diff --git a/lean/OAI/Probability/SLE/Mass/LevelRandomRadon.lean b/lean/OAI/Probability/SLE/Mass/LevelRandomRadon.lean new file mode 100644 index 0000000000000000000000000000000000000000..0127a893dddbfed864d3b8a259d45750849017f6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelRandomRadon.lean @@ -0,0 +1,107 @@ +import OAI.Probability.SLE.Mass.LevelRadonExtraction +import OAI.Probability.SLE.Mass.RandomRadonLimit +import OAI.Probability.SLE.Mass.RadonTestLimitProperties + +namespace OAI + +/-! Measurable versions and simultaneous time ordering of the actual +common Radon limits. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma halfPlaneLevelMeasure_mono + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) (u : ℝ) (ω : Ω) : + Monotone (fun t => halfPlaneLevelMeasure κ B γ G u t ω) := by + intro s t hst + apply Measure.le_iff.mpr + intro A hA + simp only [halfPlaneLevelMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet] + exact levelApproximation_mono κ B γ G u ω hst _ + +lemma convexLevelMeasure_mono + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) (u : ℕ → ℝ) + (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) (n : ℕ) (ω : Ω) : + Monotone (fun t => convexLevelMeasure κ B γ G u s w n t ω) := by + intro t₁ t₂ ht + apply Measure.le_iff.mpr + intro A hA + simp only [convexLevelMeasure,Measure.finsetSum_apply,Measure.smul_apply,smul_eq_mul] + exact Finset.sum_le_sum (fun i _ => mul_le_mul' le_rfl + (halfPlaneLevelMeasure_mono κ B γ G (u (n+i)) ω ht A)) + +lemma convexLevelMeasure_test_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (hw₀ : ∀ n i, i ∈ s n → 0 ≤ w n i) (n : ℕ) (t : ℝ≥0∞) + (f : C_c(upperHalfPlane,ℝ)) : + Measurable (fun ω => ∫ z, f z ∂convexLevelMeasure κ B γ G u s w n t ω) := by + have he (ω : Ω) := integral_convexLevelMeasure hκ hκ8 γ G F ω (hBc ω) (hw ω) + u s w n t (hw₀ n) f + simp_rw [he] + apply Finset.measurable_sum + intro i hi + exact measurable_const.mul (levelApproximationRealTest_measurable hm hBc κ (u (n+i)) + (hu (n+i)) γ G F hw t (extendHalfPlaneTest f) + (extendHalfPlaneTest_measurable f f.continuous.measurable)) + +theorem exists_measurable_level_radon_limits + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (t : ℕ → ℝ≥0∞) : + ∃ s : ℕ → Finset ℕ, ∃ w : ℕ → ℕ → ℝ, ∃ ν : ℕ → Ω → Measure upperHalfPlane, + (∀ n i, i ∈ s n → 0 ≤ w n i) ∧ (∀ n, ∑ i ∈ s n, w n i = 1) ∧ + (∀ j, Measurable (ν j)) ∧ + (∀ j ω, (ν j ω).Regular ∧ IsFiniteMeasureOnCompacts (ν j ω)) ∧ + (∀ᵐ ω ∂P, + (∀ j (f : C_c(upperHalfPlane,ℝ)), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G u s w n (t j) ω) + atTop (𝓝 (∫ z, f z ∂ν j ω))) ∧ + ∀ i j, t i ≤ t j → ν i ω ≤ ν j ω) := by + obtain ⟨s,w,hw₀,hw₁,hex⟩ := exists_common_level_radon_limits hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth u hu t + have hex' : ∀ᵐ ω ∂P, ∃ ν : ℕ → Measure upperHalfPlane, (∀ j, (ν j).Regular) ∧ + ∀ j (f : C_c(upperHalfPlane,ℝ)), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G u s w n (t j) ω) + atTop (𝓝 (∫ z, f z ∂ν j)) := by + filter_upwards [hex] with ω hω + obtain ⟨ν,hν,hlim⟩ := hω + exact ⟨ν,fun j => (hν j).1,hlim⟩ + obtain ⟨ν,hνm,hνr,hlim⟩ := exists_measurable_countable_radon_limits P + (fun n j ω => convexLevelMeasure κ B γ G u s w n (t j) ω) + (fun n j f => convexLevelMeasure_test_measurable hm hBc hκ hκ8 γ G F hw u hu s w hw₀ n (t j) f) hex' + refine ⟨s,w,ν,hw₀,hw₁,hνm,hνr,?_⟩ + filter_upwards [hlim] with ω hω + refine ⟨hω,?_⟩ + intro i j hij + let (k : ℕ) : IsFiniteMeasureOnCompacts (convexLevelMeasure κ B γ G u s w k (t i) ω) := + convexLevelMeasure_finite_on_compacts hκ hκ8 γ G F ω (hBc ω) (hw ω) u s w k (t i) + let (k : ℕ) : IsFiniteMeasureOnCompacts (convexLevelMeasure κ B γ G u s w k (t j) ω) := + convexLevelMeasure_finite_on_compacts hκ hκ8 γ G F ω (hBc ω) (hw ω) u s w k (t j) + let : (ν i ω).Regular := (hνr i ω).1 + let : (ν j ω).Regular := (hνr j ω).1 + exact radon_limits_mono _ _ (ν i ω) (ν j ω) (hω i) (hω j) + (fun k => convexLevelMeasure_mono κ B γ G u s w k ω hij) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelRemainderMeasure.lean b/lean/OAI/Probability/SLE/Mass/LevelRemainderMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..529f7d030e6e7662b0088e8e66d51f47665b634b --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelRemainderMeasure.lean @@ -0,0 +1,113 @@ +import OAI.Probability.SLE.Mass.LevelApproximationKernel +import OAI.Probability.SLE.Mass.LevelMeanMeasure + +namespace OAI + +/-! The unreached part of a finite-level approximation, as a positive +measure. The conditional Green identity holds as a measure identity. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +def halfPlaneRemainderMeasure {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (t : ℝ≥0) (ω : Ω) : Measure upperHalfPlane := + (volume.withDensity (fun z => ENNReal.ofReal (levelRemainderGreen κ B γ G u t z ω))).comap Subtype.val + +def halfPlaneCurrentMeasure {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (t : ℝ≥0) (ω : Ω) : Measure upperHalfPlane := + (volume.withDensity (fun z => ENNReal.ofReal (levelCurrentGreen κ B γ G u t z ω))).comap Subtype.val + +lemma levelDensity_split {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (t : ℝ≥0) (ω : Ω) (z : ℂ) : + levelApproximationDensity κ B γ G u ∞ ω z = + levelApproximationDensity κ B γ G u t ω z + + ENNReal.ofReal (levelRemainderGreen κ B γ G u t z ω) := by + unfold levelApproximationDensity levelRemainderGreen + by_cases h : radiusLevelTime (γ ω) (G ω) z u ≤ t + · simp only [le_top,ite_true,ite_eq_left h,ite_eq_right (not_lt.mpr h), + ENNReal.ofReal_zero,add_zero] + · simp only [le_top,ite_true,ite_eq_right h,ite_eq_left (lt_of_not_ge h),zero_add] + +lemma halfPlaneRemainderMeasure_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) : Measurable (halfPlaneRemainderMeasure κ B γ G u t) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneRemainderMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet, + withDensity_apply _ hAI] + exact (levelRemainderGreen_joint_measurable hm hBc κ u hu γ G F hw t).ennreal_ofReal.lintegral_prod_right' + +lemma halfPlaneCurrentMeasure_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) : Measurable (halfPlaneCurrentMeasure κ B γ G u t) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneCurrentMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet, + withDensity_apply _ hAI] + exact (levelCurrentGreen_joint_measurable hBm hBc κ u hu γ G F hw t).ennreal_ofReal.lintegral_prod_right' + +lemma halfPlaneLevelMeasure_split + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) (ω : Ω) : + halfPlaneLevelMeasure κ B γ G u ∞ ω = + halfPlaneLevelMeasure κ B γ G u t ω + halfPlaneRemainderMeasure κ B γ G u t ω := by + apply Measure.ext + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [Measure.add_apply,halfPlaneLevelMeasure,halfPlaneRemainderMeasure,levelApproximation, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + simp_rw [levelDensity_split κ B γ G u t ω] + exact lintegral_add_left + (levelApproximationDensity_joint_measurable hm hBc κ u hu γ G F hw t).of_uncurry_left _ + +theorem halfPlaneRemainderMeasure_conditional_mean + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0) (E : Set Ω) + (hE : MeasurableSet[Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable) t] E) : + (P.restrict E).bind (halfPlaneRemainderMeasure κ B γ G u t) = + (P.restrict E).bind (halfPlaneCurrentMeasure κ B γ G u t) := by + let hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + apply Measure.ext + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + have hAH : (Subtype.val : upperHalfPlane → ℂ) '' A ⊆ upperHalfPlane := by + rintro _ ⟨x,_,rfl⟩; exact x.property + rw [Measure.bind_apply hA (halfPlaneRemainderMeasure_measurable hm hBc κ u hu γ G F hw t).aemeasurable, + Measure.bind_apply hA (halfPlaneCurrentMeasure_measurable hBm hBc κ u hu γ G F hw t).aemeasurable] + simp only [halfPlaneRemainderMeasure,halfPlaneCurrentMeasure, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + simpa only [one_mul] using levelRemainderGreen_spatial_kernel hB hBm hBc hB0 hκ hκ8 γ G F hw + u hu t _ hAI hAH (fun _ => 1) measurable_const E hE + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelRemainderSupport.lean b/lean/OAI/Probability/SLE/Mass/LevelRemainderSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..0363df1de48d89e7a3a86410a1d13a2c7478c6a0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelRemainderSupport.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SLE.Geometry.RandomKernelSupport +import OAI.Probability.SLE.Mass.GreenMeasureSupport +import OAI.Probability.SLE.Geometry.CountableRemainderKernels + +namespace OAI + +/-! The positive remaining mass in the actual countable Radon construction +is carried by the surviving Loewner domain. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma surviving_complement_past_measurable + {Ω : Type*} [mΩ : MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) : + @MeasurableSet (Ω × upperHalfPlane) + ((Filtration.natural B (fun r => (hm r).stronglyMeasurable) t).prod inferInstance) + {p | (p.2 : ℂ) ∉ survivingDomain (γ p.1) t} := by + have hlive := (actual_spatial_past_kernels hm hBc κ γ G F hw t).2.2 + let : MeasurableSpace Ω := Filtration.natural B (fun r => (hm r).stronglyMeasurable) t + let t0 : Iic t := ⟨t,by simp only [mem_Iic]; exact le_rfl⟩ + have hmap : Measurable (fun p : Ω × upperHalfPlane => + (t0,((p.2 : ℂ),p.1))) := by + apply Measurable.prodMk + · exact measurable_const + · exact ((measurable_subtype_coe : Measurable (fun z : upperHalfPlane => (z : ℂ))).comp + measurable_snd).prodMk measurable_fst + exact (hlive.preimage hmap).compl + +theorem ae_remainder_carried_by_surviving + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) (η : Ω → Measure upperHalfPlane) (hη : Measurable η) + (hηfin : ∀ ω, IsFiniteMeasureOnCompacts (η ω)) + (hevent : ∀ E : Set Ω, + MeasurableSet[Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable) t] E → + (P.restrict E).bind η = (P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t)) : + ∀ᵐ ω ∂P, η ω {z : upperHalfPlane | (z : ℂ) ∉ survivingDomain (γ ω) t} = 0 := by + let D := localTestFamily upperHalfPlane + let ℱ := Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable) + have hmean : P.bind η = P.bind (halfPlaneGreenMeasure κ B γ G t) := by + simpa only [Measure.restrict_univ] using hevent univ MeasurableSet.univ + let : IsFiniteMeasureOnCompacts (initialGreenMeasure κ) := initialGreenMeasure_finite_on_compacts κ + refine ae_avoids_random_set_of_conditional_kernel (ℱ t) (ℱ.le t) P η + (halfPlaneGreenMeasure κ B γ G t) hη + (halfPlaneGreenMeasure_measurable hBm hBc κ γ G F hw t) + D.compactSet (fun n => (D.isCompact n).measurableSet) ?_ ?_ ?_ ?_ hevent + {p | (p.2 : ℂ) ∉ survivingDomain (γ p.1) t} ?_ ?_ + · intro z + obtain ⟨n,hn⟩ := D.exhaustive {z} isCompact_singleton + exact ⟨n,hn (mem_singleton z)⟩ + · intro n ω + let := hηfin ω + exact (D.isCompact n).measure_lt_top + · intro n + exact ae_halfPlaneGreenMeasure_compact_finite hB hBm hBc hB0 hκ hκ8 γ G F hw t + _ (D.isCompact n) + · intro n + rw [hmean] + have hb := halfPlaneGreenMeasure_mean_le hB hBm hBc hB0 hκ hκ8 γ G F hw t univ + (D.compactSet n) + rw [Measure.restrict_univ] at hb + exact lt_of_le_of_lt hb (D.isCompact n).measure_lt_top + · exact surviving_complement_past_measurable + (fun r => hBm.comp (measurable_const.prodMk measurable_id)) hBc κ γ G F hw t + · intro ω + exact halfPlaneGreenMeasure_off_surviving ω (hw ω) t + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingConvex.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingConvex.lean new file mode 100644 index 0000000000000000000000000000000000000000..33c2f9f38d23ce0dadc7bb0eb6b99db9c9e8ebcd --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingConvex.lean @@ -0,0 +1,128 @@ +import OAI.Probability.SLE.Mass.LevelStoppingTests + +namespace OAI + +/-! The actual common convex tails preserve the conditional decomposition +at every Brownian stopping time, including infinite stops. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +def convexStoppingCurrentMean {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℕ → ℝ) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) (n : ℕ) (S : Ω → ℝ≥0∞) : + Measure upperHalfPlane := + ∑ i ∈ s n, ENNReal.ofReal (w n i) • P.bind (halfPlaneStoppingCurrentMeasure κ B γ G (u (n+i)) S) + +lemma convexLevelMeasure_random_time_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (n : ℕ) (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun ω => convexLevelMeasure κ B γ G u s w n (S ω) ω) := by + apply Measure.measurable_of_measurable_coe + intro A hA + simp only [convexLevelMeasure,Measure.finsetSum_apply,Measure.smul_apply,smul_eq_mul] + apply Finset.measurable_sum + intro i _ + exact measurable_const.mul ((Measure.measurable_coe hA).comp + (halfPlaneLevelMeasure_random_time_measurable hm hc κ (u (n+i)) (hu _) γ G F hw S hS)) + +lemma convexLevelMeasure_stopping_conditional_split + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (n : ℕ) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable)) S) + (E : Set Ω) (hE : MeasurableSet[hS.measurableSpace] E) : + (P.restrict E).bind (convexLevelMeasure κ B γ G u s w n ∞) = + (P.restrict E).bind (fun ω => convexLevelMeasure κ B γ G u s w n (S ω) ω) + + convexStoppingCurrentMean (P.restrict E) κ B γ G u s w n S := by + let hm (r : ℝ≥0) : Measurable (B r) := hBm.comp (measurable_const.prodMk measurable_id) + unfold convexLevelMeasure convexStoppingCurrentMean + rw [bind_finset_smul _ _ _ (fun _ => ENNReal.ofReal_ne_top) _ + (fun i => halfPlaneLevelMeasure_measurable hm hc κ (u (n+i)) (hu _) γ G F hw ∞), + bind_finset_smul _ _ _ (fun _ => ENNReal.ofReal_ne_top) _ + (fun i => halfPlaneLevelMeasure_random_time_measurable hm hc κ (u (n+i)) (hu _) + γ G F hw S hS.measurable')] + simp_rw [halfPlaneLevelMeasure_stopping_conditional_split hB hBm hc hB0 hκ hκ8 γ G F hw + _ (hu _) S hS E hE,smul_add,Finset.sum_add_distrib] + +lemma convexStoppingCurrentMean_le + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (hw₀ : ∀ n i, i ∈ s n → 0 ≤ w n i) (hw₁ : ∀ n, ∑ i ∈ s n, w n i = 1) + (n : ℕ) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable)) S) + (E : Set Ω) : + convexStoppingCurrentMean (P.restrict E) κ B γ G u s w n S ≤ initialGreenMeasure κ := by + apply Measure.le_iff.mpr + intro A _ + simp only [convexStoppingCurrentMean,Measure.finsetSum_apply,Measure.smul_apply,smul_eq_mul] + calc + _ ≤ ∑ i ∈ s n, ENNReal.ofReal (w n i) * initialGreenMeasure κ A := + Finset.sum_le_sum (fun i _ => mul_le_mul' le_rfl + (halfPlaneStoppingCurrentMeasure_mean_le hB hBm hc hB0 hκ hκ8 γ G F hw + (u (n+i)) (hu _) S hS E A)) + _ = _ := by + rw [← Finset.sum_mul,← ENNReal.ofReal_sum_of_nonneg (hw₀ n),hw₁ n,ENNReal.ofReal_one,one_mul] + +theorem convexStoppingCurrentMean_test_tendsto + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (hmono : Monotone u) (hlim : Tendsto u atTop atTop) + (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (hw₀ : ∀ n i, i ∈ s n → 0 ≤ w n i) (hw₁ : ∀ n, ∑ i ∈ s n, w n i = 1) + (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable)) S) + (E : Set Ω) (f : C_c(upperHalfPlane,ℝ)) : + Tendsto (fun n => ∫ z, f z ∂convexStoppingCurrentMean (P.restrict E) κ B γ G u s w n S) + atTop (𝓝 (∫ z, f z ∂(P.restrict E).bind (halfPlaneStoppingGreenMeasure κ B γ G S))) := by + let ρ := initialGreenMeasure κ + let : IsFiniteMeasureOnCompacts ρ := initialGreenMeasure_finite_on_compacts κ + let μ (j : ℕ) := (P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G (u j) S) + have hμ (j : ℕ) : μ j ≤ ρ := + halfPlaneStoppingCurrentMeasure_mean_le hB hBm hc hB0 hκ hκ8 γ G F hw (u j) (hu j) S hS E + have hfi (j : ℕ) : Integrable f (μ j) := f.integrable.mono_measure (hμ j) + have he (n : ℕ) : (∫ z, f z ∂convexStoppingCurrentMean (P.restrict E) κ B γ G u s w n S) = + ∑ i ∈ s n, w n i * (∫ z, f z ∂μ (n+i)) := by + have hi (i : ℕ) : Integrable f (ENNReal.ofReal (w n i) • μ (n+i)) := + (hfi (n+i)).smul_measure ENNReal.ofReal_ne_top + change (∫ z, f z ∂∑ i ∈ s n, ENNReal.ofReal (w n i) • μ (n+i)) = _ + rw [integral_finsetSum_measure (fun i _ => hi i)] + apply Finset.sum_congr rfl + intro i his + rw [integral_smul_measure,ENNReal.toReal_ofReal (hw₀ n i his),smul_eq_mul] + simp only [he] + exact real_convex_tail_tendsto (fun j => ∫ z, f z ∂μ j) + (halfPlaneStoppingCurrentMeasure_mean_test_tendsto hB hBm hc hB0 hκ hκ8 γ G F hw + u hu hmono hlim S hS E f) s w hw₀ hw₁ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingGreenLimit.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingGreenLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..80b858519d9b489b7bb2ed50fe1c1c1e36a43e59 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingGreenLimit.lean @@ -0,0 +1,131 @@ +import OAI.Probability.SLE.Mass.LevelStoppingSpatialKernel +import OAI.Probability.SLE.Mass.LevelGreenLimit + +namespace OAI + +/-! Increasing finite radius levels recover the Green kernel killed at an +arbitrary stopping time. Its expectation is bounded by the initial Green +function, also when the stopping time may be infinite. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +def stoppingGreen {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (S : Ω → ℝ≥0∞) (z : ℂ) (ω : Ω) : ℝ := + if S ω < ∞ then greenDensity κ (fun s => Real.sqrt κ * B s ω) + (γ ω) (G ω) (S ω).toNNReal z else 0 + +lemma levelStoppingCurrentGreen_mono + {Ω : Type*} {B : ℝ≥0 → Ω → ℝ} {κ : ℝ} + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (ω : Ω) (hc : Continuous (fun s => B s ω)) + (hw : IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (S : Ω → ℝ≥0∞) {u v : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) : + levelStoppingCurrentGreen κ B γ G u S z ω ≤ levelStoppingCurrentGreen κ B γ G v S z ω := by + have hτ := radiusLevelTime_mono (hc.const_mul _) hw z hu huv + unfold levelStoppingCurrentGreen + split_ifs with h₁ h₂ + · exact le_rfl + · exact False.elim (h₂ (h₁.trans_le hτ)) + · exact greenDensity_nonneg hw κ _ z + · exact le_rfl + +lemma levelStoppingCurrentGreen_eventually_eq + {Ω : Type*} {B : ℝ≥0 → Ω → ℝ} {κ : ℝ} + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (ω : Ω) (hc : Continuous (fun s => B s ω)) + (hw : IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (S : Ω → ℝ≥0∞) (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) + (hlim : Tendsto u atTop atTop) : + ∀ᶠ n in atTop, levelStoppingCurrentGreen κ B γ G (u n) S z ω = stoppingGreen κ B γ G S z ω := by + by_cases hfin : S ω < ∞ + · have hcoe : ((S ω).toNNReal : ℝ≥0∞) = S ω := ENNReal.coe_toNNReal hfin.ne + filter_upwards [levelCurrentGreen_eventually_eq ω hc hw z (S ω).toNNReal u hu hlim] with n hn + simpa only [levelCurrentGreen,levelStoppingCurrentGreen,stoppingGreen,hcoe,ite_eq_left hfin] using hn + · have htop : S ω = ∞ := top_le_iff.mp (le_of_not_gt hfin) + filter_upwards [] with n + simp [levelStoppingCurrentGreen,stoppingGreen,htop] + +theorem levelStoppingCurrentGreen_mean_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (u : ℝ) (hu : 0 ≤ u) + (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) : + (∫⁻ ω, ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u S z ω) ∂P) ≤ + ENNReal.ofReal (initialGreen κ z) := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have he := levelStoppingRemainderGreen_setLIntegral hB hBm hc hB0 hκ hκ8 + γ G F hw z hz u hu S hS univ MeasurableSet.univ + simp only [Measure.restrict_univ] at he + rw [← he] + calc + _ ≤ ∫⁻ ω, ENNReal.ofReal (stoppedGreen κ (fun s => Real.sqrt κ * B s ω) + (γ ω) (G ω) z u) ∂P := by + apply lintegral_mono + intro ω + unfold levelStoppingRemainderGreen + dsimp only + split_ifs + · exact le_rfl + · simp only [ENNReal.ofReal_zero] + exact bot_le + _ = _ := by + obtain ⟨hi,he⟩ := finite_stopped_green_regular hB hBm hc hB0 κ hκ hκ8 γ G F + (ae_of_all _ hw) z hz u hu + rw [← ofReal_integral_eq_lintegral_ofReal hi + (ae_of_all _ (fun ω => stoppedGreen_nonneg (hw ω) κ z u)),he] + +theorem stoppingGreen_mean_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) : + (∫⁻ ω, ENNReal.ofReal (stoppingGreen κ B γ G S z ω) ∂P) ≤ + ENNReal.ofReal (initialGreen κ z) := by + have hm (n : ℕ) : Measurable (fun ω => ENNReal.ofReal + (levelStoppingCurrentGreen κ B γ G n S z ω)) := by + have hj := (levelStoppingCurrentGreen_joint_measurable hBm hc κ n (Nat.cast_nonneg n) + γ G F hw S hS.measurable').ennreal_ofReal + have hh := hj.comp (measurable_id.prodMk (measurable_const (a := z))) + simpa only [Function.comp_def,id_eq] using hh + have hmono : ∀ᵐ ω ∂P, Monotone (fun n : ℕ => ENNReal.ofReal + (levelStoppingCurrentGreen κ B γ G n S z ω)) := by + filter_upwards [] with ω + intro n k hnk + exact ENNReal.ofReal_le_ofReal (levelStoppingCurrentGreen_mono ω (hc ω) (hw ω) + z S (Nat.cast_nonneg n) (Nat.cast_le.mpr hnk)) + have hlim : ∀ᵐ ω ∂P, Tendsto (fun n : ℕ => ENNReal.ofReal + (levelStoppingCurrentGreen κ B γ G n S z ω)) atTop + (𝓝 (ENNReal.ofReal (stoppingGreen κ B γ G S z ω))) := by + filter_upwards [] with ω + apply tendsto_const_nhds.congr' + exact (levelStoppingCurrentGreen_eventually_eq ω (hc ω) (hw ω) z S + (fun n : ℕ => (n:ℝ)) (fun n => Nat.cast_nonneg n) tendsto_natCast_atTop_atTop).mono + (fun _ he => congrArg ENNReal.ofReal he.symm) + exact le_of_tendsto (lintegral_tendsto_of_tendsto_of_monotone + (fun n => (hm n).aemeasurable) hmono hlim) + (Eventually.of_forall (fun n => levelStoppingCurrentGreen_mean_le hB hBm hc hB0 hκ hκ8 + γ G F hw z hz n (Nat.cast_nonneg n) S hS)) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingKernel.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..a534ea323f712b90499add3a80abbea82b91d88b --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingKernel.lean @@ -0,0 +1,230 @@ +import OAI.Probability.SLE.Mass.LevelApproximationKernel +import OAI.Probability.SLE.Loewner.ActualRadiusStopsRegular +import OAI.Probability.SLE.Gauge.ExtendedExperimentStop + +namespace OAI + +/-! The finite-level remaining Green kernel at any Brownian stopping +time. Both sides vanish at an infinite stopping time. Finite cutoffs use +the existing optional identity for the stopped Green martingale. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +def levelStoppingRemainderGreen {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (S : Ω → ℝ≥0∞) (z : ℂ) (ω : Ω) : ℝ := + if S ω < radiusLevelTime (γ ω) (G ω) z u then + stoppedGreen κ (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) z u else 0 + +def levelStoppingCurrentGreen {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (S : Ω → ℝ≥0∞) (z : ℂ) (ω : Ω) : ℝ := + if S ω < radiusLevelTime (γ ω) (G ω) z u then + greenDensity κ (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (S ω).toNNReal z else 0 + +lemma levelStoppingRemainderGreen_nonneg + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (S : Ω → ℝ≥0∞) (z : ℂ) (ω : Ω) : + 0 ≤ levelStoppingRemainderGreen κ B γ G u S z ω := by + unfold levelStoppingRemainderGreen + split_ifs + · exact stoppedGreen_nonneg (hw ω) κ z u + · exact le_rfl + +lemma levelStoppingCurrentGreen_nonneg + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (S : Ω → ℝ≥0∞) (z : ℂ) (ω : Ω) : + 0 ≤ levelStoppingCurrentGreen κ B γ G u S z ω := by + unfold levelStoppingCurrentGreen + split_ifs + · exact greenDensity_nonneg (hw ω) κ _ z + · exact le_rfl + +theorem levelStoppingRemainderGreen_finite_condExp + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (u : ℝ) (hu : 0 ≤ u) + (σ : Ω → ℝ≥0) + (hσ : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) + (fun ω => (σ ω : WithTop ℝ≥0))) : + Integrable (levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z) P ∧ + Integrable (levelStoppingCurrentGreen κ B γ G u (fun ω => σ ω) z) P ∧ + P[levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z | hσ.measurableSpace] =ᵐ[P] + levelStoppingCurrentGreen κ B γ G u (fun ω => σ ω) z := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + let hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + obtain ⟨M,Z,_,hZi,_,_,_,hStop,heq,_⟩ := exists_physical_green_stopping_regular + hB hBm hc hB0 κ hκ hκ8 γ G F (ae_of_all _ hw) z hz u hu + have hτ := actual_radiusLevelTime_stopping hB hm hBm hc hB0 κ hκ hκ8 γ G F hw z hz u hu + let A : Set Ω := {ω | (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u} + have hA : MeasurableSet[hσ.measurableSpace] A := by + have he : A = {ω | radiusLevelTime (γ ω) (G ω) z u ≤ (σ ω : WithTop ℝ≥0)}ᶜ := by + ext ω + change (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u ↔ + ¬ radiusLevelTime (γ ω) (G ω) z u ≤ (σ ω : ℝ≥0∞) + exact lt_iff_not_ge + rw [he] + exact (hτ.measurableSet_stopping_time_le hσ).compl + have hAg : MeasurableSet A := hσ.measurableSpace_le _ hA + have hR : levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z =ᵐ[P] A.indicator Z := by + filter_upwards [heq] with ω he + by_cases ha : ω ∈ A + · have ht : (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u := ha + rw [levelStoppingRemainderGreen,ite_eq_left ht,indicator_of_mem ha,he.2] + · have ht : ¬ (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u := ha + rw [levelStoppingRemainderGreen,ite_eq_right ht,indicator_of_notMem ha] + have hC : levelStoppingCurrentGreen κ B γ G u (fun ω => σ ω) z =ᵐ[P] + A.indicator (fun ω => M (σ ω) ω) := by + filter_upwards [heq] with ω he + by_cases ha : ω ∈ A + · have ht : (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u := ha + rw [levelStoppingCurrentGreen,ite_eq_left ht,indicator_of_mem ha,ENNReal.toNNReal_coe, + he.1 (σ ω),physicalStoppedGreen,ite_eq_right (not_le.mpr ht)] + · have ht : ¬ (σ ω : ℝ≥0∞) < radiusLevelTime (γ ω) (G ω) z u := ha + rw [levelStoppingCurrentGreen,ite_eq_right ht,indicator_of_notMem ha] + have hMi : Integrable (fun ω => M (σ ω) ω) P := + integrable_condExp.congr (hStop σ hσ).symm + refine ⟨(hZi.indicator hAg).congr hR.symm,(hMi.indicator hAg).congr hC.symm,?_⟩ + apply (condExp_congr_ae hR).trans + apply (condExp_indicator hZi hA).trans + apply EventuallyEq.trans _ hC.symm + filter_upwards [hStop σ hσ] with ω he + by_cases ha : ω ∈ A + · simpa only [indicator_of_mem ha] using he.symm + · simp only [indicator_of_notMem ha] + +theorem levelStoppingRemainderGreen_finite_setLIntegral + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (u : ℝ) (hu : 0 ≤ u) + (σ : Ω → ℝ≥0) + (hσ : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) + (fun ω => (σ ω : WithTop ℝ≥0))) + (A : Set Ω) (hA : MeasurableSet[hσ.measurableSpace] A) : + (∫⁻ ω in A, ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z ω) ∂P) = + ∫⁻ ω in A, ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u (fun ω => σ ω) z ω) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + obtain ⟨hR,hC,he⟩ := levelStoppingRemainderGreen_finite_condExp hB hBm hc hB0 hκ hκ8 + γ G F hw z hz u hu σ hσ + have hRn : ∀ᵐ ω ∂P.restrict A, 0 ≤ levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z ω := + ae_of_all _ (levelStoppingRemainderGreen_nonneg κ B γ G F hw u _ z) + have hCn : ∀ᵐ ω ∂P.restrict A, 0 ≤ levelStoppingCurrentGreen κ B γ G u (fun ω => σ ω) z ω := + ae_of_all _ (levelStoppingCurrentGreen_nonneg κ B γ G F hw u _ z) + rw [← ofReal_integral_eq_lintegral_ofReal hR.integrableOn hRn, + ← ofReal_integral_eq_lintegral_ofReal hC.integrableOn hCn] + congr 1 + have : IsFiniteMeasure (P.trim hσ.measurableSpace_le) := isFiniteMeasure_trim hσ.measurableSpace_le + exact (setIntegral_condExp hσ.measurableSpace_le hR hA).symm.trans + (integral_congr_ae (ae_restrict_of_ae he)) + +private lemma stopped_setLIntegral_cutoffs + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (S : Ω → ℝ≥0∞) (hS : Measurable S) (E : Set Ω) (f : Ω → ℝ≥0∞) + (hz : ∀ ω, S ω = ∞ → f ω = 0) : + (∫⁻ ω in E, f ω ∂P) = + ⨆ n : ℕ, ∫⁻ ω in E ∩ {ω | S ω ≤ (n:ℝ≥0)}, f ω ∂P := by + let A (n : ℕ) := E ∩ {ω | S ω ≤ (n:ℝ≥0)} + have hmono : Monotone A := by + intro n k hnk ω hω + refine ⟨hω.1,?_⟩ + change S ω ≤ ((k:ℝ≥0):ℝ≥0∞) + exact hω.2.trans (ENNReal.coe_le_coe.mpr (by exact_mod_cast hnk)) + have hcover : (⋃ n, A n) = E ∩ {ω | S ω < ∞} := by + ext ω + simp only [mem_iUnion,A,mem_inter_iff,mem_ofPred_eq] + constructor + · rintro ⟨n,hnE,hn⟩ + exact ⟨hnE,hn.trans_lt ENNReal.coe_lt_top⟩ + · rintro ⟨hE,hfin⟩ + obtain ⟨n,hn⟩ := exists_nat_ge ((S ω).toReal) + refine ⟨n,hE,?_⟩ + exact (ENNReal.toReal_le_toReal hfin.ne ENNReal.coe_ne_top).mp (by simpa using hn) + have hsupp : f.support ⊆ {ω | S ω < ∞} := by + intro ω hω + by_contra hn + exact hω (hz ω (top_le_iff.mp (le_of_not_gt hn))) + calc + (∫⁻ ω in E, f ω ∂P) = ∫⁻ ω in {ω | S ω < ∞}, f ω ∂P.restrict E := + (setLIntegral_eq_of_support_subset hsupp).symm + _ = ∫⁻ ω in E ∩ {ω | S ω < ∞}, f ω ∂P := by + rw [Measure.restrict_restrict (measurableSet_lt hS measurable_const),inter_comm] + _ = ∫⁻ ω in ⋃ n, A n, f ω ∂P := by rw [hcover] + _ = _ := setLIntegral_iUnion_of_directed f hmono.directed_le + +theorem levelStoppingRemainderGreen_setLIntegral + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (u : ℝ) (hu : 0 ≤ u) + (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) (hE : MeasurableSet[hS.measurableSpace] E) : + (∫⁻ ω in E, ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u S z ω) ∂P) = + ∫⁻ ω in E, ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u S z ω) ∂P := by + classical + let ℱ := Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable) + have hRzero (ω : Ω) (hω : S ω = ∞) : + ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u S z ω) = 0 := by + simp [levelStoppingRemainderGreen,hω] + have hCzero (ω : Ω) (hω : S ω = ∞) : + ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u S z ω) = 0 := by + simp [levelStoppingCurrentGreen,hω] + rw [stopped_setLIntegral_cutoffs P S hS.measurable' E _ hRzero, + stopped_setLIntegral_cutoffs P S hS.measurable' E _ hCzero] + apply iSup_congr + intro n + let σ := cutoffStop S (n:ℝ≥0) + have hσ := cutoffStop_stopping ℱ S hS (n:ℝ≥0) + have hlocal := levelStoppingRemainderGreen_finite_setLIntegral hB hBm hc hB0 hκ hκ8 + γ G F hw z hz u hu σ hσ (E ∩ {ω | S ω ≤ (n:ℝ≥0)}) + (cutoffStop_success_measurable ℱ S hS (n:ℝ≥0) E hE) + have he (ω : Ω) (hω : ω ∈ E ∩ {ω | S ω ≤ (n:ℝ≥0)}) : (σ ω : ℝ≥0∞) = S ω := by + change (cutoffStop S (n:ℝ≥0) ω : WithTop ℝ≥0) = S ω + rw [cutoffStop_coe,min_eq_left hω.2] + calc + _ = ∫⁻ ω in E ∩ {ω | S ω ≤ (n:ℝ≥0)}, + ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u (fun ω => σ ω) z ω) ∂P := by + apply setLIntegral_congr_fun (hS.measurableSpace_le _ + (hE.inter (hS.measurableSet_le' (n:ℝ≥0)))) + intro ω hω + simp only [levelStoppingRemainderGreen,he ω hω] + split_ifs <;> rfl + _ = _ := hlocal + _ = _ := by + apply setLIntegral_congr_fun (hS.measurableSpace_le _ + (hE.inter (hS.measurableSet_le' (n:ℝ≥0)))) + intro ω hω + simp only [levelStoppingCurrentGreen,he ω hω] + split_ifs <;> rfl + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingMeasures.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingMeasures.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff84368f19a408293d727d3abe3a94e8699dd7d4 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingMeasures.lean @@ -0,0 +1,280 @@ +import OAI.Probability.SLE.Mass.LevelStoppingGreenLimit +import OAI.Probability.SLE.Mass.LevelMeanMeasure + +namespace OAI + +/-! The unreached part of a finite-level approximation at an arbitrary +stopping time, as a positive measure. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.Multipoint + +lemma levelApproximationDensity_random_time_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun p : Ω × ℂ => levelApproximationDensity κ B γ G u (S p.1) p.1 p.2) := + Measurable.ite (measurableSet_le + (actual_radiusLevel_joint_measurable hm hc κ u hu γ G F hw) (hS.comp measurable_fst)) + (actual_stoppedGreen_joint_measurable hm hc κ u hu γ G F hw).ennreal_ofReal measurable_const + +lemma halfPlaneLevelMeasure_random_time_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun ω => halfPlaneLevelMeasure κ B γ G u (S ω) ω) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneLevelMeasure,levelApproximation, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + exact (levelApproximationDensity_random_time_joint_measurable hm hc κ u hu γ G F hw S hS).lintegral_prod_right' + +def halfPlaneStoppingRemainderMeasure {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (S : Ω → ℝ≥0∞) (ω : Ω) : Measure upperHalfPlane := + (volume.withDensity (fun z => ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u S z ω))).comap Subtype.val + +def halfPlaneStoppingCurrentMeasure {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (S : Ω → ℝ≥0∞) (ω : Ω) : Measure upperHalfPlane := + (volume.withDensity (fun z => ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u S z ω))).comap Subtype.val + +def halfPlaneStoppingGreenMeasure {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (S : Ω → ℝ≥0∞) (ω : Ω) : Measure upperHalfPlane := + (volume.withDensity (fun z => ENNReal.ofReal (stoppingGreen κ B γ G S z ω))).comap Subtype.val + +lemma stoppingGreen_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun p : Ω × ℂ => stoppingGreen κ B γ G S p.2 p.1) := + Measurable.ite (measurableSet_lt (hS.comp measurable_fst) measurable_const) + (actual_greenDensity_random_time_joint_measurable hBm hc κ γ G F hw + (fun ω => (S ω).toNNReal) (ENNReal.measurable_toNNReal.comp hS)) measurable_const + +lemma halfPlaneStoppingGreenMeasure_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (halfPlaneStoppingGreenMeasure κ B γ G S) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneStoppingGreenMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet, + withDensity_apply _ hAI] + exact (stoppingGreen_joint_measurable hBm hc κ γ G F hw S hS).ennreal_ofReal.lintegral_prod_right' + +lemma halfPlaneStoppingRemainderMeasure_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : Measurable (halfPlaneStoppingRemainderMeasure κ B γ G u S) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneStoppingRemainderMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet, + withDensity_apply _ hAI] + exact (levelStoppingRemainderGreen_joint_measurable hm hBc κ u hu γ G F hw S hS).ennreal_ofReal.lintegral_prod_right' + +lemma halfPlaneStoppingCurrentMeasure_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : Measurable (halfPlaneStoppingCurrentMeasure κ B γ G u S) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneStoppingCurrentMeasure,comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet, + withDensity_apply _ hAI] + exact (levelStoppingCurrentGreen_joint_measurable hBm hBc κ u hu γ G F hw S hS).ennreal_ofReal.lintegral_prod_right' + +lemma halfPlaneLevelMeasure_stopping_split + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) (ω : Ω) : + halfPlaneLevelMeasure κ B γ G u ∞ ω = + halfPlaneLevelMeasure κ B γ G u (S ω) ω + halfPlaneStoppingRemainderMeasure κ B γ G u S ω := by + apply Measure.ext + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [Measure.add_apply,halfPlaneLevelMeasure,halfPlaneStoppingRemainderMeasure,levelApproximation, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + simp_rw [stopping_level_density_split κ B γ G u S ω] + have hd : Measurable (fun z => levelApproximationDensity κ B γ G u (S ω) ω z) := by + have hp : Measurable (fun z : ℂ => (ω,z)) := measurable_const.prodMk measurable_id + have hh := (levelApproximationDensity_random_time_joint_measurable hm hBc κ u hu + γ G F hw S hS).comp hp + simpa only [Function.comp_def] using hh + exact lintegral_add_left hd _ + +theorem halfPlaneStoppingRemainderMeasure_conditional_mean + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (hu : 0 ≤ u) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) + (hE : MeasurableSet[hS.measurableSpace] E) : + (P.restrict E).bind (halfPlaneStoppingRemainderMeasure κ B γ G u S) = + (P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G u S) := by + let hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + apply Measure.ext + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + have hAH : (Subtype.val : upperHalfPlane → ℂ) '' A ⊆ upperHalfPlane := by + rintro _ ⟨x,_,rfl⟩; exact x.property + rw [Measure.bind_apply hA (halfPlaneStoppingRemainderMeasure_measurable hm hBc κ u hu γ G F hw S hS.measurable').aemeasurable, + Measure.bind_apply hA (halfPlaneStoppingCurrentMeasure_measurable hBm hBc κ u hu γ G F hw S hS.measurable').aemeasurable] + simp only [halfPlaneStoppingRemainderMeasure,halfPlaneStoppingCurrentMeasure, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + simpa only [one_mul] using levelStoppingRemainderGreen_spatial_kernel hB hBm hBc hB0 hκ hκ8 γ G F hw + u hu S hS _ hAI hAH (fun _ => 1) measurable_const E hE + +theorem halfPlaneLevelMeasure_stopping_conditional_split + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (hu : 0 ≤ u) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) (hE : MeasurableSet[hS.measurableSpace] E) : + (P.restrict E).bind (halfPlaneLevelMeasure κ B γ G u ∞) = + (P.restrict E).bind (fun ω => halfPlaneLevelMeasure κ B γ G u (S ω) ω) + + (P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G u S) := by + let hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + rw [← halfPlaneStoppingRemainderMeasure_conditional_mean hB hBm hc hB0 hκ hκ8 + γ G F hw u hu S hS E hE] + apply Measure.ext + intro A hA + rw [Measure.add_apply, + Measure.bind_apply hA (halfPlaneLevelMeasure_measurable hm hc κ u hu γ G F hw ∞).aemeasurable, + Measure.bind_apply hA (halfPlaneLevelMeasure_random_time_measurable hm hc κ u hu + γ G F hw S hS.measurable').aemeasurable, + Measure.bind_apply hA (halfPlaneStoppingRemainderMeasure_measurable hm hc κ u hu + γ G F hw S hS.measurable').aemeasurable] + simp_rw [halfPlaneLevelMeasure_stopping_split hm hc κ u hu γ G F hw S hS.measurable',Measure.add_apply] + exact lintegral_add_left (((Measure.measurable_coe hA).comp + (halfPlaneLevelMeasure_random_time_measurable hm hc κ u hu γ G F hw S hS.measurable'))) _ + +theorem halfPlaneStoppingGreenMeasure_mean_le + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) : + (P.restrict E).bind (halfPlaneStoppingGreenMeasure κ B γ G S) ≤ initialGreenMeasure κ := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + apply Measure.le_iff.mpr + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + have hAH : (Subtype.val : upperHalfPlane → ℂ) '' A ⊆ upperHalfPlane := by + rintro _ ⟨x,_,rfl⟩ + exact x.property + rw [Measure.bind_apply hA + (halfPlaneStoppingGreenMeasure_measurable hBm hc κ γ G F hw S hS.measurable').aemeasurable] + simp only [halfPlaneStoppingGreenMeasure,initialGreenMeasure, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + apply (lintegral_mono' Measure.restrict_le_self (le_refl _)).trans + rw [lintegral_lintegral_swap + (stoppingGreen_joint_measurable hBm hc κ γ G F hw S hS.measurable').ennreal_ofReal.aemeasurable] + exact setLIntegral_mono' hAI (fun z hz => + stoppingGreen_mean_le hB hBm hc hB0 hκ hκ8 γ G F hw z (hAH hz) S hS) + +theorem stoppingCurrentGreen_spatial_mean_tendsto + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + {B : ℝ≥0 → Ω → ℝ} (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ : ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (hmono : Monotone u) + (hlim : Tendsto u atTop atTop) (S : Ω → ℝ≥0∞) (hS : Measurable S) (K : Set ℂ) + (f : ℂ → ℝ≥0∞) (hf : Measurable f) (E : Set Ω) : + Tendsto (fun n => ∫⁻ ω in E, (∫⁻ z in K, + f z * ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G (u n) S z ω) ∂volume) ∂P) + atTop (𝓝 (∫⁻ ω in E, (∫⁻ z in K, f z * ENNReal.ofReal + (stoppingGreen κ B γ G S z ω) ∂volume) ∂P)) := by + let a (n : ℕ) (q : Ω × ℂ) := + f q.2 * ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G (u n) S q.2 q.1) + have ha (n : ℕ) : Measurable (a n) := + (hf.comp measurable_snd).mul + (levelStoppingCurrentGreen_joint_measurable hBm hBc κ (u n) (hu n) γ G F hw S hS).ennreal_ofReal + have ham (ω : Ω) : Monotone (fun n => fun z => a n (ω,z)) := by + intro n m hnm z + exact mul_le_mul' le_rfl (ENNReal.ofReal_le_ofReal + (levelStoppingCurrentGreen_mono ω (hBc ω) (hw ω) z S (hu n) (hmono hnm))) + have hal (ω : Ω) : Tendsto (fun n => ∫⁻ z in K, a n (ω,z)) atTop + (𝓝 (∫⁻ z in K, f z * ENNReal.ofReal + (stoppingGreen κ B γ G S z ω))) := by + apply lintegral_tendsto_of_tendsto_of_monotone (μ := volume.restrict K) + (f := fun n z => a n (ω,z)) + (fun n => ((ha n).comp (measurable_const.prodMk measurable_id)).aemeasurable) + (Eventually.of_forall (fun z n m hnm => ham ω hnm z)) + filter_upwards [] with z + apply tendsto_const_nhds.congr' + exact (levelStoppingCurrentGreen_eventually_eq ω (hBc ω) (hw ω) z S u hu hlim).mono + (fun n hn => congrArg (fun x : ℝ => f z * ENNReal.ofReal x) hn.symm) + exact lintegral_tendsto_of_tendsto_of_monotone + (fun n => (ha n).lintegral_prod_right'.aemeasurable) + (Eventually.of_forall (fun ω n m hnm => lintegral_mono (ham ω hnm))) + (Eventually.of_forall hal) + +theorem halfPlaneStoppingCurrentMeasure_mean_tendsto + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + {B : ℝ≥0 → Ω → ℝ} (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ : ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (hmono : Monotone u) + (hlim : Tendsto u atTop atTop) (S : Ω → ℝ≥0∞) (hS : Measurable S) (E : Set Ω) + (A : Set upperHalfPlane) (hA : MeasurableSet A) : + Tendsto (fun n => (P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G (u n) S) A) + atTop (𝓝 ((P.restrict E).bind (halfPlaneStoppingGreenMeasure κ B γ G S) A)) := by + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [Measure.bind_apply hA + (halfPlaneStoppingCurrentMeasure_measurable hBm hBc κ (u _) (hu _) γ G F hw S hS).aemeasurable, + Measure.bind_apply hA (halfPlaneStoppingGreenMeasure_measurable hBm hBc κ γ G F hw S hS).aemeasurable, + halfPlaneStoppingCurrentMeasure,halfPlaneStoppingGreenMeasure, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + simpa only [one_mul] using stoppingCurrentGreen_spatial_mean_tendsto P hBm hBc κ γ G F hw + u hu hmono hlim S hS _ (fun _ => 1) measurable_const E + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingSpatialKernel.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingSpatialKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f9f1abfb8d8d28790d962d483748a1038fd7e56 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingSpatialKernel.lean @@ -0,0 +1,114 @@ +import OAI.Probability.SLE.Mass.LevelStoppingKernel + +namespace OAI + +/-! Joint spatial measurability and the spatial form of the finite-level +conditional kernel at an arbitrary, possibly infinite, stopping time. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +lemma actual_greenDensity_random_time_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (t : Ω → ℝ≥0) (ht : Measurable t) : + Measurable (fun p : Ω × ℂ => greenDensity κ + (fun s => Real.sqrt κ * B s p.1) (γ p.1) (G p.1) (t p.1) p.2) := by + let U (s : ℝ≥0) (ω : Ω) := Real.sqrt κ * B s ω + let c := spatialClippedFamily U (hBm.const_mul _) (fun ω => (hc ω).const_mul _) + have hmap : Measurable (fun p : Ω × ℂ => (t p.1,p.2,p.1)) := + (ht.comp measurable_fst).prodMk (measurable_snd.prodMk measurable_fst) + have hj := (c.jointGreen_measurable κ B hBm).comp hmap + have he (p : Ω × ℂ) : c.jointGreen κ B (t p.1,p.2,p.1) = + greenDensity κ (fun s => Real.sqrt κ * B s p.1) (γ p.1) (G p.1) (t p.1) p.2 := + c.jointGreen_eq κ B p.1 ((hc p.1).const_mul _) (fun _ => rfl) (hw p.1) _ _ + simpa only [Function.comp_def,he] using hj + +lemma levelStoppingRemainderGreen_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun p : Ω × ℂ => levelStoppingRemainderGreen κ B γ G u S p.2 p.1) := + Measurable.ite + (measurableSet_lt (hS.comp measurable_fst) + (actual_radiusLevel_joint_measurable hm hc κ u hu γ G F hw)) + (actual_stoppedGreen_joint_measurable hm hc κ u hu γ G F hw) measurable_const + +lemma levelStoppingCurrentGreen_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hBm : Measurable (Function.uncurry B)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun p : Ω × ℂ => levelStoppingCurrentGreen κ B γ G u S p.2 p.1) := by + let hm (t : ℝ≥0) : Measurable (B t) := hBm.comp (measurable_const.prodMk measurable_id) + exact Measurable.ite + (measurableSet_lt (hS.comp measurable_fst) + (actual_radiusLevel_joint_measurable hm hc κ u hu γ G F hw)) + (actual_greenDensity_random_time_joint_measurable hBm hc κ γ G F hw + (fun ω => (S ω).toNNReal) (ENNReal.measurable_toNNReal.comp hS)) measurable_const + +theorem levelStoppingRemainderGreen_spatial_kernel + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (hu : 0 ≤ u) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (K : Set ℂ) (hK : MeasurableSet K) (hKH : K ⊆ upperHalfPlane) + (f : ℂ → ℝ≥0∞) (hf : Measurable f) (E : Set Ω) + (hE : MeasurableSet[hS.measurableSpace] E) : + (∫⁻ ω in E, (∫⁻ z in K, f z * ENNReal.ofReal + (levelStoppingRemainderGreen κ B γ G u S z ω) ∂volume) ∂P) = + ∫⁻ ω in E, (∫⁻ z in K, f z * ENNReal.ofReal + (levelStoppingCurrentGreen κ B γ G u S z ω) ∂volume) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + let hm (t : ℝ≥0) : Measurable (B t) := hBm.comp (measurable_const.prodMk measurable_id) + have hmR := levelStoppingRemainderGreen_joint_measurable hm hc κ u hu γ G F hw S hS.measurable' + have hmC := levelStoppingCurrentGreen_joint_measurable hBm hc κ u hu γ G F hw S hS.measurable' + have hR := (hf.comp measurable_snd).mul hmR.ennreal_ofReal + have hC := (hf.comp measurable_snd).mul hmC.ennreal_ofReal + conv_lhs => rw [lintegral_lintegral_swap hR.aemeasurable] + conv_rhs => rw [lintegral_lintegral_swap hC.aemeasurable] + apply setLIntegral_congr_fun hK + intro z hz + dsimp only + have hp : Measurable (fun ω : Ω => (ω,z)) := measurable_id.prodMk measurable_const + have hRz := hmR.ennreal_ofReal.comp hp + have hCz := hmC.ennreal_ofReal.comp hp + simp only [Function.comp_def] at hRz hCz + rw [lintegral_const_mul _ hRz,lintegral_const_mul _ hCz] + rw [levelStoppingRemainderGreen_setLIntegral hB hBm hc hB0 hκ hκ8 + γ G F hw z (hKH hz) u hu S hS E hE] + +lemma stopping_level_density_split + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (S : Ω → ℝ≥0∞) (ω : Ω) (z : ℂ) : + levelApproximationDensity κ B γ G u ∞ ω z = + levelApproximationDensity κ B γ G u (S ω) ω z + + ENNReal.ofReal (levelStoppingRemainderGreen κ B γ G u S z ω) := by + by_cases h : radiusLevelTime (γ ω) (G ω) z u ≤ S ω + · simp only [levelApproximationDensity,le_top,ite_true,ite_eq_left h, + levelStoppingRemainderGreen,ite_eq_right (not_lt.mpr h),ENNReal.ofReal_zero,add_zero] + · simp only [levelApproximationDensity,le_top,ite_true,ite_eq_right h, + levelStoppingRemainderGreen,ite_eq_left (lt_of_not_ge h),zero_add] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LevelStoppingTests.lean b/lean/OAI/Probability/SLE/Mass/LevelStoppingTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..40bdda8e95e6eb80f660a317e7b981998b364716 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LevelStoppingTests.lean @@ -0,0 +1,146 @@ +import OAI.Probability.SLE.Mass.LevelStoppingMeasures +import OAI.Probability.SLE.Mass.LevelCurrentTests +import OAI.Probability.SLE.Mass.LevelConditionalMean + +namespace OAI + +/-! Signed compact-test convergence for the Green remainder at arbitrary +stopping times, and its preservation by the chosen convex tails. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma levelStoppingCurrentGreen_le_green + {Ω : Type*} {B : ℝ≥0 → Ω → ℝ} {κ : ℝ} + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (ω : Ω) (hw : IsCapacityTwoWitness + (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (S : Ω → ℝ≥0∞) (z : ℂ) : + levelStoppingCurrentGreen κ B γ G u S z ω ≤ stoppingGreen κ B γ G S z ω := by + by_cases hfin : S ω < ∞ + · unfold levelStoppingCurrentGreen stoppingGreen + rw [ite_eq_left hfin] + split_ifs + · exact le_rfl + · exact greenDensity_nonneg hw κ _ z + · have hnot : ¬ S ω < radiusLevelTime (γ ω) (G ω) z u := + fun h => hfin (h.trans_le le_top) + simp only [levelStoppingCurrentGreen,stoppingGreen,ite_eq_right hfin,ite_eq_right hnot] + exact le_rfl + +lemma halfPlaneStoppingCurrentMeasure_le_green + {Ω : Type*} {B : ℝ≥0 → Ω → ℝ} {κ : ℝ} + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (ω : Ω) (hw : IsCapacityTwoWitness + (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (S : Ω → ℝ≥0∞) : + halfPlaneStoppingCurrentMeasure κ B γ G u S ω ≤ halfPlaneStoppingGreenMeasure κ B γ G S ω := by + apply Measure.le_iff.mpr + intro A hA + have hAI := (MeasurableEmbedding.subtype_coe isOpen_upperHalfPlane.measurableSet).measurableSet_image.mpr hA + simp only [halfPlaneStoppingCurrentMeasure,halfPlaneStoppingGreenMeasure, + comap_subtype_coe_apply isOpen_upperHalfPlane.measurableSet,withDensity_apply _ hAI] + exact lintegral_mono (fun z => ENNReal.ofReal_le_ofReal (levelStoppingCurrentGreen_le_green ω hw u S z)) + +lemma halfPlaneStoppingCurrentMeasure_mean_lintegral_test + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + {B : ℝ≥0 → Ω → ℝ} (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) (f : upperHalfPlane → ℝ) (hf : Measurable f) : + (∫⁻ z, ENNReal.ofReal (f z) ∂P.bind (halfPlaneStoppingCurrentMeasure κ B γ G u S)) = + ∫⁻ ω, (∫⁻ z, ENNReal.ofReal (extendHalfPlaneTest f z) * + ENNReal.ofReal (levelStoppingCurrentGreen κ B γ G u S z ω) ∂volume) ∂P := + lintegral_density_kernel_test P _ + (halfPlaneStoppingCurrentMeasure_measurable hBm hBc κ u hu γ G F hw S hS) _ + (levelStoppingCurrentGreen_joint_measurable hBm hBc κ u hu γ G F hw S hS).ennreal_ofReal + (fun _ => rfl) f hf + +lemma halfPlaneStoppingGreenMeasure_mean_lintegral_test + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + {B : ℝ≥0 → Ω → ℝ} (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ : ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (S : Ω → ℝ≥0∞) (hS : Measurable S) (f : upperHalfPlane → ℝ) (hf : Measurable f) : + (∫⁻ z, ENNReal.ofReal (f z) ∂P.bind (halfPlaneStoppingGreenMeasure κ B γ G S)) = + ∫⁻ ω, (∫⁻ z, ENNReal.ofReal (extendHalfPlaneTest f z) * ENNReal.ofReal + (stoppingGreen κ B γ G S z ω) ∂volume) ∂P := + lintegral_density_kernel_test P _ (halfPlaneStoppingGreenMeasure_measurable hBm hBc κ γ G F hw S hS) _ + (stoppingGreen_joint_measurable hBm hBc κ γ G F hw S hS).ennreal_ofReal + (fun _ => rfl) f hf + +lemma halfPlaneStoppingCurrentMeasure_mean_lintegral_test_tendsto + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + {B : ℝ≥0 → Ω → ℝ} (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ : ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (hmono : Monotone u) + (hlim : Tendsto u atTop atTop) (S : Ω → ℝ≥0∞) (hS : Measurable S) (E : Set Ω) + (f : upperHalfPlane → ℝ) (hf : Measurable f) : + Tendsto (fun n => ∫⁻ z, ENNReal.ofReal (f z) + ∂(P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G (u n) S)) atTop + (𝓝 (∫⁻ z, ENNReal.ofReal (f z) ∂(P.restrict E).bind (halfPlaneStoppingGreenMeasure κ B γ G S))) := by + simp_rw [halfPlaneStoppingCurrentMeasure_mean_lintegral_test _ hBm hBc κ _ (hu _) γ G F hw S hS f hf, + halfPlaneStoppingGreenMeasure_mean_lintegral_test _ hBm hBc κ γ G F hw S hS f hf] + simpa only [Measure.restrict_univ] using stoppingCurrentGreen_spatial_mean_tendsto P hBm hBc κ γ G F hw + u hu hmono hlim S hS univ (fun z => ENNReal.ofReal (extendHalfPlaneTest f z)) + (extendHalfPlaneTest_measurable f hf).ennreal_ofReal E + +lemma halfPlaneStoppingCurrentMeasure_mean_le + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℝ) (hu : 0 ≤ u) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) : + (P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G u S) ≤ initialGreenMeasure κ := by + apply le_trans ?_ (halfPlaneStoppingGreenMeasure_mean_le hB hBm hBc hB0 hκ hκ8 γ G F hw S hS E) + apply Measure.le_iff.mpr + intro A hA + rw [Measure.bind_apply hA (halfPlaneStoppingCurrentMeasure_measurable hBm hBc κ u hu γ G F hw S hS.measurable').aemeasurable, + Measure.bind_apply hA (halfPlaneStoppingGreenMeasure_measurable hBm hBc κ γ G F hw S hS.measurable').aemeasurable] + exact lintegral_mono (fun ω => halfPlaneStoppingCurrentMeasure_le_green ω (hw ω) u S A) + +theorem halfPlaneStoppingCurrentMeasure_mean_test_tendsto + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (hB0 : ∀ ω, B 0 ω = 0) {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (hmono : Monotone u) + (hlim : Tendsto u atTop atTop) (S : Ω → WithTop ℝ≥0) + (hS : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) S) + (E : Set Ω) + (f : C_c(upperHalfPlane,ℝ)) : + Tendsto (fun n => ∫ z, f z ∂(P.restrict E).bind (halfPlaneStoppingCurrentMeasure κ B γ G (u n) S)) + atTop (𝓝 (∫ z, f z ∂(P.restrict E).bind (halfPlaneStoppingGreenMeasure κ B γ G S))) := by + let : IsFiniteMeasureOnCompacts (initialGreenMeasure κ) := initialGreenMeasure_finite_on_compacts κ + have hfi : Integrable f (initialGreenMeasure κ) := f.integrable + apply integral_tendsto_of_lintegral_pos_neg + · exact fun n => hfi.mono_measure (halfPlaneStoppingCurrentMeasure_mean_le hB hBm hBc hB0 hκ hκ8 + γ G F hw (u n) (hu n) S hS E) + · exact hfi.mono_measure (halfPlaneStoppingGreenMeasure_mean_le hB hBm hBc hB0 hκ hκ8 γ G F hw S hS E) + · exact halfPlaneStoppingCurrentMeasure_mean_lintegral_test_tendsto P hBm hBc κ γ G F hw + u hu hmono hlim S hS.measurable' E f f.continuous.measurable + · exact halfPlaneStoppingCurrentMeasure_mean_lintegral_test_tendsto P hBm hBc κ γ G F hw + u hu hmono hlim S hS.measurable' E (fun z => -f z) f.continuous.measurable.neg + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LocalGridMass.lean b/lean/OAI/Probability/SLE/Mass/LocalGridMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..637ed44dbc02cf61aaf1d059617665ebc506d79c --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LocalGridMass.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SLE.Gauge.CoverGrid + +namespace OAI + +/-! A translated finite grid count for arbitrary sets of bounded diameter. +No regularity of the set being covered is required. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma localGrid_coordinate {r s x y : ℝ} (hr : 0 < r) (_hs : 0 ≤ s) + (hxy : |y-x| ≤ s) : + ⌊x/r⌋-(⌈s/r⌉+2) ≤ ⌊y/r⌋ ∧ ⌊y/r⌋ ≤ ⌊x/r⌋+(⌈s/r⌉+2) := by + have hx0 := Int.floor_le (x/r) + have hx1 := Int.lt_floor_add_one (x/r) + have hy0 := Int.floor_le (y/r) + have hy1 := Int.lt_floor_add_one (y/r) + have hc := Int.le_ceil (s/r) + have hlo : -s/r ≤ (y-x)/r := div_le_div_of_nonneg_right (abs_le.mp hxy).1 hr.le + have hhi : (y-x)/r ≤ s/r := div_le_div_of_nonneg_right (abs_le.mp hxy).2 hr.le + rw [sub_div] at hlo hhi + rw [neg_div] at hlo + constructor + · have hh : ((⌊x/r⌋-(⌈s/r⌉+2):ℤ):ℝ) ≤ (⌊y/r⌋:ℝ) := by + push_cast + linarith + exact_mod_cast hh + · have hh : (⌊y/r⌋:ℝ) ≤ ((⌊x/r⌋+(⌈s/r⌉+2):ℤ):ℝ) := by + push_cast + linarith + exact_mod_cast hh + +def localGridIndex (r s : ℝ) (z : ℂ) : Finset (ℤ×ℤ) := + let N : ℤ := ⌈s/r⌉+2 + (Finset.Icc (⌊z.re/r⌋-N) (⌊z.re/r⌋+N)) ×ˢ + (Finset.Icc (⌊z.im/r⌋-N) (⌊z.im/r⌋+N)) + +lemma localGrid_covers {r s : ℝ} (hr : 0 < r) (hs : 0 ≤ s) (z : ℂ) : + closedBall z s ⊆ ⋃ i∈localGridIndex r s z, closedBall (coverGridCenter r i) (2*r) := by + intro w hw + have hn : ‖w-z‖ ≤ s := by simpa only [mem_closedBall,dist_eq_norm] using hw + have hx := localGrid_coordinate hr hs ((Complex.abs_re_le_norm (w-z)).trans hn) + have hy := localGrid_coordinate hr hs ((Complex.abs_im_le_norm (w-z)).trans hn) + refine mem_iUnion₂.mpr ⟨(⌊w.re/r⌋,⌊w.im/r⌋),?_,coverGrid_floor_distance hr w⟩ + simpa only [localGridIndex,Finset.mem_product,Finset.mem_Icc,Complex.sub_re,Complex.sub_im] + using And.intro hx hy + +lemma localGrid_card_bound {r s : ℝ} (hr : 0 < r) (hs : 0 ≤ s) (z : ℂ) : + ((localGridIndex r s z).card:ℝ) ≤ 81*max 1 ((s/r)^2) := by + let N : ℤ := ⌈s/r⌉+2 + have hN : 0 ≤ N := by + have h := Int.ceil_nonneg (div_nonneg hs hr.le) + dsimp [N] + omega + have hside : 2*(N:ℝ)+1 ≤ 2*(s/r)+7 := by + have hc := Int.ceil_lt_add_one (s/r) + dsimp [N] + push_cast + linarith + have hside0 : 0 ≤ 2*(N:ℝ)+1 := by exact_mod_cast (show (0:ℤ) ≤ 2*N+1 by omega) + have hcard : ((localGridIndex r s z).card:ℝ)=(2*(N:ℝ)+1)^2 := by + have hx := Int.card_Icc_of_le (a:=⌊z.re/r⌋-N) (b:=⌊z.re/r⌋+N) (by omega) + have hy := Int.card_Icc_of_le (a:=⌊z.im/r⌋-N) (b:=⌊z.im/r⌋+N) (by omega) + have hx' : ((Finset.Icc (⌊z.re/r⌋-N) (⌊z.re/r⌋+N)).card:ℝ)=2*(N:ℝ)+1 := by + have h : ((Finset.Icc (⌊z.re/r⌋-N) (⌊z.re/r⌋+N)).card:ℝ)= + ((⌊z.re/r⌋:ℝ)+(N:ℝ))+1-((⌊z.re/r⌋:ℝ)-(N:ℝ)) := by exact_mod_cast hx + linarith + have hy' : ((Finset.Icc (⌊z.im/r⌋-N) (⌊z.im/r⌋+N)).card:ℝ)=2*(N:ℝ)+1 := by + have h : ((Finset.Icc (⌊z.im/r⌋-N) (⌊z.im/r⌋+N)).card:ℝ)= + ((⌊z.im/r⌋:ℝ)+(N:ℝ))+1-((⌊z.im/r⌋:ℝ)-(N:ℝ)) := by exact_mod_cast hy + linarith + change (((Finset.Icc _ _) ×ˢ (Finset.Icc _ _)).card:ℝ)=_ + rw [Finset.card_product,Nat.cast_mul,hx',hy',pow_two] + rw [hcard] + have hratio : 0 ≤ s/r := div_nonneg hs hr.le + by_cases hsmall : s/r ≤ 1 + · have h : 2*(N:ℝ)+1 ≤ 9 := by linarith + have hp := pow_le_pow_left₀ hside0 h 2 + norm_num at hp + exact hp.trans (by nlinarith [le_max_left (1:ℝ) ((s/r)^2)]) + · have hlarge : 1 ≤ s/r := (lt_of_not_ge hsmall).le + have h : 2*(N:ℝ)+1 ≤ 9*(s/r) := by linarith + have hp := pow_le_pow_left₀ hside0 h 2 + calc + _ ≤ (9*(s/r))^2 := hp + _ = 81*(s/r)^2 := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left (le_max_right _ _) (by norm_num) + +lemma localGrid_mass_bound + (μ : Measure ℂ) {r s H : ℝ} (hr : 0 < r) (hs : 0 ≤ s) (hH : 0 ≤ H) + (hcell : ∀ i : ℤ×ℤ, μ (closedBall (coverGridCenter r i) (2*r)) ≤ ENNReal.ofReal H) + (A : Set ℂ) (hA : ∀ x∈A, ∀ y∈A, dist x y ≤ s) : + μ A ≤ ENNReal.ofReal (81*H*max 1 ((s/r)^2)) := by + classical + rcases A.eq_empty_or_nonempty with rfl | ⟨z,hz⟩ + · simp + have hcover : A ⊆ closedBall z s := by + intro w hw + exact hA w hw z hz + calc + μ A ≤ μ (⋃ i∈localGridIndex r s z, closedBall (coverGridCenter r i) (2*r)) := + measure_mono (hcover.trans (localGrid_covers hr hs z)) + _ ≤ ∑ i∈localGridIndex r s z, μ (closedBall (coverGridCenter r i) (2*r)) := measure_biUnion_finset_le _ _ + _ ≤ ∑ _i∈localGridIndex r s z, ENNReal.ofReal H := Finset.sum_le_sum (fun i _ => hcell i) + _ = ENNReal.ofReal (((localGridIndex r s z).card:ℝ)*H) := by + simp only [Finset.sum_const,nsmul_eq_mul,ENNReal.ofReal_mul (Nat.cast_nonneg _),ENNReal.ofReal_natCast] + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + have h := mul_le_mul_of_nonneg_right (localGrid_card_bound hr hs z) hH + nlinarith) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/LocallyFiniteMeasureSubtract.lean b/lean/OAI/Probability/SLE/Mass/LocallyFiniteMeasureSubtract.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c5692ff4ff424e247fb97e6572a84729be06e12 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/LocallyFiniteMeasureSubtract.lean @@ -0,0 +1,49 @@ +import Mathlib.MeasureTheory.Measure.Sub +import Mathlib.MeasureTheory.Measure.Typeclasses.SFinite + +namespace OAI + +/-! Subtraction for locally finite canonical mass. Cancellation is checked +on finite restrictions, so no finite total-mass assumption is needed. -/ + +noncomputable section +open Set MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge + +theorem sigmaFinite_sub_add_cancel_of_le + {X : Type*} [MeasurableSpace X] {μ ν : Measure X} [SigmaFinite ν] + (hle : ν ≤ μ) : μ - ν + ν = μ := by + apply Measure.ext_of_iUnion_eq_univ (iUnion_spanningSets ν) + intro n + rw [Measure.restrict_add,Measure.restrict_sub_eq_restrict_sub_restrict + (measurableSet_spanningSets ν n)] + have : Fact (ν (spanningSets ν n) < ⊤) := ⟨measure_spanningSets_lt_top ν n⟩ + exact Measure.sub_add_cancel_of_le (Measure.restrict_mono le_rfl hle) + +theorem sub_apply_of_finite_restriction + {X : Type*} [MeasurableSpace X] {μ ν : Measure X} (hle : ν ≤ μ) + {A : Set X} (hA : MeasurableSet A) (hνA : ν A ≠ ⊤) : + (μ - ν) A = μ A - ν A := by + have : Fact (ν A < ⊤) := ⟨hνA.lt_top⟩ + calc + (μ - ν) A = ((μ - ν).restrict A) univ := by simp + _ = (μ.restrict A - ν.restrict A) univ := by + rw [Measure.restrict_sub_eq_restrict_sub_restrict hA] + _ = μ.restrict A univ - ν.restrict A univ := + Measure.sub_apply MeasurableSet.univ (Measure.restrict_mono le_rfl hle) + _ = μ A - ν A := by simp + +theorem sub_le_sub_right_of_le + {X : Type*} [MeasurableSpace X] {μ ν ξ : Measure X} [SigmaFinite ξ] + (hξ : ξ ≤ ν) (hμν : μ ≤ ν) : μ - ξ ≤ ν - ξ := by + apply Measure.sub_le_of_le_add + rw [sigmaFinite_sub_add_cancel_of_le hξ] + exact hμν + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MarkedTubeHarmonicMeasure.lean b/lean/OAI/Probability/SLE/Mass/MarkedTubeHarmonicMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1e51fa893c3d03f63f90e6c105057c4fe5a2777 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MarkedTubeHarmonicMeasure.lean @@ -0,0 +1,103 @@ +import OAI.Probability.SLE.Geometry.MarkedWindowRoutes +import OAI.Probability.SLE.Geometry.FiniteExitArcAt + +namespace OAI + +/-! Convert the two explicit marked-point Brownian tubes into lower +bounds for both conformal exit arcs. Every geometric condition concerns +actual paths in the surviving domain; the only probabilistic input here +is the generic published conformal Brownian exit law. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Serpentine +open RibbonCoordinates CrosscutSides Target + +lemma marked_window_tubes_opposite_sides + (hopen : PublishedPlanarDiskOpenness) (w : ℂ) {a : ℝ} (ha : 0 < a) + (f : ℂ → ℂ) (j : ℂ → ℝ) + (hf : ContinuousOn f (ball (0 : ℂ) (a / 12))) + (hfi : InjOn f (ball (0 : ℂ) (a / 12))) + (hzero : ∀ z ∈ ball (0 : ℂ) (a / 12), (f z).re = 0 ↔ z.im = 0) + (hrel : ∀ z ∈ ball (0 : ℂ) (a / 12), j (markedCornerChart w z) = (f z).re) : + ∃ right : Bool, + (∀ y : ℂ, dist y (markedWindowRoute right w a (1 / 64)) < a / 10000 → 0 < j y) ∧ + (∀ y : ℂ, dist y (markedWindowRoute (!right) w a (1 / 64)) < a / 10000 → j y < 0) := by + rcases marked_physical_tubes_opposite_sides hopen w ha f j hf hfi hzero hrel with h | h + · refine ⟨false, ?_⟩ + simpa only [markedWindowRoute_small, Bool.false_eq_true, ↓reduceIte, Bool.not_false] using h + · refine ⟨true, ?_⟩ + simpa only [markedWindowRoute_small, ↓reduceIte, Bool.not_true, Bool.false_eq_true] using And.symm h + +theorem marked_tubes_harmonic_bounds + (hopen : PublishedPlanarDiskOpenness) (hexitLaw : PublishedHalfPlaneConformalExitLaw) + (W : WienerLaw) (hW : IsWiener W) + (D : Set ℂ) (hD : IsOpen D) (hDH : D ⊆ upperHalfPlane) + (g F : ℂ → ℂ) (hg : DifferentiableOn ℂ g D) + (hF : DifferentiableOn ℂ F upperHalfPlane) + (hgH : MapsTo g D upperHalfPlane) (hFD : MapsTo F upperHalfPlane D) + (hFg : ∀ z ∈ D, F (g z) = z) (hgF : ∀ z ∈ upperHalfPlane, g (F z) = z) + (w : ℂ) (hwD : w ∈ D) {a : ℝ} (ha : 0 < a) + (h : ℂ ≃ₜ ℂ) (hreal : ∀ x : ℝ, h (x : ℂ) = (x : ℂ)) + (hloc : ContinuousOn (fun z => h (g (markedCornerChart w z))) (ball (0 : ℂ) (a / 12))) + (hloci : InjOn (fun z => h (g (markedCornerChart w z))) (ball (0 : ℂ) (a / 12))) + (hlocz : ∀ z ∈ ball (0 : ℂ) (a / 12), + (h (g (markedCornerChart w z))).re = 0 ↔ z.im = 0) + (q : ℝ≥0∞) + (hprob : ∀ right : Bool, q ≤ (W.prod W) {b | ∀ t ∈ Icc (0 : ℝ) 3, + dist (physicalUnitBrownianPath w b t) (markedWindowRoute right w a t) < a / 10000}) + (hgeom : ∀ (right : Bool) (b : Driver × Driver), + (∀ t ∈ Icc (0 : ℝ) 3, + dist (physicalUnitBrownianPath w b t) (markedWindowRoute right w a t) < a / 10000) → + ∃ τ : ℝ, UnitWindowFirstExit D (physicalUnitBrownianPath w b) τ ∧ (1 / 64 : ℝ) < τ ∧ + ∀ t ∈ Ico (1 / 64 : ℝ) τ, (h (g (physicalUnitBrownianPath w b t))).re ≠ 0) : + q ≤ ENNReal.ofReal ((g w).arg / Real.pi) ∧ + q ≤ ENNReal.ofReal (1 - (g w).arg / Real.pi) := by + let E := fun right : Bool => {b | ∀ t ∈ Icc (0 : ℝ) 3, + dist (physicalUnitBrownianPath w b t) (markedWindowRoute right w a t) < a / 10000} + obtain ⟨hae, hnegBound, hposBound⟩ := hexitLaw W hW D g F hD hDH + hg hF hgH hFD hFg hgF w hwD + obtain ⟨right, hpos, hneg⟩ := marked_window_tubes_opposite_sides hopen w ha + (fun z => h (g (markedCornerChart w z))) (fun z => (h (g z)).re) + hloc hloci hlocz (fun _ _ => rfl) + have hposProb : q ≤ (W.prod W) (unitWindowExitArc D g w 1) := by + refine (hprob right).trans (finite_exit_event_measure_le_arc_at (W.prod W) D g w h hreal + hg.continuousOn (E right) (Or.inr rfl) (by norm_num : (0 : ℝ) ≤ 1 / 64) hae + (hgeom right) ?_) + intro b hb + simpa only [one_mul] using hpos _ (hb _ (by norm_num)) + have hnegProb : q ≤ (W.prod W) (unitWindowExitArc D g w (-1)) := by + refine (hprob (!right)).trans (finite_exit_event_measure_le_arc_at (W.prod W) D g w h hreal + hg.continuousOn (E (!right)) (Or.inl rfl) (by norm_num : (0 : ℝ) ≤ 1 / 64) hae + (hgeom (!right)) ?_) + intro b hb + have hh := hneg _ (hb _ (by norm_num)) + nlinarith + exact ⟨hnegProb.trans hnegBound, hposProb.trans hposBound⟩ + +/-- Early survival, a final exit and avoidance of the actual complete +guide imply the geometric hypotheses in the harmonic-measure theorem. -/ +theorem marked_tube_first_exit_geometry + (D : Set ℂ) (hD : IsOpen D) (g : ℂ → ℂ) (h : ℂ ≃ₜ ℂ) + (α : ℝ≥0 → ℂ) + (hzero : ∀ z ∈ D, (h (g z)).re = 0 → ∃ u : ℝ≥0, 0 < u ∧ α u = z) + (ζ : ℝ → ℂ) (hc : Continuous ζ) + (hearly : MapsTo ζ (Icc (0 : ℝ) (1 / 64)) D) + (hlast : ζ 3 ∉ D) + (havoid : ∀ t ∈ Icc (1 / 64 : ℝ) 3, ∀ u : ℝ≥0, 0 < u → ζ t ≠ α u) : + ∃ τ : ℝ, UnitWindowFirstExit D ζ τ ∧ (1 / 64 : ℝ) < τ ∧ + ∀ t ∈ Ico (1 / 64 : ℝ) τ, (h (g (ζ t))).re ≠ 0 := by + obtain ⟨τ, hτ, hout, hin⟩ := exists_first_domain_exit (L := 3) D hD ζ hc.continuousOn hearly + ⟨3, by norm_num, hlast⟩ + refine ⟨τ, ⟨⟨by linarith [hτ.1], hτ.2⟩, hout, hin⟩, hτ.1, ?_⟩ + intro t ht he + obtain ⟨u, hu, hue⟩ := hzero (ζ t) (hin ⟨by linarith [ht.1], ht.2⟩) he + exact havoid t ⟨ht.1, ht.2.le.trans hτ.2⟩ u hu hue.symm + +end SLEExactGauge.Serpentine + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassCompensatorEndpoint.lean b/lean/OAI/Probability/SLE/Mass/MassCompensatorEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..f603c038536009687f862d1432c46824edf0b0ba --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassCompensatorEndpoint.lean @@ -0,0 +1,117 @@ +import OAI.Probability.SLE.Mass.MassCompensatorMesh + +namespace OAI + +/-! The last full dyadic cell before a finite or infinite time. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma compensatorMeshTime_eq_div (n i : ℕ) : + compensatorMeshTime n i = (i:ℝ≥0)/(2:ℝ≥0)^n := by + simp only [compensatorMeshTime,zpow_neg,zpow_natCast,div_eq_mul_inv] + +@[simp] lemma compensatorMeshTime_end (n : ℕ) : + compensatorMeshTime n (n*2^n) = n := by + rw [compensatorMeshTime_eq_div] + push_cast + exact mul_div_cancel_right₀ _ (by positivity) + +def compensatorFiniteIndex (n : ℕ) (t : ℝ≥0) : ℕ := + min (n*2^n) ⌊t*(2:ℝ≥0)^n⌋₊ + +lemma compensatorFiniteIndex_le (n : ℕ) (t : ℝ≥0) : + compensatorFiniteIndex n t ≤ n*2^n := min_le_left _ _ + +lemma compensator_cell_before_iff (n i : ℕ) (t : ℝ≥0) : + compensatorMeshTime n (i+1) ≤ t ↔ i < ⌊t*(2:ℝ≥0)^n⌋₊ := by + rw [compensatorMeshTime_eq_div,div_le_iff₀ (by positivity), + ← Nat.le_floor_iff (show 0 ≤ t*(2:ℝ≥0)^n from zero_le)] + exact Nat.succ_le_iff + +lemma compensator_before_sum (n : ℕ) (t : ℝ≥0) (q : ℕ → ℝ) : + (∑ i ∈ Finset.range (n*2^n), + if compensatorMeshTime n (i+1) ≤ t then q i else 0) = + ∑ i ∈ Finset.range (compensatorFiniteIndex n t), q i := by + simp only [compensator_cell_before_iff] + rw [← Finset.sum_filter] + congr 1 + ext i + simp only [Finset.mem_filter,Finset.mem_range,compensatorFiniteIndex,lt_min_iff] + +lemma compensatorFiniteIndex_eq_floor {n : ℕ} {t : ℝ≥0} (ht : t ≤ n) : + compensatorFiniteIndex n t = ⌊t*(2:ℝ≥0)^n⌋₊ := by + apply min_eq_right + apply Nat.floor_le_of_le + push_cast + exact mul_le_mul_of_nonneg_right ht (by positivity) + +lemma compensatorEndpoint_le (n : ℕ) (t : ℝ≥0) : + compensatorMeshTime n (compensatorFiniteIndex n t) ≤ t := by + rw [compensatorMeshTime_eq_div,div_le_iff₀ (by positivity)] + exact (Nat.cast_le.mpr (min_le_right _ _)).trans (Nat.floor_le (show 0 ≤ t*(2:ℝ≥0)^n from zero_le)) + +lemma compensatorEndpoint_lower {n : ℕ} {t : ℝ≥0} (ht : t ≤ n) : + t < compensatorMeshTime n (compensatorFiniteIndex n t)+(2:ℝ≥0)^(-(n:ℤ)) := by + rw [compensatorFiniteIndex_eq_floor ht,compensatorMeshTime_eq_div, + zpow_neg,zpow_natCast,← one_div,← add_div,lt_div_iff₀ (by positivity)] + exact Nat.lt_floor_add_one _ + +/-- A finite endpoint is approached from below even though the grid +horizon grows. -/ +theorem compensatorEndpoint_tendsto (t : ℝ≥0) : + Tendsto (fun n => compensatorMeshTime n (compensatorFiniteIndex n t)) atTop (𝓝 t) := by + apply NNReal.tendsto_coe.mp + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' + (show Tendsto (fun n : ℕ => (t:ℝ)-(2:ℝ)^(-(n:ℤ))) atTop (𝓝 (t:ℝ)) from + by simpa only [sub_zero,zpow_neg,zpow_natCast,inv_pow] using + tendsto_const_nhds.sub (tendsto_pow_atTop_nhds_zero_of_lt_one + (show 0 ≤ (2:ℝ)⁻¹ by positivity) (show (2:ℝ)⁻¹<1 by norm_num))) + tendsto_const_nhds + · have hn : ∀ᶠ n : ℕ in atTop, t ≤ (n:ℝ≥0) := + (tendsto_natCast_atTop_atTop (R := ℝ≥0)).eventually (eventually_ge_atTop t) + filter_upwards [hn] with n hn + have h := compensatorEndpoint_lower hn + have hc : (t:ℝ) < (compensatorMeshTime n (compensatorFiniteIndex n t):ℝ)+ + (2:ℝ)^(-(n:ℤ)) := by exact_mod_cast h + linarith + · exact Eventually.of_forall (fun n => by exact_mod_cast compensatorEndpoint_le n t) + +def compensatorStopIndex (n : ℕ) (T : ℝ≥0∞) : ℕ := + if T=∞ then n*2^n else compensatorFiniteIndex n T.toNNReal + +lemma compensatorStopIndex_measurable {Ω : Type*} [MeasurableSpace Ω] + (T : Ω → ℝ≥0∞) (hT : Measurable T) (n : ℕ) : + Measurable (fun ω => compensatorStopIndex n (T ω)) := by + apply Measurable.ite (measurableSet_eq_fun hT measurable_const) measurable_const + exact measurable_const.min ((hT.ennreal_toNNReal.mul_const ((2:ℝ≥0)^n)).nat_floor) + +lemma compensatorStopIndex_le (n : ℕ) (T : ℝ≥0∞) : + compensatorStopIndex n T ≤ n*2^n := by + unfold compensatorStopIndex + split_ifs + · exact le_rfl + · exact compensatorFiniteIndex_le _ _ + +def massAtExtendedTime (A : ℝ≥0 → ℝ) (L : ℝ) (T : ℝ≥0∞) : ℝ := + if T=∞ then L else A T.toNNReal + +theorem massAt_compensatorEndpoint_tendsto + (A : ℝ≥0 → ℝ) (L : ℝ) (hA : Continuous A) + (hL : Tendsto A atTop (𝓝 L)) (T : ℝ≥0∞) : + Tendsto (fun n => A (compensatorMeshTime n (compensatorStopIndex n T))) + atTop (𝓝 (massAtExtendedTime A L T)) := by + by_cases hT : T=∞ + · simpa only [compensatorStopIndex,massAtExtendedTime,hT,ite_true, + compensatorMeshTime_end,Function.comp_def] using hL.comp (tendsto_natCast_atTop_atTop (R := ℝ≥0)) + · simpa only [compensatorStopIndex,massAtExtendedTime,hT,ite_false,Function.comp_def] using + hA.continuousAt.tendsto.comp (compensatorEndpoint_tendsto T.toNNReal) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassCompensatorMesh.lean b/lean/OAI/Probability/SLE/Mass/MassCompensatorMesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..705940a2dd567c0463621c56b87b4ae90f174270 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassCompensatorMesh.lean @@ -0,0 +1,146 @@ +import OAI.Probability.SLE.Mass.MassUniquenessMesh +import OAI.Probability.SLE.MomentGauge +import Mathlib.Topology.Order.Compact + +namespace OAI + +/-! The deterministic quadratic-error estimate for the prescribed dyadic +potential compensator. A finite terminal limit controls the growing horizon. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal + +namespace SLEExactGauge + +/-- A continuous mass path with a finite terminal limit is uniformly +continuous even though the compensator mesh horizon grows to infinity. -/ +lemma mass_path_uniformContinuous (A : ℝ≥0 → ℝ) (L : ℝ) + (hc : Continuous A) (hl : Tendsto A atTop (𝓝 L)) : UniformContinuous A := by + apply hc.uniformContinuous_of_tendsto_cocompact + simpa only [cocompact_eq_atTop] using hl + +def compensatorMeshTime (n i : ℕ) : ℝ≥0 := + (i : ℝ≥0) * (2 : ℝ≥0)^(-(n:ℤ)) + +@[simp] lemma compensatorMeshTime_zero (n : ℕ) : compensatorMeshTime n 0=0 := by + simp [compensatorMeshTime] + +lemma compensatorMeshTime_mono (n : ℕ) : Monotone (compensatorMeshTime n) := by + intro i j hij + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hij) (by positivity) + +lemma compensatorMeshTime_dist (n i : ℕ) : + dist (compensatorMeshTime n (i+1)) (compensatorMeshTime n i) = (2:ℝ)^(-(n:ℤ)) := by + rw [NNReal.dist_eq] + simp only [compensatorMeshTime,NNReal.coe_mul,NNReal.coe_zpow,NNReal.coe_ofNat, + NNReal.coe_natCast,NNReal.coe_add,NNReal.coe_one,Nat.cast_add,Nat.cast_one] + rw [show ((i:ℝ)+1)*(2:ℝ)^(-(n:ℤ))-(i:ℝ)*(2:ℝ)^(-(n:ℤ)) = + (2:ℝ)^(-(n:ℤ)) by ring, abs_of_pos (by positivity)] + +lemma compensatorMeshTime_small_increments (A : ℝ≥0 → ℝ) (L : ℝ) + (hc : Continuous A) (hl : Tendsto A atTop (𝓝 L)) : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, ∀ i : ℕ, + |A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i)| ≤ ε := by + intro ε hε + obtain ⟨δ,hδ,hAδ⟩ := Metric.uniformContinuous_iff.mp + (mass_path_uniformContinuous A L hc hl) ε hε + have hmesh : Tendsto (fun n : ℕ => (2:ℝ)^(-(n:ℤ))) atTop (𝓝 0) := by + simpa only [zpow_neg, zpow_natCast, inv_pow] using + (tendsto_pow_atTop_nhds_zero_of_lt_one (show 0 ≤ (2:ℝ)⁻¹ by positivity) + (show (2:ℝ)⁻¹ < 1 by norm_num)) + filter_upwards [hmesh.eventually (gt_mem_nhds hδ)] with n hn i + have h := hAδ (a := compensatorMeshTime n (i+1)) (b := compensatorMeshTime n i) + (by simpa only [compensatorMeshTime_dist] using hn) + exact (by simpa only [Real.dist_eq] using h.le) + +def compensatorQuadraticError (A : ℝ≥0 → ℝ) (n : ℕ) : ℝ := + ∑ i ∈ Finset.range (n*2^n), + (A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i))^2 + +lemma compensatorQuadraticError_nonneg (A : ℝ≥0 → ℝ) (n : ℕ) : + 0 ≤ compensatorQuadraticError A n := + Finset.sum_nonneg (fun _ _ => sq_nonneg _) + +lemma compensatorQuadraticError_le (A : ℝ≥0 → ℝ) (L : ℝ) + (hm : Monotone A) (h0 : A 0=0) (hb : ∀ t, A t ≤ L) + (n : ℕ) {ε : ℝ} (hε : 0 ≤ ε) + (hsmall : ∀ i : ℕ, A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i) ≤ ε) : + compensatorQuadraticError A n ≤ ε*L := by + have hsum : (∑ i ∈ Finset.range (n*2^n), + (A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i))) ≤ L := by + rw [Finset.sum_range_sub (fun i => A (compensatorMeshTime n i)) (n*2^n), + compensatorMeshTime_zero,h0,sub_zero] + exact hb _ + calc + compensatorQuadraticError A n ≤ ∑ i ∈ Finset.range (n*2^n), + ε*(A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i)) := by + apply Finset.sum_le_sum + intro i _ + have hnonneg := sub_nonneg.mpr (hm (compensatorMeshTime_mono n (Nat.le_succ i))) + nlinarith [hsmall i] + _ = ε*∑ i ∈ Finset.range (n*2^n), + (A (compensatorMeshTime n (i+1))-A (compensatorMeshTime n i)) := + (Finset.mul_sum _ _ _).symm + _ ≤ ε*L := mul_le_mul_of_nonneg_left hsum hε + +lemma compensatorQuadraticError_le_terminal_sq (A : ℝ≥0 → ℝ) (L : ℝ) + (hm : Monotone A) (h0 : A 0=0) (hb : ∀ t, A t ≤ L) (n : ℕ) : + compensatorQuadraticError A n ≤ L^2 := by + have hL : 0 ≤ L := by simpa only [h0] using hb 0 + simpa only [pow_two] using compensatorQuadraticError_le A L hm h0 hb n hL (fun i => by + have hAi : 0 ≤ A (compensatorMeshTime n i) := by + rw [← h0] + exact hm (show 0 ≤ _ from zero_le) + linarith [hb (compensatorMeshTime n (i+1))]) + +/-- The accumulated squared mass increments vanish for the exact growing +horizon and dyadic mesh used by the paper's potential formula. -/ +theorem compensatorQuadraticError_tendsto_zero (A : ℝ≥0 → ℝ) (L : ℝ) + (hm : Monotone A) (h0 : A 0=0) (hc : Continuous A) + (hl : Tendsto A atTop (𝓝 L)) (hb : ∀ t, A t ≤ L) : + Tendsto (compensatorQuadraticError A) atTop (𝓝 0) := by + have hL : 0 ≤ L := by simpa only [h0] using hb 0 + apply tendsto_order.mpr + constructor + · intro a ha + exact Eventually.of_forall (fun n => ha.trans_le (compensatorQuadraticError_nonneg A n)) + · intro b hb0 + have hd : 0 < b/(L+1) := div_pos hb0 (by linarith) + filter_upwards [compensatorMeshTime_small_increments A L hc hl _ hd] with n hn + have hbound := compensatorQuadraticError_le A L hm h0 hb n hd.le + (fun i => (le_abs_self _).trans (hn i)) + have he : b/(L+1)*(L+1)=b := div_mul_cancel₀ b (by linarith) + nlinarith + +/-- Dominated convergence for the exact quadratic mesh error; the bound +requires only the second terminal moment, not a uniform time horizon. -/ +theorem compensatorQuadraticError_mean_tendsto_zero + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (A : ℝ≥0 → Ω → ℝ) (L : Ω → ℝ) + (hA : ∀ t, Measurable (A t)) (hL : Integrable (fun ω => L ω^2) P) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ + Continuous (fun t => A t ω) ∧ Tendsto (fun t => A t ω) atTop (𝓝 (L ω)) ∧ + ∀ t, A t ω ≤ L ω) : + Tendsto (fun n => ∫ ω, compensatorQuadraticError (fun t => A t ω) n ∂P) + atTop (𝓝 0) := by + have hm (n : ℕ) : Measurable (fun ω => compensatorQuadraticError (fun t => A t ω) n) := by + apply Finset.measurable_sum + intro i _ + exact ((hA _).sub (hA _)).pow_const 2 + have hb (n : ℕ) : ∀ᵐ ω ∂P, ‖compensatorQuadraticError (fun t => A t ω) n‖ ≤ L ω^2 := by + filter_upwards [hp] with ω hω + rw [Real.norm_of_nonneg (compensatorQuadraticError_nonneg _ _)] + exact compensatorQuadraticError_le_terminal_sq _ _ hω.1 hω.2.1 hω.2.2.2.2 n + have hl : ∀ᵐ ω ∂P, Tendsto (fun n => compensatorQuadraticError (fun t => A t ω) n) + atTop (𝓝 0) := by + filter_upwards [hp] with ω hω + exact compensatorQuadraticError_tendsto_zero _ _ hω.1 hω.2.1 hω.2.2.1 hω.2.2.2.1 hω.2.2.2.2 + simpa only [integral_zero] using tendsto_integral_of_dominated_convergence + (fun ω => L ω^2) (fun n => (hm n).aestronglyMeasurable) hL hb hl + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassCompensatorRecovery.lean b/lean/OAI/Probability/SLE/Mass/MassCompensatorRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..88ef900b892d00bade52bf1e4f02254602e50c61 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassCompensatorRecovery.lean @@ -0,0 +1,144 @@ +import OAI.Probability.SLE.Mass.MassCompensatorEndpoint +import OAI.Probability.SLE.Mass.MassCompensatorSelection + +namespace OAI + +/-! Recovery of a continuous finite mass path from its discrete +predictable increments, with the paper's growing dyadic horizon. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +def meshMassIncrement (A : ℝ≥0 → Ω → ℝ) (n i : ℕ) (ω : Ω) : ℝ := + A (compensatorMeshTime n (i+1)) ω-A (compensatorMeshTime n i) ω + +def meshMassCompensator (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) + (n j : ℕ) (ω : Ω) : ℝ := + ∑ i ∈ Finset.range j, condExp (ℱ n i) P (meshMassIncrement A n i) ω + +omit [IsProbabilityMeasure P] in +lemma meshMassIncrement_memLp + (A : ℝ≥0 → Ω → ℝ) (L : Ω → ℝ) (hL : MemLp L 2 P) + (hA : ∀ t, Measurable (A t)) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ ∀ t, A t ω ≤ L ω) + (n i : ℕ) : MemLp (meshMassIncrement A n i) 2 P := by + apply hL.mono' (((hA _).sub (hA _)).aestronglyMeasurable) + filter_upwards [hp] with ω hω + have hn : 0 ≤ meshMassIncrement A n i ω := + sub_nonneg.mpr (hω.1 (compensatorMeshTime_mono n (Nat.le_succ i))) + have hz : 0 ≤ A (compensatorMeshTime n i) ω := by + rw [← hω.2.1] + exact hω.1 (show 0 ≤ _ from zero_le) + simp only [Pi.sub_apply] + change 0 ≤ A (compensatorMeshTime n (i+1)) ω-A (compensatorMeshTime n i) ω at hn + rw [Real.norm_of_nonneg hn] + linarith [hω.2.2 (compensatorMeshTime n (i+1))] + +omit [IsProbabilityMeasure P] in +lemma meshMassCompensator_decomposition + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) (n j : ℕ) (ω : Ω) : + meshMassCompensator P ℱ A n j ω = + A (compensatorMeshTime n j) ω-A 0 ω- + centeredMassPartialSum P (ℱ n) (meshMassIncrement A n) j ω := by + unfold centeredMassPartialSum meshMassCompensator + rw [Finset.sum_sub_distrib] + have he : (∑ i ∈ Finset.range j, meshMassIncrement A n i ω) = + A (compensatorMeshTime n j) ω-A 0 ω := by + simp only [meshMassIncrement] + rw [Finset.sum_range_sub (fun i => A (compensatorMeshTime n i) ω) j,compensatorMeshTime_zero] + rw [he] + ring + +theorem meshMassCentered_selected_tendstoInMeasure + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) (L : Ω → ℝ) + (hA : ∀ t, Measurable (A t)) + (hgrid : ∀ n i, StronglyMeasurable[ℱ n i] (A (compensatorMeshTime n i))) + (hL : MemLp L 2 P) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ + Continuous (fun t => A t ω) ∧ Tendsto (fun t => A t ω) atTop (𝓝 (L ω)) ∧ + ∀ t, A t ω ≤ L ω) + (J : ℕ → Ω → ℕ) (hJ : ∀ n ω, J n ω ≤ n*2^n) : + TendstoInMeasure P + (fun n ω => centeredMassPartialSum P (ℱ n) (meshMassIncrement A n) (J n ω) ω) + atTop 0 := by + apply centeredMassPartialSum_selected_tendstoInMeasure P ℱ (meshMassIncrement A) + (fun n i => meshMassIncrement_memLp P A L hL hA + (hp.mono (fun ω hω => ⟨hω.1,hω.2.1,hω.2.2.2.2⟩)) n i) + (fun n i => (hgrid n (i+1)).sub ((hgrid n i).mono (ℱ n |>.mono (Nat.le_succ i)))) + (fun n => n*2^n) J hJ + exact compensatorQuadraticError_mean_tendsto_zero P A L hA hL.integrable_sq hp + +omit [IsProbabilityMeasure P] in +lemma meshMassCompensator_selected_measurable + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) + (n : ℕ) (J : Ω → ℕ) (hJ : Measurable J) : + Measurable (fun ω => meshMassCompensator P ℱ A n (J ω) ω) := by + have hjoint : Measurable (fun z : ℕ × Ω => meshMassCompensator P ℱ A n z.1 z.2) := by + apply measurable_from_prod_countable_right + intro j + change Measurable (fun ω => ∑ i ∈ Finset.range j, condExp (ℱ n i) P (meshMassIncrement A n i) ω) + apply Finset.measurable_sum + intro i _ + exact stronglyMeasurable_condExp.measurable.le (ℱ n |>.le i) + exact hjoint.comp (hJ.prodMk measurable_id) + +/-- Any measurable choice of endpoints where the sampled mass has its +pathwise limit recovers that same mass from the predictable increments. -/ +theorem meshMassCompensator_selected_tendstoInMeasure + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) (L V : Ω → ℝ) + (hA : ∀ t, Measurable (A t)) + (hgrid : ∀ n i, StronglyMeasurable[ℱ n i] (A (compensatorMeshTime n i))) + (hL : MemLp L 2 P) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ + Continuous (fun t => A t ω) ∧ Tendsto (fun t => A t ω) atTop (𝓝 (L ω)) ∧ + ∀ t, A t ω ≤ L ω) + (J : ℕ → Ω → ℕ) (hJm : ∀ n, Measurable (J n)) + (hJ : ∀ n ω, J n ω ≤ n*2^n) + (hJV : ∀ᵐ ω ∂P, Tendsto (fun n => A (compensatorMeshTime n (J n ω)) ω) + atTop (𝓝 (V ω))) : + TendstoInMeasure P (fun n ω => meshMassCompensator P ℱ A n (J n ω) ω) atTop V := by + have hZ := meshMassCentered_selected_tendstoInMeasure P ℱ A L hA hgrid hL hp J hJ + apply (exists_seq_tendstoInMeasure_atTop_iff + (fun n => (meshMassCompensator_selected_measurable P ℱ A n (J n) (hJm n)).aestronglyMeasurable)).mpr + intro ns hns + obtain ⟨ms,hms,hlim⟩ := (hZ.comp hns.tendsto_atTop).exists_seq_tendsto_ae + refine ⟨ms,hms,?_⟩ + filter_upwards [hp,hJV,hlim] with ω hω hV hZω + have ht := (hV.comp (hns.tendsto_atTop.comp hms.tendsto_atTop)).sub hZω + simp only [Pi.zero_apply,sub_zero,Function.comp_def] at ht + convert ht using 1 + funext n + rw [meshMassCompensator_decomposition,hω.2.1,sub_zero] + +/-- The exact last-full-cell convention, including an infinite endpoint, +recovers the stopped mass in probability. -/ +theorem meshMassCompensator_stopped_tendstoInMeasure + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) (L : Ω → ℝ) + (hA : ∀ t, Measurable (A t)) + (hgrid : ∀ n i, StronglyMeasurable[ℱ n i] (A (compensatorMeshTime n i))) + (hL : MemLp L 2 P) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ + Continuous (fun t => A t ω) ∧ Tendsto (fun t => A t ω) atTop (𝓝 (L ω)) ∧ + ∀ t, A t ω ≤ L ω) + (T : Ω → ℝ≥0∞) (hT : Measurable T) : + TendstoInMeasure P + (fun n ω => meshMassCompensator P ℱ A n (compensatorStopIndex n (T ω)) ω) + atTop (fun ω => massAtExtendedTime (fun t => A t ω) (L ω) (T ω)) := by + apply meshMassCompensator_selected_tendstoInMeasure P ℱ A L _ hA hgrid hL hp + (fun n ω => compensatorStopIndex n (T ω)) + (fun n => compensatorStopIndex_measurable T hT n) + (fun n ω => compensatorStopIndex_le n (T ω)) + filter_upwards [hp] with ω hω + exact massAt_compensatorEndpoint_tendsto (fun t => A t ω) (L ω) + hω.2.2.1 hω.2.2.2.1 (T ω) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassCompensatorSelection.lean b/lean/OAI/Probability/SLE/Mass/MassCompensatorSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..598e99832c292edf2eea2a6e87a32174ca92002b --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassCompensatorSelection.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Mass.MassCompensatorVariance +import Mathlib.MeasureTheory.Function.ConvergenceInMeasure + +namespace OAI + +/-! The compensator error at a selected grid endpoint. The endpoint may +depend on the whole path; the maximal bound does not require it to be a +discrete stopping time. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +lemma centeredMassPartialSum_selected_bound + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) + (hDm : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) + (N : ℕ) (J : Ω → ℕ) (hJ : ∀ ω, J ω ≤ N) (ε : ℝ) (hε : 0 < ε) : + ENNReal.ofReal (ε^2) * P {ω | ε ≤ |centeredMassPartialSum P ℱ D (J ω) ω|} ≤ + ENNReal.ofReal (∫ ω, ∑ i ∈ Finset.range N, D i ω^2 ∂P) := by + have hs : {ω | ε ≤ |centeredMassPartialSum P ℱ D (J ω) ω|} ⊆ + {ω | ε^2 ≤ (Finset.range (N+1)).sup' Finset.nonempty_range_add_one + (fun j => centeredMassPartialSum P ℱ D j ω^2)} := by + intro ω hω + change ε^2 ≤ _ + apply Finset.le_sup'_of_le (fun j => centeredMassPartialSum P ℱ D j ω^2) + (Finset.mem_range.mpr (Nat.lt_succ_of_le (hJ ω))) + have hh := mul_self_le_mul_self hε.le hω + simpa only [sq_abs,← pow_two] using hh + have hb := centeredMassPartialSum_maximal_error P ℱ D hD hDm + (NNReal.mk (ε^2) (sq_nonneg ε)) N + have hb' : ENNReal.ofReal (ε^2) * P {ω | ε^2 ≤ + (Finset.range (N+1)).sup' Finset.nonempty_range_add_one + (fun j => centeredMassPartialSum P ℱ D j ω^2)} ≤ + ENNReal.ofReal (∫ ω, ∑ i ∈ Finset.range N, D i ω^2 ∂P) := by + simpa only [ENNReal.ofReal_eq_coe_nnreal (sq_nonneg ε),NNReal.coe_mk] using hb + exact (mul_le_mul_of_nonneg_left (measure_mono hs) + (show 0 ≤ ENNReal.ofReal (ε^2) from zero_le)).trans hb' + +/-- Vanishing expected quadratic increments imply that the centered +compensator vanishes in probability at every bounded selected index. -/ +theorem centeredMassPartialSum_selected_tendstoInMeasure + (ℱ : ℕ → Filtration ℕ mΩ) (D : ℕ → ℕ → Ω → ℝ) + (hD : ∀ n i, MemLp (D n i) 2 P) + (hDm : ∀ n i, StronglyMeasurable[ℱ n (i+1)] (D n i)) + (N : ℕ → ℕ) (J : ℕ → Ω → ℕ) (hJ : ∀ n ω, J n ω ≤ N n) + (hE : Tendsto (fun n => ∫ ω, ∑ i ∈ Finset.range (N n), D n i ω^2 ∂P) + atTop (𝓝 0)) : + TendstoInMeasure P (fun n ω => centeredMassPartialSum P (ℱ n) (D n) (J n ω) ω) + atTop 0 := by + rw [tendstoInMeasure_iff_norm] + intro ε hε + let c : ℝ≥0∞ := ENNReal.ofReal (ε^2) + have hc0 : c ≠ 0 := (ENNReal.ofReal_pos.mpr (sq_pos_of_pos hε)).ne' + have hcT : c ≠ ∞ := ENNReal.ofReal_ne_top + have hb (n : ℕ) : P {ω | ε ≤ |centeredMassPartialSum P (ℱ n) (D n) (J n ω) ω|} ≤ + c⁻¹*ENNReal.ofReal (∫ ω, ∑ i ∈ Finset.range (N n), D n i ω^2 ∂P) := by + calc + _ = c⁻¹*(c*P {ω | ε ≤ |centeredMassPartialSum P (ℱ n) (D n) (J n ω) ω|}) := by + rw [← mul_assoc,ENNReal.inv_mul_cancel hc0 hcT,one_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left + (centeredMassPartialSum_selected_bound P (ℱ n) (D n) (hD n) (hDm n) + (N n) (J n) (hJ n) ε hε) (show 0 ≤ c⁻¹ from zero_le) + have ht : Tendsto (fun n => c⁻¹*ENNReal.ofReal + (∫ ω, ∑ i ∈ Finset.range (N n), D n i ω^2 ∂P)) atTop (𝓝 0) := by + simpa only [ENNReal.ofReal_zero,mul_zero] using + ENNReal.Tendsto.const_mul (ENNReal.tendsto_ofReal hE) + (Or.inr (ENNReal.inv_ne_top.mpr hc0)) + simpa only [Pi.zero_apply,sub_zero,Real.norm_eq_abs] using + tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds ht + (fun _ => bot_le) hb + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassCompensatorVariance.lean b/lean/OAI/Probability/SLE/Mass/MassCompensatorVariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..b479aefd0b6a2d3856df50b160a97f2b512fc035 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassCompensatorVariance.lean @@ -0,0 +1,192 @@ +import OAI.Probability.SLE.Mass.MassCompensatorMesh +import Mathlib.Probability.Martingale.Centering +import Mathlib.Probability.Martingale.OptionalStopping +import Mathlib.Probability.CondVar + +namespace OAI + +/-! Orthogonality and variance bounds for the discrete potential +compensator used in the prescribed moment coefficients. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +section Centered +variable (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + +include hm in +lemma centered_mass_increment_condExp (X : Ω → ℝ) (hX : MemLp X 2 P) : + P[X-P[X|m]|m] =ᵐ[P] 0 := by + have hi := hX.integrable one_le_two + have h := condExp_sub hi (integrable_condExp (μ := P) (m := m) (f := X)) m + rw [condExp_of_stronglyMeasurable hm stronglyMeasurable_condExp integrable_condExp] at h + simpa only [sub_self] using h + +include hm in +lemma integral_mul_centered_mass_increment + (X Y : Ω → ℝ) (hX : MemLp X 2 P) (hY : MemLp Y 2 P) + (hYm : StronglyMeasurable[m] Y) : + (∫ ω, Y ω*(X ω-P[X|m] ω) ∂P)=0 := by + have hZ : MemLp (X-P[X|m]) 2 P := hX.sub (hX.condExp one_le_two) + have hprod : Integrable (Y*(X-P[X|m])) P := memLp_one_iff_integrable.mp (hY.mul hZ) + have he := condExp_mul_of_stronglyMeasurable_left hYm hprod (hZ.integrable one_le_two) + have hz := centered_mass_increment_condExp (mΩ := mΩ) P m hm X hX + have he0 : P[Y*(X-P[X|m])|m] =ᵐ[P] 0 := by + filter_upwards [he,hz] with ω hp hz + simp only [Pi.mul_apply,Pi.zero_apply,hz,mul_zero] at hp ⊢ + exact hp + calc + _ = ∫ ω, P[Y*(X-P[X|m])|m] ω ∂P := (integral_condExp hm).symm + _ = 0 := by simpa only [Pi.zero_apply,integral_zero] using integral_congr_ae he0 + +include hm in +lemma centered_mass_increment_variance_le (X : Ω → ℝ) (hX : MemLp X 2 P) : + (∫ ω, (X ω-P[X|m] ω)^2 ∂P) ≤ ∫ ω, X ω^2 ∂P := by + have hZ : Integrable (fun ω => (X ω-P[X|m] ω)^2) P := + (hX.sub (hX.condExp one_le_two)).integrable_sq + have he := setIntegral_condVar (hm := hm) hZ (MeasurableSet.univ : MeasurableSet[m] univ) + simp only [Measure.restrict_univ] at he + rw [← he] + calc + _ ≤ ∫ ω, P[X^2|m] ω ∂P := + integral_mono_ae integrable_condVar integrable_condExp (condVar_ae_le_condExp_sq hm hX) + _ = _ := integral_condExp hm + +end Centered + +lemma martingale_square_submartingale + {ι : Type*} [Preorder ι] (ℱ : Filtration ι mΩ) + (M : ι → Ω → ℝ) (hM : Martingale M ℱ P) (h2 : ∀ i, MemLp (M i) 2 P) : + Submartingale (fun i ω => M i ω^2) ℱ P := by + refine ⟨fun i => (hM.stronglyMeasurable i).pow 2,?_,fun i => (h2 i).integrable_sq⟩ + intro i j hij + have hv := condVar_ae_eq_condExp_sq_sub_sq_condExp (ℱ.le i) (h2 j) + have hn : 0 ≤ᵐ[P] condVar (ℱ i) (M j) P := + condExp_nonneg (ae_of_all _ (fun ω => sq_nonneg (M j ω-P[M j|ℱ i] ω))) + filter_upwards [hv,hn,hM.condExp_ae_eq hij] with ω hv hn he + simp only [Pi.sub_apply,Pi.pow_apply] at hv + rw [he] at hv + change 0 ≤ condVar (ℱ i) (M j) P ω at hn + change condVar (ℱ i) (M j) P ω = P[fun ω => M j ω^2|ℱ i] ω - M i ω^2 at hv + linarith + +lemma martingale_square_maximal_ineq + (ℱ : Filtration ℕ mΩ) (M : ℕ → Ω → ℝ) + (hM : Martingale M ℱ P) (h2 : ∀ i, MemLp (M i) 2 P) + (ε : ℝ≥0) (N : ℕ) : + (ε:ℝ≥0∞) * P {ω | (ε:ℝ) ≤ (Finset.range (N+1)).sup' + Finset.nonempty_range_add_one (fun j => M j ω^2)} ≤ + ENNReal.ofReal (∫ ω, M N ω^2 ∂P) := by + have hsub := martingale_square_submartingale P ℱ M hM h2 + have h := maximal_ineq hsub (fun i ω => sq_nonneg (M i ω)) (ε := ε) N + refine h.trans (ENNReal.ofReal_le_ofReal ?_) + exact setIntegral_le_integral (h2 N).integrable_sq (ae_of_all _ (fun ω => sq_nonneg (M N ω))) + +noncomputable def centeredMassPartialSum (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (n : ℕ) (ω : Ω) : ℝ := ∑ i ∈ Finset.range n, (D i ω - condExp (ℱ i) P (D i) ω) + +omit [IsProbabilityMeasure P] in +lemma centeredMassPartialSum_memLp (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) (n : ℕ) : + MemLp (centeredMassPartialSum P ℱ D n) 2 P := + memLp_finsetSum _ (fun i _ => (hD i).sub ((hD i).condExp one_le_two)) + +omit [IsProbabilityMeasure P] in +lemma centeredMassPartialSum_stronglyMeasurable + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) (n : ℕ) : + StronglyMeasurable[ℱ n] (centeredMassPartialSum P ℱ D n) := by + apply Finset.stronglyMeasurable_fun_sum + intro i hi + have hle : i+1 ≤ n := Nat.succ_le_of_lt (Finset.mem_range.mp hi) + exact ((hD i).mono (ℱ.mono hle)).sub + (stronglyMeasurable_condExp.mono (ℱ.mono (Nat.le_of_lt (Finset.mem_range.mp hi)))) + +lemma centeredMassPartialSum_variance + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) + (hDm : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) (n : ℕ) : + (∫ ω, centeredMassPartialSum P ℱ D n ω^2 ∂P) = + ∑ i ∈ Finset.range n, ∫ ω, (D i ω-P[D i|ℱ i] ω)^2 ∂P := by + induction n with + | zero => simp [centeredMassPartialSum] + | succ n ih => + have hS := centeredMassPartialSum_memLp P ℱ D hD n + have hX : MemLp (D n-P[D n|ℱ n]) 2 P := (hD n).sub ((hD n).condExp one_le_two) + have hSX : Integrable (fun ω => centeredMassPartialSum P ℱ D n ω* + (D n ω-P[D n|ℱ n] ω)) P := memLp_one_iff_integrable.mp (hS.mul hX) + have hcross := integral_mul_centered_mass_increment P (ℱ n) (ℱ.le n) + (D n) (centeredMassPartialSum P ℱ D n) (hD n) hS + (centeredMassPartialSum_stronglyMeasurable P ℱ D hDm n) + have he : (fun ω => centeredMassPartialSum P ℱ D (n+1) ω^2) = + (fun ω => centeredMassPartialSum P ℱ D n ω^2+ + 2*(centeredMassPartialSum P ℱ D n ω*(D n ω-P[D n|ℱ n] ω))+ + (D n ω-P[D n|ℱ n] ω)^2) := by + funext ω + simp only [centeredMassPartialSum,Finset.sum_range_succ] + ring + have hi₁ := integral_add (hS.integrable_sq.add (hSX.const_mul 2)) hX.integrable_sq + have hi₂ := integral_add hS.integrable_sq (hSX.const_mul 2) + simp only [Pi.add_apply,Pi.sub_apply] at hi₁ hi₂ + rw [he,hi₁,hi₂,integral_const_mul,hcross,mul_zero,add_zero,ih,Finset.sum_range_succ] + +lemma centeredMassPartialSum_variance_le + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) + (hDm : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) (n : ℕ) : + (∫ ω, centeredMassPartialSum P ℱ D n ω^2 ∂P) ≤ + ∫ ω, ∑ i ∈ Finset.range n, D i ω^2 ∂P := by + rw [centeredMassPartialSum_variance P ℱ D hD hDm n, + integral_finsetSum _ (fun i _ => (hD i).integrable_sq)] + exact Finset.sum_le_sum (fun i _ => centered_mass_increment_variance_le P (ℱ i) (ℱ.le i) (D i) (hD i)) + +lemma centeredMassPartialSum_martingale + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) + (hDm : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) : + Martingale (centeredMassPartialSum P ℱ D) ℱ P := by + let A : ℕ → Ω → ℝ := fun n ω => ∑ i ∈ Finset.range n, D i ω + have hAm : StronglyAdapted ℱ A := by + intro n + apply Finset.stronglyMeasurable_fun_sum + intro i hi + exact (hDm i).mono (ℱ.mono (Nat.succ_le_of_lt (Finset.mem_range.mp hi))) + have hAI (n : ℕ) : Integrable (A n) P := + (memLp_finsetSum _ (fun i _ => hD i)).integrable one_le_two + have hd (i : ℕ) : A (i+1)-A i=D i := by + funext ω + simp only [A,Finset.sum_range_succ,Pi.sub_apply,add_sub_cancel_left] + have he : martingalePart A ℱ P = centeredMassPartialSum P ℱ D := by + rw [martingalePart_eq_sum] + funext n ω + simp only [Pi.add_apply,Finset.sum_apply,Pi.sub_apply] + change A 0 ω+(∑ i ∈ Finset.range n, + ((A (i+1)-A i) ω-condExp (ℱ i) P (A (i+1)-A i) ω)) = _ + simp only [hd] + simp only [A,Finset.range_zero,Finset.sum_empty,zero_add,centeredMassPartialSum] + simpa only [he] using martingale_martingalePart hAm hAI + +/-- A maximal estimate valid at every selected grid index, without +requiring that the selected index itself be a stopping time. -/ +theorem centeredMassPartialSum_maximal_error + (ℱ : Filtration ℕ mΩ) (D : ℕ → Ω → ℝ) + (hD : ∀ i, MemLp (D i) 2 P) + (hDm : ∀ i, StronglyMeasurable[ℱ (i+1)] (D i)) (ε : ℝ≥0) (N : ℕ) : + (ε:ℝ≥0∞)*P {ω | (ε:ℝ) ≤ (Finset.range (N+1)).sup' + Finset.nonempty_range_add_one (fun j => centeredMassPartialSum P ℱ D j ω^2)} ≤ + ENNReal.ofReal (∫ ω, ∑ i ∈ Finset.range N, D i ω^2 ∂P) := by + exact (martingale_square_maximal_ineq P ℱ (centeredMassPartialSum P ℱ D) + (centeredMassPartialSum_martingale P ℱ D hD hDm) + (centeredMassPartialSum_memLp P ℱ D hD) ε N).trans + (ENNReal.ofReal_le_ofReal (centeredMassPartialSum_variance_le P ℱ D hD hDm N)) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassGridCutoffs.lean b/lean/OAI/Probability/SLE/Mass/MassGridCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1dcf0be8ff7ef7d2b380d50d37d856891f6cfca --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassGridCutoffs.lean @@ -0,0 +1,105 @@ +import OAI.Probability.SLE.Mass.MassGridOverlap +import OAI.Probability.SLE.Mass.LevelRadonMoments + +namespace OAI + +/-! Compact spatial test functions adapted to the mass grid. A fixed +compact cutoff keeps every enlarged grid cell inside the open half-plane. -/ + +noncomputable section +open Set Metric Filter MeasureTheory Classical +open scoped ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +lemma exists_unit_compact_test_cutoff (K : Set upperHalfPlane) (hK : IsCompact K) : + ∃ f : C_c(upperHalfPlane,ℝ), (∀ z, 0 ≤ f z ∧ f z ≤ 1) ∧ ∀ z ∈ K, f z = 1 := by + let : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + obtain ⟨f,hf,hfc,_,h01⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen + hK isOpen_univ (subset_univ K) + exact ⟨⟨f,hfc⟩,h01,fun z hz => hf hz⟩ + +def massGridBump (r : ℝ) (i : ℤ×ℤ) : C(upperHalfPlane,ℝ) := + ⟨fun z => max 0 (min 1 ((3*r-dist (z:ℂ) (coverGridCenter r i))/r)), by fun_prop⟩ + +def massGridCutoff (χ : C_c(upperHalfPlane,ℝ)) (r : ℝ) (i : ℤ×ℤ) : + C_c(upperHalfPlane,ℝ) := massGridBump r i • χ + +lemma massGridBump_bounds (r : ℝ) (i : ℤ×ℤ) (z : upperHalfPlane) : + 0 ≤ massGridBump r i z ∧ massGridBump r i z ≤ 1 := by + exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ + +lemma massGridBump_eq_one {r : ℝ} (hr : 0 < r) (i : ℤ×ℤ) (z : upperHalfPlane) + (hz : dist (z:ℂ) (coverGridCenter r i) ≤ 2*r) : massGridBump r i z = 1 := by + have hh : 1 ≤ (3*r-dist (z:ℂ) (coverGridCenter r i))/r := (le_div_iff₀ hr).mpr (by linarith) + simp only [massGridBump,ContinuousMap.coe_mk,min_eq_left hh,max_eq_right (by norm_num : (0:ℝ)≤1)] + +lemma massGridBump_eq_zero {r : ℝ} (hr : 0 < r) (i : ℤ×ℤ) (z : upperHalfPlane) + (hz : 3*r < dist (z:ℂ) (coverGridCenter r i)) : massGridBump r i z = 0 := by + have hh : (3*r-dist (z:ℂ) (coverGridCenter r i))/r ≤ 0 := + div_nonpos_of_nonpos_of_nonneg (by linarith) hr.le + apply max_eq_left + exact (min_le_right _ _).trans hh + +lemma massGridCutoff_bounds (χ : C_c(upperHalfPlane,ℝ)) + (hχ : ∀ z, 0 ≤ χ z ∧ χ z ≤ 1) (r : ℝ) (i : ℤ×ℤ) (z : upperHalfPlane) : + 0 ≤ massGridCutoff χ r i z ∧ massGridCutoff χ r i z ≤ 1 := by + have hb := massGridBump_bounds r i z + change 0 ≤ massGridBump r i z * χ z ∧ massGridBump r i z * χ z ≤ 1 + exact ⟨mul_nonneg hb.1 (hχ z).1,(mul_le_mul_of_nonneg_right hb.2 (hχ z).1).trans (by simpa only [one_mul] using (hχ z).2)⟩ + +lemma massGridCutoff_eq_one (χ : C_c(upperHalfPlane,ℝ)) {r : ℝ} (hr : 0 < r) + (i : ℤ×ℤ) (z : upperHalfPlane) (hχ : χ z = 1) + (hz : dist (z:ℂ) (coverGridCenter r i) ≤ 2*r) : massGridCutoff χ r i z = 1 := by + change massGridBump r i z * χ z = 1 + rw [massGridBump_eq_one hr i z hz,hχ,one_mul] + +lemma massGridCutoff_support (χ : C_c(upperHalfPlane,ℝ)) {r : ℝ} (hr : 0 < r) + (i : ℤ×ℤ) (z : ℂ) (hz : extendHalfPlaneTest (massGridCutoff χ r i) z ≠ 0) : + dist z (coverGridCenter r i) ≤ 3*r := by + by_cases hH : z ∈ upperHalfPlane + · by_contra h + have he := massGridBump_eq_zero hr i ⟨z,hH⟩ (lt_of_not_ge h) + apply hz + rw [show z = (⟨z,hH⟩ : upperHalfPlane).val from rfl,extendHalfPlaneTest_apply] + change massGridBump r i ⟨z,hH⟩ * χ ⟨z,hH⟩ = 0 + rw [he,zero_mul] + · exact False.elim (hz (extendHalfPlaneTest_of_not_mem _ z hH)) + +lemma massGridCutoff_common_support (χ : C_c(upperHalfPlane,ℝ)) (r : ℝ) (i : ℤ×ℤ) + (z : ℂ) (hz : z ∉ (Subtype.val : upperHalfPlane → ℂ) '' tsupport χ) : + extendHalfPlaneTest (massGridCutoff χ r i) z = 0 := by + by_cases hH : z ∈ upperHalfPlane + · let x : upperHalfPlane := ⟨z,hH⟩ + have hχ : χ x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hz ⟨x,h,rfl⟩) + change extendHalfPlaneTest (massGridCutoff χ r i) x = 0 + rw [extendHalfPlaneTest_apply] + change massGridBump r i x * χ x = 0 + rw [hχ,mul_zero] + · exact extendHalfPlaneTest_of_not_mem _ z hH + +lemma massGridCutoff_sum_bound (χ : C_c(upperHalfPlane,ℝ)) + (hχ : ∀ z, 0 ≤ χ z ∧ χ z ≤ 1) {r : ℝ} (hr : 0 < r) (I : Finset (ℤ×ℤ)) + (x y : ℂ) : + (∑ i ∈ I, ENNReal.ofReal (extendHalfPlaneTest (massGridCutoff χ r i) x) * + ENNReal.ofReal (extendHalfPlaneTest (massGridCutoff χ r i) y)) ≤ + if dist x y ≤ 6*r then 81 else 0 := by + refine massGrid_cutoff_product_sum_le hr I + (fun i z => ENNReal.ofReal (extendHalfPlaneTest (massGridCutoff χ r i) z)) ?_ ?_ x y + · intro i z + apply ENNReal.ofReal_le_one.mpr + by_cases hH : z ∈ upperHalfPlane + · rw [show z = (⟨z,hH⟩ : upperHalfPlane).val from rfl,extendHalfPlaneTest_apply] + exact (massGridCutoff_bounds χ hχ r i ⟨z,hH⟩).2 + · rw [extendHalfPlaneTest_of_not_mem _ z hH] + norm_num + · intro i z hz + apply massGridCutoff_support χ hr i z + intro he + exact hz (by rw [he,ENNReal.ofReal_zero]) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassGridOverlap.lean b/lean/OAI/Probability/SLE/Mass/MassGridOverlap.lean new file mode 100644 index 0000000000000000000000000000000000000000..532a8125098f8de274361345035f2d2b2a9bf623 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassGridOverlap.lean @@ -0,0 +1,91 @@ +import OAI.Probability.SLE.Gauge.CoverGrid + +namespace OAI + +/-! A fixed overlap bound for planar mass cutoffs on the physical grid. -/ + +noncomputable section +open Set Metric Filter MeasureTheory Classical +open scoped ENNReal + +namespace SLEExactGauge + +lemma massGrid_coordinate_bounds {r x : ℝ} (hr : 0 < r) (i : ℤ) + (hi : |x-r*(i:ℝ)| ≤ 3*r) : + ⌊x/r⌋-4 ≤ i ∧ i ≤ ⌊x/r⌋+4 := by + have hf : r*(⌊x/r⌋:ℝ) ≤ x := by + have hh := mul_le_mul_of_nonneg_left (Int.floor_le (x/r)) hr.le + rwa [mul_div_cancel₀ _ hr.ne'] at hh + have hg : x < r*((⌊x/r⌋:ℝ)+1) := by + have hh := mul_lt_mul_of_pos_left (Int.lt_floor_add_one (x/r)) hr + rwa [mul_div_cancel₀ _ hr.ne'] at hh + have hlo : ((⌊x/r⌋-4:ℤ):ℝ) ≤ (i:ℝ) := by + push_cast + nlinarith [abs_le.mp hi] + have hhi : (i:ℝ) ≤ ((⌊x/r⌋+4:ℤ):ℝ) := by + push_cast + nlinarith [abs_le.mp hi] + exact ⟨by exact_mod_cast hlo,by exact_mod_cast hhi⟩ + +lemma massGrid_nearby_card_le {r : ℝ} (hr : 0 < r) (I : Finset (ℤ×ℤ)) (z : ℂ) : + (I.filter (fun ij => dist z (coverGridCenter r ij) ≤ 3*r)).card ≤ 81 := by + let J := (Finset.Icc (⌊z.re/r⌋-4) (⌊z.re/r⌋+4)) ×ˢ + (Finset.Icc (⌊z.im/r⌋-4) (⌊z.im/r⌋+4)) + have hsub : I.filter (fun ij => dist z (coverGridCenter r ij) ≤ 3*r) ⊆ J := by + intro ij hij + have hd := (Finset.mem_filter.mp hij).2 + have hre : |z.re-r*(ij.1:ℝ)| ≤ 3*r := by + have h := (Complex.abs_re_le_norm (z-coverGridCenter r ij)).trans + (by simpa only [dist_eq_norm] using hd) + simpa [coverGridCenter] using h + have him : |z.im-r*(ij.2:ℝ)| ≤ 3*r := by + have h := (Complex.abs_im_le_norm (z-coverGridCenter r ij)).trans + (by simpa only [dist_eq_norm] using hd) + simpa [coverGridCenter] using h + simpa only [J,Finset.mem_product,Finset.mem_Icc] using + And.intro (massGrid_coordinate_bounds hr ij.1 hre) (massGrid_coordinate_bounds hr ij.2 him) + have hcard : J.card = 81 := by + simp only [J,Finset.card_product,Int.card_Icc] + rw [show ⌊z.re/r⌋+4+1-(⌊z.re/r⌋-4) = (9:ℤ) by omega, + show ⌊z.im/r⌋+4+1-(⌊z.im/r⌋-4) = (9:ℤ) by omega] + rfl + exact (Finset.card_le_card hsub).trans_eq hcard + +lemma massGrid_cutoff_product_sum_le {r : ℝ} (hr : 0 < r) (I : Finset (ℤ×ℤ)) + (f : (ℤ×ℤ) → ℂ → ℝ≥0∞) (hf : ∀ i z, f i z ≤ 1) + (hs : ∀ i z, f i z ≠ 0 → dist z (coverGridCenter r i) ≤ 3*r) + (x y : ℂ) : + (∑ i ∈ I, f i x * f i y) ≤ if dist x y ≤ 6*r then 81 else 0 := by + by_cases hxy : dist x y ≤ 6*r + · rw [ite_eq_left hxy] + let J := I.filter (fun i => dist x (coverGridCenter r i) ≤ 3*r) + have he : (∑ i ∈ I, f i x * f i y) = ∑ i ∈ J, f i x * f i y := by + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro i hi hij + have hx : f i x = 0 := by + by_contra h + exact hij (Finset.mem_filter.mpr ⟨hi,hs i x h⟩) + simp only [hx,zero_mul] + rw [he] + calc + _ ≤ ∑ _i ∈ J, (1 : ℝ≥0∞) := + Finset.sum_le_sum (fun i _ => (mul_le_mul' (hf i x) (hf i y)).trans_eq (one_mul 1)) + _ = J.card := by simp + _ ≤ 81 := by exact_mod_cast massGrid_nearby_card_le hr I x + · rw [ite_eq_right hxy] + apply le_of_eq + apply Finset.sum_eq_zero + intro i hi + by_cases hx : f i x = 0 + · simp only [hx,zero_mul] + by_cases hy : f i y = 0 + · simp only [hy,mul_zero] + exact False.elim (hxy ((dist_triangle_right x y (coverGridCenter r i)).trans + (by linarith [hs i x hx,hs i y hy]))) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassKernelUniqueness.lean b/lean/OAI/Probability/SLE/Mass/MassKernelUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a545c4ab0ed8b47b53c39397b7889a34151c383 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassKernelUniqueness.lean @@ -0,0 +1,51 @@ +import OAI.Probability.SLE.Mass.MassMartingaleUniqueness + +namespace OAI + +/-! Equal terminal remainder kernels yield a martingale difference; continuity +and increasing integrable masses then imply uniqueness. -/ + +noncomputable section +open MeasureTheory Filter +open scoped Topology NNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsFiniteMeasure P] + {ℱ : Filtration ℝ≥0 ‹MeasurableSpace Ω›} + +lemma mass_difference_martingale_of_terminal_mean + (A B : ℝ≥0 → Ω → ℝ) (Z : Ω → ℝ) (hZ : Integrable Z P) + (hAm : StronglyAdapted ℱ A) (hBm : StronglyAdapted ℱ B) + (hAI : ∀ t, Integrable (A t) P) (hBI : ∀ t, Integrable (B t) P) + (hmean : ∀ t E, MeasurableSet[ℱ t] E → + (∫ ω in E, A t ω-B t ω ∂P) = ∫ ω in E, Z ω ∂P) : + Martingale (fun t ω => A t ω-B t ω) ℱ P := by + have he (t : ℝ≥0) : (fun ω => A t ω-B t ω) =ᵐ[P] P[Z | ℱ t] := by + apply ae_eq_condExp_of_forall_setIntegral_eq (ℱ.le t) hZ + (fun E _ _ => ((hAI t).sub (hBI t)).integrableOn) + (fun E hE _ => hmean t E hE) + exact ((hAm t).sub (hBm t)).aestronglyMeasurable + exact (martingale_condExp Z ℱ P).congr (hAm.sub hBm) + (fun t => (he t).symm) + +theorem increasing_mass_unique_of_terminal_mean + (A B : ℝ≥0 → Ω → ℝ) (Z : Ω → ℝ) (hZ : Integrable Z P) + (hAm : StronglyAdapted ℱ A) (hBm : StronglyAdapted ℱ B) + (hAI : ∀ t, Integrable (A t) P) (hBI : ∀ t, Integrable (B t) P) + (hmean : ∀ t E, MeasurableSet[ℱ t] E → + (∫ ω in E, A t ω-B t ω ∂P) = ∫ ω in E, Z ω ∂P) + (hA : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hB : ∀ᵐ ω ∂P, Monotone (fun t => B t ω)) + (hA0 : A 0 =ᵐ[P] 0) (hB0 : B 0 =ᵐ[P] 0) + (hcont : ∀ᵐ ω ∂P, Continuous (fun t => A t ω-B t ω)) : + ∀ᵐ ω ∂P, ∀ t, A t ω = B t ω := + increasing_mass_martingale_indistinguishable A B + (mass_difference_martingale_of_terminal_mean A B Z hZ hAm hBm hAI hBI hmean) + hA hB hA0 hB0 hAI hBI hcont + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassMartingaleTesting.lean b/lean/OAI/Probability/SLE/Mass/MassMartingaleTesting.lean new file mode 100644 index 0000000000000000000000000000000000000000..e83d61b25c4a08d35f37a0475ead53b4f27f7240 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassMartingaleTesting.lean @@ -0,0 +1,75 @@ +import OAI.Probability.SLE.Mass.MassUniquenessSeparation +import Mathlib.Probability.Martingale.Basic +import Mathlib.MeasureTheory.Function.ConditionalExpectation.PullOut + +namespace OAI + +/-! Bounded predictable testing of the increments in the mass uniqueness proof. -/ + +noncomputable section +open MeasureTheory Filter +open scoped Topology NNReal + +namespace SLEExactGauge + +lemma massSeparationTest_continuous : Continuous massSeparationTest := + continuous_iff_continuousAt.mpr (fun x => (massSeparationTest_hasDerivAt x).continuousAt) + +lemma massSeparationSlope_continuous : Continuous massSeparationSlope := + continuous_iff_continuousAt.mpr (fun x => (massSeparationSlope_hasDerivAt x).continuousAt) + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsFiniteMeasure P] + {ℱ : Filtration ℝ≥0 ‹MeasurableSpace Ω›} {M : ℝ≥0 → Ω → ℝ} + +omit [IsFiniteMeasure P] in +lemma martingale_mass_test_integrable (hM : Martingale M ℱ P) (t : ℝ≥0) : + Integrable (fun ω => massSeparationTest (M t ω)) P := by + apply ((hM.integrable t).norm.const_mul 2).mono' + (massSeparationTest_continuous.comp_stronglyMeasurable + ((hM.stronglyMeasurable t).mono (ℱ.le t))).aestronglyMeasurable + filter_upwards [] with ω + simpa only [Real.norm_eq_abs,massSeparationTest_zero,sub_zero] using + massSeparationTest_lipschitz 0 (M t ω) + +omit [IsFiniteMeasure P] in +lemma martingale_mass_weighted_increment_integrable (hM : Martingale M ℱ P) + (s t : ℝ≥0) : + Integrable (fun ω => massSeparationSlope (M s ω)*(M t ω-M s ω)) P := by + exact ((hM.integrable t).sub (hM.integrable s)).bdd_mul + (massSeparationSlope_continuous.comp_stronglyMeasurable + ((hM.stronglyMeasurable s).mono (ℱ.le s))).aestronglyMeasurable + (ae_of_all _ (fun ω => by simpa only [Real.norm_eq_abs] using + massSeparationSlope_abs_le (M s ω))) + +lemma martingale_mass_weighted_increment_mean (hM : Martingale M ℱ P) + {s t : ℝ≥0} (hst : s ≤ t) : + (∫ ω, massSeparationSlope (M s ω)*(M t ω-M s ω) ∂P) = 0 := by + have hg := (hM.integrable t).sub (hM.integrable s) + have hfg := martingale_mass_weighted_increment_integrable hM s t + have hCE : P[(fun ω => M t ω-M s ω) | ℱ s] =ᵐ[P] 0 := by + have hsub := condExp_sub (hM.integrable t) (hM.integrable s) (ℱ s) + have hs : P[M s | ℱ s] = M s := + condExp_of_stronglyMeasurable (ℱ.le s) (hM.stronglyMeasurable s) (hM.integrable s) + filter_upwards [hsub,hM.condExp_ae_eq hst] with ω hω htω + simp only [Pi.sub_apply,hs,htω,sub_self,Pi.zero_apply] at hω ⊢ + exact hω + have hpull := condExp_mul_of_stronglyMeasurable_left + (massSeparationSlope_continuous.comp_stronglyMeasurable (hM.stronglyMeasurable s)) hfg hg + calc + _ = ∫ ω, P[(fun ω => massSeparationSlope (M s ω)*(M t ω-M s ω)) | ℱ s] ω ∂P := + (integral_condExp (ℱ.le s)).symm + _ = 0 := by + have he : P[(fun ω => massSeparationSlope (M s ω)*(M t ω-M s ω)) | ℱ s] =ᵐ[P] 0 := by + filter_upwards [hpull,hCE] with ω hp hc + change P[(fun ω => massSeparationSlope (M s ω)*(M t ω-M s ω)) | ℱ s] ω = + massSeparationSlope (M s ω)*P[(fun ω => M t ω-M s ω) | ℱ s] ω at hp + change P[(fun ω => M t ω-M s ω) | ℱ s] ω = 0 at hc + simpa only [hc,mul_zero,Pi.zero_apply] using hp + rw [integral_congr_ae he] + simp + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassMartingaleUniqueness.lean b/lean/OAI/Probability/SLE/Mass/MassMartingaleUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..440fd58ec35261f55e2ae60dc40c4d067a546eaa --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassMartingaleUniqueness.lean @@ -0,0 +1,123 @@ +import OAI.Probability.SLE.Mass.MassUniquenessMesh +import OAI.Probability.SLE.Mass.MassMartingaleTesting +import Mathlib.MeasureTheory.Integral.DominatedConvergence +import Mathlib.Topology.DenseEmbedding + +namespace OAI + +/-! Uniqueness of a continuous mass process from its integrable increasing +variation and martingale difference. No second moment is imposed on a competing +mass construction. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsFiniteMeasure P] + {ℱ : Filtration ℝ≥0 ‹MeasurableSpace Ω›} (A B : ℝ≥0 → Ω → ℝ) + +/-- A continuous martingale which is the difference of two increasing processes +starting at zero vanishes, using only integrability of the two endpoint masses. -/ +theorem increasing_mass_martingale_eq_at + (hM : Martingale (fun t ω => A t ω-B t ω) ℱ P) + (hA : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hB : ∀ᵐ ω ∂P, Monotone (fun t => B t ω)) + (hA0 : A 0 =ᵐ[P] 0) (hB0 : B 0 =ᵐ[P] 0) + (T : ℝ≥0) (hAI : Integrable (A T) P) (hBI : Integrable (B T) P) + (hcont : ∀ᵐ ω ∂P, ContinuousOn (fun t => A t ω-B t ω) (Icc 0 T)) : + A T =ᵐ[P] B T := by + let M : ℝ≥0 → Ω → ℝ := fun t ω => A t ω-B t ω + let X : ℕ → Ω → ℝ := fun n ω => + massPartitionRemainder (fun i => M (massTimeMesh T n i) ω) (n+1) + have hXint (n : ℕ) : Integrable (X n) P := by + have hsum : Integrable (fun ω => ∑ i ∈ Finset.range (n+1), + massSeparationSlope (M (massTimeMesh T n i) ω)* + (M (massTimeMesh T n (i+1)) ω-M (massTimeMesh T n i) ω)) P := + integrable_finsetSum _ (fun i _ => + martingale_mass_weighted_increment_integrable hM _ _) + exact ((martingale_mass_test_integrable hM _).sub + (martingale_mass_test_integrable hM _)).sub hsum + have hXmean (n : ℕ) : (∫ ω, X n ω ∂P) = ∫ ω, massSeparationTest (M T ω) ∂P := by + have hsum (i : ℕ) := martingale_mass_weighted_increment_integrable hM + (massTimeMesh T n i) (massTimeMesh T n (i+1)) + change (∫ ω, massSeparationTest (M (massTimeMesh T n (n+1)) ω)- + massSeparationTest (M (massTimeMesh T n 0) ω)- + ∑ i ∈ Finset.range (n+1), massSeparationSlope (M (massTimeMesh T n i) ω)* + (M (massTimeMesh T n (i+1)) ω-M (massTimeMesh T n i) ω) ∂P) = _ + rw [massTimeMesh_end,massTimeMesh_zero, + integral_sub (f := fun ω => massSeparationTest (M T ω)-massSeparationTest (M 0 ω)) + (g := fun ω => ∑ i ∈ Finset.range (n+1), massSeparationSlope (M (massTimeMesh T n i) ω)* + (M (massTimeMesh T n (i+1)) ω-M (massTimeMesh T n i) ω)) + ((martingale_mass_test_integrable hM T).sub + (martingale_mass_test_integrable hM 0)) (integrable_finsetSum _ (fun i _ => hsum i)), + integral_sub (f := fun ω => massSeparationTest (M T ω)) + (g := fun ω => massSeparationTest (M 0 ω)) + (martingale_mass_test_integrable hM T) (martingale_mass_test_integrable hM 0), + integral_finsetSum _ (fun i _ => hsum i)] + have hzero : (fun ω => massSeparationTest (M 0 ω)) =ᵐ[P] 0 := by + filter_upwards [hA0,hB0] with ω ha hb + simp only [M,ha,hb,Pi.zero_apply,sub_self,massSeparationTest_zero] + have hmeans : (∑ i ∈ Finset.range (n+1), ∫ ω, + massSeparationSlope (M (massTimeMesh T n i) ω)* + (M (massTimeMesh T n (i+1)) ω-M (massTimeMesh T n i) ω) ∂P) = 0 := by + apply Finset.sum_eq_zero + intro i _ + exact martingale_mass_weighted_increment_mean hM (massTimeMesh_mono T n (Nat.le_succ i)) + simp only [M] at hmeans + rw [integral_congr_ae hzero,hmeans] + simp + have hbound (n : ℕ) : ∀ᵐ ω ∂P, ‖X n ω‖ ≤ 4*(A T ω+B T ω) := by + filter_upwards [hA,hB,hA0,hB0] with ω ha hb ha0 hb0 + calc + _ ≤ 4*∑ i ∈ Finset.range (n+1), + |M (massTimeMesh T n (i+1)) ω-M (massTimeMesh T n i) ω| := by + simpa only [X,Real.norm_eq_abs] using massPartitionRemainder_linear + (fun i => M (massTimeMesh T n i) ω) (n+1) + _ ≤ 4*((A T ω-A 0 ω)+(B T ω-B 0 ω)) := + mul_le_mul_of_nonneg_left (massDifference_mesh_variation + (fun t => A t ω) (fun t => B t ω) ha hb T n) (by norm_num) + _ = _ := by simp only [ha0,hb0,Pi.zero_apply,sub_zero] + have hlim : ∀ᵐ ω ∂P, Tendsto (fun n => X n ω) atTop (𝓝 0) := by + filter_upwards [hA,hB,hcont] with ω ha hb hc + exact massDifference_mesh_remainder_tendsto (fun t => A t ω) (fun t => B t ω) ha hb T hc + have hI := tendsto_integral_of_dominated_convergence (fun ω => 4*(A T ω+B T ω)) + (fun n => (hXint n).aestronglyMeasurable) ((hAI.add hBI).const_mul 4) hbound hlim + simp only [integral_zero,hXmean] at hI + have htest0 : (∫ ω, massSeparationTest (M T ω) ∂P) = 0 := + tendsto_nhds_unique tendsto_const_nhds hI + have hae := (integral_eq_zero_iff_of_nonneg + (fun ω => massSeparationTest_nonneg (M T ω)) + (martingale_mass_test_integrable hM T)).mp htest0 + filter_upwards [hae] with ω hω + exact sub_eq_zero.mp ((massSeparationTest_eq_zero (M T ω)).mp hω) + +/-- The fixed-time result holds simultaneously at every time by continuity and +a countable dense family of deterministic times. -/ +theorem increasing_mass_martingale_indistinguishable + (hM : Martingale (fun t ω => A t ω-B t ω) ℱ P) + (hA : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hB : ∀ᵐ ω ∂P, Monotone (fun t => B t ω)) + (hA0 : A 0 =ᵐ[P] 0) (hB0 : B 0 =ᵐ[P] 0) + (hAI : ∀ T, Integrable (A T) P) (hBI : ∀ T, Integrable (B T) P) + (hcont : ∀ᵐ ω ∂P, Continuous (fun t => A t ω-B t ω)) : + ∀ᵐ ω ∂P, ∀ t, A t ω = B t ω := by + have heq (t : ℝ≥0) : A t =ᵐ[P] B t := + increasing_mass_martingale_eq_at A B hM hA hB hA0 hB0 t (hAI t) (hBI t) + (hcont.mono (fun _ h => h.continuousOn)) + have hcount : ∀ᵐ ω ∂P, ∀ n : ℕ, + A (TopologicalSpace.denseSeq ℝ≥0 n) ω = B (TopologicalSpace.denseSeq ℝ≥0 n) ω := + ae_all_iff.mpr (fun n => heq _) + filter_upwards [hcount,hcont] with ω he hc + have hfun : (fun t => A t ω-B t ω) = fun _ => 0 := + (TopologicalSpace.denseRange_denseSeq ℝ≥0).equalizer hc continuous_const + (funext (fun n => sub_eq_zero.mpr (he n))) + intro t + exact sub_eq_zero.mp (congr_fun hfun t) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassPotentialCompensator.lean b/lean/OAI/Probability/SLE/Mass/MassPotentialCompensator.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7570827c5c8ee745b512f641d6361dd365fbc37 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassPotentialCompensator.lean @@ -0,0 +1,57 @@ +import OAI.Probability.SLE.Mass.MassCompensatorVariance + +namespace OAI + +/-! A remaining-mass potential determines the predictable mass increments. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +/-- The difference of the current potential and the one-step averaged +future potential is the conditional expectation of the mass increment. -/ +theorem remainingPotential_increment + (ℱ : Filtration ℕ mΩ) (A V : ℕ → Ω → ℝ) (L : Ω → ℝ) + (hA : StronglyAdapted ℱ A) (hAI : ∀ i, Integrable (A i) P) (hLI : Integrable L P) + (hV : ∀ i, V i =ᵐ[P] P[L-A i|ℱ i]) (i : ℕ) : + V i-P[V (i+1)|ℱ i] =ᵐ[P] P[A (i+1)-A i|ℱ i] := by + have hnext := (condExp_congr_ae (m := ℱ i) (hV (i+1))).trans + (condExp_condExp_of_le (ℱ.mono (Nat.le_succ i)) (ℱ.le (i+1))) + have hcur := (hV i).trans (condExp_sub hLI (hAI i) (ℱ i)) + have hnext' := hnext.trans (condExp_sub hLI (hAI (i+1)) (ℱ i)) + have hinc := condExp_sub (hAI (i+1)) (hAI i) (ℱ i) + have hz := condExp_of_stronglyMeasurable (ℱ.le i) (hA i) (hAI i) + filter_upwards [hcur,hnext',hinc] with ω hc hn hi + simp only [Pi.sub_apply,hz] at hc hn hi ⊢ + linarith + +omit [IsProbabilityMeasure P] in +/-- Pathwise telescoping after identifying each predictable increment. -/ +lemma predictable_mass_sum_eq + (ℱ : Filtration ℕ mΩ) (A : ℕ → Ω → ℝ) + (q : ℕ → Ω → ℝ) + (hq : ∀ i, q i =ᵐ[P] P[A (i+1)-A i|ℱ i]) (N : ℕ) : + (fun ω => ∑ i ∈ Finset.range N, q i ω) =ᵐ[P] + fun ω => A N ω-A 0 ω-centeredMassPartialSum P ℱ + (fun i => A (i+1)-A i) N ω := by + filter_upwards [ae_all_iff.mpr hq] with ω hω + simp only [centeredMassPartialSum,Pi.sub_apply] + have hs := Finset.sum_sub_distrib (s := Finset.range N) + (f := fun i => A (i+1) ω-A i ω) + (g := fun i => condExp (ℱ i) P (A (i+1)-A i) ω) + rw [Finset.sum_range_sub (fun i => A i ω) N] at hs + have hq' : (∑ i ∈ Finset.range N, q i ω) = + ∑ i ∈ Finset.range N, condExp (ℱ i) P (A (i+1)-A i) ω := + Finset.sum_congr rfl (fun i _ => hω i) + rw [hq'] + linarith + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassUniquenessMesh.lean b/lean/OAI/Probability/SLE/Mass/MassUniquenessMesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..140fee9dd44795b2834210e4469e49c9b33ff3d4 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassUniquenessMesh.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Mass.MassUniquenessPartitions +import Mathlib.Topology.Instances.NNReal.Lemmas +import Mathlib.Topology.UniformSpace.HeineCantor + +namespace OAI + +/-! Uniform finite time partitions used in the continuous-mass uniqueness proof. -/ + +noncomputable section +open Set Filter +open scoped Topology NNReal + +namespace SLEExactGauge + +def massTimeMesh (T : ℝ≥0) (n i : ℕ) : ℝ≥0 := T*(i:ℝ≥0)/(n+1:ℝ≥0) + +@[simp] lemma massTimeMesh_zero (T : ℝ≥0) (n : ℕ) : massTimeMesh T n 0 = 0 := by + simp [massTimeMesh] + +@[simp] lemma massTimeMesh_end (T : ℝ≥0) (n : ℕ) : massTimeMesh T n (n+1) = T := by + simp [massTimeMesh] + +lemma massTimeMesh_mono (T : ℝ≥0) (n : ℕ) : Monotone (massTimeMesh T n) := by + intro i j hij + exact div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left (by exact_mod_cast hij) (show 0 ≤ T from zero_le)) + (by positivity) + +lemma massTimeMesh_mem (T : ℝ≥0) (n i : ℕ) (hi : i ≤ n+1) : + massTimeMesh T n i ∈ Icc 0 T := by + exact ⟨zero_le,(massTimeMesh_mono T n hi).trans_eq (massTimeMesh_end T n)⟩ + +lemma massTimeMesh_dist (T : ℝ≥0) (n i : ℕ) : + dist (massTimeMesh T n (i+1)) (massTimeMesh T n i) = (T:ℝ)/(n+1:ℝ) := by + rw [NNReal.dist_eq] + simp only [massTimeMesh,NNReal.coe_div,NNReal.coe_mul,NNReal.coe_natCast,NNReal.coe_add, + NNReal.coe_one,Nat.cast_add,Nat.cast_one] + rw [show (T:ℝ)*(i+1:ℝ)/(n+1)-(T:ℝ)*(i:ℝ)/(n+1) = T/(n+1) by ring, + abs_of_nonneg (by positivity)] + +lemma massTimeMesh_small_increments (T : ℝ≥0) (f : ℝ≥0 → ℝ) + (hf : ContinuousOn f (Icc 0 T)) : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n in atTop, + ∀ i < n+1, |f (massTimeMesh T n (i+1))-f (massTimeMesh T n i)| ≤ ε := by + intro ε hε + obtain ⟨δ,hδ,hfδ⟩ := Metric.uniformContinuousOn_iff.mp + (isCompact_Icc.uniformContinuousOn_of_continuous hf) ε hε + have hlim : Tendsto (fun n : ℕ => (T:ℝ)/(n+1:ℝ)) atTop (𝓝 0) := by + simpa only [mul_one_div,mul_zero] using + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul (T:ℝ) + filter_upwards [hlim.eventually (gt_mem_nhds hδ)] with n hn i hi + have h := hfδ (massTimeMesh T n (i+1)) (massTimeMesh_mem T n (i+1) (by omega)) + (massTimeMesh T n i) (massTimeMesh_mem T n i (by omega)) + (by simpa only [massTimeMesh_dist] using hn) + exact le_of_lt (by simpa only [Real.dist_eq] using h) + +lemma massDifference_mesh_variation (A B : ℝ≥0 → ℝ) + (hA : Monotone A) (hB : Monotone B) (T : ℝ≥0) (n : ℕ) : + (∑ i ∈ Finset.range (n+1), + |(A (massTimeMesh T n (i+1))-B (massTimeMesh T n (i+1)))- + (A (massTimeMesh T n i)-B (massTimeMesh T n i))|) ≤ + (A T-A 0)+(B T-B 0) := by + simpa only [Function.comp_def,massTimeMesh_zero,massTimeMesh_end] using + massDifference_partition_variation (A ∘ massTimeMesh T n) (B ∘ massTimeMesh T n) + (hA.comp (massTimeMesh_mono T n)) (hB.comp (massTimeMesh_mono T n)) (n+1) + +lemma massDifference_mesh_remainder_tendsto (A B : ℝ≥0 → ℝ) + (hA : Monotone A) (hB : Monotone B) (T : ℝ≥0) + (hcont : ContinuousOn (fun t => A t-B t) (Icc 0 T)) : + Tendsto (fun n => massPartitionRemainder + (fun i => A (massTimeMesh T n i)-B (massTimeMesh T n i)) (n+1)) atTop (𝓝 0) := by + exact massPartitionRemainder_tendsto_zero _ _ ((A T-A 0)+(B T-B 0)) + (add_nonneg (sub_nonneg.mpr (hA zero_le)) (sub_nonneg.mpr (hB zero_le))) + (massDifference_mesh_variation A B hA hB T) + (massTimeMesh_small_increments T _ hcont) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassUniquenessPartitions.lean b/lean/OAI/Probability/SLE/Mass/MassUniquenessPartitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..50d56c511aa1e4a1b85880d66657abd8d1bf023f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassUniquenessPartitions.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SLE.Mass.MassUniquenessSeparation +import Mathlib.Analysis.SpecificLimits.Basic + +namespace OAI + +/-! Finite-variation estimates for the smooth separator on time partitions. -/ + +noncomputable section +open Set Filter +open scoped Topology NNReal + +namespace SLEExactGauge + +def massPartitionRemainder (x : ℕ → ℝ) (N : ℕ) : ℝ := + massSeparationTest (x N)-massSeparationTest (x 0) - + ∑ i ∈ Finset.range N, massSeparationSlope (x i)*(x (i+1)-x i) + +lemma massPartitionRemainder_eq_sum (x : ℕ → ℝ) (N : ℕ) : + massPartitionRemainder x N = ∑ i ∈ Finset.range N, + (massSeparationTest (x (i+1))-massSeparationTest (x i)- + massSeparationSlope (x i)*(x (i+1)-x i)) := by + rw [Finset.sum_sub_distrib, + Finset.sum_range_sub (fun i => massSeparationTest (x i)) N] + rfl + +lemma massPartitionRemainder_linear (x : ℕ → ℝ) (N : ℕ) : + |massPartitionRemainder x N| ≤ 4*∑ i ∈ Finset.range N, |x (i+1)-x i| := by + rw [massPartitionRemainder_eq_sum,Finset.mul_sum] + exact (Finset.abs_sum_le_sum_abs _ _).trans + (Finset.sum_le_sum (fun i _ => massSeparationTest_remainder_linear (x i) (x (i+1)))) + +lemma massPartitionRemainder_small (x : ℕ → ℝ) (N : ℕ) {ε : ℝ} + (hx : ∀ i < N, |x (i+1)-x i| ≤ ε) : + |massPartitionRemainder x N| ≤ (8*ε)*∑ i ∈ Finset.range N, |x (i+1)-x i| := by + rw [massPartitionRemainder_eq_sum,Finset.mul_sum] + apply (Finset.abs_sum_le_sum_abs _ _).trans + apply Finset.sum_le_sum + intro i hi + exact (massSeparationTest_remainder_le (x i) (x (i+1))).trans (by + rw [pow_two,mul_assoc] + exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right (hx i (Finset.mem_range.mp hi)) (abs_nonneg _)) (by norm_num)) + +lemma massDifference_partition_variation (A B : ℕ → ℝ) + (hA : Monotone A) (hB : Monotone B) (N : ℕ) : + (∑ i ∈ Finset.range N, |(A (i+1)-B (i+1))-(A i-B i)|) ≤ + (A N-A 0)+(B N-B 0) := by + calc + _ ≤ ∑ i ∈ Finset.range N, ((A (i+1)-A i)+(B (i+1)-B i)) := by + apply Finset.sum_le_sum + intro i _ + have hAi : 0 ≤ A (i+1)-A i := sub_nonneg.mpr (hA (Nat.le_succ i)) + have hBi : 0 ≤ B (i+1)-B i := sub_nonneg.mpr (hB (Nat.le_succ i)) + calc + _ = |(A (i+1)-A i)-(B (i+1)-B i)| := by congr 1; ring + _ ≤ |A (i+1)-A i|+|B (i+1)-B i| := abs_sub _ _ + _ = _ := by rw [abs_of_nonneg hAi,abs_of_nonneg hBi] + _ = _ := by rw [Finset.sum_add_distrib,Finset.sum_range_sub,Finset.sum_range_sub] + +lemma massPartitionRemainder_tendsto_zero + (x : ℕ → ℕ → ℝ) (N : ℕ → ℕ) (D : ℝ) (hD : 0 ≤ D) + (hvar : ∀ n, (∑ i ∈ Finset.range (N n), |x n (i+1)-x n i|) ≤ D) + (hsmall : ∀ ε : ℝ, 0 < ε → ∀ᶠ n in atTop, ∀ i < N n, |x n (i+1)-x n i| ≤ ε) : + Tendsto (fun n => massPartitionRemainder (x n) (N n)) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + let η := ε/(16*(D+1)) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨n₀,hn₀⟩ := eventually_atTop.mp (hsmall η hη) + refine ⟨n₀,fun n hn => ?_⟩ + rw [Real.dist_eq,sub_zero] + calc + _ ≤ (8*η)*∑ i ∈ Finset.range (N n), |x n (i+1)-x n i| := + massPartitionRemainder_small (x n) (N n) (hn₀ n hn) + _ ≤ (8*η)*D := mul_le_mul_of_nonneg_left (hvar n) (by positivity) + _ < ε := by + dsimp only [η] + have hpos : 0 < D+1 := by linarith + rw [show 8*(ε/(16*(D+1)))*D = (8*ε*D)/(16*(D+1)) by ring] + apply (div_lt_iff₀ (by positivity : 0 < 16*(D+1))).mpr + nlinarith + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MassUniquenessSeparation.lean b/lean/OAI/Probability/SLE/Mass/MassUniquenessSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..06adc2c0210cb35a0eeeb9d6be1166304b4be97f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MassUniquenessSeparation.lean @@ -0,0 +1,124 @@ +import Mathlib.Analysis.Calculus.MeanValue +import Mathlib.Analysis.Calculus.Deriv.Pow +import Mathlib.Analysis.Calculus.Deriv.Inv +import Mathlib.Analysis.SpecialFunctions.Pow.Real + +namespace OAI + +/-! A bounded smooth test detecting a nonzero continuous finite-variation +martingale. Its bounded derivatives permit an integrable-variation argument. -/ + +noncomputable section +open Set +open scoped Topology + +namespace SLEExactGauge + +def massSeparationTest (x : ℝ) : ℝ := x^2 / (1+x^2) +def massSeparationSlope (x : ℝ) : ℝ := 2*x / (1+x^2)^2 + +theorem massSeparationTest_nonneg (x : ℝ) : 0 ≤ massSeparationTest x := by + unfold massSeparationTest + positivity + +@[simp] theorem massSeparationTest_zero : massSeparationTest 0 = 0 := by + norm_num [massSeparationTest] + +@[simp] theorem massSeparationTest_eq_zero (x : ℝ) : massSeparationTest x = 0 ↔ x = 0 := by + have hp : 0 < 1+x^2 := by positivity + simp only [massSeparationTest,div_eq_zero_iff,hp.ne',or_false,pow_eq_zero_iff (by decide : (2:ℕ) ≠ 0)] + +theorem massSeparationTest_hasDerivAt (x : ℝ) : + HasDerivAt massSeparationTest (massSeparationSlope x) x := by + have hd := ((hasDerivAt_id x).pow 2).div + ((hasDerivAt_const x 1).add ((hasDerivAt_id x).pow 2)) (by positivity : 1+x^2 ≠ 0) + convert hd using 1 + · rfl + · dsimp only [massSeparationSlope,id_eq,Pi.pow_apply,Pi.add_apply,Pi.div_apply] + field_simp + ring + +theorem massSeparationSlope_hasDerivAt (x : ℝ) : + HasDerivAt massSeparationSlope ((2-6*x^2)/(1+x^2)^3) x := by + have hd := ((hasDerivAt_id x).const_mul 2).div + (((hasDerivAt_const x 1).add ((hasDerivAt_id x).pow 2)).pow 2) + (by positivity : (1+x^2)^2 ≠ 0) + convert hd using 1 + · rfl + · dsimp only [id_eq,Pi.pow_apply,Pi.add_apply,Pi.div_apply] + field_simp + ring + +theorem massSeparationSlope_abs_le (x : ℝ) : |massSeparationSlope x| ≤ 2 := by + have hy : 0 ≤ x^2 := sq_nonneg x + have hx : |x| ≤ 1+x^2 := by + nlinarith [sq_nonneg (|x|-1),sq_abs x] + have hp : 0 < 1+x^2 := by positivity + rw [massSeparationSlope,abs_div,abs_mul,abs_of_pos (sq_pos_of_pos hp)] + norm_num only [abs_of_pos (by norm_num : (0:ℝ)<2)] + apply (div_le_iff₀ (sq_pos_of_pos hp)).mpr + nlinarith [sq_nonneg (x^2)] + +theorem massSeparationSlope_deriv_abs_le (x : ℝ) : + |(2-6*x^2)/(1+x^2)^3| ≤ 8 := by + have hp : 0 < 1+x^2 := by positivity + rw [abs_div,abs_of_pos (pow_pos hp 3)] + apply (div_le_iff₀ (pow_pos hp 3)).mpr + have hn : |2-6*x^2| ≤ 2+6*x^2 := by + have hh := abs_sub (2:ℝ) (6*x^2) + norm_num [abs_mul,abs_of_nonneg (sq_nonneg x)] at hh ⊢ + exact hh + have hb : 2+6*x^2 ≤ 8*(1+x^2)^3 := by + nlinarith [sq_nonneg (x^2),pow_nonneg (sq_nonneg x) 3] + exact hn.trans hb + +theorem massSeparationTest_lipschitz (x y : ℝ) : + |massSeparationTest y-massSeparationTest x| ≤ 2*|y-x| := by + have h := Convex.norm_image_sub_le_of_norm_deriv_le + (s := (univ:Set ℝ)) (f := massSeparationTest) (C := 2) (x := x) (y := y) + (fun z _ => (massSeparationTest_hasDerivAt z).differentiableAt) + (fun z _ => by simpa only [(massSeparationTest_hasDerivAt z).deriv,Real.norm_eq_abs] + using massSeparationSlope_abs_le z) convex_univ (mem_univ x) (mem_univ y) + simpa only [Real.norm_eq_abs] using h + +theorem massSeparationSlope_lipschitz (x y : ℝ) : + |massSeparationSlope y-massSeparationSlope x| ≤ 8*|y-x| := by + have h := Convex.norm_image_sub_le_of_norm_deriv_le + (s := (univ:Set ℝ)) (f := massSeparationSlope) (C := 8) (x := x) (y := y) + (fun z _ => (massSeparationSlope_hasDerivAt z).differentiableAt) + (fun z _ => by simpa only [(massSeparationSlope_hasDerivAt z).deriv,Real.norm_eq_abs] + using massSeparationSlope_deriv_abs_le z) convex_univ (mem_univ x) (mem_univ y) + simpa only [Real.norm_eq_abs] using h + +theorem massSeparationTest_remainder_le (x y : ℝ) : + |massSeparationTest y-massSeparationTest x-massSeparationSlope x*(y-x)| ≤ 8*|y-x|^2 := by + let f (z : ℝ) := massSeparationTest z-massSeparationTest x-massSeparationSlope x*(z-x) + have hd (z : ℝ) : HasDerivAt f (massSeparationSlope z-massSeparationSlope x) z := by + convert ((massSeparationTest_hasDerivAt z).sub_const + (massSeparationTest x)).sub (((hasDerivAt_id z).sub_const x).const_mul (massSeparationSlope x)) using 1 + · rfl + · ring + have h := Convex.norm_image_sub_le_of_norm_deriv_le + (s := Metric.closedBall x |y-x|) (f := f) (C := 8*|y-x|) (x := x) (y := y) + (fun z _ => (hd z).differentiableAt) + (fun z hz => by + rw [(hd z).deriv,Real.norm_eq_abs] + exact (massSeparationSlope_lipschitz x z).trans + (mul_le_mul_of_nonneg_left (by simpa only [Metric.mem_closedBall,Real.dist_eq] using hz) (by norm_num))) + (convex_closedBall x _) (Metric.mem_closedBall_self (abs_nonneg _)) + (by simp only [Metric.mem_closedBall,Real.dist_eq,le_refl]) + simpa only [f,sub_self,mul_zero,sub_zero,Real.norm_eq_abs,pow_two,mul_assoc] using h + +theorem massSeparationTest_remainder_linear (x y : ℝ) : + |massSeparationTest y-massSeparationTest x-massSeparationSlope x*(y-x)| ≤ 4*|y-x| := by + calc + _ ≤ |massSeparationTest y-massSeparationTest x|+|massSeparationSlope x*(y-x)| := abs_sub _ _ + _ ≤ 2*|y-x|+2*|y-x| := add_le_add (massSeparationTest_lipschitz x y) + (by rw [abs_mul]; exact mul_le_mul_of_nonneg_right (massSeparationSlope_abs_le x) (abs_nonneg _)) + _ = _ := by ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MomentLevels.lean b/lean/OAI/Probability/SLE/Mass/MomentLevels.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c44d6f5156901b6e8f582fa923f7ecc88b5f005 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MomentLevels.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SLE.MomentGauge + +namespace OAI + +/-! +The prescribed retained level in the first paper's moment-batch construction. +Its definition counts bad positive integer levels. Monotonicity makes those +levels an initial segment, so one plus their cardinal is a good level. +The moment convergence hypotheses here are explicit internal proof inputs. +-/ + +noncomputable section +open Set Filter +open scoped Topology + +namespace SLEExactGauge.Target + +theorem batchLevel_ge_one (κ : ℝ) (W : WienerLaw) (n : ℕ) : + 1 ≤ batchLevel κ W n := by + unfold batchLevel + omega + +theorem finite_bad_moment_levels (κ : ℝ) (W : WienerLaw) (n : ℕ) + (hm : 0 < moment κ W n) + (hlim : Tendsto (fun j : ℕ => finiteMoment κ W n j) atTop (𝓝 (moment κ W n))) : + {j : ℕ | 1 ≤ j ∧ finiteMoment κ W n j ≤ 3 * moment κ W n / 4}.Finite := by + have hlt : 3 * moment κ W n / 4 < moment κ W n := by linarith + have hevent : ∀ᶠ j : ℕ in atTop, 3 * moment κ W n / 4 < finiteMoment κ W n j := + (tendsto_order.mp hlim).1 _ hlt + obtain ⟨N, hN⟩ := eventually_atTop.mp hevent + apply (finite_Iio N).subset + intro j hj + show j < N + by_contra hjN + exact (not_le_of_gt (hN j (le_of_not_gt hjN))) hj.2 + +/-- The actual `Target.batchLevel`, not a separately chosen large level, +retains more than three quarters of the limiting moment. -/ +theorem finiteMoment_batchLevel_gt (κ : ℝ) (W : WienerLaw) (n : ℕ) + (hmono : Monotone (fun j : ℕ => finiteMoment κ W n j)) + (hm : 0 < moment κ W n) + (hlim : Tendsto (fun j : ℕ => finiteMoment κ W n j) atTop (𝓝 (moment κ W n))) : + 3 * moment κ W n / 4 < finiteMoment κ W n (batchLevel κ W n) := by + classical + let B := {j : ℕ // 1 ≤ j ∧ finiteMoment κ W n j ≤ 3 * moment κ W n / 4} + let : Finite B := (finite_bad_moment_levels κ W n hm hlim).to_subtype + by_contra hbad + have hbad' : finiteMoment κ W n (batchLevel κ W n) ≤ 3 * moment κ W n / 4 := + le_of_not_gt hbad + let f : Fin (batchLevel κ W n) → B := fun j => + ⟨(j : ℕ) + 1, by + refine ⟨by omega, ?_⟩ + exact (hmono (Nat.succ_le_of_lt j.isLt)).trans hbad'⟩ + have hinj : Function.Injective f := by + intro i j hij + apply Fin.ext + have hval := congrArg Subtype.val hij + dsimp only [f] at hval + omega + have hcard := Nat.card_le_card_of_injective f hinj + rw [Nat.card_fin] at hcard + change 1 + Nat.card B ≤ Nat.card B at hcard + omega + +theorem batchLevel_retains_moment (κ : ℝ) (W : WienerLaw) (n : ℕ) + (hmono : Monotone (fun j : ℕ => finiteMoment κ W n j)) + (hm : 0 < moment κ W n) + (hlim : Tendsto (fun j : ℕ => finiteMoment κ W n j) atTop (𝓝 (moment κ W n))) : + 1 ≤ batchLevel κ W n ∧ + 3 * moment κ W n / 4 < finiteMoment κ W n (batchLevel κ W n) := + ⟨batchLevel_ge_one κ W n, finiteMoment_batchLevel_gt κ W n hmono hm hlim⟩ + +end SLEExactGauge.Target + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/MonotoneMassExhaustion.lean b/lean/OAI/Probability/SLE/Mass/MonotoneMassExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0085bbbc4da7988eb1d5e5a8252c30de74d5382 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/MonotoneMassExhaustion.lean @@ -0,0 +1,33 @@ +import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence +import Mathlib.Topology.Order.MonotoneConvergence + +namespace OAI + +/-! Nonnegative decreasing remaining masses vanish almost surely when +their expectations tend to zero. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal Topology + +namespace SLEExactGauge + +theorem ae_tendsto_zero_of_antitone_lintegral + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (f : ℕ → Ω → ℝ≥0∞) + (hf : ∀ n, Measurable (f n)) (hanti : ∀ᵐ ω ∂P, Antitone (fun n => f n ω)) + (hmean : Tendsto (fun n => ∫⁻ ω, f n ω ∂P) atTop (𝓝 0)) : + ∀ᵐ ω ∂P, Tendsto (fun n => f n ω) atTop (𝓝 0) := by + have hi : (∫⁻ ω, liminf (fun n => f n ω) atTop ∂P) = 0 := by + apply le_zero_iff.mp + exact (lintegral_liminf_le hf).trans_eq hmean.liminf_eq + have hz := (lintegral_eq_zero_iff (Measurable.liminf hf)).mp hi + filter_upwards [hanti,hz] with ω ha hz + have ht := tendsto_atTop_iInf ha + have he : (⨅ n, f n ω) = 0 := ht.liminf_eq.symm.trans hz + rwa [he] at ht + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/NonnegativeL2Passage.lean b/lean/OAI/Probability/SLE/Mass/NonnegativeL2Passage.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb89ec6a62d1409302d5e5f51af74b64d4952715 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/NonnegativeL2Passage.lean @@ -0,0 +1,56 @@ +import OAI.Probability.SLE.ExponentialMartingales + +namespace OAI + +/-! Uniform second moments of terminal tests also control every smaller +nonnegative test, including tests evaluated at random times. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal Topology + +namespace SLEExactGauge + +lemma memLp_two_of_nonnegative_square_bound + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (X : Ω → ℝ) + (hm : Measurable X) (hX : ∀ ω, 0 ≤ X ω) + (M : ℝ≥0∞) (hM : M < ∞) + (hb : (∫⁻ ω, ENNReal.ofReal (X ω)^2 ∂P) ≤ M) : + MemLp X 2 P ∧ (∫ ω, X ω^2 ∂P) ≤ M.toReal := by + have hi : Integrable (fun ω => X ω^2) P := by + refine ⟨(hm.pow_const 2).aestronglyMeasurable,?_⟩ + apply (hasFiniteIntegral_iff_ofReal (ae_of_all _ (fun ω => sq_nonneg (X ω)))).mpr + simpa only [ENNReal.ofReal_pow (hX _)] using hb.trans_lt hM + have hmem := (memLp_two_iff_integrable_sq hm.aestronglyMeasurable).mpr hi + refine ⟨hmem,?_⟩ + have he : ENNReal.ofReal (∫ ω, X ω^2 ∂P) ≤ M := by + rw [ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun ω => sq_nonneg (X ω)))] + simpa only [ENNReal.ofReal_pow (hX _)] using hb + have ht := ENNReal.toReal_mono hM.ne he + rwa [ENNReal.toReal_ofReal (integral_nonneg (fun ω => sq_nonneg (X ω)))] at ht + +theorem integral_tendsto_of_nonnegative_L2_domination + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (X Z : ℕ → Ω → ℝ) (Y : Ω → ℝ) + (hXm : ∀ n, Measurable (X n)) (hX0 : ∀ n ω, 0 ≤ X n ω) + (hXZ : ∀ n ω, X n ω ≤ Z n ω) (hZ : ∀ n, MemLp (Z n) 2 P) + (A : ℝ) (hA : ∀ n, (∫ ω, Z n ω^2 ∂P) ≤ A) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun n => X n ω) atTop (𝓝 (Y ω))) : + Integrable Y P ∧ + Tendsto (fun n => ∫ ω, X n ω ∂P) atTop (𝓝 (∫ ω, Y ω ∂P)) := by + have hX (n : ℕ) : MemLp (X n) 2 P := + (hZ n).mono' (hXm n).aestronglyMeasurable + (ae_of_all _ (fun ω => by simpa only [Real.norm_of_nonneg (hX0 n ω)] using hXZ n ω)) + have hsq (n : ℕ) : (∫ ω, X n ω^2 ∂P) ≤ A := by + apply (integral_mono (hX n).integrable_sq (hZ n).integrable_sq ?_).trans (hA n) + intro ω + exact pow_le_pow_left₀ (hX0 n ω) (hXZ n ω) 2 + obtain ⟨hY,hL1⟩ := finite_L1_tendsto_of_square_bound hX A hsq hlim + exact ⟨hY,tendsto_integral_of_L1' Y + (Eventually.of_forall (fun n => (hX n).integrable (by norm_num))) hL1⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/NormalizedDiskCompensator.lean b/lean/OAI/Probability/SLE/Mass/NormalizedDiskCompensator.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff7d5699ec06f6824c83eea0e515783477c6c20f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/NormalizedDiskCompensator.lean @@ -0,0 +1,92 @@ +import OAI.Probability.SLE.Geometry.CanonicalNormalizedPotential +import OAI.Probability.SLE.Mass.CanonicalMassCompensator + +namespace OAI + +/-! Recovery of the actual canonical disk mass on the exact target +Brownian-time dyadic grid. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint.CanonicalMass + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {κ : ℝ} + {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (C : CanonicalMass P κ B hBm γ G) + +def normalizedDiskScalar (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) + (t : ℝ≥0) (ω : Ω) : ℝ := C.diskScalar θ hθ (t/κ.toNNReal) ω + +lemma normalizedDiskScalar_measurable (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) + (t : ℝ≥0) : Measurable (C.normalizedDiskScalar θ hθ t) := + (compactWeightedMass_measurable _ _ + (Target.diskSourceHalfPlane_compact hθ).measurableSet).comp + C.progressive.adapted.measurable + +lemma normalizedDiskScalar_integrable (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) + (t : ℝ≥0) : Integrable (C.normalizedDiskScalar θ hθ t) P := by + exact (compactWeightedMass_kernel_integrable P κ (C.process (t/κ.toNNReal)) + C.progressive.adapted.measurable + (by simpa only [Measure.restrict_univ] using + C.uniqueness_process_mean_le (t/κ.toNNReal) univ) + _ _ (Target.diskSourceHalfPlane_compact hθ)).1 + +lemma normalizedDiskScalar_stronglyAdapted (hκ : 0<κ) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) : + StronglyAdapted (Target.normalizedFiltration κ B + (fun r => (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r))) hc h0) + (C.normalizedDiskScalar θ hθ) := by + intro t + erw [Target.normalizedFiltration_at κ hκ] + exact ((compactWeightedMass_measurable _ _ + (Target.diskSourceHalfPlane_compact hθ).measurableSet).comp + (C.progressive.adapted (t/κ.toNNReal))).stronglyMeasurable + +theorem normalizedDiskScalar_paths (hκ : 0<κ) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) : + ∀ᵐ ω ∂P, Monotone (fun t => C.normalizedDiskScalar θ hθ t ω) ∧ + C.normalizedDiskScalar θ hθ 0 ω=0 ∧ + Continuous (fun t => C.normalizedDiskScalar θ hθ t ω) ∧ + Tendsto (fun t => C.normalizedDiskScalar θ hθ t ω) atTop + (𝓝 (C.diskTerminalScalar θ hθ ω)) ∧ + ∀ t, C.normalizedDiskScalar θ hθ t ω ≤ C.diskTerminalScalar θ hθ ω := by + filter_upwards [C.compactWeightedMass_paths (Target.diskMassWeight κ θ hθ) + (Target.diskSourceHalfPlane θ) (Target.diskSourceHalfPlane_compact hθ)] with ω hω + refine ⟨?_,?_,hω.2.2.1.comp (continuous_id.div_const _),?_,fun t => hω.2.2.2.2 _⟩ + · intro s t hst + exact hω.1 (div_le_div_of_nonneg_right hst zero_le) + · simpa only [normalizedDiskScalar,diskScalar,zero_div] using hω.2.1 + · exact hω.2.2.2.1.comp + ((tendsto_div_const_atTop_of_pos (Real.toNNReal_pos.mpr hκ)).mpr tendsto_id) + +theorem normalized_disk_compensator_recovery [IsProbabilityMeasure P] + (hκ : 0<κ) (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) (T : Ω → ℝ≥0∞) (hT : Measurable T) : + TendstoInMeasure P + (fun n ω => meshMassCompensator P + (compensatorMeshFiltration (Target.normalizedFiltration κ B + (fun r => (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r))) hc h0)) + (C.normalizedDiskScalar θ hθ) n (compensatorStopIndex n (T ω)) ω) atTop + (fun ω => massAtExtendedTime (fun t => C.normalizedDiskScalar θ hθ t ω) + (C.diskTerminalScalar θ hθ ω) (T ω)) := by + apply meshMassCompensator_stopped_tendstoInMeasure P _ _ _ _ _ + (C.compactWeightedMass_terminal_memLp _ _ (Target.diskSourceHalfPlane_compact hθ)) + (C.normalizedDiskScalar_paths hκ θ hθ) T hT + · intro t + exact C.normalizedDiskScalar_measurable θ hθ t + · intro n i + change StronglyMeasurable[Target.normalizedFiltration κ B + (fun r => (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r))) + hc h0 (compensatorMeshTime n i)] _ + exact C.normalizedDiskScalar_stronglyAdapted hκ hc h0 θ hθ _ + +end SLEExactGauge.Multipoint.CanonicalMass + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/OriginalShiftedMass.lean b/lean/OAI/Probability/SLE/Mass/OriginalShiftedMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d36dcf1fc2162d97449859bee51b17dba93932d --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/OriginalShiftedMass.lean @@ -0,0 +1,58 @@ +import OAI.Probability.SLE.Mass.CanonicalMassRemaining +import OAI.Probability.SLE.Stochastic.ProgressiveStoppedTime + +namespace OAI + +/-! The original canonical mass evaluated after a finite stopping time. +Its remaining Green kernel is stated in the full shifted filtration. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory Classical +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.Multipoint + +lemma extendedCanonicalMass_finite_time + {Ω : Type*} (N : ℝ≥0 → Ω → Measure upperHalfPlane) + (ν : Ω → Measure upperHalfPlane) (τ : Ω → ℝ≥0) (ω : Ω) : + extendedCanonicalMass N ν (τ ω:ℝ≥0∞) ω=N (τ ω) ω := by + simp only [extendedCanonicalMass,ENNReal.coe_lt_top,ite_true,ENNReal.toNNReal_coe] + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {κ : ℝ} + {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (C : CanonicalMass P κ B hBm γ G) (τ : Ω → ℝ≥0) + (hτ : IsStoppingTime (Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) + (fun ω => (τ ω:WithTop ℝ≥0))) + +include C τ hτ in +lemma CanonicalMass.original_shifted_adapted : + Adapted (shiftedStoppingFiltration hτ) (fun t ω => C.process (τ ω+t) ω) := + _root_.OAI.MeasureTheory.IsProgressive.shifted_adapted C.progressive τ hτ + +include C τ hτ in +lemma CanonicalMass.original_shifted_green_kernel + (t : ℝ≥0) (E : Set Ω) (hE : MeasurableSet[shiftedStoppingFiltration hτ t] E) : + (P.restrict E).bind C.rational.terminal = + (P.restrict E).bind (fun ω => C.process (τ ω+t) ω)+ + (P.restrict E).bind (fun ω => halfPlaneGreenMeasure κ B γ G (τ ω+t) ω) := by + have h := C.kernel (fun ω => ((τ ω+t:ℝ≥0):WithTop ℝ≥0)) + (stopping_time_add_nnreal hτ t) E hE + change (P.restrict E).bind C.rational.terminal = + (P.restrict E).bind (fun ω => C.process (τ ω+t) ω)+ + (P.restrict E).bind (fun ω => halfPlaneGreenMeasure κ B γ G (τ ω+t) ω) at h + exact h + +include C τ hτ in +lemma CanonicalMass.original_shifted_mean_le (t : ℝ≥0) (E : Set Ω) : + (P.restrict E).bind (fun ω => C.process (τ ω+t) ω) ≤ initialGreenMeasure κ := by + have h := C.atTime_mean_le (fun ω => ((τ ω+t:ℝ≥0):ℝ≥0∞)) + (stopping_time_add_nnreal hτ t).measurable' E + exact h + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/PastThresholdMass.lean b/lean/OAI/Probability/SLE/Mass/PastThresholdMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b017d4d9d99a6c6534bba601fbdda7166167d0f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/PastThresholdMass.lean @@ -0,0 +1,63 @@ +import OAI.Probability.SLE.Gauge.StrictPastCountable +import OAI.Probability.SLE.Geometry.WeightedCompactTerminal + +namespace OAI + +/-! Continuous mass crosses an intermediate level at a dense test time. +Consequently a cell with twice the threshold has at least half its mass +strictly after a successful past test. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +attribute [local instance] Classical.propDecidable + +namespace SLEExactGauge.Multipoint + +lemma dense_time_between_mass_levels (q : ℕ → ℝ≥0) (hq : DenseRange q) + (f : ℝ≥0 → ℝ) (hf : Continuous f) (h0 : f 0=0) + (M H L : ℝ) (hH : 0 linarith) + have hopen : IsOpen (f ⁻¹' Ioo H L) := isOpen_Ioo.preimage hf + have hne : (f ⁻¹' Ioo H L).Nonempty := ⟨t,by change H linarith⟩ + exact hq.exists_mem_open hopen hne + +lemma past_threshold_detects_half + {X : Type*} [MeasurableSpace X] (μ : Measure X) (K : Set X) + (hfin : μ K≠∞) + (A : ℝ≥0 → Set X) (hA : ∀ t, MeasurableSet (A t)) + (q : ℕ → ℝ≥0) (hq : DenseRange q) (f : ℝ≥0 → ℝ) + (hf : Continuous f) (h0 : f 0=0) + (hlim : Tendsto f atTop (𝓝 (μ K).toReal)) + (hpast : ∀ n, μ (K ∩ A (q n))=ENNReal.ofReal (f (q n))) + (H : ℝ) (hH : 0 H z) + (fun z : upperHalfPlane => ENNReal.ofReal (‖deriv H z‖^dimension κ)) μ := by + have hmap : (fun z : upperHalfPlane => f (Target.diskMap θ z))= + (fun z : upperHalfPlane => H z) := funext (fun z => he z z.property) + have hder (z : upperHalfPlane) : deriv (f ∘ Target.diskMap θ) z=deriv H z := by + apply Filter.EventuallyEq.deriv_eq + filter_upwards [isOpen_upperHalfPlane.mem_nhds z.property] with w hw + exact he w hw + unfold diskChartMass + rw [hmap] + congr 1 + funext z + rw [hder] + +lemma diskToHalfPlane_real_affine (c a : ℝ) (z ξ : ℂ) + (hξ : ξ ∈ ball (0:ℂ) 1) : + diskToHalfPlane ((c:ℂ)+(a:ℂ)*z) ξ = + (c:ℂ)+(a:ℂ)*diskToHalfPlane z ξ := by + simp only [diskToHalfPlane,star_add,star_mul,Complex.star_def,Complex.conj_ofReal] + field_simp [disk_denominator_ne hξ] + ring + +lemma physicalDiskChart_normalized + (F G : ℝ≥0 → ℂ → ℂ) (t : ℝ≥0) (z : ℂ) (c a θ : ℝ) + (he : G t z=(c:ℂ)+(a:ℂ)*Complex.exp (θ*Complex.I)) + {ξ : ℂ} (hξ : ξ ∈ ball (0:ℂ) 1) : + physicalDiskChart id F G t z ξ = + F t ((c:ℂ)+(a:ℂ)*Target.diskMapInv θ ξ) := by + change F t (diskToHalfPlane (G t z) ξ)=_ + rw [he,diskToHalfPlane_real_affine c a _ ξ hξ,← Target.diskMapInv_eq_diskToHalfPlane] + +lemma physicalDiskChart_mass_eq + (κ θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) + (F G : ℝ≥0 → ℂ → ℂ) (t : ℝ≥0) (z : ℂ) (c a : ℝ) + (he : G t z=(c:ℂ)+(a:ℂ)*Complex.exp (θ*Complex.I)) + (μ : Measure upperHalfPlane) : + diskChartMass κ θ (physicalDiskChart id F G t z) μ = + weightedImageMass (fun w : upperHalfPlane => F t ((c:ℂ)+(a:ℂ)*w)) + (fun w : upperHalfPlane => ENNReal.ofReal + (‖deriv (fun v : ℂ => F t ((c:ℂ)+(a:ℂ)*v)) w‖^dimension κ)) μ := by + apply diskChartMass_eq_of_coordinates κ θ (physicalDiskChart id F G t z) + (fun v : ℂ => F t ((c:ℂ)+(a:ℂ)*v)) + intro w hw + rw [physicalDiskChart_normalized F G t z c a θ he (Target.diskMap_maps hθ hw), + Target.diskMapInv_diskMap hθ hw] + +lemma IsCapacityTwoWitness.physical_quarter_mass_bounds + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hgrowth : PublishedDiskUnivalentGrowth) + (κ : ℝ) (hκ : 0 < κ) (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) + (t : ℝ≥0) (z : ℂ) (hz : z ∈ survivingDomain γ t) (a : ℝ) + (he : G t z=(U t:ℂ)+(a:ℂ)*Complex.exp (θ*Complex.I)) + (μ : Measure upperHalfPlane) [IsFiniteMeasureOnCompacts μ] : + let f := physicalDiskChart id F G t z + let ν := weightedImageMass (fun w : upperHalfPlane => F t ((U t:ℂ)+(a:ℂ)*w)) + (fun w : upperHalfPlane => ENNReal.ofReal + (‖deriv (fun v : ℂ => F t ((U t:ℂ)+(a:ℂ)*v)) w‖^dimension κ)) μ + let L := ENNReal.ofReal (compactWeightedMass (Target.diskMassWeight κ θ hθ) + (Target.diskSourceHalfPlane θ) μ) + ENNReal.ofReal ((fullRadius G t z/16)^dimension κ)*L ≤ ν (f '' Target.diskK) ∧ + ν (f '' Target.diskK) ≤ ENNReal.ofReal ((16*fullRadius G t z)^dimension κ)*L := by + obtain ⟨hd,hi,_,hder,_⟩ := hw.physical_disk_chart id differentiableOn_id + (fun _ _ _ _ h => h) t z hz + have hder' : ‖deriv (physicalDiskChart id F G t z) 0‖=fullRadius G t z := by + simpa [physicalConformalRadius] using hder + have hb := diskChartMass_quarter_bounds hgrowth κ hκ θ hθ + (physicalDiskChart id F G t z) hd hi μ + rw [hder',physicalDiskChart_mass_eq κ θ hθ F G t z (U t) a he μ] at hb + exact hb + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/PositiveMassContinuity.lean b/lean/OAI/Probability/SLE/Mass/PositiveMassContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a742be6b94b733317363ddfdace983c2ce2a82a --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/PositiveMassContinuity.lean @@ -0,0 +1,37 @@ +import OAI.Probability.SLE.Loewner.StoppedInversePaths + +namespace OAI + +/-! Positive compact tests determine continuity of every real compact test. -/ +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped Topology NNReal ENNReal CompactlySupported + +namespace SLEExactGauge + +lemma PositiveMassPaths.continuous_real_tests + {N : ℝ≥0 → Measure upperHalfPlane} {ν : Measure upperHalfPlane} + (h : PositiveMassPaths N ν) (f : C_c(upperHalfPlane,ℝ)) : + Continuous (fun t => ∫ z, f z ∂N t) := by + let fp : C_c(upperHalfPlane,ℝ) := f ⊔ 0 + let fm : C_c(upperHalfPlane,ℝ) := -f ⊔ 0 + have hp : ∀ z, 0 ≤ fp z := fun z => le_max_right _ _ + have hm : ∀ z, 0 ≤ fm z := fun z => le_max_right _ _ + have he (t : ℝ≥0) : (∫ z, f z ∂N t) = (∫ z, fp z ∂N t)-(∫ z, fm z ∂N t) := by + let := (h.radon t).2 + rw [← integral_sub fp.integrable fm.integrable] + apply integral_congr_ae + exact ae_of_all _ (fun z => by + change f z = max (f z) 0-max (-f z) 0 + rcases le_total 0 (f z) with hz | hz + · rw [max_eq_left hz,max_eq_right (neg_nonpos.mpr hz)]; ring + · rw [max_eq_right hz,max_eq_left (neg_nonneg.mpr hz)]; ring) + have hcont : Continuous (fun t => (∫ z, fp z ∂N t)-(∫ z, fm z ∂N t)) := + (h.continuous_tests fp hp).sub (h.continuous_tests fm hm) + exact hcont.congr (fun t => (he t).symm) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/PositiveMassGerm.lean b/lean/OAI/Probability/SLE/Mass/PositiveMassGerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b2eaec736f589f6f36c050794d1a373d763ae14 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/PositiveMassGerm.lean @@ -0,0 +1,98 @@ +import OAI.Probability.SLE.Stochastic.BrownianGerm +import OAI.Probability.SLE.Mass.CanonicalMassConstruction + +namespace OAI + +/-! A uniform positive chance of early mass, together with the Brownian +germ law, gives mass before every positive time. The scaling estimate +needed to apply this lemma is kept explicit. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge + +lemma earlyMassGerm_tail {Ω : Type*} (E : ℕ → Set Ω) (k : ℕ) : + (⋂ N : ℕ, ⋃ j ≥ N, E j) = (⋂ N : ℕ, ⋃ j ≥ max N k, E j) := by + ext ω + simp only [mem_iInter,mem_iUnion] + constructor + · intro h N + exact h (max N k) + · intro h N + obtain ⟨j,hj,hE⟩ := h N + exact ⟨j,(le_max_left N k).trans hj,hE⟩ + +/-- This is the zero-one step of the canonical mass positivity argument. +The lower bound will come from scaling a single nonzero compact mean. -/ +theorem positive_mass_all_times_of_uniform_probability + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (Z : ℝ≥0 → Ω → ℝ≥0∞) + (hZ : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) Z) + (hmono : ∀ᵐ ω ∂P, Monotone (fun t => Z t ω)) + (ε : ℕ → ℝ≥0) (hεanti : Antitone ε) (hε : Tendsto ε atTop (𝓝 0)) + (p : ℝ≥0∞) (hp : 0 {ω | 0 ⋃ j ≥ N, E j + let G : Set Ω := ⋂ N, A N + have hEp (j k : ℕ) (hkj : k≤j) : + MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε k)] (E j) := by + have hz : Measurable[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε k)] + (Z (ε j)) := (hZ (ε j)).mono + ((Filtration.natural B (fun t => (hm t).stronglyMeasurable)).mono (hεanti hkj)) le_rfl + exact measurableSet_lt measurable_const hz + have hGp (k : ℕ) : MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε k)] G := by + change MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε k)] + (⋂ N : ℕ, ⋃ j ≥ N, E j) + rw [earlyMassGerm_tail E k] + apply MeasurableSet.iInter + intro N + apply MeasurableSet.iUnion + intro j + apply MeasurableSet.iUnion + intro hj + exact hEp j k ((le_max_right N k).trans hj) + have hEm (j : ℕ) : MeasurableSet (E j) := + (Filtration.natural B (fun t => (hm t).stronglyMeasurable)).le _ _ (hEp j j le_rfl) + have hAm (N : ℕ) : MeasurableSet (A N) := + MeasurableSet.iUnion (fun j => MeasurableSet.iUnion (fun _ => hEm j)) + have hGm : MeasurableSet G := MeasurableSet.iInter hAm + have hAa : Antitone A := by + intro N M hNM ω hω + obtain ⟨j,hj⟩ := mem_iUnion.mp hω + obtain ⟨hjM,hωE⟩ := mem_iUnion.mp hj + exact mem_iUnion.mpr ⟨j,mem_iUnion.mpr ⟨hNM.trans hjM,hωE⟩⟩ + have hpG : p≤P G := by + change p≤P (⋂ N, A N) + rw [hAa.measure_iInter (fun N => (hAm N).nullMeasurableSet) ⟨0,measure_ne_top P _⟩] + apply le_iInf + intro N + apply (hprob N).trans (measure_mono ?_) + intro ω hω + exact mem_iUnion.mpr ⟨N,mem_iUnion.mpr ⟨le_rfl,hω⟩⟩ + have hGone : P G=1 := by + rcases brownian_germ_zero_one hB hm hc h0 ε hε G hGp with hG | hG + · exact ((ne_of_gt hp) (le_zero_iff.mp (hpG.trans hG.le))).elim + · exact hG + have hGa : ∀ᵐ ω ∂P, ω∈G := (mem_ae_iff_prob_eq_one hGm).mpr hGone + filter_upwards [hGa,hmono] with ω hω hωmono + intro t ht + obtain ⟨N,hN⟩ := (hε.eventually (eventually_lt_nhds ht)).exists + have hg : ∀ N : ℕ, ∃ j, N≤j ∧ ω∈E j := by + intro N + change ω∈⋂ N, ⋃ j ≥ N, E j at hω + obtain ⟨j,hj⟩ := mem_iUnion.mp (mem_iInter.mp hω N) + obtain ⟨hNj,hmem⟩ := mem_iUnion.mp hj + exact ⟨j,hNj,hmem⟩ + obtain ⟨j,hj,hωj⟩ := hg N + exact lt_of_lt_of_le hωj (hωmono ((hεanti hj).trans hN.le)) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/PositiveRestartMass.lean b/lean/OAI/Probability/SLE/Mass/PositiveRestartMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d822fa3fb52ff334199d958bf55535c25868305 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/PositiveRestartMass.lean @@ -0,0 +1,167 @@ +import OAI.Probability.SLE.Mass.CanonicalMassRestart +import OAI.Probability.SLE.Geometry.RestartGreenKernel + +namespace OAI + +/-! Positive mass survives the actual inverse-Loewner transport and +passes from initial intervals to every finite Brownian restart. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge + +lemma weightedImageMass_ne_zero {X : Type*} [MeasurableSpace X] + (J : upperHalfPlane → X) (hJ : Measurable J) + (w : upperHalfPlane → ℝ≥0∞) (hw : Measurable w) (hp : ∀ z, 0 B t ω)) + (R : RawCanonicalMass) + (he : ∀ᵐ ω ∂P, ∀ t, R.process t (sourceDriverPath B hc ω)=C.process t ω) + (hpos : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, 0 + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) + (fun ω => (τ ω:WithTop ℝ≥0))) + (t : ℝ≥0) (ht : 0 B t ω)) (hκ : 0<κ) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hpublished : PublishedTraceGeneration (P.map (sourceDriverPath B hc)) κ (fun t p => p t)) + (hpos : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, 0 + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) + (fun ω => (τ ω:WithTop ℝ≥0))) + (t : ℝ≥0) (ht : 0 (ω,z)) := + @measurable_prodMk_left Ω upperHalfPlane hτ.measurableSpace inferInstance ω + have hJsec (ω : Ω) : Measurable (stoppedMassPoint B κ γ G F hw τ ω) := + @Measurable.comp upperHalfPlane (Ω × upperHalfPlane) upperHalfPlane + inferInstance (hτ.measurableSpace.prod inferInstance) inferInstance + (fun p => stoppedMassPoint B κ γ G F hw τ p.1 p.2) (fun z => (ω,z)) hJ (hpair ω) + have hWsec (ω : Ω) : Measurable (stoppedMassWeight B κ F τ ω) := + @Measurable.comp upperHalfPlane (Ω × upperHalfPlane) ℝ≥0∞ + inferInstance (hτ.measurableSpace.prod inferInstance) inferInstance + (fun p => stoppedMassWeight B κ F τ p.1 p.2) (fun z => (ω,z)) hW (hpair ω) + filter_upwards [hr τ hτ,C.raw_restart_positive_time hB hc R (he.mono fun _ h => h.1) + hpos τ hτ t ht,fresh_capacity_witness_exists hB hm hc hpublished τ hτ] with ω hω hp hf + rw [hω.1 t] + obtain ⟨β,G',F',hf⟩ := hf + apply weightedImageMass_ne_zero (stoppedMassPoint B κ γ G F hw τ ω) + (hJsec ω) + (stoppedMassWeight B κ F τ ω) + (hWsec ω) + (fun z => ?_) _ hp + exact ENNReal.ofReal_pos.mpr (Real.rpow_pos_of_pos + ((hw ω).restart_inverse_derivative_norm_pos ((hc ω).const_mul _) (τ ω) hf z z.property) _) + +lemma positive_increment_fixed_times + (hB : IsBrownianReal B P) (hc : ∀ ω, Continuous (fun t => B t ω)) (hκ : 0 < κ) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hpublished : PublishedTraceGeneration (P.map (sourceDriverPath B hc)) κ (fun t p => p t)) + (hpos : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, 0 < t → C.process t ω ≠ 0) + (s t : ℝ≥0) (hst : s < t) : + ∀ᵐ ω ∂P, C.process t ω-C.process s ω ≠ 0 := by + have hτ := isStoppingTime_const (Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable)) s + have h := C.positive_increment_after_stop hB hc hκ F hw hpublished hpos + (fun _ => s) hτ (t-s) (tsub_pos_iff_lt.mpr hst) + simpa only [add_tsub_cancel_of_le hst.le] using h + +lemma positive_increment_all_times + (hB : IsBrownianReal B P) (hc : ∀ ω, Continuous (fun t => B t ω)) (hκ : 0 < κ) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hpublished : PublishedTraceGeneration (P.map (sourceDriverPath B hc)) κ (fun t p => p t)) + (hpos : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, 0 < t → C.process t ω ≠ 0) : + ∀ᵐ ω ∂P, ∀ s t : ℝ≥0, s < t → C.process t ω-C.process s ω ≠ 0 := by + have hq (p q : ℚ) : ∀ᵐ ω ∂P, + (p:ℝ).toNNReal < (q:ℝ).toNNReal → + C.process (q:ℝ).toNNReal ω-C.process (p:ℝ).toNNReal ω ≠ 0 := by + by_cases hpq : (p:ℝ).toNNReal < (q:ℝ).toNNReal + · exact (C.positive_increment_fixed_times hB hc hκ F hw hpublished hpos _ _ hpq).mono + (fun _ h _ => h) + · exact ae_of_all _ (fun _ h => (hpq h).elim) + filter_upwards [C.paths,ae_all_iff.mpr (fun p => ae_all_iff.mpr (hq p))] with ω hp hqω + intro s t hst hz + obtain ⟨p,hsp,hpt⟩ := exists_rat_btwn (show (s:ℝ) < (t:ℝ) from hst) + obtain ⟨q,hpq,hqt⟩ := exists_rat_btwn hpt + have hp0 : (0:ℝ) ≤ p := s.coe_nonneg.trans hsp.le + have hq0 : (0:ℝ) ≤ q := hp0.trans hpq.le + have hsp' : s ≤ (p:ℝ).toNNReal := by + exact_mod_cast (show (s:ℝ) ≤ ((p:ℝ).toNNReal:ℝ) by rw [Real.coe_toNNReal _ hp0]; exact hsp.le) + have hpq' : (p:ℝ).toNNReal < (q:ℝ).toNNReal := by + exact_mod_cast (show ((p:ℝ).toNNReal:ℝ) < ((q:ℝ).toNNReal:ℝ) by + rw [Real.coe_toNNReal _ hp0,Real.coe_toNNReal _ hq0]; exact hpq) + have hqt' : (q:ℝ).toNNReal ≤ t := by + exact_mod_cast (show ((q:ℝ).toNNReal:ℝ) ≤ (t:ℝ) by rw [Real.coe_toNNReal _ hq0]; exact hqt.le) + let : IsFiniteMeasureOnCompacts (C.process s ω) := (C.radon s ω).2 + have hts : C.process t ω=C.process s ω := by + have h := sigmaFinite_sub_add_cancel_of_le (hp.monotone hst.le) + rw [hz,zero_add] at h + exact h.symm + have hps : C.process (p:ℝ).toNNReal ω=C.process s ω := by + apply le_antisymm + · exact (hp.monotone (hpq'.le.trans hqt')).trans_eq hts + · exact hp.monotone hsp' + have hqs : C.process (q:ℝ).toNNReal ω=C.process s ω := by + apply le_antisymm + · exact (hp.monotone hqt').trans_eq hts + · exact hp.monotone (hsp'.trans hpq'.le) + apply hqω p q hpq' + rw [hps,hqs,Measure.sub_self] + +end Multipoint.CanonicalMass +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/PositiveTraceMass.lean b/lean/OAI/Probability/SLE/Mass/PositiveTraceMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..c34be2fa3d32166f5828e767ab6c4fdbd24515c9 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/PositiveTraceMass.lean @@ -0,0 +1,72 @@ +import OAI.Probability.SLE.Mass.PositiveRestartMass +import OAI.Probability.SLE.Mass.CanonicalMassScaling + +namespace OAI + +/-! Positive increments and trace support force positive canonical mass +in each open set visited at a positive time. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +lemma positive_trace_mass_of_positive_increments + (γ : ℝ≥0 → ℂ) (hγ : Continuous γ) (N : ℝ≥0 → Measure upperHalfPlane) + (hmono : Monotone N) + (hinc : ∀ s t, s ≤ t → (N t-N s) + {z : upperHalfPlane | (z:ℂ) ∉ (fun r : ℝ => γ r.toNNReal) '' Icc (s:ℝ) t}=0) + (hpos : ∀ s t, s < t → N t-N s ≠ 0) + (V : Set ℂ) (hV : IsOpen V) (u T : ℝ≥0) (hu : 0 < u) (huT : u ≤ T) + (hvisit : γ u ∈ V) : 0 < N T (Subtype.val ⁻¹' V) := by + have hpre : γ ⁻¹' V ∈ 𝓝 u := hγ.continuousAt.preimage_mem_nhds (hV.mem_nhds hvisit) + obtain ⟨a,ha,haV⟩ := exists_Ioc_subset_of_mem_nhds' hpre hu + obtain ⟨b,hab,hbu⟩ := exists_between ha.2 + have hseg : (fun r : ℝ => γ r.toNNReal) '' Icc (b:ℝ) u ⊆ V := by + rintro _ ⟨r,hr,rfl⟩ + apply haV + have hbr : b ≤ r.toNNReal := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_mono hr.1 + have hru : r.toNNReal ≤ u := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_mono hr.2 + exact ⟨hab.trans_le hbr,hru⟩ + have hnull : (N u-N b) (Subtype.val ⁻¹' V)ᶜ=0 := by + apply le_antisymm ?_ bot_le + apply (measure_mono (show (Subtype.val ⁻¹' V)ᶜ ⊆ + {z : upperHalfPlane | (z:ℂ) ∉ (fun r : ℝ => γ r.toNNReal) '' Icc (b:ℝ) u} from ?_)).trans_eq + (hinc b u hbu.le) + intro z hz hs + exact hz (hseg hs) + have hVmeas : MeasurableSet ((Subtype.val : upperHalfPlane → ℂ) ⁻¹' V) := + (hV.preimage (continuous_subtype_val : Continuous (Subtype.val : upperHalfPlane → ℂ))).measurableSet + have he := measure_add_measure_compl (μ:=N u-N b) hVmeas + rw [hnull,add_zero] at he + have hp : 0 < (N u-N b) (Subtype.val ⁻¹' V) := by + rw [he] + exact Measure.measure_univ_pos.mpr (hpos b u hbu) + exact hp.trans_le (((Measure.sub_le : N u-N b ≤ N u).trans (hmono huT)) _) + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {κ : ℝ} {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + +lemma CanonicalMass.positive_open_visited + (C : CanonicalMass P κ B hBm γ G) (hB : IsBrownianReal B P) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) (hκ : 0 < κ) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hpublished : PublishedTraceGeneration (P.map (sourceDriverPath B hc)) κ (fun t p => p t)) : + ∀ᵐ ω ∂P, ∀ V : Set ℂ, IsOpen V → ∀ u T : ℝ≥0, + 0 < u → u ≤ T → γ ω u ∈ V → 0 < C.process T ω (Subtype.val ⁻¹' V) := by + have hp := C.positive_all_times hB hc h0 F hw + have hi := C.positive_increment_all_times hB hc hκ F hw hpublished hp + filter_upwards [C.paths,hi] with ω hω hωi + exact positive_trace_mass_of_positive_increments (γ ω) (hw ω).1 (fun t => C.process t ω) + hω.monotone hω.increment_support hωi + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonApproximationList.lean b/lean/OAI/Probability/SLE/Mass/RadonApproximationList.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1fab3ca0e1aa343890668ef2b45b77416bc040a --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonApproximationList.lean @@ -0,0 +1,56 @@ +import OAI.Probability.SLE.Mass.RadonTestLimit +import Mathlib.Topology.Bases +import Mathlib.Topology.Instances.Real.Lemmas + +namespace OAI + +/-! A countable list of positive Radon measures approximates every finite +list of compact-test integrals. This uses separability of the image in +real sequence space, without a topology on the space of measures. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +omit [T2Space X] [LocallyCompactSpace X] [BorelSpace X] in +lemma LocalTestFamily.exists_countable_measure_approximants (D : LocalTestFamily X) : + ∃ μ : ℕ → Measure X, (∀ k, (μ k).Regular) ∧ + ∀ (ν : Measure X), ν.Regular → ∀ n : ℕ, ∀ ε : ℝ, 0 < ε → + ∃ k, ∀ j < n+1, |(∫ x, D.test j x ∂μ k)-(∫ x, D.test j x ∂ν)| < ε := by + let R := {ν : Measure X // ν.Regular} + let V : R → ℕ → ℝ := fun ν j => ∫ x, D.test j x ∂ν.val + let S := range V + let : Nonempty S := ⟨⟨V ⟨0,inferInstance⟩,⟨⟨0,inferInstance⟩,rfl⟩⟩⟩ + let q : ℕ → S := TopologicalSpace.denseSeq S + have hq : DenseRange q := TopologicalSpace.denseRange_denseSeq S + choose μ hμ using fun k => (q k).property + refine ⟨fun k => (μ k).val,fun k => (μ k).property,?_⟩ + intro ν hν n ε hε + let v : S := ⟨V ⟨ν,hν⟩,⟨⟨ν,hν⟩,rfl⟩⟩ + let U : Set S := {w | ∀ j : Fin (n+1), |w.val j.val-v.val j.val| < ε} + have hU : IsOpen U := by + simp only [U,Set.ofPred_forall] + apply isOpen_iInter_of_finite + intro j + exact isOpen_lt (((continuous_apply j.val).comp continuous_subtype_val).sub continuous_const).abs + continuous_const + have hv : v ∈ U := by + intro j + simpa only [sub_self,abs_zero] using hε + obtain ⟨k,hk⟩ := hq.exists_mem_open hU ⟨v,hv⟩ + refine ⟨k,fun j hj => ?_⟩ + have hh := hk (⟨j,hj⟩ : Fin (n+1)) + change |(V (μ k)) j-(V ⟨ν,hν⟩) j| < ε + rw [hμ k] + exact hh + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonFactorization.lean b/lean/OAI/Probability/SLE/Mass/RadonFactorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..530985e1384039d818dc6553abf502fbc68028b1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonFactorization.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SLE.Mass.RadonApproximationList +import OAI.Probability.SLE.Mass.RawRadonLimit +import OAI.Probability.SLE.Mass.RadonTestDetermines +import Mathlib.MeasureTheory.Function.FactorsThrough + +namespace OAI + +/-! Doob--Dynkin factorization of a locally finite Radon kernel through +countably many real compact tests. The factor is regular on every input and +is reconstructed in the target data space, without ambient null-set changes. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +lemma exists_measurable_nat_choice + {Y : Type*} [MeasurableSpace Y] (p : Y → ℕ → Prop) + (hm : ∀ k, MeasurableSet {y | p y k}) : + ∃ i : Y → ℕ, Measurable i ∧ ∀ y, (∃ k, p y k) → p y (i y) := by + let q (y : Y) (k : ℕ) := (∃ j, p y j) → p y k + have hq (y : Y) : ∃ k, q y k := by + by_cases h : ∃ j, p y j + · obtain ⟨k,hk⟩ := h + exact ⟨k,fun _ => hk⟩ + · exact ⟨0,fun h' => (h h').elim⟩ + have hqm (k : ℕ) : MeasurableSet {y | q y k} := by + have he : {y | q y k} = (⋃ j, {y | p y j})ᶜ ∪ {y | p y k} := by + ext y + simp only [q,mem_ofPred_eq,mem_union,mem_compl_iff,mem_iUnion] + tauto + rw [he] + exact (MeasurableSet.iUnion hm).compl.union (hm k) + exact ⟨fun y => Nat.find (hq y),measurable_find hq hqm, + fun y hy => Nat.find_spec (hq y) hy⟩ + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +/-- Countable compact tests suffice for a raw measurable Radon factor. +The factorization equality holds at every original input. -/ +theorem LocalTestFamily.measurable_radon_factor + (D : LocalTestFamily X) {Ω Y : Type*} [MeasurableSpace Y] + (F : Ω → Y) (μ : Ω → Measure X) (hμ : ∀ ω, (μ ω).Regular) + (htest : ∀ j, Measurable[MeasurableSpace.comap F inferInstance] + (fun ω => ∫ x, D.test j x ∂μ ω)) : + ∃ ν : Y → Measure X, Measurable ν ∧ (∀ y, (ν y).Regular) ∧ ∀ ω, ν (F ω)=μ ω := by + choose g hgm hg using fun j => (htest j).exists_eq_measurable_comp + obtain ⟨a,ha,happrox⟩ := D.exists_countable_measure_approximants + let p (n : ℕ) (y : Y) (k : ℕ) : Prop := + ∀ j < n+1, |(∫ x, D.test j x ∂a k)-g j y| < 1/(n+1:ℝ) + have hpm (n k : ℕ) : MeasurableSet {y | p n y k} := by + simp only [p,Set.ofPred_forall] + apply MeasurableSet.iInter + intro j + apply MeasurableSet.iInter + intro _ + simpa only [Real.norm_eq_abs,Pi.sub_apply] using + measurableSet_lt (measurable_const.sub (hgm j)).norm measurable_const + choose i him hi using fun n => exists_measurable_nat_choice (p n) (hpm n) + let μn (n : ℕ) (y : Y) := a (i n y) + have hμnm (n : ℕ) (f : C_c(X,ℝ)) : Measurable (fun y => ∫ x, f x ∂μn n y) := + (measurable_of_countable (fun k => ∫ x, f x ∂a k)).comp (him n) + have hvalid (n : ℕ) (ω : Ω) : p n (F ω) (i n (F ω)) := by + apply hi n + obtain ⟨k,hk⟩ := happrox (μ ω) (hμ ω) n (1/(n+1:ℝ)) (by positivity) + refine ⟨k,fun j hj => ?_⟩ + have he : g j (F ω) = ∫ x, D.test j x ∂μ ω := congr_fun (hg j) ω |>.symm + rw [he] + exact hk j hj + have hlim (ω : Ω) (j : ℕ) : Tendsto (fun n => ∫ x, D.test j x ∂μn n (F ω)) atTop + (𝓝 (∫ x, D.test j x ∂μ ω)) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + obtain ⟨N,hN⟩ := eventually_atTop.mp + ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).eventually (gt_mem_nhds hε)) + refine ⟨max j N,fun n hn => ?_⟩ + rw [Real.dist_eq] + have hjn : j < n+1 := by omega + have hv := hvalid n ω j hjn + have he : g j (F ω) = ∫ x, D.test j x ∂μ ω := congr_fun (hg j) ω |>.symm + rw [he] at hv + exact hv.trans (hN n (le_trans (le_max_right _ _) hn)) + obtain ⟨ν,hνm,hν,hνlim⟩ := D.exists_raw_radon_limit μn (fun n y => ha (i n y)) hμnm + refine ⟨ν,hνm,hν,fun ω => ?_⟩ + let := hν (F ω) + let := hμ ω + apply D.measure_eq_of_test_integrals + intro j + exact tendsto_nhds_unique (hνlim (F ω) (fun j => (hlim ω j).cauchySeq) (D.test j)) (hlim ω j) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonKernelIntegral.lean b/lean/OAI/Probability/SLE/Mass/RadonKernelIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e4cfbfc5007aaf3f965d1f34a27b4780468f504 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonKernelIntegral.lean @@ -0,0 +1,67 @@ +import Mathlib.MeasureTheory.Measure.GiryMonad +import Mathlib.MeasureTheory.Integral.Bochner.Basic + +namespace OAI + +/-! Signed integrals of a random Radon measure can be computed from its +mean measure. The positive and negative parts use Tonelli separately. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge + +lemma lintegral_ofReal_lt_top_of_integrable + {X : Type*} [MeasurableSpace X] {μ : Measure X} {f : X → ℝ} + (hf : Integrable f μ) : (∫⁻ x, ENNReal.ofReal (f x) ∂μ) < ⊤ := by + apply (lintegral_mono (fun x => ENNReal.ofReal_le_ofReal (le_abs_self (f x)))).trans_lt + exact (hasFiniteIntegral_iff_ofReal (Eventually.of_forall (fun x => norm_nonneg (f x)))).mp + hf.norm.hasFiniteIntegral + +theorem integrable_integral_bind_of_sections + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) (μ : Ω → Measure X) (hμ : Measurable μ) + (f : X → ℝ) (hf : Measurable f) + (hfi : ∀ ω, Integrable f (μ ω)) (hfP : Integrable f (P.bind μ)) : + Integrable (fun ω => ∫ x, f x ∂μ ω) P ∧ + (∫ ω, (∫ x, f x ∂μ ω) ∂P) = ∫ x, f x ∂P.bind μ := by + let A (ω : Ω) := ∫⁻ x, ENNReal.ofReal (f x) ∂μ ω + let B (ω : Ω) := ∫⁻ x, ENNReal.ofReal (-f x) ∂μ ω + have hAm : Measurable A := (Measure.measurable_lintegral hf.ennreal_ofReal).comp hμ + have hBm : Measurable B := (Measure.measurable_lintegral hf.neg.ennreal_ofReal).comp hμ + have hA : (∫⁻ ω, A ω ∂P) = ∫⁻ x, ENNReal.ofReal (f x) ∂P.bind μ := + (Measure.lintegral_bind hμ.aemeasurable hf.ennreal_ofReal.aemeasurable).symm + have hB : (∫⁻ ω, B ω ∂P) = ∫⁻ x, ENNReal.ofReal (-f x) ∂P.bind μ := + (Measure.lintegral_bind hμ.aemeasurable hf.neg.ennreal_ofReal.aemeasurable).symm + have hAf : (∫⁻ ω, A ω ∂P) < ⊤ := hA.trans_lt (lintegral_ofReal_lt_top_of_integrable hfP) + have hBf : (∫⁻ ω, B ω ∂P) < ⊤ := hB.trans_lt (lintegral_ofReal_lt_top_of_integrable hfP.neg) + have he (ω : Ω) : (∫ x, f x ∂μ ω) = (A ω).toReal - (B ω).toReal := + integral_eq_lintegral_pos_part_sub_lintegral_neg_part (hfi ω) + refine ⟨?_,?_⟩ + · convert (integrable_toReal_of_lintegral_ne_top hAm.aemeasurable hAf.ne).sub + (integrable_toReal_of_lintegral_ne_top hBm.aemeasurable hBf.ne) using 1 + funext ω + exact he ω + simp_rw [he] + rw [integral_sub (integrable_toReal_of_lintegral_ne_top hAm.aemeasurable hAf.ne) + (integrable_toReal_of_lintegral_ne_top hBm.aemeasurable hBf.ne), + integral_toReal hAm.aemeasurable (Eventually.of_forall (fun ω => + lintegral_ofReal_lt_top_of_integrable (hfi ω))), + integral_toReal hBm.aemeasurable (Eventually.of_forall (fun ω => + lintegral_ofReal_lt_top_of_integrable (hfi ω).neg)),hA,hB] + exact (integral_eq_lintegral_pos_part_sub_lintegral_neg_part hfP).symm + +theorem integral_bind_of_integrable_sections + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) (μ : Ω → Measure X) (hμ : Measurable μ) + (f : X → ℝ) (hf : Measurable f) + (hfi : ∀ ω, Integrable f (μ ω)) (hfP : Integrable f (P.bind μ)) : + (∫ ω, (∫ x, f x ∂μ ω) ∂P) = ∫ x, f x ∂P.bind μ := + (integrable_integral_bind_of_sections P μ hμ f hf hfi hfP).2 + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonPathCertificates.lean b/lean/OAI/Probability/SLE/Mass/RadonPathCertificates.lean new file mode 100644 index 0000000000000000000000000000000000000000..b06b2877e6c26028d3bad1fd90cb2a862173db93 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonPathCertificates.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SLE.Mass.RadonTestDetermines +import OAI.Probability.SLE.Mass.RadonTestLimitProperties +import OAI.Probability.SLE.Mass.RationalTraceMassProgressiveVersion + +namespace OAI + +/-! Countable compact-test certificates for order and continuous Radon paths. +The cutoff coordinates in the determining family supply local mass bounds. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported NNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +private lemma positive_part_error {a b e : ℝ} (ha : 0 ≤ a) (h : |a-b| ≤ e) : + |a-max b 0| ≤ e := by + rcases le_total 0 b with hb | hb + · simpa only [max_eq_left hb] using h + · rw [max_eq_right hb,sub_zero,abs_of_nonneg ha] + rw [abs_of_nonneg (sub_nonneg.mpr (hb.trans ha))] at h + linarith + +theorem LocalTestFamily.measure_le_of_positive_tests (D : LocalTestFamily X) + (μ ν : Measure X) [μ.Regular] [ν.Regular] + (h : ∀ j, (∫ x, (D.test j ⊔ 0) x ∂μ) ≤ ∫ x, (D.test j ⊔ 0) x ∂ν) : μ ≤ ν := by + apply radon_measure_le_of_nonneg_tests + intro f hf + obtain ⟨k,_,happrox⟩ := D.weighted_approximation f + let A := ∫ x, f x ∂μ + let B := ∫ x, f x ∂ν + let M := (∫ x, D.test k x ∂μ)+(∫ x, D.test k x ∂ν) + have hb (n : ℕ) : A ≤ B+(1/(n+1:ℝ))*M := by + obtain ⟨j,hj⟩ := happrox (1/(n+1:ℝ)) (by positivity) + have hp (x : X) : |f x-(D.test j ⊔ 0) x| ≤ (1/(n+1:ℝ))*D.test k x := + positive_part_error (hf x) (hj x) + have hμ := integral_sub_le_cutoff μ f (D.test j ⊔ 0) (D.test k) _ hp + have hν := integral_sub_le_cutoff ν f (D.test j ⊔ 0) (D.test k) _ hp + have hh := h j + dsimp only [A,B,M] + have hμ' := le_abs_self ((∫ x, f x ∂μ)-(∫ x, (D.test j ⊔ 0) x ∂μ)) + have hν' := neg_le_abs ((∫ x, f x ∂ν)-(∫ x, (D.test j ⊔ 0) x ∂ν)) + nlinarith + have hl : Tendsto (fun n : ℕ => B+(1/(n+1:ℝ))*M) atTop (𝓝 B) := by + simpa only [zero_mul,add_zero] using tendsto_const_nhds.add + ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).mul_const M) + exact le_of_tendsto_of_tendsto' tendsto_const_nhds hl hb + +theorem LocalTestFamily.continuous_integrals_of_tests (D : LocalTestFamily X) + {T : Type*} [TopologicalSpace T] [SequentialSpace T] + (N : T → Measure X) (hr : ∀ t, (N t).Regular) + (hc : ∀ j, Continuous (fun t => ∫ x, D.test j x ∂N t)) : + ∀ f : C_c(X,ℝ), Continuous (fun t => ∫ x, f x ∂N t) := by + intro f + apply SeqContinuous.continuous + intro t a hta + let (n : ℕ) : IsFiniteMeasureOnCompacts (N (t n)) := by + let := hr (t n) + infer_instance + obtain ⟨ν,hν,_,hl⟩ := D.exists_radon_limit (fun n => N (t n)) + (fun j => ⟨∫ x, D.test j x ∂N a,(hc j).continuousAt.tendsto.comp hta⟩) + have he : ν=N a := by + let := hν + let := hr a + apply D.measure_eq_of_test_integrals + intro j + exact tendsto_nhds_unique (hl (D.test j)) ((hc j).continuousAt.tendsto.comp hta) + simpa only [he,Function.comp_def] using hl f + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonProcessAEUniqueness.lean b/lean/OAI/Probability/SLE/Mass/RadonProcessAEUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..03f04266a254faafa22abcad587378d531421bf0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonProcessAEUniqueness.lean @@ -0,0 +1,39 @@ +import OAI.Probability.SLE.Mass.RadonProcessUniqueness + +namespace OAI + +/-! A single almost-sure Radon certificate suffices when upgrading +simultaneous positive-test identities to identities of measure paths. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported NNReal + +namespace SLEExactGauge + + theorem random_radon_process_eq_of_positive_tests_ae + {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (D : LocalTestFamily X) (N M : ℝ≥0 → Ω → Measure X) + (hNr : ∀ᵐ ω ∂P, ∀ t, (N t ω).Regular) + (hMr : ∀ᵐ ω ∂P, ∀ t, (M t ω).Regular) + (htest : ∀ f : C_c(X,ℝ), (∀ x, 0 ≤ f x) → + ∀ᵐ ω ∂P, ∀ t, (∫ x, f x ∂N t ω)=∫ x, f x ∂M t ω) : + ∀ᵐ ω ∂P, ∀ t, N t ω=M t ω := by + have hp (j : ℕ) := htest (D.test j ⊔ 0) (fun x => le_max_right _ _) + have hn (j : ℕ) := htest ((-D.test j) ⊔ 0) (fun x => le_max_right _ _) + filter_upwards [hNr,hMr,ae_all_iff.mpr hp,ae_all_iff.mpr hn] with ω hN hM hωp hωn + intro t + let := hN t + let := hM t + apply D.measure_eq_of_test_integrals + intro j + rw [compact_test_integral_pos_sub_neg (N t ω) (D.test j), + compact_test_integral_pos_sub_neg (M t ω) (D.test j),hωp j t,hωn j t] + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonProcessUniqueness.lean b/lean/OAI/Probability/SLE/Mass/RadonProcessUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..924a138f9d28f962858a22c00bf7493cc0523575 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonProcessUniqueness.lean @@ -0,0 +1,51 @@ +import OAI.Probability.SLE.Mass.MassKernelUniqueness +import OAI.Probability.SLE.Mass.RadonTestDetermines + +namespace OAI + +/-! Countably many positive compact tests give one common full-measure event +on which all times of two random Radon processes agree. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported NNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +omit [T2Space X] [LocallyCompactSpace X] in +lemma compact_test_integral_pos_sub_neg (μ : Measure X) [μ.Regular] (f : C_c(X,ℝ)) : + (∫ x, f x ∂μ) = (∫ x, (f ⊔ 0) x ∂μ)-(∫ x, ((-f) ⊔ 0) x ∂μ) := by + rw [← integral_sub (f ⊔ 0).integrable ((-f) ⊔ 0).integrable] + apply integral_congr_ae + filter_upwards [] with x + change f x = max (f x) 0-max (-f x) 0 + 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),zero_sub,neg_neg] + +theorem random_radon_process_eq_of_positive_tests + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (D : LocalTestFamily X) (N M : ℝ≥0 → Ω → Measure X) + (hNr : ∀ t ω, (N t ω).Regular) (hMr : ∀ t ω, (M t ω).Regular) + (htest : ∀ f : C_c(X,ℝ), (∀ x, 0 ≤ f x) → + ∀ᵐ ω ∂P, ∀ t, (∫ x, f x ∂N t ω) = ∫ x, f x ∂M t ω) : + ∀ᵐ ω ∂P, ∀ t, N t ω = M t ω := by + have hp (j : ℕ) := htest (D.test j ⊔ 0) (fun x => le_max_right _ _) + have hn (j : ℕ) := htest ((-D.test j) ⊔ 0) (fun x => le_max_right _ _) + filter_upwards [ae_all_iff.mpr hp,ae_all_iff.mpr hn] with ω hωp hωn + intro t + let := hNr t ω + let := hMr t ω + apply D.measure_eq_of_test_integrals + intro j + rw [compact_test_integral_pos_sub_neg (N t ω) (D.test j), + compact_test_integral_pos_sub_neg (M t ω) (D.test j),hωp j t,hωn j t] + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonRandomTesting.lean b/lean/OAI/Probability/SLE/Mass/RadonRandomTesting.lean new file mode 100644 index 0000000000000000000000000000000000000000..e199bd1227710da38b76e296bba2b8b11ee04a97 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonRandomTesting.lean @@ -0,0 +1,64 @@ +import OAI.Probability.SLE.Geometry.RandomSpatialTesting +import OAI.Probability.SLE.LoewnerCharts + +namespace OAI + +/-! Nonnegative random tests of locally finite half-plane measures. +Compact restrictions remove any need for a finite total mass. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped ENNReal + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +private lemma finite_halfPlane_random_test_measurable + {Ω : Type*} [MeasurableSpace Ω] + (μ : Ω → Measure upperHalfPlane) (hμ : Measurable μ) + (hfin : ∀ ω, IsFiniteMeasure (μ ω)) + (f : Ω × upperHalfPlane → ℝ≥0∞) (hf : Measurable f) : + Measurable (fun ω => ∫⁻ z, f (ω,z) ∂μ ω) := by + let K : Kernel Ω upperHalfPlane := ⟨μ,hμ⟩ + have hp : Measurable (fun ω => (μ ω).map (Prod.mk ω)) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have h := Kernel.measurable_kernel_prodMk_left_of_finite (κ := K) hA hfin + change Measurable (fun a => μ a (Prod.mk a ⁻¹' A)) at h + simpa only [Measure.map_apply measurable_prodMk_left hA] using h + have h := (Measure.measurable_lintegral hf).comp hp + convert h using 1 + funext ω + exact (lintegral_map hf measurable_prodMk_left).symm + +theorem halfPlane_random_test_measurable + {Ω : Type*} [MeasurableSpace Ω] + (μ : Ω → Measure upperHalfPlane) (hμ : Measurable μ) + (hfin : ∀ ω, IsFiniteMeasureOnCompacts (μ ω)) + (f : Ω × upperHalfPlane → ℝ≥0∞) (hf : Measurable f) : + Measurable (fun ω => ∫⁻ z, f (ω,z) ∂μ ω) := by + have he (ω : Ω) : (∫⁻ z, f (ω,z) ∂μ ω) = + ⨆ n, ∫⁻ z in compactCovering upperHalfPlane n, f (ω,z) ∂μ ω := by + rw [← setLIntegral_iUnion_of_directed _ (Monotone.directed_le (compactCovering_subset upperHalfPlane)), + iUnion_compactCovering,Measure.restrict_univ] + simp_rw [he] + apply Measurable.iSup + intro n + have hK := (isCompact_compactCovering upperHalfPlane n).measurableSet + have hm : Measurable (fun ω => (μ ω).restrict (compactCovering upperHalfPlane n)) := by + apply Measure.measurable_of_measurable_coe + intro A hA + simp only [Measure.restrict_apply hA] + exact (Measure.measurable_coe (hA.inter hK)).comp hμ + apply finite_halfPlane_random_test_measurable _ hm _ f hf + intro ω + let := hfin ω + exact ⟨by simpa only [Measure.restrict_apply_univ] using + (isCompact_compactCovering upperHalfPlane n).measure_lt_top (μ := μ ω)⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTerminalUniqueness.lean b/lean/OAI/Probability/SLE/Mass/RadonTerminalUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c39003d25695ae4cbf9040ad4b66f89992b459f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTerminalUniqueness.lean @@ -0,0 +1,49 @@ +import OAI.Probability.SLE.Mass.RadonProcessUniqueness +import OAI.Probability.SLE.Mass.RationalTraceMassLocalVariation +import OAI.Probability.SLE.Mass.LocallyFiniteMeasureSubtract + +namespace OAI + +/-! Local exhaustion determines the terminal measure once the finite-time +increasing Radon family is fixed. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal NNReal Topology + +namespace SLEExactGauge + +lemma radon_terminal_eq_of_common_exhaustion + {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + (μ ν : Measure X) [μ.Regular] [ν.Regular] + (N : ℝ≥0 → Measure X) + (hμ : ∀ t, N t ≤ μ) (hν : ∀ t, N t ≤ ν) + (hlμ : ∀ K : Set X, IsCompact K → Tendsto (fun t : ℝ≥0 => (μ-N t) K) atTop (𝓝 0)) + (hlν : ∀ K : Set X, IsCompact K → Tendsto (fun t : ℝ≥0 => (ν-N t) K) atTop (𝓝 0)) : + μ = ν := by + have hle (ρ σ : Measure X) [ρ.Regular] (hρ : ∀ t, N t ≤ ρ) (hσ : ∀ t, N t ≤ σ) + (hl : ∀ K : Set X, IsCompact K → Tendsto (fun t : ℝ≥0 => (ρ-N t) K) atTop (𝓝 0)) + (K : Set X) (hK : IsCompact K) : ρ K ≤ σ K := by + have hb (t : ℝ≥0) : ρ K ≤ σ K+(ρ-N t) K := by + let : IsFiniteMeasureOnCompacts (N t) := + ⟨fun L hL => lt_of_le_of_lt (hρ t L) hL.measure_lt_top⟩ + rw [sub_apply_of_finite_restriction (hρ t) hK.measurableSet hK.measure_lt_top.ne] + calc + ρ K = (ρ K-N t K)+N t K := (tsub_add_cancel_of_le (hρ t K)).symm + _ ≤ (ρ K-N t K)+σ K := add_le_add le_rfl (hσ t K) + _ = _ := add_comm _ _ + have hlim := (tendsto_const_nhds (x := σ K)).add (hl K hK) + simp only [add_zero] at hlim + exact le_of_tendsto_of_tendsto' tendsto_const_nhds hlim hb + apply Measure.OuterRegular.ext_isOpen + apply Measure.InnerRegularWRT.eq_of_innerRegularWRT_of_forall_eq + Measure.Regular.innerRegular Measure.Regular.innerRegular + intro K hK + exact (hle μ ν hμ hν hlμ K hK).antisymm (hle ν μ hν hμ hlν K hK) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTestDetermines.lean b/lean/OAI/Probability/SLE/Mass/RadonTestDetermines.lean new file mode 100644 index 0000000000000000000000000000000000000000..47041cca8db6d5d14378c29a9ec4332934ed64ad --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTestDetermines.lean @@ -0,0 +1,49 @@ +import OAI.Probability.SLE.Mass.RadonTestLimit + +namespace OAI + +/-! The constructed countable local family determines a regular measure. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +theorem LocalTestFamily.measure_eq_of_test_integrals (D : LocalTestFamily X) + (μ ν : Measure X) [μ.Regular] [ν.Regular] + (h : ∀ j, (∫ x, D.test j x ∂μ) = ∫ x, D.test j x ∂ν) : μ = ν := by + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + let M (n : ℕ) := if n % 2 = 0 then μ else ν + let (n : ℕ) : IsFiniteMeasureOnCompacts (M n) := by + dsimp only [M] + split_ifs <;> infer_instance + have hc : CauchySeq (fun n => ∫ x, f x ∂M n) := D.integrals_cauchy M (fun j => by + refine ⟨∫ x, D.test j x ∂ν,?_⟩ + have he : (fun n => ∫ x, D.test j x ∂M n) = fun _ => ∫ x, D.test j x ∂ν := by + funext n + dsimp only [M] + split_ifs + · exact h j + · rfl + rw [he] + exact tendsto_const_nhds) f + apply eq_of_dist_eq_zero + apply le_antisymm _ dist_nonneg + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp hc ε hε + have hh := hN (2*N) (by omega) (2*N+1) (by omega) + have hm0 : (2*N)%2=0 := by omega + have hm1 : (2*N+1)%2≠0 := by omega + simpa only [M,hm0,hm1,ite_true,ite_false,zero_add] using hh.le + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTestFamily.lean b/lean/OAI/Probability/SLE/Mass/RadonTestFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3dace8daf4c7a0411ff0f9556fa227d770a4a05 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTestFamily.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SLE.Mass.RadonTestLimit +import Mathlib.Topology.ContinuousMap.SecondCountableSpace +import Mathlib.Topology.UrysohnsLemma + +namespace OAI + +/-! A countable determining family on a second-countable locally compact +space, constructed from compact exhaustion and separability on compacts. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] + +omit [LocallyCompactSpace X] in +/-- Compact support in a fixed compact set admits a countable uniformly +dense family, with the same support constraint. -/ +theorem exists_compact_test_sequence (K : Set X) (hK : IsCompact K) : + ∃ f : ℕ → C_c(X, ℝ), (∀ j, tsupport (f j) ⊆ K) ∧ + ∀ g : C_c(X, ℝ), tsupport g ⊆ K → ∀ ε : ℝ, 0 < ε → + ∃ j, ∀ x, |g x-f j x| ≤ ε := by + classical + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + let S : Set C(K, ℝ) := {g | ∃ f : C_c(X, ℝ), tsupport f ⊆ K ∧ ∀ x : K, g x=f x} + have hzero : (0 : C(K, ℝ)) ∈ S := by + refine ⟨0, ?_, fun _ => rfl⟩ + simp + let : Nonempty S := ⟨⟨0,hzero⟩⟩ + obtain ⟨d,hd⟩ := TopologicalSpace.exists_dense_seq S + have hrep (j : ℕ) : ∃ f : C_c(X, ℝ), tsupport f ⊆ K ∧ ∀ x : K, (d j).1 x=f x := + (d j).2 + choose f hf hrep using hrep + refine ⟨f,hf,fun g hg ε hε => ?_⟩ + let r : C(K, ℝ) := ⟨fun x => g x, g.continuous.comp continuous_subtype_val⟩ + have hr : r ∈ S := ⟨g,hg,fun _ => rfl⟩ + obtain ⟨j,hj⟩ := Metric.denseRange_iff.mp hd ⟨r,hr⟩ ε hε + refine ⟨j,fun x => ?_⟩ + by_cases hx : x ∈ K + · have hb := ContinuousMap.norm_coe_le_norm (r-(d j).1) ⟨x,hx⟩ + have hb' : |g x-f j x| ≤ dist (⟨r,hr⟩ : S) (d j) := by + change |g x-f j x| ≤ dist r (d j).1 + rw [dist_eq_norm] + simpa only [ContinuousMap.sub_apply, Real.norm_eq_abs, hrep j ⟨x,hx⟩, r, + ContinuousMap.coe_mk] using hb + exact hb'.trans hj.le + · have hgx : g x=0 := image_eq_zero_of_notMem_tsupport (fun h => hx (hg h)) + have hfx : f j x=0 := image_eq_zero_of_notMem_tsupport (fun h => hx (hf j h)) + simpa only [hgx,hfx,sub_self,abs_zero] using hε.le + +omit [SecondCountableTopology X] in +/-- One nonnegative compactly supported cutoff dominates one on a given +compact set. -/ +theorem exists_compact_test_cutoff (K : Set X) (hK : IsCompact K) : + ∃ f : C_c(X, ℝ), (∀ x, 0 ≤ f x) ∧ ∀ x ∈ K, 1 ≤ f x := by + obtain ⟨f,hf,hfc,_,h01⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen + hK isOpen_univ (subset_univ K) + refine ⟨⟨f,hfc⟩,fun x => (h01 x).1,fun x hx => ?_⟩ + change 1 ≤ f x + rw [hf hx] + rfl + +/-- The determining family required by Radon reconstruction exists +without an additional density or cutoff hypothesis. -/ +theorem exists_localTestFamily : Nonempty (LocalTestFamily X) := by + classical + let K := CompactExhaustion.choice X + have hdense (n : ℕ) := exists_compact_test_sequence (K n) (K.isCompact n) + choose f hf hfdense using hdense + have hcut (n : ℕ) := exists_compact_test_cutoff (K n) (K.isCompact n) + choose ψ hψ0 hψ1 using hcut + let test (j : ℕ) : C_c(X, ℝ) := + match Encodable.decode (α := ℕ ⊕ (ℕ × ℕ)) j with + | some (.inl n) => ψ n + | some (.inr (n,k)) => f n k + | none => 0 + have htest_cut (n : ℕ) : test (Encodable.encode (Sum.inl n : ℕ ⊕ (ℕ × ℕ)))=ψ n := by + simp only [test, Encodable.encodek] + have htest_dense (n j : ℕ) : + test (Encodable.encode (Sum.inr (n,j) : ℕ ⊕ (ℕ × ℕ)))=f n j := by + simp only [test, Encodable.encodek] + refine ⟨{ + compactSet := K + isCompact := K.isCompact + exhaustive := fun _ h => K.exists_superset_of_isCompact h + test := test + cutoffIndex := fun n => Encodable.encode (Sum.inl n : ℕ ⊕ (ℕ × ℕ)) + cutoff_nonneg := ?_ + cutoff_one_le := ?_ + dense := ?_ }⟩ + · intro n x + rw [htest_cut] + exact hψ0 n x + · intro n x hx + rw [htest_cut] + exact hψ1 n x hx + · intro n g hg ε hε + obtain ⟨j,hj⟩ := hfdense n g hg ε hε + refine ⟨Encodable.encode (Sum.inr (n,j) : ℕ ⊕ (ℕ × ℕ)), ?_, ?_⟩ + · rw [htest_dense] + exact hf n j + · rw [htest_dense] + exact hj + +/-- A chosen countable family can be used for all times and all random +outcomes of a measure-valued construction. -/ +def localTestFamily (X : Type*) [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] : LocalTestFamily X := + Classical.choice exists_localTestFamily + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTestLimit.lean b/lean/OAI/Probability/SLE/Mass/RadonTestLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..a574783b1bf742227b82656c294305d542f3d4cf --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTestLimit.lean @@ -0,0 +1,138 @@ +import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real +import Mathlib.Topology.MetricSpace.Sequences + +namespace OAI + +/-! Deterministic reconstruction in `mass:construction`. A countable +family locally dense in compactly supported continuous functions, +including nonnegative exhaustion cutoffs, determines one Radon limit. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +/-- A countable determining family with explicit support control. +Density is in the uniform norm within each compact exhaustion set. -/ +structure LocalTestFamily (X : Type*) [TopologicalSpace X] where + compactSet : ℕ → Set X + isCompact : ∀ n, IsCompact (compactSet n) + exhaustive : ∀ K : Set X, IsCompact K → ∃ n, K ⊆ compactSet n + test : ℕ → C_c(X, ℝ) + cutoffIndex : ℕ → ℕ + cutoff_nonneg : ∀ n x, 0 ≤ test (cutoffIndex n) x + cutoff_one_le : ∀ n x, x ∈ compactSet n → 1 ≤ test (cutoffIndex n) x + dense : ∀ n (f : C_c(X, ℝ)), tsupport f ⊆ compactSet n → + ∀ ε : ℝ, 0 < ε → ∃ j, tsupport (test j) ⊆ compactSet n ∧ + ∀ x, |f x-test j x| ≤ ε + +omit [T2Space X] [LocallyCompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma LocalTestFamily.weighted_approximation (D : LocalTestFamily X) (f : C_c(X, ℝ)) : + ∃ k, (∀ x, 0 ≤ D.test k x) ∧ ∀ ε : ℝ, 0 < ε → + ∃ j, ∀ x, |f x-D.test j x| ≤ ε * D.test k x := by + obtain ⟨n,hn⟩ := D.exhaustive (tsupport f) f.hasCompactSupport + refine ⟨D.cutoffIndex n,D.cutoff_nonneg n,fun ε hε => ?_⟩ + obtain ⟨j,hj,happrox⟩ := D.dense n f hn ε hε + refine ⟨j,fun x => ?_⟩ + by_cases hx : x ∈ D.compactSet n + · exact (happrox x).trans (le_mul_of_one_le_right hε.le (D.cutoff_one_le n x hx)) + · have hfx : f x=0 := image_eq_zero_of_notMem_tsupport (fun h => hx (hn h)) + have hjx : D.test j x=0 := image_eq_zero_of_notMem_tsupport (fun h => hx (hj h)) + rw [hfx,hjx,sub_self,abs_zero] + exact mul_nonneg hε.le (D.cutoff_nonneg n x) + +omit [T2Space X] [LocallyCompactSpace X] in +lemma integral_sub_le_cutoff (μ : Measure X) [IsFiniteMeasureOnCompacts μ] + (f g ψ : C_c(X, ℝ)) (ε : ℝ) + (h : ∀ x, |f x-g x| ≤ ε*ψ x) : + |(∫ x, f x ∂μ)-(∫ x, g x ∂μ)| ≤ ε*(∫ x, ψ x ∂μ) := by + rw [← integral_sub f.integrable g.integrable] + have hh := norm_integral_le_of_norm_le (f := fun x => f x-g x) (ψ.integrable.const_mul ε) + (ae_of_all μ (fun x => by simpa only [Real.norm_eq_abs] using h x)) + simpa only [Real.norm_eq_abs,integral_const_mul] using hh + +omit [T2Space X] [LocallyCompactSpace X] in +/-- Compactly supported integrals are Cauchy once the countable tests +converge. Cutoff convergence supplies the uniform local mass bounds. -/ +theorem LocalTestFamily.integrals_cauchy (D : LocalTestFamily X) + (μ : ℕ → Measure X) [∀ n, IsFiniteMeasureOnCompacts (μ n)] + (htest : ∀ j, ∃ a : ℝ, Tendsto (fun n => ∫ x, D.test j x ∂μ n) atTop (𝓝 a)) + (f : C_c(X, ℝ)) : CauchySeq (fun n => ∫ x, f x ∂μ n) := by + obtain ⟨k,_,hk⟩ := D.weighted_approximation f + obtain ⟨a,ha⟩ := htest k + obtain ⟨B,hB⟩ := (Metric.isBounded_range_of_tendsto _ ha).exists_norm_le + have hB0 : 0 ≤ B := (norm_nonneg _).trans (hB _ (mem_range_self 0)) + have hB' (n : ℕ) : (∫ x, D.test k x ∂μ n) ≤ B := + (le_abs_self _).trans (by simpa only [Real.norm_eq_abs] using hB _ (mem_range_self n)) + apply Metric.cauchySeq_iff.mpr + intro ε hε + let δ : ℝ := ε/(4*(B+1)) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hδB : δ*B < ε/4 := by + dsimp [δ] + rw [div_mul_eq_mul_div,div_lt_div_iff₀ (by positivity) (by norm_num : (0:ℝ)<4)] + nlinarith + obtain ⟨j,hj⟩ := hk δ hδ + obtain ⟨a,ha⟩ := htest j + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp ha.cauchySeq (ε/2) (by positivity) + have herror (n : ℕ) : dist (∫ x, f x ∂μ n) (∫ x, D.test j x ∂μ n) ≤ δ*B := by + rw [Real.dist_eq] + exact (integral_sub_le_cutoff (μ n) f (D.test j) (D.test k) δ hj).trans + (mul_le_mul_of_nonneg_left (hB' n) hδ.le) + refine ⟨N,fun n hn m hm => ?_⟩ + have hmid := hN n hn m hm + have htri := dist_triangle (∫ x, f x ∂μ n) (∫ x, D.test j x ∂μ n) (∫ x, f x ∂μ m) + have htri' := dist_triangle (∫ x, D.test j x ∂μ n) (∫ x, D.test j x ∂μ m) (∫ x, f x ∂μ m) + have hright : dist (∫ x, D.test j x ∂μ m) (∫ x, f x ∂μ m) ≤ δ*B := by + rw [dist_comm] + exact herror m + have hleft := herror n + linarith + +/-- Positive limits of compact continuous tests are represented by one +locally finite regular measure. -/ +theorem radon_limit_of_all_test_limits (μ : ℕ → Measure X) + [∀ n, IsFiniteMeasureOnCompacts (μ n)] + (hlimit : ∀ f : C_c(X, ℝ), ∃ a : ℝ, + Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 a)) : + ∃ ν : Measure X, ν.Regular ∧ IsFiniteMeasureOnCompacts ν ∧ + ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν)) := by + choose L hL using hlimit + let I (n : ℕ) : C_c(X, ℝ) →ₚ[ℝ] ℝ := + CompactlySupportedContinuousMap.integralPositiveLinearMap (μ n) + have hI (f : C_c(X, ℝ)) : Tendsto (fun n => I n f) atTop (𝓝 (L f)) := hL f + have hadd (f g : C_c(X, ℝ)) : L (f+g) = L f+L g := by + apply tendsto_nhds_unique (hI (f+g)) + simpa only [map_add] using (hI f).add (hI g) + have hsmul (c : ℝ) (f : C_c(X, ℝ)) : L (c • f) = c • L f := by + apply tendsto_nhds_unique (hI (c • f)) + simpa only [map_smul] using tendsto_const_nhds.smul (hI f) + let Λ : C_c(X, ℝ) →ₚ[ℝ] ℝ := + { toFun := L + map_add' := hadd + map_smul' := hsmul + monotone' := fun f g hfg => le_of_tendsto_of_tendsto' (hI f) (hI g) + (fun n => (I n).monotone hfg) } + refine ⟨RealRMK.rieszMeasure Λ,inferInstance,inferInstance,fun f => ?_⟩ + rw [RealRMK.integral_rieszMeasure] + exact hL f + +/-- Reconstruction from a single countable locally determining family. -/ +theorem LocalTestFamily.exists_radon_limit (D : LocalTestFamily X) + (μ : ℕ → Measure X) [∀ n, IsFiniteMeasureOnCompacts (μ n)] + (htest : ∀ j, ∃ a : ℝ, Tendsto (fun n => ∫ x, D.test j x ∂μ n) atTop (𝓝 a)) : + ∃ ν : Measure X, ν.Regular ∧ IsFiniteMeasureOnCompacts ν ∧ + ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν)) := by + apply radon_limit_of_all_test_limits μ + intro f + exact cauchySeq_tendsto_of_complete (D.integrals_cauchy μ htest f) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTestLimitProperties.lean b/lean/OAI/Probability/SLE/Mass/RadonTestLimitProperties.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed4d511ae2774e243d50421f3a439ed928667ca5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTestLimitProperties.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Mass.RadonTestFamily + +namespace OAI + +/-! Order and closed-support properties of the reconstructed Radon limits. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported ENNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [MeasurableSpace X] [BorelSpace X] + +lemma compact_measure_le_test_integral (μ : Measure X) [μ.Regular] + (f : C_c(X, ℝ)) (hf : ∀ x, 0 ≤ f x) {K : Set X} (hK : IsCompact K) + (hfone : ∀ x ∈ K, f x=1) : μ K ≤ ENNReal.ofReal (∫ x, f x ∂μ) := by + simpa only [RealRMK.rieszMeasure_integralPositiveLinearMap, + CompactlySupportedContinuousMap.integralPositiveLinearMap_apply] using + RealRMK.rieszMeasure_le_of_eq_one + (CompactlySupportedContinuousMap.integralPositiveLinearMap μ) hf hK hfone + +lemma test_integral_le_measure (μ : Measure X) [μ.Regular] + (f : C_c(X, ℝ)) (hf : ∀ x, 0 ≤ f x ∧ f x ≤ 1) {U : Set X} + (hs : tsupport f ⊆ U) : ENNReal.ofReal (∫ x, f x ∂μ) ≤ μ U := by + simpa only [RealRMK.rieszMeasure_integralPositiveLinearMap, + CompactlySupportedContinuousMap.integralPositiveLinearMap_apply] using + RealRMK.le_rieszMeasure_tsupport_subset + (CompactlySupportedContinuousMap.integralPositiveLinearMap μ) hf hs + +/-- The positive compact-test order determines the order of Radon measures. -/ +theorem radon_measure_le_of_nonneg_tests (μ ν : Measure X) [μ.Regular] [ν.Regular] + (h : ∀ f : C_c(X, ℝ), (∀ x, 0 ≤ f x) → (∫ x, f x ∂μ) ≤ ∫ x, f x ∂ν) : μ ≤ ν := by + have hc (K : Set X) (hK : IsCompact K) : μ K ≤ ν K := by + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + obtain ⟨U,hKU,hU,hνU⟩ := K.exists_isOpen_le_add ν + (ne_of_gt (ENNReal.coe_lt_coe.mpr hε)) + obtain ⟨f,hf1,hfc,hfs,hf01⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen + hK hU hKU + let g : C_c(X, ℝ) := ⟨f,hfc⟩ + have hg0 : ∀ x, 0 ≤ g x := fun x => (hf01 x).1 + calc + μ K ≤ ENNReal.ofReal (∫ x, g x ∂μ) := compact_measure_le_test_integral μ g hg0 hK hf1 + _ ≤ ENNReal.ofReal (∫ x, g x ∂ν) := ENNReal.ofReal_le_ofReal (h g hg0) + _ ≤ ν U := test_integral_le_measure ν g hf01 hfs + _ ≤ ν K+ε := hνU + have ho (U : Set X) (hU : IsOpen U) : μ U ≤ ν U := by + rw [Measure.Regular.innerRegular.measure_eq_iSup hU] + exact iSup_le fun K => iSup_le fun hKU => iSup_le fun hK => (hc K hK).trans (measure_mono hKU) + apply Measure.le_iff'.mpr + intro A + rw [A.measure_eq_iInf_isOpen ν] + exact le_iInf fun U => le_iInf fun hAU => le_iInf fun hU => (measure_mono hAU).trans (ho U hU) + +/-- Order of positive approximants passes to every compact-test limit. -/ +theorem radon_limits_mono (μ ν : ℕ → Measure X) + [∀ n, IsFiniteMeasureOnCompacts (μ n)] [∀ n, IsFiniteMeasureOnCompacts (ν n)] + (μ₀ ν₀ : Measure X) [μ₀.Regular] [ν₀.Regular] + (hμ : ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂μ₀))) + (hν : ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂ν n) atTop (𝓝 (∫ x, f x ∂ν₀))) + (hle : ∀ n, μ n ≤ ν n) : μ₀ ≤ ν₀ := by + apply radon_measure_le_of_nonneg_tests + intro f hf + exact le_of_tendsto_of_tendsto' (hμ f) (hν f) (fun n => + integral_mono_measure (hle n) (ae_of_all _ hf) f.integrable) + +/-- Vanishing compact tests inside an open set force the Radon mass of +that open set to vanish. -/ +theorem radon_open_eq_zero_of_tests (μ : Measure X) [μ.Regular] (U : Set X) (hU : IsOpen U) + (hzero : ∀ f : C_c(X, ℝ), tsupport f ⊆ U → (∫ x, f x ∂μ)=0) : μ U=0 := by + apply le_antisymm ?_ bot_le + rw [Measure.Regular.innerRegular.measure_eq_iSup hU] + refine iSup_le fun K => iSup_le fun hKU => iSup_le fun hK => ?_ + obtain ⟨f,hf1,hfc,hfs,hf01⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen + hK hU hKU + let g : C_c(X, ℝ) := ⟨f,hfc⟩ + have hg0 : ∀ x, 0 ≤ g x := fun x => (hf01 x).1 + have hb := compact_measure_le_test_integral μ g hg0 hK hf1 + change μ K ≤ 0 + simpa only [hzero g hfs,ENNReal.ofReal_zero] using hb + +/-- The compact-test limit is carried by a closed set if each compact +test separated from it eventually vanishes. -/ +theorem radon_limit_carried_by_closed (μ : ℕ → Measure X) (ν : Measure X) [ν.Regular] + (hlim : ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν))) + (S : Set X) (hS : IsClosed S) + (hvanish : ∀ f : C_c(X, ℝ), tsupport f ⊆ Sᶜ → + ∀ᶠ n in atTop, (∫ x, f x ∂μ n)=0) : ν Sᶜ=0 := by + apply radon_open_eq_zero_of_tests ν Sᶜ hS.isOpen_compl + intro f hf + have heq : (fun _ : ℕ => (0:ℝ)) =ᶠ[atTop] (fun n => ∫ x, f x ∂μ n) := + (hvanish f hf).mono (fun _ h => h.symm) + exact tendsto_nhds_unique (hlim f) (tendsto_const_nhds.congr' heq) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RadonTestMeasurability.lean b/lean/OAI/Probability/SLE/Mass/RadonTestMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..f093013be00cbcdf355ad78c1a22796d68eeed0b --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RadonTestMeasurability.lean @@ -0,0 +1,138 @@ +import OAI.Probability.SLE.Mass.RadonTestLimitProperties +import Mathlib.MeasureTheory.Measure.GiryMonad +import Mathlib.MeasureTheory.Constructions.Polish.Basic + +namespace OAI + +/-! A Radon measure determined by measurable compact continuous tests is +a measurable measure-valued function. Local finite restrictions are used, +so no finite total-mass hypothesis is imposed. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported ENNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +/-- A fixed countable list of compact cutoffs recovers the mass of a fixed +open set simultaneously for all Radon measures. -/ +theorem exists_open_cutoff_sequence (U : Set X) (hU : IsOpen U) : + ∃ f : ℕ → C_c(X, ℝ), (∀ n x, 0 ≤ f n x ∧ f n x ≤ 1) ∧ + (∀ n, tsupport (f n) ⊆ U) ∧ ∀ (μ : Measure X), μ.Regular → + μ U = ⨆ n, ENNReal.ofReal (∫ x, f n x ∂μ) := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let K := CompactExhaustion.choice U + let A (n : ℕ) : Set X := Subtype.val '' K n + have hAc (n : ℕ) : IsCompact (A n) := (K.isCompact n).image continuous_subtype_val + have hAU (n : ℕ) : A n ⊆ U := by rintro _ ⟨x,_,rfl⟩; exact x.2 + have hcut (n : ℕ) := exists_continuousMap_one_of_isCompact_subset_isOpen (hAc n) hU (hAU n) + choose f hf1 hfc hfs hf01 using hcut + let g (n : ℕ) : C_c(X, ℝ) := ⟨f n,hfc n⟩ + have hAm : Monotone A := fun _ _ h => image_mono (K.subset h) + have hUnion : (⋃ n, A n)=U := by + ext x + constructor + · intro hx + obtain ⟨n,hn⟩ := mem_iUnion.mp hx + exact hAU n hn + · intro hx + obtain ⟨n,hn⟩ := K.exists_mem (⟨x,hx⟩ : U) + exact mem_iUnion.mpr ⟨n,⟨⟨x,hx⟩,hn,rfl⟩⟩ + refine ⟨g,hf01,hfs,fun μ hμ => ?_⟩ + let : μ.Regular := hμ + apply le_antisymm + · rw [← hUnion,hAm.measure_iUnion] + exact iSup_mono fun n => compact_measure_le_test_integral μ (g n) + (fun x => (hf01 n x).1) (hAc n) (hf1 n) + · exact iSup_le fun n => test_integral_le_measure μ (g n) (hf01 n) (hfs n) + +/-- Measurability of all compact continuous test integrals implies +measurability of every open-set evaluation. -/ +theorem measurable_open_evaluation_of_tests + {Ω : Type*} [MeasurableSpace Ω] (ν : Ω → Measure X) + (hν : ∀ ω, (ν ω).Regular) + (htest : ∀ f : C_c(X, ℝ), Measurable (fun ω => ∫ x, f x ∂ν ω)) + (U : Set X) (hU : IsOpen U) : Measurable (fun ω => ν ω U) := by + obtain ⟨f,_,_,hf⟩ := exists_open_cutoff_sequence U hU + have he : (fun ω => ν ω U)=(fun ω => ⨆ n, ENNReal.ofReal (∫ x, f n x ∂ν ω)) := + funext fun ω => hf (ν ω) (hν ω) + rw [he] + exact Measurable.iSup fun n => (htest (f n)).ennreal_ofReal + +omit [T2Space X] in +/-- Locally finite Radon kernels are measurable once all their open-set +evaluations are measurable. -/ +theorem measurable_radon_of_open_evaluations + {Ω : Type*} [MeasurableSpace Ω] (ν : Ω → Measure X) + (hν : ∀ ω, (ν ω).Regular) + (hopen : ∀ U : Set X, IsOpen U → Measurable (fun ω => ν ω U)) : Measurable ν := by + let K := CompactExhaustion.choice X + let U (n : ℕ) := interior (K n) + have hU (n : ℕ) : IsOpen (U n) := isOpen_interior + have hfinite (n : ℕ) (ω : Ω) : ν ω (U n) < ⊤ := by + let : (ν ω).Regular := hν ω + exact (measure_mono interior_subset).trans_lt (K.isCompact n).measure_lt_top + have hlocal (n : ℕ) : ∀ A : Set X, MeasurableSet A → + Measurable (fun ω => ν ω (A ∩ U n)) := by + apply MeasurableSet.induction_on_open + · intro A hA + exact hopen _ (hA.inter (hU n)) + · intro A hA hm + have he (ω : Ω) : ν ω (Aᶜ ∩ U n)=ν ω (U n)-ν ω (A ∩ U n) := by + have hset : Aᶜ ∩ U n=U n \ (A ∩ U n) := by ext x; simp only [Set.mem_inter_iff,Set.mem_compl_iff,Set.mem_sdiff]; tauto + rw [hset] + exact measure_sdiff inter_subset_right (hA.inter (hU n).measurableSet).nullMeasurableSet + ((measure_mono inter_subset_right).trans_lt (hfinite n ω)).ne + simp_rw [he] + exact (hopen _ (hU n)).sub hm + · intro A hd hA hm + have hd' : Pairwise (fun i j => Disjoint (A i ∩ U n) (A j ∩ U n)) := + fun i j hij => (hd hij).mono inter_subset_left inter_subset_left + have he (ω : Ω) : ν ω ((⋃ i, A i) ∩ U n)=∑' i, ν ω (A i ∩ U n) := by + rw [iUnion_inter] + exact measure_iUnion hd' (fun i => (hA i).inter (hU n).measurableSet) + simp_rw [he] + exact Measurable.tsum hm + have hUnion : (⋃ n, U n)=univ := by + apply eq_univ_of_forall + intro x + obtain ⟨n,hn⟩ := K.exists_mem x + exact mem_iUnion.mpr ⟨n+1,K.subset_interior_succ n hn⟩ + have hUm : Monotone U := fun _ _ h => interior_mono (K.subset h) + apply Measure.measurable_of_measurable_coe + intro A hA + have he (ω : Ω) : ν ω A=⨆ n, ν ω (A ∩ U n) := by + have hmono : Monotone (fun n => A ∩ U n) := monotone_const.inter hUm + rw [← hmono.measure_iUnion,← inter_iUnion,hUnion,inter_univ] + simp_rw [he] + exact Measurable.iSup fun n => hlocal n A hA + +/-- A reconstruction with measurable compact-test integrals is a genuine +measurable measure-valued map, not only a collection of scalar tests. -/ +theorem measurable_radon_of_tests + {Ω : Type*} [MeasurableSpace Ω] (ν : Ω → Measure X) + (hν : ∀ ω, (ν ω).Regular) + (htest : ∀ f : C_c(X, ℝ), Measurable (fun ω => ∫ x, f x ∂ν ω)) : Measurable ν := + measurable_radon_of_open_evaluations ν hν (measurable_open_evaluation_of_tests ν hν htest) + +/-- Pointwise convergence of measurable compact-test integrals provides +measurability of the reconstructed Radon kernel. -/ +theorem measurable_radon_of_test_limits + {Ω : Type*} [MeasurableSpace Ω] (μ : ℕ → Ω → Measure X) (ν : Ω → Measure X) + (hν : ∀ ω, (ν ω).Regular) + (hmeas : ∀ n (f : C_c(X, ℝ)), Measurable (fun ω => ∫ x, f x ∂μ n ω)) + (hlim : ∀ ω (f : C_c(X, ℝ)), Tendsto (fun n => ∫ x, f x ∂μ n ω) + atTop (𝓝 (∫ x, f x ∂ν ω))) : Measurable ν := by + apply measurable_radon_of_tests ν hν + intro f + exact measurable_of_tendsto_metrizable (fun n => hmeas n f) + (tendsto_pi_nhds.mpr (fun ω => hlim ω f)) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RandomDilationMass.lean b/lean/OAI/Probability/SLE/Mass/RandomDilationMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ced430bd1cfb6f6ce7606046b5d470494f5d08c --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RandomDilationMass.lean @@ -0,0 +1,36 @@ +import OAI.Probability.SLE.Mass.DilationMass +import OAI.Probability.SLE.Mass.WeightedImageRandomMass +import OAI.Probability.SLE.Stochastic.ProgressiveParameterTime + +namespace OAI + +/-! Measurability of the actual mass normalization when its scale and +evaluation time are selected from the stopped past. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +lemma dilationMass_measurable_family {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (c : Ω → ℝ≥0) (hc : Measurable c) (hpos : ∀ ω, 0 dilationMass κ (c ω) (hpos ω) (μ ω)) := by + let J : Ω × upperHalfPlane → upperHalfPlane := fun p => halfPlaneDilation (c p.1) (hpos p.1) p.2 + have hJ : Measurable J := by + apply Measurable.subtype_mk + exact (Complex.measurable_ofReal.comp + (NNReal.continuous_coe.measurable.comp (hc.comp measurable_fst))).mul + (measurable_subtype_coe.comp measurable_snd) + let w : Ω × upperHalfPlane → ℝ≥0∞ := fun p => ENNReal.ofReal ((c p.1:ℝ)^dimension κ) + have hw : Measurable w := ENNReal.measurable_ofReal.comp + ((NNReal.continuous_coe.measurable.comp (hc.comp measurable_fst)).pow measurable_const) + exact weightedImageMass_measurable μ hμ hfin J hJ w hw + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RandomMeasureDifference.lean b/lean/OAI/Probability/SLE/Mass/RandomMeasureDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a15675b7e97bcfad9ec73f1c7e9362da3f2122f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RandomMeasureDifference.lean @@ -0,0 +1,78 @@ +import OAI.Probability.SLE.Mass.LocallyFiniteMeasureSubtract +import OAI.Probability.SLE.Mass.RationalTraceMassAdapted + +namespace OAI + +/-! Positive differences of locally finite random Radon measures admit +measurable versions. No finite total mass is required. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped ENNReal Topology CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma halfPlane_sub_finite_on_compacts (μ ν : Measure upperHalfPlane) + [IsFiniteMeasureOnCompacts μ] : IsFiniteMeasureOnCompacts (μ-ν) := + ⟨fun K hK => lt_of_le_of_lt (Measure.sub_le K) hK.measure_lt_top⟩ + +lemma integral_halfPlane_sub (μ ν : Measure upperHalfPlane) [μ.Regular] [ν.Regular] + (hle : ν ≤ μ) (f : C_c(upperHalfPlane,ℝ)) : + (∫ z, f z ∂(μ-ν)) = (∫ z, f z ∂μ) - ∫ z, f z ∂ν := by + let := halfPlane_sub_finite_on_compacts μ ν + have hi := integral_add_measure (μ := μ-ν) (ν := ν) f.integrable f.integrable + rw [sigmaFinite_sub_add_cancel_of_le hle] at hi + linarith + +theorem measurable_halfPlane_sub_of_le + {Ω : Type*} [MeasurableSpace Ω] (μ ν : Ω → Measure upperHalfPlane) + (hμ : Measurable μ) (hν : Measurable ν) + (hμr : ∀ ω, (μ ω).Regular) (hνr : ∀ ω, (ν ω).Regular) + (hle : ∀ ω, ν ω ≤ μ ω) : Measurable (fun ω => μ ω-ν ω) := by + let (ω : Ω) : (μ ω).Regular := hμr ω + let (ω : Ω) : (ν ω).Regular := hνr ω + let (ω : Ω) : IsFiniteMeasureOnCompacts (μ ω-ν ω) := + halfPlane_sub_finite_on_compacts (μ ω) (ν ω) + apply measurable_radon_of_tests _ (fun _ => inferInstance) + intro f + simp_rw [integral_halfPlane_sub _ _ (hle _) f] + exact (measurable_halfPlane_compact_test_integral μ hμ hμr f).sub + (measurable_halfPlane_compact_test_integral ν hν hνr f) + +theorem exists_measurable_halfPlane_difference + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (μ ν : Ω → Measure upperHalfPlane) + (hμ : Measurable μ) (hν : Measurable ν) + (hμr : ∀ ω, (μ ω).Regular) (hνr : ∀ ω, (ν ω).Regular) + (hle : ∀ᵐ ω ∂P, ν ω ≤ μ ω) : + ∃ η : Ω → Measure upperHalfPlane, Measurable η ∧ + (∀ ω, (η ω).Regular ∧ IsFiniteMeasureOnCompacts (η ω)) ∧ + (∀ᵐ ω ∂P, η ω + ν ω = μ ω) := by + obtain ⟨E,hE,hEm,hEsub⟩ := hle.exists_measurable_mem + let μ' (ω : Ω) := if ω ∈ E then μ ω else 0 + let ν' (ω : Ω) := if ω ∈ E then ν ω else 0 + have hμ' : Measurable μ' := hμ.ite hEm measurable_const + have hν' : Measurable ν' := hν.ite hEm measurable_const + have hμr' (ω : Ω) : (μ' ω).Regular := by + dsimp only [μ']; split_ifs; exacts [hμr ω,inferInstance] + have hνr' (ω : Ω) : (ν' ω).Regular := by + dsimp only [ν']; split_ifs; exacts [hνr ω,inferInstance] + have hle' (ω : Ω) : ν' ω ≤ μ' ω := by + dsimp only [μ',ν']; split_ifs with he + · exact hEsub ω he + · exact le_rfl + refine ⟨fun ω => μ' ω-ν' ω,measurable_halfPlane_sub_of_le μ' ν' hμ' hν' hμr' hνr' hle',?_,?_⟩ + · intro ω + let := hμr' ω + let := halfPlane_sub_finite_on_compacts (μ' ω) (ν' ω) + exact ⟨inferInstance,inferInstance⟩ + · filter_upwards [hE] with ω hω + let := hνr ω + simpa only [μ',ν',ite_eq_left hω] using sigmaFinite_sub_add_cancel_of_le (hEsub ω hω) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RandomRadonEquality.lean b/lean/OAI/Probability/SLE/Mass/RandomRadonEquality.lean new file mode 100644 index 0000000000000000000000000000000000000000..b67ebe48d2a056329ce6b51ab59e6ae847ae53f5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RandomRadonEquality.lean @@ -0,0 +1,35 @@ +import OAI.Probability.SLE.Mass.RadonProcessAEUniqueness +import OAI.Probability.SLE.LoewnerCharts +import OAI.Probability.SLE.Mass.RadonTestFamily + +namespace OAI + +/-! Equality of nonnegative tests yields equality of random Radon measures +on one common event, using the existing countable determining family. -/ +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported NNReal ENNReal + +namespace SLEExactGauge + +lemma random_halfPlane_measure_eq_of_lintegrals + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (N M : Ω → Measure upperHalfPlane) + (hN : ∀ ω, (N ω).Regular) (hM : ∀ ω, (M ω).Regular) + (htest : ∀ f : C_c(upperHalfPlane,ℝ), (∀ z, 0 ≤ f z) → + ∀ᵐ ω ∂P, (∫⁻ z, ENNReal.ofReal (f z) ∂N ω)=∫⁻ z, ENNReal.ofReal (f z) ∂M ω) : + ∀ᵐ ω ∂P, N ω=M ω := by + let : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + have h := random_radon_process_eq_of_positive_tests P (localTestFamily upperHalfPlane) + (fun _ => N) (fun _ => M) (fun _ => hN) (fun _ => hM) (fun f hf => ?_) + · exact h.mono (fun _ hω => hω 0) + · filter_upwards [htest f hf] with ω hω + intro _ + rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hf) f.continuous.measurable.aestronglyMeasurable, + integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hf) f.continuous.measurable.aestronglyMeasurable,hω] + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RandomRadonLimit.lean b/lean/OAI/Probability/SLE/Mass/RandomRadonLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..b14dbbb531753747280b524da71a6baf8c452079 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RandomRadonLimit.lean @@ -0,0 +1,116 @@ +import OAI.Probability.SLE.Mass.RadonTestMeasurability + +namespace OAI + +/-! Measurable selection of the pathwise Radon limit. Only a measurable +full-measure set is retained; the limit is set to zero on its complement. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +/-- An almost-sure regular vague limit of random positive measures has a +measurable regular version. The approximants need only have measurable +compact-test integrals. -/ +theorem exists_measurable_random_radon_limit + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (μ : ℕ → Ω → Measure X) + (hmeas : ∀ n (f : C_c(X,ℝ)), Measurable (fun ω => ∫ x, f x ∂μ n ω)) + (hex : ∀ᵐ ω ∂P, ∃ ν : Measure X, ν.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν))) : + ∃ ν : Ω → Measure X, Measurable ν ∧ + (∀ ω, (ν ω).Regular ∧ IsFiniteMeasureOnCompacts (ν ω)) ∧ + ∀ᵐ ω ∂P, ∀ f : C_c(X,ℝ), + Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν ω)) := by + let good (ω : Ω) : Prop := ∃ ν : Measure X, ν.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν)) + have hnull : P {ω | ¬good ω}=0 := ae_iff.mp hex + obtain ⟨N,hN,hNm,hN0⟩ := exists_measurable_superset_of_null hnull + have hgood (ω : Ω) (hω : ω ∉ N) : good ω := by + by_contra h + exact hω (hN h) + have hall (ω : Ω) : ∃ ν : Measure X, ν.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto (fun n => if ω ∈ N then (0:ℝ) else ∫ x, f x ∂μ n ω) + atTop (𝓝 (∫ x, f x ∂ν)) := by + by_cases hω : ω ∈ N + · refine ⟨0,inferInstance,fun f => ?_⟩ + simpa only [ite_eq_left hω,integral_zero_measure] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:ℝ)) atTop (𝓝 0)) + · obtain ⟨ν,hν,hlim⟩ := hgood ω hω + exact ⟨ν,hν,fun f => by simpa only [ite_eq_right hω] using hlim f⟩ + choose ν hν hlim using hall + have hνm : Measurable ν := by + apply measurable_radon_of_tests ν hν + intro f + apply measurable_of_tendsto_metrizable + (f := fun n ω => if ω ∈ N then (0:ℝ) else ∫ x, f x ∂μ n ω) + · intro n + exact measurable_const.ite hNm (hmeas n f) + · exact tendsto_pi_nhds.mpr (fun ω => hlim ω f) + refine ⟨ν,hνm,fun ω => ?_,?_⟩ + · let : (ν ω).Regular := hν ω + exact ⟨hν ω,inferInstance⟩ + · filter_upwards [compl_mem_ae_iff.mpr hN0] with ω hω + intro f + simpa only [ite_eq_right hω] using hlim ω f + +/-- Countably many times retain one common event of convergence, and each +selected time slice is a measurable locally finite regular random measure. -/ +theorem exists_measurable_countable_radon_limits + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (μ : ℕ → ℕ → Ω → Measure X) + (hmeas : ∀ n j (f : C_c(X,ℝ)), Measurable (fun ω => ∫ x, f x ∂μ n j ω)) + (hex : ∀ᵐ ω ∂P, ∃ ν : ℕ → Measure X, (∀ j, (ν j).Regular) ∧ + ∀ j (f : C_c(X,ℝ)), Tendsto (fun n => ∫ x, f x ∂μ n j ω) atTop (𝓝 (∫ x, f x ∂ν j))) : + ∃ ν : ℕ → Ω → Measure X, (∀ j, Measurable (ν j)) ∧ + (∀ j ω, (ν j ω).Regular ∧ IsFiniteMeasureOnCompacts (ν j ω)) ∧ + ∀ᵐ ω ∂P, ∀ j (f : C_c(X,ℝ)), + Tendsto (fun n => ∫ x, f x ∂μ n j ω) atTop (𝓝 (∫ x, f x ∂ν j ω)) := by + have hj (j : ℕ) : ∀ᵐ ω ∂P, ∃ ν : Measure X, ν.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n j ω) atTop (𝓝 (∫ x, f x ∂ν)) := by + filter_upwards [hex] with ω hω + obtain ⟨ν,hν,hlim⟩ := hω + exact ⟨ν j,hν j,hlim j⟩ + choose ν hνm hνr hlim using fun j => + exists_measurable_random_radon_limit P (fun n => μ n j) (fun n => hmeas n j) (hj j) + exact ⟨ν,hνm,hνr,ae_all_iff.mpr hlim⟩ + +omit [SecondCountableTopology X] in +/-- Regular vague limits of the same sequence are unique. -/ +theorem radon_test_limit_unique (μ : ℕ → Measure X) (ν η : Measure X) + [ν.Regular] [η.Regular] + (hν : ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν))) + (hη : ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂η))) : + ν=η := + Measure.ext_of_integral_eq_on_compactlySupported fun f => tendsto_nhds_unique (hν f) (hη f) + +/-- Any pathwise version of the same limit is almost everywhere +measurable, useful when the approximants are measurable in a smaller +stopped or deterministic-time sigma algebra. -/ +theorem aemeasurable_radon_of_test_limits_ae + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (μ : ℕ → Ω → Measure X) + (ν : Ω → Measure X) + (hmeas : ∀ n (f : C_c(X,ℝ)), Measurable (fun ω => ∫ x, f x ∂μ n ω)) + (hν : ∀ᵐ ω ∂P, (ν ω).Regular) + (hlim : ∀ᵐ ω ∂P, ∀ f : C_c(X,ℝ), + Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν ω))) : + AEMeasurable ν P := by + have hex : ∀ᵐ ω ∂P, ∃ η : Measure X, η.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂η)) := by + filter_upwards [hν,hlim] with ω hr hl + exact ⟨ν ω,hr,hl⟩ + obtain ⟨η,hηm,hηr,hηlim⟩ := exists_measurable_random_radon_limit P μ hmeas hex + apply hηm.aemeasurable.congr + filter_upwards [hν,hlim,hηlim] with ω hr hl hηl + let : (ν ω).Regular := hr + let : (η ω).Regular := (hηr ω).1 + exact (radon_test_limit_unique (fun n => μ n ω) (ν ω) (η ω) hl hηl).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalCanonicalMass.lean b/lean/OAI/Probability/SLE/Mass/RationalCanonicalMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d9c3678ebeb546c1799cbda60745d95b9f0e77f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalCanonicalMass.lean @@ -0,0 +1,190 @@ +import OAI.Probability.SLE.Mass.LevelRemainderSupport +import OAI.Probability.SLE.Mass.RationalMassFromSupports +import OAI.Probability.SLE.Mass.CountableLevelAdapted +import OAI.Probability.SLE.Mass.LevelRadonNonatomic + +namespace OAI + +/-! The actual common convex-tail construction at rational times, with +adapted versions, positive trace increments and its conditional Green kernel. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +def rationalMassTime (n : ℕ) : ℝ≥0 := + (((Encodable.decode (α := ℚ) n).getD 0 : ℚ) : ℝ).toNNReal + +@[simp] lemma rationalMassTime_encode (q : ℚ) : + rationalMassTime (Encodable.encode q) = (q : ℝ).toNNReal := by + simp only [rationalMassTime,Encodable.encodek,Option.getD_some] + +structure RationalCanonicalMass + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (hBm : Measurable (Function.uncurry B)) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) where + terminal : Ω → Measure upperHalfPlane + mass : ℚ → Ω → Measure upperHalfPlane + terminal_measurable : Measurable terminal + mass_measurable : ∀ q : ℚ, Measurable[Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable) + (q : ℝ).toNNReal] (mass q) + terminal_radon : ∀ ω, (terminal ω).Regular ∧ IsFiniteMeasureOnCompacts (terminal ω) + mass_radon : ∀ q ω, (mass q ω).Regular ∧ IsFiniteMeasureOnCompacts (mass q ω) + supports : ℕ → Finset ℕ + weights : ℕ → ℕ → ℝ + weights_nonneg : ∀ n i, i ∈ supports n → 0 ≤ weights n i + weights_sum : ∀ n, ∑ i ∈ supports n, weights n i = 1 + terminal_limit : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G (fun n => (n:ℝ)) + supports weights n ∞ ω) atTop (𝓝 (∫ z, f z ∂terminal ω)) + mass_limit : ∀ᵐ ω ∂P, ∀ (q : ℚ) (f : C_c(upperHalfPlane,ℝ)), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G (fun n => (n:ℝ)) + supports weights n (q : ℝ).toNNReal ω) atTop (𝓝 (∫ z, f z ∂mass q ω)) + zero : ∀ᵐ ω ∂P, mass 0 ω = 0 + increments : ∀ᵐ ω ∂P, + HalfPlaneTraceIncrements (fun q => mass q ω) (terminal ω) (fun r => γ ω r.toNNReal) + nonatomic : ∀ᵐ ω ∂P, NullSingletonClass (terminal ω) + moments : ∀ K : Set upperHalfPlane, IsCompact K → ∀ m : ℕ, + (∫⁻ ω, terminal ω K ^ m ∂P) < ∞ + mean : P.bind terminal = initialGreenMeasure κ + conditional : ∀ q : ℚ, ∀ E : Set Ω, + MeasurableSet[Filtration.natural B (fun r => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r)).stronglyMeasurable) + (q : ℝ).toNNReal] E → + (P.restrict E).bind terminal = (P.restrict E).bind (mass q) + + (P.restrict E).bind (halfPlaneGreenMeasure κ B γ G (q : ℝ).toNNReal) + +theorem exists_rationalCanonicalMass + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) : + Nonempty (RationalCanonicalMass P κ B hBm γ G) := by + obtain ⟨s,w,ν,η,hw₀,hw₁,hνm,hν,hlim,hηm,hη,hηsum,hmean,hkernel⟩ := + exists_countable_radon_remainder_kernels hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth + rationalMassTime + have hfiniteLimit : ∀ᵐ ω ∂P, ∀ j (f : C_c(upperHalfPlane,ℝ)), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G (fun n => (n:ℝ)) + s w n (rationalMassTime j) ω) atTop (𝓝 (∫ z, f z ∂ν (j+1) ω)) := by + filter_upwards [hlim] with ω hω + intro j f + simpa only [levelMassTimes_succ] using hω (j+1) f + obtain ⟨M,hMm,hMr,hMeq⟩ := countable_level_limits_have_past_versions P + (fun r => hBm.comp (measurable_const.prodMk measurable_id)) hBc hκ hκ8 γ G F hw + (fun n => (n:ℝ)) (fun n => Nat.cast_nonneg n) s w hw₀ rationalMassTime + (fun j => ν (j+1)) (Eventually.of_forall (fun ω j => (hν (j+1) ω).1)) hfiniteLimit + let μ (q : ℚ) := M (Encodable.encode q) + have hμeq : ∀ᵐ ω ∂P, ∀ q, μ q ω = ν (Encodable.encode q+1) ω := by + filter_upwards [hMeq] with ω hω + exact fun q => hω _ + have hμlim : ∀ᵐ ω ∂P, ∀ (q : ℚ) (f : C_c(upperHalfPlane,ℝ)), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G (fun n => (n:ℝ)) + s w n (q:ℝ).toNNReal ω) atTop (𝓝 (∫ z, f z ∂μ q ω)) := by + filter_upwards [hfiniteLimit,hμeq] with ω hl he + intro q f + rw [he q] + simpa only [rationalMassTime_encode] using hl (Encodable.encode q) f + have htermLimit : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G (fun n => (n:ℝ)) + s w n ∞ ω) atTop (𝓝 (∫ z, f z ∂ν 0 ω)) := by + filter_upwards [hlim] with ω hω + exact hω 0 + have hfuture (j : ℕ) := ae_remainder_carried_by_surviving hB hBm hBc hB0 hκ hκ8 γ G F hw + (rationalMassTime j) (η j) (hηm j) (fun ω => (hη j ω).2) (hkernel j) + have hinc : ∀ᵐ ω ∂P, + HalfPlaneTraceIncrements (fun q => μ q ω) (ν 0 ω) (fun r => γ ω r.toNNReal) := by + filter_upwards [hμlim,htermLimit,hμeq,hηsum,ae_all_iff.mpr hfuture] with ω hl ht he hs hf + let : (ν 0 ω).Regular := (hν 0 ω).1 + let (q : ℚ) : (μ q ω).Regular := (hMr (Encodable.encode q) ω).1 + let (q : ℚ) : IsFiniteMeasureOnCompacts (μ q ω) := (hMr (Encodable.encode q) ω).2 + let (n : ℕ) (v : ℝ≥0∞) : IsFiniteMeasureOnCompacts + (convexLevelMeasure κ B γ G (fun n => (n:ℝ)) s w n v ω) := + convexLevelMeasure_finite_on_compacts hκ hκ8 γ G F ω (hBc ω) (hw ω) _ s w n v + have hdom (q : ℚ) : μ q ω ≤ ν 0 ω := by + apply radon_limits_mono _ _ _ _ (hl q) ht + intro n + exact convexLevelMeasure_mono κ B γ G (fun n => (n:ℝ)) s w n ω le_top + have hmono : Monotone (fun q => μ q ω) := by + intro p q hpq + let (n : ℕ) : IsFiniteMeasureOnCompacts + (convexLevelMeasure κ B γ G (fun n => (n:ℝ)) s w n (p:ℝ).toNNReal ω) := + convexLevelMeasure_finite_on_compacts hκ hκ8 γ G F ω (hBc ω) (hw ω) _ s w n _ + apply radon_limits_mono _ _ _ _ (hl p) (hl q) + intro n + exact convexLevelMeasure_mono κ B γ G (fun n => (n:ℝ)) s w n ω + (ENNReal.coe_le_coe.mpr (Real.toNNReal_mono (Rat.cast_le.mpr hpq))) + have hzero (q : ℚ) (hq : q ≤ 0) : μ q ω = 0 := by + apply convex_level_radon_limit_zero_at_zero ω (hBc ω) (hw ω) (fun n => (n:ℝ)) + tendsto_natCast_atTop_atTop s w (μ q ω) + simpa only [Real.toNNReal_eq_zero.mpr (Rat.cast_nonpos.mpr hq),ENNReal.coe_zero] using hl q + apply halfPlaneTraceIncrements_of_past_and_future (fun q => μ q ω) (ν 0 ω) (γ ω) + (fun q => (hMr (Encodable.encode q) ω).1) hdom hmono hzero + · intro q _ + exact convex_level_radon_limit_carried_by_past ω (hBc ω) (hw ω) _ (fun n => (n:ℝ)) + tendsto_natCast_atTop_atTop s w (μ q ω) (hl q) + · intro q _ + have heη : η (Encodable.encode q) ω = ν 0 ω-μ q ω := by + apply (Measure.add_left_inj (μ q ω) _ _).mp + rw [sigmaFinite_sub_add_cancel_of_le (hdom q),he q] + exact hs _ + rw [← heη] + simpa only [rationalMassTime_encode] using hf (Encodable.encode q) + refine ⟨{ + terminal := ν 0 + mass := μ + terminal_measurable := hνm 0 + mass_measurable := ?_ + terminal_radon := hν 0 + mass_radon := fun q => hMr (Encodable.encode q) + supports := s + weights := w + weights_nonneg := hw₀ + weights_sum := hw₁ + terminal_limit := htermLimit + mass_limit := hμlim + zero := ?_ + increments := hinc + nonatomic := ?_ + moments := ?_ + mean := hmean + conditional := ?_ }⟩ + · intro q + simpa +instances only [rationalMassTime_encode,Function.comp_def,Function.uncurry] using hMm (Encodable.encode q) + · filter_upwards [hμlim] with ω hω + let : (μ 0 ω).Regular := (hMr (Encodable.encode (0:ℚ)) ω).1 + apply convex_level_radon_limit_zero_at_zero ω (hBc ω) (hw ω) (fun n => (n:ℝ)) + tendsto_natCast_atTop_atTop s w (μ 0 ω) + simpa only [Rat.cast_zero,Real.toNNReal_zero,ENNReal.coe_zero] using hω 0 + · exact level_radon_limit_nonatomic hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth + (fun n => (n:ℝ)) (fun n => Nat.cast_nonneg n) s w hw₀ hw₁ ∞ (ν 0) (hνm 0) + (fun ω => (hν 0 ω).2) htermLimit + · intro K hK m + exact level_radon_limit_compact_moments hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth + (fun n => (n:ℝ)) (fun n => Nat.cast_nonneg n) s w hw₀ hw₁ ∞ (ν 0) + (fun ω => (hν 0 ω).2) htermLimit K hK m + · intro q E hE + have hμm : Measurable (μ q) := (hMm (Encodable.encode q)).mono (Filtration.le _ _) le_rfl + have hs : ∀ᵐ ω ∂P, η (Encodable.encode q) ω + μ q ω = ν 0 ω := by + filter_upwards [hμeq,hηsum] with ω he hs + rw [he q] + exact hs _ + have hc := bind_add_of_ae (P.restrict E) (μ q) (ν 0) (η (Encodable.encode q)) + hμm (hνm 0) (hηm _) (ae_restrict_of_ae hs) + rw [← hc,add_comm] + congr 1 + simpa only [rationalMassTime_encode] using hkernel (Encodable.encode q) E (by simpa +instances only [rationalMassTime_encode] using hE) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalMassFromSupports.lean b/lean/OAI/Probability/SLE/Mass/RationalMassFromSupports.lean new file mode 100644 index 0000000000000000000000000000000000000000..63a2acadb0ba77f93bb55f66a1196e6a4d69effa --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalMassFromSupports.lean @@ -0,0 +1,85 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassLocal +import OAI.Probability.SLE.Mass.LevelRadonSupport +import OAI.Probability.SLE.Mass.LocallyFiniteMeasureSubtract + +namespace OAI + +/-! Past support and the remaining-mass support give exactly the rational +increment hypothesis used by the locally finite continuous extension. -/ + +noncomputable section +open Set MeasureTheory Classical +open scoped NNReal ENNReal + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma trace_segment_toNNReal_image (γ : ℝ≥0 → ℂ) {p q : ℚ} (hp : 0 ≤ p) (hpq : p ≤ q) : + γ '' Icc (p : ℝ).toNNReal (q : ℝ).toNNReal ⊆ + (fun r : ℝ => γ r.toNNReal) '' Icc (p:ℝ) q := by + rintro _ ⟨r,hr,rfl⟩ + refine ⟨(r:ℝ),⟨?_,?_⟩,?_⟩ + · have hr' : ((p:ℝ).toNNReal:ℝ) ≤ (r:ℝ) := by exact_mod_cast hr.1 + simpa only [Real.coe_toNNReal _ (Rat.cast_nonneg.mpr hp)] using hr' + · have hq : (0:ℝ) ≤ q := Rat.cast_nonneg.mpr (hp.trans hpq) + have hr' : (r:ℝ) ≤ ((q:ℝ).toNNReal:ℝ) := by exact_mod_cast hr.2 + simpa only [Real.coe_toNNReal _ hq] using hr' + · change γ (r:ℝ).toNNReal = γ r + rw [Real.toNNReal_coe] + +theorem halfPlaneTraceIncrements_of_past_and_future + (μ : ℚ → Measure upperHalfPlane) (ν : Measure upperHalfPlane) [ν.Regular] + (γ : ℝ≥0 → ℂ) (hμr : ∀ q, (μ q).Regular) + (hdom : ∀ q, μ q ≤ ν) (hmono : Monotone μ) + (hzero : ∀ q, q ≤ 0 → μ q = 0) + (hpast : ∀ q, 0 ≤ q → μ q {z : upperHalfPlane | (z : ℂ) ∉ γ '' Icc 0 (q : ℝ).toNNReal} = 0) + (hfuture : ∀ q, 0 ≤ q → (ν-μ q) + {z : upperHalfPlane | (z : ℂ) ∉ survivingDomain γ (q : ℝ).toNNReal} = 0) : + HalfPlaneTraceIncrements μ ν (fun r : ℝ => γ r.toNNReal) := by + let (q : ℚ) : (μ q).Regular := hμr q + refine ⟨hμr,hdom,?_⟩ + intro p q hpq + let η := μ q-μ p + have hηsum : μ q = μ p+η := by + rw [add_comm] + exact (sigmaFinite_sub_add_cancel_of_le (hmono hpq)).symm + refine ⟨η,hηsum,?_⟩ + by_cases hq : q ≤ 0 + · have hp : p ≤ 0 := hpq.trans hq + simp only [η,hzero p hp,hzero q hq,Measure.sub_self] + exact bot_le + by_cases hp : p < 0 + · have heη : η = μ q := by simp only [η,hzero p hp.le,Measure.sub_zero] + rw [heη] + let A := {z : upperHalfPlane | (z : ℂ) ∈ (fun r : ℝ => γ r.toNNReal) '' Icc (p:ℝ) q} + have hqpos : 0 < (q:ℝ) := Rat.cast_pos.mpr (lt_of_not_ge hq) + have hsubset : γ '' Icc 0 (q:ℝ).toNNReal ⊆ + (fun r : ℝ => γ r.toNNReal) '' Icc (p:ℝ) q := by + rintro _ ⟨r,hr,rfl⟩ + refine ⟨(r:ℝ),⟨(Rat.cast_nonpos.mpr hp.le).trans r.coe_nonneg,?_⟩,?_⟩ + · have hr' : (r:ℝ) ≤ ((q:ℝ).toNNReal:ℝ) := by exact_mod_cast hr.2 + simpa only [Real.coe_toNNReal _ hqpos.le] using hr' + · change γ (r:ℝ).toNNReal = γ r + rw [Real.toNNReal_coe] + have ha : ∀ᵐ z : upperHalfPlane ∂μ q, z ∈ A := by + have hh := measure_eq_zero_iff_ae_notMem.mp (hpast q (lt_of_not_ge hq).le) + filter_upwards [hh] with z hz + exact hsubset (not_not.mp hz) + calc + μ q = (μ q).restrict A := (Measure.restrict_eq_self_of_ae_mem ha).symm + _ ≤ ν.restrict A := Measure.restrict_mono le_rfl (hdom q) + · have hp' : 0 ≤ p := le_of_not_gt hp + have hq' : 0 ≤ q := hp'.trans hpq + have hh := Multipoint.increment_le_restrict_trace_segment γ + (p:ℝ).toNNReal (q:ℝ).toNNReal η (μ q) (ν-μ p) ν + Measure.sub_le (sub_le_sub_right_of_le (hdom p) (hdom q)) + (Measure.sub_le.trans (hdom q)) (hpast q hq') (hfuture p hp') + exact hh.trans (Measure.restrict_mono + (fun (z : upperHalfPlane) hz => trace_segment_toNNReal_image γ hp' hpq hz) le_rfl) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMass.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..13c02a5356481650491be2d7c2a549558f3c66ff --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMass.lean @@ -0,0 +1,137 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassControl +import Mathlib.Topology.Sequences + +namespace OAI + +/-! Continuous extension of a rational measure family whose positive +increments are supported on the corresponding trace intervals. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported ENNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +/-- This is the positive-increment and interval-support assertion used in +the pathwise extension. Local applications restrict all measures to one +compact set, making the terminal measure finite. -/ +structure RationalTraceIncrements (μ : ℚ → Measure X) (ν : Measure X) (γ : ℝ → X) : Prop where + regular : ∀ q, (μ q).Regular + dominated : ∀ q, μ q ≤ ν + increment : ∀ p q, p ≤ q → ∃ η : Measure X, + μ q=μ p+η ∧ η ≤ ν.restrict (γ '' Icc (p:ℝ) q) + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] [BorelSpace X] in +lemma RationalTraceIncrements.monotone {μ : ℚ → Measure X} {ν : Measure X} {γ : ℝ → X} + (H : RationalTraceIncrements μ ν γ) : Monotone μ := by + intro p q hpq + obtain ⟨η,hη,_⟩ := H.increment p q hpq + rw [hη] + exact Measure.le_add_right le_rfl + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] in +lemma RationalTraceIncrements.integral_dist_le {μ : ℚ → Measure X} {ν : Measure X} + [IsFiniteMeasure ν] {γ : ℝ → X} (H : RationalTraceIncrements μ ν γ) + (f : C_c(X,ℝ)) (p q : ℚ) : + dist (∫ x, f x ∂μ p) (∫ x, f x ∂μ q) ≤ ‖f.toBoundedContinuousFunction‖ * + (ν (γ '' Icc (min (p:ℝ) q) (max (p:ℝ) q))).toReal := by + have ordered (a b : ℚ) (hab : a ≤ b) : + dist (∫ x, f x ∂μ a) (∫ x, f x ∂μ b) ≤ ‖f.toBoundedContinuousFunction‖ * + (ν (γ '' Icc (a:ℝ) b)).toReal := by + obtain ⟨η,hη,hην⟩ := H.increment a b hab + have hηle : η ≤ ν := hην.trans Measure.restrict_le_self + let : IsFiniteMeasure η := isFiniteMeasure_of_le ν hηle + let : (μ a).Regular := H.regular a + rw [hη,integral_add_measure f.integrable f.integrable,dist_eq_norm] + have hsub : (∫ x, f x ∂μ a)-((∫ x, f x ∂μ a)+(∫ x, f x ∂η))= -(∫ x, f x ∂η) := by ring + rw [hsub,norm_neg] + have hb := norm_integral_le_of_norm_le_const (μ := η) + (ae_of_all η (fun x => f.toBoundedContinuousFunction.norm_coe_le_norm x)) + apply hb.trans + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply ENNReal.toReal_mono (measure_ne_top ν _) + exact (hην univ).trans_eq (by simp) + rcases le_total p q with h | h + · simpa only [min_eq_left (Rat.cast_le.mpr h),max_eq_right (Rat.cast_le.mpr h)] using ordered p q h + · rw [dist_comm] + simpa only [min_eq_right (Rat.cast_le.mpr h),max_eq_left (Rat.cast_le.mpr h)] using ordered q p h + +lemma exists_rational_sequence_tendsto (t : ℝ) : + ∃ q : ℕ → ℚ, Tendsto (fun n => (q n : ℝ)) atTop (𝓝 t) := by + obtain ⟨x,hx,ht⟩ := mem_closure_iff_seq_limit.mp (Rat.denseRange_cast t) + choose q hq using hx + exact ⟨q,by simpa only [hq] using ht⟩ + +omit [SecondCountableTopology X] in +/-- The rational family has an all-real-time regular extension, continuous +against every compact continuous test. It is dominated by the same finite +terminal measure, and agrees exactly at every rational time. -/ +theorem RationalTraceIncrements.exists_continuous_extension + {μ : ℚ → Measure X} {ν : Measure X} [ν.Regular] [IsFiniteMeasure ν] + [NullSingletonClass ν] {γ : ℝ → X} (H : RationalTraceIncrements μ ν γ) + (hγ : Continuous γ) : + ∃ M : ℝ → Measure X, (∀ t, (M t).Regular) ∧ (∀ t, M t ≤ ν) ∧ + (∀ q : ℚ, M q=μ q) ∧ + (∀ f : C_c(X,ℝ), Continuous (fun t => ∫ x, f x ∂M t)) ∧ Monotone M := by + have hf (f : C_c(X,ℝ)) := continuous_rational_extension_of_trace_control + ν γ hγ (fun q => ∫ x, f x ∂μ q) ‖f.toBoundedContinuousFunction‖ (norm_nonneg _) + (H.integral_dist_le f) + choose F hFc hFq _ using hf + have hex (t : ℝ) : ∃ η : Measure X, η.Regular ∧ IsFiniteMeasureOnCompacts η ∧ + ∀ f : C_c(X,ℝ), (∫ x, f x ∂η)=F f t := by + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + let (n : ℕ) : (μ (q n)).Regular := H.regular (q n) + have hlim (f : C_c(X,ℝ)) : Tendsto (fun n => ∫ x, f x ∂μ (q n)) atTop (𝓝 (F f t)) := by + simpa only [Function.comp_def,hFq] using (hFc f).continuousAt.tendsto.comp hq + obtain ⟨η,hηr,hηf,hηlim⟩ := radon_limit_of_all_test_limits (fun n => μ (q n)) + (fun f => ⟨F f t,hlim f⟩) + exact ⟨η,hηr,hηf,fun f => tendsto_nhds_unique (hηlim f) (hlim f)⟩ + choose M hMr hMf hMI using hex + have hcont (f : C_c(X,ℝ)) : Continuous (fun t => ∫ x, f x ∂M t) := by + simpa only [hMI] using hFc f + have hrat (q : ℚ) : M q=μ q := by + let : (M q).Regular := hMr q + let : (μ q).Regular := H.regular q + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + rw [hMI,hFq] + have hdom (t : ℝ) : M t ≤ ν := by + let : (M t).Regular := hMr t + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hlim : Tendsto (fun n => ∫ x, f x ∂μ (q n)) atTop (𝓝 (∫ x, f x ∂M t)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hq + apply le_of_tendsto_of_tendsto' hlim tendsto_const_nhds + intro n + exact integral_mono_measure (H.dominated (q n)) (ae_of_all ν hfn) f.integrable + refine ⟨M,hMr,hdom,hrat,hcont,?_⟩ + intro s t hst + rcases eq_or_lt_of_le hst with rfl | hst + · exact le_rfl + let : (M s).Regular := hMr s + let : (M t).Regular := hMr t + obtain ⟨p,hp⟩ := exists_rational_sequence_tendsto s + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + have hp' : ∀ᶠ n in atTop, (p n : ℝ)<(s+t)/2 := hp.eventually (gt_mem_nhds (by linarith)) + have hq' : ∀ᶠ n in atTop, (s+t)/2<(q n : ℝ) := hq.eventually (lt_mem_nhds (by linarith)) + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hplim : Tendsto (fun n => ∫ x, f x ∂μ (p n)) atTop (𝓝 (∫ x, f x ∂M s)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hp + have hqlim : Tendsto (fun n => ∫ x, f x ∂μ (q n)) atTop (𝓝 (∫ x, f x ∂M t)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hq + apply le_of_tendsto_of_tendsto hplim hqlim + filter_upwards [hp',hq'] with n hpn hqn + let : (μ (q n)).Regular := H.regular (q n) + exact integral_mono_measure (H.monotone (Rat.cast_le.mp (le_of_lt (hpn.trans hqn)))) + (ae_of_all _ hfn) f.integrable + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdapted.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdapted.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca8d460383a1e4f0bce3c9f166c21cf37427f57f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdapted.lean @@ -0,0 +1,111 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassLocalVariation +import OAI.Probability.SLE.Mass.RadonTestMeasurability + +namespace OAI + +/-! Adapted and jointly measurable all-time Radon mass, obtained from +rational left limits in the original filtration. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology ENNReal NNReal CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma measurable_halfPlane_compact_test_integral + {Ω : Type*} [MeasurableSpace Ω] (μ : Ω → Measure upperHalfPlane) + (hm : Measurable μ) (hr : ∀ ω, (μ ω).Regular) (f : C_c(upperHalfPlane,ℝ)) : + Measurable (fun ω => ∫ z, f z ∂μ ω) := by + have hp := (Measure.measurable_lintegral f.continuous.measurable.ennreal_ofReal).comp hm + have hn := (Measure.measurable_lintegral f.continuous.measurable.neg.ennreal_ofReal).comp hm + have he (ω : Ω) : (∫ z, f z ∂μ ω) = + (∫⁻ z, ENNReal.ofReal (f z) ∂μ ω).toReal - + (∫⁻ z, ENNReal.ofReal (-f z) ∂μ ω).toReal := by + let := hr ω + exact integral_eq_lintegral_pos_part_sub_lintegral_neg_part f.integrable + simp_rw [he] + exact hp.ennreal_toReal.sub hn.ennreal_toReal + +theorem halfPlane_extension_adapted + {Ω : Type*} [mΩ : MeasurableSpace Ω] (ℱ : Filtration ℝ≥0 mΩ) + (μ : ℚ → Ω → Measure upperHalfPlane) (M : ℝ → Ω → Measure upperHalfPlane) + (hMr : ∀ t ω, (M t ω).Regular) + (hcont : ∀ ω (f : C_c(upperHalfPlane,ℝ)), Continuous (fun t => ∫ z, f z ∂M t ω)) + (hrat : ∀ (q : ℚ) ω, M q ω = μ q ω) + (hμm : ∀ q : ℚ, 0 ≤ q → Measurable[ℱ (q : ℝ).toNNReal] (μ q)) : + Adapted ℱ (fun t : ℝ≥0 => M t) := by + intro t + by_cases ht : t = 0 + · subst t + have he : M (0:ℝ) = μ (0:ℚ) := by + funext ω + simpa only [Rat.cast_zero] using hrat 0 ω + change Measurable[ℱ 0] (M (0:ℝ)) + rw [he] + convert hμm (0:ℚ) le_rfl using 1 + norm_num + · have htpos : 0 < (t:ℝ) := NNReal.coe_pos.mpr (pos_iff_ne_zero.mpr ht) + obtain ⟨q,_,hq,hqt⟩ := Rat.denseRange_cast.exists_seq_strictMono_tendsto_of_lt + (fun a b hab => Rat.cast_le.mpr hab) htpos + let : MeasurableSpace Ω := ℱ t + apply measurable_radon_of_tests (M t) (hMr t) + intro f + have hqm (n : ℕ) : Measurable[ℱ t] (μ (q n)) := by + have hqn : 0 ≤ q n := Rat.cast_nonneg.mp (hq n).1.le + have htime : (q n : ℝ).toNNReal ≤ t := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal (hq n).2.le + exact (hμm (q n) hqn).mono (ℱ.mono htime) le_rfl + apply measurable_of_tendsto_metrizable + (fun n => measurable_halfPlane_compact_test_integral (μ (q n)) (hqm n) + (fun ω => hrat (q n) ω ▸ hMr (q n) ω) f) + apply tendsto_pi_nhds.mpr + intro ω + simpa only [Function.comp_def,hrat] using + (hcont ω f).continuousAt.tendsto.comp hqt + +/-- Joint measurability follows through real compact-test integrals; +no topology on the space of Radon measures is required. -/ +theorem halfPlane_extension_joint_measurable + {Ω : Type*} [mΩ : MeasurableSpace Ω] (ℱ : Filtration ℝ≥0 mΩ) + (μ : ℚ → Ω → Measure upperHalfPlane) (M : ℝ → Ω → Measure upperHalfPlane) + (hMr : ∀ t ω, (M t ω).Regular) + (hcont : ∀ ω (f : C_c(upperHalfPlane,ℝ)), Continuous (fun t => ∫ z, f z ∂M t ω)) + (hrat : ∀ (q : ℚ) ω, M q ω = μ q ω) + (hμm : ∀ q : ℚ, 0 ≤ q → Measurable[ℱ (q : ℝ).toNNReal] (μ q)) : + Measurable (fun q : ℝ≥0 × Ω => M q.1 q.2) := by + have had := halfPlane_extension_adapted ℱ μ M hMr hcont hrat hμm + apply measurable_radon_of_tests (fun q : ℝ≥0 × Ω => M q.1 q.2) + (fun q => hMr q.1 q.2) + intro f + apply measurable_uncurry_of_continuous_of_measurable + (fun ω => (hcont ω f).comp NNReal.continuous_coe) + intro t + exact measurable_halfPlane_compact_test_integral (M t) (had.measurable (i := t)) (hMr t) f + +theorem halfPlane_extension_progressive + {Ω : Type*} [mΩ : MeasurableSpace Ω] (ℱ : Filtration ℝ≥0 mΩ) + (μ : ℚ → Ω → Measure upperHalfPlane) (M : ℝ → Ω → Measure upperHalfPlane) + (hMr : ∀ t ω, (M t ω).Regular) + (hcont : ∀ ω (f : C_c(upperHalfPlane,ℝ)), Continuous (fun t => ∫ z, f z ∂M t ω)) + (hrat : ∀ (q : ℚ) ω, M q ω = μ q ω) + (hμm : ∀ q : ℚ, 0 ≤ q → Measurable[ℱ (q : ℝ).toNNReal] (μ q)) : + IsProgressive ℱ (fun t : ℝ≥0 => M t) := by + have had := halfPlane_extension_adapted ℱ μ M hMr hcont hrat hμm + intro T + let : MeasurableSpace Ω := ℱ T + apply measurable_radon_of_tests (fun q : Iic T × Ω => M q.1.1 q.2) + (fun q => hMr q.1.1 q.2) + intro f + apply measurable_uncurry_of_continuous_of_measurable + (fun ω => (hcont ω f).comp (NNReal.continuous_coe.comp continuous_subtype_val)) + intro t + have ht : Measurable[ℱ T] (M (t.1 : ℝ)) := had.measurable_le t.2 + exact measurable_halfPlane_compact_test_integral (M (t.1 : ℝ)) ht (hMr t.1) f + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdaptedVersion.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdaptedVersion.lean new file mode 100644 index 0000000000000000000000000000000000000000..298b51aa673dbe35f1ceccfd3c748765d2c26506 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassAdaptedVersion.lean @@ -0,0 +1,76 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassAdapted +import OAI.Probability.SLE.Mass.SubSigmaRadonLimit + +namespace OAI + +/-! Rational adapted versions determine one adapted all-time version on the +same probability-one set on which the limiting compact tests are continuous. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology NNReal ENNReal CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +theorem halfPlane_extension_adapted_common_version + {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) (ℱ : Filtration ℝ≥0 mΩ) + (μ : ℚ → Ω → Measure upperHalfPlane) (M : ℝ → Ω → Measure upperHalfPlane) + (hμr : ∀ q ω, (μ q ω).Regular) (hMr : ∀ t ω, (M t ω).Regular) + (hcont : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Continuous (fun t => ∫ z, f z ∂M t ω)) + (hrat : ∀ᵐ ω ∂P, ∀ q : ℚ, M q ω = μ q ω) + (hμm : ∀ q : ℚ, 0 ≤ q → Measurable[ℱ (q : ℝ).toNNReal] (μ q)) : + ∃ N : ℝ≥0 → Ω → Measure upperHalfPlane, Adapted ℱ N ∧ + (∀ t ω, (N t ω).Regular ∧ IsFiniteMeasureOnCompacts (N t ω)) ∧ + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, N t ω = M t ω := by + let Good (ω : Ω) : Prop := + (∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t ω)) ∧ + ∀ q : ℚ, M q ω = μ q ω + have hex (t : ℝ≥0) : ∃ N : Ω → Measure upperHalfPlane, + Measurable[ℱ t] N ∧ (∀ ω, (N ω).Regular ∧ IsFiniteMeasureOnCompacts (N ω)) ∧ + ∀ ω, Good ω → N ω = M t ω := by + by_cases ht : t = 0 + · subst t + refine ⟨μ 0,?_,?_,?_⟩ + · convert hμm (0:ℚ) le_rfl using 1 + norm_num + · intro ω + let := hμr 0 ω + exact ⟨hμr 0 ω,inferInstance⟩ + · intro ω hω + simpa only [Rat.cast_zero,NNReal.coe_zero] using (hω.2 0).symm + · have htpos : 0 < (t:ℝ) := NNReal.coe_pos.mpr (pos_iff_ne_zero.mpr ht) + obtain ⟨q,_,hq,hqt⟩ := Rat.denseRange_cast.exists_seq_strictMono_tendsto_of_lt + (fun a b hab => Rat.cast_le.mpr hab) htpos + have hqm (n : ℕ) : Measurable[ℱ t] (μ (q n)) := by + have hqn : 0 ≤ q n := Rat.cast_nonneg.mp (hq n).1.le + have htime : (q n : ℝ).toNNReal ≤ t := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal (hq n).2.le + exact (hμm (q n) hqn).mono (ℱ.mono htime) le_rfl + have hfinite (n : ℕ) (ω : Ω) : IsFiniteMeasureOnCompacts (μ (q n) ω) := by + let := hμr (q n) ω + infer_instance + let : MeasurableSpace Ω := ℱ t + have hm (n : ℕ) (f : C_c(upperHalfPlane,ℝ)) : + Measurable[ℱ t] (fun ω => ∫ z, f z ∂μ (q n) ω) := + measurable_halfPlane_compact_test_integral (μ (q n)) (hqm n) (hμr (q n)) f + obtain ⟨N,hNm,hNr,hNe⟩ := exists_subsigma_radon_version_identified + (ℱ t) (fun n => μ (q n)) hfinite hm + refine ⟨N,hNm,hNr,?_⟩ + intro ω hω + apply hNe ω (M t ω) (hMr t ω) + intro f + simpa only [Function.comp_def,hω.2] using + (hω.1 f).continuousAt.tendsto.comp hqt + choose N hNm hNr hNe using hex + refine ⟨N,hNm,hNr,?_⟩ + filter_upwards [hcont,hrat] with ω hc hr + exact fun t => hNe t ω ⟨hc,hr⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassControl.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ea64c02ebcfb442691292deeac7fc129e583ec0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassControl.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Mass.RadonTestLimitProperties +import Mathlib.Topology.Instances.Rat +import Mathlib.Topology.DenseEmbedding + +namespace OAI + +/-! Shrinking trace intervals have vanishing nonatomic mass. This gives +local oscillation control and continuous extension from rational times. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] + +omit [BorelSpace X] in +/-- Continuity and null singleton mass control every sufficiently short +trace interval around any fixed time. It applies to a finite compact +restriction of the terminal measure. -/ +theorem trace_interval_mass_small (ν : Measure X) [ν.OuterRegular] + [NullSingletonClass ν] (γ : ℝ → X) (hγ : Continuous γ) + (t : ℝ) (ε : ℝ≥0∞) (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ a b : ℝ, dist a t < δ → dist b t < δ → + ν (γ '' Icc a b) < ε := by + obtain ⟨U,hUsub,hU,hνU⟩ := ({γ t} : Set X).exists_isOpen_lt_of_lt (μ := ν) ε (by simpa using hε) + have htU : γ t ∈ U := hUsub (mem_singleton _) + have hpre : γ ⁻¹' U ∈ 𝓝 t := hγ.continuousAt.preimage_mem_nhds (hU.mem_nhds htU) + obtain ⟨δ,hδ,hδsub⟩ := Metric.mem_nhds_iff.mp hpre + refine ⟨δ,hδ,fun a b ha hb => (measure_mono ?_).trans_lt hνU⟩ + rintro _ ⟨x,hx,rfl⟩ + apply hδsub + rw [Metric.mem_ball,Real.dist_eq] + rw [Real.dist_eq,abs_lt] at ha hb + exact abs_lt.mpr ⟨lt_of_lt_of_le ha.1 (sub_le_sub_right hx.1 t), + lt_of_le_of_lt (sub_le_sub_right hx.2 t) hb.2⟩ + +/-- A rational-time real observable with arbitrarily small local +oscillation has a unique continuous extension to all real times. -/ +theorem exists_continuous_rational_extension + (f : ℚ → ℝ) + (hosc : ∀ t : ℝ, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ p q : ℚ, dist (p:ℝ) t < δ → dist (q:ℝ) t < δ → dist (f p) (f q) < ε) : + ∃ F : ℝ → ℝ, Continuous F ∧ (∀ q : ℚ, F q=f q) ∧ + ∀ G : ℝ → ℝ, Continuous G → (∀ q : ℚ, G q=f q) → G=F := by + let D := Rat.isDenseEmbedding_coe_real.isDenseInducing + have hlim (t : ℝ) : ∃ c : ℝ, Tendsto f (comap ((↑) : ℚ → ℝ) (𝓝 t)) (𝓝 c) := by + let : NeBot (comap ((↑) : ℚ → ℝ) (𝓝 t)) := D.comap_nhds_neBot t + apply cauchy_map_iff_exists_tendsto.mp + apply Metric.cauchy_iff.mpr + refine ⟨inferInstance,fun ε hε => ?_⟩ + obtain ⟨δ,hδ,hcontrol⟩ := hosc t ε hε + let A : Set ℚ := ((↑) : ℚ → ℝ) ⁻¹' Metric.ball t δ + have hA : A ∈ comap ((↑) : ℚ → ℝ) (𝓝 t) := + preimage_mem_comap (Metric.ball_mem_nhds t hδ) + refine ⟨f '' A,image_mem_map hA,?_⟩ + rintro _ ⟨p,hp,rfl⟩ _ ⟨q,hq,rfl⟩ + exact hcontrol p q hp hq + refine ⟨D.extend f,D.continuous_extend hlim,D.extend_eq' hlim,?_⟩ + intro G hG heq + exact (D.extend_unique heq hG).symm + +omit [BorelSpace X] in +/-- The trace-support estimate for increments supplies the local +oscillation hypothesis of the rational extension theorem. -/ +theorem continuous_rational_extension_of_trace_control + (ν : Measure X) [ν.OuterRegular] [IsFiniteMeasure ν] [NullSingletonClass ν] + (γ : ℝ → X) (hγ : Continuous γ) (f : ℚ → ℝ) (C : ℝ) (hC : 0 ≤ C) + (hcontrol : ∀ p q : ℚ, dist (f p) (f q) ≤ + C*(ν (γ '' Icc (min (p:ℝ) q) (max (p:ℝ) q))).toReal) : + ∃ F : ℝ → ℝ, Continuous F ∧ (∀ q : ℚ, F q=f q) ∧ + ∀ G : ℝ → ℝ, Continuous G → (∀ q : ℚ, G q=f q) → G=F := by + apply exists_continuous_rational_extension f + intro t ε hε + have he : 0 < ε/(C+1) := div_pos hε (by linarith) + obtain ⟨δ,hδ,hsmall⟩ := trace_interval_mass_small ν γ hγ t + (ENNReal.ofReal (ε/(C+1))) (ENNReal.ofReal_pos.mpr he) + refine ⟨δ,hδ,fun p q hp hq => ?_⟩ + have hm : dist (min (p:ℝ) q) t < δ := by + rcases le_total (p:ℝ) q with h | h + · simpa only [min_eq_left h] using hp + · simpa only [min_eq_right h] using hq + have hM : dist (max (p:ℝ) q) t < δ := by + rcases le_total (p:ℝ) q with h | h + · simpa only [max_eq_right h] using hq + · simpa only [max_eq_left h] using hp + have hv : (ν (γ '' Icc (min (p:ℝ) q) (max (p:ℝ) q))).toReal < ε/(C+1) := by + have hh := (ENNReal.toReal_lt_toReal (measure_ne_top ν _) ENNReal.ofReal_ne_top).mpr (hsmall _ _ hm hM) + simpa only [ENNReal.toReal_ofReal he.le] using hh + have hbound := hcontrol p q + have hratio : C*(ε/(C+1)) < ε := by + rw [← mul_div_assoc,div_lt_iff₀ (by linarith : 0 (hηle L).trans_lt hL.measure_lt_top⟩ + let : (μ a).Regular := H.regular a + have hηK : η K < ⊤ := f.hasCompactSupport.measure_lt_top + have : Fact (η K < ⊤) := ⟨hηK⟩ + let : IsFiniteMeasure (η.restrict K) := inferInstance + let : IsFiniteMeasure (ambientCompactRestriction ν K) := + ambientCompactRestriction_finite ν K f.hasCompactSupport + have hbound : η K ≤ ambientCompactRestriction ν K (γ '' Icc (a:ℝ) b) := by + calc + η K ≤ ν.restrict A K := hην K + _ = ν (K ∩ A) := Measure.restrict_apply f.hasCompactSupport.measurableSet + _ = ambientCompactRestriction ν K (γ '' Icc (a:ℝ) b) := by + rw [ambientCompactRestriction,Measure.map_apply measurable_subtype_coe + (isCompact_Icc.image hγ).measurableSet] + change ν (K ∩ A) = ν.restrict K A + rw [Measure.restrict_apply hAm,inter_comm] + rw [hη,integral_add_measure f.integrable f.integrable,dist_eq_norm] + have hsub : (∫ z, f z ∂μ a)-((∫ z, f z ∂μ a)+(∫ z, f z ∂η)) = -(∫ z, f z ∂η) := by ring + rw [hsub,norm_neg,← setIntegral_eq_integral_of_forall_compl_eq_zero + (fun z hz => image_eq_zero_of_notMem_tsupport hz)] + have hb := norm_integral_le_of_norm_le_const (μ := η.restrict K) + (ae_of_all _ (fun z => f.toBoundedContinuousFunction.norm_coe_le_norm z)) + apply hb.trans + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply ENNReal.toReal_mono (measure_ne_top (ambientCompactRestriction ν K) _) + simpa only [Measure.restrict_apply_univ] using hbound + rcases le_total p q with h | h + · simpa only [min_eq_left (Rat.cast_le.mpr h),max_eq_right (Rat.cast_le.mpr h)] using ordered p q h + · rw [dist_comm] + simpa only [min_eq_right (Rat.cast_le.mpr h),max_eq_left (Rat.cast_le.mpr h)] using ordered q p h + +lemma HalfPlaneTraceIncrements.continuous_test_extension + {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} [ν.Regular] + [NullSingletonClass ν] {γ : ℝ → ℂ} + (H : HalfPlaneTraceIncrements μ ν γ) (hγ : Continuous γ) (f : C_c(upperHalfPlane,ℝ)) : + ∃ F : ℝ → ℝ, Continuous F ∧ (∀ q : ℚ, F q = ∫ z, f z ∂μ q) ∧ + ∀ G : ℝ → ℝ, Continuous G → (∀ q : ℚ, G q = ∫ z, f z ∂μ q) → G = F := by + let ρ := ambientCompactRestriction ν (tsupport f) + let : IsFiniteMeasure ρ := ambientCompactRestriction_finite ν _ f.hasCompactSupport + let : NullSingletonClass ρ := ambientCompactRestriction_nullSingletons ν _ + exact continuous_rational_extension_of_trace_control ρ γ hγ + (fun q => ∫ z, f z ∂μ q) ‖f.toBoundedContinuousFunction‖ (norm_nonneg _) + (H.integral_dist_le hγ f) + +/-- One locally finite Radon family extends all rational times. Every +compact test is continuous, even when the physical trace meets the real line. -/ +theorem HalfPlaneTraceIncrements.exists_continuous_extension + {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} [ν.Regular] + [NullSingletonClass ν] {γ : ℝ → ℂ} + (H : HalfPlaneTraceIncrements μ ν γ) (hγ : Continuous γ) : + ∃ M : ℝ → Measure upperHalfPlane, (∀ t, (M t).Regular) ∧ (∀ t, M t ≤ ν) ∧ + (∀ q : ℚ, M q = μ q) ∧ + (∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t)) ∧ Monotone M := by + choose F hFc hFq _ using H.continuous_test_extension hγ + have hex (t : ℝ) : ∃ η : Measure upperHalfPlane, η.Regular ∧ IsFiniteMeasureOnCompacts η ∧ + ∀ f : C_c(upperHalfPlane,ℝ), (∫ z, f z ∂η) = F f t := by + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + let (n : ℕ) : (μ (q n)).Regular := H.regular (q n) + have hlim (f : C_c(upperHalfPlane,ℝ)) : + Tendsto (fun n => ∫ z, f z ∂μ (q n)) atTop (𝓝 (F f t)) := by + simpa only [Function.comp_def,hFq] using (hFc f).continuousAt.tendsto.comp hq + obtain ⟨η,hηr,hηf,hηlim⟩ := radon_limit_of_all_test_limits (fun n => μ (q n)) + (fun f => ⟨F f t,hlim f⟩) + exact ⟨η,hηr,hηf,fun f => tendsto_nhds_unique (hηlim f) (hlim f)⟩ + choose M hMr hMf hMI using hex + have hcont (f : C_c(upperHalfPlane,ℝ)) : Continuous (fun t => ∫ z, f z ∂M t) := by + simpa only [hMI] using hFc f + have hrat (q : ℚ) : M q = μ q := by + let : (M q).Regular := hMr q + let : (μ q).Regular := H.regular q + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + rw [hMI,hFq] + have hdom (t : ℝ) : M t ≤ ν := by + let : (M t).Regular := hMr t + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hlim : Tendsto (fun n => ∫ z, f z ∂μ (q n)) atTop (𝓝 (∫ z, f z ∂M t)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hq + apply le_of_tendsto_of_tendsto' hlim tendsto_const_nhds + intro n + exact integral_mono_measure (H.dominated (q n)) (ae_of_all ν hfn) f.integrable + refine ⟨M,hMr,hdom,hrat,hcont,?_⟩ + intro s t hst + rcases eq_or_lt_of_le hst with rfl | hst + · exact le_rfl + let : (M s).Regular := hMr s + let : (M t).Regular := hMr t + obtain ⟨p,hp⟩ := exists_rational_sequence_tendsto s + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + have hp' : ∀ᶠ n in atTop, (p n : ℝ) < (s+t)/2 := hp.eventually (gt_mem_nhds (by linarith)) + have hq' : ∀ᶠ n in atTop, (s+t)/2 < (q n : ℝ) := hq.eventually (lt_mem_nhds (by linarith)) + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hplim : Tendsto (fun n => ∫ z, f z ∂μ (p n)) atTop (𝓝 (∫ z, f z ∂M s)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hp + have hqlim : Tendsto (fun n => ∫ z, f z ∂μ (q n)) atTop (𝓝 (∫ z, f z ∂M t)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hq + apply le_of_tendsto_of_tendsto hplim hqlim + filter_upwards [hp',hq'] with n hpn hqn + let : (μ (q n)).Regular := H.regular (q n) + exact integral_mono_measure (H.monotone (Rat.cast_le.mp (le_of_lt (hpn.trans hqn)))) + (ae_of_all _ hfn) f.integrable + +/-- Agreement at rational times identifies continuous Radon families. +Thus the reconstruction is independent of compact exhaustions. -/ +theorem halfPlane_continuous_measure_extension_unique + (M N : ℝ → Measure upperHalfPlane) + (hMr : ∀ t, (M t).Regular) (hNr : ∀ t, (N t).Regular) + (hMc : ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t)) + (hNc : ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂N t)) + (heq : ∀ q : ℚ, M q = N q) : M = N := by + funext t + let : (M t).Regular := hMr t + let : (N t).Regular := hNr t + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + obtain ⟨q,hq⟩ := exists_rational_sequence_tendsto t + have hm := (hMc f).continuousAt.tendsto.comp hq + have hn := (hNc f).continuousAt.tendsto.comp hq + simp only [Function.comp_def,heq] at hm hn + exact tendsto_nhds_unique hm hn + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassLocalVariation.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassLocalVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e599d17633d7dabeae5dcc331658285a030c2189 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassLocalVariation.lean @@ -0,0 +1,139 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassLocal + +namespace OAI + +/-! Local total-variation continuity of the half-plane reconstruction. +Only the mass of a fixed compact is used; the terminal mass may be infinite. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology ENNReal CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +private lemma halfPlane_regular_add (μ ν : Measure upperHalfPlane) [μ.Regular] [ν.Regular] : + (μ + ν).Regular := by + let : IsFiniteMeasureOnCompacts (μ + ν) := ⟨fun K hK => by + rw [Measure.add_apply] + exact ENNReal.add_lt_top.mpr ⟨hK.measure_lt_top,hK.measure_lt_top⟩⟩ + infer_instance + +theorem HalfPlaneTraceIncrements.local_variation_continuity + {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} [ν.Regular] + [NullSingletonClass ν] {γ : ℝ → ℂ} + (H : HalfPlaneTraceIncrements μ ν γ) (hγ : Continuous γ) + (M : ℝ → Measure upperHalfPlane) (hMr : ∀ t, (M t).Regular) + (hdom : ∀ t, M t ≤ ν) (hrat : ∀ q : ℚ, M q = μ q) + (hcont : ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t)) + (K : Set upperHalfPlane) (hK : IsCompact K) : + ∀ t₀ : ℝ, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ s t : ℝ, dist s t₀ < δ → dist t t₀ < δ → + ∀ A : Set upperHalfPlane, MeasurableSet A → A ⊆ K → + |(M s A).toReal-(M t A).toReal| < ε := by + intro t₀ ε hε + let ρ := ambientCompactRestriction ν K + let : IsFiniteMeasure ρ := ambientCompactRestriction_finite ν K hK + let : NullSingletonClass ρ := ambientCompactRestriction_nullSingletons ν K + obtain ⟨U,hUsub,hU,hρU⟩ := ({γ t₀} : Set ℂ).exists_isOpen_lt_of_lt (μ := ρ) + (ENNReal.ofReal ε) (by simpa using ENNReal.ofReal_pos.mpr hε) + let V : Set upperHalfPlane := (Subtype.val : upperHalfPlane → ℂ) ⁻¹' U + have hV : IsOpen V := hU.preimage continuous_subtype_val + have htU : γ t₀ ∈ U := hUsub (mem_singleton _) + obtain ⟨δ,hδ,hδsub⟩ := Metric.mem_nhds_iff.mp + (hγ.continuousAt.preimage_mem_nhds (hU.mem_nhds htU)) + have hI (a b : ℝ) (ha : dist a t₀ < δ) (hb : dist b t₀ < δ) : γ '' Icc a b ⊆ U := by + rintro _ ⟨x,hx,rfl⟩ + apply hδsub + rw [Metric.mem_ball,Real.dist_eq] + rw [Real.dist_eq,abs_lt] at ha hb + exact abs_lt.mpr ⟨lt_of_lt_of_le ha.1 (sub_le_sub_right hx.1 t₀), + lt_of_le_of_lt (sub_le_sub_right hx.2 t₀) hb.2⟩ + have hq (p q : ℚ) (hp : dist (p:ℝ) t₀ < δ) (hq : dist (q:ℝ) t₀ < δ) : + μ p ≤ μ q+ν.restrict V := by + rcases le_total p q with hpq | hqp + · exact (H.monotone hpq).trans (Measure.le_add_right le_rfl) + · obtain ⟨η,hη,hην⟩ := H.increment q p hqp + rw [hη] + apply add_le_add le_rfl + exact hην.trans (Measure.restrict_mono + (show {z : upperHalfPlane | (z : ℂ) ∈ γ '' Icc (q:ℝ) p} ⊆ V + from fun z hz => hI q p hq hp hz) le_rfl) + have hreal (s t : ℝ) (hs : dist s t₀ < δ) (ht : dist t t₀ < δ) : + M s ≤ M t+ν.restrict V := by + let : (M s).Regular := hMr s + let : (M t).Regular := hMr t + let : (ν.restrict V).Regular := inferInstance + let : (M t+ν.restrict V).Regular := halfPlane_regular_add _ _ + obtain ⟨p,hp⟩ := exists_rational_sequence_tendsto s + obtain ⟨q,hqt⟩ := exists_rational_sequence_tendsto t + have hpU : ∀ᶠ n in atTop, dist (p n:ℝ) t₀ < δ := + hp.eventually (isOpen_lt (continuous_id.dist continuous_const) continuous_const |>.mem_nhds hs) + have hqU : ∀ᶠ n in atTop, dist (q n:ℝ) t₀ < δ := + hqt.eventually (isOpen_lt (continuous_id.dist continuous_const) continuous_const |>.mem_nhds ht) + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hplim : Tendsto (fun n => ∫ z, f z ∂μ (p n)) atTop (𝓝 (∫ z, f z ∂M s)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hp + have hqlim : Tendsto (fun n => ∫ z, f z ∂(μ (q n)+ν.restrict V)) atTop + (𝓝 (∫ z, f z ∂(M t+ν.restrict V))) := by + have hi := ((hcont f).continuousAt.tendsto.comp hqt).add + (tendsto_const_nhds (x := ∫ z, f z ∂ν.restrict V)) + simp only [Function.comp_def,hrat] at hi + have hqadd (n : ℕ) : (∫ z, f z ∂(μ (q n)+ν.restrict V)) = + (∫ z, f z ∂μ (q n))+(∫ z, f z ∂ν.restrict V) := by + let : (μ (q n)).Regular := H.regular (q n) + exact integral_add_measure f.integrable f.integrable + simpa only [hqadd,integral_add_measure f.integrable f.integrable] using hi + apply le_of_tendsto_of_tendsto hplim hqlim + filter_upwards [hpU,hqU] with n hpn hqn + let : (μ (q n)).Regular := H.regular (q n) + let : (μ (q n)+ν.restrict V).Regular := halfPlane_regular_add _ _ + exact integral_mono_measure (hq (p n) (q n) hpn hqn) (ae_of_all _ hfn) f.integrable + refine ⟨δ,hδ,fun s t hs ht A hA hAK => ?_⟩ + have hst := hreal s t hs ht A + have hts := hreal t s ht hs A + have hsn : M s A ≠ ⊤ := ((hdom s A).trans ((measure_mono hAK))).trans_lt hK.measure_lt_top |>.ne + have htn : M t A ≠ ⊤ := ((hdom t A).trans ((measure_mono hAK))).trans_lt hK.measure_lt_top |>.ne + have hUn : ρ U ≠ ⊤ := measure_ne_top ρ U + rw [Measure.add_apply,Measure.restrict_apply hA,inter_comm] at hst hts + have hUA : ν (V ∩ A) ≤ ρ U := by + change ν (V ∩ A) ≤ ambientCompactRestriction ν K U + rw [ambientCompactRestriction,Measure.map_apply measurable_subtype_coe hU.measurableSet] + change ν (V ∩ A) ≤ ν.restrict K V + rw [Measure.restrict_apply hV.measurableSet] + exact measure_mono (fun z hz => ⟨hz.1,hAK hz.2⟩) + have hcan : ν (V ∩ A) ≠ ⊤ := (hUA.trans_lt hUn.lt_top).ne + have hst' := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨htn,hcan⟩) hst + have hts' := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hsn,hcan⟩) hts + rw [ENNReal.toReal_add htn hcan] at hst' + rw [ENNReal.toReal_add hsn hcan] at hts' + have hless : (ν (V ∩ A)).toReal < ε := by + have hUl : (ρ U).toReal < ε := by + simpa only [ENNReal.toReal_ofReal hε.le] using + (ENNReal.toReal_lt_toReal hUn ENNReal.ofReal_ne_top).mpr hρU + exact (ENNReal.toReal_mono hUn hUA).trans_lt hUl + exact abs_lt.mpr ⟨by linarith,by linarith⟩ + +theorem HalfPlaneTraceIncrements.exists_locally_tv_continuous_extension + {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} [ν.Regular] + [NullSingletonClass ν] {γ : ℝ → ℂ} + (H : HalfPlaneTraceIncrements μ ν γ) (hγ : Continuous γ) : + ∃ M : ℝ → Measure upperHalfPlane, (∀ t, (M t).Regular) ∧ (∀ t, M t ≤ ν) ∧ + (∀ q : ℚ, M q = μ q) ∧ Monotone M ∧ + (∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t)) ∧ + ∀ K : Set upperHalfPlane, IsCompact K → + ∀ t₀ : ℝ, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ s t : ℝ, dist s t₀ < δ → dist t t₀ < δ → + ∀ A : Set upperHalfPlane, MeasurableSet A → A ⊆ K → + |(M s A).toReal-(M t A).toReal| < ε := by + obtain ⟨M,hMr,hdom,hrat,hcont,hmono⟩ := H.exists_continuous_extension hγ + exact ⟨M,hMr,hdom,hrat,hmono,hcont, + fun K hK => H.local_variation_continuity hγ M hMr hdom hrat hcont K hK⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassProgressiveVersion.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassProgressiveVersion.lean new file mode 100644 index 0000000000000000000000000000000000000000..98a573938e36c64dfca943ade7a255c8f3ac344e --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassProgressiveVersion.lean @@ -0,0 +1,111 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassAdaptedVersion +import OAI.Probability.SLE.Mass.CanonicalRadonLimit +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.Analysis.SpecificLimits.Basic + +namespace OAI + +/-! A single reconstruction from rational left samples is progressive in +the uncompleted filtration and agrees at every time on the common good set. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology NNReal ENNReal CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +def leftRationalSample (n : ℕ) (t : ℝ≥0) : ℚ := + (⌊(t:ℝ)*((n:ℝ)+1)⌋₊ : ℚ)/((n:ℚ)+1) + +lemma leftRationalSample_nonneg (n : ℕ) (t : ℝ≥0) : 0 ≤ leftRationalSample n t := by + unfold leftRationalSample + positivity + +lemma leftRationalSample_le (n : ℕ) (t : ℝ≥0) : (leftRationalSample n t : ℝ) ≤ t := by + unfold leftRationalSample + push_cast + apply (div_le_iff₀ (by positivity : 0 < (n:ℝ)+1)).mpr + exact Nat.floor_le (mul_nonneg t.coe_nonneg (by positivity)) + +lemma leftRationalSample_tendsto (t : ℝ≥0) : + Tendsto (fun n => (leftRationalSample n t : ℝ)) atTop (𝓝 (t:ℝ)) := by + have h := (tendsto_nat_floor_mul_div_atTop t.coe_nonneg).comp + (tendsto_atTop_add_const_right atTop (1:ℝ) (tendsto_natCast_atTop_atTop (R := ℝ))) + simpa only [leftRationalSample,Rat.cast_div,Rat.cast_natCast,Rat.cast_add,Rat.cast_one, + Function.comp_def] using h + +lemma leftRationalSample_measurable (n : ℕ) : Measurable (leftRationalSample n) := by + exact (measurable_of_countable (fun k : ℕ => (k:ℚ)/((n:ℚ)+1))).comp + ((NNReal.continuous_coe.measurable.mul_const ((n:ℝ)+1)).nat_floor) + +def rationalRadonExtension {Ω : Type*} (μ : ℚ → Ω → Measure upperHalfPlane) + (t : ℝ≥0) (ω : Ω) : Measure upperHalfPlane := + canonicalRadonLimit (fun n => μ (leftRationalSample n t) ω) + +theorem rationalRadonExtension_regular {Ω : Type*} + (μ : ℚ → Ω → Measure upperHalfPlane) (t : ℝ≥0) (ω : Ω) : + (rationalRadonExtension μ t ω).Regular ∧ + IsFiniteMeasureOnCompacts (rationalRadonExtension μ t ω) := by + have h : (rationalRadonExtension μ t ω).Regular := + canonicalRadonLimit_regular (fun n => μ (leftRationalSample n t) ω) + let := h + exact ⟨h,inferInstance⟩ + +theorem rationalRadonExtension_progressive + {Ω : Type*} [mΩ : MeasurableSpace Ω] (ℱ : Filtration ℝ≥0 mΩ) + (μ : ℚ → Ω → Measure upperHalfPlane) + (hμr : ∀ q ω, (μ q ω).Regular) + (hμm : ∀ q : ℚ, 0 ≤ q → Measurable[ℱ (q : ℝ).toNNReal] (μ q)) : + IsProgressive ℱ (rationalRadonExtension μ) := by + classical + intro T + let : MeasurableSpace Ω := ℱ T + have hm (n : ℕ) : Measurable (fun p : Iic T × Ω => μ (leftRationalSample n p.1) p.2) := by + let ν (q : ℚ) (ω : Ω) := if 0 ≤ q ∧ (q:ℝ) ≤ T then μ q ω else 0 + have hνm (q : ℚ) : Measurable (ν q) := by + by_cases hq : 0 ≤ q ∧ (q:ℝ) ≤ T + · have hqt : (q:ℝ).toNNReal ≤ T := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal hq.2 + simpa only [ν,ite_eq_left hq] using (hμm q hq.1).mono (ℱ.mono hqt) le_rfl + · simpa only [ν,ite_eq_right hq] using (measurable_const : Measurable (fun _ : Ω => (0 : Measure upperHalfPlane))) + have hv : Measurable (fun p : ℚ × Ω => ν p.1 p.2) := + measurable_from_prod_countable_right hνm + have hq : Measurable (fun p : Iic T × Ω => (leftRationalSample n p.1,p.2)) := + ((leftRationalSample_measurable n).comp + (measurable_subtype_coe.comp measurable_fst)).prodMk measurable_snd + have h := hv.comp hq + convert h using 1 + funext p + dsimp only [Function.comp_def,ν] + rw [ite_eq_left ⟨leftRationalSample_nonneg n p.1, + (leftRationalSample_le n p.1).trans (NNReal.coe_le_coe.mpr p.1.property)⟩] + apply canonicalRadonLimit_measurable (fun (n : ℕ) (p : Iic T × Ω) => μ (leftRationalSample n p.1) p.2) + · intro n p + let := hμr (leftRationalSample n p.1) p.2 + infer_instance + · intro n f + exact measurable_halfPlane_compact_test_integral _ (hm n) + (fun p => hμr (leftRationalSample n p.1) p.2) f + +theorem rationalRadonExtension_common_version + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (μ : ℚ → Ω → Measure upperHalfPlane) (M : ℝ → Ω → Measure upperHalfPlane) + (hMr : ∀ t ω, (M t ω).Regular) + (hcont : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂M t ω)) + (hrat : ∀ᵐ ω ∂P, ∀ q : ℚ, M q ω = μ q ω) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, rationalRadonExtension μ t ω = M t ω := by + filter_upwards [hcont,hrat] with ω hc hr + intro t + apply canonicalRadonLimit_identified _ (M t ω) + refine ⟨hMr t ω,?_⟩ + intro f + simpa only [Function.comp_def,hr] using + (hc f).continuousAt.tendsto.comp (leftRationalSample_tendsto t) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassSupport.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ff6656964525fffb5fe76e870b33498340a7c49 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassSupport.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Mass.RationalTraceMassLocal +import OAI.Probability.SLE.Mass.RadonTestLimitProperties +import OAI.Probability.SLE.Mass.LocallyFiniteMeasureSubtract + +namespace OAI + +/-! The trace support of rational increments passes simultaneously to every +real interval, using only monotonicity and continuity of the trace. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology ENNReal CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma exists_rational_trace_enclosure_avoiding + (γ : ℝ → ℂ) (hγ : Continuous γ) {s t : ℝ} (hst : s ≤ t) + (K : Set ℂ) (hK : IsClosed K) (hdis : Disjoint K (γ '' Icc s t)) : + ∃ p q : ℚ, (p:ℝ) < s ∧ t < (q:ℝ) ∧ Disjoint K (γ '' Icc (p:ℝ) q) := by + let U := γ ⁻¹' Kᶜ + have hU : IsOpen U := hK.isOpen_compl.preimage hγ + have hs : s ∈ U := by + intro hs + exact Set.disjoint_left.mp hdis hs ⟨s,⟨le_rfl,hst⟩,rfl⟩ + have ht : t ∈ U := by + intro ht + exact Set.disjoint_left.mp hdis ht ⟨t,⟨hst,le_rfl⟩,rfl⟩ + obtain ⟨ε,hε,hballε⟩ := Metric.isOpen_iff.mp hU s hs + obtain ⟨δ,hδ,hballδ⟩ := Metric.isOpen_iff.mp hU t ht + obtain ⟨p,hp,hps⟩ := exists_rat_btwn (show s-ε < s by linarith) + obtain ⟨q,htq,hq⟩ := exists_rat_btwn (show t < t+δ by linarith) + refine ⟨p,q,hps,htq,Set.disjoint_left.mpr ?_⟩ + rintro z hz ⟨r,hr,rfl⟩ + by_cases hrs : r < s + · have hb : r ∈ Metric.ball s ε := by + rw [Metric.mem_ball,Real.dist_eq,abs_of_neg (sub_neg.mpr hrs)] + linarith [hr.1] + exact hballε hb hz + by_cases htr : t < r + · have hb : r ∈ Metric.ball t δ := by + rw [Metric.mem_ball,Real.dist_eq,abs_of_pos (sub_pos.mpr htr)] + linarith [hr.2] + exact hballδ hb hz + exact Set.disjoint_left.mp hdis hz ⟨r,⟨le_of_not_gt hrs,le_of_not_gt htr⟩,rfl⟩ + +theorem HalfPlaneTraceIncrements.extension_increment_carried + {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} [ν.Regular] + {γ : ℝ → ℂ} (H : HalfPlaneTraceIncrements μ ν γ) (hγ : Continuous γ) + (M : ℝ → Measure upperHalfPlane) (hMr : ∀ t, (M t).Regular) + (hrat : ∀ q : ℚ, M q = μ q) (hmono : Monotone M) + {s t : ℝ} (hst : s ≤ t) : + (M t-M s) {z : upperHalfPlane | (z:ℂ) ∉ γ '' Icc s t} = 0 := by + let η := M t-M s + let : (M t).Regular := hMr t + let : (M s).Regular := hMr s + let : IsFiniteMeasureOnCompacts η := + ⟨fun K hK => lt_of_le_of_lt (Measure.sub_le K) hK.measure_lt_top⟩ + let : η.Regular := inferInstance + let S : Set upperHalfPlane := {z | (z:ℂ) ∈ γ '' Icc s t} + apply radon_limit_carried_by_closed (fun _ => η) η (fun _ => tendsto_const_nhds) S + (((isCompact_Icc.image hγ).isClosed).preimage continuous_subtype_val) + intro f hf + let K := (Subtype.val : upperHalfPlane → ℂ) '' tsupport f + have hK : IsCompact K := f.hasCompactSupport.image continuous_subtype_val + have hdis : Disjoint K (γ '' Icc s t) := by + apply Set.disjoint_left.mpr + rintro _ ⟨z,hz,rfl⟩ hs + exact hf hz hs + obtain ⟨p,q,hps,htq,havoid⟩ := exists_rational_trace_enclosure_avoiding γ hγ hst K hK.isClosed hdis + have hpq : p ≤ q := Rat.cast_le.mp (hps.le.trans (hst.trans htq.le)) + obtain ⟨ξ,hξ,hξle⟩ := H.increment p q hpq + have hηξ : η ≤ ξ := by + apply Measure.sub_le_of_le_add + calc + M t ≤ M q := hmono htq.le + _ = μ q := hrat q + _ = μ p+ξ := hξ + _ = ξ+M p := by rw [hrat p,add_comm] + _ ≤ ξ+M s := add_le_add le_rfl (hmono hps.le) + have hzero : η (tsupport f) = 0 := by + apply le_zero_iff.mp + apply ((hηξ _).trans (hξle _)).trans_eq + rw [Measure.restrict_apply f.hasCompactSupport.measurableSet] + have hempty : tsupport f ∩ {z : upperHalfPlane | (z:ℂ) ∈ γ '' Icc (p:ℝ) q} = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro z hz + exact Set.disjoint_left.mp havoid ⟨z,hz.1,rfl⟩ hz.2 + rw [hempty,measure_empty] + apply Eventually.of_forall + intro _ + apply integral_eq_zero_of_ae + filter_upwards [measure_eq_zero_iff_ae_notMem.mp hzero] with z hz + exact image_eq_zero_of_notMem_tsupport hz + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RationalTraceMassVariation.lean b/lean/OAI/Probability/SLE/Mass/RationalTraceMassVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5a166f47fef635bdacafdbe338fc4eee6ddaa36 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RationalTraceMassVariation.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SLE.Mass.RationalTraceMass + +namespace OAI + +/-! Uniform local total-variation control for the all-time extension. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +/-- Local total variation is expressed uniformly on measurable sets. The +finite-terminal form applies to each compact restriction in the source. -/ +theorem RationalTraceIncrements.local_variation_continuity + {μ : ℚ → Measure X} {ν : Measure X} [ν.Regular] [IsFiniteMeasure ν] + [NullSingletonClass ν] {γ : ℝ → X} (H : RationalTraceIncrements μ ν γ) + (hγ : Continuous γ) (M : ℝ → Measure X) + (hMr : ∀ t, (M t).Regular) (hdom : ∀ t, M t ≤ ν) + (hrat : ∀ q : ℚ, M q=μ q) + (hcont : ∀ f : C_c(X,ℝ), Continuous (fun t => ∫ x, f x ∂M t)) : + ∀ t₀ : ℝ, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ s t : ℝ, dist s t₀ < δ → dist t t₀ < δ → + ∀ A : Set X, MeasurableSet A → |(M s A).toReal-(M t A).toReal| < ε := by + intro t₀ ε hε + obtain ⟨U,hUsub,hU,hνU⟩ := ({γ t₀} : Set X).exists_isOpen_lt_of_lt (μ := ν) + (ENNReal.ofReal ε) (by simpa using ENNReal.ofReal_pos.mpr hε) + have htU : γ t₀ ∈ U := hUsub (mem_singleton _) + obtain ⟨δ,hδ,hδsub⟩ := Metric.mem_nhds_iff.mp + (hγ.continuousAt.preimage_mem_nhds (hU.mem_nhds htU)) + have hI (a b : ℝ) (ha : dist a t₀ < δ) (hb : dist b t₀ < δ) : γ '' Icc a b ⊆ U := by + rintro _ ⟨x,hx,rfl⟩ + apply hδsub + rw [Metric.mem_ball,Real.dist_eq] + rw [Real.dist_eq,abs_lt] at ha hb + exact abs_lt.mpr ⟨lt_of_lt_of_le ha.1 (sub_le_sub_right hx.1 t₀), + lt_of_le_of_lt (sub_le_sub_right hx.2 t₀) hb.2⟩ + have hq (p q : ℚ) (hp : dist (p:ℝ) t₀ < δ) (hq : dist (q:ℝ) t₀ < δ) : + μ p ≤ μ q+ν.restrict U := by + rcases le_total p q with hpq | hqp + · exact (H.monotone hpq).trans (Measure.le_add_right le_rfl) + · obtain ⟨η,hη,hην⟩ := H.increment q p hqp + rw [hη] + exact add_le_add le_rfl (hην.trans (Measure.restrict_mono (hI q p hq hp) le_rfl)) + have hreal (s t : ℝ) (hs : dist s t₀ < δ) (ht : dist t t₀ < δ) : + M s ≤ M t+ν.restrict U := by + let : (M s).Regular := hMr s + let : (M t).Regular := hMr t + let : IsFiniteMeasure (M t) := isFiniteMeasure_of_le ν (hdom t) + let : (ν.restrict U).Regular := Measure.Regular.restrict_of_measure_ne_top (measure_ne_top ν U) + obtain ⟨p,hp⟩ := exists_rational_sequence_tendsto s + obtain ⟨q,hqt⟩ := exists_rational_sequence_tendsto t + have hpU : ∀ᶠ n in atTop, dist (p n:ℝ) t₀ < δ := + hp.eventually (isOpen_lt (continuous_id.dist continuous_const) continuous_const |>.mem_nhds hs) + have hqU : ∀ᶠ n in atTop, dist (q n:ℝ) t₀ < δ := + hqt.eventually (isOpen_lt (continuous_id.dist continuous_const) continuous_const |>.mem_nhds ht) + apply radon_measure_le_of_nonneg_tests + intro f hfn + have hplim : Tendsto (fun n => ∫ x, f x ∂μ (p n)) atTop (𝓝 (∫ x, f x ∂M s)) := by + simpa only [Function.comp_def,hrat] using (hcont f).continuousAt.tendsto.comp hp + have hqlim : Tendsto (fun n => ∫ x, f x ∂(μ (q n)+ν.restrict U)) atTop + (𝓝 (∫ x, f x ∂(M t+ν.restrict U))) := by + have hi := ((hcont f).continuousAt.tendsto.comp hqt).add + (tendsto_const_nhds (x := ∫ x, f x ∂ν.restrict U)) + simp only [Function.comp_def,hrat] at hi + have hqadd (n : ℕ) : (∫ x, f x ∂(μ (q n)+ν.restrict U))= + (∫ x, f x ∂μ (q n))+(∫ x, f x ∂ν.restrict U) := by + let : (μ (q n)).Regular := H.regular (q n) + exact integral_add_measure f.integrable f.integrable + simpa only [hqadd,integral_add_measure f.integrable f.integrable] using hi + apply le_of_tendsto_of_tendsto hplim hqlim + filter_upwards [hpU,hqU] with n hpn hqn + let : (μ (q n)).Regular := H.regular (q n) + let : IsFiniteMeasure (μ (q n)) := isFiniteMeasure_of_le ν (H.dominated (q n)) + exact integral_mono_measure (hq (p n) (q n) hpn hqn) (ae_of_all _ hfn) f.integrable + refine ⟨δ,hδ,fun s t hs ht A hA => ?_⟩ + have hst := hreal s t hs ht A + have hts := hreal t s ht hs A + have hsn : M s A ≠ ⊤ := ((hdom s A).trans_lt (measure_lt_top ν A)).ne + have htn : M t A ≠ ⊤ := ((hdom t A).trans_lt (measure_lt_top ν A)).ne + have hUn : ν U ≠ ⊤ := measure_ne_top ν U + rw [Measure.add_apply,Measure.restrict_apply hA,inter_comm] at hst hts + have hUA : ν (U ∩ A) ≤ ν U := measure_mono inter_subset_left + have hcan : ν (U ∩ A) ≠ ⊤ := (hUA.trans_lt hUn.lt_top).ne + have hst' := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨htn,hcan⟩) hst + have hts' := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hsn,hcan⟩) hts + rw [ENNReal.toReal_add htn hcan] at hst' + rw [ENNReal.toReal_add hsn hcan] at hts' + have hless : (ν (U ∩ A)).toReal < ε := by + have hUl : (ν U).toReal < ε := by + simpa only [ENNReal.toReal_ofReal hε.le] using + (ENNReal.toReal_lt_toReal hUn ENNReal.ofReal_ne_top).mpr hνU + exact (ENNReal.toReal_mono hUn hUA).trans_lt hUl + exact abs_lt.mpr ⟨by linarith,by linarith⟩ + +/-- The pathwise rational squeeze gives one increasing extension with +local total-variation continuity. -/ +theorem RationalTraceIncrements.exists_locally_tv_continuous_extension + {μ : ℚ → Measure X} {ν : Measure X} [ν.Regular] [IsFiniteMeasure ν] + [NullSingletonClass ν] {γ : ℝ → X} (H : RationalTraceIncrements μ ν γ) + (hγ : Continuous γ) : + ∃ M : ℝ → Measure X, (∀ t, (M t).Regular) ∧ (∀ t, M t ≤ ν) ∧ + (∀ q : ℚ, M q=μ q) ∧ Monotone M ∧ + (∀ f : C_c(X,ℝ), Continuous (fun t => ∫ x, f x ∂M t)) ∧ + ∀ t₀ : ℝ, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ s t : ℝ, dist s t₀ < δ → dist t t₀ < δ → + ∀ A : Set X, MeasurableSet A → |(M s A).toReal-(M t A).toReal| < ε := by + obtain ⟨M,hMr,hdom,hrat,hcont,hmono⟩ := H.exists_continuous_extension hγ + exact ⟨M,hMr,hdom,hrat,hmono,hcont,H.local_variation_continuity hγ M hMr hdom hrat hcont⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawMassFunctional.lean b/lean/OAI/Probability/SLE/Mass/RawMassFunctional.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1532af672bdf4d8e81d35ace4078dadd062acb4 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawMassFunctional.lean @@ -0,0 +1,74 @@ +import OAI.Probability.SLE.Stochastic.DriverPastFactorization +import OAI.Probability.SLE.Mass.RationalTraceMassProgressiveVersion + +namespace OAI + +/-! A fixed raw, nonanticipating mass functional on continuous driver paths. +Each rational slice is first factored through the stopped driver, and the +single rational reconstruction is progressive on the full path space. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal CompactlySupported + +namespace SLEExactGauge + +local instance rawMassDriverMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance rawMassDriverBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma raw_rational_reconstruction_depends_on_past + (F : ℚ → C(ℝ≥0,ℝ) → Measure upperHalfPlane) + (t : ℝ≥0) (p q : C(ℝ≥0,ℝ)) (hpq : ∀ s ≤ t, p s=q s) : + rationalRadonExtension (fun r p => F r (driverPathStopped (r:ℝ).toNNReal p)) t p = + rationalRadonExtension (fun r p => F r (driverPathStopped (r:ℝ).toNNReal p)) t q := by + unfold rationalRadonExtension + apply congrArg canonicalRadonLimit + funext n + apply congrArg (F (leftRationalSample n t)) + exact driverPathStopped_eq_of_agree t _ (by + simpa only [Real.toNNReal_coe] using + Real.toNNReal_le_toNNReal (leftRationalSample_le n t)) p q hpq + +theorem exists_raw_progressive_radon_factor + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) + (N : ℝ≥0 → Ω → Measure upperHalfPlane) + (hNm : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) N) + (hNr : ∀ t ω, (N t ω).Regular) + (hNc : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂N t ω)) : + ∃ R : ℝ≥0 → C(ℝ≥0,ℝ) → Measure upperHalfPlane, + IsProgressive driverPathFiltration R ∧ + (∀ t p, (R t p).Regular ∧ IsFiniteMeasureOnCompacts (R t p)) ∧ + (∀ t p q, (∀ s ≤ t, p s=q s) → R t p=R t q) ∧ + ∀ᵐ ω ∂P, ∀ t, R t (sourceDriverPath B hc ω) = N t ω := by + choose F hFm hFr hFe using fun q : ℚ => exists_stopped_driver_radon_factor B hm hc + (q:ℝ).toNNReal (N (q:ℝ).toNNReal) (hNr _) (hNm _) + let μ (q : ℚ) (p : C(ℝ≥0,ℝ)) := F q (driverPathStopped (q:ℝ).toNNReal p) + have hμr (q : ℚ) (p : C(ℝ≥0,ℝ)) : (μ q p).Regular := hFr q _ + have hμm (q : ℚ) (_hq : 0 ≤ q) : + Measurable[driverPathFiltration (q:ℝ).toNNReal] (μ q) := + (hFm q).comp (driverPathStopped_measurable_past (q:ℝ).toNNReal) + refine ⟨rationalRadonExtension μ,rationalRadonExtension_progressive + driverPathFiltration μ hμr hμm,rationalRadonExtension_regular μ, + raw_rational_reconstruction_depends_on_past F,?_⟩ + let μ' (q : ℚ) (ω : Ω) := μ q (sourceDriverPath B hc ω) + have hcont : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Continuous (fun t : ℝ => ∫ z, f z ∂N t.toNNReal ω) := by + filter_upwards [hNc] with ω hω + intro f + exact (hω f).comp continuous_real_toNNReal + have heq : ∀ᵐ ω ∂P, ∀ q : ℚ, N (q:ℝ).toNNReal ω = μ' q ω := + ae_of_all _ (fun ω q => (hFe q ω).symm) + have he := rationalRadonExtension_common_version P μ' (fun t ω => N t.toNNReal ω) + (fun t ω => hNr t.toNNReal ω) hcont heq + filter_upwards [he] with ω hω + intro t + simpa only [rationalRadonExtension,μ',Real.toNNReal_coe] using hω t + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawMassPathLaw.lean b/lean/OAI/Probability/SLE/Mass/RawMassPathLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..66add794f542fd9cc80ff83a10d08875ce879fe8 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawMassPathLaw.lean @@ -0,0 +1,133 @@ +import OAI.Probability.SLE.Mass.CanonicalRawMass +import OAI.Probability.SLE.Mass.RawRadonGoodPaths + +namespace OAI + +/-! The raw mass has one measurable full-law event carrying all path +properties simultaneously. Equal driver laws therefore preserve these +properties without assuming measurability of an uncountable predicate. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped Topology CompactlySupported NNReal + +namespace SLEExactGauge + +local instance rawPathLawDriverMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance rawPathLawDriverBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +theorem exists_raw_rational_radon_factor + {Ω : Type*} [MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) + (N : ℝ≥0 → Ω → Measure upperHalfPlane) + (hNm : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) N) + (hNr : ∀ t ω, (N t ω).Regular) : + ∃ μ : ℚ → C(ℝ≥0,ℝ) → Measure upperHalfPlane, + (∀ q p, (μ q p).Regular) ∧ + (∀ q : ℚ, Measurable[driverPathFiltration (q:ℝ).toNNReal] (μ q)) ∧ + (∀ (q : ℚ) p r, (∀ s ≤ (q:ℝ).toNNReal, p s=r s) → μ q p=μ q r) ∧ + ∀ ω q, μ q (sourceDriverPath B hc ω)=N (q:ℝ).toNNReal ω := by + choose F hFm hFr hFe using fun q : ℚ => exists_stopped_driver_radon_factor B hm hc + (q:ℝ).toNNReal (N (q:ℝ).toNNReal) (hNr _) (hNm _) + refine ⟨fun q p => F q (driverPathStopped (q:ℝ).toNNReal p),?_,?_,?_,?_⟩ + · exact fun q p => hFr q _ + · exact fun q => (hFm q).comp (driverPathStopped_measurable_past (q:ℝ).toNNReal) + · intro q p r hpr + exact congrArg (F q) (driverPathStopped_eq_of_agree _ _ le_rfl p r hpr) + · exact fun ω q => hFe q ω + +lemma rational_reconstruction_nonanticipating + (μ : ℚ → C(ℝ≥0,ℝ) → Measure upperHalfPlane) + (hμ : ∀ (q : ℚ) p r, (∀ s ≤ (q:ℝ).toNNReal, p s=r s) → μ q p=μ q r) + (t : ℝ≥0) (p r : C(ℝ≥0,ℝ)) (hpr : ∀ s ≤ t, p s=r s) : + rationalRadonExtension μ t p=rationalRadonExtension μ t r := by + unfold rationalRadonExtension + apply congrArg canonicalRadonLimit + funext n + apply hμ + intro s hs + apply hpr s + apply hs.trans + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal (leftRationalSample_le n t) + +theorem raw_radon_path_properties_of_same_law + {Ω Ξ Y : Type*} [MeasurableSpace Ω] [MeasurableSpace Ξ] [MeasurableSpace Y] + (P : Measure Ω) (Q : Measure Ξ) (A : Ω → Y) (B : Ξ → Y) + (hA : Measurable A) (hB : Measurable B) (hlaw : Q.map B=P.map A) + (D : LocalTestFamily upperHalfPlane) (μ : ℚ → Y → Measure upperHalfPlane) + (hm : ∀ q, Measurable (μ q)) (hr : ∀ q y, (μ q y).Regular) + (hg : ∀ᵐ ω ∂P, RawRadonGood D (fun q => μ q (A ω))) : + ∀ᵐ ξ ∂Q, + rationalRadonExtension μ 0 (B ξ)=0 ∧ + Monotone (fun t => rationalRadonExtension μ t (B ξ)) ∧ + ∀ f : C_c(upperHalfPlane,ℝ), + Continuous (fun t => ∫ z, f z ∂rationalRadonExtension μ t (B ξ)) := by + have hE := measurableSet_rawRadonGood D μ hm hr + have hpush : ∀ᵐ y ∂P.map A, RawRadonGood D (fun q => μ q y) := + (ae_map_iff hA.aemeasurable hE).mpr hg + rw [← hlaw] at hpush + have hgood := (ae_map_iff hB.aemeasurable hE).mp hpush + filter_upwards [hgood] with ξ hξ + exact RawRadonGood.reconstructed_paths D (fun q => μ q (B ξ)) (fun q => hr q _) hξ + +namespace Multipoint + +theorem CanonicalMass.exists_raw_nonanticipating_with_good_set + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {κ : ℝ} + {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (C : CanonicalMass P κ B hBm γ G) + (hBc : ∀ ω, Continuous (fun t => B t ω)) : + ∃ R : ℝ≥0 → C(ℝ≥0,ℝ) → Measure upperHalfPlane, + ∃ E : Set C(ℝ≥0,ℝ), + IsProgressive driverPathFiltration R ∧ + (∀ t p, (R t p).Regular ∧ IsFiniteMeasureOnCompacts (R t p)) ∧ + (∀ t p r, (∀ s ≤ t, p s=r s) → R t p=R t r) ∧ + MeasurableSet E ∧ (∀ᵐ p ∂P.map (sourceDriverPath B hBc), p ∈ E) ∧ + (∀ p ∈ E, R 0 p=0 ∧ Monotone (fun t => R t p) ∧ + ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂(R t p))) ∧ + ∀ᵐ ω ∂P, ∀ t, R t (sourceDriverPath B hBc ω)=C.process t ω := by + have hm (t : ℝ≥0) : Measurable (B t) := + hBm.comp (measurable_const.prodMk measurable_id) + obtain ⟨μ,hμr,hμm,hμn,hμe⟩ := exists_raw_rational_radon_factor B hm hBc C.process + C.progressive.adapted (fun t ω => (C.radon t ω).1) + let R := rationalRadonExtension μ + let D := localTestFamily upperHalfPlane + let E : Set C(ℝ≥0,ℝ) := {p | RawRadonGood D (fun q => μ q p)} + have hμma (q : ℚ) : Measurable (μ q) := + (hμm q).mono (driverPathFiltration.le _) le_rfl + have hEm : MeasurableSet E := measurableSet_rawRadonGood D μ hμma hμr + have hgood : ∀ᵐ ω ∂P, sourceDriverPath B hBc ω ∈ E := by + filter_upwards [C.paths] with ω hω + dsimp only [E,mem_ofPred_eq] + simp_rw [hμe] + exact rawRadonGood_of_continuous_path D (fun t => C.process t ω) + (fun t => (C.radon t ω).1) hω.zero hω.monotone hω.continuous_tests + have hbp : Measurable (sourceDriverPath B hBc) := source_path_measurable _ hm + refine ⟨R,E,rationalRadonExtension_progressive driverPathFiltration μ hμr (fun q _ => hμm q), + rationalRadonExtension_regular μ,rational_reconstruction_nonanticipating μ hμn, + hEm,(ae_map_iff hbp.aemeasurable hEm).mpr hgood,?_,?_⟩ + · intro p hp + exact RawRadonGood.reconstructed_paths D (fun q => μ q p) (fun q => hμr q p) hp + · let μ' (q : ℚ) (ω : Ω) := μ q (sourceDriverPath B hBc ω) + have hc : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Continuous (fun t : ℝ => ∫ z, f z ∂C.process t.toNNReal ω) := by + filter_upwards [C.paths] with ω hω + intro f + exact (hω.continuous_tests f).comp continuous_real_toNNReal + have he : ∀ᵐ ω ∂P, ∀ q : ℚ, C.process (q:ℝ).toNNReal ω=μ' q ω := + ae_of_all _ (fun ω q => (hμe ω q).symm) + have h := rationalRadonExtension_common_version P μ' (fun t ω => C.process t.toNNReal ω) + (fun t ω => (C.radon t.toNNReal ω).1) hc he + filter_upwards [h] with ω hω + intro t + simpa only [R,rationalRadonExtension,μ',Real.toNNReal_coe] using hω t + +end Multipoint +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawRadonGoodPaths.lean b/lean/OAI/Probability/SLE/Mass/RawRadonGoodPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..19151e9e70268c1b4b37599c7f2b9bc322029693 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawRadonGoodPaths.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SLE.Geometry.RationalTestPath + +namespace OAI + +/-! A countably measurable event guaranteeing zero initial mass, monotone +growth, and continuous compact-test paths for the raw rational reconstruction. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology CompactlySupported NNReal + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +def RawRadonGood (D : LocalTestFamily upperHalfPlane) (μ : ℚ → Measure upperHalfPlane) : Prop := + HasContinuousRationalTests D μ ∧ + (∀ p q : ℚ, 0 ≤ p → p ≤ q → ∀ j, + (∫ z, (D.test j ⊔ 0) z ∂μ p) ≤ ∫ z, (D.test j ⊔ 0) z ∂μ q) ∧ + ∀ j, (∫ z, D.test j z ∂μ 0)=0 + +lemma measurableSet_rawRadonGood {Y : Type*} [MeasurableSpace Y] + (D : LocalTestFamily upperHalfPlane) (μ : ℚ → Y → Measure upperHalfPlane) + (hm : ∀ q, Measurable (μ q)) (hr : ∀ q y, (μ q y).Regular) : + MeasurableSet {y | RawRadonGood D (fun q => μ q y)} := by + have htest (q : ℚ) (f : C_c(upperHalfPlane,ℝ)) := + measurable_halfPlane_compact_test_integral (μ q) (hm q) (hr q) f + have hc := measurableSet_hasContinuousRationalTests D μ (fun q j => htest q (D.test j)) + have ho : MeasurableSet {y | ∀ p q : ℚ, 0 ≤ p → p ≤ q → ∀ j, + (∫ z, (D.test j ⊔ 0) z ∂μ p y) ≤ ∫ z, (D.test j ⊔ 0) z ∂μ q y} := by + simp only [Set.ofPred_forall] + exact MeasurableSet.iInter fun p => MeasurableSet.iInter fun q => + MeasurableSet.iInter fun _ => MeasurableSet.iInter fun _ => + MeasurableSet.iInter fun j => measurableSet_le (htest p _) (htest q _) + have hz : MeasurableSet {y | ∀ j, (∫ z, D.test j z ∂μ 0 y)=0} := by + simp only [Set.ofPred_forall] + exact MeasurableSet.iInter fun j => measurableSet_eq_fun (htest 0 (D.test j)) measurable_const + simpa only [RawRadonGood,Set.ofPred_and] using hc.inter (ho.inter hz) + +theorem RawRadonGood.reconstructed_paths + (D : LocalTestFamily upperHalfPlane) (μ : ℚ → Measure upperHalfPlane) + (hr : ∀ q, (μ q).Regular) (hg : RawRadonGood D μ) : + let N := fun t => rationalRadonExtension (fun q (_ : Unit) => μ q) t () + N 0=0 ∧ Monotone N ∧ ∀ f : C_c(upperHalfPlane,ℝ), + Continuous (fun t => ∫ z, f z ∂N t) := by + dsimp only + let N := fun t => rationalRadonExtension (fun q (_ : Unit) => μ q) t () + obtain ⟨hq,hc⟩ := HasContinuousRationalTests.continuous_extension D μ hr hg.1 + have hzero : μ 0=0 := by + let := hr 0 + apply D.measure_eq_of_test_integrals + intro j + simpa only [integral_zero_measure] using hg.2.2 j + have hz : N 0=0 := by + have h := hq 0 le_rfl + simpa only [Rat.cast_zero,Real.toNNReal_zero,hzero] using h + refine ⟨hz,?_,hc⟩ + intro s t hst + rcases eq_or_lt_of_le hst with rfl | hst + · exact le_rfl + let := (rationalRadonExtension_regular (fun q (_ : Unit) => μ q) s ()).1 + let := (rationalRadonExtension_regular (fun q (_ : Unit) => μ q) t ()).1 + apply radon_measure_le_of_nonneg_tests + intro f hf + have hlim (r : ℝ≥0) : Tendsto (fun n => ∫ z, f z ∂μ (leftRationalSample n r)) atTop + (𝓝 (∫ z, f z ∂N r)) := by + have he (n : ℕ) := hq (leftRationalSample n r) (leftRationalSample_nonneg n r) + have ht := (continuous_real_toNNReal.tendsto (r:ℝ)).comp (leftRationalSample_tendsto r) + simpa only [Real.toNNReal_coe,Function.comp_def,he] using + (hc f).continuousAt.tendsto.comp ht + have hlt : ∀ᶠ n in atTop, leftRationalSample n s ≤ leftRationalSample n t := by + have hs := (leftRationalSample_tendsto s).eventually + (gt_mem_nhds (show (s:ℝ)<((s:ℝ)+t)/2 by exact (by have := NNReal.coe_lt_coe.mpr hst; linarith))) + have ht := (leftRationalSample_tendsto t).eventually + (lt_mem_nhds (show ((s:ℝ)+t)/2<(t:ℝ) by exact (by have := NNReal.coe_lt_coe.mpr hst; linarith))) + filter_upwards [hs,ht] with n hn hm + exact Rat.cast_le.mp (hn.trans hm).le + apply le_of_tendsto_of_tendsto (hlim s) (hlim t) + filter_upwards [hlt] with n hn + have hle : μ (leftRationalSample n s) ≤ μ (leftRationalSample n t) := by + let := hr (leftRationalSample n s) + let := hr (leftRationalSample n t) + exact D.measure_le_of_positive_tests _ _ + (hg.2.1 _ _ (leftRationalSample_nonneg n s) hn) + let := hr (leftRationalSample n t) + exact integral_mono_measure hle (ae_of_all _ hf) f.integrable + +theorem rawRadonGood_of_continuous_path + (D : LocalTestFamily upperHalfPlane) (N : ℝ≥0 → Measure upperHalfPlane) + (hr : ∀ t, (N t).Regular) (hz : N 0=0) (hm : Monotone N) + (hc : ∀ f : C_c(upperHalfPlane,ℝ), Continuous (fun t => ∫ z, f z ∂N t)) : + RawRadonGood D (fun q : ℚ => N (q:ℝ).toNNReal) := by + refine ⟨?_,?_,?_⟩ + · intro j + refine ⟨⟨fun t => ∫ z, D.test j z ∂N t.toNNReal, + (hc (D.test j)).comp continuous_real_toNNReal⟩,?_⟩ + rfl + · intro p q _hp hpq j + let := hr (q:ℝ).toNNReal + exact integral_mono_measure (hm (Real.toNNReal_le_toNNReal (Rat.cast_le.mpr hpq))) + (ae_of_all _ (fun _ => le_max_right _ _)) (D.test j ⊔ 0).integrable + · intro j + simp only [Rat.cast_zero,Real.toNNReal_zero,hz,integral_zero_measure] + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawRadonLimit.lean b/lean/OAI/Probability/SLE/Mass/RawRadonLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..19e1b30b65aa58eb1833ad46c219390e0d037cd0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawRadonLimit.lean @@ -0,0 +1,44 @@ +import OAI.Probability.SLE.Mass.CanonicalRadonLimit + +namespace OAI + +/-! Raw Radon reconstruction from countable test-Cauchy data. The existing +canonical reconstruction tests Cauchy convergence in the data space itself; +its cutoff coordinates supply the local mass bounds. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +lemma LocalTestFamily.exists_raw_radon_limit + (D : LocalTestFamily X) {Y : Type*} [MeasurableSpace Y] + (μ : ℕ → Y → Measure X) (hμ : ∀ n y, (μ n y).Regular) + (hm : ∀ n (f : C_c(X,ℝ)), Measurable (fun y => ∫ x, f x ∂μ n y)) : + ∃ ν : Y → Measure X, Measurable ν ∧ (∀ y, (ν y).Regular) ∧ + ∀ y, (∀ j, CauchySeq (fun n => ∫ x, D.test j x ∂μ n y)) → + ∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n y) atTop (𝓝 (∫ x, f x ∂ν y)) := by + let ν (y : Y) := canonicalRadonLimit (fun n => μ n y) + refine ⟨ν,canonicalRadonLimit_measurable μ ?_ hm, + fun y => canonicalRadonLimit_regular _,?_⟩ + · intro n y + let := hμ n y + infer_instance + · intro y hy + let (n : ℕ) : IsFiniteMeasureOnCompacts (μ n y) := by + let := hμ n y + infer_instance + obtain ⟨η,hη,_,hl⟩ := D.exists_radon_limit (fun n => μ n y) + (fun j => cauchySeq_tendsto_of_complete (hy j)) + have he : ν y=η := canonicalRadonLimit_identified _ η ⟨hη,hl⟩ + simpa only [he] using hl + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawScaledMassMeans.lean b/lean/OAI/Probability/SLE/Mass/RawScaledMassMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b71165c133c6ef4f192308b08d0c151fbc5bfd3 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawScaledMassMeans.lean @@ -0,0 +1,135 @@ +import OAI.Probability.SLE.Mass.RawScaledMassPaths +import OAI.Probability.SLE.Mass.ScaledGreenMeasure +import OAI.Probability.SLE.Mass.GreenMassProcessUniqueness + +namespace OAI + +/-! Mean bounds and equal Green remainders for the physical dilation +and the canonical functional of the scaled Brownian driver. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +local instance rawScaledMeansMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance rawScaledMeansBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +lemma bind_comp_eq_of_path_law {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (X Y : Ω → C(ℝ≥0,ℝ)) (hX : Measurable X) (hY : Measurable Y) + (hXY : P.map X=P.map Y) (N : C(ℝ≥0,ℝ) → Measure upperHalfPlane) (hN : Measurable N) : + P.bind (fun ω => N (X ω))=P.bind (fun ω => N (Y ω)) := by + calc + _ = (P.map X).bind N := by + unfold Measure.bind + rw [Measure.map_map hN hX] + rfl + _ = (P.map Y).bind N := by rw [hXY] + _ = _ := by + unfold Measure.bind + rw [Measure.map_map hN hY] + rfl + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {κ : ℝ} {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (C : CanonicalMass P κ B hBm γ G) (hB : IsBrownianReal B P) + (hc : ∀ ω, Continuous (fun t => B t ω)) + (R : RawCanonicalMass) + (he : ∀ᵐ ω ∂P, (∀ t, R.process t (sourceDriverPath B hc ω)=C.process t ω) ∧ + R.terminal (sourceDriverPath B hc ω)=C.rational.terminal ω) + (c : ℝ≥0) (hcp : 0 < c) + +include C hB hc R he c hcp in +omit [IsProbabilityMeasure P] in +lemma CanonicalMass.scaledRawMass_mean_le (t : ℝ≥0) : + P.bind (scaledRawMass R c B hc t) ≤ initialGreenMeasure κ := by + have hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + have hp := source_path_measurable (sourceDriverPath B hc) hm + have hy := source_path_measurable + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc)) + (scaledBrownianDriver_measurable c B hm) + have h := bind_comp_eq_of_path_law P _ _ hy hp + (scaledBrownianDriver_path_law c hcp B hB hm hc) (R.process (c^2*t)) + (R.progressive.adapted.measurable (i:=c^2*t)) + change P.bind (scaledRawMass R c B hc t)=_ at h + rw [h,Measure.bind_congr_right (he.mono (fun _ h => h.1 (c^2*t)))] + simpa only [Measure.restrict_univ] using C.uniqueness_process_mean_le (c^2*t) univ + +include C hB hc R he c hcp in +omit [IsProbabilityMeasure P] in +lemma CanonicalMass.scaledRawTerminal_mean : + P.bind (scaledRawTerminal R c B hc)=initialGreenMeasure κ := by + have hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + have hp := source_path_measurable (sourceDriverPath B hc) hm + have hy := source_path_measurable + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc)) + (scaledBrownianDriver_measurable c B hm) + have h := bind_comp_eq_of_path_law P _ _ hy hp + (scaledBrownianDriver_path_law c hcp B hB hm hc) R.terminal R.terminal_measurable + change P.bind (scaledRawTerminal R c B hc)=_ at h + rw [h,Measure.bind_congr_right (he.mono (fun _ h => h.2)),C.rational.mean] + +include C in +omit [IsProbabilityMeasure P] in +lemma CanonicalMass.deterministic_green_kernel (t : ℝ≥0) (E : Set Ω) + (hE : MeasurableSet[(Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) t] E) : + (P.restrict E).bind C.rational.terminal=(P.restrict E).bind (C.process t)+ + (P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t) := by + let ℱ := Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable) + have hs := isStoppingTime_const ℱ t + have hEs : MeasurableSet[hs.measurableSpace] E := by + change MeasurableSet[(isStoppingTime_const ℱ t).measurableSpace] E + rw [IsStoppingTime.measurableSpace_const] + exact hE + have h := C.kernel (fun _ => (t:WithTop ℝ≥0)) hs E hEs + change (P.restrict E).bind C.rational.terminal=(P.restrict E).bind (C.process t)+ + (P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t) at h + exact h + +include C hB hc R he c hcp in +lemma CanonicalMass.scaledRawMass_cross_kernel + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) (E : Set Ω) + (hE : MeasurableSet[(Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) t] E) : + (P.restrict E).bind (fun ω => dilationMass κ c hcp (C.rational.terminal ω))+ + (P.restrict E).bind (scaledRawMass R c B hc t)= + (P.restrict E).bind (scaledRawTerminal R c B hc)+ + (P.restrict E).bind (fun ω => dilationMass κ c hcp (C.process t ω)) := by + have hm (s : ℝ≥0) : Measurable (B s) := hBm.comp (measurable_const.prodMk measurable_id) + have hCm := C.progressive.adapted.measurable (i:=t) + have hGm := halfPlaneGreenMeasure_measurable hBm hc κ γ G F hw t + have hdm : Measurable (dilationMass κ c hcp) := conformalMass_measurable _ _ + have hNm := (scaledRawMass_adapted R c hcp B hm hc).measurable (i:=t) + have hd := congrArg (dilationMass κ c hcp) (C.deterministic_green_kernel t E hE) + change dilationMass κ c hcp ((P.restrict E).bind C.rational.terminal)= + conformalMass (halfPlaneDilation c hcp) _ + ((P.restrict E).bind (C.process t)+(P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t)) at hd + rw [conformalMass_add] at hd + change dilationMass κ c hcp ((P.restrict E).bind C.rational.terminal)= + dilationMass κ c hcp ((P.restrict E).bind (C.process t))+ + dilationMass κ c hcp ((P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t)) at hd + rw [← dilationMass_bind _ _ _ _ _ C.rational.terminal_measurable, + ← dilationMass_bind _ _ _ _ _ hCm,← dilationMass_bind _ _ _ _ _ hGm] at hd + have hr := C.raw_scaled_green_kernel hB hc F hw R he c hcp t E hE + dsimp only at hr + simp_rw [canonicalGreenMass_scaled κ B hc γ G F hw c hcp t] at hr + change (P.restrict E).bind (scaledRawTerminal R c B hc)= + (P.restrict E).bind (fun ω => scaledRawMass R c B hc t ω+ + dilationMass κ c hcp (halfPlaneGreenMeasure κ B γ G t ω)) at hr + have hD : Measurable (fun ω => dilationMass κ c hcp (halfPlaneGreenMeasure κ B γ G t ω)) := + hdm.comp hGm + rw [bind_kernel_add _ _ _ hNm hD] at hr + rw [hd,hr] + ac_rfl + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RawScaledMassPaths.lean b/lean/OAI/Probability/SLE/Mass/RawScaledMassPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..40c34628c5a68fdc06d5dd1698093dddea0ad465 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RawScaledMassPaths.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SLE.Loewner.RawScaledGreenKernel +import OAI.Probability.SLE.Loewner.RawTerminalExhaustion +import OAI.Probability.SLE.Loewner.StoppedInversePaths + +namespace OAI + +/-! One raw canonical functional has a measurable full-law certificate +for continuous positive mass paths. Brownian scaling preserves it. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal CompactlySupported + +namespace SLEExactGauge.Multipoint + +local instance rawScaledMassMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance rawScaledMassBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ +local instance rawScaledMassLocallyCompact : LocallyCompactSpace upperHalfPlane := + isOpen_upperHalfPlane.locallyCompactSpace + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {κ : ℝ} {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + +omit [IsProbabilityMeasure P] in +lemma CanonicalMass.exists_raw_positive_paths (C : CanonicalMass P κ B hBm γ G) + (hc : ∀ ω, Continuous (fun t => B t ω)) : + ∃ R : RawCanonicalMass, + (∀ᵐ ω ∂P, (∀ t, R.process t (sourceDriverPath B hc ω)=C.process t ω) ∧ + R.terminal (sourceDriverPath B hc ω)=C.rational.terminal ω) ∧ + ∃ E : Set C(ℝ≥0,ℝ), MeasurableSet E ∧ + (∀ᵐ p ∂P.map (sourceDriverPath B hc), p ∈ E) ∧ + ∀ p ∈ E, PositiveMassPaths (fun t => R.process t p) (R.terminal p) := by + obtain ⟨N,E,hNp,hNr,hNn,hEm,hEf,hEp,he⟩ := C.exists_raw_nonanticipating_with_good_set hc + let R : RawCanonicalMass := ⟨N,rawTerminalMass N,hNp,hNr, + rawTerminalMass_measurable N hNp hNr,rawTerminalMass_radon N,hNn⟩ + obtain ⟨hTm,hTf,hTp⟩ := C.raw_terminal_good_set hc N hNp hNr he + refine ⟨R,?_,E ∩ {p | RawTerminalGood (localTestFamily upperHalfPlane) + (fun t => N t p) (rawTerminalMass N p)},hEm.inter hTm,?_,?_⟩ + · filter_upwards [he,C.rawTerminal_realizes hc N he] with ω hω ht + exact ⟨hω,ht⟩ + · exact hEf.and hTf + · intro p hp + obtain ⟨hz,hm,hcont⟩ := hEp p hp.1 + exact ⟨hz,hm,(hTp p hp.2 hm).1,(fun t => hNr t p),fun f _ => hcont f⟩ + +def scaledRawMass (R : RawCanonicalMass) (c : ℝ≥0) + (B : ℝ≥0 → Ω → ℝ) (hc : ∀ ω, Continuous (fun t => B t ω)) + (t : ℝ≥0) (ω : Ω) : Measure upperHalfPlane := + R.process (c^2*t) (sourceDriverPath (scaledBrownianDriver c B) + (scaledBrownianDriver_continuous c B hc) ω) + +def scaledRawTerminal (R : RawCanonicalMass) (c : ℝ≥0) + (B : ℝ≥0 → Ω → ℝ) (hc : ∀ ω, Continuous (fun t => B t ω)) + (ω : Ω) : Measure upperHalfPlane := + R.terminal (sourceDriverPath (scaledBrownianDriver c B) + (scaledBrownianDriver_continuous c B hc) ω) + +lemma scaledRawMass_adapted (R : RawCanonicalMass) (c : ℝ≥0) (hcp : 0 < c) + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) : + Adapted (Filtration.natural B (fun s => (hm s).stronglyMeasurable)) (scaledRawMass R c B hc) := by + let ℱc := Filtration.natural (scaledBrownianDriver c B) + (fun s => (scaledBrownianDriver_measurable c B hm s).stronglyMeasurable) + let Y := sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc) + have hY : Adapted ℱc (fun t ω => Y ω t) := fun t => + (Filtration.stronglyAdapted_natural + (fun s => (scaledBrownianDriver_measurable c B hm s).stronglyMeasurable) t).measurable + have hp := (raw_process_comp_progressive ℱc Y hY R.process R.progressive).adapted + intro t + have h := hp (c^2*t) + change Measurable[ℱc (c^2*t)] (scaledRawMass R c B hc t) at h + rwa [show ℱc (c^2*t)=(Filtration.natural B (fun s => (hm s).stronglyMeasurable)) t from + scaledBrownianDriver_filtration c hcp B hm t] at h + +omit [IsProbabilityMeasure P] in +lemma scaledRawMass_positive_paths + (R : RawCanonicalMass) (E : Set C(ℝ≥0,ℝ)) (hE : MeasurableSet E) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hEf : ∀ᵐ p ∂P.map (sourceDriverPath B hc), p ∈ E) + (hEp : ∀ p ∈ E, PositiveMassPaths (fun t => R.process t p) (R.terminal p)) + (c : ℝ≥0) (hcp : 0 < c) : + ∀ᵐ ω ∂P, PositiveMassPaths (fun t => scaledRawMass R c B hc t ω) + (scaledRawTerminal R c B hc ω) := by + have hY := source_path_measurable + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc)) + (scaledBrownianDriver_measurable c B hm) + have hf : ∀ᵐ p ∂P.map (sourceDriverPath (scaledBrownianDriver c B) + (scaledBrownianDriver_continuous c B hc)), p ∈ E := by + rwa [scaledBrownianDriver_path_law c hcp B hB hm hc] + filter_upwards [(ae_map_iff hY.aemeasurable hE).mp hf] with ω hω + have hp := hEp _ hω + refine ⟨?_,?_,?_,?_,?_⟩ + · simpa only [scaledRawMass,mul_zero] using hp.zero + · intro s t hst + exact hp.monotone (mul_le_mul_of_nonneg_left hst zero_le) + · intro t + exact hp.dominated (c^2*t) + · intro t + exact hp.radon (c^2*t) + · intro f hfp + exact (hp.continuous_tests f hfp).comp (continuous_const.mul continuous_id) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RestartMassCoordinates.lean b/lean/OAI/Probability/SLE/Mass/RestartMassCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a1eddd74327e56991cd952737bb20531379e0f1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RestartMassCoordinates.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SLE.Mass.ConformalMassTransport +import OAI.Probability.SLE.Geometry.RestartConformalRadius + +namespace OAI + +/-! The actual centered inverse Loewner map and its mass weight. +These are defined only on interior points; no boundary extension is used. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge + +def IsCapacityTwoWitness.restartHomeomorph + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (T : ℝ≥0) : + upperHalfPlane ≃ₜ survivingDomain γ T := by + rcases hw with ⟨hc,_,_,hG,hF,hGM,hFM,hFG,hGF,_,_,_,_⟩ + have hshift (z : upperHalfPlane) : (z:ℂ)+(U T:ℂ) ∈ upperHalfPlane := by + simpa only [upperHalfPlane,mem_ofPred_eq,Complex.add_im,Complex.ofReal_im,add_zero] + using z.property + have hback (z : survivingDomain γ T) : G T z-(U T:ℂ) ∈ upperHalfPlane := by + simpa only [upperHalfPlane,mem_ofPred_eq,Complex.sub_im,Complex.ofReal_im,sub_zero] + using hGM T z.property + refine { + toFun := fun z => ⟨F T ((z:ℂ)+(U T:ℂ)),hFM T (hshift z)⟩ + invFun := fun z => ⟨G T z-(U T:ℂ),hback z⟩ + left_inv := ?_ + right_inv := ?_ + continuous_toFun := ?_ + continuous_invFun := ?_ } + · intro z + apply Subtype.ext + exact (congrArg (fun v : ℂ => v-(U T:ℂ)) (hGF T _ (hshift z))).trans + (add_sub_cancel_right _ _) + · intro z + apply Subtype.ext + change F T ((G T z-(U T:ℂ))+(U T:ℂ)) = z + rw [sub_add_cancel,hFG T _ z.property] + · exact ((hF T).continuousOn.comp_continuous + (continuous_subtype_val.add continuous_const) hshift).subtype_mk _ + · exact (((hG T).continuousOn.comp_continuous continuous_subtype_val + (fun z => z.property)).sub continuous_const).subtype_mk _ + +@[simp] lemma IsCapacityTwoWitness.restartHomeomorph_apply + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (T : ℝ≥0) (z : upperHalfPlane) : + ((hw.restartHomeomorph T z : survivingDomain γ T):ℂ) = F T ((z:ℂ)+(U T:ℂ)) := by + rcases hw with ⟨hc,h0,hi,hG,hF,hGM,hFM,hFG,hGF,hG0,hode,hn,ht⟩ + rfl + +def IsCapacityTwoWitness.restartMassWeight + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (T : ℝ≥0) (κ : ℝ) (hκ : 0 < κ) : + C(upperHalfPlane, ℝ≥0) where + toFun z := ⟨‖deriv (F T) ((z:ℂ)+(U T:ℂ))‖ ^ (1+κ/8),Real.rpow_nonneg (norm_nonneg _) _⟩ + continuous_toFun := by + have hshift (z : upperHalfPlane) : (z:ℂ)+(U T:ℂ) ∈ upperHalfPlane := by + simpa only [upperHalfPlane,mem_ofPred_eq,Complex.add_im,Complex.ofReal_im,add_zero] + using z.property + have hd := (hw.2.2.2.2.1 T).deriv isOpen_upperHalfPlane + have hc := hd.continuousOn.comp_continuous + (continuous_subtype_val.add continuous_const) hshift + exact ((Real.continuous_rpow_const (by linarith : 0 ≤ 1+κ/8)).comp hc.norm).subtype_mk _ + +def IsCapacityTwoWitness.restartMass + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (T : ℝ≥0) (κ : ℝ) (hκ : 0 < κ) + (μ : Measure upperHalfPlane) : Measure (survivingDomain γ T) := + Multipoint.conformalMass (hw.restartHomeomorph T) (hw.restartMassWeight T κ hκ) μ + +lemma IsCapacityTwoWitness.restartMass_integral + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (T : ℝ≥0) (κ : ℝ) (hκ : 0 < κ) + (μ : Measure upperHalfPlane) (f : C_c(survivingDomain γ T, ℝ)) : + (∫ z, f z ∂hw.restartMass T κ hκ μ) = + ∫ z : upperHalfPlane, ‖deriv (F T) ((z:ℂ)+(U T:ℂ))‖ ^ (1+κ/8) * + f (hw.restartHomeomorph T z) ∂μ := + Multipoint.conformalMass_integral (hw.restartHomeomorph T) + (hw.restartMassWeight T κ hκ) μ f + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RestartRandomMassTesting.lean b/lean/OAI/Probability/SLE/Mass/RestartRandomMassTesting.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d38e1c332a2cd2add5de498ef22dad5a1e93c20 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RestartRandomMassTesting.lean @@ -0,0 +1,55 @@ +import OAI.Probability.SLE.Mass.RadonRandomTesting +import OAI.Probability.SLE.Geometry.RandomRestartEvents + +namespace OAI + +/-! The fresh-driver law may be tested against a random spatial weight +measurable in the stopped past. This is the conditional-Tonelli step for +the restart candidate, before invoking uniqueness. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped ENNReal + +namespace SLEExactGauge + +lemma fresh_mass_test_joint_measurable + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (M : X → Measure upperHalfPlane) (hM : Measurable M) + (hMf : ∀ x, IsFiniteMeasureOnCompacts (M x)) + (f : Ω × upperHalfPlane → ℝ≥0∞) (hf : Measurable f) : + Measurable (fun p : Ω × X => ∫⁻ z, f (p.1,z) ∂M p.2) := by + exact halfPlane_random_test_measurable (fun p : Ω × X => M p.2) + (hM.comp measurable_snd) (fun p => hMf p.2) + (fun p : (Ω × X) × upperHalfPlane => f (p.1.1,p.2)) + (hf.comp (measurable_fst.fst.prodMk measurable_snd)) + +theorem restart_random_mass_test + {Ω X : Type*} [mΩ : MeasurableSpace Ω] [mX : MeasurableSpace X] + (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure X) [IsFiniteMeasure ν] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + (Y : Ω → X) (hY : Measurable[mΩ] Y) + (hlaw : ∀ A : Set Ω, MeasurableSet[m] A → + @Measure.map Ω X mΩ mX Y (P.restrict A) = P A • ν) + (M : X → Measure upperHalfPlane) (hM : Measurable M) + (hMf : ∀ x, IsFiniteMeasureOnCompacts (M x)) + (f : Ω × upperHalfPlane → ℝ≥0∞) + (hf : Measurable[m.prod inferInstance] f) : + (∫⁻ ω, ∫⁻ z, f (ω,z) ∂M (Y ω) ∂P) = + ∫⁻ ω, ∫⁻ z, f (ω,z) ∂ν.bind M ∂P := by + let : MeasurableSpace Ω := mΩ + have hg : Measurable[m.prod mX] + (fun p : Ω × X => ∫⁻ z, f (p.1,z) ∂M p.2) := + @fresh_mass_test_joint_measurable Ω X m mX M hM hMf f hf + rw [@restart_lintegral_random_test Ω X mΩ mX P inferInstance ν inferInstance + m hm Y hY hlaw _ hg] + apply lintegral_congr + intro ω + exact (Measure.lintegral_bind hM.aemeasurable + (hf.comp (measurable_const.prodMk measurable_id)).aemeasurable).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/RestartStoppedMass.lean b/lean/OAI/Probability/SLE/Mass/RestartStoppedMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cf2e5cbc8d51193a629e3db6218aca6f7694277 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/RestartStoppedMass.lean @@ -0,0 +1,93 @@ +import OAI.Probability.SLE.Geometry.NormalizedRestartKernel +import OAI.Probability.SLE.Gauge.ConformalDenseExperiment + +namespace OAI + +/-! A dense mass generated by the normalized fresh trace is present in the +original stopped trace at the corresponding physical radius level. -/ + +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open FrontSuccessMeasurability + +lemma segmentSausageCharge_clock_le + (κ : ℝ) (γ η : C(ℝ≥0, ℂ)) (T c σ : ℝ≥0) + (hpath : ∀ t, η t = γ (T + c * t)) (v : ℝ) (D : Set ℂ) : + segmentSausageCharge κ η 0 σ v D ≤ segmentSausageCharge κ γ 0 (T + c * σ) v D := by + apply mul_le_mul' le_rfl + apply measure_mono + rintro z ⟨hz, t, ht, hdist⟩ + refine ⟨hz, T + c * t, ⟨bot_le, + add_le_add le_rfl (mul_le_mul_of_nonneg_left ht.2 (show 0 ≤ c from bot_le))⟩, ?_⟩ + simpa only [hpath t] using hdist + +lemma stoppedWholeSausageCharge_clock_le + (κ : ℝ) (γ η : C(ℝ≥0, ℂ)) (T c σ : ℝ≥0) (ρ : WithTop ℝ≥0) + (hpath : ∀ t, η t = γ (T + c * t)) + (hstop : ((T + c * σ : ℝ≥0) : WithTop ℝ≥0) ≤ ρ) (v : ℝ) (D : Set ℂ) : + stoppedWholeSausageCharge κ η (σ : WithTop ℝ≥0) v D ≤ + stoppedWholeSausageCharge κ γ ρ v D := by + rw [stoppedWholeSausageCharge_finite] + exact (segmentSausageCharge_clock_le κ γ η T c σ hpath v D).trans + (segmentSausageCharge_le_stoppedWhole κ γ _ ρ hstop v D) + +lemma IsCapacityTwoWitness.normalized_restart_level_of_live_source + {U : ℝ≥0 → ℝ} {γ β : ℝ≥0 → ℂ} {G F G' F' : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) (T a : ℝ≥0) (ha : 0 < a) + (hb : IsCapacityTwoWitness (normalizedRestartDriver U T a) β G' F') + (w : ℂ) (u v : ℝ) + (hbase : fullRadius G T (F T ((a : ℂ) * w + (U T : ℂ))) = + (2 * (F T ((a : ℂ) * w + (U T : ℂ))).im) * Real.exp (-u)) + (t : ℝ≥0) (ht : w ∈ survivingDomain β t) + (hR : fullRadius G' t w = (2 * w.im) * Real.exp (-v)) : + fullRadius G (T + a ^ 2 * t) (F T ((a : ℂ) * w + (U T : ℂ))) = + (2 * (F T ((a : ℂ) * w + (U T : ℂ))).im) * Real.exp (-(u + v)) ∧ + radiusLevelTime γ G (F T ((a : ℂ) * w + (U T : ℂ))) (u + v) = + (T + a ^ 2 * t : ℝ≥0) := by + have hbup := normalized_restart_witness T a ha hb + have haC : (a : ℂ) ≠ 0 := by exact_mod_cast ha.ne' + have htu : (a : ℂ) * w ∈ survivingDomain (sourceScaleTrace a β) (a ^ 2 * t) := by + rw [source_scale_domain_iff a _ ha β, source_scale_time_mul_sq a t ha, + mul_div_cancel_left₀ w haC] + exact ht + have hRu : fullRadius (sourceScaleChart a G') (a ^ 2 * t) ((a : ℂ) * w) = + (2 * ((a : ℂ) * w).im) * Real.exp (-v) := by + rw [hb.scaled_radius a ha t w ht, hR] + simp only [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero] + ring + exact hw.restart_level_of_live_source hU T hbup ((a : ℂ) * w) u v hbase (a ^ 2 * t) htu hRu + +/-- At every finite source radius level, the stopped fresh physical mass +is contained in the stopped original mass at the corresponding actual level. -/ +theorem IsCapacityTwoWitness.normalized_restart_stopped_mass_le + {U : ℝ≥0 → ℝ} {γ β : ℝ≥0 → ℂ} {G F G' F' : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) (T a : ℝ≥0) (ha : 0 < a) + (hb : IsCapacityTwoWitness (normalizedRestartDriver U T a) β G' F') + (w : ℂ) (u q : ℝ) + (hbase : fullRadius G T (F T ((a : ℂ) * w + (U T : ℂ))) = + (2 * (F T ((a : ℂ) * w + (U T : ℂ))).im) * Real.exp (-u)) + (η : C(ℝ≥0, ℂ)) (hpath : ∀ t, η t = γ (T + a ^ 2 * t)) + (hfinite : radiusLevelTime β G' w q < ∞) (κ v : ℝ) (D : Set ℂ) : + stoppedWholeSausageCharge κ η (radiusLevelTime β G' w q) v D ≤ + stoppedWholeSausageCharge κ ⟨γ, hw.1⟩ + (radiusLevelTime γ G (F T ((a : ℂ) * w + (U T : ℂ))) (u + q)) v D := by + have hV : Continuous (normalizedRestartDriver U T a) := by + unfold normalizedRestartDriver + fun_prop + obtain ⟨t, ht, hR⟩ := exists_live_level_of_radiusLevelTime_lt_top β G' w q hfinite + have hs := radiusLevelTime_eq_of_live_level hV hb w q t ht hR + have hp := (hw.normalized_restart_level_of_live_source hU T a ha hb w u q hbase t ht hR).2 + have hs' : (radiusLevelTime β G' w q : WithTop ℝ≥0) = (t : WithTop ℝ≥0) := by exact_mod_cast hs + have hp' : (radiusLevelTime γ G (F T ((a : ℂ) * w + (U T : ℂ))) (u + q) : WithTop ℝ≥0) = + ((T + a ^ 2 * t : ℝ≥0) : WithTop ℝ≥0) := by exact_mod_cast hp + rw [hs', hp'] + exact stoppedWholeSausageCharge_clock_le κ ⟨γ, hw.1⟩ η T (a ^ 2) t _ hpath le_rfl v D + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/ScaledGreenMeasure.lean b/lean/OAI/Probability/SLE/Mass/ScaledGreenMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..283aac110d0be191d59aa55e5e4bbf5db90369db --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/ScaledGreenMeasure.lean @@ -0,0 +1,61 @@ +import OAI.Probability.SLE.Mass.DilationMass +import OAI.Probability.SLE.Loewner.RawScaledGreenKernel +import OAI.Probability.SLE.Geometry.ScaledMarkedKernel + +namespace OAI + +/-! Killed Green measures scale by the same dimension-weighted spatial +pushforward as the canonical mass, including points no longer surviving. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +local instance scaledGreenMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance scaledGreenBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +lemma halfPlaneGreenMeasure_scaled {Ω : Type*} (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (c : ℝ≥0) (hc : 0 < c) (t : ℝ≥0) (ω : Ω) : + halfPlaneGreenMeasure κ (scaledBrownianDriver c B) + (fun ω => sourceScaleTrace c (γ ω)) (fun ω => sourceScaleChart c (G ω)) (c^2*t) ω= + dilationMass κ c hc (halfPlaneGreenMeasure κ B γ G t ω) := by + unfold halfPlaneGreenMeasure + apply dilationMass_realDensity + intro z _hz + have h := source_scale_greenDensity κ c hc (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (F ω) (hw ω) (c^2*t) z + rw [source_scale_time_mul_sq c t hc] at h + simpa only [scaledBrownianDriver,mul_left_comm (Real.sqrt κ) (c:ℝ)] using h + +lemma canonicalGreenMass_scaled {Ω : Type*} (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (hc : ∀ ω, Continuous (fun t => B t ω)) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (c : ℝ≥0) (hcp : 0 < c) (t : ℝ≥0) (ω : Ω) : + canonicalGreenMass κ (c^2*t) + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc) ω)= + dilationMass κ c hcp (halfPlaneGreenMeasure κ B γ G t ω) := by + have hwc : IsCapacityTwoWitness (fun t => Real.sqrt κ*scaledBrownianDriver c B t ω) + (sourceScaleTrace c (γ ω)) (sourceScaleChart c (G ω)) (sourceScaleChart c (F ω)) := by + have h := source_scale_witness c hcp (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (F ω) (hw ω) + simpa only [scaledBrownianDriver,mul_left_comm (Real.sqrt κ) (c:ℝ)] using h + have he := canonicalGreenMass_eq κ + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc) ω) + hwc (c^2*t) + change canonicalGreenMass κ (c^2*t) + (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hc) ω)= + halfPlaneGreenMeasure κ (scaledBrownianDriver c B) + (fun ω => sourceScaleTrace c (γ ω)) (fun ω => sourceScaleChart c (G ω)) (c^2*t) ω at he + rw [he] + exact halfPlaneGreenMeasure_scaled κ B γ G F hw c hcp t ω + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/SignedLevelTests.lean b/lean/OAI/Probability/SLE/Mass/SignedLevelTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b1a110823853d6fe4d4aceb0a0ee254330a23d5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/SignedLevelTests.lean @@ -0,0 +1,142 @@ +import OAI.Probability.SLE.Mass.LevelApproximationL2 + +namespace OAI + +/-! Real compact tests of the actual level measures. Both signs are +controlled by the same compact moment estimate. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.Multipoint + +def levelApproximationRealTest {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (t : ℝ≥0∞) (f : ℂ → ℝ) (ω : Ω) : ℝ := + ∫ z, f z ∂levelApproximation κ B γ G u t ω + +lemma integrable_of_bounded_support (μ : Measure ℂ) (K : Set ℂ) + (hK : MeasurableSet K) (hμK : μ K < ⊤) (f : ℂ → ℝ) + (hfm : Measurable f) (C : ℝ) (hf : ∀ z ∈ K, ‖f z‖ ≤ C) + (hz : ∀ z ∉ K, f z = 0) : Integrable f μ := by + have hi : Integrable (K.indicator (fun _ : ℂ => C)) μ := + (integrableOn_const hμK.ne).integrable_indicator hK + apply hi.mono' hfm.aestronglyMeasurable + filter_upwards [] with z + by_cases h : z ∈ K + · simpa only [indicator_of_mem h] using hf z h + · simp only [hz z h,norm_zero,indicator_of_notMem h,le_refl] + +lemma levelApproximationRealTest_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0∞) (f : ℂ → ℝ) (hfm : Measurable f) : + Measurable (levelApproximationRealTest κ B γ G u t f) := by + have hd := levelApproximationDensity_joint_measurable hm hBc κ u hu γ G F hw t + have he (ω : Ω) : levelApproximationRealTest κ B γ G u t f ω = + ∫ z, (levelApproximationDensity κ B γ G u t ω z).toReal * f z := by + apply integral_withDensity_eq_integral_toReal_smul hd.of_uncurry_left + filter_upwards [] with z + unfold levelApproximationDensity + split_ifs <;> simp + simp_rw [show levelApproximationRealTest κ B γ G u t f = + (fun ω => ∫ z, (levelApproximationDensity κ B γ G u t ω z).toReal * f z) + from funext he] + exact (hd.ennreal_toReal.mul (hfm.comp measurable_snd)).stronglyMeasurable.integral_prod_right'.measurable + +lemma levelApproximationRealTest_eq_parts + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (t : ℝ≥0∞) (f : ℂ → ℝ) (ω : Ω) + (K : Set ℂ) (hK : MeasurableSet K) (hM : levelMass κ B γ G u K ω < ⊤) + (hfm : Measurable f) (C : ℝ) (hf : ∀ z ∈ K, ‖f z‖ ≤ C) + (hz : ∀ z ∉ K, f z = 0) : + levelApproximationRealTest κ B γ G u t f ω = + (levelApproximationTest κ B γ G u t (fun z => ENNReal.ofReal (f z)) ω).toReal - + (levelApproximationTest κ B γ G u t (fun z => ENNReal.ofReal (-f z)) ω).toReal := by + exact integral_eq_lintegral_pos_part_sub_lintegral_neg_part + (integrable_of_bounded_support _ K hK + ((levelApproximation_apply_le κ B γ G u t ω hK).trans_lt hM) f hfm C hf hz) + +theorem levelMass_ae_finite + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (K : Set ℂ) (hK : IsCompact K) (hKH : K ⊆ upperHalfPlane) + (u : ℝ) (hu : 0 ≤ u) : ∀ᵐ ω ∂P, levelMass κ B γ G u K ω < ⊤ := by + obtain ⟨M,hM,hbound⟩ := uniform_levelMass_compact_moments hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth K hK hKH 1 + apply ae_lt_top (levelMass_measurable hm hBc κ u hu γ G F hw K) + exact (lt_of_le_of_lt (by simpa only [pow_one] using hbound u hu) hM).ne + +theorem uniform_signed_levelTest_L2 + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun s => Real.sqrt κ * B s ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (K : Set ℂ) (hK : IsCompact K) (hKH : K ⊆ upperHalfPlane) + (f : ℂ → ℝ) (hfm : Measurable f) (C : ℝ) (hf : ∀ z ∈ K, ‖f z‖ ≤ C) + (hz : ∀ z ∉ K, f z = 0) : + (∀ u : ℝ, 0 ≤ u → ∀ t : ℝ≥0∞, MemLp (levelApproximationRealTest κ B γ G u t f) 2 P) ∧ + ∃ D : ℝ, ∀ u : ℝ, ∀ _hu : 0 ≤ u, ∀ t : ℝ≥0∞, + ∀ hp : MemLp (levelApproximationRealTest κ B γ G u t f) 2 P, + ‖hp.toLp (levelApproximationRealTest κ B γ G u t f)‖ ≤ D := by + let fp : ℂ → ℝ≥0∞ := fun z => ENNReal.ofReal (f z) + let fn : ℂ → ℝ≥0∞ := fun z => ENNReal.ofReal (-f z) + have hfp (z : ℂ) (hzK : z ∈ K) : fp z ≤ ENNReal.ofReal C := + ENNReal.ofReal_le_ofReal ((le_abs_self _).trans (hf z hzK)) + have hfn (z : ℂ) (hzK : z ∈ K) : fn z ≤ ENNReal.ofReal C := + ENNReal.ofReal_le_ofReal ((neg_le_abs _).trans (hf z hzK)) + obtain ⟨Mp,hMp,hpb⟩ := uniform_levelApproximationTest_moments hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth K hK hKH fp (ENNReal.ofReal C) ENNReal.ofReal_lt_top hfp + (fun z hzK => by simp only [fp,hz z hzK,ENNReal.ofReal_zero]) 2 + obtain ⟨Mn,hMn,hnb⟩ := uniform_levelApproximationTest_moments hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth K hK hKH fn (ENNReal.ofReal C) ENNReal.ofReal_lt_top hfn + (fun z hzK => by simp only [fn,hz z hzK,neg_zero,ENNReal.ofReal_zero]) 2 + have hpm (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) := + levelApproximationTest_measurable hm hBc κ u hu γ G F hw t fp hfm.ennreal_ofReal + have hnm (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) := + levelApproximationTest_measurable hm hBc κ u hu γ G F hw t fn hfm.neg.ennreal_ofReal + have hpLp (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) := + memLp_toReal_two P _ (hpm u hu t) Mp hMp (hpb u hu t) + have hnLp (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) := + memLp_toReal_two P _ (hnm u hu t) Mn hMn (hnb u hu t) + have he (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) : levelApproximationRealTest κ B γ G u t f =ᵐ[P] + fun ω => (levelApproximationTest κ B γ G u t fp ω).toReal - + (levelApproximationTest κ B γ G u t fn ω).toReal := by + filter_upwards [levelMass_ae_finite hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth K hK hKH u hu] + with ω hω + exact levelApproximationRealTest_eq_parts κ B γ G u t f ω K hK.measurableSet hω hfm C hf hz + refine ⟨fun u hu t => MemLp.ae_eq (he u hu t).symm ((hpLp u hu t).sub (hnLp u hu t)), + ⟨(Mp ^ (1/2 : ℝ)).toReal + (Mn ^ (1/2 : ℝ)).toReal, ?_⟩⟩ + intro u hu t hp + have hclass : hp.toLp (levelApproximationRealTest κ B γ G u t f) = + (hpLp u hu t).toLp _ - (hnLp u hu t).toLp _ := by + apply Lp.ext + filter_upwards [hp.coeFn_toLp, (hpLp u hu t).coeFn_toLp, + (hnLp u hu t).coeFn_toLp,Lp.coeFn_sub ((hpLp u hu t).toLp _) ((hnLp u hu t).toLp _), + he u hu t] with ω h₁ h₂ h₃ h₄ h₅ + rw [h₁,h₄,Pi.sub_apply,h₂,h₃,h₅] + rw [hclass] + exact (norm_sub_le _ _).trans (add_le_add + (norm_toLp_toReal_two_le P _ (hpm u hu t) Mp hMp (hpb u hu t) (hpLp u hu t)) + (norm_toLp_toReal_two_le P _ (hnm u hu t) Mn hMn (hnb u hu t) (hnLp u hu t))) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/SignedMeasureConvergence.lean b/lean/OAI/Probability/SLE/Mass/SignedMeasureConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..c99ae9bfae7abd71879534d865e75ac94cc4d8b7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/SignedMeasureConvergence.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SLE.Mass.RadonKernelIntegral +import Mathlib.MeasureTheory.Integral.Bochner.Set +import Mathlib.MeasureTheory.Function.LpSpace.Indicator +import Mathlib.Analysis.Normed.Group.FunctionSeries + +namespace OAI + +/-! Small analytic passages used for the conditional mass kernel. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal Topology + +namespace SLEExactGauge + +theorem integral_tendsto_of_lintegral_pos_neg + {X : Type*} [MeasurableSpace X] (μ : ℕ → Measure X) (ν : Measure X) + (f : X → ℝ) (hμ : ∀ n, Integrable f (μ n)) (hν : Integrable f ν) + (hpos : Tendsto (fun n => ∫⁻ x, ENNReal.ofReal (f x) ∂μ n) atTop + (𝓝 (∫⁻ x, ENNReal.ofReal (f x) ∂ν))) + (hneg : Tendsto (fun n => ∫⁻ x, ENNReal.ofReal (-f x) ∂μ n) atTop + (𝓝 (∫⁻ x, ENNReal.ofReal (-f x) ∂ν))) : + Tendsto (fun n => ∫ x, f x ∂μ n) atTop (𝓝 (∫ x, f x ∂ν)) := by + have hp := (ENNReal.tendsto_toReal (lintegral_ofReal_lt_top_of_integrable hν).ne).comp hpos + have hn := (ENNReal.tendsto_toReal (lintegral_ofReal_lt_top_of_integrable hν.neg).ne).comp hneg + have hh := hp.sub hn + dsimp only [Function.comp_def,Pi.neg_apply] at hh + rw [← integral_eq_lintegral_pos_part_sub_lintegral_neg_part hν] at hh + exact hh.congr' (Eventually.of_forall (fun n => + (integral_eq_lintegral_pos_part_sub_lintegral_neg_part (hμ n)).symm)) + +theorem real_convex_tail_tendsto (f : ℕ → ℝ) {a : ℝ} + (hf : Tendsto f atTop (𝓝 a)) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (hw₀ : ∀ n i, i ∈ s n → 0 ≤ w n i) (hw₁ : ∀ n, ∑ i ∈ s n, w n i = 1) : + Tendsto (fun n => ∑ i ∈ s n, w n i * f (n+i)) atTop (𝓝 a) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + obtain ⟨N,hN⟩ := Metric.tendsto_atTop.mp hf (ε/2) (by positivity) + refine ⟨N,fun n hn => ?_⟩ + have he : (∑ i ∈ s n, w n i * f (n+i)) - a = + ∑ i ∈ s n, w n i * (f (n+i)-a) := by + simp only [mul_sub,Finset.sum_sub_distrib,← Finset.sum_mul,hw₁ n,one_mul] + calc + dist (∑ i ∈ s n, w n i * f (n+i)) a = + ‖∑ i ∈ s n, w n i * (f (n+i)-a)‖ := by rw [dist_eq_norm,he] + _ ≤ ∑ i ∈ s n, ‖w n i * (f (n+i)-a)‖ := norm_sum_le _ _ + _ ≤ ∑ i ∈ s n, w n i * (ε/2) := by + apply Finset.sum_le_sum + intro i hi + rw [norm_mul,Real.norm_of_nonneg (hw₀ n i hi)] + exact mul_le_mul_of_nonneg_left (le_of_lt (hN (n+i) (by omega))) (hw₀ n i hi) + _ = ε/2 := by rw [← Finset.sum_mul,hw₁ n,one_mul] + _ < ε := by linarith + + +lemma integral_indicator_one_mul + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (E : Set Ω) + (hE : MeasurableSet E) (f : Ω → ℝ) : + (∫ ω, E.indicator (fun _ => (1 : ℝ)) ω * f ω ∂P) = ∫ ω in E, f ω ∂P := by + rw [← integral_indicator hE] + congr 1 + funext ω + by_cases hω : ω ∈ E + · simp only [indicator_of_mem hω,one_mul] + · simp only [indicator_of_notMem hω,zero_mul] + +theorem setIntegral_tendsto_of_L2_pairings + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (F : ℕ → Ω → ℝ) (f : Ω → ℝ) + (hp : ∀ a : Ω → ℝ, MemLp a 2 P → + Tendsto (fun n => ∫ ω, a ω * F n ω ∂P) atTop (𝓝 (∫ ω, a ω * f ω ∂P))) + (E : Set Ω) (hE : MeasurableSet E) : + Tendsto (fun n => ∫ ω in E, F n ω ∂P) atTop (𝓝 (∫ ω in E, f ω ∂P)) := by + have ha : MemLp (E.indicator (fun _ => (1 : ℝ))) 2 P := (memLp_const 1).indicator hE + have hh := hp (E.indicator (fun _ => 1)) ha + simpa only [integral_indicator_one_mul P E hE] using hh + + +theorem mean_test_tendsto_of_L2_pairings + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) [IsFiniteMeasure P] (μ : ℕ → Ω → Measure X) (ν : Ω → Measure X) + (hμ : ∀ n, Measurable (μ n)) (hν : Measurable ν) (f : X → ℝ) (hf : Measurable f) + (hμi : ∀ n ω, Integrable f (μ n ω)) (hνi : ∀ ω, Integrable f (ν ω)) + (E : Set Ω) (hE : MeasurableSet E) + (hμP : ∀ n, Integrable f ((P.restrict E).bind (μ n))) + (hνP : Integrable f ((P.restrict E).bind ν)) + (hp : ∀ a : Ω → ℝ, MemLp a 2 P → + Tendsto (fun n => ∫ ω, a ω * (∫ x, f x ∂μ n ω) ∂P) atTop + (𝓝 (∫ ω, a ω * (∫ x, f x ∂ν ω) ∂P))) : + Tendsto (fun n => ∫ x, f x ∂(P.restrict E).bind (μ n)) atTop + (𝓝 (∫ x, f x ∂(P.restrict E).bind ν)) := by + have he (n : ℕ) := integral_bind_of_integrable_sections (P.restrict E) (μ n) (hμ n) f hf + (hμi n) (hμP n) + have hev := integral_bind_of_integrable_sections (P.restrict E) ν hν f hf hνi hνP + simpa only [he,hev] using setIntegral_tendsto_of_L2_pairings P + (fun n ω => ∫ x, f x ∂μ n ω) (fun ω => ∫ x, f x ∂ν ω) hp E hE + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/SimultaneousConvexTails.lean b/lean/OAI/Probability/SLE/Mass/SimultaneousConvexTails.lean new file mode 100644 index 0000000000000000000000000000000000000000..8246ea22d5325a0b44b70e0a1187d83289a2e7b1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/SimultaneousConvexTails.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SLE.Mass.HilbertConvexTails +import Mathlib.Analysis.InnerProductSpace.l2Space + +namespace OAI + +/-! The countable deterministic extraction in `mass:construction`. +A weighted Hilbert sum ensures the same finite convex coefficients work +for every member of the countable family of bounded test sequences. -/ + +noncomputable section +open Set Filter +open scoped Topology ENNReal + +namespace SLEExactGauge + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + +lemma geometric_half_mem_l2 : Memℓp (fun j : ℕ => (1/2 : ℝ)^j) 2 := by + apply memℓp_gen + have h := summable_geometric_of_abs_lt_one (show |(1/4 : ℝ)| < 1 by norm_num) + convert h using 1 + funext j + simp only [ENNReal.toReal_ofNat,Real.rpow_two,Real.norm_eq_abs, + abs_of_nonneg (pow_nonneg (by norm_num : (0:ℝ) ≤ 1/2) j)] + rw [pow_two,← mul_pow] + norm_num + +theorem exists_simultaneous_convex_tail_combinations (u : ℕ → ℕ → E) + (hbound : ∀ j, ∃ B : ℝ, ∀ n, ‖u n j‖ ≤ B) : + ∃ x : ℕ → E, ∃ s : ℕ → Finset ℕ, ∃ w : ℕ → ℕ → ℝ, + (∀ n i, i ∈ s n → 0 ≤ w n i) ∧ + (∀ n, ∑ i ∈ s n, w n i = 1) ∧ + (∀ j, Summable (fun n => ‖(∑ i ∈ s n, w n i • u (n+i) j) - x j‖)) ∧ + (∀ j, Tendsto (fun n => ∑ i ∈ s n, w n i • u (n+i) j) atTop (𝓝 (x j))) := by + choose B hB using hbound + let c : ℕ → ℝ := fun j => (1/2:ℝ)^j / max 1 (B j) + have hc (j : ℕ) : 0 < c j := by + apply div_pos (pow_pos (by norm_num) _) + exact lt_of_lt_of_le zero_lt_one (le_max_left _ _) + have hsmall (n j : ℕ) : ‖c j • u n j‖ ≤ (1/2:ℝ)^j := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (hc j)] + dsimp only [c] + have hd : 0 < max 1 (B j) := lt_of_lt_of_le zero_lt_one (le_max_left _ _) + have hh : ‖u n j‖ ≤ max 1 (B j) := (hB j n).trans (le_max_right _ _) + calc + (1/2:ℝ)^j / max 1 (B j) * ‖u n j‖ = + (1/2:ℝ)^j * ‖u n j‖ / max 1 (B j) := by ring + _ ≤ (1/2:ℝ)^j := (div_le_iff₀ hd).mpr (by gcongr) + let g : lp (fun _ : ℕ => ℝ) 2 := ⟨_,geometric_half_mem_l2⟩ + let v : ℕ → lp (fun _ : ℕ => E) 2 := fun n => + ⟨fun j => c j • u n j,geometric_half_mem_l2.mono (hsmall n)⟩ + have hv (n : ℕ) : ‖v n‖ ≤ ‖g‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro j + simpa only [g,Real.norm_eq_abs, + abs_of_nonneg (pow_nonneg (by norm_num : (0:ℝ) ≤ 1/2) j)] using hsmall n j + obtain ⟨x,s,w,hw,hs,herror,hconv⟩ := exists_convex_tail_combinations v ‖g‖ hv + let L (j : ℕ) : lp (fun _ : ℕ => E) 2 →L[ℝ] E := + (c j)⁻¹ • lp.evalCLM ℝ (fun _ : ℕ => E) 2 j + have hL (j n : ℕ) : L j (v n) = u n j := by + change (c j)⁻¹ • (c j • u n j) = _ + rw [smul_smul,inv_mul_cancel₀ (hc j).ne',one_smul] + refine ⟨fun j => L j x,s,w,hw,hs,?_,?_⟩ + · intro j + have hgeo : Summable (fun n : ℕ => ‖L j‖ * (1/2:ℝ)^n) := + (summable_geometric_of_abs_lt_one (show |(1/2:ℝ)| < 1 by norm_num)).mul_left _ + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ hgeo + intro n + have hnorm := (L j).le_opNorm ((∑ i ∈ s n, w n i • v (n+i))-x) + simp only [map_sub,map_sum,map_smul,hL] at hnorm + have hh : ‖(∑ i ∈ s n, w n i • v (n+i))-x‖ ≤ (1/2:ℝ)^n := by + simpa only [dist_eq_norm] using (herror n).le + exact hnorm.trans (mul_le_mul_of_nonneg_left hh (norm_nonneg _)) + · intro j + have hh := ((L j).continuous.tendsto x).comp hconv + simpa only [Function.comp_def,map_sum,map_smul,hL] using hh + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/StoppedConformalPassageMass.lean b/lean/OAI/Probability/SLE/Mass/StoppedConformalPassageMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b244fdeb09f8cf03c08d7fa419891606bd67f05 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/StoppedConformalPassageMass.lean @@ -0,0 +1,218 @@ +import OAI.Probability.SLE.Mass.CompactConformalPassageMass + +namespace OAI + +/-! Retained sausage mass before the actual passage stop. The physical +curve may include boundary visits; only its retained interior interval is +identified with the conformal image. All mass is charged to the prescribed +stopped segment, rather than to later portions of the whole trace. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal + +namespace SLEExactGauge + +def segmentSausageCharge (κ : ℝ) (η : ℝ≥0 → ℂ) (s t : ℝ≥0) + (v : ℝ) (R : Set ℂ) : ℝ≥0∞ := + ENNReal.ofReal (v ^ (-codimension κ)) * volume (R ∩ sourceSausageSet η s t v) + +theorem sourceSausageSet_mono_interval + (η : ℝ≥0 → ℂ) {s t a b : ℝ≥0} (hsa : s ≤ a) (hbt : b ≤ t) (v : ℝ) : + sourceSausageSet η a b v ⊆ sourceSausageSet η s t v := by + rintro z ⟨u, hu, hd⟩ + exact ⟨u, ⟨hsa.trans hu.1, hu.2.trans hbt⟩, hd⟩ + +theorem sourceSausageSet_congr_interval + {η ξ : ℝ≥0 → ℂ} {s t : ℝ≥0} (heq : EqOn η ξ (Icc s t)) (v : ℝ) : + sourceSausageSet η s t v = sourceSausageSet ξ s t v := by + ext z + constructor <;> rintro ⟨u, hu, hd⟩ + · exact ⟨u, hu, by simpa only [heq hu] using hd⟩ + · exact ⟨u, hu, by simpa only [heq hu] using hd⟩ + +theorem segmentSausageCharge_mono + (κ : ℝ) (η : ℝ≥0 → ℂ) {s t a b : ℝ≥0} + (hsa : s ≤ a) (hbt : b ≤ t) (v : ℝ) {R S : Set ℂ} (hRS : R ⊆ S) : + segmentSausageCharge κ η a b v R ≤ segmentSausageCharge κ η s t v S := + mul_le_mul' le_rfl (measure_mono (inter_subset_inter hRS + (sourceSausageSet_mono_interval η hsa hbt v))) + +/-- The finite-list conformal transfer charges only the actual stopped +physical passage. Its values at parameter-boundary times can be supplied by +the boundary-safe restart theorem. -/ +theorem compact_conformal_stopped_passage_mass + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (hSLE : IsOrdinaryChordalSLE κ γ P) + (Fₙ : ℕ → ℂ → ℂ) (F : ℂ → ℂ) + (hFn : ∀ n, DifferentiableOn ℂ (Fₙ n) upperHalfPlane) + (hinj : ∀ n, InjOn (Fₙ n) upperHalfPlane) + (hF : DifferentiableOn ℂ F upperHalfPlane) + (hne : ∀ z ∈ upperHalfPlane, deriv F z ≠ 0) + (hconv : TendstoLocallyUniformlyOn Fₙ F atTop upperHalfPlane) + (K : Set ℂ) (hK : IsCompact K) (hKn : K.Nonempty) (hKH : K ⊆ upperHalfPlane) + (R : Set ℂ) (hR : IsOpen R) (himage : F '' K ⊆ R) + (I : Finset (ℝ≥0 × ℝ≥0)) (hI : ∀ J ∈ I, J.1 < J.2) + (v : ℕ → ℝ) (hv : ∀ n, 0 < v n) (hlim : Tendsto v atTop (𝓝 0)) + (η : ℕ → Ω → ℝ≥0 → ℂ) (s t : ℕ → Ω → ℝ≥0) (Rₙ : ℕ → Set ℂ) + (G : ℕ → Set Ω) (q : ℝ) (hq : 0 < q) + (hG : ∀ᶠ n in atTop, ENNReal.ofReal q ≤ P (G n)) + (hregion : ∀ᶠ n in atTop, R ⊆ Rₙ n) + (hretain : ∀ᶠ n in atTop, ∀ ω, ω ∈ G n → + ∃ J ∈ I, γ ω '' Icc J.1 J.2 ⊆ K ∧ s n ω ≤ J.1 ∧ J.2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc J.1 J.2)) : + ∃ a : ℝ, 0 < a ∧ ∀ᶠ n in atTop, + ENNReal.ofReal (q / 2) ≤ P {ω | ω ∈ G n ∧ ENNReal.ofReal a ≤ + segmentSausageCharge κ (η n ω) (s n ω) (t n ω) (v n) (Rₙ n)} := by + obtain ⟨c, ell, v₀, hc, hell, hv₀, htransfer⟩ := eventually_compact_sausage_transfer + κ Fₙ F hFn hinj hF hne hconv K hK hKn hKH R hR himage + have hcoeff : 0 < c ^ 2 * ell ^ codimension κ := + mul_pos (sq_pos_of_pos hc) (Real.rpow_pos_of_pos hell _) + have hsmall : ∀ᶠ n in atTop, v n < v₀ := hlim.eventually (gt_mem_nhds hv₀) + have hlim' : Tendsto (fun n => ell * v n) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul hlim + have htrans : ∀ᶠ n in atTop, ∀ ω, ω ∈ G n → True ∧ + ∃ J ∈ I, ENNReal.ofReal (c ^ 2 * ell ^ codimension κ) * + sourceSausageMass κ (γ ω) J.1 J.2 (ell * v n) ≤ + segmentSausageCharge κ (η n ω) (s n ω) (t n ω) (v n) (Rₙ n) := by + filter_upwards [htransfer, hretain, hsmall, hregion] with n hn hr hs hRsub + intro ω hω + obtain ⟨J, hJI, hJK, hJs, hJt, heq⟩ := hr ω hω + refine ⟨trivial, J, hJI, (hn (γ ω) J.1 J.2 hJK (v n) (hv n) hs).trans ?_⟩ + change segmentSausageCharge κ (fun u => Fₙ n (γ ω u)) J.1 J.2 (v n) R ≤ _ + have hsausage := sourceSausageSet_congr_interval heq (v n) + unfold segmentSausageCharge + rw [← hsausage] + exact segmentSausageCharge_mono κ (η n ω) hJs hJt (v n) hRsub + obtain ⟨a, ha, hmass⟩ := ribbon_passage_mass_of_eventually_finite_intervals + P κ hκ hκ8 γ hSLE I hI (fun n => ell * v n) + (fun n => mul_pos hell (hv n)) hlim' G q hq hG + (fun n ω => segmentSausageCharge κ (η n ω) (s n ω) (t n ω) (v n) (Rₙ n)) + (fun _ _ => True) (c ^ 2 * ell ^ codimension κ) hcoeff htrans + exact ⟨a, ha, by simpa only [true_and] using hmass⟩ + +/-- Almost-sure chart identities suffice; exceptional restart paths are +removed without changing the probabilities of the retained events. -/ +theorem compact_conformal_stopped_passage_mass_ae + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (hSLE : IsOrdinaryChordalSLE κ γ P) + (Fₙ : ℕ → ℂ → ℂ) (F : ℂ → ℂ) + (hFn : ∀ n, DifferentiableOn ℂ (Fₙ n) upperHalfPlane) + (hinj : ∀ n, InjOn (Fₙ n) upperHalfPlane) + (hF : DifferentiableOn ℂ F upperHalfPlane) + (hne : ∀ z ∈ upperHalfPlane, deriv F z ≠ 0) + (hconv : TendstoLocallyUniformlyOn Fₙ F atTop upperHalfPlane) + (K : Set ℂ) (hK : IsCompact K) (hKn : K.Nonempty) (hKH : K ⊆ upperHalfPlane) + (R : Set ℂ) (hR : IsOpen R) (himage : F '' K ⊆ R) + (I : Finset (ℝ≥0 × ℝ≥0)) (hI : ∀ J ∈ I, J.1 < J.2) + (v : ℕ → ℝ) (hv : ∀ n, 0 < v n) (hlim : Tendsto v atTop (𝓝 0)) + (η : ℕ → Ω → ℝ≥0 → ℂ) (s t : ℕ → Ω → ℝ≥0) (Rₙ : ℕ → Set ℂ) + (G : ℕ → Set Ω) (q : ℝ) (hq : 0 < q) + (hG : ∀ᶠ n in atTop, ENNReal.ofReal q ≤ P (G n)) + (hregion : ∀ᶠ n in atTop, R ⊆ Rₙ n) + (hretain : ∀ᶠ n in atTop, ∀ᵐ ω ∂P, ω ∈ G n → + ∃ J ∈ I, γ ω '' Icc J.1 J.2 ⊆ K ∧ s n ω ≤ J.1 ∧ J.2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc J.1 J.2)) : + ∃ a : ℝ, 0 < a ∧ ∀ᶠ n in atTop, + ENNReal.ofReal (q / 2) ≤ P {ω | ω ∈ G n ∧ ENNReal.ofReal a ≤ + segmentSausageCharge κ (η n ω) (s n ω) (t n ω) (v n) (Rₙ n)} := by + let H (n : ℕ) : Set Ω := {ω | ω ∈ G n ∧ + ∃ J ∈ I, γ ω '' Icc J.1 J.2 ⊆ K ∧ s n ω ≤ J.1 ∧ J.2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc J.1 J.2)} + have hH : ∀ᶠ n in atTop, ENNReal.ofReal q ≤ P (H n) := by + filter_upwards [hG, hretain] with n hn hr + have he : H n =ᵐ[P] G n := by + filter_upwards [hr] with ω hω + exact propext ⟨fun h => h.1, fun h => ⟨h, hω h⟩⟩ + simpa only [measure_congr he] using hn + have hr : ∀ᶠ n in atTop, ∀ ω, ω ∈ H n → + ∃ J ∈ I, γ ω '' Icc J.1 J.2 ⊆ K ∧ s n ω ≤ J.1 ∧ J.2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc J.1 J.2) := + Eventually.of_forall fun _ _ hω => hω.2 + obtain ⟨a, ha, hm⟩ := compact_conformal_stopped_passage_mass P κ hκ hκ8 γ hSLE + Fₙ F hFn hinj hF hne hconv K hK hKn hKH R hR himage I hI v hv hlim + η s t Rₙ H q hq hH hregion hr + refine ⟨a, ha, ?_⟩ + filter_upwards [hm] with n hn + exact hn.trans (measure_mono fun _ hω => ⟨hω.1.1, hω.2⟩) + +/-- Countable compact/time certificates are extracted before choosing the +common mesh. The selected intervals lie before the actual passage stop. -/ +theorem countable_compact_conformal_stopped_passage_mass + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (hSLE : IsOrdinaryChordalSLE κ γ P) + (Fₙ : ℕ → ℂ → ℂ) (F : ℂ → ℂ) + (hFn : ∀ n, DifferentiableOn ℂ (Fₙ n) upperHalfPlane) + (hinj : ∀ n, InjOn (Fₙ n) upperHalfPlane) + (hF : DifferentiableOn ℂ F upperHalfPlane) + (hne : ∀ z ∈ upperHalfPlane, deriv F z ≠ 0) + (hconv : TendstoLocallyUniformlyOn Fₙ F atTop upperHalfPlane) + (K : ℕ → Set ℂ) (hK : ∀ i, IsCompact (K i)) (hKH : ∀ i, K i ⊆ upperHalfPlane) + (R : Set ℂ) (hR : IsOpen R) (himage : ∀ i, F '' K i ⊆ R) + (J : ℕ → ℝ≥0 × ℝ≥0) (hJ : ∀ i, (J i).1 < (J i).2) + (E : Set Ω) (D : ℕ → Set Ω) (hE : MeasurableSet E) (hD : ∀ i, MeasurableSet (D i)) + (hcover : P (E \ ⋃ i, D i) = 0) + (hretain : ∀ i ω, ω ∈ D i → γ ω '' Icc (J i).1 (J i).2 ⊆ K i) + (v : ℕ → ℝ) (hv : ∀ n, 0 < v n) (hlim : Tendsto v atTop (𝓝 0)) + (η : ℕ → Ω → ℝ≥0 → ℂ) (s t : ℕ → Ω → ℝ≥0) (Rₙ : ℕ → Set ℂ) + (hregion : ∀ᶠ n in atTop, R ⊆ Rₙ n) + (G : ℕ → Set Ω) (q : ℝ) (hq : 0 < q) + (hG : ∀ n, ENNReal.ofReal q ≤ P (G n ∩ E)) + (hwindow : ∀ i, ∀ᶠ n in atTop, ∀ ω, ω ∈ G n ∩ E ∩ D i → + s n ω ≤ (J i).1 ∧ (J i).2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc (J i).1 (J i).2)) : + ∃ a : ℝ, 0 < a ∧ ∀ᶠ n in atTop, + ENNReal.ofReal (q / 4) ≤ P {ω | ω ∈ G n ∩ E ∧ ENNReal.ofReal a ≤ + segmentSausageCharge κ (η n ω) (s n ω) (t n ω) (v n) (Rₙ n)} := by + classical + obtain ⟨N, hN⟩ := varying_events_after_finite_retention P E D G hE hD hcover q hq hG + let A := ⋃ i ∈ Finset.range N, D i + let Q := ⋃ i ∈ Finset.range N, K i + let H : ℕ → Set Ω := fun n => G n ∩ E ∩ A + have hQ : IsCompact Q := (Finset.range N).isCompact_biUnion (fun i _ => hK i) + have hQH : Q ⊆ upperHalfPlane := iUnion₂_subset (fun i _ => hKH i) + have hQR : F '' Q ⊆ R := by + rintro w ⟨z, hz, rfl⟩ + obtain ⟨i, _, hi⟩ := mem_iUnion₂.mp hz + exact himage i (mem_image_of_mem F hi) + have hQn : Q.Nonempty := by + have hHpos : 0 < P (H 0) := (ENNReal.ofReal_pos.mpr (by positivity : 0 < q / 2)).trans_le (hN 0) + obtain ⟨ω, hω⟩ := nonempty_of_measure_ne_zero hHpos.ne' + obtain ⟨i, hi, hDi⟩ := mem_iUnion₂.mp hω.2 + exact ⟨γ ω (J i).1, mem_iUnion₂.mpr ⟨i, hi, + hretain i ω hDi (mem_image_of_mem (γ ω) ⟨le_rfl, (hJ i).le⟩)⟩⟩ + let I := (Finset.range N).image J + have hI : ∀ L ∈ I, L.1 < L.2 := by + intro L hL + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hL + exact hJ i + have hwin : ∀ᶠ n in atTop, ∀ i ∈ Finset.range N, ∀ ω, ω ∈ G n ∩ E ∩ D i → + s n ω ≤ (J i).1 ∧ (J i).2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc (J i).1 (J i).2) := + (Finset.eventually_all _).mpr (fun i _ => hwindow i) + have hr : ∀ᶠ n in atTop, ∀ ω, ω ∈ H n → + ∃ L ∈ I, γ ω '' Icc L.1 L.2 ⊆ Q ∧ s n ω ≤ L.1 ∧ L.2 ≤ t n ω ∧ + EqOn (η n ω) (fun u => Fₙ n (γ ω u)) (Icc L.1 L.2) := by + filter_upwards [hwin] with n hn + intro ω hω + obtain ⟨i, hi, hDi⟩ := mem_iUnion₂.mp hω.2 + exact ⟨J i, Finset.mem_image.mpr ⟨i, hi, rfl⟩, + (hretain i ω hDi).trans (subset_iUnion₂_of_subset i hi Subset.rfl), + hn i hi ω ⟨hω.1, hDi⟩⟩ + obtain ⟨a, ha, hmass⟩ := compact_conformal_stopped_passage_mass P κ hκ hκ8 γ hSLE + Fₙ F hFn hinj hF hne hconv Q hQ hQn hQH R hR hQR I hI v hv hlim + η s t Rₙ H (q / 2) (by positivity) (Eventually.of_forall hN) hregion hr + refine ⟨a, ha, ?_⟩ + filter_upwards [hmass] with n hn + have hqq : q / 2 / 2 = q / 4 := by ring + rw [hqq] at hn + exact hn.trans (measure_mono (fun _ hω => ⟨hω.1.1, hω.2⟩)) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/StoppedInverseMass.lean b/lean/OAI/Probability/SLE/Mass/StoppedInverseMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f4ae26ea92a6f5046202a96c1cb225e8ec5375c --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/StoppedInverseMass.lean @@ -0,0 +1,105 @@ +import OAI.Probability.SLE.Geometry.RestartDerivativeMeasurability +import OAI.Probability.SLE.Geometry.CanonicalRawMean +import OAI.Probability.SLE.Mass.WeightedImageRandomMass + +namespace OAI + +/-! Actual stopped inverse-Loewner transport of the fresh raw terminal +mass, with measurable charts, derivative weights and exact spatial tests. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.Multipoint + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace +local instance : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) + (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (τ : Ω → ℝ≥0) + +def stoppedMassPoint (ω : Ω) (z : upperHalfPlane) : upperHalfPlane := + ⟨F ω (τ ω) ((z:ℂ)+(Real.sqrt κ*B (τ ω) ω:ℝ)), + ((hw ω).2.2.2.2.2.2.1 (τ ω) (by + simpa only [upperHalfPlane,mem_ofPred_eq,Complex.add_im,Complex.ofReal_im,add_zero] + using z.property)).1.1⟩ + +def stoppedMassWeight (ω : Ω) (z : upperHalfPlane) : ℝ≥0∞ := + ENNReal.ofReal (‖deriv (F ω (τ ω)) ((z:ℂ)+(Real.sqrt κ*B (τ ω) ω:ℝ))‖^dimension κ) + +variable (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (hτ : IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (τ ω:WithTop ℝ≥0))) + +include hm hc hτ γ G hw + +theorem stoppedMassPoint_measurable : Measurable[hτ.measurableSpace.prod inferInstance] + (fun p : Ω × upperHalfPlane => stoppedMassPoint B κ γ G F hw τ p.1 p.2) := by + unfold stoppedMassPoint + apply Measurable.subtype_mk + exact continuous_eval.measurable.comp + (((source_stopped_inversePath_measurable B hm hc κ γ G F hw τ hτ).comp + measurable_fst).prodMk measurable_snd) + +theorem stoppedMassWeight_measurable (hκ : 0 < κ) : + Measurable[hτ.measurableSpace.prod inferInstance] + (fun p : Ω × upperHalfPlane => stoppedMassWeight B κ F τ p.1 p.2) := by + let : MeasurableSpace (Ω × upperHalfPlane) := hτ.measurableSpace.prod inferInstance + have hd := source_stopped_inverse_derivative_measurable B hm hc κ γ G F hw τ hτ + have he : 0 ≤ dimension κ := by unfold dimension; linarith + exact ((Real.continuous_rpow_const he).measurable.comp hd.norm).ennreal_ofReal + +omit hm hτ in +def stoppedFreshTerminalMass (R : RawCanonicalMass) (ω : Ω) : Measure upperHalfPlane := + weightedImageMass (stoppedMassPoint B κ γ G F hw τ ω) (stoppedMassWeight B κ F τ ω) + (R.terminal (sourceRestartDriverPath B hc τ ω)) + +theorem stoppedFreshTerminalMass_measurable (hκ : 0 < κ) (R : RawCanonicalMass) : + Measurable (stoppedFreshTerminalMass B κ γ G F hw τ hc R) := by + have hY : Measurable (sourceRestartDriverPath B hc τ) := source_path_measurable _ + (fun t => (measurable_pi_apply t).comp + (brownianRestart_measurable hm hc (stopping_time_measurable_nnreal hτ))) + have hM := @weightedImageMass_measurable_of_subsigma Ω upperHalfPlane mΩ inferInstance + hτ.measurableSpace hτ.measurableSpace_le + (fun ω => R.terminal (sourceRestartDriverPath B hc τ ω)) + (R.terminal_measurable.comp hY) (fun ω => (R.terminal_radon _).2) + (fun p => stoppedMassPoint B κ γ G F hw τ p.1 p.2) + (stoppedMassPoint_measurable B κ γ G F hw τ hm hc hτ) + (fun p => stoppedMassWeight B κ F τ p.1 p.2) + (stoppedMassWeight_measurable B κ γ G F hw τ hm hc hτ hκ) + exact hM + +theorem CanonicalMass.stoppedFreshTerminalMass_test + {P : Measure Ω} [IsProbabilityMeasure P] {hBm : Measurable (Function.uncurry B)} + (C : CanonicalMass P κ B hBm γ G) (hB : IsBrownianReal B P) (hκ : 0 < κ) + (R : RawCanonicalMass) + (he : ∀ᵐ ω ∂P, R.terminal (sourceDriverPath B hc ω) = C.rational.terminal ω) + (f : Ω × upperHalfPlane → ℝ≥0∞) + (hf : Measurable[hτ.measurableSpace.prod inferInstance] f) : + (∫⁻ ω, ∫⁻ x, f (ω,x) ∂(stoppedFreshTerminalMass B κ γ G F hw τ hc R ω) ∂P) = + ∫⁻ ω, ∫⁻ z, stoppedMassWeight B κ F τ ω z * + f (ω,stoppedMassPoint B κ γ G F hw τ ω z) ∂initialGreenMeasure κ ∂P := by + have hp : Measurable (sourceDriverPath B hc) := source_path_measurable _ hm + let : IsProbabilityMeasure (P.map (sourceDriverPath B hc)) := + (Measure.isProbabilityMeasure_map_iff hp.aemeasurable).mpr inferInstance + have hY : Measurable (sourceRestartDriverPath B hc τ) := source_path_measurable _ + (fun t => (measurable_pi_apply t).comp + (brownianRestart_measurable hm hc (stopping_time_measurable_nnreal hτ))) + have h := restart_weighted_mass_test P (P.map (sourceDriverPath B hc)) + hτ.measurableSpace hτ.measurableSpace_le (sourceRestartDriverPath B hc τ) hY + (fun A hA => source_restart_continuous_driver_law hB hm hc τ hτ hA) + R.terminal R.terminal_measurable (fun p => (R.terminal_radon p).2) _ + (stoppedMassPoint_measurable B κ γ G F hw τ hm hc hτ) _ + (stoppedMassWeight_measurable B κ γ G F hw τ hm hc hτ hκ) f hf + rwa [C.raw_terminal_mean hc R he] at h + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/StrictPastMass.lean b/lean/OAI/Probability/SLE/Mass/StrictPastMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..078893f86791f8da06e1a612b96efb3cb9498354 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/StrictPastMass.lean @@ -0,0 +1,76 @@ +import OAI.Probability.SLE.Mass.CanonicalMassFirstVisit + +namespace OAI + +/-! The expected terminal mass arriving strictly after a deterministic past +is its current Green mass, including arbitrary events in that past. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Multipoint.CanonicalMass + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {κ : ℝ} {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + +lemma strict_past_mass_kernel + (C : CanonicalMass P κ B hBm γ G) (hB : IsBrownianReal B P) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (hκ : 0<κ) (hκ8 : κ<8) (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (t : ℝ≥0) (E : Set Ω) + (hE : MeasurableSet[(Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable)) t] E) + (K : Set upperHalfPlane) (hK : IsCompact K) : + (∫⁻ ω in E, C.rational.terminal ω + (K \ {z : upperHalfPlane | (z:ℂ)∈γ ω '' Icc 0 t}) ∂P)= + ∫⁻ ω in E, halfPlaneGreenMeasure κ B γ G t ω K ∂P := by + let ℱ := Filtration.natural B (fun s => + (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B s)).stronglyMeasurable) + have hNm : Measurable (C.process t) := by + simpa only [atTime,extendedCanonicalMass,ENNReal.coe_lt_top,ite_true,ENNReal.toNNReal_coe] + using C.atTime_measurable (fun _ => (t:ℝ≥0∞)) measurable_const + have hNG : Measurable (fun ω => C.process t ω K) := + (Measure.measurable_coe hK.measurableSet).comp hNm + have hGm := halfPlaneGreenMeasure_measurable hBm hc κ γ G F hw t + have hp : ∀ᵐ ω ∂P, C.process t ω=(C.rational.terminal ω).restrict + {z : upperHalfPlane | (z:ℂ)∈γ ω '' Icc 0 t} := by + simpa only [atTime,extendedCanonicalMass,ENNReal.coe_lt_top,ite_true,ENNReal.toNNReal_coe] + using C.atTime_eq_restrict_past hB hBm hc h0 hκ hκ8 F hw t + have hdecomp : (∫⁻ ω in E, C.rational.terminal ω K ∂P)= + (∫⁻ ω in E, C.process t ω K ∂P)+ + ∫⁻ ω in E, C.rational.terminal ω + (K \ {z : upperHalfPlane | (z:ℂ)∈γ ω '' Icc 0 t}) ∂P := by + rw [← lintegral_add_left hNG] + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae hp] with ω hω + rw [hω,Measure.restrict_apply hK.measurableSet] + exact (measure_inter_add_sdiff K + (((isCompact_Icc.image (hw ω).1).isClosed.preimage continuous_subtype_val).measurableSet)).symm + have hS : IsStoppingTime ℱ (fun _ : Ω => (t:WithTop ℝ≥0)) := isStoppingTime_const ℱ t + have hEs : MeasurableSet[hS.measurableSpace] E := by + change MeasurableSet[(isStoppingTime_const ℱ t).measurableSpace] E + rw [IsStoppingTime.measurableSpace_const] + exact hE + have hk := congrArg (fun μ : Measure upperHalfPlane => μ K) (C.kernel _ hS E hEs) + change ((P.restrict E).bind C.rational.terminal) K= + (((P.restrict E).bind (C.process t))+((P.restrict E).bind (halfPlaneGreenMeasure κ B γ G t))) K at hk + rw [Measure.add_apply,Measure.bind_apply hK.measurableSet C.rational.terminal_measurable.aemeasurable, + Measure.bind_apply hK.measurableSet hNm.aemeasurable, + Measure.bind_apply hK.measurableSet hGm.aemeasurable] at hk + have hfin : (∫⁻ ω in E, C.process t ω K ∂P)≠∞ := by + let : IsFiniteMeasureOnCompacts (initialGreenMeasure κ) := initialGreenMeasure_finite_on_compacts κ + have hb := C.atTime_mean_le (fun _ => (t:ℝ≥0∞)) measurable_const E K + change ((P.restrict E).bind (C.process t)) K ≤ initialGreenMeasure κ K at hb + rw [Measure.bind_apply hK.measurableSet hNm.aemeasurable] at hb + exact (hb.trans_lt hK.measure_lt_top).ne + apply (ENNReal.add_right_inj hfin).mp + simpa only [add_comm] using hdecomp.symm.trans hk + +end SLEExactGauge.Multipoint.CanonicalMass + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/SubSigmaRadonLimit.lean b/lean/OAI/Probability/SLE/Mass/SubSigmaRadonLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3c9b85ae68edcf5c41d6d2b083485293c71de2a --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/SubSigmaRadonLimit.lean @@ -0,0 +1,88 @@ +import OAI.Probability.SLE.Mass.RandomRadonLimit +import OAI.Probability.SLE.Mass.RadonTestFamily + +namespace OAI + +/-! A vague Radon limit has a version measurable in the same sigma-algebra +as its approximants. The probability measure may use a larger sigma-algebra; +the exceptional convergence set is detected by countably many tests. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped Topology CompactlySupported + +namespace SLEExactGauge + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +theorem exists_subsigma_radon_version_identified + {Ω : Type*} (m : MeasurableSpace Ω) (μ : ℕ → Ω → Measure X) + (hfinite : ∀ n ω, IsFiniteMeasureOnCompacts (μ n ω)) + (hmeas : ∀ n (f : C_c(X,ℝ)), Measurable[m] (fun ω => ∫ x, f x ∂μ n ω)) : + ∃ η : Ω → Measure X, Measurable[m] η ∧ + (∀ ω, (η ω).Regular ∧ IsFiniteMeasureOnCompacts (η ω)) ∧ + ∀ ω (ν : Measure X), ν.Regular → + (∀ f : C_c(X,ℝ), Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν))) → + η ω = ν := by + let : MeasurableSpace Ω := m + let D := localTestFamily X + let G : Set Ω := {ω | ∀ j, ∃ a : ℝ, + Tendsto (fun n => ∫ x, D.test j x ∂μ n ω) atTop (𝓝 a)} + have hG : MeasurableSet[m] G := by + let : MeasurableSpace Ω := m + simpa only [G,Set.ofPred_forall] using MeasurableSet.iInter + (fun j => measurableSet_exists_tendsto (fun n => hmeas n (D.test j))) + have hex (ω : Ω) : ∃ η : Measure X, η.Regular ∧ + ∀ f : C_c(X,ℝ), Tendsto + (fun n => if ω ∈ G then ∫ x, f x ∂μ n ω else 0) atTop (𝓝 (∫ x, f x ∂η)) := by + by_cases hω : ω ∈ G + · let (n : ℕ) : IsFiniteMeasureOnCompacts (μ n ω) := hfinite n ω + obtain ⟨η,hη,_,hl⟩ := D.exists_radon_limit (fun n => μ n ω) hω + exact ⟨η,hη,fun f => by simpa only [ite_eq_left hω] using hl f⟩ + · refine ⟨0,inferInstance,fun f => ?_⟩ + simpa only [ite_eq_right hω,integral_zero_measure] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:ℝ)) atTop (𝓝 0)) + choose η hηr hηlim using hex + have hηm : Measurable[m] η := by + let : MeasurableSpace Ω := m + apply measurable_radon_of_tests η hηr + intro f + apply measurable_of_tendsto_metrizable + (f := fun n ω => if ω ∈ G then ∫ x, f x ∂μ n ω else 0) + · intro n + exact (hmeas n f).ite hG measurable_const + · exact tendsto_pi_nhds.mpr (fun ω => hηlim ω f) + refine ⟨η,hηm,fun ω => ?_,?_⟩ + · let := hηr ω + exact ⟨hηr ω,inferInstance⟩ + · intro ω ν hr hl + have hg : ω ∈ G := fun j => ⟨∫ x, D.test j x ∂ν,hl (D.test j)⟩ + let := hηr ω + let := hr + apply radon_test_limit_unique (fun n => μ n ω) (η ω) ν + · intro f + simpa only [ite_eq_left hg] using hηlim ω f + · exact hl + +theorem exists_subsigma_radon_version + {Ω : Type*} [mΩ : MeasurableSpace Ω] (m : MeasurableSpace Ω) (P : @Measure Ω mΩ) + (μ : ℕ → Ω → Measure X) (ν : Ω → Measure X) + (hfinite : ∀ n ω, IsFiniteMeasureOnCompacts (μ n ω)) + (hmeas : ∀ n (f : C_c(X,ℝ)), Measurable[m] (fun ω => ∫ x, f x ∂μ n ω)) + (hν : ∀ᵐ ω ∂P, (ν ω).Regular) + (hlim : ∀ᵐ ω ∂P, ∀ f : C_c(X,ℝ), + Tendsto (fun n => ∫ x, f x ∂μ n ω) atTop (𝓝 (∫ x, f x ∂ν ω))) : + ∃ η : Ω → Measure X, Measurable[m] η ∧ + (∀ ω, (η ω).Regular ∧ IsFiniteMeasureOnCompacts (η ω)) ∧ η =ᵐ[P] ν := by + obtain ⟨η,hm,hr,he⟩ := exists_subsigma_radon_version_identified m μ hfinite hmeas + refine ⟨η,hm,hr,?_⟩ + filter_upwards [hν,hlim] with ω hν hlim + exact he ω (ν ω) hν hlim + + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/TargetDiscreteMassRecovery.lean b/lean/OAI/Probability/SLE/Mass/TargetDiscreteMassRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..052ebf993a04278ea850ca62555bca7af12d7379 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/TargetDiscreteMassRecovery.lean @@ -0,0 +1,71 @@ +import OAI.Probability.SLE.Mass.MassCompensatorRecovery +import OAI.Probability.SLE.Gauge.MomentCoefficientConvergence + +namespace OAI + +/-! The exact finite sum in the prescribed coefficient formula agrees +with the stopped predictable compensator once its potential increments +have been identified. The endpoint is allowed to be infinite. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma compensator_before_extended_sum (n : ℕ) (T : ℝ≥0∞) (q : ℕ → ℝ) : + (∑ i ∈ Finset.range (n*2^n), + if (compensatorMeshTime n (i+1):ℝ≥0∞) ≤ T then q i else 0) = + ∑ i ∈ Finset.range (compensatorStopIndex n T), q i := by + by_cases hT : T=∞ + · simp [hT,compensatorStopIndex] + · have he : T=(T.toNNReal:ℝ≥0∞) := (ENNReal.coe_toNNReal hT).symm + conv_lhs => rw [he] + simp only [ENNReal.coe_le_coe] + rw [compensator_before_sum,compensatorStopIndex,ite_eq_right hT] + +lemma target_mesh_time (n i : ℕ) : + ENNReal.ofReal (((i:ℝ)+1)*Target.mesh n) = + (compensatorMeshTime n (i+1):ℝ≥0∞) := by + have he : (compensatorMeshTime n (i+1):ℝ)=((i:ℝ)+1)*Target.mesh n := by + simp [compensatorMeshTime,Target.mesh] + rw [← he,ENNReal.ofReal_coe_nnreal] + +lemma target_discreteMass_eq_sum (κ θ : ℝ) (W : Target.WienerLaw) + (b : Target.Driver) (ℓ : ℝ) (n : ℕ) : + Target.discreteMass κ θ W b ℓ n = + ∑ i ∈ Finset.range (compensatorStopIndex n (Target.levelTime κ θ b ℓ)), + Target.potentialDifference κ θ W b n i := by + unfold Target.discreteMass + simp_rw [target_mesh_time] + exact compensator_before_extended_sum n _ _ + +theorem target_discreteMass_tendstoInMeasure + {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (κ θ : ℝ) (W : Target.WienerLaw) (b : Ω → Target.Driver) (ℓ : ℝ) + (ℱ : ℕ → Filtration ℕ mΩ) (A : ℝ≥0 → Ω → ℝ) (L : Ω → ℝ) + (hA : ∀ t, Measurable (A t)) + (hgrid : ∀ n i, StronglyMeasurable[ℱ n i] (A (compensatorMeshTime n i))) + (hL : MemLp L 2 P) + (hp : ∀ᵐ ω ∂P, Monotone (fun t => A t ω) ∧ A 0 ω=0 ∧ + Continuous (fun t => A t ω) ∧ Tendsto (fun t => A t ω) atTop (𝓝 (L ω)) ∧ + ∀ t, A t ω ≤ L ω) + (hT : Measurable (fun ω => Target.levelTime κ θ (b ω) ℓ)) + (hq : ∀ n i, (fun ω => Target.potentialDifference κ θ W (b ω) n i) =ᵐ[P] + condExp (ℱ n i) P (meshMassIncrement A n i)) : + TendstoInMeasure P (fun n ω => Target.discreteMass κ θ W (b ω) ℓ n) atTop + (fun ω => massAtExtendedTime (fun t => A t ω) (L ω) + (Target.levelTime κ θ (b ω) ℓ)) := by + have h := meshMassCompensator_stopped_tendstoInMeasure P ℱ A L hA hgrid hL hp + (fun ω => Target.levelTime κ θ (b ω) ℓ) hT + apply h.congr _ (Filter.EventuallyEq.refl _ _) + intro n + filter_upwards [ae_all_iff.mpr (hq n)] with ω hω + rw [target_discreteMass_eq_sum] + exact Finset.sum_congr rfl (fun i _ => (hω i).symm) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/TerminalMassTestLimit.lean b/lean/OAI/Probability/SLE/Mass/TerminalMassTestLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..52cf03d05104dac38dfab235162341e0b579ae3b --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/TerminalMassTestLimit.lean @@ -0,0 +1,57 @@ +import OAI.Probability.SLE.Mass.CanonicalMassExhaustion + +namespace OAI + +/-! Local exhaustion implies convergence of every compact continuous test. +This provides the terminal value of the fixed raw driver functional. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge + +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +lemma compact_test_norm_le_mass (μ : Measure upperHalfPlane) + [IsFiniteMeasureOnCompacts μ] (f : C_c(upperHalfPlane,ℝ)) : + ‖∫ z, f z ∂μ‖ ≤ ‖f.toBoundedContinuousFunction‖ * (μ (tsupport f)).toReal := by + let : IsFiniteMeasure (μ.restrict (tsupport f)) := + ⟨by simpa only [Measure.restrict_apply_univ] using f.hasCompactSupport.measure_lt_top (μ := μ)⟩ + have he := setIntegral_eq_integral_of_forall_compl_eq_zero (μ := μ) + (s := tsupport f) (fun z hz => image_eq_zero_of_notMem_tsupport hz) + rw [← he] + have hb : ∀ᵐ z ∂μ.restrict (tsupport f), ‖f z‖ ≤ ‖f.toBoundedContinuousFunction‖ := + ae_of_all _ (fun z => f.toBoundedContinuousFunction.norm_coe_le_norm z) + have h := norm_integral_le_of_norm_le_const hb + simpa only [Measure.real,Measure.restrict_apply_univ] using h + +theorem terminal_mass_test_tendsto + (ν : Measure upperHalfPlane) [ν.Regular] + (N : ℝ≥0 → Measure upperHalfPlane) (hNr : ∀ t, (N t).Regular) + (hdom : ∀ t, N t ≤ ν) + (hlim : ∀ K : Set upperHalfPlane, IsCompact K → + Tendsto (fun t : ℝ≥0 => (ν-N t) K) atTop (𝓝 0)) + (f : C_c(upperHalfPlane,ℝ)) : + Tendsto (fun t : ℝ≥0 => ∫ z, f z ∂N t) atTop (𝓝 (∫ z, f z ∂ν)) := by + let (t : ℝ≥0) : IsFiniteMeasureOnCompacts (ν-N t) := + ⟨fun K hK => lt_of_le_of_lt (Measure.sub_le K) hK.measure_lt_top⟩ + have hrem : Tendsto (fun t : ℝ≥0 => ∫ z, f z ∂(ν-N t)) atTop (𝓝 0) := by + apply squeeze_zero_norm (fun t => compact_test_norm_le_mass (ν-N t) f) + have hh := (ENNReal.continuousAt_toReal ENNReal.zero_ne_top).tendsto.comp + (hlim (tsupport f) f.hasCompactSupport) + simpa only [Function.comp_def,ENNReal.toReal_zero,mul_zero] using + (tendsto_const_nhds (x := ‖f.toBoundedContinuousFunction‖)).mul hh + have he (t : ℝ≥0) : (∫ z, f z ∂ν)-(∫ z, f z ∂(ν-N t)) = ∫ z, f z ∂N t := by + let := hNr t + have : (ν-N t).Regular := inferInstance + have hsum := integral_add_measure (μ := ν-N t) (ν := N t) f.integrable f.integrable + rw [sigmaFinite_sub_add_cancel_of_le (hdom t)] at hsum + linarith + simpa only [he,sub_zero] using (tendsto_const_nhds (x := ∫ z, f z ∂ν)).sub hrem + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/UniformCoverLevels.lean b/lean/OAI/Probability/SLE/Mass/UniformCoverLevels.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd7799176916c5b29c9a73d75e68f2d7144ff8f0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/UniformCoverLevels.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SLE.Gauge.CoverRadiusLevels +import OAI.Probability.SLE.Gauge.CoverGrid + +namespace OAI + +/-! Uniform clock geometry over the moving grid centers retained above a +fixed positive height. The terminal visit level is separated from every +test endpoint by a full clock unit. -/ + +noncomputable section +open Set Filter +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +def coverVisitLevel (z : ℂ) (T : ℝ) (n : ℕ) : ℝ := + Real.log (2 * z.im) + T * (n : ℝ) - Real.log (512 * Real.pi) + +/-- One deterministic cutoff works for every point above the retained height +and every test index, including the endpoint after the last test. -/ +theorem eventually_uniform_cover_levels {T η : ℝ} (hT : 0 < T) (hη : 0 < η) : + ∀ᶠ n : ℕ in atTop, ∀ z : ℂ, η / 2 ≤ z.im → + (∀ j : ℕ, n / 3 ≤ j → + coverLogLevel z T j = Real.log (2 * z.im) + T * (j : ℝ)) ∧ + coverLogLevel z T (2 * n / 3 + 1) + 1 ≤ coverVisitLevel z T n ∧ + 4 * coverRadius T n ≤ z.im := by + obtain ⟨N, hN⟩ := exists_nat_gt (-Real.log η / T) + have hNT : -Real.log η < T * (N : ℝ) := by + simpa only [mul_comm] using (div_lt_iff₀ hT).mp hN + have hlarge : ∀ᶠ n : ℕ in atTop, + 3 * (Real.log (512 * Real.pi) + 1 + T) / T ≤ (n : ℝ) := + tendsto_natCast_atTop_atTop.eventually (eventually_ge_atTop _) + have hlim : Tendsto (fun n => 4 * coverRadius T n) atTop (𝓝 0) := by + simpa only [mul_zero] using (coverRadius_tendsto_zero hT).const_mul 4 + have hsmall : ∀ᶠ n : ℕ in atTop, 4 * coverRadius T n < η / 2 := + hlim.eventually (gt_mem_nhds (half_pos hη)) + filter_upwards [eventually_ge_atTop (3 * N), hlarge, hsmall] with n hn hnlarge hnsmall + intro z hz + have hlog : Real.log η ≤ Real.log (2 * z.im) := + Real.log_le_log hη (by linarith) + have hlevels : ∀ j : ℕ, n / 3 ≤ j → + coverLogLevel z T j = Real.log (2 * z.im) + T * (j : ℝ) := by + intro j hj + have hjN : N ≤ j := by omega + have hNj : T * (N : ℝ) ≤ T * (j : ℝ) := + mul_le_mul_of_nonneg_left (by exact_mod_cast hjN) hT.le + exact max_eq_right (by linarith) + refine ⟨hlevels, ?_, hnsmall.le.trans hz⟩ + rw [hlevels (2 * n / 3 + 1) (by omega)] + have hlast : 3 * (2 * n / 3 + 1) ≤ 2 * n + 3 := by omega + have hlastR : (3 : ℝ) * (2 * n / 3 + 1 : ℕ) ≤ 2 * n + 3 := by exact_mod_cast hlast + have hnT := (div_le_iff₀ hT).mp hnlarge + unfold coverVisitLevel + nlinarith + +lemma coverVisitLevel_nonneg_of_gap (z : ℂ) (T : ℝ) (n : ℕ) + (hgap : coverLogLevel z T (2 * n / 3 + 1) + 1 ≤ coverVisitLevel z T n) : + 0 ≤ coverVisitLevel z T n := by + have h0 := coverLogLevel_nonneg z T (2 * n / 3 + 1) + linarith + +/-- The late visit level is the fixed multiple `512π r_n` of the fine mesh, +independently of the varying center's height. -/ +lemma coverVisitLevel_radius (z : ℂ) (hz : 0 < z.im) (T : ℝ) (n : ℕ) : + (2 * z.im) * Real.exp (-coverVisitLevel z T n) = + (512 * Real.pi) * coverRadius T n := by + have hz2 : 0 < 2 * z.im := by positivity + have hM : 0 < 512 * Real.pi := by positivity + have he : -coverVisitLevel z T n = Real.log (512 * Real.pi) + + (-Real.log (2 * z.im) + -T * (n : ℝ)) := by + unfold coverVisitLevel + ring + unfold coverRadius + rw [he, Real.exp_add, Real.exp_add, + Real.exp_log hM, Real.exp_neg, Real.exp_log hz2] + field_simp [hz2.ne'] + +/-- The exact test window inherits the common late-grid cutoff. -/ +theorem eventually_uniform_cover_window_levels {T η : ℝ} (hT : 0 < T) (hη : 0 < η) : + ∀ᶠ n : ℕ in atTop, ∀ z : ℂ, η / 2 ≤ z.im → + (∀ j ∈ coverTestWindow n, + coverLogLevel z T j = Real.log (2 * z.im) + T * (j : ℝ)) ∧ + coverLogLevel z T (2 * n / 3 + 1) = + Real.log (2 * z.im) + T * ((2 * n / 3 + 1 : ℕ) : ℝ) ∧ + coverLogLevel z T (2 * n / 3 + 1) + 1 ≤ coverVisitLevel z T n ∧ + 4 * coverRadius T n ≤ z.im := by + filter_upwards [eventually_uniform_cover_levels hT hη] with n hn + intro z hz + obtain ⟨hlevel, hgap, hsmall⟩ := hn z hz + exact ⟨fun j hj => hlevel j (Finset.mem_Icc.mp hj).1, + hlevel _ (by omega), hgap, hsmall⟩ + +/-- In particular the changing retained grid centers satisfy all clock and +visit geometry simultaneously; no center-dependent cutoff is required. -/ +theorem eventually_retained_grid_cover_levels {R T η : ℝ} {K : Set ℂ} + (hT : 0 < T) (hη : 0 < η) (hK : K ⊆ Metric.closedBall 0 R) + (hheight : ∀ z ∈ K, η ≤ z.im) : + ∀ᶠ n : ℕ in atTop, ∀ ij ∈ retainedCoverGridIndex R (coverRadius T n) K, + let z := coverGridCenter (coverRadius T n) ij + z ∈ upperHalfPlane ∧ + (∀ j ∈ coverTestWindow n, + coverLogLevel z T j = Real.log (2 * z.im) + T * (j : ℝ)) ∧ + coverLogLevel z T (2 * n / 3 + 1) = + Real.log (2 * z.im) + T * ((2 * n / 3 + 1 : ℕ) : ℝ) ∧ + coverLogLevel z T (2 * n / 3 + 1) + 1 ≤ coverVisitLevel z T n ∧ + 4 * coverRadius T n ≤ z.im := by + have hsmall := (coverRadius_tendsto_zero hT).eventually (gt_mem_nhds (show 0 < η / 4 by positivity)) + filter_upwards [eventually_uniform_cover_window_levels hT hη, hsmall] with n hn hnr + intro ij hij + have hcenter := (retainedCoverGrid_center_bounds hK hheight hij).2 + have hz : η / 2 ≤ (coverGridCenter (coverRadius T n) ij).im := by linarith + exact ⟨lt_of_lt_of_le (half_pos hη) hz, hn _ hz⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/VerticalDisplacementMass.lean b/lean/OAI/Probability/SLE/Mass/VerticalDisplacementMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe80f0e18f8a637fdde5f7652086f4290bf4de9d --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/VerticalDisplacementMass.lean @@ -0,0 +1,31 @@ +import OAI.Probability.SLE.Loewner.HalfPlaneDisplacementBound + +namespace OAI + +/-! Reading the hydrodynamic mass from a vertical displacement bound. -/ +noncomputable section +open Set Filter Complex +open scoped Topology + +namespace SLEExactGauge + +lemma hydrodynamic_mass_le_of_displacement {f : ℂ → ℂ} {a b : ℝ} + (hcoef : Tendsto (fun z : ℂ => z*f z) + (cocompact ℂ ⊓ 𝓟 upperHalfPlane) (𝓝 (-a:ℂ))) + (hbound : ∀ z∈upperHalfPlane, ‖f z‖≤b/z.im) : a≤b := by + apply le_of_tendsto (hydrodynamic_vertical_limits hcoef).2 + apply Eventually.of_forall + intro n + have hi := (Complex.im_le_norm (f (verticalInfinity n))).trans + (hbound _ (verticalInfinity_mem n)) + have hy : 0<(n:ℝ)+1 := by positivity + have hb := (le_div_iff₀ hy).mp (show (f (verticalInfinity n)).im≤b/((n:ℝ)+1) from by + simpa only [verticalInfinity,mul_im,ofReal_re,I_im,mul_one,ofReal_im,I_re,mul_zero,add_zero] + using hi) + nlinarith + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/WaypointHarmonicMeasure.lean b/lean/OAI/Probability/SLE/Mass/WaypointHarmonicMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bc71e1ac8920510b3f916b833eea89941bf536a --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/WaypointHarmonicMeasure.lean @@ -0,0 +1,135 @@ +import OAI.Probability.SLE.Geometry.WaypointTubeGeometry +import OAI.Probability.SLE.Geometry.CrosscutExitSides +import OAI.Probability.SLE.Geometry.WaypointAngleNumerics + +namespace OAI + +/-! The actual two-sided physical route events bound the two half-plane +exit arcs from below. Uniform route support is proved elsewhere; only the +generic published conformal Brownian exit law is parameterized here. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.RibbonCoordinates +open Target CrosscutSides + +theorem finite_exit_event_measure_le_arc + (μ : Measure (Driver × Driver)) (D : Set ℂ) (g : ℂ → ℂ) (w : ℂ) + (h : ℂ ≃ₜ ℂ) (hreal : ∀ x : ℝ, h (x : ℂ) = (x : ℂ)) + (hg : ContinuousOn g D) (E : Set (Driver × Driver)) {dir : ℝ} + (hdir : dir = -1 ∨ dir = 1) + (hexit : ∀ᵐ b ∂μ, ∀ τ : ℝ, UnitWindowFirstExit D (physicalUnitBrownianPath w b) τ → + ∃ x : ℝ, x ≠ 0 ∧ Tendsto (fun t => g (physicalUnitBrownianPath w b t)) + (𝓝[<] τ) (𝓝 (x : ℂ))) + (hgeom : ∀ b ∈ E, ∃ τ : ℝ, + UnitWindowFirstExit D (physicalUnitBrownianPath w b) τ ∧ (1 / 4 : ℝ) < τ ∧ + ∀ t ∈ Ico (1 / 4 : ℝ) τ, (h (g (physicalUnitBrownianPath w b t))).re ≠ 0) + (hstart : ∀ b ∈ E, 0 < dir * (h (g (physicalUnitBrownianPath w b (1 / 4)))).re) : + μ E ≤ μ (unitWindowExitArc D g w dir) := by + apply measure_mono_ae + filter_upwards [hexit] with b hb + intro he + obtain ⟨τ, hτ, haτ, hn⟩ := hgeom b he + obtain ⟨x, hx, hlim⟩ := hb τ hτ + refine ⟨τ, hτ, x, ?_, hlim⟩ + have hs := hstart b he + rcases hdir with rfl | rfl + · have hxneg := negative_first_exit_belongs_to_arc D g h hreal hg + (physicalUnitBrownianPath w b) (physicalUnitBrownianPath_continuous w b) + hτ haτ hn (by nlinarith) x hx hlim + nlinarith + · have hxpos := positive_first_exit_belongs_to_arc D g h hreal hg + (physicalUnitBrownianPath w b) (physicalUnitBrownianPath_continuous w b) + hτ haτ hn (by simpa using hs) x hx hlim + simpa using hxpos + +theorem ribbon_tube_harmonic_bounds + (hopen : PublishedPlanarDiskOpenness) (hexitLaw : PublishedHalfPlaneConformalExitLaw) + (W : WienerLaw) (hW : IsWiener W) (K : ℝ≥0) (hK : 0 < (K : ℝ)) + (P : ℂ → ℂ) (hP : ContinuousOn P closedRibbon) (hi : InjOn P closedRibbon) + (hH : ∀ z ∈ closedRibbon, 0 < z.re → P z ∈ upperHalfPlane) + {k ε x : ℝ} (hk : 1 ≤ k) (hε : 0 < ε) (hεsmall : ε ≤ 1 / 8) + (hx : |x| ≤ 1 / 16) + (hlower : ∀ u ∈ crossingPatch k, ∀ v ∈ crossingPatch k, + dist u v ≤ K * dist (P u) (P v)) + (γ xp : ℝ≥0 → ℂ) (hγc : Continuous γ) (T : ℝ≥0) (hT : 0 < T) + (hxp : ContinuousOn xp (Icc 0 T)) (hγ : EqOn γ (P ∘ xp) (Icc 0 T)) + (hxp0 : (xp 0).re = 0) (hxpT : (xp T).re = k) + (hcoords : MapsTo xp (Icc 0 T) closedRibbon) + (hcore : ∀ t ∈ Icc 0 T, (xp t).re ≤ k ∧ |(xp t).im| ≤ ε) + (hunbounded : ¬ Bornology.IsBounded (P '' futureRibbon k)) + (g F : ℂ → ℂ) + (hg : DifferentiableOn ℂ g (survivingDomain γ T)) + (hF : DifferentiableOn ℂ F upperHalfPlane) + (hgH : MapsTo g (survivingDomain γ T) upperHalfPlane) + (hFD : MapsTo F upperHalfPlane (survivingDomain γ T)) + (hFg : ∀ z ∈ survivingDomain γ T, F (g z) = z) + (hgF : ∀ z ∈ upperHalfPlane, g (F z) = z) + (h : ℂ ≃ₜ ℂ) (hreal : ∀ x : ℝ, h (x : ℂ) = (x : ℂ)) + (hcut : ∀ z ∈ survivingDomain γ T, (h (g z)).re = 0 → + ∃ u : ℝ, 0 ≤ u ∧ P (guideCoordinate k x u) = z) + (hloc : ContinuousOn (fun z => h (g (P z))) + (ball ((k + 1 / 2 : ℝ) : ℂ) (1 / 4))) + (hloci : InjOn (fun z => h (g (P z))) + (ball ((k + 1 / 2 : ℝ) : ℂ) (1 / 4))) + (hlocz : ∀ z ∈ ball ((k + 1 / 2 : ℝ) : ℂ) (1 / 4), + (h (g (P z))).re = 0 ↔ z.im = 0) + (q : ℝ≥0∞) + (hprob : ∀ side : ℝ, (side = -1 ∨ side = 1) → + q ≤ (W.prod W) {b | ∀ t ∈ Icc (0 : ℝ) 3, + dist (physicalUnitBrownianPath (P ((k + 1 / 2 : ℝ) : ℂ)) b t) + (P (waypointRoute k side t)) < (1 / 32 : ℝ) / K}) : + q ≤ ENNReal.ofReal ((g (P ((k + 1 / 2 : ℝ) : ℂ))).arg / Real.pi) ∧ + q ≤ ENNReal.ofReal (1 - (g (P ((k + 1 / 2 : ℝ) : ℂ))).arg / Real.pi) := by + let D := survivingDomain γ T + let w := P ((k + 1 / 2 : ℝ) : ℂ) + let E := fun side : ℝ => {b | ∀ t ∈ Icc (0 : ℝ) 3, + dist (physicalUnitBrownianPath w b t) (P (waypointRoute k side t)) < (1 / 32 : ℝ) / K} + have hpast : γ '' Icc 0 T ⊆ P '' {z ∈ closedRibbon | z.re ≤ k} := by + rintro z ⟨s, hs, rfl⟩ + exact ⟨xp s, ⟨hcoords hs, (hcore s hs).1⟩, (hγ hs).symm⟩ + have hwD : w ∈ D := by + apply futureRibbon_survives P hP hi (by linarith) hH γ T hpast hunbounded + exact ⟨((k + 1 / 2 : ℝ) : ℂ), ⟨by simp, by simp⟩, rfl⟩ + obtain ⟨hae, hnegBound, hposBound⟩ := hexitLaw W hW D g F + (isOpen_survivingDomain hγc T) (fun z hz => hz.1.1) hg hF hgH hFD hFg hgF w hwD + obtain ⟨side, hside, hpos, hneg⟩ := physical_waypoint_tubes_opposite_sides hopen P hP hi + K hK hk hlower (fun z => h (g (P z))) (fun z => (h (g z)).re) + hloc hloci hlocz (fun _ _ => rfl) + have hgeom (side' : ℝ) (hside' : side' = -1 ∨ side' = 1) (b : Driver × Driver) + (hb : b ∈ E side') : ∃ τ : ℝ, + UnitWindowFirstExit D (physicalUnitBrownianPath w b) τ ∧ (1 / 4 : ℝ) < τ ∧ + ∀ t ∈ Ico (1 / 4 : ℝ) τ, (h (g (physicalUnitBrownianPath w b t))).re ≠ 0 := by + let ζ := physicalUnitBrownianPath w b + have hζ : Continuous ζ := physicalUnitBrownianPath_continuous w b + obtain ⟨hearly, havoid, hhit⟩ := physical_waypoint_tube_geometry hopen P hP hi hH K hK + hk hε hεsmall hx hside' hlower γ xp T hT hxp hγ hxp0 hxpT hcoords hcore hunbounded + ζ hζ hb + obtain ⟨τ, hτ, hout, hin⟩ := waypoint_first_exit_after_early_prefix γ hγc T ζ + hζ.continuousOn hearly hhit + refine ⟨τ, ⟨⟨by linarith [hτ.1], hτ.2⟩, hout, hin⟩, by linarith [hτ.1], ?_⟩ + intro t ht he + obtain ⟨u, hu, heq⟩ := hcut (ζ t) (hin ⟨by linarith [ht.1], ht.2⟩) he + exact havoid t ⟨ht.1, ht.2.le.trans hτ.2⟩ u hu heq.symm + have hposProb : q ≤ (W.prod W) (unitWindowExitArc D g w 1) := by + refine (hprob side hside).trans (finite_exit_event_measure_le_arc (W.prod W) D g w h hreal + hg.continuousOn (E side) (Or.inr rfl) hae (hgeom side hside) ?_) + intro b hb + simpa only [one_mul] using hpos _ (hb _ (by norm_num)) + have hsideNeg : -side = -1 ∨ -side = 1 := by + rcases hside with rfl | rfl <;> norm_num + have hnegProb : q ≤ (W.prod W) (unitWindowExitArc D g w (-1)) := by + refine (hprob (-side) hsideNeg).trans (finite_exit_event_measure_le_arc (W.prod W) D g w h hreal + hg.continuousOn (E (-side)) (Or.inl rfl) hae (hgeom (-side) hsideNeg) ?_) + intro b hb + have hh := hneg _ (hb _ (by norm_num)) + nlinarith + exact ⟨hnegProb.trans hnegBound, hposProb.trans hposBound⟩ + +end SLEExactGauge.RibbonCoordinates + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/WeightedCompactMass.lean b/lean/OAI/Probability/SLE/Mass/WeightedCompactMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7cee9250a2beebe09f710d088efd5fe9128e2bb --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/WeightedCompactMass.lean @@ -0,0 +1,108 @@ +import OAI.Probability.SLE.Mass.CanonicalMassContinuity +import OAI.Probability.SLE.Geometry.ConformalRestartTransport + +namespace OAI + +/-! Bounded compact weights preserve the scalar continuity estimates +used for the canonical disk mass. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma integral_weight_difference_le + {X : Type*} [MeasurableSpace X] (μ ν : Measure X) + [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hμν : μ ≤ ν) + (f : X → ℝ) (hf : Integrable f ν) (M : ℝ) + (h0 : 0 ≤ᵐ[ν] f) (hM : ∀ᵐ x ∂ν, f x ≤ M) : + 0 ≤ (∫ x, f x ∂ν)-(∫ x, f x ∂μ) ∧ + (∫ x, f x ∂ν)-(∫ x, f x ∂μ) ≤ M*((ν univ).toReal-(μ univ).toReal) := by + let ξ := ν-μ + have hξν : ξ ≤ ν := Measure.sub_le + have hξ : Integrable f ξ := hf.mono_measure hξν + have hμ : Integrable f μ := hf.mono_measure hμν + have he : (∫ x, f x ∂ν) = (∫ x, f x ∂ξ)+(∫ x, f x ∂μ) := by + rw [← sigmaFinite_sub_add_cancel_of_le hμν] + exact integral_add_measure hξ hμ + have hn : 0 ≤ ∫ x, f x ∂ξ := integral_nonneg_of_ae (ae_mono hξν h0) + have hi : (∫ x, f x ∂ξ) ≤ ∫ _ : X, M ∂ξ := + integral_mono_ae hξ (integrable_const M) (ae_mono hξν hM) + have hv : (ξ univ).toReal = (ν univ).toReal-(μ univ).toReal := by + rw [Measure.sub_apply MeasurableSet.univ hμν, + ENNReal.toReal_sub_of_le (hμν univ) (measure_ne_top ν univ)] + simp only [integral_const,smul_eq_mul,measureReal_def,hv] at hi + constructor + · linarith + · rw [mul_comm] at hi + linarith + +namespace Multipoint + +lemma compact_weight_bounded (w : C(upperHalfPlane,ℝ≥0)) + (K : Set upperHalfPlane) (hK : IsCompact K) : + ∃ M : ℝ≥0, ∀ z ∈ K, w z ≤ M := by + obtain ⟨M,hM⟩ := hK.bddAbove_image w.continuous.continuousOn + exact ⟨M,fun z hz => hM (mem_image_of_mem _ hz)⟩ + +lemma compact_weight_integrable (w : C(upperHalfPlane,ℝ≥0)) + (K : Set upperHalfPlane) (hK : IsCompact K) + (μ : Measure upperHalfPlane) [IsFiniteMeasureOnCompacts μ] : + IntegrableOn (fun z => (w z:ℝ)) K μ := + (continuous_subtype_val.comp w.continuous).continuousOn.integrableOn_compact hK + +lemma compact_weight_difference_le + (w : C(upperHalfPlane,ℝ≥0)) (K : Set upperHalfPlane) (hK : IsCompact K) + (M : ℝ≥0) (hM : ∀ z ∈ K, w z ≤ M) + (μ ν : Measure upperHalfPlane) + [IsFiniteMeasureOnCompacts μ] [IsFiniteMeasureOnCompacts ν] (hμν : μ ≤ ν) : + |(∫ z in K, (w z:ℝ) ∂ν)-(∫ z in K, (w z:ℝ) ∂μ)| ≤ + (M:ℝ)*|(ν K).toReal-(μ K).toReal| := by + let : IsFiniteMeasure (μ.restrict K) := ⟨by simpa using hK.measure_lt_top (μ := μ)⟩ + let : IsFiniteMeasure (ν.restrict K) := ⟨by simpa using hK.measure_lt_top (μ := ν)⟩ + have h := integral_weight_difference_le (μ.restrict K) (ν.restrict K) + (Measure.restrict_mono le_rfl hμν) (fun z => (w z:ℝ)) + (compact_weight_integrable w K hK ν) M + (ae_of_all _ (fun z => (w z).coe_nonneg)) + ((ae_restrict_mem hK.measurableSet).mono (fun z hz => NNReal.coe_le_coe.mpr (hM z hz))) + have hv : (μ K).toReal ≤ (ν K).toReal := + ENNReal.toReal_mono hK.measure_ne_top (hμν K) + simpa only [Measure.restrict_apply_univ,abs_of_nonneg h.1, + abs_of_nonneg (sub_nonneg.mpr hv)] using h.2 + +theorem ContinuousMassPath.weighted_compact_continuous + {γ : ℝ≥0 → ℂ} {μ : ℚ → Measure upperHalfPlane} {ν : Measure upperHalfPlane} + {N : ℝ≥0 → Measure upperHalfPlane} (hp : ContinuousMassPath γ μ ν N) + (hN : ∀ t, IsFiniteMeasureOnCompacts (N t)) + (w : C(upperHalfPlane,ℝ≥0)) (K : Set upperHalfPlane) (hK : IsCompact K) : + Continuous (fun t => ∫ z in K, (w z:ℝ) ∂N t) := by + obtain ⟨M,hM⟩ := compact_weight_bounded w K hK + apply continuous_iff_continuousAt.mpr + intro t₀ + rw [Metric.continuousAt_iff] + intro ε hε + have hpos : 0 < ε/((M:ℝ)+1) := div_pos hε (by positivity) + obtain ⟨δ,hδ,hvar⟩ := hp.local_variation K hK t₀ _ hpos + refine ⟨δ,hδ,?_⟩ + intro t ht + let := hN t + let := hN t₀ + have ht' : dist (t:ℝ) (t₀:ℝ) < δ := ht + have hsmall := hvar t t₀ ht' (by simpa using hδ) K hK.measurableSet Subset.rfl + have hb : |(∫ z in K, (w z:ℝ) ∂N t)-(∫ z in K, (w z:ℝ) ∂N t₀)| ≤ + (M:ℝ)*|((N t) K).toReal-((N t₀) K).toReal| := by + rcases le_total t t₀ with htt | htt + · have h := compact_weight_difference_le w K hK M hM (N t) (N t₀) (hp.monotone htt) + simpa only [abs_sub_comm] using h + · exact compact_weight_difference_le w K hK M hM (N t₀) (N t) (hp.monotone htt) + rw [Real.dist_eq] + have he : ε/((M:ℝ)+1)*((M:ℝ)+1)=ε := div_mul_cancel₀ _ (by positivity) + nlinarith [abs_nonneg (((N t) K).toReal-((N t₀) K).toReal),M.coe_nonneg] + +end Multipoint +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/WeightedImageRandomMass.lean b/lean/OAI/Probability/SLE/Mass/WeightedImageRandomMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd36f7cf7a8124e3d8c66e16144219635798f32f --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/WeightedImageRandomMass.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SLE.Mass.RestartRandomMassTesting + +namespace OAI + +/-! Measurable weighted images of locally finite random half-plane measures. +The weight and image map can be chosen from the stopped past. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped ENNReal + +namespace SLEExactGauge + +def weightedImageMass {X : Type*} [MeasurableSpace X] + (J : upperHalfPlane → X) (w : upperHalfPlane → ℝ≥0∞) + (μ : Measure upperHalfPlane) : Measure X := + (μ.withDensity w).map J + +lemma weightedImageMass_apply {X : Type*} [MeasurableSpace X] + (J : upperHalfPlane → X) (hJ : Measurable J) + (w : upperHalfPlane → ℝ≥0∞) (μ : Measure upperHalfPlane) + (A : Set X) (hA : MeasurableSet A) : + weightedImageMass J w μ A = ∫⁻ z, (J ⁻¹' A).indicator w z ∂μ := by + rw [weightedImageMass,Measure.map_apply hJ hA,withDensity_apply _ (hJ hA), + lintegral_indicator (hJ hA)] + +theorem weightedImageMass_measurable + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (μ : Ω → Measure upperHalfPlane) (hμ : Measurable μ) + (hfin : ∀ ω, IsFiniteMeasureOnCompacts (μ ω)) + (J : Ω × upperHalfPlane → X) (hJ : Measurable J) + (w : Ω × upperHalfPlane → ℝ≥0∞) (hw : Measurable w) : + Measurable (fun ω => weightedImageMass (fun z => J (ω,z)) + (fun z => w (ω,z)) (μ ω)) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have he (ω : Ω) := weightedImageMass_apply (fun z => J (ω,z)) + (hJ.comp (measurable_const.prodMk measurable_id)) (fun z => w (ω,z)) (μ ω) A hA + simp_rw [he] + exact halfPlane_random_test_measurable μ hμ hfin + ((J ⁻¹' A).indicator w) (hw.indicator (hJ hA)) + +lemma weightedImageMass_lintegral {X : Type*} [MeasurableSpace X] + (J : upperHalfPlane → X) (hJ : Measurable J) + (w : upperHalfPlane → ℝ≥0∞) (hw : Measurable w) + (μ : Measure upperHalfPlane) (f : X → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ x, f x ∂weightedImageMass J w μ) = ∫⁻ z, w z*f (J z) ∂μ := by + rw [weightedImageMass,lintegral_map hf hJ] + exact lintegral_withDensity_eq_lintegral_mul μ hw + (show Measurable (fun z => f (J z)) from hf.comp hJ) + +theorem weightedImageMass_measurable_of_subsigma + {Ω X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace X] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + (μ : Ω → Measure upperHalfPlane) (hμ : Measurable[mΩ] μ) + (hfin : ∀ ω, IsFiniteMeasureOnCompacts (μ ω)) + (J : Ω × upperHalfPlane → X) (hJ : Measurable[m.prod inferInstance] J) + (w : Ω × upperHalfPlane → ℝ≥0∞) (hw : Measurable[m.prod inferInstance] w) : + Measurable[mΩ] (fun ω => weightedImageMass (fun z => J (ω,z)) + (fun z => w (ω,z)) (μ ω)) := by + let : MeasurableSpace Ω := mΩ + have hle : m.prod (inferInstance : MeasurableSpace upperHalfPlane) ≤ mΩ.prod inferInstance := + sup_le_sup (MeasurableSpace.comap_mono hm) le_rfl + exact weightedImageMass_measurable μ hμ hfin J (hJ.mono hle le_rfl) w (hw.mono hle le_rfl) + +theorem restart_weighted_mass_test + {Ω X Y : Type*} [mΩ : MeasurableSpace Ω] [mX : MeasurableSpace X] + [mY : MeasurableSpace Y] + (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure X) [IsFiniteMeasure ν] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + (V : Ω → X) (hV : Measurable[mΩ] V) + (hlaw : ∀ A : Set Ω, MeasurableSet[m] A → + @Measure.map Ω X mΩ mX V (P.restrict A) = P A • ν) + (M : X → Measure upperHalfPlane) (hM : Measurable M) + (hMf : ∀ x, IsFiniteMeasureOnCompacts (M x)) + (J : Ω × upperHalfPlane → Y) (hJ : Measurable[m.prod inferInstance] J) + (w : Ω × upperHalfPlane → ℝ≥0∞) (hw : Measurable[m.prod inferInstance] w) + (f : Ω × Y → ℝ≥0∞) (hf : Measurable[m.prod mY] f) : + (∫⁻ ω, ∫⁻ y, f (ω,y) ∂weightedImageMass (fun z => J (ω,z)) + (fun z => w (ω,z)) (M (V ω)) ∂P) = + ∫⁻ ω, ∫⁻ z, w (ω,z)*f (ω,J (ω,z)) ∂ν.bind M ∂P := by + let : MeasurableSpace Ω := mΩ + have htest : Measurable[m.prod inferInstance] + (fun p : Ω × upperHalfPlane => w p*f (p.1,J p)) := + hw.mul (hf.comp (measurable_fst.prodMk hJ)) + have he (ω : Ω) := weightedImageMass_lintegral (fun z => J (ω,z)) + (hJ.comp (measurable_const.prodMk measurable_id)) (fun z => w (ω,z)) + (hw.comp (measurable_const.prodMk measurable_id)) (M (V ω)) (fun y => f (ω,y)) + (hf.comp (measurable_const.prodMk measurable_id)) + simp_rw [he] + exact restart_random_mass_test P ν m hm V hV hlaw M hM hMf _ htest + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Mass/WeightedLevelMoments.lean b/lean/OAI/Probability/SLE/Mass/WeightedLevelMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..463bb1f0161a1db3c46551b039fbc97c07383f72 --- /dev/null +++ b/lean/OAI/Probability/SLE/Mass/WeightedLevelMoments.lean @@ -0,0 +1,188 @@ +import OAI.Probability.SLE.Mass.LevelRadonMoments +import OAI.Probability.SLE.Gauge.WeightedMomentIntegration + +namespace OAI + +/-! The actual multipoint estimate with spatial weights retained. This +retains the near-diagonal gain needed for nonatomicity. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped NNReal ENNReal Topology CompactlySupported + +namespace SLEExactGauge.Multipoint + +def weightedLevelMass {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (K : Set ℂ) (f : ℂ → ℝ≥0∞) (ω : Ω) : ℝ≥0∞ := + ∫⁻ z in K, f z * ENNReal.ofReal (stoppedGreen κ (fun t => Real.sqrt κ * B t ω) + (γ ω) (G ω) z u) + +theorem weightedLevelMass_moment_identity + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [SigmaFinite P] + {B : ℝ≥0 → Ω → ℝ} (hm : ∀ t, Measurable (B t)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (K : Set ℂ) (f : ℂ → ℝ≥0∞) (hf : Measurable f) (m : ℕ) : + (∫⁻ ω, weightedLevelMass κ B γ G u K f ω ^ m ∂P) = + ∫⁻ z : Fin m → ℂ, (∏ i, f (z i)) * + (∫⁻ ω, ENNReal.ofReal (∏ i, stoppedGreen κ (fun t => Real.sqrt κ * B t ω) + (γ ω) (G ω) (z i) u) ∂P) ∂Measure.pi (fun _ : Fin m => volume.restrict K) := by + have hW := (actual_stoppedGreen_joint_measurable hm hBc κ u hu γ G F hw).ennreal_ofReal + unfold weightedLevelMass + rw [lintegral_weighted_mass_pow_eq P (volume.restrict K) + (fun ω z => ENNReal.ofReal (stoppedGreen κ + (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) z u)) hW f hf m] + apply lintegral_congr + intro z + apply congrArg (fun v : ℝ≥0∞ => (∏ i, f (z i)) * v) + apply lintegral_congr + intro ω + exact (ENNReal.ofReal_prod_of_nonneg (fun i _ => stoppedGreen_nonneg (hw ω) κ _ _)).symm + +theorem actual_product_le_cappedKernel + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + {m : ℕ} (z : Fin m → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hzi : Function.Injective z) + (b : ℝ) (hb : 0 < b) (hbR : ∀ i, b ≤ 2*(z i).im) (u : ℝ) : + (∫⁻ ω, ENNReal.ofReal (∏ i, stoppedGreen κ + (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (z i) u) ∂P) ≤ + ENNReal.ofReal (multipointConstant κ m) * cappedDistanceKernel (codimension κ) b z := by + have hc := stoppedGreen_common_level_product_bound hB hm hBm hBc hB0 hκ hκ8 γ G F hw + hgrowth z hz hzi (cappedDistance b z) (fun i => cap_pos hb hzi i) + (fun i => (cap_le_fixed b z i).trans (hbR i)) + (fun i j hij => cap_le_dist b z i j hij) u + apply hc.trans_eq + rw [ENNReal.ofReal_mul (by positivity)] + congr 1 + · simp only [multipointConstant,Fintype.card_fin] + · exact ENNReal.ofReal_prod_of_nonneg + (fun i _ => Real.rpow_nonneg (cap_pos hb hzi i).le _) + +theorem weightedLevelMass_moment_le_cappedKernel + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (K : Set ℂ) (hK : MeasurableSet K) (hKH : K ⊆ upperHalfPlane) + (f : ℂ → ℝ≥0∞) (hf : Measurable f) + (b : ℝ) (hb : 0 < b) (hbR : ∀ z ∈ K, b ≤ 2*z.im) (m : ℕ) + (u : ℝ) (hu : 0 ≤ u) : + (∫⁻ ω, weightedLevelMass κ B γ G u K f ω ^ m ∂P) ≤ + ENNReal.ofReal (multipointConstant κ m) * + ∫⁻ z : Fin m → ℂ, (∏ i, f (z i)) * cappedDistanceKernel (codimension κ) b z + ∂Measure.pi (fun _ : Fin m => volume.restrict K) := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + rw [weightedLevelMass_moment_identity P hm hBc κ u hu γ G F hw K f hf m] + have hk : Measurable (fun z : Fin m → ℂ => + (∏ i, f (z i)) * cappedDistanceKernel (codimension κ) b z) := + (Finset.measurable_prod _ (fun i _ => hf.comp (measurable_pi_apply i))).mul + (measurable_cappedDistanceKernel _ _) + rw [← lintegral_const_mul _ hk] + apply lintegral_mono_ae + filter_upwards [ae_tuple_mem (ι := Fin m) K hK,ae_tuple_injective (ι := Fin m) K] with z hz hzi + have he := actual_product_le_cappedKernel hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth + z (fun i => hKH (hz i)) hzi b hb (fun i => hbR (z i) (hz i)) u + exact (mul_le_mul' le_rfl he).trans_eq (by ac_rfl) + +lemma levelApproximationTest_le_weightedLevelMass + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (K : Set ℂ) (hK : MeasurableSet K) (f : ℂ → ℝ≥0∞) (hf : Measurable f) + (hz : ∀ z ∉ K, f z = 0) (t : ℝ≥0∞) (ω : Ω) : + levelApproximationTest κ B γ G u t f ω ≤ weightedLevelMass κ B γ G u K f ω := by + have hd := levelApproximationDensity_joint_measurable hm hBc κ u hu γ G F hw t + change (∫⁻ z, f z ∂volume.withDensity _) ≤ _ + rw [lintegral_withDensity_eq_lintegral_mul volume hd.of_uncurry_left hf] + have he : (fun z => levelApproximationDensity κ B γ G u t ω z * f z) = + K.indicator (fun z => levelApproximationDensity κ B γ G u t ω z * f z) := by + funext z + by_cases hzK : z ∈ K + · simp only [indicator_of_mem hzK] + · simp only [indicator_of_notMem hzK,hz z hzK,mul_zero] + change (∫⁻ z, levelApproximationDensity κ B γ G u t ω z * f z) ≤ _ + rw [he,lintegral_indicator hK] + apply lintegral_mono + intro z + unfold levelApproximationDensity + dsimp only + split_ifs + · exact (mul_comm _ _).le + · simp only [zero_mul,zero_le] + +theorem levelApproximationTest_moment_le_cappedKernel + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (K : Set ℂ) (hK : MeasurableSet K) (hKH : K ⊆ upperHalfPlane) + (f : ℂ → ℝ≥0∞) (hf : Measurable f) (hz : ∀ z ∉ K, f z = 0) + (b : ℝ) (hb : 0 < b) (hbR : ∀ z ∈ K, b ≤ 2*z.im) (m : ℕ) + (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0∞) : + (∫⁻ ω, levelApproximationTest κ B γ G u t f ω ^ m ∂P) ≤ + ENNReal.ofReal (multipointConstant κ m) * + ∫⁻ z : Fin m → ℂ, (∏ i, f (z i)) * cappedDistanceKernel (codimension κ) b z + ∂Measure.pi (fun _ : Fin m => volume.restrict K) := by + apply (lintegral_mono (fun ω => pow_le_pow_left' + (levelApproximationTest_le_weightedLevelMass hm hBc κ u hu γ G F hw K hK f hf hz t ω) m)).trans + exact weightedLevelMass_moment_le_cappedKernel hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth + K hK hKH f hf b hb hbR m u hu + +theorem level_radon_limit_test_moment_le + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) (s : ℕ → Finset ℕ) (w : ℕ → ℕ → ℝ) + (hw₀ : ∀ n i, i ∈ s n → 0 ≤ w n i) (hw₁ : ∀ n, ∑ i ∈ s n, w n i = 1) + (t : ℝ≥0∞) (ν : Ω → Measure upperHalfPlane) + (hlim : ∀ᵐ ω ∂P, ∀ f : C_c(upperHalfPlane,ℝ), + Tendsto (fun n => ∫ z, f z ∂convexLevelMeasure κ B γ G u s w n t ω) + atTop (𝓝 (∫ z, f z ∂ν ω))) + (f : C_c(upperHalfPlane,ℝ)) (hf : ∀ z, 0 ≤ f z) (m : ℕ) (M : ℝ≥0∞) + (hbound : ∀ n, (∫⁻ ω, ENNReal.ofReal + (∫ z, f z ∂halfPlaneLevelMeasure κ B γ G (u n) t ω)^m ∂P) ≤ M) : + (∫⁻ ω, ENNReal.ofReal (∫ z, f z ∂ν ω)^m ∂P) ≤ M := by + apply lintegral_le_of_ae_tendsto_bound P + (fun n ω => ENNReal.ofReal (∫ z, f z ∂convexLevelMeasure κ B γ G u s w n t ω)^m) + (fun ω => ENNReal.ofReal (∫ z, f z ∂ν ω)^m) + (fun n => ((convexLevelMeasure_test_measurable hm hBc hκ hκ8 γ G F hw u hu s w hw₀ n t f).ennreal_ofReal.pow_const m).aemeasurable) + · filter_upwards [hlim] with ω hω + exact (ENNReal.continuous_pow m).continuousAt.tendsto.comp + ((ENNReal.continuous_ofReal.tendsto _).comp (hω f)) + · intro n + have hb := lintegral_pow_convex_sum_le P (s n) (w n) + (fun i ω => ∫ z, f z ∂halfPlaneLevelMeasure κ B γ G (u (n+i)) t ω) + (hw₀ n) (hw₁ n) (fun i _ ω => integral_nonneg hf) + (fun i _ => by + simp_rw [integral_halfPlaneLevelMeasure] + exact levelApproximationRealTest_measurable hm hBc κ (u (n+i)) (hu _) γ G F hw t + _ (extendHalfPlaneTest_measurable f f.continuous.measurable)) + m M (fun i _ => hbound (n+i)) + simpa only [integral_convexLevelMeasure hκ hκ8 γ G F _ (hBc _) (hw _) u s w n t (hw₀ n) f, + integral_halfPlaneLevelMeasure] using hb + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointAbsorption.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointAbsorption.lean new file mode 100644 index 0000000000000000000000000000000000000000..4acc0e27cc3533ba878cd0bea5e7b920fe3ab424 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointAbsorption.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SLE.Multipoint.MultipointYoung + +namespace OAI + +/-! Summation of the pairwise Young bounds. The active index set may +change at the individual activation and completion times. -/ + +noncomputable section +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +lemma offDiag_vertex_cost_le {ι : Type*} [DecidableEq ι] + (s : Finset ι) (A : ι → ℝ) (hA : ∀ i ∈ s, 0 ≤ A i) : + (∑ ij ∈ s.offDiag, (A ij.1 + A ij.2)) ≤ + 2 * (s.card : ℝ) * ∑ i ∈ s, A i := by + calc + _ ≤ ∑ ij ∈ s ×ˢ s, (A ij.1 + A ij.2) := by + apply Finset.sum_le_sum_of_subset_of_nonneg + · intro ij hij + obtain ⟨hi, hj, _⟩ := Finset.mem_offDiag.mp hij + exact Finset.mem_product.mpr ⟨hi, hj⟩ + · intro ij hij _ + obtain ⟨hi, hj⟩ := Finset.mem_product.mp hij + exact add_nonneg (hA _ hi) (hA _ hj) + _ = _ := by + rw [Finset.sum_product] + simp only [Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul, + ← Finset.mul_sum] + ring + +/-- Negative one-point drift absorbs every pair contribution. We bound +the off-diagonal vertex count by the full square; this only changes the +order-dependent choice of epsilon. -/ +theorem sum_drift_absorption {ι : Type*} [DecidableEq ι] + (s : Finset ι) (D A H : ι → ℝ) (cross weight : ι × ι → ℝ) + (C k ε L : ℝ) (hε : 0 ≤ ε) (hA : ∀ i ∈ s, 0 ≤ A i) + (hbudget : 2*ε*(s.card : ℝ) ≤ k) + (hD : ∀ i ∈ s, D i ≤ C*H i-k*A i) + (hcross : ∀ ij ∈ s.offDiag, cross ij ≤ ε*(A ij.1+A ij.2)+L*weight ij) : + (∑ i ∈ s, D i) + (∑ ij ∈ s.offDiag, cross ij) ≤ + C*(∑ i ∈ s, H i) + L*(∑ ij ∈ s.offDiag, weight ij) := by + have hsumD := Finset.sum_le_sum hD + simp only [Finset.sum_sub_distrib, ← Finset.mul_sum] at hsumD + have hsumcross := Finset.sum_le_sum hcross + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hsumcross + have hvertices := mul_le_mul_of_nonneg_left (offDiag_vertex_cost_le s A hA) hε + rw [Finset.sum_add_distrib] at hvertices + have hsumA : 0 ≤ ∑ i ∈ s, A i := Finset.sum_nonneg hA + have htotal := mul_le_mul_of_nonneg_right hbudget hsumA + nlinarith + +lemma absorption_epsilon_pos {k : ℝ} (hk : 0 < k) (m : ℕ) : + 0 < k/(4*((m : ℝ)+1)) := by positivity + +lemma absorption_epsilon_budget {k : ℝ} (hk : 0 ≤ k) (m : ℕ) : + 2*(k/(4*((m : ℝ)+1)))*(m : ℝ) ≤ k := by + have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg m + have hden : 0 < 4*((m : ℝ)+1) := by positivity + have he : 2*(k/(4*((m : ℝ)+1)))*(m : ℝ) = + (2*k*(m : ℝ))/(4*((m : ℝ)+1)) := by ring + rw [he] + apply (div_le_iff₀ hden).mpr + nlinarith + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActiveCosts.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActiveCosts.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2a7a53b430c0885951cf9ff7f2302e467927e30 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActiveCosts.lean @@ -0,0 +1,117 @@ +import OAI.Probability.SLE.Multipoint.MultipointLogClockTransport +import OAI.Probability.SLE.Multipoint.MultipointGlobalDiscount + +namespace OAI + +/-! The raw active costs and their bounds on individual completion +intervals. Disjoint active intervals contribute zero pair cost. -/ + +noncomputable section +open Set MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def actualSingleCost (κ β a U : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (t : ℝ) : ℝ := + regulator β U (logFactorClock κ (logLoewnerCoordinates G z t)-a)* + logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2 + +def actualPairCost (κ β az aw Uz Uw : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z w : ℂ) (t : ℝ) : ℝ := + (regulator β Uz (logFactorClock κ (logLoewnerCoordinates G z t)-az)* + regulator β Uw (logFactorClock κ (logLoewnerCoordinates G w t)-aw))^(-exponent (greenExponent κ))* + (logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)* + logVelocity κ (logLoewnerCoordinates G w t) (B t.toNNReal)) + +lemma actualSingleCost_nonneg (κ β a U : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (t : ℝ) : 0 ≤ actualSingleCost κ β a U B G z t := + mul_nonneg (regulator_pos _ _ _).le (sq_nonneg _) + +lemma actualPairCost_nonneg (κ β az aw Uz Uw : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z w : ℂ) (t : ℝ) : + 0 ≤ actualPairCost κ β az aw Uz Uw B G z w t := + mul_nonneg (Real.rpow_nonneg (mul_pos (regulator_pos _ _ _) (regulator_pos _ _ _)).le _) + (mul_pos (logVelocity_pos _ _ _) (logVelocity_pos _ _ _)).le + +theorem actualSingleCost_bound + {κ : ℝ} (hκ : 0 < κ) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) + (β a U : ℝ) (hβ : 0 < β) (hU : 0 ≤ U) + (hstart : σ < T → logFactorClock κ (logLoewnerCoordinates G z σ) = a) + (hend : σ < T → logFactorClock κ (logLoewnerCoordinates G z T)-a ≤ U) : + IntervalIntegrable (actualSingleCost κ β a U B G z) volume (σ : ℝ) (T : ℝ) ∧ + (∫ t in (σ : ℝ)..(T : ℝ), actualSingleCost κ β a U B G z t) ≤ 2/(κ*β) := by + rcases lt_or_eq_of_le hσT with hlt | rfl + · have he : actualSingleCost κ β a U B G z = fun t => + regulator β U (logFactorClock κ (logLoewnerCoordinates G z t)- + logFactorClock κ (logLoewnerCoordinates G z σ))* + logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2 := by + funext t + rw [actualSingleCost, hstart hlt] + rw [he] + refine ⟨hw.logFactor_single_intervalIntegrable hB σ T hσT z hz β U, + hw.logFactor_single_regulator_integral_le hκ hB σ T hσT z hz hβ hU ?_⟩ + simpa only [hstart hlt] using hend hlt + · exact ⟨by simp, by simp only [intervalIntegral.integral_same]; positivity⟩ + +def overlapStart (σz σw : ℝ≥0) : ℝ≥0 := max σz σw + +def overlapEnd (σz σw Tz Tw : ℝ≥0) : ℝ≥0 := max (overlapStart σz σw) (min Tz Tw) + +theorem actualPairCost_bound + {κ : ℝ} (hκ : 0 < κ) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (σz σw Tz Tw : ℝ≥0) (z w : ℂ) + (hz : z ∈ survivingDomain γ Tz) (hw' : w ∈ survivingDomain γ Tw) (hne : z ≠ w) + (β az aw Uz Uw : ℝ) (hβ : 0 ≤ β) (hM : 0 ≤ exponent (greenExponent κ)) + (hdecay : 2*(exponent (greenExponent κ)*β) < 2/κ) + (hstartz : σz < Tz → logFactorClock κ (logLoewnerCoordinates G z σz) = az) + (hstartw : σw < Tw → logFactorClock κ (logLoewnerCoordinates G w σw) = aw) + (hgeoz : σz < Tz → σw < Tw → physicalConformalRadius J G σz z ≤ dist (J z) (J w)) + (hgeow : σz < Tz → σw < Tw → physicalConformalRadius J G σw w ≤ dist (J z) (J w)) : + IntervalIntegrable (actualPairCost κ β az aw Uz Uw B G z w) volume + (overlapStart σz σw : ℝ) (overlapEnd σz σw Tz Tw : ℝ) ∧ + (∫ t in (overlapStart σz σw : ℝ)..(overlapEnd σz σw Tz Tw : ℝ), + actualPairCost κ β az aw Uz Uw B G z w t) ≤ + interactionBudget 2 (exponent (greenExponent κ)*(κ*β)) := by + have hadm : 2*(exponent (greenExponent κ)*(κ*β)) < 2 := by + have hh := (source_pair_exponent_admissible (c := exponent (greenExponent κ)*β) hκ).mpr hdecay + convert hh using 1 + ring + by_cases ht : overlapStart σz σw < min Tz Tw + · have hzt : σz < Tz := (le_max_left σz σw).trans_lt (ht.trans_le (min_le_left _ _)) + have hwt : σw < Tw := (le_max_right σz σw).trans_lt (ht.trans_le (min_le_right _ _)) + have he : actualPairCost κ β az aw Uz Uw B G z w = fun t => + (regulator β Uz (logFactorClock κ (logLoewnerCoordinates G z t)- + logFactorClock κ (logLoewnerCoordinates G z σz))* + regulator β Uw (logFactorClock κ (logLoewnerCoordinates G w t)- + logFactorClock κ (logLoewnerCoordinates G w σw)))^(-exponent (greenExponent κ))* + (logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)* + logVelocity κ (logLoewnerCoordinates G w t) (B t.toNNReal)) := by + funext t + rw [actualPairCost, hstartz hzt, hstartw hwt] + rw [he, overlapEnd, max_eq_right ht.le] + have hzl := survivingDomain_antitone γ (min_le_left Tz Tw) hz + have hwl := survivingDomain_antitone γ (min_le_right Tz Tw) hw' + exact ⟨hw.logFactor_pair_intervalIntegrable hB σz σw (overlapStart σz σw) (min Tz Tw) + (le_max_left _ _) (le_max_right _ _) ht.le z w hzl hwl β _ Uz Uw, + hw.logFactor_pair_regulator_integral_le hκ hB hgrowth J hJ hJinj σz σw + (overlapStart σz σw) (min Tz Tw) (le_max_left _ _) (le_max_right _ _) ht.le + z w hzl hwl hne (hgeoz hzt hwt) (hgeow hzt hwt) hβ hM hdecay Uz Uw⟩ + · have he : overlapEnd σz σw Tz Tw = overlapStart σz σw := + max_eq_left (le_of_not_gt ht) + rw [he] + exact ⟨by simp, by simpa only [intervalIntegral.integral_same] using + (interactionBudget_pos (by norm_num : (0 : ℝ) < 2) hadm).le⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActualBudget.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActualBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfc3574f3cb29a42ba5ebcb066c488323b54888a --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActualBudget.lean @@ -0,0 +1,146 @@ +import OAI.Probability.SLE.Multipoint.MultipointActualExpectation +import OAI.Probability.SLE.Multipoint.MultipointCostAssembly +import OAI.Probability.SLE.Multipoint.MultipointInitialParameters + +namespace OAI + +/-! The uniform discount budget for the actual, individually stopped +Loewner coordinates in an arbitrary conformal image. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem actual_localized_discount_le + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {κ β lo hi M : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) (hβ : 0 < β) + (hdecay : 2*(exponent (greenExponent κ)*β) < 2/κ) + {H : ℝ≥0} (z : ι → ℂ) (hne : Function.Injective z) + (u₀ u₂ : ι → ℝ) (h₀ : ∀ i, 0 ≤ u₀ i) (hu : ∀ i, u₀ i ≤ u₂ i) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (S : LocalizedState B hm κ lo hi M H z + (fun i => actualFactorStops γ G z u₀ u₂ H (i,2)) γ G) + (horder : ∀ ω i, Monotone (fun k => actualFactorStops γ G z u₀ u₂ H (i,k) ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (R b : ι → ℝ) (hR : ∀ i, 0 < R i) (hb : ∀ i, 0 < b i) + (hRdef : ∀ i, R i = 2*(z i).im*‖deriv J (z i)‖) + (hu₀ : ∀ i, u₀ i = Real.log (R i/b i)) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (J (z i)) (J (z j))) + (r : ℝ≥0 → Ω → ℝ) (C : ℝ≥0) + (hrm : Measurable (Function.uncurry r)) (hrb : ∀ t ω, |r t ω| ≤ C) + (hcost : ∀ ω t, t < S.χ ω → r t ω = + productDriftCost (patternActiveSet (phaseAt (actualFactorStops γ G z u₀ u₂ H) t ω)) κ + (fun i => phaseRegulatorScale β (sourceClockLevel κ (z i) (u₀ i)) + (κ/4*(u₂ i-u₀ i)) (phaseAt (actualFactorStops γ G z u₀ u₂ H) t ω i)) + (fun i => phaseRegulatorSlope β (phaseAt (actualFactorStops γ G z u₀ u₂ H) t ω i)) + (S.Q t ω) (B t ω)) (ω : Ω) : + discountClock r (S.χ ω) ω ≤ uniformDiscountBudget κ β (Finset.univ : Finset ι) := by + classical + let ρ := actualFactorStops γ G z u₀ u₂ H + let a := fun i => sourceClockLevel κ (z i) (u₀ i) + let U := fun i => κ/4*(u₂ i-u₀ i) + let σ := fun i => min (ρ (i,0) ω) (S.χ ω) + let T := fun i => min (ρ (i,2) ω) (S.χ ω) + have hσT (i : ι) : σ i ≤ T i := min_le_min (horder ω i (by decide : (0 : Fin 3) ≤ 2)) le_rfl + have hTH (i : ι) : T i ≤ S.χ ω := min_le_right _ _ + have hlive (i : ι) : z i ∈ survivingDomain (γ ω) (T i) := (S.actual ω i).1 + have hσeq (i : ι) (hlt : σ i < T i) : σ i = ρ (i,0) ω := by + apply min_eq_left + by_contra h + have he : σ i = S.χ ω := min_eq_right (le_of_not_ge h) + exact (not_lt_of_ge (hTH i)) (he ▸ hlt) + have hσχ (i : ι) : σ i ≤ S.χ ω := min_le_right _ _ + have hστ (i : ι) : σ i ≤ ρ (i,2) ω := + (min_le_left _ _).trans (horder ω i (by decide : (0 : Fin 3) ≤ 2)) + have hstart (i : ι) (hlt : σ i < T i) : + logFactorClock κ (logLoewnerCoordinates (G ω) (z i) (σ i)) = a i := by + have he := (S.actual_at ω i (σ i) (hσχ i) (hστ i)).2 + have hs : actualFactorStops γ G z u₀ u₂ H (i,0) ω = σ i := (hσeq i hlt).symm + have hc := actual_phase_switch_clock hBc hκ hw S horder ω i 0 + (by rw [hs]; exact hσχ i) + rw [hs, he] at hc + exact sub_eq_zero.mp (by simpa only [ite_true] using hc) + have hend (i : ι) : + logFactorClock κ (logLoewnerCoordinates (G ω) (z i) (T i))-a i ≤ U i := by + have hc := cutoff_radius_strictly_reached_iff (continuous_const.mul (hBc ω)) + (hw ω) hκ (z i) (u₂ i) ((h₀ i).trans (hu i)) H (T i) + ((hTH i).trans (S.bounded ω)) (hlive i) ω + have hle : logFactorClock κ (logLoewnerCoordinates (G ω) (z i) (T i)) ≤ + sourceClockLevel κ (z i) (u₂ i) := by + apply le_of_not_gt + intro h + have ht : ρ (i,2) ω < T i := by + simpa only [ρ, actualFactorStops, factorRadiusLevel, Fin.reduceEq, ite_false, cutoffStop] using hc.mpr h + exact (not_lt_of_ge (min_le_left _ _)) ht + have he : sourceClockLevel κ (z i) (u₂ i) = a i+U i := by + dsimp [a,U,sourceClockLevel] + ring + rw [he] at hle + linarith + have hgeo (i j : ι) (hij : i ≠ j) (hlt : σ i < T i) : + physicalConformalRadius J (G ω) (σ i) (z i) ≤ dist (J (z i)) (J (z j)) := by + have hc := hstart i hlt + rw [logFactorClock_eq_logRadiusClock κ (Real.log (z i).im)] at hc + have he : logRadiusClock (Real.log (z i).im) + (logLoewnerCoordinates (G ω) (z i) (σ i)) = Real.log (R i/b i) := by + dsimp [a,sourceClockLevel] at hc + rw [← hu₀ i] + nlinarith [hκ] + rw [(hw ω).physical_radius_at_activation (continuous_const.mul (hBc ω)) J + (z i) (R i) (b i) (hR i) (hb i) (hRdef i) (σ i) + (S.actual_at ω i (σ i) (hσχ i) (hστ i)).1 he] + exact hsep i j hij + have hactive (t : ℝ) (ht : t ∈ Ico 0 (S.χ ω : ℝ)) (i : ι) + (hi : i ∈ patternActiveSet (phaseAt ρ t.toNNReal ω)) : + (σ i : ℝ) ≤ t ∧ t ≤ (T i : ℝ) := by + have ha := (phaseAt_active_iff ρ ω i (horder ω i) t.toNNReal).mp + (Finset.mem_filter.mp hi).2 + have htχ : t.toNNReal ≤ S.χ ω := Real.toNNReal_le_iff_le_coe.mpr ht.2.le + constructor + · have hh := (min_le_left (ρ (i,0) ω) (S.χ ω)).trans ha.1 + simpa only [Real.coe_toNNReal t ht.1] using (NNReal.coe_le_coe.mpr hh) + · have hh : t.toNNReal ≤ T i := le_min ha.2.le htχ + simpa only [Real.coe_toNNReal t ht.1] using (NNReal.coe_le_coe.mpr hh) + have hQ (t : ℝ) (ht : t ∈ Ico 0 (S.χ ω : ℝ)) (i : ι) + (hi : i ∈ patternActiveSet (phaseAt ρ t.toNNReal ω)) : + S.Q t ω i = logLoewnerCoordinates (G ω) (z i) t := by + have ha := (phaseAt_active_iff ρ ω i (horder ω i) t.toNNReal).mp + (Finset.mem_filter.mp hi).2 + have hh := (S.actual_at ω i t.toNNReal (Real.toNNReal_le_iff_le_coe.mpr ht.2.le) ha.2.le).2 + simpa only [Real.coe_toNNReal t ht.1] using hh + have hrt : ∀ ω, Measurable (fun t => r t ω) := + fun ω => hrm.comp (measurable_id.prodMk measurable_const) + have hri : IntervalIntegrable (fun t : ℝ => r t.toNNReal ω) volume 0 (S.χ ω : ℝ) := + ((bounded_rate_locallyIntegrable r hrt C hrb ω).integrableOn_isCompact isCompact_uIcc).intervalIntegrable + have hbound := actual_phase_cost_integral_le hκ hκ8 (hBc ω) (hw ω) hgrowth J hJ hJinj + (Finset.univ : Finset ι) z (fun _ _ _ _ he => hne he) β hβ hdecay a U + (fun i _ => mul_nonneg (div_nonneg hκ.le (by norm_num)) (sub_nonneg.mpr (hu i))) + σ T (S.χ ω) (fun i _ => hσT i) (fun i _ => hTH i) (fun i _ => hlive i) + (fun i _ => hstart i) (fun i _ _ => hend i) + (fun i _ j _ hij hi _ => hgeo i j hij hi) + (fun t => S.Q t ω) (fun t => phaseAt ρ t.toNNReal ω) + (fun _ _ => Finset.subset_univ _) hactive hQ + (fun t ht i hi => by + have hh := (actual_phase_regulator hBc hκ hβ.le h₀ hu hw S horder ω t.toNNReal + (Real.toNNReal_le_iff_le_coe.mpr ht.2.le) i (Finset.mem_filter.mp hi).2).1 + simpa only [Real.coe_toNNReal t ht.1,hQ t ht i hi] using hh) + (fun t : ℝ => r t.toNNReal ω) hri + (fun t ht => by + have htχ : t.toNNReal < S.χ ω := by + apply NNReal.coe_lt_coe.mp + simpa only [Real.coe_toNNReal t ht.1] using ht.2 + have hh := hcost ω t.toNNReal htχ + simpa only [Real.coe_toNNReal t ht.1] using hh) + simpa only [discountClock,Real.toNNReal_coe] using hbound + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActualCutoffs.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActualCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a747fd36d3502062bce70728b8aa7c3c06130f8 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActualCutoffs.lean @@ -0,0 +1,57 @@ +import OAI.Probability.SLE.Multipoint.MultipointActualPhases + +namespace OAI + +/-! A countable family of concrete localizations, with the original +radius stops capped beyond each integration horizon. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem exists_actual_localizations + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (u₀ u₂ : ι → ℝ) (h₀ : ∀ i, 0 ≤ u₀ i) (hu : ∀ i, u₀ i ≤ u₂ i) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (A : ℝ) (hA : 0 ≤ A) (hzA : ∀ i, |Real.log (z i).im| ≤ A) : + Nonempty (∀ n : ℕ, LocalizedState B hm κ (-(A+n+1)) (A+n+1) (A+n+1) + ((n : ℝ≥0)+1) z + (fun i => actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2)) γ G) := by + classical + have hn (n : ℕ) : 0 ≤ A+(n : ℝ)+1 := by positivity + have hex (n : ℕ) : Nonempty (LocalizedState B hm κ (-(A+n+1)) (A+n+1) (A+n+1) + ((n : ℝ≥0)+1) z + (fun i => actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2)) γ G) := by + have ht := (actualFactorStops_regular hB hm hBm hBc hB0 κ hκ hκ8 γ G F hw + z hz u₀ u₂ h₀ hu ((n : ℝ≥0)+1)).1 + apply exists_localizedState B hm hBm hBc κ (-(A+n+1)) (A+n+1) (A+n+1) + (by linarith [hn n]) ((n : ℝ≥0)+1) z hz + · intro i + have hi := (abs_le.mp (hzA i)).1 + linarith [Nat.cast_nonneg (α := ℝ) n] + · intro i + have hi := (abs_le.mp (hzA i)).2 + linarith [Nat.cast_nonneg (α := ℝ) n] + · intro ω + simpa only [hB0 ω,abs_zero] using hn n + · exact fun i => ht (i,2) + · exact hw + exact ⟨fun n => Classical.choice (hex n)⟩ + +lemma initial_log_height_bound {ι : Type*} [Fintype ι] (z : ι → ℂ) (i : ι) : + |Real.log (z i).im| ≤ ‖fun j => Real.log (z j).im‖ := by + simpa only [Real.norm_eq_abs] using norm_le_pi_norm (fun j => Real.log (z j).im) i + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActualExpectation.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActualExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..23b93fca0c1b73bec38298b8f6358cbe6b4687f6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActualExpectation.lean @@ -0,0 +1,124 @@ +import OAI.Probability.SLE.Multipoint.MultipointActualPhases +import OAI.Probability.SLE.Multipoint.MultipointLocalizedExpectation +import OAI.Probability.SLE.Multipoint.MultipointSelectedRate +import OAI.Probability.SLE.Multipoint.MultipointStateBounds +import OAI.Probability.SLE.Multipoint.MultipointTerminalProbability + +namespace OAI + +/-! The actual localized multipoint product has expectation at most one. +The bounded discount process is constructed, not supplied as an input. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem actual_localized_product_expectation + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ β lo hi M : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) (hβ : 0 ≤ β) (hβ1 : β ≤ 1) + {H : ℝ≥0} (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (u₀ u₂ : ι → ℝ) (h₀ : ∀ i, 0 ≤ u₀ i) (hu : ∀ i, u₀ i ≤ u₂ i) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (S : LocalizedState B hm κ lo hi M H z + (fun i => actualFactorStops γ G z u₀ u₂ H (i,2)) γ G) : + let ρ := actualFactorStops γ G z u₀ u₂ H + let a := fun i => sourceClockLevel κ (z i) (u₀ i) + let U := fun i => κ/4*(u₂ i-u₀ i) + ∃ (r : ℝ≥0 → Ω → ℝ) (C : ℝ≥0), + Measurable (Function.uncurry r) ∧ + IsProgressive (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) r ∧ + (∀ t ω, 0 ≤ r t ω ∧ |r t ω| ≤ C) ∧ + (∀ ω t, t < S.χ ω → r t ω = + productDriftCost (patternActiveSet (phaseAt ρ t ω)) κ + (fun i => phaseRegulatorScale β (a i) (U i) (phaseAt ρ t ω i)) + (fun i => phaseRegulatorSlope β (phaseAt ρ t ω i)) (S.Q t ω) (B t ω)) ∧ + Integrable (fun ω => discountedPatternProduct κ β a U (phaseAt ρ (S.χ ω) ω) + (S.Q (S.χ ω) ω,discountClock r (S.χ ω) ω) (B (S.χ ω) ω)) P ∧ + (∫ ω, discountedPatternProduct κ β a U (phaseAt ρ (S.χ ω) ω) + (S.Q (S.χ ω) ω,discountClock r (S.χ ω) ω) (B (S.χ ω) ω) ∂P) ≤ 1 := by + classical + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + dsimp only + let ρ := actualFactorStops γ G z u₀ u₂ H + let a := fun i => sourceClockLevel κ (z i) (u₀ i) + let U := fun i => κ/4*(u₂ i-u₀ i) + let l := factorSwitchList ρ + obtain ⟨hρstop,horder,hρbound⟩ := actualFactorStops_regular hB hm hBm hBc hB0 + κ hκ hκ8 γ G F hw z hz u₀ u₂ h₀ hu H + have hlstop := factorSwitchList_forall ρ + (fun τ => IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (τ ω : WithTop ℝ≥0))) + (by + simpa only [WithTop.coe_zero] using + (isStoppingTime_const (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (0 : ℝ≥0))) hρstop + have hlbound := factorSwitchList_forall ρ (fun τ => ∀ ω, τ ω ≤ H+1) + (fun _ => bot_le) hρbound + have hU (i : ι) : 0 ≤ U i := mul_nonneg (div_nonneg hκ.le (by norm_num)) (sub_nonneg.mpr (hu i)) + let q₀ := fun i => initialLogCoordinates (z i) + have hQ0 (ω : Ω) : S.Q 0 ω = q₀ := funext (S.initial ω) + let Qbound := ‖q₀‖+(S.L : ℝ)*(H : ℝ) + have hQbound (ω : Ω) (t : ℝ≥0) (ht : t ≤ S.χ ω) : ‖S.Q t ω‖ ≤ Qbound := by + have hh := lipschitz_state_norm_le (fun u => S.Q u ω) S.L (S.lipschitz ω) + H t t.coe_nonneg (by exact_mod_cast ht.trans (S.bounded ω)) + simpa only [hQ0 ω] using hh + let R₀ := max Qbound M + have hR₀ : 0 ≤ R₀ := (by positivity : (0 : ℝ) ≤ Qbound).trans (le_max_left _ _) + have hnorm₀ (ω : Ω) (t : ℝ≥0) (ht : t ≤ S.χ ω) : ‖(S.Q t ω,B t ω)‖ ≤ R₀ := by + rw [Prod.norm_def,Real.norm_eq_abs] + exact max_le_max (hQbound ω t ht) (S.driver_bound ω t ht) + obtain ⟨r,C,hrm,hrp,hrb,hcost⟩ := exists_localized_discount_rate B hm hBm hBc + S.Q S.measurable S.adapted (fun ω => (S.lipschitz ω).continuous) κ β hκ hκ8 a U + ρ l H hlstop hlbound (factorSwitchList_mem ρ) (factorSwitchList_zero ρ) + S.χ S.stopping S.bounded R₀ hR₀ hnorm₀ + have hrt (ω : Ω) : Measurable (fun t => r t ω) := + hrm.comp (measurable_id.prodMk measurable_const) + let R := max (max Qbound ((C : ℝ)*(H : ℝ))) M + have hR : 0 ≤ R := (by positivity : (0 : ℝ) ≤ Qbound).trans + ((le_max_left _ _).trans (le_max_left _ _)) + have hnorm (ω : Ω) (t : ℝ) (ht : 0 ≤ t) (htχ : t ≤ (S.χ ω : ℝ)) : + ‖((S.Q t ω,discountClock r t ω),B t.toNNReal ω)‖ ≤ R := + discounted_state_norm_bound S.Q S.L S.lipschitz q₀ hQ0 r hrt C + (fun t ω => (hrb t ω).2) B S.χ H S.bounded M + (fun ω t ht => by simpa only [Real.norm_eq_abs] using S.driver_bound ω t ht) ω t ht htχ + have hclock (ω : Ω) (i : ι) (k : Fin 3) (hk : ρ (i,k) ω ≤ S.χ ω) : + logFactorClock κ (S.Q (ρ (i,k) ω) ω i)-a i = + if k = 0 then 0 else if k = 1 then U i/2 else U i := + actual_phase_switch_clock hBc hκ hw S horder ω i k hk + obtain ⟨hI,hmean⟩ := localized_pattern_expectation_le hB hm hBm hBc S.Q S.V S.L + S.measurable S.adapted S.lipschitz S.velocity_measurable S.velocity_bound S.derivative + r hrm hrp C (fun t ω => (hrb t ω).2) κ β hκ hκ8 hβ hβ1 a U hU ρ l H + hlstop hlbound (factorSwitchList_mem ρ) horder (factorSwitchList_zero ρ) + S.χ S.stopping S.bounded R hR hnorm + (fun ω t ht i hi => (actual_phase_regulator hBc hκ hβ h₀ hu hw S horder ω t ht.le i + (Finset.mem_filter.mp hi).2).2) + (fun ω t ht i hi => S.physical_velocity ω t ht i + ((phaseAt_active_iff ρ ω i (horder ω i) t).mp (Finset.mem_filter.mp hi).2).2) + hcost hclock + refine ⟨r,C,hrm,hrp,hrb,hcost,hI,hmean.trans ?_⟩ + have hinit (ω : Ω) : discountedPatternProduct κ β a U (phaseAt ρ 0 ω) + (S.Q 0 ω,discountClock r 0 ω) (B 0 ω) ≤ 1 := by + simp only [discountedPatternProduct, discountClock_initial, neg_zero, Real.exp_zero, one_mul] + apply initial_phase_product_le_one κ β hκ hκ8 a U hU ρ ω (horder ω) (S.Q 0 ω) (B 0 ω) + intro i k hk + have hh := hclock ω i k (by rw [hk]; exact bot_le) + simpa only [hk, NNReal.coe_zero] using hh + have hnonneg (ω : Ω) : 0 ≤ discountedPatternProduct κ β a U (phaseAt ρ 0 ω) + (S.Q 0 ω,discountClock r 0 ω) (B 0 ω) := + mul_nonneg (Real.exp_pos _).le (Finset.prod_nonneg (fun i _ => + (phaseFactor_pos κ β (a i) (U i) (phaseAt ρ 0 ω i) (S.Q 0 ω i) (B 0 ω)).le)) + simpa only [integral_const,probReal_univ,one_smul] using + integral_mono_of_nonneg (μ := P) (ae_of_all P hnonneg) + (integrable_const (1 : ℝ)) (ae_of_all P hinit) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActualPhases.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActualPhases.lean new file mode 100644 index 0000000000000000000000000000000000000000..f12843a69982a3668e811c01090d95dd3e3a2957 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActualPhases.lean @@ -0,0 +1,163 @@ +import OAI.Probability.SLE.Multipoint.MultipointLocalizedState +import OAI.Probability.SLE.Multipoint.MultipointRadiusStatus +import OAI.Probability.SLE.Multipoint.MultipointPhaseRegulator + +namespace OAI + +/-! The three actual radius stops and their phase identities along the +constructed localized state. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def factorRadiusLevel (u₀ u₂ : ℝ) (k : Fin 3) : ℝ := + if k = 0 then u₀ else if k = 1 then (u₀+u₂)/2 else u₂ + +lemma factorRadiusLevel_nonneg {u₀ u₂ : ℝ} (h₀ : 0 ≤ u₀) (h₂ : 0 ≤ u₂) (k : Fin 3) : + 0 ≤ factorRadiusLevel u₀ u₂ k := by + fin_cases k <;> norm_num [factorRadiusLevel] <;> positivity + +lemma factorRadiusLevel_monotone {u₀ u₂ : ℝ} (hu : u₀ ≤ u₂) : + Monotone (factorRadiusLevel u₀ u₂) := by + intro i j hij + fin_cases i <;> fin_cases j <;> norm_num [factorRadiusLevel] at * <;> linarith + +def actualFactorStops {Ω ι : Type*} (γ : Ω → ℝ≥0 → ℂ) + (G : Ω → ℝ≥0 → ℂ → ℂ) (z : ι → ℂ) (u₀ u₂ : ι → ℝ) (H : ℝ≥0) + (k : ι × Fin 3) : Ω → ℝ≥0 := + cutoffStop (fun ω => radiusLevelTime (γ ω) (G ω) (z k.1) + (factorRadiusLevel (u₀ k.1) (u₂ k.1) k.2)) (H+1) + +def factorSwitchList {Ω ι : Type*} [Fintype ι] + (ρ : (ι × Fin 3) → Ω → ℝ≥0) : List (Ω → ℝ≥0) := + (fun _ => 0) :: (Finset.univ.toList.map ρ) + +lemma factorSwitchList_zero {Ω ι : Type*} [Fintype ι] + (ρ : (ι × Fin 3) → Ω → ℝ≥0) : (fun _ : Ω => (0 : ℝ≥0)) ∈ factorSwitchList ρ := by + simp only [factorSwitchList, List.mem_cons, true_or] + +lemma factorSwitchList_mem {Ω ι : Type*} [Fintype ι] + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (k : ι × Fin 3) : ρ k ∈ factorSwitchList ρ := by + exact List.mem_cons_of_mem _ (List.mem_map.mpr ⟨k,Finset.mem_toList.mpr (Finset.mem_univ _),rfl⟩) + +lemma factorSwitchList_forall {Ω ι : Type*} [Fintype ι] + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (P : (Ω → ℝ≥0) → Prop) + (hzero : P (fun _ => 0)) (hρ : ∀ k, P (ρ k)) : ∀ τ ∈ factorSwitchList ρ, P τ := by + intro τ hτ + rcases List.mem_cons.mp hτ with rfl | hτ + · exact hzero + · obtain ⟨k,_,rfl⟩ := List.mem_map.mp hτ + exact hρ k + +theorem actualFactorStops_regular {Ω ι : Type*} [mΩ : MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (u₀ u₂ : ι → ℝ) + (h₀ : ∀ i, 0 ≤ u₀ i) (hu : ∀ i, u₀ i ≤ u₂ i) (H : ℝ≥0) : + (∀ k, IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (actualFactorStops γ G z u₀ u₂ H k ω : WithTop ℝ≥0))) ∧ + (∀ ω i, Monotone (fun k => actualFactorStops γ G z u₀ u₂ H (i,k) ω)) ∧ + (∀ k ω, actualFactorStops γ G z u₀ u₂ H k ω ≤ H+1) := by + refine ⟨?_,?_,?_⟩ + · intro k + exact cutoffStop_stopping _ _ (actual_radiusLevelTime_stopping hB hm hBm hBc hB0 κ hκ hκ8 + γ G F hw (z k.1) (hz k.1) _ (factorRadiusLevel_nonneg (h₀ k.1) ((h₀ k.1).trans (hu k.1)) k.2)) (H+1) + · intro ω i j k hjk + apply cutoffStop_mono _ (H+1) ω + intro ω' + exact radiusLevelTime_mono (continuous_const.mul (hBc ω')) (hw ω') (z i) + (factorRadiusLevel_nonneg (h₀ i) ((h₀ i).trans (hu i)) j) + (factorRadiusLevel_monotone (hu i) hjk) + · exact fun k ω => cutoffStop_le_horizon _ _ ω + +lemma LocalizedState.actual_at {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + {κ lo hi M : ℝ} {H : ℝ≥0} {z : ι → ℂ} {τ : ι → Ω → ℝ≥0} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (S : LocalizedState B hm κ lo hi M H z τ γ G) + (ω : Ω) (i : ι) (t : ℝ≥0) (htχ : t ≤ S.χ ω) (htτ : t ≤ τ i ω) : + z i ∈ survivingDomain (γ ω) t ∧ S.Q t ω i = logLoewnerCoordinates (G ω) (z i) t := by + have ht : t ≤ min (τ i ω) (S.χ ω) := le_min htτ htχ + exact ⟨survivingDomain_antitone (γ ω) ht (S.actual ω i).1, + (S.actual ω i).2 ⟨t.coe_nonneg, by exact_mod_cast ht⟩⟩ + +theorem actual_phase_regulator + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {κ lo hi M β : ℝ} (hκ : 0 < κ) (hβ : 0 ≤ β) {H : ℝ≥0} + {z : ι → ℂ} {u₀ u₂ : ι → ℝ} (h₀ : ∀ i, 0 ≤ u₀ i) (hu : ∀ i, u₀ i ≤ u₂ i) + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (S : LocalizedState B hm κ lo hi M H z + (fun i => actualFactorStops γ G z u₀ u₂ H (i,2)) γ G) + (horder : ∀ ω i, Monotone (fun k => actualFactorStops γ G z u₀ u₂ H (i,k) ω)) + (ω : Ω) (t : ℝ≥0) (htχ : t ≤ S.χ ω) (i : ι) + (hactive : phaseActive (phaseAt (actualFactorStops γ G z u₀ u₂ H) t ω i)) : + let a := sourceClockLevel κ (z i) (u₀ i) + let U := κ/4*(u₂ i-u₀ i) + let j := phaseAt (actualFactorStops γ G z u₀ u₂ H) t ω i + branchRegulator κ (phaseRegulatorScale β a U j) (phaseRegulatorSlope β j) (S.Q t ω i) = + regulator β U (logFactorClock κ (S.Q t ω i)-a) ∧ + branchRegulator κ (phaseRegulatorScale β a U j) (phaseRegulatorSlope β j) (S.Q t ω i) ≤ 1 := by + have htt := ((phaseAt_active_iff _ ω i (horder ω i) t).mp hactive).2.le + obtain ⟨hlive,he⟩ := S.actual_at ω i t htχ htt + have hh := cutoff_radius_factor_thresholds (continuous_const.mul (hBc ω)) (hw ω) hκ + (z i) (u₀ i) (u₂ i) (h₀ i) ((h₀ i).trans (hu i)) H t + (htχ.trans (S.bounded ω)) hlive ω + dsimp only at hh ⊢ + apply phaseAt_regulator_eq_and_le_one _ ω i (horder ω i) t κ β + (sourceClockLevel κ (z i) (u₀ i)) (κ/4*(u₂ i-u₀ i)) hβ (S.Q t ω i) hactive + · intro ht + rw [he] + exact hh.1.mp ht + · intro ht + rw [he] + apply le_of_not_gt + intro h + exact (not_le_of_gt ht) (hh.2.1.mpr h.le) + · intro ht + rw [he] + exact hh.2.1.mp ht + · intro ht + rw [he] + apply le_of_not_gt + intro h + exact (not_le_of_gt ht) (hh.2.2.1.mpr h.le) + +theorem actual_phase_switch_clock + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {κ lo hi M : ℝ} (hκ : 0 < κ) {H : ℝ≥0} + {z : ι → ℂ} {u₀ u₂ : ι → ℝ} + {γ : Ω → ℝ≥0 → ℂ} {G F : Ω → ℝ≥0 → ℂ → ℂ} + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (S : LocalizedState B hm κ lo hi M H z + (fun i => actualFactorStops γ G z u₀ u₂ H (i,2)) γ G) + (horder : ∀ ω i, Monotone (fun k => actualFactorStops γ G z u₀ u₂ H (i,k) ω)) + (ω : Ω) (i : ι) (k : Fin 3) + (hk : actualFactorStops γ G z u₀ u₂ H (i,k) ω ≤ S.χ ω) : + logFactorClock κ (S.Q (actualFactorStops γ G z u₀ u₂ H (i,k) ω) ω i)- + sourceClockLevel κ (z i) (u₀ i) = + if k = 0 then 0 else if k = 1 then (κ/4*(u₂ i-u₀ i))/2 else κ/4*(u₂ i-u₀ i) := by + let t := actualFactorStops γ G z u₀ u₂ H (i,k) ω + have htτ : t ≤ actualFactorStops γ G z u₀ u₂ H (i,2) ω := horder ω i (Fin.le_last k) + obtain ⟨hlive,he⟩ := S.actual_at ω i t hk htτ + have hclock := (cutoff_radius_eq_iff (continuous_const.mul (hBc ω)) (hw ω) hκ + (z i) (factorRadiusLevel (u₀ i) (u₂ i) k) H t (hk.trans (S.bounded ω)) hlive ω).mp rfl + rw [he,hclock] + fin_cases k <;> norm_num [factorRadiusLevel, sourceClockLevel] <;> ring + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointActualProbability.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointActualProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..a084c8d435887bc842d647b963c65fd26ccb8ae7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointActualProbability.lean @@ -0,0 +1,86 @@ +import OAI.Probability.SLE.Multipoint.MultipointActualBudget +import OAI.Probability.SLE.Multipoint.MultipointActualCutoffs +import OAI.Probability.SLE.Multipoint.MultipointCompletionExhaustion + +namespace OAI + +/-! The fixed-order radius estimate in an arbitrary conformal image. +The only analytic input not proved here is the stated disk growth bound. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +theorem actual_radius_multipoint_bound + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (R b e : ι → ℝ) (he : ∀ i, 0 < e i) (heb : ∀ i, e i ≤ b i) + (hbR : ∀ i, b i ≤ R i) (hRdef : ∀ i, R i = 2*(z i).im*‖deriv J (z i)‖) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (J (z i)) (J (z j))) : + P {ω | ∀ i, radiusLevelTime (γ ω) (G ω) (z i) (Real.log (R i/e i)) < ⊤} ≤ + ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) * + ∏ i, (e i/b i)^(1-κ/8)) := by + classical + let u₀ := fun i => Real.log (R i/b i) + let u₂ := fun i => Real.log (R i/e i) + let a := fun i => sourceClockLevel κ (z i) (u₀ i) + let U := fun i => κ/4*(u₂ i-u₀ i) + let A := ‖fun i => Real.log (z i).im‖ + let K := uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι) + have hb (i : ι) : 0 < b i := (he i).trans_le (heb i) + have hR (i : ι) : 0 < R i := (hb i).trans_le (hbR i) + have hparams (i : ι) := physical_radius_level_parameters hκ (z i) + (R i) (b i) (e i) (he i) (heb i) (hbR i) + have h₀ (i : ι) : 0 ≤ u₀ i := (hparams i).1 + have hu (i : ι) : u₀ i ≤ u₂ i := (hparams i).2.1 + have hU (i : ι) : U i = sourceTarget κ (b i) (e i) := by + have hh := (hparams i).2.2.2.1 + dsimp [U,u₀,u₂,sourceClockLevel] at * + linarith + obtain ⟨_,hβ,hβ1,hdecay,_⟩ := source_parameters hκ hκ8 + obtain ⟨S⟩ := exists_actual_localizations hB hm hBm hBc hB0 hκ hκ8 z hz u₀ u₂ h₀ hu + γ G F hw A (norm_nonneg _) (initial_log_height_bound z) + let ρ := fun n : ℕ => actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) + have horder (n : ℕ) := (actualFactorStops_regular hB hm hBm hBc hB0 κ hκ hκ8 + γ G F hw z hz u₀ u₂ h₀ hu ((n : ℝ≥0)+1)).2.1 + have hex (n : ℕ) := actual_localized_product_expectation hB hm hBm hBc hB0 hκ hκ8 + hβ.le hβ1 z hz u₀ u₂ h₀ hu γ G F hw (S n) + choose r C hrm hrp hrb hcost hI hmean using hex + let E := {ω | ∀ i, radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) < ⊤} + let cutoff := fun n => {ω | phaseAt (ρ n) ((S n).χ ω) ω = fun _ => 3} + have hcover : ∀ ω ∈ E, ∀ᶠ n : ℕ in atTop, ω ∈ cutoff n := by + intro ω hω + filter_upwards [eventually_all_completed_of_finite_radius_levels B hm hBc κ A + (norm_nonneg _) z u₀ u₂ γ G F hw S ω hω] with n hn + exact hn.2 + have hbudget (n : ℕ) (ω : Ω) : discountClock (r n) ((S n).χ ω) ω ≤ K := + actual_localized_discount_le hBc hκ hκ8 hβ hdecay z hne u₀ u₂ h₀ hu γ G F hw + (S n) (horder n) hgrowth J hJ hJinj R b hR hb hRdef (fun _ => rfl) hsep + (r n) (C n) (hrm n) (fun t ω => (hrb n t ω).2) (hcost n) ω + have hbound := measure_le_of_completed_phase_products P E cutoff κ (sourceBeta κ) a U K + (fun n ω => phaseAt (ρ n) ((S n).χ ω) ω) + (fun n ω => (S n).Q ((S n).χ ω) ω) + (fun n ω => discountClock (r n) ((S n).χ ω) ω) + (fun n ω => B ((S n).χ ω) ω) + hcover hI hmean (fun _ _ h => h) (fun n ω _ => hbudget n ω) + have hexp := source_radius_targets_exponential (Finset.univ : Finset ι) hκ b e + (fun i _ => hb i) (fun i _ => he i) + simpa only [E,u₂,K,show U = (fun i => sourceTarget κ (b i) (e i)) from funext hU, + hexp] using hbound + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointAngular.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointAngular.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b472ffc84e4520f8472b23f8d2e1d64c163c624 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointAngular.lean @@ -0,0 +1,289 @@ +import OAI.Probability.SLE.Multipoint.MultipointRegularizer + +namespace OAI + +/-! The angular generator calculation for the regularized factors of the +fixed-order multipoint radius estimate. The angular clock has generator +`(1/2)∂² + ((1-p)/2) cot(θ) ∂`, with `p = 4a-1`. -/ + +noncomputable section +open Set + +namespace SLEExactGauge.Multipoint + +def sinePower (r θ : ℝ) : ℝ := Real.sin θ ^ r + +def sinePowerFirst (r θ : ℝ) : ℝ := r * Real.sin θ ^ (r-1) * Real.cos θ + +def sinePowerSecond (r θ : ℝ) : ℝ := + r * (r-1) * Real.sin θ ^ (r-2) * Real.cos θ ^ 2 - r * Real.sin θ ^ r + +lemma sinePower_hasDerivAt {r θ : ℝ} (hθ : Real.sin θ ≠ 0) : + HasDerivAt (sinePower r) (sinePowerFirst r θ) θ := by + apply ((Real.hasDerivAt_sin θ).rpow_const (p := r) (Or.inl hθ)).congr_deriv + unfold sinePowerFirst + ring + +lemma sinePowerFirst_hasDerivAt {r θ : ℝ} (hθ : Real.sin θ ≠ 0) : + HasDerivAt (sinePowerFirst r) (sinePowerSecond r θ) θ := by + have hd := (((Real.hasDerivAt_sin θ).rpow_const (p := r-1) (Or.inl hθ)).const_mul r).mul + (Real.hasDerivAt_cos θ) + apply hd.congr_deriv + dsimp only [sinePowerSecond] + rw [show r-1-1 = r-2 by ring] + have hs : Real.sin θ ^ (r-1) * Real.sin θ = Real.sin θ ^ r := by + rw [← Real.rpow_add_one hθ] + congr 1 + ring + calc + _ = r * (r-1) * Real.sin θ ^ (r-2) * Real.cos θ ^ 2 - + r * (Real.sin θ ^ (r-1) * Real.sin θ) := by ring + _ = _ := by rw [hs] + +def sineGenerator (p r θ : ℝ) : ℝ := + sinePowerSecond r θ / 2 + (1-p)/2 * (Real.cos θ/Real.sin θ) * sinePowerFirst r θ + +lemma sineGenerator_eq {p r θ : ℝ} (hθ : 0 < Real.sin θ) : + sineGenerator p r θ = r*(r-p)/2 * Real.sin θ ^ (r-2) - + r*(r+1-p)/2 * Real.sin θ ^ r := by + unfold sineGenerator sinePowerSecond sinePowerFirst + rw [Real.rpow_sub hθ, Real.rpow_sub hθ, Real.rpow_two, Real.rpow_one] + have hcos : Real.cos θ ^ 2 = 1 - Real.sin θ ^ 2 := by + nlinarith [Real.sin_sq_add_cos_sq θ] + rw [hcos] + field_simp [hθ.ne'] + ring_nf + rw [hcos] + ring + +lemma sineGenerator_eigen {p θ : ℝ} (hθ : 0 < Real.sin θ) : + sineGenerator p p θ + p/2 * sinePower p θ = 0 := by + rw [sineGenerator_eq hθ] + unfold sinePower + ring + +def angularFactor (p δ θ : ℝ) : ℝ := sinePower p θ + δ*(1+sinePower (q p) θ) + +def damping (p δ θ : ℝ) : ℝ := δ / angularFactor p δ θ * sinePower (q p-2) θ + +def negativeDrift (p : ℝ) : ℝ := q p * (p-q p)/2 + +def driftAllowance (p : ℝ) : ℝ := p/2 + (p-q p)*(1+q p)/2 + 2 + +lemma negativeDrift_pos {p : ℝ} (hp : 0 < p) : 0 < negativeDrift p := by + exact div_pos (mul_pos (q_pos hp) (sub_pos.mpr (q_lt_p hp))) (by norm_num) + +lemma driftAllowance_pos {p : ℝ} (hp : 0 < p) : 0 < driftAllowance p := by + have hq := q_pos hp + have hqp := q_lt_p hp + dsimp [driftAllowance] + positivity + +lemma angularFactor_pos {p δ θ : ℝ} (hδ : 0 < δ) (hθ : 0 < Real.sin θ) : + 0 < angularFactor p δ θ := by + unfold angularFactor sinePower + positivity + +/-- Exact algebraic drift before estimating its negative singular term. -/ +lemma regularized_generator {p δ σ θ : ℝ} (hθ : 0 < Real.sin θ) : + sineGenerator p p θ + δ*sineGenerator p (q p) θ + + (p/2)*angularFactor p δ θ + δ*σ*(1+sinePower (q p) θ) = + δ*(p/2 + (p-q p)*(1+q p)/2*sinePower (q p) θ - + negativeDrift p*sinePower (q p-2) θ + σ*(1+sinePower (q p) θ)) := by + rw [sineGenerator_eq hθ, sineGenerator_eq hθ] + unfold angularFactor sinePower negativeDrift + ring + +lemma regularized_bracket_le {p σ θ : ℝ} (hp : 0 < p) + (hσ : σ ≤ 1) (hθ : 0 ≤ Real.sin θ) (hθ1 : Real.sin θ ≤ 1) : + p/2 + (p-q p)*(1+q p)/2*sinePower (q p) θ - + negativeDrift p*sinePower (q p-2) θ + σ*(1+sinePower (q p) θ) ≤ + driftAllowance p - negativeDrift p*sinePower (q p-2) θ := by + have hs0 : 0 ≤ sinePower (q p) θ := Real.rpow_nonneg hθ _ + have hs1 : sinePower (q p) θ ≤ 1 := Real.rpow_le_one hθ hθ1 (q_pos hp).le + have hk : 0 ≤ (p-q p)*(1+q p)/2 := by + have := q_lt_p hp + have := q_pos hp + positivity + have h1 := mul_le_mul_of_nonneg_left hs1 hk + have h2 := mul_le_mul_of_nonneg_right hσ (by linarith : 0 ≤ 1+sinePower (q p) θ) + unfold driftAllowance + nlinarith + +lemma angularFactor_ge_delta {p δ θ : ℝ} (hδ : 0 ≤ δ) (hθ : 0 ≤ Real.sin θ) : + δ ≤ angularFactor p δ θ := by + unfold angularFactor sinePower + have hp := Real.rpow_nonneg hθ p + have hq := Real.rpow_nonneg hθ (q p) + nlinarith + +lemma angularFactor_le_three {p δ θ : ℝ} (hp : 0 < p) + (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hθ : 0 ≤ Real.sin θ) : + angularFactor p δ θ ≤ 3 := by + have hp1 : sinePower p θ ≤ 1 := Real.rpow_le_one hθ (Real.sin_le_one θ) hp.le + have hq1 : sinePower (q p) θ ≤ 1 := Real.rpow_le_one hθ (Real.sin_le_one θ) (q_pos hp).le + have hq0 : 0 ≤ sinePower (q p) θ := Real.rpow_nonneg hθ _ + unfold angularFactor + nlinarith + +lemma angularFactor_endpoint_bounds {p θ : ℝ} (hp : 0 < p) (hθ : 0 ≤ Real.sin θ) : + 1 ≤ angularFactor p 1 θ ∧ angularFactor p 1 θ ≤ 3 := + ⟨angularFactor_ge_delta zero_le_one hθ, + angularFactor_le_three hp zero_le_one le_rfl hθ⟩ + +def angularFactorFirst (p δ θ : ℝ) : ℝ := + sinePowerFirst p θ + δ*sinePowerFirst (q p) θ + +lemma angularFactor_hasDerivAt {p δ θ : ℝ} (hθ : Real.sin θ ≠ 0) : + HasDerivAt (angularFactor p δ) (angularFactorFirst p δ θ) θ := by + apply ((sinePower_hasDerivAt (r := p) hθ).add + (((hasDerivAt_const θ 1).add (sinePower_hasDerivAt (r := q p) hθ)).const_mul δ)).congr_deriv + simp only [angularFactorFirst, zero_add] + +lemma angularFactorFirst_bound {p δ θ : ℝ} (hp : 0 < p) + (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hθ : 0 < Real.sin θ) : + |angularFactorFirst p δ θ| ≤ (p+q p)*Real.sin θ ^ (q p-1) := by + have hpq : Real.sin θ ^ (p-1) ≤ Real.sin θ ^ (q p-1) := + Real.rpow_le_rpow_of_exponent_ge hθ (Real.sin_le_one θ) (by linarith [q_lt_p hp]) + have hq := (q_pos hp).le + have hpow : 0 ≤ Real.sin θ ^ (q p-1) := Real.rpow_nonneg hθ.le _ + have hcos : |Real.cos θ| ≤ 1 := abs_le.mpr ⟨Real.neg_one_le_cos θ, Real.cos_le_one θ⟩ + have hfirst (r : ℝ) (hr : 0 ≤ r) : |sinePowerFirst r θ| ≤ r * Real.sin θ ^ (r-1) := by + unfold sinePowerFirst + rw [abs_mul, abs_of_nonneg (mul_nonneg hr (Real.rpow_nonneg hθ.le _))] + exact mul_le_of_le_one_right (mul_nonneg hr (Real.rpow_nonneg hθ.le _)) hcos + calc + _ ≤ |sinePowerFirst p θ| + |δ*sinePowerFirst (q p) θ| := abs_add_le _ _ + _ = |sinePowerFirst p θ| + δ*|sinePowerFirst (q p) θ| := by + rw [abs_mul, abs_of_nonneg hδ] + _ ≤ p*Real.sin θ ^ (p-1) + δ*(q p*Real.sin θ ^ (q p-1)) := + add_le_add (hfirst p hp.le) (mul_le_mul_of_nonneg_left (hfirst (q p) hq) hδ) + _ ≤ p*Real.sin θ ^ (q p-1) + q p*Real.sin θ ^ (q p-1) := + add_le_add (mul_le_mul_of_nonneg_left hpq hp.le) + (mul_le_of_le_one_left (mul_nonneg hq hpow) hδ1) + _ = _ := by ring + +/-- The singular angular derivative is controlled by the damping term. +The exponent is chosen so that `eta * (q - 2) = q - 1`. -/ +lemma normalized_angularFactorFirst_bound {p δ θ : ℝ} (hp : 0 < p) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hθ : 0 < Real.sin θ) : + |angularFactorFirst p δ θ| / angularFactor p δ θ ≤ + (p+q p)*3^(eta p)*δ^(-1-eta p)*(damping p δ θ)^(eta p) := by + let f := angularFactor p δ θ + let e := eta p + have hf : 0 < f := angularFactor_pos hδ hθ + have hdf : δ ≤ f := angularFactor_ge_delta hδ.le hθ.le + have hf3 : f ≤ 3 := angularFactor_le_three hp hδ.le hδ1 hθ.le + have he : 0 < e := eta_pos + have hD : 0 < damping p δ θ := + mul_pos (div_pos hδ hf) (Real.rpow_pos_of_pos hθ _) + have hidentity : Real.sin θ ^ (q p-1) = (f/δ)^e * (damping p δ θ)^e := by + rw [← Real.mul_rpow (div_pos hf hδ).le hD.le] + have hcancel : f/δ*damping p δ θ = Real.sin θ ^ (q p-2) := by + dsimp [damping, sinePower, f] + field_simp [hδ.ne', (angularFactor_pos hδ hθ).ne'] + rw [hcancel, ← Real.rpow_mul hθ.le] + congr 1 + exact ((mul_comm _ _).trans (eta_identity p)).symm + have hpq : 0 ≤ p+q p := add_nonneg hp.le (q_pos hp).le + calc + _ ≤ ((p+q p)*Real.sin θ ^ (q p-1))/f := + div_le_div_of_nonneg_right (angularFactorFirst_bound hp hδ.le hδ1 hθ) hf.le + _ ≤ ((p+q p)*Real.sin θ ^ (q p-1))/δ := + div_le_div_of_nonneg_left (mul_nonneg hpq (Real.rpow_nonneg hθ.le _)) hδ hdf + _ = (p+q p)/δ * (f/δ)^e * (damping p δ θ)^e := by rw [hidentity]; ring + _ ≤ (p+q p)/δ * (3/δ)^e * (damping p δ θ)^e := by + apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg hD.le _) + apply mul_le_mul_of_nonneg_left _ (div_nonneg hpq hδ.le) + exact Real.rpow_le_rpow (div_pos hf hδ).le + (div_le_div_of_nonneg_right hf3 hδ.le) he.le + _ = _ := by + rw [Real.div_rpow (by norm_num : (0:ℝ) ≤ 3) hδ.le, + Real.rpow_sub hδ, Real.rpow_neg_one] + ring + +def driftThreshold (p : ℝ) : ℝ := + (negativeDrift p / (2*driftAllowance p)) ^ (1/(2-q p)) + +lemma driftThreshold_pos {p : ℝ} (hp : 0 < p) : 0 < driftThreshold p := by + exact Real.rpow_pos_of_pos (div_pos (negativeDrift_pos hp) + (mul_pos (by norm_num) (driftAllowance_pos hp))) _ + +lemma driftThreshold_lt_one {p : ℝ} (hp : 0 < p) : driftThreshold p < 1 := by + have hq := q_pos hp + have hq1 := q_lt_one (p := p) + have hqp := q_lt_p hp + have hk := negativeDrift_pos hp + have hA := driftAllowance_pos hp + have hden : 0 < 2-q p := by linarith + have hsmall : negativeDrift p < 2*driftAllowance p := by + unfold negativeDrift driftAllowance + nlinarith [mul_nonneg (sub_nonneg.mpr hq1.le) (sub_nonneg.mpr hqp.le)] + exact Real.rpow_lt_one (div_pos hk (by positivity)).le + ((div_lt_one (by positivity)).mpr hsmall) (by positivity : 0 < 1/(2-q p)) + +lemma driftThreshold_identity {p : ℝ} (hp : 0 < p) : + negativeDrift p * driftThreshold p ^ (q p-2) = 2*driftAllowance p := by + have hk := negativeDrift_pos hp + have hA := driftAllowance_pos hp + have hq2 : 2-q p ≠ 0 := ne_of_gt (by linarith [q_lt_one (p := p)]) + unfold driftThreshold + rw [← Real.rpow_mul (div_pos hk (by positivity)).le] + have he : (1/(2-q p))*(q p-2) = -1 := by field_simp; ring + rw [he, Real.rpow_neg_one] + field_simp + +/-- The negative singular part absorbs the bounded drift at small angles; +away from the endpoints the denominator supplies a fixed lower bound. -/ +lemma regularized_drift_bound {p δ σ θ : ℝ} (hp : 0 < p) + (hδ : 0 < δ) (hσ : σ ≤ 1) (hθ : 0 < Real.sin θ) : + δ / angularFactor p δ θ * + (p/2 + (p-q p)*(1+q p)/2*sinePower (q p) θ - + negativeDrift p*sinePower (q p-2) θ + σ*(1+sinePower (q p) θ)) ≤ + (driftAllowance p * driftThreshold p ^ (-p))*δ - + (negativeDrift p/2)*damping p δ θ := by + let f := angularFactor p δ θ + let S := sinePower (q p-2) θ + let A := driftAllowance p + let k := negativeDrift p + let h := driftThreshold p + have hf : 0 < f := angularFactor_pos hδ hθ + have hA : 0 < A := driftAllowance_pos hp + have hk : 0 < k := negativeDrift_pos hp + have hh : 0 < h := driftThreshold_pos hp + have hbr := regularized_bracket_le hp hσ hθ.le (Real.sin_le_one θ) + have hstart := mul_le_mul_of_nonneg_left hbr (div_pos hδ hf).le + change δ/f * _ ≤ A*h^(-p)*δ - (k/2)*(δ/f*S) + apply hstart.trans + change δ/f * (A-k*S) ≤ A*h^(-p)*δ - (k/2)*(δ/f*S) + by_cases hsmall : Real.sin θ ≤ h + · have hS : h^(q p-2) ≤ S := + Real.rpow_le_rpow_of_nonpos hθ hsmall (by linarith [q_lt_one (p := p)]) + have hcancel : A ≤ k/2*S := by + have he := driftThreshold_identity hp + change k*h^(q p-2) = 2*A at he + nlinarith [mul_le_mul_of_nonneg_left hS hk.le] + have hnonneg : 0 ≤ A*h^(-p)*δ := by positivity + have hneg := mul_nonpos_of_nonneg_of_nonpos (div_pos hδ hf).le + (sub_nonpos.mpr hcancel) + nlinarith + · have hsp : h^p ≤ Real.sin θ ^ p := + Real.rpow_le_rpow hh.le (le_of_not_ge hsmall) hp.le + have hsf : Real.sin θ ^ p ≤ f := by + dsimp [f, angularFactor, sinePower] + exact le_add_of_nonneg_right (by positivity) + have hhpow : 0 < h^p := Real.rpow_pos_of_pos hh _ + have hquot : δ/f ≤ δ/(h^p) := div_le_div_of_nonneg_left hδ.le hhpow (hsp.trans hsf) + have hmain := mul_le_mul_of_nonneg_left hquot hA.le + have hS0 : 0 ≤ S := Real.rpow_nonneg hθ.le _ + have hnonneg : 0 ≤ (k/2)*(δ/f*S) := mul_nonneg (by positivity) + (mul_nonneg (div_pos hδ hf).le hS0) + rw [Real.rpow_neg hh.le] + change A*(δ/f) ≤ A*(δ*(h^p)⁻¹) at hmain + nlinarith + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointBrownianCoefficient.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointBrownianCoefficient.lean new file mode 100644 index 0000000000000000000000000000000000000000..f161c7f85376205379eb77f780760036cf89bde2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointBrownianCoefficient.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Multipoint.MultipointAngular +import OAI.Probability.SLE.Multipoint.MultipointYoung + +namespace OAI + +/-! The Brownian cross coefficient in the regularized multipoint product, +including the singular powers when `p < 1`. -/ + +noncomputable section + +namespace SLEExactGauge.Multipoint + +def angularCoefficientConstant (p : ℝ) : ℝ := (p+q p)*3^(eta p) + +lemma angularCoefficientConstant_pos {p : ℝ} (hp : 0 < p) : + 0 < angularCoefficientConstant p := by + unfold angularCoefficientConstant + exact mul_pos (add_pos hp (q_pos hp)) (Real.rpow_pos_of_pos (by norm_num) _) + +lemma velocity_power_identity {D v e : ℝ} (hD : 0 ≤ D) (hv : 0 < v) : + (D*v^2)^e * v^(1-2*e) = D^e*v := by + rw [Real.mul_rpow hD (sq_nonneg v), ← Real.rpow_natCast v 2, + ← Real.rpow_mul hv.le, mul_assoc, ← Real.rpow_add hv] + norm_num + +lemma pair_velocity_power_identity {Di Dj vi vj e : ℝ} + (hDi : 0 ≤ Di) (hDj : 0 ≤ Dj) (hvi : 0 < vi) (hvj : 0 < vj) : + (Di*vi^2)^e*(Dj*vj^2)^e*(vi*vj)^(1-2*e) = Di^e*Dj^e*vi*vj := by + rw [Real.mul_rpow hvi.le hvj.le] + calc + _ = ((Di*vi^2)^e*vi^(1-2*e))*((Dj*vj^2)^e*vj^(1-2*e)) := by ring + _ = _ := by rw [velocity_power_identity hDi hvi, velocity_power_identity hDj hvj]; ring + +/-- The magnitude of one Brownian cross term is absorbed at its two +endpoints, leaving exactly the inverse-regulator interaction cost. -/ +theorem angular_pair_absorption {p δi δj θi θj vi vj ε : ℝ} + (hp : 0 < p) (hδi : 0 < δi) (hδi1 : δi ≤ 1) + (hδj : 0 < δj) (hδj1 : δj ≤ 1) + (hθi : 0 < Real.sin θi) (hθj : 0 < Real.sin θj) + (hvi : 0 < vi) (hvj : 0 < vj) (hε : 0 < ε) : + (|angularFactorFirst p δi θi| / angularFactor p δi θi * vi) * + (|angularFactorFirst p δj θj| / angularFactor p δj θj * vj) ≤ + ε*(damping p δi θi*vi^2+damping p δj θj*vj^2) + + youngConstant p (angularCoefficientConstant p ^ 2) ε * + (δi*δj)^(-exponent p)*(vi*vj) := by + let Di := damping p δi θi + let Dj := damping p δj θj + let C := angularCoefficientConstant p + have hDi : 0 < Di := mul_pos (div_pos hδi (angularFactor_pos hδi hθi)) + (Real.rpow_pos_of_pos hθi _) + have hDj : 0 < Dj := mul_pos (div_pos hδj (angularFactor_pos hδj hθj)) + (Real.rpow_pos_of_pos hθj _) + have hC : 0 < C := angularCoefficientConstant_pos hp + have hi := normalized_angularFactorFirst_bound hp hδi hδi1 hθi + have hj := normalized_angularFactorFirst_bound hp hδj hδj1 hθj + change _ ≤ C*δi^(-1-eta p)*Di^(eta p) at hi + change _ ≤ C*δj^(-1-eta p)*Dj^(eta p) at hj + have hmul := mul_le_mul hi hj (div_nonneg (abs_nonneg _) (angularFactor_pos hδj hθj).le) + (by positivity : 0 ≤ C*δi^(-1-eta p)*Di^(eta p)) + have hmulv := mul_le_mul_of_nonneg_right hmul (mul_pos hvi hvj).le + calc + _ ≤ C^2*(δi*δj)^(-1-eta p)*Di^(eta p)*Dj^(eta p)*vi*vj := by + rw [Real.mul_rpow hδi.le hδj.le] + convert hmulv using 1 <;> ring + _ = C^2*(δi*δj)^(-1-eta p)*(Di*vi^2)^(eta p)* + (Dj*vj^2)^(eta p)*(vi*vj)^(1-2*eta p) := by + calc + _ = C^2*(δi*δj)^(-1-eta p)*(Di^(eta p)*Dj^(eta p)*vi*vj) := by ring + _ = C^2*(δi*δj)^(-1-eta p)* + ((Di*vi^2)^(eta p)*(Dj*vj^2)^(eta p)*(vi*vj)^(1-2*eta p)) := by + rw [pair_velocity_power_identity hDi.le hDj.le hvi hvj] + _ = _ := by ring + _ ≤ _ := weighted_pair_absorption hp (sq_pos_of_pos hC) hε (mul_pos hδi hδj) + (mul_nonneg hDi.le (sq_nonneg vi)) (mul_nonneg hDj.le (sq_nonneg vj)) + (mul_pos hvi hvj).le + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointBudgetMonotone.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointBudgetMonotone.lean new file mode 100644 index 0000000000000000000000000000000000000000..376d7f67c9d026a73273467d2b1b645e6f7d892a --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointBudgetMonotone.lean @@ -0,0 +1,58 @@ +import OAI.Probability.SLE.Multipoint.MultipointGlobalDiscount +import OAI.Probability.SLE.Multipoint.MultipointInitialParameters + +namespace OAI + +/-! The fixed-order constant remains valid after discarding constraints +whose targets already exceed their caps. -/ + +noncomputable section +open Set +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +lemma allPatternYoungConstant_mono {ι : Type*} [DecidableEq ι] {κ : ℝ} + (hκ : 0 < κ) (hκ8 : κ < 8) {I J : Finset ι} (hIJ : I ⊆ J) : + allPatternYoungConstant κ I ≤ allPatternYoungConstant κ J := by + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.powerset_mono.mpr hIJ) + exact fun s _ _ => (patternYoungConstant_pos hκ hκ8 s).le + +lemma allPatternYoungConstant_map {ι ν : Type*} [DecidableEq ι] [DecidableEq ν] + (κ : ℝ) (f : ι ↪ ν) (I : Finset ι) : + allPatternYoungConstant κ (I.map f) = allPatternYoungConstant κ I := by + classical + unfold allPatternYoungConstant + rw [Finset.map_eq_image,Finset.powerset_image,Finset.sum_image] + · apply Finset.sum_congr rfl + intro s _ + simp only [patternYoungConstant,Finset.card_image_of_injective s f.injective] + · exact Finset.image_injOn_powerset_of_injOn (fun _ _ _ _ h => f.injective h) + +lemma uniformDiscountBudget_map {ι ν : Type*} [DecidableEq ι] [DecidableEq ν] + (κ β : ℝ) (f : ι ↪ ν) (I : Finset ι) : + uniformDiscountBudget κ β (I.map f) = uniformDiscountBudget κ β I := by + simp only [uniformDiscountBudget,allPatternYoungConstant_map,Finset.offDiag_card,Finset.card_map] + +lemma uniformDiscountBudget_mono {ι : Type*} [DecidableEq ι] {κ : ℝ} + (hκ : 0 < κ) (hκ8 : κ < 8) {I J : Finset ι} (hIJ : I ⊆ J) : + uniformDiscountBudget κ (sourceBeta κ) I ≤ uniformDiscountBudget κ (sourceBeta κ) J := by + obtain ⟨_,hβ,_,_,hdecay⟩ := source_parameters hκ hκ8 + have hpair := (interactionBudget_pos (by norm_num : (0 : ℝ) < 2) hdecay).le + have hcard : (I.card : ℝ) ≤ J.card := by exact_mod_cast Finset.card_le_card hIJ + have hoff : (I.offDiag.card : ℝ) ≤ J.offDiag.card := by + exact_mod_cast Finset.card_le_card (Finset.offDiag_mono hIJ) + unfold uniformDiscountBudget + apply mul_le_mul_of_nonneg_left _ hκ.le + apply add_le_add + · exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right hcard (by positivity)) (singleDriftConstant_pos hκ hκ8).le + · exact mul_le_mul (allPatternYoungConstant_mono hκ hκ8 hIJ) + (mul_le_mul_of_nonneg_right hoff hpair) (mul_nonneg (Nat.cast_nonneg _) hpair) + (allPatternYoungConstant_pos hκ hκ8 J).le + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCappedKernel.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCappedKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..d933bbae846970151ae7309c973443da95d563bd --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCappedKernel.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Multipoint.MultipointKernelGraph +import OAI.Probability.SLE.Multipoint.MultipointTupleNull + +namespace OAI + +/-! The exact fixed-cap, nearest-neighbor distance kernel from +`mp:kernel-integral`, and its expansion into finite graph terms. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +def capEntry {ι : Type*} [DecidableEq ι] (b : ℝ) (x : ι → ℂ) (i : ι) : Option ι → ℝ + | none => b + | some j => if j=i then b else dist (x i) (x j) + +def cappedDistance {ι : Type*} [Fintype ι] [DecidableEq ι] + (b : ℝ) (x : ι → ℂ) (i : ι) : ℝ := + Finset.univ.inf' Finset.univ_nonempty (capEntry b x i) + +theorem cap_pos {ι : Type*} [Fintype ι] [DecidableEq ι] + {b : ℝ} (hb : 0 < b) {x : ι → ℂ} (hx : Function.Injective x) (i : ι) : + 0 < cappedDistance b x i := by + obtain ⟨o,_,ho⟩ := Finset.exists_mem_eq_inf' Finset.univ_nonempty (capEntry b x i) + change 0 < Finset.univ.inf' Finset.univ_nonempty (capEntry b x i) + rw [ho] + cases o with + | none => exact hb + | some j => + dsimp only [capEntry] + split_ifs with hji + · exact hb + · exact dist_pos.mpr (fun h => hji (hx h.symm)) + +theorem cap_le_fixed {ι : Type*} [Fintype ι] [DecidableEq ι] + (b : ℝ) (x : ι → ℂ) (i : ι) : cappedDistance b x i ≤ b := by + exact Finset.inf'_le (capEntry b x i) (Finset.mem_univ none) + +theorem cap_le_dist {ι : Type*} [Fintype ι] [DecidableEq ι] + (b : ℝ) (x : ι → ℂ) (i j : ι) (hij : i≠j) : + cappedDistance b x i ≤ dist (x i) (x j) := by + change Finset.univ.inf' Finset.univ_nonempty (capEntry b x i) ≤ _ + have h := Finset.inf'_le (capEntry b x i) (Finset.mem_univ (some j)) + simpa only [capEntry,ite_eq_right hij.symm] using h + +theorem continuous_cappedDistance {ι : Type*} [Fintype ι] [DecidableEq ι] + (b : ℝ) (i : ι) : Continuous (fun x : ι → ℂ => cappedDistance b x i) := by + apply Continuous.finset_inf'_apply Finset.univ_nonempty + intro o _ + cases o with + | none => exact continuous_const + | some j => + dsimp only [capEntry] + split_ifs + · exact continuous_const + · fun_prop + +def cappedDistanceKernel {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) : ℝ≥0∞ := + ∏ i, ENNReal.ofReal (cappedDistance b x i ^ (-α)) + +lemma measurable_cappedDistanceKernel {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) : Measurable (cappedDistanceKernel (ι := ι) α b) := by + apply Finset.measurable_prod + intro i _ + exact (((continuous_cappedDistance b i).measurable.pow_const (-α)).ennreal_ofReal) + +def rowChoice {ι : Type*} [DecidableEq ι] (α b : ℝ) (x : ι → ℂ) (i : ι) : Option ι → ℝ≥0∞ + | none => ENNReal.ofReal (b^(-α)) + | some j => if j=i then 0 else distanceKernel α (x i) (x j) + +lemma cap_reciprocal_le_row {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) (i : ι) : + ENNReal.ofReal (cappedDistance b x i ^ (-α)) ≤ ∑ o, rowChoice α b x i o := by + obtain ⟨o,_,ho⟩ := Finset.exists_mem_eq_inf' Finset.univ_nonempty (capEntry b x i) + change ENNReal.ofReal ((Finset.univ.inf' Finset.univ_nonempty (capEntry b x i))^(-α)) ≤ _ + rw [ho] + cases o with + | none => + exact Finset.single_le_sum (f := rowChoice α b x i) + (fun _ _ => bot_le) (Finset.mem_univ none) + | some j => + by_cases hji : j=i + · simpa only [capEntry,ite_eq_left hji,rowChoice] using + (Finset.single_le_sum (f := rowChoice α b x i) (fun _ _ => bot_le) (Finset.mem_univ none)) + · simpa only [capEntry,ite_eq_right hji,rowChoice,distanceKernel] using + (Finset.single_le_sum (f := rowChoice α b x i) (fun _ _ => bot_le) (Finset.mem_univ (some j))) + +lemma cappedDistanceKernel_le_expansion {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) : + cappedDistanceKernel α b x ≤ ∑ f : ι → Option ι, ∏ i, rowChoice α b x i (f i) := by + rw [← Fintype.prod_sum] + exact Finset.prod_le_prod (fun i _ => cap_reciprocal_le_row α b x i) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCenteredWeights.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCenteredWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce54f8c6f71e96e6d789ca3b255aa9e97aec4914 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCenteredWeights.lean @@ -0,0 +1,192 @@ +import OAI.Probability.SLE.Mass.LevelApproximants + +namespace OAI + +/-! A fixed additional approach event costs its target radius to the +codimension power, uniformly in the levels of the integrated weights. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +lemma lintegral_indicator_ofReal_prod_le_event + {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (P : Measure Ω) (E₀ E : Set Ω) (Y : ι → Ω → ℝ) (c : ι → ℝ) + (hY0 : ∀ i ω, 0 ≤ Y i ω) + (hY : ∀ ω ∈ E, ∀ i, Y i ω ≤ c i) + (hzero : ∀ ω, ω ∈ E₀ → ω ∉ E → ∃ i, Y i ω = 0) : + (∫⁻ ω, E₀.indicator (fun ω => ENNReal.ofReal (∏ i, Y i ω)) ω ∂P) ≤ + ENNReal.ofReal (∏ i, c i) * P E := by + classical + apply (lintegral_mono (fun ω => ?_)).trans (lintegral_indicator_const_le E _) + by_cases hω₀ : ω ∈ E₀ + · rw [indicator_of_mem hω₀] + by_cases hω : ω ∈ E + · rw [indicator_of_mem hω] + exact ENNReal.ofReal_le_ofReal (Finset.prod_le_prod₀ (fun i _ => hY0 i ω) + (fun i _ => hY ω hω i)) + · obtain ⟨i,hi⟩ := hzero ω hω₀ hω + rw [Finset.prod_eq_zero (Finset.mem_univ i) hi,ENNReal.ofReal_zero] + exact bot_le + · rw [indicator_of_notMem hω₀] + exact bot_le + +theorem stoppedGreen_centered_product_expectation_bound + {Ω : Type*} [mΩ : MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (m : ℕ) + (z : Fin (m+1) → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (hne : Function.Injective z) (b e : Fin (m+1) → ℝ) + (he : ∀ i, 0 < e i) (hb : ∀ i, 0 < b i) + (hbR : ∀ i, b i ≤ 2*(z i).im) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (z i) (z j)) : + (∫⁻ ω, {ω | ∃ t : ℝ≥0, z 0 ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t (z 0) ≤ e 0}.indicator + (fun ω => ENNReal.ofReal (∏ i : Fin m, stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i.succ) (Real.log (2*(z i.succ).im/e i.succ)))) ω ∂P) ≤ + ENNReal.ofReal ((3 : ℝ)^(m+1) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset (Fin (m+1)))) * + (e 0)^(codimension κ) * ∏ i, (b i)^(-codimension κ)) := by + classical + let E₀ := {ω | ∃ t : ℝ≥0, z 0 ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t (z 0) ≤ e 0} + let E := {ω | ω ∈ E₀ ∧ ∀ i : Fin m, + radiusLevelTime (γ ω) (G ω) (z i.succ) (Real.log (2*(z i.succ).im/e i.succ)) < ∞} + let Y := fun (i : Fin m) ω => stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i.succ) (Real.log (2*(z i.succ).im/e i.succ)) + let W := ∏ i : Fin m, (e i.succ)^(-codimension κ) + let C := (3 : ℝ)^(m+1) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset (Fin (m+1)))) + have hW : 0 ≤ W := Finset.prod_nonneg (fun i _ => Real.rpow_nonneg (he i.succ).le _) + have hC : 0 ≤ C := by dsimp [C]; positivity + have hint := lintegral_indicator_ofReal_prod_le_event P E₀ E Y + (fun i => (e i.succ)^(-codimension κ)) + (fun i ω => stoppedGreen_nonneg (hw ω) κ _ _) + (fun ω _ i => stoppedGreen_level_bound (continuous_const.mul (hBc ω)) + (hw ω) hκ hκ8 (z i.succ) (hz i.succ) (e i.succ) (he i.succ)) (fun ω hω hn => by + have hn' : ¬ ∀ i : Fin m, + radiusLevelTime (γ ω) (G ω) (z i.succ) (Real.log (2*(z i.succ).im/e i.succ)) < ∞ := + fun hi => hn ⟨hω,hi⟩ + obtain ⟨i,hi⟩ := not_forall.mp hn' + exact ⟨i,by simp only [Y,stoppedGreen,ite_eq_right hi]⟩) + have hprob := capped_physical_radius_multipoint_bound hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth (fun z : ℂ => z) differentiableOn_id (fun _ _ _ _ h => h) + z hz hne (fun i => 2*(z i).im) b e he hb + (fun i => by simpa only [deriv_id'',norm_one,mul_one] using hbR i) + (fun i => by simp only [deriv_id'',norm_one,mul_one]) hsep + have hsub : E ⊆ {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t (z i) ≤ e i} := by + intro ω hω + refine Fin.cases hω.1 (fun i => ?_) + obtain ⟨t,ht,hR⟩ := (physical_radius_eq_hit_iff_finite_level + (continuous_const.mul (hBc ω)) (hw ω) (fun z : ℂ => z) (z i.succ) + (2*(z i.succ).im) (e i.succ) (mul_pos (by norm_num) (hz i.succ)) (he i.succ) + (by simp only [deriv_id'',norm_one,mul_one])).mpr (hω.2 i) + exact ⟨t,ht,hR.le⟩ + have hα : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + have hp : W * (∏ i, min 1 ((e i/b i)^(1-κ/8))) ≤ + (e 0)^(codimension κ) * ∏ i, (b i)^(-codimension κ) := by + rw [← hα,Fin.prod_univ_succ] + have hroot : min 1 ((e 0/b 0)^codimension κ) ≤ + (e 0)^codimension κ * (b 0)^(-codimension κ) := by + rw [Real.rpow_neg (hb 0).le,← div_eq_mul_inv,← Real.div_rpow (he 0).le (hb 0).le] + exact min_le_right _ _ + have htail : W * (∏ i : Fin m, min 1 ((e i.succ/b i.succ)^codimension κ)) ≤ + ∏ i : Fin m, (b i.succ)^(-codimension κ) := by + dsimp only [W] + rw [← Finset.prod_mul_distrib] + apply Finset.prod_le_prod₀ + · intro i _ + exact mul_nonneg (Real.rpow_nonneg (he i.succ).le _) + (le_min zero_le_one (Real.rpow_nonneg (div_nonneg (he i.succ).le (hb i.succ).le) _)) + · exact fun i _ => target_weight_capped (hb i.succ) (he i.succ) + calc + _ = min 1 ((e 0/b 0)^codimension κ) * + (W * ∏ i : Fin m, min 1 ((e i.succ/b i.succ)^codimension κ)) := by ring + _ ≤ ((e 0)^codimension κ * (b 0)^(-codimension κ)) * + ∏ i : Fin m, (b i.succ)^(-codimension κ) := + mul_le_mul hroot htail (mul_nonneg hW (Finset.prod_nonneg (fun i _ => + le_min zero_le_one (Real.rpow_nonneg (div_nonneg (he i.succ).le (hb i.succ).le) _)))) + (mul_nonneg (Real.rpow_nonneg (he 0).le _) (Real.rpow_nonneg (hb 0).le _)) + _ = _ := by rw [Fin.prod_univ_succ]; ring + calc + _ ≤ ENNReal.ofReal W * P E := hint + _ ≤ ENNReal.ofReal W * ENNReal.ofReal (C * ∏ i, min 1 ((e i/b i)^(1-κ/8))) := + mul_le_mul' le_rfl ((measure_mono hsub).trans (by simpa only [Fintype.card_fin] using hprob)) + _ = ENNReal.ofReal (C * (W * ∏ i, min 1 ((e i/b i)^(1-κ/8)))) := by + rw [← ENNReal.ofReal_mul hW] + congr 1 + ring + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + simpa only [C,mul_assoc] using (mul_le_mul_of_nonneg_left hp hC)) + +lemma measurableSet_physical_radius_hit + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ : ℝ) (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) (e : ℝ) (he : 0 < e) (heR : e ≤ 2*z.im) : + MeasurableSet {ω | ∃ t : ℝ≥0, z ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t z ≤ e} := by + have hu : 0 ≤ Real.log (2*z.im/e) := + Real.log_nonneg ((one_le_div he).mpr heR) + have hj : Measurable (fun q : Ω × ℂ => + radiusLevelTime (γ q.1) (G q.1) q.2 (Real.log (2*z.im/e))) := + actual_radiusLevel_joint_measurable hm hBc κ (Real.log (2*z.im/e)) hu γ G F hw + have hp : Measurable (fun ω : Ω => (ω,z)) := + (measurable_id : Measurable (fun ω : Ω => ω)).prodMk + (measurable_const : Measurable (fun _ : Ω => z)) + have hc := hj.comp hp + have hmτ : Measurable (fun ω => radiusLevelTime (γ ω) (G ω) z (Real.log (2*z.im/e))) := by + simpa only [Function.comp_def] using hc + suffices hE : {ω | ∃ t : ℝ≥0, z ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t z ≤ e} = + {ω | radiusLevelTime (γ ω) (G ω) z (Real.log (2*z.im/e)) < (⊤ : ℝ≥0∞)} by + rw [hE] + exact measurableSet_lt hmτ measurable_const + ext ω + exact physical_radius_hit_iff_finite_level (continuous_const.mul (hBc ω)) (hw ω) + (fun z : ℂ => z) z (2*z.im) e (mul_pos (by norm_num) hz) he heR + (by simp only [deriv_id'',norm_one,mul_one]) + +theorem stoppedGreen_centered_common_level_bound + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (m : ℕ) + (z : Fin (m+1) → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (hne : Function.Injective z) (b : Fin (m+1) → ℝ) + (hb : ∀ i, 0 < b i) (hbR : ∀ i, b i ≤ 2*(z i).im) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (z i) (z j)) + (e₀ : ℝ) (he₀ : 0 < e₀) (u : ℝ) : + (∫⁻ ω, {ω | ∃ t : ℝ≥0, z 0 ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t (z 0) ≤ e₀}.indicator + (fun ω => ENNReal.ofReal (∏ i : Fin m, stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i.succ) u)) ω ∂P) ≤ + ENNReal.ofReal (multipointConstant κ (m+1) * + e₀^(codimension κ) * ∏ i, (b i)^(-codimension κ)) := by + let e : Fin (m+1) → ℝ := Fin.cons e₀ (fun i => 2*(z i.succ).im*Real.exp (-u)) + have he : ∀ i, 0 < e i := by + refine Fin.cases he₀ (fun i => ?_) + exact mul_pos (mul_pos (by norm_num) (hz i.succ)) (Real.exp_pos _) + have h := stoppedGreen_centered_product_expectation_bound hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth m z hz hne b e he hb hbR hsep + simpa only [e,Fin.cons_zero,Fin.cons_succ,common_level_log_target _ (hz _) u, + multipointConstant] using h + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointClippedState.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointClippedState.lean new file mode 100644 index 0000000000000000000000000000000000000000..53c37006c6bd5f34f3ca7077678e8049d2998714 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointClippedState.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SLE.BoundaryDensity + +namespace OAI + +/-! Simultaneous bounded adapted logarithmic Loewner coordinates. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +lemma measurable_clipped_multipoint_velocity + {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (Q : ℝ → Ω → (ι → ℂ × ℝ)) (U : ℝ → Ω → ℝ) + (hQ : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hU : Measurable (fun p : ℝ × Ω => U p.1 p.2)) + (lo hi : ℝ) (hle : lo ≤ hi) : + Measurable (fun p : ℝ × Ω => fun i => + clippedLogLoewnerField lo hi hle (U p.1 p.2) (Q p.1 p.2 i)) := by + apply Measurable.of_eval + intro i + have hqi : Measurable (fun p : ℝ × Ω => Q p.1 p.2 i) := + (measurable_pi_apply i).comp hQ + have hf : Measurable (fun p : ℝ × (ℂ × ℝ) => + clippedLogLoewnerField lo hi hle p.1 p.2) := + (continuous_clippedLogLoewnerField lo hi hle).measurable + have hp : Measurable (fun p : ℝ × Ω => (U p.1 p.2,Q p.1 p.2 i)) := hU.prodMk hqi + change Measurable ((fun p : ℝ × (ℂ × ℝ) => clippedLogLoewnerField lo hi hle p.1 p.2) ∘ + (fun p : ℝ × Ω => (U p.1 p.2,Q p.1 p.2 i))) + exact hf.comp hp + +theorem exists_clipped_multipoint_state + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun p : ℝ≥0 × Ω => B p.1 p.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ lo hi : ℝ) (hle : lo ≤ hi) (q₀ : ι → ℂ × ℝ) : + ∃ (L : ℝ≥0) (Q V : ℝ → Ω → (ι → ℂ × ℝ)), + Measurable (fun p : ℝ × Ω => Q p.1 p.2) ∧ + Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t) ∧ + (∀ ω, LipschitzWith L (fun t => Q t ω)) ∧ + Measurable (fun p : ℝ × Ω => V p.1 p.2) ∧ + (∀ t ω, ‖V t ω‖ ≤ L) ∧ + (∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t) ∧ + (∀ ω t, 0 ≤ t → HasDerivWithinAt (fun u => Q u ω) (V t ω) (Ici 0) t) ∧ + (∀ ω, Q 0 ω = q₀) ∧ + (∀ t ω i, V t ω i = clippedLogLoewnerField lo hi hle + (Real.sqrt κ*B t.toNNReal ω) (Q t ω i)) := by + classical + let c (i : ι) : ClippedLogSolution B hm κ lo hi hle (q₀ i) := + Classical.choice (exists_clippedLogSolution B hm hBm hBc κ lo hi hle (q₀ i)) + clear_value c + obtain ⟨L₀, K₀, hbound, _⟩ := clippedLogLoewnerField_bounds lo hi hle + let L : ℝ≥0 := L₀ + ∑ i, (c i).L + let Q := fun t ω i => (c i).Q t ω + let V := fun t ω i => clippedLogLoewnerField lo hi hle + (Real.sqrt κ*B t.toNNReal ω) (Q t ω i) + have hLi (i : ι) : (c i).L ≤ L := by + change (c i).L ≤ L₀+∑ j, (c j).L + exact (Finset.single_le_sum (fun j _ => (zero_le : 0 ≤ (c j).L)) (Finset.mem_univ i)).trans + (le_add_left le_rfl) + have hL₀ : L₀ ≤ L := le_add_of_nonneg_right (by positivity) + have hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2) := + Measurable.of_eval (fun i => (c i).measurable) + have hQadapt (t : ℝ≥0) (i : ι) : + @Measurable Ω (ℂ × ℝ) + ((Filtration.natural B (fun t => (hm t).stronglyMeasurable)) t) _ + (fun ω => Q t ω i) := (c i).adapted t + have hUm : Measurable (fun p : ℝ × Ω => Real.sqrt κ*B p.1.toNNReal p.2) := + (hBm.comp ((continuous_real_toNNReal.measurable.comp measurable_fst).prodMk measurable_snd)).const_mul _ + refine ⟨L, Q, V, hQm, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro t + let : MeasurableSpace Ω := (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) t + exact Measurable.of_eval (hQadapt t) + · intro ω + apply LipschitzWith.of_dist_le_mul + intro t u + apply (dist_pi_le_iff (mul_nonneg L.coe_nonneg dist_nonneg)).mpr + intro i + exact ((c i).lipschitz ω).dist_le_mul t u |>.trans + (mul_le_mul_of_nonneg_right (by exact_mod_cast hLi i) dist_nonneg) + · exact measurable_clipped_multipoint_velocity Q + (fun t ω => Real.sqrt κ * B t.toNNReal ω) hQm hUm lo hi hle + · intro t ω + apply (pi_norm_le_iff_of_nonneg L.coe_nonneg).mpr + intro i + change ‖clippedLogLoewnerField lo hi hle + (Real.sqrt κ * B t.toNNReal ω) (Q t ω i)‖ ≤ (L : ℝ) + have hb := hbound (Real.sqrt κ * B t.toNNReal ω) (Q t ω i) + exact hb.trans (by exact_mod_cast hL₀) + · intro ω + exact Eventually.of_forall fun t ht => hasDerivAt_pi.mpr fun i => + ((c i).derivative ω t ht.le).hasDerivAt (Ici_mem_nhds ht) + · intro ω t ht + exact hasDerivWithinAt_pi.mpr (fun i => (c i).derivative ω t ht) + · intro ω + funext i + exact (c i).initial ω + · intro t ω i + rfl + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCompactField.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCompactField.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a832996ef7ce79f165d1912b7fe37eadf57da7b --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCompactField.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SLE.Multipoint.MultipointDiscountedField + +namespace OAI + +/-! Compact smooth tests agreeing with the discounted product on each +bounded localization region. -/ + +noncomputable section +open Set Filter +open scoped Topology + +namespace SLEExactGauge.Multipoint + +theorem exists_compact_discounted_field {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) + (R : ℝ) (hR : 0 ≤ R) : + ∃ φ : ((ι → ℂ × ℝ) × ℝ) × ℝ → ℝ, + ContDiff ℝ (⊤ : ℕ∞) φ ∧ HasCompactSupport φ ∧ (∀ p, 0 ≤ φ p) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → φ (z,x) = discountedProduct s κ D σ z x) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → + fderiv ℝ φ (z,x) = + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) (z,x)) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → iteratedDeriv 2 (fun y => φ (z,y)) x = + iteratedDeriv 2 (discountedProduct s κ D σ z) x) := by + let b : ContDiffBump (0 : ((ι → ℂ × ℝ) × ℝ) × ℝ) := + ⟨R+1, R+2, by linarith, by linarith⟩ + let φ := fun p : ((ι → ℂ × ℝ) × ℝ) × ℝ => b p*discountedProduct s κ D σ p.1 p.2 + have hnear (p : ((ι → ℂ × ℝ) × ℝ) × ℝ) (hp : ‖p‖ ≤ R) : + φ =ᶠ[𝓝 p] (fun q => discountedProduct s κ D σ q.1 q.2) := by + have hball : p ∈ Metric.ball (0 : ((ι → ℂ × ℝ) × ℝ) × ℝ) b.rIn := by + simp only [Metric.mem_ball, dist_zero_right] + change ‖p‖ < R+1 + linarith + filter_upwards [b.eventuallyEq_one_of_mem_ball hball] with q hq + simp only [φ, hq, Pi.one_apply, one_mul] + refine ⟨φ, b.contDiff.mul (discountedProduct_contDiff s κ D σ), b.hasCompactSupport.mul_right, + ?_, (fun z x h => (hnear (z,x) h).eq_of_nhds), ?_, ?_⟩ + · intro p + apply mul_nonneg b.nonneg + apply mul_nonneg (Real.exp_pos _).le + exact (Finset.prod_pos (fun i hi => regularizedLogFactor_pos κ (D i) (σ i) (hD i hi) _ _)).le + · intro z x h + exact (hnear (z,x) h).fderiv_eq + · intro z x h + have he := (hnear (z,x) h).comp_tendsto + ((continuous_const.prodMk continuous_id).tendsto x) + exact he.iteratedDeriv_eq 2 + +lemma discountedProduct_pair_directional {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) + (z v : (ι → ℂ × ℝ) × ℝ) (x : ℝ) : + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) (z,x) (v,0) = + fderiv ℝ (fun q => discountedProduct s κ D σ q x) z v := by + have hd := ((discountedProduct_contDiff s κ D σ).differentiable (by simp)) (z,x) + have hp := (hasFDerivAt_id (𝕜 := ℝ) z).prodMk + (hasFDerivAt_const (𝕜 := ℝ) (E := (ι → ℂ × ℝ) × ℝ) x z) + have hc := (hd.hasFDerivAt.comp z hp).fderiv + have he := congrArg (fun A : ((ι → ℂ × ℝ) × ℝ) →L[ℝ] ℝ => A v) hc + simpa only [Function.comp_def, ContinuousLinearMap.comp_apply, ContinuousLinearMap.prod_apply, + ContinuousLinearMap.id_apply, id_eq, zero_apply] using he.symm + +theorem compact_discounted_generator_nonpos {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (b x : ℝ) + (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (hδ : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (z i) ≤ 1) + (φ : ((ι → ℂ × ℝ) × ℝ) × ℝ → ℝ) + (hφD : fderiv ℝ φ ((z,b),x) = + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) ((z,b),x)) + (hφ2 : iteratedDeriv 2 (fun y => φ ((z,b),y)) x = + iteratedDeriv 2 (discountedProduct s κ D σ (z,b)) x) : + fderiv ℝ φ ((z,b),x) + (((fun i => physicalLogLoewnerField (Real.sqrt κ*x) (z i)), + productDriftCost s κ D σ z x),0) + + (1/2 : ℝ)*iteratedDeriv 2 (fun y => φ ((z,b),y)) x ≤ 0 := by + rw [hφD, hφ2, discountedProduct_pair_directional] + exact discountedProduct_generator_nonpos s κ hκ hκ8 D σ z b x hD hσ hδ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCompletionExhaustion.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCompletionExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a36cc70cbff4e0be83b77ebcd46992021f0913d --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCompletionExhaustion.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Multipoint.MultipointCutoffExhaustion +import OAI.Probability.SLE.Multipoint.MultipointActualPhases + +namespace OAI + +/-! On the literal event that every target radius is reached, every +factor is eventually completed before the localization cutoff. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +theorem eventually_all_completed_of_finite_radius_levels + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ A : ℝ) (hA : 0 ≤ A) (z : ι → ℂ) (u₀ u₂ : ι → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (F ω)) + (S : ∀ n : ℕ, LocalizedState B hm κ (-(A+n+1)) (A+n+1) (A+n+1) + ((n : ℝ≥0)+1) z + (fun i => actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2)) γ G) + (ω : Ω) (hfinish : ∀ i, radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) < ⊤) : + ∀ᶠ n : ℕ in atTop, + (∀ i, actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2) ω ≤ (S n).χ ω) ∧ + phaseAt (actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1)) ((S n).χ ω) ω = + fun _ => 3 := by + classical + have hex (i : ι) : ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) = (t : ℝ≥0∞) := by + obtain ⟨t,ht,hR⟩ := exists_live_level_of_radiusLevelTime_lt_top + (γ ω) (G ω) (z i) (u₂ i) (hfinish i) + exact ⟨t,ht,radiusLevelTime_eq_of_live_level + (continuous_const.mul (hBc ω)) (hw ω) (z i) (u₂ i) t ht hR⟩ + choose σ hσlive hσeq using hex + let T : ℝ≥0 := (∑ i, σ i)+1 + have hσT (i : ι) : σ i ≤ T := by + exact (Finset.single_le_sum (fun j _ => (show 0 ≤ σ j from bot_le)) (Finset.mem_univ i)).trans + (le_add_of_nonneg_right zero_le) + have hlarge : ∀ᶠ n : ℕ in atTop, (T : ℝ) < (n : ℝ) := + (tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop).eventually + (eventually_gt_atTop (T : ℝ)) + have hτ : ∀ᶠ n : ℕ in atTop, + ∀ i, actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2) ω = σ i := by + filter_upwards [hlarge] with n hn i + have hbound : σ i ≤ ((n : ℝ≥0)+1)+1 := by + have hsT : (σ i : ℝ) ≤ (T : ℝ) := by exact_mod_cast hσT i + exact_mod_cast (show (σ i : ℝ) ≤ ((n : ℝ)+1)+1 from by linarith) + change cutoffStop (fun ω => radiusLevelTime (γ ω) (G ω) (z i) + (factorRadiusLevel (u₀ i) (u₂ i) 2)) (((n : ℝ≥0)+1)+1) ω = σ i + have hfactor : factorRadiusLevel (u₀ i) (u₂ i) 2 = u₂ i := by + norm_num [factorRadiusLevel] + simp only [hfactor] + change (min (radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) : WithTop ℝ≥0) + ((((n : ℝ≥0)+1)+1 : ℝ≥0) : WithTop ℝ≥0)).untopD 0 = σ i + have he : (radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) : WithTop ℝ≥0) = + (σ i : WithTop ℝ≥0) := hσeq i + have hemin : min (radiusLevelTime (γ ω) (G ω) (z i) (u₂ i) : WithTop ℝ≥0) + ((((n : ℝ≥0)+1)+1 : ℝ≥0) : WithTop ℝ≥0) = (σ i : WithTop ℝ≥0) := + (congrArg (fun q : WithTop ℝ≥0 => min q + ((((n : ℝ≥0)+1)+1 : ℝ≥0) : WithTop ℝ≥0)) he).trans + (min_eq_left (WithTop.coe_le_coe.mpr hbound)) + exact congrArg (WithTop.untopD 0) hemin + have hχ := eventually_localization_after_completed B hm hBc κ A hA z + (fun n i => actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2)) + γ G F hw S ω σ T hσT hσlive hτ + filter_upwards [hτ,hχ] with n hτn hχn + have hdone (i : ι) : + actualFactorStops γ G z u₀ u₂ ((n : ℝ≥0)+1) (i,2) ω ≤ (S n).χ ω := by + rw [hτn i] + exact (hσT i).trans hχn.le + exact ⟨hdone,funext (fun i => by simp only [phaseAt,ite_eq_left (hdone i)])⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCostAssembly.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCostAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..731e206d68fd4a215a6644a0714e4b593d910178 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCostAssembly.lean @@ -0,0 +1,115 @@ +import OAI.Probability.SLE.Multipoint.MultipointActiveCosts +import OAI.Probability.SLE.Multipoint.MultipointPatternProduct + +namespace OAI + +/-! Integrating the actual phase-selected cost through the individual +live intervals. No common survival endpoint is imposed on all points. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem actual_phase_cost_integral_le {ι : Type*} [Fintype ι] [DecidableEq ι] + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (I : Finset ι) (z : ι → ℂ) (hne : Set.InjOn z (I : Set ι)) + (β : ℝ) (hβ : 0 < β) (hdecay : 2*(exponent (greenExponent κ)*β) < 2/κ) + (a U : ι → ℝ) (hU : ∀ i ∈ I, 0 ≤ U i) + (σ T : ι → ℝ≥0) (H : ℝ≥0) + (hσT : ∀ i ∈ I, σ i ≤ T i) (hTH : ∀ i ∈ I, T i ≤ H) + (hz : ∀ i ∈ I, z i ∈ survivingDomain γ (T i)) + (hstart : ∀ i ∈ I, σ i < T i → logFactorClock κ (logLoewnerCoordinates G (z i) (σ i)) = a i) + (hend : ∀ i ∈ I, σ i < T i → logFactorClock κ (logLoewnerCoordinates G (z i) (T i))-a i ≤ U i) + (hgeo : ∀ i ∈ I, ∀ j ∈ I, i ≠ j → σ i < T i → σ j < T j → + physicalConformalRadius J G (σ i) (z i) ≤ dist (J (z i)) (J (z j))) + (Q : ℝ → ι → ℂ × ℝ) (j : ℝ → ι → Fin 4) + (hj : ∀ t ∈ Ico 0 (H : ℝ), patternActiveSet (j t) ⊆ I) + (hactive : ∀ t ∈ Ico 0 (H : ℝ), ∀ i ∈ patternActiveSet (j t), + (σ i : ℝ) ≤ t ∧ t ≤ (T i : ℝ)) + (hQ : ∀ t ∈ Ico 0 (H : ℝ), ∀ i ∈ patternActiveSet (j t), + Q t i = logLoewnerCoordinates G (z i) t) + (hreg : ∀ t ∈ Ico 0 (H : ℝ), ∀ i ∈ patternActiveSet (j t), + branchRegulator κ (phaseRegulatorScale β (a i) (U i) (j t i)) + (phaseRegulatorSlope β (j t i)) (Q t i) = + regulator β (U i) (logFactorClock κ (logLoewnerCoordinates G (z i) t)-a i)) + (R : ℝ → ℝ) (hR : IntervalIntegrable R volume 0 (H : ℝ)) + (hcost : ∀ t ∈ Ico 0 (H : ℝ), R t = + productDriftCost (patternActiveSet (j t)) κ + (fun i => phaseRegulatorScale β (a i) (U i) (j t i)) + (fun i => phaseRegulatorSlope β (j t i)) (Q t) (B t.toNNReal)) : + (∫ t in (0 : ℝ)..(H : ℝ), R t) ≤ uniformDiscountBudget κ β I := by + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + let f := fun i => actualSingleCost κ β (a i) (U i) B G (z i) + let g := fun ij : ι × ι => actualPairCost κ β (a ij.1) (a ij.2) + (U ij.1) (U ij.2) B G (z ij.1) (z ij.2) + let c := fun ij : ι × ι => overlapStart (σ ij.1) (σ ij.2) + let d := fun ij : ι × ι => overlapEnd (σ ij.1) (σ ij.2) (T ij.1) (T ij.2) + have hf (i) (hi : i ∈ I) := actualSingleCost_bound hκ hB hw (σ i) (T i) (hσT i hi) + (z i) (hz i hi) β (a i) (U i) hβ (hU i hi) (hstart i hi) (hend i hi) + have hg (ij : ι × ι) (hij : ij ∈ I.offDiag) : + IntervalIntegrable (g ij) volume (c ij : ℝ) (d ij : ℝ) ∧ + (∫ t in (c ij : ℝ)..(d ij : ℝ), g ij t) ≤ + interactionBudget 2 (exponent (greenExponent κ)*(κ*β)) := by + obtain ⟨hi,hj,hneij⟩ := Finset.mem_offDiag.mp hij + exact actualPairCost_bound hκ hB hw hgrowth J hJ hJinj (σ ij.1) (σ ij.2) + (T ij.1) (T ij.2) (z ij.1) (z ij.2) (hz _ hi) (hz _ hj) + (fun he => hneij (hne hi hj he)) β (a ij.1) (a ij.2) (U ij.1) (U ij.2) + hβ.le (exponent_pos hp).le hdecay (hstart _ hi) (hstart _ hj) + (hgeo _ hi _ hj hneij) (fun h₁ h₂ => by + simpa only [dist_comm] using hgeo _ hj _ hi hneij.symm h₂ h₁) + have hcH (ij : ι × ι) (hij : ij ∈ I.offDiag) : c ij ≤ H := by + obtain ⟨hi,hj,_⟩ := Finset.mem_offDiag.mp hij + exact max_le ((hσT _ hi).trans (hTH _ hi)) ((hσT _ hj).trans (hTH _ hj)) + have hdH (ij : ι × ι) (hij : ij ∈ I.offDiag) : d ij ≤ H := by + obtain ⟨hi,_,_⟩ := Finset.mem_offDiag.mp hij + exact max_le (hcH ij hij) ((min_le_left _ _).trans (hTH _ hi)) + apply integrated_uniform_discount_le hκ hκ8 β I (fun i => (σ i : ℝ)) + (fun i => (T i : ℝ)) (fun ij => (c ij : ℝ)) (fun ij => (d ij : ℝ)) H H.coe_nonneg f g + (fun i _ => (σ i).coe_nonneg) (fun i hi => by exact_mod_cast hσT i hi) + (fun i hi => by exact_mod_cast hTH i hi) + (fun ij _ => (c ij).coe_nonneg) (fun ij _ => by exact_mod_cast le_max_left (c ij) (min (T ij.1) (T ij.2))) + (fun ij hij => by exact_mod_cast hdH ij hij) + (fun i hi => (hf i hi).1) (fun ij hij => (hg ij hij).1) + (fun i hi => (hf i hi).2) (fun ij hij => (hg ij hij).2) R hR + have hnσ : ∀ᵐ t : ℝ, ∀ i, t ≠ (σ i : ℝ) := + ae_all_iff.mpr (fun i => volume.ae_ne (σ i : ℝ)) + filter_upwards [ae_restrict_mem measurableSet_Icc, + ae_restrict_of_ae (volume.ae_ne (H : ℝ)), ae_restrict_of_ae hnσ] with t ht hneH hnσ + have ht' : t ∈ Ico 0 (H : ℝ) := ⟨ht.1, lt_of_le_of_ne ht.2 hneH⟩ + rw [hcost t ht'] + have his (i : ι) (hi : i ∈ patternActiveSet (j t)) : t ∈ Ioc (σ i : ℝ) (T i : ℝ) := + ⟨lt_of_le_of_ne (hactive t ht' i hi).1 (hnσ i).symm, (hactive t ht' i hi).2⟩ + apply productDriftCost_le_active_envelope hκ hκ8 (hj t ht') + (fun i => phaseRegulatorScale β (a i) (U i) (j t i)) + (fun i => phaseRegulatorSlope β (j t i)) (fun i _ => phaseRegulatorScale_pos _ _ _ _) + (Q t) (B t.toNNReal) t (fun i => (σ i : ℝ)) (fun i => (T i : ℝ)) + (fun ij => (c ij : ℝ)) (fun ij => (d ij : ℝ)) f g + (fun i _ => actualSingleCost_nonneg _ _ _ _ _ _ _ _) + (fun ij _ => actualPairCost_nonneg _ _ _ _ _ _ _ _ _ _ _) his + · intro ij hij + obtain ⟨hi,hj,_⟩ := Finset.mem_offDiag.mp hij + refine ⟨?_,?_⟩ + · exact max_lt (his _ hi).1 (his _ hj).1 + · exact (le_min (his _ hi).2 (his _ hj).2).trans (by exact_mod_cast le_max_right (c ij) (min (T ij.1) (T ij.2))) + · intro i hi + rw [hreg t ht' i hi, hQ t ht' i hi] + rfl + · intro ij hij + obtain ⟨hi,hj,_⟩ := Finset.mem_offDiag.mp hij + rw [hreg t ht' _ hi, hreg t ht' _ hj, hQ t ht' _ hi, hQ t ht' _ hj] + rfl + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCutoff.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7d7fc10cb002ff33c8530120aeca014124fdc46 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoff.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +/-! Exhaustion of successful multipoint paths by nonsingular cutoffs. +Each point is monitored only through its own completion time. Later +swallowing of an already completed point does not enter this lemma. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal + +namespace SLEExactGauge.Multipoint + +lemma eventually_compact_positive_reciprocal {X : Type*} [TopologicalSpace X] + {K : Set X} (hK : IsCompact K) {f : X → ℝ} (hf : ContinuousOn f K) + (hpos : ∀ x ∈ K, 0 < f x) : + ∀ᶠ n : ℕ in atTop, ∀ x ∈ K, 1 / ((n : ℝ)+1) < f x := by + by_cases hne : K.Nonempty + · obtain ⟨x, hx, hmin⟩ := hK.exists_isMinOn hne hf + filter_upwards [(tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).eventually + (gt_mem_nhds (hpos x hx))] with n hn + intro y hy + exact hn.trans_le (hmin hy) + · exact Eventually.of_forall (fun _ x hx => False.elim (hne ⟨x, hx⟩)) + +/-- On a successful path, finitely many individually stopped points admit +one common height, angle, and physical-time cutoff. -/ +theorem successful_path_eventually_inside_cutoff + {ι : Type*} [Finite ι] (T : ι → ℝ) (Y θ : ι → ℝ → ℝ) + (hY : ∀ i, ContinuousOn (Y i) (Icc 0 (T i))) + (hθ : ∀ i, ContinuousOn (θ i) (Icc 0 (T i))) + (hYpos : ∀ i t, t ∈ Icc 0 (T i) → 0 < Y i t) + (hθpos : ∀ i t, t ∈ Icc 0 (T i) → 0 < θ i t) + (hθpi : ∀ i t, t ∈ Icc 0 (T i) → θ i t < Real.pi) : + ∀ᶠ n : ℕ in atTop, ∀ i, + T i < (n : ℝ)+1 ∧ ∀ t ∈ Icc 0 (T i), + 1 / ((n : ℝ)+1) < Y i t ∧ + 1 / ((n : ℝ)+1) < θ i t ∧ + θ i t < Real.pi - 1 / ((n : ℝ)+1) := by + apply eventually_all.mpr + intro i + have htime : ∀ᶠ n : ℕ in atTop, T i < (n : ℝ)+1 := by + obtain ⟨N, hN⟩ := exists_nat_gt (T i) + filter_upwards [eventually_ge_atTop N] with n hn + have hcast : (N : ℝ) ≤ n := by exact_mod_cast hn + linarith + have hheight := eventually_compact_positive_reciprocal isCompact_Icc (hY i) (hYpos i) + have hangle := eventually_compact_positive_reciprocal isCompact_Icc (hθ i) (hθpos i) + have hupper := eventually_compact_positive_reciprocal isCompact_Icc + (continuousOn_const.sub (hθ i)) (fun t ht => sub_pos.mpr (hθpi i t ht)) + filter_upwards [htime, hheight, hangle, hupper] with n hn hy ha hb + refine ⟨hn, fun t ht => ⟨hy t ht, ha t ht, ?_⟩⟩ + have hupper' : 1 / ((n : ℝ)+1) < Real.pi - θ i t := hb t ht + linarith + +/-- Bounds for nonsingular stopped products pass to the successful event +when each successful path eventually lies inside every cutoff. -/ +lemma measure_le_of_eventual_cutoffs {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (E : Set Ω) (cutoff : ℕ → Set Ω) (C : ℝ≥0∞) + (hcover : ∀ ω ∈ E, ∀ᶠ n : ℕ in atTop, ω ∈ cutoff n) + (hbound : ∀ n, P (cutoff n) ≤ C) : P E ≤ C := by + let tail (N : ℕ) := ⋂ n ≥ N, cutoff n + have hmono : Monotone tail := by + intro N M hNM ω hω + simp only [tail, mem_iInter] at hω ⊢ + exact fun n hn => hω n (hNM.trans hn) + have hsub : E ⊆ ⋃ N, tail N := by + intro ω hω + obtain ⟨N, hN⟩ := eventually_atTop.mp (hcover ω hω) + exact mem_iUnion.mpr ⟨N, mem_iInter₂.mpr hN⟩ + apply (measure_mono hsub).trans + rw [hmono.measure_iUnion] + apply iSup_le + intro N + exact (measure_mono (show tail N ⊆ cutoff N from + fun ω hω => mem_iInter₂.mp hω N le_rfl)).trans (hbound N) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffExhaustion.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4a9f53073331d1e68f1f9886fa6f5124db1e001 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffExhaustion.lean @@ -0,0 +1,95 @@ +import OAI.Probability.SLE.Multipoint.MultipointCutoffSuccess + +namespace OAI + +/-! Integer localization bounds eventually contain every successful finite +family of completion prefixes. Height monotonicity reduces the spatial +bound to the two endpoints of each individual prefix. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem completion_prefixes_bounded_by_nat + {ι : Type*} [Fintype ι] + (B : ℝ≥0 → ℝ) (hB : Continuous B) + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) + (z : ι → ℂ) (τ : ι → ℝ≥0) + (hlive : ∀ i, z i ∈ survivingDomain γ (τ i)) (T : ℝ≥0) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + (∀ t : ℝ≥0, t ≤ T → |B t| < (n : ℝ)) ∧ + (∀ i (t : ℝ≥0), t ≤ τ i → + (logLoewnerCoordinates G (z i) t).1.im ∈ Ioo (-(n : ℝ)) (n : ℝ)) := by + classical + obtain ⟨b,hb⟩ := continuous_path_bounded_by_nat B hB T + let C : ℝ := ∑ i, (|Real.log (G (τ i) (z i)).im| + |Real.log (z i).im|) + obtain ⟨k,hk⟩ := exists_nat_gt C + refine ⟨max (b+1) k, fun n hn => ⟨?_, ?_⟩⟩ + · intro t ht + have hbn : (b : ℝ)+1 ≤ (n : ℝ) := by exact_mod_cast (le_max_left (b+1) k).trans hn + exact (hb t ht).trans_le hbn + · intro i t ht + have hi : |Real.log (G (τ i) (z i)).im| + |Real.log (z i).im| ≤ C := by + exact Finset.single_le_sum + (f := fun j => |Real.log (G (τ j) (z j)).im| + |Real.log (z j).im|) + (fun j _ => add_nonneg (abs_nonneg _) (abs_nonneg _)) (Finset.mem_univ i) + have hkn : (k : ℝ) ≤ (n : ℝ) := by exact_mod_cast (le_max_right (b+1) k).trans hn + have hh := hw.log_height_bounds (τ i) (z i) (hlive i) t + (show (t : ℝ) ∈ Icc 0 (τ i : ℝ) from ⟨t.coe_nonneg, by exact_mod_cast ht⟩) + simp only [Real.toNNReal_coe] at hh + have hl := neg_abs_le (Real.log (G (τ i) (z i)).im) + have hu := le_abs_self (Real.log (z i).im) + have hla := abs_nonneg (Real.log (G (τ i) (z i)).im) + have hua := abs_nonneg (Real.log (z i).im) + have hresult : Real.log (G t (z i)).im ∈ Ioo (-(n : ℝ)) (n : ℝ) := by + constructor <;> linarith + simpa only [logLoewnerCoordinates, Real.toNNReal_coe, Complex.add_im, + Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, + Complex.I_re, mul_one, mul_zero, add_zero, zero_add] using hresult + +/-- The standard integer localizations eventually survive beyond any +fixed successful completion horizon. Their frozen completion times may +be horizon truncations, provided those truncations eventually agree. -/ +theorem eventually_localization_after_completed + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ A : ℝ) (hA : 0 ≤ A) (z : ι → ℂ) + (τ : ℕ → ι → Ω → ℝ≥0) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (F ω)) + (S : ∀ n : ℕ, LocalizedState B hm κ (-(A+n+1)) (A+n+1) (A+n+1) + ((n : ℝ≥0)+1) z (τ n) γ G) + (ω : Ω) (σ : ι → ℝ≥0) (T : ℝ≥0) + (hσ : ∀ i, σ i ≤ T) + (hlive : ∀ i, z i ∈ survivingDomain (γ ω) (σ i)) + (hτ : ∀ᶠ n : ℕ in atTop, ∀ i, τ n i ω = σ i) : + ∀ᶠ n : ℕ in atTop, T < (S n).χ ω := by + obtain ⟨N,hN⟩ := completion_prefixes_bounded_by_nat + (fun t => B t ω) (hBc ω) (hw ω) z σ hlive T + have hlarge : ∀ᶠ n : ℕ in atTop, (T : ℝ) < (n : ℝ) := + (tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop).eventually + (eventually_gt_atTop (T : ℝ)) + filter_upwards [eventually_ge_atTop N, hlarge, hτ] with n hn hT hτn + have hupper : (n : ℝ) ≤ A+n+1 := by linarith + apply (S n).cutoff_after_completed ω T + · exact_mod_cast (show (T : ℝ) < (n : ℝ)+1 from by linarith) + · intro i + rw [hτn i] + exact hσ i + · intro t ht + exact ((hN n hn).1 t ht).trans_le hupper + · intro i t ht + rw [hτn i] at ht + have hi := (hN n hn).2 i t ht + exact ⟨(neg_le_neg hupper).trans_lt hi.1, hi.2.trans_le hupper⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffSuccess.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffSuccess.lean new file mode 100644 index 0000000000000000000000000000000000000000..386225aa50185b1122a3825b3a5c02e6da953c10 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointCutoffSuccess.lean @@ -0,0 +1,62 @@ +import OAI.Probability.SLE.Multipoint.MultipointLocalizedState + +namespace OAI + +/-! A successful path remains before the common localization boundary +once its finitely many completion prefixes have strict bounds. -/ + +noncomputable section +open Set MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +lemma LocalizedState.at_cutoff_eq_actual + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + {κ lo hi M : ℝ} {H : ℝ≥0} {z : ι → ℂ} {τ : ι → Ω → ℝ≥0} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (S : LocalizedState B hm κ lo hi M H z τ γ G) (ω : Ω) (i : ι) : + S.Q (S.χ ω) ω i = + logLoewnerCoordinates (G ω) (z i) (min (τ i ω) (S.χ ω) : ℝ≥0) := by + have ha := (S.actual ω i).2 + (show ((min (τ i ω) (S.χ ω) : ℝ≥0) : ℝ) ∈ + Icc (0 : ℝ) ((min (τ i ω) (S.χ ω) : ℝ≥0) : ℝ) from + ⟨(min (τ i ω) (S.χ ω)).coe_nonneg,le_rfl⟩) + by_cases hτχ : τ i ω ≤ S.χ ω + · rw [min_eq_left hτχ] at ha ⊢ + exact (S.frozen ω (S.χ ω) i hτχ).trans ha + · have hχτ : S.χ ω ≤ τ i ω := le_of_not_ge hτχ + simpa only [min_eq_right hχτ] using ha + +/-- Every point is monitored only up to its own completion. Once all +completion prefixes satisfy the strict bounds, the localization cannot +occur before the common completion horizon. -/ +theorem LocalizedState.cutoff_after_completed + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} + {κ lo hi M : ℝ} {H : ℝ≥0} {z : ι → ℂ} {τ : ι → Ω → ℝ≥0} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (S : LocalizedState B hm κ lo hi M H z τ γ G) (ω : Ω) + (T : ℝ≥0) (hT : T < H) (_hτ : ∀ i, τ i ω ≤ T) + (hB : ∀ t : ℝ≥0, t ≤ T → |B t ω| < M) + (hheight : ∀ i (t : ℝ≥0), t ≤ τ i ω → + (logLoewnerCoordinates (G ω) (z i) t).1.im ∈ Ioo lo hi) : + T < S.χ ω := by + by_contra hn + have hχT : S.χ ω ≤ T := le_of_not_gt hn + have hχH : S.χ ω < H := hχT.trans_lt hT + have hstrict (i : ι) : (S.Q (S.χ ω) ω i).1.im ∈ Ioo lo hi := by + rw [S.at_cutoff_eq_actual ω i] + exact hheight i _ (min_le_left _ _) + rcases S.boundary ω hχH with ⟨i,hi⟩ | hb + · rcases hi with hlow | hhigh + · exact (ne_of_gt (hstrict i).1) hlow + · exact (ne_of_lt (hstrict i).2) hhigh + · exact (ne_of_lt (hB (S.χ ω) hχT)) hb + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountClock.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountClock.lean new file mode 100644 index 0000000000000000000000000000000000000000..49c6ea815b7e154e5b28f325a911bb93a4ebebf2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountClock.lean @@ -0,0 +1,93 @@ +import OAI.Probability.SLE.OptionalStopping + +namespace OAI + +/-! The bounded accumulated drift used as the product's discount state. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +def discountClock {Ω : Type*} (g : ℝ≥0 → Ω → ℝ) (t : ℝ) (ω : Ω) : ℝ := + ∫ u in (0 : ℝ)..(t.toNNReal : ℝ), g u.toNNReal ω + +lemma discountClock_measurable {Ω : Type*} [MeasurableSpace Ω] + (g : ℝ≥0 → Ω → ℝ) (hg : Measurable (Function.uncurry g)) : + Measurable (fun p : ℝ × Ω => discountClock g p.1 p.2) := by + have hgr : Measurable (fun p : ℝ × Ω => g p.1.toNNReal p.2) := + hg.comp ((continuous_real_toNNReal.measurable.comp measurable_fst).prodMk measurable_snd) + exact (cumulative_integral_measurable _ hgr).comp + ((continuous_real_toNNReal.measurable.comp measurable_fst).prodMk measurable_snd) + +lemma discountClock_initial {Ω : Type*} (g : ℝ≥0 → Ω → ℝ) (ω : Ω) : + discountClock g 0 ω = 0 := by simp [discountClock] + +lemma discountClock_lipschitz {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Continuous (fun t => g t ω)) + (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (ω : Ω) : + LipschitzWith C (fun t => discountClock g t ω) := by + have hc : Continuous (fun u : ℝ => g u.toNNReal ω) := (hg ω).comp continuous_real_toNNReal + apply LipschitzWith.of_dist_le_mul + intro s t + rw [Real.dist_eq, ← Real.norm_eq_abs] + unfold discountClock + rw [intervalIntegral.integral_interval_sub_left (hc.intervalIntegrable _ _) (hc.intervalIntegrable _ _)] + have hb := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (t.toNNReal : ℝ)) (b := (s.toNNReal : ℝ)) (C := (C : ℝ)) + (f := fun u : ℝ => g u.toNNReal ω) + (fun u _ => by simpa only [Real.norm_eq_abs] using hC u.toNNReal ω) + apply hb.trans + apply mul_le_mul_of_nonneg_left _ C.coe_nonneg + have ht := Real.lipschitzWith_toNNReal.dist_le_mul s t + simpa only [NNReal.dist_eq, Real.dist_eq, NNReal.coe_one, one_mul] using ht + +lemma discountClock_derivative {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Continuous (fun t => g t ω)) + (t : ℝ) (ht : 0 ≤ t) (ω : Ω) : + HasDerivWithinAt (fun u => discountClock g u ω) (g t.toNNReal ω) (Ici 0) t := by + have hc : Continuous (fun u : ℝ => g u.toNNReal ω) := (hg ω).comp continuous_real_toNNReal + apply (hc.integral_hasStrictDerivAt 0 t).hasDerivAt.hasDerivWithinAt.congr_of_mem + · intro u hu + simp only [discountClock, Real.coe_toNNReal u hu] + · exact ht + +lemma discountClock_nonneg {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ t ω, 0 ≤ g t ω) (t : ℝ) (ω : Ω) : + 0 ≤ discountClock g t ω := by + apply intervalIntegral.integral_nonneg_of_forall t.toNNReal.coe_nonneg + exact fun u => hg u.toNNReal ω + +lemma discountClock_adapted {Ω : Type*} [mΩ : MeasurableSpace Ω] + (f : Filtration ℝ≥0 mΩ) (g : ℝ≥0 → Ω → ℝ) + (hga : Adapted f g) (hgc : ∀ ω, Continuous (fun t => g t ω)) : + Adapted f (fun t : ℝ≥0 => discountClock g t) := by + have hsa : StronglyAdapted f g := fun t => (hga t).stronglyMeasurable + have hp := hsa.isStronglyProgressive_of_continuous hgc + intro t + have hpt := (hp t).measurable + let : MeasurableSpace Ω := f t + have htime : Measurable (fun u : ℝ => + (⟨min u.toNNReal t, by change min u.toNNReal t ≤ t; exact min_le_right _ _⟩ : Iic t)) := + ((continuous_real_toNNReal.min continuous_const).measurable).subtype_mk + have hgm : Measurable (fun p : ℝ × Ω => g (min p.1.toNNReal t) p.2) := + hpt.comp ((htime.comp measurable_fst).prodMk measurable_snd) + have hm := (cumulative_integral_measurable (fun u ω => g (min u.toNNReal t) ω) hgm).comp + (measurable_const.prodMk measurable_id : Measurable (fun ω : Ω => (t,ω))) + convert hm using 1 + funext ω + simp only [discountClock, Real.toNNReal_coe, Function.comp_def] + apply intervalIntegral.integral_congr + intro u hu + rw [uIcc_of_le t.coe_nonneg] at hu + have hut : u.toNNReal ≤ t := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal hu.2 + change g u.toNNReal ω = g (min u.toNNReal t) ω + rw [min_eq_left hut] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountCost.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ee0fa96431e0e7666e68fed482ced3b604b9ba2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountCost.lean @@ -0,0 +1,107 @@ +import OAI.Probability.SLE.Multipoint.MultipointProductGenerator + +namespace OAI + +/-! Continuous nonnegative drift cost and its bounded localization. -/ + +noncomputable section +open Set Filter +open scoped Topology BigOperators NNReal + +namespace SLEExactGauge.Multipoint + +lemma continuous_logVelocity (κ : ℝ) : + Continuous (fun p : (ℂ × ℝ) × ℝ => logVelocity κ p.1 p.2) := by + have hre : Continuous (fun p : (ℂ × ℝ) × ℝ => p.1.1.re) := + Complex.continuous_re.comp continuous_fst.fst + have him : Continuous (fun p : (ℂ × ℝ) × ℝ => p.1.1.im) := + Complex.continuous_im.comp continuous_fst.fst + have hN : Continuous (fun p : (ℂ × ℝ) × ℝ => greenLogNormSq κ p.1 p.2) := + ((hre.sub (continuous_const.mul continuous_snd)).pow 2).add + (Real.continuous_exp.comp (continuous_const.mul him)) + exact (Real.continuous_exp.comp him).div hN (fun p => (greenLogNormSq_pos κ p.1 p.2).ne') + +lemma continuous_branchRegulator (κ D σ : ℝ) : Continuous (branchRegulator κ D σ) := by + unfold branchRegulator + have h : Continuous (fun z : ℂ × ℝ => (σ*κ/4)*(z.2-z.1.im)) := + continuous_const.mul (continuous_snd.sub (Complex.continuous_im.comp continuous_fst)) + exact continuous_const.mul (Real.continuous_exp.comp h) + +lemma productDriftCost_continuous {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) : + Continuous (fun p : (ι → ℂ × ℝ) × ℝ => productDriftCost s κ D σ p.1 p.2) := by + have hz (i : ι) : Continuous (fun p : (ι → ℂ × ℝ) × ℝ => p.1 i) := + (continuous_apply i).comp continuous_fst + have hv (i : ι) : Continuous (fun p : (ι → ℂ × ℝ) × ℝ => logVelocity κ (p.1 i) p.2) := + (continuous_logVelocity κ).comp ((hz i).prodMk continuous_snd) + have hd (i : ι) : Continuous (fun p : (ι → ℂ × ℝ) × ℝ => branchRegulator κ (D i) (σ i) (p.1 i)) := + (continuous_branchRegulator κ (D i) (σ i)).comp (hz i) + unfold productDriftCost + apply continuous_const.mul + apply Continuous.add <;> apply continuous_const.mul + · exact continuous_finsetSum s (fun i _ => (hd i).mul ((hv i).pow 2)) + · apply continuous_finsetSum + intro ij hij + obtain ⟨hi, hj, _⟩ := Finset.mem_offDiag.mp hij + apply Continuous.mul + · apply ((hd ij.1).mul (hd ij.2)).rpow_const + intro p + exact Or.inl (mul_pos (mul_pos (hD _ hi) (Real.exp_pos _)) + (mul_pos (hD _ hj) (Real.exp_pos _))).ne' + · exact (hv ij.1).mul (hv ij.2) + +lemma productDriftCost_nonneg {ι : Type*} [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (z : ι → ℂ × ℝ) (x : ℝ) : + 0 ≤ productDriftCost s κ D σ z x := by + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + have hC : 0 < driftAllowance (greenExponent κ)*driftThreshold (greenExponent κ)^(-greenExponent κ) := + mul_pos (driftAllowance_pos hp) (Real.rpow_pos_of_pos (driftThreshold_pos hp) _) + have he : 0 < (negativeDrift (greenExponent κ)/2)/(4*((s.card : ℝ)+1)) := + absorption_epsilon_pos (div_pos (negativeDrift_pos hp) (by norm_num)) _ + have hL := youngConstant_pos hp (sq_pos_of_pos (angularCoefficientConstant_pos hp)) he + unfold productDriftCost + apply mul_nonneg hκ.le + apply add_nonneg + · apply mul_nonneg hC.le + apply Finset.sum_nonneg + intro i hi + exact mul_nonneg (mul_pos (hD i hi) (Real.exp_pos _)).le (sq_nonneg _) + · apply mul_nonneg hL.le + apply Finset.sum_nonneg + intro ij hij + obtain ⟨hi, hj, _⟩ := Finset.mem_offDiag.mp hij + exact mul_nonneg (Real.rpow_nonneg (mul_nonneg + (mul_pos (hD _ hi) (Real.exp_pos _)).le (mul_pos (hD _ hj) (Real.exp_pos _)).le) _) + (mul_pos (logVelocity_pos κ (z ij.1) x) (logVelocity_pos κ (z ij.2) x)).le + +theorem exists_bounded_discount_cost {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (R : ℝ) (hR : 0 ≤ R) : + ∃ (G : (ι → ℂ × ℝ) × ℝ → ℝ) (C : ℝ≥0), + Continuous G ∧ (∀ p, 0 ≤ G p ∧ |G p| ≤ C) ∧ + (∀ p, ‖p‖ ≤ R → G p = productDriftCost s κ D σ p.1 p.2) := by + let b : ContDiffBump (0 : (ι → ℂ × ℝ) × ℝ) := ⟨R+1, R+2, by linarith, by linarith⟩ + let G := fun p : (ι → ℂ × ℝ) × ℝ => b p*productDriftCost s κ D σ p.1 p.2 + have hGc : Continuous G := b.continuous.mul (productDriftCost_continuous s κ D σ hD) + have hGs : HasCompactSupport G := b.hasCompactSupport.mul_right + obtain ⟨A, hA⟩ := hGc.bounded_above_of_compact_support hGs + refine ⟨G, Real.toNNReal A, hGc, ?_, ?_⟩ + · intro p + refine ⟨mul_nonneg b.nonneg (productDriftCost_nonneg s κ hκ hκ8 D σ hD p.1 p.2), ?_⟩ + exact (show |G p| ≤ A by simpa only [Real.norm_eq_abs] using hA p).trans (Real.le_coe_toNNReal A) + · intro p hp + have hb : b p = 1 := b.one_of_mem_closedBall (by + simp only [Metric.mem_closedBall, dist_zero_right] + change ‖p‖ ≤ R+1 + linarith) + simp only [G, hb, one_mul] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountProcess.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountProcess.lean new file mode 100644 index 0000000000000000000000000000000000000000..97ac841a691785ba3b38d65d33eea24ccbb09bfc --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountProcess.lean @@ -0,0 +1,156 @@ +import OAI.Probability.SLE.Stochastic.BrownianStateAE +import OAI.Probability.SLE.Multipoint.MultipointCompactField +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock +import OAI.Probability.SLE.Multipoint.MultipointDiscountCost + +namespace OAI + +/-! The compact discounted product along adapted Loewner states. The +discount rate may jump at stopping times. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +theorem exists_bounded_discount_cost_process + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (Q : ℝ → Ω → (ι → ℂ × ℝ)) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t)) + (hQc : ∀ ω, Continuous (fun t => Q t ω)) + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (R : ℝ) (hR : 0 ≤ R) : + ∃ (g : ℝ≥0 → Ω → ℝ) (C : ℝ≥0), + Measurable (Function.uncurry g) ∧ + IsProgressive (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) g ∧ + (∀ ω, Continuous (fun t => g t ω)) ∧ + (∀ t ω, 0 ≤ g t ω ∧ |g t ω| ≤ C) ∧ + (∀ (t : ℝ≥0) ω, ‖(Q t ω,B t ω)‖ ≤ R → + g t ω = productDriftCost s κ D σ (Q t ω) (B t ω)) := by + obtain ⟨G, C, hG, hGb, hGe⟩ := exists_bounded_discount_cost s κ hκ hκ8 D σ hD R hR + let g := fun (t : ℝ≥0) ω => G (Q t ω,B t ω) + have hQn : Measurable (fun p : ℝ≥0 × Ω => Q p.1 p.2) := + hQm.comp ((NNReal.continuous_coe.measurable.comp measurable_fst).prodMk measurable_snd) + have hga : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) g := + fun t => hG.measurable.comp ((hQa t).prodMk ((Filtration.stronglyAdapted_natural + (fun t => (hm t).stronglyMeasurable)).adapted t)) + have hgc (ω : Ω) : Continuous (fun t => g t ω) := + hG.comp (((hQc ω).comp NNReal.continuous_coe).prodMk (hBc ω)) + refine ⟨g, C, hG.measurable.comp (hQn.prodMk hBm), ?_, hgc, ?_, ?_⟩ + · have hs : StronglyAdapted (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) g := fun t => (hga t).stronglyMeasurable + exact (hs.isStronglyProgressive_of_continuous hgc).isProgressive + · exact fun t ω => hGb (Q t ω,B t ω) + · exact fun t ω ht => hGe (Q t ω,B t ω) ht + +theorem compact_discounted_smooth_field + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (Q V : ℝ → Ω → (ι → ℂ × ℝ)) (L : ℝ≥0) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t)) + (hQl : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (hVm : Measurable (fun p : ℝ × Ω => V p.1 p.2)) + (hVb : ∀ t ω, ‖V t ω‖ ≤ L) + (hQd : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t) + (r : ℝ≥0 → Ω → ℝ) (hrm : Measurable (Function.uncurry r)) + (hrp : IsProgressive (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) r) + (C : ℝ≥0) (hrb : ∀ t ω, |r t ω| ≤ C) + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) + (R : ℝ) (hR : 0 ≤ R) : + ∃ (φ : ((ι → ℂ × ℝ) × ℝ) × ℝ → ℝ) (K : ℝ≥0), + (∀ p, 0 ≤ φ p) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → φ (z,x) = discountedProduct s κ D σ z x) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → fderiv ℝ φ (z,x) = + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) (z,x)) ∧ + (∀ z x, ‖(z,x)‖ ≤ R → iteratedDeriv 2 (fun y => φ (z,y)) x = + iteratedDeriv 2 (discountedProduct s κ D σ z) x) ∧ + SmoothTimeBrownianField B hm K + (fun t ω x => φ ((Q t ω, discountClock r t ω),x)) + (fun t ω x => fderiv ℝ φ ((Q t ω, discountClock r t ω),x) + ((V t ω, r t ω),0)) := by + obtain ⟨φ, hφ, hφc, hφ0, he, heD, he2⟩ := + exists_compact_discounted_field s κ D σ hD R hR + have hrt (ω : Ω) : Measurable (fun t => r t ω) := + hrm.comp (measurable_id.prodMk measurable_const) + have hcm := discountClock_measurable r hrm + have hca := discountClock_adapted_of_progressive _ r hrp + have hcl := discountClock_lipschitz_of_measurable r hrt C hrb + have hcd := discountClock_ae_derivative r hrt C hrb + let Q' := fun t ω => (Q t ω, discountClock r t ω) + let V' := fun t ω => (V t ω, r t.toNNReal ω) + have hQ'm : Measurable (fun p : ℝ × Ω => Q' p.1 p.2) := hQm.prodMk hcm + have hQ'a : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q' t) := fun t => (hQa t).prodMk (hca t) + have hQ'l (ω : Ω) : LipschitzWith (max L C) (fun t => Q' t ω) := by + apply LipschitzWith.of_dist_le_mul + intro t u + rw [Prod.dist_eq] + exact max_le + (((hQl ω).dist_le_mul t u).trans + (mul_le_mul_of_nonneg_right (by exact_mod_cast le_max_left L C) dist_nonneg)) + (((hcl ω).dist_le_mul t u).trans + (mul_le_mul_of_nonneg_right (by exact_mod_cast le_max_right L C) dist_nonneg)) + have hrm' : Measurable (fun p : ℝ × Ω => r p.1.toNNReal p.2) := + hrm.comp ((continuous_real_toNNReal.measurable.comp measurable_fst).prodMk measurable_snd) + have hV'm : Measurable (fun p : ℝ × Ω => V' p.1 p.2) := hVm.prodMk hrm' + have hV'b (t : ℝ) (ω : Ω) : ‖V' t ω‖ ≤ (max L C : ℝ≥0) := by + rw [Prod.norm_def] + have hrnorm : ‖r t.toNNReal ω‖ ≤ (C : ℝ) := by + simpa only [Real.norm_eq_abs] using hrb t.toNNReal ω + exact max_le + ((hVb t ω).trans (by exact_mod_cast le_max_left L C)) + (hrnorm.trans (by exact_mod_cast le_max_right L C)) + have hQ'd (ω : Ω) : ∀ᵐ t : ℝ, 0 < t → + HasDerivAt (fun u => Q' u ω) (V' t ω) t := by + filter_upwards [hQd ω, hcd ω] with t hq hc + intro ht + exact (hq ht).prodMk (hc ht) + obtain ⟨K, hK⟩ := compact_state_smooth_brownian_field_of_ae_deriv B hm Q' V' + (max L C) hQ'm hQ'a hQ'l hV'm hV'b hQ'd φ hφ hφc + refine ⟨φ, K, hφ0, he, heD, he2, ?_⟩ + simpa only [Q', V', Real.toNNReal_coe] using hK + +lemma compact_discounted_process_drift_nonpos + {Ω ι : Type*} [Fintype ι] [DecidableEq ι] + (B : ℝ≥0 → Ω → ℝ) (Q V : ℝ → Ω → (ι → ℂ × ℝ)) + (r : ℝ≥0 → Ω → ℝ) (s : Finset ι) + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (D σ : ι → ℝ) + (φ : ((ι → ℂ × ℝ) × ℝ) × ℝ → ℝ) (t : ℝ) (ht : 0 ≤ t) (ω : Ω) + (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (hδ : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (Q t ω i) ≤ 1) + (hV : ∀ i ∈ s, V t ω i = physicalLogLoewnerField + (Real.sqrt κ*B t.toNNReal ω) (Q t ω i)) + (hr : r t.toNNReal ω = productDriftCost s κ D σ (Q t ω) (B t.toNNReal ω)) + (hφD : fderiv ℝ φ ((Q t ω,discountClock r t ω),B t.toNNReal ω) = + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) + ((Q t ω,discountClock r t ω),B t.toNNReal ω)) + (hφ2 : iteratedDeriv 2 (fun y => φ ((Q t ω,discountClock r t ω),y)) + (B t.toNNReal ω) = + iteratedDeriv 2 (discountedProduct s κ D σ (Q t ω,discountClock r t ω)) + (B t.toNNReal ω)) : + brownianFieldDrift B + (fun t ω x => φ ((Q t ω,discountClock r t ω),x)) + (fun t ω x => fderiv ℝ φ ((Q t ω,discountClock r t ω),x) + ((V t ω,r t ω),0)) t ω ≤ 0 := by + unfold brownianFieldDrift + simp only [Real.coe_toNNReal t ht] + rw [hr, hφD, hφ2, discountedProduct_pair_directional, + discountedProduct_directional_congr s κ D σ hD (Q t ω) _ _ + (discountClock r t ω) (productDriftCost s κ D σ (Q t ω) (B t.toNNReal ω)) + (B t.toNNReal ω) hV] + exact discountedProduct_generator_nonpos s κ hκ hκ8 D σ (Q t ω) + (discountClock r t ω) (B t.toNNReal ω) hD hσ hδ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountedField.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountedField.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ca38e215edce9c7140f869e2df3fa033dcec508 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointDiscountedField.lean @@ -0,0 +1,74 @@ +import OAI.Probability.SLE.Multipoint.MultipointProductGenerator + +namespace OAI + +/-! The smooth discounted product used between consecutive switches. -/ + +noncomputable section + +namespace SLEExactGauge.Multipoint + +def discountedProduct {ι : Type*} (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) + (z : (ι → ℂ × ℝ) × ℝ) (x : ℝ) : ℝ := + Real.exp (-z.2)*regularizedProduct s κ D σ z.1 x + +lemma discountedProduct_contDiff {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) : + ContDiff ℝ (⊤ : ℕ∞) + (fun p : ((ι → ℂ × ℝ) × ℝ) × ℝ => discountedProduct s κ D σ p.1 p.2) := by + unfold discountedProduct + exact (contDiff_fst.snd.neg.exp).mul ((regularizedProduct_contDiff s κ D σ).comp + (contDiff_fst.fst.prodMk contDiff_snd)) + +lemma discountedProduct_directional {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) + (z v : ι → ℂ × ℝ) (b c x : ℝ) : + (fderiv ℝ (fun q => discountedProduct s κ D σ q x) (z,b)) (v,c) = + Real.exp (-b)*((fderiv ℝ (fun q => regularizedProduct s κ D σ q x) z) v - + c*regularizedProduct s κ D σ z x) := by + have hp : ContDiff ℝ (⊤ : ℕ∞) (fun z => regularizedProduct s κ D σ z x) := + (regularizedProduct_contDiff s κ D σ).comp (contDiff_id.prodMk contDiff_const) + have hd := ((hasFDerivAt_snd (𝕜 := ℝ) (p := (z,b))).neg.exp).mul + (((hp.differentiable (by simp)) z).hasFDerivAt.comp (z,b) (hasFDerivAt_fst (𝕜 := ℝ))) + have he := congrArg (fun f : ((ι → ℂ × ℝ) × ℝ) →L[ℝ] ℝ => f (v,c)) hd.fderiv + change (fderiv ℝ (fun q => discountedProduct s κ D σ q x) (z,b)) (v,c) = _ at he + rw [he] + simp only [smul_apply, smul_eq_mul, add_apply, neg_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.coe_fst', ContinuousLinearMap.coe_snd', Function.comp_def, + Pi.neg_apply] + ring + +lemma discountedProduct_spatial_second {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (b x : ℝ) : + iteratedDeriv 2 (discountedProduct s κ D σ (z,b)) x = + Real.exp (-b)*iteratedDeriv 2 (regularizedProduct s κ D σ z) x := by + apply iteratedDeriv_const_mul + exact (((regularizedProduct_contDiff s κ D σ).comp + (contDiff_const.prodMk contDiff_id)).of_le (by simp)).contDiffAt + +lemma discountedProduct_directional_congr {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) + (z v w : ι → ℂ × ℝ) (b c x : ℝ) (hvw : ∀ i ∈ s, v i = w i) : + (fderiv ℝ (fun q => discountedProduct s κ D σ q x) (z,b)) (v,c) = + (fderiv ℝ (fun q => discountedProduct s κ D σ q x) (z,b)) (w,c) := by + rw [discountedProduct_directional, discountedProduct_directional, + regularizedProduct_directional_congr s κ D σ hD z v w x hvw] + +theorem discountedProduct_generator_nonpos {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (b x : ℝ) + (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (hδ : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (z i) ≤ 1) : + (fderiv ℝ (fun q => discountedProduct s κ D σ q x) (z,b)) + ((fun i => physicalLogLoewnerField (Real.sqrt κ*x) (z i)), productDriftCost s κ D σ z x) + + (1/2 : ℝ)*iteratedDeriv 2 (discountedProduct s κ D σ (z,b)) x ≤ 0 := by + rw [discountedProduct_directional, discountedProduct_spatial_second] + have h := mul_le_mul_of_nonneg_left + (regularizedProduct_generator_le s κ hκ hκ8 D σ z x hD hσ hδ) (Real.exp_pos (-b)).le + nlinarith only [h] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointDistanceKernel.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointDistanceKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..698f0cca4924481dd54f72565be25cebe2effc0e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointDistanceKernel.lean @@ -0,0 +1,140 @@ +import Mathlib.Analysis.SpecialFunctions.Pow.Integral +import Mathlib.MeasureTheory.Measure.Lebesgue.Complex +import Mathlib.MeasureTheory.Group.LIntegral +import Mathlib.MeasureTheory.Integral.Marginal +import Mathlib.MeasureTheory.Integral.Pi +import Mathlib.LinearAlgebra.Complex.FiniteDimensional + +namespace OAI + +/-! The local planar singularities used to integrate the capped distance +kernel. Diagonal values are set to zero; they have zero planar measure. -/ + +noncomputable section +open Set Metric Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +def distanceKernel (α : ℝ) (x y : ℂ) : ℝ≥0∞ := + ENNReal.ofReal (dist x y ^ (-α)) + +lemma distanceKernel_symm (α : ℝ) (x y : ℂ) : + distanceKernel α x y = distanceKernel α y x := by + simp only [distanceKernel,dist_comm] + +@[fun_prop] +lemma measurable_distanceKernel (α : ℝ) : + Measurable (fun p : ℂ × ℂ => distanceKernel α p.1 p.2) := by + unfold distanceKernel + fun_prop + +lemma measurable_distanceKernel_left (α : ℝ) (y : ℂ) : + Measurable (fun x : ℂ => distanceKernel α x y) := by + unfold distanceKernel + fun_prop + +def radialKernelMass (α : ℝ) : ℝ≥0∞ := + ∫⁻ x : ℂ in ball 0 1, ENNReal.ofReal (‖x‖ ^ (-α)) + +lemma radialKernelMass_lt_top {α : ℝ} (hα : α < 2) : radialKernelMass α < ⊤ := by + have hi : IntegrableOn (fun x : ℂ => ‖x‖ ^ (-α)) (ball 0 1) := by + apply integrableOn_ball_of_norm_le_rpow (μ := volume) (C := 1) + (α := α) (by simp [Complex.finrank_real_complex]) + (by simpa only [Complex.finrank_real_complex, Nat.cast_ofNat] using hα) + · filter_upwards [] with x + rw [Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _),one_mul] + · exact ((continuous_norm.measurable).pow_const _).aestronglyMeasurable + exact (hasFiniteIntegral_iff_ofReal + (ae_of_all _ (fun x => Real.rpow_nonneg (norm_nonneg x) _))).mp hi.hasFiniteIntegral + +lemma distanceKernel_le_local_add_one {α : ℝ} (hα : 0 ≤ α) (x y : ℂ) : + distanceKernel α x y ≤ + (ball (0 : ℂ) 1).indicator (fun z => ENNReal.ofReal (‖z‖ ^ (-α))) (x-y) + 1 := by + by_cases h : x-y ∈ ball (0 : ℂ) 1 + · rw [indicator_of_mem h] + simpa only [distanceKernel,dist_eq_norm] using + (le_add_right (le_refl (ENNReal.ofReal (‖x-y‖ ^ (-α))))) + · rw [indicator_of_notMem h,zero_add] + have hd : 1 ≤ dist x y := by + simpa only [mem_ball_zero_iff,not_lt,← dist_eq_norm] using h + exact ENNReal.ofReal_le_one.mpr (Real.rpow_le_one_of_one_le_of_nonpos hd (neg_nonpos.mpr hα)) + +theorem distanceKernel_lintegral_le {α : ℝ} (hα : 0 ≤ α) + (K : Set ℂ) (y : ℂ) : + (∫⁻ x in K, distanceKernel α x y) ≤ radialKernelMass α + volume K := by + let f : ℂ → ℝ≥0∞ := (ball (0 : ℂ) 1).indicator + (fun z => ENNReal.ofReal (‖z‖ ^ (-α))) + have hfm : Measurable f := by + apply Measurable.indicator _ measurableSet_ball + fun_prop + have hshiftm : Measurable (fun x : ℂ => f (x-y)) := + hfm.comp (measurable_id.sub_const y) + calc + (∫⁻ x in K, distanceKernel α x y) ≤ ∫⁻ x in K, f (x-y)+1 := + lintegral_mono (distanceKernel_le_local_add_one hα · y) + _ = (∫⁻ x in K, f (x-y)) + volume K := by + rw [lintegral_add_left hshiftm,lintegral_const] + simp only [Measure.restrict_apply_univ,one_mul] + _ ≤ (∫⁻ x, f (x-y)) + volume K := + add_le_add (lintegral_mono' Measure.restrict_le_self (fun _ => le_rfl)) le_rfl + _ = radialKernelMass α + volume K := by + rw [lintegral_sub_right_eq_self] + simp only [f,lintegral_indicator measurableSet_ball,radialKernelMass] + +lemma distanceKernel_mul_le_squares (α : ℝ) (x y z : ℂ) : + distanceKernel α x y * distanceKernel α x z ≤ + distanceKernel (2*α) x y + distanceKernel (2*α) x z := by + have hs (w : ℂ) : (dist x w ^ (-α))^2 = dist x w ^ (-(2*α)) := by + rw [← Real.rpow_natCast,← Real.rpow_mul dist_nonneg] + congr 1 + ring + unfold distanceKernel + rw [← ENNReal.ofReal_mul (Real.rpow_nonneg dist_nonneg _), + ← ENNReal.ofReal_add (Real.rpow_nonneg dist_nonneg _) (Real.rpow_nonneg dist_nonneg _)] + apply ENNReal.ofReal_le_ofReal + rw [← hs y,← hs z] + nlinarith [sq_nonneg ((dist x y ^ (-α))-(dist x z ^ (-α)))] + +theorem distanceKernel_pair_lintegral_le {α : ℝ} (hα : 0 ≤ α) + (K : Set ℂ) (y z : ℂ) : + (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ + 2*(radialKernelMass (2*α)+volume K) := by + calc + (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ + ∫⁻ x in K, distanceKernel (2*α) x y + distanceKernel (2*α) x z := + lintegral_mono (distanceKernel_mul_le_squares α · y z) + _ = (∫⁻ x in K, distanceKernel (2*α) x y) + + (∫⁻ x in K, distanceKernel (2*α) x z) := by + apply lintegral_add_left + exact measurable_distanceKernel_left (2*α) y + _ ≤ (radialKernelMass (2*α)+volume K)+(radialKernelMass (2*α)+volume K) := + add_le_add (distanceKernel_lintegral_le (by positivity) K y) + (distanceKernel_lintegral_le (by positivity) K z) + _ = _ := (two_mul _).symm + +theorem distanceKernel_uniform_local_bounds {α : ℝ} (hα : 0 < α) (hα1 : α < 1) + (K : Set ℂ) (hK : Bornology.IsBounded K) : + ∃ C : ℝ≥0∞, C < ⊤ ∧ 1 ≤ C ∧ volume K ≤ C ∧ + (∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) ∧ + (∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) := by + let C := 1+volume K+(radialKernelMass α+volume K)+2*(radialKernelMass (2*α)+volume K) + have hvol : volume K < ⊤ := hK.measure_lt_top + have hmass : radialKernelMass α < ⊤ := radialKernelMass_lt_top (by linarith) + have hmass2 : radialKernelMass (2*α) < ⊤ := radialKernelMass_lt_top (by linarith) + refine ⟨C,by dsimp [C]; finiteness,?_,?_,?_,?_⟩ + · dsimp [C] + exact (le_add_right le_rfl).trans ((le_add_right le_rfl).trans (le_add_right le_rfl)) + · dsimp [C] + exact (le_add_left le_rfl).trans ((le_add_right le_rfl).trans (le_add_right le_rfl)) + · intro y + exact (distanceKernel_lintegral_le hα.le K y).trans + ((le_add_left le_rfl).trans (le_add_right le_rfl)) + · intro y z + exact (distanceKernel_pair_lintegral_le hα.le K y z).trans (le_add_left le_rfl) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointFactorBranches.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointFactorBranches.lean new file mode 100644 index 0000000000000000000000000000000000000000..4eba71e455dedf8307044127b4f47a25e31867f8 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointFactorBranches.lean @@ -0,0 +1,147 @@ +import OAI.Probability.SLE.Multipoint.MultipointRegularizedField +import OAI.Probability.SLE.Multipoint.MultipointSwitches + +namespace OAI + +/-! Exact first-half and second-half formulas for the active multipoint +factor. The change of formula at the midpoint has no jump. -/ + +noncomputable section +open Set + +namespace SLEExactGauge.Multipoint + +/-- The source clock in logarithmic capacity-two coordinates. -/ +def logFactorClock (κ : ℝ) (z : ℂ × ℝ) : ℝ := κ / 4 * (z.2-z.1.im) + +def factorActivationScale (κ a : ℝ) : ℝ := Real.exp (-greenExponent κ*a/2)/3 + +lemma factorActivationScale_pos (κ a : ℝ) : 0 < factorActivationScale κ a := + div_pos (Real.exp_pos _) (by norm_num) + +lemma first_branch_regulator (κ β a : ℝ) (z : ℂ × ℝ) : + branchRegulator κ (Real.exp (β*a)) (-β) z = + Real.exp (-β*(logFactorClock κ z-a)) := by + unfold branchRegulator logFactorClock + rw [← Real.exp_add] + congr 1 + ring + +lemma second_branch_regulator (κ β a U : ℝ) (z : ℂ × ℝ) : + branchRegulator κ (Real.exp (-β*(U+a))) β z = + Real.exp (-β*(U-(logFactorClock κ z-a))) := by + unfold branchRegulator logFactorClock + rw [← Real.exp_add] + congr 1 + ring + +lemma first_branch_regulator_eq (κ β a U : ℝ) (z : ℂ × ℝ) + (hu : logFactorClock κ z-a ≤ U/2) : + branchRegulator κ (Real.exp (β*a)) (-β) z = + regulator β U (logFactorClock κ z-a) := by + rw [first_branch_regulator, regulator_eq_left hu] + +lemma second_branch_regulator_eq (κ β a U : ℝ) (z : ℂ × ℝ) + (hu : U/2 ≤ logFactorClock κ z-a) : + branchRegulator κ (Real.exp (-β*(U+a))) β z = + regulator β U (logFactorClock κ z-a) := by + rw [second_branch_regulator, regulator_eq_right hu] + +lemma regularizedLogFactor_normalized (κ D σ a : ℝ) (z : ℂ × ℝ) (x : ℝ) : + factorActivationScale κ a * regularizedLogFactor κ D σ z x = + Real.exp (greenExponent κ/2*(logFactorClock κ z-a))/3 * + angularFactor (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) := by + rw [regularizedLogFactor_eq] + unfold factorActivationScale + have he : Real.exp (-greenExponent κ*a/2) * + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im)) = + Real.exp (greenExponent κ/2*(logFactorClock κ z-a)) := by + rw [← Real.exp_add] + congr 1 + unfold logFactorClock + ring + calc + _ = (Real.exp (-greenExponent κ*a/2) * + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im)))/3 * + angularFactor (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) := by ring + _ = _ := by rw [he] + +lemma first_branch_factor_eq (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) + (hu : logFactorClock κ z-a ≤ U/2) : + factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (β*a)) (-β) z x = + activeFactor (greenExponent κ) β U (logFactorClock κ z-a) (logAngle κ z x) := by + rw [regularizedLogFactor_normalized, first_branch_regulator_eq κ β a U z hu] + rfl + +lemma second_branch_factor_eq (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) + (hu : U/2 ≤ logFactorClock κ z-a) : + factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (-β*(U+a))) β z x = + activeFactor (greenExponent κ) β U (logFactorClock κ z-a) (logAngle κ z x) := by + rw [regularizedLogFactor_normalized, second_branch_regulator_eq κ β a U z hu] + rfl + +lemma first_branch_regulator_le_one (κ β a : ℝ) (z : ℂ × ℝ) + (hβ : 0 ≤ β) (hu : 0 ≤ logFactorClock κ z-a) : + branchRegulator κ (Real.exp (β*a)) (-β) z ≤ 1 := by + rw [first_branch_regulator] + exact Real.exp_le_one_iff.mpr (mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hβ) hu) + +lemma second_branch_regulator_le_one (κ β a U : ℝ) (z : ℂ × ℝ) + (hβ : 0 ≤ β) (hu : logFactorClock κ z-a ≤ U) : + branchRegulator κ (Real.exp (-β*(U+a))) β z ≤ 1 := by + rw [second_branch_regulator] + exact Real.exp_le_one_iff.mpr (mul_nonpos_of_nonpos_of_nonneg + (neg_nonpos.mpr hβ) (sub_nonneg.mpr hu)) + +lemma first_branch_factor_pos (κ β a : ℝ) (z : ℂ × ℝ) (x : ℝ) : + 0 < factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (β*a)) (-β) z x := + mul_pos (factorActivationScale_pos κ a) + (regularizedLogFactor_pos κ _ _ (Real.exp_pos _) z x) + +lemma second_branch_factor_pos (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) : + 0 < factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (-β*(U+a))) β z x := + mul_pos (factorActivationScale_pos κ a) + (regularizedLogFactor_pos κ _ _ (Real.exp_pos _) z x) + +lemma branch_midpoint_eq (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) + (hu : logFactorClock κ z-a = U/2) : + regularizedLogFactor κ (Real.exp (β*a)) (-β) z x = + regularizedLogFactor κ (Real.exp (-β*(U+a))) β z x := by + rw [regularizedLogFactor_eq, regularizedLogFactor_eq, + first_branch_regulator_eq κ β a U z hu.le, + second_branch_regulator_eq κ β a U z hu.ge] + +private lemma factorExponent_pos (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) : + 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + +/-- Activation changes the inactive factor one downward to the first +smooth branch. -/ +lemma first_branch_activation_le (κ β a U : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ℂ × ℝ) (x : ℝ) (hU : 0 ≤ U) (hu : logFactorClock κ z-a = 0) : + factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (β*a)) (-β) z x ≤ 1 := by + rw [first_branch_factor_eq κ β a U z x (by rw [hu]; linarith), hu] + exact activeFactor_activation_le (factorExponent_pos κ hκ hκ8) hU + (logAngle_sin_pos κ z x).le + +/-- Completion freezes at the angle-independent lower bound. -/ +lemma second_branch_completion_jump (κ β a U : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ℂ × ℝ) (x : ℝ) (hU : 0 ≤ U) (hu : logFactorClock κ z-a = U) : + Real.exp (greenExponent κ/2*U)/3 ≤ factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (-β*(U+a))) β z x := by + rw [second_branch_factor_eq κ β a U z x (by rw [hu]; linarith), hu] + exact activeFactor_completion_jump (factorExponent_pos κ hκ hκ8) hU + (logAngle_sin_pos κ z x).le + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointFieldBounds.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointFieldBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..087da90b408febbcabb2ccab972efb7dca3ae430 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointFieldBounds.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Multipoint.MultipointRegularizedField +import OAI.Probability.SLE.Multipoint.MultipointBrownianCoefficient + +namespace OAI + +/-! Drift and Brownian cross bounds for the concrete regularized fields. -/ + +noncomputable section + +namespace SLEExactGauge.Multipoint + +theorem regularizedLogFactor_relative_drift + (κ D σ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (hD : 0 < D) (hσ : σ ≤ 1) + (z : ℂ × ℝ) (x : ℝ) : + logGenerator κ (regularizedLogFactor κ D σ) z x / regularizedLogFactor κ D σ z x ≤ + κ*logVelocity κ z x^2 * + ((driftAllowance (greenExponent κ)*driftThreshold (greenExponent κ)^(-greenExponent κ))* + branchRegulator κ D σ z - + (negativeDrift (greenExponent κ)/2)* + damping (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x)) := by + have hδ : 0 < branchRegulator κ D σ z := mul_pos hD (Real.exp_pos _) + have hs := logAngle_sin_pos κ z x + have hf := angularFactor_pos (p := greenExponent κ) hδ hs + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + have h := regularized_drift_bound hp hδ hσ hs + have hm := mul_le_mul_of_nonneg_left h + (mul_nonneg hκ.le (sq_nonneg (logVelocity κ z x))) + rw [regularizedLogFactor_generator κ D σ hκ, regularizedLogFactor_eq] + convert hm using 1 + field_simp [hf.ne', (Real.exp_pos (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))).ne'] + +lemma regularizedLogFactor_relative_spatial + (κ D σ : ℝ) (hD : 0 < D) (z : ℂ × ℝ) (x : ℝ) : + deriv (regularizedLogFactor κ D σ z) x / regularizedLogFactor κ D σ z x = + Real.sqrt κ*logVelocity κ z x * + (angularFactorFirst (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) / + angularFactor (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x)) := by + rw [regularizedLogFactor_spatial, regularizedLogFactor_eq] + have hf := angularFactor_pos (p := greenExponent κ) (mul_pos hD (Real.exp_pos ((σ*κ/4)*(z.2-z.1.im)))) + (logAngle_sin_pos κ z x) + change 0 < angularFactor (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) at hf + field_simp [hf.ne', (Real.exp_pos (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))).ne'] + +theorem regularizedLogFactor_pair_absorption + (κ Di Dj σi σj ε : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (hDi : 0 < Di) (hDj : 0 < Dj) (hε : 0 < ε) + (zi zj : ℂ × ℝ) (x : ℝ) + (hi1 : branchRegulator κ Di σi zi ≤ 1) + (hj1 : branchRegulator κ Dj σj zj ≤ 1) : + |(deriv (regularizedLogFactor κ Di σi zi) x / regularizedLogFactor κ Di σi zi x)* + (deriv (regularizedLogFactor κ Dj σj zj) x / regularizedLogFactor κ Dj σj zj x)| ≤ + κ*(ε*(damping (greenExponent κ) (branchRegulator κ Di σi zi) (logAngle κ zi x)* + logVelocity κ zi x^2 + + damping (greenExponent κ) (branchRegulator κ Dj σj zj) (logAngle κ zj x)* + logVelocity κ zj x^2) + + youngConstant (greenExponent κ) (angularCoefficientConstant (greenExponent κ)^2) ε * + (branchRegulator κ Di σi zi*branchRegulator κ Dj σj zj)^(-exponent (greenExponent κ))* + (logVelocity κ zi x*logVelocity κ zj x)) := by + have hi : 0 < branchRegulator κ Di σi zi := mul_pos hDi (Real.exp_pos _) + have hj : 0 < branchRegulator κ Dj σj zj := mul_pos hDj (Real.exp_pos _) + have hsi := logAngle_sin_pos κ zi x + have hsj := logAngle_sin_pos κ zj x + have hfi := angularFactor_pos (p := greenExponent κ) hi hsi + have hfj := angularFactor_pos (p := greenExponent κ) hj hsj + have hvi := logVelocity_pos κ zi x + have hvj := logVelocity_pos κ zj x + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + have h := angular_pair_absorption hp hi hi1 hj hj1 hsi hsj + hvi hvj hε + have hh := mul_le_mul_of_nonneg_left h hκ.le + rw [regularizedLogFactor_relative_spatial κ Di σi hDi, + regularizedLogFactor_relative_spatial κ Dj σj hDj] + calc + _ = κ*((|angularFactorFirst (greenExponent κ) (branchRegulator κ Di σi zi) (logAngle κ zi x)| / + angularFactor (greenExponent κ) (branchRegulator κ Di σi zi) (logAngle κ zi x)*logVelocity κ zi x)* + (|angularFactorFirst (greenExponent κ) (branchRegulator κ Dj σj zj) (logAngle κ zj x)| / + angularFactor (greenExponent κ) (branchRegulator κ Dj σj zj) (logAngle κ zj x)*logVelocity κ zj x)) := by + simp only [abs_mul, abs_div, abs_of_nonneg (Real.sqrt_nonneg κ), + abs_of_pos hvi, abs_of_pos hvj, abs_of_pos hfi, abs_of_pos hfj] + let ai := |angularFactorFirst (greenExponent κ) (branchRegulator κ Di σi zi) (logAngle κ zi x)| / + angularFactor (greenExponent κ) (branchRegulator κ Di σi zi) (logAngle κ zi x) + let aj := |angularFactorFirst (greenExponent κ) (branchRegulator κ Dj σj zj) (logAngle κ zj x)| / + angularFactor (greenExponent κ) (branchRegulator κ Dj σj zj) (logAngle κ zj x) + change Real.sqrt κ*logVelocity κ zi x*ai*(Real.sqrt κ*logVelocity κ zj x*aj) = + κ*((ai*logVelocity κ zi x)*(aj*logVelocity κ zj x)) + calc + _ = (Real.sqrt κ)^2*((ai*logVelocity κ zi x)*(aj*logVelocity κ zj x)) := by ring + _ = _ := by rw [Real.sq_sqrt hκ.le] + _ ≤ _ := hh + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointFixedCenterKernel.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointFixedCenterKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..93b2e21a1e16031a511b81bb09f8a96cc61f2e82 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointFixedCenterKernel.lean @@ -0,0 +1,129 @@ +import OAI.Probability.SLE.Multipoint.MultipointKernelExpansion +import Mathlib.Data.Fin.Tuple.Basic + +namespace OAI + +/-! The fixed-center form of the capped kernel estimate. The constant +is independent of the location of the fixed center. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +def fixedKernelBound (ι : Type*) [Fintype ι] [DecidableEq ι] (α b : ℝ) (C : ℝ≥0∞) : ℝ≥0∞ := + ∑ _f : ι → Option ι, capCoefficient α b ^ Fintype.card ι * C^(Fintype.card ι-1) + +lemma fixedKernelBound_lt_top (ι : Type*) [Fintype ι] [DecidableEq ι] (α b : ℝ) + (C : ℝ≥0∞) (hC : C < ⊤) : fixedKernelBound ι α b C < ⊤ := by + apply ENNReal.sum_lt_top.mpr + intro f _ + exact ENNReal.mul_lt_top (ENNReal.pow_lt_top (capCoefficient_finite α b)) + (ENNReal.pow_lt_top hC) + +lemma cappedDistanceKernel_marginal_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (K : Set ℂ) (C : ℝ≥0∞) (hC : C < ⊤) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (root : ι) (x : ι → ℂ) : + lmarginal (fun _ : ι => volume.restrict K) (Finset.univ.erase root) + (cappedDistanceKernel α b) x ≤ fixedKernelBound ι α b C := by + let S : Finset ι := Finset.univ.erase root + have hg (f : ι → Option ι) : + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α (selectedEdges f)) x ≤ C^S.card := by + apply graphKernel_marginal_le_with_root α K C hC hC0 hC1 hC2 root S (selectedEdges f) + · exact Finset.notMem_erase _ _ + · intro e _ + constructor <;> simp only [S,Finset.insert_erase (Finset.mem_univ root),Finset.mem_univ] + · exact selectedEdges_outgoing f + · exact selectedEdges_loopfree f + change lmarginal (fun _ : ι => volume.restrict K) S (cappedDistanceKernel α b) x ≤ _ + calc + _ ≤ lmarginal (fun _ : ι => volume.restrict K) S + (fun y => ∑ f : ι → Option ι, + capCoefficient α b ^ Fintype.card ι * graphKernel α (selectedEdges f) y) x := + lmarginal_mono (cappedDistanceKernel_le_graph_sum α b) x + _ = ∑ f : ι → Option ι, capCoefficient α b ^ Fintype.card ι * + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α (selectedEdges f)) x := by + unfold lmarginal + rw [lintegral_finsetSum] + · apply Finset.sum_congr rfl + intro f _ + exact lintegral_const_mul' _ _ (ENNReal.pow_ne_top (capCoefficient_finite α b).ne) + · intro f _ + exact measurable_const.mul ((measurable_graphKernel α (selectedEdges f)).comp + measurable_updateFinset) + _ ≤ ∑ _f : ι → Option ι, capCoefficient α b ^ Fintype.card ι * C^S.card := by + apply Finset.sum_le_sum + intro f _ + have hh := hg f + gcongr + _ = fixedKernelBound ι α b C := by + simp only [S,Finset.card_erase_of_mem (Finset.mem_univ root),Finset.card_univ,fixedKernelBound] + +lemma lintegral_fin_cons_eq_marginal (m : ℕ) (K : Set ℂ) + (f : (Fin (m+1) → ℂ) → ℝ≥0∞) (hf : Measurable f) (z : ℂ) : + (∫⁻ x, f (Fin.cons z x) ∂Measure.pi (fun _ : Fin m => volume.restrict K)) = + lmarginal (fun _ : Fin (m+1) => volume.restrict K) (Finset.univ.erase 0) + f (Fin.cons z (fun _ => 0)) := by + let g : (Fin m → ℂ) → ℝ≥0∞ := fun x => f (Fin.cons z x) + have hg : Measurable g := by + apply hf.comp + apply measurable_pi_iff.mpr + intro i + cases i using Fin.cases <;> simp only [Fin.cons_zero,Fin.cons_succ] + · exact measurable_const + · exact measurable_pi_apply _ + have hcomp : (fun y : Fin (m+1) → ℂ => f (Function.update y 0 z)) = + g ∘ (fun y : Fin (m+1) → ℂ => y ∘ Fin.succ) := by + funext y + apply congrArg f + ext i + cases i using Fin.cases <;> simp [Function.comp_def] + have hset : (Finset.univ : Finset (Fin m)).image Fin.succ = Finset.univ.erase 0 := by + rw [Fin.image_succ_univ] + ext i + simp + calc + _ = lmarginal (fun _ : Fin m => volume.restrict K) Finset.univ g (fun _ => 0) := by + simp only [lmarginal_univ,g] + _ = lmarginal (fun _ : Fin (m+1) => volume.restrict K) (Finset.univ.image Fin.succ) + (g ∘ (fun y => y ∘ Fin.succ)) (Fin.cons z (fun _ => 0)) := by + exact (lmarginal_image (μ := fun _ : Fin (m+1) => volume.restrict K) + (Fin.succ_injective m) Finset.univ hg (Fin.cons z (fun _ => 0))).symm + _ = lmarginal (fun _ : Fin (m+1) => volume.restrict K) (Finset.univ.erase 0) + (fun y => f (Function.update y 0 z)) (Fin.cons z (fun _ => 0)) := by rw [hset,hcomp] + _ = _ := by + simpa only [Fin.update_cons_zero,Function.comp_def] using + (lmarginal_update_of_notMem (μ := fun _ : Fin (m+1) => volume.restrict K) hf + (Finset.notMem_erase 0 Finset.univ) (Fin.cons z (fun _ => 0)) z).symm + +/-- Uniform fixed-center kernel bound, with the center in coordinate zero +and the free variables in the successor coordinates. -/ +theorem cappedDistanceKernel_fixed_center_bound (m : ℕ) + {α : ℝ} (hα : 0 < α) (hα1 : α < 1) (b : ℝ) + (K : Set ℂ) (hK : Bornology.IsBounded K) : + ∃ C : ℝ≥0∞, C < ⊤ ∧ ∀ z : ℂ, + (∫⁻ x, cappedDistanceKernel α b (Fin.cons z x) + ∂Measure.pi (fun _ : Fin m => volume.restrict K)) ≤ C := by + obtain ⟨C,hC,_,hC0,hC1,hC2⟩ := distanceKernel_uniform_local_bounds hα hα1 K hK + refine ⟨fixedKernelBound (Fin (m+1)) α b C, + fixedKernelBound_lt_top _ α b C hC,fun z => ?_⟩ + rw [lintegral_fin_cons_eq_marginal m K _ (measurable_cappedDistanceKernel α b)] + exact cappedDistanceKernel_marginal_le α b K C hC hC0 hC1 hC2 0 _ + +lemma ae_fin_cons_injective (m : ℕ) (K : Set ℂ) (z : ℂ) : + ∀ᵐ x : Fin m → ℂ ∂Measure.pi (fun _ : Fin m => volume.restrict K), + Function.Injective (Fin.cons z x) := by + filter_upwards [ae_tuple_injective K,ae_tuple_avoids K z] with x hx hz + apply Fin.cons_injective_of_injective _ hx + rintro ⟨i,hi⟩ + exact hz i hi + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointGeometry.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..df50be933cbac19d5e61dfec6815b3b3a5ac3aa1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointGeometry.lean @@ -0,0 +1,105 @@ +import OAI.Probability.SLE.Multipoint.MultipointInteraction + +namespace OAI + +/-! Geometric decay of the multipoint interaction follows from the +univalent disk growth inequality in Duren, *Univalent Functions* (1983), +Section 2.3. -/ + +noncomputable section +open Set Metric + +namespace SLEExactGauge + +def PublishedDiskUnivalentGrowth : Prop := + ∀ f : ℂ → ℂ, DifferentiableOn ℂ f (ball 0 1) → + InjOn f (ball 0 1) → ∀ z ∈ ball (0 : ℂ) 1, + ‖f z-f 0‖ ≤ ‖deriv f 0‖ * ‖z‖ / (1-‖z‖)^2 + +namespace Multipoint + +/-- The hyperbolic interaction is bounded by the square root of the +ratio of conformal radius to point separation. -/ +lemma neg_log_sq_le_radius_ratio {ρ R D : ℝ} + (hρ : 0 < ρ) (hρ1 : ρ < 1) (hD : 0 < D) + (hgrowth : D ≤ R*ρ/(1-ρ)^2) : (-Real.log ρ)^2 ≤ R/D := by + let L := -Real.log ρ + let E := Real.exp (L/2) + have hL : 0 ≤ L := neg_nonneg.mpr (Real.log_nonpos hρ.le hρ1.le) + have hE : 0 < E := Real.exp_pos _ + have he2 : E^2*ρ = 1 := by + dsimp only [E] + rw [pow_two, ← Real.exp_add, show L/2+L/2 = L by ring] + dsimp only [L] + rw [Real.exp_neg, Real.exp_log hρ, inv_mul_cancel₀ hρ.ne'] + have hminus : Real.exp (-(L/2)) = E*ρ := by + have hrho : ρ = Real.exp (-L) := by simp [L, Real.exp_log hρ] + rw [hrho] + dsimp only [E] + rw [← Real.exp_add] + congr 1 + ring + have hs : L ≤ E-E*ρ := by + have hh := Real.self_le_sinh_iff.mpr (show 0 ≤ L/2 by positivity) + rw [Real.sinh_eq, hminus] at hh + change L/2 ≤ (E-E*ρ)/2 at hh + linarith + have hsquare : L^2 ≤ (E-E*ρ)^2 := by nlinarith + have hweighted := mul_le_mul_of_nonneg_right hsquare hρ.le + have hid : (E-E*ρ)^2*ρ = (1-ρ)^2 := by + calc + _ = (E^2*ρ)*(1-ρ)^2 := by ring + _ = _ := by rw [he2, one_mul] + rw [hid] at hweighted + have hcross := (le_div_iff₀ (sq_pos_of_pos (sub_pos.mpr hρ1))).mp hgrowth + have hratio : (1-ρ)^2/ρ ≤ R/D := by + apply (div_le_div_iff₀ hρ hD).mpr + nlinarith + exact ((le_div_iff₀ hρ).mpr hweighted).trans hratio + +lemma interaction_decay_of_growth {ρ b D a u : ℝ} + (hρ : 0 < ρ) (hρ1 : ρ < 1) (hD : 0 < D) (hb : b ≤ D) + (hgrowth : D ≤ (b*Real.exp (-2*a*u))*ρ/(1-ρ)^2) : + -Real.log ρ ≤ Real.exp (-a*u) := by + have hsq := neg_log_sq_le_radius_ratio hρ hρ1 hD hgrowth + have hratio : (b*Real.exp (-2*a*u))/D ≤ Real.exp (-2*a*u) := by + apply (div_le_iff₀ hD).mpr + nlinarith [mul_le_mul_of_nonneg_right hb (Real.exp_pos (-2*a*u)).le] + have hexp : Real.exp (-2*a*u) = (Real.exp (-a*u))^2 := by + rw [pow_two, ← Real.exp_add] + congr 1 + ring + have hfinal := hsq.trans hratio + rw [hexp] at hfinal + exact (sq_le_sq₀ (neg_nonneg.mpr (Real.log_nonpos hρ.le hρ1.le)) + (Real.exp_pos _).le).mp hfinal + +/-- A physical disk uniformization supplies the growth hypothesis used +above. No derivative of the original half-plane map is bounded. -/ +theorem disk_interaction_decay (hgrowth : PublishedDiskUnivalentGrowth) + (f : ℂ → ℂ) (hf : DifferentiableOn ℂ f (ball 0 1)) + (hinj : InjOn f (ball 0 1)) (z : ℂ) (hz : z ∈ ball (0 : ℂ) 1) + (hz0 : z ≠ 0) (b a u : ℝ) (hb : b ≤ ‖f z-f 0‖) + (hradius : ‖deriv f 0‖ = b*Real.exp (-2*a*u)) : + -Real.log ‖z‖ ≤ Real.exp (-a*u) := by + have hρ : 0 < ‖z‖ := norm_pos_iff.mpr hz0 + have hρ1 : ‖z‖ < 1 := by simpa only [mem_ball, dist_zero_right] using hz + have hD : 0 < ‖f z-f 0‖ := norm_pos_iff.mpr (sub_ne_zero.mpr (by + intro he + exact hz0 (hinj hz (by simp) he))) + apply interaction_decay_of_growth hρ hρ1 hD hb + simpa only [hradius] using hgrowth f hf hinj z hz + +lemma interaction_decay_max {L a u v : ℝ} + (hu : L ≤ Real.exp (-a*u)) (hv : L ≤ Real.exp (-a*v)) : + L ≤ Real.exp (-a*max u v) := by + rcases le_total u v with h | h + · simpa only [max_eq_right h] using hv + · simpa only [max_eq_left h] using hu + +end Multipoint +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointGlobalDiscount.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointGlobalDiscount.lean new file mode 100644 index 0000000000000000000000000000000000000000..793155090d50051672fffc41738dfabbcaa56a02 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointGlobalDiscount.lean @@ -0,0 +1,121 @@ +import OAI.Probability.SLE.Multipoint.MultipointUniformCost +import OAI.Probability.SLE.Multipoint.MultipointIntegratedCost + +namespace OAI + +/-! A uniform discount budget from the individual live intervals. The +pair sum is ordered, as in the product generator. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def singleDriftConstant (κ : ℝ) : ℝ := + driftAllowance (greenExponent κ)*driftThreshold (greenExponent κ)^(-greenExponent κ) + +lemma singleDriftConstant_pos {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) : + 0 < singleDriftConstant κ := by + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + exact mul_pos (driftAllowance_pos hp) (Real.rpow_pos_of_pos (driftThreshold_pos hp) _) + +def uniformDiscountBudget {ι : Type*} [DecidableEq ι] (κ β : ℝ) (I : Finset ι) : ℝ := + κ*(singleDriftConstant κ*((I.card : ℝ)*(2/(κ*β))) + + allPatternYoungConstant κ I*((I.offDiag.card : ℝ)* + interactionBudget 2 (exponent (greenExponent κ)*(κ*β)))) + +lemma productDriftCost_le_active_envelope {ι : Type*} [DecidableEq ι] + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) {I s : Finset ι} (hs : s ⊆ I) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (z : ι → ℂ × ℝ) (x t : ℝ) + (a b : ι → ℝ) (c d : ι × ι → ℝ) (f : ι → ℝ → ℝ) (g : ι × ι → ℝ → ℝ) + (hf0 : ∀ i ∈ I, 0 ≤ f i t) (hg0 : ∀ ij ∈ I.offDiag, 0 ≤ g ij t) + (hfi : ∀ i ∈ s, t ∈ Ioc (a i) (b i)) + (hgi : ∀ ij ∈ s.offDiag, t ∈ Ioc (c ij) (d ij)) + (hf : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (z i)*logVelocity κ (z i) x^2 = f i t) + (hg : ∀ ij ∈ s.offDiag, + (branchRegulator κ (D ij.1) (σ ij.1) (z ij.1)* + branchRegulator κ (D ij.2) (σ ij.2) (z ij.2))^(-exponent (greenExponent κ))* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x) = g ij t) : + productDriftCost s κ D σ z x ≤ + κ*(singleDriftConstant κ*(∑ i ∈ I, (Ioc (a i) (b i)).indicator (f i) t) + + allPatternYoungConstant κ I*(∑ ij ∈ I.offDiag, (Ioc (c ij) (d ij)).indicator (g ij) t)) := by + apply (productDriftCost_le_uniform hκ hκ8 hs D σ hD z x).trans + apply mul_le_mul_of_nonneg_left _ hκ.le + apply add_le_add + · apply mul_le_mul_of_nonneg_left _ (singleDriftConstant_pos hκ hκ8).le + calc + _ = ∑ i ∈ s, (Ioc (a i) (b i)).indicator (f i) t := by + apply Finset.sum_congr rfl + intro i hi + rw [hf i hi, indicator_of_mem (hfi i hi)] + _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg hs (fun i hi _ => by + by_cases ht : t ∈ Ioc (a i) (b i) + · simpa only [indicator_of_mem ht] using hf0 i hi + · simp only [indicator_of_notMem ht, le_refl]) + · apply mul_le_mul_of_nonneg_left _ (allPatternYoungConstant_pos hκ hκ8 I).le + calc + _ = ∑ ij ∈ s.offDiag, (Ioc (c ij) (d ij)).indicator (g ij) t := by + apply Finset.sum_congr rfl + intro ij hij + rw [hg ij hij, indicator_of_mem (hgi ij hij)] + _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg (Finset.offDiag_mono hs) (fun ij hij _ => by + by_cases ht : t ∈ Ioc (c ij) (d ij) + · simpa only [indicator_of_mem ht] using hg0 ij hij + · simp only [indicator_of_notMem ht, le_refl]) + +theorem integrated_uniform_discount_le {ι : Type*} [DecidableEq ι] + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) (β : ℝ) (I : Finset ι) + (a b : ι → ℝ) (c d : ι × ι → ℝ) (H : ℝ) (hH : 0 ≤ H) + (f : ι → ℝ → ℝ) (g : ι × ι → ℝ → ℝ) + (ha : ∀ i ∈ I, 0 ≤ a i) (hab : ∀ i ∈ I, a i ≤ b i) (hb : ∀ i ∈ I, b i ≤ H) + (hc : ∀ ij ∈ I.offDiag, 0 ≤ c ij) (hcd : ∀ ij ∈ I.offDiag, c ij ≤ d ij) + (hd : ∀ ij ∈ I.offDiag, d ij ≤ H) + (hf : ∀ i ∈ I, IntervalIntegrable (f i) volume (a i) (b i)) + (hg : ∀ ij ∈ I.offDiag, IntervalIntegrable (g ij) volume (c ij) (d ij)) + (hfB : ∀ i ∈ I, (∫ t in a i..b i, f i t) ≤ 2/(κ*β)) + (hgB : ∀ ij ∈ I.offDiag, (∫ t in c ij..d ij, g ij t) ≤ + interactionBudget 2 (exponent (greenExponent κ)*(κ*β))) + (R : ℝ → ℝ) (hR : IntervalIntegrable R volume 0 H) + (hle : R ≤ᵐ[volume.restrict (Icc 0 H)] (fun t => + κ*(singleDriftConstant κ*(∑ i ∈ I, (Ioc (a i) (b i)).indicator (f i) t) + + allPatternYoungConstant κ I*(∑ ij ∈ I.offDiag, (Ioc (c ij) (d ij)).indicator (g ij) t)))) : + (∫ t in 0..H, R t) ≤ uniformDiscountBudget κ β I := by + let F := fun t => ∑ i ∈ I, (Ioc (a i) (b i)).indicator (f i) t + let G := fun t => ∑ ij ∈ I.offDiag, (Ioc (c ij) (d ij)).indicator (g ij) t + have hFi : IntervalIntegrable F volume 0 H := by + convert (IntervalIntegrable.sum (a := 0) (b := H) I + (fun i hi => active_interval_integrable (f i) (hf i hi))) using 1 + ext t + simp only [F, Finset.sum_apply] + have hGi : IntervalIntegrable G volume 0 H := by + convert (IntervalIntegrable.sum (a := 0) (b := H) I.offDiag + (fun i hi => active_interval_integrable (g i) (hg i hi))) using 1 + ext t + simp only [G, Finset.sum_apply] + have hFB : (∫ t in 0..H, F t) ≤ (I.card : ℝ)*(2/(κ*β)) := by + simpa only [Finset.sum_const, nsmul_eq_mul] using + finite_active_cost_integral_le I a b (fun _ => 2/(κ*β)) f H ha hab hb hf hfB + have hGB : (∫ t in 0..H, G t) ≤ (I.offDiag.card : ℝ)* + interactionBudget 2 (exponent (greenExponent κ)*(κ*β)) := by + simpa only [Finset.sum_const, nsmul_eq_mul] using + finite_active_cost_integral_le I.offDiag c d + (fun _ => interactionBudget 2 (exponent (greenExponent κ)*(κ*β))) g H hc hcd hd hg hgB + apply (intervalIntegral.integral_mono_ae_restrict hH hR + (((hFi.const_mul _).add (hGi.const_mul _)).const_mul _) hle).trans + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_add (hFi.const_mul _) (hGi.const_mul _), + intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] + apply mul_le_mul_of_nonneg_left _ hκ.le + exact add_le_add + (mul_le_mul_of_nonneg_left hFB (singleDriftConstant_pos hκ hκ8).le) + (mul_le_mul_of_nonneg_left hGB (allPatternYoungConstant_pos hκ hκ8 I).le) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointHorizonStages.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointHorizonStages.lean new file mode 100644 index 0000000000000000000000000000000000000000..397ce4ff70f39e2240a42e8c9de7560e16412960 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointHorizonStages.lean @@ -0,0 +1,117 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhaseProcess + +namespace OAI + +/-! Only the integration intervals are capped at the localization horizon. +The phase continues to read the original switches, so an unreached switch +is not mistaken for completion at the horizon. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def horizonStage {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) (n : ℕ) (ω : Ω) : ℝ≥0 := + min (sortedStopAt l (H+1) n ω) H + +lemma horizonStage_stopping {Ω : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (l : List (Ω → ℝ≥0)) + (hl : ∀ τ ∈ l, IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) + (H : ℝ≥0) (n : ℕ) : + IsStoppingTime ℱ (fun ω => (horizonStage l H n ω : WithTop ℝ≥0)) := by + simpa only [horizonStage, WithTop.coe_min] using + (sortedStopAt_stopping ℱ l hl (H+1) n).min_const H + +lemma horizonStage_monotone {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ τ ∈ l, ∀ ω, τ ω ≤ H+1) (ω : Ω) : + Monotone (fun n => horizonStage l H n ω) := by + intro i j hij + exact min_le_min_right H (sortedStopAt_monotone l (H+1) hl ω hij) + +lemma horizonStage_le {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) (n : ℕ) (ω : Ω) : + horizonStage l H n ω ≤ H := min_le_right _ _ + +lemma horizonStage_last {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) (ω : Ω) : + horizonStage l H l.length ω = H := by + simp only [horizonStage, sortedStopAt_length] + exact min_eq_right (le_add_of_nonneg_right zero_le_one) + +lemma exists_finite_stage (τ : ℕ → ℝ≥0) (N : ℕ) (t : ℝ≥0) + (h0 : τ 0 ≤ t) (hN : t < τ N) : + ∃ n < N, τ n ≤ t ∧ t < τ (n+1) := by + induction N with + | zero => exact False.elim ((not_lt_of_ge h0) hN) + | succ N ih => + by_cases h : t < τ N + · obtain ⟨n, hn, ht⟩ := ih h + exact ⟨n, Nat.lt_trans hn (Nat.lt_succ_self N), ht⟩ + · exact ⟨N, Nat.lt_succ_self N, le_of_not_gt h, hN⟩ + +lemma horizonStage_zero {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ τ ∈ l, ∀ ω, τ ω ≤ H+1) (hzero : (fun _ : Ω => (0 : ℝ≥0)) ∈ l) + (ω : Ω) : horizonStage l H 0 ω = 0 := by + rw [horizonStage, sortedStopAt_zero l (H+1) hl hzero ω] + exact min_eq_left bot_le + +lemma horizonStage_cover {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ τ ∈ l, ∀ ω, τ ω ≤ H+1) (hzero : (fun _ : Ω => (0 : ℝ≥0)) ∈ l) + (ω : Ω) (t : ℝ≥0) (ht : t < H) : + ∃ n < l.length, horizonStage l H n ω ≤ t ∧ t < horizonStage l H (n+1) ω := by + apply exists_finite_stage + · rw [horizonStage_zero l H hl hzero ω] + exact bot_le + · rwa [horizonStage_last] + +lemma horizonStage_nonempty {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (n : ℕ) (ω : Ω) (t : ℝ≥0) + (hnt : horizonStage l H n ω ≤ t) (htn : t < horizonStage l H (n+1) ω) : + sortedStopAt l (H+1) n ω ≤ t ∧ t < sortedStopAt l (H+1) (n+1) ω := by + have htH : t < H := htn.trans_le (horizonStage_le l H (n+1) ω) + have hnH : sortedStopAt l (H+1) n ω < H := by + by_contra h + have hn := le_of_not_gt h + have he : horizonStage l H n ω = H := min_eq_right hn + rw [he] at hnt + exact (not_le_of_gt htH) hnt + exact ⟨by simpa only [horizonStage, min_eq_left hnH.le] using hnt, + htn.trans_le (min_le_left _ _)⟩ + +lemma phaseAt_const_horizon_interval {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (t : ℝ≥0) + (hnt : horizonStage l H n ω ≤ t) (htn : t < horizonStage l H (n+1) ω) : + phaseAt ρ t ω = phaseAt ρ (horizonStage l H n ω) ω := by + obtain ⟨hleft, hright⟩ := horizonStage_nonempty l H n ω t hnt htn + have htH : t < H := htn.trans_le (horizonStage_le l H (n+1) ω) + have hnH' : sortedStopAt l (H+1) n ω ≤ H := hleft.trans htH.le + rw [horizonStage, min_eq_left hnH'] + exact phaseAt_const_sorted_interval ρ l (H+1) hl hρ n ω t hleft hright + +lemma phaseAt_crossed_horizon_switch {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (i : ι) (k : Fin 3) + (hord : Monotone (fun j => ρ (i,j) ω)) + (hbefore : (phaseAt ρ (horizonStage l H n ω) ω i).val ≤ k.val) + (hafter : k.val+1 ≤ (phaseAt ρ (horizonStage l H (n+1) ω) ω i).val) : + ρ (i,k) ω = horizonStage l H (n+1) ω := by + have hupper := (phaseAt_ge_iff ρ ω i hord _ k).mp hafter + have hlt : horizonStage l H n ω < ρ (i,k) ω := by + by_contra h + have hc := (phaseAt_ge_iff ρ ω i hord _ k).mpr (le_of_not_gt h) + omega + have hsorted : sortedStopAt l (H+1) n ω < ρ (i,k) ω := by + by_contra h + have hp : ρ (i,k) ω ≤ sortedStopAt l (H+1) n ω := le_of_not_gt h + have hH : ρ (i,k) ω ≤ H := hupper.trans (horizonStage_le l H (n+1) ω) + exact (not_le_of_gt hlt) (le_min hp hH) + have hnext := sortedStopAt_no_intermediate l (H+1) hl _ (hρ (i,k)) n ω hsorted + exact le_antisymm hupper ((min_le_left _ _).trans hnext) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointInitialParameters.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointInitialParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..9dd105dee9d0edfb205827de544b4792cc9c18b3 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointInitialParameters.lean @@ -0,0 +1,121 @@ +import OAI.Probability.SLE.Multipoint.MultipointRadiusStatus +import OAI.Probability.SLE.Multipoint.MultipointSuccess + +namespace OAI + +/-! The source-normalized parameters for the physical multipoint estimate. +All constants depend only on the SLE parameter and the finite order. -/ + +noncomputable section +open Set +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +def sourceBeta (κ : ℝ) : ℝ := beta (2/κ) (greenExponent κ) + +def sourceTarget (κ b e : ℝ) : ℝ := κ/4*Real.log (b/e) + +lemma source_parameters {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) : + 0 < greenExponent κ ∧ 0 < sourceBeta κ ∧ sourceBeta κ ≤ 1 ∧ + 2*(exponent (greenExponent κ)*sourceBeta κ) < 2/κ ∧ + 2*(exponent (greenExponent κ)*(κ*sourceBeta κ)) < 2 := by + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos,lt_div_iff₀ hκ] + linarith + have ha : 0 < 2/κ := div_pos (by norm_num) hκ + have hdecay := twice_exponent_beta_lt ha hp + refine ⟨hp,beta_pos ha hp,beta_le_one _ _,hdecay,?_⟩ + have hscaled := (source_pair_exponent_admissible (c := exponent (greenExponent κ)*sourceBeta κ) hκ).mpr hdecay + convert hscaled using 1 + ring + +lemma sourceTarget_nonneg {κ b e : ℝ} (hκ : 0 ≤ κ) (he : 0 < e) (heb : e ≤ b) : + 0 ≤ sourceTarget κ b e := by + exact mul_nonneg (div_nonneg hκ (by norm_num)) + (Real.log_nonneg ((one_le_div he).mpr heb)) + +lemma physical_radius_level_parameters {κ : ℝ} (hκ : 0 < κ) + (z : ℂ) (R b e : ℝ) (he : 0 < e) (heb : e ≤ b) (hbR : b ≤ R) : + let u₀ := Real.log (R/b) + let u₂ := Real.log (R/e) + 0 ≤ u₀ ∧ u₀ ≤ u₂ ∧ 0 ≤ sourceTarget κ b e ∧ + sourceClockLevel κ z u₂ = sourceClockLevel κ z u₀ + sourceTarget κ b e ∧ + sourceClockLevel κ z ((u₀+u₂)/2) = + sourceClockLevel κ z u₀ + sourceTarget κ b e/2 := by + dsimp only + have hb := he.trans_le heb + have hR := hb.trans_le hbR + have h₀ : 0 ≤ Real.log (R/b) := Real.log_nonneg ((one_le_div hb).mpr hbR) + have h₂ : Real.log (R/b) ≤ Real.log (R/e) := + Real.log_le_log (div_pos hR hb) (div_le_div_of_nonneg_left hR.le he heb) + have hgap : Real.log (R/e)-Real.log (R/b) = Real.log (b/e) := by + rw [Real.log_div hR.ne' he.ne',Real.log_div hR.ne' hb.ne',Real.log_div hb.ne' he.ne'] + ring + refine ⟨h₀,h₂,sourceTarget_nonneg hκ.le he heb,?_,?_⟩ + · unfold sourceClockLevel sourceTarget + rw [← hgap] + ring + · unfold sourceClockLevel sourceTarget + rw [← hgap] + ring + +lemma physical_switch_level_parameters {κ : ℝ} (hκ : 0 < κ) + (z : ℂ) (R b e : ℝ) (he : 0 < e) (heb : e ≤ b) (hbR : b ≤ R) : + (∀ j, 0 ≤ switchLevel R b e j) ∧ Monotone (switchLevel R b e) ∧ + sourceClockLevel κ z (switchLevel R b e 1) = + sourceClockLevel κ z (switchLevel R b e 0) + sourceTarget κ b e/2 ∧ + sourceClockLevel κ z (switchLevel R b e 2) = + sourceClockLevel κ z (switchLevel R b e 0) + sourceTarget κ b e := by + obtain ⟨_,_,_,hend,hmid⟩ := physical_radius_level_parameters hκ z R b e he heb hbR + refine ⟨fun j => switchLevel_nonneg he heb hbR j, + switchLevel_monotone he heb hbR,?_,?_⟩ + · simpa [switchLevel] using hmid + · simpa [switchLevel] using hend + +lemma sourceClockLevel_physical_activation (κ : ℝ) (J : ℂ → ℂ) (z : ℂ) + (hz : 0 < z.im) (R b : ℝ) (hR : 0 < R) (hb : 0 < b) + (hRdef : R = 2*z.im*‖deriv J z‖) : + sourceClockLevel κ z (Real.log (R/b)) = κ/4*Real.log (2*‖deriv J z‖/b) := by + have hd : ‖deriv J z‖ ≠ 0 := by + intro he + rw [hRdef,he,mul_zero] at hR + exact (lt_irrefl 0 hR) + have h2 : (2 : ℝ) ≠ 0 := by norm_num + unfold sourceClockLevel + rw [hRdef,Real.log_div (mul_ne_zero (mul_ne_zero h2 hz.ne') hd) hb.ne', + Real.log_mul (mul_ne_zero h2 hz.ne') hd,Real.log_mul h2 hz.ne', + Real.log_div (mul_ne_zero h2 hd) hb.ne',Real.log_mul h2 hd] + ring + +lemma sourceTarget_coefficient {κ : ℝ} (hκ : 0 < κ) : + 1/(2*(2/κ)) = κ/4 := by field_simp [hκ.ne']; ring + +lemma source_terminal_exponent {κ : ℝ} (hκ : 0 < κ) : + greenExponent κ/(4*(2/κ)) = 1-κ/8 := by + unfold greenExponent + field_simp [hκ.ne'] + ring + +lemma source_radius_targets_exponential {ι : Type*} (s : Finset ι) + {κ : ℝ} (hκ : 0 < κ) (b e : ι → ℝ) + (hb : ∀ i ∈ s, 0 < b i) (he : ∀ i ∈ s, 0 < e i) : + Real.exp (-greenExponent κ/2 * ∑ i ∈ s, sourceTarget κ (b i) (e i)) = + ∏ i ∈ s, (e i/b i)^(1-κ/8) := by + have h := radius_targets_exponential s (a := 2/κ) (p := greenExponent κ) + (show 0 < (2 : ℝ)/κ from div_pos (by norm_num) hκ) b e hb he + simpa only [sourceTarget,sourceTarget_coefficient hκ,source_terminal_exponent hκ] using h + +lemma source_successBarrier_inv {ι : Type*} (s : Finset ι) + {κ : ℝ} (hκ : 0 < κ) (K : ℝ) (b e : ι → ℝ) + (hb : ∀ i ∈ s, 0 < b i) (he : ∀ i ∈ s, 0 < e i) : + (successBarrier (greenExponent κ) K s (fun i => sourceTarget κ (b i) (e i)))⁻¹ = + (3 : ℝ)^s.card * Real.exp K * ∏ i ∈ s, (e i/b i)^(1-κ/8) := by + rw [successBarrier_inv,source_radius_targets_exponential s hκ b e hb he] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointIntegratedCost.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointIntegratedCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9cd1ec4e402d23bc0da97199f44bf6ef9136a04 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointIntegratedCost.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock + +namespace OAI + +/-! Integrating finitely many active-interval costs. The interval endpoints +may be different for every point or pair. -/ + +noncomputable section +open Set Filter MeasureTheory + +namespace SLEExactGauge.Multipoint + +lemma active_interval_integral (f : ℝ → ℝ) {a b H : ℝ} + (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ H) : + (∫ t in 0..H, (Ioc a b).indicator f t) = ∫ t in a..b, f t := by + have h0H := ha.trans (hab.trans hb) + rw [intervalIntegral.integral_of_le h0H, MeasureTheory.integral_indicator measurableSet_Ioc, + Measure.restrict_restrict measurableSet_Ioc] + rw [inter_eq_left.mpr (Ioc_subset_Ioc ha hb)] + exact (intervalIntegral.integral_of_le hab).symm + +lemma active_interval_integrable (f : ℝ → ℝ) {a b H : ℝ} + (hf : IntervalIntegrable f volume a b) : + IntervalIntegrable ((Ioc a b).indicator f) volume 0 H := + ((integrable_indicator_iff measurableSet_Ioc).mpr hf.1).intervalIntegrable + +theorem finite_active_cost_integral_le {ι : Type*} + (s : Finset ι) (a b B : ι → ℝ) (f : ι → ℝ → ℝ) (H : ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) (hab : ∀ i ∈ s, a i ≤ b i) + (hb : ∀ i ∈ s, b i ≤ H) + (hf : ∀ i ∈ s, IntervalIntegrable (f i) volume (a i) (b i)) + (hB : ∀ i ∈ s, (∫ t in a i..b i, f i t) ≤ B i) : + (∫ t in 0..H, ∑ i ∈ s, (Ioc (a i) (b i)).indicator (f i) t) ≤ ∑ i ∈ s, B i := by + rw [intervalIntegral.integral_finsetSum + (fun i hi => active_interval_integrable (f i) (hf i hi))] + apply Finset.sum_le_sum + intro i hi + rw [active_interval_integral (f i) (ha i hi) (hab i hi) (hb i hi)] + exact hB i hi + +theorem dominated_active_cost_integral_le {ι : Type*} + (s : Finset ι) (a b B : ι → ℝ) (f : ι → ℝ → ℝ) (H : ℝ) (hH : 0 ≤ H) + (ha : ∀ i ∈ s, 0 ≤ a i) (hab : ∀ i ∈ s, a i ≤ b i) + (hb : ∀ i ∈ s, b i ≤ H) + (hf : ∀ i ∈ s, IntervalIntegrable (f i) volume (a i) (b i)) + (hB : ∀ i ∈ s, (∫ t in a i..b i, f i t) ≤ B i) + (R : ℝ → ℝ) (hR : IntervalIntegrable R volume 0 H) + (hle : R ≤ᵐ[volume.restrict (Icc 0 H)] + (fun t => ∑ i ∈ s, (Ioc (a i) (b i)).indicator (f i) t)) : + (∫ t in 0..H, R t) ≤ ∑ i ∈ s, B i := by + have hsum : IntervalIntegrable + (fun t => ∑ i ∈ s, (Ioc (a i) (b i)).indicator (f i) t) volume 0 H := + by + convert (IntervalIntegrable.sum (a := 0) (b := H) s + (fun i hi => active_interval_integrable (f i) (hf i hi))) using 1 + ext t + simp only [Finset.sum_apply] + exact (intervalIntegral.integral_mono_ae_restrict hH hR hsum hle).trans + (finite_active_cost_integral_le s a b B f H ha hab hb hf hB) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointInteraction.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointInteraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3598ec5801aa79bcb94db7efd0fc2f9f7c43359e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointInteraction.lean @@ -0,0 +1,158 @@ +import OAI.Probability.SLE.KernelConsistency + +namespace OAI + +/-! The interaction of two active points in the September 25 manuscript, +equation `mp:interaction-derivative`. Centering by a common real driver +does not change the kernel, so differentiability of that driver is not +needed for the ordinary Loewner-path calculation. -/ + +noncomputable section +open Set Filter Complex +open scoped Topology ComplexConjugate NNReal + +namespace SLEExactGauge.Multipoint + +def interaction (z w : ℂ) : ℝ := halfPlaneGreen z w + +lemma interaction_eq (z w : ℂ) : + interaction z w = Real.log ‖(z - conj w) / (z - w)‖ := rfl + +lemma interaction_nonneg {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + 0 ≤ interaction z w := halfPlaneGreen_nonneg hz hw + +lemma interaction_center (z w : ℂ) (u : ℝ) : + interaction (z - (u : ℂ)) (w - (u : ℂ)) = interaction z w := by + have hn : z - (u : ℂ) - conj (w - (u : ℂ)) = z - conj w := by + simp only [map_sub, Complex.conj_ofReal] + ring + have hd : z - (u : ℂ) - (w - (u : ℂ)) = z - w := by ring + unfold interaction halfPlaneGreen + rw [hn, hd] + +/-- The real-part identity behind the interaction derivative. -/ +lemma interaction_velocity_algebra (a : ℝ) (z w : ℂ) : + (-(a : ℂ) / (z * conj w) + (a : ℂ) / (z * w)).re = + -2 * a * (z.im / ‖z‖ ^ 2) * (w.im / ‖w‖ ^ 2) := by + simp only [Complex.add_re, Complex.div_re, Complex.neg_re, Complex.neg_im, + Complex.ofReal_re, Complex.ofReal_im, Complex.mul_re, Complex.conj_re, + Complex.conj_im, Complex.normSq_mul, Complex.normSq_conj, Complex.sq_norm] + ring + +lemma interaction_difference_algebra (a : ℝ) {z w : ℂ} + (hz : 0 < z.im) (hw : 0 < w.im) (hne : z ≠ w) : + (((a : ℂ) / z - conj ((a : ℂ) / w)) / (z - conj w) - + ((a : ℂ) / z - (a : ℂ) / w) / (z - w)).re = + -2 * a * (z.im / ‖z‖ ^ 2) * (w.im / ‖w‖ ^ 2) := by + have hz0 : z ≠ 0 := fun h => by simp only [h, Complex.zero_im, lt_self_iff_false] at hz + have hw0 : w ≠ 0 := fun h => by simp only [h, Complex.zero_im, lt_self_iff_false] at hw + have hcw0 : conj w ≠ 0 := by simpa using hw0 + have hn : z - w ≠ 0 := sub_ne_zero.mpr hne + have hnc : z - conj w ≠ 0 := by + intro he + have hi := congrArg Complex.im (sub_eq_zero.mp he) + simp only [Complex.conj_im] at hi + linarith + have h₁ : ((a : ℂ) / z - conj ((a : ℂ) / w)) / (z - conj w) = + -(a : ℂ) / (z * conj w) := by + simp only [map_div₀, Complex.conj_ofReal] + field_simp + ring + have h₂ : ((a : ℂ) / z - (a : ℂ) / w) / (z - w) = + -(a : ℂ) / (z * w) := by + field_simp + ring + rw [h₁, h₂] + simpa only [neg_div, sub_neg_eq_add] using interaction_velocity_algebra a z w + +/-- Two differentiable paths with a common real drift have the source's +interaction derivative; the common drift cancels in both differences. -/ +theorem interaction_hasDerivWithinAt + {f g : ℝ → ℂ} {S : Set ℝ} {t a b : ℝ} + (hf : HasDerivWithinAt f ((a : ℂ) / f t + (b : ℂ)) S t) + (hg : HasDerivWithinAt g ((a : ℂ) / g t + (b : ℂ)) S t) + (hfi : 0 < (f t).im) (hgi : 0 < (g t).im) (hne : f t ≠ g t) : + HasDerivWithinAt (fun s => interaction (f s) (g s)) + (-2 * a * ((f t).im / ‖f t‖ ^ 2) * ((g t).im / ‖g t‖ ^ 2)) S t := by + have hn : f t - g t ≠ 0 := sub_ne_zero.mpr hne + have hnc : f t - conj (g t) ≠ 0 := by + intro he + have hi := congrArg Complex.im (sub_eq_zero.mp he) + simp only [Complex.conj_im] at hi + linarith + have hd := hasDerivWithinAt_log_norm_div + (hf.sub (hasDerivWithinAt_conj hg)) (hf.sub hg) hnc hn + apply hd.congr_deriv + change (((a : ℂ) / f t + (b : ℂ) - conj ((a : ℂ) / g t + (b : ℂ))) / + (f t - conj (g t)) - + ((a : ℂ) / f t + (b : ℂ) - ((a : ℂ) / g t + (b : ℂ))) / + (f t - g t)).re = _ + simp only [map_add, Complex.conj_ofReal] + have h₁ : (a : ℂ) / f t + (b : ℂ) - (conj ((a : ℂ) / g t) + (b : ℂ)) = + (a : ℂ) / f t - conj ((a : ℂ) / g t) := by ring + have h₂ : (a : ℂ) / f t + (b : ℂ) - ((a : ℂ) / g t + (b : ℂ)) = + (a : ℂ) / f t - (a : ℂ) / g t := by ring + rw [h₁, h₂] + exact interaction_difference_algebra a hfi hgi hne + +theorem interaction_hasDerivAt + {f g : ℝ → ℂ} {t a b : ℝ} + (hf : HasDerivAt f ((a : ℂ) / f t + (b : ℂ)) t) + (hg : HasDerivAt g ((a : ℂ) / g t + (b : ℂ)) t) + (hfi : 0 < (f t).im) (hgi : 0 < (g t).im) (hne : f t ≠ g t) : + HasDerivAt (fun s => interaction (f s) (g s)) + (-2 * a * ((f t).im / ‖f t‖ ^ 2) * ((g t).im / ‖g t‖ ^ 2)) t := + (interaction_hasDerivWithinAt hf.hasDerivWithinAt hg.hasDerivWithinAt hfi hgi hne + (S := univ)).hasDerivAt (univ_mem) + +/-- The driver can be any real function here: only the two uncentered +Loewner paths are differentiated. -/ +theorem centered_interaction_hasDerivWithinAt + {f g : ℝ → ℂ} (U : ℝ → ℝ) {S : Set ℝ} {t a : ℝ} + (hf : HasDerivWithinAt f ((a : ℂ) / (f t - (U t : ℂ))) S t) + (hg : HasDerivWithinAt g ((a : ℂ) / (g t - (U t : ℂ))) S t) + (hfi : 0 < (f t).im) (hgi : 0 < (g t).im) (hne : f t ≠ g t) : + HasDerivWithinAt + (fun s => interaction (f s - (U s : ℂ)) (g s - (U s : ℂ))) + (-2 * a * ((f t).im / ‖f t - (U t : ℂ)‖ ^ 2) * + ((g t).im / ‖g t - (U t : ℂ)‖ ^ 2)) S t := by + have hn : f t - g t ≠ 0 := sub_ne_zero.mpr hne + have hnc : f t - conj (g t) ≠ 0 := by + intro he + have hi := congrArg Complex.im (sub_eq_zero.mp he) + simp only [Complex.conj_im] at hi + linarith + have hd := hasDerivWithinAt_log_norm_div + (hf.sub (hasDerivWithinAt_conj hg)) (hf.sub hg) hnc hn + have h₁ : f t - conj (g t) = + (f t - (U t : ℂ)) - conj (g t - (U t : ℂ)) := by + simp only [map_sub, Complex.conj_ofReal] + ring + have h₂ : f t - g t = (f t - (U t : ℂ)) - (g t - (U t : ℂ)) := by ring + have hd' : HasDerivWithinAt (fun s => interaction (f s) (g s)) + (-2 * a * ((f t).im / ‖f t - (U t : ℂ)‖ ^ 2) * + ((g t).im / ‖g t - (U t : ℂ)‖ ^ 2)) S t := by + apply hd.congr_deriv + dsimp only [Pi.sub_apply] + rw [h₁, h₂, interaction_difference_algebra a (by simpa using hfi) + (by simpa using hgi) (sub_left_inj.not.mpr hne)] + simp only [Complex.sub_im, Complex.ofReal_im, sub_zero] + simpa only [interaction_center] using hd' + +theorem centered_interaction_hasDerivAt + {f g : ℝ → ℂ} (U : ℝ → ℝ) {t a : ℝ} + (hf : HasDerivAt f ((a : ℂ) / (f t - (U t : ℂ))) t) + (hg : HasDerivAt g ((a : ℂ) / (g t - (U t : ℂ))) t) + (hfi : 0 < (f t).im) (hgi : 0 < (g t).im) (hne : f t ≠ g t) : + HasDerivAt + (fun s => interaction (f s - (U s : ℂ)) (g s - (U s : ℂ))) + (-2 * a * ((f t).im / ‖f t - (U t : ℂ)‖ ^ 2) * + ((g t).im / ‖g t - (U t : ℂ)‖ ^ 2)) t := + (centered_interaction_hasDerivWithinAt U hf.hasDerivWithinAt hg.hasDerivWithinAt + hfi hgi hne (S := univ)).hasDerivAt univ_mem + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointInteractionShells.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointInteractionShells.lean new file mode 100644 index 0000000000000000000000000000000000000000..52b45c69534b706653ccf74352e8998f0ac70ca7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointInteractionShells.lean @@ -0,0 +1,242 @@ +import OAI.Probability.SLE.Multipoint.MultipointInteraction +import OAI.Probability.SLE.Multipoint.MultipointRegularizer + +namespace OAI + +/-! The Green drop bounds the mass of every clock shell. The first point +of the closed clock tail gives the bound even when a clock is constant on +an interval. Disjoint measurable shells then give the manuscript's +weighted interaction budget. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal Function + +namespace SLEExactGauge.Multipoint + +def clockTail (s T : ℝ) (q : ℝ → ℝ) (k : ℕ) : Set ℝ := + Icc s T ∩ q ⁻¹' Ici (k : ℝ) + +def clockShell (s T : ℝ) (q : ℝ → ℝ) (k : ℕ) : Set ℝ := + clockTail s T q k \ clockTail s T q (k + 1) + +lemma clockTail_isClosed {s T : ℝ} {q : ℝ → ℝ} + (hq : ContinuousOn q (Icc s T)) (k : ℕ) : IsClosed (clockTail s T q k) := + hq.preimage_isClosed_of_isClosed isClosed_Icc isClosed_Ici + +lemma clockTail_isCompact {s T : ℝ} {q : ℝ → ℝ} + (hq : ContinuousOn q (Icc s T)) (k : ℕ) : IsCompact (clockTail s T q k) := + isCompact_Icc.of_isClosed_subset (clockTail_isClosed hq k) inter_subset_left + +lemma clockShell_measurableSet {s T : ℝ} {q : ℝ → ℝ} + (hq : ContinuousOn q (Icc s T)) (k : ℕ) : MeasurableSet (clockShell s T q k) := + (clockTail_isClosed hq k).measurableSet.diff + (clockTail_isClosed hq (k + 1)).measurableSet + +lemma mem_clockShell {s T : ℝ} {q : ℝ → ℝ} {k : ℕ} {t : ℝ} : + t ∈ clockShell s T q k ↔ t ∈ Icc s T ∧ (k : ℝ) ≤ q t ∧ q t < k + 1 := by + simp only [clockShell, clockTail, Set.mem_sdiff, mem_inter_iff, mem_preimage, mem_Ici, + Nat.cast_add, Nat.cast_one] + constructor + · rintro ⟨⟨hI, hlo⟩, hn⟩ + exact ⟨hI, hlo, lt_of_not_ge (fun hh => hn ⟨hI, hh⟩)⟩ + · rintro ⟨hI, hlo, hhi⟩ + exact ⟨⟨hI, hlo⟩, fun hh => (not_le_of_gt hhi) hh.2⟩ + +lemma clockShell_pairwise (s T : ℝ) (q : ℝ → ℝ) : + Pairwise (Disjoint on clockShell s T q) := by + intro i j hij + apply disjoint_left.mpr + intro t hi hj + have hi' := mem_clockShell.mp hi + have hj' := mem_clockShell.mp hj + rcases lt_or_gt_of_ne hij with h | h + · have hcast : (i : ℝ) + 1 ≤ j := by exact_mod_cast Nat.succ_le_of_lt h + linarith + · have hcast : (j : ℝ) + 1 ≤ i := by exact_mod_cast Nat.succ_le_of_lt h + linarith + +lemma iUnion_clockShell {s T : ℝ} {q : ℝ → ℝ} + (h0 : ∀ t ∈ Icc s T, 0 ≤ q t) : + (⋃ k : ℕ, clockShell s T q k) = Icc s T := by + ext t + constructor + · intro ht + obtain ⟨k, hk⟩ := mem_iUnion.mp ht + exact (mem_clockShell.mp hk).1 + · intro ht + refine mem_iUnion.mpr ⟨⌊q t⌋₊, mem_clockShell.mpr ⟨ht, Nat.floor_le (h0 t ht), ?_⟩⟩ + exact Nat.lt_floor_add_one (q t) + +/-- A future Green-drop bound and the exponential interaction decay give +the exact mass bound for a single shell of the increasing clock. -/ +theorem interaction_shell_mass_bound + {s T a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (q R L : ℝ → ℝ) + (hq : ContinuousOn q (Icc s T)) (hR : ContinuousOn R (Icc s T)) + (hR0 : ∀ t ∈ Icc s T, 0 ≤ R t) + (hdrop : ∀ t ∈ Icc s T, (∫ v in t..T, R v) ≤ L t / (2 * a)) + (hdecay : ∀ t ∈ Icc s T, L t ≤ M * Real.exp (-a * q t)) (k : ℕ) : + (∫ t in clockShell s T q k, R t) ≤ M * Real.exp (-a * k) / (2 * a) := by + classical + by_cases hne : (clockTail s T q k).Nonempty + · obtain ⟨τ, hτ⟩ := (clockTail_isCompact hq k).exists_isLeast hne + have hτI : τ ∈ Icc s T := hτ.1.1 + have hτq : (k : ℝ) ≤ q τ := hτ.1.2 + have hsub : clockShell s T q k ⊆ Icc τ T := by + intro t ht + exact ⟨hτ.2 ht.1, ht.1.1.2⟩ + have hI : Icc τ T ⊆ Icc s T := Icc_subset_Icc hτI.1 le_rfl + have hnonneg : 0 ≤ᵐ[volume.restrict (Icc τ T)] R := by + change ∀ᵐ t ∂volume.restrict (Icc τ T), 0 ≤ R t + rw [ae_restrict_iff' measurableSet_Icc] + exact Eventually.of_forall (fun t ht => hR0 t (hI ht)) + calc + _ ≤ ∫ t in Icc τ T, R t := + setIntegral_mono_set (hR.mono hI).integrableOn_Icc hnonneg + (Eventually.of_forall hsub) + _ = ∫ t in τ..T, R t := by + rw [integral_Icc_eq_integral_Ioc, intervalIntegral.integral_of_le hτI.2] + _ ≤ L τ / (2 * a) := hdrop τ hτI + _ ≤ M * Real.exp (-a * k) / (2 * a) := by + apply div_le_div_of_nonneg_right _ (by positivity) + exact (hdecay τ hτI).trans + (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by nlinarith)) hM) + · have hs : clockShell s T q k = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro t ht + exact hne ⟨t, ht.1⟩ + rw [hs] + simp only [Measure.restrict_empty, integral_zero_measure] + positivity + +lemma weighted_shell_sum_le_prefactor {a c M : ℝ} + (ha : 0 < a) (hc : 2 * c < a) (_hM : 0 ≤ M) + (mass : ℕ → ℝ) (h0 : ∀ k, 0 ≤ mass k) + (hmass : ∀ k : ℕ, mass k ≤ M * Real.exp (-a * k) / (2 * a)) : + Summable (fun k : ℕ => Real.exp (2 * c * ((k : ℝ) + 1)) * mass k) ∧ + (∑' k : ℕ, Real.exp (2 * c * ((k : ℝ) + 1)) * mass k) ≤ + M * interactionBudget a c := by + have hs := (interaction_shell_series ha hc).mul_left M + have hnonneg (k : ℕ) : 0 ≤ Real.exp (2 * c * ((k : ℝ) + 1)) * mass k := + mul_nonneg (Real.exp_pos _).le (h0 k) + have hle (k : ℕ) : Real.exp (2 * c * ((k : ℝ) + 1)) * mass k ≤ + M * (Real.exp (2 * c * ((k : ℝ) + 1)) * Real.exp (-a * k) / (2 * a)) := by + calc + _ ≤ Real.exp (2 * c * ((k : ℝ) + 1)) * + (M * Real.exp (-a * k) / (2 * a)) := + mul_le_mul_of_nonneg_left (hmass k) (Real.exp_pos _).le + _ = _ := by ring + have hsum := Summable.of_nonneg_of_le hnonneg hle hs.summable + exact ⟨hsum, hs.tsum_eq ▸ hsum.tsum_le_tsum hle hs.summable⟩ + +/-- The full weighted interaction bound, derived from the Green drop; +no shell-mass estimate is assumed. -/ +theorem weighted_interaction_integral_le + {s T a c M : ℝ} (hsT : s ≤ T) (ha : 0 < a) (hM : 0 ≤ M) + (hc : 0 ≤ c) (hca : 2 * c < a) + (u v R L : ℝ → ℝ) + (hu : ContinuousOn u (Icc s T)) (hv : ContinuousOn v (Icc s T)) + (hu0 : ∀ t ∈ Icc s T, 0 ≤ u t) (hv0 : ∀ t ∈ Icc s T, 0 ≤ v t) + (hR : ContinuousOn R (Icc s T)) (hR0 : ∀ t ∈ Icc s T, 0 ≤ R t) + (hdrop : ∀ t ∈ Icc s T, (∫ x in t..T, R x) ≤ L t / (2 * a)) + (hdecay : ∀ t ∈ Icc s T, L t ≤ M * Real.exp (-a * max (u t) (v t))) : + (∫ t in s..T, Real.exp (c * (u t + v t)) * R t) ≤ M * interactionBudget a c := by + let q := fun t => max (u t) (v t) + let F := fun t => Real.exp (c * (u t + v t)) * R t + let mass := fun k => ∫ t in clockShell s T q k, R t + have hq : ContinuousOn q (Icc s T) := hu.sup hv + have hcov : (⋃ k : ℕ, clockShell s T q k) = Icc s T := + iUnion_clockShell (fun t ht => (le_min (hu0 t ht) (hv0 t ht)).trans min_le_max) + have hFm : ContinuousOn F (Icc s T) := + (Real.continuous_exp.comp_continuousOn (continuousOn_const.mul (hu.add hv))).mul hR + have hmass0 (k : ℕ) : 0 ≤ mass k := by + apply setIntegral_nonneg (clockShell_measurableSet hq k) + intro t ht + exact hR0 t (mem_clockShell.mp ht).1 + have hmass (k : ℕ) : mass k ≤ M * Real.exp (-a * k) / (2 * a) := + interaction_shell_mass_bound ha hM q R L hq hR hR0 hdrop hdecay k + obtain ⟨hsum, hsumle⟩ := weighted_shell_sum_le_prefactor ha hca hM mass hmass0 hmass + have hFint : IntegrableOn F (⋃ k : ℕ, clockShell s T q k) := by + rw [hcov] + exact hFm.integrableOn_Icc + have hpieces := hasSum_integral_iUnion (clockShell_measurableSet hq) + (clockShell_pairwise s T q) hFint + have hpiece (k : ℕ) : (∫ t in clockShell s T q k, F t) ≤ + Real.exp (2 * c * ((k : ℝ) + 1)) * mass k := by + have hsub : clockShell s T q k ⊆ Icc s T := fun t ht => (mem_clockShell.mp ht).1 + rw [← integral_const_mul] + apply setIntegral_mono_on (hFm.integrableOn_Icc.mono_set hsub) + ((hR.integrableOn_Icc.mono_set hsub).const_mul _) + (clockShell_measurableSet hq k) + intro t ht + have hkt := mem_clockShell.mp ht + apply mul_le_mul_of_nonneg_right _ (hR0 t hkt.1) + apply Real.exp_le_exp.mpr + have hsumq : u t + v t ≤ 2 * q t := by + have h₁ := le_max_left (u t) (v t) + have h₂ := le_max_right (u t) (v t) + dsimp only [q] + linarith + have hbound : u t + v t ≤ 2 * ((k : ℝ) + 1) := by linarith [hkt.2.2] + nlinarith + calc + _ = ∫ t in Icc s T, F t := by + rw [integral_Icc_eq_integral_Ioc, intervalIntegral.integral_of_le hsT] + _ = ∑' k : ℕ, ∫ t in clockShell s T q k, F t := by + rw [← hcov] + exact hpieces.tsum_eq.symm + _ ≤ ∑' k : ℕ, Real.exp (2 * c * ((k : ℝ) + 1)) * mass k := + hpieces.summable.tsum_le_tsum hpiece hsum + _ ≤ M * interactionBudget a c := hsumle + +end SLEExactGauge.Multipoint + +namespace SLEExactGauge + +/-- The weighted-shell estimate for the actual capacity-two Loewner maps. +The pair drop is supplied by the proved Green-kernel identity. Its sole +remaining geometric premise is the interaction decay during joint activity. -/ +theorem IsCapacityTwoWitness.weighted_interaction_integral_le + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (s T : ℝ≥0) (hsT : s ≤ T) (z w : ℂ) + (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) (hne : z ≠ w) + {c M : ℝ} (hM : 0 ≤ M) (hc : 0 ≤ c) (hca : 2 * c < 2) (u v : ℝ → ℝ) + (hu : ContinuousOn u (Icc (s : ℝ) (T : ℝ))) + (hv : ContinuousOn v (Icc (s : ℝ) (T : ℝ))) + (hu0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ u t) + (hv0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ v t) + (hdecay : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + halfPlaneGreen (G t.toNNReal z) (G t.toNNReal w) ≤ + M * Real.exp (-2 * max (u t) (v t))) : + (∫ t in (s : ℝ)..(T : ℝ), Real.exp (c * (u t + v t)) * + (chartPoissonRate U G t.toNNReal z * chartPoissonRate U G t.toNNReal w)) ≤ + M * Multipoint.interactionBudget 2 c := by + let R := fun t : ℝ => chartPoissonRate U G t.toNNReal z * chartPoissonRate U G t.toNNReal w + let L := fun t : ℝ => halfPlaneGreen (G t.toNNReal z) (G t.toNNReal w) + have hI : Icc (s : ℝ) (T : ℝ) ⊆ Icc 0 (T : ℝ) := + Icc_subset_Icc s.coe_nonneg le_rfl + have hR : ContinuousOn R (Icc (s : ℝ) (T : ℝ)) := + ((hw.poissonRate_continuousOn hU T z hz).mul + (hw.poissonRate_continuousOn hU T w hw')).mono hI + have hR0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ R t := by + intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + exact mul_nonneg + (hw.poissonRate_nonneg _ z (survivingDomain_antitone γ htT hz)) + (hw.poissonRate_nonneg _ w (survivingDomain_antitone γ htT hw')) + have hdrop : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + (∫ x in t..(T : ℝ), R x) ≤ L t / (2 * 2) := by + intro t ht + have ht0 : 0 ≤ t := s.coe_nonneg.trans ht.1 + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hb := hw.green_pair_bound hU t.toNNReal T htT z w hz hw' hne + simpa only [R, L, Real.coe_toNNReal _ ht0, show (2 : ℝ) * 2 = 4 by norm_num] using hb + exact Multipoint.weighted_interaction_integral_le hsT (by norm_num) hM hc hca + u v R L hu hv hu0 hv0 hR hR0 hdrop hdecay + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointKernelExpansion.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointKernelExpansion.lean new file mode 100644 index 0000000000000000000000000000000000000000..63c79773940795cd1deac63c973e4a40cff19b49 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointKernelExpansion.lean @@ -0,0 +1,162 @@ +import OAI.Probability.SLE.Multipoint.MultipointCappedKernel + +namespace OAI + +/-! Each term of the nearest-neighbor cap expansion is a loop-free graph +with at most one outgoing edge at every vertex. Integrating a vertex of +incidence at most two proves the fixed-order kernel estimate. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +def selectedTarget {ι : Type*} (f : ι → Option ι) (i : ι) : ι := (f i).getD i + +def selectedVertices {ι : Type*} [Fintype ι] [DecidableEq ι] (f : ι → Option ι) : Finset ι := + Finset.univ.filter (fun i => selectedTarget f i ≠ i) + +def selectedEdges {ι : Type*} [Fintype ι] [DecidableEq ι] (f : ι → Option ι) : Finset (ι × ι) := + (selectedVertices f).image (fun i => (i,selectedTarget f i)) + +lemma selectedEdges_outgoing {ι : Type*} [Fintype ι] [DecidableEq ι] + (f : ι → Option ι) : + ∀ e ∈ selectedEdges f, ∀ d ∈ selectedEdges f, e.1=d.1 → e=d := by + intro e he d hd h + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp he + obtain ⟨j,_,rfl⟩ := Finset.mem_image.mp hd + exact congrArg (fun i => (i,selectedTarget f i)) h + +lemma selectedEdges_loopfree {ι : Type*} [Fintype ι] [DecidableEq ι] + (f : ι → Option ι) : ∀ e ∈ selectedEdges f, e.1≠e.2 := by + intro e he + obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp he + exact (Finset.mem_filter.mp hi).2.symm + +lemma graphKernel_selectedEdges {ι : Type*} [Fintype ι] [DecidableEq ι] + (α : ℝ) (f : ι → Option ι) (x : ι → ℂ) : + graphKernel α (selectedEdges f) x = + ∏ i, if selectedTarget f i=i then 1 else distanceKernel α (x i) (x (selectedTarget f i)) := by + unfold graphKernel selectedEdges + rw [Finset.prod_image] + · simp only [selectedVertices,Finset.prod_filter] + apply Finset.prod_congr rfl + intro i _ + by_cases h : selectedTarget f i=i <;> simp [h] + · intro i _ j _ h + exact congrArg Prod.fst h + +def capCoefficient (α b : ℝ) : ℝ≥0∞ := max 1 (ENNReal.ofReal (b^(-α))) + +lemma capCoefficient_finite (α b : ℝ) : capCoefficient α b < ⊤ := by + unfold capCoefficient + exact max_lt (by simp) ENNReal.ofReal_lt_top + +lemma rowChoice_le_graph_factor {ι : Type*} [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) (f : ι → Option ι) (i : ι) : + rowChoice α b x i (f i) ≤ capCoefficient α b * + (if selectedTarget f i=i then 1 else distanceKernel α (x i) (x (selectedTarget f i))) := by + cases h : f i with + | none => + simp only [rowChoice,selectedTarget,h,Option.getD_none,ite_true,mul_one] + exact le_max_right _ _ + | some j => + simp only [rowChoice,selectedTarget,h,Option.getD_some] + by_cases hji : j=i + · simp only [hji,ite_true] + exact bot_le + · simp only [hji,ite_false] + have hc : 1 ≤ capCoefficient α b := le_max_left _ _ + calc + distanceKernel α (x i) (x j) = 1 * distanceKernel α (x i) (x j) := (one_mul _).symm + _ ≤ capCoefficient α b * distanceKernel α (x i) (x j) := by gcongr + +lemma rowProduct_le_graph {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) (f : ι → Option ι) : + (∏ i, rowChoice α b x i (f i)) ≤ + capCoefficient α b ^ Fintype.card ι * graphKernel α (selectedEdges f) x := by + rw [graphKernel_selectedEdges,← Finset.card_univ,← Finset.prod_const,← Finset.prod_mul_distrib] + exact Finset.prod_le_prod (fun i _ => rowChoice_le_graph_factor α b x f i) + +lemma cappedDistanceKernel_le_graph_sum {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) : + cappedDistanceKernel α b x ≤ + ∑ f : ι → Option ι, capCoefficient α b ^ Fintype.card ι * graphKernel α (selectedEdges f) x := + (cappedDistanceKernel_le_expansion α b x).trans + (Finset.sum_le_sum (fun f _ => rowProduct_le_graph α b x f)) + +/-- Integrate all graph vertices. The empty index set is included. -/ +theorem graphKernel_marginal_le {ι : Type*} [DecidableEq ι] + (α : ℝ) (K : Set ℂ) (C : ℝ≥0∞) (hC : C < ⊤) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (S : Finset ι) (E : Finset (ι × ι)) + (hends : ∀ e ∈ E, e.1 ∈ S ∧ e.2 ∈ S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) + (hloop : ∀ e ∈ E, e.1≠e.2) (x : ι → ℂ) : + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α E) x ≤ C^S.card := by + induction S using Finset.strongInductionOn generalizing E with + | _ S ih => + by_cases hempty : S=∅ + · have hE : E=∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro e he + simpa only [hempty,Finset.notMem_empty] using (hends e he).1 + simp only [hempty,hE,lmarginal_empty,graphKernel,Finset.prod_empty,Finset.card_empty,pow_zero,le_rfl] + · obtain ⟨v,hv,hdegree⟩ := exists_vertex_incident_card_le_two S + (Finset.nonempty_iff_ne_empty.mpr hempty) E hends hout + obtain ⟨hends',hout',hloop'⟩ := eraseVertex_properties S E v hends hout hloop + have hsmall := ih (S.erase v) (Finset.erase_ssubset hv) (eraseVertex E v) hends' hout' hloop' + calc + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α E) x = + lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (fun x => ∫⁻ y in K, graphKernel α E (Function.update x v y)) x := by + exact congrFun (lmarginal_erase' (μ := fun _ : ι => volume.restrict K) + (graphKernel α E) (measurable_graphKernel α E) hv) x + _ ≤ lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (fun x => C*graphKernel α (eraseVertex E v) x) x := + lmarginal_mono (fun x => graphKernel_section_le α K C hC0 hC1 hC2 E v x hdegree hloop) x + _ = C*lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (graphKernel α (eraseVertex E v)) x := by + exact lintegral_const_mul' C _ hC.ne + _ ≤ C*C^(S.erase v).card := by gcongr + _ = C^S.card := by rw [← Finset.card_erase_add_one hv,pow_succ,mul_comm] + +lemma selectedGraph_integral_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (α : ℝ) (K : Set ℂ) (C : ℝ≥0∞) (hC : C < ⊤) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (f : ι → Option ι) : + (∫⁻ x, graphKernel α (selectedEdges f) x ∂Measure.pi (fun _ : ι => volume.restrict K)) ≤ + C^Fintype.card ι := by + simpa only [lmarginal_univ,Finset.card_univ] using + graphKernel_marginal_le α K C hC hC0 hC1 hC2 Finset.univ (selectedEdges f) + (fun _ _ => ⟨Finset.mem_univ _,Finset.mem_univ _⟩) + (selectedEdges_outgoing f) (selectedEdges_loopfree f) (fun _ => 0) + +/-- The exact capped inverse-distance kernel has a finite integral on every +bounded planar product set, for every fixed order. -/ +theorem cappedDistanceKernel_integral_lt_top {ι : Type*} [Fintype ι] [DecidableEq ι] + {α : ℝ} (hα : 0 < α) (hα1 : α < 1) (b : ℝ) + (K : Set ℂ) (hK : Bornology.IsBounded K) : + (∫⁻ x, cappedDistanceKernel (ι := ι) α b x + ∂Measure.pi (fun _ : ι => volume.restrict K)) < ⊤ := by + obtain ⟨C,hC,_,hC0,hC1,hC2⟩ := distanceKernel_uniform_local_bounds hα hα1 K hK + apply lt_of_le_of_lt (lintegral_mono (cappedDistanceKernel_le_graph_sum α b)) + rw [lintegral_finsetSum] + · apply ENNReal.sum_lt_top.mpr + intro f _ + rw [lintegral_const_mul' _ _ (ENNReal.pow_ne_top (capCoefficient_finite α b).ne)] + exact lt_of_le_of_lt (by gcongr; exact selectedGraph_integral_le α K C hC hC0 hC1 hC2 f) + (ENNReal.mul_lt_top (ENNReal.pow_lt_top (capCoefficient_finite α b)) (ENNReal.pow_lt_top hC)) + · intro f _ + exact measurable_const.mul (measurable_graphKernel α (selectedEdges f)) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointKernelGraph.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointKernelGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..07fe29a2840afdd98c17cc4da36035c87b98edeb --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointKernelGraph.lean @@ -0,0 +1,275 @@ +import OAI.Probability.SLE.Multipoint.MultipointDistanceKernel + +namespace OAI + +/-! The finite graph elimination used in the capped distance kernel. +An edge records one selected inverse-distance factor. Each vertex has +at most one outgoing edge, including after deleting a vertex. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +def incidentEdges {ι : Type*} [DecidableEq ι] (E : Finset (ι × ι)) (v : ι) : Finset (ι × ι) := + E.filter (fun e => e.1=v ∨ e.2=v) + +def eraseVertex {ι : Type*} [DecidableEq ι] (E : Finset (ι × ι)) (v : ι) : Finset (ι × ι) := + E.filter (fun e => e.1≠v ∧ e.2≠v) + +def graphKernel {ι : Type*} (α : ℝ) (E : Finset (ι × ι)) (x : ι → ℂ) : ℝ≥0∞ := + ∏ e ∈ E, distanceKernel α (x e.1) (x e.2) + +lemma measurable_graphKernel {ι : Type*} (α : ℝ) (E : Finset (ι × ι)) : + Measurable (graphKernel α E) := by + unfold graphKernel distanceKernel + fun_prop + +lemma exists_vertex_incident_card_le_two {ι : Type*} [DecidableEq ι] + (S : Finset ι) (hS : S.Nonempty) (E : Finset (ι × ι)) + (hends : ∀ e ∈ E, e.1 ∈ S ∧ e.2 ∈ S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) : + ∃ v ∈ S, (incidentEdges E v).card ≤ 2 := by + have hcard : E.card ≤ S.card := + Finset.card_le_card_of_injOn Prod.fst (fun e he => (hends e he).1) + (fun e he f hf hef => hout e he f hf hef) + have hsum : E.card = ∑ v ∈ S, (E.filter (fun e => e.2=v)).card := + Finset.card_eq_sum_card_fiberwise (fun e he => (hends e he).2) + have hin : ∃ v ∈ S, (E.filter (fun e => e.2=v)).card ≤ 1 := by + by_contra! h + have hlt : S.card < ∑ v ∈ S, (E.filter (fun e => e.2=v)).card := by + calc + S.card = ∑ _v ∈ S, 1 := by simp + _ < _ := Finset.sum_lt_sum (fun v hv => (h v hv).le) + (by obtain ⟨v,hv⟩ := hS; exact ⟨v,hv,h v hv⟩) + omega + obtain ⟨v,hv,hin⟩ := hin + have houtcard : (E.filter (fun e => e.1=v)).card ≤ 1 := by + apply Finset.card_le_one.mpr + intro e he f hf + exact hout e (Finset.mem_filter.mp he).1 f (Finset.mem_filter.mp hf).1 + ((Finset.mem_filter.mp he).2.trans (Finset.mem_filter.mp hf).2.symm) + have heq : incidentEdges E v = (E.filter (fun e => e.1=v)) ∪ (E.filter (fun e => e.2=v)) := by + ext e + simp only [incidentEdges,Finset.mem_filter,Finset.mem_union] + tauto + refine ⟨v,hv,?_⟩ + rw [heq] + exact (Finset.card_union_le _ _).trans (by omega) + +lemma incoming_card_le_erase {ι : Type*} [DecidableEq ι] + (S : Finset ι) (E : Finset (ι × ι)) (v : ι) + (hends : ∀ e ∈ E, e.1 ∈ S ∧ e.2 ∈ S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) + (hloop : ∀ e ∈ E, e.1≠e.2) : + (E.filter (fun e => e.2=v)).card ≤ (S.erase v).card := by + apply Finset.card_le_card_of_injOn Prod.fst + · intro e he + obtain ⟨he,hev⟩ := Finset.mem_filter.mp he + exact Finset.mem_erase.mpr ⟨by simpa only [← hev] using hloop e he,(hends e he).1⟩ + · intro e he f hf hef + exact hout e (Finset.mem_filter.mp he).1 f (Finset.mem_filter.mp hf).1 hef + +/-- The low-incidence vertex can be chosen among the integration +variables even when one additional vertex is fixed. -/ +lemma exists_free_vertex_incident_card_le_two {ι : Type*} [DecidableEq ι] + (S : Finset ι) (hS : S.Nonempty) (root : ι) (hr : root ∉ S) + (E : Finset (ι × ι)) + (hends : ∀ e ∈ E, e.1 ∈ insert root S ∧ e.2 ∈ insert root S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) + (hloop : ∀ e ∈ E, e.1≠e.2) : + ∃ v ∈ S, (incidentEdges E v).card ≤ 2 := by + have hcard : E.card ≤ S.card+1 := by + have hh := Finset.card_le_card_of_injOn Prod.fst (fun e he => (hends e he).1) + (fun e he f hf hef => hout e he f hf hef) + simpa only [Finset.card_insert_of_notMem hr] using hh + have hsum : (∑ v ∈ S, (E.filter (fun e => e.2=v)).card) ≤ E.card := by + rw [Finset.sum_card_fiberwise_eq_card_filter] + exact Finset.card_filter_le _ _ + have hin : ∃ v ∈ S, (E.filter (fun e => e.2=v)).card ≤ 1 := by + by_cases hS1 : S.card=1 + · obtain ⟨v,hv⟩ := hS + refine ⟨v,hv,?_⟩ + have hh := incoming_card_le_erase (insert root S) E v hends hout hloop + have hv' : v ∈ insert root S := Finset.mem_insert_of_mem hv + simpa only [Finset.card_erase_of_mem hv',Finset.card_insert_of_notMem hr,hS1] using hh + · by_contra! hn + have htwo : S.card*2 ≤ ∑ v ∈ S, (E.filter (fun e => e.2=v)).card := by + simpa only [Finset.sum_const,smul_eq_mul] using + (Finset.sum_le_sum (s := S) (f := fun _ => (2 : ℕ)) + (g := fun v => (E.filter (fun e : ι × ι => e.2=v)).card) + (fun v hv => Nat.succ_le_of_lt (hn v hv))) + have hpos := Finset.card_pos.mpr hS + omega + obtain ⟨v,hv,hin⟩ := hin + have houtcard : (E.filter (fun e => e.1=v)).card ≤ 1 := by + apply Finset.card_le_one.mpr + intro e he f hf + exact hout e (Finset.mem_filter.mp he).1 f (Finset.mem_filter.mp hf).1 + ((Finset.mem_filter.mp he).2.trans (Finset.mem_filter.mp hf).2.symm) + have heq : incidentEdges E v = (E.filter (fun e => e.1=v)) ∪ (E.filter (fun e => e.2=v)) := by + ext e + simp only [incidentEdges,Finset.mem_filter,Finset.mem_union] + tauto + refine ⟨v,hv,?_⟩ + rw [heq] + exact (Finset.card_union_le _ _).trans (by omega) + +lemma eraseVertex_properties {ι : Type*} [DecidableEq ι] + (S : Finset ι) (E : Finset (ι × ι)) (v : ι) + (hends : ∀ e ∈ E, e.1 ∈ S ∧ e.2 ∈ S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) + (hloop : ∀ e ∈ E, e.1≠e.2) : + (∀ e ∈ eraseVertex E v, e.1 ∈ S.erase v ∧ e.2 ∈ S.erase v) ∧ + (∀ e ∈ eraseVertex E v, ∀ f ∈ eraseVertex E v, e.1=f.1 → e=f) ∧ + (∀ e ∈ eraseVertex E v, e.1≠e.2) := by + refine ⟨?_,?_,?_⟩ + · intro e he + obtain ⟨he,h1,h2⟩ := Finset.mem_filter.mp he + exact ⟨Finset.mem_erase.mpr ⟨h1,(hends e he).1⟩, + Finset.mem_erase.mpr ⟨h2,(hends e he).2⟩⟩ + · intro e he f hf + exact hout e (Finset.mem_filter.mp he).1 f (Finset.mem_filter.mp hf).1 + · intro e he + exact hloop e (Finset.mem_filter.mp he).1 + +lemma graphKernel_split_vertex {ι : Type*} [DecidableEq ι] + (α : ℝ) (E : Finset (ι × ι)) (v : ι) (x : ι → ℂ) : + graphKernel α E x = graphKernel α (incidentEdges E v) x * graphKernel α (eraseVertex E v) x := by + unfold graphKernel incidentEdges eraseVertex + have he : E.filter (fun e => e.1≠v ∧ e.2≠v) = E.filter (fun e => ¬(e.1=v ∨ e.2=v)) := by + ext e + simp only [Finset.mem_filter,not_or] + rw [he] + exact (Finset.prod_filter_mul_prod_filter_not _ _ _).symm + +lemma graphKernel_erase_update {ι : Type*} [DecidableEq ι] + (α : ℝ) (E : Finset (ι × ι)) (v : ι) (x : ι → ℂ) (y : ℂ) : + graphKernel α (eraseVertex E v) (Function.update x v y) = graphKernel α (eraseVertex E v) x := by + apply Finset.prod_congr rfl + intro e he + obtain ⟨_,h1,h2⟩ := Finset.mem_filter.mp he + simp only [Function.update_of_ne h1,Function.update_of_ne h2] + +lemma incident_edge_section {ι : Type*} [DecidableEq ι] + (α : ℝ) (e : ι × ι) (v : ι) (x : ι → ℂ) + (hinc : e.1=v ∨ e.2=v) (hloop : e.1≠e.2) : + ∃ c : ℂ, ∀ y, distanceKernel α ((Function.update x v y) e.1) + ((Function.update x v y) e.2) = distanceKernel α y c := by + rcases hinc with h1 | h2 + · have h2 : e.2≠v := by rw [← h1]; exact hloop.symm + refine ⟨x e.2,fun y => ?_⟩ + rw [h1,Function.update_self,Function.update_of_ne h2] + · have h1 : e.1≠v := by rw [← h2]; exact hloop + refine ⟨x e.1,fun y => ?_⟩ + rw [h2,Function.update_self,Function.update_of_ne h1,distanceKernel_symm] + +lemma incident_kernel_section_le {ι : Type*} [DecidableEq ι] + (α : ℝ) (K : Set ℂ) (C : ℝ≥0∞) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (E : Finset (ι × ι)) (v : ι) (x : ι → ℂ) + (hcard : E.card ≤ 2) (hinc : ∀ e ∈ E, e.1=v ∨ e.2=v) + (hloop : ∀ e ∈ E, e.1≠e.2) : + (∫⁻ y in K, graphKernel α E (Function.update x v y)) ≤ C := by + have hcases : E.card=0 ∨ E.card=1 ∨ E.card=2 := by omega + rcases hcases with h0 | h1 | h2 + · have he : E=∅ := Finset.card_eq_zero.mp h0 + simpa only [he,graphKernel,Finset.prod_empty,lintegral_const, + Measure.restrict_apply_univ,one_mul] using hC0 + · obtain ⟨e,he⟩ := Finset.card_eq_one.mp h1 + have hem : e ∈ E := he ▸ Finset.mem_singleton_self e + obtain ⟨c,hc⟩ := incident_edge_section α e v x (hinc e hem) (hloop e hem) + simpa only [he,graphKernel,Finset.prod_singleton,hc] using hC1 c + · obtain ⟨e,f,hef,he⟩ := Finset.card_eq_two.mp h2 + have hem : e ∈ E := he ▸ Finset.mem_insert_self e {f} + have hfm : f ∈ E := he ▸ Finset.mem_insert_of_mem (Finset.mem_singleton_self f) + obtain ⟨c,hc⟩ := incident_edge_section α e v x (hinc e hem) (hloop e hem) + obtain ⟨d,hd⟩ := incident_edge_section α f v x (hinc f hfm) (hloop f hfm) + simpa only [he,graphKernel,Finset.prod_pair hef,hc,hd] using hC2 c d + +lemma graphKernel_section_le {ι : Type*} [DecidableEq ι] + (α : ℝ) (K : Set ℂ) (C : ℝ≥0∞) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (E : Finset (ι × ι)) (v : ι) (x : ι → ℂ) + (hcard : (incidentEdges E v).card ≤ 2) (hloop : ∀ e ∈ E, e.1≠e.2) : + (∫⁻ y in K, graphKernel α E (Function.update x v y)) ≤ + C*graphKernel α (eraseVertex E v) x := by + have he (y : ℂ) : graphKernel α E (Function.update x v y) = + graphKernel α (incidentEdges E v) (Function.update x v y) * + graphKernel α (eraseVertex E v) x := by + rw [graphKernel_split_vertex α E v,graphKernel_erase_update] + simp_rw [he] + have hu : Measurable (fun y : ℂ => Function.update x v y) := by fun_prop + have hm : Measurable (fun y : ℂ => graphKernel α (incidentEdges E v) (Function.update x v y)) := + (measurable_graphKernel α (incidentEdges E v)).comp hu + rw [lintegral_mul_const _ hm] + have hh := incident_kernel_section_le α K C hC0 hC1 hC2 (incidentEdges E v) v x hcard + (fun e he => (Finset.mem_filter.mp he).2) + (fun e he => hloop e (Finset.mem_filter.mp he).1) + gcongr + +theorem graphKernel_marginal_le_with_root {ι : Type*} [DecidableEq ι] + (α : ℝ) (K : Set ℂ) (C : ℝ≥0∞) (hC : C < ⊤) + (hC0 : volume K ≤ C) + (hC1 : ∀ y, (∫⁻ x in K, distanceKernel α x y) ≤ C) + (hC2 : ∀ y z, (∫⁻ x in K, distanceKernel α x y * distanceKernel α x z) ≤ C) + (root : ι) (S : Finset ι) (E : Finset (ι × ι)) (hr : root ∉ S) + (hends : ∀ e ∈ E, e.1 ∈ insert root S ∧ e.2 ∈ insert root S) + (hout : ∀ e ∈ E, ∀ f ∈ E, e.1=f.1 → e=f) + (hloop : ∀ e ∈ E, e.1≠e.2) (x : ι → ℂ) : + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α E) x ≤ C^S.card := by + induction S using Finset.strongInductionOn generalizing E with + | _ S ih => + by_cases hempty : S=∅ + · have hE : E=∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro e he + have hs := hends e he + simp only [hempty,Finset.mem_insert,Finset.notMem_empty,or_false] at hs + exact hloop e he (hs.1.trans hs.2.symm) + simp only [hempty,hE,lmarginal_empty,graphKernel,Finset.prod_empty,Finset.card_empty,pow_zero,le_rfl] + · obtain ⟨v,hv,hdegree⟩ := exists_free_vertex_incident_card_le_two S + (Finset.nonempty_iff_ne_empty.mpr hempty) root hr E hends hout hloop + have hr' : root ∉ S.erase v := fun h => hr (Finset.mem_of_mem_erase h) + have hends' : ∀ e ∈ eraseVertex E v, + e.1 ∈ insert root (S.erase v) ∧ e.2 ∈ insert root (S.erase v) := by + intro e he + obtain ⟨he,h1,h2⟩ := Finset.mem_filter.mp he + constructor + · rcases Finset.mem_insert.mp (hends e he).1 with h | h + · exact Finset.mem_insert.mpr (Or.inl h) + · exact Finset.mem_insert.mpr (Or.inr (Finset.mem_erase.mpr ⟨h1,h⟩)) + · rcases Finset.mem_insert.mp (hends e he).2 with h | h + · exact Finset.mem_insert.mpr (Or.inl h) + · exact Finset.mem_insert.mpr (Or.inr (Finset.mem_erase.mpr ⟨h2,h⟩)) + have hout' : ∀ e ∈ eraseVertex E v, ∀ f ∈ eraseVertex E v, e.1=f.1 → e=f := + fun e he f hf => hout e (Finset.mem_filter.mp he).1 f (Finset.mem_filter.mp hf).1 + have hloop' : ∀ e ∈ eraseVertex E v, e.1≠e.2 := + fun e he => hloop e (Finset.mem_filter.mp he).1 + have hsmall := ih (S.erase v) (Finset.erase_ssubset hv) (eraseVertex E v) hr' hends' hout' hloop' + calc + lmarginal (fun _ : ι => volume.restrict K) S (graphKernel α E) x = + lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (fun x => ∫⁻ y in K, graphKernel α E (Function.update x v y)) x := by + exact congrFun (lmarginal_erase' (μ := fun _ : ι => volume.restrict K) + (graphKernel α E) (measurable_graphKernel α E) hv) x + _ ≤ lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (fun x => C*graphKernel α (eraseVertex E v) x) x := + lmarginal_mono (fun x => graphKernel_section_le α K C hC0 hC1 hC2 E v x hdegree hloop) x + _ = C*lmarginal (fun _ : ι => volume.restrict K) (S.erase v) + (graphKernel α (eraseVertex E v)) x := by + exact lintegral_const_mul' C _ hC.ne + _ ≤ C*C^(S.erase v).card := by gcongr + _ = C^S.card := by + rw [← Finset.card_erase_add_one hv,pow_succ,mul_comm] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLevelMass.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLevelMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..73d8af9f52ea7069d1fbdd78b240d1bfaa9dfb81 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLevelMass.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SLE.Multipoint.MultipointLevelWeights +import OAI.Probability.SLE.Multipoint.MultipointMomentIntegration +import OAI.Probability.SLE.Loewner.CanonicalRadiusKernel + +namespace OAI + +/-! Jointly measurable actual level masses and the tensor identity used +to integrate the multipoint estimate. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +local instance : MeasurableSpace C(ℝ≥0, ℝ) := borel _ +local instance : BorelSpace C(ℝ≥0, ℝ) := ⟨rfl⟩ + +lemma actual_stoppedGreen_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) : + Measurable (fun q : Ω × ℂ => stoppedGreen κ (fun t => Real.sqrt κ*B t q.1) + (γ q.1) (G q.1) q.2 u) := by + have hp : Measurable (sourceDriverPath B hBc) := source_path_measurable _ hm + have h : Measurable (fun q : Ω × ℂ => + canonicalStoppedGreen κ (u, q.2, sourceDriverPath B hBc q.1)) := + (canonicalStoppedGreen_measurable κ).comp + (measurable_const.prodMk (measurable_snd.prodMk (hp.comp measurable_fst))) + convert h using 1 + funext q + exact (canonicalStoppedGreen_eq κ (sourceDriverPath B hBc q.1) (hw q.1) u hu q.2).symm + +def levelMass {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) + (u : ℝ) (K : Set ℂ) (ω : Ω) : ℝ≥0∞ := + ∫⁻ z in K, ENNReal.ofReal (stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) z u) + +lemma levelMass_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + (hm : ∀ t, Measurable (B t)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (K : Set ℂ) : Measurable (levelMass κ B γ G u K) := + (actual_stoppedGreen_joint_measurable hm hBc κ u hu γ G F hw).ennreal_ofReal.lintegral_prod_right' + +theorem levelMass_moment_identity + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [SigmaFinite P] + {B : ℝ≥0 → Ω → ℝ} (hm : ∀ t, Measurable (B t)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (κ u : ℝ) (hu : 0 ≤ u) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (K : Set ℂ) (m : ℕ) : + (∫⁻ ω, levelMass κ B γ G u K ω ^ m ∂P) = + ∫⁻ z : Fin m → ℂ, ∫⁻ ω, ENNReal.ofReal (∏ i, stoppedGreen κ + (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (z i) u) ∂P + ∂Measure.pi (fun _ : Fin m => volume.restrict K) := by + have h := lintegral_mass_pow_eq P (volume.restrict K) + (fun ω z => ENNReal.ofReal (stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) z u)) + (actual_stoppedGreen_joint_measurable hm hBc κ u hu γ G F hw).ennreal_ofReal m + change (∫⁻ ω, (∫⁻ z in K, ENNReal.ofReal (stoppedGreen κ + (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) z u)) ^ m ∂P) = _ + rw [h] + apply lintegral_congr + intro z + apply lintegral_congr + intro ω + exact (ENNReal.ofReal_prod_of_nonneg + (fun i _ => stoppedGreen_nonneg (hw ω) κ _ _)).symm + +lemma common_level_log_target (z : ℂ) (hz : z ∈ upperHalfPlane) (u : ℝ) : + Real.log (2*z.im/(2*z.im*Real.exp (-u))) = u := by + have hratio : 2*z.im/(2*z.im*Real.exp (-u)) = Real.exp u := by + rw [Real.exp_neg] + field_simp [(show z.im ≠ 0 from ne_of_gt hz),(Real.exp_pos u).ne'] + rw [hratio,Real.log_exp] + +theorem stoppedGreen_common_level_product_bound + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (b : ι → ℝ) (hb : ∀ i, 0 < b i) (hbR : ∀ i, b i ≤ 2*(z i).im) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (z i) (z j)) (u : ℝ) : + (∫⁻ ω, ENNReal.ofReal (∏ i, stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i) u) ∂P) ≤ + ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) * + ∏ i, (b i)^(-codimension κ)) := by + have h := stoppedGreen_product_expectation_bound hB hm hBm hBc hB0 hκ hκ8 γ G F hw + hgrowth z hz hne b (fun i => 2*(z i).im*Real.exp (-u)) + (fun i => mul_pos (mul_pos (by norm_num) (hz i)) (Real.exp_pos _)) hb hbR hsep + simpa only [common_level_log_target _ (hz _) u] using h + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLevelWeights.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLevelWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..584cca500094af2a37420b1195103db4037c31e0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLevelWeights.lean @@ -0,0 +1,130 @@ +import OAI.Probability.SLE.Multipoint.MultipointOrdinaryProbability +import OAI.Probability.SLE.FiniteStoppedLaw + +namespace OAI + +/-! From the multipoint probability bound to the product estimate for +actual stopped Green weights. The estimate is uniform in their levels. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +lemma target_weight_capped {α b e : ℝ} (hb : 0 < b) (he : 0 < e) : + e^(-α) * min 1 ((e/b)^α) ≤ b^(-α) := by + calc + _ ≤ e^(-α) * (e/b)^α := + mul_le_mul_of_nonneg_left (min_le_right _ _) (Real.rpow_nonneg he.le _) + _ = b^(-α) := by + rw [Real.rpow_neg he.le,Real.rpow_neg hb.le,Real.div_rpow he.le hb.le] + field_simp [(Real.rpow_pos_of_pos he α).ne'] + +lemma lintegral_ofReal_prod_le_event + {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (P : Measure Ω) (E : Set Ω) (Y : ι → Ω → ℝ) (c : ι → ℝ) + (hY0 : ∀ i ω, 0 ≤ Y i ω) + (hY : ∀ ω ∈ E, ∀ i, Y i ω ≤ c i) + (hzero : ∀ ω, ω ∉ E → ∃ i, Y i ω = 0) : + (∫⁻ ω, ENNReal.ofReal (∏ i, Y i ω) ∂P) ≤ ENNReal.ofReal (∏ i, c i) * P E := by + classical + apply (lintegral_mono (fun ω => ?_)).trans (lintegral_indicator_const_le E _) + by_cases hω : ω ∈ E + · rw [indicator_of_mem hω] + exact ENNReal.ofReal_le_ofReal (Finset.prod_le_prod₀ (fun i _ => hY0 i ω) + (fun i _ => hY ω hω i)) + · obtain ⟨i,hi⟩ := hzero ω hω + rw [Finset.prod_eq_zero (Finset.mem_univ i) hi,ENNReal.ofReal_zero] + exact bot_le + +lemma stoppedGreen_level_bound + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) (z : ℂ) (hz : z ∈ upperHalfPlane) + (e : ℝ) (he : 0 < e) : + stoppedGreen κ U γ G z (Real.log (2*z.im/e)) ≤ e^(-codimension κ) := by + by_cases hf : radiusLevelTime γ G z (Real.log (2*z.im/e)) < ∞ + · obtain ⟨t,ht,hR⟩ := exists_live_level_of_radiusLevelTime_lt_top γ G z _ hf + have htarget : (2*z.im)*Real.exp (-Real.log (2*z.im/e)) = e := by + rw [Real.exp_neg,Real.exp_log (div_pos (mul_pos (by norm_num) hz) he)] + field_simp [he.ne',(show z.im ≠ 0 from ne_of_gt hz)] + rw [stoppedGreen_eq_of_live_level hU hw κ z _ t ht hR,greenDensity,ite_eq_left ht, + hR,htarget] + have hsin : 0 ≤ Real.sin (Complex.arg (G t z - (U t : ℂ))) := by + rw [Complex.sin_arg,Complex.sub_im,Complex.ofReal_im,sub_zero] + exact div_nonneg (hw.imag_positive t z ht).le (norm_nonneg _) + exact mul_le_of_le_one_right (Real.rpow_nonneg he.le _) + (Real.rpow_le_one hsin (Real.sin_le_one _) (greenExponent_pos κ hκ hκ8).le) + · simp only [stoppedGreen,ite_eq_right hf] + exact Real.rpow_nonneg he.le _ + +theorem stoppedGreen_product_expectation_bound + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (b e : ι → ℝ) (he : ∀ i, 0 < e i) (hb : ∀ i, 0 < b i) + (hbR : ∀ i, b i ≤ 2*(z i).im) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (z i) (z j)) : + (∫⁻ ω, ENNReal.ofReal (∏ i, stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i) (Real.log (2*(z i).im/e i))) ∂P) ≤ + ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) * + ∏ i, (b i)^(-codimension κ)) := by + classical + let E := {ω | ∀ i, radiusLevelTime (γ ω) (G ω) (z i) (Real.log (2*(z i).im/e i)) < ∞} + let Y := fun i ω => stoppedGreen κ (fun t => Real.sqrt κ*B t ω) + (γ ω) (G ω) (z i) (Real.log (2*(z i).im/e i)) + let W := ∏ i, (e i)^(-codimension κ) + let C := (3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) + have hW : 0 ≤ W := Finset.prod_nonneg (fun i _ => Real.rpow_nonneg (he i).le _) + have hC : 0 ≤ C := by dsimp [C]; positivity + have hint := lintegral_ofReal_prod_le_event P E Y (fun i => (e i)^(-codimension κ)) + (fun i ω => stoppedGreen_nonneg (hw ω) κ _ _) + (fun ω _ i => stoppedGreen_level_bound (continuous_const.mul (hBc ω)) + (hw ω) hκ hκ8 (z i) (hz i) (e i) (he i)) (fun ω hω => by + obtain ⟨i,hi⟩ := not_forall.mp hω + exact ⟨i,by simp only [Y,stoppedGreen,ite_eq_right hi]⟩) + have hprob := capped_physical_radius_multipoint_bound hB hm hBm hBc hB0 hκ hκ8 + γ G F hw hgrowth (fun z : ℂ => z) differentiableOn_id (fun _ _ _ _ h => h) + z hz hne (fun i => 2*(z i).im) b e he hb + (fun i => by simpa only [deriv_id'',norm_one,mul_one] using hbR i) + (fun i => by simp only [deriv_id'',norm_one,mul_one]) hsep + have hsub : E ⊆ {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius (fun z : ℂ => z) (G ω) t (z i) ≤ e i} := by + intro ω hω i + obtain ⟨t,ht,hR⟩ := (physical_radius_eq_hit_iff_finite_level + (continuous_const.mul (hBc ω)) (hw ω) (fun z : ℂ => z) (z i) (2*(z i).im) (e i) + (mul_pos (by norm_num) (hz i)) (he i) + (by simp only [deriv_id'',norm_one,mul_one])).mpr (hω i) + exact ⟨t,ht,hR.le⟩ + have hα : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + have hp : W * (∏ i, min 1 ((e i/b i)^(1-κ/8))) ≤ ∏ i, (b i)^(-codimension κ) := by + dsimp only [W] + rw [← Finset.prod_mul_distrib,← hα] + apply Finset.prod_le_prod₀ + · intro i _ + exact mul_nonneg (Real.rpow_nonneg (he i).le _) (le_min zero_le_one (Real.rpow_nonneg (div_nonneg (he i).le (hb i).le) _)) + · exact fun i _ => target_weight_capped (hb i) (he i) + calc + _ ≤ ENNReal.ofReal W * P E := hint + _ ≤ ENNReal.ofReal W * ENNReal.ofReal (C * ∏ i, min 1 ((e i/b i)^(1-κ/8))) := + mul_le_mul' le_rfl ((measure_mono hsub).trans hprob) + _ = ENNReal.ofReal (C * (W * ∏ i, min 1 ((e i/b i)^(1-κ/8)))) := by + rw [← ENNReal.ofReal_mul hW] + congr 1 + ring + _ ≤ _ := ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left hp hC) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLocalIdentification.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d56e03a723461c72252973cfeec80f130c7ccf8 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalIdentification.lean @@ -0,0 +1,60 @@ +import OAI.Probability.SLE.Multipoint.MultipointClippedState +import OAI.Probability.SLE.Multipoint.MultipointStoppedCoordinates +import OAI.Probability.SLE.FiniteRadiusStop + +namespace OAI + +/-! Safe clipped coordinates identify the actual Loewner flow separately +up to each point's completion or the common localization time. -/ + +noncomputable section +open Set +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem clipped_multipoint_identification {ι : Type*} [Fintype ι] + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (lo hi : ℝ) (hle : lo ≤ hi) (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (T : ι → ℝ≥0) (Q : ℝ → ι → ℂ × ℝ) + (hQ0 : ∀ i, Q 0 i = initialLogCoordinates (z i)) + (hQd : ∀ t, 0 ≤ t → HasDerivWithinAt Q + (fun i => clippedLogLoewnerField lo hi hle (U t.toNNReal) (Q t i)) (Ici 0) t) + (hheight : ∀ i t, t ∈ Icc 0 (T i : ℝ) → (Q t i).1.im ∈ Icc lo hi) : + ∀ i, z i ∈ survivingDomain γ (T i) ∧ + EqOn (fun t => Q t i) (logLoewnerCoordinates G (z i)) (Icc 0 (T i : ℝ)) := by + intro i + apply clipped_log_identification hU hw (z i) (hz i) (T i) lo hi hle + (fun t => Q t i) (hQ0 i) + · intro t ht + exact ((hasDerivWithinAt_pi.mp (hQd t ht.1)) i).mono (fun _ hs => hs.1) + · exact hheight i + +theorem stopped_height_gives_local_identification + {Ω ι : Type*} [Fintype ι] + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (lo hi : ℝ) (hle : lo ≤ hi) (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (χ : Ω → ℝ≥0) (ω : Ω) + (hQ0 : ∀ i, Q 0 ω i = initialLogCoordinates (z i)) + (hQd : ∀ t, 0 ≤ t → HasDerivWithinAt (fun t => Q t ω) + (fun i => clippedLogLoewnerField lo hi hle (U t.toNNReal) (Q t ω i)) (Ici 0) t) + (hheight : ∀ (t : ℝ≥0), t ≤ χ ω → ∀ i, + (stoppedCoordinateState Q τ t ω i).1.im ∈ Icc lo hi) : + ∀ i, z i ∈ survivingDomain γ (min (τ i ω) (χ ω)) ∧ + EqOn (fun t => Q t ω i) (logLoewnerCoordinates G (z i)) + (Icc 0 (min (τ i ω) (χ ω) : ℝ≥0)) := by + apply clipped_multipoint_identification hU hw lo hi hle z hz + (fun i => min (τ i ω) (χ ω)) (fun t => Q t ω) hQ0 hQd + intro i t ht + have htτ : t ≤ (τ i ω : ℝ) := ht.2.trans (by exact_mod_cast min_le_left (τ i ω) (χ ω)) + have htχ : t ≤ (χ ω : ℝ) := ht.2.trans (by exact_mod_cast min_le_right (τ i ω) (χ ω)) + have hh := hheight t.toNNReal (Real.toNNReal_le_iff_le_coe.mpr htχ) i + simpa only [stoppedCoordinateState, Real.coe_toNNReal t ht.1, min_eq_left htτ] using hh + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLocalization.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..59184839f082f7a6dc53d70b549fb63091bedc62 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalization.lean @@ -0,0 +1,152 @@ +import OAI.Probability.SLE.FiniteRadiusStop +import OAI.Probability.SLE.Multipoint.MultipointStoppedCoordinates + +namespace OAI + +/-! A finite localization for the completion-frozen logarithmic coordinates. +Only the log heights and the real driver are cut off; the smooth factors +need no angular cutoff. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def localizationMarginTerm {ι : Type*} (lo hi M : ℝ) + (q : ι → ℂ × ℝ) (b : ℝ) : Option ι → ℝ + | none => M-|b| + | some i => min ((q i).1.im-lo) (hi-(q i).1.im) + +/-- The extra `none` index is the driver margin, so empty point families +are allowed without an artificial height condition. -/ +def localizationMargin {ι : Type*} [Fintype ι] (lo hi M : ℝ) + (q : ι → ℂ × ℝ) (b : ℝ) : ℝ := + Finset.univ.inf' Finset.univ_nonempty (localizationMarginTerm lo hi M q b) + +lemma localizationMargin_nonneg_iff {ι : Type*} [Fintype ι] + (lo hi M : ℝ) (q : ι → ℂ × ℝ) (b : ℝ) : + 0 ≤ localizationMargin lo hi M q b ↔ + (∀ i, lo ≤ (q i).1.im ∧ (q i).1.im ≤ hi) ∧ |b| ≤ M := by + classical + rw [localizationMargin, Finset.le_inf'_iff] + constructor + · intro h + refine ⟨fun i => ?_, ?_⟩ + · have hi := h (some i) (Finset.mem_univ _) + simpa only [localizationMarginTerm, le_min_iff, sub_nonneg] using hi + · exact sub_nonneg.mp (h none (Finset.mem_univ _)) + · rintro ⟨hq,hb⟩ i _ + cases i with + | none => exact sub_nonneg.mpr hb + | some i => + exact le_min (sub_nonneg.mpr (hq i).1) (sub_nonneg.mpr (hq i).2) + +lemma localizationMargin_pos_iff {ι : Type*} [Fintype ι] + (lo hi M : ℝ) (q : ι → ℂ × ℝ) (b : ℝ) : + 0 < localizationMargin lo hi M q b ↔ + (∀ i, lo < (q i).1.im ∧ (q i).1.im < hi) ∧ |b| < M := by + classical + rw [localizationMargin, Finset.lt_inf'_iff] + constructor + · intro h + refine ⟨fun i => ?_, ?_⟩ + · have hi := h (some i) (Finset.mem_univ _) + simpa only [localizationMarginTerm, lt_min_iff, sub_pos] using hi + · exact sub_pos.mp (h none (Finset.mem_univ _)) + · rintro ⟨hq,hb⟩ i _ + cases i with + | none => exact sub_pos.mpr hb + | some i => + exact lt_min (sub_pos.mpr (hq i).1) (sub_pos.mpr (hq i).2) + +lemma localizationMargin_continuous {ι : Type*} [Fintype ι] + (lo hi M : ℝ) : + Continuous (fun p : (ι → ℂ × ℝ) × ℝ => localizationMargin lo hi M p.1 p.2) := by + classical + unfold localizationMargin + apply Continuous.finset_inf'_apply + intro i _ + cases i with + | none => exact continuous_const.sub continuous_snd.abs + | some i => + have hc : Continuous (fun p : (ι → ℂ × ℝ) × ℝ => (p.1 i).1.im) := + Complex.continuous_im.comp (((continuous_apply i).comp continuous_fst).fst) + exact (hc.sub continuous_const).min (continuous_const.sub hc) + +lemma localizationMargin_boundary {ι : Type*} [Fintype ι] + (lo hi M : ℝ) (q : ι → ℂ × ℝ) (b : ℝ) + (hn : 0 ≤ localizationMargin lo hi M q b) + (hz : localizationMargin lo hi M q b = 0) : + (∃ i, (q i).1.im = lo ∨ (q i).1.im = hi) ∨ |b| = M := by + classical + obtain ⟨hq,hb⟩ := (localizationMargin_nonneg_iff lo hi M q b).mp hn + have hzle : localizationMargin lo hi M q b ≤ 0 := hz.le + rw [localizationMargin, Finset.inf'_le_iff] at hzle + obtain ⟨i, _, hterm⟩ := hzle + cases i with + | none => + right + change M-|b| ≤ 0 at hterm + linarith + | some i => + left + refine ⟨i, ?_⟩ + change min ((q i).1.im-lo) (hi-(q i).1.im) ≤ 0 at hterm + rcases min_le_iff.mp hterm with hl | hh + · left + linarith [(hq i).1] + · right + linarith [(hq i).2] + +/-- Stop the continuous adapted state at the first height or driver +boundary, capped at the deterministic horizon. -/ +theorem exists_multipoint_localization + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (ℱ : Filtration ℝ≥0 mΩ) + (Q : ℝ → Ω → ι → ℂ × ℝ) (B : ℝ≥0 → Ω → ℝ) + (hQa : Adapted ℱ (fun t : ℝ≥0 => Q t)) + (hQc : ∀ ω, Continuous (fun t : ℝ => Q t ω)) + (hBa : Adapted ℱ B) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (lo hi M : ℝ) (H : ℝ≥0) + (hQ0 : ∀ ω i, lo ≤ (Q 0 ω i).1.im ∧ (Q 0 ω i).1.im ≤ hi) + (hB0 : ∀ ω, |B 0 ω| ≤ M) : + ∃ χ : Ω → ℝ≥0, + IsStoppingTime ℱ (fun ω => (χ ω : WithTop ℝ≥0)) ∧ + (∀ ω, χ ω ≤ H) ∧ + (∀ ω t, t ≤ χ ω → + (∀ i, lo ≤ (Q t ω i).1.im ∧ (Q t ω i).1.im ≤ hi) ∧ |B t ω| ≤ M) ∧ + (∀ ω t, t < χ ω → + (∀ i, lo < (Q t ω i).1.im ∧ (Q t ω i).1.im < hi) ∧ |B t ω| < M) ∧ + (∀ ω, χ ω < H → + (∃ i, (Q (χ ω) ω i).1.im = lo ∨ (Q (χ ω) ω i).1.im = hi) ∨ + |B (χ ω) ω| = M) := by + let D := fun (t : ℝ≥0) ω => localizationMargin lo hi M (Q t ω) (B t ω) + have hmc : Continuous (fun p : (ι → ℂ × ℝ) × ℝ => + localizationMargin lo hi M p.1 p.2) := + localizationMargin_continuous (ι := ι) lo hi M + have hDa : Adapted ℱ D := by + intro t + change Measurable[ℱ t] ((fun p : (ι → ℂ × ℝ) × ℝ => + localizationMargin lo hi M p.1 p.2) ∘ (fun ω => (Q t ω,B t ω))) + exact hmc.measurable.comp ((hQa t).prodMk (hBa t)) + have hDc (ω : Ω) : Continuous (fun t => D t ω) := + hmc.comp + (((hQc ω).comp NNReal.continuous_coe).prodMk (hBc ω)) + have hD0 (ω : Ω) : 0 ≤ D 0 ω := + (localizationMargin_nonneg_iff lo hi M (Q 0 ω) (B 0 ω)).mpr ⟨hQ0 ω,hB0 ω⟩ + obtain ⟨χ,hχ,hH,hn,hp,hz⟩ := first_margin_stopping ℱ D hDa hDc hD0 H + refine ⟨χ,hχ,hH,?_,?_,?_⟩ + · intro ω t ht + exact (localizationMargin_nonneg_iff lo hi M (Q t ω) (B t ω)).mp (hn ω t ht) + · intro ω t ht + exact (localizationMargin_pos_iff lo hi M (Q t ω) (B t ω)).mp (hp ω t ht) + · intro ω ht + exact localizationMargin_boundary lo hi M (Q (χ ω) ω) (B (χ ω) ω) + (hn ω (χ ω) le_rfl) (hz ω ht) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedExpectation.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea06da96b47d9b5eb16db7f6f679b04973e0f7c7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedExpectation.lean @@ -0,0 +1,183 @@ +import OAI.Probability.SLE.Multipoint.MultipointLocalizedStages +import OAI.Probability.SLE.Multipoint.MultipointPatternExpectation + +namespace OAI + +/-! Optional stopping for the complete four-phase product, including +simultaneous switches and a separate random localization time. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem localized_pattern_expectation_le + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (Q V : ℝ → Ω → (ι → ℂ × ℝ)) (L : ℝ≥0) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t)) + (hQl : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (hVm : Measurable (fun p : ℝ × Ω => V p.1 p.2)) + (hVb : ∀ t ω, ‖V t ω‖ ≤ L) + (hQd : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t) + (r : ℝ≥0 → Ω → ℝ) (hrm : Measurable (Function.uncurry r)) + (hrp : IsProgressive (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) r) + (C : ℝ≥0) (hrb : ∀ t ω, |r t ω| ≤ C) + (κ β : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (hβ : 0 ≤ β) (hβ1 : β ≤ 1) + (a U : ι → ℝ) (hU : ∀ i, 0 ≤ U i) + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hlstop : ∀ σ ∈ l, IsStoppingTime + (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (σ ω : WithTop ℝ≥0))) + (hlbound : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρmem : ∀ k, ρ k ∈ l) + (hρorder : ∀ ω i, Monotone (fun k => ρ (i,k) ω)) + (hzero : (fun _ : Ω => (0 : ℝ≥0)) ∈ l) + (χ : Ω → ℝ≥0) + (hχstop : IsStoppingTime + (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (χ ω : WithTop ℝ≥0))) (hχbound : ∀ ω, χ ω ≤ H) + (R : ℝ) (hR : 0 ≤ R) + (hnorm : ∀ ω t, 0 ≤ t → t ≤ (χ ω : ℝ) → + ‖((Q t ω,discountClock r t ω),B t.toNNReal ω)‖ ≤ R) + (hδ : ∀ ω (t : ℝ≥0), t < χ ω → ∀ i ∈ patternActiveSet (phaseAt ρ t ω), + branchRegulator κ (phaseRegulatorScale β (a i) (U i) (phaseAt ρ t ω i)) + (phaseRegulatorSlope β (phaseAt ρ t ω i)) (Q t ω i) ≤ 1) + (hV : ∀ ω (t : ℝ≥0), t < χ ω → ∀ i ∈ patternActiveSet (phaseAt ρ t ω), + V t ω i = physicalLogLoewnerField (Real.sqrt κ*B t ω) (Q t ω i)) + (hr : ∀ ω (t : ℝ≥0), t < χ ω → r t ω = + productDriftCost (patternActiveSet (phaseAt ρ t ω)) κ + (fun i => phaseRegulatorScale β (a i) (U i) (phaseAt ρ t ω i)) + (fun i => phaseRegulatorSlope β (phaseAt ρ t ω i)) (Q t ω) (B t ω)) + (hclock : ∀ ω i (k : Fin 3), ρ (i,k) ω ≤ χ ω → + logFactorClock κ (Q (ρ (i,k) ω) ω i)-a i = + if k = 0 then 0 else if k = 1 then U i/2 else U i) : + Integrable (fun ω => discountedPatternProduct κ β a U (phaseAt ρ (χ ω) ω) + (Q (χ ω) ω,discountClock r (χ ω) ω) (B (χ ω) ω)) P ∧ + (∫ ω, discountedPatternProduct κ β a U (phaseAt ρ (χ ω) ω) + (Q (χ ω) ω,discountClock r (χ ω) ω) (B (χ ω) ω) ∂P) ≤ + ∫ ω, discountedPatternProduct κ β a U (phaseAt ρ 0 ω) + (Q 0 ω,discountClock r 0 ω) (B 0 ω) ∂P := by + classical + let τ := localizedStage l H χ + let j := fun n ω => phaseAt ρ (τ n ω) ω + let X := fun n ω => discountedPatternProduct κ β a U (j n ω) + (Q (τ n ω) ω,discountClock r (τ n ω) ω) (B (τ n ω) ω) + let Y := fun n ω => discountedPatternProduct κ β a U (j n ω) + (Q (τ (n+1) ω) ω,discountClock r (τ (n+1) ω) ω) (B (τ (n+1) ω) ω) + have hτ (n : ℕ) := localizedStage_stopping _ l hlstop H χ hχstop n + have hmono (ω : Ω) := localizedStage_monotone l H χ hlbound ω + have hρstop (k : ι × Fin 3) := hlstop (ρ k) (hρmem k) + have hstep (n : ℕ) : Integrable (Y n) P ∧ Integrable (X n) P ∧ + (∫ ω, Y n ω ∂P) ≤ ∫ ω, X n ω ∂P := by + let F := fun (A : Finset (ι × Fin 3)) ω => + discountedPatternProduct κ β a U (phaseOfPattern A) + (Q (τ (n+1) ω) ω,discountClock r (τ (n+1) ω) ω) (B (τ (n+1) ω) ω) + let G := fun (A : Finset (ι × Fin 3)) ω => + discountedPatternProduct κ β a U (phaseOfPattern A) + (Q (τ n ω) ω,discountClock r (τ n ω) ω) (B (τ n ω) ω) + have hb (A : Finset (ι × Fin 3)) : + IntegrableOn (F A) (switchPatternEvent Finset.univ ρ (τ n) A) P ∧ + IntegrableOn (G A) (switchPatternEvent Finset.univ ρ (τ n) A) P ∧ + (∫ ω in switchPatternEvent Finset.univ ρ (τ n) A, F A ω ∂P) ≤ + ∫ ω in switchPatternEvent Finset.univ ρ (τ n) A, G A ω ∂P := by + let s := patternActiveSet (phaseOfPattern A) + let D := fun i => phaseRegulatorScale β (a i) (U i) (phaseOfPattern A i) + let σ := fun i => phaseRegulatorSlope β (phaseOfPattern A i) + have hD (i) (_ : i ∈ s) : 0 < D i := phaseRegulatorScale_pos _ _ _ _ + obtain ⟨φ,K,_,he,heD,he2,hfield⟩ := compact_discounted_smooth_field B hm + Q V L hQm hQa hQl hVm hVb hQd r hrm hrp C hrb s κ D σ hD R hR + have hphase (ω : Ω) (hω : ω ∈ switchPatternEvent Finset.univ ρ (τ n) A) + (u : ℝ) (hu : (τ n ω : ℝ) ≤ u) (hu' : u < (τ (n+1) ω : ℝ)) : + phaseAt ρ u.toNNReal ω = phaseOfPattern A := by + have hu0 := (τ n ω).coe_nonneg.trans hu + have ht : τ n ω ≤ u.toNNReal := by exact_mod_cast (show (τ n ω : ℝ) ≤ + (u.toNNReal : ℝ) by simpa only [Real.coe_toNNReal u hu0] using hu) + have ht' : u.toNNReal < τ (n+1) ω := by exact_mod_cast (show + (u.toNNReal : ℝ) < (τ (n+1) ω : ℝ) by simpa only [Real.coe_toNNReal u hu0] using hu') + exact (phaseAt_const_localized_interval ρ l H χ hlbound hρmem n ω _ ht ht').trans + (phaseAt_of_pattern ρ (τ n) A hω) + have huχ (ω : Ω) (u : ℝ) (hu : (τ n ω : ℝ) ≤ u) + (hu' : u < (τ (n+1) ω : ℝ)) : u.toNNReal < χ ω := by + have hu0 := (τ n ω).coe_nonneg.trans hu + have hlt : (u.toNNReal : ℝ) < (χ ω : ℝ) := by + rw [Real.coe_toNNReal u hu0] + exact hu'.trans_le (by exact_mod_cast localizedStage_le l H χ (n+1) ω) + exact_mod_cast hlt + have hb := discounted_product_optional_interval_le hB hm hBm hBc Q V r s κ hκ hκ8 + D σ hD (fun i _ => phaseRegulatorSlope_le_one hβ hβ1 _) φ K hfield R he heD he2 + (τ n) (τ (n+1)) (hτ n) (hτ (n+1)) (fun ω => hmono ω (Nat.le_succ n)) H + (fun ω => (localizedStage_le l H χ (n+1) ω).trans (hχbound ω)) + (switchPatternEvent_measurable _ Finset.univ ρ (τ n) (fun i _ => hρstop i) (hτ n) A) + (fun ω _ u hu hu' => hnorm ω u ((τ n ω).coe_nonneg.trans hu) + (hu'.trans (by exact_mod_cast localizedStage_le l H χ (n+1) ω))) + (fun ω hω u hu hu' => by + have hh := hδ ω u.toNNReal (huχ ω u hu hu') + rw [hphase ω hω u hu hu'] at hh + simpa only [Real.coe_toNNReal u ((τ n ω).coe_nonneg.trans hu)] using hh) + (fun ω hω u hu hu' => by + have hh := hV ω u.toNNReal (huχ ω u hu hu') + rw [hphase ω hω u hu hu'] at hh + simpa only [Real.coe_toNNReal u ((τ n ω).coe_nonneg.trans hu)] using hh) + (fun ω hω u hu hu' => by + have hh := hr ω u.toNNReal (huχ ω u hu hu') + rw [hphase ω hω u hu hu'] at hh + simpa only [Real.coe_toNNReal u ((τ n ω).coe_nonneg.trans hu)] using hh) + refine ⟨?_,?_,?_⟩ + · simpa only [F,discountedPatternProduct_eq,s,D,σ,IntegrableOn] using hb.1.const_mul (patternWeight κ a U (phaseOfPattern A)) + · simpa only [G,discountedPatternProduct_eq,s,D,σ,IntegrableOn] using hb.2.1.const_mul (patternWeight κ a U (phaseOfPattern A)) + · simpa only [F,G,discountedPatternProduct_eq,integral_const_mul,s,D,σ] using + mul_le_mul_of_nonneg_left hb.2.2 (patternWeight_pos κ a U (phaseOfPattern A)).le + apply switchPattern_integral_le P Finset.univ ρ (τ n) + (fun A _ => (hτ n).measurableSpace_le _ + (switchPatternEvent_measurable _ Finset.univ ρ (τ n) (fun i _ => hρstop i) (hτ n) A)) F G (Y n) (X n) + (fun A _ => (hb A).1) (fun A _ => (hb A).2.1) + · intro A _ ω hω + change discountedPatternProduct κ β a U (phaseOfPattern A) _ _ = + discountedPatternProduct κ β a U (phaseAt ρ (τ n ω) ω) _ _ + rw [phaseAt_of_pattern ρ (τ n) A hω] + · intro A _ ω hω + change discountedPatternProduct κ β a U (phaseOfPattern A) _ _ = + discountedPatternProduct κ β a U (phaseAt ρ (τ n ω) ω) _ _ + rw [phaseAt_of_pattern ρ (τ n) A hω] + · exact fun A _ => (hb A).2.2 + have hjump (n : ℕ) (ω : Ω) : X (n+1) ω ≤ Y n ω := by + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + apply patternProduct_switch_le κ β hκ hκ8 a U hU _ _ _ _ + (fun i => phaseAt_monotone ρ ω i (hmono ω (Nat.le_succ n))) + · intro i hbefore hafter + have hc := phaseAt_crossed_localized_switch ρ l H χ hlbound hρmem n ω i + (0: Fin 3) (hρorder ω i) hbefore hafter + have hh := hclock ω i (0: Fin 3) (hc ▸ localizedStage_le l H χ (n+1) ω) + rw [hc] at hh + simpa only [ite_true, ite_false, Fin.isValue, Fin.reduceEq] using hh + · intro i hbefore hafter + have hc := phaseAt_crossed_localized_switch ρ l H χ hlbound hρmem n ω i + (1: Fin 3) (hρorder ω i) hbefore hafter + have hh := hclock ω i (1: Fin 3) (hc ▸ localizedStage_le l H χ (n+1) ω) + rw [hc] at hh + simpa only [ite_true, ite_false, Fin.isValue, Fin.reduceEq] using hh + · intro i hbefore hafter + have hc := phaseAt_crossed_localized_switch ρ l H χ hlbound hρmem n ω i + (2: Fin 3) (hρorder ω i) hbefore hafter + have hh := hclock ω i (2: Fin 3) (hc ▸ localizedStage_le l H χ (n+1) ω) + rw [hc] at hh + simpa only [ite_true, ite_false, Fin.isValue, Fin.reduceEq] using hh + have hout := finite_switched_product_expectation_le P l.length X Y + (fun n _ => (hstep n).2.1) (fun n _ => (hstep n).1) + (fun n _ => (hstep n).2.2) (fun n _ => hjump n) + have hlast : ∀ ω, τ l.length ω = χ ω := localizedStage_last l H χ hχbound + have hfirst : ∀ ω, τ 0 ω = 0 := localizedStage_zero l H χ hlbound hzero + refine ⟨?_,?_⟩ + · simpa only [X,j,hlast] using (hstep l.length).2.1 + · simpa only [X,j,hlast,hfirst,NNReal.coe_zero] using hout + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedStages.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedStages.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e3b4163dc97002c300733e3821d0ea2878e76cb --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedStages.lean @@ -0,0 +1,100 @@ +import OAI.Probability.SLE.Multipoint.MultipointHorizonStages + +namespace OAI + +/-! Stop the integration at a bounded random localization time, while +continuing to detect phases from the original radius switches. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def localizedStage {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (n : ℕ) (ω : Ω) : ℝ≥0 := + min (sortedStopAt l (H+1) n ω) (χ ω) + +lemma localizedStage_stopping {Ω : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (l : List (Ω → ℝ≥0)) + (hl : ∀ τ ∈ l, IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) + (H : ℝ≥0) (χ : Ω → ℝ≥0) + (hχ : IsStoppingTime ℱ (fun ω => (χ ω : WithTop ℝ≥0))) (n : ℕ) : + IsStoppingTime ℱ (fun ω => (localizedStage l H χ n ω : WithTop ℝ≥0)) := by + simpa only [localizedStage, WithTop.coe_min] using + (sortedStopAt_stopping ℱ l hl (H+1) n).min hχ + +lemma localizedStage_monotone {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (hl : ∀ τ ∈ l, ∀ ω, τ ω ≤ H+1) (ω : Ω) : + Monotone (fun n => localizedStage l H χ n ω) := by + intro i j hij + exact min_le_min_right (χ ω) (sortedStopAt_monotone l (H+1) hl ω hij) + +lemma localizedStage_le {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (n : ℕ) (ω : Ω) : localizedStage l H χ n ω ≤ χ ω := + min_le_right _ _ + +lemma localizedStage_last {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (hχ : ∀ ω, χ ω ≤ H) (ω : Ω) : + localizedStage l H χ l.length ω = χ ω := by + simp only [localizedStage, sortedStopAt_length] + exact min_eq_right ((hχ ω).trans (le_add_of_nonneg_right zero_le_one)) + +lemma localizedStage_zero {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (hl : ∀ τ ∈ l, ∀ ω, τ ω ≤ H+1) + (hzero : (fun _ : Ω => (0 : ℝ≥0)) ∈ l) (ω : Ω) : + localizedStage l H χ 0 ω = 0 := by + rw [localizedStage, sortedStopAt_zero l (H+1) hl hzero ω] + exact min_eq_left bot_le + +lemma localizedStage_nonempty {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (n : ℕ) (ω : Ω) (t : ℝ≥0) + (hnt : localizedStage l H χ n ω ≤ t) (htn : t < localizedStage l H χ (n+1) ω) : + sortedStopAt l (H+1) n ω ≤ t ∧ t < sortedStopAt l (H+1) (n+1) ω := by + have htχ : t < χ ω := htn.trans_le (localizedStage_le l H χ (n+1) ω) + have hnχ : sortedStopAt l (H+1) n ω < χ ω := by + by_contra h + have he : localizedStage l H χ n ω = χ ω := min_eq_right (le_of_not_gt h) + rw [he] at hnt + exact (not_le_of_gt htχ) hnt + exact ⟨by simpa only [localizedStage, min_eq_left hnχ.le] using hnt, + htn.trans_le (min_le_left _ _)⟩ + +lemma phaseAt_const_localized_interval {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (t : ℝ≥0) + (hnt : localizedStage l H χ n ω ≤ t) (htn : t < localizedStage l H χ (n+1) ω) : + phaseAt ρ t ω = phaseAt ρ (localizedStage l H χ n ω) ω := by + obtain ⟨hleft, hright⟩ := localizedStage_nonempty l H χ n ω t hnt htn + have hnχ : sortedStopAt l (H+1) n ω ≤ χ ω := + hleft.trans ((htn.trans_le (localizedStage_le l H χ (n+1) ω)).le) + rw [localizedStage, min_eq_left hnχ] + exact phaseAt_const_sorted_interval ρ l (H+1) hl hρ n ω t hleft hright + +lemma phaseAt_crossed_localized_switch {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (χ : Ω → ℝ≥0) (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (i : ι) (k : Fin 3) + (hord : Monotone (fun j => ρ (i,j) ω)) + (hbefore : (phaseAt ρ (localizedStage l H χ n ω) ω i).val ≤ k.val) + (hafter : k.val+1 ≤ (phaseAt ρ (localizedStage l H χ (n+1) ω) ω i).val) : + ρ (i,k) ω = localizedStage l H χ (n+1) ω := by + have hupper := (phaseAt_ge_iff ρ ω i hord _ k).mp hafter + have hlt : localizedStage l H χ n ω < ρ (i,k) ω := by + by_contra h + have hc := (phaseAt_ge_iff ρ ω i hord _ k).mpr (le_of_not_gt h) + omega + have hsorted : sortedStopAt l (H+1) n ω < ρ (i,k) ω := by + by_contra h + have hp : ρ (i,k) ω ≤ sortedStopAt l (H+1) n ω := le_of_not_gt h + have hχ : ρ (i,k) ω ≤ χ ω := hupper.trans (localizedStage_le l H χ (n+1) ω) + exact (not_le_of_gt hlt) (le_min hp hχ) + have hnext := sortedStopAt_no_intermediate l (H+1) hl _ (hρ (i,k)) n ω hsorted + exact le_antisymm hupper ((min_le_left _ _).trans hnext) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedState.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedState.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfb238a2d71eef51f9bcbb4a001b28dea0f5896e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLocalizedState.lean @@ -0,0 +1,116 @@ +import OAI.Probability.SLE.Multipoint.MultipointLocalIdentification +import OAI.Probability.SLE.Multipoint.MultipointLocalization + +namespace OAI + +/-! The concrete localized state used by the multipoint product. Each +coordinate is frozen at its own completion; the common stop only bounds +the driver and the remaining coordinate heights. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +structure LocalizedState {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (κ lo hi M : ℝ) (H : ℝ≥0) (z : ι → ℂ) (τ : ι → Ω → ℝ≥0) + (γ : Ω → ℝ≥0 → ℂ) (G : Ω → ℝ≥0 → ℂ → ℂ) where + L : ℝ≥0 + Q : ℝ → Ω → ι → ℂ × ℝ + V : ℝ → Ω → ι → ℂ × ℝ + χ : Ω → ℝ≥0 + measurable : Measurable (fun p : ℝ × Ω => Q p.1 p.2) + adapted : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t) + lipschitz : ∀ ω, LipschitzWith L (fun t => Q t ω) + velocity_measurable : Measurable (fun p : ℝ × Ω => V p.1 p.2) + velocity_bound : ∀ t ω, ‖V t ω‖ ≤ L + derivative : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t + initial : ∀ ω i, Q 0 ω i = initialLogCoordinates (z i) + frozen : ∀ ω (t : ℝ≥0) i, τ i ω ≤ t → Q t ω i = Q (τ i ω) ω i + stopping : IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (χ ω : WithTop ℝ≥0)) + bounded : ∀ ω, χ ω ≤ H + heights : ∀ ω (t : ℝ≥0), t ≤ χ ω → ∀ i, (Q t ω i).1.im ∈ Icc lo hi + driver_bound : ∀ ω t, t ≤ χ ω → |B t ω| ≤ M + strict_heights : ∀ ω (t : ℝ≥0), t < χ ω → ∀ i, (Q t ω i).1.im ∈ Ioo lo hi + strict_driver : ∀ ω t, t < χ ω → |B t ω| < M + boundary : ∀ ω, χ ω < H → + (∃ i, (Q (χ ω) ω i).1.im = lo ∨ (Q (χ ω) ω i).1.im = hi) ∨ |B (χ ω) ω| = M + physical_velocity : ∀ ω (t : ℝ≥0), t < χ ω → ∀ i, t < τ i ω → + V t ω i = physicalLogLoewnerField (Real.sqrt κ*B t ω) (Q t ω i) + actual : ∀ ω i, z i ∈ survivingDomain (γ ω) (min (τ i ω) (χ ω)) ∧ + EqOn (fun t => Q t ω i) (logLoewnerCoordinates (G ω) (z i)) + (Icc 0 (min (τ i ω) (χ ω) : ℝ≥0)) + +theorem exists_localizedState + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (κ lo hi M : ℝ) (hle : lo ≤ hi) (H : ℝ≥0) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) + (hzlo : ∀ i, lo ≤ Real.log (z i).im) (hzhi : ∀ i, Real.log (z i).im ≤ hi) + (hB0 : ∀ ω, |B 0 ω| ≤ M) + (τ : ι → Ω → ℝ≥0) + (hτ : ∀ i, IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (τ i ω : WithTop ℝ≥0))) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) : + Nonempty (LocalizedState B hm κ lo hi M H z τ γ G) := by + classical + obtain ⟨L,Q,V,hQm,hQa,hQl,hVm,hVb,hQd,hQdw,hQ0,hfield⟩ := + exists_clipped_multipoint_state B hm hBm hBc κ lo hi hle (fun i => initialLogCoordinates (z i)) + obtain ⟨hSm,hSa,hSl,hSVm,hSVb,hSd⟩ := stoppedCoordinateState_regular _ Q V τ L + hQm hQa hQl hVm hVb hQd hτ + let S := stoppedCoordinateState Q τ + let W := stoppedCoordinateVelocity V τ + have hS0 (ω : Ω) (i : ι) : S 0 ω i = initialLogCoordinates (z i) := by + rw [show S 0 ω = Q 0 ω from stoppedCoordinateState_initial Q τ ω, hQ0 ω] + have hBa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) B := + (Filtration.stronglyAdapted_natural (fun t => (hm t).stronglyMeasurable)).adapted + obtain ⟨χ,hχ,hχH,hbounds,hstrict,hboundary⟩ := exists_multipoint_localization _ S B hSa + (fun ω => (hSl ω).continuous) hBa hBc lo hi M H + (fun ω i => by simpa only [hS0 ω i, initialLogCoordinates, Complex.add_im, + Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.I_re, + mul_one, mul_zero, add_zero, zero_add] using And.intro (hzlo i) (hzhi i)) hB0 + have hheight (ω : Ω) (t : ℝ≥0) (ht : t ≤ χ ω) (i : ι) : + (S t ω i).1.im ∈ Icc lo hi := (hbounds ω t ht).1 i + refine ⟨{ + L := L, Q := S, V := W, χ := χ, measurable := hSm, adapted := hSa, + lipschitz := hSl, velocity_measurable := hSVm, velocity_bound := hSVb, + derivative := hSd, initial := hS0, + frozen := fun ω t i ht => by + have ht' : (τ i ω : ℝ) ≤ (t : ℝ) := by exact_mod_cast ht + simp only [S,stoppedCoordinateState,min_eq_right ht',min_self], + stopping := hχ, bounded := hχH, + heights := hheight, driver_bound := fun ω t ht => (hbounds ω t ht).2, + strict_heights := fun ω t ht i => (hstrict ω t ht).1 i, + strict_driver := fun ω t ht => (hstrict ω t ht).2, boundary := hboundary, + physical_velocity := ?_, actual := ?_ }⟩ + · intro ω t ht i hti + have htir : (t : ℝ) < (τ i ω : ℝ) := by exact_mod_cast hti + have he : S t ω i = Q t ω i := by simp only [S,stoppedCoordinateState,min_eq_left htir.le] + change (if (t : ℝ) < (τ i ω : ℝ) then V t ω i else 0) = _ + rw [ite_eq_left htir, hfield, ← he, Real.toNNReal_coe] + exact clippedLogLoewnerField_eq_physical lo hi hle _ _ (hheight ω t ht.le i) + · intro ω i + have hid := stopped_height_gives_local_identification (continuous_const.mul (hBc ω)) + (hw ω) lo hi hle z hz Q τ χ ω (fun i => congrFun (hQ0 ω) i) + (fun t ht => by + have hv : V t ω = fun i => clippedLogLoewnerField lo hi hle + (Real.sqrt κ*B t.toNNReal ω) (Q t ω i) := funext (hfield t ω) + simpa only [hv, Pi.mul_apply] using hQdw ω t ht) (hheight ω) + refine ⟨(hid i).1, ?_⟩ + intro t ht + have hti : t ≤ (τ i ω : ℝ) := ht.2.trans (by exact_mod_cast min_le_left (τ i ω) (χ ω)) + change S t ω i = logLoewnerCoordinates (G ω) (z i) t + rw [show S t ω i = Q t ω i by simp only [S,stoppedCoordinateState,min_eq_left hti]] + exact (hid i).2 ht + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLoewnerDrop.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLoewnerDrop.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7876f6eadc2d35529e09e6633a65a68e8e75d0e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLoewnerDrop.lean @@ -0,0 +1,132 @@ +import OAI.Probability.SLE.Multipoint.MultipointInteractionShells + +namespace OAI + +/-! The source time normalization of the pair-interaction drop. The two +uncentered Loewner paths have velocity `a/(f-U)`, while the common real +driver is only assumed continuous. No derivative of Brownian motion is +used. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology + +namespace SLEExactGauge.Multipoint + +def loewnerPoissonRate (f : ℝ → ℂ) (U : ℝ → ℝ) (t : ℝ) : ℝ := + (f t).im / ‖f t - (U t : ℂ)‖ ^ 2 + +lemma loewnerPoissonRate_continuousOn + {s T : ℝ} {f : ℝ → ℂ} {U : ℝ → ℝ} + (hf : ContinuousOn f (Icc s T)) (hU : ContinuousOn U (Icc s T)) + (hfi : ∀ t ∈ Icc s T, 0 < (f t).im) : + ContinuousOn (loewnerPoissonRate f U) (Icc s T) := by + apply (Complex.continuous_im.comp_continuousOn hf).div + ((hf.sub (Complex.continuous_ofReal.comp_continuousOn hU)).norm.pow 2) + intro t ht + apply pow_ne_zero 2 + apply norm_ne_zero_iff.mpr + intro he + have hi := congrArg Complex.im (sub_eq_zero.mp he) + have hp := hfi t ht + change (f t).im = 0 at hi + linarith + +lemma loewnerPoissonRate_nonneg + {f : ℝ → ℂ} {U : ℝ → ℝ} {t : ℝ} (hfi : 0 ≤ (f t).im) : + 0 ≤ loewnerPoissonRate f U t := div_nonneg hfi (sq_nonneg _) + +/-- Exact fundamental-theorem-of-calculus form of the interaction identity +in the manuscript's time normalization. -/ +theorem loewner_interaction_drop + {s T a : ℝ} (hs : 0 ≤ s) (hsT : s ≤ T) + (f g : ℝ → ℂ) (U : ℝ → ℝ) (hU : ContinuousOn U (Icc s T)) + (hf : ∀ t ∈ Icc s T, HasDerivWithinAt f ((a : ℂ) / (f t - (U t : ℂ))) (Ici 0) t) + (hg : ∀ t ∈ Icc s T, HasDerivWithinAt g ((a : ℂ) / (g t - (U t : ℂ))) (Ici 0) t) + (hfi : ∀ t ∈ Icc s T, 0 < (f t).im) + (hgi : ∀ t ∈ Icc s T, 0 < (g t).im) + (hne : ∀ t ∈ Icc s T, f t ≠ g t) : + 2 * a * (∫ t in s..T, loewnerPoissonRate f U t * loewnerPoissonRate g U t) = + interaction (f s) (g s) - interaction (f T) (g T) := by + let K := fun t => interaction (f t) (g t) + let R := fun t => loewnerPoissonRate f U t * loewnerPoissonRate g U t + have hfc : ContinuousOn f (Icc s T) := fun t ht => + ((hf t ht).mono (fun x hx => hs.trans hx.1)).continuousWithinAt + have hgc : ContinuousOn g (Icc s T) := fun t ht => + ((hg t ht).mono (fun x hx => hs.trans hx.1)).continuousWithinAt + have hRc : ContinuousOn R (Icc s T) := + (loewnerPoissonRate_continuousOn hfc hU hfi).mul + (loewnerPoissonRate_continuousOn hgc hU hgi) + have hd : ∀ t ∈ Icc s T, HasDerivWithinAt K ((-2 * a) * R t) (Ici 0) t := by + intro t ht + simpa only [K, R, loewnerPoissonRate, interaction_center, mul_assoc] using + centered_interaction_hasDerivWithinAt U (hf t ht) (hg t ht) + (hfi t ht) (hgi t ht) (hne t ht) + have hKc : ContinuousOn K (Icc s T) := fun t ht => + ((hd t ht).mono (fun x hx => hs.trans hx.1)).continuousWithinAt + have he := intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le hsT hKc + (fun t ht => (hd t ⟨ht.1.le, ht.2.le⟩).mono + (fun x hx => hs.trans (ht.1.le.trans hx.le))) + ((continuousOn_const.mul hRc).intervalIntegrable_of_Icc hsT) + rw [intervalIntegral.integral_const_mul] at he + change (-2 * a) * (∫ t in s..T, R t) = K T - K s at he + change 2 * a * (∫ t in s..T, R t) = K s - K T + linarith + +theorem loewner_interaction_future_bound + {s T a : ℝ} (hs : 0 ≤ s) (hsT : s ≤ T) (ha : 0 < a) + (f g : ℝ → ℂ) (U : ℝ → ℝ) (hU : ContinuousOn U (Icc s T)) + (hf : ∀ t ∈ Icc s T, HasDerivWithinAt f ((a : ℂ) / (f t - (U t : ℂ))) (Ici 0) t) + (hg : ∀ t ∈ Icc s T, HasDerivWithinAt g ((a : ℂ) / (g t - (U t : ℂ))) (Ici 0) t) + (hfi : ∀ t ∈ Icc s T, 0 < (f t).im) + (hgi : ∀ t ∈ Icc s T, 0 < (g t).im) + (hne : ∀ t ∈ Icc s T, f t ≠ g t) : + (∫ t in s..T, loewnerPoissonRate f U t * loewnerPoissonRate g U t) ≤ + interaction (f s) (g s) / (2 * a) := by + have hd := loewner_interaction_drop hs hsT f g U hU hf hg hfi hgi hne + have hp := interaction_nonneg (hfi T ⟨hsT, le_rfl⟩) (hgi T ⟨hsT, le_rfl⟩) + apply (le_div_iff₀ (by positivity : 0 < 2 * a)).mpr + nlinarith + +/-- Source-normalized weighted interaction, with the interval drop +discharged from the actual Loewner ODE. Only the geometric decay remains +as a separate premise. -/ +theorem loewner_weighted_interaction_integral_le + {s T a c M : ℝ} (hs : 0 ≤ s) (hsT : s ≤ T) (ha : 0 < a) + (hM : 0 ≤ M) (hc : 0 ≤ c) (hca : 2 * c < a) + (f g : ℝ → ℂ) (U : ℝ → ℝ) (hU : ContinuousOn U (Icc s T)) + (hf : ∀ t ∈ Icc s T, HasDerivWithinAt f ((a : ℂ) / (f t - (U t : ℂ))) (Ici 0) t) + (hg : ∀ t ∈ Icc s T, HasDerivWithinAt g ((a : ℂ) / (g t - (U t : ℂ))) (Ici 0) t) + (hfi : ∀ t ∈ Icc s T, 0 < (f t).im) + (hgi : ∀ t ∈ Icc s T, 0 < (g t).im) + (hne : ∀ t ∈ Icc s T, f t ≠ g t) + (u v : ℝ → ℝ) (hu : ContinuousOn u (Icc s T)) (hv : ContinuousOn v (Icc s T)) + (hu0 : ∀ t ∈ Icc s T, 0 ≤ u t) (hv0 : ∀ t ∈ Icc s T, 0 ≤ v t) + (hdecay : ∀ t ∈ Icc s T, interaction (f t) (g t) ≤ + M * Real.exp (-a * max (u t) (v t))) : + (∫ t in s..T, Real.exp (c * (u t + v t)) * + (loewnerPoissonRate f U t * loewnerPoissonRate g U t)) ≤ + M * interactionBudget a c := by + have hfc : ContinuousOn f (Icc s T) := fun t ht => + ((hf t ht).mono (fun x hx => hs.trans hx.1)).continuousWithinAt + have hgc : ContinuousOn g (Icc s T) := fun t ht => + ((hg t ht).mono (fun x hx => hs.trans hx.1)).continuousWithinAt + apply weighted_interaction_integral_le hsT ha hM hc hca u v + (fun t => loewnerPoissonRate f U t * loewnerPoissonRate g U t) + (fun t => interaction (f t) (g t)) hu hv hu0 hv0 + ((loewnerPoissonRate_continuousOn hfc hU hfi).mul + (loewnerPoissonRate_continuousOn hgc hU hgi)) + (fun t ht => mul_nonneg (loewnerPoissonRate_nonneg (hfi t ht).le) + (loewnerPoissonRate_nonneg (hgi t ht).le)) ?_ hdecay + intro t ht + have hsub : Icc t T ⊆ Icc s T := Icc_subset_Icc ht.1 le_rfl + exact loewner_interaction_future_bound (hs.trans ht.1) ht.2 ha f g U (hU.mono hsub) + (fun x hx => hf x (hsub hx)) (fun x hx => hg x (hsub hx)) + (fun x hx => hfi x (hsub hx)) (fun x hx => hgi x (hsub hx)) + (fun x hx => hne x (hsub hx)) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLogAngular.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLogAngular.lean new file mode 100644 index 0000000000000000000000000000000000000000..f004d5a652c9631eb464f48e004c787d5814fdec --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLogAngular.lean @@ -0,0 +1,128 @@ +import OAI.Probability.SLE.Multipoint.MultipointLogFactor +import OAI.Probability.SLE.Multipoint.MultipointAngular + +namespace OAI + +/-! Identification of the smooth logarithmic monomials with the angular +factors, in actual capacity-two coordinates. -/ + +noncomputable section +open Set + +namespace SLEExactGauge.Multipoint + +def logPoint (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : ℂ := + ((q.1.re-Real.sqrt κ*x : ℝ) : ℂ) + (Real.exp q.1.im : ℂ)*Complex.I + +def logAngle (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : ℝ := (logPoint κ q x).arg + +def logVelocity (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : ℝ := + Real.exp q.1.im / greenLogNormSq κ q x + +lemma logPoint_re (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + (logPoint κ q x).re = q.1.re-Real.sqrt κ*x := by simp [logPoint] + +lemma logPoint_im (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + (logPoint κ q x).im = Real.exp q.1.im := by + simp only [logPoint, Complex.add_im, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, zero_add, add_zero] + +lemma logPoint_norm_sq (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + ‖logPoint κ q x‖^2 = greenLogNormSq κ q x := by + rw [← Complex.normSq_eq_norm_sq, Complex.normSq_apply, logPoint_re, logPoint_im] + have he : Real.exp q.1.im * Real.exp q.1.im = Real.exp (2*q.1.im) := by + rw [← Real.exp_add]; congr 1; ring + simpa only [greenLogNormSq, pow_two] using congrArg + (fun y => (q.1.re-Real.sqrt κ*x)*(q.1.re-Real.sqrt κ*x)+y) he + +lemma logPoint_norm_pos (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + 0 < ‖logPoint κ q x‖ := by + apply norm_pos_iff.mpr + intro h + have him := congrArg Complex.im h + rw [logPoint_im, Complex.zero_im] at him + exact (Real.exp_pos q.1.im).ne' him + +lemma logAngle_sin_pos (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + 0 < Real.sin (logAngle κ q x) := by + rw [logAngle, Complex.sin_arg, logPoint_im] + exact div_pos (Real.exp_pos _) (logPoint_norm_pos κ q x) + +lemma logAngle_sin_sq (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + Real.sin (logAngle κ q x)^2 = Real.exp (2*q.1.im)/greenLogNormSq κ q x := by + rw [logAngle, Complex.sin_arg, logPoint_im, div_pow, logPoint_norm_sq] + have he : Real.exp q.1.im^2 = Real.exp (2*q.1.im) := by + rw [pow_two, ← Real.exp_add]; congr 1; ring + rw [he] + +lemma logAngle_log_sin (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + Real.log (Real.sin (logAngle κ q x)) = + q.1.im - Real.log (greenLogNormSq κ q x)/2 := by + have hn := logPoint_norm_pos κ q x + have hN : Real.log (greenLogNormSq κ q x) = 2*Real.log ‖logPoint κ q x‖ := by + rw [← logPoint_norm_sq, Real.log_pow] + norm_num + rw [logAngle, Complex.sin_arg, logPoint_im, Real.log_div (Real.exp_ne_zero _) hn.ne', + Real.log_exp, hN] + ring + +lemma logFactor_eq_angular (κ c r : ℝ) (q : ℂ × ℝ) (x : ℝ) : + logFactor κ c r q x = Real.exp ((c*κ/4)*(q.2-q.1.im))* + sinePower r (logAngle κ q x) := by + rw [sinePower, Real.rpow_def_of_pos (logAngle_sin_pos κ q x), ← Real.exp_add, + logAngle_log_sin] + unfold logFactor + congr 1 + ring + +lemma logVelocity_pos (κ : ℝ) (q : ℂ × ℝ) (x : ℝ) : + 0 < logVelocity κ q x := div_pos (Real.exp_pos _) (greenLogNormSq_pos κ q x) + +lemma logFactor_spatial_eq_angular (κ c r : ℝ) (q : ℂ × ℝ) (x : ℝ) : + deriv (logFactor κ c r q) x = + Real.sqrt κ*logVelocity κ q x*Real.exp ((c*κ/4)*(q.2-q.1.im))* + sinePowerFirst r (logAngle κ q x) := by + rw [(logFactor_spatial_derivative κ c r q x).deriv, logFactor_eq_angular] + unfold sinePowerFirst sinePower + rw [Real.rpow_sub (logAngle_sin_pos κ q x), Real.rpow_one] + have hn := logPoint_norm_pos κ q x + have hz : logPoint κ q x ≠ 0 := norm_pos_iff.mp hn + rw [logAngle, Complex.cos_arg hz, Complex.sin_arg, logPoint_re, logPoint_im] + unfold logVelocity + field_simp [hn.ne', Real.exp_ne_zero _, (greenLogNormSq_pos κ q x).ne'] + +lemma sineGenerator_relative {p c r θ : ℝ} (hθ : 0 < Real.sin θ) : + sineGenerator p r θ+c*sinePower r θ = + sinePower r θ * ((r*(r-p)/2)*(1/Real.sin θ^2-1)+c-r/2) := by + rw [sineGenerator_eq hθ] + unfold sinePower + rw [Real.rpow_sub hθ, Real.rpow_two] + field_simp [hθ.ne'] + ring + +theorem logFactor_generator_eq_angular (κ c r : ℝ) (hκ : 0 < κ) + (q : ℂ × ℝ) (x : ℝ) : + (fderiv ℝ (fun q => logFactor κ c r q x) q) + (physicalLogLoewnerField (Real.sqrt κ*x) q) + + (1/2 : ℝ)*iteratedDeriv 2 (logFactor κ c r q) x = + κ*logVelocity κ q x^2*Real.exp ((c*κ/4)*(q.2-q.1.im))* + (sineGenerator (greenExponent κ) r (logAngle κ q x)+ + c*sinePower r (logAngle κ q x)) := by + rw [logFactor_physical_generator κ c r hκ, + sineGenerator_relative (logAngle_sin_pos κ q x), logAngle_sin_sq, + logFactor_eq_angular] + have hN := (greenLogNormSq_pos κ q x).ne' + have hY := Real.exp_ne_zero (2*q.1.im) + have he : Real.exp q.1.im^2 = Real.exp (2*q.1.im) := by + rw [pow_two, ← Real.exp_add]; congr 1; ring + unfold logVelocity + rw [div_pow, he] + field_simp [hN, hY] + dsimp only [greenLogNormSq] + ring_nf + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLogClockTransport.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLogClockTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8eddb77d2cc0f6fe1e95affa1dc456f123318f02 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLogClockTransport.lean @@ -0,0 +1,277 @@ +import OAI.Probability.SLE.Multipoint.MultipointFactorBranches +import OAI.Probability.SLE.Multipoint.MultipointRegulatorTransport +import OAI.Probability.SLE.DiskHalfPlane + +namespace OAI + +/-! The smooth logarithmic-coordinate factors use precisely the source +radius clock. These identities transport the proved one-point and pair +costs to the normalized branches, in capacity-two physical time. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +lemma logFactorClock_eq_logRadiusClock (κ η : ℝ) (z : ℂ × ℝ) : + logFactorClock κ z = κ/4*(logRadiusClock η z-η) := by + unfold logFactorClock logRadiusClock + ring + +lemma regulator_scaled_argument {κ : ℝ} (hκ : 0 < κ) (β U u : ℝ) : + regulator β U (κ*u) = regulator (κ*β) (U/κ) u := by + rw [regulator_scale_clock hκ.le] + have he : κ*(U/κ) = U := by field_simp [hκ.ne'] + rw [he] + +lemma logVelocity_logCoordinates (κ : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (t : ℝ) + (hy : 0 < (G t.toNNReal z).im) : + logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal) = + chartPoissonRate (fun u => Real.sqrt κ*B u) G t.toNNReal z := by + have he : logLoewnerCoordinates G z t = logLoewnerCoordinates G z (t.toNNReal : ℝ) := by + simp only [logLoewnerCoordinates, Real.toNNReal_coe] + rw [he, logVelocity, logCoordinates_im, Real.exp_log hy, + greenLogNormSq_logCoordinates κ (B t.toNNReal) G z t.toNNReal hy, + Complex.normSq_eq_norm_sq] + rfl + +lemma logFactor_single_integrand_nonneg (κ β target : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (σ : ℝ≥0) (t : ℝ) : + 0 ≤ regulator β target + (logFactorClock κ (logLoewnerCoordinates G z t) - + logFactorClock κ (logLoewnerCoordinates G z σ)) * + logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2 := + mul_nonneg (regulator_pos _ _ _).le (sq_nonneg _) + +lemma logFactor_pair_integrand_nonneg (κ β M Uz Uw : ℝ) (B : ℝ≥0 → ℝ) + (G : ℝ≥0 → ℂ → ℂ) (z w : ℂ) (σz σw : ℝ≥0) (t : ℝ) : + 0 ≤ (regulator β Uz + (logFactorClock κ (logLoewnerCoordinates G z t) - + logFactorClock κ (logLoewnerCoordinates G z σz)) * + regulator β Uw + (logFactorClock κ (logLoewnerCoordinates G w t) - + logFactorClock κ (logLoewnerCoordinates G w σw)))^(-M) * + (logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal) * + logVelocity κ (logLoewnerCoordinates G w t) (B t.toNNReal)) := + mul_nonneg (Real.rpow_nonneg (mul_nonneg (regulator_pos _ _ _).le + (regulator_pos _ _ _).le) _) (mul_pos (logVelocity_pos _ _ _) (logVelocity_pos _ _ _)).le + +end SLEExactGauge.Multipoint + +namespace SLEExactGauge + +lemma IsCapacityTwoWitness.logFactorClock_sub + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (κ : ℝ) (z : ℂ) (σ : ℝ≥0) (t : ℝ) + (hσ : z ∈ survivingDomain γ σ) (ht : z ∈ survivingDomain γ t.toNNReal) : + Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ) = + κ*Multipoint.activeRadiusClock G z σ t := by + have hLt : logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) = + Real.log ((2*z.im)/fullRadius G t.toNNReal z) := by + simpa only [logLoewnerCoordinates, Real.toNNReal_coe] using + logRadiusClock_logCoordinates hU hw z t.toNNReal ht + have hLs := logRadiusClock_logCoordinates hU hw z σ hσ + rw [Multipoint.logFactorClock_eq_logRadiusClock κ (Real.log z.im), + Multipoint.logFactorClock_eq_logRadiusClock κ (Real.log z.im), hLt, hLs] + unfold Multipoint.activeRadiusClock + ring + +/-- The one-point regulator cost in the smooth factor's clock units. -/ +theorem IsCapacityTwoWitness.logFactor_single_regulator_integral_le + {κ : ℝ} (hκ : 0 < κ) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) + {β target : ℝ} (hβ : 0 < β) (htarget : 0 ≤ target) + (hclock : Multipoint.logFactorClock κ (logLoewnerCoordinates G z T) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ) ≤ target) : + (∫ t in (σ : ℝ)..(T : ℝ), + Multipoint.regulator β target + (Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ)) * + Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2) ≤ + 2/(κ*β) := by + have hU : Continuous (fun t => Real.sqrt κ*B t) := continuous_const.mul hB + have hzσ := survivingDomain_antitone γ hσT hz + have hclock' : Multipoint.activeRadiusClock G z σ T ≤ target/κ := by + apply (le_div_iff₀ hκ).mpr + have hc := hw.logFactorClock_sub hU κ z σ T hzσ (by simpa using hz) + rw [hc] at hclock + nlinarith only [hclock] + have hb := hw.active_regulator_integral_le hU σ T hσT z hz + (mul_pos hκ hβ) (div_nonneg htarget hκ.le) hclock' + convert hb using 1 + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le (show (σ : ℝ) ≤ T by exact_mod_cast hσT)] at ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hzt := survivingDomain_antitone γ htT hz + dsimp only + rw [hw.logFactorClock_sub hU κ z σ t hzσ hzt, + Multipoint.regulator_scaled_argument hκ, + Multipoint.logVelocity_logCoordinates κ B G z t (hw.imag_positive _ z hzt)] + +/-- Including the generator's factor `κ` gives exactly the source bound. -/ +theorem IsCapacityTwoWitness.logFactor_single_discount_le + {κ : ℝ} (hκ : 0 < κ) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) + {β target : ℝ} (hβ : 0 < β) (htarget : 0 ≤ target) + (hclock : Multipoint.logFactorClock κ (logLoewnerCoordinates G z T) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ) ≤ target) : + κ*(∫ t in (σ : ℝ)..(T : ℝ), + Multipoint.regulator β target + (Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ)) * + Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2) ≤ + 2/β := by + have hb := mul_le_mul_of_nonneg_left + (hw.logFactor_single_regulator_integral_le hκ hB σ T hσT z hz hβ htarget hclock) hκ.le + have he : κ*(2/(κ*β)) = 2/β := by field_simp [hκ.ne', hβ.ne'] + rwa [he] at hb + +/-- Pair interaction cost for the source-normalized regulator branches. +The physical-time interaction budget remains in capacity-two units. -/ +theorem IsCapacityTwoWitness.logFactor_pair_regulator_integral_le + {κ : ℝ} (hκ : 0 < κ) {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (σz σw s T : ℝ≥0) (hσz : σz ≤ s) (hσw : σw ≤ s) (hsT : s ≤ T) + (z w : ℂ) (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) + (hne : z ≠ w) + (hbz : physicalConformalRadius J G σz z ≤ dist (J z) (J w)) + (hbw : physicalConformalRadius J G σw w ≤ dist (J z) (J w)) + {β M : ℝ} (hβ : 0 ≤ β) (hM : 0 ≤ M) (hdecay : 2*(M*β) < 2/κ) + (Uz Uw : ℝ) : + (∫ t in (s : ℝ)..(T : ℝ), + (Multipoint.regulator β Uz + (Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σz)) * + Multipoint.regulator β Uw + (Multipoint.logFactorClock κ (logLoewnerCoordinates G w t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G w σw)))^(-M) * + (Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal) * + Multipoint.logVelocity κ (logLoewnerCoordinates G w t) (B t.toNNReal))) ≤ + Multipoint.interactionBudget 2 (M*(κ*β)) := by + have hU : Continuous (fun t => Real.sqrt κ*B t) := continuous_const.mul hB + have hzσ := survivingDomain_antitone γ (hσz.trans hsT) hz + have hwσ := survivingDomain_antitone γ (hσw.trans hsT) hw' + have hadm : 2*(M*(κ*β)) < 2 := by + have hh := (Multipoint.source_pair_exponent_admissible (c := M*β) hκ).mpr hdecay + convert hh using 1 + ring + have hb := hw.actual_pair_regulator_integral_le hU hgrowth J hJ hJinj + σz σw s T hσz hσw hsT z w hz hw' hne hbz hbw (mul_nonneg hκ.le hβ) hM hadm + (Uz/κ) (Uw/κ) + convert hb using 1 + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le (show (s : ℝ) ≤ T by exact_mod_cast hsT)] at ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hzt := survivingDomain_antitone γ htT hz + have hwt := survivingDomain_antitone γ htT hw' + dsimp only + rw [hw.logFactorClock_sub hU κ z σz t hzσ hzt, + hw.logFactorClock_sub hU κ w σw t hwσ hwt, + Multipoint.regulator_scaled_argument hκ, Multipoint.regulator_scaled_argument hκ, + Multipoint.logVelocity_logCoordinates κ B G z t (hw.imag_positive _ z hzt), + Multipoint.logVelocity_logCoordinates κ B G w t (hw.imag_positive _ w hwt)] + +lemma IsCapacityTwoWitness.logFactorClock_sub_continuousOn + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (κ : ℝ) (σ T : ℝ≥0) (z : ℂ) + (hσ : z ∈ survivingDomain γ σ) (hz : z ∈ survivingDomain γ T) : + ContinuousOn (fun t : ℝ => + Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ)) (Icc 0 (T : ℝ)) := by + apply (continuousOn_const.mul (hw.activeRadiusClock_continuousOn hU σ T z hz)).congr + intro t ht + exact hw.logFactorClock_sub hU κ z σ t hσ + (hw.live_at_real_time T z hz t ht.2) + +lemma IsCapacityTwoWitness.logVelocity_continuousOn + {κ : ℝ} {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (T : ℝ≥0) (z : ℂ) (hz : z ∈ survivingDomain γ T) : + ContinuousOn (fun t : ℝ => + Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)) + (Icc 0 (T : ℝ)) := by + apply (hw.poissonRate_continuousOn (continuous_const.mul hB) T z hz).congr + intro t ht + exact Multipoint.logVelocity_logCoordinates κ B G z t + (hw.imag_positive _ z (hw.live_at_real_time T z hz t ht.2)) + +/-- Integrability for the exact source-clock single-point cost on its own +active interval. The endpoint may be specific to this marked point. -/ +theorem IsCapacityTwoWitness.logFactor_single_intervalIntegrable + {κ : ℝ} {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) + (β target : ℝ) : + IntervalIntegrable (fun t : ℝ => + Multipoint.regulator β target + (Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σ)) * + Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal)^2) + volume (σ : ℝ) (T : ℝ) := by + have hU : Continuous (fun t => Real.sqrt κ*B t) := continuous_const.mul hB + have hσ := survivingDomain_antitone γ hσT hz + have hc := (Multipoint.regulator_continuous β target).comp_continuousOn + (hw.logFactorClock_sub_continuousOn hU κ σ T z hσ hz) + have hv := (hw.logVelocity_continuousOn hB T z hz).pow 2 + have hsub : Icc (σ : ℝ) (T : ℝ) ⊆ Icc 0 (T : ℝ) := + Icc_subset_Icc σ.coe_nonneg le_rfl + exact ((hc.mul hv).mono hsub).intervalIntegrable_of_Icc + (show (σ : ℝ) ≤ T by exact_mod_cast hσT) + +/-- Integrability for the exact source-clock pair cost on the overlap of +the two active intervals; the common endpoint may be their minimum. -/ +theorem IsCapacityTwoWitness.logFactor_pair_intervalIntegrable + {κ : ℝ} {B : ℝ≥0 → ℝ} (hB : Continuous B) + {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness (fun t => Real.sqrt κ*B t) γ G F) + (σz σw s T : ℝ≥0) (hσz : σz ≤ s) (hσw : σw ≤ s) (hsT : s ≤ T) + (z w : ℂ) (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) + (β M Uz Uw : ℝ) : + IntervalIntegrable (fun t : ℝ => + (Multipoint.regulator β Uz + (Multipoint.logFactorClock κ (logLoewnerCoordinates G z t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G z σz)) * + Multipoint.regulator β Uw + (Multipoint.logFactorClock κ (logLoewnerCoordinates G w t) - + Multipoint.logFactorClock κ (logLoewnerCoordinates G w σw)))^(-M) * + (Multipoint.logVelocity κ (logLoewnerCoordinates G z t) (B t.toNNReal) * + Multipoint.logVelocity κ (logLoewnerCoordinates G w t) (B t.toNNReal))) + volume (s : ℝ) (T : ℝ) := by + have hU : Continuous (fun t => Real.sqrt κ*B t) := continuous_const.mul hB + have hzσ := survivingDomain_antitone γ (hσz.trans hsT) hz + have hwσ := survivingDomain_antitone γ (hσw.trans hsT) hw' + have hzclock := hw.logFactorClock_sub_continuousOn hU κ σz T z hzσ hz + have hwclock := hw.logFactorClock_sub_continuousOn hU κ σw T w hwσ hw' + have hreg := ((Multipoint.regulator_continuous β Uz).comp_continuousOn hzclock).mul + ((Multipoint.regulator_continuous β Uw).comp_continuousOn hwclock) + have hpw := hreg.rpow_const (p := -M) fun t _ => Or.inl + (mul_pos (Multipoint.regulator_pos _ _ _) (Multipoint.regulator_pos _ _ _)).ne' + have hv := (hw.logVelocity_continuousOn hB T z hz).mul + (hw.logVelocity_continuousOn hB T w hw') + have hsub : Icc (s : ℝ) (T : ℝ) ⊆ Icc 0 (T : ℝ) := + Icc_subset_Icc s.coe_nonneg le_rfl + exact ((hpw.mul hv).mono hsub).intervalIntegrable_of_Icc + (show (s : ℝ) ≤ T by exact_mod_cast hsT) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointLogFactor.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointLogFactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..419a3c19b6593e180fb7a4640e3e47309cc558e2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointLogFactor.lean @@ -0,0 +1,140 @@ +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + +/-! Smooth logarithmic-coordinate monomials for the multipoint factors. +The three monomials in each regularized factor have this form. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology + +namespace SLEExactGauge.Multipoint + +def logFactor (κ c r : ℝ) (q : ℂ × ℝ) (x : ℝ) : ℝ := + Real.exp ((c*κ/4)*q.2+(r-c*κ/4)*q.1.im-(r/2)*Real.log (greenLogNormSq κ q x)) + +lemma logFactor_pos (κ c r : ℝ) (q : ℂ × ℝ) (x : ℝ) : 0 < logFactor κ c r q x := + Real.exp_pos _ + +lemma logFactor_contDiff (κ c r : ℝ) : + ContDiff ℝ (⊤ : ℕ∞) (fun p : (ℂ × ℝ) × ℝ => logFactor κ c r p.1 p.2) := by + have hre : ContDiff ℝ (⊤ : ℕ∞) (fun p : (ℂ × ℝ) × ℝ => p.1.1.re) := + Complex.reCLM.contDiff.comp contDiff_fst.fst + have him : ContDiff ℝ (⊤ : ℕ∞) (fun p : (ℂ × ℝ) × ℝ => p.1.1.im) := + Complex.imCLM.contDiff.comp contDiff_fst.fst + have hN : ContDiff ℝ (⊤ : ℕ∞) (fun p : (ℂ × ℝ) × ℝ => greenLogNormSq κ p.1 p.2) := + ((hre.sub (contDiff_const.mul contDiff_snd)).pow 2).add + ((contDiff_const.mul him).exp) + have hlog := hN.log (fun p => (greenLogNormSq_pos κ p.1 p.2).ne') + unfold logFactor + exact ((contDiff_const.mul contDiff_fst.snd).add + (contDiff_const.mul him) |>.sub (contDiff_const.mul hlog)).exp + +lemma logFactor_spatial_derivative (κ c r : ℝ) (q : ℂ × ℝ) (x : ℝ) : + HasDerivAt (logFactor κ c r q) + (logFactor κ c r q x * (r*Real.sqrt κ*(q.1.re-Real.sqrt κ*x)/greenLogNormSq κ q x)) x := by + have hX := (hasDerivAt_const x q.1.re).sub ((hasDerivAt_id x).const_mul (Real.sqrt κ)) + have hN : HasDerivAt (greenLogNormSq κ q) + (2*(q.1.re-Real.sqrt κ*x)*(-Real.sqrt κ)) x := by + convert (hX.pow 2).add_const (Real.exp (2*q.1.im)) using 1 <;> try rfl + simp + have hlog := hN.log (greenLogNormSq_pos κ q x).ne' + have hd := ((hasDerivAt_const x ((c*κ/4)*q.2+(r-c*κ/4)*q.1.im)).sub + (hlog.const_mul (r/2))).exp + convert hd using 1 <;> try rfl + dsimp only [logFactor, Pi.sub_apply, Pi.mul_apply, Function.comp_def] + ring + +lemma logFactor_spatial_second (κ c r : ℝ) (hκ : 0 ≤ κ) (q : ℂ × ℝ) (x : ℝ) : + iteratedDeriv 2 (logFactor κ c r q) x = + logFactor κ c r q x * κ*r*((r+1)*(q.1.re-Real.sqrt κ*x)^2-Real.exp (2*q.1.im)) / + (greenLogNormSq κ q x)^2 := by + have hd : deriv (logFactor κ c r q) = fun x => + logFactor κ c r q x*(r*Real.sqrt κ*(q.1.re-Real.sqrt κ*x)/greenLogNormSq κ q x) := + funext (fun x => (logFactor_spatial_derivative κ c r q x).deriv) + have hX := (hasDerivAt_const x q.1.re).sub ((hasDerivAt_id x).const_mul (Real.sqrt κ)) + have hN : HasDerivAt (greenLogNormSq κ q) + (2*(q.1.re-Real.sqrt κ*x)*(-Real.sqrt κ)) x := by + convert (hX.pow 2).add_const (Real.exp (2*q.1.im)) using 1 <;> try rfl + simp + have hcoef := (hX.const_mul (r*Real.sqrt κ)).div hN (greenLogNormSq_pos κ q x).ne' + have hsecond := (logFactor_spatial_derivative κ c r q x).mul hcoef + rw [show (2 : ℕ) = 1+1 from rfl, iteratedDeriv_succ, iteratedDeriv_one, hd] + dsimp only [Pi.mul_apply, Pi.sub_apply, Pi.div_apply, id_eq] at hsecond + change HasDerivAt (fun y => logFactor κ c r q y * + (r*Real.sqrt κ*(q.1.re-Real.sqrt κ*y)/greenLogNormSq κ q y)) _ x at hsecond + rw [hsecond.deriv] + dsimp only [greenLogNormSq] + generalize logFactor κ c r q x = f + generalize q.1.re-Real.sqrt κ*x = X + generalize Real.exp (2*q.1.im) = Y + have hs := Real.sq_sqrt hκ + generalize Real.sqrt κ = v at * + rw [← hs] + field_simp + ring + +lemma logFactor_directional (κ c r : ℝ) (q v : ℂ × ℝ) (x : ℝ) : + (fderiv ℝ (fun q => logFactor κ c r q x) q) v = + logFactor κ c r q x*((c*κ/4)*v.2+(r-c*κ/4)*v.1.im-(r/2)* + ((2*(q.1.re-Real.sqrt κ*x)*v.1.re+2*Real.exp (2*q.1.im)*v.1.im)/ + greenLogNormSq κ q x)) := by + have hzre : HasDerivAt (fun t : ℝ => (q+t • v).1.re) v.1.re 0 := by + simpa only [Prod.fst_add, Prod.smul_fst, Complex.add_re, Complex.smul_re, smul_eq_mul, + id_eq, one_mul] using ((hasDerivAt_id (0 : ℝ)).mul_const v.1.re).const_add q.1.re + have hzim : HasDerivAt (fun t : ℝ => (q+t • v).1.im) v.1.im 0 := by + simpa only [Prod.fst_add, Prod.smul_fst, Complex.add_im, Complex.smul_im, smul_eq_mul, + id_eq, one_mul] using ((hasDerivAt_id (0 : ℝ)).mul_const v.1.im).const_add q.1.im + have hj : HasDerivAt (fun t : ℝ => (q+t • v).2) v.2 0 := by + simpa only [Prod.snd_add, Prod.smul_snd, smul_eq_mul, id_eq, one_mul] + using ((hasDerivAt_id (0 : ℝ)).mul_const v.2).const_add q.2 + have hN : HasDerivAt (fun t : ℝ => greenLogNormSq κ (q+t • v) x) + (2*(q.1.re-Real.sqrt κ*x)*v.1.re+2*Real.exp (2*q.1.im)*v.1.im) 0 := by + convert ((hzre.sub_const (Real.sqrt κ*x)).pow 2).add ((hzim.const_mul 2).exp) using 1 <;> try rfl + simp only [zero_smul, add_zero, Nat.cast_ofNat] + ring + have hlog := hN.log (by simpa only [zero_smul, add_zero] using (greenLogNormSq_pos κ q x).ne') + have hcalc := ((hj.const_mul (c*κ/4)).add (hzim.const_mul (r-c*κ/4))).sub + (hlog.const_mul (r/2)) + have hline : HasDerivAt (fun t : ℝ => logFactor κ c r (q+t • v) x) + (logFactor κ c r q x*((c*κ/4)*v.2+(r-c*κ/4)*v.1.im-(r/2)* + ((2*(q.1.re-Real.sqrt κ*x)*v.1.re+2*Real.exp (2*q.1.im)*v.1.im)/ + greenLogNormSq κ q x))) 0 := by + convert hcalc.exp using 1 <;> try rfl + simp only [Pi.sub_apply, Pi.add_apply, zero_smul, add_zero, logFactor] + have hcd : ContDiff ℝ (⊤ : ℕ∞) (fun q => logFactor κ c r q x) := + (logFactor_contDiff κ c r).comp (contDiff_id.prodMk contDiff_const) + have haff : HasDerivAt (fun t : ℝ => q+t • v) v 0 := by + simpa only [id_eq, one_smul] using ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add q + have hfd : HasFDerivAt (fun q => logFactor κ c r q x) + (fderiv ℝ (fun q => logFactor κ c r q x) q) (q+(0 : ℝ) • v) := by + simpa using ((hcd.differentiable (by simp)) q).hasFDerivAt + have hchain := hfd.comp_hasDerivAt 0 haff + simpa only [Function.comp_def] using hchain.unique hline + +/-- The source angular generator in actual capacity-two coordinates. -/ +theorem logFactor_physical_generator (κ c r : ℝ) (hκ : 0 < κ) + (q : ℂ × ℝ) (x : ℝ) : + (fderiv ℝ (fun q => logFactor κ c r q x) q) + (physicalLogLoewnerField (Real.sqrt κ*x) q) + + (1/2 : ℝ)*iteratedDeriv 2 (logFactor κ c r q) x = + logFactor κ c r q x * κ * + ((r*(r-greenExponent κ)/2)*(q.1.re-Real.sqrt κ*x)^2+ + (c-r/2)*Real.exp (2*q.1.im)) / (greenLogNormSq κ q x)^2 := by + rw [logFactor_directional, logFactor_spatial_second κ c r hκ.le] + obtain ⟨hr, hi, hj⟩ := physicalLogLoewnerField_components κ q x + rw [hr, hi, hj] + have hp : κ*(greenExponent κ+1) = 8 := by + simp only [greenExponent, sub_add_cancel] + field_simp + have hn := (greenLogNormSq_pos κ q x).ne' + field_simp [hn] + dsimp only [greenLogNormSq] + linear_combination 4*logFactor κ c r q x*r*(q.1.re-Real.sqrt κ*x)^2*hp + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointMomentIntegration.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointMomentIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ae71c96940523978d91f3a9e7e908275fc8509e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointMomentIntegration.lean @@ -0,0 +1,61 @@ +import Mathlib.MeasureTheory.Integral.Pi + +namespace OAI + +/-! Finite products and Tonelli for the moments of a nonnegative spatial +weight. These identities retain arbitrary finite orders. -/ + +noncomputable section +open Set MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +lemma lintegral_fin_product + {X : Type*} [MeasurableSpace X] (μ : Measure X) [SigmaFinite μ] + (f : X → ℝ≥0∞) (hf : Measurable f) (n : ℕ) : + (∫⁻ x : Fin n → X, ∏ i, f (x i) ∂Measure.pi (fun _ => μ)) = (∫⁻ x, f x ∂μ)^n := by + induction n with + | zero => simp only [Finset.univ_eq_empty,Finset.prod_empty,lintegral_const, + one_mul,pow_zero,Measure.pi_empty_univ] + | succ n ih => + rw [← (measurePreserving_piFinSuccAbove (fun _ : Fin (n+1) => μ) 0).symm.lintegral_comp_emb + (MeasurableEquiv.measurableEmbedding _) (fun x : Fin (n+1) → X => ∏ i, f (x i))] + simp only [MeasurableEquiv.piFinSuccAbove_symm_apply,Fin.insertNthEquiv, + Fin.prod_univ_succ,Fin.insertNth_zero,Fin.zero_succAbove,Equiv.coe_fn_mk, + Fin.cons_succ,cast_eq,Fin.cons_zero] + have hg : Measurable (fun x : Fin n → X => ∏ i, f (x i)) := + Finset.measurable_prod Finset.univ (fun i _ => hf.comp (measurable_pi_apply i)) + rw [lintegral_prod_mul (f := f) (g := fun x : Fin n → X => ∏ i, f (x i)) + hf.aemeasurable hg.aemeasurable,ih,pow_succ,mul_comm] + +theorem lintegral_mass_pow_eq + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) (μ : Measure X) [SigmaFinite P] [SigmaFinite μ] + (W : Ω → X → ℝ≥0∞) (hW : Measurable (Function.uncurry W)) (n : ℕ) : + (∫⁻ ω, (∫⁻ x, W ω x ∂μ)^n ∂P) = + ∫⁻ x : Fin n → X, ∫⁻ ω, ∏ i, W ω (x i) ∂P ∂Measure.pi (fun _ => μ) := by + have he (ω : Ω) := lintegral_fin_product μ (W ω) + (hW.comp (measurable_const.prodMk measurable_id)) n + simp_rw [← he] + apply lintegral_lintegral_swap + apply Measurable.aemeasurable + apply Finset.measurable_prod + intro i _ + exact hW.comp (measurable_fst.prodMk ((measurable_pi_apply i).comp measurable_snd)) + +theorem lintegral_mass_pow_le + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) (μ : Measure X) [SigmaFinite P] [SigmaFinite μ] + (W : Ω → X → ℝ≥0∞) (hW : Measurable (Function.uncurry W)) (n : ℕ) + (K : (Fin n → X) → ℝ≥0∞) + (hK : ∀ᵐ x ∂Measure.pi (fun _ : Fin n => μ), (∫⁻ ω, ∏ i, W ω (x i) ∂P) ≤ K x) : + (∫⁻ ω, (∫⁻ x, W ω x ∂μ)^n ∂P) ≤ ∫⁻ x, K x ∂Measure.pi (fun _ : Fin n => μ) := by + rw [lintegral_mass_pow_eq P μ W hW n] + exact lintegral_mono_ae hK + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointOrdinaryProbability.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointOrdinaryProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..beb7102e58b506fe853d7ab5d2daf4eea8310ed5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointOrdinaryProbability.lean @@ -0,0 +1,51 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhysicalProbability + +namespace OAI + +/-! The arbitrary-domain multipoint estimate for an ordinary chordal SLE +in its regular Brownian presentation. The constant is fixed by the order +and SLE parameter before choosing any domain, points, caps or targets. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge + +def multipointConstant (κ : ℝ) (m : ℕ) : ℝ := + (3 : ℝ)^m * Real.exp (Multipoint.uniformDiscountBudget κ (Multipoint.sourceBeta κ) + (Finset.univ : Finset (Fin m))) + +lemma multipointConstant_pos (κ : ℝ) (m : ℕ) : 0 < multipointConstant κ m := by + unfold multipointConstant + positivity + +/-- The capped estimate of the first paper's multipoint proposition, +for every fixed finite order and arbitrary physical conformal domain. +The input `PublishedDiskUnivalentGrowth` is Duren (1983), §2.3. -/ +theorem RegularSLEPresentation.physical_multipoint_main + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {κ : ℝ} + {γ : Ω → ℝ≥0 → ℂ} (a : RegularSLEPresentation P κ γ) + (hκ : 0 < κ) (hκ8 : κ < 8) (hgrowth : PublishedDiskUnivalentGrowth) + (m : ℕ) (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) (z : Fin m → ℂ) + (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (b e : Fin m → ℝ) (hb : ∀ i, 0 < b i) (he : ∀ i, 0 < e i) + (hbR : ∀ i, b i ≤ 2*(z i).im*‖deriv J (z i)‖) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (J (z i)) (J (z j))) : + (P.comap (Subtype.val : a.samples → Ω)) + {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (a.G ω) t (z i) ≤ e i} ≤ + ENNReal.ofReal (multipointConstant κ m * ∏ i, min 1 ((e i/b i)^(1-κ/8))) := by + have hBm : Measurable (Function.uncurry a.B) := + measurable_uncurry_of_continuous_of_measurable a.continuous_B a.measurable_B + simpa only [multipointConstant,Fintype.card_fin] using + Multipoint.capped_physical_radius_multipoint_bound a.brownian a.measurable_B hBm + a.continuous_B a.zero_B hκ hκ8 (fun ω => γ ω) a.G a.F a.witness hgrowth J hJ hJinj + z hz hne (fun i => 2*(z i).im*‖deriv J (z i)‖) b e he hb hbR (fun _ => rfl) hsep + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPatternExpectation.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPatternExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6805b1f209c8dd35b596a852cdf868948c932b82 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPatternExpectation.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SLE.Multipoint.MultipointStoppedProduct +import OAI.Probability.SLE.Multipoint.MultipointSwitchPatterns + +namespace OAI + +/-! Summing the conditional product estimate over the actual finite +switch partition, then telescoping the downward product jumps. -/ + +noncomputable section +open Set MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem switchPattern_integral_le + {Ω ι : Type*} [MeasurableSpace Ω] [DecidableEq ι] (P : Measure Ω) + (s : Finset ι) (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) + (hA : ∀ A ∈ s.powerset, MeasurableSet (switchPatternEvent s ρ τ A)) + (F G : Finset ι → Ω → ℝ) (X Y : Ω → ℝ) + (hF : ∀ A ∈ s.powerset, IntegrableOn (F A) (switchPatternEvent s ρ τ A) P) + (hG : ∀ A ∈ s.powerset, IntegrableOn (G A) (switchPatternEvent s ρ τ A) P) + (hFX : ∀ A ∈ s.powerset, ∀ ω ∈ switchPatternEvent s ρ τ A, F A ω = X ω) + (hGY : ∀ A ∈ s.powerset, ∀ ω ∈ switchPatternEvent s ρ τ A, G A ω = Y ω) + (hle : ∀ A ∈ s.powerset, + (∫ ω in switchPatternEvent s ρ τ A, F A ω ∂P) ≤ + ∫ ω in switchPatternEvent s ρ τ A, G A ω ∂P) : + Integrable X P ∧ Integrable Y P ∧ (∫ ω, X ω ∂P) ≤ ∫ ω, Y ω ∂P := by + have heX := sum_switchPattern_fields s ρ τ F X hFX + have heY := sum_switchPattern_fields s ρ τ G Y hGY + have hFi (A : Finset ι) (hAs : A ∈ s.powerset) : + Integrable ((switchPatternEvent s ρ τ A).indicator (F A)) P := + (integrable_indicator_iff (hA A hAs)).mpr (hF A hAs) + have hGi (A : Finset ι) (hAs : A ∈ s.powerset) : + Integrable ((switchPatternEvent s ρ τ A).indicator (G A)) P := + (integrable_indicator_iff (hA A hAs)).mpr (hG A hAs) + have hXi : Integrable X P := by + rw [← heX] + exact integrable_finsetSum _ hFi + have hYi : Integrable Y P := by + rw [← heY] + exact integrable_finsetSum _ hGi + refine ⟨hXi,hYi,?_⟩ + rw [← heX, ← heY, integral_finsetSum _ hFi, integral_finsetSum _ hGi] + apply Finset.sum_le_sum + intro A hAs + rw [integral_indicator (hA A hAs), integral_indicator (hA A hAs)] + exact hle A hAs + +theorem finite_switched_product_expectation_le + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) (N : ℕ) + (X Y : ℕ → Ω → ℝ) + (hX : ∀ n, n ≤ N → Integrable (X n) P) + (hY : ∀ n, n < N → Integrable (Y n) P) + (hflow : ∀ n, n < N → (∫ ω, Y n ω ∂P) ≤ ∫ ω, X n ω ∂P) + (hjump : ∀ n, n < N → ∀ ω, X (n+1) ω ≤ Y n ω) : + (∫ ω, X N ω ∂P) ≤ ∫ ω, X 0 ω ∂P := by + have hind : ∀ n, n ≤ N → (∫ ω, X n ω ∂P) ≤ ∫ ω, X 0 ω ∂P := by + intro n + induction n with + | zero => exact fun _ => le_rfl + | succ n ih => + intro hn + have hnN : n < N := Nat.lt_of_succ_le hn + have hle : (∫ ω, X (n+1) ω ∂P) ≤ ∫ ω, Y n ω ∂P := + integral_mono_ae (hX (n+1) hn) (hY n hnN) (ae_of_all _ (hjump n hnN)) + exact hle.trans ((hflow n hnN).trans (ih (Nat.le_trans (Nat.le_succ n) hn))) + exact hind N le_rfl + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPatternProduct.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPatternProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..8df5e0a353cd33d50392d7e3f28d0fee0ec00088 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPatternProduct.lean @@ -0,0 +1,191 @@ +import OAI.Probability.SLE.Multipoint.MultipointFactorBranches +import OAI.Probability.SLE.Multipoint.MultipointDiscountedField +import OAI.Probability.SLE.Multipoint.MultipointSuccess + +namespace OAI + +/-! The finite branch formula for inactive, first-half, second-half, and +completed factors. Its constant part includes every completed factor. -/ + +noncomputable section +open Set +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +def phaseActive (j : Fin 4) : Prop := j = 1 ∨ j = 2 + +instance (j : Fin 4) : Decidable (phaseActive j) := inferInstanceAs (Decidable (_ ∨ _)) + +def phaseRegulatorScale (β a U : ℝ) (j : Fin 4) : ℝ := + if j = 1 then Real.exp (β*a) else Real.exp (-β*(U+a)) + +def phaseRegulatorSlope (β : ℝ) (j : Fin 4) : ℝ := if j = 1 then -β else β + +def phaseWeight (κ a U : ℝ) (j : Fin 4) : ℝ := + if phaseActive j then factorActivationScale κ a + else if j = 3 then Real.exp (greenExponent κ/2*U)/3 else 1 + +def phaseFactor (κ β a U : ℝ) (j : Fin 4) (z : ℂ × ℝ) (x : ℝ) : ℝ := + phaseWeight κ a U j * if phaseActive j then + regularizedLogFactor κ (phaseRegulatorScale β a U j) (phaseRegulatorSlope β j) z x + else 1 + +def patternActiveSet {ι : Type*} [Fintype ι] (j : ι → Fin 4) : Finset ι := + Finset.univ.filter (fun i => phaseActive (j i)) + +def patternWeight {ι : Type*} [Fintype ι] (κ : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) : ℝ := + ∏ i, phaseWeight κ (a i) (U i) (j i) + +def patternProduct {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) (z : ι → ℂ × ℝ) (x : ℝ) : ℝ := + ∏ i, phaseFactor κ β (a i) (U i) (j i) (z i) x + +def discountedPatternProduct {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) (z : (ι → ℂ × ℝ) × ℝ) (x : ℝ) : ℝ := + Real.exp (-z.2)*patternProduct κ β a U j z.1 x + +lemma phaseRegulatorScale_pos (β a U : ℝ) (j : Fin 4) : + 0 < phaseRegulatorScale β a U j := by + unfold phaseRegulatorScale + split_ifs <;> exact Real.exp_pos _ + +lemma phaseRegulatorSlope_le_one {β : ℝ} (hβ : 0 ≤ β) (hβ1 : β ≤ 1) (j : Fin 4) : + phaseRegulatorSlope β j ≤ 1 := by + unfold phaseRegulatorSlope + split_ifs <;> linarith + +lemma phaseWeight_pos (κ a U : ℝ) (j : Fin 4) : 0 < phaseWeight κ a U j := by + unfold phaseWeight + split_ifs + · exact factorActivationScale_pos κ a + · positivity + · norm_num + +lemma phaseFactor_pos (κ β a U : ℝ) (j : Fin 4) (z : ℂ × ℝ) (x : ℝ) : + 0 < phaseFactor κ β a U j z x := by + unfold phaseFactor + apply mul_pos (phaseWeight_pos κ a U j) + split_ifs + · exact regularizedLogFactor_pos κ _ _ (phaseRegulatorScale_pos β a U j) z x + · norm_num + +lemma patternWeight_pos {ι : Type*} [Fintype ι] + (κ : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) : 0 < patternWeight κ a U j := + Finset.prod_pos (fun i _ => phaseWeight_pos κ (a i) (U i) (j i)) + +lemma patternProduct_eq {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) (z : ι → ℂ × ℝ) (x : ℝ) : + patternProduct κ β a U j z x = patternWeight κ a U j * + regularizedProduct (patternActiveSet j) κ + (fun i => phaseRegulatorScale β (a i) (U i) (j i)) + (fun i => phaseRegulatorSlope β (j i)) z x := by + simp only [patternProduct, phaseFactor, Finset.prod_mul_distrib, patternWeight, + regularizedProduct, patternActiveSet, Finset.prod_filter] + +lemma discountedPatternProduct_eq {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (j : ι → Fin 4) (z : (ι → ℂ × ℝ) × ℝ) (x : ℝ) : + discountedPatternProduct κ β a U j z x = patternWeight κ a U j * + discountedProduct (patternActiveSet j) κ + (fun i => phaseRegulatorScale β (a i) (U i) (j i)) + (fun i => phaseRegulatorSlope β (j i)) z x := by + rw [discountedPatternProduct, patternProduct_eq, discountedProduct] + ring + +lemma phaseFactor_inactive (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) : + phaseFactor κ β a U 0 z x = 1 := by + norm_num [phaseFactor, phaseWeight, phaseActive] + +lemma phaseFactor_first (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) : + phaseFactor κ β a U 1 z x = factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (β*a)) (-β) z x := by + norm_num [phaseFactor, phaseWeight, phaseActive, phaseRegulatorScale, phaseRegulatorSlope] + +lemma phaseFactor_second (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) : + phaseFactor κ β a U 2 z x = factorActivationScale κ a * + regularizedLogFactor κ (Real.exp (-β*(U+a))) β z x := by + norm_num [phaseFactor, phaseWeight, phaseActive, phaseRegulatorScale, phaseRegulatorSlope] + +lemma phaseFactor_completed (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) : + phaseFactor κ β a U 3 z x = Real.exp (greenExponent κ/2*U)/3 := by + norm_num [phaseFactor, phaseWeight, phaseActive] + +lemma phaseFactor_activation (κ β a U : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ℂ × ℝ) (x : ℝ) (hU : 0 ≤ U) (hu : logFactorClock κ z-a = 0) : + phaseFactor κ β a U 1 z x ≤ phaseFactor κ β a U 0 z x := by + rw [phaseFactor_first, phaseFactor_inactive] + exact first_branch_activation_le κ β a U hκ hκ8 z x hU hu + +lemma phaseFactor_midpoint (κ β a U : ℝ) (z : ℂ × ℝ) (x : ℝ) + (hu : logFactorClock κ z-a = U/2) : + phaseFactor κ β a U 2 z x = phaseFactor κ β a U 1 z x := by + rw [phaseFactor_first, phaseFactor_second, branch_midpoint_eq κ β a U z x hu] + +lemma phaseFactor_completion (κ β a U : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ℂ × ℝ) (x : ℝ) (hU : 0 ≤ U) (hu : logFactorClock κ z-a = U) : + phaseFactor κ β a U 3 z x ≤ phaseFactor κ β a U 2 z x := by + rw [phaseFactor_second, phaseFactor_completed] + exact second_branch_completion_jump κ β a U hκ hκ8 z x hU hu + +/-- Several coincident switches still move the factor downward. Each +crossed threshold is imposed at its actual clock value. -/ +lemma phaseFactor_switch_le (κ β a U : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (z : ℂ × ℝ) (x : ℝ) (hU : 0 ≤ U) (j k : Fin 4) (hjk : j ≤ k) + (hstart : j ≤ 0 → 1 ≤ k → logFactorClock κ z-a = 0) + (hmid : j ≤ 1 → 2 ≤ k → logFactorClock κ z-a = U/2) + (hend : j ≤ 2 → 3 ≤ k → logFactorClock κ z-a = U) : + phaseFactor κ β a U k z x ≤ phaseFactor κ β a U j z x := by + fin_cases j <;> fin_cases k + all_goals norm_num at hjk + all_goals try exact le_rfl + · exact phaseFactor_activation κ β a U hκ hκ8 z x hU (hstart (by decide) (by decide)) + · exact (phaseFactor_midpoint κ β a U z x (hmid (by decide) (by decide))).le.trans + (phaseFactor_activation κ β a U hκ hκ8 z x hU (hstart (by decide) (by decide))) + · exact (phaseFactor_completion κ β a U hκ hκ8 z x hU (hend (by decide) (by decide))).trans + ((phaseFactor_midpoint κ β a U z x (hmid (by decide) (by decide))).le.trans + (phaseFactor_activation κ β a U hκ hκ8 z x hU (hstart (by decide) (by decide)))) + · exact (phaseFactor_midpoint κ β a U z x (hmid (by decide) (by decide))).le + · exact (phaseFactor_completion κ β a U hκ hκ8 z x hU (hend (by decide) (by decide))).trans + (phaseFactor_midpoint κ β a U z x (hmid (by decide) (by decide))).le + · exact phaseFactor_completion κ β a U hκ hκ8 z x hU (hend (by decide) (by decide)) + +lemma patternProduct_switch_le {ι : Type*} [Fintype ι] + (κ β : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (a U : ι → ℝ) (hU : ∀ i, 0 ≤ U i) + (j k : ι → Fin 4) (z : ι → ℂ × ℝ) (x : ℝ) (hjk : ∀ i, j i ≤ k i) + (hstart : ∀ i, j i ≤ 0 → 1 ≤ k i → logFactorClock κ (z i)-a i = 0) + (hmid : ∀ i, j i ≤ 1 → 2 ≤ k i → logFactorClock κ (z i)-a i = U i/2) + (hend : ∀ i, j i ≤ 2 → 3 ≤ k i → logFactorClock κ (z i)-a i = U i) : + patternProduct κ β a U k z x ≤ patternProduct κ β a U j z x := by + apply Finset.prod_le_prod₀ (fun i _ => (phaseFactor_pos κ β (a i) (U i) (k i) (z i) x).le) + exact fun i _ => phaseFactor_switch_le κ β (a i) (U i) hκ hκ8 (z i) x + (hU i) (j i) (k i) (hjk i) (hstart i) (hmid i) (hend i) + +lemma patternProduct_all_inactive {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (z : ι → ℂ × ℝ) (x : ℝ) : + patternProduct κ β a U (fun _ => 0) z x = 1 := by + simp only [patternProduct, phaseFactor_inactive, Finset.prod_const_one] + +lemma patternProduct_all_complete {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (z : ι → ℂ × ℝ) (x : ℝ) : + patternProduct κ β a U (fun _ => 3) z x = + Real.exp (greenExponent κ/2 * ∑ i, U i) / 3^(Fintype.card ι) := by + simp only [patternProduct, phaseFactor_completed, Finset.prod_div_distrib, + ← Real.exp_sum, Finset.prod_const, Finset.card_univ, Finset.mul_sum] + +lemma discountedPatternProduct_complete_lower {ι : Type*} [Fintype ι] + (κ β : ℝ) (a U : ι → ℝ) (z : ι → ℂ × ℝ) (b K x : ℝ) (hb : b ≤ K) : + successBarrier (greenExponent κ) K Finset.univ U ≤ + discountedPatternProduct κ β a U (fun _ => 3) (z,b) x := by + rw [discountedPatternProduct, patternProduct_all_complete] + unfold successBarrier + simp only [Finset.card_univ, zpow_neg, zpow_natCast] + have he := Real.exp_le_exp.mpr (neg_le_neg hb) + have hp : 0 ≤ Real.exp (greenExponent κ/2 * ∑ i, U i) / 3^Fintype.card ι := by positivity + convert mul_le_mul_of_nonneg_right he hp using 1 + ring + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseProcess.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseProcess.lean new file mode 100644 index 0000000000000000000000000000000000000000..7453b686c259e4233999ef0f3d3790909cbf1289 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseProcess.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SLE.Multipoint.MultipointPatternProduct +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock + +namespace OAI + +/-! The actual finite phase process read from the three stopping times of +each marked point. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def phaseAt {Ω ι : Type*} (ρ : (ι × Fin 3) → Ω → ℝ≥0) + (t : ℝ≥0) (ω : Ω) (i : ι) : Fin 4 := + if ρ (i,2) ω ≤ t then 3 else if ρ (i,1) ω ≤ t then 2 + else if ρ (i,0) ω ≤ t then 1 else 0 + +def phaseOfPattern {ι : Type*} [DecidableEq ι] (A : Finset (ι × Fin 3)) (i : ι) : Fin 4 := + if (i,2) ∈ A then 3 else if (i,1) ∈ A then 2 else if (i,0) ∈ A then 1 else 0 + +lemma phaseAt_of_pattern {Ω ι : Type*} [Fintype ι] [DecidableEq ι] + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (τ : Ω → ℝ≥0) (A : Finset (ι × Fin 3)) + {ω : Ω} (hω : ω ∈ switchPatternEvent Finset.univ ρ τ A) : + phaseAt ρ (τ ω) ω = phaseOfPattern A := by + funext i + simp only [phaseAt, phaseOfPattern, hω (i,2) (Finset.mem_univ _), + hω (i,1) (Finset.mem_univ _), hω (i,0) (Finset.mem_univ _)] + +lemma phaseAt_monotone {Ω ι : Type*} (ρ : (ι × Fin 3) → Ω → ℝ≥0) + (ω : Ω) (i : ι) : Monotone (fun t => phaseAt ρ t ω i) := by + intro t u htu + have h0 : ρ (i,0) ω ≤ t → ρ (i,0) ω ≤ u := fun h => h.trans htu + have h1 : ρ (i,1) ω ≤ t → ρ (i,1) ω ≤ u := fun h => h.trans htu + have h2 : ρ (i,2) ω ≤ t → ρ (i,2) ω ≤ u := fun h => h.trans htu + dsimp only [phaseAt] + split_ifs <;> simp_all + +lemma phaseAt_ge_iff {Ω ι : Type*} (ρ : (ι × Fin 3) → Ω → ℝ≥0) + (ω : Ω) (i : ι) (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) (k : Fin 3) : + k.val+1 ≤ (phaseAt ρ t ω i).val ↔ ρ (i,k) ω ≤ t := by + have h01 : ρ (i,0) ω ≤ ρ (i,1) ω := hρ (by decide) + have h12 : ρ (i,1) ω ≤ ρ (i,2) ω := hρ (by decide) + have h02 := h01.trans h12 + fin_cases k <;> unfold phaseAt <;> split_ifs <;> simp_all <;> linarith + +lemma phaseAt_const_sorted_interval {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (t : ℝ≥0) + (hnt : sortedStopAt l H n ω ≤ t) (ht : t < sortedStopAt l H (n+1) ω) : + phaseAt ρ t ω = phaseAt ρ (sortedStopAt l H n ω) ω := by + funext i + simp only [phaseAt, sortedStopAt_reached_iff l H hl _ (hρ (i,2)) n ω t hnt ht, + sortedStopAt_reached_iff l H hl _ (hρ (i,1)) n ω t hnt ht, + sortedStopAt_reached_iff l H hl _ (hρ (i,0)) n ω t hnt ht] + +lemma phaseAt_crossed_sorted_switch {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H) (hρ : ∀ k, ρ k ∈ l) + (n : ℕ) (ω : Ω) (i : ι) (k : Fin 3) + (hord : Monotone (fun j => ρ (i,j) ω)) + (hbefore : (phaseAt ρ (sortedStopAt l H n ω) ω i).val ≤ k.val) + (hafter : k.val+1 ≤ (phaseAt ρ (sortedStopAt l H (n+1) ω) ω i).val) : + ρ (i,k) ω = sortedStopAt l H (n+1) ω := by + have hlt : sortedStopAt l H n ω < ρ (i,k) ω := by + by_contra h + have hc := (phaseAt_ge_iff ρ ω i hord _ k).mpr (le_of_not_gt h) + omega + exact le_antisymm ((phaseAt_ge_iff ρ ω i hord _ k).mp hafter) + (sortedStopAt_no_intermediate l H hl _ (hρ (i,k)) n ω hlt) + +lemma phaseAt_horizon {Ω ι : Type*} (ρ : (ι × Fin 3) → Ω → ℝ≥0) + (H : ℝ≥0) (hρ : ∀ k ω, ρ k ω ≤ H) (ω : Ω) : + phaseAt ρ H ω = fun _ => 3 := by + funext i + simp only [phaseAt, ite_eq_left (hρ (i,2) ω)] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseRegulator.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseRegulator.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ba72fc5cf271cf419a6ce03ecb8c66539929e01 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhaseRegulator.lean @@ -0,0 +1,168 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhaseProcess +import OAI.Probability.SLE.Multipoint.MultipointStoppedCoordinates +import OAI.Probability.SLE.FiniteRadiusStop + +namespace OAI + +/-! On each active interval the finite phase selects exactly the raw +radius regulator. Completion freezes the coordinate and removes its rate. -/ + +noncomputable section +open Set +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +lemma phaseActive_iff_val (j : Fin 4) : + phaseActive j ↔ 1 ≤ j.val ∧ j.val < 3 := by + fin_cases j <;> norm_num [phaseActive] + +lemma phaseAt_active_iff {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) : + phaseActive (phaseAt ρ t ω i) ↔ ρ (i,0) ω ≤ t ∧ t < ρ (i,2) ω := by + rw [phaseActive_iff_val] + have h0 := phaseAt_ge_iff ρ ω i hρ t 0 + have h2 := phaseAt_ge_iff ρ ω i hρ t 2 + simp only [Fin.val_zero] at h0 h2 + constructor + · rintro ⟨ha,hb⟩ + refine ⟨h0.mp ha, lt_of_not_ge ?_⟩ + intro hc + have := h2.mpr hc + omega + · rintro ⟨ha,hb⟩ + refine ⟨h0.mpr ha, ?_⟩ + by_contra hc + have := h2.mp (by omega) + exact (not_le_of_gt hb) this + +lemma phaseAt_first_iff {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) : + phaseAt ρ t ω i = 1 ↔ ρ (i,0) ω ≤ t ∧ t < ρ (i,1) ω := by + have h0 := phaseAt_ge_iff ρ ω i hρ t 0 + have h1 := phaseAt_ge_iff ρ ω i hρ t 1 + simp only [Fin.val_zero, Fin.val_one] at h0 h1 + constructor + · intro h + have hv : (phaseAt ρ t ω i).val = 1 := by rw [h]; rfl + refine ⟨h0.mp (by omega), lt_of_not_ge ?_⟩ + intro hc + have := h1.mpr hc + omega + · rintro ⟨ha,hb⟩ + have hlo := h0.mpr ha + have hhi : ¬ 2 ≤ (phaseAt ρ t ω i).val := by + intro hc + exact (not_le_of_gt hb) (h1.mp hc) + apply Fin.ext + change (phaseAt ρ t ω i).val = 1 + omega + +lemma phaseAt_second_iff {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) : + phaseAt ρ t ω i = 2 ↔ ρ (i,1) ω ≤ t ∧ t < ρ (i,2) ω := by + have h1 := phaseAt_ge_iff ρ ω i hρ t 1 + have h2 := phaseAt_ge_iff ρ ω i hρ t 2 + simp only [Fin.val_one] at h1 h2 + constructor + · intro h + have hv : (phaseAt ρ t ω i).val = 2 := by rw [h]; rfl + refine ⟨h1.mp (by omega), lt_of_not_ge ?_⟩ + intro hc + have := h2.mpr hc + omega + · rintro ⟨ha,hb⟩ + have hlo := h1.mpr ha + have hhi : ¬ 3 ≤ (phaseAt ρ t ω i).val := by + intro hc + exact (not_le_of_gt hb) (h2.mp hc) + apply Fin.ext + change (phaseAt ρ t ω i).val = 2 + omega + +lemma phaseAt_active_stopped_state {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) + (hactive : phaseActive (phaseAt ρ t ω i)) + (Q : ℝ → Ω → ι → ℂ × ℝ) : + stoppedCoordinateState Q (fun i => ρ (i,2)) t ω i = Q t ω i := by + have ht := ((phaseAt_active_iff ρ ω i hρ t).mp hactive).2 + have hle : (t : ℝ) ≤ (ρ (i,2) ω : ℝ) := by exact_mod_cast ht.le + simp only [stoppedCoordinateState, min_eq_left hle] + +lemma phaseAt_active_stopped_velocity {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) + (hactive : phaseActive (phaseAt ρ t ω i)) + (V : ℝ → Ω → ι → ℂ × ℝ) : + stoppedCoordinateVelocity V (fun i => ρ (i,2)) t ω i = V t ω i := by + have ht := ((phaseAt_active_iff ρ ω i hρ t).mp hactive).2 + have hlt : (t : ℝ) < (ρ (i,2) ω : ℝ) := by exact_mod_cast ht + simp only [stoppedCoordinateVelocity, ite_eq_left hlt] + +/-- Agreement up to each point's own completion suffices on every active +phase; no common live endpoint for all coordinates is required. -/ +lemma phaseAt_active_chart {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) + (hactive : phaseActive (phaseAt ρ t ω i)) + (Q : ℝ → Ω → ι → ℂ × ℝ) (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) + (hQ : EqOn (fun u => Q u ω i) (logLoewnerCoordinates G z) + (Icc 0 (ρ (i,2) ω : ℝ))) : + stoppedCoordinateState Q (fun i => ρ (i,2)) t ω i = + logLoewnerCoordinates G z t := by + rw [phaseAt_active_stopped_state ρ ω i hρ t hactive Q] + apply hQ + refine ⟨t.coe_nonneg, ?_⟩ + exact_mod_cast ((phaseAt_active_iff ρ ω i hρ t).mp hactive).2.le + +/-- The selected active branch has the raw regulator and never exceeds one. -/ +theorem phaseRegulator_eq_and_le_one (κ β a U : ℝ) (hβ : 0 ≤ β) + (j : Fin 4) (hj : phaseActive j) (z : ℂ × ℝ) + (hfirst : j = 1 → 0 ≤ logFactorClock κ z-a ∧ logFactorClock κ z-a ≤ U/2) + (hsecond : j = 2 → U/2 ≤ logFactorClock κ z-a ∧ logFactorClock κ z-a ≤ U) : + branchRegulator κ (phaseRegulatorScale β a U j) (phaseRegulatorSlope β j) z = + regulator β U (logFactorClock κ z-a) ∧ + branchRegulator κ (phaseRegulatorScale β a U j) (phaseRegulatorSlope β j) z ≤ 1 := by + rcases hj with rfl | rfl + · change branchRegulator κ (Real.exp (β*a)) (-β) z = _ ∧ + branchRegulator κ (Real.exp (β*a)) (-β) z ≤ 1 + exact ⟨first_branch_regulator_eq κ β a U z (hfirst rfl).2, + first_branch_regulator_le_one κ β a z hβ (hfirst rfl).1⟩ + · change branchRegulator κ (Real.exp (-β*(U+a))) β z = _ ∧ + branchRegulator κ (Real.exp (-β*(U+a))) β z ≤ 1 + exact ⟨second_branch_regulator_eq κ β a U z (hsecond rfl).1, + second_branch_regulator_le_one κ β a U z hβ (hsecond rfl).2⟩ + +/-- Threshold status for the actual stopping-time phase supplies the branch +bounds; no separate regulator assumption is needed. -/ +theorem phaseAt_regulator_eq_and_le_one {Ω ι : Type*} + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) (i : ι) + (hρ : Monotone (fun k => ρ (i,k) ω)) (t : ℝ≥0) + (κ β a U : ℝ) (hβ : 0 ≤ β) (z : ℂ × ℝ) + (hactive : phaseActive (phaseAt ρ t ω i)) + (hstart : ρ (i,0) ω ≤ t → 0 ≤ logFactorClock κ z-a) + (hbefore : t < ρ (i,1) ω → logFactorClock κ z-a ≤ U/2) + (hafter : ρ (i,1) ω ≤ t → U/2 ≤ logFactorClock κ z-a) + (hend : t < ρ (i,2) ω → logFactorClock κ z-a ≤ U) : + branchRegulator κ (phaseRegulatorScale β a U (phaseAt ρ t ω i)) + (phaseRegulatorSlope β (phaseAt ρ t ω i)) z = + regulator β U (logFactorClock κ z-a) ∧ + branchRegulator κ (phaseRegulatorScale β a U (phaseAt ρ t ω i)) + (phaseRegulatorSlope β (phaseAt ρ t ω i)) z ≤ 1 := by + apply phaseRegulator_eq_and_le_one κ β a U hβ _ hactive z + · intro h + obtain ⟨h0,h1⟩ := (phaseAt_first_iff ρ ω i hρ t).mp h + exact ⟨hstart h0,hbefore h1⟩ + · intro h + obtain ⟨h1,h2⟩ := (phaseAt_second_iff ρ ω i hρ t).mp h + exact ⟨hafter h1,hend h2⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalBudget.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..084ad2b7eb730bca3ae5d6b3211fe77340ab8cd0 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalBudget.lean @@ -0,0 +1,94 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhysicalGeometry +import OAI.Probability.SLE.Multipoint.MultipointLoewnerDrop + +namespace OAI + +/-! The actual physical-domain interaction budget. This statement uses +capacity-two time throughout: the radius clocks satisfy `R = b exp(-4u)`, +and the Green derivative has coefficient four. No bound on the derivative +of the original conformal map is assumed. -/ + +noncomputable section +open Set Metric Filter MeasureTheory Complex +open scoped Topology NNReal ComplexConjugate + +namespace SLEExactGauge + +/-- A conformal-radius upper bound suffices for geometric interaction +decay; the physical clock need not be specified by equality. -/ +theorem IsCapacityTwoWitness.physical_interaction_decay_of_radius_le + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (t : ℝ≥0) (z w : ℂ) (hz : z ∈ survivingDomain γ t) + (hw' : w ∈ survivingDomain γ t) (hne : z ≠ w) + (b a u : ℝ) (hb : b ≤ dist (J z) (J w)) + (hR : physicalConformalRadius J G t z ≤ b * Real.exp (-2 * a * u)) : + halfPlaneGreen (G t z) (G t w) ≤ Real.exp (-a * u) := by + let b' := physicalConformalRadius J G t z / Real.exp (-2 * a * u) + have hb' : b' ≤ dist (J z) (J w) := by + apply (div_le_iff₀ (Real.exp_pos _)).mpr + exact hR.trans (mul_le_mul_of_nonneg_right hb (Real.exp_pos _).le) + apply hw.physical_interaction_decay hgrowth J hJ hJinj t z w hz hw' hne b' a u hb' + exact (div_mul_cancel₀ _ (Real.exp_ne_zero _)).symm + +lemma halfPlaneGreen_symm (z w : ℂ) : halfPlaneGreen z w = halfPlaneGreen w z := by + have hn : ‖z - conj w‖ = ‖w - conj z‖ := by + calc + _ = ‖conj (z - conj w)‖ := (Complex.norm_conj _).symm + _ = ‖-(w - conj z)‖ := by + congr 1 + simp only [map_sub, Complex.conj_conj] + ring + _ = _ := norm_neg _ + unfold halfPlaneGreen + rw [norm_div, norm_div, hn, norm_sub_rev z w] + +/-- Both radius caps yield the decay in the maximum of the two clocks; +the proved Green drop then pays for every weighted interaction shell. -/ +theorem IsCapacityTwoWitness.physical_pair_interaction_budget + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (s T : ℝ≥0) (hsT : s ≤ T) (z w : ℂ) + (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) (hne : z ≠ w) + (bz bw : ℝ) (hbz : bz ≤ dist (J z) (J w)) (hbw : bw ≤ dist (J z) (J w)) + {c : ℝ} (hc : 0 ≤ c) (hca : 2 * c < 2) (u v : ℝ → ℝ) + (hu : ContinuousOn u (Icc (s : ℝ) (T : ℝ))) + (hv : ContinuousOn v (Icc (s : ℝ) (T : ℝ))) + (hu0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ u t) + (hv0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ v t) + (hRu : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + physicalConformalRadius J G t.toNNReal z ≤ bz * Real.exp (-4 * u t)) + (hRv : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + physicalConformalRadius J G t.toNNReal w ≤ bw * Real.exp (-4 * v t)) : + (∫ t in (s : ℝ)..(T : ℝ), Real.exp (c * (u t + v t)) * + (chartPoissonRate U G t.toNNReal z * chartPoissonRate U G t.toNNReal w)) ≤ + Multipoint.interactionBudget 2 c := by + have hdecay : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + halfPlaneGreen (G t.toNNReal z) (G t.toNNReal w) ≤ + Real.exp (-2 * max (u t) (v t)) := by + intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hzt := survivingDomain_antitone γ htT hz + have hwt := survivingDomain_antitone γ htT hw' + have hdz := hw.physical_interaction_decay_of_radius_le hgrowth J hJ hJinj t.toNNReal z w + hzt hwt hne bz 2 (u t) hbz (by + simpa only [show (-2 : ℝ) * 2 = -4 by norm_num] using hRu t ht) + have hdw := hw.physical_interaction_decay_of_radius_le hgrowth J hJ hJinj t.toNNReal w z + hwt hzt hne.symm bw 2 (v t) (by simpa only [dist_comm] using hbw) (by + simpa only [show (-2 : ℝ) * 2 = -4 by norm_num] using hRv t ht) + rw [halfPlaneGreen_symm (G t.toNNReal w) (G t.toNNReal z)] at hdw + exact Multipoint.interaction_decay_max hdz hdw + simpa only [one_mul] using hw.weighted_interaction_integral_le hU s T hsT z w hz hw' hne + (M := 1) zero_le_one hc hca u v hu hv hu0 hv0 + (by simpa only [one_mul] using hdecay) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalGeometry.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..476677144817a37af1a8dadf9b88e14f4882277e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalGeometry.lean @@ -0,0 +1,117 @@ +import OAI.Probability.SLE.Multipoint.MultipointGeometry + +namespace OAI + +/-! Disk uniformizations of the actual surviving physical domains. +The radius includes the derivative of the original conformal map, with +no uniform bound on that derivative. -/ + +noncomputable section +open Set Metric Filter +open scoped Topology NNReal + +namespace SLEExactGauge + +def physicalConformalRadius (J : ℂ → ℂ) (G : ℝ≥0 → ℂ → ℂ) + (t : ℝ≥0) (z : ℂ) : ℝ := ‖deriv J z‖ * fullRadius G t z + +def physicalDiskChart (J : ℂ → ℂ) (F G : ℝ≥0 → ℂ → ℂ) + (t : ℝ≥0) (z : ℂ) : ℂ → ℂ := J ∘ F t ∘ diskToHalfPlane (G t z) + +theorem IsCapacityTwoWitness.physical_disk_chart + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (h : IsCapacityTwoWitness U γ G F) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (t : ℝ≥0) (z : ℂ) (hz : z ∈ survivingDomain γ t) : + DifferentiableOn ℂ (physicalDiskChart J F G t z) (ball 0 1) ∧ + InjOn (physicalDiskChart J F G t z) (ball 0 1) ∧ + physicalDiskChart J F G t z 0 = J z ∧ + ‖deriv (physicalDiskChart J F G t z) 0‖ = physicalConformalRadius J G t z ∧ + ∀ w ∈ survivingDomain γ t, + physicalDiskChart J F G t z (halfPlaneToDisk (G t z) (G t w)) = J w := by + have hγ := h.1 + rcases h with ⟨_, _, _, hG, hF, hGmap, hFmap, hinv, hinv', _, _, _, _⟩ + have hy : 0 < (G t z).im := hGmap t hz + let f : ℂ → ℂ := F t ∘ diskToHalfPlane (G t z) + have hfd : DifferentiableOn ℂ f (ball 0 1) := + (hF t).comp (diskToHalfPlane_differentiable _) (diskToHalfPlane_maps hy) + have hfmap : MapsTo f (ball 0 1) upperHalfPlane := by + intro v hv + exact (hFmap t (diskToHalfPlane_maps hy hv)).1.1 + have hfi : InjOn f (ball 0 1) := by + intro v hv w hw he + apply diskToHalfPlane_injOn hy hv hw + have he' := congrArg (G t) he + change G t (F t (diskToHalfPlane (G t z) v)) = + G t (F t (diskToHalfPlane (G t z) w)) at he' + rwa [hinv' t _ (diskToHalfPlane_maps hy hv), + hinv' t _ (diskToHalfPlane_maps hy hw)] at he' + have hf0 : f 0 = z := by simp only [f, Function.comp_apply, diskToHalfPlane_zero, hinv t z hz] + have hdG := ((hG t).differentiableAt ((isOpen_survivingDomain hγ t).mem_nhds hz)).hasDerivAt + have hdF := ((hF t).differentiableAt (isOpen_upperHalfPlane.mem_nhds (hGmap t hz))).hasDerivAt + have hident : (fun v => F t (G t v)) =ᶠ[𝓝 z] (fun v => v) := by + filter_upwards [(isOpen_survivingDomain hγ t).mem_nhds hz] with v hv + exact hinv t v hv + have hprod : deriv (F t) (G t z) * deriv (G t) z = 1 := + ((hdF.comp z hdG).congr_of_eventuallyEq hident.symm).unique (hasDerivAt_id z) + have hnormprod : ‖deriv (F t) (G t z)‖ * ‖deriv (G t) z‖ = 1 := by + simpa only [norm_mul, norm_one] using congrArg norm hprod + have hgn : ‖deriv (G t) z‖ ≠ 0 := by + intro he + rw [he, mul_zero] at hnormprod + norm_num at hnormprod + have hdF' : HasDerivAt (F t) (deriv (F t) (G t z)) (diskToHalfPlane (G t z) 0) := by + simpa only [diskToHalfPlane_zero] using hdF + have hdf : HasDerivAt f (deriv (F t) (G t z) * (G t z-star (G t z))) 0 := + hdF'.comp 0 (diskToHalfPlane_deriv_zero _) + have hfrad : ‖deriv f 0‖ = fullRadius G t z := by + rw [hdf.deriv, norm_mul, norm_sub_conj_of_im_pos hy, fullRadius] + apply (eq_div_iff hgn).mpr + nlinarith [hnormprod] + have hdJ := (hJ.differentiableAt (isOpen_upperHalfPlane.mem_nhds hz.1.1)).hasDerivAt + have hdcomp : HasDerivAt (J ∘ f) (deriv J z * deriv f 0) 0 := by + have hdJ' : HasDerivAt J (deriv J z) (f 0) := by rwa [hf0] + have hh := hdJ'.comp 0 hdf + simpa only [hdf.deriv] using hh + refine ⟨hJ.comp hfd hfmap, hJinj.comp hfi hfmap, ?_, ?_, ?_⟩ + · exact congrArg J hf0 + · change ‖deriv (J ∘ f) 0‖ = _ + rw [hdcomp.deriv, norm_mul, hfrad] + rfl + · intro w hw + dsimp only [physicalDiskChart, Function.comp_apply] + rw [diskToHalfPlane_halfPlaneToDisk hy (hGmap t hw), hinv t w hw] + +theorem IsCapacityTwoWitness.physical_interaction_decay + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (h : IsCapacityTwoWitness U γ G F) + (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (t : ℝ≥0) (z w : ℂ) (hz : z ∈ survivingDomain γ t) + (hw : w ∈ survivingDomain γ t) (hne : z ≠ w) + (b a u : ℝ) (hb : b ≤ dist (J z) (J w)) + (hR : physicalConformalRadius J G t z = b*Real.exp (-2*a*u)) : + halfPlaneGreen (G t z) (G t w) ≤ Real.exp (-a*u) := by + obtain ⟨hfd, hfi, hf0, hfrad, hfpoint⟩ := h.physical_disk_chart J hJ hJinj t z hz + let ξ := halfPlaneToDisk (G t z) (G t w) + have hξ : ξ ∈ ball (0 : ℂ) 1 := + halfPlaneToDisk_maps (h.imag_positive t z hz) (h.imag_positive t w hw) + have hξ0 : ξ ≠ 0 := by + intro he + have hv := hfpoint w hw + change physicalDiskChart J F G t z ξ = J w at hv + rw [he, hf0] at hv + exact hne (hJinj hz.1.1 hw.1.1 hv) + rw [halfPlaneGreen_eq_disk] + apply Multipoint.disk_interaction_decay hgrowth _ hfd hfi ξ hξ hξ0 b a u + · rw [hfpoint w hw, hf0, norm_sub_rev, ← dist_eq_norm] + exact hb + · exact hfrad.trans hR + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalHits.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalHits.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ed109d8bb522265cf61dee733ebe2fbb1162e97 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalHits.lean @@ -0,0 +1,79 @@ +import OAI.Probability.SLE.Multipoint.MultipointRadiusStatus + +namespace OAI + +/-! The finite-radius-stop event is exactly the physical conformal-radius +hit event in the original conformal domain. -/ + +noncomputable section +open Set Filter +open scoped NNReal ENNReal + +namespace SLEExactGauge + +private lemma physical_radius_level_value + (J : ℂ → ℂ) (z : ℂ) (R e : ℝ) (hR : 0 < R) (he : 0 < e) + (hRdef : R = 2*z.im*‖deriv J z‖) : + ‖deriv J z‖ * ((2*z.im)*Real.exp (-Real.log (R/e))) = e := by + have hexp : Real.exp (-Real.log (R/e)) = e/R := by + rw [Real.exp_neg, Real.exp_log (div_pos hR he)] + field_simp [hR.ne',he.ne'] + have hcoef : ‖deriv J z‖*(2*z.im) = R := by rw [hRdef]; ring + rw [hexp,← mul_assoc,hcoef] + field_simp [hR.ne'] + +theorem physical_radius_eq_hit_iff_finite_level + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (J : ℂ → ℂ) (z : ℂ) (R e : ℝ) (hR : 0 < R) (he : 0 < e) + (hRdef : R = 2*z.im*‖deriv J z‖) : + (∃ t : ℝ≥0, z ∈ survivingDomain γ t ∧ physicalConformalRadius J G t z = e) ↔ + radiusLevelTime γ G z (Real.log (R/e)) < ⊤ := by + have hc : 0 < ‖deriv J z‖ := by + by_contra hn + have hz : ‖deriv J z‖ = 0 := le_antisymm (le_of_not_gt hn) (norm_nonneg _) + rw [hz,mul_zero] at hRdef + linarith + have htarget := physical_radius_level_value J z R e hR he hRdef + constructor + · rintro ⟨t,ht,htR⟩ + have hfull : fullRadius G t z = (2*z.im)*Real.exp (-Real.log (R/e)) := + (mul_left_cancel₀ hc.ne') (htR.trans htarget.symm) + rw [radiusLevelTime_eq_of_live_level hU hw z (Real.log (R/e)) t ht hfull] + exact ENNReal.coe_lt_top + · intro hf + obtain ⟨t,ht,htR⟩ := exists_live_level_of_radiusLevelTime_lt_top γ G z (Real.log (R/e)) hf + exact ⟨t,ht,by rw [physicalConformalRadius,htR]; exact htarget⟩ + +theorem physical_radius_hit_iff_finite_level + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (J : ℂ → ℂ) (z : ℂ) (R e : ℝ) (hR : 0 < R) (he : 0 < e) (heR : e ≤ R) + (hRdef : R = 2*z.im*‖deriv J z‖) : + (∃ t : ℝ≥0, z ∈ survivingDomain γ t ∧ physicalConformalRadius J G t z ≤ e) ↔ + radiusLevelTime γ G z (Real.log (R/e)) < ⊤ := by + constructor + · rintro ⟨t,ht,htR⟩ + rcases lt_or_eq_of_le htR with hlt | heq + · have hc : 0 < ‖deriv J z‖ := by + by_contra hn + have hz : ‖deriv J z‖ = 0 := le_antisymm (le_of_not_gt hn) (norm_nonneg _) + rw [hz,mul_zero] at hRdef + linarith + have hlog : 0 ≤ Real.log (R/e) := Real.log_nonneg + ((le_div_iff₀ he).mpr (by simpa only [one_mul] using heR)) + have htarget := physical_radius_level_value J z R e hR he hRdef + apply radiusLevelTime_finite_of_live_radius_lt hU hw z (Real.log (R/e)) hlog t ht + apply (mul_lt_mul_iff_right₀ hc).mp + exact hlt.trans_eq htarget.symm + · exact (physical_radius_eq_hit_iff_finite_level hU hw J z R e hR he hRdef).mp + ⟨t,ht,heq⟩ + · intro hf + obtain ⟨t,ht,hR⟩ := (physical_radius_eq_hit_iff_finite_level hU hw J z R e hR he hRdef).mpr hf + exact ⟨t,ht,hR.le⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalProbability.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9124d0ac23f3041735c639c32fda5a454327bd5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPhysicalProbability.lean @@ -0,0 +1,113 @@ +import OAI.Probability.SLE.Multipoint.MultipointActualProbability +import OAI.Probability.SLE.Multipoint.MultipointPhysicalHits +import OAI.Probability.SLE.Multipoint.MultipointBudgetMonotone + +namespace OAI + +/-! Physical-domain multipoint approach bounds, including arbitrary +positive targets through the paper's capped product. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace SLEExactGauge.Multipoint + +theorem physical_radius_multipoint_bound + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (R b e : ι → ℝ) (he : ∀ i, 0 < e i) (heb : ∀ i, e i ≤ b i) + (hbR : ∀ i, b i ≤ R i) (hRdef : ∀ i, R i = 2*(z i).im*‖deriv J (z i)‖) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (J (z i)) (J (z j))) : + P {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (G ω) t (z i) ≤ e i} ≤ + ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) * + ∏ i, (e i/b i)^(1-κ/8)) := by + have heq : {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (G ω) t (z i) ≤ e i} = + {ω | ∀ i, radiusLevelTime (γ ω) (G ω) (z i) (Real.log (R i/e i)) < ⊤} := by + ext ω + apply forall_congr' + intro i + exact physical_radius_hit_iff_finite_level (continuous_const.mul (hBc ω)) (hw ω) + J (z i) (R i) (e i) ((he i).trans_le ((heb i).trans (hbR i))) (he i) + ((heb i).trans (hbR i)) (hRdef i) + rw [heq] + exact actual_radius_multipoint_bound hB hm hBm hBc hB0 hκ hκ8 γ G F hw hgrowth J + hJ hJinj z hz hne R b e he heb hbR hRdef hsep + +theorem capped_physical_radius_multipoint_bound + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hBm : Measurable (Function.uncurry B)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (hgrowth : PublishedDiskUnivalentGrowth) (J : ℂ → ℂ) + (hJ : DifferentiableOn ℂ J upperHalfPlane) (hJinj : InjOn J upperHalfPlane) + (z : ι → ℂ) (hz : ∀ i, z i ∈ upperHalfPlane) (hne : Function.Injective z) + (R b e : ι → ℝ) (he : ∀ i, 0 < e i) (hb : ∀ i, 0 < b i) + (hbR : ∀ i, b i ≤ R i) (hRdef : ∀ i, R i = 2*(z i).im*‖deriv J (z i)‖) + (hsep : ∀ i j, i ≠ j → b i ≤ dist (J (z i)) (J (z j))) : + P {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (G ω) t (z i) ≤ e i} ≤ + ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι) * + Real.exp (uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι)) * + ∏ i, min 1 ((e i/b i)^(1-κ/8))) := by + classical + let I := Finset.univ.filter (fun i => e i ≤ b i) + let f : I ↪ ι := Function.Embedding.subtype _ + have himage : (Finset.univ : Finset I).map f = I := by + ext i + simp only [Finset.mem_map,Finset.mem_univ,true_and] + exact ⟨fun ⟨j,hj⟩ => hj ▸ j.property,fun hi => ⟨⟨i,hi⟩,rfl⟩⟩ + have hsmall := physical_radius_multipoint_bound hB hm hBm hBc hB0 hκ hκ8 γ G F hw + hgrowth J hJ hJinj (fun i : I => z i) (fun i => hz i) + (fun i j hij => Subtype.ext (hne hij)) (fun i : I => R i) (fun i : I => b i) + (fun i : I => e i) (fun i => he i) (fun i => (Finset.mem_filter.mp i.property).2) + (fun i => hbR i) (fun i => hRdef i) + (fun i j hij => hsep i j (fun h => hij (Subtype.ext h))) + have hsub : {ω | ∀ i, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (G ω) t (z i) ≤ e i} ⊆ + {ω | ∀ i : I, ∃ t : ℝ≥0, z i ∈ survivingDomain (γ ω) t ∧ + physicalConformalRadius J (G ω) t (z i) ≤ e i} := fun _ h i => h i + apply (measure_mono hsub).trans (hsmall.trans (ENNReal.ofReal_le_ofReal ?_)) + have hK : uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset I) ≤ + uniformDiscountBudget κ (sourceBeta κ) (Finset.univ : Finset ι) := by + rw [← uniformDiscountBudget_map κ (sourceBeta κ) f,himage] + exact uniformDiscountBudget_mono hκ hκ8 (Finset.subset_univ I) + have hcard : Fintype.card I ≤ Fintype.card ι := by + simpa only [Fintype.card_coe,Finset.card_univ] using Finset.card_le_card (Finset.subset_univ I) + have hα : 0 ≤ 1-κ/8 := by linarith + have hprod : (∏ i : I, (e i/b i)^(1-κ/8)) = ∏ i, min 1 ((e i/b i)^(1-κ/8)) := by + rw [Finset.prod_coe_sort I (fun i : ι => (e i/b i)^(1-κ/8))] + dsimp only [I] + rw [Finset.prod_filter] + apply Finset.prod_congr rfl + intro i _ + by_cases hi : e i ≤ b i + · rw [ite_eq_left hi,min_eq_right (Real.rpow_le_one (div_nonneg (he i).le (hb i).le) + ((div_le_one (hb i)).mpr hi) hα)] + · rw [ite_eq_right hi,min_eq_left (Real.one_le_rpow + ((one_le_div (hb i)).mpr (le_of_not_ge hi)) hα)] + rw [← hprod] + apply mul_le_mul_of_nonneg_right _ (Finset.prod_nonneg (fun (i : I) _ => Real.rpow_nonneg + (div_nonneg (he i).le (hb i).le) _)) + exact mul_le_mul (pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 3) hcard) + (Real.exp_le_exp.mpr hK) (Real.exp_pos _).le (by positivity) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointPiecewiseClock.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointPiecewiseClock.lean new file mode 100644 index 0000000000000000000000000000000000000000..f590ff289d2ccacf5d31728d1b87db518a2e0f02 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointPiecewiseClock.lean @@ -0,0 +1,294 @@ +import OAI.Probability.SLE.Geometry.FiniteStopSorting +import OAI.Probability.SLE.Multipoint.MultipointDiscountClock +import OAI.Probability.SLE.Multipoint.MultipointSwitchPatterns +import Mathlib.MeasureTheory.Integral.IntervalIntegral.LebesgueDifferentiationThm + +namespace OAI + +/-! Bounded discount rates selected at finitely many stopping-time switches. +The rate may jump at the switches; its accumulated clock is adapted and +Lipschitz, and its derivative agrees with the rate almost everywhere. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal BigOperators + +namespace SLEExactGauge.Multipoint + +/-- Sorting all raw switches leaves no original switch strictly between +successive entries, including when some entries coincide. -/ +lemma sortedStopAt_no_intermediate {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H) (σ : Ω → ℝ≥0) (hσ : σ ∈ l) + (n : ℕ) (ω : Ω) (hn : sortedStopAt l H n ω < σ ω) : + sortedStopAt l H (n+1) ω ≤ σ ω := by + obtain ⟨k, _, hk⟩ := sortedStopAt_covers l H σ hσ ω + have hnk : n+1 ≤ k := by + by_contra h + have hkn : k ≤ n := by omega + have hc := sortedStopAt_monotone l H hl ω hkn + change sortedStopAt l H k ω ≤ sortedStopAt l H n ω at hc + rw [hk] at hc + exact (not_le_of_gt hn) hc + exact (sortedStopAt_monotone l H hl ω hnk).trans_eq hk + +lemma sortedStopAt_reached_iff {Ω : Type*} (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hl : ∀ σ ∈ l, ∀ ω, σ ω ≤ H) (σ : Ω → ℝ≥0) (hσ : σ ∈ l) + (n : ℕ) (ω : Ω) (t : ℝ≥0) (hnt : sortedStopAt l H n ω ≤ t) + (ht : t < sortedStopAt l H (n+1) ω) : + σ ω ≤ t ↔ σ ω ≤ sortedStopAt l H n ω := by + constructor + · intro hσt + by_contra h + have hnext := sortedStopAt_no_intermediate l H hl σ hσ n ω (lt_of_not_ge h) + exact (not_le_of_gt ht) (hnext.trans hσt) + · exact fun h => h.trans hnt + +def stoppedBranchRate {Ω : Type*} (σ τ : Ω → ℝ≥0) (A : Set Ω) + (g : ℝ≥0 → Ω → ℝ) (t : ℝ≥0) (ω : Ω) : ℝ := by + classical + exact if ω ∈ A ∧ σ ω ≤ t ∧ t < τ ω then g t ω else 0 + +lemma stoppedBranchRate_measurable {Ω : Type*} [MeasurableSpace Ω] + (σ τ : Ω → ℝ≥0) (hσ : Measurable σ) (hτ : Measurable τ) + (A : Set Ω) (hA : MeasurableSet A) (g : ℝ≥0 → Ω → ℝ) + (hg : Measurable (Function.uncurry g)) : + Measurable (Function.uncurry (stoppedBranchRate σ τ A g)) := by + have hstart : MeasurableSet {p : ℝ≥0 × Ω | σ p.2 ≤ p.1} := + measurableSet_le (hσ.comp measurable_snd) measurable_fst + have hend : MeasurableSet {p : ℝ≥0 × Ω | p.1 < τ p.2} := + measurableSet_lt measurable_fst (hτ.comp measurable_snd) + exact Measurable.ite ((hA.preimage measurable_snd).inter (hstart.inter hend)) + hg measurable_const + +/-- A branch known at its starting stop gives a measurable stochastic +interval on every finite deterministic horizon. -/ +lemma stoppedBranch_start_measurable {Ω : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (σ : Ω → ℝ≥0) + (hσ : IsStoppingTime ℱ (fun ω => (σ ω : WithTop ℝ≥0))) + (A : Set Ω) (hA : MeasurableSet[hσ.measurableSpace] A) (T : ℝ≥0) : + MeasurableSet[Subtype.instMeasurableSpace.prod (ℱ T)] + {p : Iic T × Ω | p.2 ∈ A ∧ σ p.2 ≤ p.1} := by + let : MeasurableSpace Ω := ℱ T + have hAT : MeasurableSet (A ∩ {ω | σ ω ≤ T}) := by + simpa only [WithTop.coe_le_coe] using hA.2 T + have hσT : Measurable (fun ω => min (σ ω) T) := by + have hm := ((hσ.min_const T).measurable_of_le + (fun ω => min_le_right (σ ω : WithTop ℝ≥0) T)).untopD 0 + simpa only [← WithTop.coe_min, WithTop.untopD_coe] using hm + have he : {p : Iic T × Ω | p.2 ∈ A ∧ σ p.2 ≤ p.1} = + {p : Iic T × Ω | p.2 ∈ A ∩ {ω | σ ω ≤ T}} ∩ + {p : Iic T × Ω | min (σ p.2) T ≤ p.1} := by + ext p + constructor + · rintro ⟨hA, hs⟩ + exact ⟨⟨hA, hs.trans p.1.prop⟩, (min_le_left _ _).trans hs⟩ + · rintro ⟨⟨hA, hsT⟩, hs⟩ + change σ p.2 ≤ T at hsT + change min (σ p.2) T ≤ (p.1 : ℝ≥0) at hs + exact ⟨hA, by simpa only [min_eq_left hsT] using hs⟩ + rw [he] + exact (hAT.preimage measurable_snd).inter + (measurableSet_le (hσT.comp measurable_snd) + (measurable_subtype_coe.comp measurable_fst)) + +lemma stoppedBranchRate_progressive {Ω : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (σ τ : Ω → ℝ≥0) + (hσ : IsStoppingTime ℱ (fun ω => (σ ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) + (A : Set Ω) (hA : MeasurableSet[hσ.measurableSpace] A) + (g : ℝ≥0 → Ω → ℝ) (hg : IsProgressive ℱ g) : + IsProgressive ℱ (stoppedBranchRate σ τ A g) := by + intro T + have hs := stoppedBranch_start_measurable ℱ σ hσ A hA T + have ht := stoppedBranch_start_measurable ℱ τ hτ univ MeasurableSet.univ T + have ht' : MeasurableSet[Subtype.instMeasurableSpace.prod (ℱ T)] + {p : Iic T × Ω | (p.1 : ℝ≥0) < τ p.2} := by + convert ht.compl using 1 + ext p + simp only [mem_compl_iff, mem_ofPred_eq, mem_univ, true_and, not_le] + have he : {p : Iic T × Ω | p.2 ∈ A ∧ σ p.2 ≤ p.1 ∧ (p.1 : ℝ≥0) < τ p.2} = + {p : Iic T × Ω | p.2 ∈ A ∧ σ p.2 ≤ p.1} ∩ + {p : Iic T × Ω | (p.1 : ℝ≥0) < τ p.2} := by + ext p + simp only [mem_inter_iff, mem_ofPred_eq, and_assoc] + apply Measurable.ite _ (hg T) measurable_const + rw [he] + exact hs.inter ht' + +lemma stoppedBranchRate_norm_le {Ω : Type*} (σ τ : Ω → ℝ≥0) (A : Set Ω) + (g : ℝ≥0 → Ω → ℝ) (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (t : ℝ≥0) (ω : Ω) : + |stoppedBranchRate σ τ A g t ω| ≤ C := by + unfold stoppedBranchRate + split_ifs + · exact hC t ω + · simpa only [abs_zero] using C.coe_nonneg + +lemma stoppedBranchRate_nonneg {Ω : Type*} (σ τ : Ω → ℝ≥0) (A : Set Ω) + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ t ω, 0 ≤ g t ω) (t : ℝ≥0) (ω : Ω) : + 0 ≤ stoppedBranchRate σ τ A g t ω := by + unfold stoppedBranchRate + split_ifs + · exact hg t ω + · exact le_rfl + +/-- Local integrability of a bounded measurable rate, without continuity. -/ +lemma bounded_rate_locallyIntegrable {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Measurable (fun t => g t ω)) + (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (ω : Ω) : + LocallyIntegrable (fun u : ℝ => g u.toNNReal ω) volume := by + have hc : LocallyIntegrable (fun _ : ℝ => (C : ℝ)) volume := + continuous_const.locallyIntegrable + apply hc.mono ((hg ω).comp continuous_real_toNNReal.measurable).aestronglyMeasurable + filter_upwards [] with u + simpa only [Function.comp_apply, Real.norm_eq_abs, abs_of_nonneg C.coe_nonneg] + using hC u.toNNReal ω + +lemma discountClock_lipschitz_of_measurable {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Measurable (fun t => g t ω)) + (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (ω : Ω) : + LipschitzWith C (fun t => discountClock g t ω) := by + have hi (a b : ℝ) : IntervalIntegrable (fun u : ℝ => g u.toNNReal ω) volume a b := + ((bounded_rate_locallyIntegrable g hg C hC ω).integrableOn_isCompact + isCompact_uIcc).intervalIntegrable + apply LipschitzWith.of_dist_le_mul + intro s t + rw [Real.dist_eq, ← Real.norm_eq_abs] + unfold discountClock + rw [intervalIntegral.integral_interval_sub_left (hi _ _) (hi _ _)] + have hb := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (t.toNNReal : ℝ)) (b := (s.toNNReal : ℝ)) (C := (C : ℝ)) + (f := fun u : ℝ => g u.toNNReal ω) + (fun u _ => by simpa only [Real.norm_eq_abs] using hC u.toNNReal ω) + apply hb.trans + apply mul_le_mul_of_nonneg_left _ C.coe_nonneg + have ht := Real.lipschitzWith_toNNReal.dist_le_mul s t + simpa only [NNReal.dist_eq, Real.dist_eq, NNReal.coe_one, one_mul] using ht + +lemma discountClock_increment_of_measurable {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Measurable (fun t => g t ω)) + (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (s t : ℝ≥0) (ω : Ω) : + discountClock g t ω - discountClock g s ω = + ∫ u in (s : ℝ)..(t : ℝ), g u.toNNReal ω := by + have hi (a b : ℝ) : IntervalIntegrable (fun u : ℝ => g u.toNNReal ω) volume a b := + ((bounded_rate_locallyIntegrable g hg C hC ω).integrableOn_isCompact + isCompact_uIcc).intervalIntegrable + simp only [discountClock, Real.toNNReal_coe] + exact intervalIntegral.integral_interval_sub_left (hi _ _) (hi _ _) + +lemma discountClock_ae_derivative {Ω : Type*} + (g : ℝ≥0 → Ω → ℝ) (hg : ∀ ω, Measurable (fun t => g t ω)) + (C : ℝ≥0) (hC : ∀ t ω, |g t ω| ≤ C) (ω : Ω) : + ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => discountClock g u ω) (g t.toNNReal ω) t := by + filter_upwards [LocallyIntegrable.ae_hasDerivAt_integral (bounded_rate_locallyIntegrable g hg C hC ω)] + with t ht + intro ht0 + apply (ht 0).congr_of_eventuallyEq + filter_upwards [eventually_gt_nhds ht0] with u hu + simp only [discountClock, Real.coe_toNNReal u hu.le] + +lemma discountClock_adapted_of_progressive {Ω : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (g : ℝ≥0 → Ω → ℝ) (hg : IsProgressive ℱ g) : + Adapted ℱ (fun t : ℝ≥0 => discountClock g t) := by + intro t + let : MeasurableSpace Ω := ℱ t + have htime : Measurable (fun u : ℝ => + (⟨min u.toNNReal t, by change min u.toNNReal t ≤ t; exact min_le_right _ _⟩ : Iic t)) := + ((continuous_real_toNNReal.min continuous_const).measurable).subtype_mk + have hgm : Measurable (fun p : ℝ × Ω => g (min p.1.toNNReal t) p.2) := + (hg t).comp ((htime.comp measurable_fst).prodMk measurable_snd) + have hm := (cumulative_integral_measurable (fun u ω => g (min u.toNNReal t) ω) hgm).comp + (measurable_const.prodMk measurable_id : Measurable (fun ω : Ω => (t, ω))) + convert hm using 1 + funext ω + simp only [discountClock, Real.toNNReal_coe, Function.comp_def] + apply intervalIntegral.integral_congr + intro u hu + rw [uIcc_of_le t.coe_nonneg] at hu + have hut : u.toNNReal ≤ t := by + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal hu.2 + change g u.toNNReal ω = g (min u.toNNReal t) ω + rw [min_eq_left hut] + +/-- The finite index may comprise a stage and its finite past-measurable +pattern. Empty or simultaneous stages contribute zero. -/ +def finiteSwitchRate {Ω ι : Type*} (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (A : ι → Set Ω) (g : ι → ℝ≥0 → Ω → ℝ) (t : ℝ≥0) (ω : Ω) : ℝ := + ∑ i ∈ s, stoppedBranchRate (σ i) (τ i) (A i) (g i) t ω + +lemma finiteSwitchRate_measurable {Ω ι : Type*} [MeasurableSpace Ω] + (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (hσ : ∀ i ∈ s, Measurable (σ i)) (hτ : ∀ i ∈ s, Measurable (τ i)) + (A : ι → Set Ω) (hA : ∀ i ∈ s, MeasurableSet (A i)) + (g : ι → ℝ≥0 → Ω → ℝ) (hg : ∀ i ∈ s, Measurable (Function.uncurry (g i))) : + Measurable (Function.uncurry (finiteSwitchRate s σ τ A g)) := by + exact Finset.measurable_sum s (fun i hi => + stoppedBranchRate_measurable (σ i) (τ i) (hσ i hi) (hτ i hi) (A i) (hA i hi) + (g i) (hg i hi)) + +lemma finiteSwitchRate_progressive {Ω ι : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (hσ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (σ i ω : WithTop ℝ≥0))) + (hτ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (τ i ω : WithTop ℝ≥0))) + (A : ι → Set Ω) (hA : ∀ (i) (hi : i ∈ s), MeasurableSet[(hσ i hi).measurableSpace] (A i)) + (g : ι → ℝ≥0 → Ω → ℝ) (hg : ∀ i ∈ s, IsProgressive ℱ (g i)) : + IsProgressive ℱ (finiteSwitchRate s σ τ A g) := by + intro T + exact Finset.measurable_sum s (fun i hi => + stoppedBranchRate_progressive ℱ (σ i) (τ i) (hσ i hi) (hτ i hi) + (A i) (hA i hi) (g i) (hg i hi) T) + +lemma finiteSwitchRate_norm_le {Ω ι : Type*} (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (A : ι → Set Ω) (g : ι → ℝ≥0 → Ω → ℝ) (C : ι → ℝ≥0) + (hC : ∀ i ∈ s, ∀ t ω, |g i t ω| ≤ C i) (t : ℝ≥0) (ω : Ω) : + |finiteSwitchRate s σ τ A g t ω| ≤ (∑ i ∈ s, C i : ℝ≥0) := by + unfold finiteSwitchRate + apply (Finset.abs_sum_le_sum_abs _ _).trans + simpa only [NNReal.coe_sum] using Finset.sum_le_sum (fun i hi => + stoppedBranchRate_norm_le (σ i) (τ i) (A i) (g i) (C i) (hC i hi) t ω) + +lemma finiteSwitchRate_nonneg {Ω ι : Type*} (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (A : ι → Set Ω) (g : ι → ℝ≥0 → Ω → ℝ) + (hg : ∀ i ∈ s, ∀ t ω, 0 ≤ g i t ω) (t : ℝ≥0) (ω : Ω) : + 0 ≤ finiteSwitchRate s σ τ A g t ω := by + exact Finset.sum_nonneg (fun i hi => + stoppedBranchRate_nonneg (σ i) (τ i) (A i) (g i) (hg i hi) t ω) + +/-- The state used by the smooth-field adapter. No differentiability of +rates at switching times is required. -/ +theorem finiteSwitchClock_regular {Ω ι : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (s : Finset ι) (σ τ : ι → Ω → ℝ≥0) + (hσ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (σ i ω : WithTop ℝ≥0))) + (hτ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (τ i ω : WithTop ℝ≥0))) + (A : ι → Set Ω) (hA : ∀ (i) (hi : i ∈ s), MeasurableSet[(hσ i hi).measurableSpace] (A i)) + (g : ι → ℝ≥0 → Ω → ℝ) + (hgm : ∀ i ∈ s, Measurable (Function.uncurry (g i))) + (hgp : ∀ i ∈ s, IsProgressive ℱ (g i)) + (C : ι → ℝ≥0) (hC : ∀ i ∈ s, ∀ t ω, |g i t ω| ≤ C i) : + let R := finiteSwitchRate s σ τ A g + Measurable (fun p : ℝ × Ω => discountClock R p.1 p.2) ∧ + Adapted ℱ (fun t : ℝ≥0 => discountClock R t) ∧ + (∀ ω, LipschitzWith (∑ i ∈ s, C i) (fun t => discountClock R t ω)) ∧ + (∀ ω, ∀ᵐ t : ℝ, 0 < t → + HasDerivAt (fun u => discountClock R u ω) (R t.toNNReal ω) t) ∧ + ∀ ω, discountClock R 0 ω = 0 := by + let R := finiteSwitchRate s σ τ A g + have hAm (i : ι) (hi : i ∈ s) : MeasurableSet (A i) := + (hσ i hi).measurableSpace_le _ (hA i hi) + have hRm : Measurable (Function.uncurry R) := finiteSwitchRate_measurable s σ τ + (fun i hi => stopping_time_measurable_nnreal (hσ i hi)) + (fun i hi => stopping_time_measurable_nnreal (hτ i hi)) A hAm g hgm + have hRt : ∀ ω, Measurable (fun t => R t ω) := fun ω => + hRm.comp (measurable_id.prodMk measurable_const) + have hbound := finiteSwitchRate_norm_le s σ τ A g C hC + exact ⟨discountClock_measurable R hRm, + discountClock_adapted_of_progressive ℱ R + (finiteSwitchRate_progressive ℱ s σ τ hσ hτ A hA g hgp), + discountClock_lipschitz_of_measurable R hRt _ hbound, + discountClock_ae_derivative R hRt _ hbound, + discountClock_initial R⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointProductCalculus.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointProductCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..bff46989797cc7c40511f114dcfbd9b72332514e --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointProductCalculus.lean @@ -0,0 +1,115 @@ +import OAI.Probability.SLE.Multipoint.MultipointAbsorption + +namespace OAI + +/-! Relative derivatives of the finite product used in the multipoint +supermartingale. The off-diagonal sum is ordered, so its generator carries +the factor one half. -/ + +noncomputable section +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +lemma finite_product_hasDerivAt_relative {ι : Type*} [DecidableEq ι] + (s : Finset ι) (f : ι → ℝ → ℝ) (df : ι → ℝ) (x : ℝ) + (hf : ∀ i ∈ s, HasDerivAt (f i) (df i) x) + (hne : ∀ i ∈ s, f i x ≠ 0) : + HasDerivAt (fun y => ∏ i ∈ s, f i y) + ((∏ i ∈ s, f i x)*(∑ i ∈ s, df i/f i x)) x := by + apply (HasDerivAt.fun_finsetProd hf).congr_deriv + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + simp only [smul_eq_mul] + rw [← Finset.mul_prod_erase s (fun i => f i x) hi] + field_simp [hne i hi] + +lemma sum_offDiag_mul {ι : Type*} [DecidableEq ι] + (s : Finset ι) (b : ι → ℝ) : + (∑ ij ∈ s.offDiag, b ij.1*b ij.2) = + (∑ i ∈ s, b i)^2 - ∑ i ∈ s, (b i)^2 := by + have he := Finset.sum_union (f := fun ij : ι × ι => b ij.1*b ij.2) + (Finset.disjoint_diag_offDiag (s := s)) + rw [Finset.diag_union_offDiag, Finset.sum_product, ← Finset.sum_mul_sum, ← pow_two] at he + have hdiag : (∑ ij ∈ s.diag, b ij.1*b ij.2) = ∑ i ∈ s, (b i)^2 := by + simp only [Finset.diag, Finset.sum_map, Function.Embedding.coeFn_mk, Function.diag_apply, + pow_two] + rw [hdiag] at he + linarith + +lemma finite_product_second_relative {ι : Type*} [DecidableEq ι] + (s : Finset ι) (f : ι → ℝ → ℝ) + (hf : ∀ i ∈ s, Differentiable ℝ (f i)) + (hdf : ∀ i ∈ s, Differentiable ℝ (deriv (f i))) + (hne : ∀ y i, i ∈ s → f i y ≠ 0) (x : ℝ) : + iteratedDeriv 2 (fun y => ∏ i ∈ s, f i y) x = + (∏ i ∈ s, f i x)*((∑ i ∈ s, iteratedDeriv 2 (f i) x/f i x) + + ∑ ij ∈ s.offDiag, (deriv (f ij.1) x/f ij.1 x)*(deriv (f ij.2) x/f ij.2 x)) := by + let P := fun y => ∏ i ∈ s, f i y + let b := fun i y => deriv (f i) y/f i y + have hP (y : ℝ) : HasDerivAt P (P y*∑ i ∈ s, b i y) y := + finite_product_hasDerivAt_relative s f (fun i => deriv (f i) y) y + (fun i hi => (hf i hi y).hasDerivAt) (hne y) + have hPeq : deriv P = fun y => P y*∑ i ∈ s, b i y := + funext (fun y => (hP y).deriv) + have hb (i : ι) (hi : i ∈ s) : HasDerivAt (b i) + (iteratedDeriv 2 (f i) x/f i x-(b i x)^2) x := by + apply (((hdf i hi x).hasDerivAt).div (hf i hi x).hasDerivAt (hne x i hi)).congr_deriv + simp only [iteratedDeriv_succ, iteratedDeriv_zero, b] + field_simp [hne x i hi] + have hsum := HasDerivAt.fun_sum (fun i hi => hb i hi) + have hsecond := ((hP x).mul hsum).deriv + change deriv (fun y => P y * ∑ i ∈ s, b i y) x = _ at hsecond + change iteratedDeriv (1+1) P x = _ + rw [iteratedDeriv_succ, iteratedDeriv_one] + rw [hPeq, hsecond] + rw [sum_offDiag_mul s (fun i => deriv (f i) x / f i x), Finset.sum_sub_distrib] + dsimp only [P, b] + ring + +lemma finite_product_directional_relative {ι E : Type*} [DecidableEq ι] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (s : Finset ι) (f : ι → E → ℝ) (z v : E) + (hf : ∀ i ∈ s, DifferentiableAt ℝ (f i) z) + (hne : ∀ i ∈ s, f i z ≠ 0) : + (fderiv ℝ (fun z => ∏ i ∈ s, f i z) z) v = + (∏ i ∈ s, f i z)*(∑ i ∈ s, (fderiv ℝ (f i) z) v/f i z) := by + rw [fderiv_finsetProd hf, sum_apply, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + simp only [smul_apply, smul_eq_mul] + rw [← Finset.mul_prod_erase s (fun i => f i z) hi] + field_simp [hne i hi] + +/-- Generator identity before estimating the individual and cross terms. -/ +theorem finite_product_generator {ι E : Type*} [DecidableEq ι] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (s : Finset ι) (F : ι → E → ℝ → ℝ) + (hF : ∀ i ∈ s, ContDiff ℝ (⊤ : ℕ∞) (fun p : E × ℝ => F i p.1 p.2)) + (hne : ∀ i ∈ s, ∀ z x, F i z x ≠ 0) (z v : E) (x : ℝ) : + (fderiv ℝ (fun z => ∏ i ∈ s, F i z x) z) v + + (1/2 : ℝ)*iteratedDeriv 2 (fun y => ∏ i ∈ s, F i z y) x = + (∏ i ∈ s, F i z x)* + ((∑ i ∈ s, ((fderiv ℝ (fun z => F i z x) z) v + + (1/2 : ℝ)*iteratedDeriv 2 (F i z) x)/F i z x) + + (1/2 : ℝ)*∑ ij ∈ s.offDiag, + (deriv (F ij.1 z) x/F ij.1 z x)*(deriv (F ij.2 z) x/F ij.2 z x)) := by + have hs (i : ι) (hi : i ∈ s) : ContDiff ℝ (⊤ : ℕ∞) (fun z => F i z x) := + (hF i hi).comp (contDiff_id.prodMk contDiff_const) + have hx (i : ι) (hi : i ∈ s) : ContDiff ℝ (⊤ : ℕ∞) (F i z) := + (hF i hi).comp (contDiff_const.prodMk contDiff_id) + rw [finite_product_directional_relative s (fun i z => F i z x) z v + (fun i hi => ((hs i hi).differentiable (by simp)) z) (fun i hi => hne i hi z x)] + rw [finite_product_second_relative s (fun i => F i z) + (fun i hi => (hx i hi).differentiable (by simp)) + (fun i hi => ((hx i hi).of_le (by simp)).differentiable_deriv_two) + (fun y i hi => hne i hi z y) x] + simp only [add_div, mul_div_assoc, Finset.sum_add_distrib, ← Finset.mul_sum] + ring + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointProductDrift.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointProductDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6da3162e0b57cc143fb2340bba4545742a79794 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointProductDrift.lean @@ -0,0 +1,95 @@ +import OAI.Probability.SLE.Multipoint.MultipointFieldBounds +import OAI.Probability.SLE.Multipoint.MultipointAbsorption + +namespace OAI + +/-! Absorption of the actual finite-product generator. -/ + +noncomputable section +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +theorem regularized_product_relative_drift {ι : Type*} [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (x : ℝ) + (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (hδ : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (z i) ≤ 1) : + let p := greenExponent κ + let ε := (negativeDrift p/2)/(4*((s.card : ℝ)+1)) + let C := driftAllowance p*driftThreshold p^(-p) + let L := youngConstant p (angularCoefficientConstant p^2) ε + (∑ i ∈ s, logGenerator κ (regularizedLogFactor κ (D i) (σ i)) (z i) x / + regularizedLogFactor κ (D i) (σ i) (z i) x) + + (1/2 : ℝ)*(∑ ij ∈ s.offDiag, + (deriv (regularizedLogFactor κ (D ij.1) (σ ij.1) (z ij.1)) x / + regularizedLogFactor κ (D ij.1) (σ ij.1) (z ij.1) x)* + (deriv (regularizedLogFactor κ (D ij.2) (σ ij.2) (z ij.2)) x / + regularizedLogFactor κ (D ij.2) (σ ij.2) (z ij.2) x)) ≤ + κ*(C*(∑ i ∈ s, branchRegulator κ (D i) (σ i) (z i)*logVelocity κ (z i) x^2) + + L*(∑ ij ∈ s.offDiag, + (branchRegulator κ (D ij.1) (σ ij.1) (z ij.1)* + branchRegulator κ (D ij.2) (σ ij.2) (z ij.2))^(-exponent p)* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x))) := by + dsimp only + let p := greenExponent κ + let k := negativeDrift p/2 + let ε := k/(4*((s.card : ℝ)+1)) + let C := driftAllowance p*driftThreshold p^(-p) + let L := youngConstant p (angularCoefficientConstant p^2) ε + let δ := fun i => branchRegulator κ (D i) (σ i) (z i) + let A := fun i => damping p (δ i) (logAngle κ (z i) x)*logVelocity κ (z i) x^2 + let H := fun i => δ i*logVelocity κ (z i) x^2 + let b := fun i => deriv (regularizedLogFactor κ (D i) (σ i) (z i)) x / + regularizedLogFactor κ (D i) (σ i) (z i) x + let d := fun i => logGenerator κ (regularizedLogFactor κ (D i) (σ i)) (z i) x / + regularizedLogFactor κ (D i) (σ i) (z i) x + let w := fun ij : ι × ι => (δ ij.1*δ ij.2)^(-exponent p)* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x) + have hp : 0 < p := by + dsimp [p, greenExponent] + rw [sub_pos, lt_div_iff₀ hκ] + linarith + have hk : 0 < k := div_pos (negativeDrift_pos hp) (by norm_num) + have he : 0 < ε := absorption_epsilon_pos hk s.card + have hA (i : ι) (hi : i ∈ s) : 0 ≤ A i := by + have hδi : 0 < δ i := mul_pos (hD i hi) (Real.exp_pos _) + have hf := angularFactor_pos (p := p) hδi (logAngle_sin_pos κ (z i) x) + change 0 ≤ (δ i/angularFactor p (δ i) (logAngle κ (z i) x)* + sinePower (q p-2) (logAngle κ (z i) x))*logVelocity κ (z i) x^2 + exact mul_nonneg (mul_nonneg (div_pos hδi hf).le + (Real.rpow_nonneg (logAngle_sin_pos κ (z i) x).le _)) (sq_nonneg _) + have hd (i : ι) (hi : i ∈ s) : d i ≤ (κ*C)*H i-(κ*k)*A i := by + have h := regularizedLogFactor_relative_drift κ (D i) (σ i) hκ hκ8 + (hD i hi) (hσ i hi) (z i) x + convert h using 1 + dsimp [d, C, H, k, A, δ, p] + ring + have hcross (ij : ι × ι) (hij : ij ∈ s.offDiag) : + (1/2 : ℝ)*(b ij.1*b ij.2) ≤ (κ*ε)*(A ij.1+A ij.2)+(κ*L)*w ij := by + obtain ⟨hi, hj, _⟩ := Finset.mem_offDiag.mp hij + have h := regularizedLogFactor_pair_absorption κ (D ij.1) (D ij.2) (σ ij.1) (σ ij.2) + ε hκ hκ8 (hD _ hi) (hD _ hj) he (z ij.1) (z ij.2) x (hδ _ hi) (hδ _ hj) + have hsmall : (1/2 : ℝ)*(b ij.1*b ij.2) ≤ |b ij.1*b ij.2| := by + nlinarith [le_abs_self (b ij.1*b ij.2), abs_nonneg (b ij.1*b ij.2)] + apply hsmall.trans + convert h using 1 + dsimp [b, L, A, w, δ, p] + ring + have hbudget : 2*(κ*ε)*(s.card : ℝ) ≤ κ*k := by + have h := mul_le_mul_of_nonneg_left (absorption_epsilon_budget hk.le s.card) hκ.le + convert h using 1 + dsimp [ε] + ring + have h := sum_drift_absorption s d A H (fun ij => (1/2 : ℝ)*(b ij.1*b ij.2)) w + (κ*C) (κ*k) (κ*ε) (κ*L) (mul_pos hκ he).le hA hbudget hd hcross + rw [← Finset.mul_sum] at h + convert h using 1 + dsimp [d, b, C, L, H, w, ε, k, δ, p] + ring + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointProductGenerator.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointProductGenerator.lean new file mode 100644 index 0000000000000000000000000000000000000000..4212794719f9db53849b48755682f1324da23511 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointProductGenerator.lean @@ -0,0 +1,115 @@ +import OAI.Probability.SLE.Multipoint.MultipointProductDrift +import OAI.Probability.SLE.Multipoint.MultipointProductCalculus + +namespace OAI + +/-! The generator of the actual regularized product in simultaneous +Loewner logarithmic coordinates. -/ + +noncomputable section +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +def regularizedProduct {ι : Type*} (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) + (z : ι → ℂ × ℝ) (x : ℝ) : ℝ := + ∏ i ∈ s, regularizedLogFactor κ (D i) (σ i) (z i) x + +def productDriftCost {ι : Type*} [DecidableEq ι] (s : Finset ι) (κ : ℝ) + (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (x : ℝ) : ℝ := + let p := greenExponent κ + let ε := (negativeDrift p/2)/(4*((s.card : ℝ)+1)) + let C := driftAllowance p*driftThreshold p^(-p) + let L := youngConstant p (angularCoefficientConstant p^2) ε + κ*(C*(∑ i ∈ s, branchRegulator κ (D i) (σ i) (z i)*logVelocity κ (z i) x^2) + + L*(∑ ij ∈ s.offDiag, + (branchRegulator κ (D ij.1) (σ ij.1) (z ij.1)* + branchRegulator κ (D ij.2) (σ ij.2) (z ij.2))^(-exponent p)* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x))) + +lemma regularizedProduct_contDiff {ι : Type*} [Fintype ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) : + ContDiff ℝ (⊤ : ℕ∞) (fun p : (ι → ℂ × ℝ) × ℝ => regularizedProduct s κ D σ p.1 p.2) := by + unfold regularizedProduct + apply contDiff_prod + intro i _ + exact (regularizedLogFactor_contDiff κ (D i) (σ i)).comp + (((contDiff_apply ℝ (ℂ × ℝ) i).comp contDiff_fst).prodMk contDiff_snd) + +lemma regularizedFactor_state_directional {ι : Type*} [Fintype ι] + (i : ι) (κ D σ : ℝ) (z v : ι → ℂ × ℝ) (x : ℝ) : + (fderiv ℝ (fun z => regularizedLogFactor κ D σ (z i) x) z) v = + (fderiv ℝ (fun q => regularizedLogFactor κ D σ q x) (z i)) (v i) := by + have hcd : ContDiff ℝ (⊤ : ℕ∞) (fun q => regularizedLogFactor κ D σ q x) := + (regularizedLogFactor_contDiff κ D σ).comp (contDiff_id.prodMk contDiff_const) + have hd := ((hcd.differentiable (by simp)) (z i)).hasFDerivAt + have hproj : HasFDerivAt (fun q : ι → ℂ × ℝ => q i) + (ContinuousLinearMap.proj i) z := hasFDerivAt_apply (𝕜 := ℝ) i z + have he := hd.comp z hproj + have heq := congrArg (fun A : (ι → ℂ × ℝ) →L[ℝ] ℝ => A v) he.fderiv + simpa only [Function.comp_def, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.proj_apply] using heq + +/-- Completed and not-yet-active points impose no velocity condition. -/ +lemma regularizedProduct_directional_congr {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) + (z v w : ι → ℂ × ℝ) (x : ℝ) (hvw : ∀ i ∈ s, v i = w i) : + (fderiv ℝ (fun q => regularizedProduct s κ D σ q x) z) v = + (fderiv ℝ (fun q => regularizedProduct s κ D σ q x) z) w := by + have hf (i : ι) : DifferentiableAt ℝ + (fun q : ι → ℂ × ℝ => regularizedLogFactor κ (D i) (σ i) (q i) x) z := + (((regularizedLogFactor_contDiff κ (D i) (σ i)).comp + ((contDiff_apply ℝ (ℂ × ℝ) i).prodMk contDiff_const)).differentiable (by simp)) z + have hne (i : ι) (hi : i ∈ s) : regularizedLogFactor κ (D i) (σ i) (z i) x ≠ 0 := + (regularizedLogFactor_pos κ (D i) (σ i) (hD i hi) _ _).ne' + unfold regularizedProduct + rw [finite_product_directional_relative s _ z v (fun i _ => hf i) hne, + finite_product_directional_relative s _ z w (fun i _ => hf i) hne] + congr 1 + apply Finset.sum_congr rfl + intro i hi + rw [regularizedFactor_state_directional, regularizedFactor_state_directional, hvw i hi] + +theorem regularizedProduct_generator_identity {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) + (z : ι → ℂ × ℝ) (x : ℝ) : + (fderiv ℝ (fun z => regularizedProduct s κ D σ z x) z) + (fun i => physicalLogLoewnerField (Real.sqrt κ*x) (z i)) + + (1/2 : ℝ)*iteratedDeriv 2 (regularizedProduct s κ D σ z) x = + regularizedProduct s κ D σ z x * + ((∑ i ∈ s, logGenerator κ (regularizedLogFactor κ (D i) (σ i)) (z i) x / + regularizedLogFactor κ (D i) (σ i) (z i) x) + + (1/2 : ℝ)*(∑ ij ∈ s.offDiag, + (deriv (regularizedLogFactor κ (D ij.1) (σ ij.1) (z ij.1)) x / + regularizedLogFactor κ (D ij.1) (σ ij.1) (z ij.1) x)* + (deriv (regularizedLogFactor κ (D ij.2) (σ ij.2) (z ij.2)) x / + regularizedLogFactor κ (D ij.2) (σ ij.2) (z ij.2) x))) := by + have hcd (i : ι) : ContDiff ℝ (⊤ : ℕ∞) + (fun p : (ι → ℂ × ℝ) × ℝ => regularizedLogFactor κ (D i) (σ i) (p.1 i) p.2) := + (regularizedLogFactor_contDiff κ (D i) (σ i)).comp + (((contDiff_apply ℝ (ℂ × ℝ) i).comp contDiff_fst).prodMk contDiff_snd) + have h := finite_product_generator s + (fun i z x => regularizedLogFactor κ (D i) (σ i) (z i) x) (fun i _ => hcd i) + (fun i hi z x => (regularizedLogFactor_pos κ (D i) (σ i) (hD i hi) (z i) x).ne') + z (fun i => physicalLogLoewnerField (Real.sqrt κ*x) (z i)) x + simp only [regularizedFactor_state_directional] at h + exact h + +theorem regularizedProduct_generator_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (z : ι → ℂ × ℝ) (x : ℝ) + (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (hδ : ∀ i ∈ s, branchRegulator κ (D i) (σ i) (z i) ≤ 1) : + (fderiv ℝ (fun z => regularizedProduct s κ D σ z x) z) + (fun i => physicalLogLoewnerField (Real.sqrt κ*x) (z i)) + + (1/2 : ℝ)*iteratedDeriv 2 (regularizedProduct s κ D σ z) x ≤ + regularizedProduct s κ D σ z x * productDriftCost s κ D σ z x := by + rw [regularizedProduct_generator_identity s κ D σ hD] + apply mul_le_mul_of_nonneg_left (regularized_product_relative_drift s κ hκ hκ8 D σ z x hD hσ hδ) + exact (Finset.prod_pos (fun i hi => regularizedLogFactor_pos κ (D i) (σ i) (hD i hi) (z i) x)).le + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusStatus.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusStatus.lean new file mode 100644 index 0000000000000000000000000000000000000000..e73ff05fbdb391d601849c4213ff346920641cf5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusStatus.lean @@ -0,0 +1,253 @@ +import OAI.Probability.SLE.Loewner.ActualRadiusStops +import OAI.Probability.SLE.Multipoint.MultipointLogClockTransport +import OAI.Probability.SLE.Multipoint.MultipointRadiusSwitches + +namespace OAI + +/-! The literal radius stop is the inverse of the actual increasing radius +clock. Horizon truncation preserves all threshold tests strictly before +its cutoff, including equality at a crossed threshold. -/ + +noncomputable section +open Set +open scoped NNReal ENNReal + +namespace SLEExactGauge + +lemma radiusLevelTime_le_iff_clock + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (z : ℂ) (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0) (ht : z ∈ survivingDomain γ t) : + radiusLevelTime γ G z u ≤ (t : ℝ≥0∞) ↔ + u ≤ logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) := by + constructor + · intro hτ + obtain ⟨s,hs,hsR⟩ := exists_live_level_of_radiusLevelTime_lt_top γ G z u + (hτ.trans_lt ENNReal.coe_lt_top) + have hst : s ≤ t := by + rw [radiusLevelTime_eq_of_live_level hU hw z u s hs hsR] at hτ + exact_mod_cast hτ + have hmono := (hw.radius_clock_strictMonoOn hU z t ht).monotoneOn + (show (s : ℝ) ∈ Icc 0 (t : ℝ) from ⟨s.coe_nonneg,by exact_mod_cast hst⟩) + (show (t : ℝ) ∈ Icc 0 (t : ℝ) from ⟨t.coe_nonneg,le_rfl⟩) + (by exact_mod_cast hst) + have hsclock := (fullRadius_level_iff_logClock hU hw z s hs u).mp hsR + rw [Real.toNNReal_coe, Real.toNNReal_coe, + ← logRadiusClock_logCoordinates hU hw z s hs, + ← logRadiusClock_logCoordinates hU hw z t ht, hsclock] at hmono + exact hmono + · intro hc + have htR := (fullRadius_level_iff_logClock hU hw z t ht + (logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t))).mpr rfl + obtain ⟨s,hst,hs,hsR⟩ := live_radius_level_before hU hw z hu hc t ht htR + rw [radiusLevelTime_eq_of_live_level hU hw z u s hs hsR] + exact_mod_cast hst + +lemma radiusLevelTime_eq_iff_clock + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (z : ℂ) (u : ℝ) (t : ℝ≥0) (ht : z ∈ survivingDomain γ t) : + radiusLevelTime γ G z u = (t : ℝ≥0∞) ↔ + logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) = u := by + constructor + · intro hτ + obtain ⟨s,hs,hsR⟩ := exists_live_level_of_radiusLevelTime_lt_top γ G z u + (by rw [hτ]; exact ENNReal.coe_lt_top) + have hst : s = t := by + rw [radiusLevelTime_eq_of_live_level hU hw z u s hs hsR] at hτ + exact_mod_cast hτ + subst s + exact (fullRadius_level_iff_logClock hU hw z t ht u).mp hsR + · intro hc + exact radiusLevelTime_eq_of_live_level hU hw z u t ht + ((fullRadius_level_iff_logClock hU hw z t ht u).mpr hc) + +lemma radiusLevelTime_lt_iff_clock + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + (z : ℂ) (u : ℝ) (hu : 0 ≤ u) (t : ℝ≥0) (ht : z ∈ survivingDomain γ t) : + radiusLevelTime γ G z u < (t : ℝ≥0∞) ↔ + u < logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) := by + rw [lt_iff_le_and_ne, radiusLevelTime_le_iff_clock hU hw z u hu t ht] + constructor + · rintro ⟨hle,hne⟩ + apply lt_of_le_of_ne hle + intro he + exact hne ((radiusLevelTime_eq_iff_clock hU hw z u t ht).mpr he.symm) + · intro h + refine ⟨h.le, ?_⟩ + intro he + exact h.ne' ((radiusLevelTime_eq_iff_clock hU hw z u t ht).mp he) + +lemma cutoffStop_reached_before_horizon {Ω : Type*} + (τ : Ω → WithTop ℝ≥0) (H t : ℝ≥0) (ht : t ≤ H) (ω : Ω) : + cutoffStop τ (H+1) ω ≤ t ↔ τ ω ≤ (t : WithTop ℝ≥0) := by + have hHt : ¬ ((H+1 : ℝ≥0) : WithTop ℝ≥0) ≤ (t : WithTop ℝ≥0) := by + exact_mod_cast (not_le_of_gt (lt_of_le_of_lt ht (lt_add_one H))) + rw [← WithTop.coe_le_coe, cutoffStop_coe, min_le_iff] + exact or_iff_left hHt + +lemma cutoffStop_strictly_reached_before_horizon {Ω : Type*} + (τ : Ω → WithTop ℝ≥0) (H t : ℝ≥0) (ht : t ≤ H) (ω : Ω) : + cutoffStop τ (H+1) ω < t ↔ τ ω < (t : WithTop ℝ≥0) := by + have hHt : ¬ ((H+1 : ℝ≥0) : WithTop ℝ≥0) < (t : WithTop ℝ≥0) := by + exact_mod_cast (not_lt_of_ge (le_of_lt (lt_of_le_of_lt ht (lt_add_one H)))) + rw [← WithTop.coe_lt_coe, cutoffStop_coe, min_lt_iff] + exact or_iff_left hHt + +lemma cutoffStop_eq_before_horizon {Ω : Type*} + (τ : Ω → WithTop ℝ≥0) (H t : ℝ≥0) (ht : t ≤ H) (ω : Ω) : + cutoffStop τ (H+1) ω = t ↔ τ ω = (t : WithTop ℝ≥0) := by + rw [eq_iff_le_not_lt, cutoffStop_reached_before_horizon τ H t ht ω, + cutoffStop_strictly_reached_before_horizon τ H t ht ω, eq_iff_le_not_lt] + +namespace Multipoint + +def sourceClockLevel (κ : ℝ) (z : ℂ) (u : ℝ) : ℝ := κ/4*(u-Real.log z.im) + +lemma cutoff_radius_reached_iff + {Ω : Type*} {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + {κ : ℝ} (hκ : 0 < κ) (z : ℂ) (u : ℝ) (hu : 0 ≤ u) + (H t : ℝ≥0) (htH : t ≤ H) (ht : z ∈ survivingDomain γ t) (ω : Ω) : + cutoffStop (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) (H+1) ω ≤ t ↔ + sourceClockLevel κ z u ≤ logFactorClock κ (logLoewnerCoordinates G z t) := by + have hc : (radiusLevelTime γ G z u : WithTop ℝ≥0) ≤ (t : WithTop ℝ≥0) ↔ + u ≤ logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) := by + constructor + · intro h + apply (radiusLevelTime_le_iff_clock hU hw z u hu t ht).mp + exact_mod_cast h + · intro h + have h' := (radiusLevelTime_le_iff_clock hU hw z u hu t ht).mpr h + exact_mod_cast h' + have hs : (u ≤ logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t)) ↔ + sourceClockLevel κ z u ≤ logFactorClock κ (logLoewnerCoordinates G z t) := by + rw [logFactorClock_eq_logRadiusClock κ (Real.log z.im)] + unfold sourceClockLevel + rw [mul_le_mul_iff_right₀ (div_pos hκ (by norm_num)), sub_le_sub_iff_right] + exact (cutoffStop_reached_before_horizon + (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) H t htH ω).trans (hc.trans hs) + +lemma cutoff_radius_strictly_reached_iff + {Ω : Type*} {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + {κ : ℝ} (hκ : 0 < κ) (z : ℂ) (u : ℝ) (hu : 0 ≤ u) + (H t : ℝ≥0) (htH : t ≤ H) (ht : z ∈ survivingDomain γ t) (ω : Ω) : + cutoffStop (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) (H+1) ω < t ↔ + sourceClockLevel κ z u < logFactorClock κ (logLoewnerCoordinates G z t) := by + have hc : (radiusLevelTime γ G z u : WithTop ℝ≥0) < (t : WithTop ℝ≥0) ↔ + u < logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) := by + constructor + · intro h + apply (radiusLevelTime_lt_iff_clock hU hw z u hu t ht).mp + exact_mod_cast h + · intro h + have h' := (radiusLevelTime_lt_iff_clock hU hw z u hu t ht).mpr h + exact_mod_cast h' + have hs : (u < logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t)) ↔ + sourceClockLevel κ z u < logFactorClock κ (logLoewnerCoordinates G z t) := by + rw [logFactorClock_eq_logRadiusClock κ (Real.log z.im)] + unfold sourceClockLevel + rw [mul_lt_mul_iff_right₀ (div_pos hκ (by norm_num)), sub_lt_sub_iff_right] + exact (cutoffStop_strictly_reached_before_horizon + (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) H t htH ω).trans (hc.trans hs) + +lemma cutoff_radius_eq_iff + {Ω : Type*} {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + {κ : ℝ} (hκ : 0 < κ) (z : ℂ) (u : ℝ) + (H t : ℝ≥0) (htH : t ≤ H) (ht : z ∈ survivingDomain γ t) (ω : Ω) : + cutoffStop (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) (H+1) ω = t ↔ + logFactorClock κ (logLoewnerCoordinates G z t) = sourceClockLevel κ z u := by + have hc : (radiusLevelTime γ G z u : WithTop ℝ≥0) = (t : WithTop ℝ≥0) ↔ + logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) = u := by + constructor + · intro h + apply (radiusLevelTime_eq_iff_clock hU hw z u t ht).mp + exact_mod_cast h + · intro h + have h' := (radiusLevelTime_eq_iff_clock hU hw z u t ht).mpr h + exact_mod_cast h' + have hs : (logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) = u) ↔ + logFactorClock κ (logLoewnerCoordinates G z t) = sourceClockLevel κ z u := by + rw [logFactorClock_eq_logRadiusClock κ (Real.log z.im)] + unfold sourceClockLevel + rw [mul_right_inj' (div_pos hκ (by norm_num)).ne', sub_left_inj] + exact (cutoffStop_eq_before_horizon + (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) H t htH ω).trans (hc.trans hs) + +/-- The three concrete radius switches give exactly the source branch +thresholds, also after truncation at `H + 1`. -/ +theorem cutoff_radius_factor_thresholds + {Ω : Type*} {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hU : Continuous U) (hw : IsCapacityTwoWitness U γ G F) + {κ : ℝ} (hκ : 0 < κ) (z : ℂ) (u₀ u₂ : ℝ) (h₀ : 0 ≤ u₀) (h₂ : 0 ≤ u₂) + (H t : ℝ≥0) (htH : t ≤ H) (ht : z ∈ survivingDomain γ t) (ω : Ω) : + let τ := fun u => cutoffStop (fun _ : Ω => (radiusLevelTime γ G z u : WithTop ℝ≥0)) (H+1) ω + let v := logFactorClock κ (logLoewnerCoordinates G z t)-sourceClockLevel κ z u₀ + let V := κ/4*(u₂-u₀) + (τ u₀ ≤ t ↔ 0 ≤ v) ∧ + (τ ((u₀+u₂)/2) ≤ t ↔ V/2 ≤ v) ∧ + (τ u₂ ≤ t ↔ V ≤ v) ∧ + (τ u₀ = t → v = 0) ∧ + (τ ((u₀+u₂)/2) = t → v = V/2) ∧ + (τ u₂ = t → v = V) := by + dsimp only + have hm : 0 ≤ (u₀+u₂)/2 := by positivity + have hstart := cutoff_radius_reached_iff hU hw hκ z u₀ h₀ H t htH ht ω + have hmid := cutoff_radius_reached_iff hU hw hκ z ((u₀+u₂)/2) hm H t htH ht ω + have hend := cutoff_radius_reached_iff hU hw hκ z u₂ h₂ H t htH ht ω + have hmidlevel : sourceClockLevel κ z ((u₀+u₂)/2) = + sourceClockLevel κ z u₀ + (κ/4*(u₂-u₀))/2 := by + unfold sourceClockLevel + ring + have hendlevel : sourceClockLevel κ z u₂ = + sourceClockLevel κ z u₀ + κ/4*(u₂-u₀) := by + unfold sourceClockLevel + ring + refine ⟨?_,?_,?_,?_,?_,?_⟩ + · exact hstart.trans (sub_nonneg.symm) + · rw [hmid,hmidlevel] + constructor <;> intro h <;> linarith + · rw [hend,hendlevel] + constructor <;> intro h <;> linarith + · intro h + have he := (cutoff_radius_eq_iff hU hw hκ z u₀ H t htH ht ω).mp h + exact sub_eq_zero.mpr he + · intro h + have he := (cutoff_radius_eq_iff hU hw hκ z ((u₀+u₂)/2) H t htH ht ω).mp h + rw [hmidlevel] at he + linarith + · intro h + have he := (cutoff_radius_eq_iff hU hw hκ z u₂ H t htH ht ω).mp h + rw [hendlevel] at he + linarith + +end Multipoint + +/-- At the activation clock chosen from the physical initial radius, the +physical conformal radius is exactly the prescribed activation radius. -/ +theorem IsCapacityTwoWitness.physical_radius_at_activation + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (J : ℂ → ℂ) (z : ℂ) (R b : ℝ) (hR : 0 < R) (hb : 0 < b) + (hRdef : R = 2*z.im*‖deriv J z‖) + (t : ℝ≥0) (ht : z ∈ survivingDomain γ t) + (hclock : logRadiusClock (Real.log z.im) (logLoewnerCoordinates G z t) = + Real.log (R/b)) : + physicalConformalRadius J G t z = b := by + have hradius := (fullRadius_level_iff_logClock hU hw z t ht (Real.log (R/b))).mpr hclock + have hexp : Real.exp (-Real.log (R/b)) = b/R := by + rw [Real.exp_neg, Real.exp_log (div_pos hR hb)] + field_simp [hR.ne',hb.ne'] + have hcoef : ‖deriv J z‖*(2*z.im) = R := by rw [hRdef]; ring + unfold physicalConformalRadius + rw [hradius,hexp,← mul_assoc,hcoef] + field_simp [hR.ne'] + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusSwitches.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusSwitches.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b373832d47c02c56abab6b8d06730caa085d774 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointRadiusSwitches.lean @@ -0,0 +1,103 @@ +import OAI.Probability.SLE.Loewner.ActualRadiusStopsRegular +import OAI.Probability.SLE.Gauge.ExtendedExperimentStop + +namespace OAI + +/-! The three actual radius switches of one multipoint factor: activation, +the midpoint of its radius clock, and completion. They reuse the literal +radius-level stopping times and are truncated only at the common finite +localization horizon. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +def switchLevel (R b e : ℝ) (j : Fin 3) : ℝ := + if j = 0 then Real.log (R / b) + else if j = 1 then (Real.log (R / b) + Real.log (R / e)) / 2 + else Real.log (R / e) + +lemma switchLevel_nonneg {R b e : ℝ} (he : 0 < e) (heb : e ≤ b) (hbR : b ≤ R) + (j : Fin 3) : 0 ≤ switchLevel R b e j := by + have hb := he.trans_le heb + have h₀ := Real.log_nonneg ((one_le_div hb).mpr hbR) + have h₂ := Real.log_nonneg ((one_le_div he).mpr (heb.trans hbR)) + fin_cases j <;> norm_num [switchLevel] <;> linarith + +lemma switchLevel_monotone {R b e : ℝ} (he : 0 < e) (heb : e ≤ b) (hbR : b ≤ R) : + Monotone (switchLevel R b e) := by + have hb := he.trans_le heb + have hR := hb.trans_le hbR + have hle : Real.log (R / b) ≤ Real.log (R / e) := + Real.log_le_log (div_pos hR hb) (div_le_div_of_nonneg_left hR.le he heb) + intro i j hij + dsimp only [switchLevel] + split_ifs <;> first | omega | linarith + +lemma switchLevel_midpoint_offset {R b e : ℝ} (hR : 0 < R) (hb : 0 < b) (he : 0 < e) : + switchLevel R b e 1 - switchLevel R b e 0 = Real.log (b / e) / 2 := by + norm_num [switchLevel, + Real.log_div hR.ne' hb.ne', Real.log_div hR.ne' he.ne', Real.log_div hb.ne' he.ne'] + ring + +lemma switchLevel_completion_offset {R b e : ℝ} (hR : 0 < R) (hb : 0 < b) (he : 0 < e) : + switchLevel R b e 2 - switchLevel R b e 0 = Real.log (b / e) := by + norm_num [switchLevel, + Real.log_div hR.ne' hb.ne', Real.log_div hR.ne' he.ne', Real.log_div hb.ne' he.ne'] + +end SLEExactGauge.Multipoint + +namespace SLEExactGauge + +lemma cutoffStop_le_horizon {Ω : Type*} (τ : Ω → WithTop ℝ≥0) (H : ℝ≥0) (ω : Ω) : + cutoffStop τ H ω ≤ H := by + apply WithTop.coe_le_coe.mp + rw [cutoffStop_coe] + exact min_le_right _ _ + +lemma cutoffStop_mono {Ω : Type*} {σ τ : Ω → WithTop ℝ≥0} + (hστ : ∀ ω, σ ω ≤ τ ω) (H : ℝ≥0) (ω : Ω) : + cutoffStop σ H ω ≤ cutoffStop τ H ω := by + apply WithTop.coe_le_coe.mp + rw [cutoffStop_coe, cutoffStop_coe] + exact min_le_min (hστ ω) le_rfl + +/-- Concrete activation, midpoint, and completion stopping times for a +regular actual SLE, all localized at the same horizon. -/ +theorem actual_radius_factor_switches + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun p : ℝ≥0 × Ω => B p.1 p.2)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hB0 : ∀ ω, B 0 ω = 0) + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (γ : Ω → ℝ≥0 → ℂ) (G F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B t ω) (γ ω) (G ω) (F ω)) + (z : ℂ) (hz : z ∈ upperHalfPlane) + (R b e : ℝ) (he : 0 < e) (heb : e ≤ b) (hbR : b ≤ R) (H : ℝ≥0) : + let τ := fun j : Fin 3 => cutoffStop + (fun ω => radiusLevelTime (γ ω) (G ω) z (Multipoint.switchLevel R b e j)) H + (∀ j, IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (τ j ω : WithTop ℝ≥0))) ∧ + (∀ ω, Monotone (fun j => τ j ω)) ∧ (∀ j ω, τ j ω ≤ H) := by + dsimp only + refine ⟨?_, ?_, ?_⟩ + · intro j + exact cutoffStop_stopping _ _ + (actual_radiusLevelTime_stopping hB hm hBm hc hB0 κ hκ hκ8 γ G F hw z hz + (Multipoint.switchLevel R b e j) (Multipoint.switchLevel_nonneg he heb hbR j)) H + · intro ω i j hij + apply cutoffStop_mono _ H ω + intro ω' + exact radiusLevelTime_mono ((hc ω').const_mul _) (hw ω') z + (Multipoint.switchLevel_nonneg he heb hbR i) + (Multipoint.switchLevel_monotone he heb hbR hij) + · exact fun j ω => cutoffStop_le_horizon _ H ω + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizedField.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizedField.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c1551f4c285f233954708d7e41675b33d6c02fd --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizedField.lean @@ -0,0 +1,143 @@ +import OAI.Probability.SLE.Multipoint.MultipointLogAngular + +namespace OAI + +/-! The actual smooth factor on either side of a regulator midpoint. +Its only parameters are the constant and logarithmic slope of that branch. -/ + +noncomputable section + +namespace SLEExactGauge.Multipoint + +def regularizedLogFactor (κ D σ : ℝ) (z : ℂ × ℝ) (x : ℝ) : ℝ := + logFactor κ (greenExponent κ/2) (greenExponent κ) z x + + D*(logFactor κ (greenExponent κ/2+σ) 0 z x + + logFactor κ (greenExponent κ/2+σ) (q (greenExponent κ)) z x) + +def branchRegulator (κ D σ : ℝ) (z : ℂ × ℝ) : ℝ := + D*Real.exp ((σ*κ/4)*(z.2-z.1.im)) + +lemma regularizedLogFactor_contDiff (κ D σ : ℝ) : + ContDiff ℝ (⊤ : ℕ∞) (fun z : (ℂ × ℝ) × ℝ => regularizedLogFactor κ D σ z.1 z.2) := + (logFactor_contDiff κ _ _).add (contDiff_const.mul + ((logFactor_contDiff κ _ _).add (logFactor_contDiff κ _ _))) + +lemma regularizedLogFactor_eq (κ D σ : ℝ) (z : ℂ × ℝ) (x : ℝ) : + regularizedLogFactor κ D σ z x = + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + angularFactor (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) := by + unfold regularizedLogFactor + rw [logFactor_eq_angular, logFactor_eq_angular, logFactor_eq_angular] + have he : Real.exp (((greenExponent κ/2+σ)*κ/4)*(z.2-z.1.im)) = + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + Real.exp ((σ*κ/4)*(z.2-z.1.im)) := by + rw [← Real.exp_add]; congr 1; ring + rw [he] + simp only [sinePower, Real.rpow_zero, angularFactor, branchRegulator] + ring + +lemma regularizedLogFactor_pos (κ D σ : ℝ) (hD : 0 < D) (z : ℂ × ℝ) (x : ℝ) : + 0 < regularizedLogFactor κ D σ z x := by + rw [regularizedLogFactor_eq] + exact mul_pos (Real.exp_pos _) (angularFactor_pos (mul_pos hD (Real.exp_pos _)) + (logAngle_sin_pos κ z x)) + +lemma regularizedLogFactor_spatial (κ D σ : ℝ) (z : ℂ × ℝ) (x : ℝ) : + deriv (regularizedLogFactor κ D σ z) x = + Real.sqrt κ*logVelocity κ z x* + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + angularFactorFirst (greenExponent κ) (branchRegulator κ D σ z) (logAngle κ z x) := by + have hd := (logFactor_spatial_derivative κ (greenExponent κ/2) (greenExponent κ) z x).add + (((logFactor_spatial_derivative κ (greenExponent κ/2+σ) 0 z x).add + (logFactor_spatial_derivative κ (greenExponent κ/2+σ) (q (greenExponent κ)) z x)).const_mul D) + change HasDerivAt (regularizedLogFactor κ D σ z) _ x at hd + rw [hd.deriv] + have hs (c r : ℝ) := logFactor_spatial_eq_angular κ c r z x + rw [← (logFactor_spatial_derivative κ (greenExponent κ/2) (greenExponent κ) z x).deriv, + ← (logFactor_spatial_derivative κ (greenExponent κ/2+σ) 0 z x).deriv, + ← (logFactor_spatial_derivative κ (greenExponent κ/2+σ) (q (greenExponent κ)) z x).deriv] + rw [hs, hs, hs] + have he : Real.exp (((greenExponent κ/2+σ)*κ/4)*(z.2-z.1.im)) = + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + Real.exp ((σ*κ/4)*(z.2-z.1.im)) := by + rw [← Real.exp_add]; congr 1; ring + rw [he] + simp only [sinePowerFirst, zero_mul, angularFactorFirst, branchRegulator] + ring + +def logGenerator (κ : ℝ) (F : (ℂ × ℝ) → ℝ → ℝ) (z : ℂ × ℝ) (x : ℝ) : ℝ := + (fderiv ℝ (fun z => F z x) z) (physicalLogLoewnerField (Real.sqrt κ*x) z) + + (1/2 : ℝ)*iteratedDeriv 2 (F z) x + +lemma logGenerator_add (κ : ℝ) (F G : (ℂ × ℝ) → ℝ → ℝ) + (hF : ContDiff ℝ (⊤ : ℕ∞) (fun z : (ℂ × ℝ) × ℝ => F z.1 z.2)) + (hG : ContDiff ℝ (⊤ : ℕ∞) (fun z : (ℂ × ℝ) × ℝ => G z.1 z.2)) + (z : ℂ × ℝ) (x : ℝ) : + logGenerator κ (fun z x => F z x+G z x) z x = + logGenerator κ F z x+logGenerator κ G z x := by + have hFs : ContDiff ℝ (⊤ : ℕ∞) (fun z => F z x) := + hF.comp (contDiff_id.prodMk contDiff_const) + have hGs : ContDiff ℝ (⊤ : ℕ∞) (fun z => G z x) := + hG.comp (contDiff_id.prodMk contDiff_const) + have hFx : ContDiff ℝ (⊤ : ℕ∞) (F z) := + hF.comp (contDiff_const.prodMk contDiff_id) + have hGx : ContDiff ℝ (⊤ : ℕ∞) (G z) := + hG.comp (contDiff_const.prodMk contDiff_id) + unfold logGenerator + rw [fderiv_fun_add ((hFs.differentiable (by simp)) z) ((hGs.differentiable (by simp)) z), + iteratedDeriv_fun_add (hFx.of_le (by simp)).contDiffAt (hGx.of_le (by simp)).contDiffAt] + simp only [add_apply] + ring + +lemma logGenerator_const_mul (κ D : ℝ) (F : (ℂ × ℝ) → ℝ → ℝ) + (hF : ContDiff ℝ (⊤ : ℕ∞) (fun z : (ℂ × ℝ) × ℝ => F z.1 z.2)) + (z : ℂ × ℝ) (x : ℝ) : + logGenerator κ (fun z x => D*F z x) z x = D*logGenerator κ F z x := by + have hFs : ContDiff ℝ (⊤ : ℕ∞) (fun z => F z x) := + hF.comp (contDiff_id.prodMk contDiff_const) + have hFx : ContDiff ℝ (⊤ : ℕ∞) (F z) := + hF.comp (contDiff_const.prodMk contDiff_id) + unfold logGenerator + rw [fderiv_const_mul ((hFs.differentiable (by simp)) z), + iteratedDeriv_const_mul D (hFx.of_le (by simp)).contDiffAt] + simp only [smul_apply, smul_eq_mul] + ring + +theorem regularizedLogFactor_generator (κ D σ : ℝ) (hκ : 0 < κ) + (z : ℂ × ℝ) (x : ℝ) : + logGenerator κ (regularizedLogFactor κ D σ) z x = + κ*logVelocity κ z x^2* + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + branchRegulator κ D σ z * + (greenExponent κ/2 + + (greenExponent κ-q (greenExponent κ))*(1+q (greenExponent κ))/2* + sinePower (q (greenExponent κ)) (logAngle κ z x) - + negativeDrift (greenExponent κ)* + sinePower (q (greenExponent κ)-2) (logAngle κ z x) + + σ*(1+sinePower (q (greenExponent κ)) (logAngle κ z x))) := by + unfold regularizedLogFactor + rw [logGenerator_add κ _ _ (logFactor_contDiff κ _ _) + (contDiff_const.mul ((logFactor_contDiff κ _ _).add (logFactor_contDiff κ _ _))), + logGenerator_const_mul κ D _ ((logFactor_contDiff κ _ _).add (logFactor_contDiff κ _ _)), + logGenerator_add κ _ _ (logFactor_contDiff κ _ _) (logFactor_contDiff κ _ _)] + simp only [logGenerator, logFactor_generator_eq_angular κ _ _ hκ] + have he : Real.exp (((greenExponent κ/2+σ)*κ/4)*(z.2-z.1.im)) = + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im))* + Real.exp ((σ*κ/4)*(z.2-z.1.im)) := by + rw [← Real.exp_add]; congr 1; ring + rw [he] + have h0 : sineGenerator (greenExponent κ) 0 (logAngle κ z x) = 0 := by + simp [sineGenerator, sinePowerFirst, sinePowerSecond] + rw [h0] + have hreg := regularized_generator (p := greenExponent κ) + (δ := branchRegulator κ D σ z) (σ := σ) (logAngle_sin_pos κ z x) + simp only [sinePower, Real.rpow_zero, branchRegulator] at hreg ⊢ + unfold angularFactor sinePower at hreg + linear_combination (κ*logVelocity κ z x^2* + Real.exp (((greenExponent κ/2)*κ/4)*(z.2-z.1.im)))*hreg + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizer.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..83a20caf2dc229c1a874cb084addb7329a559160 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointRegularizer.lean @@ -0,0 +1,207 @@ +import Mathlib + +namespace OAI + +/-! Parameters and the two-ended regularizer in the multipoint radius +estimate, September 25 manuscript, Section 3. These bounds are uniform in +all target levels; completed factors can therefore be frozen separately. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology + +namespace SLEExactGauge.Multipoint + +def q (p : ℝ) : ℝ := min 1 p / 2 + +def eta (p : ℝ) : ℝ := (1 - q p) / (2 - q p) + +def exponent (p : ℝ) : ℝ := (1 + eta p) / (1 - 2 * eta p) + +def beta (a p : ℝ) : ℝ := min 1 (a / (4 * exponent p)) + +lemma q_pos {p : ℝ} (hp : 0 < p) : 0 < q p := + div_pos (lt_min zero_lt_one hp) (by norm_num) + +lemma q_lt_one {p : ℝ} : q p < 1 := by + have h := min_le_left (1 : ℝ) p + dsimp [q] + linarith + +lemma q_lt_p {p : ℝ} (hp : 0 < p) : q p < p := by + have h := min_le_right (1 : ℝ) p + dsimp [q] + linarith + +lemma eta_pos {p : ℝ} : 0 < eta p := by + exact div_pos (sub_pos.mpr q_lt_one) (by linarith [q_lt_one (p := p)]) + +lemma eta_lt_half {p : ℝ} (hp : 0 < p) : eta p < 1 / 2 := by + rw [eta, div_lt_iff₀ (by linarith [q_lt_one (p := p)])] + linarith [q_pos hp] + +lemma eta_identity (p : ℝ) : eta p * (q p - 2) = q p - 1 := by + have hn : 2 - q p ≠ 0 := ne_of_gt (by linarith [q_lt_one (p := p)]) + dsimp [eta] + field_simp + ring + +lemma exponent_eq {p : ℝ} (hp : 0 < p) : exponent p = 3 / q p - 2 := by + have hq := q_pos hp + have hq2 : 2 - q p ≠ 0 := ne_of_gt (by linarith [q_lt_one (p := p)]) + have he : 1 - 2 * eta p ≠ 0 := ne_of_gt (by linarith [eta_lt_half hp]) + dsimp [exponent] + apply (div_eq_iff he).mpr + dsimp [eta] + field_simp + ring + +lemma exponent_pos {p : ℝ} (hp : 0 < p) : 0 < exponent p := by + exact div_pos (by linarith [eta_pos (p := p)]) (by linarith [eta_lt_half hp]) + +lemma beta_pos {a p : ℝ} (ha : 0 < a) (hp : 0 < p) : 0 < beta a p := by + exact lt_min zero_lt_one (div_pos ha (mul_pos (by norm_num) (exponent_pos hp))) + +lemma beta_le_one (a p : ℝ) : beta a p ≤ 1 := min_le_left _ _ + +lemma twice_exponent_beta_lt {a p : ℝ} (ha : 0 < a) (hp : 0 < p) : + 2 * (exponent p * beta a p) < a := by + have hM := exponent_pos hp + have hb : beta a p ≤ a / (4 * exponent p) := min_le_right _ _ + have h := (le_div_iff₀ (by positivity : 0 < 4 * exponent p)).mp hb + nlinarith + +/-- The regulator equals one at either endpoint of an active interval. -/ +def regulator (β U u : ℝ) : ℝ := Real.exp (-β * min u (U - u)) + +@[simp] lemma regulator_zero (β U : ℝ) (hU : 0 ≤ U) : regulator β U 0 = 1 := by + simp [regulator, min_eq_left hU] + +@[simp] lemma regulator_end (β U : ℝ) (hU : 0 ≤ U) : regulator β U U = 1 := by + simp [regulator, min_eq_right hU] + +lemma regulator_pos (β U u : ℝ) : 0 < regulator β U u := Real.exp_pos _ + +lemma regulator_le_one {β U u : ℝ} (hβ : 0 ≤ β) (hu : u ∈ Icc 0 U) : + regulator β U u ≤ 1 := by + apply Real.exp_le_one_iff.mpr + exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hβ) + (le_min hu.1 (sub_nonneg.mpr hu.2)) + +lemma regulator_inv_power_le {β U u M : ℝ} (hβ : 0 ≤ β) (hM : 0 ≤ M) : + regulator β U u ^ (-M) ≤ Real.exp (M * β * u) := by + rw [regulator, ← Real.exp_mul] + apply Real.exp_le_exp.mpr + have h := mul_le_mul_of_nonneg_left (min_le_left u (U-u)) (mul_nonneg hM hβ) + nlinarith + +lemma pair_regulator_inv_power_le {β U V u v M : ℝ} (hβ : 0 ≤ β) (hM : 0 ≤ M) : + (regulator β U u * regulator β V v) ^ (-M) ≤ Real.exp (M * β * (u + v)) := by + rw [Real.mul_rpow (regulator_pos _ _ _).le (regulator_pos _ _ _).le] + calc + _ ≤ Real.exp (M * β * u) * Real.exp (M * β * v) := + mul_le_mul (regulator_inv_power_le hβ hM) (regulator_inv_power_le hβ hM) + (Real.rpow_nonneg (regulator_pos _ _ _).le _) (Real.exp_pos _).le + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +lemma regulator_eq_left {β U u : ℝ} (hu : u ≤ U / 2) : + regulator β U u = Real.exp (-β * u) := by + rw [regulator, min_eq_left (by linarith)] + +lemma regulator_eq_right {β U u : ℝ} (hu : U / 2 ≤ u) : + regulator β U u = Real.exp (-β * (U-u)) := by + rw [regulator, min_eq_right (by linarith)] + +lemma regulator_reflect (β U u : ℝ) : regulator β U (U-u) = regulator β U u := by + simp only [regulator, sub_sub_cancel, min_comm] + +lemma regulator_continuous (β U : ℝ) : Continuous (regulator β U) := by + exact Real.continuous_exp.comp (continuous_const.mul + (continuous_id.min (continuous_const.sub continuous_id))) + +/-- Exact total regulator cost, independent of the length of the active clock. -/ +lemma integral_regulator {β U : ℝ} (hβ : 0 < β) (hU : 0 ≤ U) : + (∫ u in (0 : ℝ)..U, regulator β U u) = + 2 / β * (1 - Real.exp (-β * U / 2)) := by + have hi (a b : ℝ) : IntervalIntegrable (regulator β U) volume a b := + (regulator_continuous β U).intervalIntegrable _ _ + have he (a b : ℝ) : + (∫ u in a..b, Real.exp (-β * u)) = + (-β)⁻¹ * (Real.exp (-β * b) - Real.exp (-β * a)) := by + rw [intervalIntegral.integral_comp_mul_left _ (neg_ne_zero.mpr hβ.ne'), + integral_exp] + rfl + have hleft : (∫ u in (0 : ℝ)..U/2, regulator β U u) = + ∫ u in (0 : ℝ)..U/2, Real.exp (-β*u) := by + apply intervalIntegral.integral_congr + intro u hu + rw [uIcc_of_le (by linarith : (0 : ℝ) ≤ U/2)] at hu + exact regulator_eq_left hu.2 + have hright : (∫ u in U/2..U, regulator β U u) = + ∫ u in (0 : ℝ)..U/2, Real.exp (-β*u) := by + calc + _ = ∫ u in U/2..U, Real.exp (-β*(U-u)) := by + apply intervalIntegral.integral_congr + intro u hu + rw [uIcc_of_le (by linarith : U/2 ≤ U)] at hu + exact regulator_eq_right hu.1 + _ = _ := by + change (∫ u in U/2..U, (fun v : ℝ => Real.exp (-β*v)) (U-u)) = _ + rw [intervalIntegral.integral_comp_sub_left (f := fun v : ℝ => Real.exp (-β*v)) U] + congr 1 <;> ring + rw [← intervalIntegral.integral_add_adjacent_intervals (hi 0 (U/2)) (hi (U/2) U), + hleft, hright, he] + simp only [mul_zero, Real.exp_zero] + field_simp [hβ.ne'] + ring + +lemma integral_regulator_le {β U : ℝ} (hβ : 0 < β) (hU : 0 ≤ U) : + (∫ u in (0 : ℝ)..U, regulator β U u) ≤ 2 / β := by + rw [integral_regulator hβ hU] + exact mul_le_of_le_one_right (by positivity) (by linarith [Real.exp_pos (-β * U / 2)]) + +/-- The deterministic pair-interaction allowance obtained by shells of +`max uᵢ uⱼ`; see the interaction integral in the manuscript. -/ +def interactionBudget (a c : ℝ) : ℝ := + Real.exp (2*c) / (2*a*(1-Real.exp (2*c-a))) + +lemma interactionBudget_pos {a c : ℝ} (ha : 0 < a) (hc : 2*c < a) : + 0 < interactionBudget a c := by + unfold interactionBudget + exact div_pos (Real.exp_pos _) (mul_pos (by positivity) + (sub_pos.mpr (Real.exp_lt_one_iff.mpr (by linarith)))) + +lemma interaction_shell_series {a c : ℝ} (_ha : 0 < a) (hc : 2*c < a) : + HasSum (fun k : ℕ => Real.exp (2*c*((k:ℝ)+1)) * Real.exp (-a*k) / (2*a)) + (interactionBudget a c) := by + have hs := (hasSum_geometric_of_lt_one (Real.exp_pos (2*c-a)).le + (Real.exp_lt_one_iff.mpr (by linarith : 2*c-a < 0))).mul_left + (Real.exp (2*c)/(2*a)) + convert hs using 1 + · ext k + rw [← Real.exp_nat_mul, div_mul_eq_mul_div, ← Real.exp_add, ← Real.exp_add] + congr 2 + ring + · simp only [interactionBudget, div_eq_mul_inv, mul_inv_rev] + ring + +lemma weighted_shell_sum_le {a c : ℝ} (ha : 0 < a) (hc : 2*c < a) + (mass : ℕ → ℝ) (h0 : ∀ k, 0 ≤ mass k) + (hmass : ∀ k : ℕ, mass k ≤ Real.exp (-a*k)/(2*a)) : + Summable (fun k : ℕ => Real.exp (2*c*((k:ℝ)+1))*mass k) ∧ + (∑' k : ℕ, Real.exp (2*c*((k:ℝ)+1))*mass k) ≤ interactionBudget a c := by + have hs := interaction_shell_series ha hc + have hnonneg (k : ℕ) : 0 ≤ Real.exp (2*c*((k:ℝ)+1))*mass k := + mul_nonneg (Real.exp_pos _).le (h0 k) + have hle (k : ℕ) : Real.exp (2*c*((k:ℝ)+1))*mass k ≤ + Real.exp (2*c*((k:ℝ)+1))*Real.exp (-a*k)/(2*a) := by + simpa only [mul_div_assoc] using + mul_le_mul_of_nonneg_left (hmass k) (Real.exp_pos _).le + have hsum := Summable.of_nonneg_of_le hnonneg hle hs.summable + exact ⟨hsum, hs.tsum_eq ▸ hsum.tsum_le_tsum hle hs.summable⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointRegulatorTransport.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointRegulatorTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ccfce13fa31f360dda623ebab2a15c84218f173 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointRegulatorTransport.lean @@ -0,0 +1,280 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhysicalBudget + +namespace OAI + +/-! Deterministic transport of the two-ended regulator to physical time. +The single-point cost follows by change of variables along the actual +radius clock, and the pair cost follows from geometric interaction decay. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +/-- Change of variables for a regulator on any subinterval of its clock. +Only ordinary calculus is used here; no stochastic estimate is assumed. -/ +theorem regulator_clock_integral_le + {β U s T : ℝ} (hβ : 0 < β) (hU : 0 ≤ U) (hsT : s ≤ T) + (u speed : ℝ → ℝ) (hu : ContinuousOn u (Icc s T)) + (hspeed : ContinuousOn speed (Icc s T)) + (hdu : ∀ t ∈ Ioo s T, HasDerivWithinAt u (speed t) (Ioi t) t) + (hu0 : 0 ≤ u s) (huT : u T ≤ U) (hmono : u s ≤ u T) : + (∫ t in s..T, regulator β U (u t) * speed t) ≤ 2 / β := by + have he : (∫ t in s..T, regulator β U (u t) * speed t) = + ∫ v in u s..u T, regulator β U v := by + simpa only [Function.comp_apply] using + intervalIntegral.integral_comp_mul_deriv'' + (by simpa only [uIcc_of_le hsT] using hu) + (by simpa only [min_eq_left hsT, max_eq_right hsT] using hdu) + (by simpa only [uIcc_of_le hsT] using hspeed) + (regulator_continuous β U).continuousOn + rw [he] + apply le_trans _ (integral_regulator_le hβ hU) + exact intervalIntegral.integral_mono_interval hu0 hmono huT + (ae_of_all _ fun v => (regulator_pos β U v).le) + ((regulator_continuous β U).intervalIntegrable 0 U) + +/-- The radius clock measured from activation, in capacity-two time. +The clock derivative is the square of the Poisson rate. -/ +def activeRadiusClock (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (σ : ℝ≥0) (t : ℝ) : ℝ := + (Real.log ((2 * z.im) / fullRadius G t.toNNReal z) - + Real.log ((2 * z.im) / fullRadius G σ z)) / 4 + +@[simp] lemma activeRadiusClock_start (G : ℝ≥0 → ℂ → ℂ) (z : ℂ) (σ : ℝ≥0) : + activeRadiusClock G z σ σ = 0 := by + simp [activeRadiusClock] + +end SLEExactGauge.Multipoint + +namespace SLEExactGauge + +theorem IsCapacityTwoWitness.activeRadiusClock_hasDerivWithinAt + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (σ T : ℝ≥0) (z : ℂ) (hz : z ∈ survivingDomain γ T) + (t : ℝ) (ht : t ∈ Icc 0 (T : ℝ)) : + HasDerivWithinAt (Multipoint.activeRadiusClock G z σ) + (chartPoissonRate U G t.toNNReal z ^ 2) (Icc 0 (T : ℝ)) t := by + refine (((loewner_radius_clock_derivative hU hw T z hz t ht).sub_const + (Real.log ((2 * z.im) / fullRadius G σ z))).div_const 4).congr_deriv ?_ + simp only [chartPoissonRate, Complex.normSq_eq_norm_sq] + ring + +theorem IsCapacityTwoWitness.activeRadiusClock_continuousOn + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (σ T : ℝ≥0) (z : ℂ) (hz : z ∈ survivingDomain γ T) : + ContinuousOn (Multipoint.activeRadiusClock G z σ) (Icc 0 (T : ℝ)) := by + intro t ht + exact (hw.activeRadiusClock_hasDerivWithinAt hU σ T z hz t ht).continuousWithinAt + +theorem IsCapacityTwoWitness.activeRadiusClock_nonneg + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) : + 0 ≤ Multipoint.activeRadiusClock G z σ T := by + have h := (hw.radius_clock_strictMonoOn hU z T hz).monotoneOn + (show (σ : ℝ) ∈ Icc 0 (T : ℝ) from ⟨σ.coe_nonneg, hσT⟩) + (show (T : ℝ) ∈ Icc 0 (T : ℝ) from ⟨T.coe_nonneg, le_rfl⟩) hσT + simp only [Real.toNNReal_coe] at h + change 0 ≤ (Real.log ((2 * z.im) / fullRadius G (T : ℝ).toNNReal z) - + Real.log ((2 * z.im) / fullRadius G σ z)) / 4 + rw [Real.toNNReal_coe] + exact div_nonneg (sub_nonneg.mpr h) (by norm_num) + +/-- The physical conformal radius has the same ratio as the half-plane +radius. In particular, no derivative bound on `J` is needed. -/ +theorem IsCapacityTwoWitness.physical_radius_active_clock + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (J : ℂ → ℂ) (σ t : ℝ≥0) (z : ℂ) + (hσ : z ∈ survivingDomain γ σ) (ht : z ∈ survivingDomain γ t) : + physicalConformalRadius J G t z = physicalConformalRadius J G σ z * + Real.exp (-4 * Multipoint.activeRadiusClock G z σ t) := by + have hRσ := hw.fullRadius_positive hU σ z hσ + have hRt := hw.fullRadius_positive hU t z ht + have hz0 : 2 * z.im ≠ 0 := ne_of_gt (mul_pos (by norm_num) ht.1.1) + have he : -4 * Multipoint.activeRadiusClock G z σ t = + Real.log (fullRadius G t z / fullRadius G σ z) := by + rw [Multipoint.activeRadiusClock, Real.toNNReal_coe, + Real.log_div hz0 hRt.ne', Real.log_div hz0 hRσ.ne', + Real.log_div hRt.ne' hRσ.ne'] + ring + rw [he, Real.exp_log (div_pos hRt hRσ)] + unfold physicalConformalRadius + field_simp [hRσ.ne'] + +/-- One complete or partial active interval has regulator cost at most +`2 / β`, independently of its target-clock length. -/ +theorem IsCapacityTwoWitness.active_regulator_integral_le + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (σ T : ℝ≥0) (hσT : σ ≤ T) (z : ℂ) (hz : z ∈ survivingDomain γ T) + {β target : ℝ} (hβ : 0 < β) (htarget : 0 ≤ target) + (hclock : Multipoint.activeRadiusClock G z σ T ≤ target) : + (∫ t in (σ : ℝ)..(T : ℝ), + Multipoint.regulator β target (Multipoint.activeRadiusClock G z σ t) * + chartPoissonRate U G t.toNNReal z ^ 2) ≤ 2 / β := by + have hsub : Icc (σ : ℝ) (T : ℝ) ⊆ Icc (0 : ℝ) (T : ℝ) := + Icc_subset_Icc σ.coe_nonneg le_rfl + have hclockcont : ContinuousOn (Multipoint.activeRadiusClock G z σ) + (Icc (σ : ℝ) (T : ℝ)) := by + intro t ht + exact ((hw.activeRadiusClock_hasDerivWithinAt hU σ T z hz t (hsub ht)).mono + hsub).continuousWithinAt + apply Multipoint.regulator_clock_integral_le hβ htarget hσT + (Multipoint.activeRadiusClock G z σ) (fun t => chartPoissonRate U G t.toNNReal z ^ 2) + hclockcont ((hw.poissonRate_continuousOn hU T z hz).pow 2 |>.mono hsub) + · intro t ht + exact (hw.activeRadiusClock_hasDerivWithinAt hU σ T z hz t + ⟨σ.coe_nonneg.trans ht.1.le, ht.2.le⟩).hasDerivAt + (Icc_mem_nhds (σ.coe_nonneg.trans_lt ht.1) ht.2) |>.hasDerivWithinAt + · simp + · exact hclock + · simpa [Multipoint.activeRadiusClock] using + hw.activeRadiusClock_nonneg hU σ T hσT z hz + +/-- The inverse pair regulator is paid by the actual physical-domain +interaction budget. The terminal clock levels can be arbitrary. -/ +theorem IsCapacityTwoWitness.physical_pair_regulator_integral_le + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (s T : ℝ≥0) (hsT : s ≤ T) (z w : ℂ) + (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) (hne : z ≠ w) + (bz bw : ℝ) (hbz : bz ≤ dist (J z) (J w)) (hbw : bw ≤ dist (J z) (J w)) + {β M : ℝ} (hβ : 0 ≤ β) (hM : 0 ≤ M) (hdecay : 2 * (M * β) < 2) + (Uz Uw : ℝ) (u v : ℝ → ℝ) + (hu : ContinuousOn u (Icc (s : ℝ) (T : ℝ))) + (hv : ContinuousOn v (Icc (s : ℝ) (T : ℝ))) + (hu0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ u t) + (hv0 : ∀ t ∈ Icc (s : ℝ) (T : ℝ), 0 ≤ v t) + (hRu : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + physicalConformalRadius J G t.toNNReal z ≤ bz * Real.exp (-4 * u t)) + (hRv : ∀ t ∈ Icc (s : ℝ) (T : ℝ), + physicalConformalRadius J G t.toNNReal w ≤ bw * Real.exp (-4 * v t)) : + (∫ t in (s : ℝ)..(T : ℝ), + (Multipoint.regulator β Uz (u t) * Multipoint.regulator β Uw (v t)) ^ (-M) * + (chartPoissonRate U G t.toNNReal z * chartPoissonRate U G t.toNNReal w)) ≤ + Multipoint.interactionBudget 2 (M * β) := by + have hsub : Icc (s : ℝ) (T : ℝ) ⊆ Icc (0 : ℝ) (T : ℝ) := + Icc_subset_Icc s.coe_nonneg le_rfl + have hR := ((hw.poissonRate_continuousOn hU T z hz).mul + (hw.poissonRate_continuousOn hU T w hw')).mono hsub + have hreg := ((Multipoint.regulator_continuous β Uz).comp_continuousOn hu).mul + ((Multipoint.regulator_continuous β Uw).comp_continuousOn hv) + have hpw := hreg.rpow_const (p := -M) fun t _ => Or.inl + (mul_pos (Multipoint.regulator_pos _ _ _) (Multipoint.regulator_pos _ _ _)).ne' + apply le_trans (intervalIntegral.integral_mono_on hsT + ((hpw.mul hR).intervalIntegrable_of_Icc hsT) + (((Real.continuous_exp.comp_continuousOn + (continuousOn_const.mul (hu.add hv))).mul hR).intervalIntegrable_of_Icc hsT) ?_) + (hw.physical_pair_interaction_budget hU hgrowth J hJ hJinj s T hsT z w hz hw' hne + bz bw hbz hbw (mul_nonneg hM hβ) hdecay u v hu hv hu0 hv0 hRu hRv) + intro t ht + apply mul_le_mul_of_nonneg_right (Multipoint.pair_regulator_inv_power_le hβ hM) + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + exact mul_nonneg + (hw.poissonRate_nonneg _ z (survivingDomain_antitone γ htT hz)) + (hw.poissonRate_nonneg _ w (survivingDomain_antitone γ htT hw')) + +/-- The pair discount on a joint active interval, expressed entirely in +the actual radius clocks measured from the individual activation times. -/ +theorem IsCapacityTwoWitness.actual_pair_regulator_integral_le + {U : ℝ≥0 → ℝ} {γ : ℝ≥0 → ℂ} {G F : ℝ≥0 → ℂ → ℂ} + (hw : IsCapacityTwoWitness U γ G F) (hU : Continuous U) + (hgrowth : PublishedDiskUnivalentGrowth) + (J : ℂ → ℂ) (hJ : DifferentiableOn ℂ J upperHalfPlane) + (hJinj : InjOn J upperHalfPlane) + (σz σw s T : ℝ≥0) (hσz : σz ≤ s) (hσw : σw ≤ s) (hsT : s ≤ T) + (z w : ℂ) (hz : z ∈ survivingDomain γ T) (hw' : w ∈ survivingDomain γ T) + (hne : z ≠ w) + (hbz : physicalConformalRadius J G σz z ≤ dist (J z) (J w)) + (hbw : physicalConformalRadius J G σw w ≤ dist (J z) (J w)) + {β M : ℝ} (hβ : 0 ≤ β) (hM : 0 ≤ M) (hdecay : 2 * (M * β) < 2) + (Uz Uw : ℝ) : + (∫ t in (s : ℝ)..(T : ℝ), + (Multipoint.regulator β Uz (Multipoint.activeRadiusClock G z σz t) * + Multipoint.regulator β Uw (Multipoint.activeRadiusClock G w σw t)) ^ (-M) * + (chartPoissonRate U G t.toNNReal z * chartPoissonRate U G t.toNNReal w)) ≤ + Multipoint.interactionBudget 2 (M * β) := by + have hsub : Icc (s : ℝ) (T : ℝ) ⊆ Icc (0 : ℝ) (T : ℝ) := + Icc_subset_Icc s.coe_nonneg le_rfl + have hzσ := survivingDomain_antitone γ (hσz.trans hsT) hz + have hwσ := survivingDomain_antitone γ (hσw.trans hsT) hw' + apply hw.physical_pair_regulator_integral_le hU hgrowth J hJ hJinj s T hsT z w hz hw' + hne (physicalConformalRadius J G σz z) (physicalConformalRadius J G σw w) + hbz hbw hβ hM hdecay Uz Uw + (Multipoint.activeRadiusClock G z σz) (Multipoint.activeRadiusClock G w σw) + ((hw.activeRadiusClock_continuousOn hU σz T z hz).mono hsub) + ((hw.activeRadiusClock_continuousOn hU σw T w hw').mono hsub) + · intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hσzt : σz ≤ t.toNNReal := by + simpa only [Real.toNNReal_coe] using + Real.toNNReal_le_toNNReal ((show (σz : ℝ) ≤ s from hσz).trans ht.1) + simpa only [Real.coe_toNNReal _ (s.coe_nonneg.trans ht.1)] using + hw.activeRadiusClock_nonneg hU σz t.toNNReal hσzt z + (survivingDomain_antitone γ htT hz) + · intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + have hσwt : σw ≤ t.toNNReal := by + simpa only [Real.toNNReal_coe] using + Real.toNNReal_le_toNNReal ((show (σw : ℝ) ≤ s from hσw).trans ht.1) + simpa only [Real.coe_toNNReal _ (s.coe_nonneg.trans ht.1)] using + hw.activeRadiusClock_nonneg hU σw t.toNNReal hσwt w + (survivingDomain_antitone γ htT hw') + · intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + simpa only [Real.coe_toNNReal _ (s.coe_nonneg.trans ht.1)] using + (hw.physical_radius_active_clock hU J σz t.toNNReal z hzσ + (survivingDomain_antitone γ htT hz)).le + · intro t ht + have htT : t.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr ht.2 + simpa only [Real.coe_toNNReal _ (s.coe_nonneg.trans ht.1)] using + (hw.physical_radius_active_clock hU J σw t.toNNReal w hwσ + (survivingDomain_antitone γ htT hw')).le + +end SLEExactGauge + +namespace SLEExactGauge.Multipoint + +/-- The regulator is unchanged when moving from the capacity-two clock +`u` to the manuscript clock `κ * u`, provided its decay rate is scaled +by the inverse factor. -/ +lemma regulator_scale_clock {κ : ℝ} (hκ : 0 ≤ κ) (β U u : ℝ) : + regulator (κ * β) U u = regulator β (κ * U) (κ * u) := by + unfold regulator + rw [← mul_sub, ← mul_min_of_nonneg u (U-u) hκ] + congr 1 + ring + +lemma source_radius_clock_scale {κ : ℝ} (hκ : 0 < κ) (b u : ℝ) : + b * Real.exp (-2 * (2 / κ) * (κ * u)) = b * Real.exp (-4 * u) := by + congr 2 + field_simp [hκ.ne'] + ring + +lemma source_pair_exponent_scale (κ c u v : ℝ) : + Real.exp (c * (κ * u + κ * v)) = Real.exp ((κ * c) * (u + v)) := by + congr 1 + ring + +lemma source_pair_exponent_admissible {κ c : ℝ} (hκ : 0 < κ) : + 2 * (κ * c) < 2 ↔ 2 * c < 2 / κ := by + rw [lt_div_iff₀ hκ] + constructor <;> intro h <;> nlinarith + +lemma source_terminal_factor_scale (κ p u : ℝ) : + Real.exp ((κ * p) / 2 * u) = Real.exp (p / 2 * (κ * u)) := by + congr 1 + ring + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointSelectedRate.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointSelectedRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..4505c74667c5fe9c267ed8ff76a7ff6ddd11fa75 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointSelectedRate.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SLE.Multipoint.MultipointDiscountProcess +import OAI.Probability.SLE.Multipoint.MultipointStagedRate +import OAI.Probability.SLE.Multipoint.MultipointLocalizedStages + +namespace OAI + +/-! A bounded progressive discount rate that agrees with the actual +four-phase product cost before localization. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +theorem exists_localized_discount_rate + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (Function.uncurry B)) (hBc : ∀ ω, Continuous (fun t => B t ω)) + (Q : ℝ → Ω → ι → ℂ × ℝ) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t)) (hQc : ∀ ω, Continuous (fun t => Q t ω)) + (κ β : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (a U : ι → ℝ) + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (H : ℝ≥0) + (hlstop : ∀ σ ∈ l, IsStoppingTime + (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (σ ω : WithTop ℝ≥0))) + (hlbound : ∀ σ ∈ l, ∀ ω, σ ω ≤ H+1) (hρmem : ∀ k, ρ k ∈ l) + (hzero : (fun _ : Ω => (0 : ℝ≥0)) ∈ l) + (χ : Ω → ℝ≥0) + (hχstop : IsStoppingTime + (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (χ ω : WithTop ℝ≥0))) (hχbound : ∀ ω, χ ω ≤ H) + (R : ℝ) (hR : 0 ≤ R) + (hnorm : ∀ ω t, t ≤ χ ω → ‖(Q t ω,B t ω)‖ ≤ R) : + ∃ (r : ℝ≥0 → Ω → ℝ) (C : ℝ≥0), + Measurable (Function.uncurry r) ∧ + IsProgressive (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) r ∧ + (∀ t ω, 0 ≤ r t ω ∧ |r t ω| ≤ C) ∧ + (∀ ω t, t < χ ω → r t ω = + productDriftCost (patternActiveSet (phaseAt ρ t ω)) κ + (fun i => phaseRegulatorScale β (a i) (U i) (phaseAt ρ t ω i)) + (fun i => phaseRegulatorSlope β (phaseAt ρ t ω i)) (Q t ω) (B t ω)) := by + classical + have hex (A : Finset (ι × Fin 3)) := exists_bounded_discount_cost_process B hm hBm hBc + Q hQm hQa hQc (patternActiveSet (phaseOfPattern A)) κ hκ hκ8 + (fun i => phaseRegulatorScale β (a i) (U i) (phaseOfPattern A i)) + (fun i => phaseRegulatorSlope β (phaseOfPattern A i)) + (fun i _ => phaseRegulatorScale_pos _ _ _ _) R hR + choose g C hgm hgp hgc hgb hge using hex + let τ := localizedStage l H χ + have hτ (n : ℕ) := localizedStage_stopping _ l hlstop H χ hχstop n + have hρstop (k : ι × Fin 3) := hlstop (ρ k) (hρmem k) + let r := stagedPatternRate l.length Finset.univ ρ τ g + let C₀ : ℝ≥0 := ∑ k ∈ (Finset.range l.length).product (Finset.univ : Finset (ι × Fin 3)).powerset, C k.2 + refine ⟨r,C₀,?_,?_,?_,?_⟩ + · exact stagedPatternRate_measurable _ l.length Finset.univ ρ τ + (fun i _ => hρstop i) hτ g (fun A _ => hgm A) + · exact stagedPatternRate_progressive _ l.length Finset.univ ρ τ + (fun i _ => hρstop i) hτ g (fun A _ => hgp A) + · intro t ω + exact ⟨stagedPatternRate_nonneg l.length Finset.univ ρ τ g + (fun A _ u ω => (hgb A u ω).1) t ω, + stagedPatternRate_bound l.length Finset.univ ρ τ g C + (fun A _ u ω => (hgb A u ω).2) t ω⟩ + · intro ω t htχ + obtain ⟨n,hn,hnt,htn⟩ := exists_finite_stage (fun n => τ n ω) l.length t + (by rw [show τ 0 ω = 0 from localizedStage_zero l H χ hlbound hzero ω]; exact bot_le) + (by rwa [show τ l.length ω = χ ω from localizedStage_last l H χ hχbound ω]) + obtain ⟨A,hA,hω⟩ := switchPatternEvent_cover Finset.univ ρ (τ n) ω + have hphase : phaseAt ρ t ω = phaseOfPattern A := + (phaseAt_const_localized_interval ρ l H χ hlbound hρmem n ω t hnt htn).trans + (phaseAt_of_pattern ρ (τ n) A hω) + change stagedPatternRate l.length Finset.univ ρ τ g t ω = _ + rw [stagedPatternRate_eq l.length Finset.univ ρ τ g + (localizedStage_monotone l H χ hlbound) n hn A hA t ω hω hnt htn, + hge A t ω (hnorm ω t htχ.le), hphase] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointStagedRate.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointStagedRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..42299590bc7e918465303ed534445d95f343c0da --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointStagedRate.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock + +namespace OAI + +/-! The single adapted discount rate obtained by reading the current +finite stopping interval and its past-measurable switch pattern. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +def stagedPatternRate {Ω ι : Type*} [DecidableEq ι] + (N : ℕ) (s : Finset ι) (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (g : Finset ι → ℝ≥0 → Ω → ℝ) : ℝ≥0 → Ω → ℝ := + finiteSwitchRate ((Finset.range N).product s.powerset) + (fun k => τ k.1) (fun k => τ (k.1+1)) + (fun k => switchPatternEvent s ρ (τ k.1) k.2) (fun k => g k.2) + +theorem stagedPatternRate_eq {Ω ι : Type*} [DecidableEq ι] + (N : ℕ) (s : Finset ι) (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (g : Finset ι → ℝ≥0 → Ω → ℝ) (hmono : ∀ ω, Monotone (fun n => τ n ω)) + (n : ℕ) (hn : n < N) (A : Finset ι) (hA : A ∈ s.powerset) + (t : ℝ≥0) (ω : Ω) (hω : ω ∈ switchPatternEvent s ρ (τ n) A) + (hnt : τ n ω ≤ t) (htn : t < τ (n+1) ω) : + stagedPatternRate N s ρ τ g t ω = g A t ω := by + classical + unfold stagedPatternRate finiteSwitchRate + rw [Finset.sum_eq_single (n,A)] + · simp only [stoppedBranchRate, hω, hnt, htn, and_self, ite_true] + · rintro ⟨m,C⟩ hmem hneq + obtain ⟨_, hC⟩ := Finset.mem_product.mp hmem + change stoppedBranchRate (τ m) (τ (m+1)) (switchPatternEvent s ρ (τ m) C) (g C) t ω = 0 + unfold stoppedBranchRate + apply ite_eq_right + rintro ⟨hωC, hmt, htm⟩ + have hmn : m = n := by + rcases lt_trichotomy m n with h | h | h + · exact False.elim ((not_le_of_gt htm) ((hmono ω (Nat.succ_le_of_lt h)).trans hnt)) + · exact h + · exact False.elim ((not_le_of_gt htn) ((hmono ω (Nat.succ_le_of_lt h)).trans hmt)) + subst m + have hCA : C = A := switchPatternEvent_unique s ρ (τ n) + (Finset.mem_powerset.mp hC) (Finset.mem_powerset.mp hA) hωC hω + exact hneq (Prod.ext rfl hCA) + · intro h + exact False.elim (h (Finset.mem_product.mpr ⟨Finset.mem_range.mpr hn,hA⟩)) + +theorem stagedPatternRate_progressive {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [DecidableEq ι] + (ℱ : Filtration ℝ≥0 mΩ) (N : ℕ) (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (hρ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (ρ i ω : WithTop ℝ≥0))) + (hτ : ∀ n, IsStoppingTime ℱ (fun ω => (τ n ω : WithTop ℝ≥0))) + (g : Finset ι → ℝ≥0 → Ω → ℝ) (hg : ∀ A ∈ s.powerset, IsProgressive ℱ (g A)) : + IsProgressive ℱ (stagedPatternRate N s ρ τ g) := by + exact finiteSwitchRate_progressive ℱ ((Finset.range N).product s.powerset) + (fun k => τ k.1) (fun k => τ (k.1+1)) + (fun k _ => hτ k.1) (fun k _ => hτ (k.1+1)) + (fun k => switchPatternEvent s ρ (τ k.1) k.2) + (fun k _ => switchPatternEvent_measurable ℱ s ρ (τ k.1) hρ (hτ k.1) k.2) + (fun k => g k.2) (fun k hk => hg k.2 (Finset.mem_product.mp hk).2) + +theorem stagedPatternRate_measurable {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [DecidableEq ι] + (ℱ : Filtration ℝ≥0 mΩ) (N : ℕ) (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (hρ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (ρ i ω : WithTop ℝ≥0))) + (hτ : ∀ n, IsStoppingTime ℱ (fun ω => (τ n ω : WithTop ℝ≥0))) + (g : Finset ι → ℝ≥0 → Ω → ℝ) + (hg : ∀ A ∈ s.powerset, Measurable (Function.uncurry (g A))) : + Measurable (Function.uncurry (stagedPatternRate N s ρ τ g)) := by + apply finiteSwitchRate_measurable + · exact fun k _ => stopping_time_measurable_nnreal (hτ k.1) + · exact fun k _ => stopping_time_measurable_nnreal (hτ (k.1+1)) + · exact fun k _ => (hτ k.1).measurableSpace_le _ + (switchPatternEvent_measurable ℱ s ρ (τ k.1) hρ (hτ k.1) k.2) + · exact fun k hk => hg k.2 (Finset.mem_product.mp hk).2 + +lemma stagedPatternRate_nonneg {Ω ι : Type*} [DecidableEq ι] + (N : ℕ) (s : Finset ι) (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (g : Finset ι → ℝ≥0 → Ω → ℝ) (hg : ∀ A ∈ s.powerset, ∀ t ω, 0 ≤ g A t ω) + (t : ℝ≥0) (ω : Ω) : 0 ≤ stagedPatternRate N s ρ τ g t ω := + finiteSwitchRate_nonneg _ _ _ _ _ + (fun k hk => hg k.2 (Finset.mem_product.mp hk).2) t ω + +lemma stagedPatternRate_bound {Ω ι : Type*} [DecidableEq ι] + (N : ℕ) (s : Finset ι) (ρ : ι → Ω → ℝ≥0) (τ : ℕ → Ω → ℝ≥0) + (g : Finset ι → ℝ≥0 → Ω → ℝ) (C : Finset ι → ℝ≥0) + (hg : ∀ A ∈ s.powerset, ∀ t ω, |g A t ω| ≤ C A) (t : ℝ≥0) (ω : Ω) : + |stagedPatternRate N s ρ τ g t ω| ≤ + (∑ k ∈ (Finset.range N).product s.powerset, C k.2 : ℝ≥0) := + finiteSwitchRate_norm_le ((Finset.range N).product s.powerset) + (fun k => τ k.1) (fun k => τ (k.1+1)) + (fun k => switchPatternEvent s ρ (τ k.1) k.2) (fun k => g k.2) (fun k => C k.2) + (fun k hk => hg k.2 (Finset.mem_product.mp hk).2) t ω + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointStateBounds.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointStateBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7329543b629d38ca039b5ff69144eae5ff048cb --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointStateBounds.lean @@ -0,0 +1,50 @@ +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock + +namespace OAI + +/-! Deterministic compact bounds for the adapted state and its discount. +Only the Brownian coordinate needs a separate stopping bound. -/ + +noncomputable section +open Set MeasureTheory +open scoped NNReal + +namespace SLEExactGauge.Multipoint + +lemma lipschitz_state_norm_le {E : Type*} [NormedAddCommGroup E] + (Q : ℝ → E) (L : ℝ≥0) (hQ : LipschitzWith L Q) (H t : ℝ) + (ht : 0 ≤ t) (htH : t ≤ H) : ‖Q t‖ ≤ ‖Q 0‖+(L : ℝ)*H := by + have hd : ‖Q t-Q 0‖ ≤ (L : ℝ)*t := by + simpa only [dist_eq_norm, sub_zero, Real.norm_eq_abs, abs_of_nonneg ht] using hQ.dist_le_mul t 0 + calc + ‖Q t‖ = ‖(Q t-Q 0)+Q 0‖ := by rw [sub_add_cancel] + _ ≤ ‖Q t-Q 0‖+‖Q 0‖ := norm_add_le _ _ + _ ≤ (L : ℝ)*H+‖Q 0‖ := add_le_add + (hd.trans (mul_le_mul_of_nonneg_left htH L.coe_nonneg)) le_rfl + _ = _ := add_comm _ _ + +lemma discounted_state_norm_bound {Ω E : Type*} [NormedAddCommGroup E] + (Q : ℝ → Ω → E) (L : ℝ≥0) (hQ : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (q₀ : E) (hQ0 : ∀ ω, Q 0 ω = q₀) + (r : ℝ≥0 → Ω → ℝ) (hr : ∀ ω, Measurable (fun t => r t ω)) + (C : ℝ≥0) (hrb : ∀ t ω, |r t ω| ≤ C) + (B : ℝ≥0 → Ω → ℝ) (χ : Ω → ℝ≥0) (H : ℝ≥0) (hχ : ∀ ω, χ ω ≤ H) + (M : ℝ) (hB : ∀ ω t, t ≤ χ ω → ‖B t ω‖ ≤ M) + (ω : Ω) (t : ℝ) (ht : 0 ≤ t) (htχ : t ≤ (χ ω : ℝ)) : + ‖((Q t ω,discountClock r t ω),B t.toNNReal ω)‖ ≤ + max (max (‖q₀‖+(L : ℝ)*(H : ℝ)) ((C : ℝ)*(H : ℝ))) M := by + have htH : t ≤ (H : ℝ) := htχ.trans (by exact_mod_cast hχ ω) + have hq := lipschitz_state_norm_le (fun t => Q t ω) L (hQ ω) H t ht htH + rw [hQ0 ω] at hq + have hc := lipschitz_state_norm_le (fun t => discountClock r t ω) C + (discountClock_lipschitz_of_measurable r hr C hrb ω) H t ht htH + rw [discountClock_initial, norm_zero, zero_add] at hc + have hbt : t.toNNReal ≤ χ ω := Real.toNNReal_le_iff_le_coe.mpr htχ + simp only [Prod.norm_def] + exact max_le_max (max_le_max hq hc) (hB ω t.toNNReal hbt) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedCoordinates.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfb5770e9b92d3351dabf39a292a6d17a5780ec6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedCoordinates.lean @@ -0,0 +1,167 @@ +import OAI.Probability.SLE.Multipoint.MultipointPiecewiseClock + +namespace OAI + +/-! Each completed multipoint coordinate is frozen at its own stopping +time. The finite vector remains an adapted Lipschitz state, with the +expected stopped velocity almost everywhere in time. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +def stoppedCoordinateState {Ω ι : Type*} + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (t : ℝ) (ω : Ω) (i : ι) : ℂ × ℝ := + Q (min t (τ i ω : ℝ)) ω i + +def stoppedCoordinateVelocity {Ω ι : Type*} + (V : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (t : ℝ) (ω : Ω) (i : ι) : ℂ × ℝ := + if t < (τ i ω : ℝ) then V t ω i else 0 + +lemma stoppedCoordinateState_measurable {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) + (hQ : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hτ : ∀ i, Measurable (τ i)) : + Measurable (fun p : ℝ × Ω => stoppedCoordinateState Q τ p.1 p.2) := by + apply Measurable.of_eval + intro i + have hQi : Measurable (fun p : ℝ × Ω => Q p.1 p.2 i) := + (measurable_pi_apply i).comp hQ + have htime : Measurable (fun p : ℝ × Ω => min p.1 (τ i p.2 : ℝ)) := + measurable_fst.min (NNReal.continuous_coe.measurable.comp ((hτ i).comp measurable_snd)) + exact hQi.comp (htime.prodMk measurable_snd) + +lemma stoppedCoordinateVelocity_measurable {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (V : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) + (hV : Measurable (fun p : ℝ × Ω => V p.1 p.2)) + (hτ : ∀ i, Measurable (τ i)) : + Measurable (fun p : ℝ × Ω => stoppedCoordinateVelocity V τ p.1 p.2) := by + apply Measurable.of_eval + intro i + apply Measurable.ite _ ((measurable_pi_apply i).comp hV) measurable_const + exact measurableSet_lt measurable_fst + (NNReal.continuous_coe.measurable.comp ((hτ i).comp measurable_snd)) + +lemma stoppedCoordinateState_lipschitz {Ω ι : Type*} [Fintype ι] + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (L : ℝ≥0) + (hQ : ∀ ω, LipschitzWith L (fun t => Q t ω)) (ω : Ω) : + LipschitzWith L (fun t => stoppedCoordinateState Q τ t ω) := by + apply LipschitzWith.of_dist_le_mul + intro t u + apply (dist_pi_le_iff (mul_nonneg L.coe_nonneg dist_nonneg)).mpr + intro i + have hmin := (LipschitzWith.id.min_const (τ i ω : ℝ)).dist_le_mul t u + calc + dist (Q (min t (τ i ω : ℝ)) ω i) (Q (min u (τ i ω : ℝ)) ω i) ≤ + dist (Q (min t (τ i ω : ℝ)) ω) (Q (min u (τ i ω : ℝ)) ω) := + dist_le_pi_dist _ _ i + _ ≤ (L : ℝ) * dist (min t (τ i ω : ℝ)) (min u (τ i ω : ℝ)) := + (hQ ω).dist_le_mul _ _ + _ ≤ (L : ℝ) * dist t u := by + apply mul_le_mul_of_nonneg_left _ L.coe_nonneg + simpa only [NNReal.coe_one, one_mul, id_eq] using hmin + +lemma stoppedCoordinateVelocity_bound {Ω ι : Type*} [Fintype ι] + (V : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (L : ℝ≥0) + (hV : ∀ t ω, ‖V t ω‖ ≤ L) (t : ℝ) (ω : Ω) : + ‖stoppedCoordinateVelocity V τ t ω‖ ≤ L := by + apply (pi_norm_le_iff_of_nonneg L.coe_nonneg).mpr + intro i + unfold stoppedCoordinateVelocity + split_ifs + · exact (norm_le_pi_norm (V t ω) i).trans (hV t ω) + · simpa only [norm_zero] using L.coe_nonneg + +lemma stoppedCoordinateState_ae_derivative {Ω ι : Type*} [Fintype ι] + (Q V : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) + (hQd : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t) + (ω : Ω) : ∀ᵐ t : ℝ, 0 < t → + HasDerivAt (fun u => stoppedCoordinateState Q τ u ω) + (stoppedCoordinateVelocity V τ t ω) t := by + have hne : ∀ᵐ t : ℝ, ∀ i, t ≠ (τ i ω : ℝ) := + ae_all_iff.mpr (fun i => volume.ae_ne (τ i ω : ℝ)) + filter_upwards [hQd ω, hne] with t ht hne + intro ht0 + apply hasDerivAt_pi.mpr + intro i + by_cases hti : t < (τ i ω : ℝ) + · have hd := hasDerivAt_pi.mp (ht ht0) i + have he : (fun u => stoppedCoordinateState Q τ u ω i) =ᶠ[𝓝 t] (fun u => Q u ω i) := by + filter_upwards [eventually_lt_nhds hti] with u hu + simp only [stoppedCoordinateState, min_eq_left hu.le] + simpa only [stoppedCoordinateVelocity, ite_eq_left hti] using hd.congr_of_eventuallyEq he + · have hit : (τ i ω : ℝ) < t := lt_of_le_of_ne (le_of_not_gt hti) (hne i).symm + have he : (fun u => stoppedCoordinateState Q τ u ω i) =ᶠ[𝓝 t] + (fun _ => Q (τ i ω : ℝ) ω i) := by + filter_upwards [eventually_gt_nhds hit] with u hu + simp only [stoppedCoordinateState, min_eq_right hu.le] + simpa only [stoppedCoordinateVelocity, ite_eq_right hti] using + (hasDerivAt_const t (Q (τ i ω : ℝ) ω i)).congr_of_eventuallyEq he + +lemma stoppedCoordinateState_adapted {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (ℱ : Filtration ℝ≥0 mΩ) (Q : ℝ → Ω → ι → ℂ × ℝ) + (τ : ι → Ω → ℝ≥0) (L : ℝ≥0) + (hQa : Adapted ℱ (fun t : ℝ≥0 => Q t)) + (hQl : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (hτ : ∀ i, IsStoppingTime ℱ (fun ω => (τ i ω : WithTop ℝ≥0))) : + Adapted ℱ (fun t : ℝ≥0 => stoppedCoordinateState Q τ t) := by + intro t + let : MeasurableSpace Ω := ℱ t + apply Measurable.of_eval + intro i + have hQi : StronglyAdapted ℱ (fun t : ℝ≥0 => fun ω => Q t ω i) := fun u => + ((measurable_pi_apply i).comp (hQa u)).stronglyMeasurable + have hQc (ω : Ω) : Continuous (fun u : ℝ≥0 => Q u ω i) := + ((continuous_apply i).comp (hQl ω).continuous).comp NNReal.continuous_coe + have hs := ((hQi.stoppedProcess hQc (hτ i)) t).measurable + convert hs using 1 + funext ω + simp only [stoppedCoordinateState, MeasureTheory.stoppedProcess, ← WithTop.coe_min, + WithTop.untopA, WithTop.untopD_coe, NNReal.coe_min] + +@[simp] lemma stoppedCoordinateState_initial {Ω ι : Type*} + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) (ω : Ω) : + stoppedCoordinateState Q τ 0 ω = Q 0 ω := by + funext i + simp only [stoppedCoordinateState, min_eq_left (τ i ω).coe_nonneg] + +lemma stoppedCoordinateState_frozen {Ω ι : Type*} + (Q : ℝ → Ω → ι → ℂ × ℝ) (τ : ι → Ω → ℝ≥0) + (t : ℝ) (ω : Ω) (i : ι) (ht : (τ i ω : ℝ) ≤ t) : + stoppedCoordinateState Q τ t ω i = Q (τ i ω : ℝ) ω i := by + rw [stoppedCoordinateState, min_eq_right ht] + +/-- Stop each coordinate separately while preserving all state hypotheses +of the compact Brownian field adapter. -/ +theorem stoppedCoordinateState_regular {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] + (ℱ : Filtration ℝ≥0 mΩ) (Q V : ℝ → Ω → ι → ℂ × ℝ) + (τ : ι → Ω → ℝ≥0) (L : ℝ≥0) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted ℱ (fun t : ℝ≥0 => Q t)) + (hQl : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (hVm : Measurable (fun p : ℝ × Ω => V p.1 p.2)) + (hVb : ∀ t ω, ‖V t ω‖ ≤ L) + (hQd : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => Q u ω) (V t ω) t) + (hτ : ∀ i, IsStoppingTime ℱ (fun ω => (τ i ω : WithTop ℝ≥0))) : + Measurable (fun p : ℝ × Ω => stoppedCoordinateState Q τ p.1 p.2) ∧ + Adapted ℱ (fun t : ℝ≥0 => stoppedCoordinateState Q τ t) ∧ + (∀ ω, LipschitzWith L (fun t => stoppedCoordinateState Q τ t ω)) ∧ + Measurable (fun p : ℝ × Ω => stoppedCoordinateVelocity V τ p.1 p.2) ∧ + (∀ t ω, ‖stoppedCoordinateVelocity V τ t ω‖ ≤ L) ∧ + (∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun u => stoppedCoordinateState Q τ u ω) + (stoppedCoordinateVelocity V τ t ω) t) := by + have hτm (i : ι) : Measurable (τ i) := stopping_time_measurable_nnreal (hτ i) + exact ⟨stoppedCoordinateState_measurable Q τ hQm hτm, + stoppedCoordinateState_adapted ℱ Q τ L hQa hQl hτ, + stoppedCoordinateState_lipschitz Q τ L hQl, + stoppedCoordinateVelocity_measurable V τ hVm hτm, + stoppedCoordinateVelocity_bound V τ L hVb, + stoppedCoordinateState_ae_derivative Q V τ hQd⟩ + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedProduct.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b9807b9ef7c1d45dbea270850c60f0287039a8c --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointStoppedProduct.lean @@ -0,0 +1,91 @@ +import OAI.Probability.SLE.Multipoint.MultipointDiscountProcess +import OAI.Probability.SLE.Stochastic.BrownianOptionalIntervals + +namespace OAI + +/-! The actual discounted regularized product has nonincreasing conditional +expectation on each localized interval of constant active pattern. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace SLEExactGauge.Multipoint + +theorem discounted_product_optional_interval_le + {Ω ι : Type*} [mΩ : MeasurableSpace Ω] [Fintype ι] [DecidableEq ι] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (Q V : ℝ → Ω → (ι → ℂ × ℝ)) (r : ℝ≥0 → Ω → ℝ) + (s : Finset ι) (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (hσ : ∀ i ∈ s, σ i ≤ 1) + (φ : ((ι → ℂ × ℝ) × ℝ) × ℝ → ℝ) (K : ℝ≥0) + (hF : SmoothTimeBrownianField B hm K + (fun t ω x => φ ((Q t ω,discountClock r t ω),x)) + (fun t ω x => fderiv ℝ φ ((Q t ω,discountClock r t ω),x) + ((V t ω,r t ω),0))) + (R : ℝ) + (he : ∀ z x, ‖(z,x)‖ ≤ R → φ (z,x) = discountedProduct s κ D σ z x) + (heD : ∀ z x, ‖(z,x)‖ ≤ R → fderiv ℝ φ (z,x) = + fderiv ℝ (fun p => discountedProduct s κ D σ p.1 p.2) (z,x)) + (he2 : ∀ z x, ‖(z,x)‖ ≤ R → iteratedDeriv 2 (fun y => φ (z,y)) x = + iteratedDeriv 2 (discountedProduct s κ D σ z) x) + (a b : Ω → ℝ≥0) + (ha : IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (a ω : WithTop ℝ≥0))) + (hb : IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (b ω : WithTop ℝ≥0))) + (hab : ∀ ω, a ω ≤ b ω) (T : ℝ≥0) (hbT : ∀ ω, b ω ≤ T) + {A : Set Ω} (hA : MeasurableSet[ha.measurableSpace] A) + (hnorm : ∀ ω ∈ A, ∀ u, (a ω : ℝ) ≤ u → u ≤ (b ω : ℝ) → + ‖((Q u ω,discountClock r u ω),B u.toNNReal ω)‖ ≤ R) + (hδ : ∀ ω ∈ A, ∀ u, (a ω : ℝ) ≤ u → u < (b ω : ℝ) → + ∀ i ∈ s, branchRegulator κ (D i) (σ i) (Q u ω i) ≤ 1) + (hV : ∀ ω ∈ A, ∀ u, (a ω : ℝ) ≤ u → u < (b ω : ℝ) → + ∀ i ∈ s, V u ω i = physicalLogLoewnerField + (Real.sqrt κ*B u.toNNReal ω) (Q u ω i)) + (hr : ∀ ω ∈ A, ∀ u, (a ω : ℝ) ≤ u → u < (b ω : ℝ) → + r u.toNNReal ω = productDriftCost s κ D σ (Q u ω) (B u.toNNReal ω)) : + IntegrableOn (fun ω => discountedProduct s κ D σ + (Q (b ω) ω,discountClock r (b ω) ω) (B (b ω) ω)) A P ∧ + IntegrableOn (fun ω => discountedProduct s κ D σ + (Q (a ω) ω,discountClock r (a ω) ω) (B (a ω) ω)) A P ∧ + (∫ ω in A, discountedProduct s κ D σ + (Q (b ω) ω,discountClock r (b ω) ω) (B (b ω) ω) ∂P) ≤ + ∫ ω in A, discountedProduct s κ D σ + (Q (a ω) ω,discountClock r (a ω) ω) (B (a ω) ω) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hAm : MeasurableSet A := ha.measurableSpace_le _ hA + have habe (ω : Ω) : (a ω : ℝ) ≤ (b ω : ℝ) := by exact_mod_cast hab ω + have hea : (fun ω => φ ((Q (a ω) ω,discountClock r (a ω) ω),B (a ω) ω)) + =ᵐ[P.restrict A] (fun ω => discountedProduct s κ D σ + (Q (a ω) ω,discountClock r (a ω) ω) (B (a ω) ω)) := by + filter_upwards [ae_restrict_mem hAm] with ω hω + apply he + simpa only [Real.toNNReal_coe] using hnorm ω hω (a ω) le_rfl (habe ω) + have heb : (fun ω => φ ((Q (b ω) ω,discountClock r (b ω) ω),B (b ω) ω)) + =ᵐ[P.restrict A] (fun ω => discountedProduct s κ D σ + (Q (b ω) ω,discountClock r (b ω) ω) (B (b ω) ω)) := by + filter_upwards [ae_restrict_mem hAm] with ω hω + apply he + simpa only [Real.toNNReal_coe] using hnorm ω hω (b ω) (habe ω) le_rfl + have hIb := hF.eval_stopped_integrable (P := P.restrict A) hBm + (stopping_time_measurable_nnreal hb) + have hIa := hF.eval_stopped_integrable (P := P.restrict A) hBm + (stopping_time_measurable_nnreal ha) + refine ⟨hIb.congr heb, hIa.congr hea, ?_⟩ + rw [← integral_congr_ae heb, ← integral_congr_ae hea] + apply brownian_time_field_optional_interval_le hB hm hBm hBc hF a b ha hb hab T hbT hA + intro ω hω u hau hub + exact compact_discounted_process_drift_nonpos B Q V r s κ hκ hκ8 D σ φ u + (le_trans (a ω).coe_nonneg hau) ω hD hσ (hδ ω hω u hau hub) + (hV ω hω u hau hub) (hr ω hω u hau hub) + (heD _ _ (hnorm ω hω u hau hub.le)) (he2 _ _ (hnorm ω hω u hau hub.le)) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointSuccess.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointSuccess.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4cd903721ea0b06c76af68056f24722c137d568 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointSuccess.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SLE.Multipoint.MultipointCutoff + +namespace OAI + +/-! The terminal probability step for the multipoint product. Analytic +estimates enter through the expected stopped product and its deterministic +lower bound on success; completed points have already been frozen. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal BigOperators + +namespace SLEExactGauge.Multipoint + +lemma measure_le_of_eventual_stopped_products + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (E : Set Ω) (cutoff : ℕ → Set Ω) (X : ℕ → Ω → ℝ≥0∞) + (q : ℝ) (hq : 0 < q) + (hcover : ∀ ω ∈ E, ∀ᶠ n : ℕ in atTop, ω ∈ cutoff n) + (hm : ∀ n, AEMeasurable (X n) P) + (hmean : ∀ n, (∫⁻ ω, X n ω ∂P) ≤ 1) + (hterminal : ∀ n ω, ω ∈ cutoff n → ENNReal.ofReal q ≤ X n ω) : + P E ≤ ENNReal.ofReal q⁻¹ := by + apply measure_le_of_eventual_cutoffs P E cutoff _ hcover + intro n + have hsub : cutoff n ⊆ {ω | ENNReal.ofReal q ≤ X n ω} := hterminal n + have hb := (measure_mono hsub).trans + (meas_ge_le_lintegral_div (hm n) (ne_of_gt (ENNReal.ofReal_pos.mpr hq)) ENNReal.ofReal_ne_top) + have hle : (∫⁻ ω, X n ω ∂P) / ENNReal.ofReal q ≤ 1 / ENNReal.ofReal q := by + exact mul_le_mul' (hmean n) le_rfl + apply hb.trans + simpa only [one_div, ENNReal.ofReal_inv_of_pos hq] using hle + +def successBarrier (p K : ℝ) {ι : Type*} (s : Finset ι) (U : ι → ℝ) : ℝ := + Real.exp (-K) * (3 : ℝ)^(-(s.card : ℤ)) * Real.exp (p/2 * ∑ i ∈ s, U i) + +lemma successBarrier_pos (p K : ℝ) {ι : Type*} (s : Finset ι) (U : ι → ℝ) : + 0 < successBarrier p K s U := by unfold successBarrier; positivity + +lemma successBarrier_inv (p K : ℝ) {ι : Type*} (s : Finset ι) (U : ι → ℝ) : + (successBarrier p K s U)⁻¹ = + (3 : ℝ)^s.card * Real.exp K * Real.exp (-p/2 * ∑ i ∈ s, U i) := by + unfold successBarrier + rw [mul_inv_rev, mul_inv_rev, ← Real.exp_neg, ← Real.exp_neg] + simp only [neg_neg, zpow_neg, inv_inv, zpow_natCast] + rw [show -(p/2 * ∑ i ∈ s, U i) = -p/2 * ∑ i ∈ s, U i by ring] + ring + +lemma radius_target_exponential {a p b e : ℝ} (ha : 0 < a) + (hb : 0 < b) (he : 0 < e) : + Real.exp (-p/2 * (1/(2*a)*Real.log (b/e))) = (e/b)^(p/(4*a)) := by + rw [Real.rpow_def_of_pos (div_pos he hb), Real.log_div he.ne' hb.ne', + Real.log_div hb.ne' he.ne'] + congr 1 + field_simp + ring + +lemma radius_targets_exponential {ι : Type*} (s : Finset ι) + {a p : ℝ} (ha : 0 < a) (b e : ι → ℝ) + (hb : ∀ i ∈ s, 0 < b i) (he : ∀ i ∈ s, 0 < e i) : + Real.exp (-p/2 * ∑ i ∈ s, (1/(2*a)*Real.log (b i/e i))) = + ∏ i ∈ s, (e i/b i)^(p/(4*a)) := by + rw [Finset.mul_sum, Real.exp_sum] + exact Finset.prod_congr rfl (fun i hi => radius_target_exponential ha (hb i hi) (he i hi)) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointSwitchPatterns.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointSwitchPatterns.lean new file mode 100644 index 0000000000000000000000000000000000000000..b588451e9b5ea7adbfa0a336620d46fc1d1553ed --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointSwitchPatterns.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SLE.Multipoint.MultipointSwitches + +namespace OAI + +/-! The active/completed/midpoint pattern at a switch is a finite, +stopped-past measurable partition. This supplies the actual branch events +for the finite-field conditional optional inequality. -/ + +noncomputable section +open Set MeasureTheory ProbabilityTheory +open scoped NNReal BigOperators + +namespace SLEExactGauge.Multipoint + +def switchPatternEvent {Ω ι : Type*} (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) (A : Finset ι) : Set Ω := + {ω | ∀ i ∈ s, ρ i ω ≤ τ ω ↔ i ∈ A} + +theorem switchPatternEvent_measurable {Ω ι : Type*} [mΩ : MeasurableSpace Ω] + (ℱ : Filtration ℝ≥0 mΩ) (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) + (hρ : ∀ i ∈ s, IsStoppingTime ℱ (fun ω => (ρ i ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) (A : Finset ι) : + MeasurableSet[hτ.measurableSpace] (switchPatternEvent s ρ τ A) := by + classical + have he : switchPatternEvent s ρ τ A = ⋂ i ∈ s, + if i ∈ A then {ω | ρ i ω ≤ τ ω} else {ω | ρ i ω ≤ τ ω}ᶜ := by + ext ω + simp only [switchPatternEvent, mem_ofPred_eq, mem_iInter] + apply forall_congr' + intro i + apply forall_congr' + intro _ + by_cases hi : i ∈ A <;> simp [hi] + rw [he] + apply s.measurableSet_biInter + intro i hi + have hm : MeasurableSet[hτ.measurableSpace] {ω | ρ i ω ≤ τ ω} := by + simpa only [WithTop.coe_le_coe] using (hρ i hi).measurableSet_stopping_time_le hτ + split_ifs + · exact hm + · exact hm.compl + +theorem switchPatternEvent_unique {Ω ι : Type*} [DecidableEq ι] (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) {A B : Finset ι} + (hA : A ⊆ s) (hB : B ⊆ s) {ω : Ω} + (hωA : ω ∈ switchPatternEvent s ρ τ A) + (hωB : ω ∈ switchPatternEvent s ρ τ B) : A = B := by + apply Finset.ext + intro i + by_cases hi : i ∈ s + · exact (hωA i hi).symm.trans (hωB i hi) + · exact iff_of_false (fun h => hi (hA h)) (fun h => hi (hB h)) + +theorem switchPatternEvent_cover {Ω ι : Type*} [DecidableEq ι] (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) (ω : Ω) : + ∃ A ∈ s.powerset, ω ∈ switchPatternEvent s ρ τ A := by + refine ⟨s.filter (fun i => ρ i ω ≤ τ ω), Finset.mem_powerset.mpr (Finset.filter_subset _ _), ?_⟩ + intro i hi + simp only [Finset.mem_filter, hi, true_and] + +theorem sum_switchPattern_fields {Ω ι : Type*} [DecidableEq ι] (s : Finset ι) + (ρ : ι → Ω → ℝ≥0) (τ : Ω → ℝ≥0) (F : Finset ι → Ω → ℝ) + (X : Ω → ℝ) + (hF : ∀ A ∈ s.powerset, ∀ ω ∈ switchPatternEvent s ρ τ A, F A ω = X ω) : + (fun ω => ∑ A ∈ s.powerset, (switchPatternEvent s ρ τ A).indicator (F A) ω) = X := by + classical + funext ω + obtain ⟨A, hA, hωA⟩ := switchPatternEvent_cover s ρ τ ω + rw [Finset.sum_eq_single A] + · rw [indicator_of_mem hωA, hF A hA ω hωA] + · intro B hB hBA + apply indicator_of_notMem + intro hωB + exact hBA (switchPatternEvent_unique s ρ τ (Finset.mem_powerset.mp hB) + (Finset.mem_powerset.mp hA) hωB hωA) + · exact fun h => False.elim (h hA) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointSwitches.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointSwitches.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1515aff858d4f7bff565eb83eb0a43299f607e2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointSwitches.lean @@ -0,0 +1,168 @@ +import OAI.Probability.SLE.Stochastic.BrownianOptionalIntervals +import OAI.Probability.SLE.Multipoint.MultipointAngular + +namespace OAI + +/-! Finite switching for the regularized multipoint product. Smooth +pieces may change at bounded stopping times, provided the jumps are +downward. A completed factor can therefore remain constant on all later +pieces without any condition on its subsequent lifetime. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal BigOperators + +namespace SLEExactGauge + +/-- At a switching time the active/completed pattern has only finitely +many possibilities. Apply the conditional interval estimate on each +past-measurable branch and sum. The branch formula also covers several +simultaneous switches. -/ +theorem brownian_finite_branch_optional_interval_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (σ τ : Ω → ℝ≥0) + (hσ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (σ ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ ω : WithTop ℝ≥0))) + (hστ : ∀ ω, σ ω ≤ τ ω) (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) + {ι : Type*} (s : Finset ι) (A : ι → Set Ω) + (hA : ∀ i ∈ s, MeasurableSet[hσ.measurableSpace] (A i)) + (K : ι → ℝ≥0) (F a : ι → ℝ≥0 → Ω → ℝ → ℝ) + (hF : ∀ i ∈ s, SmoothTimeBrownianField B hm (K i) (F i) (a i)) + (hdrift : ∀ i ∈ s, ∀ ω ∈ A i, ∀ u, + (σ ω : ℝ) ≤ u → u < (τ ω : ℝ) → brownianFieldDrift B (F i) (a i) u ω ≤ 0) : + (∫ ω, ∑ i ∈ s, (A i).indicator + (fun ω => F i (τ ω) ω (B (τ ω) ω)) ω ∂P) ≤ + ∫ ω, ∑ i ∈ s, (A i).indicator + (fun ω => F i (σ ω) ω (B (σ ω) ω)) ω ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hAi (i : ι) (hi : i ∈ s) : MeasurableSet (A i) := + hσ.measurableSpace_le _ (hA i hi) + have hleft (i : ι) (hi : i ∈ s) : Integrable ((A i).indicator + (fun ω => F i (τ ω) ω (B (τ ω) ω))) P := + ((hF i hi).eval_stopped_integrable hBm (stopping_time_measurable_nnreal hτ)).indicator + (hAi i hi) + have hright (i : ι) (hi : i ∈ s) : Integrable ((A i).indicator + (fun ω => F i (σ ω) ω (B (σ ω) ω))) P := + ((hF i hi).eval_stopped_integrable hBm (stopping_time_measurable_nnreal hσ)).indicator + (hAi i hi) + rw [integral_finsetSum _ hleft, integral_finsetSum _ hright] + apply Finset.sum_le_sum + intro i hi + rw [integral_indicator (hAi i hi), integral_indicator (hAi i hi)] + exact brownian_time_field_optional_interval_le hB hm hBm hBc (hF i hi) + σ τ hσ hτ hστ T hb (hA i hi) (hdrift i hi) + +/-- Patching finitely many bounded stopping intervals preserves the +conditional expectation bound. Each field is required to have +nonpositive drift only on its own interval. -/ +theorem brownian_finite_switch_optional_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (N : ℕ) (τ : ℕ → Ω → ℝ≥0) + (hτ : ∀ n, n ≤ N → IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ n ω : WithTop ℝ≥0))) + (hmono : ∀ n, n < N → ∀ ω, τ n ω ≤ τ (n+1) ω) + (T : ℝ≥0) (hbound : ∀ n, n ≤ N → ∀ ω, τ n ω ≤ T) + (K : ℕ → ℝ≥0) (F a : ℕ → ℝ≥0 → Ω → ℝ → ℝ) + (hF : ∀ n, n ≤ N → SmoothTimeBrownianField B hm (K n) (F n) (a n)) + {A : Set Ω} (hA : MeasurableSet[(hτ 0 (Nat.zero_le N)).measurableSpace] A) + (hdrift : ∀ n, n < N → ∀ ω ∈ A, ∀ u, + (τ n ω : ℝ) ≤ u → u < (τ (n+1) ω : ℝ) → + brownianFieldDrift B (F n) (a n) u ω ≤ 0) + (hjump : ∀ n, n < N → ∀ ω ∈ A, + F (n+1) (τ (n+1) ω) ω (B (τ (n+1) ω) ω) ≤ + F n (τ (n+1) ω) ω (B (τ (n+1) ω) ω)) : + (∫ ω in A, F N (τ N ω) ω (B (τ N ω) ω) ∂P) ≤ + ∫ ω in A, F 0 (τ 0 ω) ω (B (τ 0 ω) ω) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hstart : ∀ n, n ≤ N → ∀ ω, τ 0 ω ≤ τ n ω := by + intro n + induction n with + | zero => intro _ _; exact le_rfl + | succ n ih => + intro hn ω + exact (ih (Nat.le_trans (Nat.le_succ n) hn) ω).trans + (hmono n (Nat.lt_of_succ_le hn) ω) + have hAm (n : ℕ) (hn : n ≤ N) : + MeasurableSet[(hτ n hn).measurableSpace] A := by + apply IsStoppingTime.measurableSpace_mono (hτ 0 (Nat.zero_le N)) (hτ n hn) + (fun ω => WithTop.coe_le_coe.mpr (hstart n hn ω)) + exact hA + have hind : ∀ n, n ≤ N → + (∫ ω in A, F n (τ n ω) ω (B (τ n ω) ω) ∂P) ≤ + ∫ ω in A, F 0 (τ 0 ω) ω (B (τ 0 ω) ω) ∂P := by + intro n + induction n with + | zero => intro _; exact le_rfl + | succ n ih => + intro hn + have hn' := Nat.le_trans (Nat.le_succ n) hn + have hnN := Nat.lt_of_succ_le hn + have hflow := brownian_time_field_optional_interval_le hB hm hBm hBc + (hF n hn') (τ n) (τ (n+1)) (hτ n hn') (hτ (n+1) hn) + (hmono n hnN) T (hbound (n+1) hn) (hAm n hn') (hdrift n hnN) + have hright := (hF n hn').eval_stopped_integrable hBm + (stopping_time_measurable_nnreal (hτ (n+1) hn)) (P := P.restrict A) + have hleft := (hF (n+1) hn).eval_stopped_integrable hBm + (stopping_time_measurable_nnreal (hτ (n+1) hn)) (P := P.restrict A) + have hswitch : (∫ ω in A, F (n+1) (τ (n+1) ω) ω (B (τ (n+1) ω) ω) ∂P) ≤ + ∫ ω in A, F n (τ (n+1) ω) ω (B (τ (n+1) ω) ω) ∂P := by + apply integral_mono_ae hleft hright + filter_upwards [ae_restrict_mem ((hτ 0 (Nat.zero_le N)).measurableSpace_le _ hA)] + with ω hω + exact hjump n hnN ω hω + exact hswitch.trans (hflow.trans (ih hn')) + exact hind N le_rfl + +namespace Multipoint + +def activeFactor (p β U u θ : ℝ) : ℝ := + Real.exp (p / 2 * u) / 3 * angularFactor p (regulator β U u) θ + +lemma activeFactor_activation_le {p β U θ : ℝ} + (hp : 0 < p) (hU : 0 ≤ U) (hθ : 0 ≤ Real.sin θ) : + activeFactor p β U 0 θ ≤ 1 := by + unfold activeFactor + rw [regulator_zero β U hU] + have h := (angularFactor_endpoint_bounds hp hθ).2 + simp only [mul_zero, Real.exp_zero] + linarith + +/-- Completion freezes the factor at its angle-independent lower bound. -/ +lemma activeFactor_completion_jump {p β U θ : ℝ} + (hp : 0 < p) (hU : 0 ≤ U) (hθ : 0 ≤ Real.sin θ) : + Real.exp (p / 2 * U) / 3 ≤ activeFactor p β U U θ := by + unfold activeFactor + rw [regulator_end β U hU] + simpa only [mul_one] using mul_le_mul_of_nonneg_left + (angularFactor_endpoint_bounds hp hθ).1 (by positivity : 0 ≤ Real.exp (p / 2 * U) / 3) + +lemma activeFactor_nonneg {p β U u θ : ℝ} (hθ : 0 ≤ Real.sin θ) : + 0 ≤ activeFactor p β U u θ := by + unfold activeFactor + exact mul_nonneg (by positivity) + ((regulator_pos β U u).le.trans (angularFactor_ge_delta (regulator_pos β U u).le hθ)) + +/-- Simultaneous activation or completion of any subset still gives a +downward jump for the finite product. Unchanged completed factors need +only be nonnegative constants. -/ +lemma finite_factor_switch_le {ι : Type*} (s : Finset ι) (before after : ι → ℝ) + (hafter : ∀ i ∈ s, 0 ≤ after i) (hle : ∀ i ∈ s, after i ≤ before i) : + (∏ i ∈ s, after i) ≤ ∏ i ∈ s, before i := + Finset.prod_le_prod₀ hafter hle + +end Multipoint +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointTerminalProbability.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointTerminalProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a71a1f1c8028acae99980865d30ed8b4428ef44 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointTerminalProbability.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Multipoint.MultipointPhaseProcess + +namespace OAI + +/-! Convert the real-valued stopped product estimate into the successful +event probability, after exhaustion by the concrete localizations. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal NNReal + +namespace SLEExactGauge.Multipoint + +lemma initial_phase_product_le_one + {Ω ι : Type*} [Fintype ι] + (κ β : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) (a U : ι → ℝ) (hU : ∀ i, 0 ≤ U i) + (ρ : (ι × Fin 3) → Ω → ℝ≥0) (ω : Ω) + (horder : ∀ i, Monotone (fun k => ρ (i,k) ω)) + (z : ι → ℂ × ℝ) (x : ℝ) + (hclock : ∀ i (k : Fin 3), ρ (i,k) ω = 0 → + logFactorClock κ (z i)-a i = if k = 0 then 0 else if k = 1 then U i/2 else U i) : + patternProduct κ β a U (phaseAt ρ 0 ω) z x ≤ 1 := by + rw [← patternProduct_all_inactive κ β a U z x] + apply patternProduct_switch_le κ β hκ hκ8 a U hU _ _ _ _ (fun _ => bot_le) + · intro i _ hi + have hh := (phaseAt_ge_iff ρ ω i (horder i) 0 0).mp hi + simpa only [ite_true] using hclock i 0 (le_antisymm hh bot_le) + · intro i _ hi + have hh := (phaseAt_ge_iff ρ ω i (horder i) 0 1).mp hi + simpa only [Fin.reduceEq, ite_true, ite_false] using hclock i 1 (le_antisymm hh bot_le) + · intro i _ hi + have hh := (phaseAt_ge_iff ρ ω i (horder i) 0 2).mp hi + simpa only [Fin.reduceEq, ite_true, ite_false] using hclock i 2 (le_antisymm hh bot_le) + +lemma measure_le_of_eventual_real_products + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (E : Set Ω) (cutoff : ℕ → Set Ω) (X : ℕ → Ω → ℝ) (q : ℝ) (hq : 0 < q) + (hcover : ∀ ω ∈ E, ∀ᶠ n : ℕ in atTop, ω ∈ cutoff n) + (hX : ∀ n, Integrable (X n) P) (hX0 : ∀ n ω, 0 ≤ X n ω) + (hmean : ∀ n, (∫ ω, X n ω ∂P) ≤ 1) + (hterminal : ∀ n ω, ω ∈ cutoff n → q ≤ X n ω) : + P E ≤ ENNReal.ofReal q⁻¹ := by + apply measure_le_of_eventual_stopped_products P E cutoff (fun n ω => ENNReal.ofReal (X n ω)) q hq hcover + · intro n + exact ENNReal.continuous_ofReal.measurable.comp_aemeasurable (hX n).aestronglyMeasurable.aemeasurable + · intro n + rw [← ofReal_integral_eq_lintegral_ofReal (hX n) (ae_of_all _ (hX0 n))] + exact (ENNReal.ofReal_le_ofReal (hmean n)).trans_eq ENNReal.ofReal_one + · exact fun n ω hω => ENNReal.ofReal_le_ofReal (hterminal n ω hω) + +theorem measure_le_of_completed_phase_products + {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (P : Measure Ω) (E : Set Ω) (cutoff : ℕ → Set Ω) + (κ β : ℝ) (a U : ι → ℝ) (K : ℝ) + (j : ℕ → Ω → ι → Fin 4) (Q : ℕ → Ω → ι → ℂ × ℝ) + (b x : ℕ → Ω → ℝ) + (hcover : ∀ ω ∈ E, ∀ᶠ n : ℕ in atTop, ω ∈ cutoff n) + (hI : ∀ n, Integrable (fun ω => discountedPatternProduct κ β a U (j n ω) + (Q n ω,b n ω) (x n ω)) P) + (hmean : ∀ n, (∫ ω, discountedPatternProduct κ β a U (j n ω) + (Q n ω,b n ω) (x n ω) ∂P) ≤ 1) + (hcomplete : ∀ n ω, ω ∈ cutoff n → j n ω = fun _ => 3) + (hb : ∀ n ω, ω ∈ cutoff n → b n ω ≤ K) : + P E ≤ ENNReal.ofReal ((3 : ℝ)^(Fintype.card ι)*Real.exp K* + Real.exp (-greenExponent κ/2 * ∑ i, U i)) := by + have hbound := measure_le_of_eventual_real_products P E cutoff + (fun n ω => discountedPatternProduct κ β a U (j n ω) (Q n ω,b n ω) (x n ω)) + (successBarrier (greenExponent κ) K Finset.univ U) + (successBarrier_pos _ _ _ _) hcover hI + (fun n ω => mul_nonneg (Real.exp_pos _).le + (Finset.prod_nonneg (fun i _ => (phaseFactor_pos κ β (a i) (U i) (j n ω i) (Q n ω i) (x n ω)).le))) + hmean (fun n ω hω => by + rw [hcomplete n ω hω] + exact discountedPatternProduct_complete_lower κ β a U (Q n ω) (b n ω) K (x n ω) (hb n ω hω)) + simpa only [successBarrier_inv, Finset.card_univ] using hbound + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointTupleNull.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointTupleNull.lean new file mode 100644 index 0000000000000000000000000000000000000000..772223b5dc3583cc715e7436f2c38fb539b1b50f --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointTupleNull.lean @@ -0,0 +1,69 @@ +import OAI.Probability.SLE.Multipoint.MultipointDistanceKernel + +namespace OAI + +/-! Distinctness of planar integration tuples. The values assigned to +the distance kernel on collision diagonals do not affect its integral. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal + +namespace SLEExactGauge.Multipoint + +lemma ae_tuple_pair_ne {ι : Type*} [Fintype ι] [DecidableEq ι] + (K : Set ℂ) (i j : ι) (hij : i≠j) : + ∀ᵐ x : ι → ℂ ∂Measure.pi (fun _ : ι => volume.restrict K), x i≠x j := by + let μ : ι → Measure ℂ := fun _ => volume.restrict K + let D : Set (ι → ℂ) := {x | x i=x j} + let f : (ι → ℂ) → ℝ≥0∞ := D.indicator (fun _ => 1) + have hD : MeasurableSet D := measurableSet_eq_fun (measurable_pi_apply i) (measurable_pi_apply j) + have hf : Measurable f := measurable_const.indicator hD + have hmarginal : lmarginal μ {i} f = lmarginal μ {i} (fun _ => 0) := by + rw [lmarginal_singleton,lmarginal_singleton] + funext x + have he : (fun y : ℂ => f (Function.update x i y)) = + ({x j} : Set ℂ).indicator (fun _ => (1 : ℝ≥0∞)) := by + funext y + simp only [f,D,indicator,mem_ofPred_eq,Function.update_self, + Function.update_of_ne hij.symm,mem_singleton_iff] + rw [he,lintegral_indicator (measurableSet_singleton _)] + simp only [lintegral_const,Measure.restrict_apply_univ,measure_singleton,one_mul,zero_mul] + have hint : (∫⁻ x, f x ∂Measure.pi μ) = 0 := by + have hh := lintegral_eq_of_lmarginal_eq {i} hf measurable_const hmarginal + simpa only [lintegral_zero] using hh + have hnull : Measure.pi μ D = 0 := by + simpa only [f,lintegral_indicator hD,lintegral_const, + Measure.restrict_apply_univ,one_mul] using hint + apply ae_iff.mpr + simpa only [not_not] using hnull + +theorem ae_tuple_injective {ι : Type*} [Fintype ι] + (K : Set ℂ) : + ∀ᵐ x : ι → ℂ ∂Measure.pi (fun _ : ι => volume.restrict K), Function.Injective x := by + classical + have hp : ∀ i j : ι, + ∀ᵐ x : ι → ℂ ∂Measure.pi (fun _ : ι => volume.restrict K), i≠j → x i≠x j := by + intro i j + by_cases hij : i=j + · exact ae_of_all _ (fun _ h => (h hij).elim) + · exact (ae_tuple_pair_ne K i j hij).mono (fun _ h _ => h) + filter_upwards [ae_all_iff.mpr (fun i => ae_all_iff.mpr (hp i))] with x hx + intro i j he + by_contra hij + exact hx i j hij he + +theorem ae_tuple_avoids {ι : Type*} [Fintype ι] (K : Set ℂ) (z : ℂ) : + ∀ᵐ x : ι → ℂ ∂Measure.pi (fun _ : ι => volume.restrict K), ∀ i, x i≠z := by + apply ae_all_iff.mpr + intro i + apply ae_iff.mpr + simpa only [not_not,Set.preimage,Function.eval,Set.mem_singleton_iff] using + Measure.pi_eval_preimage_null (i := i) (fun _ : ι => volume.restrict K) + (by simp only [measure_singleton] : (volume.restrict K) {z}=0) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointUniformCost.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointUniformCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecf8a624c497d18577284a08048f4704a03b00e7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointUniformCost.lean @@ -0,0 +1,79 @@ +import OAI.Probability.SLE.Multipoint.MultipointDiscountCost + +namespace OAI + +/-! A single finite-order Young coefficient controls every active subset. +The coefficient is chosen before the stopping-time pattern is known. -/ + +noncomputable section +open scoped BigOperators + +namespace SLEExactGauge.Multipoint + +/-- The Young coefficient associated with one active subset. -/ +def patternYoungConstant {ι : Type*} (κ : ℝ) (s : Finset ι) : ℝ := + let p := greenExponent κ + youngConstant p (angularCoefficientConstant p^2) + ((negativeDrift p/2)/(4*((s.card : ℝ)+1))) + +/-- A common coefficient for all active subsets of a fixed finite family. -/ +def allPatternYoungConstant {ι : Type*} (κ : ℝ) (I : Finset ι) : ℝ := + ∑ s ∈ I.powerset, patternYoungConstant κ s + +lemma patternYoungConstant_pos {ι : Type*} {κ : ℝ} + (hκ : 0 < κ) (hκ8 : κ < 8) (s : Finset ι) : + 0 < patternYoungConstant κ s := by + have hp : 0 < greenExponent κ := by + unfold greenExponent + rw [sub_pos, lt_div_iff₀ hκ] + linarith + exact youngConstant_pos hp (sq_pos_of_pos (angularCoefficientConstant_pos hp)) + (absorption_epsilon_pos (div_pos (negativeDrift_pos hp) (by norm_num)) s.card) + +lemma patternYoungConstant_le_all {ι : Type*} [DecidableEq ι] {κ : ℝ} + (hκ : 0 < κ) (hκ8 : κ < 8) {I s : Finset ι} (hs : s ⊆ I) : + patternYoungConstant κ s ≤ allPatternYoungConstant κ I := by + exact Finset.single_le_sum (fun t _ => (patternYoungConstant_pos hκ hκ8 t).le) + (Finset.mem_powerset.mpr hs) + +lemma allPatternYoungConstant_pos {ι : Type*} [DecidableEq ι] {κ : ℝ} + (hκ : 0 < κ) (hκ8 : κ < 8) (I : Finset ι) : + 0 < allPatternYoungConstant κ I := + (patternYoungConstant_pos hκ hκ8 (∅ : Finset ι)).trans_le + (patternYoungConstant_le_all hκ hκ8 (Finset.empty_subset I)) + +/-- The actual drift cost is controlled by one deterministic coefficient, +while keeping precisely the current active single and pair sums. -/ +theorem productDriftCost_le_uniform {ι : Type*} [DecidableEq ι] + {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) {I s : Finset ι} (hs : s ⊆ I) + (D σ : ι → ℝ) (hD : ∀ i ∈ s, 0 < D i) (z : ι → ℂ × ℝ) (x : ℝ) : + productDriftCost s κ D σ z x ≤ + κ*((driftAllowance (greenExponent κ)* + driftThreshold (greenExponent κ)^(-greenExponent κ))* + (∑ i ∈ s, branchRegulator κ (D i) (σ i) (z i)*logVelocity κ (z i) x^2) + + allPatternYoungConstant κ I * + (∑ ij ∈ s.offDiag, + (branchRegulator κ (D ij.1) (σ ij.1) (z ij.1)* + branchRegulator κ (D ij.2) (σ ij.2) (z ij.2))^(-exponent (greenExponent κ))* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x))) := by + have hpair : 0 ≤ ∑ ij ∈ s.offDiag, + (branchRegulator κ (D ij.1) (σ ij.1) (z ij.1)* + branchRegulator κ (D ij.2) (σ ij.2) (z ij.2))^(-exponent (greenExponent κ))* + (logVelocity κ (z ij.1) x*logVelocity κ (z ij.2) x) := by + apply Finset.sum_nonneg + intro ij hij + obtain ⟨hi, hj, _⟩ := Finset.mem_offDiag.mp hij + exact mul_nonneg (Real.rpow_nonneg (mul_nonneg + (mul_pos (hD _ hi) (Real.exp_pos _)).le + (mul_pos (hD _ hj) (Real.exp_pos _)).le) _) + (mul_pos (logVelocity_pos κ (z ij.1) x) (logVelocity_pos κ (z ij.2) x)).le + unfold productDriftCost + apply mul_le_mul_of_nonneg_left _ hκ.le + exact add_le_add le_rfl + (mul_le_mul_of_nonneg_right (patternYoungConstant_le_all hκ hκ8 hs) hpair) + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/MultipointYoung.lean b/lean/OAI/Probability/SLE/Multipoint/MultipointYoung.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1f9549639ba649fdd3cc5f58f8d8ef89fce3fd5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/MultipointYoung.lean @@ -0,0 +1,90 @@ +import OAI.Probability.SLE.Multipoint.MultipointRegularizer + +namespace OAI + +/-! Weighted Young absorption for the pair terms in the multipoint +regularized product. The constant depends on the order and SLE parameter, +not the two target levels or their current clocks. -/ + +noncomputable section +namespace SLEExactGauge.Multipoint + +def youngConstant (p C ε : ℝ) : ℝ := + (1-2*eta p) * (C*(eta p/ε)^(2*eta p))^(1/(1-2*eta p)) + +lemma youngConstant_pos {p C ε : ℝ} (hp : 0 < p) (hC : 0 < C) (hε : 0 < ε) : + 0 < youngConstant p C ε := by + have he := eta_pos (p := p) + have hr : 0 < 1-2*eta p := by linarith [eta_lt_half hp] + unfold youngConstant + positivity + +lemma three_factor_young {p C ε x y z : ℝ} (hp : 0 < p) + (hC : 0 < C) (hε : 0 < ε) (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + C*x^(eta p)*y^(eta p)*z^(1-2*eta p) ≤ + ε*(x+y) + youngConstant p C ε*z := by + let e := eta p + let r := 1-2*e + let b := ε/e + let K := (C*(e/ε)^(2*e))^(1/r) + have he : 0 < e := eta_pos + have hr : 0 < r := by dsimp only [r, e]; linarith [eta_lt_half hp] + have hb : 0 < b := div_pos hε he + have hK : 0 < K := by dsimp only [K]; positivity + have hKr : K^r = C*(e/ε)^(2*e) := by + dsimp only [K] + rw [← Real.rpow_mul (by positivity), one_div_mul_cancel hr.ne', Real.rpow_one] + have hcoef : b^e*b^e*K^r = C := by + rw [← Real.rpow_add hb, show e+e = 2*e by ring, hKr] + calc + _ = C*(b^(2*e)*(e/ε)^(2*e)) := by ring + _ = C*(b*(e/ε))^(2*e) := by rw [Real.mul_rpow hb.le (div_pos he hε).le] + _ = C := by + have hinv : b*(e/ε) = 1 := by dsimp only [b]; field_simp + rw [hinv, Real.one_rpow, mul_one] + have hprod : (b*x)^e*(b*y)^e*(K*z)^r = C*x^e*y^e*z^r := by + rw [Real.mul_rpow hb.le hx, Real.mul_rpow hb.le hy, Real.mul_rpow hK.le hz] + calc + _ = (b^e*b^e*K^r)*(x^e*y^e*z^r) := by ring + _ = _ := by rw [hcoef]; ring + have hmean := Real.geom_mean_le_arith_mean3_weighted he.le he.le hr.le + (mul_nonneg hb.le hx) (mul_nonneg hb.le hy) (mul_nonneg hK.le hz) + (show e+e+r = 1 by dsimp only [r]; ring) + rw [hprod] at hmean + calc + _ ≤ e*(b*x)+e*(b*y)+r*(K*z) := hmean + _ = _ := by + change e*(b*x)+e*(b*y)+r*(K*z) = ε*(x+y)+(r*K)*z + dsimp only [b] + field_simp + +/-- The factor from the singular angular derivatives is absorbed with +coefficient ε at both vertices and a deterministic inverse-regulator cost. -/ +theorem weighted_pair_absorption {p C ε D x y z : ℝ} (hp : 0 < p) + (hC : 0 < C) (hε : 0 < ε) (hD : 0 < D) + (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + C*D^(-1-eta p)*x^(eta p)*y^(eta p)*z^(1-2*eta p) ≤ + ε*(x+y) + youngConstant p C ε*D^(-exponent p)*z := by + have he := eta_pos (p := p) + have hr : 0 < 1-2*eta p := by linarith [eta_lt_half hp] + have hCD : 0 < C*D^(-1-eta p) := mul_pos hC (Real.rpow_pos_of_pos hD _) + have hconst : youngConstant p (C*D^(-1-eta p)) ε = + youngConstant p C ε*D^(-exponent p) := by + unfold youngConstant + have hb : 0 < C*(eta p/ε)^(2*eta p) := by positivity + rw [show C*D^(-1-eta p)*(eta p/ε)^(2*eta p) = + (C*(eta p/ε)^(2*eta p))*D^(-1-eta p) by ring, + Real.mul_rpow hb.le (Real.rpow_pos_of_pos hD _).le, + ← Real.rpow_mul hD.le] + have hexp : (-1-eta p)*(1/(1-2*eta p)) = -exponent p := by + unfold exponent + ring + rw [hexp] + ring + simpa only [hconst, mul_assoc] using three_factor_young hp hCD hε hx hy hz + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Multipoint/NearDiagonalKernel.lean b/lean/OAI/Probability/SLE/Multipoint/NearDiagonalKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..59416baabeefdf2d160cca8d98619d6689a3da9f --- /dev/null +++ b/lean/OAI/Probability/SLE/Multipoint/NearDiagonalKernel.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SLE.Multipoint.MultipointKernelExpansion +import OAI.Probability.SLE.Multipoint.MultipointTupleNull +import Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence + +namespace OAI + +/-! Integrable two-point kernels have vanishing mass near the diagonal. +Finite cutoff sums with bounded overlap inherit this decay. -/ + +noncomputable section +open Set Filter MeasureTheory Classical +open scoped ENNReal Topology + +namespace SLEExactGauge.Multipoint + +def nearDiagonalKernel (α b r : ℝ) (z : Fin 2 → ℂ) : ℝ≥0∞ := + if dist (z 0) (z 1) ≤ r then cappedDistanceKernel α b z else 0 + +lemma nearDiagonalKernel_measurable (α b r : ℝ) : Measurable (nearDiagonalKernel α b r) := + (measurable_cappedDistanceKernel α b).ite + (measurableSet_le ((measurable_pi_apply 0).dist (measurable_pi_apply 1)) measurable_const) + measurable_const + +theorem nearDiagonalKernel_integral_tendsto_zero {α : ℝ} (hα : 0 < α) (hα1 : α < 1) + (b : ℝ) (K : Set ℂ) (hK : Bornology.IsBounded K) + (r : ℕ → ℝ) (hr : Tendsto r atTop (𝓝 0)) : + Tendsto (fun n => ∫⁻ z : Fin 2 → ℂ, nearDiagonalKernel α b (r n) z + ∂Measure.pi (fun _ : Fin 2 => volume.restrict K)) atTop (𝓝 0) := by + have hh := tendsto_lintegral_of_dominated_convergence + (μ := Measure.pi (fun _ : Fin 2 => volume.restrict K)) + (F := fun n => nearDiagonalKernel α b (r n)) (f := fun _ => 0) + (cappedDistanceKernel α b) (fun n => nearDiagonalKernel_measurable α b (r n)) + (fun n => Eventually.of_forall (fun z => by + unfold nearDiagonalKernel + split_ifs <;> simp only [le_refl,zero_le])) + (cappedDistanceKernel_integral_lt_top hα hα1 b K hK).ne ?_ + · simpa only [lintegral_zero] using hh + filter_upwards [ae_tuple_pair_ne K (0 : Fin 2) 1 (by decide)] with z hz + have hdist : 0 < dist (z 0) (z 1) := dist_pos.mpr hz + have he : ∀ᶠ n in atTop, nearDiagonalKernel α b (r n) z = 0 := by + filter_upwards [(tendsto_order.mp hr).2 _ hdist] with n hn + exact ite_eq_right (not_le.mpr hn) + exact tendsto_const_nhds.congr' (he.mono (fun _ hn => hn.symm)) + +lemma sum_weighted_pair_kernel_le {ι : Type*} (I : Finset ι) + (f : ι → ℂ → ℝ≥0∞) (hf : ∀ i ∈ I, Measurable (f i)) + (α b r : ℝ) (N : ℝ≥0∞) + (hcover : ∀ x y, (∑ i ∈ I, f i x * f i y) ≤ if dist x y ≤ r then N else 0) + (K : Set ℂ) : + (∑ i ∈ I, ∫⁻ z : Fin 2 → ℂ, (∏ j, f i (z j)) * cappedDistanceKernel α b z + ∂Measure.pi (fun _ : Fin 2 => volume.restrict K)) ≤ + N * ∫⁻ z : Fin 2 → ℂ, nearDiagonalKernel α b r z + ∂Measure.pi (fun _ : Fin 2 => volume.restrict K) := by + rw [← lintegral_finsetSum I (f := fun i z => (∏ j : Fin 2, f i (z j)) * cappedDistanceKernel α b z) + (fun i hi => (Finset.measurable_prod _ (fun j _ => (hf i hi).comp (measurable_pi_apply j))).mul + (measurable_cappedDistanceKernel α b))] + rw [← lintegral_const_mul _ (nearDiagonalKernel_measurable α b r)] + apply lintegral_mono + intro z + simp only [Fin.prod_univ_two] + rw [← Finset.sum_mul] + apply (mul_le_mul' (hcover (z 0) (z 1)) le_rfl).trans_eq + unfold nearDiagonalKernel + split_ifs <;> simp only [zero_mul,mul_zero] + +end SLEExactGauge.Multipoint + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteSmallBall.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteSmallBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..21a025ef177c030d635678c89625071d0e6f74ca --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteSmallBall.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SLE.Angle.TargetBrownianNormalization +import OAI.Probability.SLE.Stochastic.WienerRealSupport + +namespace OAI + +/-! Positive probability of a uniformly small real Brownian driver on any +fixed finite time interval, using its actual based path law. -/ +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +local instance smallBallPathMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance smallBallPathBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +def driverUnitSmallBall (ε : ℝ) : Set Target.Driver := + {b | ∀ t : ℝ≥0, t ≤ 1 → |b t| < ε} + +lemma isOpen_driverUnitSmallBall (ε : ℝ) : IsOpen (driverUnitSmallBall ε) := by + have ho := ContinuousMap.isOpen_setOfPred_mapsTo + (isCompact_Icc : IsCompact (Icc (0:ℝ≥0) 1)) + (isOpen_Ioo : IsOpen (Ioo (-ε) ε)) + have he : driverUnitSmallBall ε = + (fun b : Target.Driver => b.toContinuousMap) ⁻¹' + {p : C(ℝ≥0,ℝ) | MapsTo p (Icc 0 1) (Ioo (-ε) ε)} := by + ext b + simp only [driverUnitSmallBall,mem_ofPred_eq,mem_preimage,MapsTo,mem_Icc,mem_Ioo] + constructor + · intro hb t ht + exact abs_lt.mp (hb t ht.2) + · intro hb t ht + exact abs_lt.mpr (hb ⟨zero_le,ht⟩) + rw [he] + exact ho.preimage ContinuousMapZero.isClosedEmbedding_toContinuousMap.continuous + +lemma driverUnitSmallBall_positive (W : Target.WienerLaw) (hW : Target.IsWiener W) + {ε : ℝ} (hε : 0 < ε) : 0 < W (driverUnitSmallBall ε) := by + have hp := wienerReal_uniform_tube_pos W hW (fun _ => 0) continuous_const rfl ε hε + apply hp.trans_le + apply measure_mono + intro b hb t ht + convert! hb (⟨(t:ℝ),t.coe_nonneg,by exact_mod_cast ht⟩ : unitInterval) using 1 + simp only [sub_zero] + exact congrArg (fun u : ℝ≥0 => |b u|) (Subtype.ext rfl) + +theorem brownian_finite_smallBall_positive + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (h0 : ∀ ω, B 0 ω=0) (T : ℝ≥0) (hT : 0 < T) {ε : ℝ} (hε : 0 < ε) : + 0 < P {ω | ∀ t ∈ Icc 0 T, |B t ω| < ε} := by + let C (t : ℝ≥0) (ω : Ω) := (Real.sqrt T)⁻¹*B (T*t) ω + have hC : IsBrownianReal C P := hB.smul hT.ne' + have hCm : ∀ t, Measurable (C t) := fun t => measurable_const.mul (hm _) + have hCc : ∀ ω, Continuous (fun t => C t ω) := + fun ω => continuous_const.mul ((hc ω).comp (continuous_const.mul continuous_id)) + have hC0 : ∀ ω, C 0 ω=0 := by intro ω; simp [C,h0] + let b := Target.normalizedDriver 1 C hCc hC0 + have hb : Measurable b := Target.normalizedDriver_measurable 1 C hCm hCc hC0 + have hW := Target.normalizedDriver_isWiener 1 (by norm_num) C hC hCm hCc hC0 + have hsqrt : 0 < Real.sqrt T := Real.sqrt_pos.mpr (by exact_mod_cast hT) + have hp := driverUnitSmallBall_positive (P.map b) hW (div_pos hε hsqrt) + rw [Measure.map_apply hb (isOpen_driverUnitSmallBall _).measurableSet] at hp + apply hp.trans_le (measure_mono ?_) + intro ω hω t ht + let q : ℝ≥0 := t/T + have hq : q ≤ 1 := (div_le_one₀ hT).mpr ht.2 + have hbq := hω q hq + change |Real.sqrt 1*C (q/(1:ℝ).toNNReal) ω| < ε/Real.sqrt T at hbq + simp only [Real.sqrt_one,Real.toNNReal_one,div_one,one_mul] at hbq + have htq : T*q=t := by dsimp [q]; exact mul_div_cancel₀ _ hT.ne' + dsimp only [C] at hbq + rw [htq,abs_mul,abs_inv,abs_of_pos hsqrt,← div_eq_inv_mul] at hbq + exact (div_lt_div_iff_of_pos_right hsqrt).mp hbq + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteTube.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteTube.lean new file mode 100644 index 0000000000000000000000000000000000000000..44013a746f5e65ea7c9da0631a7a54a72b028bd9 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianFiniteTube.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SLE.Stochastic.BrownianFiniteSmallBall + +namespace OAI + +/-! Finite-window support around any prescribed continuous based real +driver, transported from the actual unit-window Wiener law. -/ +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +local instance finiteTubePathMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance finiteTubePathBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +def driverUnitTube (f : C(ℝ≥0,ℝ)) (ε : ℝ) : Set Target.Driver := + {b | ∀ t : ℝ≥0, t ≤ 1 → |b t-f t| < ε} + +lemma isOpen_driverUnitTube (f : C(ℝ≥0,ℝ)) (ε : ℝ) : IsOpen (driverUnitTube f ε) := by + have ho := ContinuousMap.isOpen_setOfPred_mapsTo + (isCompact_Icc : IsCompact (Icc (0:ℝ≥0) 1)) + (isOpen_Ioo : IsOpen (Ioo (-ε) ε)) + have he : driverUnitTube f ε = + (fun b : Target.Driver => b.toContinuousMap-f) ⁻¹' + {p : C(ℝ≥0,ℝ) | MapsTo p (Icc 0 1) (Ioo (-ε) ε)} := by + ext b + simp only [driverUnitTube,mem_ofPred_eq,mem_preimage,MapsTo,mem_Icc,mem_Ioo, + ContinuousMap.sub_apply] + constructor + · intro hb t ht + exact abs_lt.mp (hb t ht.2) + · intro hb t ht + exact abs_lt.mpr (hb ⟨zero_le,ht⟩) + rw [he] + exact ho.preimage (ContinuousMapZero.isClosedEmbedding_toContinuousMap.continuous.sub + continuous_const) + +lemma driverUnitTube_positive (W : Target.WienerLaw) (hW : Target.IsWiener W) + (f : C(ℝ≥0,ℝ)) (hf0 : f 0=0) {ε : ℝ} (hε : 0 < ε) : + 0 < W (driverUnitTube f ε) := by + have hp := wienerReal_uniform_tube_pos W hW f f.continuous hf0 ε hε + apply hp.trans_le (measure_mono ?_) + intro b hb t ht + convert! hb (⟨(t:ℝ),t.coe_nonneg,by exact_mod_cast ht⟩ : unitInterval) using 1 + +theorem brownian_finite_uniform_tube_positive + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (h0 : ∀ ω, B 0 ω=0) (T : ℝ≥0) (hT : 0 < T) + (f : C(ℝ≥0,ℝ)) (hf0 : f 0=0) {ε : ℝ} (hε : 0 < ε) : + 0 < P {ω | ∀ t ∈ Icc 0 T, |B t ω-f t| < ε} := by + let C (t : ℝ≥0) (ω : Ω) := (Real.sqrt T)⁻¹*B (T*t) ω + have hC : IsBrownianReal C P := hB.smul hT.ne' + have hCm : ∀ t, Measurable (C t) := fun t => measurable_const.mul (hm _) + have hCc : ∀ ω, Continuous (fun t => C t ω) := + fun ω => continuous_const.mul ((hc ω).comp (continuous_const.mul continuous_id)) + have hC0 : ∀ ω, C 0 ω=0 := by intro ω; simp [C,h0] + let g : C(ℝ≥0,ℝ) := ⟨fun t => (Real.sqrt T)⁻¹*f (T*t), + continuous_const.mul (f.continuous.comp (continuous_const.mul continuous_id))⟩ + have hg0 : g 0=0 := by simp [g,hf0] + let b := Target.normalizedDriver 1 C hCc hC0 + have hb : Measurable b := Target.normalizedDriver_measurable 1 C hCm hCc hC0 + have hW := Target.normalizedDriver_isWiener 1 (by norm_num) C hC hCm hCc hC0 + have hsqrt : 0 < Real.sqrt T := Real.sqrt_pos.mpr (by exact_mod_cast hT) + have hp := driverUnitTube_positive (P.map b) hW g hg0 (div_pos hε hsqrt) + rw [Measure.map_apply hb (isOpen_driverUnitTube _ _).measurableSet] at hp + apply hp.trans_le (measure_mono ?_) + intro ω hω t ht + let q : ℝ≥0 := t/T + have hq : q ≤ 1 := (div_le_one₀ hT).mpr ht.2 + have hbq := hω q hq + change |Real.sqrt 1*C (q/(1:ℝ).toNNReal) ω-g q| < ε/Real.sqrt T at hbq + simp only [Real.sqrt_one,Real.toNNReal_one,div_one,one_mul] at hbq + have htq : T*q=t := by dsimp [q]; exact mul_div_cancel₀ _ hT.ne' + change |(Real.sqrt T)⁻¹*B (T*q) ω-(Real.sqrt T)⁻¹*f (T*q)| < _ at hbq + rw [htq,← mul_sub,abs_mul,abs_inv,abs_of_pos hsqrt,← div_eq_inv_mul] at hbq + exact (div_lt_div_iff_of_pos_right hsqrt).mp hbq + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianGerm.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianGerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..863a32b56d341db24514a252a5d128c66f4d9c6b --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianGerm.lean @@ -0,0 +1,104 @@ +import OAI.Probability.SLE.BrownianStrongMarkov + +namespace OAI + +/-! The Brownian germ zero-one argument needed for positive canonical +mass before every positive time. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} + +lemma brownian_germ_fdd_law + (hB : IsBrownianReal B P) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (ε : ℕ → ℝ≥0) (hε : Tendsto ε atTop (𝓝 0)) + (E : Set Ω) + (hE : ∀ n, MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε n)] E) + (I : Finset ℝ≥0) : + (P.restrict E).map (fun ω => I.restrict (fun t => B t ω)) = + P E • BrownianReal.projectiveFamily I := by + let : IsFiniteMeasure (P E • BrownianReal.projectiveFamily I) := + Measure.smul_finite _ (measure_ne_top P E) + apply ext_of_forall_integral_eq_of_IsFiniteMeasure + intro φ + have hXm : Measurable (fun ω => I.restrict (fun t => B t ω)) := + (Finset.measurable_restrict I).comp (Measurable.of_eval hm) + rw [integral_map hXm.aemeasurable φ.continuous.aestronglyMeasurable, integral_smul_measure] + have ht (ω : Ω) : Tendsto (fun n => shiftedFDD B I (ε n) ω) atTop + (𝓝 (I.restrict (fun t => B t ω))) := by + apply tendsto_pi_nhds.mpr + intro i + change Tendsto (fun n => B (ε n+(i:ℝ≥0)) ω-B (ε n) ω) atTop (𝓝 (B (i:ℝ≥0) ω)) + have hh := ((hc ω).continuousAt.tendsto.comp (hε.add_const (i:ℝ≥0))).sub + ((hc ω).continuousAt.tendsto.comp hε) + simpa only [Function.comp_def,zero_add,h0 ω,sub_zero] using hh + have hi := tendsto_integral_of_dominated_convergence (μ:=P.restrict E) + (F:=fun n ω => φ (shiftedFDD B I (ε n) ω)) + (f:=fun ω => φ (I.restrict (fun t => B t ω))) (fun _ => ‖φ‖) + (fun n => (φ.continuous.measurable.comp (shiftedFDD_measurable hm I (ε n))).aestronglyMeasurable) + (integrable_const _) (fun _ => Eventually.of_forall (fun _ => φ.norm_coe_le_norm _)) + (Eventually.of_forall (fun ω => φ.continuous.continuousAt.tendsto.comp (ht ω))) + simp only [shiftedFDD_setIntegral hB hm I _ φ (hE _)] at hi + exact tendsto_nhds_unique hi tendsto_const_nhds + +lemma brownian_germ_path_law + (hB : IsBrownianReal B P) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (ε : ℕ → ℝ≥0) (hε : Tendsto ε atTop (𝓝 0)) + (E : Set Ω) + (hE : ∀ n, MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε n)] E) : + (P.restrict E).map (fun ω t => B t ω) = P E • P.map (fun ω t => B t ω) := by + let (I : Finset ℝ≥0) : IsFiniteMeasure (P E • BrownianReal.projectiveFamily I) := + Measure.smul_finite _ (measure_ne_top P E) + have hL : IsProjectiveLimit ((P.restrict E).map (fun ω t => B t ω)) + (fun I => P E • BrownianReal.projectiveFamily I) := by + intro I + rw [Measure.map_map (Finset.measurable_restrict I) (Measurable.of_eval hm)] + exact brownian_germ_fdd_law hB hm hc h0 ε hε E hE I + have hR : IsProjectiveLimit (P E • P.map (fun ω t => B t ω)) + (fun I => P E • BrownianReal.projectiveFamily I) := by + intro I + rw [Measure.map_smul _ (Finset.measurable_restrict I).aemeasurable, + Measure.map_map (Finset.measurable_restrict I) (Measurable.of_eval hm)] + exact congrArg (fun μ => P E • μ) (hB.hasLaw I).map_eq + exact hL.unique hR + +/-- An event observable along times decreasing to zero has probability +zero or one. Only the continuous based Brownian path is needed. -/ +theorem brownian_germ_zero_one + (hB : IsBrownianReal B P) (hm : ∀ t, Measurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (ε : ℕ → ℝ≥0) (hε : Tendsto ε atTop (𝓝 0)) + (E : Set Ω) + (hE : ∀ n, MeasurableSet[Filtration.natural B (fun t => (hm t).stronglyMeasurable) (ε n)] E) : + P E=0 ∨ P E=1 := by + have hevent := hE 0 + rw [Filtration.natural_eq_comap B _ (ε 0)] at hevent + obtain ⟨D,hD,heD⟩ := hevent + let A : Set (ℝ≥0 → ℝ) := (fun b => fun s : Iic (ε 0) => b s) ⁻¹' D + have hr : Measurable (fun b : ℝ≥0 → ℝ => fun s : Iic (ε 0) => b (s:ℝ≥0)) := + Measurable.of_eval (fun s => measurable_pi_apply (s:ℝ≥0)) + have hA : MeasurableSet A := hr hD + have hpre : (fun ω t => B t ω) ⁻¹' A=E := heD + have hEm : MeasurableSet E := (Filtration.natural B (fun t => (hm t).stronglyMeasurable)).le (ε 0) E (hE 0) + have he := congrArg (fun μ : Measure (ℝ≥0 → ℝ) => μ A) + (brownian_germ_path_law hB hm hc h0 ε hε E hE) + rw [Measure.map_apply (Measurable.of_eval hm) hA,Measure.smul_apply, + Measure.map_apply (Measurable.of_eval hm) hA,hpre,Measure.restrict_apply hEm,inter_self] at he + by_cases hz : P E=0 + · exact Or.inl hz + · right + apply (ENNReal.mul_left_inj hz (measure_ne_top P E)).mp + simpa only [smul_eq_mul,one_mul] using he.symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalInequality.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalInequality.lean new file mode 100644 index 0000000000000000000000000000000000000000..75d2805e8e38c9b005a1698db3e6a6e0928146c6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalInequality.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SLE.OptionalStopping + +namespace OAI + +/-! A one-sided optional-stopping estimate for the discounted multipoint +product, obtained from the centered grid identity and the sign of the drift. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma bounded_cumulative_at_grid_le + {Ω : Type*} [MeasurableSpace Ω] (G : ℝ → Ω → ℝ) + (hG : Measurable (Function.uncurry G)) (C : ℝ) (hC : 0 ≤ C) + (hb : ∀ u ω, |G u ω| ≤ C) (τ : Ω → ℝ≥0) + (hnonpos : ∀ ω u, 0 ≤ u → u < (τ ω : ℝ) → G u ω ≤ 0) + (n : ℕ) (ω : Ω) : + (∫ u in (0 : ℝ)..(stopGrid n (τ ω) : ℝ), G u ω) ≤ + C*(1/((n : ℝ)+1)) := by + have hi₀ := bounded_time_section_intervalIntegrable 0 (τ ω) (τ ω).coe_nonneg G hG C hb ω + have h0 : (∫ u in (0 : ℝ)..(τ ω : ℝ), G u ω) ≤ 0 := by + have hh := intervalIntegral.integral_mono_on_of_le_Ioo (τ ω).coe_nonneg hi₀ + (intervalIntegrable_const (c := (0 : ℝ))) + (fun u hu => hnonpos ω u hu.1.le hu.2) + simpa only [intervalIntegral.integral_zero] using hh + have hle : (τ ω : ℝ) ≤ stopGrid n (τ ω) := (stopGrid_bounds n (τ ω)).1 + have hsplit := intervalIntegral.integral_add_adjacent_intervals hi₀ + (bounded_time_section_intervalIntegrable (τ ω) (stopGrid n (τ ω)) hle G hG C hb ω) + have hbnd := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (τ ω : ℝ)) (b := (stopGrid n (τ ω) : ℝ)) (C := C) + (f := fun u => G u ω) (fun u _ => by simpa only [Real.norm_eq_abs] using hb u ω) + rw [Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hle)] at hbnd + have hupper := (stopGrid_bounds n (τ ω)).2 + have hu : (stopGrid n (τ ω) : ℝ) ≤ (τ ω : ℝ)+1/((n : ℝ)+1) := by exact_mod_cast hupper + have htail := (le_abs_self _).trans hbnd + have hrange := mul_le_mul_of_nonneg_left (show (stopGrid n (τ ω) : ℝ)-(τ ω : ℝ) ≤ + 1/((n : ℝ)+1) by linarith) hC + linarith + +theorem brownian_time_field_optional_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + (K : ℝ≥0) (F a : ℝ≥0 → Ω → ℝ → ℝ) + (hF : SmoothTimeBrownianField B hm K F a) + (τ : Ω → ℝ≥0) + (hτ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ ω : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) + (hnonpos : ∀ ω u, 0 ≤ u → u < (τ ω : ℝ) → brownianFieldDrift B F a u ω ≤ 0) : + (∫ ω, F (τ ω) ω (B (τ ω) ω) ∂P) ≤ (∫ ω, F 0 ω (B 0 ω) ∂P) := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hτm := stopping_time_measurable_nnreal hτ + let V (n : ℕ) (ω : Ω) := F (stopGrid n (τ ω)) ω (B (stopGrid n (τ ω)) ω) + let H (n : ℕ) (ω : Ω) := ∫ u in (0 : ℝ)..(stopGrid n (τ ω) : ℝ), brownianFieldDrift B F a u ω + have hVm (n : ℕ) : Measurable (V n) := + measurable_discrete_eval (fun k ω => F (stopGridTime n k) ω (B (stopGridTime n k) ω)) + (fun k => hF.eval_measurable _ 0 (by decide) (hm _)) (stopGridIndex_measurable hτm n) + have hVb (n : ℕ) (ω : Ω) : |V n ω| ≤ (K : ℝ) := hF.bound _ ω _ 0 (by decide) + have hVi (n : ℕ) : Integrable (V n) P := + Integrable.of_bound (hVm n).aestronglyMeasurable (K : ℝ) + (Eventually.of_forall fun ω => by simpa only [Real.norm_eq_abs] using hVb n ω) + have hGm := hF.generator_measurable hBm + have hHjoint := cumulative_integral_measurable _ hGm + have hHm (n : ℕ) : Measurable (H n) := + measurable_discrete_eval + (fun k ω => ∫ u in (0 : ℝ)..(stopGridTime n k : ℝ), brownianFieldDrift B F a u ω) + (fun k => hHjoint.comp measurable_prodMk_left) (stopGridIndex_measurable hτm n) + have hHb (n : ℕ) (ω : Ω) : |H n ω| ≤ 2*(K : ℝ)*((T : ℝ)+1) := by + have hbound := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0 : ℝ)) (b := (stopGrid n (τ ω) : ℝ)) (C := 2*(K : ℝ)) + (f := fun u => brownianFieldDrift B F a u ω) + (fun u _ => by simpa only [Real.norm_eq_abs] using hF.generator_bound u ω) + rw [Real.norm_eq_abs, sub_zero, abs_of_nonneg (stopGrid n (τ ω)).coe_nonneg] at hbound + have hupper := (stopGrid_bounds n (τ ω)).2 + have hgrid : (stopGrid n (τ ω) : ℝ) ≤ (τ ω : ℝ)+1/((n : ℝ)+1) := by exact_mod_cast hupper + have hT : (τ ω : ℝ) ≤ T := hb ω + have hone : 1/((n : ℝ)+1) ≤ 1 := by + apply (div_le_iff₀ (by positivity : 0 < (n : ℝ)+1)).mpr + nlinarith [Nat.cast_nonneg (α := ℝ) n] + exact hbound.trans (mul_le_mul_of_nonneg_left (by linarith) (by positivity)) + have hHi (n : ℕ) : Integrable (H n) P := + Integrable.of_bound (hHm n).aestronglyMeasurable _ + (Eventually.of_forall fun ω => by simpa only [Real.norm_eq_abs] using hHb n ω) + have hHle (n : ℕ) (ω : Ω) : H n ω ≤ 2*(K : ℝ)*(1/((n : ℝ)+1)) := + bounded_cumulative_at_grid_le _ hGm (2*(K : ℝ)) (by positivity) + hF.generator_bound τ hnonpos n ω + have hmean (n : ℕ) : (∫ ω, V n ω ∂P) ≤ + (∫ ω, F 0 ω (B 0 ω) ∂P)+2*(K : ℝ)*(1/((n : ℝ)+1)) := by + have he := brownian_compensated_grid_integral hB hm hBm hF τ hτ T hb n + change (∫ ω, V n ω-H n ω ∂P) = _ at he + rw [integral_sub (hVi n) (hHi n)] at he + have hi := integral_mono_ae (hHi n) (integrable_const (2*(K : ℝ)*(1/((n : ℝ)+1)))) + (Eventually.of_forall (hHle n)) + simp only [integral_const, measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] at hi + linarith + have hlim : Tendsto (fun n => ∫ ω, V n ω ∂P) atTop + (𝓝 (∫ ω, F (τ ω) ω (B (τ ω) ω) ∂P)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => (K : ℝ)) + (fun n => (hVm n).aestronglyMeasurable) (integrable_const _) + (fun n => Eventually.of_forall fun ω => by simpa only [Real.norm_eq_abs] using hVb n ω) + exact Eventually.of_forall fun ω => + (hF.path_continuous hBc ω).continuousAt.tendsto.comp (stopGrid_tendsto (τ ω)) + have hlimUpper : Tendsto (fun n : ℕ => (∫ ω, F 0 ω (B 0 ω) ∂P)+ + 2*(K : ℝ)*(1/((n : ℝ)+1))) atTop (𝓝 (∫ ω, F 0 ω (B 0 ω) ∂P)) := by + simpa only [mul_zero, add_zero] using tendsto_const_nhds.add + ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul (2*(K : ℝ))) + exact le_of_tendsto_of_tendsto hlim hlimUpper (Eventually.of_forall hmean) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalIntervals.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalIntervals.lean new file mode 100644 index 0000000000000000000000000000000000000000..c83a2046187ca84d6cc3f16b981aeddb9c1da21b --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianOptionalIntervals.lean @@ -0,0 +1,273 @@ +import OAI.Probability.SLE.Stochastic.BrownianOptionalInequality + +namespace OAI + +/-! Conditional optional stopping between two bounded stopping times. +The compensated identity follows from the discrete grid identity. The drift is required to have its sign only between the two +stops, as needed between multipoint activation and completion switches. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma SmoothTimeBrownianField.eval_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) : + Measurable (fun q : ℝ≥0 × Ω => F q.1 q.2 (B q.1 q.2)) := by + convert (hF.joint 0 (by decide)).comp (measurable_id.prodMk hBm) using 1 + funext q + simp only [iteratedDeriv_zero, Function.comp_apply, id_eq] + +lemma SmoothTimeBrownianField.compensated_joint_measurable + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) : + Measurable (fun q : ℝ≥0 × Ω => brownianFieldCompensated B F a q.1 q.2) := + (hF.eval_joint_measurable hBm).sub + (cumulative_integral_measurable _ (hF.generator_measurable hBm)) + +lemma SmoothTimeBrownianField.compensated_bound + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (T t : ℝ≥0) (ht : t ≤ T) (ω : Ω) : + |brownianFieldCompensated B F a t ω| ≤ (K : ℝ) + 2 * K * T := by + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0 : ℝ)) (b := (t : ℝ)) (C := 2 * (K : ℝ)) + (f := fun u => brownianFieldDrift B F a u ω) + (fun u _ => by simpa only [Real.norm_eq_abs] using hF.generator_bound u ω) + rw [Real.norm_eq_abs, sub_zero, abs_of_nonneg t.coe_nonneg] at hi + exact (abs_sub _ _).trans (add_le_add (hF.bound t ω (B t ω) 0 (by decide)) + (hi.trans (mul_le_mul_of_nonneg_left ht (by positivity)))) + +lemma SmoothTimeBrownianField.compensated_path_continuous + {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} + {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) (ω : Ω) : + Continuous (fun t => brownianFieldCompensated B F a t ω) := by + have hi (s t : ℝ) : IntervalIntegrable (fun u => brownianFieldDrift B F a u ω) + volume s t := by + rcases le_total s t with h | h + · exact bounded_time_section_intervalIntegrable s t h _ (hF.generator_measurable hBm) + (2 * (K : ℝ)) hF.generator_bound ω + · exact (bounded_time_section_intervalIntegrable t s h _ (hF.generator_measurable hBm) + (2 * (K : ℝ)) hF.generator_bound ω).symm + exact (hF.path_continuous hBc ω).sub + ((intervalIntegral.continuous_primitive hi 0).comp continuous_subtype_val) + +lemma SmoothTimeBrownianField.eval_stopped_integrable + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsFiniteMeasure P] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + {τ : Ω → ℝ≥0} (hτm : Measurable τ) : + Integrable (fun ω => F (τ ω) ω (B (τ ω) ω)) P := by + apply Integrable.of_bound + ((hF.eval_joint_measurable hBm).comp (hτm.prodMk measurable_id)).aestronglyMeasurable + (K : ℝ) + exact ae_of_all _ fun ω => by + simpa only [Real.norm_eq_abs, Function.comp_apply, id_eq, iteratedDeriv_zero] using + hF.bound (τ ω) ω (B (τ ω) ω) 0 (by decide) + +lemma SmoothTimeBrownianField.compensated_stopped_integrable + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsFiniteMeasure P] + {B : ℝ≥0 → Ω → ℝ} {hm : ∀ t, Measurable (B t)} {K : ℝ≥0} + {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + {τ : Ω → ℝ≥0} (hτm : Measurable τ) (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) : + Integrable (fun ω => brownianFieldCompensated B F a (τ ω) ω) P := by + apply Integrable.of_bound + ((hF.compensated_joint_measurable hBm).comp (hτm.prodMk measurable_id)).aestronglyMeasurable + ((K : ℝ) + 2 * K * T) + exact ae_of_all _ fun ω => by + simpa only [Real.norm_eq_abs, Function.comp_apply, id_eq] using + hF.compensated_bound T (τ ω) (hb ω) ω + +/-- The full compensated optional identity. No sign restriction on the +drift is needed for this identity. -/ +theorem brownian_compensated_optional_integral + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {K : ℝ≥0} {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (τ : Ω → ℝ≥0) + (hτ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ ω : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) : + (∫ ω, brownianFieldCompensated B F a (τ ω) ω ∂P) = + ∫ ω, F 0 ω (B 0 ω) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hτm := stopping_time_measurable_nnreal hτ + have hCm := hF.compensated_joint_measurable hBm + let V (n : ℕ) (ω : Ω) := brownianFieldCompensated B F a (stopGrid n (τ ω)) ω + have hVm (n : ℕ) : Measurable (V n) := + measurable_discrete_eval (fun k ω => brownianFieldCompensated B F a (stopGridTime n k) ω) + (fun k => hCm.comp measurable_prodMk_left) (stopGridIndex_measurable hτm n) + have hVb (n : ℕ) (ω : Ω) : |V n ω| ≤ (K : ℝ) + 2 * K * (T + 1) := by + apply hF.compensated_bound (T + 1) _ _ ω + have hgrid := (stopGrid_bounds n (τ ω)).2 + have hone : (1 : ℝ≥0) / ((n : ℝ≥0) + 1) ≤ 1 := by + apply (div_le_iff₀ (by positivity)).mpr + simp + exact hgrid.trans (add_le_add (hb ω) hone) + have hlim : Tendsto (fun n => ∫ ω, V n ω ∂P) atTop + (𝓝 (∫ ω, brownianFieldCompensated B F a (τ ω) ω ∂P)) := by + apply tendsto_integral_of_dominated_convergence + (fun _ => (K : ℝ) + 2 * K * (T + 1)) + (fun n => (hVm n).aestronglyMeasurable) (integrable_const _) + (fun n => ae_of_all _ fun ω => by simpa only [Real.norm_eq_abs] using hVb n ω) + exact ae_of_all _ fun ω => + (hF.compensated_path_continuous hBm hBc ω).continuousAt.tendsto.comp + (stopGrid_tendsto (τ ω)) + have he (n : ℕ) : (∫ ω, V n ω ∂P) = ∫ ω, F 0 ω (B 0 ω) ∂P := + brownian_compensated_grid_integral hB hm hBm hF τ hτ T hb n + have hlim' : Tendsto (fun n => ∫ ω, V n ω ∂P) atTop + (𝓝 (∫ ω, F 0 ω (B 0 ω) ∂P)) := by + have heq : (fun n => ∫ ω, V n ω ∂P) = fun _ : ℕ => ∫ ω, F 0 ω (B 0 ω) ∂P := + funext he + rw [heq] + exact tendsto_const_nhds + exact tendsto_nhds_unique hlim hlim' + +lemma stopping_time_piecewise_after + {Ω : Type*} [mΩ : MeasurableSpace Ω] (ℱ : Filtration ℝ≥0 mΩ) + {σ τ : Ω → ℝ≥0} + (hσ : IsStoppingTime ℱ (fun ω => (σ ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) + (hστ : ∀ ω, σ ω ≤ τ ω) {A : Set Ω} [DecidablePred (· ∈ A)] + (hA : MeasurableSet[hσ.measurableSpace] A) : + IsStoppingTime ℱ (fun ω => ((if ω ∈ A then τ ω else σ ω) : WithTop ℝ≥0)) := by + classical + intro t + have hAt := (hσ.measurableSet A).mp hA |>.2 t + have hAct := (hσ.measurableSet Aᶜ).mp hA.compl |>.2 t + convert (hAt.inter (hτ t)).union hAct using 1 + ext ω + by_cases hω : ω ∈ A + · simp only [hω, ite_true, mem_union, mem_inter_iff, mem_ofPred_eq, mem_compl_iff, + not_true_eq_false, false_and, or_false, true_and, WithTop.coe_le_coe] + exact ⟨fun h => ⟨(hστ ω).trans h, h⟩, fun h => h.2⟩ + · simp [hω] + +/-- Conditional compensated equality between two bounded stopping times. -/ +theorem brownian_compensated_optional_interval + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {K : ℝ≥0} {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (σ τ : Ω → ℝ≥0) + (hσ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (σ ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ ω : WithTop ℝ≥0))) + (hστ : ∀ ω, σ ω ≤ τ ω) (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) + {A : Set Ω} (hA : MeasurableSet[hσ.measurableSpace] A) : + (∫ ω in A, brownianFieldCompensated B F a (τ ω) ω - + brownianFieldCompensated B F a (σ ω) ω ∂P) = 0 := by + classical + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + let π := fun ω => if ω ∈ A then τ ω else σ ω + have hπ : IsStoppingTime (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun ω => (π ω : WithTop ℝ≥0)) := by + convert stopping_time_piecewise_after _ hσ hτ hστ hA using 1 + funext ω + by_cases hω : ω ∈ A <;> simp [π, hω] <;> rfl + have hbσ : ∀ ω, σ ω ≤ T := fun ω => (hστ ω).trans (hb ω) + have hbπ : ∀ ω, π ω ≤ T := by + intro ω + dsimp only [π] + split_ifs + · exact hb ω + · exact hbσ ω + have hπi := hF.compensated_stopped_integrable hBm (stopping_time_measurable_nnreal hπ) T hbπ + (P := P) + have hσi := hF.compensated_stopped_integrable hBm (stopping_time_measurable_nnreal hσ) T hbσ + (P := P) + have heπ := brownian_compensated_optional_integral hB hm hBm hBc hF π hπ T hbπ + have heσ := brownian_compensated_optional_integral hB hm hBm hBc hF σ hσ T hbσ + have hpoint (ω : Ω) : brownianFieldCompensated B F a (π ω) ω - + brownianFieldCompensated B F a (σ ω) ω = + A.indicator (fun ω => brownianFieldCompensated B F a (τ ω) ω - + brownianFieldCompensated B F a (σ ω) ω) ω := by + by_cases hω : ω ∈ A <;> simp [π, hω] + have he : (∫ ω, brownianFieldCompensated B F a (π ω) ω - + brownianFieldCompensated B F a (σ ω) ω ∂P) = 0 := by + rw [integral_sub hπi hσi, heπ, heσ, sub_self] + simpa only [hpoint, integral_indicator (hσ.measurableSpace_le _ hA)] using he + +/-- Only the drift between the stops needs to be nonpositive, and the +inequality remains valid after restricting to any event known at the +first stop. -/ +theorem brownian_time_field_optional_interval_le + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) + (hBm : Measurable (fun q : ℝ≥0 × Ω => B q.1 q.2)) + (hBc : ∀ ω, Continuous (fun t => B t ω)) + {K : ℝ≥0} {F a : ℝ≥0 → Ω → ℝ → ℝ} + (hF : SmoothTimeBrownianField B hm K F a) + (σ τ : Ω → ℝ≥0) + (hσ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (σ ω : WithTop ℝ≥0))) + (hτ : IsStoppingTime (Filtration.natural B + (fun t => (hm t).stronglyMeasurable)) (fun ω => (τ ω : WithTop ℝ≥0))) + (hστ : ∀ ω, σ ω ≤ τ ω) (T : ℝ≥0) (hb : ∀ ω, τ ω ≤ T) + {A : Set Ω} (hA : MeasurableSet[hσ.measurableSpace] A) + (hnonpos : ∀ ω ∈ A, ∀ u, (σ ω : ℝ) ≤ u → u < (τ ω : ℝ) → + brownianFieldDrift B F a u ω ≤ 0) : + (∫ ω in A, F (τ ω) ω (B (τ ω) ω) ∂P) ≤ + ∫ ω in A, F (σ ω) ω (B (σ ω) ω) ∂P := by + let : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hbσ : ∀ ω, σ ω ≤ T := fun ω => (hστ ω).trans (hb ω) + have hσm := stopping_time_measurable_nnreal hσ + have hτm := stopping_time_measurable_nnreal hτ + have hFσ := hF.eval_stopped_integrable hBm hσm (P := P.restrict A) + have hFτ := hF.eval_stopped_integrable hBm hτm (P := P.restrict A) + have hCσ := hF.compensated_stopped_integrable hBm hσm T hbσ (P := P.restrict A) + have hCτ := hF.compensated_stopped_integrable hBm hτm T hb (P := P.restrict A) + have hCm := brownian_compensated_optional_interval hB hm hBm hBc hF σ τ hσ hτ hστ T hb hA + have hGm := hF.generator_measurable hBm + have hi (s t : ℝ) (hst : s ≤ t) (ω : Ω) := + bounded_time_section_intervalIntegrable s t hst _ hGm (2 * (K : ℝ)) hF.generator_bound ω + have hle : (∫ ω in A, F (τ ω) ω (B (τ ω) ω) - F (σ ω) ω (B (σ ω) ω) ∂P) ≤ + ∫ ω in A, brownianFieldCompensated B F a (τ ω) ω - + brownianFieldCompensated B F a (σ ω) ω ∂P := by + apply integral_mono_ae (hFτ.sub hFσ) (hCτ.sub hCσ) + filter_upwards [ae_restrict_mem (hσ.measurableSpace_le _ hA)] with ω hω + have hστreal : (σ ω : ℝ) ≤ (τ ω : ℝ) := hστ ω + have hneg : (∫ u in (σ ω : ℝ)..(τ ω : ℝ), brownianFieldDrift B F a u ω) ≤ 0 := by + have hh := intervalIntegral.integral_mono_on_of_le_Ioo hστreal + (hi (σ ω) (τ ω) hστreal ω) (intervalIntegrable_const (c := (0 : ℝ))) + (fun u hu => hnonpos ω hω u hu.1.le hu.2) + simpa only [intervalIntegral.integral_zero] using hh + have hsplit := intervalIntegral.integral_add_adjacent_intervals + (hi 0 (σ ω) (σ ω).coe_nonneg ω) (hi (σ ω) (τ ω) (hστ ω) ω) + dsimp only [brownianFieldCompensated, Pi.sub_apply] + linarith + rw [hCm, integral_sub hFτ hFσ] at hle + exact sub_nonpos.mp hle + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/BrownianStateAE.lean b/lean/OAI/Probability/SLE/Stochastic/BrownianStateAE.lean new file mode 100644 index 0000000000000000000000000000000000000000..425d3bef256b035b58af47a882d2f89a4b523575 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/BrownianStateAE.lean @@ -0,0 +1,142 @@ +import OAI.Probability.SLE.ClippedCoordinates +import Mathlib.MeasureTheory.Integral.IntervalIntegral.AbsolutelyContinuousFun + +namespace OAI + +/-! Compact Brownian test fields with absolutely continuous adapted states. +The state derivative may fail at the finitely many multipoint switches. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +theorem compact_state_smooth_brownian_field_of_ae_deriv + {Ω E : Type*} [MeasurableSpace Ω] [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) + (Q V : ℝ → Ω → E) (L : ℝ≥0) + (hQm : Measurable (fun p : ℝ × Ω => Q p.1 p.2)) + (hQa : Adapted (Filtration.natural B (fun t => (hm t).stronglyMeasurable)) + (fun t : ℝ≥0 => Q t)) + (hQl : ∀ ω, LipschitzWith L (fun t => Q t ω)) + (hVm : Measurable (fun p : ℝ × Ω => V p.1 p.2)) + (hVb : ∀ t ω, ‖V t ω‖ ≤ L) + (hQd : ∀ ω, ∀ᵐ t : ℝ, 0 < t → HasDerivAt (fun s => Q s ω) (V t ω) t) + (φ : E × ℝ → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφc : HasCompactSupport φ) : + ∃ K : ℝ≥0, SmoothTimeBrownianField B hm K + (fun t ω x => φ (Q t ω, x)) + (fun t ω x => fderiv ℝ φ (Q t ω, x) (V t ω, 0)) := by + + classical + have hr (j : ℕ) := compact_smooth_bounded_lipschitz (spatialPartial φ j) + (spatialPartial_smooth φ hφ j) (spatialPartial_compact φ hφc j) + choose C hCb hCl using hr + let C₀ : ℝ≥0 := ∑ j ∈ Finset.range 4, C j + have hC (j : ℕ) (hj : j ≤ 3) : C j ≤ C₀ := + Finset.single_le_sum (fun i _ => (zero_le : (0 : ℝ≥0) ≤ C i)) (Finset.mem_range.mpr (by omega)) + have hCb' (j : ℕ) (hj : j ≤ 3) (p : E × ℝ) : |spatialPartial φ j p| ≤ C₀ := by + have hh := (hCb j p).trans (show (C j : ℝ) ≤ C₀ by exact_mod_cast hC j hj) + simpa only [Real.norm_eq_abs] using hh + have hC2 : LipschitzWith C₀ (spatialPartial φ 2) := (hCl 2).weaken (hC 2 (by decide)) + obtain ⟨D, hDb, hDl⟩ := compact_smooth_bounded_lipschitz (fderiv ℝ φ) + (hφ.fderiv_right (by simp)) (hφc.fderiv ℝ) + let K : ℝ≥0 := (C₀ + D) * (L + 1) + have hKC : (C₀ : ℝ) ≤ (K : ℝ) := by + change (C₀ : ℝ) ≤ ((C₀ : ℝ) + D) * ((L : ℝ) + 1) + nlinarith [C₀.coe_nonneg, D.coe_nonneg, L.coe_nonneg] + have hKDL : (D : ℝ) * L ≤ (K : ℝ) := by + change (D : ℝ) * L ≤ ((C₀ : ℝ) + D) * ((L : ℝ) + 1) + nlinarith [C₀.coe_nonneg, D.coe_nonneg, L.coe_nonneg] + have hKCL : (C₀ : ℝ) * ((L : ℝ) + 1) ≤ (K : ℝ) := by + change (C₀ : ℝ) * ((L : ℝ) + 1) ≤ ((C₀ : ℝ) + D) * ((L : ℝ) + 1) + nlinarith [C₀.coe_nonneg, D.coe_nonneg, L.coe_nonneg] + have hQn : Measurable (fun p : ℝ≥0 × Ω => Q p.1 p.2) := + hQm.comp ((NNReal.continuous_coe.measurable.comp measurable_fst).prodMk measurable_snd) + have hVn : Measurable (fun p : ℝ≥0 × Ω => V p.1 p.2) := + hVm.comp ((NNReal.continuous_coe.measurable.comp measurable_fst).prodMk measurable_snd) + have happ : Continuous (fun p : (E × ℝ) × (E × ℝ) => fderiv ℝ φ p.1 p.2) := + ((hφ.continuous_fderiv (by simp)).comp continuous_fst).clm_apply continuous_snd + have hameas : Measurable (fun p : (ℝ≥0 × Ω) × ℝ => fderiv ℝ φ (Q p.1.1 p.1.2, p.2) (V p.1.1 p.1.2, 0)) := + happ.measurable.comp (((hQn.comp measurable_fst).prodMk measurable_snd).prodMk + ((hVn.comp measurable_fst).prodMk measurable_const)) + have habound (t : ℝ≥0) (ω : Ω) (x : ℝ) : + |fderiv ℝ φ (Q t ω, x) (V t ω, 0)| ≤ K := by + calc + _ = ‖fderiv ℝ φ (Q t ω, x) (V t ω, 0)‖ := (Real.norm_eq_abs _).symm + _ ≤ ‖fderiv ℝ φ (Q t ω, x)‖ * ‖(V t ω, (0 : ℝ))‖ := ContinuousLinearMap.le_opNorm _ _ + _ = ‖fderiv ℝ φ (Q t ω, x)‖ * ‖V t ω‖ := by simp + _ ≤ (D : ℝ) * L := mul_le_mul (hDb _) (hVb t ω) (norm_nonneg _) D.coe_nonneg + _ ≤ K := hKDL + have haLip (t : ℝ≥0) (ω : Ω) (x y : ℝ) : + |fderiv ℝ φ (Q t ω, x) (V t ω, 0) - fderiv ℝ φ (Q t ω, y) (V t ω, 0)| ≤ + (K : ℝ) * |x - y| := by + have hd : ‖fderiv ℝ φ (Q t ω, x) - fderiv ℝ φ (Q t ω, y)‖ ≤ (D : ℝ) * |x - y| := by + simpa [dist_eq_norm, Prod.norm_def, Real.norm_eq_abs] using hDl.dist_le_mul (Q t ω, x) (Q t ω, y) + calc + _ = ‖(fderiv ℝ φ (Q t ω, x) - fderiv ℝ φ (Q t ω, y)) (V t ω, 0)‖ := by + rw [sub_apply, Real.norm_eq_abs] + _ ≤ ‖fderiv ℝ φ (Q t ω, x) - fderiv ℝ φ (Q t ω, y)‖ * ‖(V t ω, (0 : ℝ))‖ := ContinuousLinearMap.le_opNorm _ _ + _ = ‖fderiv ℝ φ (Q t ω, x) - fderiv ℝ φ (Q t ω, y)‖ * ‖V t ω‖ := by simp + _ ≤ ((D : ℝ) * |x - y|) * L := mul_le_mul hd (hVb t ω) (norm_nonneg _) (by positivity) + _ = ((D : ℝ) * L) * |x - y| := by ring + _ ≤ (K : ℝ) * |x - y| := mul_le_mul_of_nonneg_right hKDL (abs_nonneg _) + refine ⟨K, ⟨?_, ?_, ?_, hameas, ?_, habound, haLip, ?_, ?_⟩⟩ + · intro t ω + have hc : ContDiff ℝ (⊤ : ℕ∞) (fun x : ℝ => φ (Q t ω, x)) := + hφ.comp (contDiff_const.prodMk contDiff_id) + exact hc.of_le (WithTop.coe_le_coe.mpr (show (3 : ℕ∞) ≤ ⊤ from le_top)) + · intro t j hj + simp_rw [← spatialPartial_eq_iteratedDeriv φ hφ] + exact (spatialPartial_smooth φ hφ j).continuous.measurable.comp + (((hQa t).comp measurable_fst).prodMk measurable_snd) + · intro j hj + simp_rw [← spatialPartial_eq_iteratedDeriv φ hφ] + exact (spatialPartial_smooth φ hφ j).continuous.measurable.comp + ((hQn.comp measurable_fst).prodMk measurable_snd) + · intro t ω x j hj + rw [← spatialPartial_eq_iteratedDeriv φ hφ] + exact (hCb' j hj _).trans hKC + · intro s t ω x y + rw [← spatialPartial_eq_iteratedDeriv φ hφ, ← spatialPartial_eq_iteratedDeriv φ hφ] + have hQdist := (hQl ω).dist_le_mul (t : ℝ) (s : ℝ) + rw [Real.dist_eq] at hQdist + calc + _ = dist (spatialPartial φ 2 (Q t ω, x)) (spatialPartial φ 2 (Q s ω, y)) := (Real.dist_eq _ _).symm + _ ≤ (C₀ : ℝ) * dist (Q t ω, x) (Q s ω, y) := hC2.dist_le_mul _ _ + _ ≤ (C₀ : ℝ) * (dist (Q t ω) (Q s ω) + |x - y|) := by + apply mul_le_mul_of_nonneg_left _ C₀.coe_nonneg + rw [Prod.dist_eq, Real.dist_eq] + exact max_le (le_add_of_nonneg_right (abs_nonneg _)) (le_add_of_nonneg_left dist_nonneg) + _ ≤ (C₀ : ℝ) * ((L : ℝ) * |(t : ℝ) - s| + |x - y|) := + mul_le_mul_of_nonneg_left (show dist (Q (t : ℝ) ω) (Q (s : ℝ) ω) + |x - y| ≤ + (L : ℝ) * |(t : ℝ) - s| + |x - y| by linarith) C₀.coe_nonneg + _ ≤ ((C₀ : ℝ) * ((L : ℝ) + 1)) * (|(t : ℝ) - s| + |x - y|) := by + nlinarith [mul_nonneg C₀.coe_nonneg (abs_nonneg ((t : ℝ) - s)), + mul_nonneg (mul_nonneg C₀.coe_nonneg L.coe_nonneg) (abs_nonneg (x - y))] + _ ≤ (K : ℝ) * (|(t : ℝ) - s| + |x - y|) := + mul_le_mul_of_nonneg_right hKCL (by positivity) + · intro s t hst ω x + have hst' : (s : ℝ) ≤ (t : ℝ) := by exact_mod_cast hst + have hpair : LipschitzWith L (fun u : ℝ => (Q u ω, x)) := by + apply LipschitzWith.of_dist_le_mul + intro u v + simpa only [Prod.dist_eq, dist_self, max_eq_left dist_nonneg] using (hQl ω).dist_le_mul u v + have hlip : LipschitzWith (C 0*L) (fun u : ℝ => φ (Q u ω,x)) := (hCl 0).comp hpair + have hAC := hlip.lipschitzOnWith.absolutelyContinuousOnInterval (a := (s : ℝ)) (b := (t : ℝ)) + symm + rw [← hAC.integral_deriv_eq_sub] + apply intervalIntegral.integral_congr_ae + filter_upwards [hQd ω] with u hu huu + rw [uIoc_of_le hst'] at huu + have hu0 : 0 < u := lt_of_le_of_lt s.coe_nonneg huu.1 + have hd := (hu hu0).prodMk (hasDerivAt_const u x) + have hc := ((hφ.differentiable (by simp)) (Q u ω,x)).hasFDerivAt.comp_hasDerivAt u hd + simpa only [Function.comp_def, Real.coe_toNNReal _ hu0.le] using hc.deriv.symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/DriverLawKernelTransfer.lean b/lean/OAI/Probability/SLE/Stochastic/DriverLawKernelTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..11021d9d83d00e20a63985821264016173c164f3 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/DriverLawKernelTransfer.lean @@ -0,0 +1,90 @@ +import OAI.Probability.SLE.Geometry.RestartContinuationKernel +import OAI.Probability.SLE.Loewner.ScaleTraceLaw + +namespace OAI + +/-! A deterministic-time kernel specified by the original Brownian past +transfers to another Brownian realization with the same continuous path law. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +local instance driverLawKernelMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance driverLawKernelBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B B' : ℝ≥0 → Ω → ℝ} + +lemma source_driver_integral_of_same_law_kernel + (hB : IsBrownianReal B P) (hB' : IsBrownianReal B' P) + (hm : ∀ t, Measurable (B t)) (hm' : ∀ t, Measurable (B' t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) + (hc' : ∀ ω, Continuous (fun t => B' t ω)) + (hlaw : P.map (sourceDriverPath B hc)=P.map (sourceDriverPath B' hc')) + (t : ℝ≥0) (f K : C(ℝ≥0,ℝ) → ℝ≥0∞) (hf : Measurable f) + (hK : Measurable[driverPathFiltration t] K) + (hmean : ∀ A : Set Ω, + MeasurableSet[(Filtration.natural B (fun s => (hm s).stronglyMeasurable)) t] A → + (∫⁻ ω in A, f (sourceDriverPath B hc ω) ∂P)= + ∫⁻ ω in A, K (sourceDriverPath B hc ω) ∂P) + (E : Set Ω) + (hE : MeasurableSet[(Filtration.natural B' (fun s => (hm' s).stronglyMeasurable)) t] E) : + (∫⁻ ω in E, f (sourceDriverPath B' hc' ω) ∂P)= + ∫⁻ ω in E, K (sourceDriverPath B' hc' ω) ∂P := by + have hs := driverContinuationMean_eq_of_past_integrals hB hm hc t f K hf hK hmean + have hKm := hK.mono (driverPathFiltration.le t) le_rfl + have hsec : MeasurableSet {p | driverContinuationMean (P.map (sourceDriverPath B' hc')) + t f p=K p} := measurableSet_eq_fun + ((driverContinuationMean_measurable _ t f hf).mono (driverPathFiltration.le t) le_rfl) hKm + rw [hlaw] at hs + have hp := (ae_map_iff (source_path_measurable (sourceDriverPath B' hc') hm').aemeasurable hsec).mp hs + have he := (source_driver_continuation_condLExp hB' hm' hc' t f hf).symm.trans hp + calc + _ = ∫⁻ ω in E, P⁻[(fun ω => f (sourceDriverPath B' hc' ω)) | + (Filtration.natural B' (fun s => (hm' s).stronglyMeasurable)) t] ω ∂P := + (setLIntegral_condLExp (Filtration.le _ t) P _ hE).symm + _ = _ := lintegral_congr_ae (ae_restrict_of_ae he) + +lemma source_driver_bind_of_same_law_kernel + (hB : IsBrownianReal B P) (hB' : IsBrownianReal B' P) + (hm : ∀ t, Measurable (B t)) (hm' : ∀ t, Measurable (B' t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) + (hc' : ∀ ω, Continuous (fun t => B' t ω)) + (hlaw : P.map (sourceDriverPath B hc)=P.map (sourceDriverPath B' hc')) + (t : ℝ≥0) (N K : C(ℝ≥0,ℝ) → Measure upperHalfPlane) (hN : Measurable N) + (hK : Measurable[driverPathFiltration t] K) + (hmean : ∀ A : Set Ω, + MeasurableSet[(Filtration.natural B (fun s => (hm s).stronglyMeasurable)) t] A → + (P.restrict A).bind (fun ω => N (sourceDriverPath B hc ω))= + (P.restrict A).bind (fun ω => K (sourceDriverPath B hc ω))) + (E : Set Ω) + (hE : MeasurableSet[(Filtration.natural B' (fun s => (hm' s).stronglyMeasurable)) t] E) : + (P.restrict E).bind (fun ω => N (sourceDriverPath B' hc' ω))= + (P.restrict E).bind (fun ω => K (sourceDriverPath B' hc' ω)) := by + have hp : Measurable (sourceDriverPath B hc) := source_path_measurable _ hm + have hp' : Measurable (sourceDriverPath B' hc') := source_path_measurable _ hm' + have hKm := hK.mono (driverPathFiltration.le t) le_rfl + have hNB : Measurable (fun ω => N (sourceDriverPath B hc ω)) := hN.comp hp + have hKB : Measurable (fun ω => K (sourceDriverPath B hc ω)) := hKm.comp hp + have hNB' : Measurable (fun ω => N (sourceDriverPath B' hc' ω)) := hN.comp hp' + have hKB' : Measurable (fun ω => K (sourceDriverPath B' hc' ω)) := hKm.comp hp' + apply Measure.ext + intro S hS + rw [Measure.bind_apply hS hNB'.aemeasurable, + Measure.bind_apply hS hKB'.aemeasurable] + apply source_driver_integral_of_same_law_kernel hB hB' hm hm' hc hc' hlaw t + (fun p => N p S) (fun p => K p S) + ((Measure.measurable_coe hS).comp hN) ((Measure.measurable_coe hS).comp hK) ?_ E hE + intro A hA + have he := congrArg (fun μ : Measure upperHalfPlane => μ S) (hmean A hA) + simpa only [Measure.bind_apply hS hNB.aemeasurable, + Measure.bind_apply hS hKB.aemeasurable] using he + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/DriverPastFactorization.lean b/lean/OAI/Probability/SLE/Stochastic/DriverPastFactorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..b10ba0b89d147d0212dfeb7f9de000892f1f5fca --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/DriverPastFactorization.lean @@ -0,0 +1,80 @@ +import OAI.Probability.SLE.Mass.RadonFactorization +import OAI.Probability.SLE.StoppedMeasures +import OAI.Probability.SLE.Mass.RationalTraceMassAdapted + +namespace OAI + +/-! Real continuous driver prefixes realize the natural filtration. +Radon kernels adapted to that filtration factor through each stopped prefix. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal CompactlySupported + +namespace SLEExactGauge + +local instance driverPastPathMeasurable : MeasurableSpace C(ℝ≥0,ℝ) := borel _ +local instance driverPastPathBorel : BorelSpace C(ℝ≥0,ℝ) := ⟨rfl⟩ +local instance : LocallyCompactSpace upperHalfPlane := isOpen_upperHalfPlane.locallyCompactSpace + +def driverPathStopped (t : ℝ≥0) (p : C(ℝ≥0,ℝ)) : C(ℝ≥0,ℝ) := + ⟨fun s => p (min s t),p.continuous.comp (continuous_id.min continuous_const)⟩ + +def driverPathFiltration : Filtration ℝ≥0 (borel C(ℝ≥0,ℝ)) := + Filtration.natural (fun t (p : C(ℝ≥0,ℝ)) => p t) + (fun t => (continuous_eval_const t).measurable.stronglyMeasurable) + +lemma driverPathStopped_eq_of_agree (T t : ℝ≥0) (ht : t ≤ T) + (p q : C(ℝ≥0,ℝ)) (hpq : ∀ s ≤ T, p s=q s) : + driverPathStopped t p = driverPathStopped t q := by + ext s + exact hpq (min s t) ((min_le_right s t).trans ht) + +lemma driverPathStopped_measurable_past (t : ℝ≥0) : + Measurable[driverPathFiltration t] (driverPathStopped t) := by + have he (s : ℝ≥0) : Measurable[driverPathFiltration t] + (fun p : C(ℝ≥0,ℝ) => p (min s t)) := by + have hm (r : ℝ≥0) : StronglyMeasurable (fun p : C(ℝ≥0,ℝ) => p r) := + (continuous_eval_const r).measurable.stronglyMeasurable + have h := (Filtration.stronglyAdapted_natural hm) (min s t) + exact (h.mono (driverPathFiltration.mono (min_le_right s t))).measurable + exact @source_path_measurable C(ℝ≥0,ℝ) ℝ (driverPathFiltration t) + _ _ _ _ (borel _) driverPastPathBorel _ (driverPathStopped t) he + +lemma natural_le_stoppedDriverPath_comap + {Ω : Type*} [MeasurableSpace Ω] (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) (t : ℝ≥0) : + (Filtration.natural B (fun r => (hm r).stronglyMeasurable)) t ≤ + MeasurableSpace.comap (fun ω => driverPathStopped t (sourceDriverPath B hc ω)) (borel _) := by + have hb (s : ℝ≥0) (hs : s ≤ t) : + Measurable[MeasurableSpace.comap (fun ω => driverPathStopped t (sourceDriverPath B hc ω)) + (borel C(ℝ≥0,ℝ))] (B s) := by + have h := (continuous_eval_const s).measurable.comp + (Measurable.of_comap_le (le_refl (MeasurableSpace.comap + (fun ω => driverPathStopped t (sourceDriverPath B hc ω)) (borel C(ℝ≥0,ℝ))))) + convert h using 1 + funext ω + simp only [Function.comp_def,driverPathStopped,sourceDriverPath,ContinuousMap.coe_mk,min_eq_left hs] + change (⨆ s ≤ t, MeasurableSpace.comap (B s) (borel ℝ)) ≤ _ + exact iSup_le fun s => iSup_le fun hs => measurable_iff_comap_le.mp (hb s hs) + +lemma exists_stopped_driver_radon_factor + {Ω : Type*} [MeasurableSpace Ω] (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, Measurable (B t)) (hc : ∀ ω, Continuous (fun t => B t ω)) + (t : ℝ≥0) (N : Ω → Measure upperHalfPlane) (hNr : ∀ ω, (N ω).Regular) + (hNm : Measurable[(Filtration.natural B (fun r => (hm r).stronglyMeasurable)) t] N) : + ∃ R : C(ℝ≥0,ℝ) → Measure upperHalfPlane, Measurable R ∧ + (∀ p, (R p).Regular) ∧ ∀ ω, R (driverPathStopped t (sourceDriverPath B hc ω)) = N ω := by + apply (localTestFamily upperHalfPlane).measurable_radon_factor + (fun ω => driverPathStopped t (sourceDriverPath B hc ω)) N hNr + intro j + have ht := @measurable_halfPlane_compact_test_integral Ω + ((Filtration.natural B (fun r => (hm r).stronglyMeasurable)) t) + N hNm hNr ((localTestFamily upperHalfPlane).test j) + exact ht.mono (natural_le_stoppedDriverPath_comap B hm hc t) le_rfl + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/DrivingEndpointUniqueness.lean b/lean/OAI/Probability/SLE/Stochastic/DrivingEndpointUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d373ceac9d9a7805a7cdd85ca35efaa5a7d4a58 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/DrivingEndpointUniqueness.lean @@ -0,0 +1,72 @@ +import OAI.Probability.SLE.Geometry.ShrinkingPhysicalSegments +import OAI.Probability.SLE.Loewner.SlitBoundaryFiber + +namespace OAI + +/-! The two ends of a shrinking mapped future cannot have different +real limits: a separating real interval would collapse in the inverse. -/ +noncomputable section +open Set Filter Function Complex Metric MeasureTheory +open scoped Topology + +namespace SLEExactGauge + +theorem initialDriving_shrinking_endpoint_unique (p : C(unitInterval,ℂ)) (hi : Injective p) + (h0 : p 0=0) (hH : ∀ t : unitInterval, t≠0 → p t∈upperHalfPlane) + {R : ℝ} (hR : 0 initialDrivingValue p hi h0 hH (t n) ((htr n).trans (hr1 n))) + atTop (𝓝 a)) + (hb : Tendsto (fun n => initialForwardChart p hi h0 hH (t n) (p (r n))) + atTop (𝓝 (b:ℂ))) : a=b := by + by_contra hab + have hb' := Complex.continuous_re.continuousAt.tendsto.comp hb + simp only [ofReal_re] at hb' + have hex : ∃ A B : ℝ, A (htr n).le) + let η := fun n => Real.sqrt (2*(initialCapacity p hi h0 hH (r n)- + initialCapacity p hi h0 hH (t n))) + have hη : Tendsto η atTop (𝓝 0) := by + have hcap := ((initialCapacity_continuous p hi h0 hH).tendsto s).comp hr + have hcap' := ((initialCapacity_continuous p hi h0 hH).tendsto s).comp ht + simpa only [sub_self,mul_zero,Real.sqrt_zero,Function.comp_def,η] using + (hcap.sub hcap').const_mul 2 |>.sqrt + obtain ⟨Fbar,hFbar,hFe⟩ := (initialSlitChart p hi h0 hH s hs).exists_boundary_extension + have hFi : ∀ z∈upperHalfPlane, Fbar z=initialInverseChart p hi h0 hH s z := by + intro z hz + simpa only [initialInverseChart,dite_eq_right hs] using hFe z hz + have hlow : ∀ᶠ n in atTop, ∀ x∈Ioo A B, ∃ y∈Ioc 0 (η n), + ‖initialInverseChart p hi h0 hH (t n) ((x:ℂ)+(y:ℂ)*I)-p s‖≤ε n := by + filter_upwards [hcross] with n hn + intro x hx + exact mappedFutureArc_thin_crossing p hi h0 hH (htr n) (hr1 n) (p s) (hn x hx) + (fun v hv => hbound n v ⟨hv.1.le,hv.2⟩) + have hconst := initialInverse_thin_crossing_collapse p hi h0 hH hR hp ht hFbar hFi hε hη hlow + apply (initialSlitChart p hi h0 hH s hs).boundary_not_constant_on_interval + hFbar hFe ((A+B)/2) (show 0<(B-A)/2 by linarith) (p s) + intro x hx + exact hconst x ⟨by linarith [hx.1],by linarith [hx.2]⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/DrivingLeftCluster.lean b/lean/OAI/Probability/SLE/Stochastic/DrivingLeftCluster.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e4dd10f5ed661248c68ec34e0ed2a9643dac183 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/DrivingLeftCluster.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SLE.Geometry.DiagonalComplexLimit +import OAI.Probability.SLE.Loewner.InitialDrivingRightContinuity +import OAI.Probability.SLE.Loewner.InitialForwardTimeContinuity + +namespace OAI + +/-! Every left-hand cluster of the driver is the exact tip value. -/ +noncomputable section +open Set Filter Function Complex Metric +open scoped Topology + +namespace SLEExactGauge + +theorem initialDriving_left_cluster (p : C(unitInterval,ℂ)) (hi : Injective p) + (h0 : p 0=0) (hH : ∀ t : unitInterval, t≠0 → p t∈upperHalfPlane) + {R : ℝ} (hR : 0 initialDriving p hi h0 hH (t n)) atTop (𝓝 a)) : + a=initialDriving p hi h0 hH s := by + let D : ℝ := (1-(s:ℝ))/2 + have hD : 0 D*(1/((n:ℝ)+1)) + have hd (n : ℕ) : d n∈Ioo 0 (1-(s:ℝ)) := by + have hn : (0:ℝ)<(n:ℝ)+1 := by positivity + have hb : 1/((n:ℝ)+1)≤1 := (div_le_one hn).mpr (by linarith [Nat.cast_nonneg (α := ℝ) n]) + refine ⟨mul_pos hD (one_div_pos.mpr hn),?_⟩ + have hle := mul_le_mul_of_nonneg_left hb hD.le + dsimp only [D] at hD hle + dsimp only [d,D] + linarith + let q := fun n => slitFutureParameter s (d n) + have hsq (n : ℕ) : s initialForwardChart p hi h0 hH s (p (q n))) + atTop (𝓝 (initialDrivingValue p hi h0 hH s hs:ℂ)) := + (initialDrivingValue_spec p hi h0 hH s hs).comp + (tendsto_nhdsWithin_iff.mpr ⟨hdlim,Eventually.of_forall fun n => (hd n).1⟩) + have hf (k : ℕ) : Tendsto (fun n => initialForwardChart p hi h0 hH (t n) (p (q k))) + atTop (𝓝 (initialForwardChart p hi h0 hH s (p (q k)))) := + initialForwardChart_tendsto p hi h0 hH ht tendsto_const_nhds + (point_after_prefix_mem_domain p hi hH (hsq k)) + (fun n => point_after_prefix_mem_domain p hi hH ((hts n).trans (hsq k))) + obtain ⟨φ,hφ,hφlim⟩ := diagonal_complex_limit hf hg + have hφtop : Tendsto φ atTop atTop := tendsto_atTop_mono hφ tendsto_id + have ha' : Tendsto (fun n => initialDrivingValue p hi h0 hH (t (φ n)) + (((hts (φ n)).trans (hsq n)).trans (hq1 n))) atTop (𝓝 a) := by + convert ha.comp hφtop using 1 + funext n + exact (initialDriving_of_lt p hi h0 hH ((hts (φ n)).trans hs)).symm + have he := initialDriving_shrinking_endpoint_unique p hi h0 hH hR hp hs0 + (ht.comp hφtop) hqlim (fun n => (hts (φ n)).trans (hsq n)) hq1 ha' hφlim + exact he.trans (initialDriving_of_lt p hi h0 hH hs).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/GaussianTaylorMean.lean b/lean/OAI/Probability/SLE/Stochastic/GaussianTaylorMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..81ef4f694e9bfa2a7a18522dd6d5ff4d72aeeab3 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/GaussianTaylorMean.lean @@ -0,0 +1,66 @@ +import OAI.Probability.SLE.BrownianGenerators + +namespace OAI + +/-! A scalar Gaussian Taylor estimate with finite derivative bounds for +the planar Brownian harmonic-mean argument. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma gaussian_second_taylor_integral + (f : ℝ → ℝ) (hf : ContDiff ℝ 3 f) (K : ℝ≥0) + (hbound : ∀ x j, j ≤ 3 → |iteratedDeriv j f x| ≤ K) + (δ : ℝ≥0) (x : ℝ) : + |(∫ y, f (x+y) ∂gaussianReal 0 δ)-f x- + (1/2:ℝ)*(δ:ℝ)*iteratedDeriv 2 f x| ≤ + (K:ℝ)*(δ:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 3 := by + let μ := gaussianReal 0 δ + let : IsProbabilityMeasure μ := by dsimp [μ]; infer_instance + have hμ : HasLaw (fun y : ℝ => y) μ μ := ⟨measurable_id.aemeasurable, by simp⟩ + have hi : Integrable (fun y => f (x+y)) μ := by + apply Integrable.of_bound (hf.continuous.comp (continuous_const.add continuous_id)).aestronglyMeasurable K + filter_upwards [] with y + simpa only [Function.comp_apply,Pi.add_apply,id_eq,Real.norm_eq_abs,iteratedDeriv_zero] + using hbound (x+y) 0 (by decide) + have hyi : Integrable (fun y : ℝ => y) μ := hμ.hasGaussianLaw.integrable + have hysi : Integrable (fun y : ℝ => y^2) μ := hμ.hasGaussianLaw.memLp_two.integrable_sq + have hlin : (∫ y : ℝ, deriv f x*y ∂μ)=0 := by + rw [integral_const_mul] + simp [μ] + have hquad : (∫ y : ℝ, (1/2:ℝ)*iteratedDeriv 2 f x*y^2 ∂μ) = + (1/2:ℝ)*iteratedDeriv 2 f x*(δ:ℝ) := by + rw [integral_const_mul,gaussian_square_integral] + let R (y : ℝ) := f (x+y)-f x-deriv f x*y-(1/2:ℝ)*iteratedDeriv 2 f x*y^2 + have hRi : Integrable R μ := + ((hi.sub (integrable_const _)).sub (hyi.const_mul _)).sub (hysi.const_mul _) + have hR : ∀ y, |R y| ≤ (K:ℝ)*|y|^3 := + fun y => real_second_taylor_bound hf K (fun z => hbound z 3 (by decide)) x y + have he : (∫ y, R y ∂μ) = (∫ y, f (x+y) ∂μ)-f x- + (1/2:ℝ)*(δ:ℝ)*iteratedDeriv 2 f x := by + have hci : Integrable (fun _ : ℝ => f x) μ := integrable_const _ + have hli : Integrable (fun y => deriv f x*y) μ := hyi.const_mul _ + have hqi : Integrable (fun y => (1/2:ℝ)*iteratedDeriv 2 f x*y^2) μ := hysi.const_mul _ + have h0i : Integrable (fun y => f (x+y)-f x) μ := hi.sub hci + have h1i : Integrable (fun y => f (x+y)-f x-deriv f x*y) μ := h0i.sub hli + dsimp only [R] + rw [integral_sub h1i hqi,integral_sub h0i hli,integral_sub hi hci,hlin,hquad] + simp only [integral_const,probReal_univ,one_smul,sub_zero] + ring + rw [← he] + calc + |∫ y, R y ∂μ| ≤ ∫ y, |R y| ∂μ := by + simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm (μ := μ) R + _ ≤ ∫ y, (K:ℝ)*|y|^3 ∂μ := integral_mono hRi.abs + ((gaussian_abs_moment_integrable hμ 3 (by decide)).const_mul _) hR + _ = (K:ℝ)*(δ:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 3 := by + rw [integral_const_mul,gaussian_abs_cube hμ] + ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/IndependentPlanarIncrements.lean b/lean/OAI/Probability/SLE/Stochastic/IndependentPlanarIncrements.lean new file mode 100644 index 0000000000000000000000000000000000000000..e59fd37305558e64d7a2433e0ad59e44ffcf2d2c --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/IndependentPlanarIncrements.lean @@ -0,0 +1,66 @@ +import OAI.Probability.SLE.BrownianGenerators +import OAI.Probability.SLE.Geometry.PublishedWienerSupport + +namespace OAI + +/-! Independence of the two-coordinate Wiener increment from its full +original past. Product coordinates retain both original pasts. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +private lemma measurePreserving_shuffle + {A B C D : Type*} [MeasurableSpace A] [MeasurableSpace B] + [MeasurableSpace C] [MeasurableSpace D] + (μ : Measure A) (ν : Measure B) (ρ : Measure C) (τ : Measure D) + [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + [IsProbabilityMeasure ρ] [IsProbabilityMeasure τ] : + MeasurePreserving (fun p : (A×B)×(C×D) => ((p.1.1,p.2.1),(p.1.2,p.2.2))) + ((μ.prod ν).prod (ρ.prod τ)) ((μ.prod ρ).prod (ν.prod τ)) := by + have h1 := measurePreserving_prodAssoc μ ν (ρ.prod τ) + have h2 := (MeasurePreserving.id μ).prod (measurePreserving_prodAssoc ν ρ τ).symm + have h3 := (MeasurePreserving.id μ).prod + ((Measure.measurePreserving_swap (μ := ν) (ν := ρ)).prod (MeasurePreserving.id τ)) + have h4 := (MeasurePreserving.id μ).prod (measurePreserving_prodAssoc ρ ν τ) + have h5 := (measurePreserving_prodAssoc μ ρ (ν.prod τ)).symm + exact h5.comp (h4.comp (h3.comp (h2.comp h1))) + +lemma independent_product_pairs + {Ω Ω' A B C D : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] + [MeasurableSpace A] [MeasurableSpace B] [MeasurableSpace C] [MeasurableSpace D] + {μ : Measure Ω} {ν : Measure Ω'} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {X : Ω → A} {Y : Ω → B} {X' : Ω' → C} {Y' : Ω' → D} + (hX : Measurable X) (hY : Measurable Y) (hX' : Measurable X') (hY' : Measurable Y') + (hXY : IndepFun X Y μ) (hXY' : IndepFun X' Y' ν) : + IndepFun (fun p : Ω×Ω' => (X p.1,X' p.2)) + (fun p : Ω×Ω' => (Y p.1,Y' p.2)) (μ.prod ν) := by + have hx : HasLaw X (μ.map X) μ := ⟨hX.aemeasurable,rfl⟩ + have hy : HasLaw Y (μ.map Y) μ := ⟨hY.aemeasurable,rfl⟩ + have hx' : HasLaw X' (ν.map X') ν := ⟨hX'.aemeasurable,rfl⟩ + have hy' : HasLaw Y' (ν.map Y') ν := ⟨hY'.aemeasurable,rfl⟩ + have h1 : MeasurePreserving (fun ω => (X ω,Y ω)) μ ((μ.map X).prod (μ.map Y)) := + ⟨hX.prodMk hY,(hXY.hasLaw_prod hx hy).map_eq⟩ + have h2 : MeasurePreserving (fun ω => (X' ω,Y' ω)) ν ((ν.map X').prod (ν.map Y')) := + ⟨hX'.prodMk hY',(hXY'.hasLaw_prod hx' hy').map_eq⟩ + have h3 := (measurePreserving_shuffle (μ.map X) (μ.map Y) (ν.map X') (ν.map Y')).comp + (h1.prod h2) + have hpair : HasLaw (fun p : Ω×Ω' => ((X p.1,X' p.2),(Y p.1,Y' p.2))) + (((μ.map X).prod (ν.map X')).prod ((μ.map Y).prod (ν.map Y'))) (μ.prod ν) := + ⟨h3.measurable.aemeasurable,h3.map_eq⟩ + have ha : HasLaw (fun p : Ω×Ω' => (X p.1,X' p.2)) + ((μ.map X).prod (ν.map X')) (μ.prod ν) := by + exact (measurePreserving_fst (μ := (μ.map X).prod (ν.map X')) + (ν := (μ.map Y).prod (ν.map Y'))).hasLaw.comp hpair + have hb : HasLaw (fun p : Ω×Ω' => (Y p.1,Y' p.2)) + ((μ.map Y).prod (ν.map Y')) (μ.prod ν) := by + exact (measurePreserving_snd (μ := (μ.map X).prod (ν.map X')) + (ν := (μ.map Y).prod (ν.map Y'))).hasLaw.comp hpair + exact (indepFun_iff_hasLaw_prodMk_prod ha hb).mpr hpair + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/LogRatioPaths.lean b/lean/OAI/Probability/SLE/Stochastic/LogRatioPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ba3f68daa259496f1cb8f3cba4fc38b1ecd8e8f --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/LogRatioPaths.lean @@ -0,0 +1,58 @@ +import OAI.Probability.SLE.Stochastic.PlanarLogLifting + +namespace OAI + +/-! Continuous logarithms used in the local crosscut separation argument. +Moving a puncture along a path gives a logarithm of the endpoint ratio on +the complement of that path. -/ +noncomputable section +open Set Filter Metric Function +open scoped Topology + +namespace SLEExactGauge + +lemma continuous_log_ratio_off_path {a b : ℂ} (p : Path a b) : + ∃ L : C({z : ℂ // z∉range p},ℂ), + ∀ z, Complex.exp (L z)=((z:ℂ)-b)/((z:ℂ)-a) := by + let D := {z : ℂ // z∉range p} + have hn (z : D) (t : unitInterval) : (z:ℂ)-p t≠0 := by + intro h + exact z.property ⟨t,(sub_eq_zero.mp h).symm⟩ + have hden (z : D) : (z:ℂ)-a≠0 := by simpa using hn z 0 + let H : C(unitInterval × D,ℂ) := + ⟨fun q => ((q.2:ℂ)-p q.1)/((q.2:ℂ)-a), + ((continuous_subtype_val.comp continuous_snd).sub (p.continuous.comp continuous_fst)).div + ((continuous_subtype_val.comp continuous_snd).sub continuous_const) (fun q => hden q.2)⟩ + obtain ⟨L,hL⟩ := continuous_log_at_end_of_homotopy H + (fun q => div_ne_zero (hn q.2 q.1) (hden q.2)) (ContinuousMap.const D 0) + (fun z => by simp [H,hden z]) + exact ⟨L,fun z => by simpa [H] using hL z⟩ + +lemma continuous_log_on_ball_away (c a : ℂ) (r : ℝ) (hr : 0 c+(q.1:ℂ)*((q.2:ℂ)-c)-a,by fun_prop⟩ + have hn (q : unitInterval × ball c r) : H q≠0 := by + have hm : c+(q.1:ℂ)*((q.2:ℂ)-c)∈ball c r := by + rw [mem_ball,dist_eq_norm] + rw [show c+(q.1:ℂ)*((q.2:ℂ)-c)-c=(q.1:ℂ)*((q.2:ℂ)-c) by ring] + rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg q.1.property.1] + exact (mul_le_of_le_one_left (norm_nonneg _) q.1.property.2).trans_lt + (by simpa only [mem_ball,dist_eq_norm] using q.2.property) + intro h + exact ha (sub_eq_zero.mp h ▸ hm) + obtain ⟨L,hL⟩ := continuous_log_at_end_of_homotopy H hn + (ContinuousMap.const (ball c r) (Complex.log (c-a))) + (fun z => by simp [H,Complex.exp_log hca]) + refine ⟨L,fun z => ?_⟩ + simpa [H] using hL z + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarCompensated.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarCompensated.lean new file mode 100644 index 0000000000000000000000000000000000000000..b255a135460c6385b57d4aef0975f56d49f880f6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarCompensated.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SLE.Stochastic.PlanarDynkin + +namespace OAI + +/-! The compact-test planar compensated process has zero mean increments +on every event in the original past, including its stopped finite grids. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +def planarCompensated (f : ℝ×ℝ → ℝ) (t : ℝ≥0) (b : Driver×Driver) : ℝ := + f (planarWiener t b)-∫ u in (0:ℝ)..(t:ℝ), planarGenerator f (planarWiener u.toNNReal b) + +lemma planar_compensated_integrable + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) (t : ℝ≥0) : + Integrable (planarCompensated f t) (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + have hi : Integrable (fun b => f (planarWiener t b)) (W.prod W) := by + simpa only [Measure.restrict_univ] using planar_compact_eval_integrable W hW f hf hc univ t + exact hi.sub (bounded_interval_integral_integrable 0 t t.coe_nonneg _ + (planar_generator_joint_measurable f hf) D (fun u b => hD _)) + +lemma planar_compensated_past_integral_zero + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (s t : ℝ≥0) (hst : s ≤ t) (A : Set (Driver×Driver)) + (hA : MeasurableSet[planarWienerFiltration s] A) : + (∫ b in A, planarCompensated f t b-planarCompensated f s b ∂W.prod W)=0 := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + let G (u : ℝ) (b : Driver×Driver) := planarGenerator f (planarWiener u.toNNReal b) + have hG : Measurable (Function.uncurry G) := planar_generator_joint_measurable f hf + have hGb (u b) : |G u b| ≤ D := hD _ + have hGi (a c : ℝ) (h : a ≤ c) (b : Driver×Driver) := + bounded_time_section_intervalIntegrable a c h G hG D hGb b + have hp (b : Driver×Driver) : planarCompensated f t b-planarCompensated f s b = + (f (planarWiener t b)-f (planarWiener s b))-∫ u in (s:ℝ)..(t:ℝ), G u b := by + have h := intervalIntegral.integral_add_adjacent_intervals (hGi 0 s s.coe_nonneg b) (hGi s t hst b) + dsimp only [planarCompensated] + change _ = _ at h + linarith + simp_rw [hp] + have hfi := (planar_compact_eval_integrable W hW f hf hc A t).sub + (planar_compact_eval_integrable W hW f hf hc A s) + have hdi := bounded_interval_integral_integrable (P := (W.prod W).restrict A) + s t hst G hG D hGb + have hfi' : Integrable (fun b => f (planarWiener t b)-f (planarWiener s b)) + ((W.prod W).restrict A) := hfi + rw [integral_sub hfi' hdi,planarWiener_dynkin W hW f hf hc s t hst A hA,sub_self] + +lemma planar_compensated_grid_integral + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (τ : Driver×Driver → ℝ≥0) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ b, τ b ≤ T) (n : ℕ) : + (∫ b, planarCompensated f (stopGrid n (τ b)) b ∂W.prod W)= + ∫ b, f (planarWiener 0 b) ∂W.prod W := by + let ℱn := gridFiltration planarWienerFiltration n + have hbound (b) : stopGridIndex n (τ b) ≤ stopGridIndex n T := by + exact (stopGridIndex_le n _ _).mpr ((hb b).trans (stopGrid_bounds n T).1) + have hE (j : ℕ) : MeasurableSet[ℱn j] {b | j planarCompensated f (stopGridTime n j)) + (fun j => planar_compensated_integrable W hW f hf hc _) + (fun b => stopGridIndex n (τ b)) (stopGridIndex n T) hbound hE + (fun j A hA => planar_compensated_past_integral_zero W hW f hf hc _ _ + (monotone_stopGridTime n (Nat.le_succ j)) A hA) + simpa only [stopGrid,stopGridTime,Nat.cast_zero,zero_div,planarCompensated, + NNReal.coe_zero,intervalIntegral.integral_same,sub_zero] using he + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarCoordinatePassage.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarCoordinatePassage.lean new file mode 100644 index 0000000000000000000000000000000000000000..71f640ba08be79674ee6dc0d0b3e4f4f34114516 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarCoordinatePassage.lean @@ -0,0 +1,167 @@ +import OAI.Probability.SLE.Gauge.ActualSequencePassageRegions +import OAI.Probability.SLE.Gauge.RibbonLimitSplice +import OAI.Probability.SLE.Stochastic.PlanarPassageNeighborhood + +namespace OAI + +/-! Passage along an actual convergent family of normalized charts and +ribbon coordinate maps. Every continuation tube, early-containment event, +and moving mass region is derived from the limiting coordinate guide. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.SequencePassage +open FirstHeightSupport EarlyPassageLocalization FirstFrontPassage PassageSuccess RibbonCoordinates + +/-- A convergent recentered admissible family has a positive one-step passage-and-mass +probability at every sufficiently small mesh in a prescribed vanishing +sequence. The mass lies in the actual moving coordinate middle strip. -/ +theorem planar_coordinate_limit_passage + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + (κ : ℝ) (hκ : 0 < κ) (hκ8 : κ < 8) + (B₀ : ℝ≥0 → Ω → ℝ) (hB₀ : IsBrownianReal B₀ P) + (hm : ∀ t, Measurable (B₀ t)) (hc : ∀ ω, Continuous (fun t => B₀ t ω)) + (γ : Ω → ℝ≥0 → ℂ) (G F₀ : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ * B₀ t ω) + (γ ω) (G ω) (F₀ ω)) + (hboundary : PublishedLoewnerBoundaryExtension) + (hsupport : PublishedGeometricTubeSupport P γ) + (hplanar : PublishedPlanarDiskOpenness) + (Qₙ : ℕ → ℂ → ℂ) (Q : ℂ → ℂ) (K : Set ℂ) (C Lq : ℝ≥0) + (hC : 0 < C) (hLq : 0 < Lq) + (hQu : ∀ n, LipschitzOnWith C (Qₙ n) K) + (hQl : ∀ n x, x ∈ K → ∀ y, y ∈ K → dist x y ≤ Lq * dist (Qₙ n x) (Qₙ n y)) + (hQconv : TendstoUniformlyOn Qₙ Q atTop K) + (hQ : ContinuousOn Q K) + (hbase : (1 : ℂ) ∈ K) + (Fₙ : ℕ → ℂ → ℂ) (Fbar : ℕ → ℂ → OnePoint ℂ) (F : ℂ → ℂ) + (hFn : ∀ n, DifferentiableOn ℂ (Fₙ n) upperHalfPlane) + (hinj : ∀ n, InjOn (Fₙ n) upperHalfPlane) + (hbar : ∀ n, ContinuousOn (Fbar n) closedHalfPlane) + (hext : ∀ n z, z ∈ upperHalfPlane → Fbar n z = (Fₙ n z : OnePoint ℂ)) + (hF : DifferentiableOn ℂ F upperHalfPlane) (hiF : InjOn F upperHalfPlane) + (hne : ∀ z ∈ upperHalfPlane, deriv F z ≠ 0) + (hFconv : TendstoLocallyUniformlyOn Fₙ F atTop upperHalfPlane) + (αₙ βₙ : ℕ → ℝ → ℂ) (α β : ℝ → ℂ) (Cg : ℝ≥0) + (hαL : ∀ n, LipschitzOnWith Cg (αₙ n) (Icc 0 2)) + (hαconv : TendstoUniformlyOn αₙ α atTop (Icc 0 2)) + (hα : ContinuousOn α (Icc 0 2)) + (hβc : ∀ n, ContinuousOn (βₙ n) (Icc 0 2)) (hβ0 : ∀ n, βₙ n 0 = 0) + (hβHn : ∀ n t, t ∈ Icc (0 : ℝ) 2 → 0 ≤ (βₙ n t).im) + (hmap : ∀ n t, t ∈ Icc (0 : ℝ) 2 → Fbar n (βₙ n t) = (αₙ n t : OnePoint ℂ)) + (hβconv : TendstoUniformlyOn βₙ β atTop (Icc 0 2)) + (hβ : ContinuousOn β (Icc 0 2)) (hβlim0 : β 0 = 0) (hβi : InjOn β (Icc 0 2)) + (hβH : MapsTo β (Ioc 0 2) upperHalfPlane) + (hrel : EqOn (F ∘ β) α (Ioc 0 2)) (homit : α 0 ∉ F '' upperHalfPlane) + (x ε ηtol : ℝ) (hx : |x| < ε) (hηtol : 0 < ηtol) + (hshape : EqOn α (fun t => Q (guideCoordinate 0 x t)) (Icc 0 2)) + (hmem : ∀ t ∈ Icc (0 : ℝ) (3 / 2), guideCoordinate 0 x t ∈ interior K) + (v : ℕ → ℝ) (hv : ∀ n, 0 < v n) (hlim : Tendsto v atTop (𝓝 0)) + (η : ℕ → Ω → ℝ≥0 → ℂ) (hηc : ∀ n, ∀ᵐ ω ∂P, Continuous (η n ω)) + (hηbar : ∀ n, ∀ᵐ ω ∂P, ∀ t, Fbar n (γ ω t) = (η n ω t : OnePoint ℂ)) : + ∃ B : ℝ, 0 < B ∧ ∃ Tc : ℝ≥0, 0 < Tc ∧ ∃ c q : ℝ, 0 < c ∧ 0 < q ∧ + ∀ᶠ n in atTop, ENNReal.ofReal q ≤ P {ω | + ω ∈ FrontSuccess η (fun n => longitudinalCoordinate (Qₙ n) K 0) + (fun ω => boundedFirstHeightTime (γ ω) B Tc) + (fun n => physicalPassageRegion (Qₙ n) K C ε ηtol) (fun n => Qₙ n 1) ηtol n ∧ + ENNReal.ofReal c ≤ segmentSausageCharge κ (η n ω) + (boundedFirstHeightTime (γ ω) B Tc) + (frontTime (fun t => longitudinalCoordinate (Qₙ n) K 0 (η n ω t)) 1) + (v n) (physicalMiddleRegion (Qₙ n) K 0 ε)} := by + let : IsProbabilityMeasure P := hB₀.isGaussianProcess.isProbabilityMeasure + let ℱ := Filtration.natural B₀ (fun t => (hm t).stronglyMeasurable) + have ha := brownian_capacity_trace_adapted B₀ hm hc κ γ G F₀ hw + have hγm (t : ℝ≥0) : Measurable (fun ω => γ ω t) := (ha t).mono (ℱ.le t) le_rfl + have hSLE : IsOrdinaryChordalSLE κ γ P := + ⟨hγm, B₀, hB₀, Eventually.of_forall (fun ω => ⟨G ω, F₀ ω, hw ω⟩)⟩ + let pₙ := fun n => longitudinalCoordinate (Qₙ n) K 0 + let p := longitudinalCoordinate Q K 0 + let Vₙ := fun n => physicalPassageRegion (Qₙ n) K C ε ηtol + let Rₙ := fun n => physicalMiddleRegion (Qₙ n) K 0 ε + let aₙ := fun n => αₙ n 0 + obtain ⟨U, hU, hαU, _, _, hp, hpn, hpconv, hVlate, hterminal, hregion⟩ := + limiting_guide_passage_neighborhood_plane hplanar Qₙ Q K C Lq hC hLq hQu hQl hQconv + hQ α hα x ε ηtol hx hηtol hshape hmem hbase + have hprogress : ∀ t ∈ Icc (0 : ℝ) (3 / 2), p (α t) = t := by + intro t ht + have hiQ := lower_lipschitz_injOn Q K Lq + (lower_lipschitz_uniform_limit Qₙ Q K Lq hQconv hQl) + dsimp only [p] + rw [hshape ⟨ht.1, ht.2.trans (by norm_num)⟩] + simp only [longitudinalCoordinate, coordinateInverse_left hiQ (interior_subset (hmem t ht)), + guideCoordinate_re, zero_add, sub_zero] + have haU : α 0 ∈ U := hαU (mem_image_of_mem α ⟨le_rfl, by norm_num⟩) + obtain ⟨r, hr, hball, hstartBall, hearly⟩ := eventual_early_coordinate_ball pₙ p U hU hp hpconv + aₙ (α 0) haU (hprogress _ ⟨le_rfl, by norm_num⟩) + (hαconv.tendsto_at ⟨le_rfl, by norm_num⟩) + obtain ⟨T₀, hT₀, q₀, hq₀, hheight⟩ := uniform_bounded_firstHeight_real_probability + κ hκ hκ8 B₀ hB₀ hm hc γ G F₀ hw hsupport + obtain ⟨b, A, d, L₀, hb, hA, hd, hL₀, hloc⟩ := + common_access_gives_firstHeight_localization κ hκ hκ8 + have ht : Tendsto (fun L : ℝ => A * L ^ (-d)) atTop (𝓝 0) := by + simpa only [mul_zero] using (tendsto_rpow_neg_atTop hd).const_mul A + obtain ⟨L, hL, hsmall⟩ := ((eventually_ge_atTop L₀).and + (ht.eventually (gt_mem_nhds (half_pos hq₀)))).exists + have hLp : 0 < L := (zero_lt_one.trans hL₀).trans_le hL + let r₀ := r / L + have hr₀ : 0 < r₀ := div_pos hr hLp + obtain ⟨δ, hδ, hδ2, hδsmall, hz, hpoint⟩ := + small_initial_access_segment Cg r₀ hr₀ βₙ β hβlim0 hβi hβconv + have hδsub : Icc (0 : ℝ) δ ⊆ Icc 0 2 := Icc_subset_Icc_right hδ2 + obtain ⟨b₀, hb₀, hlocseq⟩ := hloc Ω P γ hSLE (fun ω => (hw ω).1) + (fun ω => (hw ω).2.1) (fun ω t => (hw ω).2.2.1 t) + Fₙ Fbar hFn hinj hbar hext δ hδ βₙ (fun n => (hβc n).mono hδsub) hβ0 + (fun n t ht => hβHn n t (hδsub ht)) (β δ) hz hpoint αₙ aₙ Cg + (fun n => (hαL n).mono hδsub) (fun _ => rfl) + (fun n t ht => hmap n t (hδsub ht)) r₀ hr₀ hδsmall + have hβsub : Icc (0 : ℝ) (3 / 2) ⊆ Icc 0 2 := Icc_subset_Icc_right (by norm_num) + obtain ⟨B, tB, hB, hBm, htB, htBT, hcross, hafter, hcircle, hsector, htail, hW, + hend, hWfront⟩ := limiting_guide_splice_geometry F hF hiF α β (hα.mono hβsub) + (hβ.mono hβsub) hβlim0 (fun t ht => hβH ⟨ht.1, ht.2.trans (by norm_num)⟩) + (hrel.mono (Ioc_subset_Ioc le_rfl (by norm_num))) homit U hU p hp hαU hprogress + r (b₀ * L ^ b) hr (mul_pos hb₀ (Real.rpow_pos_of_pos hLp _)) + let Tc := T₀ * (Real.toNNReal B) ^ 2 + have hTc : 0 < Tc := mul_pos hT₀ (pow_pos (Real.toNNReal_pos.mpr hB) 2) + have hheightB := hheight B hB + have hpositive : 0 < P (stoppedNarrowCertificate γ + (fun ω => boundedFirstHeightTime (γ ω) B Tc) B Tc) := + (ENNReal.ofReal_pos.mpr hq₀).trans_le hheightB + have hLr : L * r₀ = r := by + dsimp [r₀] + exact mul_div_cancel₀ r hLp.ne' + have hmissing : ∀ᶠ n in atTop, P (stoppedNarrowCertificate γ + (fun ω => boundedFirstHeightTime (γ ω) B Tc) B Tc \ + stoppedImageEvent γ (fun ω => boundedFirstHeightTime (γ ω) B Tc) + (Fbar n) (aₙ n) r) ≤ + P (stoppedNarrowCertificate γ (fun ω => boundedFirstHeightTime (γ ω) B Tc) B Tc) / 2 := by + filter_upwards [hlocseq] with n hn + have hbound := hn L hL B hB hBm Tc + rw [hLr] at hbound + calc + _ ≤ ENNReal.ofReal (A * L ^ (-d)) := hbound + _ ≤ ENNReal.ofReal (q₀ / 2) := ENNReal.ofReal_le_ofReal hsmall.le + _ = ENNReal.ofReal q₀ / 2 := by + rw [ENNReal.ofReal_div_of_pos (by norm_num : (0 : ℝ) < 2)] + norm_num + _ ≤ _ := ENNReal.div_le_div_right hheightB 2 + have hearlyAllowed : ∀ᶠ n in atTop, ball (aₙ n) r ⊆ Vₙ n := by + filter_upwards [hearly, hVlate] with n hn hV + exact (hn.trans inter_subset_left).trans hV + obtain ⟨c, q, hcpos, hqpos, hprob⟩ := bounded_splice_sequence_success_middle_regions + κ hκ hκ8 B₀ hB₀ hm hc γ G F₀ hw hboundary hsupport B r hB hr Tc F hF (α 0) + U (limitingFrontTarget F p U) hU hW β tB (3 / 2) htB htBT + (hβ.mono hβsub) (hβi.mono hβsub) + (fun t ht => hβH ⟨ht.1, ht.2.trans (by norm_num)⟩) + hcross hafter hcircle hsector htail hend Fbar hbar aₙ r Fₙ hFn hinj hne hFconv hext + pₙ p U hU hp hpn hpconv (union_subset hball Subset.rfl) hWfront hstartBall hearly + U hU (union_subset hball Subset.rfl) Vₙ hVlate (fun n => Qₙ n 1) ηtol hterminal + hearlyAllowed v hv hlim η hηc hηbar Rₙ hregion hpositive hmissing + exact ⟨B, hB, Tc, hTc, c, q, hcpos, hqpos, hprob⟩ + +end SLEExactGauge.SequencePassage + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarCutoffStop.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarCutoffStop.lean new file mode 100644 index 0000000000000000000000000000000000000000..e903e037e10b25d543539f1327ef1709c90f87f5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarCutoffStop.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SLE.Stochastic.PlanarHarmonicLocalization +import OAI.Probability.SLE.Geometry.ExtendedStopLocalization + +namespace OAI + +/-! Concrete compact localization stops for planar Brownian motion. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarWiener_zero (b : Driver×Driver) : planarWiener 0 b=0 := by + simp [planarWiener] + +lemma planarWiener_adapted : Adapted planarWienerFiltration planarWiener := + (Filtration.stronglyAdapted_natural (fun t => (measurable_planarWiener t).stronglyMeasurable)).adapted + +def planarCutoffHit (χ : ℝ×ℝ → ℝ) : Driver×Driver → WithTop ℝ≥0 := + hittingAfter (fun t b => χ (planarWiener t b)) {0} 0 + +def planarCutoffStop (χ : ℝ×ℝ → ℝ) (T : ℝ≥0) : Driver×Driver → ℝ≥0 := + cutoffStop (planarCutoffHit χ) T + +lemma planarCutoffHit_stopping (χ : ℝ×ℝ → ℝ) (hχ : Continuous χ) : + IsStoppingTime planarWienerFiltration (planarCutoffHit χ) := + continuous_zero_hit_stopping planarWienerFiltration (fun t b => χ (planarWiener t b)) + (fun t => hχ.measurable.comp (planarWiener_adapted t)) + (fun b => hχ.comp (planarWiener_continuous b)) 0 + +lemma planarCutoffStop_stopping (χ : ℝ×ℝ → ℝ) (hχ : Continuous χ) (T : ℝ≥0) : + IsStoppingTime planarWienerFiltration (fun b => (planarCutoffStop χ T b : WithTop ℝ≥0)) := + cutoffStop_stopping planarWienerFiltration _ (planarCutoffHit_stopping χ hχ) T + +lemma planarCutoffStop_le (χ : ℝ×ℝ → ℝ) (T : ℝ≥0) (b : Driver×Driver) : + planarCutoffStop χ T b ≤ T := cutoffStop_le_horizon _ _ _ + +lemma planarCutoffStop_before (χ : ℝ×ℝ → ℝ) (T : ℝ≥0) (b : Driver×Driver) + (t : ℝ≥0) (ht : t < planarCutoffStop χ T b) : χ (planarWiener t b) ≠ 0 := by + have hhit : (t : WithTop ℝ≥0) notMem_of_lt_hittingAfter hhit (zero_le : (0:ℝ≥0) ≤ t) hz + +lemma planarCutoffStop_in_support (χ : ℝ×ℝ → ℝ) (h0 : χ 0≠0) + (T : ℝ≥0) (b : Driver×Driver) (t : ℝ≥0) (ht : t ≤ planarCutoffStop χ T b) : + planarWiener t b ∈ tsupport χ := by + by_cases hlt : t < planarCutoffStop χ T b + · exact subset_tsupport χ (planarCutoffStop_before χ T b t hlt) + have he : t=planarCutoffStop χ T b := le_antisymm ht (le_of_not_gt hlt) + by_cases ht0 : t=0 + · rw [ht0,planarWiener_zero] + exact subset_tsupport χ h0 + have htpos : 0 planarWiener s b) (Iio t) (tsupport χ) := by + intro s hs + exact subset_tsupport χ (planarCutoffStop_before χ T b s (he ▸ hs)) + have hx := (planarWiener_continuous b).continuousWithinAt.mem_closure hcl hm + simpa only [(isClosed_tsupport χ).closure_eq] using hx + +lemma planarCutoffStop_ge_of_nonzero (χ : ℝ×ℝ → ℝ) (hχ : Continuous χ) + (T t : ℝ≥0) (ht : t ≤ T) (b : Driver×Driver) + (hn : ∀ s ≤ t, χ (planarWiener s b)≠0) : t ≤ planarCutoffStop χ T b := by + apply WithTop.coe_le_coe.mp + rw [planarCutoffStop,cutoffStop_coe,le_min_iff] + refine ⟨?_,WithTop.coe_le_coe.mpr ht⟩ + apply le_of_lt + apply lt_of_not_ge + intro hh + have hc : ∀ b : Driver×Driver, Continuous (fun s => χ (planarWiener s b)) := + fun b => hχ.comp (planarWiener_continuous b) + obtain ⟨s,hs,hz⟩ := (hittingAfter_zero_le_iff (fun s b => χ (planarWiener s b)) hc 0 t b).mp hh + exact hn s hs.2 hz + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDiskImage.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDiskImage.lean new file mode 100644 index 0000000000000000000000000000000000000000..8358c038e72177573a09884bf6d8dd4d7dc04da2 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDiskImage.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SLE.Stochastic.PlanarLogLifting + +namespace OAI + +/-! A continuous injection of a closed planar disk contains a neighborhood +of its center image. The proof uses exponential-covering homotopy lifting. -/ +noncomputable section +open Set Filter Metric Function +open scoped Topology + +namespace SLEExactGauge + +lemma planar_closedBall_image_contains_ball + (f : ℂ → ℂ) (r δ : ℝ) (hr : 0 f z) := + hf.comp_continuous continuous_subtype_val (fun z => sphere_subset_closedBall z.property) + have hscale (q : unitInterval × S) : ((q.1:ℝ):ℂ)*(q.2:ℂ)∈closedBall (0:ℂ) r := by + rw [mem_closedBall,dist_zero_right,norm_mul,Complex.norm_real,Real.norm_eq_abs, + abs_of_nonneg q.1.property.1,hnorm] + simpa only [one_mul] using mul_le_mul_of_nonneg_right q.1.property.2 hr.le + have hnscale (q : unitInterval × S) : -(((q.1:ℝ):ℂ)*(q.2:ℂ))∈closedBall (0:ℂ) r := by + simpa only [mem_closedBall,dist_zero_right,norm_neg] using hscale q + have hsc : Continuous (fun q : unitInterval × S => f (((q.1:ℝ):ℂ)*(q.2:ℂ))) := + hf.comp_continuous (by fun_prop) hscale + have hsn : Continuous (fun q : unitInterval × S => f (-(((q.1:ℝ):ℂ)*(q.2:ℂ)))) := + hf.comp_continuous (by fun_prop) hnscale + let H₁ : C(unitInterval × S,ℂ) := ⟨fun q => f (((q.1:ℝ):ℂ)*(q.2:ℂ))-y, + hsc.sub continuous_const⟩ + obtain ⟨L₁,hL₁⟩ := continuous_log_at_end_of_homotopy H₁ + (fun q => hn _ (hscale q)) (.const S (Complex.log (f 0-y))) (by + intro z + simpa [H₁] using Complex.exp_log (hn 0 (mem_closedBall_self hr.le))) + have hL₁' (z : S) : Complex.exp (L₁ z)=f z-y := by simpa [H₁] using hL₁ z + let H₂ : C(unitInterval × S,ℂ) := + ⟨fun q => f q.2-f 0-(1-((q.1:ℝ):ℂ))*(y-f 0),by + exact (hc.comp continuous_snd).sub continuous_const |>.sub (by fun_prop)⟩ + have hH₂ (q : unitInterval × S) : H₂ q≠0 := by + intro he + have heq : f q.2-f 0=(1-((q.1:ℝ):ℂ))*(y-f 0) := sub_eq_zero.mp he + have ht : ‖1-((q.1:ℝ):ℂ)‖≤1 := by + rw [← Complex.ofReal_one,← Complex.ofReal_sub,Complex.norm_real,Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr q.1.property.2)] + linarith [q.1.property.1] + have hsmall : ‖f q.2-f 0‖<δ := by + rw [heq,norm_mul] + exact (mul_le_of_le_one_left (norm_nonneg _) ht).trans_lt hyδ + exact not_lt_of_ge (hsep q.2 q.2.property) hsmall + obtain ⟨L₂,hL₂⟩ := continuous_log_at_end_of_homotopy H₂ hH₂ L₁ (by + intro z + rw [hL₁'] + dsimp [H₂] + ring) + have hL₂' (z : S) : Complex.exp (L₂ z)=f z-f 0 := by simpa [H₂] using hL₂ z + let H₃ : C(unitInterval × S,ℂ) := ⟨fun q => f q.2-f (-(((q.1:ℝ):ℂ)*(q.2:ℂ))), + (hc.comp continuous_snd).sub hsn⟩ + have hH₃ (q : unitInterval × S) : H₃ q≠0 := by + intro he + have heq := hi (sphere_subset_closedBall q.2.property) (hnscale q) (sub_eq_zero.mp he) + have hz0 : (q.2:ℂ)≠0 := by + intro hz + have := hnorm q.2 + rw [hz,norm_zero] at this + exact hr.ne' this.symm + have hp : (1+((q.1:ℝ):ℂ))*(q.2:ℂ)=0 := by linear_combination heq + have hp0 := (mul_eq_zero.mp hp).resolve_right hz0 + have hpR : (1:ℝ)+(q.1:ℝ)=0 := by exact_mod_cast hp0 + linarith [q.1.property.1] + obtain ⟨L₃,hL₃⟩ := continuous_log_at_end_of_homotopy H₃ hH₃ L₂ (by + intro z + simpa [H₃] using hL₂' z) + let J : S → S := fun z => ⟨-z,by simpa only [S,mem_sphere,dist_zero_right,norm_neg] using z.property⟩ + have hJ : Continuous J := (continuous_subtype_val.neg).subtype_mk _ + have hJi : Involutive J := fun z => Subtype.ext (neg_neg z.1) + let F : C(S,ℂ) := ⟨fun z => f z-f (-z),hc.sub (hf.comp_continuous + (continuous_subtype_val.neg) (fun z => by + simpa only [mem_closedBall,dist_zero_right,norm_neg] using sphere_subset_closedBall z.property))⟩ + have hF (z : S) : F z≠0 := by simpa [F,H₃] using hH₃ (1,z) + have hodd (z : S) : F (J z)= -F z := by dsimp [F,J]; rw [neg_neg]; ring + have hlog (z : S) : Complex.exp (L₃ z)=F z := by simpa [F,H₃] using hL₃ z + have ha : (r:ℂ)∈S := by + simp only [S,mem_sphere,dist_zero_right,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hr] + exact no_continuous_log_of_odd_involution J hJ hJi F L₃ hF hodd hlog ⟨r,ha⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDiskOpenness.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDiskOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a3910f8c93b753b8c69167604344d3cfa6cea4b --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDiskOpenness.lean @@ -0,0 +1,46 @@ +import OAI.Probability.SLE.Stochastic.PlanarDiskImage + +namespace OAI + +/-! The planar open-disk specialization of invariance of domain, proved +from compact boundary separation and the exponential-covering argument. -/ +noncomputable section +open Set Filter Metric Function +open scoped Topology + +namespace SLEExactGauge + +theorem actual_planarDiskOpenness : PublishedPlanarDiskOpenness := by + intro f x r _hr hf hi + apply Metric.isOpen_iff.mpr + rintro _ ⟨a,ha,rfl⟩ + obtain ⟨R,hR,hRa⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (isOpen_ball.mem_nhds ha) + let F : ℂ → ℂ := fun z => f (a+z) + have htrans (z : ℂ) (hz : z∈closedBall 0 R) : a+z∈ball x r := by + apply hRa + simpa only [mem_closedBall,dist_eq_norm,add_sub_cancel_left,sub_zero] using hz + have hFc : ContinuousOn F (closedBall 0 R) := + hf.comp (continuous_const.add continuous_id).continuousOn htrans + have hFi : InjOn F (closedBall 0 R) := by + intro z hz w hw he + exact add_left_cancel (hi (htrans z hz) (htrans w hw) he) + have hpos (z : ℂ) (hz : z∈sphere (0:ℂ) R) : 0<‖F z-F 0‖ := by + apply norm_pos_iff.mpr + intro he + have hez : z=0 := hFi (sphere_subset_closedBall hz) (mem_closedBall_self hR.le) + (sub_eq_zero.mp he) + have hzr : ‖z‖=R := by simpa only [mem_sphere,dist_zero_right] using hz + rw [hez,norm_zero] at hzr + exact hR.ne' hzr.symm + obtain ⟨δ,hδ,hsep⟩ := (isCompact_sphere (0:ℂ) R).exists_forall_le' + ((hFc.mono sphere_subset_closedBall).sub continuousOn_const).norm hpos + refine ⟨δ,hδ,fun y hy => ?_⟩ + have hfy : y∈ball (F 0) δ := by simpa only [F,add_zero] using hy + obtain ⟨z,hz,hFz⟩ := planar_closedBall_image_contains_ball F R δ hR hFc hFi hsep hfy + exact ⟨a+z,htrans z hz,hFz⟩ + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDomainStops.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDomainStops.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdddce1dd850bffcea9f341a879a1725c29064bc --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDomainStops.lean @@ -0,0 +1,88 @@ +import OAI.Probability.SLE.Stochastic.PlanarCutoffStop +import OAI.Probability.SLE.Loewner.SmoothDomainExhaustion + +namespace OAI + +/-! A nested sequence of actual stopping times exhausts each finite exit +of a continuous planar Wiener path from an open domain. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Function +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target +namespace SmoothDomainExhaustion +variable {U : Set (ℝ×ℝ)} (e : SmoothDomainExhaustion U 0) + +def stop (T : ℝ≥0) (n : ℕ) : Driver×Driver → ℝ≥0 := planarCutoffStop (e.cutoff n) T + +lemma stop_stopping (T : ℝ≥0) (n : ℕ) : + IsStoppingTime planarWienerFiltration (fun b => (e.stop T n b : WithTop ℝ≥0)) := + planarCutoffStop_stopping _ (e.smooth n).continuous T + +lemma stop_le (T : ℝ≥0) (n : ℕ) (b : Driver×Driver) : e.stop T n b ≤ T := + planarCutoffStop_le _ _ _ + +lemma stop_mem_support (T : ℝ≥0) (n : ℕ) (b : Driver×Driver) (t : ℝ≥0) + (ht : t ≤ e.stop T n b) : planarWiener t b∈tsupport (e.cutoff n) := + planarCutoffStop_in_support _ (by rw [e.based n]; exact one_ne_zero) _ _ _ ht + +lemma stop_mem_domain (T : ℝ≥0) (n : ℕ) (b : Driver×Driver) (t : ℝ≥0) + (ht : t ≤ e.stop T n b) : planarWiener t b∈U := + e.supported n (e.stop_mem_support T n b t ht) + +lemma stop_monotone (T : ℝ≥0) (b : Driver×Driver) : Monotone (fun n => e.stop T n b) := by + intro n m hnm + have hh : planarCutoffHit (e.cutoff n) b ≤ planarCutoffHit (e.cutoff m) b := by + change hittingAfter planarWiener {z | e.cutoff n z=0} 0 b ≤ + hittingAfter planarWiener {z | e.cutoff m z=0} 0 b + apply hittingAfter_anti planarWiener 0 + intro z hz + by_contra hn + exact (e.increasing hnm hn) hz + apply WithTop.coe_le_coe.mp + change (cutoffStop _ _ _ : WithTop ℝ≥0) ≤ (cutoffStop _ _ _ : WithTop ℝ≥0) + rw [cutoffStop_coe,cutoffStop_coe] + exact min_le_min_right _ hh + +lemma eventually_le_stop (T t : ℝ≥0) (ht : t ≤ T) (b : Driver×Driver) + (hpath : ∀ s ≤ t, planarWiener s b∈U) : ∀ᶠ n in atTop, t ≤ e.stop T n b := by + let K := (fun s => planarWiener s b) '' Icc 0 t + have hK : IsCompact K := isCompact_Icc.image (planarWiener_continuous b) + have hKU : K ⊆ U := by + rintro z ⟨s,hs,rfl⟩ + exact hpath s hs.2 + filter_upwards [e.exhausts K hK hKU] with n hn + apply planarCutoffStop_ge_of_nonzero _ (e.smooth n).continuous T t ht b + intro s hs + exact hn ⟨s,⟨zero_le,hs⟩,rfl⟩ + +lemma stop_tendsto_finite_exit (T τ : ℝ≥0) (hτT : τ ≤ T) (b : Driver×Driver) + (hpath : ∀ s < τ, planarWiener s b∈U) (hexit : planarWiener τ b∉U) : + Tendsto (fun n => e.stop T n b) atTop (𝓝 τ) := by + have hb (n) : e.stop T n b ≤ τ := by + have hz : e.cutoff n (planarWiener τ b)=0 := by + by_contra hn + exact hexit (e.supported n (subset_tsupport _ hn)) + have hh : planarCutoffHit (e.cutoff n) b ≤ (τ : WithTop ℝ≥0) := + hittingAfter_le_of_mem (zero_le : (0:ℝ≥0) ≤ τ) hz + apply WithTop.coe_le_coe.mp + change (cutoffStop _ _ _ : WithTop ℝ≥0) ≤ _ + rw [cutoffStop_coe] + exact (min_le_left _ _).trans hh + apply tendsto_order.2 + constructor + · intro a ha + obtain ⟨t,hat,htτ⟩ := exists_between ha + filter_upwards [e.eventually_le_stop T t (htτ.le.trans hτT) b + (fun s hs => hpath s (hs.trans_lt htτ))] with n hn + exact hat.trans_le hn + · intro a ha + exact Eventually.of_forall fun n => (hb n).trans_lt ha + +end SmoothDomainExhaustion +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDriftError.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDriftError.lean new file mode 100644 index 0000000000000000000000000000000000000000..614a9848538711655ad7e671302263994fd2db72 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDriftError.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SLE.Stochastic.PlanarWienerMoments + +namespace OAI + +/-! Riemann errors for bounded Lipschitz tests along planar Wiener paths. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarWiener_lipschitz_mean_error + (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) (A : Set (Driver×Driver)) + (f : ℝ×ℝ → ℝ) (K L : ℝ≥0) (hb : ∀ z, |f z|≤K) (hf : LipschitzWith L f) : + |∫ b in A, f (planarWiener s b)-f (planarWiener (s+δ) b) ∂W.prod W| ≤ + (L:ℝ)*2*Real.sqrt δ*standardGaussianAbsMoment 1 := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hi (t : ℝ≥0) : Integrable (fun b => f (planarWiener t b)) ((W.prod W).restrict A) := + Integrable.of_bound (hf.continuous.measurable.comp (measurable_planarWiener t)).aestronglyMeasurable K + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hb _) + have hni := planarWiener_increment_integrable W hW s δ + calc + _ ≤ ∫ b in A, |f (planarWiener s b)-f (planarWiener (s+δ) b)| ∂W.prod W := by + simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm + (μ := (W.prod W).restrict A) (fun b => f (planarWiener s b)-f (planarWiener (s+δ) b)) + _ ≤ ∫ b in A, (L:ℝ)*‖planarWiener (s+δ) b-planarWiener s b‖ ∂W.prod W := by + apply integral_mono ((hi s).sub (hi (s+δ))).abs (hni.norm.restrict.const_mul _) + intro b + change |f (planarWiener s b)-f (planarWiener (s+δ) b)|≤_ + simpa only [Real.dist_eq,dist_eq_norm,Real.norm_eq_abs,abs_sub_comm] using + hf.dist_le_mul (planarWiener (s+δ) b) (planarWiener s b) + _ = (L:ℝ)*(∫ b in A, ‖planarWiener (s+δ) b-planarWiener s b‖ ∂W.prod W) := integral_const_mul _ _ + _ ≤ (L:ℝ)*(∫ b, ‖planarWiener (s+δ) b-planarWiener s b‖ ∂W.prod W) := by + exact mul_le_mul_of_nonneg_left + (setIntegral_le_integral hni.norm (Eventually.of_forall fun b => norm_nonneg _)) L.coe_nonneg + _ ≤ (L:ℝ)*(2*Real.sqrt δ*standardGaussianAbsMoment 1) := + mul_le_mul_of_nonneg_left (planarWiener_increment_norm_mean W hW s δ) L.coe_nonneg + _ = _ := by ring + +lemma planarWiener_integrated_drift_error + (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) (A : Set (Driver×Driver)) + (f : ℝ×ℝ → ℝ) (K L : ℝ≥0) (hb : ∀ z, |f z|≤K) (hf : LipschitzWith L f) : + |(δ:ℝ)*(∫ b in A, f (planarWiener s b) ∂W.prod W)- + ∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), f (planarWiener u.toNNReal b)) ∂W.prod W| ≤ + (L:ℝ)*2*(δ:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 1 := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let C (u : ℝ) (b : Driver×Driver) := f (planarWiener s b) + let D (u : ℝ) (b : Driver×Driver) := f (planarWiener u.toNNReal b) + let G (u : ℝ) (b : Driver×Driver) := C u b-D u b + have hC : Measurable (Function.uncurry C) := + (hf.continuous.measurable.comp (measurable_planarWiener s)).comp measurable_snd + have ht : Measurable (fun q : ℝ×(Driver×Driver) => (q.1.toNNReal,q.2)) := by fun_prop + have hD : Measurable (Function.uncurry D) := + hf.continuous.measurable.comp (planarWiener_joint_measurable.comp ht) + have hG : Measurable (Function.uncurry G) := hC.sub hD + have hCb (u b) : |C u b|≤K := hb _ + have hDb (u b) : |D u b|≤K := hb _ + have hGb (u b) : |G u b|≤2*(K:ℝ) := (abs_sub _ _).trans (by linarith [hCb u b,hDb u b]) + have hle : (s:ℝ)≤(s+δ:ℝ≥0) := by simp only [NNReal.coe_add]; linarith [δ.coe_nonneg] + have hCI := bounded_interval_integral_integrable (P := (W.prod W).restrict A) _ _ hle C hC K hCb + have hDI := bounded_interval_integral_integrable (P := (W.prod W).restrict A) _ _ hle D hD K hDb + have he : (δ:ℝ)*(∫ b in A, C 0 b ∂W.prod W)- + (∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), D u b) ∂W.prod W) = + ∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), G u b) ∂W.prod W := by + have hc : (∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), C u b) ∂W.prod W) = + (δ:ℝ)*∫ b in A, C 0 b ∂W.prod W := by + simp only [C,intervalIntegral.integral_const,NNReal.coe_add,add_sub_cancel_left, + smul_eq_mul,integral_const_mul] + rw [← hc,← integral_sub hCI hDI] + apply integral_congr_ae + exact Eventually.of_forall fun b => (intervalIntegral.integral_sub + (bounded_time_section_intervalIntegrable _ _ hle C hC K hCb b) + (bounded_time_section_intervalIntegrable _ _ hle D hD K hDb b)).symm + change |(δ:ℝ)*(∫ b in A, C 0 b ∂W.prod W)- + (∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), D u b) ∂W.prod W)|≤_ + rw [he] + have hmean (u : ℝ) (hu : u ∈ Ioc (s:ℝ) (s+δ:ℝ≥0)) : + |∫ b in A, G u b ∂W.prod W|≤(L:ℝ)*2*Real.sqrt δ*standardGaussianAbsMoment 1 := by + have hus : s≤u.toNNReal := by + exact_mod_cast (hu.1.le.trans (Real.le_coe_toNNReal u)) + have hud : u.toNNReal-s≤δ := by + apply tsub_le_iff_right.mpr + exact (Real.toNNReal_le_iff_le_coe).mpr (by simpa only [add_comm] using hu.2) + have ht : s+(u.toNNReal-s)=u.toNNReal := add_tsub_cancel_of_le hus + have hh := planarWiener_lipschitz_mean_error W hW s (u.toNNReal-s) A f K L hb hf + rw [ht] at hh + apply hh.trans + apply mul_le_mul_of_nonneg_right _ (standardGaussianAbsMoment_nonneg 1) + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact Real.sqrt_le_sqrt (by exact_mod_cast hud) + have hh := bounded_interval_integral_expectation_bound (P := (W.prod W).restrict A) + _ _ hle G hG (2*(K:ℝ)) ((L:ℝ)*2*Real.sqrt δ*standardGaussianAbsMoment 1) hGb hmean + calc + _ ≤ (L:ℝ)*2*Real.sqrt δ*standardGaussianAbsMoment 1*((s+δ:ℝ≥0)-s) := hh + _ = _ := by simp only [NNReal.coe_add]; ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDynkin.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDynkin.lean new file mode 100644 index 0000000000000000000000000000000000000000..28ced28a15212e7484a9a792f6ec1570c9526c54 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDynkin.lean @@ -0,0 +1,89 @@ +import OAI.Probability.SLE.Stochastic.PlanarDynkinStep +import OAI.Probability.SLE.OptionalStopping + +namespace OAI + +/-! Dynkin's formula for compact smooth tests of the actual planar Wiener +path, relative to its full two-coordinate past. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planar_compact_eval_integrable + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (A : Set (Driver×Driver)) (t : ℝ≥0) : + Integrable (fun b => f (planarWiener t b)) ((W.prod W).restrict A) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨K,hK,_⟩ := compact_smooth_bounded_lipschitz f hf hc + exact Integrable.of_bound (hf.continuous.measurable.comp (measurable_planarWiener t)).aestronglyMeasurable K + (Eventually.of_forall fun b => hK _) + +lemma planar_generator_joint_measurable + (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) : + Measurable (fun p : ℝ×(Driver×Driver) => planarGenerator f (planarWiener p.1.toNNReal p.2)) := by + have ht : Measurable (fun p : ℝ×(Driver×Driver) => (p.1.toNNReal,p.2)) := by fun_prop + exact (planarGenerator_smooth f hf).continuous.measurable.comp (planarWiener_joint_measurable.comp ht) + +theorem planarWiener_dynkin + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (s t : ℝ≥0) (hst : s≤t) (A : Set (Driver×Driver)) + (hA : MeasurableSet[planarWienerFiltration s] A) : + (∫ b in A, f (planarWiener t b)-f (planarWiener s b) ∂W.prod W) = + ∫ b in A, (∫ u in (s:ℝ)..(t:ℝ), planarGenerator f (planarWiener u.toNNReal b)) ∂W.prod W := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨C,hC⟩ := planarWiener_one_step_error W hW f hf hc + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + let G (u : ℝ) (b : Driver×Driver) := planarGenerator f (planarWiener u.toNNReal b) + have hG : Measurable (Function.uncurry G) := planar_generator_joint_measurable f hf + have hGb (u b) : |G u b|≤D := hD _ + let c (r : ℝ≥0) := ∫ b in A, (∫ u in (s:ℝ)..(s+r:ℝ≥0), G u b) ∂W.prod W + let v (r : ℝ≥0) := ∫ b in A, f (planarWiener r b) ∂W.prod W + let F (r : ℝ≥0) := v (s+r)-c r + have hI (r) := planar_compact_eval_integrable W hW f hf hc A r + have hinc (r δ : ℝ≥0) : |F (r+δ)-F r|≤(C:ℝ)*(δ:ℝ)*Real.sqrt δ := by + have hsr : s ≤ s+r := le_add_of_nonneg_right zero_le + have hA' : MeasurableSet[planarWienerFiltration (s+r)] A := + planarWienerFiltration.mono hsr A hA + have h := hC (s+r) δ A hA' + have hc' : c (r+δ)-c r = + ∫ b in A, (∫ u in (s+r:ℝ≥0)..((s+r)+δ:ℝ≥0), G u b) ∂W.prod W := by + dsimp only [c] + rw [← add_assoc] + exact bounded_interval_integral_expectation_sub _ _ _ + (by exact_mod_cast hsr) (by simp only [NNReal.coe_add]; linarith [δ.coe_nonneg]) G hG D hGb + have hv : v ((s+r)+δ)-v (s+r) = + ∫ b in A, f (planarWiener ((s+r)+δ) b)-f (planarWiener (s+r) b) ∂W.prod W := + (integral_sub (hI _) (hI _)).symm + have he : F (r+δ)-F r = + (∫ b in A, f (planarWiener ((s+r)+δ) b)-f (planarWiener (s+r) b) ∂W.prod W)- + (∫ b in A, (∫ u in (s+r:ℝ≥0)..((s+r)+δ:ℝ≥0), G u b) ∂W.prod W) := by + dsimp only [F] + rw [← add_assoc] + linarith + rw [he] + exact h + have hsqrt : Tendsto (fun δ : ℝ≥0 => Real.sqrt δ) (𝓝 0) (𝓝 0) := by + have hh : Continuous (fun δ : ℝ≥0 => Real.sqrt δ) := by fun_prop + simpa only [ContinuousAt,NNReal.coe_zero,Real.sqrt_zero] using hh.continuousAt (x := 0) + have heq := eq_of_uniform_small_increment F (fun δ => Real.sqrt δ) C hsqrt hinc 0 (t-s) zero_le + have hc0 : c 0=0 := by simp [c] + have ht : s+(t-s)=t := add_tsub_cancel_of_le hst + change v (s+(t-s))-c (t-s)=v (s+0)-c 0 at heq + rw [ht,add_zero,hc0,sub_zero] at heq + have hc' : c (t-s)=∫ b in A, (∫ u in (s:ℝ)..(t:ℝ), G u b) ∂W.prod W := by + dsimp only [c] + rw [ht] + rw [integral_sub (hI _) (hI _)] + change v t-v s=_ + linarith + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarDynkinStep.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarDynkinStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..33d67c7fcf1fa111c12b34b59e1cb858c8f55a17 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarDynkinStep.lean @@ -0,0 +1,100 @@ +import OAI.Probability.SLE.Stochastic.PlanarWienerAverage +import OAI.Probability.SLE.Stochastic.PlanarGaussianRegularity +import OAI.Probability.SLE.Stochastic.PlanarDriftError +import OAI.Probability.SLE.Stochastic.PlanarGeneratorRegularity + +namespace OAI + +/-! Uniform one-step error for compact smooth planar Brownian tests. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarWiener_taylor_set_error + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) : + ∃ C : ℝ≥0, ∀ (s δ : ℝ≥0) (A : Set (Driver×Driver)), + MeasurableSet[planarWienerFiltration s] A → + |(∫ b in A, f (planarWiener (s+δ) b)-f (planarWiener s b) ∂W.prod W)- + (δ:ℝ)*(∫ b in A, planarGenerator f (planarWiener s b) ∂W.prod W)| ≤ + (C:ℝ)*(δ:ℝ)*Real.sqrt δ := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨C,hC⟩ := compact_planar_gaussian_generator f hf hc + obtain ⟨K,hK,_⟩ := compact_smooth_bounded_lipschitz f hf hc + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + have hKb (z) : |f z|≤K := by simpa only [Real.norm_eq_abs] using hK z + refine ⟨C,?_⟩ + intro s δ A hA + have hI (t) : Integrable (fun b => f (planarWiener t b)) ((W.prod W).restrict A) := + Integrable.of_bound (hf.continuous.measurable.comp (measurable_planarWiener t)).aestronglyMeasurable K + (Eventually.of_forall fun b => hK _) + have hGI : Integrable (fun b => planarGenerator f (planarWiener s b)) ((W.prod W).restrict A) := + Integrable.of_bound ((planarGenerator_smooth f hf).continuous.measurable.comp + (measurable_planarWiener s)).aestronglyMeasurable D + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hD _) + have hMI : Integrable (fun b => planarGaussianMean δ f (planarWiener s b).1 (planarWiener s b).2) + ((W.prod W).restrict A) := + Integrable.of_bound ((planarGaussianMean_measurable δ f hf.continuous K hKb).comp + (measurable_planarWiener s)).aestronglyMeasurable K + (Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using + (planarGaussianMean_bound δ f hf.continuous K hKb (planarWiener s b))) + let R (b : Driver×Driver) := planarGaussianMean δ f (planarWiener s b).1 (planarWiener s b).2- + f (planarWiener s b)-(δ:ℝ)*planarGenerator f (planarWiener s b) + have he : (∫ b in A, f (planarWiener (s+δ) b)-f (planarWiener s b) ∂W.prod W)- + (δ:ℝ)*(∫ b in A, planarGenerator f (planarWiener s b) ∂W.prod W) = + ∫ b in A, R b ∂W.prod W := by + rw [integral_sub (hI _) (hI _),planarWiener_set_integral_average W hW s δ A hA f hf.continuous K hKb] + dsimp only [R] + have hSI : Integrable (fun b => planarGaussianMean δ f (planarWiener s b).1 (planarWiener s b).2- + f (planarWiener s b)) ((W.prod W).restrict A) := hMI.sub (hI s) + have hDI : Integrable (fun b => (δ:ℝ)*planarGenerator f (planarWiener s b)) + ((W.prod W).restrict A) := hGI.const_mul _ + rw [integral_sub hSI hDI,integral_sub hMI (hI s),integral_const_mul] + rw [he] + have hb := norm_integral_le_of_norm_le_const (μ := (W.prod W).restrict A) + (f := R) (C := (C:ℝ)*(δ:ℝ)*Real.sqrt δ) + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hC δ (planarWiener s b)) + calc + _ ≤ (C:ℝ)*(δ:ℝ)*Real.sqrt δ*((W.prod W).restrict A).real univ := by + simpa only [Real.norm_eq_abs] using hb + _ ≤ (C:ℝ)*(δ:ℝ)*Real.sqrt δ := by + have hm : ((W.prod W).restrict A).real univ ≤ 1 := by + simpa only [measureReal_def,Measure.restrict_apply_univ] using + (measureReal_le_one (μ := W.prod W) (s := A)) + exact mul_le_of_le_one_right (by positivity) hm + +lemma planarWiener_one_step_error + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) : + ∃ C : ℝ≥0, ∀ (s δ : ℝ≥0) (A : Set (Driver×Driver)), + MeasurableSet[planarWienerFiltration s] A → + |(∫ b in A, f (planarWiener (s+δ) b)-f (planarWiener s b) ∂W.prod W)- + (∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), planarGenerator f (planarWiener u.toNNReal b)) ∂W.prod W)| ≤ + (C:ℝ)*(δ:ℝ)*Real.sqrt δ := by + obtain ⟨C,hC⟩ := planarWiener_taylor_set_error W hW f hf hc + obtain ⟨L,hL,hLip⟩ := planarGenerator_bounded_lipschitz f hf hc + let M : ℝ≥0 := ⟨standardGaussianAbsMoment 1,standardGaussianAbsMoment_nonneg 1⟩ + refine ⟨C+2*L*M,?_⟩ + intro s δ A hA + have he := planarWiener_integrated_drift_error W hW s δ A (planarGenerator f) L L hL hLip + calc + _ ≤ |(∫ b in A, f (planarWiener (s+δ) b)-f (planarWiener s b) ∂W.prod W)- + (δ:ℝ)*(∫ b in A, planarGenerator f (planarWiener s b) ∂W.prod W)|+ + |(δ:ℝ)*(∫ b in A, planarGenerator f (planarWiener s b) ∂W.prod W)- + (∫ b in A, (∫ u in (s:ℝ)..(s+δ:ℝ≥0), planarGenerator f (planarWiener u.toNNReal b)) ∂W.prod W)| := + abs_sub_le _ _ _ + _ ≤ (C:ℝ)*(δ:ℝ)*Real.sqrt δ+(L:ℝ)*2*(δ:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 1 := + add_le_add (hC s δ A hA) he + _ = _ := by + change _ = ((C:ℝ)+2*(L:ℝ)*standardGaussianAbsMoment 1)*(δ:ℝ)*Real.sqrt δ + ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianMean.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e18f6c36eac462949697210f3b6df5848004fe3 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianMean.lean @@ -0,0 +1,115 @@ +import OAI.Probability.SLE.Stochastic.GaussianTaylorMean + +namespace OAI + +/-! The two-coordinate Gaussian generator estimate. Its error is uniform +under the compact smooth test bounds used for stopped planar Brownian motion. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +def planarGaussianMean (δ : ℝ≥0) (f : ℝ × ℝ → ℝ) (a b : ℝ) : ℝ := + ∫ y, ∫ x, f (a+x,b+y) ∂gaussianReal 0 δ ∂gaussianReal 0 δ + +lemma planar_gaussian_generator_error + (f : ℝ × ℝ → ℝ) (hf : Continuous f) (K : ℝ≥0) + (hx : ∀ b, ContDiff ℝ 3 (fun a => f (a,b))) + (hy : ∀ a, ContDiff ℝ 3 (fun b => f (a,b))) + (hxb : ∀ a b j, j ≤ 3 → |iteratedDeriv j (fun x => f (x,b)) a| ≤ K) + (hyb : ∀ a b j, j ≤ 3 → |iteratedDeriv j (fun y => f (a,y)) b| ≤ K) + (hxy : ∀ a, LipschitzWith K (fun b => iteratedDeriv 2 (fun x => f (x,b)) a)) + (δ : ℝ≥0) (a b : ℝ) : + |planarGaussianMean δ f a b-f (a,b)-(1/2:ℝ)*(δ:ℝ)* + (iteratedDeriv 2 (fun x => f (x,b)) a+iteratedDeriv 2 (fun y => f (a,y)) b)| ≤ + (K:ℝ)*(δ:ℝ)*Real.sqrt δ* + (2*standardGaussianAbsMoment 3+(1/2:ℝ)*standardGaussianAbsMoment 1) := by + let μ := gaussianReal 0 δ + let : IsProbabilityMeasure μ := by dsimp [μ]; infer_instance + let A (y : ℝ) := ∫ x, f (a+x,b+y) ∂μ + let D (y : ℝ) := iteratedDeriv 2 (fun x => f (x,y)) a + let R (y : ℝ) := A y-f (a,b+y)-(1/2:ℝ)*(δ:ℝ)*D (b+y) + let e := (K:ℝ)*(δ:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 3 + have hμ : HasLaw (fun y : ℝ => y) μ μ := ⟨measurable_id.aemeasurable, by simp⟩ + have hfbound (x y : ℝ) : |f (x,y)| ≤ K := by + simpa only [iteratedDeriv_zero] using hxb x y 0 (by decide) + have hAi : Integrable A μ := by + have hprod : Integrable (fun p : ℝ × ℝ => f (a+p.2,b+p.1)) (μ.prod μ) := by + apply Integrable.of_bound (hf.comp (by fun_prop)).aestronglyMeasurable K + filter_upwards [] with p + simpa only [Function.comp_apply,Real.norm_eq_abs] using hfbound (a+p.2) (b+p.1) + exact hprod.integral_prod_left + have hfi : Integrable (fun y => f (a,b+y)) μ := by + apply Integrable.of_bound ((hy a).continuous.comp (continuous_const.add continuous_id)).aestronglyMeasurable K + filter_upwards [] with y + simpa only [Function.comp_apply,Pi.add_apply,id_eq,Real.norm_eq_abs] using hfbound a (b+y) + have hDi : Integrable (fun y => D (b+y)) μ := by + apply Integrable.of_bound ((hxy a).continuous.comp (continuous_const.add continuous_id)).aestronglyMeasurable K + filter_upwards [] with y + simpa only [Function.comp_apply,Pi.add_apply,id_eq,D,Real.norm_eq_abs] using hxb a (b+y) 2 (by decide) + have hRi : Integrable R μ := (hAi.sub hfi).sub (hDi.const_mul _) + have hR (y : ℝ) : |R y| ≤ e := + gaussian_second_taylor_integral (fun x => f (x,b+y)) (hx (b+y)) K + (fun x j hj => hxb x (b+y) j hj) δ a + have hRint : |∫ y, R y ∂μ| ≤ e := by + simpa only [probReal_univ,mul_one,Real.norm_eq_abs] using + norm_integral_le_of_norm_le_const (μ := μ) (f := R) (C := e) + (Eventually.of_forall fun y => by simpa only [Real.norm_eq_abs] using hR y) + have hY : |(∫ y, f (a,b+y) ∂μ)-f (a,b)-(1/2:ℝ)*(δ:ℝ)* + iteratedDeriv 2 (fun y => f (a,y)) b| ≤ e := + gaussian_second_taylor_integral (fun y => f (a,y)) (hy a) K + (fun y j hj => hyb a y j hj) δ b + have hDD : Integrable (fun y => D (b+y)-D b) μ := hDi.sub (integrable_const _) + have hDDb (y : ℝ) : |D (b+y)-D b| ≤ (K:ℝ)*|y| := by + simpa only [D,Real.dist_eq,add_sub_cancel_left] using (hxy a).dist_le_mul (b+y) b + have hDDint : |(∫ y, D (b+y) ∂μ)-D b| ≤ + (K:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 1 := by + have he : (∫ y, D (b+y)-D b ∂μ)=(∫ y, D (b+y) ∂μ)-D b := by + rw [integral_sub hDi (integrable_const _)] + simp + rw [← he] + calc + |∫ y, D (b+y)-D b ∂μ| ≤ ∫ y, |D (b+y)-D b| ∂μ := by + simpa only [Real.norm_eq_abs] using + norm_integral_le_integral_norm (μ := μ) (fun y => D (b+y)-D b) + _ ≤ ∫ y, (K:ℝ)*|y| ∂μ := integral_mono hDD.abs + (by simpa only [pow_one] using (gaussian_abs_moment_integrable hμ 1 (by decide)).const_mul (K:ℝ)) hDDb + _ = (K:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 1 := by + rw [integral_const_mul] + have he := gaussian_abs_moment hμ 1 + simp only [pow_one] at he + rw [he] + ring + have he : planarGaussianMean δ f a b-f (a,b)-(1/2:ℝ)*(δ:ℝ)* + (D b+iteratedDeriv 2 (fun y => f (a,y)) b) = + (∫ y, R y ∂μ)+ + ((∫ y, f (a,b+y) ∂μ)-f (a,b)-(1/2:ℝ)*(δ:ℝ)*iteratedDeriv 2 (fun y => f (a,y)) b)+ + (1/2:ℝ)*(δ:ℝ)*((∫ y, D (b+y) ∂μ)-D b) := by + have h0i : Integrable (fun y => A y-f (a,b+y)) μ := hAi.sub hfi + have h1i : Integrable (fun y => (1/2:ℝ)*(δ:ℝ)*D (b+y)) μ := hDi.const_mul _ + have hRcalc : (∫ y, R y ∂μ)=(∫ y, A y ∂μ)-(∫ y, f (a,b+y) ∂μ)- + (1/2:ℝ)*(δ:ℝ)*(∫ y, D (b+y) ∂μ) := by + dsimp only [R] + rw [integral_sub h0i h1i,integral_sub hAi hfi,integral_const_mul] + rw [hRcalc] + change (∫ y, A y ∂μ)-f (a,b)-(1/2:ℝ)*(δ:ℝ)*(D b+_)=_ + ring + change |planarGaussianMean δ f a b-f (a,b)-(1/2:ℝ)*(δ:ℝ)*(D b+_)| ≤ _ + rw [he] + calc + _ ≤ |∫ y, R y ∂μ|+ + |(∫ y, f (a,b+y) ∂μ)-f (a,b)-(1/2:ℝ)*(δ:ℝ)*iteratedDeriv 2 (fun y => f (a,y)) b|+ + |(1/2:ℝ)*(δ:ℝ)*((∫ y, D (b+y) ∂μ)-D b)| := + (abs_add_le _ _).trans (add_le_add (abs_add_le _ _) le_rfl) + _ ≤ e+e+(1/2:ℝ)*(δ:ℝ)*((K:ℝ)*Real.sqrt δ*standardGaussianAbsMoment 1) := by + apply add_le_add (add_le_add hRint hY) + rw [abs_mul,abs_of_nonneg (by positivity : 0≤(1/2:ℝ)*(δ:ℝ))] + exact mul_le_mul_of_nonneg_left hDDint (by positivity) + _ = _ := by dsimp [e]; ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianRegularity.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..233b0b591f0a0e6eb685a330946c38739c8687d1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarGaussianRegularity.lean @@ -0,0 +1,45 @@ +import OAI.Probability.SLE.Stochastic.PlanarKernelMean + +namespace OAI + +/-! Measurability and boundedness of the planar Gaussian averaging operator. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma planarGaussianMean_eq_integral (δ : ℝ≥0) (f : ℝ×ℝ → ℝ) + (hf : Continuous f) (K : ℝ≥0) (hb : ∀ z, |f z|≤K) (z : ℝ×ℝ) : + planarGaussianMean δ f z.1 z.2 = + ∫ y, f (z+y) ∂(gaussianReal 0 δ).prod (gaussianReal 0 δ) := by + have hi : Integrable (fun y : ℝ×ℝ => f (z+y)) + ((gaussianReal 0 δ).prod (gaussianReal 0 δ)) := + Integrable.of_bound (hf.comp (continuous_const.add continuous_id)).aestronglyMeasurable K + (Eventually.of_forall fun y => by + simpa only [Function.comp_apply,Pi.add_apply,id_eq,Real.norm_eq_abs] using hb (z+y)) + exact (integral_prod_symm _ hi).symm + +lemma planarGaussianMean_measurable (δ : ℝ≥0) (f : ℝ×ℝ → ℝ) + (hf : Continuous f) (K : ℝ≥0) (hb : ∀ z, |f z|≤K) : + Measurable (fun z : ℝ×ℝ => planarGaussianMean δ f z.1 z.2) := by + simp_rw [planarGaussianMean_eq_integral δ f hf K hb] + have hm : Measurable (fun p : (ℝ×ℝ)×(ℝ×ℝ) => f (p.1+p.2)) := + hf.measurable.comp (measurable_fst.add measurable_snd) + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +lemma planarGaussianMean_bound (δ : ℝ≥0) (f : ℝ×ℝ → ℝ) + (hf : Continuous f) (K : ℝ≥0) (hb : ∀ z, |f z|≤K) (z : ℝ×ℝ) : + |planarGaussianMean δ f z.1 z.2|≤K := by + rw [planarGaussianMean_eq_integral δ f hf K hb] + simpa only [Real.norm_eq_abs,probReal_univ,mul_one] using + norm_integral_le_of_norm_le_const + (μ := (gaussianReal 0 δ).prod (gaussianReal 0 δ)) + (f := fun y => f (z+y)) (C := (K:ℝ)) + (Eventually.of_forall fun y => by simpa only [Real.norm_eq_abs] using hb (z+y)) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarGeneratorRegularity.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarGeneratorRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9e234e3b5e96be1c1e7a411585658495f352483 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarGeneratorRegularity.lean @@ -0,0 +1,52 @@ +import OAI.Probability.SLE.Geometry.CompactPlanarGaussian + +namespace OAI + +/-! Compact smooth tests retain bounded smoothness and Lipschitz control +under the planar Brownian generator. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma planarGenerator_partial_formula + (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) : + planarGenerator f = fun z => (1/2:ℝ)* + (spatialPartial (f ∘ Prod.swap) 2 z.swap+spatialPartial f 2 z) := by + funext z + have hg : ContDiff ℝ (⊤ : ℕ∞) (f ∘ Prod.swap) := + hf.comp (contDiff_snd.prodMk contDiff_fst) + rcases z with ⟨a,b⟩ + rw [spatialPartial_eq_iteratedDeriv _ hg,spatialPartial_eq_iteratedDeriv _ hf] + rfl + +lemma planarGenerator_smooth + (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) : + ContDiff ℝ (⊤ : ℕ∞) (planarGenerator f) := by + rw [planarGenerator_partial_formula f hf] + have hg : ContDiff ℝ (⊤ : ℕ∞) (f ∘ Prod.swap) := + hf.comp (contDiff_snd.prodMk contDiff_fst) + exact contDiff_const.mul + (((spatialPartial_smooth _ hg 2).comp (contDiff_snd.prodMk contDiff_fst)).add + (spatialPartial_smooth f hf 2)) + +lemma planarGenerator_compact + (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) : + HasCompactSupport (planarGenerator f) := by + rw [planarGenerator_partial_formula f hf] + have hg : HasCompactSupport (f ∘ Prod.swap) := hc.comp_homeomorph (Homeomorph.prodComm ℝ ℝ) + have hh := (spatialPartial_compact _ hg 2).comp_homeomorph (Homeomorph.prodComm ℝ ℝ) + exact (hh.add (spatialPartial_compact f hc 2)).mul_left + +lemma planarGenerator_bounded_lipschitz + (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) : + ∃ C : ℝ≥0, (∀ z, |planarGenerator f z|≤C) ∧ LipschitzWith C (planarGenerator f) := by + simpa only [Real.norm_eq_abs] using compact_smooth_bounded_lipschitz (planarGenerator f) + (planarGenerator_smooth f hf) (planarGenerator_compact f hf hc) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicLocalization.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..992a2705cae41b6c53d63bca0b2d2e5d6201422a --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicLocalization.lean @@ -0,0 +1,52 @@ +import OAI.Probability.SLE.Stochastic.PlanarOptional +import OAI.Probability.SLE.Geometry.CompactSmoothExtension + +namespace OAI + +/-! Compact localization of harmonic tests uses actual stopped planar +Wiener paths, retaining the original two-coordinate filtration. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarGenerator_congr_germ {f g : ℝ×ℝ → ℝ} {z : ℝ×ℝ} + (h : f =ᶠ[𝓝 z] g) : planarGenerator f z=planarGenerator g z := by + have hx : (fun x => f (x,z.2)) =ᶠ[𝓝 z.1] (fun x => g (x,z.2)) := + h.comp_tendsto (continuous_id.prodMk continuous_const).continuousAt.tendsto + have hy : (fun y => f (z.1,y)) =ᶠ[𝓝 z.2] (fun y => g (z.1,y)) := + h.comp_tendsto (continuous_const.prodMk continuous_id).continuousAt.tendsto + unfold planarGenerator + rw [hx.iteratedDeriv_eq 2,hy.iteratedDeriv_eq 2] + +theorem planar_local_harmonic_optional + (W : WienerLaw) (hW : IsWiener W) (U K : Set (ℝ×ℝ)) + (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) + (u : ℝ×ℝ → ℝ) (hu : ContDiffOn ℝ (⊤ : ℕ∞) u U) + (hhar : ∀ z∈U, planarGenerator u z=0) + (τ : Driver×Driver → ℝ≥0) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ b, τ b ≤ T) + (hpath : ∀ b t, t ≤ τ b → planarWiener t b∈K) : + (∫ b, u (planarWiener (τ b) b) ∂W.prod W)=∫ b, u (planarWiener 0 b) ∂W.prod W := by + obtain ⟨f,hf,hfc,_,he,_,_⟩ := exists_compact_smooth_extension U K hU hK hKU u hu + have hzero (b : Driver×Driver) (v : ℝ) (hv : 0 ≤ v) (hvτ : v<(τ b:ℝ)) : + planarGenerator f (planarWiener v.toNNReal b)=0 := by + have ht : v.toNNReal ≤ τ b := (Real.toNNReal_le_iff_le_coe).mpr hvτ.le + have hz := hpath b v.toNNReal ht + rw [planarGenerator_congr_germ (he _ hz)] + exact hhar _ (hKU hz) + have hh := planar_compact_optional W hW f hf hfc τ hτ T hb hzero + have ht (b) : f (planarWiener (τ b) b)=u (planarWiener (τ b) b) := + (he _ (hpath b (τ b) le_rfl)).self_of_nhds + have h0 (b) : f (planarWiener 0 b)=u (planarWiener 0 b) := + (he _ (hpath b 0 zero_le)).self_of_nhds + simpa only [ht,h0] using hh + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicSampling.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf3765c513ef86cae4e6f1a7e409ed7dcc577f45 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarHarmonicSampling.lean @@ -0,0 +1,105 @@ +import OAI.Probability.SLE.Stochastic.PlanarSamplingLimit +import OAI.Probability.SLE.Stochastic.PlanarDomainStops + +namespace OAI + +/-! Conditional harmonic sampling on the actual compact domain stops. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +theorem planar_local_harmonic_optional_between + (W : WienerLaw) (hW : IsWiener W) (U K : Set (ℝ×ℝ)) + (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) + (u : ℝ×ℝ → ℝ) (hu : ContDiffOn ℝ (⊤ : ℕ∞) u U) + (hhar : ∀ z∈U, planarGenerator u z=0) + (σ τ : Driver×Driver → ℝ≥0) + (hσ : IsStoppingTime planarWienerFiltration (fun b => (σ b : WithTop ℝ≥0))) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (hστ : ∀ b, σ b ≤ τ b) (T : ℝ≥0) (hb : ∀ b, τ b ≤ T) + (A : Set (Driver×Driver)) (hA : MeasurableSet[hσ.measurableSpace] A) + (hpath : ∀ b t, t ≤ τ b → planarWiener t b∈K) : + (∫ b in A, u (planarWiener (σ b) b) ∂W.prod W)= + ∫ b in A, u (planarWiener (τ b) b) ∂W.prod W := by + obtain ⟨f,hf,hfc,_,he,_,_⟩ := exists_compact_smooth_extension U K hU hK hKU u hu + have hzero (b : Driver×Driver) (v : ℝ) (_hv : 0 ≤ v) (hvτ : v<(τ b:ℝ)) : + planarGenerator f (planarWiener v.toNNReal b)=0 := by + have ht : v.toNNReal ≤ τ b := Real.toNNReal_le_iff_le_coe.mpr hvτ.le + have hz := hpath b v.toNNReal ht + rw [planarGenerator_congr_germ (he _ hz)] + exact hhar _ (hKU hz) + have hh := planar_compact_optional_between W hW f hf hfc σ τ hσ hτ hστ T hb A hA hzero + have ht (b) : f (planarWiener (τ b) b)=u (planarWiener (τ b) b) := + (he _ (hpath b (τ b) le_rfl)).self_of_nhds + have hs (b) : f (planarWiener (σ b) b)=u (planarWiener (σ b) b) := + (he _ (hpath b (σ b) (hστ b))).self_of_nhds + simpa only [ht,hs] using hh + +namespace SmoothDomainExhaustion +variable {U : Set (ℝ×ℝ)} (e : SmoothDomainExhaustion U 0) + +def stopFiltration (T : ℝ≥0) : Filtration ℕ (inferInstance : MeasurableSpace (Driver×Driver)) where + seq n := (e.stop_stopping T n).measurableSpace + mono' := fun n m hnm => (e.stop_stopping T n).measurableSpace_mono (e.stop_stopping T m) + (fun b => WithTop.coe_le_coe.mpr (e.stop_monotone T b hnm)) + le' n := (e.stop_stopping T n).measurableSpace_le + +lemma harmonic_stopped_adapted (T : ℝ≥0) (hU : IsOpen U) + (u : ℝ×ℝ → ℝ) (hu : ContDiffOn ℝ (⊤ : ℕ∞) u U) : + StronglyAdapted (e.stopFiltration T) (fun n b => u (planarWiener (e.stop T n b) b)) := by + intro n + obtain ⟨f,hf,_,_,he,_,_⟩ := exists_compact_smooth_extension U (tsupport (e.cutoff n)) + hU (e.compact n) (e.supported n) u hu + have hb := measurable_stoppedValue ((Filtration.stronglyAdapted_natural (fun t => + (measurable_planarWiener t).stronglyMeasurable)).isStronglyProgressive_of_continuous + planarWiener_continuous) (e.stop_stopping T n) + have hm := hf.continuous.measurable.comp hb + have heq (b) : f (planarWiener (e.stop T n b) b)=u (planarWiener (e.stop T n b) b) := + (he _ (e.stop_mem_support T n b _ le_rfl)).self_of_nhds + change Measurable[(e.stopFiltration T) n] (fun b => f (planarWiener (e.stop T n b) b)) at hm + simpa only [heq] using hm.stronglyMeasurable + +theorem harmonic_stopped_martingale + (W : WienerLaw) (hW : IsWiener W) (T : ℝ≥0) (hU : IsOpen U) + (u : ℝ×ℝ → ℝ) (hu : ContDiffOn ℝ (⊤ : ℕ∞) u U) + (hhar : ∀ z∈U, planarGenerator u z=0) + (C : ℝ≥0) (huC : ∀ z∈U, |u z|≤C) : + Martingale (fun n b => u (planarWiener (e.stop T n b) b)) (e.stopFiltration T) (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have ha := e.harmonic_stopped_adapted T hU u hu + apply martingale_of_setIntegral_eq_succ ha + · intro n + exact Integrable.of_bound ((ha n).mono ((e.stopFiltration T).le n)).aestronglyMeasurable C + (Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using huC _ (e.stop_mem_domain T n b _ le_rfl)) + · intro n A hA + exact planar_local_harmonic_optional_between W hW U (tsupport (e.cutoff (n+1))) + hU (e.compact (n+1)) (e.supported (n+1)) u hu hhar (e.stop T n) (e.stop T (n+1)) + (e.stop_stopping T n) (e.stop_stopping T (n+1)) (fun b => e.stop_monotone T b (Nat.le_succ n)) + T (e.stop_le T (n+1)) A hA (e.stop_mem_support T (n+1)) + +theorem harmonic_stopped_converges + (W : WienerLaw) (hW : IsWiener W) (T : ℝ≥0) (hU : IsOpen U) + (u : ℝ×ℝ → ℝ) (hu : ContDiffOn ℝ (⊤ : ℕ∞) u U) + (hhar : ∀ z∈U, planarGenerator u z=0) + (C : ℝ≥0) (huC : ∀ z∈U, |u z|≤C) : + ∀ᵐ b ∂W.prod W, ∃ c : ℝ, Tendsto (fun n => u (planarWiener (e.stop T n b) b)) atTop (𝓝 c) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hm := e.harmonic_stopped_martingale W hW T hU u hu hhar C huC + apply hm.submartingale.exists_ae_tendsto_of_bdd (R := C) + intro n + have hb : ∀ᵐ b ∂W.prod W, ‖u (planarWiener (e.stop T n b) b)‖ ≤ C := + Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using huC _ (e.stop_mem_domain T n b _ le_rfl) + simpa using eLpNorm_le_of_ae_bound (p := 1) + (((hm.1 n).mono ((e.stopFiltration T).le n)).aestronglyMeasurable) hb + +end SmoothDomainExhaustion +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarHolomorphicTests.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarHolomorphicTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..447525c709177b423016a551236602a5c940f124 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarHolomorphicTests.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SLE.Stochastic.PlanarHarmonicSampling +import OAI.Probability.SLE.Geometry.ComplexHarmonicGenerator + +namespace OAI + +/-! Bounded holomorphic observables on the physical planar domain give +the two real harmonic tests used for conformal exit limits. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +def planarTranslatedDomain (D : Set ℂ) (w : ℂ) : Set (ℝ×ℝ) := + {z | w+Complex.equivRealProdCLM.symm z∈D} + +lemma planarTranslatedDomain_open {D : Set ℂ} (hD : IsOpen D) (w : ℂ) : + IsOpen (planarTranslatedDomain D w) := + hD.preimage (continuous_const.add Complex.equivRealProdCLM.symm.continuous) + +lemma holomorphic_planar_components {D : Set ℂ} (hD : IsOpen D) + {F : ℂ → ℂ} (hF : DifferentiableOn ℂ F D) (w : ℂ) : + (ContDiffOn ℝ (⊤ : ℕ∞) (fun z => (F (w+Complex.equivRealProdCLM.symm z)).re) + (planarTranslatedDomain D w) ∧ + ∀ z∈planarTranslatedDomain D w, + planarGenerator (fun z => (F (w+Complex.equivRealProdCLM.symm z)).re) z=0) ∧ + (ContDiffOn ℝ (⊤ : ℕ∞) (fun z => (F (w+Complex.equivRealProdCLM.symm z)).im) + (planarTranslatedDomain D w) ∧ + ∀ z∈planarTranslatedDomain D w, + planarGenerator (fun z => (F (w+Complex.equivRealProdCLM.symm z)).im) z=0) := by + let G (z : ℂ) := F (w+z) + have hG (z : ℂ) (hz : w+z∈D) : AnalyticAt ℂ G z := + (hF.analyticOnNhd hD _ hz).comp (analyticAt_const.add analyticAt_id) + have hr (z) (hz : z∈planarTranslatedDomain D w) : + ContDiffAt ℝ (⊤ : ℕ∞) (fun z => (G (Complex.equivRealProdCLM.symm z)).re) z := + Complex.reCLM.contDiff.contDiffAt.comp z + (((hG _ hz).contDiffAt.restrict_scalars ℝ).comp z + Complex.equivRealProdCLM.symm.contDiff.contDiffAt) + have hi (z) (hz : z∈planarTranslatedDomain D w) : + ContDiffAt ℝ (⊤ : ℕ∞) (fun z => (G (Complex.equivRealProdCLM.symm z)).im) z := + Complex.imCLM.contDiff.contDiffAt.comp z + (((hG _ hz).contDiffAt.restrict_scalars ℝ).comp z + Complex.equivRealProdCLM.symm.contDiff.contDiffAt) + refine ⟨⟨?_,?_⟩,⟨?_,?_⟩⟩ + · exact fun z hz => (hr z hz).contDiffWithinAt + · intro z hz + exact planarGenerator_harmonicAt (fun v => (G v).re) z (hG _ hz).harmonicAt_re + · exact fun z hz => (hi z hz).contDiffWithinAt + · intro z hz + exact planarGenerator_harmonicAt (fun v => (G v).im) z (hG _ hz).harmonicAt_im + +theorem holomorphic_stopped_converges + (W : WienerLaw) (hW : IsWiener W) {D : Set ℂ} (hD : IsOpen D) + (w : ℂ) {F : ℂ → ℂ} (hF : DifferentiableOn ℂ F D) + (e : SmoothDomainExhaustion (planarTranslatedDomain D w) 0) + (T : ℝ≥0) (C : ℝ≥0) (hC : ∀ z∈D, ‖F z‖ ≤ C) : + ∀ᵐ b ∂W.prod W, ∃ c : ℂ, + Tendsto (fun n => F (w+Complex.equivRealProdCLM.symm (planarWiener (e.stop T n b) b))) + atTop (𝓝 c) := by + obtain ⟨⟨hr,hr0⟩,⟨hi,hi0⟩⟩ := holomorphic_planar_components hD hF w + have hreal := e.harmonic_stopped_converges W hW T (planarTranslatedDomain_open hD w) + _ hr hr0 C (fun z hz => (Complex.abs_re_le_norm _).trans (hC _ hz)) + have himag := e.harmonic_stopped_converges W hW T (planarTranslatedDomain_open hD w) + _ hi hi0 C (fun z hz => (Complex.abs_im_le_norm _).trans (hC _ hz)) + filter_upwards [hreal,himag] with b hb hi + obtain ⟨a,ha⟩ := hb + obtain ⟨c,hc⟩ := hi + refine ⟨Complex.equivRealProdCLM.symm (a,c),?_⟩ + have hh := Complex.equivRealProdCLM.symm.continuous.continuousAt.tendsto.comp + (ha.prodMk_nhds hc) + change Tendsto (fun n => Complex.equivRealProdCLM.symm + ((F (w+Complex.equivRealProdCLM.symm (planarWiener (e.stop T n b) b))).re, + (F (w+Complex.equivRealProdCLM.symm (planarWiener (e.stop T n b) b))).im)) + atTop (𝓝 (Complex.equivRealProdCLM.symm (a,c))) at hh + simpa only [Complex.equivRealProdCLM_symm_apply,Complex.re_add_im] using hh + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarKernelMean.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarKernelMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0e84710c098d1b37aea0763b2e29cd7a905075c --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarKernelMean.lean @@ -0,0 +1,40 @@ +import OAI.Probability.SLE.Geometry.CompactPlanarGaussian +import OAI.Probability.SLE.Stochastic.PlanarWienerIncrements + +namespace OAI + +/-! Conditional averaging against the actual product Gaussian increment. +This is the integral form needed for the planar Brownian generator. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma independent_planar_gaussian_integral + {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + {P : Measure Ω} [IsProbabilityMeasure P] + (Z : Ω → X) (Y : Ω → ℝ×ℝ) (hZ : Measurable Z) (_hY : Measurable Y) + (δ : ℝ≥0) + (hLaw : HasLaw Y ((gaussianReal 0 δ).prod (gaussianReal 0 δ)) P) + (hind : IndepFun Z Y P) + (H : X×(ℝ×ℝ) → ℝ) (hH : Measurable H) (C : ℝ) + (hbound : ∀ p, |H p| ≤ C) : + (∫ ω, H (Z ω,Y ω) ∂P) = + ∫ ω, ∫ y, H (Z ω,y) ∂(gaussianReal 0 δ).prod (gaussianReal 0 δ) ∂P := by + let ν := (gaussianReal 0 δ).prod (gaussianReal 0 δ) + have hZLaw : HasLaw Z (P.map Z) P := ⟨hZ.aemeasurable,rfl⟩ + have hj := hind.hasLaw_prod hZLaw hLaw + have hHi : Integrable H ((P.map Z).prod ν) := + Integrable.of_bound hH.aestronglyMeasurable C + (Eventually.of_forall fun p => by simpa only [Real.norm_eq_abs] using hbound p) + calc + _ = ∫ p, H p ∂(P.map Z).prod ν := hj.integral_comp hH.aestronglyMeasurable + _ = ∫ x, ∫ y, H (x,y) ∂ν ∂P.map Z := integral_prod H hHi + _ = _ := (hZLaw.integral_comp hHi.integral_prod_left.aestronglyMeasurable).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarLogLifting.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarLogLifting.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea5c19ba9ff36681a4ef88d7c388d1900c9cd278 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarLogLifting.lean @@ -0,0 +1,55 @@ +import OAI.Probability.SLE.Geometry.PublishedPlanarDiskOpenness +import Mathlib.Analysis.Complex.CoveringMap +import Mathlib.Topology.Homotopy.Lifting + +namespace OAI + +/-! Elementary lifting facts used to prove the planar disk openness input. +An odd nonzero function on a connected antipodal space cannot have a +continuous logarithm. -/ +noncomputable section +open Set Filter Metric Function +open scoped Topology + +namespace SLEExactGauge + +lemma continuous_log_at_end_of_homotopy {A : Type*} [TopologicalSpace A] + (H : C(unitInterval × A,ℂ)) (hH : ∀ q, H q≠0) + (L : C(A,ℂ)) (hL : ∀ a, Complex.exp (L a)=H (0,a)) : + ∃ M : C(A,ℂ), ∀ a, Complex.exp (M a)=H (1,a) := by + let H' : C(unitInterval × A,{z : ℂ // z≠0}) := + ⟨fun q => ⟨H q,hH q⟩, H.continuous.subtype_mk _⟩ + have h0 (a : A) : H' (0,a)=⟨Complex.exp (L a),Complex.exp_ne_zero _⟩ := + Subtype.ext (hL a).symm + let G := Complex.isCoveringMap_exp.liftHomotopy H' L h0 + refine ⟨G.comp ⟨fun a => (1,a),continuous_const.prodMk continuous_id⟩,fun a => ?_⟩ + have he := congr_fun (Complex.isCoveringMap_exp.liftHomotopy_lifts H' L h0) (1,a) + exact congrArg Subtype.val he + +lemma no_continuous_log_of_odd_involution {A : Type*} [TopologicalSpace A] + [PreconnectedSpace A] (J : A → A) (hJ : Continuous J) (hinv : Involutive J) + (F L : C(A,ℂ)) (hne : ∀ a, F a≠0) (hodd : ∀ a, F (J a)= -F a) + (hL : ∀ a, Complex.exp (L a)=F a) (a : A) : False := by + let d : A → ℂ := fun x => L (J x)-L x + have hd : Continuous d := (L.continuous.comp hJ).sub L.continuous + have he (x : A) : Complex.exp (d x)= -1 := by + simp only [d,Complex.exp_sub,hL,hodd] + exact neg_div_self (hne x) + have hconst (x y : A) : d x=d y := + Complex.isCoveringMap_exp.const_of_comp hd (by + intro x y + apply Subtype.ext + exact (he x).trans (he y).symm) x y + have hi : d (J a)= -d a := by simp only [d,hinv a]; ring + have hz : d a=0 := by + have heq := (hconst a (J a)).trans hi + linear_combination (1/2:ℂ)*heq + have := he a + rw [hz,Complex.exp_zero] at this + norm_num at this + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarMartingale.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarMartingale.lean new file mode 100644 index 0000000000000000000000000000000000000000..055371ca4a0b28f39a5baf4ef9288164549c8f5c --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarMartingale.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SLE.Stochastic.PlanarCompensated +import OAI.Probability.SLE.Stochastic.PlanarCutoffStop + +namespace OAI + +/-! The full-past martingale associated with each compact smooth planar +test. This supplies conditional optional sampling at localization times. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarWiener_frozen_measurable (T : ℝ≥0) : + @Measurable (ℝ×(Driver×Driver)) (ℝ×ℝ) + ((borel ℝ).prod (planarWienerFiltration T)) inferInstance + (fun p => planarWiener (min p.1.toNNReal T) p.2) := by + have hp := (Filtration.stronglyAdapted_natural (fun t => + (measurable_planarWiener t).stronglyMeasurable)).isStronglyProgressive_of_continuous + planarWiener_continuous + let : MeasurableSpace (Driver×Driver) := planarWienerFiltration T + have ht : Measurable (fun p : ℝ×(Driver×Driver) => + ((⟨min p.1.toNNReal T,mem_Iic.mpr (min_le_right _ _)⟩ : Iic T),p.2)) := + ((measurable_fst.real_toNNReal.min measurable_const).subtype_mk).prodMk measurable_snd + exact (hp T).measurable.comp ht + +lemma planar_compensator_adapted (f : ℝ×ℝ → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (T : ℝ≥0) : Measurable[planarWienerFiltration T] + (fun b => ∫ u in (0:ℝ)..(T:ℝ), planarGenerator f (planarWiener u.toNNReal b)) := by + let : MeasurableSpace (Driver×Driver) := planarWienerFiltration T + let G (u : ℝ) (b : Driver×Driver) := planarGenerator f (planarWiener (min u.toNNReal T) b) + have hm : Measurable (Function.uncurry G) := + (planarGenerator_smooth f hf).continuous.measurable.comp (planarWiener_frozen_measurable T) + have hi := (cumulative_integral_measurable G hm).comp + ((measurable_const (a := T)).prodMk measurable_id) + have he (b : Driver×Driver) : (∫ u in (0:ℝ)..(T:ℝ), G u b)= + ∫ u in (0:ℝ)..(T:ℝ), planarGenerator f (planarWiener u.toNNReal b) := by + apply intervalIntegral.integral_congr_Ioo_of_le T.coe_nonneg + intro u hu + have huT : u.toNNReal ≤ T := Real.toNNReal_le_iff_le_coe.mpr hu.2.le + simp only [G,min_eq_left huT] + change Measurable (fun b => ∫ u in (0:ℝ)..(T:ℝ), G u b) at hi + simpa only [he] using hi + +lemma planar_compensated_stronglyAdapted (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) : StronglyAdapted planarWienerFiltration (planarCompensated f) := by + intro t + exact ((hf.continuous.measurable.comp (planarWiener_adapted t)).sub + (planar_compensator_adapted f hf t)).stronglyMeasurable + +theorem planar_compensated_martingale + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) : + Martingale (planarCompensated f) planarWienerFiltration (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have ha := planar_compensated_stronglyAdapted f hf + refine ⟨ha,fun s t hst => ?_⟩ + apply Filter.EventuallyEq.symm + apply ae_eq_condExp_of_forall_setIntegral_eq (planarWienerFiltration.le s) + (planar_compensated_integrable W hW f hf hc t) + (fun A _ _ => (planar_compensated_integrable W hW f hf hc s).integrableOn) + ?_ (ha s).aestronglyMeasurable + intro A hA _ + have hh := planar_compensated_past_integral_zero W hW f hf hc s t hst A hA + have hi : Integrable (fun b => planarCompensated f t b) ((W.prod W).restrict A) := + (planar_compensated_integrable W hW f hf hc t).restrict + have hj : Integrable (fun b => planarCompensated f s b) ((W.prod W).restrict A) := + (planar_compensated_integrable W hW f hf hc s).restrict + rw [integral_sub hi hj] at hh + exact (sub_eq_zero.mp hh).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarOptional.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarOptional.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e55d0c5322c692e0f5e45f70ae514cc34206719 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarOptional.lean @@ -0,0 +1,80 @@ +import OAI.Probability.SLE.Stochastic.PlanarCompensated + +namespace OAI + +/-! Bounded optional stopping for compact smooth planar harmonic tests. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +theorem planar_compact_optional + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (τ : Driver×Driver → ℝ≥0) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ b, τ b≤T) + (hz : ∀ b u, 0≤u → u<(τ b:ℝ) → planarGenerator f (planarWiener u.toNNReal b)=0) : + (∫ b, f (planarWiener (τ b) b) ∂W.prod W)=∫ b, f (planarWiener 0 b) ∂W.prod W := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨K,hK,_⟩ := compact_smooth_bounded_lipschitz f hf hc + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + have hτm := stopping_time_measurable_nnreal hτ + let V (n : ℕ) (b : Driver×Driver) := f (planarWiener (stopGrid n (τ b)) b) + let G (u : ℝ) (b : Driver×Driver) := planarGenerator f (planarWiener u.toNNReal b) + let H (n : ℕ) (b : Driver×Driver) := ∫ u in (0:ℝ)..(stopGrid n (τ b):ℝ), G u b + have hVm (n : ℕ) : Measurable (V n) := + measurable_discrete_eval (fun k b => f (planarWiener (stopGridTime n k) b)) + (fun k => hf.continuous.measurable.comp (measurable_planarWiener _)) + (stopGridIndex_measurable hτm n) + have hVb (n : ℕ) (b : Driver×Driver) : |V n b|≤K := by + simpa only [Real.norm_eq_abs] using hK (planarWiener (stopGrid n (τ b)) b) + have hVi (n : ℕ) : Integrable (V n) (W.prod W) := + Integrable.of_bound (hVm n).aestronglyMeasurable K + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hVb n b) + have hGm : Measurable (Function.uncurry G) := planar_generator_joint_measurable f hf + have hGb (u b) : |G u b|≤D := hD _ + have hHjoint := cumulative_integral_measurable G hGm + have hHm (n : ℕ) : Measurable (H n) := + measurable_discrete_eval (fun k b => ∫ u in (0:ℝ)..(stopGridTime n k:ℝ), G u b) + (fun k => hHjoint.comp measurable_prodMk_left) (stopGridIndex_measurable hτm n) + have hHb (n : ℕ) (b : Driver×Driver) : |H n b|≤(D:ℝ)*(1/((n:ℝ)+1)) := + bounded_cumulative_at_grid G hGm D D.coe_nonneg hGb τ hz n b + have hHi (n : ℕ) : Integrable (H n) (W.prod W) := + Integrable.of_bound (hHm n).aestronglyMeasurable _ + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hHb n b) + have hmean (n : ℕ) : (∫ b, V n b ∂W.prod W)-(∫ b, f (planarWiener 0 b) ∂W.prod W)= + ∫ b, H n b ∂W.prod W := by + have hh := planar_compensated_grid_integral W hW f hf hc τ hτ T hb n + change (∫ b, V n b-H n b ∂W.prod W)=_ at hh + rw [integral_sub (hVi n) (hHi n)] at hh + linarith + have herror (n : ℕ) : dist (∫ b, V n b ∂W.prod W) (∫ b, f (planarWiener 0 b) ∂W.prod W)≤ + (D:ℝ)*(1/((n:ℝ)+1)) := by + rw [Real.dist_eq,hmean] + have hh := norm_integral_le_of_norm_le_const (μ := W.prod W) + (f := H n) (C := (D:ℝ)*(1/((n:ℝ)+1))) + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hHb n b) + simpa only [Real.norm_eq_abs,probReal_univ,mul_one] using hh + have hlim : Tendsto (fun n => ∫ b, V n b ∂W.prod W) atTop + (𝓝 (∫ b, f (planarWiener (τ b) b) ∂W.prod W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => (K:ℝ)) + (fun n => (hVm n).aestronglyMeasurable) (integrable_const _) + (fun n => Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hVb n b) + exact Eventually.of_forall fun b => + (hf.continuous.comp (planarWiener_continuous b)).continuousAt.tendsto.comp (stopGrid_tendsto (τ b)) + have hlim0 : Tendsto (fun n => ∫ b, V n b ∂W.prod W) atTop + (𝓝 (∫ b, f (planarWiener 0 b) ∂W.prod W)) := by + apply tendsto_iff_dist_tendsto_zero.mpr + apply squeeze_zero (fun n => dist_nonneg) herror + simpa only [mul_zero] using + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul (D:ℝ) + exact tendsto_nhds_unique hlim hlim0 + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarPassageNeighborhood.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarPassageNeighborhood.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e2094d026e1e80683514e5d0816621561f70a2c --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarPassageNeighborhood.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SLE.Gauge.RibbonLimitPassageGeometry + +namespace OAI + +/-! Passage neighborhoods in the entire physical plane. Recentring a +physical ribbon does not preserve the upper half-plane, and this +construction uses only its embedded coordinate patch. -/ + +noncomputable section +open Set Filter Metric +open scoped Topology NNReal + +namespace SLEExactGauge.RibbonCoordinates + +/-- The actual limiting guide supplies a common physical neighborhood and +all varying-region conditions used by the retained-mass passage theorem. -/ +theorem limiting_guide_passage_neighborhood_plane + (hpublished : PublishedPlanarDiskOpenness) + (Pₙ : ℕ → ℂ → ℂ) (P : ℂ → ℂ) (K : Set ℂ) (C L : ℝ≥0) + (hC : 0 < C) (hL : 0 < L) + (hupper : ∀ n, LipschitzOnWith C (Pₙ n) K) + (hlower : ∀ n x, x ∈ K → ∀ y, y ∈ K → dist x y ≤ L * dist (Pₙ n x) (Pₙ n y)) + (hconv : TendstoUniformlyOn Pₙ P atTop K) + (hP : ContinuousOn P K) + (α : ℝ → ℂ) (hα : ContinuousOn α (Icc 0 2)) (x ε η : ℝ) + (hx : |x| < ε) (hη : 0 < η) + (hshape : EqOn α (fun t => P (guideCoordinate 0 x t)) (Icc 0 2)) + (hmem : ∀ t ∈ Icc (0 : ℝ) (3 / 2), guideCoordinate 0 x t ∈ interior K) + (hbase : (1 : ℂ) ∈ K) : + ∃ U : Set ℂ, IsOpen U ∧ α '' Icc (0 : ℝ) (3 / 2) ⊆ U ∧ + IsCompact (closure U) ∧ closure U ⊆ P '' interior K ∧ + ContinuousOn (longitudinalCoordinate P K 0) U ∧ + (∀ᶠ n in atTop, ContinuousOn (longitudinalCoordinate (Pₙ n) K 0) U) ∧ + TendstoLocallyUniformlyOn (fun n => longitudinalCoordinate (Pₙ n) K 0) + (longitudinalCoordinate P K 0) atTop U ∧ + (∀ᶠ n in atTop, U ⊆ physicalPassageRegion (Pₙ n) K C ε η) ∧ + (∀ n z, z ∈ physicalPassageRegion (Pₙ n) K C ε η → + longitudinalCoordinate (Pₙ n) K 0 z = 1 → ‖z - Pₙ n 1‖ < η / 4) ∧ + (∀ᶠ n in atTop, + U ∩ {z | (1 / 3 : ℝ) < longitudinalCoordinate (Pₙ n) K 0 z ∧ + longitudinalCoordinate (Pₙ n) K 0 z < 2 / 3} ⊆ physicalMiddleRegion (Pₙ n) K 0 ε) := by + let V := passageCoordinateRegion C ε η + let A := α '' Icc (0 : ℝ) (3 / 2) + have hA : IsCompact A := isCompact_Icc.image_of_continuousOn + (hα.mono (Icc_subset_Icc_right (by norm_num))) + have hAV : A ⊆ P '' (interior K ∩ V) := by + rintro _ ⟨t, ht, rfl⟩ + exact ⟨guideCoordinate 0 x t, ⟨hmem t ht, + guideCoordinate_mem_passageRegion C hC hx hη ht⟩, + (hshape ⟨ht.1, ht.2.trans (by norm_num)⟩).symm⟩ + obtain ⟨U, hU, hAU, hUc, hUPV, hVlate, hKlate, _⟩ := + common_coordinate_region_neighborhood hpublished Pₙ P K A V L hL hP + (fun n => (hupper n).continuousOn) hconv hlower hA + (passageCoordinateRegion_isOpen C ε η) hAV + have hUP : closure U ⊆ P '' interior K := hUPV.trans (image_mono inter_subset_left) + have hlim := lower_lipschitz_uniform_limit Pₙ P K L hconv hlower + have hi := lower_lipschitz_injOn P K L hlim + have hwidth : ∀ z ∈ closure U, |(coordinateInverse P K z).im| < ε := by + intro z hz + obtain ⟨w, hw, he⟩ := hUPV hz + rw [← he, coordinateInverse_left hi (interior_subset hw.1)] + exact hw.2.2.2.1 + refine ⟨U, hU, hAU, hUc, hUP, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact (longitudinalCoordinate_continuousOn P K L 0 hlim).mono + (subset_closure.trans (hUP.trans (image_mono interior_subset))) + · filter_upwards [hKlate] with n hn + exact (longitudinalCoordinate_continuousOn (Pₙ n) K L 0 (hlower n)).mono + (subset_closure.trans (hn.trans (image_mono interior_subset))) + · exact (longitudinalCoordinate_locally_uniform hpublished Pₙ P K L 0 hL hP + (fun n => (hupper n).continuousOn) hconv hlower).mono (subset_closure.trans hUP) + · exact hVlate.mono (fun _ hn => subset_closure.trans hn) + · exact fun n z hz hp => physicalPassageRegion_terminal (Pₙ n) K C L ε η hC + (hupper n) (hlower n) hbase hz hp + · exact eventual_middle_region_inclusion Pₙ P K U L 0 ε hconv hlower hUc + (hUP.trans (image_mono interior_subset)) + (hKlate.mono (fun _ hn => hn.trans (image_mono interior_subset))) hwidth + +end SLEExactGauge.RibbonCoordinates + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarRetractComplement.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarRetractComplement.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e1ee27270e2a588a39fd3084ebc762c0d138a80 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarRetractComplement.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SLE.Geometry.LocalLogObstruction + +namespace OAI + +/-! A closed planar retract has no bounded complementary component, since +the identity on a circle has no continuous logarithm. -/ +noncomputable section +open Set Filter Metric Function +open scoped Topology + +namespace SLEExactGauge + +lemma no_point_avoiding_identity_outside_ball (z : ℂ) {R : ℝ} (hR : 0 < R) + (f : ℂ → ℂ) (hf : Continuous f) (hne : ∀ w, f w ≠ z) + (hout : ∀ w, R ≤ dist w z → f w=w) : False := by + let S := sphere (0 : ℂ) R + let H : C(unitInterval × S,ℂ) := + ⟨fun p => f (z+(p.1 : ℂ)*(p.2 : ℂ))-z,by fun_prop⟩ + let L : C(S,ℂ) := ContinuousMap.const _ (Complex.log (f z-z)) + have hn : f z-z ≠ 0 := sub_ne_zero.mpr (hne z) + obtain ⟨M,hM⟩ := continuous_log_at_end_of_homotopy H + (fun p => sub_ne_zero.mpr (hne _)) L (fun a => by + simpa [H,L] using Complex.exp_log hn) + apply univalent_boundary_no_continuous_log id R hR continuous_id.continuousOn + injective_id.injOn M + intro a + have ha : R ≤ dist (z+(a : ℂ)) z := by + simpa only [dist_eq_norm,add_sub_cancel_left,sub_zero] using a.property.ge + simpa [H,hout _ ha] using hM a + +theorem bounded_open_frontier_not_retract + {D K : Set ℂ} (hDb : Bornology.IsBounded D) + {z : ℂ} (hz : z ∈ D) (hdisj : Disjoint D K) + (hfrontier : frontier D ⊆ K) + (r : ℂ → ℂ) (hr : Continuous r) (hrK : ∀ w, r w ∈ K) + (hrfix : ∀ w ∈ K, r w=w) : False := by + classical + let f : ℂ → ℂ := D.piecewise r id + have hf : Continuous f := hr.piecewise + (fun w hw => hrfix w (hfrontier hw)) continuous_id + have hne (w : ℂ) : f w ≠ z := by + change (D.piecewise r id) w ≠ z + by_cases hw : w ∈ D + · rw [piecewise_eq_of_mem D r id hw] + intro he + exact Set.disjoint_left.mp hdisj hz (he ▸ hrK w) + · rw [piecewise_eq_of_notMem D r id hw] + intro he + have he' : w=z := he + exact hw (he'.symm ▸ hz) + obtain ⟨R,hR,hball⟩ := hDb.subset_ball_lt 0 z + apply no_point_avoiding_identity_outside_ball z hR f hf hne + intro w hw + have hn : w ∉ D := fun hd => (hball hd).not_ge hw + exact piecewise_eq_of_notMem D r id hn + +lemma frontier_connectedComponentIn_subset_compl {U : Set ℂ} (hU : IsOpen U) + {z : ℂ} : frontier (connectedComponentIn U z) ⊆ Uᶜ := by + intro w hw hwin + obtain ⟨ε,hε,hball⟩ := Metric.isOpen_iff.mp hU w hwin + obtain ⟨v,hvball,hvC⟩ := mem_closure_iff_nhds.mp hw.1 _ (ball_mem_nhds w hε) + have hsub : ball w ε ⊆ connectedComponentIn U v := + isPreconnected_ball.subset_connectedComponentIn hvball hball + have hwC : w ∈ connectedComponentIn U z := by + rw [connectedComponentIn_eq hvC] + exact hsub (mem_ball_self hε) + exact hw.2 (by simpa only [(hU.connectedComponentIn).interior_eq] using hwC) + +theorem retract_complement_component_unbounded + {K : Set ℂ} (hK : IsClosed K) + (r : ℂ → ℂ) (hr : Continuous r) (hrK : ∀ w, r w ∈ K) + (hrfix : ∀ w ∈ K, r w=w) {z : ℂ} (hz : z ∉ K) : + ¬ Bornology.IsBounded (connectedComponentIn Kᶜ z) := by + intro hb + have hfront : frontier (connectedComponentIn Kᶜ z) ⊆ K := by + simpa only [compl_compl] using + (frontier_connectedComponentIn_subset_compl hK.isOpen_compl (z := z)) + apply bounded_open_frontier_not_retract hb + (mem_connectedComponentIn hz) (disjoint_left.mpr (fun w hw hwin => + connectedComponentIn_subset (Kᶜ) z hw hwin)) + hfront r hr hrK hrfix + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingGrid.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..f21d09e703c1897401b5c0a988528b434814191c --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingGrid.lean @@ -0,0 +1,94 @@ +import OAI.Probability.SLE.Stochastic.PlanarMartingale + +namespace OAI + +/-! Conditional optional sampling on the finite grids used to localize +planar harmonic tests. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma stopGridIndex_stopping {Ω : Type*} [mΩ : MeasurableSpace Ω] + {ℱ : Filtration ℝ≥0 mΩ} {σ : Ω → ℝ≥0} + (hσ : IsStoppingTime ℱ (fun b => (σ b : WithTop ℝ≥0))) (n : ℕ) : + IsStoppingTime (gridFiltration ℱ n) (fun b => (stopGridIndex n (σ b) : WithTop ℕ)) := by + intro j + change MeasurableSet[ℱ (stopGridTime n j)] + {b | (stopGridIndex n (σ b) : WithTop ℕ) ≤ (j : WithTop ℕ)} + have he : {b | (stopGridIndex n (σ b) : WithTop ℕ) ≤ (j : WithTop ℕ)}= + {b | σ b ≤ stopGridTime n j} := by + ext b + exact WithTop.coe_le_coe.trans (stopGridIndex_le n j (σ b)) + rw [he] + simpa only [WithTop.coe_le_coe] using hσ (stopGridTime n j) + +lemma measurableSet_stopGridIndex {Ω : Type*} [mΩ : MeasurableSpace Ω] + {ℱ : Filtration ℝ≥0 mΩ} {σ : Ω → ℝ≥0} + (hσ : IsStoppingTime ℱ (fun b => (σ b : WithTop ℝ≥0))) + (T : ℝ≥0) (hb : ∀ b, σ b ≤ T) (n : ℕ) (A : Set Ω) + (hA : MeasurableSet[hσ.measurableSpace] A) : + MeasurableSet[(stopGridIndex_stopping hσ n).measurableSpace] A := by + have hAj (j : ℕ) : MeasurableSet[(gridFiltration ℱ n) j] + (A ∩ {b | (stopGridIndex n (σ b) : WithTop ℕ) ≤ j}) := by + have he : {b | (stopGridIndex n (σ b) : WithTop ℕ) ≤ (j : WithTop ℕ)}= + {b | σ b ≤ stopGridTime n j} := by + ext b + exact WithTop.coe_le_coe.trans (stopGridIndex_le n j (σ b)) + rw [he] + change MeasurableSet[ℱ (stopGridTime n j)] (A ∩ {b | σ b ≤ stopGridTime n j}) + simpa only [WithTop.coe_le_coe] using hA.2 (stopGridTime n j) + have hn (b) : stopGridIndex n (σ b) ≤ stopGridIndex n T := + (stopGridIndex_le n _ _).mpr ((hb b).trans (stopGrid_bounds n T).1) + have hAN : MeasurableSet[(gridFiltration ℱ n) (stopGridIndex n T)] A := by + have he : {b | (stopGridIndex n (σ b) : WithTop ℕ) ≤ (stopGridIndex n T : ℕ)}=univ := by + ext b + simp only [mem_ofPred_eq,mem_univ,iff_true] + exact WithTop.coe_le_coe.mpr (hn b) + simpa only [he,inter_univ] using hAj (stopGridIndex n T) + exact ⟨le_iSup (gridFiltration ℱ n) (stopGridIndex n T) A hAN,hAj⟩ + +lemma planar_compensated_grid_sampling + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (σ τ : Driver×Driver → ℝ≥0) + (hσ : IsStoppingTime planarWienerFiltration (fun b => (σ b : WithTop ℝ≥0))) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (hστ : ∀ b, σ b ≤ τ b) (T : ℝ≥0) (hb : ∀ b, τ b ≤ T) + (A : Set (Driver×Driver)) (hA : MeasurableSet[hσ.measurableSpace] A) (n : ℕ) : + (∫ b in A, planarCompensated f (stopGrid n (σ b)) b ∂W.prod W)= + ∫ b in A, planarCompensated f (stopGrid n (τ b)) b ∂W.prod W := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let ℱn := gridFiltration planarWienerFiltration n + let C (j : ℕ) := planarCompensated f (stopGridTime n j) + have hM : Martingale C ℱn (W.prod W) := by + have hm := planar_compensated_martingale W hW f hf hc + exact ⟨fun j => hm.1 _,fun i j hij => hm.2 _ _ (monotone_stopGridTime n hij)⟩ + have hσn := stopGridIndex_stopping hσ n + have hτn := stopGridIndex_stopping hτ n + have hle : (fun b => (stopGridIndex n (σ b) : WithTop ℕ)) ≤ + (fun b => (stopGridIndex n (τ b) : WithTop ℕ)) := by + intro b + apply WithTop.coe_le_coe.mpr + exact (stopGridIndex_le n _ _).mpr ((hστ b).trans (stopGrid_bounds n (τ b)).1) + have hN (b) : (stopGridIndex n (τ b) : WithTop ℕ) ≤ (stopGridIndex n T : ℕ) := by + apply WithTop.coe_le_coe.mpr + exact (stopGridIndex_le n _ _).mpr ((hb b).trans (stopGrid_bounds n T).1) + have hCE := hM.stoppedValue_ae_eq_condExp_of_le hτn hσn hle hN + have hAn := measurableSet_stopGridIndex hσ T (fun b => (hστ b).trans (hb b)) n A hA + have hI := integrable_stoppedValue ℕ hτn hM.integrable hN + have he : (∫ b in A, stoppedValue C (fun b => (stopGridIndex n (σ b) : WithTop ℕ)) b ∂W.prod W)= + ∫ b in A, stoppedValue C (fun b => (stopGridIndex n (τ b) : WithTop ℕ)) b ∂W.prod W := by + calc + _ = ∫ b in A, (W.prod W)[stoppedValue C (fun b => (stopGridIndex n (τ b) : WithTop ℕ)) | hσn.measurableSpace] b ∂W.prod W := + integral_congr_ae (ae_restrict_of_ae hCE) + _ = _ := setIntegral_condExp hσn.measurableSpace_le hI hAn + exact he + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingLimit.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab472b4486dfd2f32a4404d546fb942ba9351fea --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarSamplingLimit.lean @@ -0,0 +1,99 @@ +import OAI.Probability.SLE.Stochastic.PlanarSamplingGrid + +namespace OAI + +/-! Passing finite-grid conditional sampling to bounded stopping times +for compact smooth planar harmonic tests. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planar_compensated_grid_tendsto + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (ρ : Driver×Driver → ℝ≥0) (hρ : Measurable ρ) (A : Set (Driver×Driver)) + (hz : ∀ b u, 0 ≤ u → u<(ρ b:ℝ) → planarGenerator f (planarWiener u.toNNReal b)=0) : + Tendsto (fun n => ∫ b in A, planarCompensated f (stopGrid n (ρ b)) b ∂W.prod W) + atTop (𝓝 (∫ b in A, f (planarWiener (ρ b) b) ∂W.prod W)) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + obtain ⟨K,hK,_⟩ := compact_smooth_bounded_lipschitz f hf hc + obtain ⟨D,hD,_⟩ := planarGenerator_bounded_lipschitz f hf hc + let V (n : ℕ) (b : Driver×Driver) := f (planarWiener (stopGrid n (ρ b)) b) + let G (u : ℝ) (b : Driver×Driver) := planarGenerator f (planarWiener u.toNNReal b) + let H (n : ℕ) (b : Driver×Driver) := ∫ u in (0:ℝ)..(stopGrid n (ρ b):ℝ), G u b + have hVm (n : ℕ) : Measurable (V n) := + measurable_discrete_eval (fun k b => f (planarWiener (stopGridTime n k) b)) + (fun k => hf.continuous.measurable.comp (measurable_planarWiener _)) + (stopGridIndex_measurable hρ n) + have hVi (n : ℕ) : Integrable (V n) ((W.prod W).restrict A) := + Integrable.of_bound (hVm n).aestronglyMeasurable K (Eventually.of_forall fun b => hK _) + have hVlim : Tendsto (fun n => ∫ b in A, V n b ∂W.prod W) atTop + (𝓝 (∫ b in A, f (planarWiener (ρ b) b) ∂W.prod W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => (K:ℝ)) + (fun n => (hVm n).aestronglyMeasurable) (integrable_const _) + (fun n => Eventually.of_forall fun b => hK _) + exact Eventually.of_forall fun b => + (hf.continuous.comp (planarWiener_continuous b)).continuousAt.tendsto.comp (stopGrid_tendsto (ρ b)) + have hGm : Measurable (Function.uncurry G) := planar_generator_joint_measurable f hf + have hGb (u b) : |G u b|≤D := hD _ + have hHjoint := cumulative_integral_measurable G hGm + have hHm (n : ℕ) : Measurable (H n) := + measurable_discrete_eval (fun k b => ∫ u in (0:ℝ)..(stopGridTime n k:ℝ), G u b) + (fun k => hHjoint.comp measurable_prodMk_left) (stopGridIndex_measurable hρ n) + have hHb (n : ℕ) (b : Driver×Driver) : |H n b|≤(D:ℝ)*(1/((n:ℝ)+1)) := + bounded_cumulative_at_grid G hGm D D.coe_nonneg hGb ρ hz n b + have hHi (n : ℕ) : Integrable (H n) ((W.prod W).restrict A) := + Integrable.of_bound (hHm n).aestronglyMeasurable _ + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hHb n b) + have hHbound (n : ℕ) : |∫ b in A, H n b ∂W.prod W|≤(D:ℝ)*(1/((n:ℝ)+1)) := by + have hh := norm_integral_le_of_norm_le_const (μ := (W.prod W).restrict A) + (f := H n) (C := (D:ℝ)*(1/((n:ℝ)+1))) + (Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hHb n b) + have hm : ((W.prod W).restrict A).real univ≤1 := by + simpa only [measureReal_def,Measure.restrict_apply_univ] using + (measureReal_le_one (μ := W.prod W) (s := A)) + have hh' : |∫ b in A, H n b ∂W.prod W| ≤ + (D:ℝ)*(1/((n:ℝ)+1))*((W.prod W).restrict A).real univ := by + simpa only [Real.norm_eq_abs] using hh + exact hh'.trans + (mul_le_of_le_one_right (by positivity) hm) + have hHlim : Tendsto (fun n => ∫ b in A, H n b ∂W.prod W) atTop (𝓝 0) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simp only [sub_zero,Real.norm_eq_abs] + apply squeeze_zero (fun n => abs_nonneg _) hHbound + simpa only [mul_zero] using + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul (D:ℝ) + have he (n) : (∫ b in A, planarCompensated f (stopGrid n (ρ b)) b ∂W.prod W)= + (∫ b in A, V n b ∂W.prod W)-(∫ b in A, H n b ∂W.prod W) := + integral_sub (hVi n) (hHi n) + simpa only [← he,sub_zero] using hVlim.sub hHlim + +theorem planar_compact_optional_between + (W : WienerLaw) (hW : IsWiener W) (f : ℝ×ℝ → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hc : HasCompactSupport f) + (σ τ : Driver×Driver → ℝ≥0) + (hσ : IsStoppingTime planarWienerFiltration (fun b => (σ b : WithTop ℝ≥0))) + (hτ : IsStoppingTime planarWienerFiltration (fun b => (τ b : WithTop ℝ≥0))) + (hστ : ∀ b, σ b ≤ τ b) (T : ℝ≥0) (hb : ∀ b, τ b ≤ T) + (A : Set (Driver×Driver)) (hA : MeasurableSet[hσ.measurableSpace] A) + (hz : ∀ b u, 0 ≤ u → u<(τ b:ℝ) → planarGenerator f (planarWiener u.toNNReal b)=0) : + (∫ b in A, f (planarWiener (σ b) b) ∂W.prod W)= + ∫ b in A, f (planarWiener (τ b) b) ∂W.prod W := by + have hs := planar_compensated_grid_tendsto W hW f hf hc σ + (stopping_time_measurable_nnreal hσ) A (fun b u hu h => hz b u hu (h.trans_le (hστ b))) + have ht := planar_compensated_grid_tendsto W hW f hf hc τ + (stopping_time_measurable_nnreal hτ) A hz + have he (n) := planar_compensated_grid_sampling W hW f hf hc σ τ hσ hτ hστ T hb A hA n + have ht' : Tendsto (fun n => ∫ b in A, planarCompensated f (stopGrid n (σ b)) b ∂W.prod W) + atTop (𝓝 (∫ b in A, f (planarWiener (τ b) b) ∂W.prod W)) := by + simpa only [he] using ht + exact tendsto_nhds_unique hs ht' + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarWienerAverage.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f98aaacc528e5d5168d31dad311bf6ea9be50b6 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerAverage.lean @@ -0,0 +1,71 @@ +import OAI.Probability.SLE.Stochastic.PlanarKernelMean +import OAI.Probability.SLE.Stochastic.PlanarWienerFiltration + +namespace OAI + +/-! Exact Gaussian averaging for every event in the planar Wiener past. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +lemma planarWiener_set_integral_average + (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) + (A : Set (Driver×Driver)) (hA : MeasurableSet[planarWienerFiltration s] A) + (f : ℝ×ℝ → ℝ) (hf : Continuous f) (C : ℝ≥0) (hb : ∀ z, |f z|≤C) : + (∫ b in A, f (planarWiener (s+δ) b) ∂W.prod W) = + ∫ b in A, planarGaussianMean δ f (planarWiener s b).1 (planarWiener s b).2 ∂W.prod W := by + classical + let P := W.prod W + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let Z (b : Driver×Driver) : (ℝ×ℝ)×Bool := (planarWiener s b,if b∈A then true else false) + let Y (b : Driver×Driver) := planarWiener (s+δ) b-planarWiener s b + have hZm : Measurable[planarWienerFiltration s] Z := + ((Filtration.stronglyAdapted_natural (fun t => + (measurable_planarWiener t).stronglyMeasurable)).adapted s).prodMk + (Measurable.ite hA measurable_const measurable_const) + have hZ : Measurable Z := hZm.mono (planarWienerFiltration.le s) le_rfl + have hY : Measurable Y := (measurable_planarWiener _).sub (measurable_planarWiener _) + have hind : IndepFun Z Y P := by + apply (IndepFun_iff_Indep _ _ _).mpr + exact indep_of_indep_of_le (planarWiener_increment_indep_filtration W hW s δ) + hZm.comap_le le_rfl + let H (p : ((ℝ×ℝ)×Bool)×(ℝ×ℝ)) : ℝ := if p.1.2=true then f (p.1.1+p.2) else 0 + have hH : Measurable H := Measurable.ite + (measurableSet_eq_fun (measurable_snd.comp measurable_fst) measurable_const) + (hf.measurable.comp ((measurable_fst.comp measurable_fst).add measurable_snd)) measurable_const + have hHb (p : ((ℝ×ℝ)×Bool)×(ℝ×ℝ)) : |H p|≤C := by + dsimp only [H] + split_ifs + · exact hb _ + · simp + have hi := independent_planar_gaussian_integral Z Y hZ hY δ + (planarWiener_increment_law W hW s δ) hind H hH C hHb + have hG (z : ℝ×ℝ) : + (∫ y, f (z+y) ∂(gaussianReal 0 δ).prod (gaussianReal 0 δ)) = + planarGaussianMean δ f z.1 z.2 := by + have hfi : Integrable (fun y : ℝ×ℝ => f (z+y)) + ((gaussianReal 0 δ).prod (gaussianReal 0 δ)) := + Integrable.of_bound (hf.comp (continuous_const.add continuous_id)).aestronglyMeasurable C + (Eventually.of_forall fun y => by simpa only [Function.comp_apply,Pi.add_apply,id_eq,Real.norm_eq_abs] using hb (z+y)) + exact integral_prod_symm _ hfi + have hleft (b : Driver×Driver) : H (Z b,Y b)=A.indicator (fun b => f (planarWiener (s+δ) b)) b := by + by_cases ha : b∈A + · simp only [H,Z,Y,ha,ite_true,Set.indicator_of_mem,add_sub_cancel] + · simp [H,Z,ha] + have hright (b : Driver×Driver) : + (∫ y, H (Z b,y) ∂(gaussianReal 0 δ).prod (gaussianReal 0 δ)) = + A.indicator (fun b => planarGaussianMean δ f (planarWiener s b).1 (planarWiener s b).2) b := by + by_cases ha : b∈A + · simpa only [H,Z,ha,ite_true,Set.indicator_of_mem] using hG (planarWiener s b) + · simp [H,Z,ha] + have hAm : MeasurableSet A := planarWienerFiltration.le s A hA + simpa only [hleft,hright,integral_indicator hAm] using hi + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarWienerFiltration.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerFiltration.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ad993cf171a15ed0208cba5478aa15f253451bd --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerFiltration.lean @@ -0,0 +1,59 @@ +import OAI.Probability.SLE.Stochastic.PlanarWienerIncrements + +namespace OAI + +/-! Full-past filtration and restricted Gaussian increment laws for the +actual two-coordinate Wiener path. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +def planarWienerFiltration : Filtration ℝ≥0 (inferInstance : MeasurableSpace (Driver×Driver)) := + Filtration.natural planarWiener (fun t => (measurable_planarWiener t).stronglyMeasurable) + +lemma planarWienerFiltration_le_past (s : ℝ≥0) : + planarWienerFiltration s ≤ MeasurableSpace.comap (planarWienerPast s) inferInstance := by + rw [planarWienerFiltration,Filtration.natural_eq_comap] + have hp : Measurable[MeasurableSpace.comap (planarWienerPast s) inferInstance] + (planarWienerPast s) := measurable_iff_comap_le.mpr le_rfl + have hm : Measurable[MeasurableSpace.comap (planarWienerPast s) inferInstance] + (fun b : Driver×Driver => fun t : Iic s => planarWiener t b) := by + let : MeasurableSpace (Driver×Driver) := + MeasurableSpace.comap (planarWienerPast s) inferInstance + apply measurable_pi_iff.mpr + intro t + exact ((measurable_pi_apply t).comp (measurable_fst.comp hp)).prodMk + ((measurable_pi_apply t).comp (measurable_snd.comp hp)) + exact hm.comap_le + +lemma planarWiener_increment_indep_filtration + (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) : + Indep (planarWienerFiltration s) + (MeasurableSpace.comap (fun b => planarWiener (s+δ) b-planarWiener s b) inferInstance) + (W.prod W) := by + have hi := (IndepFun_iff_Indep _ _ _).mp (planarWiener_increment_indep_past W hW s δ) + exact indep_of_indep_of_le hi (planarWienerFiltration_le_past s) le_rfl + +lemma planarWiener_increment_restrict_law + (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) + (A : Set (Driver×Driver)) (hA : MeasurableSet[planarWienerFiltration s] A) : + ((W.prod W).restrict A).map (fun b => planarWiener (s+δ) b-planarWiener s b) = + (W.prod W) A • (gaussianReal 0 δ).prod (gaussianReal 0 δ) := by + have hm : Measurable (fun b => planarWiener (s+δ) b-planarWiener s b) := + (measurable_planarWiener (s+δ)).sub (measurable_planarWiener s) + have hi := planarWiener_increment_indep_filtration W hW s δ + have hL := planarWiener_increment_law W hW s δ + ext S hS + rw [Measure.map_apply hm hS,Measure.restrict_apply (hm hS),Measure.smul_apply,smul_eq_mul] + rw [inter_comm] + rw [(hi.indepSet_of_measurableSet hA ⟨S,hS,rfl⟩).measure_inter_eq_mul] + exact congrArg (fun x => (W.prod W) A*x) (hL.measure_eq hS) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarWienerIncrements.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerIncrements.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc77b8dfd115112c3229e8f4126ca667a449d5b1 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerIncrements.lean @@ -0,0 +1,59 @@ +import OAI.Probability.SLE.Stochastic.IndependentPlanarIncrements + +namespace OAI + +/-! The two-coordinate Wiener increment has its exact product Gaussian +law and is independent of both coordinate pasts. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +def planarWiener (t : ℝ≥0) (b : Driver×Driver) : ℝ×ℝ := (b.1 t,b.2 t) + +def planarWienerPast (s : ℝ≥0) (b : Driver×Driver) : + (Iic s → ℝ)×(Iic s → ℝ) := (fun t => b.1 t,fun t => b.2 t) + +lemma measurable_planarWiener (t : ℝ≥0) : Measurable (planarWiener t) := by + exact ((continuous_eval_const t).measurable.comp measurable_fst).prodMk + ((continuous_eval_const t).measurable.comp measurable_snd) + +lemma measurable_planarWienerPast (s : ℝ≥0) : Measurable (planarWienerPast s) := by + apply Measurable.prodMk + · exact measurable_pi_iff.mpr (fun t => (continuous_eval_const (t:ℝ≥0)).measurable.comp measurable_fst) + · exact measurable_pi_iff.mpr (fun t => (continuous_eval_const (t:ℝ≥0)).measurable.comp measurable_snd) + +lemma planarWiener_increment_law (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) : + HasLaw (fun b => planarWiener (s+δ) b-planarWiener s b) + ((gaussianReal 0 δ).prod (gaussianReal 0 δ)) (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hm : Measurable (fun b : Driver => b (s+δ)-b s) := + (continuous_eval_const _).measurable.sub (continuous_eval_const _).measurable + have hL : HasLaw (fun b : Driver => b (s+δ)-b s) (gaussianReal 0 δ) W := + (hW.shift s).hasLaw_eval δ + have h1 : HasLaw (fun b : Driver×Driver => b.1 (s+δ)-b.1 s) + (gaussianReal 0 δ) (W.prod W) := hL.comp measurePreserving_fst.hasLaw + have h2 : HasLaw (fun b : Driver×Driver => b.2 (s+δ)-b.2 s) + (gaussianReal 0 δ) (W.prod W) := hL.comp measurePreserving_snd.hasLaw + exact (indepFun_prod hm hm).hasLaw_prod h1 h2 + +lemma planarWiener_increment_indep_past (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) : + IndepFun (planarWienerPast s) + (fun b => planarWiener (s+δ) b-planarWiener s b) (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hp : Measurable (fun b : Driver => fun t : Iic s => b t) := + measurable_pi_iff.mpr (fun t => (continuous_eval_const (t:ℝ≥0)).measurable) + have hi : Measurable (fun b : Driver => b (s+δ)-b s) := + (continuous_eval_const _).measurable.sub (continuous_eval_const _).measurable + have hind : IndepFun (fun b : Driver => fun t : Iic s => b t) + (fun b : Driver => b (s+δ)-b s) W := by + exact ((hW.indepFun_shift s).comp (measurable_pi_apply δ) measurable_id).symm + exact independent_product_pairs hp hi hp hi hind hind + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/PlanarWienerMoments.lean b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3d8e39d2be97e56ecb8309fbc6cbdc1e10e7812 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/PlanarWienerMoments.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SLE.Stochastic.PlanarWienerIncrements + +namespace OAI + +/-! First-moment control of the actual two-coordinate Wiener increments. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge +open Target + +local instance : SecondCountableTopology Driver := + ContinuousMapZero.isEmbedding_toContinuousMap.secondCountableTopology + +lemma planarWiener_increment_integrable (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) : + Integrable (fun b => planarWiener (s+δ) b-planarWiener s b) (W.prod W) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hL := planarWiener_increment_law W hW s δ + have hx := (measurePreserving_fst (μ := gaussianReal 0 δ) (ν := gaussianReal 0 δ)).hasLaw.comp hL + have hy := (measurePreserving_snd (μ := gaussianReal 0 δ) (ν := gaussianReal 0 δ)).hasLaw.comp hL + exact (hx.hasGaussianLaw.integrable).prodMk hy.hasGaussianLaw.integrable + +lemma planarWiener_increment_norm_mean (W : WienerLaw) (hW : IsWiener W) (s δ : ℝ≥0) : + (∫ b, ‖planarWiener (s+δ) b-planarWiener s b‖ ∂W.prod W) ≤ + 2*Real.sqrt δ*standardGaussianAbsMoment 1 := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hL := planarWiener_increment_law W hW s δ + have hx := (measurePreserving_fst (μ := gaussianReal 0 δ) (ν := gaussianReal 0 δ)).hasLaw.comp hL + have hy := (measurePreserving_snd (μ := gaussianReal 0 δ) (ν := gaussianReal 0 δ)).hasLaw.comp hL + have hxi : Integrable (fun b => |(planarWiener (s+δ) b-planarWiener s b).1|) (W.prod W) := by + simpa only [Function.comp_apply,Real.norm_eq_abs] using hx.hasGaussianLaw.integrable.norm + have hyi : Integrable (fun b => |(planarWiener (s+δ) b-planarWiener s b).2|) (W.prod W) := by + simpa only [Function.comp_apply,Real.norm_eq_abs] using hy.hasGaussianLaw.integrable.norm + calc + _ ≤ ∫ b, |(planarWiener (s+δ) b-planarWiener s b).1|+ + |(planarWiener (s+δ) b-planarWiener s b).2| ∂W.prod W := by + apply integral_mono (planarWiener_increment_integrable W hW s δ).norm (hxi.add hyi) + intro b + change ‖planarWiener (s+δ) b-planarWiener s b‖ ≤ + |(planarWiener (s+δ) b-planarWiener s b).1|+|(planarWiener (s+δ) b-planarWiener s b).2| + rw [Prod.norm_def,Real.norm_eq_abs,Real.norm_eq_abs] + exact max_le (le_add_of_nonneg_right (abs_nonneg _)) + (le_add_of_nonneg_left (abs_nonneg _)) + _ = _ := by + rw [integral_add hxi hyi] + have ex := gaussian_abs_moment hx 1 + have ey := gaussian_abs_moment hy 1 + simp only [pow_one,Function.comp_apply] at ex ey + rw [ex,ey] + ring + +lemma planarWiener_continuous (b : Driver×Driver) : Continuous (fun t => planarWiener t b) := + b.1.continuous.prodMk b.2.continuous + +lemma planarWiener_joint_measurable : + Measurable (fun p : ℝ≥0×(Driver×Driver) => planarWiener p.1 p.2) := by + exact ((continuous_eval.comp (continuous_snd.fst.prodMk continuous_fst)).prodMk + (continuous_eval.comp (continuous_snd.snd.prodMk continuous_fst))).measurable + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ProgressiveParameterTime.lean b/lean/OAI/Probability/SLE/Stochastic/ProgressiveParameterTime.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b0b6401f119f7f16d08630c156e94e49aa951f5 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ProgressiveParameterTime.lean @@ -0,0 +1,46 @@ +import OAI.Probability.SLE.Stochastic.ProgressiveRandomTime + +namespace OAI + +/-! A parameter may choose both the sample and the evaluation time of a +progressive process. Finite truncation keeps the original raw sigma algebras. -/ + +noncomputable section +open Set _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped NNReal ENNReal + +namespace MeasureTheory.IsProgressive +open scoped _root_.MeasureTheory _root_.MeasureTheory.IsProgressive + +theorem parameter_time_measurable + {Ω Ξ X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace Ξ] [MeasurableSpace X] + {ℱ : _root_.MeasureTheory.Filtration ℝ≥0 mΩ} {N : ℝ≥0 → Ω → X} (hN : _root_.MeasureTheory.IsProgressive ℱ N) + (g : Ξ → Ω) (hg : Measurable g) (T : Ξ → ℝ≥0) (hT : Measurable T) : + Measurable (fun x => N (T x) (g x)) := by + let f (n : ℕ) (x : Ξ) := N (min (T x) (n:ℝ≥0)) (g x) + have hf (n : ℕ) : Measurable (f n) := by + have ht : Measurable (fun x => (⟨min (T x) (n:ℝ≥0), + Set.mem_Iic.mpr (min_le_right _ _)⟩ : Iic (n:ℝ≥0))) := + (hT.min measurable_const).subtype_mk + have hgn : @Measurable Ξ Ω _ (ℱ (n:ℝ≥0)) g := hg.mono le_rfl (ℱ.le _) + exact (hN (n:ℝ≥0)).comp (ht.prodMk hgn) + intro A hA + have he : (fun x => N (T x) (g x)) ⁻¹' A = + ⋃ n : ℕ, {x | T x ≤ (n:ℝ≥0)} ∩ (f n) ⁻¹' A := by + ext x + simp only [mem_preimage,mem_iUnion,mem_inter_iff,mem_ofPred_eq] + constructor + · intro hx + obtain ⟨n,hn⟩ := exists_nat_ge (T x : ℝ) + have htn : T x ≤ (n:ℝ≥0) := by exact_mod_cast hn + exact ⟨n,htn,by simpa only [f,min_eq_left htn] using hx⟩ + · rintro ⟨n,hn,hx⟩ + simpa only [f,min_eq_left hn] using hx + rw [he] + exact MeasurableSet.iUnion (fun n => (measurableSet_le hT measurable_const).inter (hf n hA)) + +end MeasureTheory.IsProgressive + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ProgressiveRandomTime.lean b/lean/OAI/Probability/SLE/Stochastic/ProgressiveRandomTime.lean new file mode 100644 index 0000000000000000000000000000000000000000..e70202d2317b512e0a0caaedc4325bae7993bde8 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ProgressiveRandomTime.lean @@ -0,0 +1,59 @@ +import Mathlib.Probability.Process.Adapted +import Mathlib.MeasureTheory.Constructions.BorelSpace.Real + +namespace OAI + +/-! Measurable evaluation of a progressive process at an arbitrary finite +random time. The target needs only a measurable-space structure. -/ + +noncomputable section +open Set MeasureTheory +open scoped NNReal ENNReal + +namespace MeasureTheory.IsProgressive +open scoped _root_.MeasureTheory _root_.MeasureTheory.IsProgressive + +theorem random_time_measurable + {Ω X : Type*} [mΩ : MeasurableSpace Ω] [mX : MeasurableSpace X] + {ℱ : _root_.MeasureTheory.Filtration ℝ≥0 mΩ} {N : ℝ≥0 → Ω → X} + (hN : _root_.MeasureTheory.IsProgressive ℱ N) (T : Ω → ℝ≥0) (hT : Measurable T) : + Measurable (fun ω => N (T ω) ω) := by + let f (n : ℕ) (ω : Ω) := N (min (T ω) (n:ℝ≥0)) ω + have hf (n : ℕ) : Measurable (f n) := by + have ht : Measurable (fun ω => (⟨min (T ω) (n:ℝ≥0),Set.mem_Iic.mpr (min_le_right _ _)⟩ : Iic (n:ℝ≥0))) := + (hT.min measurable_const).subtype_mk + have hω : @Measurable Ω Ω mΩ (ℱ (n:ℝ≥0)) id := by + intro A hA + exact ℱ.le (n:ℝ≥0) A hA + have hp : @Measurable Ω (Iic (n:ℝ≥0) × Ω) mΩ + (Subtype.instMeasurableSpace.prod (ℱ (n:ℝ≥0))) + (fun ω => (⟨min (T ω) (n:ℝ≥0),Set.mem_Iic.mpr (min_le_right _ _)⟩,ω)) := ht.prodMk hω + exact (hN (n:ℝ≥0)).comp hp + intro A hA + have he : (fun ω => N (T ω) ω) ⁻¹' A = + ⋃ n : ℕ, {ω | T ω ≤ (n:ℝ≥0)} ∩ (f n) ⁻¹' A := by + ext ω + simp only [mem_preimage,mem_iUnion,mem_inter_iff,mem_ofPred_eq] + constructor + · intro hω + obtain ⟨n,hn⟩ := exists_nat_ge (T ω : ℝ) + have htn : T ω ≤ (n:ℝ≥0) := by exact_mod_cast hn + exact ⟨n,htn,by simpa only [f,min_eq_left htn] using hω⟩ + · rintro ⟨n,hn,hω⟩ + simpa only [f,min_eq_left hn] using hω + rw [he] + exact MeasurableSet.iUnion (fun n => + (measurableSet_le hT measurable_const).inter (hf n hA)) + +theorem extended_random_time_measurable + {Ω X : Type*} [mΩ : MeasurableSpace Ω] [mX : MeasurableSpace X] + {ℱ : _root_.MeasureTheory.Filtration ℝ≥0 mΩ} {N : ℝ≥0 → Ω → X} + (hN : _root_.MeasureTheory.IsProgressive ℱ N) (S : Ω → ℝ≥0∞) (hS : Measurable S) : + Measurable (fun ω => N (S ω).toNNReal ω) := + _root_.OAI.MeasureTheory.IsProgressive.random_time_measurable hN (fun ω => (S ω).toNNReal) (ENNReal.measurable_toNNReal.comp hS) + +end MeasureTheory.IsProgressive + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ProgressiveStoppedTime.lean b/lean/OAI/Probability/SLE/Stochastic/ProgressiveStoppedTime.lean new file mode 100644 index 0000000000000000000000000000000000000000..52e64527394d78d519098b2c380dcce9e85ac9c4 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ProgressiveStoppedTime.lean @@ -0,0 +1,88 @@ +import OAI.Probability.SLE.Stochastic.ProgressiveRandomTime +import OAI.Probability.SLE.Stochastic.ShiftedStoppingFiltration + +namespace OAI + +/-! Stopped-value measurability for a progressive process with a merely +measurable target, in particular a measure-valued canonical mass. -/ + +noncomputable section +open Set _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped NNReal ENNReal + +namespace MeasureTheory.IsProgressive +open scoped _root_.MeasureTheory _root_.MeasureTheory.IsProgressive + +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace X] + {ℱ : _root_.MeasureTheory.Filtration ℝ≥0 mΩ} {N : ℝ≥0 → Ω → X} + +lemma bounded_stopped_measurable (hN : _root_.MeasureTheory.IsProgressive ℱ N) + (τ : Ω → ℝ≥0) + (hτ : _root_.MeasureTheory.IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) + (H : ℝ≥0) (hH : ∀ ω, τ ω ≤ H) : + Measurable[ℱ H] (fun ω => N (τ ω) ω) := by + have htime : Measurable[ℱ H] τ := by + have h := (hτ.measurable_of_le (fun ω => WithTop.coe_le_coe.mpr (hH ω))).untopA + convert h using 1 + funext ω + rw [WithTop.untopA_eq_untop WithTop.coe_ne_top] + rfl + have hp : Measurable[ℱ H,Subtype.instMeasurableSpace.prod (ℱ H)] + (fun ω => ((⟨τ ω,hH ω⟩ : Iic H),ω)) := by + exact htime.subtype_mk.prodMk measurable_id + exact (hN H).comp hp + +lemma truncated_stopped_measurable (hN : _root_.MeasureTheory.IsProgressive ℱ N) + (τ : Ω → ℝ≥0) + (hτ : _root_.MeasureTheory.IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) (H : ℝ≥0) : + Measurable[ℱ H] (fun ω => N (min (τ ω) H) ω) := by + have hmin : _root_.MeasureTheory.IsStoppingTime ℱ (fun ω => ((min (τ ω) H : ℝ≥0) : WithTop ℝ≥0)) := by + simpa only [WithTop.coe_min] using hτ.min_const H + exact _root_.OAI.MeasureTheory.IsProgressive.bounded_stopped_measurable hN _ hmin H (fun _ => min_le_right _ _) + +/-- This requires no topology on the target. -/ +theorem stopped_time_measurable (hN : _root_.MeasureTheory.IsProgressive ℱ N) + (τ : Ω → ℝ≥0) + (hτ : _root_.MeasureTheory.IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) : + Measurable[hτ.measurableSpace] (fun ω => N (τ ω) ω) := by + have hslice (S : Set X) (hS : MeasurableSet S) (H : ℝ≥0) : + MeasurableSet[ℱ H] ((fun ω => N (τ ω) ω) ⁻¹' S ∩ {ω | τ ω ≤ H}) := by + have he : (fun ω => N (τ ω) ω) ⁻¹' S ∩ {ω | τ ω ≤ H} = + (fun ω => N (min (τ ω) H) ω) ⁻¹' S ∩ {ω | τ ω ≤ H} := by + ext ω + simp only [mem_inter_iff,mem_preimage,mem_ofPred_eq] + constructor <;> rintro ⟨hω,ht⟩ <;> exact ⟨by simpa only [min_eq_left ht] using hω,ht⟩ + rw [he] + exact ((_root_.OAI.MeasureTheory.IsProgressive.truncated_stopped_measurable hN τ hτ H) hS).inter (by simpa only [WithTop.coe_le_coe] using hτ H) + intro S hS + constructor + · have he : (fun ω => N (τ ω) ω) ⁻¹' S = + ⋃ n : ℕ, (fun ω => N (τ ω) ω) ⁻¹' S ∩ {ω | τ ω ≤ (n:ℝ≥0)} := by + ext ω + simp only [mem_preimage,mem_iUnion,mem_inter_iff,mem_ofPred_eq] + constructor + · intro hω + obtain ⟨n,hn⟩ := exists_nat_ge (τ ω : ℝ) + exact ⟨n,hω,by exact_mod_cast hn⟩ + · rintro ⟨n,hω,_⟩ + exact hω + rw [he] + exact MeasurableSet.iUnion (fun n => le_iSup ℱ (n:ℝ≥0) _ (hslice S hS n)) + · intro H + simpa only [WithTop.coe_le_coe] using hslice S hS H + +/-- The original measure-valued process evaluated after a finite stopping +time is adapted to the full shifted stopped-past filtration. -/ +theorem shifted_adapted (hN : _root_.MeasureTheory.IsProgressive ℱ N) + (τ : Ω → ℝ≥0) + (hτ : _root_.MeasureTheory.IsStoppingTime ℱ (fun ω => (τ ω : WithTop ℝ≥0))) : + _root_.MeasureTheory.Adapted (SLEExactGauge.shiftedStoppingFiltration hτ) + (fun t ω => N (τ ω+t) ω) := by + intro t + exact _root_.OAI.MeasureTheory.IsProgressive.stopped_time_measurable hN _ (SLEExactGauge.stopping_time_add_nnreal hτ t) + +end MeasureTheory.IsProgressive + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ScalarExponentialLower.lean b/lean/OAI/Probability/SLE/Stochastic/ScalarExponentialLower.lean new file mode 100644 index 0000000000000000000000000000000000000000..f26d6f0434386006fdc8baaf72cadf533b3917b9 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ScalarExponentialLower.lean @@ -0,0 +1,45 @@ +import Mathlib + +namespace OAI + +/-! A lower exponential comparison for the positive forward height. -/ +noncomputable section +open Set + +namespace SLEExactGauge + +lemma scalar_exponential_lower {a b C : ℝ} (y y' : ℝ → ℝ) + (hc : ContinuousOn y (Icc a b)) + (hd : ∀ t ∈ Ico a b, HasDerivWithinAt y (y' t) (Ici t) t) + (hb : ∀ t ∈ Ico a b, -C*y t ≤ y' t) : + ∀ t ∈ Icc a b, y a * Real.exp (-C*(t-a)) ≤ y t := by + let f (t : ℝ) := -(y t*Real.exp (C*(t-a))) + have hfc : ContinuousOn f (Icc a b) := + (hc.mul (Real.continuous_exp.comp + (continuous_const.mul (continuous_id.sub continuous_const))).continuousOn).neg + have hfd (t : ℝ) (ht : t ∈ Ico a b) : HasDerivWithinAt f + (-(y' t+C*y t)*Real.exp (C*(t-a))) (Ici t) t := by + have he : HasDerivAt (fun s : ℝ => Real.exp (C*(s-a))) + (C*Real.exp (C*(t-a))) t := by + convert! (((hasDerivAt_id t).sub_const a).const_mul C).exp using 1 + simp only [id_eq] + ring + convert! ((hd t ht).mul he.hasDerivWithinAt).neg using 1 + ring + have he := image_le_of_deriv_right_le_deriv_boundary hfc hfd + (B := fun _ => -y a) (B' := fun _ => 0) + (by simp [f]) continuousOn_const + (fun t _ => hasDerivWithinAt_const t (Ici t) (-y a)) + (fun t ht => mul_nonpos_of_nonpos_of_nonneg (by linarith [hb t ht]) (Real.exp_pos _).le) + intro t ht + have h := he ht + change -(y t*Real.exp (C*(t-a))) ≤ -y a at h + have hh : y a ≤ y t*Real.exp (C*(t-a)) := by linarith + have hdv := (div_le_iff₀ (Real.exp_pos (C*(t-a)))).mpr hh + simpa only [div_eq_mul_inv,← Real.exp_neg,neg_mul] using hdv + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ScaledDriverFiltration.lean b/lean/OAI/Probability/SLE/Stochastic/ScaledDriverFiltration.lean new file mode 100644 index 0000000000000000000000000000000000000000..2eb4487bf14b16cfdba68c5ce829610fc2febc29 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ScaledDriverFiltration.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SLE.Loewner.RestartDriverScaling + +namespace OAI + +/-! The natural past of the capacity-scaled Brownian driver is exactly +the original past after the deterministic quadratic time change. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +variable {Ω : Type*} [MeasurableSpace Ω] + +def scaledBrownianDriver (c : ℝ≥0) (B : ℝ≥0 → Ω → ℝ) (t : ℝ≥0) (ω : Ω) : ℝ := + (c:ℝ)*B (sourceScaleTime c t) ω + +lemma scaledBrownianDriver_measurable (c : ℝ≥0) (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, Measurable (B t)) (t : ℝ≥0) : + Measurable (scaledBrownianDriver c B t) := measurable_const.mul (hm _) + +omit [MeasurableSpace Ω] in +lemma scaledBrownianDriver_continuous (c : ℝ≥0) (B : ℝ≥0 → Ω → ℝ) + (hc : ∀ ω, Continuous (fun t => B t ω)) (ω : Ω) : + Continuous (fun t => scaledBrownianDriver c B t ω) := + continuous_const.mul ((hc ω).comp (continuous_id.div_const (c^2))) + +lemma scaledBrownianDriver_brownian {P : Measure Ω} (c : ℝ≥0) (hc : 0 < c) + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) : + IsBrownianReal (scaledBrownianDriver c B) P := by + change IsBrownianReal (fun t ω => (c:ℝ)*B (t/(c^2)) ω) P + have h := hB.smul (c := (c^2)⁻¹) (inv_ne_zero (pow_ne_zero 2 hc.ne')) + simpa only [scaledBrownianDriver,sourceScaleTime,NNReal.coe_inv,NNReal.coe_pow, + Real.sqrt_inv,Real.sqrt_sq c.coe_nonneg,inv_inv,div_eq_mul_inv,mul_comm] using h + +lemma scaledBrownianDriver_filtration (c : ℝ≥0) (hc : 0 < c) + (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) (t : ℝ≥0) : + (Filtration.natural (scaledBrownianDriver c B) + (fun s => (scaledBrownianDriver_measurable c B hm s).stronglyMeasurable)) (c^2*t)= + (Filtration.natural B (fun s => (hm s).stronglyMeasurable)) t := by + let ℱ := Filtration.natural B (fun s => (hm s).stronglyMeasurable) + let 𝒢 := Filtration.natural (scaledBrownianDriver c B) + (fun s => (scaledBrownianDriver_measurable c B hm s).stronglyMeasurable) + have hc2 : 0 < c^2 := pow_pos hc 2 + apply le_antisymm + · change (⨆ s ≤ c^2*t, + MeasurableSpace.comap (scaledBrownianDriver c B s) (borel ℝ)) ≤ ℱ t + refine iSup₂_le fun s hs => measurable_iff_comap_le.mp ?_ + have hst : sourceScaleTime c s ≤ t := by + exact (div_le_iff₀ hc2).mpr (by simpa only [mul_comm] using hs) + have hBm : Measurable[ℱ t] (B (sourceScaleTime c s)) := + ((Filtration.stronglyAdapted_natural (fun r => (hm r).stronglyMeasurable) + (sourceScaleTime c s)).mono (ℱ.mono hst)).measurable + exact measurable_const.mul hBm + · change (⨆ s ≤ t, MeasurableSpace.comap (B s) (borel ℝ)) ≤ 𝒢 (c^2*t) + refine iSup₂_le fun s hs => measurable_iff_comap_le.mp ?_ + have hst : c^2*s ≤ c^2*t := mul_le_mul_of_nonneg_left hs zero_le + have hYm : Measurable[𝒢 (c^2*t)] (scaledBrownianDriver c B (c^2*s)) := + ((Filtration.stronglyAdapted_natural (fun r => + (scaledBrownianDriver_measurable c B hm r).stronglyMeasurable) + (c^2*s)).mono (𝒢.mono hst)).measurable + have he : B s=(fun ω => (c:ℝ)⁻¹*scaledBrownianDriver c B (c^2*s) ω) := by + funext ω + change B s ω=(c:ℝ)⁻¹*((c:ℝ)*B ((c^2*s)/c^2) ω) + rw [mul_div_cancel_left₀ _ hc2.ne',inv_mul_cancel_left₀ (show (c:ℝ) ≠ 0 by exact_mod_cast hc.ne')] + rw [he] + exact measurable_const.mul hYm + +lemma scaledBrownianDriver_path_law {P : Measure Ω} + (c : ℝ≥0) (hc : 0 < c) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (hm : ∀ t, Measurable (B t)) (hcont : ∀ ω, Continuous (fun t => B t ω)) : + P.map (sourceDriverPath (scaledBrownianDriver c B) (scaledBrownianDriver_continuous c B hcont))= + P.map (sourceDriverPath B hcont) := + (ScaleTraceLaw.brownian_continuous_path_law B (scaledBrownianDriver c B) + hB (scaledBrownianDriver_brownian c hc hB) hm (scaledBrownianDriver_measurable c B hm) + hcont (scaledBrownianDriver_continuous c B hcont)).symm + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/ShiftedStoppingFiltration.lean b/lean/OAI/Probability/SLE/Stochastic/ShiftedStoppingFiltration.lean new file mode 100644 index 0000000000000000000000000000000000000000..31d2df6fda0c35ea89dae4c4b892441a6942d1e7 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/ShiftedStoppingFiltration.lean @@ -0,0 +1,67 @@ +import OAI.Probability.SLE.BrownianStrongMarkov + +namespace OAI + +/-! The original stopped-past filtration after a finite stopping time. +This keeps the restart comparison on raw sigma algebras. -/ + +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + {ℱ : Filtration ℝ≥0 mΩ} {τ : Ω → ℝ≥0} + +theorem stopping_time_add_nnreal + (hτ : IsStoppingTime ℱ (fun ω => (τ ω:WithTop ℝ≥0))) (t : ℝ≥0) : + IsStoppingTime ℱ (fun ω => ((τ ω+t:ℝ≥0):WithTop ℝ≥0)) := by + intro r + by_cases htr : t ≤ r + · have he : {ω | ((τ ω+t:ℝ≥0):WithTop ℝ≥0) ≤ r} = + {ω | (τ ω:WithTop ℝ≥0) ≤ ((r-t:ℝ≥0):WithTop ℝ≥0)} := by + ext ω + simp only [mem_ofPred_eq,WithTop.coe_le_coe] + exact (le_tsub_iff_right htr).symm + rw [he] + exact ℱ.mono (tsub_le_self : r-t ≤ r) _ (hτ (r-t)) + · have he : {ω | ((τ ω+t:ℝ≥0):WithTop ℝ≥0) ≤ r} = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro ω hω + have hle : τ ω+t ≤ r := by exact_mod_cast hω + exact htr ((le_add_left le_rfl).trans hle) + rw [he] + exact @MeasurableSet.empty Ω (ℱ r) + +def shiftedStoppingFiltration + (hτ : IsStoppingTime ℱ (fun ω => (τ ω:WithTop ℝ≥0))) : Filtration ℝ≥0 mΩ where + seq t := (stopping_time_add_nnreal hτ t).measurableSpace + mono' := by + intro s t hst + apply IsStoppingTime.measurableSpace_mono + (stopping_time_add_nnreal hτ s) (stopping_time_add_nnreal hτ t) + intro ω + change ((τ ω+s:ℝ≥0):WithTop ℝ≥0) ≤ ((τ ω+t:ℝ≥0):WithTop ℝ≥0) + exact WithTop.coe_le_coe.mpr (add_le_add le_rfl hst) + le' t := (stopping_time_add_nnreal hτ t).measurableSpace_le + +theorem shiftedStopping_adapted + (hτ : IsStoppingTime ℱ (fun ω => (τ ω:WithTop ℝ≥0))) + (X : ℝ≥0 → Ω → ℝ) (hX : IsStronglyProgressive ℱ X) : + StronglyAdapted (shiftedStoppingFiltration hτ) (fun t ω => X (τ ω+t) ω) := by + intro t + have h := measurable_stoppedValue hX (stopping_time_add_nnreal hτ t) + change StronglyMeasurable[(stopping_time_add_nnreal hτ t).measurableSpace] + (fun ω => X (τ ω+t) ω) + convert h.stronglyMeasurable using 1 + funext ω + change X (τ ω+t) ω = X (((τ ω+t:ℝ≥0):WithTop ℝ≥0).untopA) ω + rw [WithTop.untopA_eq_untop WithTop.coe_ne_top] + rfl + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerBridge.lean b/lean/OAI/Probability/SLE/Stochastic/WienerBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4438268e00d800ab0a470dd2f741a150d91b952 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerBridge.lean @@ -0,0 +1,76 @@ +import OAI.Probability.SLE.Geometry.PublishedWienerSupport +import Mathlib.Probability.Distributions.Gaussian.IsGaussianProcess.Independence + +namespace OAI + +/-! Independence of the Brownian endpoint and its pinned bridge, used in +the finite-window Wiener support theorem. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +def unitBridge {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) + (t : unitInterval) (ω : Ω) : ℝ := + B (T*⟨t,t.2.1⟩) ω-(t:ℝ)*B T ω + +lemma unitBridge_joint_gaussian + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) : + IsGaussianProcess (Sum.elim (fun _ : Unit => B T) (unitBridge B T)) P := by + classical + apply hB.isGaussianProcess.of_isGaussianProcess + rintro (s | t) + · exact ⟨{T},{toFun := fun x => x ⟨T,by simp⟩ + map_add' := by simp + map_smul' := by simp},by simp⟩ + · let q : ℝ≥0 := T*⟨t,t.2.1⟩ + refine ⟨{q,T}, + { toFun := fun x => x ⟨q,by simp⟩ - (t:ℝ)*x ⟨T,by simp⟩ + map_add' := ?_ + map_smul' := ?_ }, ?_⟩ + · intro x y + simp only [Pi.add_apply] + ring + · intro c x + simp only [Pi.smul_apply,smul_eq_mul,RingHom.id_apply] + ring + · intro ω + rfl + +lemma unitBridge_endpoint_covariance + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) (t : unitInterval) : + cov[B T,unitBridge B T t;P]=0 := by + have : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have ht : T*⟨t,t.2.1⟩≤T := by + apply NNReal.coe_le_coe.mp + change (T:ℝ)*(t:ℝ) ≤ T + nlinarith [NNReal.coe_nonneg T,t.2.2] + change cov[B T, fun ω => B (T*⟨t,t.2.1⟩) ω - (t:ℝ)*B T ω; P] = 0 + rw [covariance_fun_sub_right, + covariance_const_mul_right,hB.covariance_eval,hB.covariance_eval, + min_eq_right ht,min_self] + · change (T:ℝ)*(t:ℝ) - (t:ℝ)*(T:ℝ) = 0 + ring + · exact (hB.isGaussianProcess.hasGaussianLaw_eval _).memLp_two + · exact (hB.isGaussianProcess.hasGaussianLaw_eval _).memLp_two + · exact (hB.isGaussianProcess.hasGaussianLaw_eval _).memLp_two.const_mul _ + +lemma unitBridge_independent_endpoint + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) : + IndepFun (B T) (fun ω t => unitBridge B T t ω) P := by + have hi := (unitBridge_joint_gaussian hB T).indepFun_of_covariance_eq_zero + (fun _ => hB.aemeasurable T) + (fun t => (hB.aemeasurable _).sub ((hB.aemeasurable T).const_mul (t:ℝ))) + (fun _ t => unitBridge_endpoint_covariance hB T t) + simpa only [Function.comp_def, id_eq] using + hi.comp (measurable_pi_apply ()) measurable_id + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerCoefficientLimit.lean b/lean/OAI/Probability/SLE/Stochastic/WienerCoefficientLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..8379fa4bee84a1c6de81acecb5be78594818454f --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerCoefficientLimit.lean @@ -0,0 +1,131 @@ +import OAI.Probability.SLE.Geometry.NormalizedCoefficientLimit +import OAI.Probability.SLE.Angle.TargetLevelMeasurability + +namespace OAI + +/-! Transfer of the exact fixed-angle coefficient limit to the Wiener +integrals appearing in the prescribed deterministic gauge. -/ + +noncomputable section +open Set Filter _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge.Target + +lemma measurable_fixedLevelDensity (κ θ ℓ : ℝ) : + Measurable (fun b => levelDensity κ θ b ℓ) := + @Measurable.comp Driver (ℝ × Driver) ℝ + inferInstance inferInstance inferInstance + (fun p => levelDensity κ p.1 p.2 ℓ) (fun b => (θ,b)) + (measurable_levelDensity_angle κ ℓ) (measurable_const.prodMk measurable_id) + +lemma measurable_fixedDiscreteMass (κ θ : ℝ) (W : WienerLaw) [SFinite W] (ℓ : ℝ) (n : ℕ) : + Measurable (fun b => discreteMass κ θ W b ℓ n) := by + have ht : Measurable (fun b : Driver => levelTime κ θ b ℓ) := + @Measurable.comp Driver (ℝ × Driver) ℝ≥0∞ + inferInstance inferInstance inferInstance + (fun p => levelTime κ p.1 p.2 ℓ) (fun b => (θ,b)) + (measurable_levelTime_angle κ ℓ) (measurable_const.prodMk measurable_id) + exact discreteMass_comp_measurable κ θ W id measurable_id ℓ ht n + +lemma measurable_fixedCoefficient (κ θ : ℝ) (W : WienerLaw) [SFinite W] + (ℓ u : ℝ) (n k : ℕ) : + Measurable (fun b => levelDensity κ θ b ℓ*(clip u (discreteMass κ θ W b ℓ n))^k) := + (measurable_fixedLevelDensity κ θ ℓ).mul + (((continuous_clip u).measurable.comp (measurable_fixedDiscreteMass κ θ W ℓ n)).pow_const k) + +lemma levelDensity_nonneg_of_witness + (κ : ℝ) (hκ : 0 < κ) (b : Driver) (U : ℝ≥0 → ℝ) (hUc : Continuous U) + (γ : ℝ≥0 → ℂ) (G F : ℝ≥0 → ℂ → ℂ) (hw : IsCapacityTwoWitness U γ G F) + (hU : ∀ s : ℝ, 0 ≤ s → U s.toNNReal=driverValue b (κ*s)) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) (ℓ : ℝ) (hℓ : 0 ≤ ℓ) : + 0 ≤ levelDensity κ θ b ℓ := by + rw [levelDensity_eq_stoppedGreen κ hκ b U hUc γ G F hw hU θ hθ ℓ hℓ] + exact div_nonneg (stoppedGreen_nonneg hw κ _ _) + (initialGreen_pos κ _ (diskMapInv_maps hθ (by simp))).le + +end SLEExactGauge.Target + +namespace SLEExactGauge.Multipoint.CanonicalMass + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + [IsProbabilityMeasure P] {κ : ℝ} + {B : ℝ≥0 → Ω → ℝ} {hBm : Measurable (Function.uncurry B)} + {γ : Ω → ℝ≥0 → ℂ} {G : Ω → ℝ≥0 → ℂ → ℂ} + (C : CanonicalMass P κ B hBm γ G) + +theorem wiener_clipped_coefficient_limit + (hB : IsBrownianReal B P) (hκ : 0<κ) (hκ8 : κ<8) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (W : Target.WienerLaw) (hW : Target.IsWiener W) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) (ℓ : ℝ) (hℓ : 0 ≤ ℓ) + (u : ℝ) (hu : 0 ≤ u) (k : ℕ) : + Tendsto (fun n => ∫ b, Target.levelDensity κ θ b ℓ * + (Target.clip u (Target.discreteMass κ θ W b ℓ n))^k ∂W) atTop + (𝓝 (∫ ω, Target.levelDensity κ θ (Target.normalizedDriver κ B hc h0 ω) ℓ * + (Target.clip u (massAtExtendedTime (fun t => C.normalizedDiskScalar θ hθ t ω) + (C.diskTerminalScalar θ hθ ω) + (Target.levelTime κ θ (Target.normalizedDriver κ B hc h0 ω) ℓ)))^k ∂P)) := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + have hLaw := Target.normalizedDriver_law κ hκ B hB + (fun r => (hBm.comp (measurable_const.prodMk measurable_id) : Measurable (B r))) hc h0 W hW + have he (n : ℕ) := hLaw.integral_comp + (Target.measurable_fixedCoefficient κ θ W ℓ u n k).aestronglyMeasurable + have ht := C.normalized_clipped_coefficient_limit hB hκ hκ8 hc h0 F hw W hW θ hθ ℓ hℓ u hu k + apply ht.congr' + filter_upwards [] with n + exact he n + +include hBm in +theorem wiener_clipped_coefficient_bound + (hB : IsBrownianReal B P) (hκ : 0<κ) (hκ8 : κ<8) + (hc : ∀ ω, Continuous (fun t => B t ω)) (h0 : ∀ ω, B 0 ω=0) + (F : Ω → ℝ≥0 → ℂ → ℂ) + (hw : ∀ ω, IsCapacityTwoWitness (fun t => Real.sqrt κ*B t ω) (γ ω) (G ω) (F ω)) + (W : Target.WienerLaw) (hW : Target.IsWiener W) + (θ : ℝ) (hθ : θ ∈ Ioo (0:ℝ) Real.pi) (ℓ : ℝ) (hℓ : 0 ≤ ℓ) + (u : ℝ) (hu : 0 ≤ u) (n k : ℕ) : + 0 ≤ (∫ b, Target.levelDensity κ θ b ℓ * + (Target.clip u (Target.discreteMass κ θ W b ℓ n))^k ∂W) ∧ + (∫ b, Target.levelDensity κ θ b ℓ * + (Target.clip u (Target.discreteMass κ θ W b ℓ n))^k ∂W) ≤ u^k := by + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let b := Target.normalizedDriver κ B hc h0 + let w := fun ω => Target.levelDensity κ θ (b ω) ℓ + let f := fun ω => (Target.clip u (Target.discreteMass κ θ W (b ω) ℓ n))^k + have hm (r : ℝ≥0) : Measurable (B r) := hBm.comp (measurable_const.prodMk measurable_id) + have hb := Target.normalizedDriver_measurable κ B hm hc h0 + have hLaw := Target.normalizedDriver_law κ hκ B hB hm hc h0 W hW + have he := hLaw.integral_comp + (Target.measurable_fixedCoefficient κ θ W ℓ u n k).aestronglyMeasurable + rw [← he] + change 0 ≤ (∫ ω, w ω*f ω ∂P) ∧ (∫ ω, w ω*f ω ∂P) ≤ u^k + have hwi := Target.levelDensity_integrable_mean κ hκ hκ8 B hB b γ G F + (Eventually.of_forall hw) (Eventually.of_forall (Target.normalizedDriver_matches κ hκ B hc h0)) + θ hθ ℓ hℓ + have hw0 (ω : Ω) : 0 ≤ w ω := Target.levelDensity_nonneg_of_witness κ hκ (b ω) _ + ((hc ω).const_mul _) (γ ω) (G ω) (F ω) (hw ω) + (Target.normalizedDriver_matches κ hκ B hc h0 ω) θ hθ ℓ hℓ + have hf0 (ω : Ω) : 0 ≤ f ω := pow_nonneg (clip_nonneg hu _) k + have hfb (ω : Ω) : f ω ≤ u^k := + pow_le_pow_left₀ (clip_nonneg hu _) (clip_le _ _) k + have hprod : Integrable (fun ω => w ω*f ω) P := by + apply (hwi.1.norm.mul_const (u^k)).mono' + ((Target.measurable_fixedCoefficient κ θ W ℓ u n k).comp hb).aestronglyMeasurable + filter_upwards [] with ω + change ‖w ω * f ω‖ ≤ ‖w ω‖ * u^k + rw [norm_mul,Real.norm_of_nonneg (hf0 ω)] + exact mul_le_mul_of_nonneg_left (hfb ω) (norm_nonneg _) + refine ⟨integral_nonneg (fun ω => mul_nonneg (hw0 ω) (hf0 ω)),?_⟩ + calc + (∫ ω, w ω*f ω ∂P) ≤ ∫ ω, w ω*u^k ∂P := + integral_mono hprod (hwi.1.mul_const _) (fun ω => mul_le_mul_of_nonneg_left (hfb ω) (hw0 ω)) + _ = u^k := by rw [integral_mul_const,hwi.2,one_mul] + +end SLEExactGauge.Multipoint.CanonicalMass + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerGrid.lean b/lean/OAI/Probability/SLE/Stochastic/WienerGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..06dc9db9fbfd985b6b6def4b7e48c9369fd5e1b9 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerGrid.lean @@ -0,0 +1,177 @@ +import OAI.Probability.SLE.Stochastic.WienerBridge +import Mathlib.Algebra.Order.Floor.Semiring + +namespace OAI + +/-! The uniform grid and its linear interpolation, used only to prove +the finite-window support of the actual Wiener law. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +def wienerGridTime (n k : ℕ) : ℝ≥0 := (k:ℝ≥0)/(n+1:ℝ≥0) + +def wienerGridCell (n : ℕ) (t : unitInterval) : ℕ := + ⌊(n+1:ℝ)*(t:ℝ)⌋₊ + +def wienerGridWeight (n : ℕ) (t : unitInterval) : ℝ := + (n+1:ℝ)*(t:ℝ)-wienerGridCell n t + +lemma wienerGridCell_le (n : ℕ) (t : unitInterval) : + wienerGridCell n t ≤ n+1 := by + apply Nat.floor_le_of_le + push_cast + nlinarith [t.2.2] + +lemma wienerGridWeight_mem (n : ℕ) (t : unitInterval) : + wienerGridWeight n t ∈ Ico (0:ℝ) 1 := by + constructor + · exact sub_nonneg.mpr (Nat.floor_le (mul_nonneg (by positivity) t.2.1)) + · have h := Nat.lt_floor_add_one ((n+1:ℝ)*(t:ℝ)) + change _ < (wienerGridCell n t:ℝ)+1 at h + unfold wienerGridWeight + linarith + +lemma wienerGrid_bracket (n : ℕ) (t : unitInterval) : + (wienerGridTime n (wienerGridCell n t):ℝ) ≤ t ∧ + (t:ℝ) ≤ wienerGridTime n (wienerGridCell n t+1) := by + have hN : (0:ℝ) f s-g s) t := by + unfold wienerGridInterp + ring + +lemma wienerGridInterp_difference (n : ℕ) (f g : ℝ≥0 → ℝ) (t : unitInterval) + {ε : ℝ} + (h : ∀ k ≤ n+2, |f (wienerGridTime n k)-g (wienerGridTime n k)| ≤ ε) : + |wienerGridInterp n f t-wienerGridInterp n g t| ≤ ε := by + rw [wienerGridInterp_sub] + have hw := wienerGridWeight_mem n t + have ha := h (wienerGridCell n t) ((wienerGridCell_le n t).trans (by omega)) + have hb := h (wienerGridCell n t+1) (by have := wienerGridCell_le n t; omega) + unfold wienerGridInterp + calc + _ ≤ |(1-wienerGridWeight n t)*(f (wienerGridTime n (wienerGridCell n t))-g (wienerGridTime n (wienerGridCell n t)))|+ + |wienerGridWeight n t*(f (wienerGridTime n (wienerGridCell n t+1))-g (wienerGridTime n (wienerGridCell n t+1)))| := abs_add_le _ _ + _ = (1-wienerGridWeight n t)*|f (wienerGridTime n (wienerGridCell n t))-g (wienerGridTime n (wienerGridCell n t))|+ + wienerGridWeight n t*|f (wienerGridTime n (wienerGridCell n t+1))-g (wienerGridTime n (wienerGridCell n t+1))| := by + rw [abs_mul,abs_mul,abs_of_nonneg (sub_nonneg.mpr hw.2.le),abs_of_nonneg hw.1] + _ ≤ (1-wienerGridWeight n t)*ε+wienerGridWeight n t*ε := + add_le_add (mul_le_mul_of_nonneg_left ha (sub_nonneg.mpr hw.2.le)) + (mul_le_mul_of_nonneg_left hb hw.1) + _ = ε := by ring + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerGridIndependence.lean b/lean/OAI/Probability/SLE/Stochastic/WienerGridIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..966118fbeb237d4d38f25703ffd59aebadcde0ac --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerGridIndependence.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SLE.Stochastic.WienerGrid + +namespace OAI + +/-! The Brownian interpolation residual is independent of the finite +grid. Only covariances of the three evaluations in each residual enter. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma brownian_affine_residual_covariance + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (a b t s : ℝ≥0) (c : ℝ) (hat : a ≤ t) (htb : t ≤ b) + (hs : s ≤ a ∨ b ≤ s) (hc : (1-c)*(a:ℝ)+c*(b:ℝ)=t) : + cov[B s,fun ω => B t ω-((1-c)*B a ω+c*B b ω);P]=0 := by + have : IsProbabilityMeasure P := hB.isGaussianProcess.isProbabilityMeasure + have hm u := (hB.isGaussianProcess.hasGaussianLaw_eval u).memLp_two + have hz : MemLp (fun ω => (1-c)*B a ω+c*B b ω) 2 P := + ((hm a).const_mul (1-c)).add ((hm b).const_mul c) + have hadd : cov[B s,fun ω => (1-c)*B a ω+c*B b ω;P] = + cov[B s,fun ω => (1-c)*B a ω;P]+cov[B s,fun ω => c*B b ω;P] := + covariance_add_right (hm s) ((hm a).const_mul (1-c)) ((hm b).const_mul c) + rw [covariance_fun_sub_right (hm s) (hm t) hz, + hadd, + covariance_const_mul_right,covariance_const_mul_right, + hB.covariance_eval,hB.covariance_eval,hB.covariance_eval] + rcases hs with hs | hs + · rw [min_eq_left (hs.trans hat),min_eq_left hs,min_eq_left (hs.trans (hat.trans htb))] + ring + · rw [min_eq_right (htb.trans hs),min_eq_right ((hat.trans htb).trans hs),min_eq_right hs] + linarith + +def wienerGridResidual {Ω : Type*} (n : ℕ) (B : ℝ≥0 → Ω → ℝ) + (t : unitInterval) (ω : Ω) : ℝ := + B ⟨t,t.2.1⟩ ω-wienerGridInterp n (fun s => B s ω) t + +lemma wienerGrid_joint_gaussian + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (n : ℕ) : + IsGaussianProcess (Sum.elim (fun i : Fin (n+3) => B (wienerGridTime n i)) + (wienerGridResidual n B)) P := by + classical + apply hB.isGaussianProcess.of_isGaussianProcess + rintro (i | t) + · exact ⟨{wienerGridTime n i}, + { toFun := fun x => x ⟨wienerGridTime n i,by simp⟩ + map_add' := by simp + map_smul' := by simp },by simp⟩ + · let a := wienerGridTime n (wienerGridCell n t) + let b := wienerGridTime n (wienerGridCell n t+1) + let u : ℝ≥0 := ⟨t,t.2.1⟩ + let c := wienerGridWeight n t + refine ⟨{u,a,b}, + { toFun := fun x => x ⟨u,by simp⟩- + ((1-c)*x ⟨a,by simp⟩+c*x ⟨b,by simp⟩) + map_add' := ?_ + map_smul' := ?_ },?_⟩ + · intro x y + simp only [Pi.add_apply] + ring + · intro d x + simp only [Pi.smul_apply,smul_eq_mul,RingHom.id_apply] + ring + · intro ω + rfl + +lemma wienerGrid_residual_covariance + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (n : ℕ) + (i : Fin (n+3)) (t : unitInterval) : + cov[B (wienerGridTime n i),wienerGridResidual n B t;P]=0 := by + have hb := wienerGrid_bracket n t + have hs : wienerGridTime n i ≤ wienerGridTime n (wienerGridCell n t) ∨ + wienerGridTime n (wienerGridCell n t+1) ≤ wienerGridTime n i := by + by_cases h : (i:ℕ) ≤ wienerGridCell n t + · exact Or.inl (wienerGridTime_mono n h) + · exact Or.inr (wienerGridTime_mono n (by omega)) + exact brownian_affine_residual_covariance hB _ _ _ _ _ hb.1 hb.2 hs + (wienerGrid_affine n t) + +lemma wienerGrid_residual_independent + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (n : ℕ) : + IndepFun (fun ω (i : Fin (n+3)) => B (wienerGridTime n i) ω) + (fun ω t => wienerGridResidual n B t ω) P := by + apply (wienerGrid_joint_gaussian hB n).indepFun_of_covariance_eq_zero + · intro i + exact hB.aemeasurable _ + · intro t + exact (hB.aemeasurable _).sub + (((hB.aemeasurable _).const_mul _).add ((hB.aemeasurable _).const_mul _)) + · exact wienerGrid_residual_covariance hB n + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerGridSupport.lean b/lean/OAI/Probability/SLE/Stochastic/WienerGridSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..94bb1995052c8de058f8b7fce53c7ae2b1a3fc11 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerGridSupport.lean @@ -0,0 +1,92 @@ +import OAI.Probability.SLE.Stochastic.WienerGridIndependence +import Mathlib.MeasureTheory.Measure.OpenPos + +namespace OAI + +/-! Nondegenerate independent Gaussian increments give positive +probability to every based finite grid tube. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +lemma gaussianReal_ball_pos (a c : ℝ) (v : ℝ≥0) (hv : v ≠ 0) + (r : ℝ) (hr : 0 < r) : 0 < gaussianReal a v (ball c r) := by + by_contra h + have hz : gaussianReal a v (ball c r)=0 := le_antisymm (le_of_not_gt h) bot_le + have hz' := gaussianReal_absolutelyContinuous' a hv hz + exact (measure_ball_pos volume c hr).ne' hz' + +lemma nat_path_error_le (x y : ℕ → ℝ) (m : ℕ) (δ : ℝ) + (hzero : x 0=y 0) + (hinc : ∀ k < m, |(x (k+1)-x k)-(y (k+1)-y k)| ≤ δ) : + ∀ k ≤ m, |x k-y k| ≤ (k:ℝ)*δ := by + intro k + induction k with + | zero => intro _; simp [hzero] + | succ k ih => + intro hk + have hk' : k < m := by omega + calc + |x (k+1)-y (k+1)| = |(x k-y k)+((x (k+1)-x k)-(y (k+1)-y k))| := by congr 1; ring + _ ≤ |x k-y k|+|(x (k+1)-x k)-(y (k+1)-y k)| := abs_add_le _ _ + _ ≤ (k:ℝ)*δ+δ := add_le_add (ih (by omega)) (hinc k hk') + _ = ((k+1:ℕ):ℝ)*δ := by push_cast; ring + +lemma wienerGridTime_strictMono (n : ℕ) : StrictMono (wienerGridTime n) := by + intro i j hij + apply NNReal.coe_lt_coe.mp + change (i:ℝ)/(n+1) < (j:ℝ)/(n+1) + exact (div_lt_div_iff_of_pos_right (by positivity)).mpr (by exact_mod_cast hij) + +theorem wienerGrid_tube_pos (W : Target.WienerLaw) (hW : Target.IsWiener W) + (n : ℕ) (f : ℕ → ℝ) (hf : f 0=0) (ε : ℝ) (hε : 0 < ε) : + 0 < W {b | ∀ i : Fin (n+3), |b (wienerGridTime n i)-f i| < ε} := by + classical + have : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let m := n+2 + let δ : ℝ := ε/(m+1:ℝ) + have hδ : 0 < δ := div_pos hε (by positivity) + let X : Fin m → Target.Driver → ℝ := fun i b => + b (wienerGridTime n (i+1))-b (wienerGridTime n i) + let c : Fin m → ℝ := fun i => f (i+1)-f i + have hind : iIndepFun X W := by + exact hW.hasIndepIncrements m (fun i => wienerGridTime n i) + ((wienerGridTime_strictMono n).monotone.comp (fun _ _ h => h)) + have hpos (i : Fin m) : 0 < W (X i ⁻¹' ball (c i) δ) := by + have ht : wienerGridTime n i < wienerGridTime n (i+1) := + wienerGridTime_strictMono n (by omega) + have hv : nndist (wienerGridTime n (i+1):ℝ) (wienerGridTime n i:ℝ) ≠ 0 := by + intro h + exact (ne_of_gt (show (wienerGridTime n i:ℝ) ball (c i) δ) (fun _ _ => isOpen_ball.measurableSet) + have hall : 0 < W (⋂ i : Fin m, X i ⁻¹' ball (c i) δ) := by + have he : W (⋂ i : Fin m, X i ⁻¹' ball (c i) δ) = ∏ i, W (X i ⁻¹' ball (c i) δ) := by + simpa only [Finset.mem_univ,iInter_true] using hprod + rw [he] + exact bot_lt_iff_ne_bot.mpr (Finset.prod_ne_zero_iff.mpr (fun i _ => (hpos i).ne')) + refine hall.trans_le (measure_mono ?_) + intro b hb i + have hb' : ∀ k < m, + |(b (wienerGridTime n (k+1))-b (wienerGridTime n k))-(f (k+1)-f k)| ≤ δ := by + intro k hk + have h := mem_iInter.mp hb ⟨k,hk⟩ + exact (show |X ⟨k,hk⟩ b-c ⟨k,hk⟩| < δ from by simpa only [mem_preimage,mem_ball,Real.dist_eq] using h).le + have he := nat_path_error_le (fun k => b (wienerGridTime n k)) f m δ + (by simp [wienerGridTime,hf]) hb' i (by have := i.isLt; omega) + refine he.trans_lt ?_ + calc + (i:ℝ)*δ ≤ (m:ℝ)*δ := mul_le_mul_of_nonneg_right (by exact_mod_cast (show (i:ℕ) ≤ m from by have := i.isLt; omega)) hδ.le + _ < ε := by dsimp [δ]; rw [← mul_div_assoc,div_lt_iff₀ (by positivity)]; nlinarith + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerRealSupport.lean b/lean/OAI/Probability/SLE/Stochastic/WienerRealSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..62255572834afeabf0d741e711e666aedc910e18 --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerRealSupport.lean @@ -0,0 +1,63 @@ +import OAI.Probability.SLE.Stochastic.WienerResidualTube + +namespace OAI + +/-! Uniform support of the real Wiener law on a finite time window, +proved from its Gaussian finite-dimensional laws and continuous paths. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory TopologicalSpace +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +theorem wienerReal_uniform_tube_pos + (W : Target.WienerLaw) (hW : Target.IsWiener W) + (f : ℝ≥0 → ℝ) (hf : Continuous f) (hf0 : f 0=0) + (ε : ℝ) (hε : 0 < ε) : + 0 < W {b | ∀ t : unitInterval, |b ⟨t,t.2.1⟩-f ⟨t,t.2.1⟩| < ε} := by + let η := ε/4 + have hη : 0 < η := by dsimp [η]; positivity + obtain ⟨N,hN⟩ := eventually_atTop.mp (wienerGridInterp_uniform f hf.continuousOn η hη) + obtain ⟨n,hn,hR⟩ := exists_wienerResidualTube_pos W hW η hη N + let G : Set (Fin (n+3) → ℝ) := + {x | ∀ i, |x i-f (wienerGridTime n i)| < η} + have hG : MeasurableSet G := by + simp only [G,Set.ofPred_forall] + exact MeasurableSet.iInter (fun i => measurableSet_lt + ((measurable_pi_apply i).sub measurable_const).abs measurable_const) + have hGpos : 0 < W ((fun b (i : Fin (n+3)) => b (wienerGridTime n i)) ⁻¹' G) := + wienerGrid_tube_pos W hW n (fun k => f (wienerGridTime n k)) (by simpa [wienerGridTime] using hf0) η hη + have hind := wienerGrid_residual_independent hW n + have he := hind.measure_inter_preimage_eq_mul G (wienerResidualSet η) hG + (measurableSet_wienerResidualSet η) + have hpos : 0 < W (((fun b (i : Fin (n+3)) => b (wienerGridTime n i)) ⁻¹' G) ∩ + (fun b t => wienerGridResidual n (fun s b => b s) t b) ⁻¹' wienerResidualSet η) := by + rw [he] + exact bot_lt_iff_ne_bot.mpr (mul_ne_zero hGpos.ne' hR.ne') + refine hpos.trans_le (measure_mono ?_) + intro b hb t + have hbG : ∀ k ≤ n+2, |b (wienerGridTime n k)-f (wienerGridTime n k)| ≤ η := by + intro k hk + exact (hb.1 (⟨k,by omega⟩ : Fin (n+3))).le + have hbound : ∀ t : unitInterval, |b ⟨t,t.2.1⟩-f ⟨t,t.2.1⟩| ≤ 3*η := by + intro u + refine (show Dense (range (denseSeq unitInterval)) from denseRange_denseSeq unitInterval).induction + (P := fun t : unitInterval => |b ⟨t,t.2.1⟩-f ⟨t,t.2.1⟩| ≤ 3*η) ?_ ?_ u + · rintro _ ⟨k,rfl⟩ + let u := denseSeq unitInterval k + have hr : |b ⟨u,u.2.1⟩-wienerGridInterp n b u| ≤ η := hb.2 k + have hg := wienerGridInterp_difference n b f u hbG + have hf' := hN n hn u + have htri := abs_sub_le (b ⟨u,u.2.1⟩) (wienerGridInterp n b u) (f ⟨u,u.2.1⟩) + have htri' := abs_sub_le (wienerGridInterp n b u) (wienerGridInterp n f u) (f ⟨u,u.2.1⟩) + rw [abs_sub_comm (wienerGridInterp n f u)] at htri' + linarith + · apply isClosed_le _ continuous_const + fun_prop + exact (hbound t).trans_lt (by dsimp [η]; linarith) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLE/Stochastic/WienerResidualTube.lean b/lean/OAI/Probability/SLE/Stochastic/WienerResidualTube.lean new file mode 100644 index 0000000000000000000000000000000000000000..2550659d0eab77b262412cecbb715f62d72c7e5a --- /dev/null +++ b/lean/OAI/Probability/SLE/Stochastic/WienerResidualTube.lean @@ -0,0 +1,61 @@ +import OAI.Probability.SLE.Stochastic.WienerGridSupport + +namespace OAI + +/-! Uniform interpolation errors are eventually small on every continuous +path. A countable dense set makes the residual event measurable. -/ +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory TopologicalSpace +open scoped Topology NNReal ENNReal + +namespace SLEExactGauge + +def wienerResidualSet (r : ℝ) : Set (unitInterval → ℝ) := + {x | ∀ k : ℕ, |x (denseSeq unitInterval k)| ≤ r} + +lemma measurableSet_wienerResidualSet (r : ℝ) : MeasurableSet (wienerResidualSet r) := by + simp only [wienerResidualSet,Set.ofPred_forall] + exact MeasurableSet.iInter (fun k => measurableSet_le + (measurable_pi_apply (denseSeq unitInterval k)).abs measurable_const) + +def wienerResidualTube (n : ℕ) (r : ℝ) : Set Target.Driver := + {b | ∀ k : ℕ, |wienerGridResidual n (fun t b => b t) (denseSeq unitInterval k) b| ≤ r} + +lemma measurableSet_wienerResidualTube (n : ℕ) (r : ℝ) : + MeasurableSet (wienerResidualTube n r) := by + simp only [wienerResidualTube,Set.ofPred_forall] + apply MeasurableSet.iInter + intro k + apply measurableSet_le _ measurable_const + unfold wienerGridResidual wienerGridInterp + exact ((continuous_eval_const _).measurable.sub + ((measurable_const.mul (continuous_eval_const _).measurable).add + (measurable_const.mul (continuous_eval_const _).measurable))).abs + +lemma wienerResidualTube_eventually (b : Target.Driver) (r : ℝ) (hr : 0 < r) : + ∀ᶠ n in atTop, b ∈ wienerResidualTube n r := by + filter_upwards [wienerGridInterp_uniform b (map_continuous b).continuousOn r hr] with n hn k + exact hn _ + +lemma exists_wienerResidualTube_pos (W : Target.WienerLaw) (hW : Target.IsWiener W) + (r : ℝ) (hr : 0 < r) (N : ℕ) : + ∃ n, N ≤ n ∧ 0 < W (wienerResidualTube n r) := by + have : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + by_contra! h + have hzero n (hn : N ≤ n) : W (wienerResidualTube n r)=0 := + le_antisymm (h n hn) bot_le + have hae : ∀ᵐ b ∂W, ∀ n, N ≤ n → b ∉ wienerResidualTube n r := by + apply ae_all_iff.mpr + intro n + by_cases hn : N ≤ n + · exact ((measure_eq_zero_iff_ae_notMem.mp (hzero n hn))).mono (fun b hb _ => hb) + · exact ae_of_all _ (fun _ h => (hn h).elim) + obtain ⟨b,hb⟩ := hae.exists + obtain ⟨n,hn,hmem⟩ := ((eventually_ge_atTop N).and (wienerResidualTube_eventually b r hr)).exists + exact hb n hn hmem + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/AdaptedFailure.lean b/lean/OAI/Probability/SLEGauge/AdaptedFailure.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1c7589680e06708f0f5b1f9d2289390ea62dd0d --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/AdaptedFailure.lean @@ -0,0 +1,574 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.SpatialPastTail + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.AdaptedFailure + +variable {Ω : Type*} [m₀ : MeasurableSpace Ω] + + +def failed (success : ℕ→Set Ω) : ℕ→Set Ω + | 0 => univ + | n+1 => failed success n \ success n + +omit m₀ in +lemma failed_iff [MeasurableSpace Ω] (success : ℕ→Set Ω) (n : ℕ) (ω : Ω) : + ω∈failed success n ↔ ∀i simp [failed] + | succ n ih => + simp only [failed,Set.mem_sdiff,ih,Nat.lt_succ_iff_lt_or_eq] + constructor + · rintro ⟨h,h'⟩ i (hi | rfl) + · exact h i hi + · exact h' + · intro h + exact ⟨fun i hi=>h i (Or.inl hi),h n (Or.inr rfl)⟩ + +lemma failed_measurable (ℱ : Filtration ℕ m₀) + (success : ℕ→Set Ω) (hs : ∀i,MeasurableSet[ℱ (i+1)] (success i)) (n : ℕ) : + MeasurableSet[ℱ n] (failed success n) := by + induction n with + | zero => exact MeasurableSet.univ + | succ n ih => exact (ℱ.mono (Nat.le_succ n) _ ih).diff (hs n) + + + +theorem failure_product (P : Measure Ω) [IsProbabilityMeasure P] + (ℱ : Filtration ℕ m₀) (success : ℕ→Set Ω) + (hs : ∀i,MeasurableSet[ℱ (i+1)] (success i)) (p : ℕ→ℝ) + (hp1 : ∀i,p i≤1) + (htest : ∀i,∀A : Set Ω,MeasurableSet[ℱ i] A → + p i*P.real A≤P.real (A∩success i)) (n : ℕ) : + P.real (failed success n)≤∏i∈Finset.range n,(1-p i) := by + induction n with + | zero => simp [failed] + | succ n ih => + have hs' : MeasurableSet (success n) := ℱ.le (n+1) _ (hs n) + have hsplit := measureReal_inter_add_sdiff (μ := P) (s := failed success n) hs' + have hstep := htest n (failed success n) (failed_measurable ℱ success hs n) + calc + P.real (failed success (n+1))≤(1-p n)*P.real (failed success n) := by + change P.real (failed success n \ success n)≤_ + nlinarith + _ ≤ (1-p n)*(∏i∈Finset.range n,(1-p i)) := + mul_le_mul_of_nonneg_left ih (sub_nonneg.mpr (hp1 n)) + _ = _ := by rw [Finset.prod_range_succ]; ring + +lemma product_le_exp (p : ℕ→ℝ) (hp1 : ∀i,p i≤1) (n : ℕ) : + (∏i∈Finset.range n,(1-p i))≤Real.exp (-(∑i∈Finset.range n,p i)) := by + induction n with + | zero => simp + | succ n ih => + calc + _ = (∏i∈Finset.range n,(1-p i))*(1-p n) := Finset.prod_range_succ _ _ + _ ≤ Real.exp (-(∑i∈Finset.range n,p i))*Real.exp (-p n) := + mul_le_mul ih (Real.one_sub_le_exp_neg _) (sub_nonneg.mpr (hp1 n)) (Real.exp_pos _).le + _ = _ := by rw [←Real.exp_add,Finset.sum_range_succ,neg_add_rev]; congr 1; ring + + + +lemma tested_of_conditional (P : Measure Ω) [IsProbabilityMeasure P] + {m : MeasurableSpace Ω} (hm : m ≤ m₀) + (S : Set Ω) (hS : MeasurableSet[m₀] S) (p : ℝ) + (hp : ∀ᵐ ω∂P,p≤P[S.indicator (fun _=> (1:ℝ)) | m] ω) + (A : Set Ω) (hA : MeasurableSet[m] A) : + p*P.real A≤P.real (A∩S) := by + have hInt : Integrable (S.indicator (fun _ : Ω=>(1:ℝ))) P := + (integrable_const 1).indicator hS + calc + p*P.real A = ∫ω in A,p∂P := by simp only [setIntegral_const,smul_eq_mul]; ring + _ ≤ ∫ω in A,P[S.indicator (fun _=>(1:ℝ)) | m] ω∂P := + integral_mono_ae (integrable_const _) integrable_condExp.integrableOn + (ae_restrict_of_ae hp) + _ = ∫ω in A,S.indicator (fun _=>(1:ℝ)) ω∂P := setIntegral_condExp hm hInt hA + _ = P.real (A∩S) := by rw [setIntegral_indicator hS]; simp + + + +theorem conditional_failure (P : Measure Ω) [IsProbabilityMeasure P] + (ℱ : Filtration ℕ m₀) (success : ℕ→Set Ω) + (hs : ∀i,MeasurableSet[ℱ (i+1)] (success i)) (p : ℕ→ℝ) + (hp1 : ∀i,p i≤1) + (hp : ∀i,∀ᵐ ω∂P,p i≤P[(success i).indicator (fun _=>(1:ℝ)) | ℱ i] ω) + (n : ℕ) (B : ℝ) (hB : B≤∑i∈Finset.range n,p i) : + P.real (failed success n)≤Real.exp (-B) := by + refine (failure_product P ℱ success hs p hp1 ?_ n).trans + ((product_le_exp p hp1 n).trans (Real.exp_le_exp.mpr (neg_le_neg hB))) + intro i A hA + exact tested_of_conditional P (ℱ.le i) (success i) (ℱ.le (i+1) _ (hs i)) + (p i) (hp i) A hA + + + +lemma weighted_past_bound (P : Measure Ω) [IsFiniteMeasure P] + {m : MeasurableSpace Ω} (hm : m ≤ m₀) + (f : Ω→ℝ) (hf : Integrable f P) (K : ℝ) + (hb : ∀ᵐ ω∂P,P[f | m] ω≤K) (A : Set Ω) (hA : MeasurableSet[m] A) : + (∫ω in A,f ω∂P)≤K*P.real A := by + calc + (∫ω in A,f ω∂P) = ∫ω in A,P[f | m] ω∂P := (setIntegral_condExp hm hf hA).symm + _ ≤ ∫ω in A,K∂P := integral_mono_ae integrable_condExp.integrableOn + (integrable_const _) (ae_restrict_of_ae hb) + _ = K*P.real A := by simp only [setIntegral_const,smul_eq_mul]; ring + + + +theorem weighted_conditional_failure (P : Measure Ω) [IsProbabilityMeasure P] + (ℱ : Filtration ℕ m₀) (success : ℕ→Set Ω) + (hs : ∀i,MeasurableSet[ℱ (i+1)] (success i)) (p : ℕ→ℝ) + (hp1 : ∀i,p i≤1) + (hp : ∀i,∀ᵐ ω∂P,p i≤P[(success i).indicator (fun _=>(1:ℝ)) | ℱ i] ω) + (n : ℕ) (B : ℝ) (hB : B≤∑i∈Finset.range n,p i) + (f : Ω→ℝ) (hf : Integrable f P) (K : ℝ) (hK : 0≤K) + (hb : ∀ᵐ ω∂P,P[f | ℱ n] ω≤K) : + (∫ω in failed success n,f ω∂P)≤K*Real.exp (-B) := + (weighted_past_bound P (ℱ.le n) f hf K hb (failed success n) + (failed_measurable ℱ success hs n)).trans + (mul_le_mul_of_nonneg_left (conditional_failure P ℱ success hs p hp1 hp n B hB) hK) + +end SLEExactGauge.AdaptedFailure +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart CompactSequence MomentBatches AdaptedFailure + + + +structure RadialTestSchedule (a y : ℝ) where + start : ℕ → ℝ + boundary : ℕ → ℝ + level : ℕ + threshold : ℕ → ℝ + boundary_pos : ∀i,0 < boundary i + boundary_le : ∀i,boundary i ≤ y + start_pos : ∀i,0 < start i + start_le : ∀i,start i ≤ boundary i + next : ∀i,boundary (i+1)=start i*Real.exp (-2*a*level) + threshold_nonneg : ∀i,0 ≤ threshold i + gap : ∀i,∃s : ℝ,Jacobi.mixingTime (4*a) ≤ s ∧ start i=boundary i*Real.exp (-2*a*s) + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4 < a} {W : Measure GDriver} (M : CenteredMomentModel κ a ha W) + +def testSuccess (z : ℂ) (D : RadialTestSchedule a z.im) (i : ℕ) : Set GDriver := + {b | ENNReal.ofReal (D.threshold i) ≤ M.stoppedTest z (D.start i) D.level b} + +def testFailure (z : ℂ) (D : RadialTestSchedule a z.im) (n : ℕ) : Set GDriver := + failed (M.testSuccess z D) n + +lemma testFailure_raw (z : ℂ) (hz : 0 < z.im) (D : RadialTestSchedule a z.im) (n : ℕ) : + MeasurableSet[(radialTime_stopping a (by linarith) z hz (D.boundary n) + (D.boundary_pos n) (D.boundary_le n)).measurableSpace] (M.testFailure z D n) := by + induction n with + | zero => exact MeasurableSet.univ + | succ n ih => + have hs := M.stoppedTest_measurable z hz (D.start n) (D.start_pos n) + ((D.start_le n).trans (D.boundary_le n)) D.level + have hn : D.boundary (n+1) ≤ D.boundary n := by + rw [D.next] + exact (testEndpoint_le (ha := ha) _ (D.start_pos n).le _).trans (D.start_le n) + have hmono := (radialTime_stopping a (by linarith) z hz (D.boundary n) + (D.boundary_pos n) (D.boundary_le n)).measurableSpace_mono + (radialTime_stopping a (by linarith) z hz (D.boundary (n+1)) + (D.boundary_pos _) (D.boundary_le _)) + (radialTime_antitone a (by linarith) z hz _ _ (D.boundary_pos _) hn (D.boundary_le n)) + apply (hmono _ ih).diff + unfold testSuccess + have he := measurableSet_le (f := fun _=>ENNReal.ofReal (D.threshold n)) measurable_const hs + exact ⟨he.1,fun t=>by simpa only [D.next] using he.2 t⟩ + + + +theorem testFailure_product [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0 < z.im) (D : RadialTestSchedule a z.im) (n : ℕ) : + (radialLaw W a z (D.boundary n)).real (M.testFailure z D n) ≤ + ∏i∈Finset.range n,(1-M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x}/2) := by + let := M.probability + have hP (i : ℕ) : IsProbabilityMeasure (radialLaw W a z (D.boundary i)) := + radialLaw_probability W hW a ha z hz _ (D.boundary_pos _) (D.boundary_le _) + induction n with + | zero => + let := hP 0 + simp [testFailure,failed] + | succ n ih => + let := hP (n+1) + have hraw := M.testFailure_raw z hz D n + obtain ⟨s,hs,hgap⟩ := D.gap n + have hl := M.stopped_success_lower hW z hz (D.boundary n) (D.start n) + (D.start_pos n) (D.start_le n) (D.boundary_le n) s hs hgap D.level + (D.threshold n) (D.threshold_nonneg n) (M.testFailure z D n) hraw + rw [←D.next] at hl + have hlr := ENNReal.toReal_mono (measure_ne_top _ _) hl + simp only [ENNReal.toReal_mul,ENNReal.toReal_div,ENNReal.toReal_one,ENNReal.toReal_ofNat] at hlr + change 1/2*M.law.real {x | D.threshold n ≤ sequenceLevelReal D.level x}* + (radialLaw W a z (D.boundary (n+1))).real (M.testFailure z D n) ≤ + (radialLaw W a z (D.boundary (n+1))).real + (M.testFailure z D n∩M.testSuccess z D n) at hlr + have hm : MeasurableSet (M.testSuccess z D n) := by + have hT := radialTime_stopping a (by linarith) z hz _ + (testEndpoint_pos (a := a) _ (D.start_pos n) D.level) + ((testEndpoint_le (ha := ha) _ (D.start_pos n).le _).trans + ((D.start_le n).trans (D.boundary_le n))) + exact hT.measurableSpace_le _ (measurableSet_le measurable_const + (M.stoppedTest_measurable z hz (D.start n) (D.start_pos n) + ((D.start_le n).trans (D.boundary_le n)) D.level)) + have hsplit := measureReal_inter_add_sdiff (μ := radialLaw W a z (D.boundary (n+1))) + (s := M.testFailure z D n) hm + have hn : D.boundary (n+1) ≤ D.boundary n := by + rw [D.next] + exact (testEndpoint_le (ha := ha) _ (D.start_pos n).le _).trans (D.start_le n) + have he := congrArg ENNReal.toReal (radialLaw_consistent_le W hW a ha z hz + (D.boundary n) (D.boundary (n+1)) (D.boundary_pos _) hn (D.boundary_le n) + (M.testFailure z D n) hraw) + change (radialLaw W a z (D.boundary (n+1))).real (M.testFailure z D n)= + (radialLaw W a z (D.boundary n)).real (M.testFailure z D n) at he + have hp : M.law.real {x | D.threshold n ≤ sequenceLevelReal D.level x} ≤ 1 := measureReal_le_one + calc + _ ≤ (1-M.law.real {x | D.threshold n ≤ sequenceLevelReal D.level x}/2)* + (radialLaw W a z (D.boundary (n+1))).real (M.testFailure z D n) := by + change (radialLaw W a z (D.boundary (n+1))).real (M.testFailure z D n \ M.testSuccess z D n) ≤ _ + nlinarith + _ = (1-M.law.real {x | D.threshold n ≤ sequenceLevelReal D.level x}/2)* + (radialLaw W a z (D.boundary n)).real (M.testFailure z D n) := by rw [he] + _ ≤ (1-M.law.real {x | D.threshold n ≤ sequenceLevelReal D.level x}/2)* + (∏i∈Finset.range n,(1-M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x}/2)) := + mul_le_mul_of_nonneg_left ih (by linarith) + _ = _ := by rw [Finset.prod_range_succ]; ring + +lemma testFailure_exponential [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0 < z.im) (D : RadialTestSchedule a z.im) (n : ℕ) + (B : ℝ) (hB : B ≤ ∑i∈Finset.range n,M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x}/2) : + radialLaw W a z (D.boundary n) (M.testFailure z D n) ≤ ENNReal.ofReal (Real.exp (-B)) := by + let := M.probability + have := radialLaw_probability W hW a ha z hz (D.boundary n) (D.boundary_pos _) (D.boundary_le _) + have hp (i : ℕ) : M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x}/2 ≤ 1 := by + have : M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x} ≤ 1 := measureReal_le_one + linarith + have hh := (M.testFailure_product hW z hz D n).trans + ((product_le_exp _ hp n).trans (Real.exp_le_exp.mpr (neg_le_neg hB))) + simpa only [Measure.real,ENNReal.ofReal_toReal (measure_ne_top _ _)] using ENNReal.ofReal_le_ofReal hh + + +theorem testFailure_chordal [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0 < z.im) (D : RadialTestSchedule a z.im) (n : ℕ) + (ρ : ℝ) (hρ : 0 < ρ) (hρσ : ρ ≤ D.boundary n) + (s : ℝ) (hs : Jacobi.mixingTime (4*a) ≤ s) (hgap : ρ=D.boundary n*Real.exp (-2*a*s)) + (B : ℝ) (hB : B ≤ ∑i∈Finset.range n,M.law.real {x | D.threshold i ≤ sequenceLevelReal D.level x}/2) : + W (M.testFailure z D n∩{b | radialTime a b.1 z ρ≠∞}) ≤ + Jacobi.visitConstant a*ENNReal.ofReal ((ρ/z.im)^(alpha a))*ENNReal.ofReal (Real.exp (-B)) := by + have hr := M.testFailure_raw z hz D n + have hh := radial_change_law_past_bound W hW a ha z hz (D.boundary n) ρ hρ hρσ + (D.boundary_le n) s hs hgap (M.testFailure z D n) hr + rw [radialLaw_consistent_le W hW a ha z hz _ ρ hρ hρσ (D.boundary_le n) _ hr] at hh + exact hh.trans (mul_le_mul le_rfl (M.testFailure_exponential hW z hz D n B hB) zero_le zero_le) + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator LoewnerRestart + + +def batchRadius (a : ℝ) (l n i : ℕ) : ℝ := + Real.exp (-(n:ℝ)^2-2*a*(i:ℝ)*((l:ℝ)+(n:ℝ))) + +lemma batchRadius_pos (a : ℝ) (l n i : ℕ) : 0 < batchRadius a l n i := Real.exp_pos _ + +lemma batchRadius_zero (a : ℝ) (l n : ℕ) : batchRadius a l n 0=Real.exp (-(n:ℝ)^2) := by + simp [batchRadius] + +lemma batchRadius_succ (a : ℝ) (l n i : ℕ) : + batchRadius a l n (i+1)=batchRadius a l n i*Real.exp (-2*a*l)*Real.exp (-2*a*n) := by + simp only [batchRadius,←Real.exp_add,Nat.cast_add,Nat.cast_one] + congr 1 + ring + +lemma batchRadius_antitone (a : ℝ) (ha : 0 ≤ a) (l n : ℕ) : Antitone (batchRadius a l n) := by + intro i j hij + apply Real.exp_le_exp.mpr + have hj : (i:ℝ) ≤ j := by exact_mod_cast hij + have hm : 0 ≤ 2*a*((l:ℝ)+(n:ℝ)) := by positivity + nlinarith [mul_le_mul_of_nonneg_left hj hm] + +lemma mixingTime_nonneg (a : ℝ) : 0 ≤ Jacobi.mixingTime (4*a) := by + unfold Jacobi.mixingTime Jacobi.majorantBase + positivity + +def BatchReady (a : ℝ) (n : ℕ) : Prop := + 3 ≤ n ∧ Jacobi.mixingTime (4*a) ≤ (n:ℝ)-Real.log 2/(2*a) ∧ + 400*Real.exp (-(n:ℝ)^2) ≤ Real.exp (-(n:ℝ))*Real.exp (-2*a*Jacobi.mixingTime (4*a)) + +lemma eventually_batchReady (a : ℝ) (_ha : 0 < a) : ∀ᶠ n in atTop,BatchReady a n := by + have hR (x : ℝ) : ∀ᶠ n : ℕ in atTop,x ≤ (n:ℝ) := + (tendsto_natCast_atTop_atTop (R := ℝ)).eventually (eventually_ge_atTop x) + filter_upwards [eventually_ge_atTop 3,hR (Jacobi.mixingTime (4*a)+Real.log 2/(2*a)), + hR (Real.log 400+2*a*Jacobi.mixingTime (4*a))] with n hn hmix hinit + refine ⟨hn,by linarith,?_⟩ + have hnR : (3:ℝ) ≤ n := by exact_mod_cast hn + have hsq : (n:ℝ) ≤ (n:ℝ)^2-(n:ℝ) := by nlinarith + rw [show (400:ℝ)=Real.exp (Real.log 400) by rw [Real.exp_log (by norm_num)], + ←Real.exp_add,←Real.exp_add] + apply Real.exp_le_exp.mpr + linarith + +lemma BatchReady.mixing {a : ℝ} (ha : 0 y + | i+1 => 400*batchRadius a l n i*Real.exp (-2*a*l) + +lemma batchBoundary_pos (a y : ℝ) (hy : 0 exact hy + | succ i => dsimp [batchBoundary]; have := batchRadius_pos a l n i; positivity + +lemma batchBoundary_start (a y : ℝ) (ha : 0 + apply clock_gap_of_small a ha _ (mixingTime_nonneg a) y _ hy + (by have := batchRadius_pos a l n 0; positivity) + rw [batchRadius_zero] + exact h.2.2.trans (mul_le_mul_of_nonneg_right hyn (Real.exp_pos _).le) + | succ i => + have hg : 400*batchRadius a l n (i+1)=batchBoundary a y l n (i+1)*Real.exp (-2*a*n) := by + rw [batchRadius_succ,batchBoundary]; ring + refine ⟨?_,(n:ℝ),h.mixing ha,hg⟩ + rw [hg] + exact mul_le_of_le_one_right (batchBoundary_pos a y hy l n _).le + (Real.exp_le_one_iff.mpr (by have : (0:ℝ) ≤ n := Nat.cast_nonneg n; nlinarith)) + +lemma batchBoundary_le (a y : ℝ) (ha : 0 exact le_rfl + | succ i ih => + change 400*batchRadius a l n i*Real.exp (-2*a*l) ≤ y + have hstart := (batchBoundary_start a y ha hy l n h hyn i).1.trans ih + refine (mul_le_of_le_one_right (by have := batchRadius_pos a l n i; positivity) ?_).trans hstart + exact Real.exp_le_one_iff.mpr (by have : (0:ℝ) ≤ l := Nat.cast_nonneg l; nlinarith) + +def batchSchedule (a y : ℝ) (ha : 0L[i.1]))).sum = _ + rw [←List.map_ofFn,List.ofFn_getElem] + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4 < a} {W : Measure GDriver} (M : CenteredMomentModel κ a ha W) + +def batchLevel (n : ℕ) : ℕ := momentLevel M.law sequenceMassReal sequenceLevelReal n + +def testCount (n : ℕ) : ℕ := (noncleanup (moment M.law sequenceMassReal) n).length + +def testThreshold (n i : ℕ) : ℝ := (noncleanup (moment M.law sequenceMassReal) n).getD i 1 + +def finalRadius (n : ℕ) : ℝ := batchRadius a (M.batchLevel n) n (M.testCount n) + +lemma finalRadius_pos (n : ℕ) : 0M.law.real {x | b ≤ sequenceLevelReal (M.batchLevel n) x}) + ((noncleanup (moment M.law sequenceMassReal) n).getD i 1) + rw [sum_getD_eq_map_sum _ (fun b=>M.law.real {x | b ≤ sequenceLevelReal (M.batchLevel n) x}), + noncleanup_sum,sum_eq_tsum_multiplicity hfin] + exact M.success n hn + +lemma testCount_pos (n : ℕ) (hn : 3≤n) : 0(M.testThreshold_pos n i).le)) (M.testCount n) := by + ext b + simp only [batchFailures,mem_ofPred_eq,testFailure,AdaptedFailure.failed_iff] + rfl + +lemma batch_failures_measurable (z : ℂ) (hz : 0b.1 t) W) + (z : ℂ) (hz : 0 fderiv ℝ physicalTheta w noise) v noise = 2*X v*Y v/(Q v)^2 := by + have he : (fun w => fderiv ℝ physicalTheta w noise) =ᶠ[𝓝 v] physicalV := by + filter_upwards [Y.continuous.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hv)] with w hw + rw [(hasFDerivAt_physicalTheta w hw).fderiv,thetaDeriv_noise] + rw [he.fderiv_eq] + have hd : HasFDerivAt physicalV (velocityDeriv v) v := by + have hQinv := (hasDerivAt_inv (Q_pos hv).ne').comp_hasFDerivAt v (hasFDerivAt_Q v) + convert Y.hasFDerivAt.mul hQinv using 1 <;> try rfl + apply ContinuousLinearMap.ext + intro w + simp only [velocityDeriv,add_apply,smul_apply, + sub_apply,smul_eq_mul,Function.comp_apply] + have hq := (Q_pos hv).ne' + field_simp + ring + rw [hd.fderiv] + simp [velocityDeriv,noise,X,Y] + ring + +lemma regX_drift (a : ℝ) (v : State) : X (physicalDrift a v) = a*X v/Q v := by + simp [physicalDrift,X_apply,Complex.div_re,Q_eq] +lemma regY_drift (a : ℝ) (v : State) : Y (physicalDrift a v) = -a*Y v/Q v := by + simp [physicalDrift,Y_apply,Complex.div_im,Q_eq]; ring +lemma regJ_drift (a : ℝ) (v : State) : + J (physicalDrift a v) = -a*((X v)^2-(Y v)^2)/(Q v)^2 := by + simp only [physicalDrift,J_apply,Complex.div_re,Complex.neg_re,Complex.ofReal_re, + Complex.neg_im,Complex.ofReal_im,neg_zero,zero_mul,map_pow,← Q_eq] + simp only [pow_two,Complex.mul_re,X_apply,Y_apply,zero_div,add_zero] + +lemma theta_generator (a : ℝ) (v : State) (hv : 0 fderiv ℝ physicalTheta w noise) v noise + + fderiv ℝ physicalTheta v (physicalDrift a v) = + (1-2*a)*Real.cot (physicalTheta v)*(physicalV v)^2 := by + have hy := hv.ne' + have hq := (Q_pos hv).ne' + rw [physicalTheta_second_noise v hv,(hasFDerivAt_physicalTheta v hv).fderiv] + simp only [thetaDeriv,add_apply,smul_apply, + smul_eq_mul,regX_drift,regY_drift,physicalTheta_cot,physicalV] + field_simp + ring + +noncomputable def physicalClock (a cap : ℝ) (v : State) : ℝ := + (Real.log (cap/2)+J v-Real.log (Y v))/(2*a) +noncomputable def clockDeriv (a : ℝ) (v : State) : State →L[ℝ] ℝ := + (1/(2*a)) • (J-(1/Y v) • Y) +lemma hasFDerivAt_physicalClock (a cap : ℝ) (v : State) (hv : 0 try rfl + · ext w + simp only [physicalClock,Pi.sub_apply] + ring + · simp only [clockDeriv,one_div] +lemma clockDeriv_noise (a : ℝ) (v : State) : clockDeriv a v noise = 0 := by + simp [clockDeriv,noise,J,Y] +lemma physicalClock_drift (a cap : ℝ) (ha : a≠0) (v : State) (hv : 0 fderiv ℝ (physicalClock a cap) w noise) v noise = 0 := by + have he : (fun w => fderiv ℝ (physicalClock a cap) w noise) =ᶠ[𝓝 v] (fun _ => (0:ℝ)) := by + filter_upwards [Y.continuous.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hv)] with w hw + rw [(hasFDerivAt_physicalClock a cap w hw).fderiv,clockDeriv_noise] + rw [he.fderiv_eq,(hasFDerivAt_const (0:ℝ) v).fderiv] + rfl +lemma physicalTheta_smooth (v : State) (hv : 0 f y*g y) e x = f x*N g e x+g x*N f e x := by + change (fderiv ℝ (f*g) x) e = _ + rw [(hf.hasFDerivAt.mul hg.hasFDerivAt).fderiv] + simp only [add_apply,smul_apply,smul_eq_mul,N] +lemma L_mul {f g : E → ℝ} {x A e : E} + (hf : ContDiffAt ℝ 2 f x) (hg : ContDiffAt ℝ 2 g x) : + L (fun y => f y*g y) A e x = f x*L g A e x+g x*L f A e x+N f e x*N g e x := by + have hfd := hf.differentiableAt (by norm_num) + have hgd := hg.differentiableAt (by norm_num) + have heq : N (fun y => f y*g y) e =ᶠ[𝓝 x] (fun y => f y*N g e y+g y*N f e y) := by + filter_upwards [hf.eventually (by norm_num),hg.eventually (by norm_num)] with y hfy hgy + exact N_mul (hfy.differentiableAt (by norm_num)) (hgy.differentiableAt (by norm_num)) + have hd := (hfd.hasFDerivAt.mul (N_differentiableAt (e := e) hg).hasFDerivAt).add + (hgd.hasFDerivAt.mul (N_differentiableAt (e := e) hf).hasFDerivAt) + have hd' := hd.fderiv + have hp := (hfd.hasFDerivAt.mul hgd.hasFDerivAt).fderiv + change fderiv ℝ (fun y => f y*N g e y+g y*N f e y) x = _ at hd' + change fderiv ℝ (fun y => f y*g y) x = _ at hp + unfold L + rw [N,heq.fderiv_eq,hd',hp] + simp only [add_apply,smul_apply,smul_eq_mul,N] + ring +lemma N_comp {f : E → ℝ} {h : ℝ → ℝ} {x e : E} + (hf : DifferentiableAt ℝ f x) (hh : DifferentiableAt ℝ h (f x)) : + N (h ∘ f) e x = deriv h (f x)*N f e x := by + rw [N,(hh.hasDerivAt.comp_hasFDerivAt x hf.hasFDerivAt).fderiv] + simp only [smul_apply,smul_eq_mul,N] +lemma L_comp {f : E → ℝ} {h : ℝ → ℝ} {x A e : E} + (hf : ContDiffAt ℝ 2 f x) (hh : ContDiffAt ℝ 2 h (f x)) : + L (h ∘ f) A e x = deriv h (f x)*L f A e x+ + (1/2:ℝ)*deriv (deriv h) (f x)*(N f e x)^2 := by + have hfd := hf.differentiableAt (by norm_num) + have hhd := hh.differentiableAt (by norm_num) + have hdd : DifferentiableAt ℝ (deriv h) (f x) := by + convert N_differentiableAt (e := (1:ℝ)) hh using 1 + rfl + have heq : N (h ∘ f) e =ᶠ[𝓝 x] (fun y => deriv h (f y)*N f e y) := by + filter_upwards [hf.eventually (by norm_num), + hfd.continuousAt.preimage_mem_nhds (hh.eventually (by norm_num))] with y hfy hhy + change ContDiffAt ℝ 2 h (f y) at hhy + exact N_comp (hfy.differentiableAt (by norm_num)) (hhy.differentiableAt (by norm_num)) + have hd := (hdd.hasDerivAt.comp_hasFDerivAt x hfd.hasFDerivAt).mul + (N_differentiableAt (e := e) hf).hasFDerivAt + have hd' := hd.fderiv + change fderiv ℝ (fun y => deriv h (f y)*N f e y) x = _ at hd' + unfold L + rw [N,heq.fderiv_eq,hd',(hhd.hasDerivAt.comp_hasFDerivAt x hfd.hasFDerivAt).fderiv] + simp only [add_apply,smul_apply,smul_eq_mul,N,Function.comp_apply] + ring +end ExactSLECalculus + +namespace ExactSLECalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +@[simp] lemma N_const (c : ℝ) (e x : E) : N (fun _ => c) e x = 0 := by + rw [N,(hasFDerivAt_const c x).fderiv]; rfl +@[simp] lemma L_const (c : ℝ) (A e x : E) : L (fun _ => c) A e x = 0 := by + have heq : N (fun _ : E => c) e = (fun _ => (0:ℝ)) := funext (N_const c e) + simp only [L,heq,N,(hasFDerivAt_const c x).fderiv,(hasFDerivAt_const (0:ℝ) x).fderiv, + zero_apply,mul_zero,add_zero] +lemma N_add {f g : E → ℝ} {x e : E} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : + N (fun y => f y+g y) e x = N f e x+N g e x := by + have h := (hf.hasFDerivAt.add hg.hasFDerivAt).fderiv + change fderiv ℝ (fun y => f y+g y) x = _ at h + simp only [N,h,add_apply] +lemma L_add {f g : E → ℝ} {x A e : E} + (hf : ContDiffAt ℝ 2 f x) (hg : ContDiffAt ℝ 2 g x) : + L (fun y => f y+g y) A e x = L f A e x+L g A e x := by + have heq : N (fun y => f y+g y) e =ᶠ[𝓝 x] (fun y => N f e y+N g e y) := by + filter_upwards [hf.eventually (by norm_num),hg.eventually (by norm_num)] with y hfy hgy + exact N_add (hfy.differentiableAt (by norm_num)) (hgy.differentiableAt (by norm_num)) + have h := ((hf.differentiableAt (by norm_num)).hasFDerivAt.add + (hg.differentiableAt (by norm_num)).hasFDerivAt).fderiv + have hd := ((N_differentiableAt (e := e) hf).hasFDerivAt.add + (N_differentiableAt (e := e) hg).hasFDerivAt).fderiv + change fderiv ℝ (fun y => f y+g y) x = _ at h + change fderiv ℝ (fun y => N f e y+N g e y) x = _ at hd + unfold L + rw [N,heq.fderiv_eq,hd,h] + simp only [add_apply,N] + ring +lemma N_const_mul {f : E → ℝ} {x e : E} (hf : DifferentiableAt ℝ f x) (c : ℝ) : + N (fun y => c*f y) e x = c*N f e x := by + simpa only [N_const,zero_mul,mul_zero,add_zero] using N_mul (differentiableAt_const c) hf (e := e) +lemma L_const_mul {f : E → ℝ} {x A e : E} (hf : ContDiffAt ℝ 2 f x) (c : ℝ) : + L (fun y => c*f y) A e x = c*L f A e x := by + simpa only [N_const,L_const,mul_zero,zero_mul,add_zero] using + L_mul (contDiffAt_const (c := c)) hf (A := A) (e := e) +end ExactSLECalculus + + + +namespace ExactSLEFiniteTilt +noncomputable def sinePower (r : ℝ) (θ : ℝ) : ℝ := Real.sin θ ^ r +noncomputable def angleGenerator (β : ℝ) (f : ℝ → ℝ) (θ : ℝ) : ℝ := + (1 / 2 : ℝ) * deriv (deriv f) θ + β * Real.cot θ * deriv f θ + +open Filter +open scoped Topology + +theorem sinePower_hasDerivAt (r θ : ℝ) (hθ : 0 < Real.sin θ) : + HasDerivAt (sinePower r) (Real.cos θ * r * Real.sin θ ^ (r - 1)) θ := by + exact (Real.hasDerivAt_sin θ).rpow_const (Or.inl hθ.ne') + +theorem sinePower_secondDeriv (r θ : ℝ) (hθ : 0 < Real.sin θ) : + deriv (deriv (sinePower r)) θ = + -Real.sin θ * r * Real.sin θ ^ (r - 1) + + (Real.cos θ * r) * (Real.cos θ * (r - 1) * Real.sin θ ^ (r - 2)) := by + have he : deriv (sinePower r) =ᶠ[𝓝 θ] + (fun x => Real.cos x * r * Real.sin x ^ (r - 1)) := by + have hp : ∀ᶠ x in 𝓝 θ, 0 < Real.sin x := + (isOpen_lt continuous_const Real.continuous_sin).mem_nhds hθ + filter_upwards [hp] with x hx + exact (sinePower_hasDerivAt r x hx).deriv + rw [he.deriv_eq] + have hd := ((Real.hasDerivAt_cos θ).mul_const r).mul + ((Real.hasDerivAt_sin θ).rpow_const (p := r - 1) (Or.inl hθ.ne')) + convert hd.deriv using 1 + congr 2 + ring_nf + +theorem angleGenerator_sinePower (β r θ : ℝ) (hθ : 0 < Real.sin θ) : + angleGenerator β (sinePower r) θ = sinePower r θ * + (-r / 2 + r * (r - 1 + 2 * β) / 2 * Real.cot θ ^ 2) := by + unfold angleGenerator + rw [sinePower_secondDeriv r θ hθ, (sinePower_hasDerivAt r θ hθ).deriv] + dsimp [sinePower] + rw [Real.rpow_sub hθ, Real.rpow_sub hθ, Real.rpow_one, Real.rpow_two, + Real.cot_eq_cos_div_sin] + have htrig := Real.sin_sq_add_cos_sq θ + field_simp + nlinarith [sq_nonneg (Real.sin θ), sq_nonneg (Real.cos θ)] + +theorem sine_generator (a r θ : ℝ) (hθ : θ ∈ Set.Ioo 0 Real.pi) : + angleGenerator (1 - 2 * a) (sinePower r) θ / sinePower r θ = + -r / 2 + r * (r - (4 * a - 1)) / 2 * Real.cot θ ^ 2 := by + have hs := Real.sin_pos_of_pos_of_lt_pi hθ.1 hθ.2 + rw [angleGenerator_sinePower _ _ _ hs] + have hp : sinePower r θ ≠ 0 := (Real.rpow_pos_of_pos hs r).ne' + field_simp + ring + +theorem green_angle_eigenfunction (a θ : ℝ) (hθ : θ ∈ Set.Ioo 0 Real.pi) : + angleGenerator (1 - 2 * a) (sinePower (4 * a - 1)) θ = + -(4 * a - 1) / 2 * sinePower (4 * a - 1) θ := by + rw [angleGenerator_sinePower _ _ _ (Real.sin_pos_of_pos_of_lt_pi hθ.1 hθ.2)] + ring + +theorem tilted_lyapunov (a q θ : ℝ) (_ha : 1 / 4 < a) + (hq : 0 < q) (hqp : q < 4 * a - 1) (hθ : θ ∈ Set.Ioo 0 Real.pi) : + angleGenerator (2 * a) (sinePower (-q)) θ = + sinePower (-q) θ * (q / 2 - q * (4 * a - 1 - q) / 2 * Real.cot θ ^ 2) ∧ + angleGenerator (2 * a) (sinePower (-q)) θ ≤ q / 2 * sinePower (-q) θ := by + have he : angleGenerator (2 * a) (sinePower (-q)) θ = + sinePower (-q) θ * (q / 2 - q * (4 * a - 1 - q) / 2 * Real.cot θ ^ 2) := by + rw [angleGenerator_sinePower _ _ _ (Real.sin_pos_of_pos_of_lt_pi hθ.1 hθ.2)] + ring + refine ⟨he, ?_⟩ + rw [he] + have hf : 0 < sinePower (-q) θ := + Real.rpow_pos_of_pos (Real.sin_pos_of_pos_of_lt_pi hθ.1 hθ.2) _ + have hc : 0 ≤ q * (4 * a - 1 - q) / 2 * Real.cot θ ^ 2 := by positivity + nlinarith + +end ExactSLEFiniteTilt + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt +noncomputable def clockExp (a cap lam : ℝ) (v : State) : ℝ := + Real.exp (lam*physicalClock a cap v) +noncomputable def angleLift (g : ℝ → ℝ) (v : State) : ℝ := g (physicalTheta v) +lemma clock_N_zero (a cap : ℝ) (v : State) (hv : 0 fderiv ℝ (physicalClock a cap) w noise) v noise + + fderiv ℝ (physicalClock a cap) v (physicalDrift a v) = _ + rw [physicalClock_second_noise a cap v hv,physicalClock_drift a cap ha v hv] + ring +lemma theta_N (v : State) (hv : 0 lam*physicalClock a cap w) := rfl + rw [he,N_comp ((contDiffAt_const.mul (physicalClock_smooth a cap v hv)).differentiableAt (by norm_num)) + Real.differentiable_exp.differentiableAt] + rw [N_const_mul ((physicalClock_smooth a cap v hv).differentiableAt (by norm_num)),clock_N_zero a cap v hv] + ring +lemma clockExp_L (a cap lam : ℝ) (ha : a≠0) (v : State) (hv : 0 lam*physicalClock a cap w) := rfl + rw [he,L_comp (contDiffAt_const.mul (physicalClock_smooth a cap v hv)) Real.contDiff_exp.contDiffAt, + L_const_mul (physicalClock_smooth a cap v hv),clock_L a cap ha v hv, + N_const_mul ((physicalClock_smooth a cap v hv).differentiableAt (by norm_num)),clock_N_zero a cap v hv] + simp only [Real.deriv_exp] + change _ = Real.exp (lam*physicalClock a cap v)*lam*(physicalV v)^2 + ring +lemma angleLift_smooth (g : ℝ → ℝ) (v : State) (hv : 0 clockExp a cap lam w*angleLift g w) (physicalDrift a v) noise v = + clockExp a cap lam v*(lam*g (physicalTheta v)+angleGenerator (1-2*a) g (physicalTheta v))*(physicalV v)^2 := by + rw [L_mul (clockExp_smooth a cap lam v hv) (angleLift_smooth g v hv hg), + clockExp_L a cap lam ha v hv,clockExp_N a cap lam v hv,angleLift_L g a v hv hg] + dsimp only [angleLift] + ring +lemma sinePower_smooth (r θ : ℝ) (hθ : 0 K*x) hsq] + have hcot : A ≤ K*Real.cot θ^2 := by + rw [Real.cot_eq_cos_div_sin, div_pow, ← mul_div_assoc] + exact (le_div_iff₀ (sq_pos_of_pos hs)).mpr hk + have hh := mul_le_mul_of_nonneg_left hcot hF.le + have hc : 0≤A*δ^(-q) := by positivity + dsimp only [A] at hh + nlinarith only [hh,hc] + +end ExactSLEFiniteTilt + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt + +lemma physicalTheta_smooth_all (v : State) (hv : 0 physicalGreen a w * (clockExp a cap lam w*angleLift g w)) + (physicalDrift a v) noise v = + physicalGreen a v * clockExp a cap lam v * + (lam*g (physicalTheta v)+angleGenerator (2*a) g (physicalTheta v))*(physicalV v)^2 := by + rw [green_product_generator a ha _ v hv ((clockExp_smooth a cap lam v hv).mul + (angleLift_smooth g v hv hg))] + rw [centeredGenerator,exponential_angle_generator g a cap lam ha v hv hg, + N_mul ((clockExp_smooth a cap lam v hv).differentiableAt (by norm_num)) + ((angleLift_smooth g v hv hg).differentiableAt (by norm_num)), + clockExp_N a cap lam v hv, angleLift_N g v hv (hg.differentiableAt (by norm_num))] + simp only [angleGenerator,physicalTheta_cot,physicalV,noiseLog,p] + field_simp [(Q_pos hv).ne'] + ring + + + +def angleBudgetFactor (a q cap s C : ℝ) (v : State) : ℝ := + clockExp a cap 1 v * (angleLift (sinePower (-q)) v - C) + C*Real.exp s + +lemma angleBudgetFactor_smooth (a q cap s C : ℝ) (v : State) (hv : 0 physicalGreen a w * angleBudgetFactor a q cap s C w) + (physicalDrift a v) noise v = + physicalGreen a v * clockExp a cap 1 v * + (sinePower (-q) (physicalTheta v) + + angleGenerator (2*a) (sinePower (-q)) (physicalTheta v) - C)*(physicalV v)^2 := by + have hp := physicalTheta_mem v + have hs := sinePower_smooth (-q) (physicalTheta v) + (Real.sin_pos_of_pos_of_lt_pi hp.1 hp.2) + have hG : ContDiffAt ℝ 2 (physicalGreen a) v := + (contDiffAt_physicalGreen a v hv).of_le (by norm_cast) + have he : (fun w => physicalGreen a w * angleBudgetFactor a q cap s C w) = + (fun w => physicalGreen a w * (clockExp a cap 1 w * angleLift (sinePower (-q)) w) + + (-C)*(physicalGreen a w * (clockExp a cap 1 w * angleLift (fun _ => (1:ℝ)) w)) + + (C*Real.exp s)*physicalGreen a w) := by + funext w + dsimp only [angleBudgetFactor,angleLift] + ring + have hz : L (physicalGreen a) (physicalDrift a v) noise v = 0 := + green_generator_zero a ha v hv + rw [he,L_add ((hG.mul ((clockExp_smooth a cap 1 v hv).mul (angleLift_smooth _ v hv hs))).add + (contDiffAt_const.mul (hG.mul ((clockExp_smooth a cap 1 v hv).mul + (angleLift_smooth _ v hv contDiffAt_const))))) (contDiffAt_const.mul hG), + L_add (hG.mul ((clockExp_smooth a cap 1 v hv).mul (angleLift_smooth _ v hv hs))) + (contDiffAt_const.mul (hG.mul ((clockExp_smooth a cap 1 v hv).mul + (angleLift_smooth _ v hv contDiffAt_const)))), + L_const_mul (hG.mul ((clockExp_smooth a cap 1 v hv).mul + (angleLift_smooth _ v hv contDiffAt_const))),L_const_mul hG, + green_exponential_angle_generator _ a cap 1 ha v hv hs, + green_exponential_angle_generator _ a cap 1 ha v hv contDiffAt_const, + hz] + have h1 : deriv (fun _ : ℝ => (1:ℝ)) = fun _ => 0 := funext fun _ => deriv_const _ _ + simp only [angleGenerator,h1,deriv_const] + ring + +lemma green_angleBudget_generator_nonpos (a q cap s C : ℝ) (ha : a≠0) + (hC : ∀ θ∈Ioo 0 Real.pi, + angleGenerator (2*a) (sinePower (-q)) θ+sinePower (-q) θ≤C) + (v : State) (hv : 0 physicalGreen a w * angleBudgetFactor a q cap s C w) + (physicalDrift a v) noise v ≤0 := by + rw [green_angleBudget_generator a q cap s C ha v hv] + have hh := hC (physicalTheta v) (physicalTheta_mem v) + apply mul_nonpos_of_nonpos_of_nonneg _ (sq_nonneg _) + exact mul_nonpos_of_nonneg_of_nonpos (mul_nonneg (Real.exp_pos _).le (Real.exp_pos _).le) + (by linarith) + +end ExactSLEGreen +end +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem compact_test_stopped_dynkin + (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (hfc : HasCompactSupport f) + (T : Driver → ℝ≥0) (B : ℝ≥0) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hTB : ∀ b, T b ≤ B) : + Integrable (fun b => f (X (T b) b)) W ∧ + Integrable (fun b => ∫ u in (0 : ℝ)..(T b : ℝ), generator f A e (X u.toNNReal b)) W ∧ + (∫ b, f (X (T b) b) ∂W) = (∫ b, f (X 0 b) ∂W) + + ∫ b, (∫ u in (0 : ℝ)..(T b : ℝ), generator f A e (X u.toNNReal b)) ∂W := by + let M : ℝ≥0 → Driver → ℝ := fun t b => f (X t b) - + ∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b) + have hM : Martingale M rawFiltration W := + compact_smooth_brownian_martingale W hW X hXc hXm A hAc K hK hAb e he hXeq f hf hfc + have hgc (b : Driver) : Continuous (fun u : ℝ => generator f A e (X u.toNNReal b)) := + (generator_continuous f hf A hAc e).comp ((hXc b).comp continuous_real_toNNReal) + have hmc (b : Driver) : Continuous (fun t => M t b) := + (hf.continuous.comp (hXc b)).sub + ((intervalIntegral.continuous_primitive (fun s t => (hgc b).intervalIntegrable s t) 0).comp NNReal.continuous_coe) + obtain ⟨C,D,hC,hD,hfb,hgb⟩ := compact_generator_bounds f hf hfc A K hK hAb e + have hmb (t : ℝ≥0) (ht : t ≤ B+1) (b : Driver) : ‖M t b‖ ≤ C+D*(B+1) := by + calc + _ ≤ ‖f (X t b)‖ + ‖∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b)‖ := norm_sub_le _ _ + _ ≤ C+D*(t : ℝ) := add_le_add (hfb _) (by + simpa only [sub_zero,abs_of_nonneg t.coe_nonneg] using + intervalIntegral.norm_integral_le_of_norm_le_const (a := (0 : ℝ)) (b := (t : ℝ)) + (fun u _ => hgb (X u.toNNReal b))) + _ ≤ _ := add_le_add le_rfl (mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hD) + have hFa : StronglyAdapted rawFiltration (fun t b => f (X t b)) := fun t => + (hf.continuous.measurable.comp (hXm t)).stronglyMeasurable + have hFm : Measurable (fun b => f (X (T b) b)) := + (measurable_stoppedValue (hFa.isStronglyProgressive_of_continuous + (fun b => hf.continuous.comp (hXc b))) hT).mono hT.measurableSpace_le le_rfl + have hFi : Integrable (fun b => f (X (T b) b)) W := + Integrable.of_bound hFm.aestronglyMeasurable C (Eventually.of_forall fun b => hfb _) + have hMi : Integrable (fun b => M (T b) b) W := + Integrable.of_bound (ExactSLEOptional.stopped_measurable rawFiltration hM hmc T hT).aestronglyMeasurable + (C+D*(B+1)) (Eventually.of_forall fun b => hmb _ ((hTB b).trans (le_add_of_nonneg_right zero_le_one)) b) + have hi : Integrable (fun b => ∫ u in (0 : ℝ)..(T b : ℝ), generator f A e (X u.toNNReal b)) W := by + convert hFi.sub hMi using 1 + funext b + dsimp [M] + ring + have heq := ExactSLEOptional.setIntegral_optional_sampling rawFiltration hM hmc B + (C+D*(B+1)) hmb (fun _ => 0) T (isStoppingTime_const _ _) hT (fun _ => bot_le) hTB univ MeasurableSet.univ + simp only [setIntegral_univ, M, NNReal.coe_zero, intervalIntegral.integral_same, sub_zero] at heq + rw [integral_sub hFi hi] at heq + exact ⟨hFi, hi, by linarith⟩ + +end ExactSLEGenerator + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEGenerator + +noncomputable def lifetimeCutoff (a ε : ℝ) (N : ℝ≥0) (v : State) : ℝ := + greenCutoff a ε N v * lifetimeTest (lifetimeExponent a) v + +lemma lifetimeCutoff_smooth (a ε : ℝ) (hε : 0 < ε) (N : ℝ≥0) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (lifetimeCutoff a ε N) := by + rw [contDiff_iff_contDiffAt] + intro v + by_cases hv : 0 < Y v + · exact (greenCutoff_smooth a ε hε N).contDiffAt.mul (lifetimeTest_smooth _ v hv) + · apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + have hv' : Y v < ε/4 := lt_of_le_of_lt (le_of_not_gt hv) (by positivity) + filter_upwards [Y.continuous.continuousAt.preimage_mem_nhds (Iio_mem_nhds hv')] with w hw + simp only [lifetimeCutoff, greenCutoff, heightTurn_zero hε (le_of_lt hw), + mul_zero, zero_mul] + +lemma lifetimeCutoff_compact (a ε : ℝ) (N : ℝ≥0) : + HasCompactSupport (lifetimeCutoff a ε N) := (greenCutoff_compact a ε N).mul_right + +lemma lifetimeCutoff_eq_near (a ε : ℝ) (hε : 0 < ε) (N : ℝ≥0) + (v : State) (hv : ‖v‖ ≤ N) (hy : ε ≤ Y v) : + lifetimeCutoff a ε N =ᶠ[𝓝 v] + fun w => physicalGreen a w * lifetimeTest (lifetimeExponent a) w := + (greenCutoff_eq_near a ε hε N v hv hy).mul (EventuallyEq.refl _ _) + +noncomputable def lifetimeCost (a : ℝ) (v : State) : ℝ := + lifetimeDrift a * physicalGreen a v * Q v ^ (lifetimeExponent a / 2 - 1) + +lemma lifetimeCost_pos {a : ℝ} (ha : 1/4 < a) {v : State} (hv : 0 < Y v) : + 0 < lifetimeCost a v := + mul_pos (mul_pos (lifetimeDrift_pos ha) (Real.exp_pos _)) (Real.rpow_pos_of_pos (Q_pos hv) _) + +lemma lifetimeCost_continuousAt (a : ℝ) (v : State) (hv : 0 < Y v) : + ContinuousAt (lifetimeCost a) v := by + have hQ : ContDiffAt ℝ 1 Q v := + ((X.contDiff.pow 2).add (Y.contDiff.pow 2)).contDiffAt + exact (continuousAt_const.mul (contDiffAt_physicalGreen a v hv).continuousAt).mul + ((hQ.rpow_const_of_ne (Q_pos hv).ne').continuousAt) + +lemma lifetimeCutoff_generator_le (a ε : ℝ) (ha : 1/4 < a) (hε : 0 < ε) (N : ℝ≥0) + (v : State) (hv : ‖v‖ ≤ N) (hy : ε ≤ Y v) : + generator (lifetimeCutoff a ε N) (cutoffDrift a ε) noise v ≤ -lifetimeCost a v := by + have he := lifetimeCutoff_eq_near a ε hε N v hv hy + have hd : (fun w => fderiv ℝ (lifetimeCutoff a ε N) w noise) =ᶠ[𝓝 v] + (fun w => fderiv ℝ (fun u => physicalGreen a u * lifetimeTest (lifetimeExponent a) u) w noise) := + he.fderiv.mono (fun w hw => congrArg (fun f : State →L[ℝ] ℝ => f noise) hw) + change (1/2:ℝ) * fderiv ℝ (fun w => fderiv ℝ (lifetimeCutoff a ε N) w noise) v noise + + fderiv ℝ (lifetimeCutoff a ε N) v (cutoffDrift a ε v) ≤ _ + rw [hd.fderiv_eq, he.fderiv_eq, cutoffDrift_eq_physical a ε v hy] + convert green_lifetime_generator_le a ha v (hε.trans_le hy) using 1 <;> first | rfl | (dsimp [lifetimeCost]; ring) + + + +theorem local_lifetime_budget (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (a ε : ℝ) (ha : 1/4 < a) (hε : 0 < ε) (z : ℂ) (N B : ℝ≥0) + (T : Driver → ℝ≥0) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hTB : ∀ b, T b ≤ B) + (hsafe : ∀ b t, t ≤ T b → ε ≤ Y (localState a ε hε z t b) ∧ + ‖localState a ε hε z t b‖ ≤ N) : + Integrable (fun b => physicalGreen a (localState a ε hε z (T b) b) * + lifetimeTest (lifetimeExponent a) (localState a ε hε z (T b) b)) W ∧ + (∫ b, physicalGreen a (localState a ε hε z (T b) b) * + lifetimeTest (lifetimeExponent a) (localState a ε hε z (T b) b) ∂W) ≤ + physicalGreen a (z,0) * lifetimeTest (lifetimeExponent a) (z,0) ∧ + (∫⁻ b, ∫⁻ u in Ioc (0 : ℝ) (T b : ℝ), + ENNReal.ofReal (lifetimeCost a (localState a ε hε z u.toNNReal b)) ∂volume ∂W) ≤ + ENNReal.ofReal (physicalGreen a (z,0) * lifetimeTest (lifetimeExponent a) (z,0)) := by + let V := localState a ε hε z + let f := lifetimeCutoff a ε N + let g := generator f (cutoffDrift a ε) noise + have hf := lifetimeCutoff_smooth a ε hε N + have hfc := lifetimeCutoff_compact a ε N + have hgc : Continuous g := generator_continuous f hf _ (cutoffDrift_lipschitz a ε hε).continuous noise + have hVc (b : Driver) : Continuous (fun u : ℝ => V u.toNNReal b) := + (localState_continuous a ε hε z b).comp continuous_real_toNNReal + have he (b : Driver) (t : ℝ≥0) (ht : t ≤ T b) : + f (V t b) = physicalGreen a (V t b) * lifetimeTest (lifetimeExponent a) (V t b) := + (lifetimeCutoff_eq_near a ε hε N _ (hsafe b t ht).2 (hsafe b t ht).1).eq_of_nhds + have hfpos (b : Driver) (t : ℝ≥0) (ht : t ≤ T b) : 0 ≤ f (V t b) := by + rw [he b t ht] + exact mul_nonneg (Real.exp_pos _).le (lifetimeTest_nonneg _ _ (hε.le.trans (hsafe b t ht).1)) + have hgen (b : Driver) (t : ℝ≥0) (ht : t ≤ T b) : + g (V t b) ≤ -lifetimeCost a (V t b) := + lifetimeCutoff_generator_le a ε ha hε N _ (hsafe b t ht).2 (hsafe b t ht).1 + have hpos (b : Driver) (t : ℝ≥0) (ht : t ≤ T b) : 0 < lifetimeCost a (V t b) := + lifetimeCost_pos ha (hε.trans_le (hsafe b t ht).1) + have hDy := compact_test_stopped_dynkin W hW V + (localState_continuous a ε hε z) (localState_adapted a ε hε z) + (cutoffDrift a ε) (cutoffDrift_lipschitz a ε hε).continuous + (max (|a|/ε) (|a|/ε^2)) (by positivity) (cutoffDrift_bound a ε hε) noise + (by simp [noise, Prod.norm_def]) (localState_eq a ε hε z) f hf hfc T B hT hTB + let H : Driver → ℝ := fun b => -(∫ u in (0 : ℝ)..(T b : ℝ), g (V u.toNNReal b)) + have hHi : Integrable H W := hDy.2.1.neg + have hHnonneg (b : Driver) : 0 ≤ H b := by + dsimp [H] + apply neg_nonneg.mpr + rw [intervalIntegral.integral_of_le (T b).coe_nonneg] + apply setIntegral_nonpos measurableSet_Ioc + intro u hu + have ht : u.toNNReal ≤ T b := by simpa using Real.toNNReal_le_toNNReal hu.2 + exact (hgen b u.toNNReal ht).trans (neg_nonpos.mpr (hpos b u.toNNReal ht).le) + have hHbound : (∫ b, H b ∂W) ≤ physicalGreen a (z,0) * lifetimeTest (lifetimeExponent a) (z,0) := by + have hinit (b : Driver) : f (V 0 b) = physicalGreen a (z,0) * lifetimeTest (lifetimeExponent a) (z,0) := by + rw [he b 0 (bot_le)] + simp only [V,localState_zero] + have hd := hDy.2.2 + simp_rw [hinit] at hd + simp only [integral_const, probReal_univ, one_smul] at hd + have hn : 0 ≤ ∫ b, f (V (T b) b) ∂W := integral_nonneg (fun b => hfpos b (T b) le_rfl) + change (∫ b, -(∫ u in (0 : ℝ)..(T b : ℝ), g (V u.toNNReal b)) ∂W) ≤ _ + rw [integral_neg] + linarith + refine ⟨?_, ?_, ?_⟩ + · simpa only [he _ _ le_rfl] using hDy.1 + · have hn : (∫ b, H b ∂W) ≥ 0 := integral_nonneg hHnonneg + have hd := hDy.2.2 + have hinit (b : Driver) : f (V 0 b) = physicalGreen a (z,0) * lifetimeTest (lifetimeExponent a) (z,0) := by + rw [he b 0 (bot_le)] + simp only [V,localState_zero] + simp_rw [hinit, he _ _ le_rfl] at hd + simp only [integral_const, probReal_univ, one_smul] at hd + dsimp only [H] at hn + rw [integral_neg] at hn + change (∫ b, physicalGreen a (V (T b) b) * lifetimeTest (lifetimeExponent a) (V (T b) b) ∂W) ≤ _ + linarith + · suffices hp : ∀ b, (∫⁻ u in Ioc (0 : ℝ) (T b : ℝ), ENNReal.ofReal (lifetimeCost a (V u.toNNReal b))) ≤ ENNReal.ofReal (H b) by + calc + _ ≤ ∫⁻ b, ENNReal.ofReal (H b) ∂W := lintegral_mono hp + _ = ENNReal.ofReal (∫ b, H b ∂W) := (ofReal_integral_eq_lintegral_ofReal hHi (Eventually.of_forall hHnonneg)).symm + _ ≤ _ := ENNReal.ofReal_le_ofReal hHbound + intro b + have ht (u : ℝ) (hu : u ∈ Icc 0 (T b : ℝ)) : u.toNNReal ≤ T b := by + simpa using Real.toNNReal_le_toNNReal hu.2 + have hcostc : ContinuousOn (fun u : ℝ => lifetimeCost a (V u.toNNReal b)) (Icc 0 (T b : ℝ)) := by + intro u hu + exact ((lifetimeCost_continuousAt a _ (hε.trans_le (hsafe b u.toNNReal (ht u hu)).1)).comp (f := fun u : ℝ => V u.toNNReal b) (hVc b).continuousAt).continuousWithinAt + have hci : IntervalIntegrable (fun u : ℝ => lifetimeCost a (V u.toNNReal b)) volume 0 (T b) := + hcostc.intervalIntegrable_of_Icc (T b).coe_nonneg + have hgi : IntervalIntegrable (fun u : ℝ => g (V u.toNNReal b)) volume 0 (T b) := (hgc.comp (hVc b)).intervalIntegrable 0 (T b) + have hcb : (∫ u in (0 : ℝ)..(T b : ℝ), lifetimeCost a (V u.toNNReal b)) ≤ H b := by + dsimp only [H] + rw [← intervalIntegral.integral_neg] + apply intervalIntegral.integral_mono_on (T b).coe_nonneg hci hgi.neg + intro u hu + dsimp only [Pi.neg_apply] + linarith only [hgen b u.toNNReal (ht u hu)] + rw [intervalIntegral.integral_of_le (T b).coe_nonneg] at hcb + have hn : 0 ≤ᵐ[volume.restrict (Ioc (0 : ℝ) (T b : ℝ))] (fun u => lifetimeCost a (V u.toNNReal b)) := by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with u hu + exact (hpos b u.toNNReal (ht u ⟨hu.1.le,hu.2⟩)).le + rw [← ofReal_integral_eq_lintegral_ofReal hci.1 hn] + exact ENNReal.ofReal_le_ofReal hcb + +end ExactSLEGreen +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator + +def angleBudgetCutoff (a q cap s C ε : ℝ) (N : ℝ≥0) (v : State) : ℝ := + greenCutoff a ε N v * angleBudgetFactor a q cap s C v + +lemma angleBudgetCutoff_smooth (a q cap s C ε : ℝ) (hε : 0<ε) (N : ℝ≥0) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (angleBudgetCutoff a q cap s C ε N) := by + rw [contDiff_iff_contDiffAt] + intro v + by_cases hv : 0 physicalGreen a w * angleBudgetFactor a q cap s C w := + (greenCutoff_eq_near a ε hε N v hv hy).mul (EventuallyEq.refl _ _) + +lemma angleBudgetCutoff_generator_nonpos (a q cap s C ε : ℝ) (ha : a≠0) + (hC : ∀ θ∈Ioo 0 Real.pi, + angleGenerator (2*a) (sinePower (-q)) θ + sinePower (-q) θ ≤ C) + (hε : 0<ε) (N : ℝ≥0) (v : State) (hv : ‖v‖≤N) (hy : ε≤Y v) : + generator (angleBudgetCutoff a q cap s C ε N) (cutoffDrift a ε) noise v ≤ 0 := by + have he := angleBudgetCutoff_eq_near a q cap s C ε hε N v hv hy + have hd : (fun w => fderiv ℝ (angleBudgetCutoff a q cap s C ε N) w noise) =ᶠ[𝓝 v] + (fun w => fderiv ℝ (fun u => physicalGreen a u * angleBudgetFactor a q cap s C u) w noise) := + he.fderiv.mono (fun w hw => congrArg (fun f : State →L[ℝ] ℝ => f noise) hw) + change (1/2:ℝ) * fderiv ℝ (fun w => fderiv ℝ (angleBudgetCutoff a q cap s C ε N) w noise) v noise + + fderiv ℝ (angleBudgetCutoff a q cap s C ε N) v (cutoffDrift a ε v) ≤ 0 + rw [hd.fderiv_eq, he.fderiv_eq, cutoffDrift_eq_physical a ε v hy] + exact green_angleBudget_generator_nonpos a q cap s C ha hC v (hε.trans_le hy) + + + +theorem local_angle_budget (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (a q cap s C ε : ℝ) (ha : a≠0) + (hC : ∀ θ∈Ioo 0 Real.pi, + angleGenerator (2*a) (sinePower (-q)) θ + sinePower (-q) θ ≤ C) + (hε : 0<ε) (z : ℂ) (N B : ℝ≥0) (T : Driver → ℝ≥0) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hTB : ∀ b, T b≤B) + (hsafe : ∀ b t, t≤T b → ε≤Y (localState a ε hε z t b) ∧ + ‖localState a ε hε z t b‖≤N) : + Integrable (fun b => physicalGreen a (localState a ε hε z (T b) b) * + angleBudgetFactor a q cap s C (localState a ε hε z (T b) b)) W ∧ + (∫ b, physicalGreen a (localState a ε hε z (T b) b) * + angleBudgetFactor a q cap s C (localState a ε hε z (T b) b) ∂W) ≤ + physicalGreen a (z,0) * angleBudgetFactor a q cap s C (z,0) := by + let V := localState a ε hε z + let f := angleBudgetCutoff a q cap s C ε N + let g := generator f (cutoffDrift a ε) noise + have hf := angleBudgetCutoff_smooth a q cap s C ε hε N + have hfc := angleBudgetCutoff_compact a q cap s C ε N + have he (b : Driver) (t : ℝ≥0) (ht : t≤T b) : + f (V t b) = physicalGreen a (V t b) * angleBudgetFactor a q cap s C (V t b) := + (angleBudgetCutoff_eq_near a q cap s C ε hε N _ (hsafe b t ht).2 + (hsafe b t ht).1).eq_of_nhds + have hgen (b : Driver) (t : ℝ≥0) (ht : t≤T b) : g (V t b)≤0 := + angleBudgetCutoff_generator_nonpos a q cap s C ε ha hC hε N _ + (hsafe b t ht).2 (hsafe b t ht).1 + have hDy := compact_test_stopped_dynkin W hW V + (localState_continuous a ε hε z) (localState_adapted a ε hε z) + (cutoffDrift a ε) (cutoffDrift_lipschitz a ε hε).continuous + (max (|a|/ε) (|a|/ε^2)) (by positivity) (cutoffDrift_bound a ε hε) noise + (by simp [noise, Prod.norm_def]) (localState_eq a ε hε z) f hf hfc T B hT hTB + have hneg : (∫ b, (∫ u in (0:ℝ)..(T b : ℝ), g (V u.toNNReal b)) ∂W) ≤ 0 := by + apply integral_nonpos + intro b + change (∫ u in (0:ℝ)..(T b : ℝ), g (V u.toNNReal b)) ≤ 0 + rw [intervalIntegral.integral_of_le (T b).coe_nonneg] + apply setIntegral_nonpos measurableSet_Ioc + intro u hu + exact hgen b u.toNNReal (by simpa using Real.toNNReal_le_toNNReal hu.2) + have hinit (b : Driver) : f (V 0 b) = physicalGreen a (z,0) * angleBudgetFactor a q cap s C (z,0) := by + rw [he b 0 bot_le] + simp only [V,localState_zero] + refine ⟨by simpa only [he _ _ le_rfl] using hDy.1, ?_⟩ + have hd := hDy.2.2 + simp_rw [hinit,he _ _ le_rfl] at hd + simp only [integral_const,probReal_univ,one_smul] at hd + change (∫ b, physicalGreen a (V (T b) b)*angleBudgetFactor a q cap s C (V (T b) b) ∂W)≤_ + linarith + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/AngleMeasure.lean b/lean/OAI/Probability/SLEGauge/AngleMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3e5d2c9e8daee3d26850dc966d050e66a0f8eb6 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/AngleMeasure.lean @@ -0,0 +1,573 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ConformalFlow + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen + +abbrev Angle := Ioo (0:ℝ) Real.pi + +def angleArea : Measure Angle := volume.comap (Subtype.val : Angle→ℝ) + +def angleWeight (a : ℝ) (θ : Angle) : ℝ≥0∞ := ENNReal.ofReal ((Real.sin θ)^(4*a)) + +def angleNormalization (a : ℝ) : ℝ≥0∞ := ∫⁻θ,angleWeight a θ∂angleArea + + + +def angleLaw (a : ℝ) : Measure Angle := + (angleNormalization a)⁻¹ • angleArea.withDensity (angleWeight a) + +lemma angleArea_univ : angleArea univ=ENNReal.ofReal Real.pi := by + rw [angleArea,MeasurableEmbedding.comap_apply + (MeasurableEmbedding.subtype_coe measurableSet_Ioo) _ univ] + rw [show (Subtype.val : Angle→ℝ) '' univ=Ioo (0:ℝ) Real.pi by ext x; simp, + Real.volume_Ioo,sub_zero] + +instance : IsFiniteMeasure angleArea := ⟨by rw [angleArea_univ]; exact ENNReal.ofReal_lt_top⟩ + +lemma angleArea_ne_zero : angleArea univ≠0 := by + rw [angleArea_univ] + exact (ENNReal.ofReal_pos.mpr Real.pi_pos).ne' + +lemma angleWeight_measurable (a : ℝ) : Measurable (angleWeight a) := by + unfold angleWeight + fun_prop + +lemma angleWeight_pos (a : ℝ) (θ : Angle) : 0 1 + | n+1 => raise nu n (poly nu n) + +@[simp] lemma poly_zero (nu : ℝ) : poly nu 0=1 := rfl +@[simp] lemma poly_succ (nu : ℝ) (n : ℕ) : + poly nu (n+1)=raise nu n (poly nu n) := rfl + +lemma poly_eigen (nu : ℝ) (n : ℕ) : + operator nu (poly nu n) = -C ((n:ℝ)*(n+nu))*poly nu n := by + induction n with + | zero => simp [operator] + | succ n ih => simpa only [poly_succ,Nat.cast_add,Nat.cast_one] using + raise_eigen nu n (poly nu n) ih + +lemma poly_lowering (nu : ℝ) (n : ℕ) : + (1-X^2)*(poly nu (n+1)).derivative + C ((n:ℝ)+1)*X*poly nu (n+1) = + C (((n:ℝ)+1)*(n+nu)/(2*n+nu))*poly nu n := + raise_lowering nu n (poly nu n) (poly_eigen nu n) + +lemma raise_eq_X_sub (nu n : ℝ) (p : ℝ[X]) (h : 2*n+nu≠0) : + raise nu n p = X*p - C (1/(2*n+nu))*((1-X^2)*p.derivative+C n*X*p) := by + have hc : C (1/(2*n+nu))*(2*C n+C nu)=(1:ℝ[X]) := by + have he : (2*C n+C nu : ℝ[X])=C (2*n+nu) := by simp only [map_add,map_mul,map_ofNat] + rw [he,←map_mul,one_div_mul_cancel h,map_one] + simp only [raise,map_add] + linear_combination X*p*hc + +lemma poly_one (nu : ℝ) (hnu : nu≠0) : poly nu 1=X := by + rw [show 1=0+1 from rfl,poly_succ,poly_zero,Nat.cast_zero,raise_eq_X_sub nu 0 1 (by simpa using hnu)] + simp + + +def beta (nu : ℝ) (n : ℕ) : ℝ := + ((n:ℝ)+1)*(n+nu)/((2*n+nu+2)*(2*n+nu)) + +lemma poly_recurrence (nu : ℝ) (hnu : 0 simp + | one => + rw [poly_one nu hnu.ne',eval_X,pow_one] + exact hx.trans (by norm_num) + | more n hn hn1 => + rw [poly_recurrence nu hnu n,eval_sub,eval_mul,eval_X,eval_mul,eval_C] + calc + _ ≤ |x*(poly nu (n+1)).eval x|+|beta nu n*(poly nu n).eval x| := abs_sub _ _ + _ = |x| * |(poly nu (n+1)).eval x|+beta nu n * |(poly nu n).eval x| := by + rw [abs_mul,abs_mul,abs_of_pos (beta_pos nu hnu n)] + _ ≤ 2^(n+1)+2^n := add_le_add + ((mul_le_mul hx hn1 (abs_nonneg _) zero_le_one).trans_eq (one_mul _)) + ((mul_le_mul (beta_le_one nu hnu n) hn (abs_nonneg _) zero_le_one).trans_eq (one_mul _)) + _ ≤ 2^(n+2) := by + simp only [pow_add,pow_one] + norm_num + nlinarith [show (0:ℝ)≤2^n by positivity] + +end SLEExactGauge.Jacobi +end +end + + + +section + +noncomputable section +open Polynomial MeasureTheory Set +open scoped Interval + +namespace SLEExactGauge.Jacobi + +def weight (nu x : ℝ) : ℝ := (1-x^2)^((nu-1)/2) +def flux (nu x : ℝ) : ℝ := (1-x^2)^((nu+1)/2) + +def inner (nu : ℝ) (p q : ℝ[X]) : ℝ := + ∫ x in (-1:ℝ)..1, weight nu x * p.eval x * q.eval x + +lemma continuous_weight (nu : ℝ) (hnu : 1≤nu) : Continuous (weight nu) := + (continuous_const.sub (continuous_id.pow 2)).rpow_const (fun _ => Or.inr (by linarith)) + +lemma continuous_flux (nu : ℝ) (hnu : 1≤nu) : Continuous (flux nu) := + (continuous_const.sub (continuous_id.pow 2)).rpow_const (fun _ => Or.inr (by linarith)) + +lemma flux_eq (nu : ℝ) (hnu : 1 weight nu x*p.eval x*q.eval x) volume (-1) 1 := + (((continuous_weight nu hnu).mul p.continuous).mul q.continuous).intervalIntegrable _ _ + +lemma inner_add_left (nu : ℝ) (hnu : 1≤nu) (p q r : ℝ[X]) : + inner nu (p+q) r=inner nu p r+inner nu q r := by + simp only [inner,eval_add,mul_add,add_mul] + exact intervalIntegral.integral_add (inner_integrable nu hnu p r) (inner_integrable nu hnu q r) + +lemma inner_sub_left (nu : ℝ) (hnu : 1≤nu) (p q r : ℝ[X]) : + inner nu (p-q) r=inner nu p r-inner nu q r := by + simp only [inner,eval_sub,mul_sub,sub_mul] + exact intervalIntegral.integral_sub (inner_integrable nu hnu p r) (inner_integrable nu hnu q r) + +lemma inner_C_mul_left (nu c : ℝ) (p q : ℝ[X]) : + inner nu (C c*p) q=c*inner nu p q := by + simp only [inner,eval_mul,eval_C] + simp_rw [show ∀ x, weight nu x*(c*p.eval x)*q.eval x=c*(weight nu x*p.eval x*q.eval x) by intro x; ring] + exact intervalIntegral.integral_const_mul _ _ + +lemma inner_neg_left (nu : ℝ) (p q : ℝ[X]) : + inner nu (-p) q= -inner nu p q := by + simp [inner] + +lemma inner_X (nu : ℝ) (p q : ℝ[X]) : inner nu (X*p) q=inner nu p (X*q) := by + apply intervalIntegral.integral_congr + intro x hx + simp only [eval_mul,eval_X] + ring + + +lemma operator_symmetric (nu : ℝ) (hnu : 1 (n:ℝ)*(n+nu)) := by + intro n m hnm + have hnm' : (n:ℝ) < m := Nat.cast_lt.mpr hnm + nlinarith [Nat.cast_nonneg (α := ℝ) n,Nat.cast_nonneg (α := ℝ) m] + + +lemma poly_orthogonal (nu : ℝ) (hnu : 1 simp only [poly_zero,Nat.cast_zero,monic_one,degree_one,and_self] + | one => rw [poly_one nu hnu.ne']; exact ⟨monic_X,degree_X⟩ + | more n hn hn1 => + have hd : (C (beta nu n)*poly nu n).degree < (X*poly nu (n+1)).degree := by + rw [degree_C_mul (beta_pos nu hnu n).ne',degree_mul,degree_X,hn.2,hn1.2] + norm_cast + omega + rw [poly_recurrence nu hnu n] + refine ⟨(monic_X.mul hn1.1).sub_of_left hd, ?_⟩ + rw [degree_sub_eq_left_of_degree_lt hd,degree_mul,degree_X,hn1.2] + norm_cast + omega + + +def basis (nu : ℝ) (hnu : 0 (poly_monic_degree nu hnu n).2⟩ + seq.basis (fun n => by + change IsUnit (poly nu n).leadingCoeff + rw [(poly_monic_degree nu hnu n).1.leadingCoeff] + exact isUnit_one) + +@[simp] lemma basis_apply (nu : ℝ) (hnu : 0 + change inner nu (poly nu 1) (poly nu 1)=_ + rw [poly_zero,mul_one,poly_one nu hnu0.ne'] + | succ n => + rw [hr n,inner_add_left nu hnu.le,inner_C_mul_left, + poly_orthogonal nu hnu n (n+1+1) (by omega),mul_zero,add_zero] + rfl + +lemma normSq_pos (nu : ℝ) (hnu : 1 exact normSq_zero_pos nu hnu.le + | succ n hn => + rw [normSq_succ nu hnu n] + exact mul_pos (beta_pos nu (by linarith) n) hn + +lemma normSq_lower (nu : ℝ) (hnu : 1 simp + | succ n hn => + rw [normSq_succ nu hnu,pow_succ] + have hb := beta_lower nu hnu.le n + have hz := normSq_zero_pos nu hnu.le + have hh := mul_le_mul hb hn (by positivity : 0≤normSq nu 0/((nu+2)^2)^n) + (beta_pos nu (by linarith) n).le + calc + _ = (1/(nu+2)^2)*(normSq nu 0/((nu+2)^2)^n) := by + simp only [div_eq_mul_inv,mul_inv_rev] + ring + _ ≤ _ := hh + +end SLEExactGauge.Jacobi +end +end + + + +section + +noncomputable section +open Polynomial MeasureTheory Set +open scoped ENNReal Interval Topology +namespace SLEExactGauge.Jacobi + +abbrev Interval := Icc (-1:ℝ) 1 + +def baseMeasure : Measure Interval := volume.comap Subtype.val + +instance base_finite : IsFiniteMeasure baseMeasure := by + constructor + rw [baseMeasure,(MeasurableEmbedding.subtype_coe measurableSet_Icc).comap_apply] + simp only [image_univ,Subtype.range_coe_subtype,ofPred_mem_eq] + exact isCompact_Icc.measure_lt_top + +lemma weight_nonneg (nu : ℝ) (x : Interval) : 0≤weight nu x := by + apply Real.rpow_nonneg + have hx := x.2 + nlinarith [mul_nonneg (sub_nonneg.mpr hx.2) (show (0:ℝ)≤1+x.1 by linarith [hx.1])] + +lemma continuous_weight_interval (nu : ℝ) (hnu : 1≤nu) : + Continuous (fun x : Interval => weight nu x) := (continuous_weight nu hnu).comp continuous_subtype_val + +lemma integrable_weight_interval (nu : ℝ) (hnu : 1≤nu) : + Integrable (fun x : Interval => weight nu x) baseMeasure := by + exact (continuous_weight_interval nu hnu).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +lemma integral_base (f : ℝ → ℝ) : + (∫ x : Interval, f x ∂baseMeasure)=∫ x in (-1:ℝ)..1, f x := by + rw [baseMeasure,integral_subtype_comap measurableSet_Icc,integral_Icc_eq_integral_Ioc, + intervalIntegral.integral_of_le (by norm_num : (-1:ℝ)≤1)] + +lemma integral_weight_base (nu : ℝ) : + (∫ x : Interval, weight nu x ∂baseMeasure)=normSq nu 0 := by + rw [integral_base] + simp only [normSq,inner,poly_zero,eval_one,mul_one] + +def rawMeasure (nu : ℝ) : Measure Interval := + baseMeasure.withDensity (fun x => ENNReal.ofReal (weight nu x)) + +def pi (nu : ℝ) : Measure Interval := (ENNReal.ofReal (normSq nu 0))⁻¹ • rawMeasure nu + +lemma rawMeasure_univ (nu : ℝ) (hnu : 1≤nu) : + rawMeasure nu univ=ENNReal.ofReal (normSq nu 0) := by + rw [rawMeasure,withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + rw [← ofReal_integral_eq_lintegral_ofReal (integrable_weight_interval nu hnu) + (Filter.Eventually.of_forall (weight_nonneg nu)),integral_weight_base] + +lemma pi_probability (nu : ℝ) (hnu : 1≤nu) : IsProbabilityMeasure (pi nu) := by + constructor + rw [pi,Measure.smul_apply,rawMeasure_univ nu hnu,smul_eq_mul] + exact ENNReal.inv_mul_cancel ((ENNReal.ofReal_pos.mpr (normSq_zero_pos nu hnu)).ne') ENNReal.ofReal_ne_top + +lemma integral_pi_mul (nu : ℝ) (hnu : 1≤nu) (p q : ℝ[X]) : + (∫ x : Interval, p.eval (x:ℝ)*q.eval (x:ℝ) ∂pi nu)=inner nu p q/normSq nu 0 := by + rw [pi,integral_smul_measure,rawMeasure,integral_withDensity_eq_integral_toReal_smul + ((continuous_weight_interval nu hnu).measurable.ennreal_ofReal) + (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] + simp_rw [ENNReal.toReal_ofReal (weight_nonneg nu _),smul_eq_mul] + rw [ENNReal.toReal_inv,ENNReal.toReal_ofReal (normSq_zero_pos nu hnu).le] + have hi : (∫ x : Interval, weight nu x*(p.eval (x:ℝ)*q.eval (x:ℝ)) ∂baseMeasure)=inner nu p q := by + simp_rw [←mul_assoc] + exact integral_base (fun x : ℝ => weight nu x*p.eval x*q.eval x) + rw [hi] + ring + +lemma integral_pi_poly (nu : ℝ) (hnu : 1 p.eval (x:ℝ)) (pi nu) := by + let := pi_probability nu hnu.le + exact (p.continuous.comp continuous_subtype_val).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +lemma integral_pi_poly_single (nu : ℝ) (hnu : 1 + physicalGreen a (z.1,0)*(angleLift (sinePower (-q)) (z.1,0)+C)) := by + apply continuous_iff_continuousAt.mpr + intro z + have hsin := Real.sin_pos_of_pos_of_lt_pi (physicalTheta_mem (z.1,0)).1 + (physicalTheta_mem (z.1,0)).2 + have hi : Continuous (fun w : UpperPlane => (w.1,(0:ℝ))) := + continuous_subtype_val.prodMk continuous_const + exact ((contDiffAt_physicalGreen a (z.1,0) z.2).continuousAt.mul + (((angleLift_smooth (sinePower (-q)) _ z.2 (sinePower_smooth (-q) _ hsin)).continuousAt).add_const C)).comp + (f := fun w : UpperPlane => (w.1,(0:ℝ))) hi.continuousAt + + +theorem angularCompactMass_uniform_mean (a q : ℝ) (ha : 1/4 b.1 t) W) + (K : Set UpperPlane) (hK : IsCompact K) : + ∃ B : ℝ≥0∞, B<∞ ∧ ∀ j, (∫⁻b, angularCompactMass a q j K b ∂W)≤B := by + obtain ⟨C,hC,hbound⟩ := exists_finite_level_angle_bound a q ha hq hqp + let A : UpperPlane→ℝ := fun z => physicalGreen a (z.1,0)* + (angleLift (sinePower (-q)) (z.1,0)+C) + have hA : Continuous A := angularInitial_continuous a q C + let R := Real.exp (-alpha a*Real.log 2) + let B : ℝ≥0∞ := ∫⁻z in K, ENNReal.ofReal (R*A z) ∂upperArea + have hB : B<∞ := (ContinuousOn.integrableOn_compact (μ := upperArea) hK + (show ContinuousOn (fun z => R*A z) K from (continuous_const.mul hA).continuousOn)).lintegral_lt_top + refine ⟨B,hB,?_⟩ + intro j + have hm := angularDensity_measurable a q ha j + simp only [angularCompactMass] + rw [lintegral_lintegral_swap hm.aemeasurable] + apply setLIntegral_mono' hK.measurableSet + intro z _ + let f : ExactSLEGenerator.Driver→ℝ := fun b => + radialTestWeight a (angleLift (sinePower (-q))) b.1 z.1 + (levelRadius a (2*z.1.im) (j+1)) + have hf : Measurable f := by + have hh := (joint_radialTestWeight_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) _ (angleLift_sinePower_measurable (-q))).comp + (measurable_id.prodMk (measurable_const (a := z))) + simpa [f,levelRadius,Function.comp_def] using hh + simp_rw [angularDensity,ENNReal.ofReal_mul (Real.exp_pos _).le] + rw [lintegral_const_mul _ hf.ennreal_ofReal] + exact (mul_le_mul' le_rfl (hbound W hW z.1 z.2 (j+1) (by positivity))).trans_eq + (ENNReal.ofReal_mul (Real.exp_pos _).le).symm + + +def convexAngularMass (a q : ℝ) (s : Finset ℕ) (c : ℕ→ℝ) + (K : Set UpperPlane) (b : ExactSLEGenerator.Driver) : ℝ≥0∞ := + ∑j∈s, ENNReal.ofReal (c j)*angularCompactMass a q j K b + +lemma convexAngularMass_measurable (a q : ℝ) (ha : 1/4 ENNReal.ofReal (c j)*angularCompactMass a q j K b) (fun j _ => + measurable_const.mul (angularCompactMass_measurable a q ha j K))] + simp_rw [lintegral_const_mul _ (angularCompactMass_measurable a q ha _ K)] + exact (Finset.sum_le_sum (fun j _ => mul_le_mul' le_rfl (hB j))).trans_eq (by + rw [←Finset.sum_mul,hc',one_mul]) + + + +theorem convexAngularMass_liminf_finite (a q : ℝ) (ha : 1/4 b.1 t) W) + (K : ℕ→Set UpperPlane) (hK : ∀n,IsCompact (K n)) (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀ k j,j∈s k→0≤c k j) (hs : ∀k,∑j∈s k,c k j=1) : + ∀ᵐ b ∂W, ∀ n, liminf (fun k => convexAngularMass a q (s k) (c k) (K n) b) atTop<∞ := by + apply ae_all_iff.mpr + intro n + obtain ⟨B,hB,hBj⟩ := angularCompactMass_uniform_mean a q ha hq hqp W hW (K n) (hK n) + apply ae_lt_top (Measurable.liminf (fun k => + convexAngularMass_measurable a q ha (s k) (c k) (K n))) + apply ne_top_of_lt + apply lt_of_le_of_lt (lintegral_liminf_le' (fun k => + (convexAngularMass_measurable a q ha (s k) (c k) (K n)).aemeasurable)) + exact (liminf_le_of_frequently_le (Eventually.of_forall (fun k => + convexAngularMass_mean_bound a q ha W (K n) B hBj (s k) (c k) (hc k) (hs k))).frequently).trans_lt hB + +end ExactSLEGreen +end +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_raw_mass_endpoint (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ W=initialGreenMeasure a) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0) := by + obtain ⟨s,c,hc,hs,hsum,hμ,hmeas,hprog,hmom,hL1,hmean,hcond,hH,hconv⟩ := + actual_raw_mass_extraction a ha W hW t + let μ := recoveredMass a ha s c hc + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := + (hμ v b).1 + let K : ℝ≥0∞ → Kernel ExactSLEGenerator.Driver UpperPlane := fun v => ⟨μ v,hmeas v⟩ + have hint (i : ℕ) (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂μ (t i) b) W := + memLp_one_iff_integrable.mp (by simpa only [Nat.cast_one] using hmom i f 1) + have hfut (i j : ℕ) : ∀ᵐ b ∂W, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0 := by + by_cases hi : t i=∞ + · exact Eventually.of_forall (fun _ h => False.elim (h hi)) + by_cases hj : t j=∞ + · have hz := conditional_future_support a ha W hW (t i).toNNReal (K (t i)) (K (t j)) + (hint i) (hint j) (by + filter_upwards [hconv] with b hb + exact hb.1 i j (by rw [hj]; exact le_top)) + (hcond i j (t i).toNNReal (ENNReal.coe_toNNReal hi).symm hj) + filter_upwards [hz] with b hb + exact fun _ _ => hb + · exact Eventually.of_forall (fun _ _ h => False.elim (hj h)) + refine ⟨s,c,hc,hs,hsum,hμ,recoveredMass_zero a ha s c hc,hmeas,hprog,hmom,?_,hL1,?_,hH,?_⟩ + · intro i A hA m + exact compact_mass_memLp (K (t i)) W (m : ℝ≥0∞) (fun f => hmom i f m) A hA + · intro i hi + exact initialGreenMeasure_eq_average a (K (t i)) W (hint i) (hmean i hi) + · filter_upwards [hconv,ae_all_iff.mpr (fun i => ae_all_iff.mpr (hfut i))] with b hb hf + exact ⟨hb.1,hb.2,hf⟩ + +end ExactSLEGreen +end + + + +section +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEKernel SLEExactGauge.MassVersions + + + +def localPairMeasure (α d C : ℝ) (φ : C_c(UpperPlane,ℝ≥0)) : Measure (UpperPlane × UpperPlane) := + (upperArea.prod upperArea).withDensity (fun p => + (φ p.1:ℝ≥0∞)*(φ p.2:ℝ≥0∞)*(ENNReal.ofReal C*pairKernel α d p)) + +lemma localPairMeasure_finite (α d C : ℝ) (hα : 0<α) (hα1 : α<1) (hd : 0 (B*B*ENNReal.ofReal C)*pairKernel α d p) p + ∂upperArea.prod upperArea := by + apply lintegral_mono + intro p + by_cases hx : p.1∈K + · by_cases hy : p.2∈K + · rw [indicator_of_mem (show p∈K ×ˢ K from ⟨hx,hy⟩)] + calc + _ ≤ (B*B)*(ENNReal.ofReal C*pairKernel α d p) := + mul_le_mul' (mul_le_mul' (hB p.1) (hB p.2)) le_rfl + _ = _ := by ac_rfl + · simp [K, image_eq_zero_of_notMem_tsupport hy, hy] + · simp [K, image_eq_zero_of_notMem_tsupport hx, hx] + _ = (B*B*ENNReal.ofReal C)*(∫⁻p in K ×ˢ K, pairKernel α d p ∂upperArea.prod upperArea) := by + rw [lintegral_indicator (hK.measurableSet.prod hK.measurableSet), + lintegral_const_mul _ (pairKernel_measurable α d hα.le)] + _ < ∞ := ENNReal.mul_lt_top (by dsimp [B]; finiteness) + (pairKernel_integrable_on_compact α d hα hα1 hd K hK) + +lemma localPairMeasure_diagonal (α d C : ℝ) (φ : C_c(UpperPlane,ℝ≥0)) : + localPairMeasure α d C φ (diagonal UpperPlane) = 0 := + diagonal_null_of_ac_prod upperArea _ (withDensity_absolutelyContinuous _ _) + + + +theorem localized_actualConvexMass_pair_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ (φ : C_c(UpperPlane,ℝ≥0)) (d : ℝ),0 ((actualConvexMass a s c t b).withDensity (fun z => φ z)).prod + ((actualConvexMass a s c t b).withDensity (fun z => φ z))) ≤ + localPairMeasure (alpha a) d C φ := by + obtain ⟨C,hC,hb⟩ := actualConvexDensity_pair_bound a ha + refine ⟨C,hC,?_⟩ + intro W hprob hW φ d hd hdφ s c hc hsum t + let ρ := actualConvexDensity a s c t + have hρ : Measurable (Function.uncurry ρ) := actualConvexDensity_measurable a ha s c t + have hφ : Measurable (fun z => (φ z:ℝ≥0∞)) := φ.continuous.measurable.coe_nnreal_ennreal + have he (b : ExactSLEGenerator.Driver) : + (actualConvexMass a s c t b).withDensity (fun z => φ z) = + upperArea.withDensity (fun z => ρ b z*(φ z:ℝ≥0∞)) := by + rw [actualConvexMass_density a ha s c t b] + exact (withDensity_mul upperArea (hρ.comp (measurable_const.prodMk measurable_id)) hφ).symm + simp_rw [he] + exact average_localized_density_prod_le W upperArea ρ hρ φ + (fun p => ENNReal.ofReal C*pairKernel (alpha a) d p) + (fun x hx y hy => hb W hW s c hc hsum t x y d hd (hdφ x hx) (hdφ y hy)) + +end ExactSLEGreen +end +end + + + +section +open MeasureTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] + + + +theorem ae_atomless_of_localizations (W : Measure Ω) (ν : Ω → Measure X) + (h : ∀ φ : C_c(X,ℝ≥0),∀ᵐ ω ∂W, + NullSingletonClass ((ν ω).withDensity (fun x => φ x))) : + ∀ᵐ ω ∂W,NullSingletonClass (ν ω) := by + let K := CompactExhaustion.choice X + have hcut (n : ℕ) : ∃ φ : C_c(X,ℝ≥0),∀ x∈K n,φ x=1 := by + obtain ⟨g,hg1,-,hgc,-⟩ := exists_continuous_one_zero_of_isCompact + (K.isCompact n) isClosed_empty (disjoint_empty (K n)) + let f : C_c(X,ℝ) := ⟨g,hgc⟩ + refine ⟨f.nnrealPart,?_⟩ + intro x hx + rw [CompactlySupportedContinuousMap.nnrealPart_apply] + change (g x).toNNReal=1 + simp only [hg1 hx,Pi.one_apply,Real.toNNReal_one] + choose φ hφ using hcut + filter_upwards [ae_all_iff.mpr (fun n => h (φ n))] with ω hω + constructor + intro x + obtain ⟨n,hn⟩ := K.exists_mem x + let := hω n + have hz : ((ν ω).withDensity (fun z => φ n z)) {x}=0 := measure_singleton x + rw [withDensity_apply _ (measurableSet_singleton x),lintegral_singleton,hφ n x hn] at hz + simpa only [ENNReal.coe_one,one_mul] using hz + +end SLEExactGauge.MassVersions +end + + + +section +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEKernel SLEExactGauge.MassVersions + + + +theorem actual_limit_pair_bound (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j,j∈s k → 0≤c k j) (hsum : ∀ k,∑j∈s k,c k j=1) + (t : ℝ≥0∞) (ν : ExactSLEGenerator.Driver → Measure UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (ν b)] (hν : Measurable ν) + (hconv : ∀ᵐ b ∂W,∀ f : C_c(UpperPlane,ℝ), + Tendsto (fun k => ∑j∈s k,c k j * ∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) t b) atTop (𝓝 (∫z,f z∂ν b))) + (φ : C_c(UpperPlane,ℝ≥0)) : + ∃ (Q : Measure (UpperPlane × UpperPlane)), IsFiniteMeasure Q ∧ + Q (diagonal UpperPlane)=0 ∧ + W.bind (fun b => (ν b |>.withDensity (fun z => φ z)).prod + (ν b |>.withDensity (fun z => φ z))) ≤ Q := by + obtain ⟨C,hC,hb⟩ := localized_actualConvexMass_pair_bound a ha + obtain ⟨d,hd,hdφ⟩ := upper_compact_lower (tsupport φ) φ.hasCompactSupport + let Q := localPairMeasure (alpha a) d C φ + have hα1 : alpha a<1 := by + have ha0 : 0 localizedFinite (actualConvexMass a (s k) (c k) t b) φ + let μ := fun b => localizedFinite (ν b) φ + have hμk (k) : Measurable (μk k) := measurable_localizedFinite _ + (actualConvexMass_measurable a ha (s k) (c k) t) φ + have hμ : Measurable μ := measurable_localizedFinite ν hν φ + have hl : ∀ᵐ b ∂W,Tendsto (fun k => μk k b) atTop (𝓝 (μ b)) := by + filter_upwards [hconv] with b hb' + apply localizedFinite_tendsto + intro f + simpa only [actualConvexMass_integral a ha _ _ (hc _) t b f] using hb' f + refine ⟨Q,hQ,localPairMeasure_diagonal _ _ _ φ,?_⟩ + exact average_prod_le_of_weak_limit W μk μ hμk hμ hl Q + (fun k => hb W hW φ d hd hdφ (s k) (c k) (hc k) (hsum k) t) + + + +theorem actual_limit_localized_atomless (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j,j∈s k → 0≤c k j) (hsum : ∀ k,∑j∈s k,c k j=1) + (t : ℝ≥0∞) (ν : ExactSLEGenerator.Driver → Measure UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (ν b)] (hν : Measurable ν) + (hconv : ∀ᵐ b ∂W,∀ f : C_c(UpperPlane,ℝ), + Tendsto (fun k => ∑j∈s k,c k j * ∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) t b) atTop (𝓝 (∫z,f z∂ν b))) + (φ : C_c(UpperPlane,ℝ≥0)) : + ∀ᵐ b ∂W,NullSingletonClass ((ν b).withDensity (fun z => φ z)) := by + obtain ⟨Q,hQ,hd,hb⟩ := actual_limit_pair_bound a ha W hW s c hc hsum t ν hν hconv φ + apply ae_nullSingleton_of_average_prod_diagonal W + (fun b => localizedFinite (ν b) φ) (measurable_localizedFinite ν hν φ) + apply le_antisymm _ bot_le + exact (hb (diagonal UpperPlane)).trans_eq hd + + + +theorem actual_limit_atomless (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j,j∈s k → 0≤c k j) (hsum : ∀ k,∑j∈s k,c k j=1) + (t : ℝ≥0∞) (ν : ExactSLEGenerator.Driver → Measure UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (ν b)] (hν : Measurable ν) + (hconv : ∀ᵐ b ∂W,∀ f : C_c(UpperPlane,ℝ), + Tendsto (fun k => ∑j∈s k,c k j * ∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) t b) atTop (𝓝 (∫z,f z∂ν b))) : + ∀ᵐ b ∂W,NullSingletonClass (ν b) := + ae_atomless_of_localizations W ν + (actual_limit_localized_atomless a ha W hW s c hc hsum t ν hν hconv) + +end ExactSLEGreen +end +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_raw_atomless_mass_endpoint (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ W=initialGreenMeasure a) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0) ∧ + (∀ i, NullSingletonClass (μ (t i) b)) := by + obtain ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,hconv⟩ := + actual_raw_mass_endpoint a ha W hW t + let μ := recoveredMass a ha s c hc + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := + (hμ v b).1 + have hnon (i : ℕ) : ∀ᵐ b ∂W,NullSingletonClass (μ (t i) b) := by + apply actual_limit_atomless a ha W hW s c hc hsum (t i) (μ (t i)) (hmeas (t i)) + filter_upwards [hconv] with b hb + exact hb.2.1 i + refine ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,?_⟩ + filter_upwards [hconv,ae_all_iff.mpr hnon] with b hb hn + exact ⟨hb.1,hb.2.1,hb.2.2,hn⟩ + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/BrownianGerm.lean b/lean/OAI/Probability/SLEGauge/BrownianGerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..29fc213854821be2a4dd45a7a6cdf69bd7e1ab40 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/BrownianGerm.lean @@ -0,0 +1,559 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.FutureSupport + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.BrownianGerm + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + + +@[instance_reducible] def future (B : ℝ≥0 → Ω → ℝ) (t : ℝ≥0) : MeasurableSpace Ω := + MeasurableSpace.comap (fun ω u => B (t+u) ω - B t ω) inferInstance + +omit mΩ in +lemma measurable_shift (B : ℝ≥0 → Ω → ℝ) (s u : ℝ≥0) : + Measurable[future B s] (fun ω => B (s+u) ω-B s ω) := + (measurable_pi_apply u).comp + (comap_measurable (fun ω v => B (s+v) ω-B s ω)) + +lemma future_le (B : ℝ≥0 → Ω → ℝ) (hm : ∀ t, Measurable (B t)) (t : ℝ≥0) : + future B t ≤ mΩ := + (Measurable.of_eval fun offset => (hm (t + offset)).sub (hm t)).comap_le + +omit mΩ in +lemma future_antitone (B : ℝ≥0 → Ω → ℝ) : Antitone (future B) := by + intro s t hst + suffices Measurable[future B s] (fun ω u => B (t+u) ω - B t ω) from + this.comap_le + let : MeasurableSpace Ω := future B s + refine Measurable.of_eval fun u => ?_ + have h := (measurable_shift B s (t-s+u)).sub (measurable_shift B s (t-s)) + convert h using 1; ext ω + simp only [← add_assoc, add_tsub_cancel_of_le hst, Pi.sub_apply] + ring + + + +omit mΩ in +lemma measurable_eval_iSup_future (B : ℝ≥0 → Ω → ℝ) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) (t : ℝ≥0) : + Measurable[⨆ s : {s : ℝ≥0 // 0 ((n:ℝ≥0)+1)⁻¹ + have hep (n : ℕ) : 0<ε n := by dsimp [ε]; positivity + have he : Tendsto ε atTop (𝓝 0) := by + simpa [ε,one_div] using (tendsto_one_div_add_atTop_nhds_zero_nat : + Tendsto (fun n : ℕ => 1/((n:ℝ≥0)+1)) atTop (𝓝 0)) + let : MeasurableSpace Ω := ⨆ s : {s : ℝ≥0 // 0 B (ε n+t) ω-B (ε n) ω) + · intro n + exact (measurable_shift B (ε n) t).mono (le_iSup_of_le ⟨ε n,hep n⟩ le_rfl) le_rfl + · apply tendsto_pi_nhds.mpr + intro ω + have h := ((hc ω).tendsto (0+t)).comp (he.add_const t) + have h' := ((hc ω).tendsto 0).comp he + simpa [hz ω] using h.sub h' + + + +theorem measure_zero_or_one (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, StronglyMeasurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) + (P : Measure Ω) (hB : IsPreBrownianReal B P) + {E : Set Ω} + (hE : ∀ t : ℝ≥0, 0 future B t.1 + have hg1 : g ≤ Filtration.natural B hm 1 := + iInf_le (fun t : {t : ℝ≥0 // 0 Filtration.natural B hm t.1) ⟨1,by norm_num⟩ + have hg : g ≤ mΩ := hg1.trans ((Filtration.natural B hm).le 1) + have hi (t : {t : ℝ≥0 // 0 @future_le Ω mΩ B (fun u => (hm u).measurable) t.1) hg hd + have hgE : MeasurableSet[g] E := by + exact (MeasurableSpace.measurableSet_iInf).mpr fun t => hE t.1 t.2 + have hng : Filtration.natural B hm 1 ≤ ⨆ t, f t := by + rw [Filtration.natural_eq_comap] + let : MeasurableSpace Ω := ⨆ t, f t + exact (Measurable.of_eval fun t : Iic (1:ℝ≥0) => + measurable_eval_iSup_future B hc hz t.1).comap_le + exact measure_eq_zero_or_one_of_indepSet_self + (hind.indepSet_of_measurableSet (hng _ (hE 1 (by norm_num))) hgE) + + + +lemma measurableSet_limsup_germ + (ℱ : Filtration ℝ≥0 mΩ) (τ : ℕ → ℝ≥0) (hτ : Tendsto τ atTop (𝓝 0)) + (E : ℕ → Set Ω) (hE : ∀ n, MeasurableSet[ℱ (τ n)] (E n)) + (t : ℝ≥0) (ht : 0 h.le) + have heq : E =ᶠ[atTop] (fun n => if τ n≤t then E n else ∅) := + hev.mono fun n hn => by simp [hn] + rw [limsup_congr heq] + let : MeasurableSpace Ω := ℱ t + apply MeasurableSet.measurableSet_limsup + intro n + split_ifs with h + · exact ℱ.mono h _ (hE n) + · exact MeasurableSet.empty + + +theorem measure_zero_or_one_limsup (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, StronglyMeasurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) + (P : Measure Ω) (hB : IsPreBrownianReal B P) + (τ : ℕ → ℝ≥0) (hτ : Tendsto τ atTop (𝓝 0)) + (E : ℕ → Set Ω) (hE : ∀ n, MeasurableSet[Filtration.natural B hm (τ n)] (E n)) : + P (limsup E atTop)=0 ∨ P (limsup E atTop)=1 := + measure_zero_or_one B hm hc hz P hB + (measurableSet_limsup_germ (Filtration.natural B hm) τ hτ E hE) + +end SLEExactGauge.BrownianGerm +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.GermPositivity +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + +omit mΩ in +lemma mem_limsup_iff_mem_iInter {E : ℕ → Set Ω} {ω : Ω} + (hE : Antitone (fun n => ω ∈ E n)) : + ω ∈ limsup E atTop ↔ ω ∈ ⋂ n, E n := by + rw [mem_limsup_iff_frequently_mem,mem_iInter] + constructor + · intro h n + obtain ⟨m,hm,hmem⟩ := frequently_atTop.mp h n + exact hE hm hmem + · exact fun h => Filter.Frequently.of_forall h + + + +lemma limsup_ae_eq_iInter {P : Measure Ω} {E : ℕ → Set Ω} + (hE : ∀ᵐ ω ∂P, Antitone (fun n => ω ∈ E n)) : + ∀ᵐ ω ∂P, ω ∈ limsup E atTop ↔ ω ∈ ⋂ n, E n := by + exact hE.mono fun _ h => mem_limsup_iff_mem_iInter h + + + +theorem ae_all_mem (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, StronglyMeasurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) + (P : Measure Ω) (hB : IsPreBrownianReal B P) + (τ : ℕ → ℝ≥0) (hτ : Tendsto τ atTop (𝓝 0)) + (E : ℕ → Set Ω) (hE : ∀ n, MeasurableSet[Filtration.natural B hm (τ n)] (E n)) + (hanti : ∀ᵐ ω ∂P, Antitone (fun n => ω ∈ E n)) + {p : ℝ≥0∞} (hp : 0 (he n).nullMeasurableSet) + ⟨0,measure_ne_top _ _⟩] + exact le_iInf hlower + have hEq : P (limsup E atTop)=P (⋂ n, E n) := + measure_congr (eventuallyEqSet_iff.mpr (limsup_ae_eq_iInter hanti)) + have hpos : 0

((n:ℝ≥0)+1)⁻¹) atTop (𝓝 0) + simpa only [one_div] using (tendsto_one_div_add_atTop_nhds_zero_nat : + Tendsto (fun n : ℕ => 1/((n:ℝ≥0)+1)) atTop (𝓝 0)) + + + +theorem ae_positive_all_times (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, StronglyMeasurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) + (P : Measure Ω) (hB : IsPreBrownianReal B P) + (A : ℝ≥0 → Ω → ℝ≥0∞) + (hAm : ∀ t, Measurable[Filtration.natural B hm t] (A t)) + (hAo : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + {p : ℝ≥0∞} (hp : 0 ω∈E n) := by + filter_upwards [hAo] with ω hω n m hnm hmem + exact hmem.trans_le (hω (smallTime_antitone hnm)) + have hs := ae_all_mem B hm hc hz P hB smallTime tendsto_smallTime E hEm hant hp + (fun n => hlower _ (smallTime_pos n)) + filter_upwards [hs,hAo] with ω hsω hoω t ht + obtain ⟨n,hn⟩ := (tendsto_smallTime.eventually (gt_mem_nhds ht)).exists + exact (hsω n).trans_le (hoω hn.le) + + + +theorem ae_positive_all_times_of_same_probability (B : ℝ≥0 → Ω → ℝ) + (hm : ∀ t, StronglyMeasurable (B t)) + (hc : ∀ ω, Continuous (fun t => B t ω)) (hz : ∀ ω, B 0 ω=0) + (P : Measure Ω) (hB : IsPreBrownianReal B P) + (A : ℝ≥0 → Ω → ℝ≥0∞) + (hAm : ∀ t, Measurable[Filtration.natural B hm t] (A t)) + (hAo : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hpos : ∃ u : ℝ≥0, 0 (heq u t hu ht).le) + +end SLEExactGauge.GermPositivity +end +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma physicalGreen_split_bound (a : ℝ) (ha : 1/4 < a) (R : ℝ) (hR : 0 < R) + (v : State) (hv : 0 < Y v) : + physicalGreen a v ≤ (physicalGreen a v * lifetimeTest (lifetimeExponent a) v) / + R ^ (lifetimeExponent a / 2) + + (R / (lifetimeDrift a * R ^ (lifetimeExponent a / 2))) * lifetimeCost a v := by + let q := lifetimeExponent a + let c := lifetimeDrift a + have hq : 0 < q := lifetimeExponent_pos ha + have hc : 0 < c := lifetimeDrift_pos ha + have hp : 0 < R ^ (q/2) := Real.rpow_pos_of_pos hR _ + have hG : 0 < physicalGreen a v := Real.exp_pos _ + have hF : 0 ≤ physicalGreen a v * lifetimeTest q v := + mul_nonneg hG.le (lifetimeTest_nonneg q v hv.le) + have hC : 0 ≤ R / (c * R^(q/2)) * lifetimeCost a v := by + exact mul_nonneg (by positivity) (lifetimeCost_pos ha hv).le + change physicalGreen a v ≤ _ / R^(q/2) + (R/(c*R^(q/2))) * lifetimeCost a v + by_cases hs : R ≤ Q v + · have ht : R^(q/2) ≤ lifetimeTest q v := + (Real.rpow_le_rpow hR.le hs (by positivity)).trans (lifetimeTest_coercive q v hv.le) + have h := mul_le_mul_of_nonneg_left ht hG.le + exact ((le_div_iff₀ hp).mpr h).trans (le_add_of_nonneg_right hC) + · have heq : R^(q/2-1) = R^(q/2)/R := by + rw [Real.rpow_sub hR,Real.rpow_one] + have he : R^(q/2)/R ≤ Q v^(q/2-1) := by + rw [← heq] + apply Real.rpow_le_rpow_of_nonpos (Q_pos hv) (le_of_not_ge hs) + have hq1 := lifetimeExponent_le_one a + dsimp only [q] + linarith + have hprod := mul_le_mul_of_nonneg_left he + (show 0 ≤ R / (c * R^(q/2)) * (c * physicalGreen a v) by positivity) + have hcancel : R / (c * R^(q/2)) * (c * physicalGreen a v) * (R^(q/2)/R) = + physicalGreen a v := by field_simp + rw [hcancel] at hprod + have hb : physicalGreen a v ≤ (R/(c*R^(q/2))) * lifetimeCost a v := by + convert hprod using 1; first | rfl | (dsimp [lifetimeCost,c,q]; ring) + exact hb.trans (le_add_of_nonneg_left (div_nonneg hF hp.le)) + +lemma killedGreen_split_bound (a : ℝ) (ha : 1/4 < a) (R : ℝ) (hR : 0 < R) + (z : UpperPlane) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : + killedObservable a z (physicalGreen a) t b ≤ + killedObservable a z (fun v => physicalGreen a v * lifetimeTest (lifetimeExponent a) v) + t b / R^(lifetimeExponent a/2) + + (R / (lifetimeDrift a * R^(lifetimeExponent a/2))) * + killedObservable a z (lifetimeCost a) t b := by + unfold killedObservable + split_ifs with ht + · apply physicalGreen_split_bound a ha R hR + obtain ⟨f,hf⟩ := ht + have he : loewnerMap a b.1 t z.1 = f t := by + simpa only [Real.toNNReal_coe] using + loewnerMap_eq_solution_time hf (right_mem_Icc.mpr t.coe_nonneg) + simpa only [actualState,Y_apply,he,Complex.sub_im,Complex.ofReal_im,sub_zero] using + (hf.2 (t : ℝ) (right_mem_Icc.mpr t.coe_nonneg)).1 + · simp only [zero_div,mul_zero,add_zero,le_refl] + +lemma killedObservable_real_joint_measurable (a : ℝ) (z : UpperPlane) + (F : State → ℝ) (hF : Measurable F) : + Measurable (fun p : ℝ × ExactSLEGenerator.Driver => + ENNReal.ofReal (killedObservable a z F p.1.toNNReal p.2)) := + ((killedObservable_joint_measurable a z F hF).comp + ((measurable_real_toNNReal.comp measurable_fst).prodMk measurable_snd)).ennreal_ofReal + +lemma killedGreen_timeIntegral_bound (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (R : ℝ) (hR : 0 < R) (T : ℝ≥0) : + (∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, + ENNReal.ofReal (killedObservable a z (physicalGreen a) u.toNNReal b) ∂W) ≤ + ENNReal.ofReal (((T : ℝ) / R^(lifetimeExponent a/2) + + R / (lifetimeDrift a * R^(lifetimeExponent a/2))) * + (physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0))) := by + let q := lifetimeExponent a + let c := lifetimeDrift a + let M := physicalGreen a (z.1,0) * lifetimeTest q (z.1,0) + let A : ℝ := 1 / R^(q/2) + let B : ℝ := R / (c*R^(q/2)) + let F : ℝ → ExactSLEGenerator.Driver → ℝ≥0∞ := fun u b => ENNReal.ofReal + (killedObservable a z (fun v => physicalGreen a v * lifetimeTest q v) u.toNNReal b) + let C : ℝ → ExactSLEGenerator.Driver → ℝ≥0∞ := fun u b => ENNReal.ofReal + (killedObservable a z (lifetimeCost a) u.toNNReal b) + have hM : 0 ≤ M := mul_nonneg (Real.exp_pos _).le (lifetimeTest_nonneg q _ z.2.le) + have hc : 0 < c := lifetimeDrift_pos ha + have hA : 0 ≤ A := by dsimp [A]; positivity + have hB : 0 ≤ B := by dsimp [B]; positivity + have hFm : Measurable (Function.uncurry F) := + killedObservable_real_joint_measurable a z _ (greenLifetime_measurable a) + have hCm : Measurable (Function.uncurry C) := + killedObservable_real_joint_measurable a z _ (lifetimeCost_measurable a) + have hFu (u : ℝ) : Measurable (F u) := + hFm.comp (measurable_const.prodMk measurable_id) + have hCu (u : ℝ) : Measurable (C u) := + hCm.comp (measurable_const.prodMk measurable_id) + have hFim : Measurable (fun u => ∫⁻ b, F u b ∂W) := hFm.lintegral_prod_right + have hCim : Measurable (fun u => ∫⁻ b, C u b ∂W) := hCm.lintegral_prod_right + have hFub (u : ℝ) : (∫⁻ b, F u b ∂W) ≤ ENNReal.ofReal M := + global_lifetime_test_budget a ha W hW z u.toNNReal + have hFint : (∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, F u b ∂W) ≤ + ENNReal.ofReal M * ENNReal.ofReal (T : ℝ) := by + calc + _ ≤ ∫⁻ _u in Ioc (0 : ℝ) (T : ℝ), ENNReal.ofReal M := lintegral_mono hFub + _ = _ := by simp only [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioc,sub_zero] + have hCint : (∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, C u b ∂W) ≤ ENNReal.ofReal M := by + rw [lintegral_lintegral_swap hCm.aemeasurable] + apply le_trans (lintegral_mono (fun b => lintegral_mono_set Ioc_subset_Ioi_self)) + exact global_lifetime_occupation_budget a ha W hW z + have hsplit (u : ℝ) (b : ExactSLEGenerator.Driver) : + ENNReal.ofReal (killedObservable a z (physicalGreen a) u.toNNReal b) ≤ + ENNReal.ofReal A * F u b + ENNReal.ofReal B * C u b := by + have hFn := killedObservable_nonneg a z + (fun v => physicalGreen a v * lifetimeTest q v) + (fun v hv => mul_nonneg (Real.exp_pos _).le (lifetimeTest_nonneg q v hv.le)) u.toNNReal b + have hCn := killedObservable_nonneg a z (lifetimeCost a) + (fun v hv => (lifetimeCost_pos ha hv).le) u.toNNReal b + have h := ENNReal.ofReal_le_ofReal (killedGreen_split_bound a ha R hR z u.toNNReal b) + have he : killedObservable a z + (fun v => physicalGreen a v * lifetimeTest q v) u.toNNReal b / R^(q/2) = + A * killedObservable a z + (fun v => physicalGreen a v * lifetimeTest q v) u.toNNReal b := by dsimp [A]; ring + change _ ≤ ENNReal.ofReal (_ / R^(q/2) + B * _) at h + rw [he, ENNReal.ofReal_add (mul_nonneg hA hFn) (mul_nonneg hB hCn), + ENNReal.ofReal_mul hA, ENNReal.ofReal_mul hB] at h + exact h + have hsplitInt (u : ℝ) : + (∫⁻ b, ENNReal.ofReal (killedObservable a z (physicalGreen a) u.toNNReal b) ∂W) ≤ + ENNReal.ofReal A * (∫⁻ b, F u b ∂W) + ENNReal.ofReal B * (∫⁻ b, C u b ∂W) := by + calc + _ ≤ ∫⁻ b, ENNReal.ofReal A * F u b + ENNReal.ofReal B * C u b ∂W := + lintegral_mono (hsplit u) + _ = _ := by rw [lintegral_add_left ((hFu u).const_mul (ENNReal.ofReal A)), + lintegral_const_mul _ (hFu u), lintegral_const_mul _ (hCu u)] + calc + _ ≤ ∫⁻ u in Ioc (0 : ℝ) (T : ℝ), + ENNReal.ofReal A * (∫⁻ b, F u b ∂W) + ENNReal.ofReal B * (∫⁻ b, C u b ∂W) := + lintegral_mono hsplitInt + _ = ENNReal.ofReal A * (∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, F u b ∂W) + + ENNReal.ofReal B * (∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, C u b ∂W) := by + rw [lintegral_add_left (hFim.const_mul (ENNReal.ofReal A)), + lintegral_const_mul _ hFim, lintegral_const_mul _ hCim] + _ ≤ ENNReal.ofReal A * (ENNReal.ofReal M * ENNReal.ofReal (T : ℝ)) + + ENNReal.ofReal B * ENNReal.ofReal M := + add_le_add (mul_le_mul_right hFint _) (mul_le_mul_right hCint _) + _ = _ := by + rw [← ENNReal.ofReal_mul hM, ← ENNReal.ofReal_mul hA, ← ENNReal.ofReal_mul hB, + ← ENNReal.ofReal_add (mul_nonneg hA (mul_nonneg hM T.coe_nonneg)) (mul_nonneg hB hM)] + congr 1 + dsimp [A,B,M,q,c] + ring + + + +theorem killedGreen_polynomial_decay (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (T : ℝ≥0) (hT : 0 < T) : + (∫ b, killedObservable a z (physicalGreen a) T b ∂W) ≤ + (1 + 1 / lifetimeDrift a) * + (physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0)) / + (T : ℝ)^(lifetimeExponent a/2) := by + have ht : 0 < (T : ℝ) := hT + have htime := killedGreen_timeIntegral_bound a ha W hW z T ht T + have hlower : ENNReal.ofReal (T : ℝ) * + (∫⁻ b, ENNReal.ofReal (killedObservable a z (physicalGreen a) T b) ∂W) ≤ + ∫⁻ u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, + ENNReal.ofReal (killedObservable a z (physicalGreen a) u.toNNReal b) ∂W := by + calc + _ = ∫⁻ _u in Ioc (0 : ℝ) (T : ℝ), ∫⁻ b, + ENNReal.ofReal (killedObservable a z (physicalGreen a) T b) ∂W := by + simp only [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioc,sub_zero,mul_comm] + _ ≤ _ := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem measurableSet_Ioc] with u hu + apply killedGreen_lintegral_antitone a ha W hW z + simpa only [Real.toNNReal_coe] using Real.toNNReal_le_toNNReal hu.2 + have HB := hlower.trans htime + rw [← ofReal_integral_eq_lintegral_ofReal (killedGreen_integrable a ha W hW z T) + (Eventually.of_forall (killedGreen_nonneg a z T)), + ← ENNReal.ofReal_mul ht.le] at HB + have hp : 0 < (T : ℝ)^(lifetimeExponent a/2) := Real.rpow_pos_of_pos ht _ + have hc : 0 < lifetimeDrift a := lifetimeDrift_pos ha + have hM : 0 ≤ physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0) := + mul_nonneg (Real.exp_pos _).le (lifetimeTest_nonneg _ _ z.2.le) + have HR := (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp HB + have he : ((T : ℝ)/(T : ℝ)^(lifetimeExponent a/2) + + (T : ℝ)/(lifetimeDrift a*(T : ℝ)^(lifetimeExponent a/2))) * + (physicalGreen a (z.1,0)*lifetimeTest (lifetimeExponent a) (z.1,0)) = + (T : ℝ) * ((1+1/lifetimeDrift a) * + (physicalGreen a (z.1,0)*lifetimeTest (lifetimeExponent a) (z.1,0)) / + (T : ℝ)^(lifetimeExponent a/2)) := by ring + rw [he] at HR + exact (mul_le_mul_iff_right₀ ht).mp HR + + + +theorem killedGreen_mean_tendsto_zero (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Tendsto (fun T : ℝ≥0 => ∫ b, killedObservable a z (physicalGreen a) T b ∂W) + atTop (𝓝 0) := by + apply squeeze_zero' + (Eventually.of_forall (fun T => integral_nonneg (killedGreen_nonneg a z T))) + · filter_upwards [eventually_gt_atTop (0 : ℝ≥0)] with T hT + exact killedGreen_polynomial_decay a ha W hW z T hT + · exact tendsto_const_nhds.div_atTop + ((tendsto_rpow_atTop (by linarith [lifetimeExponent_pos ha] : 0 < lifetimeExponent a/2)).comp + (NNReal.tendsto_coe_atTop.mpr tendsto_id)) + +theorem survivingGreen_mean_tendsto_zero (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Tendsto (fun T : ℝ≥0 => ∫ b, survivingGreen a T b z.1 ∂W) atTop (𝓝 0) := by + simpa only [survivingGreen_eq_killed,integral_const_mul,mul_zero] using + (killedGreen_mean_tendsto_zero a ha W hW z).const_mul (Real.exp (-alpha a*Real.log 2)) + +theorem survivingGreen_lintegral_tendsto_zero (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Tendsto (fun T : ℝ≥0 => ∫⁻ b, ENNReal.ofReal (survivingGreen a T b z.1) ∂W) + atTop (𝓝 0) := by + have he (T : ℝ≥0) : ENNReal.ofReal (∫ b, survivingGreen a T b z.1 ∂W) = + ∫⁻ b, ENNReal.ofReal (survivingGreen a T b z.1) ∂W := + ofReal_integral_eq_lintegral_ofReal ((actual_surviving_green a ha T).2.2 W hW z.1 z.2).1 + (Eventually.of_forall (fun b => by + change 0 ≤ survivingGreen a T b z.1 + rw [survivingGreen_eq_killed] + exact mul_nonneg (Real.exp_pos _).le (killedGreen_nonneg a z T b))) + simpa only [he,ENNReal.ofReal_zero] using + ENNReal.tendsto_ofReal (survivingGreen_mean_tendsto_zero a ha W hW z) + +end ExactSLEGreen +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma survivingGreen_lintegral_le_initial (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℝ≥0) (z : UpperPlane) : + (∫⁻b, ENNReal.ofReal (survivingGreen a t b z.1) ∂W) ≤ + ENNReal.ofReal (initialGreen a z) := by + obtain ⟨hi,hb⟩ := (actual_surviving_green a ha t).2.2 W hW z.1 z.2 + rw [← ofReal_integral_eq_lintegral_ofReal hi + (Eventually.of_forall (fun b => survivingGreen_nonneg a t b z.1))] + exact ENNReal.ofReal_le_ofReal hb + + + +theorem survivingGreen_compact_mean_tendsto_zero (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (K : Set UpperPlane) (hK : IsCompact K) : + Tendsto (fun n : ℕ => ∫⁻b, ∫⁻z in K, + ENNReal.ofReal (survivingGreen a n b z.1) ∂upperArea ∂W) atTop (𝓝 0) := by + have hm (n : ℕ) : Measurable (fun z : UpperPlane => + ∫⁻b, ENNReal.ofReal (survivingGreen a n b z.1) ∂W) := + (survivingGreen_joint_measurable a ha n).ennreal_ofReal.lintegral_prod_left + have hb (n : ℕ) : (fun z : UpperPlane => + ∫⁻b, ENNReal.ofReal (survivingGreen a n b z.1) ∂W) ≤ᵐ[upperArea.restrict K] + (fun z => ENNReal.ofReal (initialGreen a z)) := + Eventually.of_forall (survivingGreen_lintegral_le_initial a ha W hW n) + have hf : (∫⁻z in K, ENNReal.ofReal (initialGreen a z) ∂upperArea) ≠ ∞ := by + rw [← withDensity_apply _ hK.measurableSet] + change initialGreenMeasure a K ≠ ∞ + exact hK.measure_lt_top.ne + have hlim : ∀ᵐ z ∂upperArea.restrict K, + Tendsto (fun n : ℕ => ∫⁻b, ENNReal.ofReal (survivingGreen a n b z.1) ∂W) + atTop (𝓝 (0 : ℝ≥0∞)) := Eventually.of_forall (fun z => + (survivingGreen_lintegral_tendsto_zero a ha W hW z).comp tendsto_natCast_atTop_atTop) + have h := tendsto_lintegral_of_dominated_convergence + (fun z => ENNReal.ofReal (initialGreen a z)) hm hb hf hlim + simp only [lintegral_zero] at h + convert h using 1 + funext n + exact lintegral_lintegral_swap + (survivingGreen_joint_measurable a ha n).ennreal_ofReal.aemeasurable + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/BrownianMartingales.lean b/lean/OAI/Probability/SLEGauge/BrownianMartingales.lean new file mode 100644 index 0000000000000000000000000000000000000000..a86f6c8c95b80f5a8a3295a92190c5ee2b346600 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/BrownianMartingales.lean @@ -0,0 +1,395 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.FlowDerivatives + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +namespace ExactSLEGenerator +open Set +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] +variable [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] +theorem compact_smooth_brownian_martingale + (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (hfc : HasCompactSupport f) : + Martingale (fun t b => f (X t b) - ∫ u in (0 : ℝ)..(t : ℝ), + ((1/2 : ℝ) * directional 2 f e (X u.toNNReal b) + + fderiv ℝ f (X u.toNNReal b) (A (X u.toNNReal b)))) rawFiltration W := by + obtain ⟨C,M,hC,hM,hLip,hThird,hfb,hDb,hQb⟩ := compact_smooth_test_bounds f hf hfc e + have hQc : Continuous (fun x => iteratedDeriv 2 (fun r : ℝ => f (x+r • e)) 0) := by + simp_rw [iteratedDeriv_line f hf e,zero_smul,add_zero] + exact (directional_contDiff f hf e 2).continuous + have hf3 : ContDiff ℝ 3 f := hf.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 3) + have hSmooth (x : E) : ContDiff ℝ 3 (fun w : ℝ => f (x+w • e)) := + hf3.comp (contDiff_const.add (contDiff_id.smul contDiff_const)) + have h := additive_brownian_martingale W hW X hXc hXm A hAc K hK hAb e he hXeq f + (fderiv ℝ f) (fun x => (hf.differentiable (by simp) x).hasFDerivAt) + (hf.continuous_fderiv (by simp)) C M hC hM hLip hSmooth hThird hQc hfb hDb hQb + simpa only [iteratedDeriv_line f hf e,zero_smul,add_zero] using h + +end ExactSLEGenerator + + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped ENNReal NNReal Topology +namespace ExactSLEOptional +variable {Ω : Type*} {m : MeasurableSpace Ω} (ℱ : Filtration ℝ≥0 m) +noncomputable def roundUp (N : ℕ) (s : ℝ≥0) : ℝ≥0 := (⌈(N : ℝ≥0) * s⌉₊ : ℝ≥0) / N + +theorem le_roundUp {N : ℕ} (hN : 0 < N) (s : ℝ≥0) : s ≤ roundUp N s := by + rw [roundUp, le_div_iff₀ (by exact_mod_cast hN)] + simpa [mul_comm] using Nat.le_ceil ((N : ℝ≥0) * s) + +theorem roundUp_lt {N : ℕ} (hN : 0 < N) (s : ℝ≥0) : + roundUp N s < s + (N : ℝ≥0)⁻¹ := by + rw [roundUp, div_lt_iff₀ (by exact_mod_cast hN)] + have h := Nat.ceil_lt_add_one (a := (N : ℝ≥0) * s) bot_le + have hn : (N : ℝ≥0) ≠ 0 := by exact_mod_cast hN.ne' + simpa [add_mul, mul_add, hn, mul_comm] using h + +theorem roundUp_le_iff {N : ℕ} (hN : 0 < N) (s t : ℝ≥0) : + roundUp N s ≤ t ↔ s ≤ (⌊(N : ℝ≥0) * t⌋₊ : ℝ≥0) / N := by + have hn : (0 : ℝ≥0) < N := by exact_mod_cast hN + rw [roundUp, div_le_iff₀ hn, le_div_iff₀ hn, mul_comm t, mul_comm s] + rw [← Nat.le_floor_iff bot_le, Nat.ceil_le] + +theorem roundUp_stopping (S : Ω → ℝ≥0) + (hS : IsStoppingTime ℱ (fun b => (S b : WithTop ℝ≥0))) + {N : ℕ} (hN : 0 < N) : + IsStoppingTime ℱ (fun b => (roundUp N (S b) : WithTop ℝ≥0)) := by + intro t + have ht : (⌊(N : ℝ≥0) * t⌋₊ : ℝ≥0) / N ≤ t := by + rw [div_le_iff₀ (by exact_mod_cast hN), mul_comm t] + exact Nat.floor_le bot_le + have he : {b : Ω | (roundUp N (S b) : WithTop ℝ≥0) ≤ t} = + {b : Ω | (S b : WithTop ℝ≥0) ≤ (((⌊(N : ℝ≥0) * t⌋₊ : ℝ≥0) / N : ℝ≥0) : WithTop ℝ≥0)} := by + ext b + exact_mod_cast roundUp_le_iff hN (S b) t + rw [he] + exact ℱ.mono ht _ (hS _) + +lemma roundUp_tendsto (s : ℝ≥0) : + Tendsto (fun n : ℕ => roundUp (n + 1) s) atTop (𝓝 s) := by + have hi : Tendsto (fun n : ℕ => ((n + 1 : ℕ) : ℝ≥0)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.comp (tendsto_add_atTop_nat 1)) + have hr : Tendsto (fun n : ℕ => s + ((n + 1 : ℕ) : ℝ≥0)⁻¹) atTop (𝓝 s) := by + simpa using tendsto_const_nhds.add hi + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hr + (fun n => le_roundUp (Nat.succ_pos n) s) (fun n => (roundUp_lt (Nat.succ_pos n) s).le) + +lemma roundUp_le_add_one {N : ℕ} (hN : 0 < N) (s : ℝ≥0) : + roundUp N s ≤ s+1 := by + exact (roundUp_lt hN s).le.trans (add_le_add le_rfl + ((inv_le_one₀ (by exact_mod_cast hN : (0 : ℝ≥0) < (N : ℝ≥0))).mpr + (by exact_mod_cast Nat.succ_le_iff.mpr hN))) + +lemma roundUp_countable_range (S : Ω → ℝ≥0) (N : ℕ) : + (Set.range (fun ω => (roundUp N (S ω) : WithTop ℝ≥0))).Countable := by + apply (Set.countable_range (fun k : ℕ => (((k : ℝ≥0)/N : ℝ≥0) : WithTop ℝ≥0))).mono + rintro _ ⟨ω,rfl⟩ + exact ⟨⌈(N : ℝ≥0) * S ω⌉₊,rfl⟩ + +variable {μ : Measure Ω} [IsFiniteMeasure μ] +variable {M : ℝ≥0 → Ω → ℝ} + +omit [IsFiniteMeasure μ] in +lemma stopped_measurable (hM : Martingale M ℱ μ) (hc : ∀ ω, Continuous (fun t => M t ω)) + (S : Ω → ℝ≥0) (hS : IsStoppingTime ℱ (fun ω => (S ω : WithTop ℝ≥0))) : + Measurable (fun ω => M (S ω) ω) := by + exact + (measurable_stoppedValue (hM.stronglyAdapted.isStronglyProgressive_of_continuous hc) hS).mono hS.measurableSpace_le le_rfl + + + +lemma setIntegral_stopped_eq_terminal (hM : Martingale M ℱ μ) + (hc : ∀ ω, Continuous (fun t => M t ω)) (K : ℝ≥0) (C : ℝ) + (hb : ∀ t ≤ K+1, ∀ ω, ‖M t ω‖ ≤ C) + (S : Ω → ℝ≥0) (hS : IsStoppingTime ℱ (fun ω => (S ω : WithTop ℝ≥0))) + (hSK : ∀ ω, S ω ≤ K) (A : Set Ω) (hA : MeasurableSet[hS.measurableSpace] A) : + ∫ ω in A, M (S ω) ω ∂μ = ∫ ω in A, M (K+1) ω ∂μ := by + have heq (n : ℕ) : ∫ ω in A, M (roundUp (n+1) (S ω)) ω ∂μ = + ∫ ω in A, M (K+1) ω ∂μ := by + let Sn := fun ω => (roundUp (n+1) (S ω) : WithTop ℝ≥0) + have hSn : IsStoppingTime ℱ Sn := roundUp_stopping ℱ S hS (Nat.succ_pos n) + have hbnd : ∀ ω, Sn ω ≤ (K+1 : ℝ≥0) := by + intro ω + exact WithTop.coe_le_coe.mpr ((roundUp_le_add_one (Nat.succ_pos n) (S ω)).trans (add_le_add (hSK ω) le_rfl)) + have hm := hM.stoppedValue_ae_eq_condExp_of_le_const_of_countable_range + hSn hbnd (roundUp_countable_range S (n+1)) + have hASn : MeasurableSet[hSn.measurableSpace] A := + hS.measurableSpace_mono hSn (fun ω => WithTop.coe_le_coe.mpr (le_roundUp (Nat.succ_pos n) (S ω))) _ hA + calc + _ = ∫ ω in A, stoppedValue M Sn ω ∂μ := by + congr 1 + _ = ∫ ω in A, μ[M (K+1) | hSn.measurableSpace] ω ∂μ := + integral_congr_ae (ae_restrict_of_ae hm) + _ = _ := setIntegral_condExp hSn.measurableSpace_le (hM.integrable _) hASn + have ht : Tendsto (fun n : ℕ => ∫ ω in A, M (roundUp (n+1) (S ω)) ω ∂μ) + atTop (𝓝 (∫ ω in A, M (S ω) ω ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => C) + · intro n + exact (stopped_measurable ℱ hM hc _ (roundUp_stopping ℱ S hS (Nat.succ_pos n))).aestronglyMeasurable + · exact integrable_const C + · intro n + exact Filter.Eventually.of_forall fun ω => hb _ + ((roundUp_le_add_one (Nat.succ_pos n) (S ω)).trans (add_le_add (hSK ω) le_rfl)) ω + · exact Filter.Eventually.of_forall fun ω => (hc ω).tendsto (S ω) |>.comp (roundUp_tendsto (S ω)) + exact tendsto_nhds_unique ht (by simp_rw [heq]; exact tendsto_const_nhds) + +lemma setIntegral_optional_sampling (hM : Martingale M ℱ μ) + (hc : ∀ ω, Continuous (fun t => M t ω)) (K : ℝ≥0) (C : ℝ) + (hb : ∀ t ≤ K+1, ∀ ω, ‖M t ω‖ ≤ C) + (S T : Ω → ℝ≥0) + (hS : IsStoppingTime ℱ (fun ω => (S ω : WithTop ℝ≥0))) + (hT : IsStoppingTime ℱ (fun ω => (T ω : WithTop ℝ≥0))) + (hST : ∀ ω, S ω ≤ T ω) (hTK : ∀ ω, T ω ≤ K) + (A : Set Ω) (hA : MeasurableSet[hS.measurableSpace] A) : + ∫ ω in A, M (S ω) ω ∂μ = ∫ ω in A, M (T ω) ω ∂μ := by + rw [setIntegral_stopped_eq_terminal ℱ hM hc K C hb S hS (fun ω => (hST ω).trans (hTK ω)) A hA, + setIntegral_stopped_eq_terminal ℱ hM hc K C hb T hT hTK A + (hS.measurableSpace_mono hT (fun ω => WithTop.coe_le_coe.mpr (hST ω)) _ hA)] + +end ExactSLEOptional + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +noncomputable def generator (f : E → ℝ) (A : E → E) (e : E) (x : E) : ℝ := + (1/2 : ℝ) * directional 2 f e x + fderiv ℝ f x (A x) + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma generator_continuous (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) + (A : E → E) (hA : Continuous A) (e : E) : Continuous (generator f A e) := + (continuous_const.mul (directional_contDiff f hf e 2).continuous).add + ((hf.continuous_fderiv (by simp)).clm_apply hA) + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma compact_generator_bounds (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) + (hfc : HasCompactSupport f) (A : E → E) (K : ℝ) (hK : 0 ≤ K) + (hAb : ∀ x, ‖A x‖ ≤ K) (e : E) : + ∃ M C : ℝ, 0 ≤ M ∧ 0 ≤ C ∧ (∀ x, ‖f x‖ ≤ M) ∧ + (∀ x, ‖generator f A e x‖ ≤ C) := by + obtain ⟨D,M,hD,hM,hLip,hThird,hfb,hDb,hQb⟩ := compact_smooth_test_bounds f hf hfc e + refine ⟨M,M/2+M*K,hM,by positivity,?_,?_⟩ + · intro x + exact hfb x + · intro x + have hq : ‖directional 2 f e x‖ ≤ M := by + simpa only [iteratedDeriv_line f hf e,zero_smul,add_zero,Real.norm_eq_abs] using hQb x + have hv : ‖fderiv ℝ f x (A x)‖ ≤ M*K := + ((fderiv ℝ f x).le_opNorm _).trans (mul_le_mul (hDb x) (hAb x) (norm_nonneg _) hM) + calc + _ ≤ ‖(1/2 : ℝ)*directional 2 f e x‖ + ‖fderiv ℝ f x (A x)‖ := norm_add_le _ _ + _ ≤ (1/2 : ℝ)*M+M*K := add_le_add (by + rw [norm_mul,Real.norm_of_nonneg (by norm_num : (0 : ℝ) ≤ 1/2)] + exact mul_le_mul_of_nonneg_left hq (by norm_num)) hv + _ = _ := by ring + + + +theorem compact_test_optional_sampling + (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (hfc : HasCompactSupport f) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b ≤ T b) (hTB : ∀ b, T b ≤ B) + (hzero : ∀ b t, t ≤ T b → generator f A e (X t b) = 0) + (U : Set Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + ∫ b in U, f (X (S b) b) ∂W = ∫ b in U, f (X (T b) b) ∂W := by + let M : ℝ≥0 → Driver → ℝ := fun t b => f (X t b) - + ∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b) + have hM : Martingale M rawFiltration W := + compact_smooth_brownian_martingale W hW X hXc hXm A hAc K hK hAb e he hXeq f hf hfc + have hc (b : Driver) : Continuous (fun t => M t b) := by + have hg : Continuous (fun u : ℝ => generator f A e (X u.toNNReal b)) := + (generator_continuous f hf A hAc e).comp ((hXc b).comp continuous_real_toNNReal) + exact (hf.continuous.comp (hXc b)).sub + ((intervalIntegral.continuous_primitive (fun s t => hg.intervalIntegrable s t) 0).comp NNReal.continuous_coe) + obtain ⟨C,D,hC,hD,hfb,hgb⟩ := compact_generator_bounds f hf hfc A K hK hAb e + have hb (t : ℝ≥0) (ht : t ≤ B+1) (b : Driver) : ‖M t b‖ ≤ C+D*(B+1) := by + calc + _ ≤ ‖f (X t b)‖ + ‖∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b)‖ := norm_sub_le _ _ + _ ≤ C+D*(t : ℝ) := add_le_add (hfb _) (by + simpa only [sub_zero,abs_of_nonneg t.coe_nonneg] using + intervalIntegral.norm_integral_le_of_norm_le_const (a := (0 : ℝ)) (b := (t : ℝ)) + (fun u _ => hgb (X u.toNNReal b))) + _ ≤ _ := add_le_add le_rfl (mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hD) + have heq (b : Driver) (t : ℝ≥0) (ht : t ≤ T b) : M t b = f (X t b) := by + change f (X t b) - _ = _ + suffices (∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b)) = 0 by rw [this,sub_zero] + apply Eq.trans _ (intervalIntegral.integral_zero (a := (0 : ℝ)) (b := (t : ℝ)) (μ := volume) (E := ℝ)) + apply intervalIntegral.integral_congr + intro u hu + apply hzero b u.toNNReal + have hu' : u ≤ (t : ℝ) := (by simpa only [uIcc_of_le t.coe_nonneg] using hu : u ∈ Icc 0 (t : ℝ)).2 + exact (Real.toNNReal_le_toNNReal hu').trans (by simpa using ht) + have ho := ExactSLEOptional.setIntegral_optional_sampling rawFiltration hM hc B + (C+D*(B+1)) hb S T hS hT hST hTB U hU + simpa only [heq _ _ (hST _),heq _ _ le_rfl] using ho + +end ExactSLEGenerator + +namespace ExactSLEMain + +abbrev Driver := {b : C(ℝ≥0, ℝ) // b 0 = 0} +instance : MeasurableSpace Driver := borel Driver + +def odeUntil (A : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (t : ℝ≥0) (f : ℝ → ℂ) : Prop := + f 0 = z ∧ ∀ u ∈ Set.Icc 0 (t : ℝ), + 0 < (f u).im ∧ HasDerivWithinAt f ((A : ℂ) / (f u - (b u.toNNReal : ℂ))) + (Set.Icc 0 (t : ℝ)) u + +def alive (A : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (z : ℂ) : Prop := + ∃ f : ℝ → ℂ, odeUntil A b z t f + +noncomputable def loewnerMap (A : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (z : ℂ) : ℂ := by + classical + exact if h : alive A b t z then (Classical.choose h) t else 0 + +theorem odeUntil_continuousOn {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {t : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z t f) : ContinuousOn f (Set.Icc 0 (t : ℝ)) := by + exact HasDerivWithinAt.continuousOn (fun u hu => (hf.2 u hu).2) + +theorem odeUntil_height_lower {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {t : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z t f) : + ∃ ε : ℝ, 0 < ε ∧ ∀ u ∈ Set.Icc 0 (t : ℝ), ε ≤ (f u).im := by + have hnon : (Set.Icc 0 (t : ℝ)).Nonempty := ⟨0, by simp⟩ + obtain ⟨u, hu, hmin⟩ := isCompact_Icc.exists_isMinOn hnon + (Complex.continuous_im.comp_continuousOn (odeUntil_continuousOn hf)) + exact ⟨(f u).im, (hf.2 u hu).1, hmin⟩ + +theorem loewner_vector_difference (A β ε : ℝ) (hε : 0 < ε) (v w : ℂ) + (hv : ε ≤ v.im) (hw : ε ≤ w.im) : + ‖(A : ℂ) / (v - (β : ℂ)) - (A : ℂ) / (w - (β : ℂ))‖ ≤ + (|A| / ε ^ 2) * ‖v - w‖ := by + have hv0 : 0 < v.im := hε.trans_le hv + have hw0 : 0 < w.im := hε.trans_le hw + have hnv : ε ≤ ‖v - (β : ℂ)‖ := by + calc + ε ≤ v.im := hv + _ = (v - (β : ℂ)).im := by simp + _ ≤ _ := Complex.im_le_norm _ + have hnw : ε ≤ ‖w - (β : ℂ)‖ := by + calc + ε ≤ w.im := hw + _ = (w - (β : ℂ)).im := by simp + _ ≤ _ := Complex.im_le_norm _ + have hvz : v - (β : ℂ) ≠ 0 := norm_pos_iff.mp (hε.trans_le hnv) + have hwz : w - (β : ℂ) ≠ 0 := norm_pos_iff.mp (hε.trans_le hnw) + have heq : (A : ℂ) / (v - (β : ℂ)) - (A : ℂ) / (w - (β : ℂ)) = + (-(A : ℂ)) * (v - w) / ((v - (β : ℂ)) * (w - (β : ℂ))) := by + field_simp + ring + rw [heq, norm_div, norm_mul, norm_mul, norm_neg, Complex.norm_real, Real.norm_eq_abs] + calc + |A| * ‖v - w‖ / (‖v - (β : ℂ)‖ * ‖w - (β : ℂ)‖) ≤ |A| * ‖v - w‖ / ε ^ 2 := by + apply div_le_div_of_nonneg_left (by positivity) (sq_pos_of_pos hε) + simpa [pow_two] using mul_le_mul hnv hnw hε.le (norm_nonneg _) + _ = _ := by ring + +theorem odeUntil_unique (A : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (t : ℝ≥0) + {f g : ℝ → ℂ} (hf : odeUntil A b z t f) (hg : odeUntil A b z t g) : + Set.EqOn f g (Set.Icc 0 (t : ℝ)) := by + obtain ⟨εf, hεf, hflower⟩ := odeUntil_height_lower hf + obtain ⟨εg, hεg, hglower⟩ := odeUntil_height_lower hg + let ε := min εf εg + have hε : 0 < ε := lt_min hεf hεg + have hderiv : ∀ u ∈ Set.Ico 0 (t : ℝ), HasDerivWithinAt (fun u => f u - g u) + ((A : ℂ) / (f u - (b u.toNNReal : ℂ)) - (A : ℂ) / (g u - (b u.toNNReal : ℂ))) + (Set.Ici u) u := by + intro u hu + exact ((hf.2 u (Set.mem_Icc_of_Ico hu)).2.sub (hg.2 u (Set.mem_Icc_of_Ico hu)).2).mono_of_mem_nhdsWithin + (Icc_mem_nhdsGE_of_mem hu) + have hzero : ∀ u ∈ Set.Icc 0 (t : ℝ), f u - g u = 0 := by + apply eq_zero_of_abs_deriv_le_mul_abs_self_of_eq_zero_right + ((odeUntil_continuousOn hf).sub (odeUntil_continuousOn hg)) hderiv + (show f 0 - g 0 = 0 by rw [hf.1, hg.1, sub_self]) + intro u hu + exact loewner_vector_difference A (b u.toNNReal) ε hε (f u) (g u) + ((min_le_left _ _).trans (hflower u (Set.mem_Icc_of_Ico hu))) + ((min_le_right _ _).trans (hglower u (Set.mem_Icc_of_Ico hu))) + exact fun u hu => sub_eq_zero.mp (hzero u hu) + +theorem odeUntil_mono {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {s t : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z t f) (hst : s ≤ t) : odeUntil A b z s f := by + refine ⟨hf.1, fun u hu => ?_⟩ + have hsub : Set.Icc 0 (s : ℝ) ⊆ Set.Icc 0 (t : ℝ) := + Set.Icc_subset_Icc_right (show (s : ℝ) ≤ t from hst) + exact ⟨(hf.2 u (hsub hu)).1, (hf.2 u (hsub hu)).2.mono hsub⟩ + +theorem alive_mono {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {s t : ℝ≥0} + (h : alive A b t z) (hst : s ≤ t) : alive A b s z := by + obtain ⟨f, hf⟩ := h + exact ⟨f, odeUntil_mono hf hst⟩ + +theorem loewnerMap_eq {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {t : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z t f) : loewnerMap A b t z = f t := by + have he : alive A b t z := ⟨f, hf⟩ + rw [loewnerMap, dite_eq_left he] + exact odeUntil_unique A b z t (Classical.choose_spec he) hf (by simp) + +def shiftDriver (b : ℝ≥0 → ℝ) (s : ℝ≥0) : ℝ≥0 → ℝ := fun u => b (s + u) - b s + +theorem odeUntil_shift {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {s t : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z (s + t) f) : + odeUntil A (shiftDriver b s) (f s - (b s : ℂ)) t + (fun u => f (u + s) - (b s : ℂ)) := by + refine ⟨by simp, fun u hu => ?_⟩ + have hmaps : Set.MapsTo (fun u : ℝ => u + s) (Set.Icc 0 (t : ℝ)) (Set.Icc 0 ((s + t : ℝ≥0) : ℝ)) := by + intro v hv + constructor <;> simp only [NNReal.coe_add] <;> linarith [s.coe_nonneg, hv.1, hv.2] + have hnn : (u + (s : ℝ)).toNNReal = s + u.toNNReal := by + apply NNReal.coe_injective + simp only [NNReal.coe_add, Real.coe_toNNReal _ (add_nonneg hu.1 s.coe_nonneg), + Real.coe_toNNReal _ hu.1] + ring + have hder := ((hf.2 (u + s) (hmaps hu)).2.scomp u + ((hasDerivAt_id u).add_const (s : ℝ)).hasDerivWithinAt hmaps).sub_const (b s : ℂ) + constructor + · simpa using (hf.2 (u + s) (hmaps hu)).1 + · simpa [shiftDriver, hnn, sub_sub_sub_cancel_right] using hder + +theorem loewnerMap_restart (A : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (s t : ℝ≥0) + (h : alive A b (s + t) z) : + alive A (shiftDriver b s) t (loewnerMap A b s z - (b s : ℂ)) ∧ + loewnerMap A (shiftDriver b s) t (loewnerMap A b s z - (b s : ℂ)) = + loewnerMap A b (s + t) z - (b s : ℂ) := by + obtain ⟨f, hf⟩ := h + have hs : odeUntil A b z s f := odeUntil_mono hf (by exact le_add_of_nonneg_right (show 0 ≤ t from bot_le)) + have hfs := loewnerMap_eq hs + rw [hfs] + constructor + · exact ⟨_, odeUntil_shift hf⟩ + · rw [loewnerMap_eq (odeUntil_shift hf), loewnerMap_eq hf] + simp [add_comm] + +end ExactSLEMain +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/BrownianNodes.lean b/lean/OAI/Probability/SLEGauge/BrownianNodes.lean new file mode 100644 index 0000000000000000000000000000000000000000..e14e922232c574be5beec29f28f8a875efbaf82d --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/BrownianNodes.lean @@ -0,0 +1,464 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.InverseRegularity + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.BrownianCalculus +open scoped ContinuousMapZero +variable {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) +include hW +lemma increment_indep_history (s h : ℝ≥0) : IndepFun (increment s h) (history s) W := by + have hi := (hW.toIsPreBrownianReal.indepFun_shift s).comp + (measurable_pi_apply h) measurable_id + exact hi + +lemma increment_indep_past_function (s h : ℝ≥0) {F : (Iic s → ℝ) → ℝ} + (hF : Measurable F) : IndepFun (increment s h) (F ∘ history s) W := by + exact (increment_indep_history hW s h).comp measurable_id hF + +lemma predictable_increment_centered (s h : ℝ≥0) {F : (Iic s → ℝ) → ℝ} + (hF : Measurable F) : + (∫ b, F (history s b) * increment s h b ∂W) = 0 := by + have hi := (increment_indep_past_function hW s h hF).symm + have hh := hi.integral_mul_eq_mul_integral + (hF.comp (measurable_history s)).aestronglyMeasurable + (measurable_increment s h).aestronglyMeasurable + change (∫ b, F (history s b) * increment s h b ∂W) = + (∫ b, F (history s b) ∂W) * (∫ b, increment s h b ∂W) at hh + rw [hh, increment_mean hW, mul_zero] + +lemma increment_pow_integrable (s h : ℝ≥0) (n : ℕ) : + Integrable (fun b => (increment s h b)^n) W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hm := (increment_law hW s h).hasGaussianLaw.memLp (p := (n : ℝ≥0∞)) (by simp) + apply (integrable_norm_iff ((measurable_increment s h).pow_const n).aestronglyMeasurable).mp + simpa only [norm_pow] using hm.integrable_norm_pow' + +lemma predictable_innovation_centered (s h : ℝ≥0) {F : (Iic s → ℝ) → ℝ} + (hF : Measurable F) {J : ℝ → ℝ} (hJ : Measurable J) + (hmean : (∫ x, J x ∂gaussianReal 0 h) = 0) : + (∫ b, F (history s b) * J (increment s h b) ∂W) = 0 := by + have hi := (increment_indep_history hW s h).comp hJ hF + have hh := hi.symm.integral_mul_eq_mul_integral + (hF.comp (measurable_history s)).aestronglyMeasurable + (hJ.comp (measurable_increment s h)).aestronglyMeasurable + change (∫ b, F (history s b) * J (increment s h b) ∂W) = + (∫ b, F (history s b) ∂W) * (∫ b, J (increment s h b) ∂W) at hh + have hm : (∫ b, J (increment s h b) ∂W) = 0 := by + exact ((increment_law hW s h).integral_comp hJ.aestronglyMeasurable).trans hmean + rw [hh, hm, mul_zero] + +lemma predictable_compensated_square_centered (s h : ℝ≥0) + {F : (Iic s → ℝ) → ℝ} (hF : Measurable F) : + (∫ b, F (history s b) * ((increment s h b)^2 - (h:ℝ)) ∂W) = 0 := by + apply predictable_innovation_centered hW s h hF (J := fun x : ℝ => x^2-(h:ℝ)) (by fun_prop) + have hi : Integrable (fun x : ℝ => x^2) (gaussianReal 0 h) := by + simpa only [id_eq] using (memLp_id_gaussianReal (μ := 0) (v := h) 2).integrable_sq + rw [integral_sub hi (integrable_const (h:ℝ)), integral_sq_gaussian] + simp + +lemma increment_abs_cube_integrable (s h : ℝ≥0) : + Integrable (fun b => |increment s h b|^3) W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hm := (increment_law hW s h).hasGaussianLaw.memLp (p := (3 : ℝ≥0∞)) (by simp) + simpa only [Real.norm_eq_abs] using hm.integrable_norm_pow' (p := 3) + +omit hW in +lemma abs_cube_bound {h x : ℝ} (hh : 0 < h) : + |x|^3 ≤ (h*x^2 + x^4) / (2*Real.sqrt h) := by + have hr := Real.sqrt_pos.mpr hh + have hs := Real.sq_sqrt hh.le + apply (le_div_iff₀ (by positivity : 0 < 2*Real.sqrt h)).mpr + have hx4 : |x|^4 = x^4 := by + calc |x|^4 = (|x|^2)^2 := by ring + _ = (x^2)^2 := by rw [sq_abs] + _ = x^4 := by ring + have he : h*x^2 + x^4 - |x|^3*(2*Real.sqrt h) = + (|x|^2 - Real.sqrt h*|x|)^2 := by + calc + _ = (Real.sqrt h)^2*|x|^2 + |x|^4 - |x|^3*(2*Real.sqrt h) := by + rw [hs, sq_abs, hx4] + _ = _ := by ring + linarith [sq_nonneg (|x|^2-Real.sqrt h*|x|)] + +lemma increment_abs_cube_le (s h : ℝ≥0) : + (∫ b, |increment s h b|^3 ∂W) ≤ 2*(h:ℝ)*Real.sqrt h := by + let := hW.isGaussianProcess.isProbabilityMeasure + by_cases hh : h = 0 + · subst h + simp [increment] + have hp : 0 < (h:ℝ) := NNReal.coe_pos.mpr (pos_iff_ne_zero.mpr hh) + have hr := Real.sqrt_pos.mpr hp + have hi2 := increment_pow_integrable hW s h 2 + have hi4 := increment_pow_integrable hW s h 4 + have hm := integral_mono (increment_abs_cube_integrable hW s h) + (((hi2.const_mul (h:ℝ)).add hi4).div_const (2*Real.sqrt h)) + (fun b => abs_cube_bound (x := increment s h b) hp) + have he : (∫ b, ((h:ℝ)*(increment s h b)^2+(increment s h b)^4) / + (2*Real.sqrt h) ∂W) = 2*(h:ℝ)*Real.sqrt h := by + rw [integral_div, integral_add (hi2.const_mul _) hi4, integral_const_mul, + increment_sq hW, increment_fourth hW] + apply (div_eq_iff (by positivity : 2*Real.sqrt (h:ℝ) ≠ 0)).mpr + nlinarith [Real.sq_sqrt hp.le] + exact hm.trans_eq he + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + +lemma taylor_second_bound {f : ℝ → ℝ} (hf : ContDiff ℝ 3 f) + {C : ℝ} (hC : ∀ z, |iteratedDeriv 3 f z| ≤ C) (x y : ℝ) : + |f y - f x - deriv f x*(y-x) - deriv (deriv f) x*(y-x)^2/2| ≤ + C/6 * |y-x|^3 := by + by_cases heq : x = y + · subst y + simp + have hc : ContDiffOn ℝ (2+1 : ℕ) f (uIcc x y) := hf.contDiffOn + obtain ⟨z, hz, he⟩ := taylor_mean_remainder_lagrange_iteratedDeriv + (n := 2) heq hc + have hi (k : ℕ) (hk : k ≤ 2) : + iteratedDerivWithin k f (uIcc x y) x = iteratedDeriv k f x := by + apply iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_uIcc heq) + · exact (hf.of_le (by norm_cast; omega)).contDiffAt + · exact left_mem_uIcc + have ht : taylorWithinEval f 2 (uIcc x y) x y = + f x + deriv f x*(y-x) + deriv (deriv f) x*(y-x)^2/2 := by + simp only [taylor_within_apply, Finset.sum_range_succ, Finset.sum_range_zero, + zero_add, hi 0 (by omega), hi 1 (by omega), hi 2 (by omega)] + norm_num [iteratedDeriv_succ, iteratedDeriv_zero] + ring + have he' : f y - f x - deriv f x*(y-x) - deriv (deriv f) x*(y-x)^2/2 = + iteratedDeriv 3 f z * (y-x)^3 / 6 := by + rw [ht] at he + norm_num at he + linarith + rw [he', abs_div, abs_mul, abs_pow] + norm_num + calc |iteratedDeriv 3 f z| * |y-x|^3 / 6 ≤ C * |y-x|^3 / 6 := by gcongr; exact hC z + _ = _ := by ring + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + + + +lemma expected_taylor_step {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (f : (Iic s → ℝ) → ℝ → ℝ) + (hsm : ∀ p, ContDiff ℝ 3 (f p)) + (hm1 : Measurable (fun p => deriv (f p) (p ⟨s, by simp⟩))) + (hm2 : Measurable (fun p => deriv (deriv (f p)) (p ⟨s, by simp⟩))) + {C M₁ M₂ : ℝ} (hC : 0 ≤ C) + (hb1 : ∀ p, |deriv (f p) (p ⟨s, by simp⟩)| ≤ M₁) + (hb2 : ∀ p, |deriv (deriv (f p)) (p ⟨s, by simp⟩)| ≤ M₂) + (hb3 : ∀ p x, |iteratedDeriv 3 (f p) x| ≤ C) + (hi : Integrable (fun b => f (history s b) (b (s+h)) - f (history s b) (b s)) W) : + |(∫ b, f (history s b) (b (s+h)) - f (history s b) (b s) ∂W) - + (h:ℝ)/2 * (∫ b, deriv (deriv (f (history s b))) (b s) ∂W)| ≤ + C/3 * (h:ℝ) * Real.sqrt h := by + let := hW.isGaussianProcess.isProbabilityMeasure + let A₁ := fun p : Iic s → ℝ => deriv (f p) (p ⟨s, by simp⟩) + let A₂ := fun p : Iic s → ℝ => deriv (deriv (f p)) (p ⟨s, by simp⟩) + have ha₁ : AEStronglyMeasurable (fun b => A₁ (history s b)) W := + (hm1.comp (measurable_history s)).aestronglyMeasurable + have ha₂ : AEStronglyMeasurable (fun b => A₂ (history s b)) W := + (hm2.comp (measurable_history s)).aestronglyMeasurable + have i₁ : Integrable (fun b => A₁ (history s b)*increment s h b) W := by + have hg : Integrable (increment s h) W := by + simpa only [pow_one] using increment_pow_integrable hW s h 1 + exact hg.bdd_mul ha₁ (Filter.Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using hb1 (history s b)) + have i₂ : Integrable (fun b => A₂ (history s b)*(increment s h b)^2) W := + (increment_pow_integrable hW s h 2).bdd_mul ha₂ + (Filter.Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using hb2 (history s b)) + have ia₂ : Integrable (fun b => A₂ (history s b)) W := + (integrable_const M₂).mono' ha₂ (Filter.Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using hb2 (history s b)) + have e₂ : (∫ b, A₂ (history s b)*(increment s h b)^2 ∂W) = + (h:ℝ)*(∫ b, A₂ (history s b) ∂W) := by + have hh := predictable_compensated_square_centered hW s h hm2 + change (∫ b, A₂ (history s b)*((increment s h b)^2-(h:ℝ)) ∂W) = 0 at hh + simp_rw [mul_sub] at hh + rw [integral_sub i₂ (ia₂.mul_const (h:ℝ)), integral_mul_const] at hh + linarith + let R := fun b => f (history s b) (b (s+h)) - f (history s b) (b s) - + A₁ (history s b)*increment s h b - A₂ (history s b)*(increment s h b)^2/2 + have he : (∫ b, R b ∂W) = + (∫ b, f (history s b) (b (s+h)) - f (history s b) (b s) ∂W) - + (h:ℝ)/2*(∫ b, deriv (deriv (f (history s b))) (b s) ∂W) := by + dsimp only [R] + have hs1 := integral_sub hi i₁ + have hs2 := integral_sub (hi.sub i₁) (i₂.div_const 2) + simp only [Pi.sub_apply] at hs1 hs2 + rw [hs2, hs1, predictable_increment_centered hW s h hm1, integral_div, e₂] + dsimp only [A₂, history] + ring + rw [← he] + have hb (b : Driver) : ‖R b‖ ≤ C/6 * |increment s h b|^3 := by + simpa only [R, A₁, A₂, history, increment, Real.norm_eq_abs] using + taylor_second_bound (hsm (history s b)) (hb3 (history s b)) (b s) (b (s+h)) + have hiR := (increment_abs_cube_integrable hW s h).const_mul (C/6) + have hbR := norm_integral_le_of_norm_le hiR (Filter.Eventually.of_forall hb) + rw [Real.norm_eq_abs, integral_const_mul] at hbR + calc + _ ≤ C/6 * (∫ b, |increment s h b|^3 ∂W) := hbR + _ ≤ C/6 * (2*(h:ℝ)*Real.sqrt h) := by + gcongr + exact increment_abs_cube_le hW s h + _ = _ := by ring + +end SLEExactGauge.BrownianCalculus + + + +noncomputable section +open Set +namespace SLEExactGauge.BrownianCalculus + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma state_taylor_bound {F : E → ℝ} {D : E → E →L[ℝ] ℝ} + (hD : ∀ x, HasFDerivAt F (D x) x) {C : ℝ} (hC : 0 ≤ C) + (hLip : ∀ x y, ‖D x-D y‖ ≤ C*‖x-y‖) (x v : E) : + |F (x+v)-F x-D x v| ≤ C*‖v‖^2 := by + let f : ℝ → ℝ := fun t => F (x+t • v)-t*(D x v) + have hd (t : ℝ) : HasDerivAt f ((D (x+t • v)-D x) v) t := by + have hh := (hD (x+t • v)).comp_hasDerivAt t + (((hasDerivAt_id t).smul_const v).const_add x) + have hk := hh.sub ((hasDerivAt_id t).mul_const (D x v)) + convert! hk using 1 + simp + have hb (t : ℝ) (ht : t ∈ Icc 0 1) : ‖(D (x+t • v)-D x) v‖ ≤ C*‖v‖^2 := by + calc _ ≤ ‖D (x+t • v)-D x‖*‖v‖ := ContinuousLinearMap.le_opNorm _ _ + _ ≤ (C*‖(x+t • v)-x‖)*‖v‖ := + mul_le_mul_of_nonneg_right (hLip _ _) (norm_nonneg _) + _ = C*(t*‖v‖)*‖v‖ := by + rw [add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_nonneg ht.1] + _ = t*(C*‖v‖^2) := by ring + _ ≤ 1*(C*‖v‖^2) := mul_le_mul_of_nonneg_right ht.2 (mul_nonneg hC (sq_nonneg _)) + _ = _ := one_mul _ + have hh := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t (_ : t ∈ Icc (0:ℝ) 1) => (hd t).hasDerivWithinAt) hb + (convex_Icc (0:ℝ) 1) (by simp : (0:ℝ) ∈ Icc 0 1) (by simp : (1:ℝ) ∈ Icc 0 1) + simp only [f, one_smul, zero_smul, add_zero, one_mul, zero_mul, sub_zero, + Real.norm_eq_abs, abs_one, mul_one] at hh + convert! hh using 1 + congr 1 + ring + +lemma state_euler_remainder {F : E → ℝ} {D : E → E →L[ℝ] ℝ} + (hD : ∀ x, HasFDerivAt F (D x) x) {C : ℝ} (hC : 0 ≤ C) + (hLip : ∀ x y, ‖D x-D y‖ ≤ C*‖x-y‖) (x v : E) {M h : ℝ} + (hh : 0 ≤ h) (hv : ‖v‖ ≤ M) : + F (x+h • v)-F x ≤ h*(D x v) + C*M^2*h^2 := by + have hb := (le_abs_self _).trans (state_taylor_bound hD hC hLip x (h • v)) + rw [map_smul, smul_eq_mul, norm_smul, Real.norm_eq_abs, abs_of_nonneg hh] at hb + have hM : 0 ≤ M := (norm_nonneg v).trans hv + have hn : ‖v‖^2 ≤ M^2 := by nlinarith [norm_nonneg v] + have hh' := mul_le_mul_of_nonneg_left hn (mul_nonneg hC (sq_nonneg h)) + nlinarith + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem expected_euler_step {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (F : E → ℝ → ℝ) (D : E → ℝ → E →L[ℝ] ℝ) + (X V : (Iic s → ℝ) → E) + (mF : Measurable (Function.uncurry F)) + (mB1 : Measurable (fun q : E × ℝ => deriv (F q.1) q.2)) + (mB2 : Measurable (fun q : E × ℝ => deriv (deriv (F q.1)) q.2)) + (mX : Measurable X) (mV : Measurable V) + (hD : ∀ x b, HasFDerivAt (fun y => F y b) (D x b) x) + (hsm : ∀ x, ContDiff ℝ 3 (F x)) + {C₀ C₁ C₂ C₃ Cx Ccross M : ℝ} + (hC₃ : 0 ≤ C₃) (hCx : 0 ≤ Cx) (hCcross : 0 ≤ Ccross) + (hF : ∀ x b, |F x b| ≤ C₀) + (hB1 : ∀ x b, |deriv (F x) b| ≤ C₁) + (hB2 : ∀ x b, |deriv (deriv (F x)) b| ≤ C₂) + (hB3 : ∀ x b, |iteratedDeriv 3 (F x) b| ≤ C₃) + (hLipD : ∀ x y b, ‖D x b-D y b‖ ≤ Cx*‖x-y‖) + (hLipB2 : ∀ x y b, |deriv (deriv (F x)) b-deriv (deriv (F y)) b| ≤ Ccross*‖x-y‖) + (hV : ∀ p, ‖V p‖ ≤ M) + (hgen : ∀ p, D (X p) (p ⟨s,by simp⟩) (V p) + + deriv (deriv (F (X p))) (p ⟨s,by simp⟩)/2 ≤ 0) : + (∫ b, F (X (history s b)+(h:ℝ) • V (history s b)) (b (s+h)) - + F (X (history s b)) (b s) ∂W) ≤ + (Cx*M^2+Ccross*M/2)*(h:ℝ)^2 + C₃/3*(h:ℝ)*Real.sqrt h := by + let := hW.isGaussianProcess.isProbabilityMeasure + let Y := fun p => X p+(h:ℝ) • V p + have mY : Measurable Y := mX.add (mV.const_smul (h:ℝ)) + let f := fun p v => F (Y p) v + let old := fun b : Driver => F (X (history s b)) (b s) + let step := fun b : Driver => F (Y (history s b)) (b s) + let next := fun b : Driver => F (Y (history s b)) (b (s+h)) + have mOld : Measurable old := mF.comp ((mX.comp (measurable_history s)).prodMk + ((continuous_eval_const s).measurable)) + have mStep : Measurable step := mF.comp ((mY.comp (measurable_history s)).prodMk + ((continuous_eval_const s).measurable)) + have mNext : Measurable next := mF.comp ((mY.comp (measurable_history s)).prodMk + ((continuous_eval_const (s+h)).measurable)) + have iOld : Integrable old W := (integrable_const C₀).mono' mOld.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hF _ _) + have iStep : Integrable step W := (integrable_const C₀).mono' mStep.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hF _ _) + have iNext : Integrable next W := (integrable_const C₀).mono' mNext.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hF _ _) + let Q := fun b : Driver => deriv (deriv (F (Y (history s b)))) (b s) + have mQ : Measurable Q := mB2.comp ((mY.comp (measurable_history s)).prodMk + ((continuous_eval_const s).measurable)) + have iQ : Integrable Q W := (integrable_const C₂).mono' mQ.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hB2 _ _) + have hm1 : Measurable (fun p => deriv (f p) (p ⟨s,by simp⟩)) := + mB1.comp (mY.prodMk (measurable_pi_apply _)) + have hm2 : Measurable (fun p => deriv (deriv (f p)) (p ⟨s,by simp⟩)) := + mB2.comp (mY.prodMk (measurable_pi_apply _)) + have ht := expected_taylor_step hW s h f (fun p => hsm (Y p)) hm1 hm2 hC₃ + (fun p => hB1 _ _) (fun p => hB2 _ _) (fun p v => hB3 _ _) (iNext.sub iStep) + change |(∫ b, next b-step b ∂W)-(h:ℝ)/2*(∫ b, Q b ∂W)| ≤ _ at ht + have hp (b : Driver) : step b-old b+(h:ℝ)/2*Q b ≤ + (Cx*M^2+Ccross*M/2)*(h:ℝ)^2 := by + let p := history s b + have hs : p ⟨s,by simp⟩ = b s := rfl + have hy : ‖Y p-X p‖ ≤ (h:ℝ)*M := by + simp only [Y, add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_nonneg h.coe_nonneg] + exact mul_le_mul_of_nonneg_left (hV p) h.coe_nonneg + have hd := state_euler_remainder (fun x => hD x (b s)) hCx + (fun x y => hLipD x y (b s)) (X p) (V p) h.coe_nonneg (hV p) + have hb := (le_abs_self _).trans (hLipB2 (Y p) (X p) (b s)) + have hcross := hb.trans (mul_le_mul_of_nonneg_left hy hCcross) + have hg := hgen p + rw [hs] at hg + have hg' := mul_nonpos_of_nonneg_of_nonpos h.coe_nonneg hg + have hc' := mul_le_mul_of_nonneg_left hcross (div_nonneg h.coe_nonneg (by norm_num : (0:ℝ) ≤ 2)) + dsimp only [step, old, Q] + change F (Y p) (b s)-F (X p) (b s)+(h:ℝ)/2*deriv (deriv (F (Y p))) (b s) ≤ _ + dsimp only [Y] at hd ⊢ + nlinarith + have hib : (∫ b, step b-old b+(h:ℝ)/2*Q b ∂W) ≤ + (Cx*M^2+Ccross*M/2)*(h:ℝ)^2 := by + have hh := integral_mono_ae ((iStep.sub iOld).add (iQ.const_mul ((h:ℝ)/2))) + (integrable_const ((Cx*M^2+Ccross*M/2)*(h:ℝ)^2)) (Filter.Eventually.of_forall hp) + simpa only [integral_const, Measure.real, measure_univ, ENNReal.toReal_one, one_smul, Pi.add_apply, Pi.sub_apply] using hh + change (∫ b, (step-old) b+((h:ℝ)/2*Q b) ∂W) ≤ _ at hib + rw [integral_add (iStep.sub iOld) (iQ.const_mul ((h:ℝ)/2)), integral_const_mul] at hib + change (∫ b, step b-old b ∂W)+(h:ℝ)/2*(∫ b, Q b ∂W) ≤ _ at hib + rw [integral_sub iStep iOld] at hib + rw [integral_sub iNext iStep] at ht + change (∫ b, next b-old b ∂W) ≤ _ + rw [integral_sub iNext iOld] + linarith [le_abs_self ((∫ b, next b ∂W)-(∫ b, step b ∂W)-(h:ℝ)/2*(∫ b, Q b ∂W))] + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +structure SmoothTest (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] where + F : E → ℝ → ℝ + D : E → ℝ → E →L[ℝ] ℝ + C₀ : ℝ + C₁ : ℝ + C₂ : ℝ + C₃ : ℝ + Cx : ℝ + Ccross : ℝ + hC₃ : 0 ≤ C₃ + hCx : 0 ≤ Cx + hCcross : 0 ≤ Ccross + cF : Continuous (Function.uncurry F) + mF : Measurable (Function.uncurry F) + mB1 : Measurable (fun q : E × ℝ => deriv (F q.1) q.2) + mB2 : Measurable (fun q : E × ℝ => deriv (deriv (F q.1)) q.2) + hD : ∀ x b, HasFDerivAt (fun y => F y b) (D x b) x + hsm : ∀ x, ContDiff ℝ 3 (F x) + hF : ∀ x b, |F x b| ≤ C₀ + hB1 : ∀ x b, |deriv (F x) b| ≤ C₁ + hB2 : ∀ x b, |deriv (deriv (F x)) b| ≤ C₂ + hB3 : ∀ x b, |iteratedDeriv 3 (F x) b| ≤ C₃ + hLipD : ∀ x y b, ‖D x b-D y b‖ ≤ Cx*‖x-y‖ + hLipB2 : ∀ x y b, |deriv (deriv (F x)) b-deriv (deriv (F y)) b| ≤ Ccross*‖x-y‖ + +def extendHistory (s : ℝ≥0) (p : Iic s → ℝ) (t : ℝ≥0) : ℝ := + if ht : t ≤ s then p ⟨t,ht⟩ else 0 + +lemma measurable_extendHistory (s : ℝ≥0) : Measurable (extendHistory s) := by + apply Measurable.of_eval + intro t + by_cases ht : t ≤ s + · simpa only [extendHistory, dite_eq_left ht] using (measurable_pi_apply (⟨t,ht⟩ : Iic s)) + · simp only [extendHistory, dite_eq_right ht] + exact measurable_const + + +def stochasticNodes (v : E → ℝ → E) (h : ℝ≥0) (x : E) : ℕ → (ℝ≥0 → ℝ) → E + | 0, _ => x + | k+1, b => stochasticNodes v h x k b + (h:ℝ) • + v (stochasticNodes v h x k b) (b ((k:ℝ≥0)*h)) + +lemma measurable_stochasticNodes (v : E → ℝ → E) + (hv : Measurable (Function.uncurry v)) (h : ℝ≥0) (x : E) (k : ℕ) : + Measurable (stochasticNodes v h x k) := by + induction k with + | zero => exact measurable_const + | succ k ih => exact ih.add ((hv.comp (ih.prodMk (measurable_pi_apply _))).const_smul (h:ℝ)) + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma stochasticNodes_congr (v : E → ℝ → E) (h : ℝ≥0) (x : E) (k : ℕ) + {b c : ℝ≥0 → ℝ} (he : ∀ t ≤ (k:ℝ≥0)*h, b t = c t) : + stochasticNodes v h x k b = stochasticNodes v h x k c := by + induction k with + | zero => rfl + | succ k ih => + have hle : (k:ℝ≥0)*h ≤ ((k+1:ℕ):ℝ≥0)*h := + mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.le_succ k) h.coe_nonneg + have hn := ih (fun t ht => he t (ht.trans hle)) + simp only [stochasticNodes, hn, he _ hle] + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma stochasticNodes_history (v : E → ℝ → E) (h : ℝ≥0) (x : E) (k : ℕ) + (b : Driver) : + stochasticNodes v h x k (extendHistory ((k:ℝ≥0)*h) (history ((k:ℝ≥0)*h) b)) = + stochasticNodes v h x k b := by + apply stochasticNodes_congr + intro t ht + simp only [extendHistory, dite_eq_left ht, history] + +end SLEExactGauge.BrownianCalculus +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/BrownianRestart.lean b/lean/OAI/Probability/SLEGauge/BrownianRestart.lean new file mode 100644 index 0000000000000000000000000000000000000000..11afb3edf92f48656ac400dc90d1450880e9ddeb --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/BrownianRestart.lean @@ -0,0 +1,394 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.BrownianShifts + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.StoppingRounding + +def round (n : ℕ) (t : ℝ≥0) : ℝ≥0 := (⌈((n+1:ℕ):ℝ≥0)*t⌉₊ : ℝ≥0)/(n+1:ℕ) + +theorem le_round (n : ℕ) (t : ℝ≥0) : t≤round n t := by + have hd : (0:ℝ≥0)<(n+1:ℕ) := by positivity + rw [round,le_div_iff₀ hd] + simpa only [mul_comm] using Nat.le_ceil (((n+1:ℕ):ℝ≥0)*t) + +theorem round_le (n : ℕ) (t : ℝ≥0) : round n t≤t+((n+1:ℕ):ℝ≥0)⁻¹ := by + have hd : (0:ℝ≥0)<(n+1:ℕ) := by positivity + rw [round,div_le_iff₀ hd,add_mul,inv_mul_cancel₀ hd.ne'] + exact (Nat.ceil_lt_add_one (bot_le (a:=((n+1:ℕ):ℝ≥0)*t))).le.trans_eq (by rw [mul_comm]) + +theorem round_le_iff (n : ℕ) (s t : ℝ≥0) : + round n s≤t ↔ s≤(⌊((n+1:ℕ):ℝ≥0)*t⌋₊ : ℝ≥0)/(n+1:ℕ) := by + have hd : (0:ℝ≥0)<(n+1:ℕ) := by positivity + rw [round,div_le_iff₀ hd,←Nat.le_floor_iff (bot_le (a:=t*((n+1:ℕ):ℝ≥0))), + Nat.ceil_le,le_div_iff₀ hd] + simp only [mul_comm] + +theorem floor_time_le (n : ℕ) (t : ℝ≥0) : + (⌊((n+1:ℕ):ℝ≥0)*t⌋₊ : ℝ≥0)/(n+1:ℕ)≤t := by + have hd : (0:ℝ≥0)<(n+1:ℕ) := by positivity + rw [div_le_iff₀ hd] + simpa only [mul_comm] using Nat.floor_le (bot_le (a:=((n+1:ℕ):ℝ≥0)*t)) + +theorem countable_range (n : ℕ) : (Set.range (round n)).Countable := by + apply (Set.countable_range (fun k : ℕ => (k:ℝ≥0)/(n+1:ℕ))).mono + rintro _ ⟨t,rfl⟩ + exact ⟨_,rfl⟩ + +theorem tendsto_round (t : ℝ≥0) : Tendsto (fun n => round n t) atTop (𝓝 t) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds _ + (fun n => le_round n t) (fun n => round_le n t) + have ht : Tendsto (fun n : ℕ => ((n+1:ℕ):ℝ≥0)⁻¹) atTop (𝓝 0) := by + have h := tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop (R:=ℝ≥0) |>.comp + (tendsto_add_atTop_nat 1)) + exact h + simpa only [add_zero] using tendsto_const_nhds.add ht + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] {ℱ : Filtration ℝ≥0 mΩ} + {S : Ω→ℝ≥0} + +theorem isStoppingTime (hS : IsStoppingTime ℱ (fun ω => (S ω : WithTop ℝ≥0))) (n : ℕ) : + IsStoppingTime ℱ (fun ω => (round n (S ω) : WithTop ℝ≥0)) := by + intro t + have h := hS ((⌊((n+1:ℕ):ℝ≥0)*t⌋₊ : ℝ≥0)/(n+1:ℕ)) + have he : {ω | (round n (S ω) : WithTop ℝ≥0)≤t} = + {ω | (S ω : WithTop ℝ≥0)≤((⌊((n+1:ℕ):ℝ≥0)*t⌋₊ : ℝ≥0)/(n+1:ℕ) : ℝ≥0)} := by + ext ω + exact (WithTop.coe_le_coe.trans (round_le_iff n (S ω) t)).trans WithTop.coe_le_coe.symm + rw [he] + exact ℱ.mono (floor_time_le n t) _ h + +end SLEExactGauge.StoppingRounding +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology Function +open scoped NNReal ENNReal ContinuousMapZero BoundedContinuousFunction +namespace SLEExactGauge.BrownianRestart + +def filtration : Filtration ℝ≥0 instMeasurableSpaceDriver := + Filtration.natural (fun t (b : Driver) => b t) + (fun t => (continuous_eval_const t).stronglyMeasurable) + +lemma continuous_shift_joint : Continuous (fun p : ℝ≥0×Driver => shift p.1 p.2) := by + apply ContinuousMapZero.isEmbedding_toContinuousMap.continuous_iff.mpr + apply ContinuousMap.continuous_of_continuous_uncurry + change Continuous (fun p : (ℝ≥0×Driver)×ℝ≥0 => p.1.2 (p.1.1+p.2)-p.1.2 p.1.1) + exact (continuous_eval.comp ((continuous_snd.comp continuous_fst).prodMk + ((continuous_fst.comp continuous_fst).add continuous_snd))).sub + (continuous_eval.comp ((continuous_snd.comp continuous_fst).prodMk + (continuous_fst.comp continuous_fst))) + +lemma indep_filtration_shift {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) (t : ℝ≥0) : + Indep (filtration t) (MeasurableSpace.comap (shift t) inferInstance) W := by + rw [filtration, Filtration.natural_eq_comap] + change IndepFun (fun b : Driver => fun s : Iic t => b s) (shift t) W + exact (indep_shift_history hW t).symm + +lemma integral_shift {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) (t : ℝ≥0) (f : Driver →ᵇ ℝ) : + (∫b,f (shift t b)∂W)=∫b,f b∂W := by + rw [← integral_map (measurable_shift t).aemeasurable f.continuous.aestronglyMeasurable, + shift_preserves_law hW t] + +lemma setIntegral_shift {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) (t : ℝ≥0) + {A : Set Driver} (hA : MeasurableSet[filtration t] A) (f : Driver →ᵇ ℝ) : + (∫b in A,f (shift t b)∂W)=∫_b in A,(∫b,f b∂W)∂W := by + rw [(indep_filtration_shift hW t).setIntegral_eq_mul (filtration.le t) + (measurable_shift t).aemeasurable hA f.continuous.aestronglyMeasurable, + integral_shift hW t f] + simp only [integral_const,measureReal_restrict_apply_univ,smul_eq_mul] + +lemma measurable_finite_stop {T : Driver→ℝ≥0} + (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) : Measurable T := by + apply measurable_of_Iic + intro t + convert filtration.le t _ (hT t) using 1 + ext b + change T b ≤ t ↔ (T b : WithTop ℝ≥0) ≤ (t : WithTop ℝ≥0) + exact WithTop.coe_le_coe.symm + +lemma measurable_shift_finite_stop {T : Driver→ℝ≥0} + (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) : + Measurable (fun b => shift (T b) b) := + continuous_shift_joint.measurable.comp ((measurable_finite_stop hT).prodMk measurable_id) + +lemma integrable_bcf_comp {W : Measure Driver} [IsFiniteMeasure W] + (f : Driver →ᵇ ℝ) {Y : Driver→Driver} (hY : Measurable Y) : + Integrable (fun b => f (Y b)) W := by + apply Integrable.mono' (integrable_const ‖f‖) + (f.continuous.measurable.comp hY).aestronglyMeasurable + exact Eventually.of_forall (fun b => f.norm_coe_le_norm (Y b)) + + +theorem setIntegral_shift_countable {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {T : Driver→ℝ≥0} (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) + (hc : (Set.range T).Countable) {A : Set Driver} + (hA : MeasurableSet[hT.measurableSpace] A) (f : Driver →ᵇ ℝ) : + (∫b in A,f (shift (T b) b)∂W)=∫_b in A,(∫b,f b∂W)∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + let : Countable (Set.range T) := hc.to_subtype + let U : Set.range T→Set Driver := fun t => A∩{b | T b=t.1} + have hm (t : Set.range T) : MeasurableSet[filtration t.1] (U t) := by + have h := hA.inter (hT.measurableSet_eq' t.1) + have h' := (hT.measurableSet_inter_eq_iff A t.1).mp h + simpa only [U,WithTop.coe_eq_coe] using h' + have hm' (t : Set.range T) : MeasurableSet (U t) := filtration.le t.1 _ (hm t) + have hd : Pairwise (Disjoint on U) := by + intro t u htu + apply disjoint_left.mpr + intro b hb hc + exact htu (Subtype.ext (hb.2.symm.trans hc.2)) + have hU : (⋃t,U t)=A := by + ext b + simp only [mem_iUnion,U,mem_inter_iff,mem_ofPred_eq] + constructor + · rintro ⟨t,h,_⟩; exact h + · intro hb; exact ⟨⟨T b,mem_range_self b⟩,hb,rfl⟩ + have hi := integrable_bcf_comp f (measurable_shift_finite_stop hT) (W:=W) + calc + (∫b in A,f (shift (T b) b)∂W) = ∑'t,∫b in U t,f (shift (T b) b)∂W := by + rw [←hU, integral_iUnion hm' hd hi.integrableOn] + _ = ∑'t,∫_b in U t,(∫b,f b∂W)∂W := by + apply tsum_congr + intro t + rw [setIntegral_congr_fun (hm' t) (fun b hb => by rw [hb.2])] + exact setIntegral_shift hW t.1 (hm t) f + _ = ∫_b in A,(∫b,f b∂W)∂W := by + rw [←hU,integral_iUnion hm' hd (integrable_const _).integrableOn] + + + +theorem setIntegral_shift_finite {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {T : Driver→ℝ≥0} (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) + {A : Set Driver} (hA : MeasurableSet[hT.measurableSpace] A) (f : Driver →ᵇ ℝ) : + (∫b in A,f (shift (T b) b)∂W)=∫_b in A,(∫b,f b∂W)∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + let Tn := fun n b => StoppingRounding.round n (T b) + have hn (n : ℕ) : IsStoppingTime filtration (fun b => (Tn n b : WithTop ℝ≥0)) := + StoppingRounding.isStoppingTime hT n + have hAn (n : ℕ) : MeasurableSet[(hn n).measurableSpace] A := + (hT.measurableSpace_mono (hn n) (fun b => WithTop.coe_le_coe.mpr + (StoppingRounding.le_round n (T b)))) _ hA + have he (n : ℕ) : (∫b in A,f (shift (Tn n b) b)∂W)=∫_b in A,(∫b,f b∂W)∂W := by + apply setIntegral_shift_countable hW (hn n) _ (hAn n) f + exact (StoppingRounding.countable_range n).mono (Set.range_comp_subset_range T (StoppingRounding.round n)) + have ht : Tendsto (fun n => ∫b in A,f (shift (Tn n b) b)∂W) atTop + (𝓝 (∫b in A,f (shift (T b) b)∂W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => ‖f‖) + (fun n => (f.continuous.measurable.comp (measurable_shift_finite_stop (hn n))).aestronglyMeasurable) + (integrable_const _) (fun n => Eventually.of_forall (fun b => f.norm_coe_le_norm _)) + apply Eventually.of_forall + intro b + exact f.continuous.continuousAt.tendsto.comp + (continuous_shift_joint.continuousAt.tendsto.comp + ((StoppingRounding.tendsto_round (T b)).prodMk_nhds tendsto_const_nhds)) + simp only [he] at ht + exact (tendsto_nhds_unique tendsto_const_nhds ht).symm + + +theorem map_shift_finite {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {T : Driver→ℝ≥0} (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) : + W.map (fun b => shift (T b) b)=W := by + let := hW.isGaussianProcess.isProbabilityMeasure + apply ext_of_forall_integral_eq_of_IsFiniteMeasure + intro f + rw [integral_map (measurable_shift_finite_stop hT).aemeasurable + f.continuous.aestronglyMeasurable] + simpa using setIntegral_shift_finite hW hT MeasurableSet.univ f + + +theorem indep_shift_finite {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {T : Driver→ℝ≥0} (hT : IsStoppingTime filtration (fun b => (T b : WithTop ℝ≥0))) : + Indep hT.measurableSpace (MeasurableSpace.comap (fun b => shift (T b) b) inferInstance) W := by + let := hW.isGaussianProcess.isProbabilityMeasure + apply indep_comap_of_bcf hT.measurableSpace_le (measurable_shift_finite_stop hT).aemeasurable + intro A hA f + rw [setIntegral_shift_finite hW hT hA f] + rw [←integral_map (measurable_shift_finite_stop hT).aemeasurable + f.continuous.aestronglyMeasurable,map_shift_finite hW hT] + simp only [integral_const,measureReal_restrict_apply_univ,smul_eq_mul] + +end SLEExactGauge.BrownianRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology Function +open scoped NNReal ENNReal ContinuousMapZero BoundedContinuousFunction +namespace SLEExactGauge.BrownianRestart + + + +def shiftAt (S : Driver → ℝ≥0∞) (b : Driver) := shift (S b).toNNReal b + +def truncateStop (S : Driver → ℝ≥0∞) (t : ℝ≥0) (b : Driver) : ℝ≥0 := + (min (S b) (t : ℝ≥0∞)).toNNReal + +lemma coe_truncateStop (S : Driver → ℝ≥0∞) (t : ℝ≥0) : + (fun b => (truncateStop S t b : WithTop ℝ≥0)) = fun b => min (S b) (t : WithTop ℝ≥0) := by + funext b + simp only [truncateStop, ENNReal.some_eq_coe'] + exact ENNReal.coe_toNNReal (ne_top_of_le_ne_top ENNReal.coe_ne_top (min_le_right _ _)) + +lemma isStoppingTime_truncateStop {S : Driver → ℝ≥0∞} + (hS : IsStoppingTime filtration S) (t : ℝ≥0) : + IsStoppingTime filtration (fun b => (truncateStop S t b : WithTop ℝ≥0)) := by + rw [coe_truncateStop] + exact hS.min_const t + +lemma measurable_shiftAt {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) : + Measurable (shiftAt S) := by + exact continuous_shift_joint.measurable.comp + ((ENNReal.measurable_toNNReal.comp hS.measurable').prodMk measurable_id) + +lemma finiteStop_iUnion_le (S : Driver → ℝ≥0∞) : + (⋃ n : ℕ, {b | S b ≤ (n : ℝ≥0∞)}) = {b | S b ≠ ∞} := by + ext b + simp only [mem_iUnion, mem_ofPred_eq] + constructor + · rintro ⟨n,hn⟩ + exact ne_top_of_le_ne_top (by simp) hn + · intro hb + exact (ENNReal.exists_nat_gt hb).imp (fun _ h => h.le) + +lemma setIntegral_shiftAt_le {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) + {A : Set Driver} (hA : MeasurableSet[hS.measurableSpace] A) + (t : ℝ≥0) (f : Driver →ᵇ ℝ) : + (∫b in A ∩ {b | S b ≤ (t : ℝ≥0∞)}, f (shiftAt S b) ∂W) = + ∫_b in A ∩ {b | S b ≤ (t : ℝ≥0∞)}, (∫b, f b ∂W) ∂W := by + have he := coe_truncateStop S t + have hA' : MeasurableSet[(isStoppingTime_truncateStop hS t).measurableSpace] + (A ∩ {b | S b ≤ (t : ℝ≥0∞)}) := by + have hspace : (isStoppingTime_truncateStop hS t).measurableSpace = + (hS.min_const t).measurableSpace := by + congr 1 + rw [hspace] + convert (hS.measurableSet_inter_le_const_iff A t).mp + (hA.inter (hS.measurableSet_le' t)) using 1 + simp only [ENNReal.some_eq_coe'] + rfl + have h := setIntegral_shift_finite hW (isStoppingTime_truncateStop hS t) hA' f + rw [←h] + apply setIntegral_congr_fun + · exact hS.measurableSpace_le _ (hA.inter (measurableSet_le (show Measurable[hS.measurableSpace] S from hS.measurable) measurable_const)) + · intro b hb + simp only [shiftAt, truncateStop, min_eq_left (show S b ≤ (t : ℝ≥0∞) from hb.2)] + + + +theorem setIntegral_shiftAt_finite {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) + {A : Set Driver} (hA : MeasurableSet[hS.measurableSpace] A) (f : Driver →ᵇ ℝ) : + (∫b in A ∩ {b | S b ≠ ∞}, f (shiftAt S b) ∂W) = + ∫_b in A ∩ {b | S b ≠ ∞}, (∫b, f b ∂W) ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + let U : ℕ → Set Driver := fun n => A ∩ {b | S b ≤ (n : ℝ≥0∞)} + have hmeas n : MeasurableSet (U n) := + (hS.measurableSpace_le _ hA).inter (measurableSet_le (show Measurable S from hS.measurable') measurable_const) + have hmono : Monotone U := by + intro n m hnm b hb + exact ⟨hb.1, (show S b ≤ (n : ℝ≥0∞) from hb.2).trans (Nat.cast_le.mpr hnm)⟩ + have hU : (⋃ n, U n) = A ∩ {b | S b ≠ ∞} := by + simp only [U, ←inter_iUnion, finiteStop_iUnion_le] + have h₁ := tendsto_setIntegral_of_monotone hmeas hmono + (integrable_bcf_comp f (measurable_shiftAt hS) (W:=W)).integrableOn + have h₂ := tendsto_setIntegral_of_monotone hmeas hmono + (integrable_const (∫b, f b ∂W) (μ:=W)).integrableOn + have he (n : ℕ) : (∫b in U n, f (shiftAt S b) ∂W) = + ∫_b in U n, (∫b, f b ∂W) ∂W := by + simpa only [U, ENNReal.coe_natCast] using setIntegral_shiftAt_le hW hS hA (n:ℝ≥0) f + simp only [hU, he] at h₁ h₂ + exact tendsto_nhds_unique h₁ h₂ + + + +theorem map_shiftAt_restrict {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) + {A : Set Driver} (hA : MeasurableSet[hS.measurableSpace] A) : + (W.restrict (A ∩ {b | S b ≠ ∞})).map (shiftAt S) = + W (A ∩ {b | S b ≠ ∞}) • W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have : IsFiniteMeasure (W (A ∩ {b | S b ≠ ∞}) • W) := + W.smul_finite (measure_ne_top W _) + apply ext_of_forall_integral_eq_of_IsFiniteMeasure + intro f + rw [integral_map (measurable_shiftAt hS).aemeasurable f.continuous.aestronglyMeasurable, + setIntegral_shiftAt_finite hW hS hA f, integral_smul_measure] + simp only [integral_const, measureReal_def, Measure.restrict_apply_univ] + + + +theorem map_data_shiftAt {X : Type*} [MeasurableSpace X] {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) + {D : Driver → X} (hD : Measurable[hS.measurableSpace] D) : + (W.restrict {b | S b ≠ ∞}).map (fun b => (D b,shiftAt S b)) = + ((W.restrict {b | S b ≠ ∞}).map D).prod W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + have hY := measurable_shiftAt hS + apply Measure.ext_prod + intro A B hA hB + rw [Measure.map_apply (hD'.prodMk hY) (hA.prod hB), Measure.prod_prod, + Measure.map_apply hD' hA, Measure.restrict_apply (hD' hA)] + have he := congrArg (fun μ : Measure Driver => μ B) + (map_shiftAt_restrict hW hS (hD hA)) + rw [Measure.map_apply hY hB, Measure.restrict_apply (hY hB), Measure.smul_apply, + smul_eq_mul] at he + rw [Measure.restrict_apply ((hD'.prodMk hY) (hA.prod hB))] + convert he using 1 + congr 1 + ext b + simp only [mem_inter_iff, mem_preimage, mem_prod, mem_ofPred_eq] + tauto + + + +theorem lintegral_data_shiftAt {X : Type*} [MeasurableSpace X] {W : Measure Driver} + (hW : IsBrownianReal (fun t (b : Driver) => b t) W) + {S : Driver → ℝ≥0∞} (hS : IsStoppingTime filtration S) + {D : Driver → X} (hD : Measurable[hS.measurableSpace] D) + {F : X × Driver → ℝ≥0∞} (hF : Measurable F) : + (∫⁻b in {b | S b ≠ ∞}, F (D b,shiftAt S b) ∂W) = + ∫⁻b in {b | S b ≠ ∞}, ∫⁻c, F (D b,c) ∂W ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + rw [←lintegral_map hF (hD'.prodMk (measurable_shiftAt hS)),map_data_shiftAt hW hS hD, + lintegral_prod _ hF.aemeasurable, lintegral_map hF.lintegral_prod_right' hD'] + +end SLEExactGauge.BrownianRestart +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/BrownianShifts.lean b/lean/OAI/Probability/SLEGauge/BrownianShifts.lean new file mode 100644 index 0000000000000000000000000000000000000000..69f90b767fcea9f705a4b9a85c6be55a3823d420 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/BrownianShifts.lean @@ -0,0 +1,481 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ReverseGenerators +import OAI.Probability.SLEGauge.ReverseMoments + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero +noncomputable section +namespace SLEExactGauge.BrownianRestart +def shift (t : ℝ≥0) (b : Driver) : Driver := + ⟨⟨fun s => b (t+s)-b t, (map_continuous b).comp (continuous_const.add continuous_id) |>.sub continuous_const⟩, + by simp⟩ + +@[simp] lemma shift_apply (t : ℝ≥0) (b : Driver) (s : ℝ≥0) : + shift t b s = b (t+s)-b t := rfl + +lemma measurable_shift (t : ℝ≥0) : Measurable (shift t) := by + apply code_embedding.measurable_comp_iff.mp + exact Measurable.of_eval fun _ => + (continuous_eval_const _).measurable.sub (continuous_eval_const _).measurable + +lemma indep_shift_history {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) : + IndepFun (shift t) (fun b : Driver => fun s : Iic t => b s) W := by + have hi := (hW.toIsPreBrownianReal.indepFun_shift t).comp + (Measurable.of_eval (f := fun path : ℝ≥0 → ℝ => fun time : ℚ => path (Real.toNNReal (time:ℝ))) + (fun _ => measurable_pi_apply _)) measurable_id + have he : MeasurableSpace.comap (code ∘ shift t) inferInstance = + MeasurableSpace.comap (shift t) inferInstance := by + rw [← MeasurableSpace.comap_comp,code_embedding.comap_eq] + change Indep (MeasurableSpace.comap (code ∘ shift t) inferInstance) + (MeasurableSpace.comap (fun b : Driver => fun s : Iic t => b s) inferInstance) W at hi + rw [he] at hi + exact hi + +lemma evaluation_law_unique {W V : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) + (hV : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) V) : W = V := by + let ev : Driver → (ℝ≥0 → ℝ) := fun b => b + have mev : Measurable ev := Measurable.of_eval fun time => (continuous_eval_const time).measurable + have hw : IsProjectiveLimit (W.map ev) BrownianReal.projectiveFamily := by + intro I + rw [Measure.map_map I.measurable_restrict mev] + exact (hW.hasLaw I).map_eq + have hv : IsProjectiveLimit (V.map ev) BrownianReal.projectiveFamily := by + intro I + rw [Measure.map_map I.measurable_restrict mev] + exact (hV.hasLaw I).map_eq + have he := hw.unique hv + have mr : Measurable (fun f : ℝ≥0 → ℝ => fun q : ℚ => f (Real.toNNReal (q:ℝ))) := + Measurable.of_eval fun _ => measurable_pi_apply _ + have hc := congrArg (Measure.map (fun f : ℝ≥0 → ℝ => fun q : ℚ => f (Real.toNNReal (q:ℝ)))) he + rw [Measure.map_map mr mev, Measure.map_map mr mev] at hc + exact code_embedding.map_injective hc + +lemma brownian_shift_map {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) : + IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) (W.map (shift t)) where + hasLaw I := by + refine ⟨(Measurable.of_eval fun _ => (continuous_eval_const _).measurable).aemeasurable, ?_⟩ + have mm : Measurable (fun b : Driver => I.restrict (fun s => b s)) := + Measurable.of_eval fun time => (continuous_eval_const (time:ℝ≥0)).measurable + rw [Measure.map_map mm (measurable_shift t)] + exact ((hW.shift t).hasLaw I).map_eq + cont := Filter.Eventually.of_forall fun b => map_continuous b + +lemma shift_preserves_law {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) : + W.map (shift t) = W := evaluation_law_unique (brownian_shift_map hW t) hW + +end SLEExactGauge.BrownianRestart + +namespace SLEExactGauge.BrownianRestart + + +def past (t : ℝ≥0) (b : Driver) : Driver := + ⟨⟨fun s => b (min t s), (map_continuous b).comp (continuous_const.min continuous_id)⟩, + by simp⟩ + +@[simp] lemma prefix_apply (t : ℝ≥0) (b : Driver) (s : ℝ≥0) : + past t b s = b (min t s) := rfl + +lemma measurable_prefix (t : ℝ≥0) : Measurable (past t) := by + apply code_embedding.measurable_comp_iff.mp + exact Measurable.of_eval fun _ => (continuous_eval_const _).measurable + + +def join (t : ℝ≥0) (b c : Driver) : Driver where + toFun s := if s ≤ t then b s else b t + c (s-t) + continuous_toFun := by + apply Continuous.if_le (map_continuous b) + (continuous_const.add ((map_continuous c).comp (continuous_id.sub continuous_const))) + continuous_id continuous_const + intro s hs + change s = t at hs + subst s + simp + map_zero' := by simp + +@[simp] lemma join_apply (t : ℝ≥0) (b c : Driver) (s : ℝ≥0) : + join t b c s = if s ≤ t then b s else b t + c (s-t) := rfl + +lemma measurable_join (t : ℝ≥0) : Measurable (fun q : Driver × Driver => join t q.1 q.2) := by + apply code_embedding.measurable_comp_iff.mp + apply Measurable.of_eval + intro q + change Measurable (fun v : Driver × Driver => if Real.toNNReal (q:ℝ) ≤ t then + v.1 (Real.toNNReal (q:ℝ)) else v.1 t + v.2 (Real.toNNReal (q:ℝ)-t)) + split_ifs + · exact (continuous_eval_const _).measurable.comp measurable_fst + · exact ((continuous_eval_const _).measurable.comp measurable_fst).add + ((continuous_eval_const _).measurable.comp measurable_snd) + +lemma join_prefix (t : ℝ≥0) (b c : Driver) : join t (past t b) c = join t b c := by + ext s + simp only [join_apply,prefix_apply,min_self] + split_ifs with hs + · rw [min_eq_right hs] + · rfl + +lemma join_reconstruct (t : ℝ≥0) (b : Driver) : join t (past t b) (shift t b) = b := by + rw [join_prefix] + ext s + simp only [join_apply,shift_apply] + split_ifs with hs + · rfl + · rw [add_tsub_cancel_of_le (le_of_not_ge hs)] + ring + +lemma indep_shift_prefix {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) : + IndepFun (shift t) (past t) W := by + have hi := (indep_shift_history hW t).comp measurable_id + (Measurable.of_eval (f := fun path : Iic t → ℝ => + fun time : ℚ => path ⟨min t (Real.toNNReal (time:ℝ)),by simpa only [Set.mem_Iic] using (min_le_left t (Real.toNNReal (time:ℝ)))⟩) + (fun q : ℚ => measurable_pi_apply (⟨min t (Real.toNNReal (q:ℝ)),by simpa only [Set.mem_Iic] using (min_le_left t (Real.toNNReal (q:ℝ)))⟩ : Iic t))) + have he : MeasurableSpace.comap (code ∘ past t) inferInstance = + MeasurableSpace.comap (past t) inferInstance := by + rw [← MeasurableSpace.comap_comp,code_embedding.comap_eq] + change Indep (MeasurableSpace.comap (shift t) inferInstance) + (MeasurableSpace.comap (code ∘ past t) inferInstance) W at hi + rw [he] at hi + exact hi + + + +lemma split_map {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) : + W.map (fun b => (past t b,shift t b)) = (W.map (past t)).prod W := by + let := hW.isGaussianProcess.isProbabilityMeasure + rw [(indep_shift_prefix hW t).symm.map_prod_eq_prod_map_map + (measurable_prefix t).aemeasurable (measurable_shift t).aemeasurable, + shift_preserves_law hW t] + +lemma lintegral_split {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) + {F : Driver × Driver → ℝ≥0∞} (hF : Measurable F) : + (∫⁻ b, F (past t b, shift t b) ∂W) = + ∫⁻ b, ∫⁻ c, F (past t b,c) ∂W ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + rw [← lintegral_map hF ((measurable_prefix t).prodMk (measurable_shift t)),split_map hW t] + rw [lintegral_prod _ hF.aemeasurable] + rw [lintegral_map hF.lintegral_prod_right' (measurable_prefix t)] + + + +theorem conditional_join_kernel {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (t : ℝ≥0) + {F H : Driver → ℝ≥0∞} (hF : Measurable F) (hH : Measurable H) : + (∫⁻ b, H (past t b) * F b ∂W) = + ∫⁻ b, H (past t b) * (∫⁻ c, F (join t b c) ∂W) ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hm := (hH.comp measurable_fst).mul (hF.comp (measurable_join t)) + have he := lintegral_split hW t hm + change (∫⁻ b, H (past t b) * F (join t (past t b) (shift t b)) ∂W) = + ∫⁻ b, ∫⁻ c, H (past t b) * F (join t (past t b) c) ∂W ∂W at he + simp only [join_reconstruct] at he + simp only [join_prefix] at he + rw [he] + apply lintegral_congr + intro b + exact lintegral_const_mul _ ((hF.comp (measurable_join t)).comp + (measurable_const.prodMk measurable_id)) + +end SLEExactGauge.BrownianRestart + +namespace SLEExactGauge.BrownianRestart + + + +def reverse (T : ℝ≥0) (b : Driver) : Driver := + ⟨⟨fun s => b (max T s) - b (T-s), + ((map_continuous b).comp (continuous_const.max continuous_id)).sub + ((map_continuous b).comp (continuous_const.sub continuous_id))⟩, by simp⟩ + +@[simp] lemma reverse_apply (T : ℝ≥0) (b : Driver) (s : ℝ≥0) : + reverse T b s = b (max T s)-b (T-s) := rfl + +lemma measurable_reverse (T : ℝ≥0) : Measurable (reverse T) := by + apply code_embedding.measurable_comp_iff.mp + exact Measurable.of_eval fun _ => + (continuous_eval_const _).measurable.sub (continuous_eval_const _).measurable + +lemma reverse_brownian {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (T : ℝ≥0) : + IsBrownianReal (fun s b => reverse T b s) W := by + have hB := hW.toIsPreBrownianReal + have hG : IsGaussianProcess (fun s b => reverse T b s) W := by + apply hB.isGaussianProcess.of_isGaussianProcess + intro s + exact ⟨{max T s,T-s}, + { toFun x := x ⟨max T s,by simp⟩ - x ⟨T-s,by simp⟩ + map_add' x y := by simp; abel + map_smul' c x := by simp; ring },by simp⟩ + refine ⟨hG.isPreBrownianReal_of_covariance ?_ ?_,?_⟩ + · intro t + simp only [reverse_apply] + rw [integral_sub (hB.integrable_eval _) (hB.integrable_eval _), + hB.integral_eval,hB.integral_eval,sub_self] + · intro s t hst + let := hG.isProbabilityMeasure + simp only [reverse_apply] + rw [covariance_fun_sub_left, covariance_fun_sub_right, covariance_fun_sub_right] + any_goals exact (hB.isGaussianProcess.hasGaussianLaw_eval _).memLp_two + any_goals exact hB.isGaussianProcess.hasGaussianLaw_sub.memLp_two + simp only [hB.covariance_fun_eval] + rw [min_eq_left (max_le_max_left T hst), + min_eq_right ((tsub_le_self).trans (le_max_left T s)), + min_eq_left ((tsub_le_self).trans (le_max_left T t)), + min_eq_right (tsub_le_tsub_left hst T)] + by_cases hs : s ≤ T + · rw [max_eq_left hs,NNReal.coe_sub hs] + ring + · rw [max_eq_right (le_of_not_ge hs),tsub_eq_zero_of_le (le_of_not_ge hs)] + simp + · exact Filter.Eventually.of_forall fun b => map_continuous (reverse T b) + +lemma reverse_preserves_law {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (T : ℝ≥0) : + W.map (reverse T) = W := by + apply evaluation_law_unique _ hW + refine ⟨⟨?_⟩, Filter.Eventually.of_forall fun b => map_continuous b⟩ + intro I + refine ⟨(Measurable.of_eval fun _ => (continuous_eval_const _).measurable).aemeasurable,?_⟩ + have mm : Measurable (fun b : Driver => I.restrict (fun s => b s)) := + Measurable.of_eval fun time => (continuous_eval_const (time:ℝ≥0)).measurable + rw [Measure.map_map mm (measurable_reverse T)] + exact ((reverse_brownian hW T).hasLaw I).map_eq + +lemma reverse_before (T s : ℝ≥0) (hs : s ≤ T) (b : Driver) : + reverse T b s = b T - b (T-s) := by simp [max_eq_left hs] + +lemma reverse_after (T s : ℝ≥0) (hs : T ≤ s) (b : Driver) : + reverse T b s = b s := by simp [max_eq_right hs,tsub_eq_zero_of_le hs] + +end SLEExactGauge.BrownianRestart + +namespace SLEExactGauge.BrownianRestart + +def backward (T : ℝ≥0) (b : Driver) : Driver := -reverse T b + +@[simp] lemma backward_apply (T : ℝ≥0) (b : Driver) (s : ℝ≥0) : + backward T b s = -(b (max T s)-b (T-s)) := rfl + +lemma measurable_backward (T : ℝ≥0) : Measurable (backward T) := by + apply code_embedding.measurable_comp_iff.mp + exact Measurable.of_eval fun _ => + ((continuous_eval_const _).measurable.sub (continuous_eval_const _).measurable).neg + +lemma backward_preserves_law {W : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) (T : ℝ≥0) : + W.map (backward T) = W := by + apply evaluation_law_unique _ hW + refine ⟨⟨?_⟩, Filter.Eventually.of_forall fun b => map_continuous b⟩ + intro I + refine ⟨(Measurable.of_eval fun _ => (continuous_eval_const _).measurable).aemeasurable,?_⟩ + have mm : Measurable (fun b : Driver => I.restrict (fun s => b s)) := + Measurable.of_eval fun time => (continuous_eval_const (time:ℝ≥0)).measurable + rw [Measure.map_map mm (measurable_backward T)] + exact ((reverse_brownian hW T).neg.hasLaw I).map_eq + +lemma backward_before {T s : ℝ} (hs : s ∈ Icc 0 T) (b : Driver) : + backward T.toNNReal b s.toNNReal = b (T-s).toNNReal-b T.toNNReal := by + have hT : 0 ≤ T := hs.1.trans hs.2 + have hst : s.toNNReal ≤ T.toNNReal := Real.toNNReal_mono hs.2 + have hsub : T.toNNReal-s.toNNReal = (T-s).toNNReal := by + apply NNReal.eq + simp only [NNReal.coe_sub hst,Real.coe_toNNReal',max_eq_left hT,max_eq_left hs.1, + max_eq_left (sub_nonneg.mpr hs.2)] + simp only [backward_apply,max_eq_left hst,hsub] + ring +end SLEExactGauge.BrownianRestart + +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative + +def reversedState (κ y T : ℝ) (b : Driver) : ℝ → ReverseDerivative.State := + ReverseDerivative.reverseFlow (a κ) (y/4) (T+y^2) y + (BrownianRestart.backward T.toNNReal b) + +def reversedCurve (κ y T : ℝ) (b : Driver) (s : ℝ) : ℂ := + (reversedState κ y T b s).2.1 + +lemma reverse_reparam_solution {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : PositiveSolution κ b + (reversedCurve κ y T b T+driverValue b T) T + (fun t => reversedCurve κ y T b (T-t)+driverValue b T) := by + let β := BrownianRestart.backward T.toNNReal b + let g := reversedState κ y T b + let G := reversedCurve κ y T b + have hq : 0 < y/4 := by positivity + have ha : 0 ≤ a κ := (div_pos (by norm_num) hκ).le + have hg := ReverseDerivative.reverseFlow_solution hq (a κ) (T+y^2) y β β.continuous hT + have hga := ReverseDerivative.reverseFlow_actual hq ha (by linarith : y/4 ≤ y) + (T+y^2) β β.continuous hT + have hgc : ContinuousOn G (Icc 0 T) := fun t ht => (hg.2 t ht).continuousWithinAt.snd.fst + have hheight (t : ℝ) (ht : t ∈ Icc 0 T) : y ≤ (G t).im := + ReverseDerivative.reverseFlow_height hq ha hy.le (T+y^2) β β.continuous hT t ht + have hrev (t : ℝ) (ht : t ∈ Icc 0 T) : T-t ∈ Icc 0 T := by constructor <;> linarith [ht.1,ht.2] + refine ⟨hT,(hgc.comp (continuous_const.sub continuous_id).continuousOn hrev).add continuousOn_const,?_,?_,?_⟩ + · simp + · intro t ht + simpa using hy.trans_le (hheight (T-t) (hrev t ht)) + · intro t ht + let projG : ReverseDerivative.State →L[ℝ] ℂ := + (ContinuousLinearMap.fst ℝ ℂ ℝ).comp (ContinuousLinearMap.snd ℝ ℝ (ℂ × ℝ)) + have hd := projG.hasFDerivAt.comp_hasDerivWithinAt (T-t) (hga (T-t) (hrev t ht)) + change HasDerivWithinAt G (-(a κ:ℂ)/(G (T-t)-β (T-t).toNNReal)) (Icc 0 T) (T-t) at hd + have hβ : β (T-t).toNNReal = driverValue b t-driverValue b T := by + have hh := BrownianRestart.backward_before (hrev t ht) b + simpa only [sub_sub_cancel,driverValue] using hh + have hden : G (T-t)-(β (T-t).toNNReal:ℂ) = + G (T-t)+(driverValue b T:ℂ)-driverValue b t := by rw [hβ,Complex.ofReal_sub]; ring + rw [hden] at hd + have hh := (hd.scomp t (((hasDerivAt_const t T).sub (hasDerivAt_id t)).hasDerivWithinAt) hrev).add_const + (driverValue b T:ℂ) + convert! hh using 1; first | rfl | (simp only [one_smul,zero_sub,neg_smul,neg_div,neg_neg]; rfl) + +lemma inverseFlow_eq_reversedCurve {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : inverseFlow κ b T (driverValue b T+y*Complex.I) = + reversedCurve κ y T b T+driverValue b T := by + have hf := reverse_reparam_solution hκ hy hT b + have he := hf.flow_eq + have hq : 0 < y/4 := by positivity + have hg := ReverseDerivative.reverseFlow_solution hq (a κ) (T+y^2) y + (BrownianRestart.backward T.toNNReal b) (BrownianRestart.backward T.toNNReal b).continuous hT + have hG0 : reversedCurve κ y T b 0 = (y:ℂ)*Complex.I := by + change (ReverseDerivative.reverseFlow (a κ) (y/4) (T+y^2) y _ 0).2.1 = _ + rw [hg.1] + apply Complex.ext <;> simp [ReverseDerivative.initial] + rw [sub_self,hG0] at he + have he' : flow κ b (reversedCurve κ y T b T+driverValue b T) T = + driverValue b T+y*Complex.I := he.trans (add_comm _ _) + rw [← he',inverseFlow_flow hT hf.surviving] +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.ReverseDerivative +open MeasureTheory BrownianCalculus + +lemma reverseFlow_log_integral {a q y T : ℝ} (hq : 0 < q) (ha : 0 ≤ a) + (hy : q ≤ y) (hT : 0 ≤ T) (U : ℝ) (b : Driver) : + (reverseFlow a q U y b T).2.2 = + ∫ s in (0:ℝ)..T, a*((((reverseFlow a q U y b s).2.1-(b s.toNNReal:ℂ))⁻¹)^2).re := by + let g := reverseFlow a q U y b + have hg := reverseFlow_solution hq a U y b b.continuous hT + have hd := reverseFlow_actual hq ha hy U b b.continuous hT + have hc : ContinuousOn g (Icc 0 T) := fun t ht => (hg.2 t ht).continuousWithinAt + have hz (t : ℝ) (ht : t ∈ Icc 0 T) : (g t).2.1-(b t.toNNReal:ℂ) ≠ 0 := by + have hh := reverseFlow_height hq ha (hq.le.trans hy) U b b.continuous hT t ht + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + change (reverseFlow a q U y b t).2.1.im = 0 at hi + linarith + have hm : ContinuousOn (fun t => (g t).2.1-(b t.toNNReal:ℂ)) (Icc 0 T) := + hc.snd.fst.sub ((Complex.continuous_ofReal.comp (b.continuous.comp continuous_real_toNNReal)).continuousOn) + have hr : ContinuousOn (fun t => a*((((g t).2.1-(b t.toNNReal:ℂ))⁻¹)^2).re) (Icc 0 T) := by + exact continuousOn_const.mul (Complex.continuous_re.comp_continuousOn ((hm.inv₀ hz).pow 2)) + let projL : State →L[ℝ] ℝ := + (ContinuousLinearMap.snd ℝ ℂ ℝ).comp (ContinuousLinearMap.snd ℝ ℝ (ℂ × ℝ)) + have hL (s : ℝ) (hs : s ∈ Icc 0 T) : HasDerivWithinAt (fun t => (g t).2.2) + (a*((((g s).2.1-(b s.toNNReal:ℂ))⁻¹)^2).re) (Icc 0 T) s := + projL.hasFDerivAt.comp_hasDerivWithinAt s (hd s hs) + have he := intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le hT hc.snd.snd + (fun s hs => ((hL s ⟨hs.1.le,hs.2.le⟩).hasDerivAt (Icc_mem_nhds hs.1 hs.2)).hasDerivWithinAt) + (hr.intervalIntegrable_of_Icc hT) + change (∫ s in (0:ℝ)..T, a*((((g s).2.1-(b s.toNNReal:ℂ))⁻¹)^2).re) = + (reverseFlow a q U y b T).2.2-(reverseFlow a q U y b 0).2.2 at he + rw [hg.1] at he + simpa only [initial,sub_zero] using he.symm +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative + +def reverseCoeff (κ y T : ℝ) (b : Driver) (s : ℝ) : ℂ := + (a κ:ℂ)*((reversedCurve κ y T b s- + (BrownianRestart.backward T.toNNReal b s.toNNReal:ℂ))⁻¹)^2 + +lemma continuousOn_reverseCoeff {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : ContinuousOn (reverseCoeff κ y T b) (Icc 0 T) := by + let β := BrownianRestart.backward T.toNNReal b + have hq : 0 < y/4 := by positivity + have ha : 0 ≤ a κ := (div_pos (by norm_num) hκ).le + have hg := ReverseDerivative.reverseFlow_solution hq (a κ) (T+y^2) y β β.continuous hT + have hc : ContinuousOn (reversedCurve κ y T b) (Icc 0 T) := fun t ht => (hg.2 t ht).continuousWithinAt.snd.fst + have hz (t : ℝ) (ht : t ∈ Icc 0 T) : reversedCurve κ y T b t-(β t.toNNReal:ℂ) ≠ 0 := by + have hh := ReverseDerivative.reverseFlow_height hq ha hy.le (T+y^2) β β.continuous hT t ht + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + change (ReverseDerivative.reverseFlow (a κ) (y/4) (T+y^2) y β t).2.1.im = 0 at hi + linarith + exact continuousOn_const.mul + (((hc.sub ((Complex.continuous_ofReal.comp (β.continuous.comp continuous_real_toNNReal)).continuousOn)).inv₀ hz).pow 2) + +lemma reversed_log_eq_integral {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : (reversedState κ y T b T).2.2 = + (∫ s in (0:ℝ)..T, reverseCoeff κ y T b s).re := by + have hq : 0 < y/4 := by positivity + have hh := ReverseDerivative.reverseFlow_log_integral hq + (by exact (div_pos (by norm_num) hκ).le : 0 ≤ a κ) (by linarith : y/4 ≤ y) + hT (T+y^2) (BrownianRestart.backward T.toNNReal b) + change (reversedState κ y T b T).2.2 = Complex.reCLM (∫ s in (0:ℝ)..T, reverseCoeff κ y T b s) + rw [← Complex.reCLM.intervalIntegral_comp_comm ((continuousOn_reverseCoeff hκ hy hT b).intervalIntegrable_of_Icc hT)] + simpa only [Complex.reCLM_apply,reverseCoeff,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero, + reversedState,reversedCurve] using hh +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CandidateCover.lean b/lean/OAI/Probability/SLEGauge/CandidateCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d758661fde9d1ced091f4482e94402afa4eb377 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CandidateCover.lean @@ -0,0 +1,550 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.OptionalPastPalm + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal NNReal Topology Classical +namespace SLEExactGauge.CandidateCover +open Deterministic + +lemma closedBall_subset_triple_of_inter {X : Type*} [PseudoMetricSpace X] + {x y : X} {r s : ℝ} (hrs : r ≤ s) + (hi : ¬Disjoint (closedBall x r) (closedBall y s)) : + closedBall x r ⊆ closedBall y (3*s) := by + obtain ⟨z,hzx,hzy⟩ := Set.not_disjoint_iff.mp hi + apply closedBall_subset_closedBall' + have hd : dist x y ≤ r+s := + (dist_triangle_left x y z).trans (add_le_add hzx hzy) + linarith + + + +theorem finite_disjoint_triples {X ι : Type*} [PseudoMetricSpace X] + (s : Finset ι) (x : ι→X) (r : ι→ℝ) (hr : ∀i∈s,0 ≤ r i) : + ∃t : Finset ι,t ⊆ s ∧ + ((t : Set ι).PairwiseDisjoint (fun i=>closedBall (x i) (r i))) ∧ + ∀i∈s,∃j∈t,closedBall (x i) (r i) ⊆ closedBall (x j) (3*r j) := by + revert hr + refine Finset.strongInductionOn s ?_ + intro s ih hr + by_cases hs : s.Nonempty + · obtain ⟨a,ha,hmax⟩ := s.exists_max_image r hs + let s' := s.filter (fun i=>Disjoint (closedBall (x i) (r i)) (closedBall (x a) (r a))) + have hstrict : s' ⊂ s := by + apply Finset.filter_ssubset.mpr + refine ⟨a,ha,?_⟩ + intro hd + have hx : x a∈closedBall (x a) (r a) := mem_closedBall_self (hr a ha) + exact Set.disjoint_left.mp hd hx hx + obtain ⟨t,ht,hd,hcover⟩ := ih s' hstrict (fun i hi=>hr i (Finset.mem_filter.mp hi).1) + refine ⟨insert a t,?_,?_,?_⟩ + · intro i hi + rcases Finset.mem_insert.mp hi with hia | hit + · simpa only [hia] using ha + · exact (Finset.mem_filter.mp (ht hit)).1 + · rw [Finset.coe_insert,Set.pairwiseDisjoint_insert] + refine ⟨hd,?_⟩ + intro j hj _ + exact (Finset.mem_filter.mp (ht hj)).2.symm + · intro i hi + by_cases hi' : i∈s' + · obtain ⟨j,hj,hij⟩ := hcover i hi' + exact ⟨j,Finset.mem_insert_of_mem hj,hij⟩ + · have hn : ¬Disjoint (closedBall (x i) (r i)) (closedBall (x a) (r a)) := by + intro hdi + exact hi' (Finset.mem_filter.mpr ⟨hi,hdi⟩) + exact ⟨a,Finset.mem_insert_self _ _,closedBall_subset_triple_of_inter (hmax i hi) hn⟩ + · have he : s=∅ := Finset.not_nonempty_iff_eq_empty.mp hs + subst s + exact ⟨∅,by simp,by simp,by simp⟩ + +lemma ediam_closedBall_le_of_nonneg {X : Type*} [PseudoMetricSpace X] + (x : X) (r : ℝ) : ediam (closedBall x r) ≤ ENNReal.ofReal (2*r) := by + apply ediam_le_of_forall_dist_le + intro y hy z hz + change dist y x ≤ r at hy + change dist z x ≤ r at hz + exact (dist_triangle_right y z x).trans (by linarith : dist y x+dist z x ≤ 2*r) + +lemma diameterCost_le_radius {h : ℝ→ℝ} (hh : Target.IsHausdorffGauge h) + {D : ℝ≥0∞} {R : ℝ} (hR : 0 ≤ R) (hD : D ≤ ENNReal.ofReal R) : + diameterCost h D ≤ ENNReal.ofReal (h R) := by + have hDfin : D≠∞ := (hD.trans_lt ENNReal.ofReal_lt_top).ne + rw [diameterCost,ite_eq_right hDfin] + apply ENNReal.ofReal_le_ofReal + apply hh.2.1 ENNReal.toReal_nonneg hR + simpa only [ENNReal.toReal_ofReal hR] using ENNReal.toReal_mono ENNReal.ofReal_ne_top hD + +lemma disjoint_charge {X ι : Type*} [MeasurableSpace X] + (μ : Measure X) (t : Finset ι) (A : ι→Set X) + (hm : ∀i∈t,MeasurableSet (A i)) (hd : (t : Set ι).PairwiseDisjoint A) + (B : Set X) (hB : ∀i∈t,A i ⊆ B) (cost : ι→ℝ≥0∞) (C : ℝ≥0∞) + (hcost : ∀i∈t,cost i ≤ C*μ (A i)) : + (∑i∈t,cost i) ≤ C*μ B := by + calc + (∑i∈t,cost i) ≤ ∑i∈t,C*μ (A i) := Finset.sum_le_sum hcost + _ = C*(∑i∈t,μ (A i)) := (Finset.mul_sum t _ C).symm + _ = C*μ (⋃i∈t,A i) := by rw [measure_biUnion_finset hd hm] + _ ≤ C*μ B := mul_le_mul le_rfl (measure_mono (iUnion₂_subset hB)) zero_le zero_le + + + +theorem finite_candidate_charge {X ι : Type*} [PseudoMetricSpace X] + [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) (s : Finset ι) (x : ι→X) (r : ι→ℝ) + (hr : ∀i∈s,0 ≤ r i) (H B : Set X) (hH : MeasurableSet H) + (hB : ∀i∈s,closedBall (x i) (r i)∩H ⊆ B) + (cost : ι→ℝ≥0∞) (C : ℝ≥0∞) + (hc : ∀i∈s,cost i ≤ C*μ (closedBall (x i) (r i)∩H)) : + ∃t : Finset ι,t ⊆ s ∧ + ((t : Set ι).PairwiseDisjoint (fun i=>closedBall (x i) (r i))) ∧ + (∀i∈s,∃j∈t,closedBall (x i) (r i) ⊆ closedBall (x j) (3*r j)) ∧ + (∑i∈t,cost i) ≤ C*μ B := by + obtain ⟨t,ht,hd,hcover⟩ := finite_disjoint_triples s x r hr + refine ⟨t,ht,hd,hcover,?_⟩ + apply disjoint_charge μ t (fun i=>closedBall (x i) (r i)∩H) + (fun _ _=>measurableSet_closedBall.inter hH) + (hd.mono (fun _=>inter_subset_left)) B (fun i hi=>hB i (ht hi)) cost C + exact fun i hi=>hc i (ht hi) + +lemma quadratic_multiple_le {ι : Type*} [Nonempty ι] (d : ℝ) (b ρ : ι→ℝ) + (hb : ∀i,0 ≤ b i) (hρ : ∀i,0<ρ i) (C : ℝ) (hC : 1 ≤ C) (i : ι) : + QuadraticGauge.gauge d b ρ (C*ρ i) ≤ C^2*b i*(ρ i)^d := by + calc + _ ≤ QuadraticGauge.entry d (b i) (ρ i) (C*ρ i) := + QuadraticGauge.gauge_le_entry hb hρ _ i + _ = _ := by + unfold QuadraticGauge.entry + rw [mul_div_cancel_right₀ C (hρ i).ne',max_eq_right (by nlinarith : 1 ≤ C^2)] + ring + + + +lemma quadratic_candidate_cost {ι : Type*} [Nonempty ι] + (d : ℝ) (b ρ : ι→ℝ) (hb : ∀i,0 ≤ b i) (hρ : ∀i,0<ρ i) + (hh : Target.IsHausdorffGauge (QuadraticGauge.gauge d b ρ)) + (μ : Measure ℂ) (H : Set ℂ) (z : ℂ) (i : ι) (A c : ℝ) + (hA : 1 ≤ A) (hc : 0closedBall (x j) (A*ρ (entry j)))) ∧ + (∀j∈s,∃k∈t,closedBall (x j) (A*ρ (entry j)) ⊆ + closedBall (x k) (3*(A*ρ (entry k)))) ∧ + (∑j∈t,diameterCost (QuadraticGauge.gauge d b ρ) + (ediam (closedBall (x j) (3*(A*ρ (entry j)))))) ≤ + ENNReal.ofReal ((6*A)^2/c)*μ B := by + apply finite_candidate_charge μ s x (fun j=>A*ρ (entry j)) + (fun j _=>mul_nonneg (by linarith) (hρ _).le) H B hH hB + exact fun j hj=>quadratic_candidate_cost d b ρ hb hρ hh μ H (x j) (entry j) A c hA hc (hqual j hj) + +end SLEExactGauge.CandidateCover +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.BoundaryGreen +open ExactSLEMain ExactSLEGenerator ExactSLEGreen + + +lemma height_power_lintegral (α H : ℝ) (hα : α<1) (hH : 0≤H) : + (∫⁻y in Ioc (0:ℝ) H,ENNReal.ofReal (y^(-α)))= + ENNReal.ofReal (H^(1-α)/(1-α)) := by + have hI : IntegrableOn (fun y : ℝ=>y^(-α)) (Ioc 0 H) volume := by + simpa only [uIoc_of_le hH] using + (intervalIntegral.intervalIntegrable_rpow' (a:=0) (b:=H) (r:=-α) (by linarith)).def' + have hn : 0≤ᵐ[volume.restrict (Ioc (0:ℝ) H)] (fun y : ℝ=>y^(-α)) := by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with y hy + exact Real.rpow_nonneg hy.1.le _ + rw [←ofReal_integral_eq_lintegral_ofReal hI hn, + ←intervalIntegral.integral_of_le hH,integral_rpow (Or.inl (by linarith : -1< -α))] + rw [show -α+1=1-α by ring,Real.zero_rpow (by linarith : 1-α≠0),sub_zero] + + +def rectangle (l u H : ℝ) : Set UpperPlane := + {z | z.1.re∈Icc l u ∧ z.1.im≤H} + +lemma rectangle_measurable (l u H : ℝ) : MeasurableSet (rectangle l u H) := by + exact ((Complex.measurable_re.comp measurable_subtype_coe) measurableSet_Icc).inter + (measurableSet_le (Complex.measurable_im.comp measurable_subtype_coe) measurable_const) + +lemma image_rectangle (l u H : ℝ) : + Subtype.val '' rectangle l u H= + Complex.measurableEquivRealProd ⁻¹' (Icc l u ×ˢ Ioc 0 H) := by + ext z + constructor + · rintro ⟨w,hw,rfl⟩ + exact ⟨hw.1,w.2,hw.2⟩ + · rintro ⟨hzx,hzy⟩ + exact ⟨⟨z,hzy.1⟩,⟨hzx,hzy.2⟩,rfl⟩ + +lemma rectangle_height_integral (α l u H : ℝ) (hα : α<1) (hH : 0≤H) : + (∫⁻z in rectangle l u H,ENNReal.ofReal (z.1.im^(-α))∂upperArea)= + ENNReal.ofReal (u-l)*ENNReal.ofReal (H^(1-α)/(1-α)) := by + have hs := setLIntegral_subtype (μ:=(volume : Measure ℂ)) upperPlane_open.measurableSet + (rectangle l u H) (fun z=>ENNReal.ofReal (z.im^(-α))) + change (∫⁻z in rectangle l u H,ENNReal.ofReal (z.1.im^(-α))∂upperArea)=_ at hs + rw [hs] + change (∫⁻z in (Subtype.val : UpperPlane → ℂ) '' rectangle l u H, + ENNReal.ofReal (z.im^(-α))∂volume)=_ + rw [image_rectangle l u H] + have ht := Complex.volume_preserving_equiv_real_prod.setLIntegral_comp_preimage_emb + Complex.measurableEquivRealProd.measurableEmbedding + (fun z : ℝ×ℝ=>ENNReal.ofReal (z.2^(-α))) (Icc l u ×ˢ Ioc 0 H) + change (∫⁻z in Complex.measurableEquivRealProd ⁻¹' (Icc l u ×ˢ Ioc 0 H), + ENNReal.ofReal (z.im^(-α))∂volume)=_ at ht + rw [ht] + change (∫⁻z in Icc l u ×ˢ Ioc (0:ℝ) H, ENNReal.ofReal (z.2^(-α)) + ∂(volume : Measure ℝ).prod volume)=_ + rw [←Measure.prod_restrict,lintegral_prod _ (by fun_prop)] + dsimp only + rw [height_power_lintegral α H hα hH,lintegral_const,Measure.restrict_apply_univ, + Real.volume_Icc,mul_comm] + +lemma initialGreen_height_bound (a : ℝ) (ha : 1/4μ ∞ b (rectangle l u H)) := + (Measure.measurable_measure.mp D.terminal_measurable) _ (rectangle_measurable l u H) + have he : (∫⁻b,μ ∞ b (rectangle l u H)∂W)=initialGreenMeasure a (rectangle l u H) := by + rw [←Measure.bind_apply (rectangle_measurable l u H) D.terminal_measurable.aemeasurable,D.mean] + have hf := initialGreen_rectangle_finite a ha l u H hH + exact ⟨he,he.trans_lt hf,ae_lt_top hmeas (he.trans_lt hf).ne⟩ + +end SLEExactGauge.BoundaryGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.BoxGrid + +def box (m : ℝ) : Set ℂ := {z | z.re∈Icc (-m) m ∧ z.im∈Icc 0 m} + +def region (m : ℝ) : Set ℂ := {z | z.re∈Icc (-(m+2)) (m+2) ∧ z.im≤ m+2} + +lemma region_measurable (m : ℝ) : MeasurableSet (region m) := + (Complex.measurable_re measurableSet_Icc).inter + (measurableSet_le Complex.measurable_im measurable_const) + +lemma preimage_region (m : ℝ) : + (Subtype.val : ExactSLEGreen.UpperPlane→ℂ) ⁻¹' region m = + BoundaryGreen.rectangle (-(m+2)) (m+2) (m+2) := rfl + +def columns (m r : ℝ) : ℕ := ⌊2*m/r⌋₊+1 + +def rows (m r : ℝ) : ℕ := ⌊m/r⌋₊+1 + +abbrev Cells (m r : ℝ) := Fin (columns m r) × Fin (rows m r) + +def center (m r : ℝ) (i j : ℕ) : ℂ := + ⟨-m+((i:ℝ)+1/2)*r,((j:ℝ)+1/2)*r⟩ + +lemma center_im_pos (m r : ℝ) (hr : 0 dsimp [center] <;> nlinarith + +lemma covered (m r : ℝ) (_hm : 0≤ m) (hr : 0 linarith + have hy : |z.im-((j:ℝ)+1/2)*r|≤r/2 := by + apply abs_le.mpr + dsimp [j] + constructor <;> linarith + simpa only [Complex.sub_re,Complex.sub_im,center] using add_le_add hx hy |>.trans_eq (by ring) + +lemma ball_subset_region (m r R : ℝ) (hm : 0≤ m) (hr : 0x^(-α)) (Icc (1/2) (1/2+(N:ℝ))) := by + intro x hx y hy hxy + exact Real.rpow_le_rpow_of_nonpos (by linarith [hx.1] : 0((j:ℝ)+1/2)*r<ε), + (((j:ℝ)+1/2)*r)^(-α))≤rowConstant α/r*(ε+r)^(1-α) := by + have hsub : (Finset.range N).filter (fun j : ℕ=>((j:ℝ)+1/2)*r<ε) ⊆ + Finset.range ⌈ε/r⌉₊ := by + intro j hj + rcases Finset.mem_filter.mp hj with ⟨_,hj⟩ + apply Finset.mem_range.mpr + apply Nat.lt_ceil.mpr + apply (lt_div_iff₀ hr).mpr + nlinarith + have htop : (⌈ε/r⌉₊:ℝ)*r≤ε+r := by + have he := (mul_lt_mul_of_pos_right (Nat.ceil_lt_add_one (div_nonneg hε hr.le)) hr).le + rwa [add_mul,div_mul_cancel₀ _ hr.ne',one_mul] at he + exact (Finset.sum_le_sum_of_subset_of_nonneg hsub + (fun j _ _=>Real.rpow_nonneg (by positivity) _)).trans + (rows_below_height α hα hα1 r hr _ _ htop) + + + +theorem rectangle_rows (α : ℝ) (hα : 0≤α) (hα1 : α<1) + (r : ℝ) (hr : 0((j:ℝ)+1/2)*r<ε), + (((j:ℝ)+1/2)*r)^(-α))≤rowConstant α*X*(ε+r)^(1-α)/r^2 := by + simp only [Finset.sum_const,Finset.card_range,nsmul_eq_mul] + calc + _ ≤ (M:ℝ)*(rowConstant α/r*(ε+r)^(1-α)) := + mul_le_mul_of_nonneg_left (truncated_rows α hα hα1 r hr N ε hε) (Nat.cast_nonneg M) + _ ≤ (X/r)*(rowConstant α/r*(ε+r)^(1-α)) := + mul_le_mul_of_nonneg_right ((le_div_iff₀ hr).mpr hX) + (mul_nonneg (div_nonneg (rowConstant_pos hα1).le hr.le) (Real.rpow_nonneg (by linarith) _)) + _ = _ := by ring + +end SLEExactGauge.BoundaryRows +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CenteredSequenceLaw.lean b/lean/OAI/Probability/SLEGauge/CenteredSequenceLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfa8e74e05002b7617bd34b318104f0f8ee0cac3 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CenteredSequenceLaw.lean @@ -0,0 +1,518 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.NormalizedRadialTests + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions CompactSequence + +lemma centeredMass_raw_measurable_of_le (a : ℝ) (ha : 1/4μ (levelTime a θ.1 b.1 i) b)) : + Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>centeredMass a μ i (θ,b)) := + (centeredMass_raw_measurable a ha μ θ i hμ).mono + ((centeredTime_stopping a ha θ i).measurableSpace_mono (centeredTime_stopping a ha θ l) + (fun b=>centeredTime_monotone a ha θ b hil)) le_rfl + +lemma centered_vector_consistent (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + {l k : ℕ} (hlk : l≤k) : + (finiteAngleLaw W a k).map (fun p=>fun i : Fin (l+1)=>centeredMass a μ i p)= + (finiteAngleLaw W a l).map (fun p=>fun i : Fin (l+1)=>centeredMass a μ i p) := by + have hm : Measurable (fun p=>fun i : Fin (l+1)=>centeredMass a μ i p) := + Measurable.of_eval (fun index=>centeredMass_measurable a ha μ hμ index) + apply Measure.ext + intro A hA + rw [Measure.map_apply hm hA,Measure.map_apply hm hA] + simp only [←lintegral_indicator_one (hm hA)] + apply finiteAngleLaw_lintegral_consistent W hW a ha hlk + · exact measurable_const.indicator (hm hA) + · intro θ + let : MeasurableSpace ExactSLEGenerator.Driver := (centeredTime_stopping a ha θ l).measurableSpace + have hv : Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>fun i : Fin (l+1)=>centeredMass a μ i (θ,b)) := + Measurable.of_eval (fun index=>centeredMass_raw_measurable_of_le a ha μ θ + (by omega) (hμraw index θ)) + exact measurable_const.indicator (hv hA) + + + +theorem exists_centered_sequence_law (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + (hmono : ∀ᵐ b∂W,Monotone (fun v=>μ v b)) : + ∃Q : Measure (ℕ→ℝ≥0∞),IsProbabilityMeasure Q ∧ + (∀n,Q.map (initialVector n)=(finiteAngleLaw W a n).map + (fun p=>fun i : Fin (n+1)=>centeredMass a μ i p)) ∧ + (∀ᵐ x∂Q,Monotone x) := by + have (n : ℕ) : IsProbabilityMeasure (finiteAngleLaw W a n) := + finiteAngleLaw_probability W hW a ha n + obtain ⟨Q,hQ,hQlaw⟩ := exists_sequence_law (finiteAngleLaw W a) + (centeredMass a μ) (centeredMass_measurable a ha μ hμ) + (fun _ _ hlk=>centered_vector_consistent W hW a ha μ hμ hμraw hlk) + refine ⟨Q,hQ,hQlaw,?_⟩ + have hX (l : ℕ) : ∀ᵐ p∂finiteAngleLaw W a l,Monotone (fun n=>centeredMass a μ n p) := by + have hb : ∀ᵐ p ∂(angleLaw a).prod W,Monotone (fun v=>μ v p.2) := + Measure.quasiMeasurePreserving_snd.tendsto_ae.eventually hmono + filter_upwards [(finiteAngleLaw_absolutelyContinuous W a l).ae_le hb] with p hp + exact centeredMass_monotone a ha μ p.2 hp p.1 + have hs (n : ℕ) : ∀ᵐ x∂Q,x n≤x (n+1) := by + let i : Fin (n+1+1) := ⟨n,by omega⟩ + let j : Fin (n+1+1) := ⟨n+1,by omega⟩ + have hm : MeasurableSet {x : Fin (n+1+1)→ℝ≥0∞ | x i≤x j} := + measurableSet_le (measurable_pi_apply _) (measurable_pi_apply _) + change ∀ᵐ x∂Q,(initialVector (n+1) x) i≤(initialVector (n+1) x) j + rw [←ae_map_iff (measurable_initialVector (n+1)).aemeasurable hm,hQlaw] + apply (ae_map_iff (Measurable.of_eval + (fun index : Fin (n+1+1)=>centeredMass_measurable a ha μ hμ index)).aemeasurable hm).mpr + filter_upwards [hX (n+1)] with p hp + exact hp (by simp only [i,j]; omega) + filter_upwards [ae_all_iff.mpr hs] with x hx + exact monotone_nat_of_le_succ hx + + + +def diskSequenceMass (x : ℕ→ℝ≥0∞) : ℝ≥0∞ := ⨆n,x n + +lemma diskSequenceMass_measurable : Measurable diskSequenceMass := + Measurable.iSup (fun _=>measurable_pi_apply _) + +lemma diskSequenceMass_tendsto {x : ℕ→ℝ≥0∞} (hx : Monotone x) : + Tendsto x atTop (𝓝 (diskSequenceMass x)) := tendsto_atTop_iSup hx + + + +theorem diskSequence_moment (W : Measure ExactSLEGenerator.Driver) + (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (Q : Measure (ℕ→ℝ≥0∞)) + (hQlaw : ∀n,Q.map (initialVector n)=(finiteAngleLaw W a n).map + (fun p=>fun i : Fin (n+1)=>centeredMass a μ i p)) + (hQmono : ∀ᵐ x∂Q,Monotone x) (m : ℕ) : + (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,finiteMoment W a μ m l := by + simp only [diskSequenceMass,ENNReal.iSup_pow] + rw [lintegral_iSup' (fun _=>(measurable_pi_apply _).pow_const m |>.aemeasurable) + (hQmono.mono (fun _ hx _ _ hij=>pow_le_pow_left' (hx hij) m))] + congr with l + exact lintegral_coordinate Q (finiteAngleLaw W a l) (centeredMass a μ) + (centeredMass_measurable a ha μ hμ) l (hQlaw l) (fun x=>x^m) + (measurable_id.pow_const m) + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions +open TraceMassIntegration TraceMassContinuity CompactSequence + + + +theorem actual_centered_finite_moments (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + ∃ (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j), + (∀k j,j∈s k→k≤j) ∧ (∀k,∑j∈s k,c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + (∀v b,IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + Measurable (fun p : ℝ≥0∞×GDriver=>μ p.1 p.2) ∧ + (∀(S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b=>μ (S b) b)) ∧ + (∀ᵐ b∂W,TraceMassFacts κ b (fun v=>μ v (driverHomeomorph b)) ∧ + (∀v : ℝ≥0∞,∀f : C_c(UpperPlane,ℝ),Tendsto + (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v (driverHomeomorph b)) + atTop (𝓝 (∫z,f z∂μ v (driverHomeomorph b)))) ∧ + (∀u v : ℝ≥0,ufun i : Fin (n+1)=>centeredMass (Target.a κ) μ i p)) ∧ + (∀ᵐ x∂Q,Monotone x ∧ Tendsto x atTop (𝓝 (diskSequenceMass x)) ∧ diskSequenceMass x<∞) ∧ + (∀ m : ℕ, 1 ≤ m → + (∫⁻x,(diskSequenceMass x)^m∂Q)<∞ ∧ + (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,finiteMoment (W.map driverHomeomorph) (Target.a κ) μ m l ∧ + Tendsto (finiteMoment (W.map driverHomeomorph) (Target.a κ) μ m) atTop + (𝓝 (∫⁻x,(diskSequenceMass x)^m∂Q))) := by + obtain ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,hmean,hstop,hpath⟩ := + actual_canonical_trace_mass κ hκ hκ8 W hW + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + let V := W.map driverHomeomorph + have hBW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) V := brownian_map_driver W hW + have : IsProbabilityMeasure V := hBW.isGaussianProcess.isProbabilityMeasure + have (v : ℝ≥0∞) (b : GDriver) : IsFiniteMeasureOnCompacts (μ v b) := (hreg v b).1 + have hμ : Measurable (fun p : ℝ≥0∞×GDriver=>μ p.1 p.2) := + recoveredMass_joint_measurable (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + have hr (l : ℕ) (θ : Angle) : + Measurable[(centeredTime_stopping (Target.a κ) (a_gt_quarter hκ hκ8) θ l).measurableSpace] + (fun b=>μ (levelTime (Target.a κ) θ.1 b.1 l) b) := (hstop _ _).1 + have hp : ∀ᵐ b∂V,TraceMassFacts κ (driverHomeomorph.symm b) (fun v=>μ v b) := by + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + filter_upwards [hpath] with b hb + change TraceMassFacts κ (driverHomeomorph.symm (driverHomeomorph b)) + (fun v=>μ v (driverHomeomorph b)) + simpa only [Homeomorph.symm_apply_apply] using hb.1 + have hv : ∀ᵐ b∂V,∀f : C_c(UpperPlane,ℝ),Tendsto + (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) ∞ b) atTop (𝓝 (∫z,f z∂μ ∞ b)) := by + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + exact hpath.mono (fun b hb=>hb.2.1 ∞) + have hmono : ∀ᵐ b∂V,Monotone (fun v=>μ v b) := hp.mono (fun b hb=>hb.monotone) + obtain ⟨Q,hQ,hlaw,hQmono⟩ := exists_centered_sequence_law V hBW (Target.a κ) + (a_gt_quarter hκ hκ8) μ hμ hr hmono + have he (m : ℕ) : (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,finiteMoment V (Target.a κ) μ m l := + diskSequence_moment V (Target.a κ) (a_gt_quarter hκ hκ8) μ hμ Q hlaw hQmono m + have hf (m : ℕ) (hm : 1 ≤ m) : (∫⁻x,(diskSequenceMass x)^m∂Q)<∞ := by + obtain ⟨D,hD,hDb⟩ := common_limit_mixed_moment_bound (Target.a κ) (a_gt_quarter hκ hκ8) m hm + rw [he] + apply lt_of_le_of_lt (iSup_le (fun l=> ?_)) hD + exact hDb V hBW s c hc hsum μ (fun v b=>(hreg v b).1) hμ + (hmono.mono (fun b hb v=>hb le_top)) hv l + have hfin : ∀ᵐ x∂Q,diskSequenceMass x<∞ := ae_lt_top (diskSequenceMass_measurable) + (show (∫⁻x,diskSequenceMass x∂Q)≠∞ by simpa only [pow_one] using (hf 1 le_rfl).ne) + refine ⟨s,c,hc,hs,hsum,hreg,hμ,fun S hS=>(hstop S hS).1,?_,Q,hQ,hlaw,?_,?_⟩ + · filter_upwards [hpath] with b hb + exact ⟨hb.1,hb.2.1,fun u v huv=>(hb.2.2 u v huv).1⟩ + · filter_upwards [hQmono,hfin] with x hx hxf + exact ⟨hx,diskSequenceMass_tendsto hx,hxf⟩ + · intro m hm + refine ⟨hf m hm,he m,?_⟩ + rw [he] + exact tendsto_atTop_iSup (finiteMoment_monotone V hBW (Target.a κ) + (a_gt_quarter hκ hκ8) μ hμ hr hmono m) + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions +open TraceMassIntegration TraceMassContinuity + +lemma diskMap_norm_lt_one (θ : Angle) (z : UpperPlane) : ‖diskMap θ.1 z.1‖<1 := by + let e := upperAffine (Real.cos θ.1) (Real.sin θ.1) + (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2) + have he := diskMap_affine θ.1 θ.2.1 θ.2.2 (e.symm z).1 + rw [←upperAffine_apply,Homeomorph.apply_symm_apply] at he + rw [he] + have h := LiteralTrace.halfPlane_disk_norm_lt_one (e.symm z).2 + (show 0diskMap θ.1 z.1) ⁻¹' Metric.ball (0:ℂ) 1=univ := by + ext z + simp only [mem_preimage,Metric.mem_ball,dist_zero_right,mem_univ,iff_true] + exact diskMap_norm_lt_one θ z + rw [diskMass,Measure.map_apply (diskMap_measurable θ.1) Metric.isOpen_ball.measurableSet, + he,withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ, + lintegral_pos_iff_support ((diskWeight_measurable a θ.1 θ.2.1 θ.2.2).ennreal_ofReal)] + have hs : Function.support (fun z : UpperPlane=>ENNReal.ofReal (diskWeight a θ.1 z))=univ := by + ext z + simp only [Function.mem_support,mem_univ,iff_true] + exact (ENNReal.ofReal_pos.mpr (diskWeight_pos a θ z)).ne' + rw [hs] + exact hν + + + +def subdiskMass (a : ℝ) (μ : ℝ≥0∞→GDriver→Measure UpperPlane) + (r : ℝ) (l : ℕ) (p : Angle×GDriver) : ℝ≥0∞ := + diskMass a p.1.1 (μ (levelTime a p.1.1 p.2.1 l) p.2) (Metric.closedBall (0:ℂ) r) + +lemma subdiskMass_quarter (a : ℝ) (μ : ℝ≥0∞→GDriver→Measure UpperPlane) : + subdiskMass a μ (1/4)=centeredMass a μ := rfl + +lemma subdiskMass_measurable (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] (r : ℝ) (l : ℕ) : + Measurable (subdiskMass a μ r l) := by + exact (Measure.measurable_coe Metric.isClosed_closedBall.measurableSet).comp + (diskMass_joint_measurable a Prod.fst measurable_fst + (fun p : Angle×GDriver=>μ (levelTime a p.1.1 p.2.1 l) p.2) + (hμ.comp ((centeredTime_measurable a ha l).prodMk measurable_snd))) + +lemma centeredTime_pos (a : ℝ) (ha : 0b.1 t) W) + (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hpos : ∀ᵐ b∂W,∀v : ℝ≥0∞,0hz n) + exact hp.ne' hnull + simpa using ae_iff.mp hf + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions KernelSimilarity + +lemma cayley_subdisk_bounds (r : ℝ) (hr : 0≤r) (hr1 : r<1) (z : UpperPlane) + (hz : ‖(z.1-Complex.I)/(z.1+Complex.I)‖≤r) : + dist z.1 Complex.I≤2*r/(1-r) ∧ (1-r^2)/4≤z.1.im := by + have hn : 1≤‖z.1+Complex.I‖ := by + apply le_trans _ (Complex.im_le_norm _) + simp only [Complex.add_im,Complex.I_im] + linarith [z.2] + have hp : 0<‖z.1+Complex.I‖ := lt_of_lt_of_le (by norm_num) hn + have hz' : ‖z.1-Complex.I‖≤r*‖z.1+Complex.I‖ := by + rw [norm_div] at hz + exact (div_le_iff₀ hp).mp hz + have htri : ‖z.1+Complex.I‖≤‖z.1-Complex.I‖+2 := by + calc + _ = ‖(z.1-Complex.I)+(Complex.I+Complex.I)‖ := by congr 1; ring + _ ≤ ‖z.1-Complex.I‖+‖Complex.I+Complex.I‖ := norm_add_le _ _ + _ ≤ ‖z.1-Complex.I‖+2 := by + have := norm_add_le Complex.I Complex.I + simp only [Complex.norm_I] at this + linarith + constructor + · rw [dist_eq_norm,le_div_iff₀ (sub_pos.mpr hr1)] + nlinarith [mul_le_mul_of_nonneg_left htri hr] + · have h2 : ‖z.1-Complex.I‖^2≤r^2*‖z.1+Complex.I‖^2 := by + simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) hz' 2 + have he : ‖z.1+Complex.I‖^2-‖z.1-Complex.I‖^2=4*z.1.im := by + simp only [Complex.sq_norm,Complex.normSq_apply,Complex.add_re,Complex.add_im, + Complex.sub_re,Complex.sub_im,Complex.I_re,Complex.I_im,add_zero,sub_zero] + ring + have hrr : 0≤1-r^2 := by nlinarith + have hsq : 1≤‖z.1+Complex.I‖^2 := by nlinarith + nlinarith [mul_le_mul_of_nonneg_left hsq hrr] + +lemma subdisk_region_compact (r : ℝ) (hr : 0≤r) (hr1 : r<1) : + IsCompact {z : UpperPlane | dist z.1 Complex.I≤2*r/(1-r) ∧ (1-r^2)/4≤z.1.im} := by + have hη : 0<(1-r^2)/4 := by nlinarith + apply Topology.IsEmbedding.subtypeVal.isCompact_iff.mpr + have he : (Subtype.val : UpperPlane→ℂ) '' + {z | dist z.1 Complex.I≤2*r/(1-r) ∧ (1-r^2)/4≤z.1.im}= + Metric.closedBall Complex.I (2*r/(1-r)) ∩ {z : ℂ | (1-r^2)/4≤z.im} := by + ext z + constructor + · rintro ⟨w,hw,rfl⟩; exact hw + · rintro ⟨hz,hi⟩ + exact ⟨⟨z,hη.trans_le hi⟩,⟨hz,hi⟩,rfl⟩ + rw [he] + exact (isCompact_closedBall _ _).inter_right (isClosed_le continuous_const Complex.continuous_im) + +lemma subdisk_cutoff_exists (r : ℝ) (hr : 0≤r) (hr1 : r<1) : + ∃f : C_c(UpperPlane,ℝ), + (∀z,0≤f z ∧ f z≤1) ∧ + (∀z : UpperPlane, ‖(z.1-Complex.I)/(z.1+Complex.I)‖≤r → f z=1) ∧ + (∀z∈tsupport f,(1-r^2)/8by dsimp; linarith [hz.2]) + exact ⟨⟨f,hfc⟩,h01,fun z hz=>hf (cayley_subdisk_bounds r hr hr1 z hz),fun z hz=>hfs hz⟩ + +def subdiskCutoff (r : ℝ) (hr : 0≤r) (hr1 : r<1) : C_c(UpperPlane,ℝ) := + Classical.choose (subdisk_cutoff_exists r hr hr1) + +lemma subdiskCutoff_nonneg (r : ℝ) (hr : 0≤r) (hr1 : r<1) (z : UpperPlane) : + 0≤ subdiskCutoff r hr hr1 z := + (Classical.choose_spec (subdisk_cutoff_exists r hr hr1)).1 z |>.1 +lemma subdiskCutoff_le_one (r : ℝ) (hr : 0≤r) (hr1 : r<1) (z : UpperPlane) : + subdiskCutoff r hr hr1 z≤1 := + (Classical.choose_spec (subdisk_cutoff_exists r hr hr1)).1 z |>.2 +lemma subdiskCutoff_one (r : ℝ) (hr : 0≤r) (hr1 : r<1) (z : UpperPlane) + (hz : ‖(z.1-Complex.I)/(z.1+Complex.I)‖≤r) : subdiskCutoff r hr hr1 z=1 := + (Classical.choose_spec (subdisk_cutoff_exists r hr hr1)).2.1 z hz +lemma subdiskCutoff_support (r : ℝ) (hr : 0≤r) (hr1 : r<1) (z : UpperPlane) + (hz : z∈tsupport (subdiskCutoff r hr hr1)) : (1-r^2)/8by rw [Real.norm_eq_abs,abs_of_nonneg (subdiskCutoff_nonneg r hr hr1 z)] + exact subdiskCutoff_le_one r hr hr1 z) z + +lemma subdiskTest_support (a : ℝ) (θ : Angle) (r : ℝ) (hr : 0≤r) (hr1 : r<1) : + Subtype.val '' tsupport (subdiskTest a θ r hr hr1) ⊆ + affine (Real.cos θ.1:ℂ) (Real.sin θ.1) (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2) '' + (Subtype.val '' tsupport (subdiskCutoff r hr hr1)) := by + apply (image_mono (tsupport_smul_subset_right (fun _ : UpperPlane => (2^(2-alpha a):ℝ)) + (normalizedTest a (Real.cos θ.1) (Real.sin θ.1) (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2) + (subdiskCutoff r hr hr1)))).trans + exact normalizedTest_support a _ _ _ _ + +lemma diskWeight_le_subdiskTest (a : ℝ) (ha : 1/4(n:ℝ)*Real.exp (-c*n)) atTop (𝓝 0) := by + have ht : Tendsto (fun n : ℕ=>c*(n:ℝ)) atTop atTop := + (tendsto_const_mul_atTop_of_pos hc).mpr tendsto_natCast_atTop_atTop + have hh := ((Real.tendsto_pow_mul_exp_neg_atTop_nhds_zero 1).comp ht).const_mul c⁻¹ + simp only [Function.comp_def,pow_one,mul_zero] at hh + convert hh using 1 + funext n + rw [neg_mul,←mul_assoc,←mul_assoc,inv_mul_cancel₀ hc.ne',one_mul] + +lemma nat_mul_exp_neg_two_pow : + Tendsto (fun n : ℕ=>(n:ℝ)*Real.exp (-((2:ℝ)^n)/16)) atTop (𝓝 0) := by + apply squeeze_zero (fun n=>mul_nonneg (Nat.cast_nonneg n) (Real.exp_pos _).le) + (g:=fun n : ℕ=>(n:ℝ)*Real.exp (-(1/16:ℝ)*n)) + · intro n + have hn : (n:ℝ)≤(2:ℝ)^n := by exact_mod_cast (Nat.lt_two_pow_self (n:=n)).le + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg n) + exact Real.exp_le_exp.mpr (by linarith) + · exact nat_mul_exp_neg_linear (1/16) (by norm_num) + +lemma nat_mul_boundary_power {α : ℝ} (hα : α<1) (r : ℕ→ℝ) + (hr : ∀n,0≤r n) (hsmall : ∀ᶠ n in atTop,r n≤Real.exp (-(n:ℝ)^2)) : + Tendsto (fun n : ℕ=>(n:ℝ)*(Real.exp (-(n:ℝ))+r n)^(1-α)) atTop (𝓝 0) := by + have hβ : 0<1-α := by linarith + have hg : Tendsto (fun n : ℕ=>(2:ℝ)^(1-α)*((n:ℝ)*Real.exp (-(1-α)*n))) atTop (𝓝 0) := by + simpa only [mul_zero] using (nat_mul_exp_neg_linear (1-α) hβ).const_mul ((2:ℝ)^(1-α)) + apply squeeze_zero' (Eventually.of_forall (fun n=>mul_nonneg (Nat.cast_nonneg n) + (Real.rpow_nonneg (add_nonneg (Real.exp_pos _).le (hr n)) _))) _ hg + filter_upwards [hsmall,eventually_ge_atTop 1] with n hn hn1 + have hn1' : (1:ℝ)≤n := by exact_mod_cast hn1 + have hh : -(n:ℝ)^2≤-(n:ℝ) := by nlinarith + have he : Real.exp (-(n:ℝ))+r n≤2*Real.exp (-(n:ℝ)) := by + have hh' := Real.exp_le_exp.mpr hh + linarith + calc + _ ≤ (n:ℝ)*(2*Real.exp (-(n:ℝ)))^(1-α) := + mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow (add_nonneg (Real.exp_pos _).le (hr n)) he hβ.le) (Nat.cast_nonneg n) + _ = _ := by + rw [Real.mul_rpow (by norm_num : (0:ℝ)≤2) (Real.exp_pos _).le, + Real.rpow_def_of_pos (Real.exp_pos _),Real.log_exp] + rw [show -(n:ℝ)*(1-α)=-(1-α)*(n:ℝ) by ring] + ring + + + +def envelope (α : ℝ) (r : ℕ→ℝ) (n : ℕ) : ℝ := + (n:ℝ)*Real.exp (-((2:ℝ)^n)/16)+(n:ℝ)*(Real.exp (-(n:ℝ))+r n)^(1-α) + +lemma envelope_tendsto {α : ℝ} (hα : α<1) (r : ℕ→ℝ) + (hr : ∀n,0≤r n) (hsmall : ∀ᶠ n in atTop,r n≤Real.exp (-(n:ℝ)^2)) : + Tendsto (envelope α r) atTop (𝓝 0) := by + change Tendsto (fun n : ℕ=>(n:ℝ)*Real.exp (-((2:ℝ)^n)/16) + + (n:ℝ)*(Real.exp (-(n:ℝ))+r n)^(1-α)) atTop (𝓝 0) + simpa only [zero_add] using + nat_mul_exp_neg_two_pow.add (nat_mul_boundary_power hα r hr hsmall) + +lemma envelope_uniform_bound {α : ℝ} (hα : α<1) (r : ℕ→ℝ) + (hr : ∀n,0≤r n) (hsmall : ∀ᶠ n in atTop,r n≤Real.exp (-(n:ℝ)^2)) : + ∃C : ℝ,0(le_abs_self _).trans (hbound _ (mem_range_self n))⟩ + + + +lemma two_region_cell_sum (α r : ℝ) (hα : 0≤α) (hα1 : α<1) (hr : 0((j:ℝ)+1/2)*r + have hn (j : ℕ) : 0≤A*r^α*(y j)^(-α) := by dsimp [y]; positivity + have hb (i : ℕ) (hi : i∈Finset.range M) (j : ℕ) (hj : j∈Finset.range N) : + P i j≤A*r^α*((y j)^(-α)*q+(if y j<ε then (y j)^(-α) else 0)) := by + by_cases hy : y j<ε + · rw [ite_eq_left hy,mul_add] + exact (hnear i hi j hj hy).trans (le_add_of_nonneg_left (by positivity)) + · rw [ite_eq_right hy,add_zero,←mul_assoc] + exact hfar i hi j hj (le_of_not_gt hy) + have hsplit : (∑i∈Finset.range M,∑j∈Finset.range N, + A*r^α*((y j)^(-α)*q+(if y j<ε then (y j)^(-α) else 0)))= + A*r^α*(q*(∑i∈Finset.range M,∑j∈Finset.range N,(y j)^(-α))+ + (∑i∈Finset.range M,∑j∈(Finset.range N).filter (fun j=>y j<ε),(y j)^(-α))) := by + simp_rw [Finset.sum_filter,mul_add,Finset.sum_add_distrib,←Finset.mul_sum,←Finset.sum_mul] + ring + have hh1 := rectangle_rows α hα hα1 r hr M N X Y hX hY + have hh2 := rectangle_truncated_rows α hα hα1 r hr M N X ε hX hε + calc + _ ≤ ∑i∈Finset.range M,∑j∈Finset.range N, + A*r^α*((y j)^(-α)*q+(if y j<ε then (y j)^(-α) else 0)) := by + exact Finset.sum_le_sum (fun i hi=>Finset.sum_le_sum (hb i hi)) + _ = _ := hsplit + _ ≤ A*r^α*(q*(rowConstant α*X*Y^(1-α)/r^2)+ + rowConstant α*X*(ε+r)^(1-α)/r^2) := + mul_le_mul_of_nonneg_left (add_le_add (mul_le_mul_of_nonneg_left hh1 hq) hh2) + (mul_nonneg hA (Real.rpow_nonneg hr.le _)) + _ = _ := by ring + + + +theorem cleanup_sum (d α r : ℝ) (hα : 0≤α) (hα1 : α<1) (hr : 0ENNReal.ofReal (4*(n:ℝ)*(M.finalRadius n)^(2-alpha a))) b + +lemma cleanupCost_measurable (m : ℝ) (n : ℕ) : Measurable (M.cleanupCost m n) := by + apply Finset.measurable_sum + intro k hk + exact measurable_const.indicator (M.cleanupEvent_measurable _ + (center_im_pos m _ (M.finalRadius_pos n) _ _) n) + +lemma cleanupCost_integral [IsProbabilityMeasure W] (m : ℝ) (n : ℕ) : + (∫⁻b,M.cleanupCost m n b∂W)=ENNReal.ofReal + (∑i∈Finset.range (columns m (M.finalRadius n)), + ∑j∈Finset.range (rows m (M.finalRadius n)), + 4*(n:ℝ)*(M.finalRadius n)^(2-alpha a)* + W.real (M.cleanupEvent (center m (M.finalRadius n) i j) n)) := by + have hr := M.finalRadius_pos n + simp only [cleanupCost] + rw [lintegral_finsetSum] + · simp_rw [lintegral_indicator_const (M.cleanupEvent_measurable _ + (center_im_pos m _ hr _ _) n)] + rw [Fintype.sum_prod_type] + + simp_rw [←Fin.sum_univ_eq_sum_range] + rw [ENNReal.ofReal_sum_of_nonneg (fun i _=>Finset.sum_nonneg (fun j _=>by positivity))] + apply Finset.sum_congr rfl + intro i hi + rw [ENNReal.ofReal_sum_of_nonneg (fun j _=>by positivity)] + apply Finset.sum_congr rfl + intro j hj + rw [ENNReal.ofReal_mul (show 0≤4*(n:ℝ)*(M.finalRadius n)^(2-alpha a) by positivity),Measure.real, + ENNReal.ofReal_toReal (measure_ne_top _ _)] + · intro k hk + exact measurable_const.indicator (M.cleanupEvent_measurable _ + (center_im_pos m _ hr _ _) n) + + +lemma cleanupCost_integral_bound [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (m : ℝ) (hm : 0≤ m) (n : ℕ) (hr : BatchReady a n) + (hr1 : M.finalRadius n≤1) : + (∫⁻b,M.cleanupCost m n b∂W) ≤ ENNReal.ofReal + (4*(n:ℝ)*M.cellConstant*BoundaryRows.rowConstant (alpha a)*(2*m+1)* + (Real.exp (-((2:ℝ)^n/16))*(m+1)^(1-alpha a)+ + (Real.exp (-(n:ℝ))+M.finalRadius n)^(1-alpha a))) := by + rw [M.cleanupCost_integral] + apply ENNReal.ofReal_le_ofReal + have hsum := CleanupCost.cleanup_sum (2-alpha a) (alpha a) (M.finalRadius n) + (alpha_pos ha).le (alpha_lt_one (ha:=ha)) (M.finalRadius_pos n) (by ring) + (columns m (M.finalRadius n)) (rows m (M.finalRadius n)) n + (2*m+1) (m+1) (Real.exp (-(n:ℝ))) M.cellConstant (Real.exp (-((2:ℝ)^n/16))) + ((columns_width m _ hm (M.finalRadius_pos n)).trans (by linarith)) + ((rows_height m _ hm (M.finalRadius_pos n)).trans (by linarith)) + (Real.exp_pos _).le M.cellConstant_pos.le (Real.exp_pos _).le + (fun i j=>W.real (M.cleanupEvent (center m (M.finalRadius n) i j) n)) + (fun i _ j _ _=>M.cleanup_near hW _ (center_im_pos m _ (M.finalRadius_pos n) i j) n) + (fun i _ j _ hy=>M.cleanup_far hW _ (center_im_pos m _ (M.finalRadius_pos n) i j) n hr hy) + have hh := mul_le_mul_of_nonneg_left hsum (show (0:ℝ)≤2 by norm_num) + simp_rw [Finset.mul_sum] at hh + calc + _ = ∑i∈Finset.range (columns m (M.finalRadius n)), + ∑j∈Finset.range (rows m (M.finalRadius n)), + 2*(2*(n:ℝ)*(M.finalRadius n)^(2-alpha a)*W.real + (M.cleanupEvent (center m (M.finalRadius n) i j) n)) := by + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + ring + _ ≤ _ := hh.trans_eq (by ring) + +lemma cleanupCost_uniform_bound [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (m : ℝ) (hm : 0≤ m) : + ∃B : ℝ≥0∞,B<∞ ∧ ∀ᶠ n in atTop,(∫⁻b,M.cleanupCost m n b∂W)≤B := by + obtain ⟨C,hC,hbound⟩ := CleanupCost.envelope_uniform_bound (alpha_lt_one (ha:=ha)) + M.finalRadius (fun n=>(M.finalRadius_pos n).le) (Eventually.of_forall M.finalRadius_le) + let D := 4*M.cellConstant*BoundaryRows.rowConstant (alpha a)*(2*m+1)*max 1 ((m+1)^(1-alpha a)) + refine ⟨ENNReal.ofReal (D*C),ENNReal.ofReal_lt_top,?_⟩ + filter_upwards [eventually_batchReady a (by linarith)] with n hn + have hs : M.finalRadius n≤1 := (M.finalRadius_le n).trans + (Real.exp_le_one_iff.mpr (neg_nonpos.mpr (sq_nonneg _))) + apply (M.cleanupCost_integral_bound hW m hm n hn hs).trans + apply ENNReal.ofReal_le_ofReal + have hrow := BoundaryRows.rowConstant_pos (alpha_lt_one (ha:=ha)) + have hD : 0≤D := by + dsimp [D] + have := M.cellConstant_pos + positivity + have henv : 4*(n:ℝ)*M.cellConstant*BoundaryRows.rowConstant (alpha a)*(2*m+1)* + (Real.exp (-((2:ℝ)^n/16))*(m+1)^(1-alpha a)+ + (Real.exp (-(n:ℝ))+M.finalRadius n)^(1-alpha a)) ≤ + D*CleanupCost.envelope (alpha a) M.finalRadius n := by + have hy : (m+1)^(1-alpha a) ≤ max 1 ((m+1)^(1-alpha a)) := le_max_right .. + have hu : (Real.exp (-(n:ℝ))+M.finalRadius n)^(1-alpha a) ≤ + max 1 ((m+1)^(1-alpha a))*(Real.exp (-(n:ℝ))+M.finalRadius n)^(1-alpha a) := by + exact le_mul_of_one_le_left (Real.rpow_nonneg + (add_nonneg (Real.exp_pos _).le (M.finalRadius_pos n).le) _) (le_max_left ..) + have hh := mul_le_mul_of_nonneg_left + (add_le_add (mul_le_mul_of_nonneg_left hy (Real.exp_pos (-((2:ℝ)^n/16))).le) hu) + (show 0≤4*(n:ℝ)*M.cellConstant*BoundaryRows.rowConstant (alpha a)*(2*m+1) by + have := M.cellConstant_pos; positivity) + exact hh.trans_eq (by dsimp [D,CleanupCost.envelope]; rw [neg_div]; ring) + exact henv.trans (mul_le_mul_of_nonneg_left (hbound n) hD) + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology Classical +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart CompactSequence MomentBatches BoxGrid Deterministic CandidateCover + +def allFrontiers (a : ℝ) (b : GDriver) : Set ℂ := + ⋃T : ℝ≥0,frontier {z | alive a b.1 T z} + +lemma exp_neg_nat_sq_tendsto : + Tendsto (fun n : ℕ=>Real.exp (-(n:ℝ)^2)) atTop (𝓝 0) := by + have hs : Tendsto (fun n : ℕ=>(n:ℝ)^2) atTop atTop := + (tendsto_pow_atTop (by norm_num : (2:ℕ)≠0)).comp tendsto_natCast_atTop_atTop + exact Real.tendsto_exp_atBot.comp (tendsto_neg_atTop_atBot.comp hs) + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4b.1 t) W) + (m : ℝ) (hm : 0≤ m) : + ∃B : ℝ≥0∞,B<∞ ∧ ∀ᶠ n in atTop,(∫⁻b,M.costBound m n b∂W)≤B := by + obtain ⟨C,hC,hbound⟩ := M.cleanupCost_uniform_bound hW m hm + have hmean : (∫⁻b,M.spatialMass b (region m)∂W)<∞ := by + simp_rw [M.spatialMass_apply _ _ (region_measurable m),preimage_region] + exact (BoundaryGreen.canonical_rectangle_mean M.canonical _ _ _ (by linarith)).2.1 + refine ⟨ENNReal.ofReal ((6*M.candidateScale)^2/M.candidateLower)* + (∫⁻b,M.spatialMass b (region m)∂W)+C, + ENNReal.add_lt_top.mpr ⟨ENNReal.mul_lt_top ENNReal.ofReal_lt_top hmean,hC⟩,?_⟩ + filter_upwards [hbound] with n hn + simp only [costBound] + have hf : Measurable (fun b=>ENNReal.ofReal ((6*M.candidateScale)^2/M.candidateLower)* + M.spatialMass b (region m)) := measurable_const.mul (M.spatialMass_measurable _ (region_measurable m)) + rw [lintegral_add_left hf, + lintegral_const_mul _ (M.spatialMass_measurable _ (region_measurable m))] + exact add_le_add le_rfl hn + +lemma finalRadius_le_one (n : ℕ) : M.finalRadius n≤1 := + (M.finalRadius_le n).trans (Real.exp_le_one_iff.mpr (neg_nonpos.mpr (sq_nonneg _))) + +lemma gauge_admissible_actual : Target.IsHausdorffGauge (M.gauge (2-alpha a)) := + M.gauge_admissible (by linarith [alpha_lt_one (ha:=ha)]) (by linarith [alpha_pos ha]) + +lemma cleanup_ball_cost (n : ℕ) (hn : 0(M.entryThreshold_pos i).le) M.entryRadius_pos 2 (by norm_num) + (cleanupIndex (moment M.law sequenceMassReal) n hn) + rw [M.cleanup_radius n hn,show M.entryThreshold (cleanupIndex (moment M.law sequenceMassReal) n hn)= + (n:ℝ) from cleanup_threshold ..] at h + norm_num only [show (2:ℝ)^2=4 by norm_num] at h + exact h + + + +lemma finite_cover (m : ℝ) (hm : 0≤ m) (n : ℕ) (hn : 0M.cleanup_covers _ + (center_im_pos m _ (M.finalRadius_pos n) _ _) n) + filter_upwards [hcover] with b hb + let s : Finset (M.CandidateIndices m n) := Finset.univ.filter + (fun j=>M.candidate n j.2 (M.gridCenter m n j.1) b) + let e : M.CandidateIndices m n→M.Entries := fun j=>M.testIndex n hn j.2 j.2.2 + have her (j : M.CandidateIndices m n) : M.entryRadius (e j)=batchRadius a (M.batchLevel n) n j.2 := rfl + have het (j : M.CandidateIndices m n) : M.entryThreshold (e j)=M.testThreshold n j.2 := + M.testIndex_threshold n hn j.2 j.2.2 + have hrbound (j : M.CandidateIndices m n) : M.entryRadius (e j)≤Real.exp (-(n:ℝ)^2) := by + rw [her,←batchRadius_zero a (M.batchLevel n) n] + exact batchRadius_antitone a (by linarith) _ _ (Nat.zero_le _) + have hrball (j : M.CandidateIndices m n) : M.candidateScale*M.entryRadius (e j)≤1 := + (mul_le_mul_of_nonneg_left (hrbound j) M.candidateScale_pos.le).trans hsmall + have hqual (j : M.CandidateIndices m n) (hj : j∈s) : + ENNReal.ofReal (M.candidateLower*M.entryThreshold (e j)*(M.entryRadius (e j))^(2-alpha a)) ≤ + M.spatialMass b (closedBall (M.gridCenter m n j.1) (M.candidateScale*M.entryRadius (e j))∩univ) := by + rw [inter_univ,her,het] + exact (Finset.mem_filter.mp hj).2 + obtain ⟨t,ht,hd,hcov,hcost⟩ := finite_quadratic_candidates (2-alpha a) M.entryThreshold M.entryRadius + (fun j=>(M.entryThreshold_pos j).le) M.entryRadius_pos M.gauge_admissible_actual + (M.spatialMass b) s (fun j=>M.gridCenter m n j.1) e univ (region m) MeasurableSet.univ + M.candidateScale M.candidateLower M.candidateScale_one M.candidateLower_pos + (fun j _=>(inter_subset_left.trans (ball_subset_region m _ _ hm (M.finalRadius_pos n) + (M.finalRadius_le_one n) (hrball j) j.1))) hqual + let U : M.CoverIndices m n→Set ℂ := Sum.elim + (fun j=>if j∈t then closedBall (M.gridCenter m n j.1) (3*(M.candidateScale*M.entryRadius (e j))) else ∅) + (fun k=>if b∈M.cleanupEvent (M.gridCenter m n k) n then + closedBall (M.gridCenter m n k) (M.finalRadius n) else ∅) + have hδ : 0≤6*M.candidateScale*Real.exp (-(n:ℝ)^2) := by have := M.candidateScale_pos; positivity + refine ⟨U,?_,?_,?_⟩ + · intro i + cases i with + | inl j => + dsimp [U] + split_ifs with hj + · apply (ediam_closedBall_le_of_nonneg _ _).trans + apply ENNReal.ofReal_le_ofReal + nlinarith [mul_le_mul_of_nonneg_left (hrbound j) M.candidateScale_pos.le] + · simp + | inr k => + dsimp [U] + split_ifs + · apply (ediam_closedBall_le_of_nonneg _ _).trans + apply ENNReal.ofReal_le_ofReal + have he := Real.exp_pos (-(n:ℝ)^2) + nlinarith [M.finalRadius_le n,M.candidateScale_one] + · simp + · intro v hv + obtain ⟨T,hT⟩ := mem_iUnion.mp hv.1 + obtain ⟨k,hk⟩ := mem_iUnion.mp (covered m _ hm (M.finalRadius_pos n) hv.2) + rcases hb k T v hk hT with hc | hc + · obtain ⟨i,hi,hc⟩ := hc + let j : M.CandidateIndices m n := (k,⟨i,hi⟩) + have hjs : j∈s := Finset.mem_filter.mpr ⟨Finset.mem_univ _,hc⟩ + obtain ⟨q,hqt,hq⟩ := hcov j hjs + refine mem_iUnion.mpr ⟨Sum.inl q,?_⟩ + change v∈if q∈t then _ else ∅ + rw [ite_eq_left hqt] + apply hq + apply closedBall_subset_closedBall (ε₁:=M.finalRadius n) (ε₂:=M.candidateScale*M.entryRadius (e j)) _ hk + have hri : M.finalRadius n≤M.entryRadius (e j) := + batchRadius_antitone a (by linarith) _ _ hi.le + exact hri.trans (le_mul_of_one_le_left (M.entryRadius_pos _).le M.candidateScale_one) + · refine mem_iUnion.mpr ⟨Sum.inr k,?_⟩ + change v∈if b∈M.cleanupEvent (M.gridCenter m n k) n then _ else ∅ + rw [ite_eq_left hc] + exact hk + · rw [Fintype.sum_sum_type] + unfold costBound + apply add_le_add + · change (∑j,diameterCost (M.gauge (2-alpha a)) (ediam + (if j∈t then closedBall (M.gridCenter m n j.1) (3*(M.candidateScale*M.entryRadius (e j))) else ∅))) ≤ _ + simp only [apply_ite,ediam_empty,diameterCost_zero M.gauge_admissible_actual.2.2.1, + ←Finset.sum_filter] + simpa only [Finset.filter_mem_eq_inter,Finset.univ_inter,M.gauge_eq_quadratic] using hcost + · change (∑k,diameterCost (M.gauge (2-alpha a)) (ediam + (if b∈M.cleanupEvent (M.gridCenter m n k) n then closedBall (M.gridCenter m n k) (M.finalRadius n) else ∅))) ≤ _ + unfold cleanupCost + apply Finset.sum_le_sum + intro k hk + change diameterCost (M.gauge (2-alpha a)) (ediam (if b∈M.cleanupEvent (M.gridCenter m n k) n then + closedBall (M.gridCenter m n k) (M.finalRadius n) else ∅)) ≤ + (M.cleanupEvent (M.gridCenter m n k) n).indicator + (fun _=>ENNReal.ofReal (4*(n:ℝ)*(M.finalRadius n)^(2-alpha a))) b + by_cases hc : b∈M.cleanupEvent (M.gridCenter m n k) n + · simp only [ite_eq_left hc,indicator_of_mem hc] + exact M.cleanup_ball_cost n hn _ + · simp only [ite_eq_right hc,ediam_empty,diameterCost_zero M.gauge_admissible_actual.2.2.1] + exact bot_le + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart CompactSequence MomentBatches BoxGrid Deterministic + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4b.1 t) W) + (m : ℝ) (hm : 0≤ m) : + ∀ᵐ b∂W,Target.hausdorff (M.gauge (2-alpha a)) (allFrontiers a b∩box m)<∞ := by + obtain ⟨B,hB,hbound⟩ := M.costBound_uniform hW m hm + have hfin := (CoverCost.liminf_cost_bound W (M.costBound m) + (M.costBound_measurable m) B hB hbound).2.2 + have hc : ∀ᵐ b∂W,∀n : ℕ,0hb) + · exact Eventually.of_forall (fun _ _ h=>(hs h).elim) + · exact Eventually.of_forall (fun _ h _=>(hn h).elim) + have he : Tendsto (fun n : ℕ=>M.candidateScale*Real.exp (-(n:ℝ)^2)) atTop (𝓝 0) := by + simpa only [mul_zero] using exp_neg_nat_sq_tendsto.const_mul M.candidateScale + have hsmall : ∀ᶠ n : ℕ in atTop,M.candidateScale*Real.exp (-(n:ℝ)^2)≤1 := + (he.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1))).mono (fun _ h=>h.le) + have hδ : Tendsto (fun n : ℕ=>ENNReal.ofReal (6*M.candidateScale*Real.exp (-(n:ℝ)^2))) atTop (𝓝 0) := by + have hh : Tendsto (fun n : ℕ=>6*M.candidateScale*Real.exp (-(n:ℝ)^2)) atTop (𝓝 0) := by + simpa only [mul_zero] using exp_neg_nat_sq_tendsto.const_mul (6*M.candidateScale) + simpa only [ENNReal.ofReal_zero] using ENNReal.tendsto_ofReal hh + filter_upwards [hc,hfin] with b hb hf + apply lt_of_le_of_lt _ hf + apply CoverCost.hausdorff_le_liminf_of_exists + (ι:=fun n=>M.CoverIndices m n) _ _ _ hδ _ + filter_upwards [hsmall,eventually_gt_atTop (0:ℕ)] with n hs hn + obtain ⟨U,hd,hcov,hcost⟩ := hb n hn hs + exact ⟨U,hd,hcov,by simpa only [tsum_fintype] using hcost⟩ + + +theorem frontier_boxes_finite [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) : + ∀ᵐ b∂W,∀m : ℕ,Target.hausdorff (M.gauge (2-alpha a)) (allFrontiers a b∩box m)<∞ := + ae_all_iff.mpr (fun m=>M.frontier_box_finite hW m (Nat.cast_nonneg m)) + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification TraceMassIntegration + + +def dimension (κ : ℝ) : ℝ := 1+κ/8 + +lemma parameterDimension_pos {κ : ℝ} (hκ : 0<κ) : 0hr⟩,?_,?_⟩ + · intro C r hC hr + change C*r ≤ C^2*r + exact mul_le_mul_of_nonneg_right (by nlinarith : C≤C^2) hr + · intro W hW + exact (h ⟨W,hW⟩).elim + + +def parameterMomentGauge (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) : ℝ→ℝ := + Classical.choose (exists_parameter_moment_gauge κ hκ hκ8) + +lemma parameterMomentGauge_admissible (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) : + Target.IsHausdorffGauge (parameterMomentGauge κ hκ hκ8) := + (Classical.choose_spec (exists_parameter_moment_gauge κ hκ hκ8)).1 + +lemma parameterMomentGauge_doubling (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (C r : ℝ) (hC : 1≤C) (hr : 0≤r) : + parameterMomentGauge κ hκ hκ8 (C*r) ≤ C^2*parameterMomentGauge κ hκ hκ8 r := + (Classical.choose_spec (exists_parameter_moment_gauge κ hκ hκ8)).2.1 C r hC hr + +lemma parameterMomentGauge_model (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Target.WienerLaw) (hW : Target.IsWiener W) : + ∃M : CenteredMomentModel κ (Target.a κ) (a_gt_quarter hκ hκ8) + (W.map driverHomeomorph), parameterMomentGauge κ hκ hκ8=M.gauge (dimension κ) := + (Classical.choose_spec (exists_parameter_moment_gauge κ hκ hκ8)).2.2 W hW + +end SLEExactGauge.CenteredMoments +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CommonStoppedMass.lean b/lean/OAI/Probability/SLEGauge/CommonStoppedMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5923bcd980c3fa601d41bc3bc7bab8a58c56b4b --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CommonStoppedMass.lean @@ -0,0 +1,570 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ConformalRestartMap +import OAI.Probability.SLEGauge.StoppedMassMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction SLEExactGauge.MassVersions + + + +theorem recoveredMass_all_stopping (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass a ha s c hc v b))) : + let μ := recoveredMass a ha s c hc + ∀ (S : ExactSLEGenerator.Driver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b => μ (S b) b) ∧ + (∀f : C_c(UpperPlane,ℝ), ∀m : ℕ, + MemLp (fun b => ∫z,f z∂μ (S b) b) (m:ℝ≥0∞) W) ∧ + (∀K : Set UpperPlane, IsCompact K → ∀m : ℕ, + MemLp (fun b => (μ (S b) b K).toReal) (m:ℝ≥0∞) W) ∧ + (∀f : C_c(UpperPlane,ℝ), Tendsto (fun k => eLpNorm + (fun b => (∑j∈s k,c k j*∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) (S b) b)-(∫z,f z∂μ (S b) b)) 1 W) + atTop (𝓝 0)) ∧ + (∀H : ExactSLEGenerator.Driver × UpperPlane→ℝ≥0∞, + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂W)=(∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂W)+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea∂W) := by + intro μ S hS + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := + radonLimit_finite _ + have hmeas := recoveredMass_stopping_raw_measurable a ha s c hc S hS + let K : Kernel ExactSLEGenerator.Driver UpperPlane := + ⟨fun b => μ (S b) b,hmeas.mono hS.measurableSpace_le le_rfl⟩ + let ν : Kernel ExactSLEGenerator.Driver UpperPlane := + ⟨μ ∞,recoveredMass_measurable a ha s c hc ∞⟩ + let (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (K b) := inferInstanceAs + (IsFiniteMeasureOnCompacts (μ (S b) b)) + let (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (ν b) := inferInstanceAs + (IsFiniteMeasureOnCompacts (μ ∞ b)) + have hcv (f : C_c(UpperPlane,ℝ)) : ∀ᵐ b ∂W, Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S b) b) + atTop (𝓝 (∫z,f z∂μ (S b) b)) := hconv.mono (fun b hb => hb (S b) f) + have hct (f : C_c(UpperPlane,ℝ)) : ∀ᵐ b ∂W, Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂ν b)) := hconv.mono (fun b hb => hb ∞ f) + have hmom (f : C_c(UpperPlane,ℝ)) (m : ℕ) : + MemLp (fun b => ∫z,f z∂μ (S b) b) (m:ℝ≥0∞) W := + actual_stopped_radon_limit_memLp a ha W hW S hS s c hc hsum _ f (hcv f) m + have hint (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂K b) W := + memLp_one_iff_integrable.mp (by simpa only [K,Kernel.coe_mk,Nat.cast_one] using hmom f 1) + have htop : IsStoppingTime rawFiltration (fun _ : ExactSLEGenerator.Driver => (∞:ℝ≥0∞)) := + fun t => by simp + have hintop (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂ν b) W := + memLp_one_iff_integrable.mp (by simpa only [Nat.cast_one] using + actual_stopped_radon_limit_memLp a ha W hW _ htop s c hc hsum _ f (hct f) 1) + have hcond (f : C_c(UpperPlane,ℝ)) (U : Set ExactSLEGenerator.Driver) + (hU : MeasurableSet[hS.measurableSpace] U) : + (∫b in U,(∫z,f z∂ν b)-(∫z,f z∂K b)∂W)= + ∫b in U,(∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1∂upperArea)∂W := + actual_stopped_limit_compact_conditional a ha W hW S hS s c hs hc hsum + K ν f (hcv f) (hct f) U hU + refine ⟨hmeas,hmom,?_,?_,?_⟩ + · intro A hA m + exact compact_mass_memLp K W (m:ℝ≥0∞) (fun f => hmom f m) A hA + · intro f + exact actual_stopped_radon_limit_L1 a ha W hW S hS _ (fun _ => Real.exp_pos _) + (level_step_le_one a ha) s c hc hsum _ f (hcv f) + · intro H hH + exact stopped_compact_conditional_to_random_tests a ha W hW S hS K ν hint hintop hcond H hH + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceRestriction + +variable {X Y : Type*} [MeasurableSpace X] [MetricSpace Y] + [MeasurableSpace Y] [BorelSpace Y] + +lemma firstVisit_finite_of_exhaustion (ν : Measure X) + (ι : X→Y) (hι : Measurable ι) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (hlim : ∀A : Set X, MeasurableSet A → Tendsto + (fun n : ℕ => (ν.restrict (visited ι γ n)) A) atTop (𝓝 (ν A))) : + ∀ᵐ x ∂ν, firstVisit ι γ x<∞ := by + let V := ι ⁻¹' range γ + have hV : MeasurableSet V := by + rw [show V=⋃n : ℕ,visited ι γ n from (iUnion_visited_nat ι γ).symm] + exact MeasurableSet.iUnion (fun n => measurableSet_visited ι hι γ hγ n) + have hz (n : ℕ) : (ν.restrict (visited ι γ n)) Vᶜ=0 := by + rw [Measure.restrict_apply hV.compl] + have he : Vᶜ∩visited ι γ n=∅ := by + apply eq_empty_iff_forall_notMem.mpr + rintro x ⟨hn,u,hu,he⟩ + exact hn ⟨u,he⟩ + rw [he,measure_empty] + have hnull : ν Vᶜ=0 := by + have h := hlim Vᶜ hV.compl + simp_rw [hz] at h + exact tendsto_nhds_unique h tendsto_const_nhds + filter_upwards [measure_eq_zero_iff_ae_notMem.mp hnull] with x hx + apply (firstVisit_lt_top_iff ι γ x).mpr + exact not_not.mp hx + + +omit [MeasurableSpace X] [MeasurableSpace Y] [BorelSpace Y] in +lemma firstVisit_fiber_subset [MeasurableSpace X] [MeasurableSpace Y] [BorelSpace Y] + (ι : X→Y) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (t : ℝ≥0) : {x | firstVisit ι γ x=(t : ℝ≥0∞)}⊆ι ⁻¹' {γ t} := by + rintro x hx + change firstVisit ι γ x=(t : ℝ≥0∞) at hx + by_cases h : ({u : ℝ≥0 | γ u=ι x}).Nonempty + · have hclosed : IsClosed {u : ℝ≥0 | γ u=ι x} := isClosed_eq hγ continuous_const + have hmem := hclosed.csInf_mem h ⟨0,fun _ _ => bot_le⟩ + have he : sInf {u : ℝ≥0 | γ u=ι x}=t := by + apply ENNReal.coe_injective + simpa only [firstVisit,dite_eq_left h] using hx + rw [he] at hmem + exact hmem.symm + · simp only [firstVisit,dite_eq_right h] at hx + exact False.elim (ENNReal.coe_ne_top hx.symm) + +lemma firstVisit_fiber_null (ν : Measure X) [NullSingletonClass ν] + (ι : X→Y) (hinj : Function.Injective ι) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (t : ℝ≥0) : ν {x | firstVisit ι γ x=(t : ℝ≥0∞)}=0 := + measure_mono_null (firstVisit_fiber_subset ι γ hγ t) + (preimage_singleton_null_of_injective ν ι hinj (γ t)) + + + +lemma restrict_strictFirstVisit (ν : Measure X) [NullSingletonClass ν] + (ι : X→Y) (hinj : Function.Injective ι) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (t : ℝ≥0) : + ν.restrict {x | firstVisit ι γ x<(t : ℝ≥0∞)}=ν.restrict (visited ι γ t) := by + apply Measure.restrict_congr_set + filter_upwards [measure_eq_zero_iff_ae_notMem.mp + (firstVisit_fiber_null ν ι hinj γ hγ t)] with x hx + apply propext + rw [←firstVisit_le_iff ι γ hγ x t,lt_iff_le_and_ne] + exact and_iff_left hx + +end SLEExactGauge.TraceRestriction +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen TraceRestriction + + + +structure TraceMassFacts (κ : ℝ) (b : TDriver) (μ : ℝ≥0∞→Measure UpperPlane) : Prop where + continuous_trace : ContinuousOn (Target.trace κ b) (Ici 0) + atomless : NullSingletonClass (μ ∞) + restriction : ∀t : ℝ≥0, μ t=(μ ∞).restrict + (visited (fun z : UpperPlane => z.1) (internalTrace κ b) t) + monotone : Monotone μ + increment_support : ∀s t : ℝ≥0, s≤t → (μ t-μ s) + {z : UpperPlane | z.1∉internalTrace κ b '' Icc s t}=0 + continuous_tests : ∀f : C_c(UpperPlane,ℝ), Continuous (fun t : ℝ≥0 => ∫z,f z∂μ t) + local_variation : ∀K : Set UpperPlane, IsCompact K → ∀t : ℝ≥0, Tendsto + (fun u : ℝ≥0 => ((μ u-μ t)+(μ t-μ u)) K) (𝓝 t) (𝓝 0) + exhaustion : ∀A : Set UpperPlane, MeasurableSet A → Tendsto + (fun n : ℕ => μ (n:ℝ≥0) A) atTop (𝓝 (μ ∞ A)) + remaining_decay : ∀K : Set UpperPlane, IsCompact K → Tendsto + (fun n : ℕ => (μ ∞-μ (n:ℝ≥0)) K) atTop (𝓝 0) + firstVisit_measurable : Measurable (firstVisit (fun z : UpperPlane => z.1) (internalTrace κ b)) + firstVisit_finite : ∀ᵐ z ∂μ ∞, firstVisit (fun z : UpperPlane => z.1) (internalTrace κ b) z<∞ + firstVisit_identity : ∀t : ℝ≥0, μ t=(μ ∞).restrict + {z | firstVisit (fun z : UpperPlane => z.1) (internalTrace κ b) z≤(t:ℝ≥0∞)} + strict_firstVisit_identity : ∀t : ℝ≥0, μ t=(μ ∞).restrict + {z | firstVisit (fun z : UpperPlane => z.1) (internalTrace κ b) z<(t:ℝ≥0∞)} + initial_positive : ∀t : ℝ≥0∞, 0 z.1) (internalTrace κ b) t)) + (hexh : ∀A : Set UpperPlane, MeasurableSet A → Tendsto + (fun n : ℕ => μ (n:ℝ≥0) A) atTop (𝓝 (μ ∞ A))) + (hrem : ∀K : Set UpperPlane, IsCompact K → Tendsto + (fun n : ℕ => (μ ∞-μ (n:ℝ≥0)) K) atTop (𝓝 0)) + (hpos : ∀t : ℝ≥0∞, 0 + induction u using ENNReal.recTopCoe with + | top => exact le_rfl + | coe u => rw [hres u]; exact Measure.restrict_le_self + | coe v => + have hu : u≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top huv + rw [←ENNReal.coe_toNNReal hu,hres,hres] + exact Measure.restrict_mono (visited_mono _ _ (by + apply ENNReal.coe_le_coe.mp + simpa only [ENNReal.coe_toNNReal hu] using huv)) le_rfl + · intro s t hst + rw [hres,hres] + exact increment_carried_by_segment (μ ∞) _ measurable_subtype_coe _ hγ hst + · intro f + simp_rw [hres] + exact continuous_integral_visited (μ ∞) _ measurable_subtype_coe Subtype.val_injective + _ hγ f f.integrable + · intro K hK t + simp_rw [hres] + exact local_variation_visited (μ ∞) hκ b hcont K hK.measurableSet hK.measure_lt_top.ne t + · exact measurable_firstVisit _ measurable_subtype_coe _ hγ + · apply firstVisit_finite_of_exhaustion (μ ∞) _ measurable_subtype_coe _ hγ + intro A hA + simpa only [←hres] using hexh A hA + · intro t + rw [hres] + congr 1 + ext z + exact (firstVisit_le_iff _ _ hγ z t).symm + · intro t + rw [hres,restrict_strictFirstVisit (μ ∞) _ Subtype.val_injective _ hγ] + + + +lemma TraceMassFacts.capacity_increment_support {κ : ℝ} (hκ : 0<κ) {b : TDriver} + {μ : ℝ≥0∞→Measure UpperPlane} (hμ : TraceMassFacts κ b μ) + (s t : ℝ) (hs : 0 ≤ s) (hst : s ≤ t) : + (μ ((κ*t).toNNReal : ℝ≥0∞)-μ ((κ*s).toNNReal : ℝ≥0∞)) + {z : UpperPlane | z.1∉Target.trace κ b '' Icc s t}=0 := by + have hst' : (κ*s).toNNReal≤(κ*t).toNNReal := + Real.toNNReal_mono (mul_le_mul_of_nonneg_left hst hκ.le) + have h := hμ.increment_support _ _ hst' + have hs0 : 0≤κ*s := mul_nonneg hκ.le hs + have ht0 : 0≤κ*t := mul_nonneg hκ.le (hs.trans hst) + simpa only [internalTrace_image hκ,Real.coe_toNNReal _ hs0,Real.coe_toNNReal _ ht0, + mul_div_cancel_left₀ _ hκ.ne'] using h + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassContinuity +open GermPositivity + + + +def massTimeList (n : ℕ) : ℝ≥0∞ := + if n%4=0 then ∞ else if n%4=1 then ((n/4 : ℕ) : ℝ≥0) + else if n%4=2 then smallTime (n/4) + else TopologicalSpace.denseSeq ℝ≥0 (n/4) + +@[simp] lemma massTimeList_top : massTimeList 0=∞ := by simp [massTimeList] + +@[simp] lemma massTimeList_nat (n : ℕ) : massTimeList (4*n+1)=(n : ℝ≥0) := by + simp [massTimeList,Nat.mul_add_div] + +@[simp] lemma massTimeList_small (n : ℕ) : massTimeList (4*n+2)=(smallTime n : ℝ≥0∞) := by + simp [massTimeList,Nat.mul_add_div] + +@[simp] lemma massTimeList_dense (n : ℕ) : + massTimeList (4*n+3)=(TopologicalSpace.denseSeq ℝ≥0 n : ℝ≥0∞) := by + simp [massTimeList,Nat.mul_add_div] + +lemma massTimeList_is_dense : Dense {u : ℝ≥0 | ∃i,massTimeList i=u} := by + apply Dense.mono (s₁ := range (TopologicalSpace.denseSeq ℝ≥0)) _ + (TopologicalSpace.denseRange_denseSeq ℝ≥0) + rintro u ⟨n,rfl⟩ + exact ⟨4*n+3,massTimeList_dense n⟩ + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions TraceMassIntegration + + + +theorem actual_common_trace_mass (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + ∃ (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j), + (∀k j,j∈s k→k≤j) ∧ (∀k,∑j∈s k,c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + (∀v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀b, μ 0 b=0) ∧ (∀v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + μ ∞ ∘ₘ (W.map driverHomeomorph)=initialGreenMeasure (Target.a κ) ∧ + (∀ (S : ExactSLEGenerator.Driver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b => μ (S b) b) ∧ + (∀f : C_c(UpperPlane,ℝ), ∀m : ℕ, + MemLp (fun b => ∫z,f z∂μ (S b) b) (m:ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀K : Set UpperPlane, IsCompact K → ∀m : ℕ, + MemLp (fun b => (μ (S b) b K).toReal) (m:ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀f : C_c(UpperPlane,ℝ), Tendsto (fun k => eLpNorm + (fun b => (∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) (S b) b)-(∫z,f z∂μ (S b) b)) + 1 (W.map driverHomeomorph)) atTop (𝓝 0)) ∧ + (∀H : ExactSLEGenerator.Driver × UpperPlane→ℝ≥0∞, + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂(W.map driverHomeomorph))= + (∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂(W.map driverHomeomorph))+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen (Target.a κ) (S b) b z.1) + ∂upperArea∂(W.map driverHomeomorph))) ∧ + ∀ᵐ b ∂W, TraceMassFacts κ b (fun v => μ v (driverHomeomorph b)) ∧ + (∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v (driverHomeomorph b)) + atTop (𝓝 (∫z,f z∂μ v (driverHomeomorph b)))) := by + have hBW := brownian_map_driver W hW + have : IsProbabilityMeasure (W.map driverHomeomorph) := hBW.isGaussianProcess.isProbabilityMeasure + obtain ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,hpath⟩ := + actual_raw_mass_trace κ hκ hκ8 W hW massTimeList massTimeList_is_dense + (fun n => 4*n+1) massTimeList_nat (fun n => 4*n+2) massTimeList_small 0 massTimeList_top + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + have hcv : ∀ᵐ b ∂(W.map driverHomeomorph), ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), + Tendsto (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) atTop (𝓝 (∫z,f z∂μ v b)) := by + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + filter_upwards [hpath] with b hb + exact hb.2.2.2.1 + refine ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,?_,?_,?_⟩ + · simpa only [massTimeList_top] using hmean 0 massTimeList_top + · exact recoveredMass_all_stopping (Target.a κ) (a_gt_quarter hκ hκ8) + (W.map driverHomeomorph) hBW s c hc hs hsum hcv + · filter_upwards [hpath] with b hb + rcases hb with ⟨hcont,hatom,hres,hconv,hexh,hrem,hpos,hposK⟩ + let (v : ℝ≥0∞) : IsFiniteMeasureOnCompacts (μ v (driverHomeomorph b)) := (hreg _ _).1 + exact ⟨traceMassFacts_of_restrictions κ hκ b (fun v => μ v (driverHomeomorph b)) + hcont hatom hres hexh hrem hpos hposK,hconv⟩ + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGenerator + + +def concatenate (s : ℝ≥0) (b c : GDriver) : GDriver := + ⟨⟨fun u => b.1 (min u s)+c.1 (u-s), + (b.1.continuous.comp (continuous_id.min continuous_const)).add + (c.1.continuous.comp (continuous_id.sub continuous_const))⟩, + by + change b.1 (min 0 s)+c.1 (0-s)=0 + simp only [min_eq_left (show 0 ≤ s from bot_le),zero_tsub,b.2,c.2,add_zero]⟩ + +@[simp] lemma concatenate_apply (s u : ℝ≥0) (b c : GDriver) : + (concatenate s b c).1 u=b.1 (min u s)+c.1 (u-s) := rfl + +lemma continuous_concatenate : Continuous (fun p : (ℝ≥0×GDriver)×GDriver => + concatenate p.1.1 p.1.2 p.2) := by + apply Continuous.subtype_mk + apply ContinuousMap.continuous_of_continuous_uncurry + exact (continuous_eval.comp + ((continuous_subtype_val.comp continuous_fst.fst.snd).prodMk + (continuous_snd.min continuous_fst.fst.fst))).add + (continuous_eval.comp + ((continuous_subtype_val.comp continuous_fst.snd).prodMk + (continuous_snd.sub continuous_fst.fst.fst))) + +lemma concatenate_before (s : ℝ≥0) (b c : GDriver) (u : ℝ≥0) (hu : u ≤ s) : + (concatenate s b c).1 u=b.1 u := by + simp only [concatenate_apply,min_eq_left hu,tsub_eq_zero_of_le hu,c.2,add_zero] + +lemma concatenate_reconstruct (s : ℝ≥0) (b : GDriver) : + concatenate s (pastDriver s b) (restart s b)=b := by + apply Subtype.ext + ext u + by_cases hu : u ≤ s + · rw [concatenate_before _ _ _ _ hu,pastDriver_eq _ _ _ hu] + · have hsu : s ≤ u := le_of_not_ge hu + simp only [concatenate_apply,min_eq_right hsu,restart_apply,pastDriver_eq s b s le_rfl, + add_tsub_cancel_of_le hsu] + ring + + +lemma raw_event_congr {u : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[rawFiltration u] A) {b c : GDriver} + (h : ∀v ≤ u,b.1 v=c.1 v) : b∈A ↔ c∈A := by + rw [rawFiltration,Filtration.natural_eq_comap,MeasurableSpace.measurableSet_comap] at hA + obtain ⟨B,hB,rfl⟩ := hA + have he : (fun v : Iic u => b.1 v)=(fun v : Iic u => c.1 v) := + funext (fun v => h v v.2) + change (fun v : Iic u => b.1 v)∈B ↔ (fun v : Iic u => c.1 v)∈B + rw [he] + + +lemma raw_stop_congr {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {b c : GDriver} {s : ℝ≥0} (hb : S b=s) (h : ∀u ≤ s,b.1 u=c.1 u) : S c=s := by + have hc : S c ≤ s := (raw_event_congr (hS s) h).mp (by + change S b ≤ (s:ℝ≥0∞) + rw [hb]) + have hcf : S c≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top hc + have hct : (S c).toNNReal ≤ s := ENNReal.coe_le_coe.mp (by + simpa only [ENNReal.coe_toNNReal hcf] using hc) + have hbc : S b ≤ S c := by + have hh := (raw_event_congr (hS (S c).toNNReal) + (fun u hu => h u (hu.trans hct))).mpr + (show S c ≤ ((S c).toNNReal:ℝ≥0∞) by rw [ENNReal.coe_toNNReal hcf]) + change S b ≤ ((S c).toNNReal:ℝ≥0∞) at hh + simpa only [ENNReal.coe_toNNReal hcf] using hh + exact le_antisymm hc (hb ▸ hbc) + + +def shiftStop (S : GDriver→ℝ≥0∞) (t : ℝ≥0) : GDriver→ℝ≥0∞ := fun b => S b+t + +lemma shiftStop_isStoppingTime {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + (t : ℝ≥0) : IsStoppingTime rawFiltration (shiftStop S t) := by + intro u + change MeasurableSet[rawFiltration u] {b | shiftStop S t b ≤ (u:ℝ≥0∞)} + by_cases htu : t ≤ u + · have he : {b : GDriver | shiftStop S t b ≤ u}={b | S b ≤ ((u-t:ℝ≥0):ℝ≥0∞)} := by + ext b + simp only [shiftStop,mem_ofPred_eq,ENNReal.coe_sub] + exact (ENNReal.le_sub_iff_add_le_right ENNReal.coe_ne_top + (ENNReal.coe_le_coe.mpr htu)).symm + rw [he] + exact (rawFiltration.mono tsub_le_self) _ (hS (u-t)) + · have he : {b : GDriver | shiftStop S t b ≤ u}=∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro b hb + exact htu (ENNReal.coe_le_coe.mp ((le_add_left le_rfl).trans hb)) + rw [he] + exact @MeasurableSet.empty GDriver (rawFiltration u) + +lemma measurableSpace_le_shiftStop {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) (t : ℝ≥0) : + hS.measurableSpace ≤ (shiftStop_isStoppingTime hS t).measurableSpace := + hS.measurableSpace_mono (shiftStop_isStoppingTime hS t) (fun b => show S b ≤ S b+(t:ℝ≥0∞) from le_self_add) + + +lemma raw_stopped_event_congr {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) + {b c : GDriver} {u : ℝ≥0} (hb : S b ≤ u) (h : ∀v ≤ u,b.1 v=c.1 v) : b∈A ↔ c∈A := by + have hc : S c ≤ u := (raw_event_congr (hS u) h).mp hb + have hh := raw_event_congr (hA.2 u) h + change (b∈A ∧ S b ≤ (u:ℝ≥0∞)) ↔ (c∈A ∧ S c ≤ (u:ℝ≥0∞)) at hh + simpa only [hb,hc,and_true] using hh + + + +def concatenatedEvent (S : GDriver→ℝ≥0∞) (A : Set GDriver) : + Set ((ℝ≥0×GDriver)×GDriver) := + {p | S (concatenate p.1.1 p.1.2 p.2) ≤ (p.1.1:ℝ≥0∞) ∧ + concatenate p.1.1 p.1.2 p.2∈A} + +lemma concatenatedEvent_measurable {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) {A : Set GDriver} (hA : MeasurableSet A) : + MeasurableSet (concatenatedEvent S A) := by + have : PolishSpace GDriver := (isClosed_eq (continuous_eval_const 0) continuous_const).polishSpace + have hc : Measurable (fun p : (ℝ≥0×GDriver)×GDriver => concatenate p.1.1 p.1.2 p.2) := + continuous_concatenate.measurable + have ht : Measurable (fun p : (ℝ≥0×GDriver)×GDriver => (p.1.1:ℝ≥0∞)) := + ENNReal.continuous_coe.measurable.comp measurable_fst.fst + exact (measurableSet_le (hS.measurable'.comp hc) ht).inter (hc hA) + +lemma concatenatedEvent_past {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) + (s : ℝ≥0) (b c : GDriver) : + ((s,b),c)∈concatenatedEvent S A ↔ ((s,b),pastDriver t c)∈concatenatedEvent S A := by + have hsmall : ∀u ≤ s,(concatenate s b c).1 u=(concatenate s b (pastDriver t c)).1 u := by + intro u hu + rw [concatenate_before _ _ _ _ hu,concatenate_before _ _ _ _ hu] + have hlong : ∀u ≤ s+t,(concatenate s b c).1 u=(concatenate s b (pastDriver t c)).1 u := by + intro u hu + simp only [concatenate_apply] + rw [pastDriver_eq t c (u-s) (tsub_le_iff_right.mpr (by simpa only [add_comm] using hu))] + have hg := raw_event_congr (hS s) hsmall + change (S (concatenate s b c) ≤ (s:ℝ≥0∞) ∧ concatenate s b c∈A) ↔ + (S (concatenate s b (pastDriver t c)) ≤ (s:ℝ≥0∞) ∧ + concatenate s b (pastDriver t c)∈A) + change (S (concatenate s b c) ≤ (s:ℝ≥0∞)) ↔ + (S (concatenate s b (pastDriver t c)) ≤ (s:ℝ≥0∞)) at hg + rw [←hg] + apply and_congr_right + intro h + exact raw_stopped_event_congr (shiftStop_isStoppingTime hS t) hA + (by + change S (concatenate s b c)+(t:ℝ≥0∞) ≤ ((s+t:ℝ≥0):ℝ≥0∞) + rw [ENNReal.coe_add] + exact add_le_add h le_rfl) hlong + +lemma concatenatedEvent_raw_joint {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) : + @MeasurableSet ((ℝ≥0×GDriver)×GDriver) + ((inferInstance : MeasurableSpace (ℝ≥0×GDriver)).prod (rawFiltration t)) + (concatenatedEvent S A) := by + have hM : @Measurable ((ℝ≥0×GDriver)×GDriver) ((ℝ≥0×GDriver)×GDriver) + ((inferInstance : MeasurableSpace (ℝ≥0×GDriver)).prod (rawFiltration t)) inferInstance + (fun p => (p.1,pastDriver t p.2)) := + measurable_fst.prodMk ((pastDriver_raw_measurable t).comp measurable_snd) + have hh := hM (concatenatedEvent_measurable hS + ((shiftStop_isStoppingTime hS t).measurableSpace_le A hA)) + convert hh using 1 + ext p + exact concatenatedEvent_past hS hA p.1.1 p.1.2 p.2 + +lemma concatenatedEvent_stoppedData {S : GDriver→ℝ≥0∞} {A : Set GDriver} + {b : GDriver} (hb : S b≠∞) : + (stoppedData S b,restartAt S b)∈concatenatedEvent S A ↔ b∈A := by + simp only [concatenatedEvent,stoppedData,restartAt,mem_ofPred_eq,concatenate_reconstruct, + ENNReal.coe_toNNReal hb,le_refl,true_and] + +end SLEExactGauge.LoewnerRestart +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ConformalFlow.lean b/lean/OAI/Probability/SLEGauge/ConformalFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc880db4f3f0cd1446b5cdc47d5148bcfa33e7f5 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ConformalFlow.lean @@ -0,0 +1,450 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.LoewnerSolutions + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +namespace ExactSLEMain +open Set Metric +theorem hasDerivAt_loewnerMap {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {T : ℝ≥0} {z : ℂ} (hz : alive A b T z) : + HasDerivAt (loewnerMap A b T) + (Complex.exp (∫ u in (0 : ℝ)..(T : ℝ), + -(A : ℂ) / (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ))^2)) z := by + obtain ⟨ε,δ,F,hε,hδ,hFc,hFe,hode,hmap,hIm⟩ := loewner_local_cutoff hb hz + have hzball : z ∈ ball z δ := mem_ball_self hδ + let q : ℂ → ℝ → ℂ := fun w u => -(A : ℂ) / + (heightClamp ε (F u.toNNReal w - (b u.toNNReal : ℂ)) * + heightClamp ε (F u.toNNReal z - (b u.toNNReal : ℂ))) + have hqc (w : ℂ) : Continuous (q w) := continuous_const.div + (((heightClamp_lipschitz ε).continuous.comp + (((hFc w).comp continuous_real_toNNReal).sub + (Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal)))).mul + ((heightClamp_lipschitz ε).continuous.comp + (((hFc z).comp continuous_real_toNNReal).sub + (Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal))))) + (fun u => mul_ne_zero (heightClamp_ne_zero hε _) (heightClamp_ne_zero hε _)) + have hqw (u : ℝ) : Continuous (fun w => q w u) := continuous_const.div + ((((heightClamp_lipschitz ε).continuous.comp + ((cutoff_loewner_continuous_start hε hb hFc hFe u.toNNReal).sub continuous_const))).mul + continuous_const) + (fun w => mul_ne_zero (heightClamp_ne_zero hε _) (heightClamp_ne_zero hε _)) + have hIc : Continuous (fun w => ∫ u in (0 : ℝ)..(T : ℝ), q w u) := + intervalIntegral.continuous_of_dominated_interval + (fun w => (hqc w).aestronglyMeasurable) + (fun w => ae_of_all volume (fun u hu => invprod_heightClamp_bound A ε hε _ _)) + (show IntervalIntegrable (fun _ : ℝ => |A|/ε^2) volume 0 T from intervalIntegrable_const) + (ae_of_all volume (fun u hu => hqw u)) + have hqe (w : ℂ) (hw : w ∈ ball z δ) (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + q w u = -(A : ℂ) / + ((F u.toNNReal w - (b u.toNNReal : ℂ)) * (F u.toNNReal z - (b u.toNNReal : ℂ))) := by + have huT : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have hc₁ : heightClamp ε (F u.toNNReal w - (b u.toNNReal : ℂ)) = + F u.toNNReal w - (b u.toNNReal : ℂ) := heightClamp_eq (by simpa using (hIm w hw _ huT).le) + have hc₂ : heightClamp ε (F u.toNNReal z - (b u.toNNReal : ℂ)) = + F u.toNNReal z - (b u.toNNReal : ℂ) := heightClamp_eq (by simpa using (hIm z hzball _ huT).le) + simp only [q,hc₁,hc₂] + have hIe (w : ℂ) (hw : w ∈ ball z δ) : + (∫ u in (0 : ℝ)..(T : ℝ), q w u) = + ∫ u in (0 : ℝ)..(T : ℝ), -(A : ℂ) / + ((F u.toNNReal w - (b u.toNNReal : ℂ)) * (F u.toNNReal z - (b u.toNNReal : ℂ))) := by + apply intervalIntegral.integral_congr + intro u hu + exact hqe w hw u (by simpa only [uIcc_of_le T.coe_nonneg] using hu) + have hIz : (∫ u in (0 : ℝ)..(T : ℝ), q z u) = + ∫ u in (0 : ℝ)..(T : ℝ), + -(A : ℂ) / (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ))^2 := by + rw [hIe z hzball] + apply intervalIntegral.integral_congr + intro u hu + have hu' : u ∈ Icc (0 : ℝ) T := by simpa only [uIcc_of_le T.coe_nonneg] using hu + have huT : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu'.2).trans_eq (by simp) + dsimp only + rw [hmap z hzball _ huT,pow_two] + rw [← hIz,hasDerivAt_iff_tendsto_slope] + have ht := (Complex.continuous_exp.comp hIc).continuousAt.tendsto.mono_left + (nhdsWithin_le_nhds : 𝓝[≠] z ≤ 𝓝 z) + apply ht.congr' + filter_upwards [Filter.Eventually.filter_mono nhdsWithin_le_nhds + (show ∀ᶠ w in 𝓝 z, w ∈ ball z δ from Metric.ball_mem_nhds z hδ), + self_mem_nhdsWithin] with w hw hwn + have hwz : w ≠ z := by simpa only [mem_compl_iff,mem_singleton_iff] using hwn + have hd := loewner_solution_difference hb (hode w hw) (hode z hzball) + simp only [Real.toNNReal_coe] at hd + rw [← hIe w hw] at hd + rw [slope,vsub_eq_sub,smul_eq_mul,hmap w hw T le_rfl,hmap z hzball T le_rfl,hd] + rw [← mul_assoc,inv_mul_cancel₀ (sub_ne_zero.mpr hwz),one_mul] + rfl + +lemma deriv_loewnerMap_ne_zero {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {T : ℝ≥0} {z : ℂ} (hz : alive A b T z) : deriv (loewnerMap A b T) z ≠ 0 := by + rw [(hasDerivAt_loewnerMap hb hz).deriv] + exact Complex.exp_ne_zero _ + +end ExactSLEMain + +namespace ExactSLEMain +open Set + +lemma loewnerMap_eq_solution_time {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {T : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z T f) {u : ℝ} (hu : u ∈ Icc (0 : ℝ) T) : + loewnerMap A b u.toNNReal z = f u := by + have huT : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + simpa only [Real.coe_toNNReal _ hu.1] using loewnerMap_eq (odeUntil_mono hf huT) + +lemma odeUntil_center_ne_zero {A : ℝ} {b : ℝ≥0 → ℝ} {z : ℂ} {T : ℝ≥0} + {f : ℝ → ℂ} (hf : odeUntil A b z T f) {u : ℝ} (hu : u ∈ Icc (0 : ℝ) T) : + f u - (b u.toNNReal : ℂ) ≠ 0 := by + intro he + have hi := congrArg Complex.im he + have hp := (hf.2 u hu).1 + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + linarith + +lemma odeUntil_center_continuousOn {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil A b z T f) : + ContinuousOn (fun u : ℝ => f u - (b u.toNNReal : ℂ)) (Icc (0 : ℝ) T) := + (odeUntil_continuousOn hf).sub + (Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal)).continuousOn + +lemma loewner_derivative_integrable {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {T : ℝ≥0} {z : ℂ} (hz : alive A b T z) : + IntervalIntegrable (fun u : ℝ => -(A : ℂ) / + (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ))^2) volume 0 T := by + obtain ⟨f,hf⟩ := hz + have hc : ContinuousOn (fun u : ℝ => -(A : ℂ) / (f u - (b u.toNNReal : ℂ))^2) + (Icc (0 : ℝ) T) := continuousOn_const.div + ((odeUntil_center_continuousOn hb hf).pow 2) + (fun u hu => pow_ne_zero 2 (odeUntil_center_ne_zero hf hu)) + apply (hc.intervalIntegrable_of_Icc T.coe_nonneg).congr + intro u hu + dsimp only + rw [loewnerMap_eq_solution_time hf (by + simpa only [uIcc_of_le T.coe_nonneg] using (uIoc_subset_uIcc hu))] + + + +theorem log_norm_deriv_loewnerMap {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {T : ℝ≥0} {z : ℂ} (hz : alive A b T z) : + Real.log ‖deriv (loewnerMap A b T) z‖ = + ∫ u in (0 : ℝ)..(T : ℝ), (-(A : ℂ) / + (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ))^2).re := by + rw [(hasDerivAt_loewnerMap hb hz).deriv,Complex.norm_exp,Real.log_exp] + exact (Complex.reCLM.intervalIntegral_comp_comm (loewner_derivative_integrable hb hz)).symm + +lemma loewner_radius_drift (A : ℝ) (z : ℂ) (hz : z ≠ 0) : + -A / Complex.normSq z - (-(A : ℂ)/z^2).re = + -2*A*(z.im/Complex.normSq z)^2 := by + have hn : Complex.normSq z ≠ 0 := (Complex.normSq_pos.mpr hz).ne' + simp only [Complex.div_re,Complex.neg_re,Complex.ofReal_re,Complex.neg_im, + Complex.ofReal_im,neg_zero,zero_mul,zero_div,add_zero,map_pow] + field_simp + simp only [pow_two,Complex.mul_re,Complex.normSq_apply] + ring + +lemma real_scalar_linear_solution_on (H c : ℝ → ℝ) (T : ℝ≥0) + (hc : ContinuousOn c (Icc (0 : ℝ) T)) + (hH : ∀ u ∈ Icc (0 : ℝ) T, HasDerivWithinAt H (c u * H u) (Icc (0 : ℝ) T) u) : + H T = H 0 * Real.exp (∫ u in (0 : ℝ)..(T : ℝ), c u) := by + have hc' : ContinuousOn (fun u => (c u : ℂ)) (Icc (0 : ℝ) T) := + Complex.continuous_ofReal.comp_continuousOn hc + have hd (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun u => (H u : ℂ)) ((c u : ℂ)*(H u : ℂ)) (Icc (0 : ℝ) T) u := by + simpa only [Complex.ofReal_mul] using (hH u hu).ofReal_comp + have he := scalar_linear_solution_on (fun u => (H u : ℂ)) (fun u => (c u : ℂ)) T hc' hd + have hi := Complex.ofRealCLM.intervalIntegral_comp_comm (μ := volume) (hc.intervalIntegrable_of_Icc T.coe_nonneg) + change (∫ u in (0 : ℝ)..(T : ℝ), (c u : ℂ)) = (∫ u in (0 : ℝ)..(T : ℝ), c u) at hi + rw [hi,← Complex.ofReal_exp,← Complex.ofReal_mul] at he + exact Complex.ofReal_injective he + + +theorem loewner_height_formula {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil A b z T f) : + (f T).im = z.im * Real.exp (∫ u in (0 : ℝ)..(T : ℝ), + -A / Complex.normSq (f u - (b u.toNNReal : ℂ))) := by + have hc : ContinuousOn (fun u : ℝ => -A / Complex.normSq (f u - (b u.toNNReal : ℂ))) + (Icc (0 : ℝ) T) := continuousOn_const.div + (Complex.continuous_normSq.comp_continuousOn (odeUntil_center_continuousOn hb hf)) + (fun u hu => (Complex.normSq_pos.mpr (odeUntil_center_ne_zero hf hu)).ne') + have hd (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun u => (f u).im) + ((-A / Complex.normSq (f u - (b u.toNNReal : ℂ))) * (f u).im) (Icc (0 : ℝ) T) u := by + have h := Complex.imCLM.hasFDerivAt.comp_hasDerivWithinAt u (hf.2 u hu).2 + convert h using 1 <;> try rfl + simp only [Complex.imCLM_apply,Complex.div_im,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,zero_div,zero_sub,Complex.sub_im,sub_zero] + ring + simpa only [hf.1] using real_scalar_linear_solution_on (fun u => (f u).im) _ T hc hd + + + +theorem loewner_radius_ratio {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hz : alive A b T z) : + (loewnerMap A b T z).im / ‖deriv (loewnerMap A b T) z‖ = + z.im * Real.exp (-2*A * (∫ u in (0 : ℝ)..(T : ℝ), + ((loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ)).im / + Complex.normSq (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ)))^2)) := by + obtain ⟨f,hf⟩ := hz + have hz : alive A b T z := ⟨f,hf⟩ + let Z : ℝ → ℂ := fun u => f u - (b u.toNNReal : ℂ) + have hZc : ContinuousOn Z (Icc (0 : ℝ) T) := odeUntil_center_continuousOn hb hf + have hZn (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : Z u ≠ 0 := odeUntil_center_ne_zero hf hu + have hJc : ContinuousOn (fun u => (-(A : ℂ)/(Z u)^2).re) (Icc (0 : ℝ) T) := + Complex.continuous_re.comp_continuousOn + (continuousOn_const.div (hZc.pow 2) (fun u hu => pow_ne_zero 2 (hZn u hu))) + have hYc : ContinuousOn (fun u => -A/Complex.normSq (Z u)) (Icc (0 : ℝ) T) := + continuousOn_const.div (Complex.continuous_normSq.comp_continuousOn hZc) + (fun u hu => (Complex.normSq_pos.mpr (hZn u hu)).ne') + have hJe : (∫ u in (0 : ℝ)..(T : ℝ), (-(A : ℂ)/ + (loewnerMap A b u.toNNReal z - (b u.toNNReal : ℂ))^2).re) = + ∫ u in (0 : ℝ)..(T : ℝ), (-(A : ℂ)/(Z u)^2).re := by + apply intervalIntegral.integral_congr + intro u hu + dsimp only [Z] + rw [loewnerMap_eq_solution_time hf (by simpa only [uIcc_of_le T.coe_nonneg] using hu)] + have hi : (∫ u in (0 : ℝ)..(T : ℝ), -A/Complex.normSq (Z u)) - + (∫ u in (0 : ℝ)..(T : ℝ), (-(A : ℂ)/(Z u)^2).re) = + -2*A*(∫ u in (0 : ℝ)..(T : ℝ), ((Z u).im/Complex.normSq (Z u))^2) := by + rw [← intervalIntegral.integral_sub (hYc.intervalIntegrable_of_Icc T.coe_nonneg) + (hJc.intervalIntegrable_of_Icc T.coe_nonneg),← intervalIntegral.integral_const_mul] + apply intervalIntegral.integral_congr + intro u hu + exact loewner_radius_drift A (Z u) (hZn u (by simpa only [uIcc_of_le T.coe_nonneg] using hu)) + have hd : ‖deriv (loewnerMap A b T) z‖ = + Real.exp (∫ u in (0 : ℝ)..(T : ℝ), (-(A : ℂ)/(Z u)^2).re) := by + rw [← hJe, ← log_norm_deriv_loewnerMap hb hz,Real.exp_log (norm_pos_iff.mpr (deriv_loewnerMap_ne_zero hb hz))] + rw [loewnerMap_eq hf,loewner_height_formula hb hf,hd,mul_div_assoc,← Real.exp_sub] + change z.im * Real.exp ((∫ u in (0 : ℝ)..(T : ℝ), -A/Complex.normSq (Z u)) - _) = _ + rw [hi] + congr 3 + apply intervalIntegral.integral_congr + intro u hu + dsimp only [Z] + rw [loewnerMap_eq_solution_time hf (by simpa only [uIcc_of_le T.coe_nonneg] using hu)] + +end ExactSLEMain + +namespace ExactSLEGreen +abbrev State := ℂ × ℝ +noncomputable def X : State →L[ℝ] ℝ := Complex.reCLM.comp (ContinuousLinearMap.fst ℝ ℂ ℝ) +noncomputable def Y : State →L[ℝ] ℝ := Complex.imCLM.comp (ContinuousLinearMap.fst ℝ ℂ ℝ) +noncomputable def J : State →L[ℝ] ℝ := ContinuousLinearMap.snd ℝ ℂ ℝ +noncomputable def Q (v : State) : ℝ := (X v)^2 + (Y v)^2 +noncomputable def p (a : ℝ) : ℝ := 4*a-1 +noncomputable def alpha (a : ℝ) : ℝ := 1-1/(4*a) +noncomputable def logGreen (a : ℝ) (v : State) : ℝ := + alpha a * J v + (p a-alpha a)*Real.log (Y v) - (p a/2)*Real.log (Q v) +noncomputable def physicalGreen (a : ℝ) (v : State) : ℝ := Real.exp (logGreen a v) +noncomputable def logGreenDeriv (a : ℝ) (v : State) : State →L[ℝ] ℝ := + alpha a • J + ((p a-alpha a)/(Y v)) • Y - ((p a/2)/(Q v)) • + ((2*X v) • X + (2*Y v) • Y) +noncomputable def physicalDrift (a : ℝ) (v : State) : State := + ((a : ℂ)/v.1, (-(a : ℂ)/v.1^2).re) +def noise : State := (-1,0) + +@[simp] lemma X_apply (v : State) : X v = v.1.re := rfl +@[simp] lemma Y_apply (v : State) : Y v = v.1.im := rfl +@[simp] lemma J_apply (v : State) : J v = v.2 := rfl +lemma Q_eq (v : State) : Q v = Complex.normSq v.1 := by + simp only [Q,X_apply,Y_apply,Complex.normSq_apply,pow_two] +lemma Q_pos {v : State} (hv : 0 < Y v) : 0 < Q v := by + change 0 < X v ^ 2 + Y v ^ 2 + nlinarith [sq_nonneg (X v),sq_pos_of_pos hv] + +lemma hasFDerivAt_Q (v : State) : + HasFDerivAt Q ((2*X v) • X + (2*Y v) • Y) v := by + have hX : HasFDerivAt (fun v => X v) X v := X.hasFDerivAt + have hY : HasFDerivAt (fun v => Y v) Y v := Y.hasFDerivAt + convert (hX.pow 2).add (hY.pow 2) using 1 <;> try rfl + simp only [Nat.reduceSub,pow_one,nsmul_eq_mul,Nat.cast_ofNat] + +lemma hasFDerivAt_logGreen (a : ℝ) (v : State) (hv : 0 < Y v) : + HasFDerivAt (logGreen a) (logGreenDeriv a v) v := by + have hY := Y.hasFDerivAt.log hv.ne' + have hQ := (hasFDerivAt_Q v).log (Q_pos hv).ne' + convert ((J.hasFDerivAt.const_mul (alpha a)).add (hY.const_mul (p a-alpha a))).sub + (hQ.const_mul (p a/2)) using 1 <;> try rfl + simp only [logGreenDeriv,smul_smul,div_eq_mul_inv] + +lemma hasFDerivAt_physicalGreen (a : ℝ) (v : State) (hv : 0 < Y v) : + HasFDerivAt (physicalGreen a) (physicalGreen a v • logGreenDeriv a v) v := + (hasFDerivAt_logGreen a v hv).exp + +lemma contDiffAt_physicalGreen (a : ℝ) (v : State) (hv : 0 < Y v) : + ContDiffAt ℝ (↑(⊤ : ℕ∞)) (physicalGreen a) v := by + have hQc : ContDiff ℝ (↑(⊤ : ℕ∞)) Q := (X.contDiff.pow 2).add (Y.contDiff.pow 2) + exact ((((contDiffAt_const (c := alpha a)).mul (J.contDiff.contDiffAt)).add + ((contDiffAt_const (c := p a-alpha a)).mul (Y.contDiff.contDiffAt.log hv.ne'))).sub + ((contDiffAt_const (c := p a/2)).mul (hQc.contDiffAt.log (Q_pos hv).ne'))).exp + +lemma logGreenDeriv_noise (a : ℝ) (v : State) : + logGreenDeriv a v noise = p a * X v / Q v := by + simp only [logGreenDeriv,add_apply,sub_apply, + smul_apply,smul_eq_mul,noise,X_apply,Y_apply,J_apply, + Complex.neg_re,Complex.one_re,Complex.neg_im,Complex.one_im,neg_zero,mul_zero, + mul_neg,mul_one,add_zero,zero_sub] + ring + +lemma logGreenDeriv_drift (a : ℝ) (v : State) (hv : 0 < Y v) : + logGreenDeriv a v (physicalDrift a v) = + -a*(alpha a+p a)*(X v^2-Y v^2)/(Q v)^2 - a*(p a-alpha a)/(Q v) := by + have hy : Y v ≠ 0 := hv.ne' + have hq : Q v ≠ 0 := (Q_pos hv).ne' + simp only [logGreenDeriv,add_apply,sub_apply, + smul_apply,smul_eq_mul,physicalDrift,X_apply,Y_apply,J_apply, + Complex.div_re,Complex.div_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.neg_re,Complex.neg_im,neg_zero,zero_mul,zero_div,add_zero,zero_sub,map_pow] + simp only [← Q_eq,pow_two,Complex.mul_re] + change alpha a * (-a * (X v*X v-Y v*Y v)/(Q v*Q v)) + + ((p a-alpha a)/Y v)*(- (a*Y v/Q v)) - ((p a/2)/Q v)* + (2*X v*(a*X v/Q v) + 2*Y v*(- (a*Y v/Q v))) = _ + field_simp + simp only [X_apply,Y_apply] + ring + +noncomputable def noiseLog (a : ℝ) (v : State) : ℝ := p a * X v / Q v +noncomputable def noiseLogDeriv (a : ℝ) (v : State) : State →L[ℝ] ℝ := + (p a / Q v) • X - (p a * X v / Q v^2) • ((2*X v) • X + (2*Y v) • Y) + +lemma hasFDerivAt_noiseLog (a : ℝ) (v : State) (hv : 0 < Y v) : + HasFDerivAt (noiseLog a) (noiseLogDeriv a v) v := by + have hQinv := (hasDerivAt_inv (Q_pos hv).ne').comp_hasFDerivAt v (hasFDerivAt_Q v) + convert (X.hasFDerivAt.const_mul (p a)).mul hQinv using 1 <;> try rfl + apply ContinuousLinearMap.ext + intro w + simp only [noiseLogDeriv,smul_apply,sub_apply, + add_apply, smul_eq_mul,smul_smul,Function.comp_apply] + ring + +lemma noiseLogDeriv_noise (a : ℝ) (v : State) (hv : 0 < Y v) : + noiseLogDeriv a v noise = p a * (X v^2-Y v^2)/(Q v)^2 := by + have hq := (Q_pos hv).ne' + simp only [noiseLogDeriv,sub_apply,smul_apply,add_apply, + smul_eq_mul,noise,X_apply,Y_apply,Complex.neg_re,Complex.one_re, + Complex.neg_im,Complex.one_im,neg_zero,mul_zero,mul_neg,mul_one,add_zero] + field_simp + unfold Q + simp only [X_apply,Y_apply] + ring + +lemma green_fderiv_noise (a : ℝ) (v : State) (hv : 0 < Y v) : + fderiv ℝ (physicalGreen a) v noise = physicalGreen a v * noiseLog a v := by + rw [(hasFDerivAt_physicalGreen a v hv).fderiv] + simp only [smul_apply,smul_eq_mul,logGreenDeriv_noise,noiseLog] + +lemma hasFDerivAt_green_noise (a : ℝ) (v : State) (hv : 0 < Y v) : + HasFDerivAt (fun w => fderiv ℝ (physicalGreen a) w noise) + ((noiseLog a v) • (physicalGreen a v • logGreenDeriv a v) + + (physicalGreen a v) • noiseLogDeriv a v) v := by + have h := (hasFDerivAt_physicalGreen a v hv).mul (hasFDerivAt_noiseLog a v hv) + rw [add_comm] + apply h.congr_of_eventuallyEq + filter_upwards [Y.continuous.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hv)] with w hw + exact green_fderiv_noise a w hw + +lemma green_second_noise (a : ℝ) (v : State) (hv : 0 < Y v) : + fderiv ℝ (fun w => fderiv ℝ (physicalGreen a) w noise) v noise = + physicalGreen a v * ((p a)^2 * (X v)^2 + p a * (X v^2-Y v^2)) / (Q v)^2 := by + rw [(hasFDerivAt_green_noise a v hv).fderiv] + simp only [add_apply,smul_apply,smul_eq_mul, + logGreenDeriv_noise, noiseLogDeriv_noise a v hv,noiseLog] + ring + + +lemma green_generator_zero (a : ℝ) (ha : a ≠ 0) (v : State) (hv : 0 < Y v) : + (1/2 : ℝ) * fderiv ℝ (fun w => fderiv ℝ (physicalGreen a) w noise) v noise + + fderiv ℝ (physicalGreen a) v (physicalDrift a v) = 0 := by + rw [green_second_noise a v hv,(hasFDerivAt_physicalGreen a v hv).fderiv] + simp only [smul_apply,smul_eq_mul,logGreenDeriv_drift a v hv] + have hq := (Q_pos hv).ne' + unfold alpha p + field_simp + unfold Q + ring + +end ExactSLEGreen + +namespace ExactSLEGreen +open Metric + +def spaceBump (N : ℝ≥0) : ContDiffBump (0 : State) where + rIn := N+1 + rOut := N+2 + rIn_pos := by positivity + rIn_lt_rOut := by linarith + +noncomputable def heightTurn (ε : ℝ) (v : State) : ℝ := + Real.smoothTransition (4 * Y v / ε - 1) + +noncomputable def greenCutoff (a ε : ℝ) (N : ℝ≥0) (v : State) : ℝ := + spaceBump N v * heightTurn ε v * physicalGreen a v + +lemma heightTurn_smooth (ε : ℝ) : ContDiff ℝ (↑(⊤ : ℕ∞)) (heightTurn ε) := by + exact Real.smoothTransition.contDiff.comp + (((contDiff_const.mul Y.contDiff).div_const ε).sub contDiff_const) + +lemma heightTurn_zero {ε : ℝ} (hε : 0 < ε) {v : State} (hv : Y v ≤ ε/4) : + heightTurn ε v = 0 := by + apply Real.smoothTransition.zero_of_nonpos + rw [sub_nonpos,div_le_iff₀ hε] + linarith + +lemma heightTurn_one {ε : ℝ} (hε : 0 < ε) {v : State} (hv : ε/2 ≤ Y v) : + heightTurn ε v = 1 := by + apply Real.smoothTransition.one_of_one_le + rw [le_sub_iff_add_le,le_div_iff₀ hε] + linarith + +lemma greenCutoff_smooth (a ε : ℝ) (hε : 0 < ε) (N : ℝ≥0) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (greenCutoff a ε N) := by + rw [contDiff_iff_contDiffAt] + intro v + by_cases hv : 0 < Y v + · exact (((spaceBump N).contDiffAt.mul (heightTurn_smooth ε).contDiffAt).mul + (contDiffAt_physicalGreen a v hv)) + · apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + have hv' : Y v < ε/4 := lt_of_le_of_lt (le_of_not_gt hv) (by positivity) + filter_upwards [Y.continuous.continuousAt.preimage_mem_nhds (Iio_mem_nhds hv')] with w hw + simp only [greenCutoff,heightTurn_zero hε (le_of_lt hw),mul_zero,zero_mul] + +lemma greenCutoff_compact (a ε : ℝ) (N : ℝ≥0) : HasCompactSupport (greenCutoff a ε N) := + ((spaceBump N).hasCompactSupport.mul_right).mul_right + +lemma greenCutoff_eq_near (a ε : ℝ) (hε : 0 < ε) (N : ℝ≥0) + (v : State) (hv : ‖v‖ ≤ N) (hy : ε ≤ Y v) : + greenCutoff a ε N =ᶠ[𝓝 v] physicalGreen a := by + have hv' : v ∈ ball (0 : State) (spaceBump N).rIn := by + simp only [mem_ball,dist_zero_right,spaceBump] + linarith + have hy' : ε/2 < Y v := lt_of_lt_of_le (by linarith) hy + filter_upwards [(spaceBump N).eventuallyEq_one_of_mem_ball hv', + Y.continuous.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hy')] with w hw hyw + simp only [greenCutoff,hw,heightTurn_one hε (le_of_lt hyw),Pi.one_apply,one_mul] + +lemma greenCutoff_generator_zero (a ε : ℝ) (ha : a ≠ 0) (hε : 0 < ε) (N : ℝ≥0) + (v : State) (hv : ‖v‖ ≤ N) (hy : ε ≤ Y v) : + (1/2 : ℝ) * fderiv ℝ (fun w => fderiv ℝ (greenCutoff a ε N) w noise) v noise + + fderiv ℝ (greenCutoff a ε N) v (physicalDrift a v) = 0 := by + have he := greenCutoff_eq_near a ε hε N v hv hy + have hd : (fun w => fderiv ℝ (greenCutoff a ε N) w noise) =ᶠ[𝓝 v] + (fun w => fderiv ℝ (physicalGreen a) w noise) := + he.fderiv.mono fun w hw => congrArg (fun f : State →L[ℝ] ℝ => f noise) hw + rw [hd.fderiv_eq,he.fderiv_eq] + exact green_generator_zero a ha v (hε.trans_le hy) + +end ExactSLEGreen + +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ConformalRestartMap.lean b/lean/OAI/Probability/SLEGauge/ConformalRestartMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..43ddcbc81ff3ccfbaefb4445540bae244cb748cc --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ConformalRestartMap.lean @@ -0,0 +1,550 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.OptionalGreen + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen + +lemma literal_parameter (a : ℝ) : Target.a (2/a)=a := div_div_cancel₀ (by norm_num : (2:ℝ)≠0) + +lemma literal_flow (a : ℝ) (b : GDriver) (z : ℂ) (t : ℝ≥0) : + LiteralTrace.flow (2/a) (driverHomeomorph.symm b) z t=loewnerMap a b.1 t z := by + rw [←flow_eq_literal,flow_eq_loewnerMap,literal_parameter,driverHomeomorph.apply_symm_apply] + +lemma literal_surviving (a : ℝ) (b : GDriver) (z : ℂ) (t : ℝ≥0) : + LiteralTrace.Surviving (2/a) (driverHomeomorph.symm b) z t ↔ alive a b.1 t z := by + rw [←surviving_eq,surviving_iff_alive,literal_parameter,driverHomeomorph.apply_symm_apply] + + +def inverseMap (a : ℝ) (b : GDriver) (s : ℝ≥0) (w : ℂ) : ℂ := + LiteralTrace.inverseFlow (2/a) (driverHomeomorph.symm b) s (w+(b.1 s:ℂ)) + +lemma inverseMap_alive {a : ℝ} (ha : 0 loewnerMap a b.1 s z.1-(b.1 s:ℂ)) h + simpa only [inverseUpper,centered_inverseMap ha b s u.2,centered_inverseMap ha b s v.2] using hh + + +def restartHomeomorph (a : ℝ) (ha : 0 z.1.1) z := + (continuous_subtype_val.comp continuous_subtype_val).continuousAt + exact ((hasDerivAt_loewnerMap b.1.continuous z.2).continuousAt.comp_of_eq hc rfl).sub continuousAt_const + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen + +abbrev AliveData (a : ℝ) := {p : ℝ≥0×(GDriver×UpperPlane) // + alive a p.2.1.1 p.1 p.2.2.1} + +def centeredData (a : ℝ) (p : AliveData a) : ℝ≥0×(GDriver×UpperPlane) := + (p.1.1,(p.1.2.1,⟨loewnerMap a p.1.2.1.1 p.1.1 p.1.2.2.1-(p.1.2.1.1 p.1.1:ℂ),by + simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using loewnerMap_im_pos p.2⟩)) + +lemma measurable_centeredData (a : ℝ) (ha : 1/4 (p.2.1.1 p.1:ℂ)) := + (Complex.continuous_ofReal.comp (continuous_subtype_val.comp (continuous_fst.comp + continuous_snd) |>.eval continuous_fst)).measurable + exact (measurable_fst.comp measurable_subtype_coe).prodMk + ((measurable_fst.comp (measurable_snd.comp measurable_subtype_coe)).prodMk + (((loewnerMap_time_joint_measurable a ha).comp measurable_subtype_coe).sub + (hv.comp measurable_subtype_coe) |>.subtype_mk)) + +lemma centeredData_injective (a : ℝ) : Function.Injective (centeredData a) := by + rintro ⟨⟨s,b,z⟩,hz⟩ ⟨⟨t,c,w⟩,hw⟩ h + have ht : s=t := congrArg Prod.fst h + have hc : b=c := congrArg (fun p => p.2.1) h + subst t; subst c + have hz' : loewnerMap a b.1 s z.1-(b.1 s:ℂ)=loewnerMap a b.1 s w.1-(b.1 s:ℂ) := + congrArg (fun p => p.2.2.1) h + have hzw := congrArg (inverseMap a b s) hz' + rw [inverseMap_centered a b s hz,inverseMap_centered a b s hw] at hzw + have : z=w := Subtype.ext hzw + subst w + rfl + + +lemma inverseUpper_joint_measurable (a : ℝ) (ha : 1/4 + inverseUpper a (lt_trans (by norm_num) ha) p.2.1 p.1 p.2.2) := by + have ha0 : 0 + ⟨(p.1,(p.2.1,inverseUpper a ha0 p.2.1 p.1 p.2.2)),inverseMap_alive ha0 _ _ p.2.2.2⟩ + have hi : Measurable inv := by + apply ((measurable_centeredData a ha).measurableEmbedding (centeredData_injective a)).measurable_comp_iff.mp + have he : centeredData a ∘ inv=id := by + funext p + apply Prod.ext + · rfl + apply Prod.ext + · rfl + apply Subtype.ext + exact centered_inverseMap ha0 _ _ p.2.2.2 + rw [he] + exact measurable_id + exact (measurable_subtype_coe.comp hi).snd.snd + +lemma norm_deriv_inverseMap_eq_exp (a : ℝ) (ha : 0 + ‖deriv (inverseMap a p.2.1 p.1) p.2.2.1‖) := by + simp_rw [norm_deriv_inverseMap_eq_exp a (lt_trans (by norm_num) ha)] + exact (((killedState_time_joint_measurable a ha).comp + (measurable_fst.prodMk (measurable_snd.fst.prodMk + (inverseUpper_joint_measurable a ha)))).snd.neg).exp + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.Conformal + +def realDerivative (v : ℂ) : ℂ→L[ℝ]ℂ := + (ContinuousLinearMap.toSpanSingleton ℂ v).restrictScalars ℝ + +lemma det_realDerivative (v : ℂ) : (realDerivative v).det=‖v‖^2 := by + simp [realDerivative,ContinuousLinearMap.det,LinearMap.det_restrictScalars, + Algebra.norm_complex_eq,Complex.normSq_eq_norm_sq] + +lemma lintegral_image_complex {f : ℂ→ℂ} {s : Set ℂ} (hs : MeasurableSet s) + (hd : ∀z∈s,DifferentiableAt ℂ f z) (hi : InjOn f s) (g : ℂ→ℝ≥0∞) : + (∫⁻z in f '' s,g z∂volume)= + ∫⁻w in s,ENNReal.ofReal (‖deriv f w‖^2)*g (f w)∂volume := by + have hf (z : ℂ) (hz : z∈s) : HasFDerivWithinAt f (realDerivative (deriv f z)) s z := + ((hd z hz).hasDerivAt.hasFDerivAt.restrictScalars ℝ).hasFDerivWithinAt + simpa only [det_realDerivative,abs_pow, abs_norm] using + lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hs hf hi g + + + +lemma map_withDensity_composed {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) {e : X→Y} (he : Measurable e) {f : Y→ℝ≥0∞} (hf : Measurable f) : + (μ.withDensity (fun x => f (e x))).map e=(μ.map e).withDensity f := by + ext A hA + rw [Measure.map_apply he hA,withDensity_apply _ (he hA), + withDensity_apply _ hA,Measure.restrict_map he hA,lintegral_map hf he] + +end SLEExactGauge.Conformal +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen + + + +def upperExtend (f : UpperPlane→ℝ≥0∞) (z : ℂ) : ℝ≥0∞ := + if hz : 0 loewnerMap a b.1 s z-(b.1 s:ℂ)) huv + simpa only [centered_inverseMap ha b s hu,centered_inverseMap ha b s hv] using h + + + +theorem inverseUpper_lintegral_area (a : ℝ) (ha : 0 (inverseMap_hasStrictDerivAt ha b s hw).hasDerivAt.differentiableAt) + (inverseMap_injOn_upper a ha b s) (upperExtend f) + rw [image_inverseMap_upper a ha b s] at h + have hleft := setLIntegral_subtype (μ:=(volume : Measure ℂ)) + upperPlane_open.measurableSet {z : UpperPlane | alive a b.1 s z.1} (upperExtend f) + have hright := lintegral_subtype_comap (μ:=(volume : Measure ℂ)) + upperPlane_open.measurableSet (fun w => + ENNReal.ofReal (‖deriv (inverseMap a b s) w‖^2)*upperExtend f (inverseMap a b s w)) + have hh := hright.trans (h.symm.trans hleft.symm) + have he (w : UpperPlane) : upperExtend f (inverseMap a b s w.1)= + f (inverseUpper a ha b s w) := dite_eq_left (alive_initial_im (inverseMap_alive ha b s w.2)) + simp only [upperExtend_coe, he] at hh + convert! hh using 1 + + +theorem map_inverseUpper_area (a : ℝ) (ha : 1/4 + ENNReal.ofReal (‖deriv (inverseMap a b s) w.1‖^2))).map + (inverseUpper a (lt_trans (by norm_num) ha) b s)= + upperArea.restrict {z : UpperPlane | alive a b.1 s z.1} := by + let ha0 : 01)) + have hi : (fun w : UpperPlane => ENNReal.ofReal (‖deriv (inverseMap a b s) w.1‖^2)* + A.indicator (fun _ =>1) (J w))= + (J ⁻¹' A).indicator (fun w => ENNReal.ofReal (‖deriv (inverseMap a b s) w.1‖^2)) := by + funext w + by_cases hw : J w ∈ A <;> simp [hw] + change (∫⁻w : UpperPlane, ENNReal.ofReal (‖deriv (inverseMap a b s) w.1‖^2)* + A.indicator (fun _ =>1) (J w) ∂upperArea)=_ at h + rw [hi,lintegral_indicator (hJ hA),lintegral_indicator hA, + setLIntegral_one,Measure.restrict_apply hA] at h + exact h + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen + + +def restartWeight (a : ℝ) (b : GDriver) (s : ℝ≥0) (w : UpperPlane) : ℝ≥0∞ := + ENNReal.ofReal (‖deriv (inverseMap a b s) w.1‖^(2-alpha a)) + +lemma restartWeight_pos (a : ℝ) (ha : 0 restartWeight a p.2.1 p.1 p.2.2) := + ((norm_deriv_inverseMap_joint_measurable a ha).pow_const _).ennreal_ofReal + +lemma restartWeight_measurable (a : ℝ) (ha : 1/4 (s,(b,w))) := + measurable_const.prodMk (measurable_const.prodMk measurable_id) + have hh := (restartWeight_joint_measurable a ha).comp hin + change Measurable (fun w : UpperPlane => restartWeight a b s w) at hh + exact hh + +lemma green_jacobian_restart (a : ℝ) (ha : 0 ENNReal.ofReal (survivingGreen a (s+t) b z.1)*f z) + simpa only [←mul_assoc,green_jacobian_restart a ha b s t] using h + + + +def restartPush (a : ℝ) (ha : 0 + f (inverseUpper a (lt_trans (by norm_num) ha) b s w)) := hf.comp hJ + rw [restartPush,lintegral_map hf hJ] + exact lintegral_withDensity_eq_lintegral_mul μ (restartWeight_measurable a ha b s) hF + + + +theorem restartPush_survivingKernel (a : ℝ) (ha : 1/41)) + have heL := restartPush_lintegral a ha b s (survivingKernel a ha t (restart s b)) + (measurable_const.indicator hA : Measurable (A.indicator (fun _ =>(1:ℝ≥0∞)))) + rw [lintegral_indicator hA,setLIntegral_one] at heL + have hF : Measurable (fun w : UpperPlane => restartWeight a b s w* + A.indicator (fun _ =>(1:ℝ≥0∞)) (inverseUpper a ha0 b s w)) := + (restartWeight_measurable a ha b s).mul ((measurable_const.indicator hA).comp hJ) + rw [survivingKernel_apply,lintegral_withDensity_eq_lintegral_mul upperArea + (survivingGreen_spatial_measurable a ha t (restart s b)).ennreal_ofReal hF] at heL + have heR : (∫⁻z in {z : UpperPlane | alive a b.1 s z.1}, + ENNReal.ofReal (survivingGreen a (s+t) b z.1)*A.indicator (fun _ =>1) z∂upperArea)= + ((survivingKernel a ha (s+t) b).restrict {z : UpperPlane | alive a b.1 s z.1}) A := by + rw [survivingKernel_apply,Measure.restrict_apply hA,withDensity_apply _ (hA.inter hsurv)] + calc + _ = ∫⁻z in {z : UpperPlane | alive a b.1 s z.1}, + A.indicator (fun z => ENNReal.ofReal (survivingGreen a (s+t) b z.1)) z∂upperArea := by + congr 1 + funext z + by_cases hz : z∈A <;> simp [hz] + _ = _ := by rw [lintegral_indicator hA,Measure.restrict_restrict hA] + rw [←heR,←h] + rw [survivingKernel_apply] + simpa only [Pi.mul_apply,mul_left_comm,mul_assoc] using heL + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator + +lemma inverseMap_driver_congr (a : ℝ) (ha : 0 inverseUpper a (lt_trans (by norm_num) ha) p.1 (S p.1).toNNReal p.2) := by + have hD := stoppedData_raw_measurable hS + have hin : @Measurable (GDriver×UpperPlane) (ℝ≥0×(GDriver×UpperPlane)) + (hS.measurableSpace.prod inferInstance) inferInstance (fun p => + ((stoppedData S p.1).1,((stoppedData S p.1).2,p.2))) := + (hD.fst.comp measurable_fst).prodMk ((hD.snd.comp measurable_fst).prodMk measurable_snd) + have hh := (inverseUpper_joint_measurable a ha).comp hin + simpa only [Function.comp_def,inverseUpper_stoppedData] using hh + +lemma restartWeight_stopped_raw_joint (a : ℝ) (ha : 1/4 restartWeight a p.1 (S p.1).toNNReal p.2) := by + have hD := stoppedData_raw_measurable hS + have hin : @Measurable (GDriver×UpperPlane) (ℝ≥0×(GDriver×UpperPlane)) + (hS.measurableSpace.prod inferInstance) inferInstance (fun p => + ((stoppedData S p.1).1,((stoppedData S p.1).2,p.2))) := + (hD.fst.comp measurable_fst).prodMk ((hD.snd.comp measurable_fst).prodMk measurable_snd) + have hh := (restartWeight_joint_measurable a ha).comp hin + simpa only [Function.comp_def,restartWeight_stoppedData a (lt_trans (by norm_num) ha)] using hh + +end SLEExactGauge.LoewnerRestart +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CutoffDrift.lean b/lean/OAI/Probability/SLEGauge/CutoffDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f2526fb4c74a8586332fba75210e7291e15534f --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CutoffDrift.lean @@ -0,0 +1,445 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ConformalFlow + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +namespace ExactSLEGreen +open ExactSLEMain +noncomputable def cutoffDrift (a ε : ℝ) (v : State) : State := + (cutoffVector a ε v.1, (-(a : ℂ) * (cutoffVector 1 ε v.1)^2).re) + +lemma cutoffDrift_second_bound (a ε : ℝ) (hε : 0 < ε) (z : ℂ) : + ‖(-(a : ℂ) * (cutoffVector 1 ε z)^2).re‖ ≤ |a|/ε^2 := by + calc + _ ≤ ‖-(a : ℂ) * (cutoffVector 1 ε z)^2‖ := Complex.abs_re_le_norm _ + _ = |a| * ‖cutoffVector 1 ε z‖^2 := by simp only [norm_mul,norm_neg,Complex.norm_real,Real.norm_eq_abs,norm_pow] + _ ≤ |a| * (1/ε)^2 := mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (norm_nonneg _) (by simpa using cutoffVector_bound 1 ε hε z) 2) (abs_nonneg _) + _ = _ := by ring + +lemma cutoffDrift_second_lipschitz (a ε : ℝ) (hε : 0 < ε) : + LipschitzWith ⟨4*|a|/ε^3,by positivity⟩ + (fun z : ℂ => (-(a : ℂ) * (cutoffVector 1 ε z)^2).re) := by + apply LipschitzWith.of_dist_le_mul + intro z w + rw [Real.dist_eq,dist_eq_norm,← Complex.sub_re] + have hb (u : ℂ) : ‖cutoffVector 1 ε u‖ ≤ 1/ε := by simpa using cutoffVector_bound 1 ε hε u + have hd : ‖cutoffVector 1 ε z - cutoffVector 1 ε w‖ ≤ (2/ε^2)*‖z-w‖ := by + have h := (cutoffVector_lipschitz 1 ε hε).dist_le_mul z w + simp only [dist_eq_norm] at h + change ‖cutoffVector 1 ε z - cutoffVector 1 ε w‖ ≤ (2*|1|/ε^2)*‖z-w‖ at h + simpa only [abs_one,mul_one] using h + have he : -(a : ℂ) * (cutoffVector 1 ε z)^2 - -(a : ℂ) * (cutoffVector 1 ε w)^2 = + -(a : ℂ) * (cutoffVector 1 ε z - cutoffVector 1 ε w) * + (cutoffVector 1 ε z + cutoffVector 1 ε w) := by ring + calc + _ ≤ ‖-(a : ℂ) * (cutoffVector 1 ε z)^2 - -(a : ℂ) * (cutoffVector 1 ε w)^2‖ := Complex.abs_re_le_norm _ + _ = |a| * ‖cutoffVector 1 ε z - cutoffVector 1 ε w‖ * + ‖cutoffVector 1 ε z + cutoffVector 1 ε w‖ := by rw [he]; simp only [norm_mul,norm_neg,Complex.norm_real,Real.norm_eq_abs] + _ ≤ (|a| * ((2/ε^2)*‖z-w‖)) * (1/ε+1/ε) := + mul_le_mul (mul_le_mul_of_nonneg_left hd (abs_nonneg _)) + ((norm_add_le _ _).trans (add_le_add (hb z) (hb w))) (norm_nonneg _) (by positivity) + _ = _ := by change _ = (4*|a|/ε^3)*‖z-w‖; field_simp; ring + +lemma cutoffDrift_bound (a ε : ℝ) (hε : 0 < ε) (v : State) : + ‖cutoffDrift a ε v‖ ≤ max (|a|/ε) (|a|/ε^2) := by + exact max_le_max (cutoffVector_bound a ε hε v.1) (cutoffDrift_second_bound a ε hε v.1) + +lemma cutoffDrift_lipschitz (a ε : ℝ) (hε : 0 < ε) : + LipschitzWith (max ⟨2*|a|/ε^2,by positivity⟩ ⟨4*|a|/ε^3,by positivity⟩) + (cutoffDrift a ε) := by + convert ((cutoffVector_lipschitz a ε hε).prodMk (cutoffDrift_second_lipschitz a ε hε)).comp LipschitzWith.prod_fst using 1 <;> first | rfl | simp only [mul_one] + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEMain + +lemma cutoffDrift_eq_physical (a ε : ℝ) (v : State) (hy : ε ≤ v.1.im) : + cutoffDrift a ε v = ((a : ℂ)/v.1, (-(a : ℂ)/v.1^2).re) := by + simp only [cutoffDrift,cutoffVector,heightClamp_eq hy,Complex.ofReal_one,one_div] + congr 1 + rw [inv_pow,div_eq_mul_inv] + + + +theorem state_eq_loewner_on_safe + (a ε : ℝ) (hε : 0 < ε) (b : ℝ≥0 → ℝ) (hb : Continuous b) (_hb0 : b 0 = 0) + (z : ℂ) (V : ℝ≥0 → State) (hVc : Continuous V) + (hVe : ∀ t, V t = (z,0) + b t • ((-1 : ℂ), (0 : ℝ)) + + ∫ u in (0 : ℝ)..(t : ℝ), cutoffDrift a ε (V u.toNNReal)) + (T : ℝ≥0) (hy : ∀ t ≤ T, ε ≤ (V t).1.im) : + alive a b T z ∧ + (∀ t ≤ T, loewnerMap a b t z - (b t : ℂ) = (V t).1) ∧ + Real.log ‖deriv (loewnerMap a b T) z‖ = (V T).2 := by + have hAc := (cutoffDrift_lipschitz a ε hε).continuous + have hIc (t : ℝ≥0) : IntervalIntegrable + (fun u : ℝ => cutoffDrift a ε (V u.toNNReal)) volume 0 t := + (hAc.comp (hVc.comp continuous_real_toNNReal)).intervalIntegrable 0 t + have hfst (t : ℝ≥0) : (V t).1 = z - (b t : ℂ) + + ∫ u in (0 : ℝ)..(t : ℝ), cutoffVector a ε (V u.toNNReal).1 := by + have h := congrArg Prod.fst (hVe t) + have hi := (ContinuousLinearMap.fst ℝ ℂ ℝ).intervalIntegral_comp_comm (hIc t) + simp only [Prod.fst_add] at h + change (V t).1 = z + b t • (-1 : ℂ) + + (ContinuousLinearMap.fst ℝ ℂ ℝ) (∫ u in (0 : ℝ)..(t : ℝ), cutoffDrift a ε (V u.toNNReal)) at h + rw [← hi] at h + simpa only [ContinuousLinearMap.coe_fst',Prod.fst_add,Prod.fst_smul,Complex.real_smul,Complex.ofReal_neg, + mul_neg,mul_one,sub_eq_add_neg,cutoffDrift] using h + have hsnd (t : ℝ≥0) : (V t).2 = + ∫ u in (0 : ℝ)..(t : ℝ), (-(a : ℂ)*(cutoffVector 1 ε (V u.toNNReal).1)^2).re := by + have h := congrArg Prod.snd (hVe t) + have hi := (ContinuousLinearMap.snd ℝ ℂ ℝ).intervalIntegral_comp_comm (hIc t) + simp only [Prod.snd_add] at h + change (V t).2 = (0 : ℝ) + b t • (0 : ℝ) + + (ContinuousLinearMap.snd ℝ ℂ ℝ) (∫ u in (0 : ℝ)..(t : ℝ), cutoffDrift a ε (V u.toNNReal)) at h + rw [← hi] at h + simpa only [ContinuousLinearMap.coe_snd',Prod.snd_add,Prod.snd_smul,smul_zero,add_zero,zero_add,cutoffDrift] using h + let G : ℝ≥0 → ℂ := fun t => (V t).1 + (b t : ℂ) + have hGc : Continuous G := hVc.fst.add (Complex.continuous_ofReal.comp hb) + have hGe (t : ℝ≥0) : G t = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector a ε (G u.toNNReal + -(b u.toNNReal : ℂ)) := by + simp only [G,add_neg_cancel_right] + rw [hfst t] + abel + have hG0 : G 0 = z := by simpa using hGe 0 + have hode : odeUntil a b z T (fun u : ℝ => G u.toNNReal) := by + refine ⟨by simpa using hG0,?_⟩ + intro u hu + have hut : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have huy := hy _ hut + have hd := ExactSLEFlow.integral_flow_hasDerivWithinAt + (cutoffVector_lipschitz a ε hε).continuous (Complex.continuous_ofReal.comp hb).neg + hGc hGe T u hu + have hGim : (G u.toNNReal).im = (V u.toNNReal).1.im := by simp [G] + refine ⟨by rw [hGim]; exact hε.trans_le huy,?_⟩ + simpa only [Function.comp_def,Pi.neg_apply,cutoffVector,G,add_neg_cancel_right,heightClamp_eq huy,sub_eq_add_neg] using hd + have hlo (t : ℝ≥0) (ht : t ≤ T) : loewnerMap a b t z - (b t : ℂ) = (V t).1 := by + rw [loewnerMap_eq (odeUntil_mono hode ht)] + simp only [Real.toNNReal_coe,G,add_sub_cancel_right] + refine ⟨⟨_,hode⟩,hlo,?_⟩ + rw [log_norm_deriv_loewnerMap hb ⟨_,hode⟩, hsnd T] + apply intervalIntegral.integral_congr + intro u hu + have hu' : u ∈ Icc (0 : ℝ) T := by simpa only [uIcc_of_le T.coe_nonneg] using hu + have hut : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu'.2).trans_eq (by simp) + dsimp only + rw [hlo _ hut,cutoffVector,heightClamp_eq (hy _ hut)] + simp only [Complex.ofReal_one,inv_pow,div_eq_mul_inv,one_mul] + +end ExactSLEGreen + +namespace ExactSLEHitting +variable {Ω : Type*} {m : MeasurableSpace Ω} +variable (ℱ : Filtration ℝ≥0 m) (f : ℝ≥0 → Ω → ℝ) + +lemma firstContact_mem (hc : ∀ ω, Continuous (fun t => f t ω)) (ω : Ω) + (hex : ∃ t, f t ω ≤ 0) : + f (hittingAfter f (Iic 0) 0 ω).untopA ω ≤ 0 := by + have he : ∃ t : ℝ≥0, 0 ≤ t ∧ f t ω ∈ Iic 0 := by + obtain ⟨t,ht⟩ := hex + exact ⟨t,bot_le,ht⟩ + rw [hittingAfter,ite_eq_left he] + change f (sInf {t : ℝ≥0 | 0 ≤ t ∧ f t ω ≤ 0}) ω ≤ 0 + have hcl : IsClosed {t : ℝ≥0 | 0 ≤ t ∧ f t ω ≤ 0} := + isClosed_Ici.inter (isClosed_le (hc ω) continuous_const) + exact (hcl.csInf_mem he ⟨0,fun _ _ => bot_le⟩).2 + +lemma firstContact_le_iff (hc : ∀ ω, Continuous (fun t => f t ω)) + (ω : Ω) (t : ℝ≥0) : + hittingAfter f (Iic 0) 0 ω ≤ t ↔ ∃ u ≤ t, f u ω ≤ 0 := by + constructor + · intro h + have hex : ∃ u, f u ω ≤ 0 := by + by_contra hn + have hz : hittingAfter f (Iic 0) 0 ω = ⊤ := by + rw [hittingAfter_eq_top_iff] + intro j _ hj + exact hn ⟨j,hj⟩ + rw [hz] at h + exact WithTop.not_top_le_coe t h + refine ⟨(hittingAfter f (Iic 0) 0 ω).untopA,?_, firstContact_mem f hc ω hex⟩ + exact WithTop.untopA_le h + · rintro ⟨u,hu,hfu⟩ + exact (hittingAfter_le_of_mem (by exact bot_le) hfu).trans (WithTop.coe_le_coe.mpr hu) + +lemma measurable_has_contact (hc : ∀ ω, Continuous (fun t => f t ω)) + (hm : ∀ t, Measurable[ℱ t] (f t)) (t : ℝ≥0) : + MeasurableSet[ℱ t] {ω | ∃ u ≤ t, f u ω ≤ 0} := by + let g : Icc (0 : ℝ≥0) t → Ω → ℝ≥0∞ := fun u ω => ENNReal.ofReal (f u ω) + have hg : @Measurable Ω ℝ≥0∞ (ℱ t) _ (⨅ u, g u) := by + apply measurable_iInf_of_upperSemicontinuous + · intro u + exact ((hm u).mono (ℱ.mono u.2.2) le_rfl).ennreal_ofReal + · intro ω + exact (ENNReal.continuous_ofReal.comp ((hc ω).comp continuous_subtype_val)).upperSemicontinuous + have he : {ω | ∃ u ≤ t, f u ω ≤ 0} = {ω | (⨅ u, g u) ω = 0} := by + ext ω + simp only [mem_ofPred_eq,iInf_apply] + constructor + · rintro ⟨u,hu,hfu⟩ + apply le_antisymm _ bot_le + exact (iInf_le (fun u => g u ω) ⟨u,bot_le,hu⟩).trans (by change ENNReal.ofReal (f u ω) ≤ 0; exact le_of_eq (ENNReal.ofReal_eq_zero.mpr hfu)) + · intro h + obtain ⟨u,hu,hmin⟩ := isCompact_Icc.exists_isMinOn (nonempty_Icc.mpr (show (0 : ℝ≥0) ≤ t from bot_le)) (hc ω).continuousOn + refine ⟨u,hu.2,?_⟩ + have hl : ENNReal.ofReal (f u ω) ≤ ⨅ v, g v ω := by + apply le_iInf + intro v + exact ENNReal.ofReal_le_ofReal (hmin v.2) + rw [h] at hl + exact ENNReal.ofReal_eq_zero.mp (le_antisymm hl bot_le) + rw [he] + exact measurableSet_eq_fun hg measurable_const + +lemma firstContact_stopping (hc : ∀ ω, Continuous (fun t => f t ω)) + (hm : ∀ t, Measurable[ℱ t] (f t)) : + IsStoppingTime ℱ (hittingAfter f (Iic 0) 0) := by + intro t + have he : {ω | hittingAfter f (Iic 0) 0 ω ≤ t} = {ω | ∃ u ≤ t, f u ω ≤ 0} := by + ext ω + exact firstContact_le_iff f hc ω t + rw [he] + exact measurable_has_contact ℱ f hc hm t + +end ExactSLEHitting + +namespace ExactSLEHitting +variable {Ω : Type*} {m : MeasurableSpace Ω} +variable (ℱ : Filtration ℝ≥0 m) (f : ℝ≥0 → Ω → ℝ) + +lemma boundedContact_le_iff (hc : ∀ ω, Continuous (fun t => f t ω)) + (ω : Ω) (B t : ℝ≥0) (ht : t < B) : + hittingBtwn f (Iic 0) 0 B ω ≤ t ↔ ∃ u ≤ t, f u ω ≤ 0 := by + constructor + · intro h + have hex : ∃ u ∈ Icc (0 : ℝ≥0) B, f u ω ∈ Iic 0 := by + by_contra hn + have he : hittingBtwn f (Iic 0) 0 B ω = B := by simp only [hittingBtwn,ite_eq_right hn] + rw [he] at h + exact not_le.mpr ht h + have hcl : IsClosed (Icc (0 : ℝ≥0) B ∩ {u | f u ω ∈ Iic 0}) := + isClosed_Icc.inter (isClosed_Iic.preimage (hc ω)) + have hmem : f (hittingBtwn f (Iic 0) 0 B ω) ω ≤ 0 := by + rw [hittingBtwn,ite_eq_left hex] + exact (hcl.csInf_mem hex bddBelow_Icc.inter_of_left).2 + exact ⟨_,h,hmem⟩ + · rintro ⟨u,hu,hfu⟩ + exact (hittingBtwn_le_of_mem bot_le (hu.trans ht.le) hfu).trans hu + +lemma boundedContact_stopping (hc : ∀ ω, Continuous (fun t => f t ω)) + (hm : ∀ t, Measurable[ℱ t] (f t)) (B : ℝ≥0) : + IsStoppingTime ℱ (fun ω => ((hittingBtwn f (Iic (0 : ℝ)) (0 : ℝ≥0) B ω : ℝ≥0) : WithTop ℝ≥0)) := by + intro t + by_cases ht : t < B + · have he : {ω | ((hittingBtwn f (Iic (0 : ℝ)) (0 : ℝ≥0) B ω : ℝ≥0) : WithTop ℝ≥0) ≤ t} = + {ω | ∃ u ≤ t, f u ω ≤ 0} := by + ext ω + simp only [mem_ofPred_eq,WithTop.coe_le_coe] + exact boundedContact_le_iff f hc ω B t ht + rw [he] + exact measurable_has_contact ℱ f hc hm t + · have he : {ω | ((hittingBtwn f (Iic (0 : ℝ)) (0 : ℝ≥0) B ω : ℝ≥0) : WithTop ℝ≥0) ≤ t} = univ := by + apply eq_univ_of_forall + intro ω + exact WithTop.coe_le_coe.mpr ((hittingBtwn_le ω).trans (le_of_not_gt ht)) + rw [he] + exact MeasurableSet.univ + +lemma nonneg_before_boundedContact (hc : ∀ ω, Continuous (fun t => f t ω)) + (h0 : ∀ ω, 0 ≤ f 0 ω) (B : ℝ≥0) (ω : Ω) (t : ℝ≥0) + (ht : t ≤ hittingBtwn f (Iic 0) 0 B ω) : 0 ≤ f t ω := by + by_cases hz : t = 0 + · simpa only [hz] using h0 ω + · have ht0 : 0 < t := bot_lt_iff_ne_bot.mpr hz + have : NeBot (𝓝[<] t) := nhdsWithin_Iio_neBot' ⟨0,ht0⟩ le_rfl + apply ge_of_tendsto ((hc ω).continuousAt.tendsto.mono_left (show 𝓝[<] t ≤ 𝓝 t from inf_le_left)) + filter_upwards [self_mem_nhdsWithin] with u hu + have hn : f u ω ∉ Iic 0 := notMem_of_lt_hittingBtwn (hu.trans_le ht) bot_le + exact le_of_lt (lt_of_not_ge hn) + +lemma boundedContact_eq_zero (hc : ∀ ω, Continuous (fun t => f t ω)) + (h0 : ∀ ω, 0 ≤ f 0 ω) (B : ℝ≥0) (ω : Ω) + (ht : hittingBtwn f (Iic 0) 0 B ω < B) : + f (hittingBtwn f (Iic 0) 0 B ω) ω = 0 := by + apply le_antisymm _ (nonneg_before_boundedContact f hc h0 B ω _ le_rfl) + obtain ⟨u,hu,hfu⟩ := (boundedContact_le_iff f hc ω B _ ht).mp le_rfl + have he : hittingBtwn f (Iic 0) 0 B ω = u := + le_antisymm (hittingBtwn_le_of_mem bot_le (hu.trans ht.le) hfu) hu + simpa only [he] using hfu + +end ExactSLEHitting + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +noncomputable def physicalRadius (v : State) : ℝ := Y v * Real.exp (-J v) +lemma physicalRadius_continuous : Continuous physicalRadius := + Y.continuous.mul (Real.continuous_exp.comp J.continuous.neg) + +lemma alpha_pos {a : ℝ} (ha : 1/4 < a) : 0 < alpha a := by + have ha0 : 0 < a := by linarith + unfold alpha + rw [sub_pos,div_lt_one (by positivity)] + linarith + +lemma physicalGreen_bound (a ρ : ℝ) (ha : 1/4 < a) (hρ : 0 < ρ) + (v : State) (hy : 0 < Y v) (hr : ρ ≤ physicalRadius v) : + physicalGreen a v ≤ Real.exp (-alpha a * Real.log ρ) := by + have hq := Q_pos hy + have hlq : 2*Real.log (Y v) ≤ Real.log (Q v) := by + have he := Real.log_pow (Y v) 2 + norm_num only [Nat.cast_ofNat] at he + rw [← he] + apply Real.log_le_log (by positivity) + dsimp only [Q] + nlinarith [sq_nonneg (X v)] + have hlr : Real.log ρ ≤ Real.log (Y v) - J v := by + have h := Real.log_le_log hρ hr + simpa only [physicalRadius,Real.log_mul hy.ne' (Real.exp_ne_zero _),Real.log_exp,sub_eq_add_neg] using h + have hp : 0 ≤ p a / 2 := by unfold p; linarith + have ha' := alpha_pos ha + apply Real.exp_le_exp.mpr + unfold logGreen + nlinarith [mul_le_mul_of_nonneg_left hlq hp,mul_le_mul_of_nonneg_left hlr ha'.le] + +lemma physicalGreen_eq_radius_sine (a : ℝ) (v : State) (hy : 0 < Y v) : + physicalGreen a v = (physicalRadius v) ^ (-alpha a) * (Y v / ‖v.1‖) ^ (p a) := by + have hzn : 0 < ‖v.1‖ := lt_of_lt_of_le hy (Complex.im_le_norm _) + have hr : 0 < physicalRadius v := mul_pos hy (Real.exp_pos _) + have hqlog : Real.log (Q v) = 2*Real.log ‖v.1‖ := by + rw [Q_eq,Complex.normSq_eq_norm_sq,Real.log_pow] + norm_num + rw [Real.rpow_def_of_pos hr,Real.rpow_def_of_pos (div_pos hy hzn),← Real.exp_add] + rw [physicalRadius,Real.log_mul hy.ne' (Real.exp_ne_zero _),Real.log_exp, + Real.log_div hy.ne' hzn.ne'] + simp only [physicalGreen,logGreen] at * + rw [hqlog] + congr 1 + ring + + +lemma exists_localState (a ε : ℝ) (hε : 0 < ε) (z : ℂ) : + ∃ V : ℝ≥0 → ExactSLEGenerator.Driver → State, + (∀ b, Continuous (fun t => V t b)) ∧ + (∀ t, Measurable[rawFiltration t] (V t)) ∧ + (∀ b, V 0 b = (z,0)) ∧ + (∀ (s h : ℝ≥0) b, V (s+h) b = V s b + increment s h b • noise + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), cutoffDrift a ε (V t.toNNReal b)) := by + exact exists_adapted_additive_brownian (cutoffDrift a ε) + ⟨max (|a|/ε) (|a|/ε^2),by positivity⟩ _ + (cutoffDrift_lipschitz a ε hε) (cutoffDrift_bound a ε hε) (z,0) noise + +noncomputable def localState (a ε : ℝ) (hε : 0 < ε) (z : ℂ) : ℝ≥0 → ExactSLEGenerator.Driver → State := + Classical.choose (exists_localState a ε hε z) +lemma localState_continuous (a ε : ℝ) (hε : 0 < ε) (z : ℂ) (b : ExactSLEGenerator.Driver) : + Continuous (fun t => localState a ε hε z t b) := + (Classical.choose_spec (exists_localState a ε hε z)).1 b +lemma localState_adapted (a ε : ℝ) (hε : 0 < ε) (z : ℂ) (t : ℝ≥0) : + Measurable[rawFiltration t] (localState a ε hε z t) := + (Classical.choose_spec (exists_localState a ε hε z)).2.1 t +lemma localState_zero (a ε : ℝ) (hε : 0 < ε) (z : ℂ) (b : ExactSLEGenerator.Driver) : + localState a ε hε z 0 b = (z,0) := + (Classical.choose_spec (exists_localState a ε hε z)).2.2.1 b +lemma localState_eq (a ε : ℝ) (hε : 0 < ε) (z : ℂ) (s h : ℝ≥0) (b : ExactSLEGenerator.Driver) : + localState a ε hε z (s+h) b = localState a ε hε z s b + increment s h b • noise + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), cutoffDrift a ε (localState a ε hε z t.toNNReal b) := + (Classical.choose_spec (exists_localState a ε hε z)).2.2.2 s h b +lemma localState_eq_zero (a ε : ℝ) (hε : 0 < ε) (z : ℂ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : + localState a ε hε z t b = (z,0) + b.1 t • noise + + ∫ u in (0 : ℝ)..(t : ℝ), cutoffDrift a ε (localState a ε hε z u.toNNReal b) := by + simpa only [zero_add,localState_zero,increment,b.2,sub_zero,NNReal.coe_zero] + using localState_eq a ε hε z 0 t b + + + +theorem localGreen_optional (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a ε : ℝ) (ha : a ≠ 0) (hε : 0 < ε) (z : ℂ) (N B : ℝ≥0) + (S T : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b ≤ T b) (hTB : ∀ b, T b ≤ B) + (hsafe : ∀ b t, t ≤ T b → ε ≤ Y (localState a ε hε z t b) ∧ + ‖localState a ε hε z t b‖ ≤ N) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + ∫ b in U, physicalGreen a (localState a ε hε z (S b) b) ∂W = + ∫ b in U, physicalGreen a (localState a ε hε z (T b) b) ∂W := by + have hf := greenCutoff_smooth a ε hε N + have hG (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t ≤ T b) : + generator (greenCutoff a ε N) (cutoffDrift a ε) noise (localState a ε hε z t b) = 0 := by + have hv := hsafe b t ht + have hg := greenCutoff_generator_zero a ε ha hε N (localState a ε hε z t b) hv.2 hv.1 + change (1/2 : ℝ) * fderiv ℝ (fun w => fderiv ℝ (greenCutoff a ε N) w noise) + (localState a ε hε z t b) noise + fderiv ℝ (greenCutoff a ε N) + (localState a ε hε z t b) (cutoffDrift a ε (localState a ε hε z t b)) = 0 + rw [cutoffDrift_eq_physical a ε _ hv.1] + exact hg + have ho := compact_test_optional_sampling W hW (localState a ε hε z) + (localState_continuous a ε hε z) (localState_adapted a ε hε z) + (cutoffDrift a ε) (cutoffDrift_lipschitz a ε hε).continuous + (max (|a|/ε) (|a|/ε^2)) (by positivity) (cutoffDrift_bound a ε hε) noise + (by simp [noise,Prod.norm_def]) (localState_eq a ε hε z) + (greenCutoff a ε N) hf (greenCutoff_compact a ε N) S T B hS hT hST hTB hG U hU + have he (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t ≤ T b) : + greenCutoff a ε N (localState a ε hε z t b) = physicalGreen a (localState a ε hε z t b) := + (greenCutoff_eq_near a ε hε N _ (hsafe b t ht).2 (hsafe b t ht).1).eq_of_nhds + simpa only [he _ _ (hST _),he _ _ le_rfl] using ho + +end ExactSLEGreen + +namespace ExactSLEBarrier + + + +structure Evolution (a : ℝ) (T : ℝ≥0) (y j q : ℝ → ℝ) : Prop where + yc : ContinuousOn y (Icc 0 (T : ℝ)) + jc : ContinuousOn j (Icc 0 (T : ℝ)) + yp : ∀ t ∈ Icc 0 (T : ℝ), 0 < y t + qp : ∀ t ∈ Icc 0 (T : ℝ), 0 < q t + yd : ∀ t ∈ Icc 0 (T : ℝ), HasDerivWithinAt y (-a*y t/q t) (Icc 0 (T : ℝ)) t + jd : ∀ t ∈ Icc 0 (T : ℝ), HasDerivWithinAt j + (-a*(q t-2*(y t)^2)/(q t)^2) (Icc 0 (T : ℝ)) t + +variable {a : ℝ} {T : ℝ≥0} {y j q : ℝ → ℝ} + +lemma Evolution.logHeight_deriv (h : Evolution a T y j q) {t : ℝ} + (ht : t ∈ Icc 0 (T : ℝ)) : + HasDerivWithinAt (fun t => Real.log (y t)) (-a/q t) (Icc 0 (T : ℝ)) t := by + convert (h.yd t ht).log (h.yp t ht).ne' using 1 + field_simp [(h.yp t ht).ne'] + +lemma Evolution.logRadius_deriv (h : Evolution a T y j q) {t : ℝ} + (ht : t ∈ Icc 0 (T : ℝ)) : + HasDerivWithinAt (fun t => Real.log (y t)-j t) + (-2*a*(y t)^2/(q t)^2) (Icc 0 (T : ℝ)) t := by + convert (h.logHeight_deriv ht).sub (h.jd t ht) using 1 + try rfl + field_simp [(h.qp t ht).ne'] + ring + +lemma Evolution.height_le (h : Evolution a T y j q) (ha : 0 ≤ a) + (t : ℝ) (ht : t ∈ Icc 0 (T : ℝ)) : y t ≤ y 0 := by + have hm : AntitoneOn y (Icc 0 (T : ℝ)) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 (T : ℝ)) h.yc + (fun u hu => (h.yd u (interior_subset hu)).mono interior_subset) + (fun u hu => div_nonpos_of_nonpos_of_nonneg (by nlinarith [h.yp u (interior_subset hu)]) + (h.qp u (interior_subset hu)).le) + exact hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + +end ExactSLEBarrier +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CutoffExhaustion.lean b/lean/OAI/Probability/SLEGauge/CutoffExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..e708c94aeae60a230d09942b006e9f7eb80c0cbe --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CutoffExhaustion.lean @@ -0,0 +1,464 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadiusComparison + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEStops +open scoped Classical +lemma unfinishedCutoff_exhausts {m : ℕ} (a : ℝ) (ha : 0 + if (radialStop a ha (z j) (hz j) (ρ j) (hρ j) (hr j) n b : ℝ≥0∞)=radialTime a b.1 (z j) (ρ j) + then ∞ else (radialStop a ha (z j) (hz j) (ρ j) (hρ j) (hr j) n b : ℝ≥0∞))=∞ := by + apply top_unique + apply Finset.le_inf + intro j hj + rw [ite_eq_left (he j)] + rw [hi,min_top_right] + exact hn i +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + + +theorem actual_unfinished_cutoff {m : ℕ} (a : ℝ) (ha : 0 (unfinishedCutoff a ha z hz ρ hρ hr n b : WithTop ℝ≥0))) ∧ + (∀ n b t i, t≤unfinishedCutoff a ha z hz ρ hρ hr n b → + (t:ℝ≥0∞)≤radialTime a b.1 (z i) (ρ i) → alive a b.1 t (z i)) ∧ + (∀ b, (∀ i, radialTime a b.1 (z i) (ρ i)<∞) → + ∀ᶠ n in Filter.atTop, ∀ i, radialTime a b.1 (z i) (ρ i) < + (unfinishedCutoff a ha z hz ρ hρ hr n b : ℝ≥0∞)) := by + refine ⟨unfinishedCutoff_stopping a ha z hz ρ hρ hr,?_,unfinishedCutoff_exhausts a ha z hz ρ hρ hr⟩ + intro n b t i ht hti + exact radialStop_actual a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b t + (unfinishedCutoff_before_individual a ha z hz ρ hρ hr n b t i ht hti) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEFlow +open Set Filter +lemma localState_noiseFree_deriv (a ε : ℝ) (hε : 0<ε) (z : ℂ) + (b : ExactSLEGenerator.Driver) (T : ℝ≥0) (u : ℝ) (hu : u∈Icc (0:ℝ) T) : + HasDerivWithinAt (fun v : ℝ => localState a ε hε z v.toNNReal b-b.1 v.toNNReal • noise) + (cutoffDrift a ε (localState a ε hε z u.toNNReal b)) (Icc (0:ℝ) T) u := by + have hc : Continuous (fun v : ℝ => cutoffDrift a ε (localState a ε hε z v.toNNReal b)) := + (cutoffDrift_lipschitz a ε hε).continuous.comp + ((localState_continuous a ε hε z b).comp continuous_real_toNNReal) + have hd := (intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 u) + hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt).const_add ((z,0):State) + apply hd.hasDerivWithinAt.congr_of_mem _ hu + intro v hv + rw [localState_eq_zero,Real.coe_toNNReal _ hv.1] + abel +lemma localState_lower_cutoff (a η ε : ℝ) (hη : 0<η) (hε : 0<ε) (hηε : η≤ε) + (z : ℂ) (b : ExactSLEGenerator.Driver) (T : ℝ≥0) + (hy : ∀ t≤T, ε≤Y (localState a ε hε z t b)) (t : ℝ≥0) (ht : t≤T) : + localState a η hη z t b=localState a ε hε z t b := by + let f : ℝ → State := fun u => localState a η hη z u.toNNReal b-b.1 u.toNNReal • noise + let g : ℝ → State := fun u => localState a ε hε z u.toNNReal b-b.1 u.toNNReal • noise + let u : ℝ → State := fun v => b.1 v.toNNReal • noise + have hf : Continuous f := ((localState_continuous a η hη z b).comp continuous_real_toNNReal).sub + ((b.1.continuous.comp continuous_real_toNNReal).smul continuous_const) + have hg : Continuous g := ((localState_continuous a ε hε z b).comp continuous_real_toNNReal).sub + ((b.1.continuous.comp continuous_real_toNNReal).smul continuous_const) + have hfd (v : ℝ) (hv : v∈Icc (0:ℝ) T) : + HasDerivWithinAt f (cutoffDrift a η (f v+u v)) (Icc (0:ℝ) T) v := by + simpa only [f,u,sub_add_cancel] using localState_noiseFree_deriv a η hη z b T v hv + have hgd (v : ℝ) (hv : v∈Icc (0:ℝ) T) : + HasDerivWithinAt g (cutoffDrift a η (g v+u v)) (Icc (0:ℝ) T) v := by + have hvT : v.toNNReal≤T := (Real.toNNReal_le_toNNReal hv.2).trans_eq (by simp) + have he : cutoffDrift a ε (localState a ε hε z v.toNNReal b)= + cutoffDrift a η (localState a ε hε z v.toNNReal b) := by + rw [cutoffDrift_eq_physical a ε _ (hy _ hvT),cutoffDrift_eq_physical a η _ (hηε.trans (hy _ hvT))] + simpa only [g,u,sub_add_cancel,←he] using localState_noiseFree_deriv a ε hε z b T v hv + have he := additive_flow_unique (cutoffDrift_lipschitz a η hη) hf.continuousOn hg.continuousOn + hfd hgd (by simp [f,g,localState_zero]) (show (t:ℝ)∈Icc (0:ℝ) T from ⟨t.coe_nonneg,ht⟩) + simpa only [f,g,Real.toNNReal_coe,sub_left_inj] using he +lemma localState_noise_bounds (a η : ℝ) (hη : 0<η) (z : ℂ) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + ‖localState a η hη z t b‖≤‖z‖+|b.1 t|+max (|a|/η) (|a|/η^2)*t ∧ + |b.1 t|≤‖localState a η hη z t b‖+‖z‖+max (|a|/η) (|a|/η^2)*t := by + let K := max (|a|/η) (|a|/η^2) + let I : State := ∫ v in (0:ℝ)..(t:ℝ), cutoffDrift a η (localState a η hη z v.toNNReal b) + have hI : ‖I‖≤K*t := by + simpa only [sub_zero,abs_of_nonneg t.coe_nonneg] using + intervalIntegral.norm_integral_le_of_norm_le_const (a:=(0:ℝ)) (b:=(t:ℝ)) + (C:=K) (fun v _ => cutoffDrift_bound a η hη _) + have hn : ‖noise‖=1 := by simp [noise,Prod.norm_def] + have hnoise : ‖b.1 t • noise‖=|b.1 t| := by rw [norm_smul,hn,mul_one,Real.norm_eq_abs] + have hz : ‖((z,0):State)‖=‖z‖ := by simp [Prod.norm_def] + have he : localState a η hη z t b=(z,0)+b.1 t • noise+I := localState_eq_zero a η hη z t b + constructor + · rw [he] + calc + _ ≤ ‖((z,0):State)+b.1 t • noise‖+‖I‖ := norm_add_le _ _ + _ ≤ ‖((z,0):State)‖+‖b.1 t • noise‖+K*t := add_le_add (norm_add_le _ _) hI + _ = _ := by rw [hz,hnoise] + · have he' : b.1 t • noise=localState a η hη z t b-(z,0)-I := by rw [he]; abel + rw [←hnoise,he'] + calc + _ ≤ ‖localState a η hη z t b-(z,0)‖+‖I‖ := norm_sub_le _ _ + _ ≤ ‖localState a η hη z t b‖+‖((z,0):State)‖+K*t := add_le_add (norm_sub_le _ _) hI + _ = _ := by rw [hz] +lemma finite_pos_lower {ι : Type*} (s : Finset ι) (f : ι → ℝ) (hf : ∀ i∈s,0 exact ⟨1,by norm_num,by simp⟩ + | @insert i s hi ih => + obtain ⟨η,hη,hηs⟩ := ih (fun j hj => hf j (Finset.mem_insert_of_mem hj)) + refine ⟨min (f i) η,lt_min (hf i (Finset.mem_insert_self _ _)) hη,?_⟩ + intro j hj + rcases Finset.mem_insert.mp hj with rfl|hj + · exact min_le_left _ _ + · exact (min_le_right _ _).trans (hηs j hj) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + + +theorem actual_common_cutoff_safe {m : ℕ} (a : ℝ) (ha : 0 radialLocalization a ha (z i) (hz i) (ρ i) (angleThreshold (z i) n) + (hρ i) (hr i) (angleThreshold_pos (z i) (hz i) n) (angleThreshold_initial (z i) (hz i) n) + obtain ⟨η,hη,hηi⟩ := finite_pos_lower Finset.univ (fun i => (L i).ε) (fun i _ => (L i).hε) + let N : ℝ≥0 := Finset.univ.sup (fun i => (L i).N) + let K : ℝ := max (|a|/η) (|a|/η^2) + have hK : 0≤K := le_trans (by positivity : 0≤|a|/η) (le_max_left _ _) + let M : ℝ≥0 := ⟨N+2*‖z‖+2*K*n,by positivity⟩ + refine ⟨η,hη,M,?_⟩ + intro b t ht hex + have htN : (t:ℝ)≤n := by + have hcut : (unfinishedCutoff a ha z hz ρ hρ hr n b : ℝ≥0∞)≤(n:ℝ≥0∞) := by + rw [unfinishedCutoff_coe] + exact unfinishedCutoffTop_le a ha z hz ρ hρ hr n b + have h : (t:ℝ≥0∞)≤(n:ℝ≥0∞) := (ENNReal.coe_le_coe.mpr ht).trans hcut + exact_mod_cast h + have hstate (i : Fin m) (hi : (t:ℝ≥0∞)≤radialTime a b.1 (z i) (ρ i)) : + η≤Y (vectorState a η hη z t b i) ∧ + vectorState a η hη z t b i=actualState a b.1 t (z i) ∧ + ‖vectorState a η hη z t b i‖≤(L i).N := by + have hti := unfinishedCutoff_before_individual a ha z hz ρ hρ hr n b t i ht hi + have he : localState a η hη (z i) t b=localState a (L i).ε (L i).hε (z i) t b := + localState_lower_cutoff a η (L i).ε hη (L i).hε (hηi i (Finset.mem_univ i)) (z i) b + (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b) + (fun u hu => (regionStop_safe a (L i).ε (L i).hε (z i) (L i).N (ρ i) + (angleThreshold (z i) n) (L i).B (L i).initial b u hu).1) t hti + have hs := regionStop_safe a (L i).ε (L i).hε (z i) (L i).N (ρ i) + (angleThreshold (z i) n) (L i).B (L i).initial b t hti + have ha' := regionStop_actualState a (L i).ε (L i).hε (z i) (L i).N (ρ i) + (angleThreshold (z i) n) (L i).B (L i).initial b t hti + change η≤Y (localState a η hη (z i) t b) ∧ + localState a η hη (z i) t b=actualState a b.1 t (z i) ∧ _ + rw [he] + exact ⟨(hηi i (Finset.mem_univ i)).trans hs.1,ha'.2.symm,by simpa only [vectorState,he] using hs.2.1⟩ + obtain ⟨j,hj⟩ := hex + have hjN : ((L j).N:ℝ)≤N := by exact_mod_cast Finset.le_sup (f:=fun i => (L i).N) (Finset.mem_univ j) + have hbn : |b.1 t|≤N+‖z‖+K*n := by + have h := (localState_noise_bounds a η hη (z j) b t).2 + have hs := (hstate j hj).2.2.trans hjN + have hzj := norm_le_pi_norm z j + have hkt := mul_le_mul_of_nonneg_left htN hK + change ‖localState a η hη (z j) t b‖≤(N:ℝ) at hs + dsimp only [K] at * + linarith + constructor + · apply (pi_norm_le_iff_of_nonneg M.coe_nonneg).mpr + intro i + have h := (localState_noise_bounds a η hη (z i) b t).1 + have hzj := norm_le_pi_norm z i + have hkt := mul_le_mul_of_nonneg_left htN hK + change ‖localState a η hη (z i) t b‖≤N+2*‖z‖+2*K*n + dsimp only [K] at * + linarith + · intro i hi + exact ⟨(hstate i hi).1,(hstate i hi).2.1⟩ +end ExactSLEGreen +namespace ExactSLEStops +open Set Filter +open scoped Classical +variable {Ω : Type*} [MeasurableSpace Ω] +noncomputable def clip (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (ω : Ω) : ℝ≥0 := + (min (τ ω) (B ω : ℝ≥0∞)).toNNReal +omit [MeasurableSpace Ω] in +lemma clip_coe (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (ω : Ω) : + (clip τ B ω : ℝ≥0∞)=min (τ ω) (B ω : ℝ≥0∞) := + ENNReal.coe_toNNReal (ne_top_of_le_ne_top (by simp) (min_le_right _ _)) +omit [MeasurableSpace Ω] in +lemma clip_le (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (ω : Ω) : clip τ B ω≤B ω := by + apply ENNReal.coe_le_coe.mp + rw [clip_coe] + exact min_le_right _ _ +omit [MeasurableSpace Ω] in +lemma le_clip_iff (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (ω : Ω) (t : ℝ≥0) : + t≤clip τ B ω ↔ (t:ℝ≥0∞)≤τ ω ∧ t≤B ω := by + rw [←ENNReal.coe_le_coe,clip_coe,le_min_iff,ENNReal.coe_le_coe] +omit [MeasurableSpace Ω] in +lemma clip_le_time (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (ω : Ω) : + (clip τ B ω : ℝ≥0∞)≤τ ω := by rw [clip_coe]; exact min_le_left _ _ +lemma clip_stopping (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (τ : Ω → ℝ≥0∞) (B : Ω → ℝ≥0) (hτ : IsStoppingTime F τ) + (hB : IsStoppingTime F (fun ω => (B ω : WithTop ℝ≥0))) : + IsStoppingTime F (fun ω => (clip τ B ω : WithTop ℝ≥0)) := by + have h := hτ.min hB + intro t + have ht := h t + change MeasurableSet[F t] {ω | min (τ ω) (B ω : ℝ≥0∞)≤(t:ℝ≥0∞)} at ht + change MeasurableSet[F t] {ω | (clip τ B ω : ℝ≥0∞)≤(t:ℝ≥0∞)} + simpa only [clip_coe] using ht + +noncomputable def phase (A B C : ℝ≥0∞) (t : ℝ≥0) : Fin 4 := + if C≤(t:ℝ≥0∞) then 3 else if B≤(t:ℝ≥0∞) then 2 else if A≤(t:ℝ≥0∞) then 1 else 0 +lemma phase_measurable (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (A B C : Ω → ℝ≥0∞) (S : Ω → ℝ≥0) + (hA : IsStoppingTime F A) (hB : IsStoppingTime F B) (hC : IsStoppingTime F C) + (hS : IsStoppingTime F (fun ω => (S ω : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun ω => phase (A ω) (B ω) (C ω) (S ω)) := by + have hA' : MeasurableSet[hS.measurableSpace] {ω | A ω≤(S ω : ℝ≥0∞)} := hA.measurableSet_stopping_time_le hS + have hB' : MeasurableSet[hS.measurableSpace] {ω | B ω≤(S ω : ℝ≥0∞)} := hB.measurableSet_stopping_time_le hS + have hC' : MeasurableSet[hS.measurableSpace] {ω | C ω≤(S ω : ℝ≥0∞)} := hC.measurableSet_stopping_time_le hS + exact measurable_const.ite hC' (measurable_const.ite hB' (measurable_const.ite hA' measurable_const)) +lemma phase_one_iff (A B C : ℝ≥0∞) (t : ℝ≥0) (_hAB : A≤B) (hBC : B≤C) : + phase A B C t=1 ↔ A≤(t:ℝ≥0∞) ∧ (t:ℝ≥0∞) simp_all + order +lemma phase_two_iff (A B C : ℝ≥0∞) (t : ℝ≥0) (_hAB : A≤B) (_hBC : B≤C) : + phase A B C t=2 ↔ B≤(t:ℝ≥0∞) ∧ (t:ℝ≥0∞) simp_all +lemma phase_zero_iff (A B C : ℝ≥0∞) (t : ℝ≥0) (hAB : A≤B) (hBC : B≤C) : + phase A B C t=0 ↔ (t:ℝ≥0∞) simp_all <;> order +lemma phase_three_iff (A B C : ℝ≥0∞) (t : ℝ≥0) : + phase A B C t=3 ↔ C≤(t:ℝ≥0∞) := by + unfold phase + split_ifs <;> simp_all + +omit [MeasurableSpace Ω] in +lemma no_actual_change_between (l : List (Ω → ℝ≥0)) (B : Ω → ℝ≥0) (τ : Ω → ℝ≥0∞) + (hτ : clip τ B∈l) (ω : Ω) (k : ℕ) (hk : k+1<(sort l).length) + (hB : (sort l)[k+1] ω≤B ω) : + τ ω≤((sort l)[k] ω : ℝ≥0∞) ∨ ((sort l)[k+1] ω : ℝ≥0∞)≤τ ω := by + rcases no_change_between l ω k hk (clip τ B) hτ with h|h + · by_cases ht : τ ω≤((sort l)[k] ω : ℝ≥0∞) + · exact Or.inl ht + · right + have hs : B ω≤(sort l)[k] ω := by + have h' := ENNReal.coe_le_coe.mpr h + rw [clip_coe,min_le_iff] at h' + exact ENNReal.coe_le_coe.mp (h'.resolve_left ht) + exact (ENNReal.coe_le_coe.mpr (hB.trans hs)).trans (not_le.mp ht).le + · exact Or.inr ((le_clip_iff τ B ω _).mp h).1 +end ExactSLEStops + + +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt Set Filter +open scoped ENNReal NNReal +lemma radialTime_antitone (a : ℝ) (ha : 0 p i=1 ∨ p i=2 +noncomputable def phaseSigma {m : ℕ} (a : ℝ) (p : PhaseVector m) (i : Fin m) : ℝ := + if p i=2 then regBeta a else -regBeta a +noncomputable def phaseOffset {m : ℕ} (a : ℝ) (U : Fin m → ℝ) (p : PhaseVector m) (i : Fin m) : ℝ := + if p i=2 then -regBeta a*U i else 0 +noncomputable def phaseConstant {m : ℕ} (a : ℝ) (U : Fin m → ℝ) (p : PhaseVector m) : ℝ := + ∏ i, if p i=3 then Real.exp (regP a*U i/2)/3 else 1 +noncomputable def phaseProduct {m : ℕ} (a : ℝ) (cap U : Fin m → ℝ) + (p : PhaseVector m) (v : Fin m → State) : ℝ := + phaseConstant a U p*regularizedProduct (phaseActive p) a cap (phaseSigma a p) (phaseOffset a U p) v +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/CutoffFlow.lean b/lean/OAI/Probability/SLEGauge/CutoffFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..5eaf92adfe8802e9be67090fdad4c3b27342a67c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/CutoffFlow.lean @@ -0,0 +1,420 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.LiteralTrace + +open scoped ContinuousMapZero +abbrev Driver := C(ℝ≥0, ℝ)₀ +instance : MeasurableSpace Driver := borel Driver +instance : BorelSpace Driver := ⟨rfl⟩ +abbrev WienerLaw := Measure Driver + +def IsWiener (W : WienerLaw) : Prop := + ProbabilityTheory.IsBrownianReal (fun t b => b t) W + +def a (κ : ℝ) := 2 / κ +def d (κ : ℝ) := 1 + 1 / (4 * a κ) +def α (κ : ℝ) := 2 - d κ +def p (κ : ℝ) := 4 * a κ - 1 + +def driverValue (b : Driver) (t : ℝ) : ℝ := b t.toNNReal + +def diskMap (θ : ℝ) (z : ℂ) : ℂ := + (z - Complex.exp (θ * Complex.I)) / (z - Complex.exp (-θ * Complex.I)) + +def diskMapInv (θ : ℝ) (x : ℂ) : ℂ := + (Complex.exp (θ * Complex.I) - x * Complex.exp (-θ * Complex.I)) / (1 - x) + + +def cutoffField (κ : ℝ) (b : Driver) (j : ℕ) (t : ℝ) (z : ℂ) : ℂ := + (a κ : ℂ) * star (z - driverValue b t) / + (max (‖z - driverValue b t‖ ^ 2) ((j : ℝ) ^ (-(4 : ℤ))) : ℝ) + +def mesh (N : ℕ) : ℝ := (2 : ℝ) ^ (-(N : ℤ)) + +def eulerSteps (κ : ℝ) (b : Driver) (j N : ℕ) (z : ℂ) : ℕ → ℂ + | 0 => z + | k + 1 => eulerSteps κ b j N z k + + mesh N * cutoffField κ b j ((k : ℝ) * mesh N) (eulerSteps κ b j N z k) + +def eulerFlow (κ : ℝ) (b : Driver) (j N : ℕ) (z : ℂ) (t : ℝ) : ℂ := + let k := ⌊t / mesh N⌋₊ + let w := t / mesh N - (k : ℝ) + (1 - w : ℝ) * eulerSteps κ b j N z k + w * eulerSteps κ b j N z (k + 1) + +def cutoffFlow (κ : ℝ) (b : Driver) (j : ℕ) (z : ℂ) (t : ℝ) : ℂ := + limUnder atTop (fun N : ℕ => eulerFlow κ b j N z t) + +def Surviving (κ : ℝ) (b : Driver) (z : ℂ) (t : ℝ) : Prop := + ∃ j : ℕ, 1 ≤ j ∧ (j : ℝ)⁻¹ < + sInf ((fun u : ℝ => (cutoffFlow κ b j z u).im) '' Icc 0 t) + +instance (κ : ℝ) (b : Driver) (z : ℂ) (t : ℝ) : Decidable (Surviving κ b z t) := + Classical.propDecidable _ + +def flow (κ : ℝ) (b : Driver) (z : ℂ) (t : ℝ) : ℂ := + if h : Surviving κ b z t then cutoffFlow κ b (Nat.find h) z t else 0 + +def centeredFlow (κ : ℝ) (b : Driver) (z : ℂ) (t : ℝ) : ℂ := + flow κ b z t - driverValue b t + + +def clock (κ θ : ℝ) (b : Driver) (x : ℂ) (t : ℝ) : ℝ := + ∫ u in Icc (0 : ℝ) t, + (flow κ b (diskMapInv θ x) u).im ^ 2 / + ‖centeredFlow κ b (diskMapInv θ x) u‖ ^ 4 + +def initialRadius (θ : ℝ) (x : ℂ) : ℝ := + 2 * (diskMapInv θ x).im * ‖deriv (diskMap θ) (diskMapInv θ x)‖ + +def radius (κ θ : ℝ) (b : Driver) (x : ℂ) (t : ℝ) : ℝ := + initialRadius θ x * Real.exp (-2 * a κ * clock κ θ b x t) + +def angle (κ θ : ℝ) (b : Driver) (x : ℂ) (t : ℝ) : ℝ := + Complex.arg (centeredFlow κ b (diskMapInv θ x) t) + +def green (κ θ : ℝ) (b : Driver) (x : ℂ) (t : ℝ) : ℝ := + if Surviving κ b (diskMapInv θ x) t then + radius κ θ b x t ^ (-α κ) * Real.sin (angle κ θ b x t) ^ p κ + else 0 + + +def levelTime (κ θ : ℝ) (b : Driver) (ℓ : ℝ) : ℝ≥0∞ := + sInf {t | ∃ q : ℚ, 0 < q ∧ t = ENNReal.ofReal (q : ℝ) ∧ + Surviving κ b (diskMapInv θ 0) q ∧ ℓ < clock κ θ b 0 q} + +def diskK : Set ℂ := closedBall 0 (1 / 4) + +def potential (κ θ : ℝ) (b : Driver) (t : ℝ) : ℝ≥0∞ := + ∫⁻ x in diskK, ENNReal.ofReal (green κ θ b x t) + + + +def concat (b c : Driver) (t : ℝ) : Driver where + toFun u := if u ≤ t.toNNReal then b u else b t.toNNReal + c (u - t.toNNReal) + continuous_toFun := by + apply Continuous.if_le (map_continuous b) + (continuous_const.add ((map_continuous c).comp (continuous_id.sub continuous_const))) + continuous_id continuous_const + intro u hu + change u = t.toNNReal at hu + subst u + simp + map_zero' := by simp + + +def potentialDifference (κ θ : ℝ) (W : WienerLaw) (b : Driver) (h i : ℕ) : ℝ := + let t := (i : ℝ) * mesh h + let v := potential κ θ b t + let w := ∫⁻ c, potential κ θ (concat b c t) (((i : ℝ) + 1) * mesh h) ∂W + if v < ∞ ∧ w < ∞ then v.toReal - w.toReal else 0 + +def discreteMass (κ θ : ℝ) (W : WienerLaw) (b : Driver) (ℓ : ℝ) (h : ℕ) : ℝ := + ∑ i ∈ Finset.range (h * 2 ^ h), + if ENNReal.ofReal (((i : ℝ) + 1) * mesh h) ≤ levelTime κ θ b ℓ + then potentialDifference κ θ W b h i else 0 + +def levelDensity (κ θ : ℝ) (b : Driver) (ℓ : ℝ) : ℝ := + let τ := levelTime κ θ b ℓ + if τ < ∞ then Real.exp (2 * a κ * α κ * ℓ) * + Real.sin (angle κ θ b 0 τ.toReal) ^ p κ / Real.sin θ ^ p κ else 0 + + +def angleLaw (κ : ℝ) : Measure ℝ := + let unnormalized := (volume.restrict (Ioo (0 : ℝ) Real.pi)).withDensity + (fun θ => ENNReal.ofReal (Real.sin θ ^ (4 * a κ))) + (unnormalized Set.univ)⁻¹ • unnormalized + +def clip (u x : ℝ) : ℝ := min (max x 0) u + + + +def finiteMoment (κ : ℝ) (W : WienerLaw) (n : ℕ) (ℓ : ℝ) : ℝ := + limUnder atTop (fun u : ℕ => limUnder atTop (fun h : ℕ => + ∫ θ, ∫ b, levelDensity κ θ b ℓ * + (clip u (discreteMass κ θ W b ℓ h)) ^ n ∂W ∂angleLaw κ)) + +def moment (κ : ℝ) (W : WienerLaw) (n : ℕ) : ℝ := + limUnder atTop (fun ℓ : ℕ => finiteMoment κ W n ℓ) + + +def batchLevel (κ : ℝ) (W : WienerLaw) (n : ℕ) : ℕ := + 1 + Nat.card {j : ℕ // 1 ≤ j ∧ finiteMoment κ W n j ≤ 3 * moment κ W n / 4} + +def threshold (κ : ℝ) (W : WienerLaw) (n : ℕ) : ℝ := + 4 * moment κ W (n + 1) / moment κ W n + +def multiplicity (κ : ℝ) (W : WienerLaw) (n : ℕ) (k : ℤ) : ℕ := + if (2 : ℝ) ^ k ≤ threshold κ W n then + ⌊(4 : ℝ) ^ n * ((2 : ℝ) ^ k) ^ n / moment κ W n⌋₊ else 0 + + + +abbrev Entry := ℕ × Option (ℤ × ℕ) + +def ValidEntry (κ : ℝ) (W : WienerLaw) (e : Entry) : Prop := + 1 ≤ e.1 ∧ match e.2 with + | none => True + | some (k,j) => j < multiplicity κ W e.1 k + +def entryValue (e : Entry) : ℝ := + match e.2 with + | none => e.1 + | some (k,_) => (2 : ℝ) ^ k + +def entryPosition (κ : ℝ) (W : WienerLaw) (e : Entry) : ℕ := + match e.2 with + | none => ∑' k : ℤ, multiplicity κ W e.1 k + | some (k,j) => (∑' l : ℤ, if l < k then multiplicity κ W e.1 l else 0) + j + +def entryRadius (κ : ℝ) (W : WienerLaw) (e : Entry) : ℝ := + Real.exp (-(e.1 : ℝ) ^ 2 - 2 * a κ * (entryPosition κ W e : ℝ) * + ((batchLevel κ W e.1 : ℝ) + (e.1 : ℝ))) + +def entryCost (κ : ℝ) (W : WienerLaw) (e : Entry) (r : ℝ) : ℝ := + entryValue e * entryRadius κ W e ^ d κ * max 1 ((r / entryRadius κ W e) ^ 2) + + +def gauge (κ : ℝ) (W : WienerLaw) (r : ℝ) : ℝ := + if r ≤ 0 then 0 else sInf {v | ∃ e : Entry, ValidEntry κ W e ∧ v = entryCost κ W e r} + +def IsHausdorffGauge (h : ℝ → ℝ) : Prop := + ContinuousOn h (Ici 0) ∧ MonotoneOn h (Ici 0) ∧ h 0 = 0 ∧ ∀ r > 0, 0 < h r + + +def hausdorff (h : ℝ → ℝ) : OuterMeasure ℂ := + OuterMeasure.mkMetric (fun r => if r = ∞ then ∞ else ENNReal.ofReal (h r.toReal)) + +def inverseFlow (κ : ℝ) (b : Driver) (t : ℝ) (w : ℂ) : ℂ := + @ite ℂ (∃ z : ℂ, Surviving κ b z t ∧ flow κ b z t = w) (Classical.propDecidable _) + (Classical.epsilon (fun z : ℂ => Surviving κ b z t ∧ flow κ b z t = w)) 0 + + +def trace (κ : ℝ) (b : Driver) (t : ℝ) : ℂ := + limUnder (nhdsWithin 0 (Ioi 0)) (fun ε : ℝ => + inverseFlow κ b (κ * t) (driverValue b (κ * t) + ε * Complex.I)) + + + +def MainObligation : Prop := + ∀ κ : ℝ, 0 < κ → κ < 8 → ∀ W : WienerLaw, IsWiener W → + IsHausdorffGauge (gauge κ W) ∧ + ∀ᵐ b ∂W, ∀ s t : ℝ, 0 < s → s < t → + 0 < hausdorff (gauge κ W) ((trace κ b) '' Icc s t) ∧ + hausdorff (gauge κ W) ((trace κ b) '' Icc s t) < ∞ + +end SLEExactGauge.LiteralTrace + + + +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.Cutoff + +def denominator (q : ℝ) (z : ℂ) : ℝ := max (‖z‖^2) (q^2) + +def inverse (q : ℝ) (z : ℂ) : ℂ := star z / (denominator q z : ℂ) + +lemma denominator_pos {q : ℝ} (hq : 0 < q) (z : ℂ) : 0 < denominator q z := + lt_of_lt_of_le (sq_pos_of_pos hq) (le_max_right _ _) + +lemma q_mul_norm_le_denominator {q : ℝ} (hq : 0 ≤ q) (z : ℂ) : + q * ‖z‖ ≤ denominator q z := by + by_cases he : ‖z‖ ≤ q + · exact (mul_le_mul_of_nonneg_left he hq).trans (by + change q*q ≤ max (‖z‖^2) (q^2) + rw [← sq] + exact le_max_right _ _) + · exact (mul_le_mul_of_nonneg_right (le_of_not_ge he) (norm_nonneg _)).trans (by + change ‖z‖*‖z‖ ≤ max (‖z‖^2) (q^2) + rw [← sq] + exact le_max_left _ _) + +lemma norm_inverse_le {q : ℝ} (hq : 0 < q) (z : ℂ) : + ‖inverse q z‖ ≤ q⁻¹ := by + rw [inverse, norm_div, norm_star, Complex.norm_real, + Real.norm_eq_abs, abs_of_pos (denominator_pos hq z)] + apply (div_le_iff₀ (denominator_pos hq z)).mpr + have hh := q_mul_norm_le_denominator hq.le z + have he : q⁻¹ * denominator q z = denominator q z / q := by ring + rw [he] + exact (le_div_iff₀ hq).mpr (by simpa only [mul_comm] using hh) + +lemma denominator_sub_le {q : ℝ} {z w : ℂ} (hzw : ‖z‖ ≤ ‖w‖) : + 0 ≤ denominator q w - denominator q z ∧ + denominator q w - denominator q z ≤ (‖w‖+‖z‖)*‖w-z‖ := by + have hn : ‖z‖^2 ≤ ‖w‖^2 := sq_le_sq₀ (norm_nonneg _) (norm_nonneg _) |>.mpr hzw + have hden : denominator q z ≤ denominator q w := max_le_max_right _ hn + refine ⟨sub_nonneg.mpr hden, ?_⟩ + have hd : max (‖w‖^2) (q^2) - max (‖z‖^2) (q^2) ≤ ‖w‖^2 - ‖z‖^2 := by + by_cases hz : q^2 ≤ ‖z‖^2 + · rw [max_eq_left (hz.trans hn), max_eq_left hz] + · rw [max_eq_right (le_of_not_ge hz)] + by_cases hw : q^2 ≤ ‖w‖^2 + · rw [max_eq_left hw] + linarith + · rw [max_eq_right (le_of_not_ge hw)] + linarith + refine hd.trans ?_ + calc ‖w‖^2 - ‖z‖^2 = (‖w‖+‖z‖)*(‖w‖-‖z‖) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left (norm_sub_norm_le w z) + (add_nonneg (norm_nonneg _) (norm_nonneg _)) + +lemma inverse_sub_bound_ordered {q : ℝ} (hq : 0 < q) (z w : ℂ) + (hzw : ‖z‖ ≤ ‖w‖) : + ‖inverse q z - inverse q w‖ ≤ (3/q^2)*‖z-w‖ := by + let dz := denominator q z + let dw := denominator q w + have hz : 0 < dz := denominator_pos hq z + have hw : 0 < dw := denominator_pos hq w + have hzne : (dz : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hz + have hwne : (dw : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hw + have he : inverse q z - inverse q w = + (star z - star w)/(dw:ℂ) + star z * ((dw:ℂ)-(dz:ℂ))/((dz:ℂ)*(dw:ℂ)) := by + dsimp [inverse] + change star z/(dz:ℂ)-star w/(dw:ℂ) = _ + change star z/(dz:ℂ)-star w/(dw:ℂ) = + (star z-star w)/(dw:ℂ)+star z*((dw:ℂ)-(dz:ℂ))/((dz:ℂ)*(dw:ℂ)) + field_simp [hzne, hwne] + ring + have hd := denominator_sub_le (q := q) hzw + have hdz : q^2 ≤ dz := le_max_right _ _ + have hdw : q^2 ≤ dw := le_max_right _ _ + have hqw := q_mul_norm_le_denominator hq.le w + have htwo : ‖z‖*(dw-dz) ≤ 2 * dw * ‖z-w‖ := by + have hm := mul_le_mul_of_nonneg_left hd.2 (norm_nonneg z) + rw [norm_sub_rev w z] at hm + have hn : ‖z‖*(‖w‖+‖z‖) ≤ 2*dw := by + have hww : ‖w‖^2 ≤ dw := le_max_left _ _ + nlinarith [norm_nonneg z, norm_nonneg w] + calc ‖z‖*(dw-dz) ≤ ‖z‖*((‖w‖+‖z‖)*‖z-w‖) := hm + _ = (‖z‖*(‖w‖+‖z‖))*‖z-w‖ := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right hn (norm_nonneg _) + have hb₁ : ‖star z - star w‖ / dw ≤ ‖z-w‖ / q^2 := by + rw [← star_sub, norm_star] + exact div_le_div_of_nonneg_left (norm_nonneg _) (sq_pos_of_pos hq) hdw + have hb₂ : ‖z‖*(dw-dz)/(dz*dw) ≤ 2*‖z-w‖/(q^2) := by + calc + _ ≤ 2*dw*‖z-w‖/(dz*dw) := div_le_div_of_nonneg_right htwo (mul_nonneg hz.le hw.le) + _ = 2*‖z-w‖/dz := by field_simp + _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (sq_pos_of_pos hq) hdz + rw [he] + calc + _ ≤ ‖(star z-star w)/(dw:ℂ)‖ + + ‖star z*((dw:ℂ)-(dz:ℂ))/((dz:ℂ)*(dw:ℂ))‖ := norm_add_le _ _ + _ = ‖star z-star w‖/dw + ‖z‖*(dw-dz)/(dz*dw) := by + rw [norm_div, norm_div, norm_mul, norm_mul, norm_star, + ← Complex.ofReal_sub, Complex.norm_real, Complex.norm_real, + Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_pos hw, abs_of_pos hz, abs_of_nonneg hd.1] + _ ≤ ‖z-w‖/q^2 + 2*‖z-w‖/q^2 := add_le_add hb₁ hb₂ + _ = _ := by ring + +lemma inverse_sub_bound {q : ℝ} (hq : 0 < q) (z w : ℂ) : + ‖inverse q z - inverse q w‖ ≤ (3/q^2)*‖z-w‖ := by + rcases le_total ‖z‖ ‖w‖ with h | h + · exact inverse_sub_bound_ordered hq z w h + · simpa only [norm_sub_rev] using inverse_sub_bound_ordered hq w z h + +lemma lipschitz_inverse {q : ℝ} (hq : 0 < q) : + LipschitzWith ⟨3/q^2, by positivity⟩ (inverse q) := by + apply LipschitzWith.of_dist_le_mul + intro z w + change dist (inverse q z) (inverse q w) ≤ (3/q^2)*dist z w + simpa only [dist_eq_norm] using inverse_sub_bound hq z w + + +def field (a q : ℝ) (b : ℝ → ℝ) (t : ℝ) (z : ℂ) : ℂ := + (a : ℂ) * inverse q (z - (b t : ℂ)) + +lemma norm_field_le {q : ℝ} (hq : 0 < q) (a : ℝ) (b : ℝ → ℝ) (t : ℝ) (z : ℂ) : + ‖field a q b t z‖ ≤ |a| / q := by + rw [field, norm_mul, Complex.norm_real, Real.norm_eq_abs] + calc |a| * ‖inverse q (z - (b t : ℂ))‖ ≤ |a| * q⁻¹ := + mul_le_mul_of_nonneg_left (norm_inverse_le hq _) (abs_nonneg a) + _ = _ := div_eq_mul_inv _ _ |>.symm + +lemma field_sub_le {q : ℝ} (hq : 0 < q) (a : ℝ) (b : ℝ → ℝ) (t : ℝ) (z w : ℂ) : + ‖field a q b t z - field a q b t w‖ ≤ (|a| *3/q^2)*‖z-w‖ := by + rw [field, field, ← mul_sub, norm_mul, Complex.norm_real, Real.norm_eq_abs] + have hh := mul_le_mul_of_nonneg_left + (inverse_sub_bound hq (z-(b t:ℂ)) (w-(b t:ℂ))) (abs_nonneg a) + simpa only [sub_sub_sub_cancel_right, mul_div_assoc, mul_assoc] using hh + +lemma continuous_field_time {q : ℝ} (hq : 0 < q) (a : ℝ) {b : ℝ → ℝ} + (hb : Continuous b) (z : ℂ) : Continuous (fun t => field a q b t z) := by + exact continuous_const.mul ((lipschitz_inverse hq).continuous.comp + (continuous_const.sub (Complex.continuous_ofReal.comp hb))) + +lemma field_joint_sub_le {q : ℝ} (hq : 0 < q) (a : ℝ) (b : ℝ → ℝ) + (s t : ℝ) (z w : ℂ) : + ‖field a q b s z - field a q b t w‖ ≤ + (|a| *3/q^2)*(‖z-w‖ + |b s-b t|) := by + rw [field, field, ← mul_sub, norm_mul, Complex.norm_real, Real.norm_eq_abs] + have hdiff : (z-(b s:ℂ))-(w-(b t:ℂ)) = (z-w)-((b s:ℂ)-(b t:ℂ)) := by ring + calc + _ ≤ |a| * ((3/q^2)*‖(z-(b s:ℂ))-(w-(b t:ℂ))‖) := + mul_le_mul_of_nonneg_left (inverse_sub_bound hq _ _) (abs_nonneg _) + _ = (|a| *3/q^2)*‖(z-w)-((b s:ℂ)-(b t:ℂ))‖ := by rw [hdiff]; ring + _ ≤ (|a| *3/q^2)*(‖z-w‖ + ‖(b s:ℂ)-(b t:ℂ)‖) := + mul_le_mul_of_nonneg_left (norm_sub_le _ _) (by positivity) + _ = _ := by rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] + + + +theorem exists_solution_on_compact {q : ℝ} (hq : 0 < q) (a : ℝ) {b : ℝ → ℝ} + (hb : Continuous b) (z : ℂ) {T : ℝ} (hT : 0 ≤ T) : + ∃ g : ℝ → ℂ, g 0 = z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt g (field a q b t (g t)) (Icc 0 T) t := by + let M : ℝ≥0 := ⟨|a|/q, by positivity⟩ + let K : ℝ≥0 := ⟨|a| *3/q^2, by positivity⟩ + let R : ℝ≥0 := ⟨(|a|/q)*T, mul_nonneg (by positivity) hT⟩ + have hp : IsPicardLindelof (field a q b) (tmin := 0) (tmax := T) + ⟨0, ⟨le_rfl, hT⟩⟩ z R 0 M K := by + constructor + · intro t ht + apply LipschitzWith.lipschitzOnWith + apply LipschitzWith.of_dist_le_mul + intro w v + change dist (field a q b t w) (field a q b t v) ≤ (|a| *3/q^2)*dist w v + simpa only [dist_eq_norm] using field_sub_le hq a b t w v + · intro w hw + exact (continuous_field_time hq a hb w).continuousOn + · intro t ht w hw + exact norm_field_le hq a b t w + · change (|a|/q)*max (T-0) (0-0) ≤ (|a|/q)*T-0 + simp only [sub_zero, sub_self, max_eq_left hT, le_refl] + exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + +end SLEExactGauge.Cutoff + + + +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.Euler + +def nodes (f : ℝ → ℂ → ℂ) (h : ℝ) (z : ℂ) : ℕ → ℂ + | 0 => z + | k+1 => nodes f h z k + h • f ((k:ℝ)*h) (nodes f h z k) + +end SLEExactGauge.Euler +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/DynkinIdentity.lean b/lean/OAI/Probability/SLEGauge/DynkinIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf132294fa735115d8e65ff5185bda4c62cd3bba --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/DynkinIdentity.lean @@ -0,0 +1,442 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RiemannIntegrals + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +namespace ExactSLEGenerator +variable {E Ω : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace Ω] +variable [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] +theorem additive_brownian_dynkin (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (D : E → E →L[ℝ] ℝ) (hD : ∀ x, HasFDerivAt f (D x) x) + (hDc : Continuous D) + (C M : ℝ) (hC : 0 ≤ C) (hM : 0 ≤ M) + (hLip : ∀ x y, ‖D y - D x‖ ≤ C * ‖y-x‖) + (hSmooth : ∀ x, ContDiff ℝ 3 (fun w : ℝ => f (x + w • e))) + (hThird : ∀ x w, |iteratedDeriv 3 (fun r : ℝ => f (x + r • e)) w| ≤ C) + (hQc : Continuous (fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0)) + (hfb : ∀ x, |f x| ≤ M) (hDb : ∀ x, ‖D x‖ ≤ M) + (hQb : ∀ x, |iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0| ≤ M) + (T : ℝ≥0) : + (∫ b, f (X T b) ∂W) - (∫ b, f (X 0 b) ∂W) = + (1/2 : ℝ) * (∫ b, (∫ t in 0..(T : ℝ), + iteratedDeriv 2 (fun r : ℝ => f (X t.toNNReal b + r • e)) 0) ∂W) + + (∫ b, (∫ t in 0..(T : ℝ), D (X t.toNNReal b) (A (X t.toNNReal b))) ∂W) := by + have hfc : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hD x).continuousAt) + let X' : ℝ → Driver → E := fun t b => X t.toNNReal b + have hX'c (b : Driver) : Continuous (fun t => X' t b) := + (hXc b).comp continuous_real_toNNReal + have hX'm (t : ℝ) : Measurable (X' t) := (hXm t.toNNReal).mono (rawFiltration.le _) le_rfl + have hXs (t : ℝ≥0) (b : Driver) : X' t b = X t b := by simp [X'] + let Q : E → ℝ := fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0 + have hZc : Continuous (fun x => D x e) := hDc.clm_apply continuous_const + have hZi (t : ℝ) : Integrable (fun b => D (X' t b) e) W := by + apply Integrable.of_bound (hZc.measurable.comp (hX'm t)).aestronglyMeasurable M + refine ae_of_all W (fun b => ?_) + calc + _ ≤ ‖D (X' t b)‖ * ‖e‖ := (D _).le_opNorm _ + _ ≤ M * 1 := mul_le_mul (hDb _) he (norm_nonneg _) hM + _ = M := mul_one _ + have hVm (u v : ℝ) : AEStronglyMeasurable + (fun b => D (X' u b) (∫ t in u..v, A (X' t b))) W := by + have hd : AEStronglyMeasurable (fun b => D (X' u b)) W := + hDc.comp_aestronglyMeasurable (hX'm u).aestronglyMeasurable + have hi : StronglyMeasurable (fun b => ∫ t in u..v, A (X' t b)) := + stronglyMeasurable_intervalIntegral_of_continuous (fun t b => A (X' t b)) + (fun b => hAc.comp (hX'c b)) (fun t => hAc.measurable.comp (hX'm t)) u v + exact (continuous_fst.clm_apply continuous_snd).comp_aestronglyMeasurable + (hd.prodMk hi.aestronglyMeasurable) + have hTaylor (s h : ℝ≥0) (b : Driver) : + |f (X' ((s+h : ℝ≥0) : ℝ) b) - f (X' s b) - D (X' s b) e * increment s h b - + Q (X' s b) * increment s h b ^ 2 / 2 - + D (X' s b) (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b))| ≤ + C * (K*h*(|increment s h b|+K*h)+|increment s h b|^3) := by + have hv : ‖∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)‖ ≤ K * (h : ℝ) := by + have hb := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (s : ℝ)) (b := ((s+h : ℝ≥0) : ℝ)) (fun t ht => hAb (X' t b)) + simpa only [NNReal.coe_add, add_sub_cancel_left, abs_of_nonneg h.coe_nonneg] using hb + have ht := mixed_taylor_remainder f D hD e he C hC hLip hSmooth hThird (X s b) + (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)) (increment s h b) + rw [← hXeq s h b] at ht + simp only [hXs] + change |f (X (s+h) b) - f (X s b) - D (X s b) e * increment s h b - + Q (X s b) * increment s h b ^ 2 / 2 - D (X s b) (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b))| ≤ _ at ht + have hs : |increment s h b| + ‖∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)‖ ≤ + |increment s h b| + K*(h : ℝ) := by linarith + have hm := mul_le_mul hv hs + (add_nonneg (abs_nonneg (increment s h b)) (norm_nonneg _)) + (mul_nonneg hK h.coe_nonneg) + exact ht.trans (mul_le_mul_of_nonneg_left (add_le_add hm (le_refl _)) hC) + have hg := dynkin_of_mixed_taylor W hW 0 + (fun t b => f (X' t b)) (fun t b => D (X' t b) e) (fun t b => Q (X' t b)) + (fun t b => D (X' t b)) (fun t b => A (X' t b)) + (fun t => Integrable.of_bound (hfc.measurable.comp (hX'm t)).aestronglyMeasurable M + (ae_of_all W (fun b => by simpa only [Real.norm_eq_abs] using hfb (X' t b)))) + (fun t => by + have ht : rawFiltration (0+t) = rawFiltration t := congrArg rawFiltration (zero_add t) + rw [ht] + simpa only [hXs, Function.comp_def] using hZc.measurable.comp (hXm t)) + (fun t => by + have ht : rawFiltration (0+t) = rawFiltration t := congrArg rawFiltration (zero_add t) + rw [ht] + simpa only [hXs, Function.comp_def, Q] using hQc.measurable.comp (hXm t)) + (fun t => hZi t) (fun b => hQc.comp (hX'c b)) + (fun t => (hQc.measurable.comp (hX'm t)).aestronglyMeasurable) + (fun b => hDc.comp (hX'c b)) (fun b => hAc.comp (hX'c b)) hVm C M K hC hM hK + (fun b t => hQb _) (fun b t => hDb _) (fun b t => hAb _) + (fun s h b => by simpa only [NNReal.coe_add, zero_add] using hTaylor s h b) T + simpa only [hXs, X', Q, Real.toNNReal_zero] using hg + +end ExactSLEGenerator + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + + +theorem weighted_dynkin_of_mixed_taylor (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (start : ℝ≥0) (F Z Y : ℝ → Driver → ℝ) (D : ℝ → Driver → E →L[ℝ] ℝ) (A : ℝ → Driver → E) + (hF : ∀ t : ℝ≥0, Integrable (F t) W) + (hZm : ∀ t : ℝ≥0, Measurable[rawFiltration (start+t)] (Z t)) + (hYm : ∀ t : ℝ≥0, Measurable[rawFiltration (start+t)] (Y t)) + (hZi : ∀ t : ℝ≥0, Integrable (Z t) W) + (hYc : ∀ b, Continuous (fun t => Y t b)) + (hYm' : ∀ t, AEStronglyMeasurable (Y t) W) + (hDc : ∀ b, Continuous (fun t => D t b)) + (hAc : ∀ b, Continuous (fun t => A t b)) + (hVm : ∀ u v, AEStronglyMeasurable (fun b => D u b (∫ t in u..v, A t b)) W) + (C M K : ℝ) (hC : 0 ≤ C) (hM : 0 ≤ M) (hK : 0 ≤ K) + (hYb : ∀ b t, |Y t b| ≤ M) (hDb : ∀ b t, ‖D t b‖ ≤ M) + (hAb : ∀ b t, ‖A t b‖ ≤ K) + (hTaylor : ∀ (s h : ℝ≥0) b, + |F (s+h) b - F s b - Z s b * increment (start+s) h b - + Y s b * increment (start+s) h b ^ 2 / 2 - D s b (∫ t in (s : ℝ)..(s+h : ℝ≥0), A t b)| ≤ + C * (K * h * (|increment (start+s) h b| + K * h) + |increment (start+s) h b| ^ 3)) + (J : Driver → ℝ) (hJm : Measurable[rawFiltration start] J) (hJb : ∀ b, |J b| ≤ 1) + (T : ℝ≥0) : + (∫ b, J b * F T b ∂W) - (∫ b, J b * F 0 b ∂W) = + (1/2 : ℝ) * (∫ b, J b * (∫ t in 0..(T : ℝ), Y t b) ∂W) + + (∫ b, J b * (∫ t in 0..(T : ℝ), D t b (A t b)) ∂W) := by + have hJ : AEStronglyMeasurable J W := (hJm.mono (rawFiltration.le _) le_rfl).aestronglyMeasurable + have hJbound : ∀ᵐ b ∂W, ‖J b‖ ≤ 1 := ae_of_all W (fun b => by simpa using hJb b) + have hJmt (t : ℝ≥0) : Measurable[rawFiltration (start+t)] J := + hJm.mono (rawFiltration.mono (le_self_add)) le_rfl + have h := dynkin_of_mixed_taylor W hW start + (fun t b => J b * F t b) (fun t b => J b * Z t b) (fun t b => J b * Y t b) + (fun t b => J b • D t b) A + (fun t => (hF t).bdd_mul hJ hJbound) + (fun t => (hJmt t).mul (hZm t)) (fun t => (hJmt t).mul (hYm t)) + (fun t => (hZi t).bdd_mul hJ hJbound) + (fun b => continuous_const.mul (hYc b)) + (fun t => hJ.mul (hYm' t)) + (fun b => (continuous_const : Continuous (fun _ : ℝ => J b)).smul (hDc b)) hAc + (fun u v => hJ.mul (hVm u v)) + C M K hC hM hK + (fun b t => by + rw [abs_mul] + exact (mul_le_mul (hJb b) (hYb b t) (abs_nonneg _) (by norm_num)).trans (by simp)) + (fun b t => by + rw [norm_smul, Real.norm_eq_abs] + exact (mul_le_mul (hJb b) (hDb b t) (norm_nonneg _) (by norm_num)).trans (by simp)) + hAb + (fun s h b => by + simp only [smul_apply, smul_eq_mul] + have he : J b * F (s+h) b - J b * F s b - J b * Z s b * increment (start+s) h b - + J b * Y s b * increment (start+s) h b ^ 2 / 2 - + J b * D s b (∫ t in (s : ℝ)..(s+h : ℝ≥0), A t b) = + J b * (F (s+h) b - F s b - Z s b * increment (start+s) h b - + Y s b * increment (start+s) h b ^ 2 / 2 - D s b (∫ t in (s : ℝ)..(s+h : ℝ≥0), A t b)) := by ring + rw [he, abs_mul] + exact (mul_le_mul_of_nonneg_right (hJb b) (abs_nonneg _)).trans (by simpa only [one_mul] using hTaylor s h b)) T + simpa only [smul_apply, smul_eq_mul, intervalIntegral.integral_const_mul] using h + +end ExactSLEGenerator + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + +theorem additive_brownian_weighted_dynkin (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (start : ℝ≥0) (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration (start+t)] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment (start+s) h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (D : E → E →L[ℝ] ℝ) (hD : ∀ x, HasFDerivAt f (D x) x) + (hDc : Continuous D) + (C M : ℝ) (hC : 0 ≤ C) (hM : 0 ≤ M) + (hLip : ∀ x y, ‖D y - D x‖ ≤ C * ‖y-x‖) + (hSmooth : ∀ x, ContDiff ℝ 3 (fun w : ℝ => f (x + w • e))) + (hThird : ∀ x w, |iteratedDeriv 3 (fun r : ℝ => f (x + r • e)) w| ≤ C) + (hQc : Continuous (fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0)) + (hfb : ∀ x, |f x| ≤ M) (hDb : ∀ x, ‖D x‖ ≤ M) + (hQb : ∀ x, |iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0| ≤ M) + (J : Driver → ℝ) (hJm : Measurable[rawFiltration start] J) (hJb : ∀ b, |J b| ≤ 1) + (T : ℝ≥0) : + (∫ b, J b * f (X T b) ∂W) - (∫ b, J b * f (X 0 b) ∂W) = + (1/2 : ℝ) * (∫ b, J b * (∫ t in 0..(T : ℝ), + iteratedDeriv 2 (fun r : ℝ => f (X t.toNNReal b + r • e)) 0) ∂W) + + (∫ b, J b * (∫ t in 0..(T : ℝ), D (X t.toNNReal b) (A (X t.toNNReal b))) ∂W) := by + have hfc : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hD x).continuousAt) + let X' : ℝ → Driver → E := fun t b => X t.toNNReal b + have hX'c (b : Driver) : Continuous (fun t => X' t b) := + (hXc b).comp continuous_real_toNNReal + have hX'm (t : ℝ) : Measurable (X' t) := (hXm t.toNNReal).mono (rawFiltration.le _) le_rfl + have hXs (t : ℝ≥0) (b : Driver) : X' t b = X t b := by simp [X'] + let Q : E → ℝ := fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0 + have hZc : Continuous (fun x => D x e) := hDc.clm_apply continuous_const + have hZi (t : ℝ) : Integrable (fun b => D (X' t b) e) W := by + apply Integrable.of_bound (hZc.measurable.comp (hX'm t)).aestronglyMeasurable M + refine ae_of_all W (fun b => ?_) + calc + _ ≤ ‖D (X' t b)‖ * ‖e‖ := (D _).le_opNorm _ + _ ≤ M * 1 := mul_le_mul (hDb _) he (norm_nonneg _) hM + _ = M := mul_one _ + have hVm (u v : ℝ) : AEStronglyMeasurable + (fun b => D (X' u b) (∫ t in u..v, A (X' t b))) W := by + have hd : AEStronglyMeasurable (fun b => D (X' u b)) W := + hDc.comp_aestronglyMeasurable (hX'm u).aestronglyMeasurable + have hi : StronglyMeasurable (fun b => ∫ t in u..v, A (X' t b)) := + stronglyMeasurable_intervalIntegral_of_continuous (fun t b => A (X' t b)) + (fun b => hAc.comp (hX'c b)) (fun t => hAc.measurable.comp (hX'm t)) u v + exact (continuous_fst.clm_apply continuous_snd).comp_aestronglyMeasurable + (hd.prodMk hi.aestronglyMeasurable) + have hTaylor (s h : ℝ≥0) (b : Driver) : + |f (X' ((s+h : ℝ≥0) : ℝ) b) - f (X' s b) - D (X' s b) e * increment (start+s) h b - + Q (X' s b) * increment (start+s) h b ^ 2 / 2 - + D (X' s b) (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b))| ≤ + C * (K*h*(|increment (start+s) h b|+K*h)+|increment (start+s) h b|^3) := by + have hv : ‖∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)‖ ≤ K * (h : ℝ) := by + have hb := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (s : ℝ)) (b := ((s+h : ℝ≥0) : ℝ)) (fun t ht => hAb (X' t b)) + simpa only [NNReal.coe_add, add_sub_cancel_left, abs_of_nonneg h.coe_nonneg] using hb + have ht := mixed_taylor_remainder f D hD e he C hC hLip hSmooth hThird (X s b) + (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)) (increment (start+s) h b) + rw [← hXeq s h b] at ht + simp only [hXs] + change |f (X (s+h) b) - f (X s b) - D (X s b) e * increment (start+s) h b - + Q (X s b) * increment (start+s) h b ^ 2 / 2 - D (X s b) (∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b))| ≤ _ at ht + have hs : |increment (start+s) h b| + ‖∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X' t b)‖ ≤ + |increment (start+s) h b| + K*(h : ℝ) := by linarith + have hm := mul_le_mul hv hs + (add_nonneg (abs_nonneg (increment (start+s) h b)) (norm_nonneg _)) + (mul_nonneg hK h.coe_nonneg) + exact ht.trans (mul_le_mul_of_nonneg_left (add_le_add hm (le_refl _)) hC) + have hg := weighted_dynkin_of_mixed_taylor W hW start + (fun t b => f (X' t b)) (fun t b => D (X' t b) e) (fun t b => Q (X' t b)) + (fun t b => D (X' t b)) (fun t b => A (X' t b)) + (fun t => Integrable.of_bound (hfc.measurable.comp (hX'm t)).aestronglyMeasurable M + (ae_of_all W (fun b => by simpa only [Real.norm_eq_abs] using hfb (X' t b)))) + (fun t => by + simpa only [hXs, Function.comp_def] using hZc.measurable.comp (hXm t)) + (fun t => by + simpa only [hXs, Function.comp_def, Q] using hQc.measurable.comp (hXm t)) + (fun t => hZi t) (fun b => hQc.comp (hX'c b)) + (fun t => (hQc.measurable.comp (hX'm t)).aestronglyMeasurable) + (fun b => hDc.comp (hX'c b)) (fun b => hAc.comp (hX'c b)) hVm C M K hC hM hK + (fun b t => hQb _) (fun b t => hDb _) (fun b t => hAb _) + (fun s h b => by simpa only [NNReal.coe_add] using hTaylor s h b) J hJm hJb T + simpa only [hXs, X', Q, Real.toNNReal_zero] using hg + +end ExactSLEGenerator + + +open MeasureTheory Filter Set Metric Function ODE +open scoped NNReal Topology +namespace ExactSLEFlow +variable {E Ω : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] [MeasurableSpace Ω] + +omit [CompleteSpace E] in +lemma stronglyMeasurable_intervalIntegral_of_continuous + (A : ℝ → Ω → E) (hc : ∀ b, Continuous (fun t => A t b)) + (hm : ∀ t, Measurable (A t)) (u v : ℝ) : + StronglyMeasurable (fun b => ∫ t in u..v, A t b) := by + have hj : StronglyMeasurable (Function.uncurry A) := + (measurable_uncurry_of_continuous_of_measurable hc hm).stronglyMeasurable + by_cases huv : u ≤ v + · simp_rw [intervalIntegral.integral_of_le huv] + exact hj.integral_prod_left + · simp_rw [intervalIntegral.integral_of_ge (le_of_not_ge huv)] + exact hj.integral_prod_left.neg + +omit [NormedSpace ℝ E] [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] + [SecondCountableTopology E] in +lemma bounded_forcing_picard (A : E → E) (L K : ℝ≥0) (hA : LipschitzWith K A) + (hb : ∀ x, ‖A x‖ ≤ L) (u : ℝ → E) (hu : Continuous u) (x : E) (T : ℝ≥0) : + IsPicardLindelof (fun t y => A (y + u t)) + (⟨0, by simp⟩ : Icc (0 : ℝ) T) x (L*T) 0 L K := by + constructor + · intro t ht + simpa only [mul_one, Function.comp_def, NNReal.coe_mul] using + (hA.comp (isometry_add_right (u t)).lipschitzWith).lipschitzOnWith + (s := closedBall x (L*T)) + · intro y hy + exact (hA.continuous.comp (continuous_const.add hu)).continuousOn + · intro t ht y hy + exact hb _ + · simp + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma picard_iterates_tendsto {f : ℝ → E → E} {tmin tmax : ℝ} + {t₀ : Icc tmin tmax} {x : E} {a L K : ℝ≥0} + (hf : IsPicardLindelof f t₀ x a 0 L K) + (α : ODE.FunSpace t₀ x 0 L) + (hα : IsFixedPt (ODE.FunSpace.next hf (mem_closedBall_self (by simp))) α) + (β : ODE.FunSpace t₀ x 0 L) (t : ℝ) : + Tendsto (fun n : ℕ => ((ODE.FunSpace.next hf (mem_closedBall_self (by simp)))^[n] β).compProj t) + atTop (𝓝 (α.compProj t)) := by + let t' : Icc tmin tmax := projIcc tmin tmax (le_trans t₀.2.1 t₀.2.2) t + rw [tendsto_iff_dist_tendsto_zero] + have hb (n : ℕ) := ODE.FunSpace.dist_iterate_next_apply_le hf + (mem_closedBall_self (by simp)) β α n t' + have he : ∀ n : ℕ, ((ODE.FunSpace.next hf (mem_closedBall_self (by simp)))^[n] α) = α := + fun n => hα.iterate n + simp only [he] at hb + have ht := (FloorSemiring.tendsto_pow_div_factorial_atTop + ((K : ℝ) * |(t' : ℝ) - (t₀ : ℝ)|)).mul_const (dist β α) + simp only [zero_mul] at ht + exact squeeze_zero (fun n => dist_nonneg) + (fun n => hb n) ht + + + +theorem measurable_additive_flow_on_interval + (A : E → E) (L K : ℝ≥0) (hA : LipschitzWith K A) (hb : ∀ x, ‖A x‖ ≤ L) + (u : ℝ → Ω → E) (huc : ∀ ω, Continuous (fun t => u t ω)) + (hum : ∀ t, Measurable (u t)) (x : Ω → E) (hxm : Measurable x) (T : ℝ≥0) : + ∃ Y : ℝ → Ω → E, + (∀ ω, Continuous (fun t => Y t ω)) ∧ + (∀ t, Measurable (Y t)) ∧ + (∀ ω t, t ∈ Icc (0 : ℝ) T → + Y t ω = x ω + ∫ v in 0..t, A (Y v ω + u v ω)) ∧ + (∀ ω t, t ∈ Icc (0 : ℝ) T → + HasDerivWithinAt (fun v => Y v ω) (A (Y t ω + u t ω)) (Icc (0 : ℝ) T) t) := by + let t₀ : Icc (0 : ℝ) T := ⟨0, by simp⟩ + have hf (ω : Ω) : IsPicardLindelof (fun t y => A (y + u t ω)) + t₀ (x ω) (L*T) 0 L K := bounded_forcing_picard A L K hA hb _ (huc ω) _ _ + have hfix (ω : Ω) := ODE.FunSpace.exists_isFixedPt_next (hf ω) + (mem_closedBall_self (by simp) : x ω ∈ closedBall (x ω) (0 : ℝ)) + choose α hα using hfix + let Y : ℝ → Ω → E := fun t ω => (α ω).compProj t + let β : (ω : Ω) → ODE.FunSpace t₀ (x ω) 0 L := fun ω => default + let N (ω : Ω) := ODE.FunSpace.next (hf ω) + (mem_closedBall_self (by simp) : x ω ∈ closedBall (x ω) (0 : ℝ)) + have hm (n : ℕ) (t : ℝ) : Measurable (fun ω => ((N ω)^[n] (β ω)).compProj t) := by + induction n generalizing t with + | zero => change Measurable x; exact hxm + | succ n ih => + have hc (ω : Ω) : Continuous (fun v => A (((N ω)^[n] (β ω)).compProj v + u v ω)) := + hA.continuous.comp ((ODE.FunSpace.continuous_compProj _).add (huc ω)) + have hi := stronglyMeasurable_intervalIntegral_of_continuous + (fun v ω => A (((N ω)^[n] (β ω)).compProj v + u v ω)) hc + (fun v => hA.continuous.measurable.comp ((ih v).add (hum v))) + 0 (projIcc (0 : ℝ) T T.coe_nonneg t) + simp only [iterate_succ_apply'] + change Measurable (fun ω => x ω + ∫ v in (0 : ℝ).. + (projIcc (0 : ℝ) T T.coe_nonneg t : ℝ), + A (((N ω)^[n] (β ω)).compProj v + u v ω)) + exact hxm.add hi.measurable + refine ⟨Y, fun ω => (α ω).continuous_compProj, fun t => ?_, ?_, ?_⟩ + · exact measurable_of_tendsto_metrizable (fun n => hm n t) + (tendsto_pi_nhds.mpr (fun ω => picard_iterates_tendsto (hf ω) (α ω) (hα ω) (β ω) t)) + · intro ω t ht + have he := (ODE.FunSpace.isFixedPt_next_iff (hf ω) + (mem_closedBall_self (by simp))).mp (hα ω) ⟨t, ht⟩ + change (α ω).compProj t = x ω + ∫ v in 0..t, A ((α ω).compProj v + u v ω) + rw [ODE.FunSpace.compProj_of_mem ht] + exact he + · intro ω t ht + apply ODE.hasDerivWithinAt_picard_Icc t₀.2 (hf ω).continuousOn_uncurry + (α ω).continuous_compProj.continuousOn + (fun _ _ => (α ω).compProj_mem_closedBall (hf ω).mul_max_le) (x ω) ht |>.congr_of_mem _ ht + intro v hv + change (α ω).compProj v = _ + nth_rw 1 [← hα ω] + rw [ODE.FunSpace.compProj_of_mem hv] + rfl + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma additive_flow_unique {A : E → E} {K : ℝ≥0} (hA : LipschitzWith K A) + {u : ℝ → E} {f g : ℝ → E} {T : ℝ≥0} + (hfc : ContinuousOn f (Icc 0 (T : ℝ))) (hgc : ContinuousOn g (Icc 0 (T : ℝ))) + (hfd : ∀ t ∈ Icc 0 (T : ℝ), HasDerivWithinAt f (A (f t + u t)) (Icc 0 (T : ℝ)) t) + (hgd : ∀ t ∈ Icc 0 (T : ℝ), HasDerivWithinAt g (A (g t + u t)) (Icc 0 (T : ℝ)) t) + (hinit : f 0 = g 0) : EqOn f g (Icc 0 (T : ℝ)) := by + apply ODE_solution_unique (K := K) (v := fun t y => A (y + u t)) + (fun t => by simpa only [mul_one, Function.comp_def] using hA.comp (isometry_add_right (u t)).lipschitzWith) + hfc (fun t ht => (hfd t (mem_Icc_of_Ico ht)).mono_of_mem_nhdsWithin + (Icc_mem_nhdsGE_of_mem ht)) + hgc (fun t ht => (hgd t (mem_Icc_of_Ico ht)).mono_of_mem_nhdsWithin + (Icc_mem_nhdsGE_of_mem ht)) hinit + + + +theorem measurable_additive_flow + (A : E → E) (L K : ℝ≥0) (hA : LipschitzWith K A) (hb : ∀ x, ‖A x‖ ≤ L) + (u : ℝ≥0 → Ω → E) (huc : ∀ ω, Continuous (fun t => u t ω)) + (hum : ∀ t, Measurable (u t)) (x : Ω → E) (hxm : Measurable x) : + ∃ Y : ℝ≥0 → Ω → E, + (∀ ω, Continuous (fun t => Y t ω)) ∧ + (∀ t, Measurable (Y t)) ∧ + (∀ ω t, Y t ω = x ω + ∫ v in (0 : ℝ)..(t : ℝ), + A (Y v.toNNReal ω + u v.toNNReal ω)) := by + have hex (T : ℝ≥0) := measurable_additive_flow_on_interval A L K hA hb + (fun t ω => u t.toNNReal ω) (fun ω => (huc ω).comp continuous_real_toNNReal) + (fun t => hum _) x hxm T + choose F hFc hFm hFe hFd using hex + have hF0 (T : ℝ≥0) (ω : Ω) : F T 0 ω = x ω := by + simpa using hFe T ω 0 (by simp) + have hcompat {S T : ℝ≥0} (hST : S ≤ T) (ω : Ω) (v : ℝ) (hv : v ∈ Icc 0 (S : ℝ)) : + F S v ω = F T v ω := by + have hsub : Icc (0 : ℝ) S ⊆ Icc (0 : ℝ) T := Icc_subset_Icc_right hST + apply additive_flow_unique hA (hFc S ω).continuousOn (hFc T ω).continuousOn + (hFd S ω) (fun t ht => (hFd T ω t (hsub ht)).mono hsub) + (by rw [hF0, hF0]) hv + let Y : ℝ≥0 → Ω → E := fun t ω => F t t ω + have hYF {T t : ℝ≥0} (ht : t ≤ T) (ω : Ω) : Y t ω = F T t ω := + hcompat ht ω t (by simp) + refine ⟨Y, ?_, fun t => hFm t t, ?_⟩ + · intro ω + apply continuous_iff_continuousAt.mpr + intro t + have hc : ContinuousAt (fun v : ℝ≥0 => F (t+1) v ω) t := + ((hFc (t+1) ω).comp continuous_subtype_val).continuousAt + apply hc.congr + filter_upwards [eventually_lt_nhds (show t < t+1 by simp)] with v hv + exact (hYF hv.le ω).symm + · intro ω t + rw [hYF le_rfl ω, hFe t ω t (by simp)] + congr 1 + apply intervalIntegral.integral_congr + intro v hv + have hv' : v ∈ Icc (0 : ℝ) t := by simpa [uIcc_of_le t.coe_nonneg] using hv + have hvt : v.toNNReal ≤ t := (Real.toNNReal_le_toNNReal hv'.2).trans_eq (by simp) + dsimp only + rw [hYF hvt ω, Real.coe_toNNReal _ hv'.1] + +end ExactSLEFlow +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/EulerConvergence.lean b/lean/OAI/Probability/SLEGauge/EulerConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..13a56e5929850a008e5da0027778e32f1e35e718 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/EulerConvergence.lean @@ -0,0 +1,467 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppedEstimates + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +namespace SLEExactGauge +namespace Parameter +theorem weighted_young_pair (P : Parameter) {C ε t X Y Z : ℝ} + (hC : 0 < C) (hε : 0 < ε) (ht : 0 < t) + (hX : 0 ≤ X) (hY : 0 ≤ Y) (hZ : 0 ≤ Z) : + C * t ^ (-1 - P.η) * X ^ P.η * Y ^ P.η * Z ^ (1 - 2 * P.η) ≤ + ε * (X + Y) + P.youngConstant C ε * t ^ (-P.M) * Z := by + let r := 1 - 2 * P.η + have hr : 0 < r := by dsimp [r]; linarith [P.η_lt_half] + have hη := P.η_pos + have hηε : 0 < P.η / ε := div_pos hη hε + have hεη : 0 < ε / P.η := div_pos hε hη + let B := C ^ (1 / r) * (P.η / ε) ^ (2 * P.η / r) * t ^ (-P.M) + have hB : 0 < B := by dsimp [B]; positivity + have heM : (-P.M) * r = -1 - P.η := by + have hM : P.M * r = 1 + P.η := by + dsimp [M, r] + exact div_mul_cancel₀ _ (by linarith [P.η_lt_half]) + nlinarith + have hBr : B ^ r = C * (P.η / ε) ^ (2 * P.η) * t ^ (-1 - P.η) := by + dsimp only [B] + rw [Real.mul_rpow (by positivity : 0 ≤ C ^ (1 / r) * + (P.η / ε) ^ (2 * P.η / r)) (by positivity), + Real.mul_rpow (by positivity : 0 ≤ C ^ (1 / r)) (by positivity), + ← Real.rpow_mul hC.le, ← Real.rpow_mul hηε.le, + ← Real.rpow_mul ht.le, heM] + rw [div_mul_cancel₀ _ hr.ne', div_mul_cancel₀ _ hr.ne', Real.rpow_one] + have hinv : (ε / P.η) ^ P.η * (ε / P.η) ^ P.η * + (P.η / ε) ^ (2 * P.η) = 1 := by + rw [← Real.rpow_add hεη, show P.η + P.η = 2 * P.η by ring, + ← Real.mul_rpow hεη.le hηε.le] + have hprod : ε / P.η * (P.η / ε) = 1 := by field_simp + rw [hprod, Real.one_rpow] + have hamgm := Real.geom_mean_le_arith_mean3_weighted hη.le hη.le hr.le + (mul_nonneg hεη.le hX) (mul_nonneg hεη.le hY) (mul_nonneg hB.le hZ) + (show P.η + P.η + r = 1 by dsimp [r]; ring) + have hleft : (ε / P.η * X) ^ P.η * (ε / P.η * Y) ^ P.η * (B * Z) ^ r = + C * t ^ (-1 - P.η) * X ^ P.η * Y ^ P.η * Z ^ r := by + rw [Real.mul_rpow hεη.le hX, Real.mul_rpow hεη.le hY, + Real.mul_rpow hB.le hZ, hBr] + calc + _ = ((ε / P.η) ^ P.η * (ε / P.η) ^ P.η * (P.η / ε) ^ (2 * P.η)) * + (C * t ^ (-1 - P.η) * X ^ P.η * Y ^ P.η * Z ^ r) := by ring + _ = _ := by rw [hinv, one_mul] + have hright : P.η * (ε / P.η * X) + P.η * (ε / P.η * Y) + r * (B * Z) = + ε * (X + Y) + P.youngConstant C ε * t ^ (-P.M) * Z := by + dsimp only [B, youngConstant] + change P.η * (ε / P.η * X) + P.η * (ε / P.η * Y) + + r * (C ^ (1 / r) * (P.η / ε) ^ (2 * P.η / r) * t ^ (-P.M) * Z) = + ε * (X + Y) + r * C ^ (1 / r) * (P.η / ε) ^ (2 * P.η / r) * t ^ (-P.M) * Z + field_simp + rw [hleft, hright] at hamgm + exact hamgm + +end Parameter +end SLEExactGauge + +open Filter Topology + +namespace SLEExactGauge.Parameter + +lemma hasDerivAt_factor_first (P : Parameter) {δ θ : ℝ} (hs : 0 < Real.sin θ) : + HasDerivAt (fun t : ℝ => P.angularDerivative δ (Real.sin t) (Real.cos t)) + (P.p*(P.p-1)*Real.cos θ^2*Real.sin θ^(P.p-2)-P.p*Real.sin θ^P.p+ + δ*(P.q*(P.q-1)*Real.cos θ^2*Real.sin θ^(P.q-2)-P.q*Real.sin θ^P.q)) θ := by + convert! (hasDerivAt_sinePower_first P.p θ hs).add + ((hasDerivAt_sinePower_first P.q θ hs).const_mul δ) using 1 + ext t + unfold angularDerivative + simp only [Pi.add_apply] + ring + +lemma deriv_factor (P : Parameter) {δ θ : ℝ} (hs : 0 < Real.sin θ) : + deriv (fun t : ℝ => P.f δ (Real.sin t)) θ = + P.angularDerivative δ (Real.sin θ) (Real.cos θ) := + (P.hasDerivAt_factor hs).deriv + +lemma factor_deriv_differentiable (P : Parameter) {δ θ : ℝ} (hs : 0 < Real.sin θ) : + HasDerivAt (deriv (fun t : ℝ => P.f δ (Real.sin t))) + (P.p*(P.p-1)*Real.cos θ^2*Real.sin θ^(P.p-2)-P.p*Real.sin θ^P.p+ + δ*(P.q*(P.q-1)*Real.cos θ^2*Real.sin θ^(P.q-2)-P.q*Real.sin θ^P.q)) θ := by + have he : deriv (fun t : ℝ => P.f δ (Real.sin t)) =ᶠ[nhds θ] + (fun t : ℝ => P.angularDerivative δ (Real.sin t) (Real.cos t)) := by + filter_upwards [Real.continuous_sin.continuousAt.eventually (Ioi_mem_nhds hs)] with t ht + exact P.deriv_factor ht + exact (P.hasDerivAt_factor_first hs).congr_of_eventuallyEq he + +lemma angleGenerator_factor (P : Parameter) {δ θ : ℝ} (hs : 0 < Real.sin θ) : + P.angleGenerator (fun t : ℝ => P.f δ (Real.sin t)) θ = + P.angleGenerator (fun t : ℝ => Real.sin t^P.p) θ+ + δ*P.angleGenerator (fun t : ℝ => Real.sin t^P.q) θ := by + unfold angleGenerator + rw [(P.factor_deriv_differentiable hs).deriv,P.deriv_factor hs, + secondDeriv_sinePower P.p θ hs,secondDeriv_sinePower P.q θ hs, + deriv_sinePower P.p θ hs,deriv_sinePower P.q θ hs] + unfold angularDerivative + ring + + + +lemma shifted_sine_generator (P : Parameter) (r θ : ℝ) (hs : 0 < Real.sin θ) : + P.angleGenerator (fun t : ℝ => Real.sin t^r) θ+P.p/2*Real.sin θ^r = + (P.p-r)*(r+1)/2*Real.sin θ^r-r*(P.p-r)/2*Real.sin θ^(r-2) := by + have hp1 : Real.sin θ^(r-1) = Real.sin θ^r/Real.sin θ := by + rw [Real.rpow_sub hs,Real.rpow_one] + have hp2 : Real.sin θ^(r-2) = Real.sin θ^r/Real.sin θ^2 := by + rw [Real.rpow_sub hs,Real.rpow_two] + have hcos : Real.cos θ^2 = 1-Real.sin θ^2 := by nlinarith [Real.sin_sq_add_cos_sq θ] + unfold angleGenerator + rw [secondDeriv_sinePower r θ hs,deriv_sinePower r θ hs,hp1,hp2] + unfold p + field_simp + rw [hcos] + ring + + + +theorem exact_factor_drift (P : Parameter) {δ θ : ℝ} (_hδ : 0 < δ) + (hs : 0 < Real.sin θ) (σ : ℝ) : + (P.angleGenerator (fun t : ℝ => P.f δ (Real.sin t)) θ+ + P.p/2*P.f δ (Real.sin θ)+σ*δ*(1+Real.sin θ^P.q))/P.f δ (Real.sin θ) = + P.drift δ (Real.sin θ) σ := by + rw [P.angleGenerator_factor hs] + have hp := P.shifted_sine_generator P.p θ hs + have hq := P.shifted_sine_generator P.q θ hs + simp only [sub_self,zero_mul,mul_zero,zero_div] at hp + unfold drift f k at * + linear_combination (norm := ring_nf) hp / (Real.sin θ ^ P.p+δ*(1+Real.sin θ^P.q)) + + δ / (Real.sin θ ^ P.p+δ*(1+Real.sin θ^P.q)) * hq + +end SLEExactGauge.Parameter + + + +noncomputable section +open Complex Real Set Filter +open scoped Topology +namespace SLEExactGauge.AngleCalculus + + +def angleD (z : ℂ) : ℂ →L[ℝ] ℝ := + Complex.imCLM.comp (z⁻¹ • (1 : ℂ →L[ℝ] ℂ)) + +lemma hasFDerivAt_arg {z : ℂ} (hz : z ∈ Complex.slitPlane) : + HasFDerivAt Complex.arg (angleD z) z := by + simpa only [angleD,Function.comp_def,Complex.imCLM_apply,Complex.log_im] using + Complex.imCLM.hasFDerivAt.comp z (Complex.hasStrictFDerivAt_log_real hz).hasFDerivAt + +lemma angleD_apply (z w : ℂ) : angleD z w = (w/z).im := by + simp [angleD,div_eq_mul_inv,mul_comm] + + +def V (z : ℂ) : ℝ := z.im / Complex.normSq z + +lemma driver_angle {z : ℂ} (hy : 0 < z.im) (b : ℝ) : + HasDerivAt (fun u : ℝ => Complex.arg (z-u)) (V (z-b)) b := by + have hz : z-(b:ℂ) ∈ Complex.slitPlane := Or.inr (by simpa using ne_of_gt hy) + have hd := (hasFDerivAt_arg hz).comp_hasDerivAt b + ((hasDerivAt_const b z).sub Complex.ofRealCLM.hasDerivAt) + convert! hd using 1 + rw [angleD_apply] + simp [V,Complex.div_im,Complex.normSq_apply] + ring + +lemma hasDerivAt_driver_V (z : ℂ) (b : ℝ) (hy : 0 < z.im) : + HasDerivAt (fun u : ℝ => V (z-u)) + (2*(z-b).re*(z-b).im/(Complex.normSq (z-b))^2) b := by + have hz : z-(b:ℂ) ≠ 0 := by + intro hh + have he := congrArg Complex.im hh + simp at he + linarith + have hn : Complex.normSq (z-(b:ℂ)) ≠ 0 := (Complex.normSq_pos.mpr hz).ne' + have hd : HasDerivAt (fun u : ℝ => (z.re-u)^2+z.im^2) (-2*(z.re-b)) b := by + convert! (((hasDerivAt_const b z.re).sub (hasDerivAt_id b)).pow 2).add_const (z.im^2) using 1 + simp only [Pi.sub_apply,id_eq] + ring + have he := (hasDerivAt_const b z.im).div hd (by simpa [Complex.normSq_apply,pow_two] using hn) + convert! he using 1 + · ext u + simp [V,Complex.normSq_apply,pow_two] + · simp [Complex.normSq_apply] + ring + +lemma deriv_driver_angle {z : ℂ} (hy : 0 < z.im) : + deriv (fun u : ℝ => Complex.arg (z-u)) = fun u : ℝ => V (z-u) := by + funext u + exact (driver_angle hy u).deriv + +lemma secondDeriv_driver_angle {z : ℂ} (hy : 0 < z.im) (b : ℝ) : + deriv (deriv (fun u : ℝ => Complex.arg (z-u))) b = + 2*(z-b).re*(z-b).im/(Complex.normSq (z-b))^2 := by + rw [deriv_driver_angle hy] + exact (hasDerivAt_driver_V z b hy).deriv + +lemma loewner_angle {g : ℝ → ℂ} {a b t : ℝ} + (hg : HasDerivAt g ((a:ℂ)/(g t-b)) t) (hy : 0 < (g t).im) : + HasDerivAt (fun u => Complex.arg (g u-b)) + (-2*a*(g t-b).re*(g t-b).im/(Complex.normSq (g t-b))^2) t := by + have hz : g t-(b:ℂ) ∈ Complex.slitPlane := Or.inr (by simpa using ne_of_gt hy) + convert! (hasFDerivAt_arg hz).comp_hasDerivAt t (hg.sub_const (b:ℂ)) using 1 + rw [angleD_apply] + simp [Complex.div_im,Complex.div_re] + ring + + + +lemma angle_generator_coefficients (a : ℝ) {z : ℂ} (hy : 0 < z.im) : + (-2*a*z.re*z.im/(Complex.normSq z)^2)+ + (2*z.re*z.im/(Complex.normSq z)^2)/2 = + (1-2*a)*(Real.cos z.arg/Real.sin z.arg)*(V z)^2 := by + have hz : z ≠ 0 := by intro h; simp [h] at hy + have hn : ‖z‖ ≠ 0 := norm_ne_zero_iff.mpr hz + have hN : Complex.normSq z ≠ 0 := (Complex.normSq_pos.mpr hz).ne' + rw [Complex.sin_arg,Complex.cos_arg hz,V] + field_simp + ring + +end SLEExactGauge.AngleCalculus + +namespace SLEExactGauge.AngleCalculus + +lemma sin_angle_pos {z : ℂ} (hy : 0 < z.im) : 0 < Real.sin z.arg := by + rw [Complex.sin_arg] + apply div_pos hy + apply norm_pos_iff.mpr + intro h + simp [h] at hy + + + +def physicalGenerator (a : ℝ) (φ : ℝ → ℝ) (z : ℂ) (b : ℝ) : ℝ := + fderiv ℝ (fun w : ℂ => φ (Complex.arg (w-b))) z ((a:ℂ)/(z-b))+ + deriv (deriv (fun c : ℝ => φ (Complex.arg (z-c)))) b/2 + +lemma driver_comp_first (φ : ℝ → ℝ) + (hφ : ∀ θ, 0 < Real.sin θ → HasDerivAt φ (deriv φ θ) θ) + {z : ℂ} (hy : 0 < z.im) (b : ℝ) : + HasDerivAt (fun c : ℝ => φ (Complex.arg (z-c))) + (deriv φ (Complex.arg (z-b))*V (z-b)) b := + (hφ _ (sin_angle_pos (by simpa using hy))).comp b (driver_angle hy b) + +lemma driver_comp_second (φ : ℝ → ℝ) + (hφ : ∀ θ, 0 < Real.sin θ → HasDerivAt φ (deriv φ θ) θ) + (hφ' : ∀ θ, 0 < Real.sin θ → HasDerivAt (deriv φ) (deriv (deriv φ) θ) θ) + {z : ℂ} (hy : 0 < z.im) (b : ℝ) : + deriv (deriv (fun c : ℝ => φ (Complex.arg (z-c)))) b = + deriv (deriv φ) (Complex.arg (z-b))*(V (z-b))^2+ + deriv φ (Complex.arg (z-b))*(2*(z-b).re*(z-b).im/(Complex.normSq (z-b))^2) := by + have he : deriv (fun c : ℝ => φ (Complex.arg (z-c))) = + fun c : ℝ => deriv φ (Complex.arg (z-c))*V (z-c) := by + funext c + exact (driver_comp_first φ hφ hy c).deriv + rw [he] + have hd := ((hφ' _ (sin_angle_pos (by simpa using hy))).comp b + (driver_angle hy b)).mul (hasDerivAt_driver_V z b hy) + convert! hd.deriv using 1 + simp only [Function.comp_def] + ring + +lemma physical_generator_angle (a : ℝ) (φ : ℝ → ℝ) + (hφ : ∀ θ, 0 < Real.sin θ → HasDerivAt φ (deriv φ θ) θ) + (hφ' : ∀ θ, 0 < Real.sin θ → HasDerivAt (deriv φ) (deriv (deriv φ) θ) θ) + {z : ℂ} (hy : 0 < z.im) (b : ℝ) : + physicalGenerator a φ z b = (V (z-b))^2 * + (deriv (deriv φ) (z-b).arg/2+(1-2*a)* + (Real.cos (z-b).arg/Real.sin (z-b).arg)*deriv φ (z-b).arg) := by + have hy' : 0 < (z-(b:ℂ)).im := by simpa using hy + have hz : z-(b:ℂ) ∈ Complex.slitPlane := Or.inr hy'.ne' + have hd := (hφ _ (sin_angle_pos hy')).hasFDerivAt.comp z + ((hasFDerivAt_arg hz).comp z ((hasFDerivAt_id z).sub_const (b:ℂ))) + have hv : angleD (z-b) ((a:ℂ)/(z-b)) = + -2*a*(z-b).re*(z-b).im/(Complex.normSq (z-b))^2 := by + rw [angleD_apply] + simp [Complex.div_im,Complex.div_re] + ring + simp only [Function.comp_def,id_eq] at hd + unfold physicalGenerator + rw [hd.fderiv,driver_comp_second φ hφ hφ' hy b] + simp only [ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,ContinuousLinearMap.toSpanSingleton_apply,smul_eq_mul] + rw [hv] + have hc := angle_generator_coefficients a hy' + linear_combination deriv φ (z-b).arg * hc + +end SLEExactGauge.AngleCalculus + +noncomputable section +open scoped Topology +namespace SLEExactGauge.Calculus + +lemma fderiv_separable (e δ : ℝ → ℝ) (φ ψ : ℂ → ℝ) (u : ℝ) (z : ℂ) + (e' δ' : ℝ) (Dφ Dψ : ℂ →L[ℝ] ℝ) + (he : HasDerivAt e e' u) (hδ : HasDerivAt δ δ' u) + (hφ : HasFDerivAt φ Dφ z) (hψ : HasFDerivAt ψ Dψ z) (v : ℝ) (w : ℂ) : + fderiv ℝ (fun x : ℝ × ℂ => e x.1*(φ x.2+δ x.1*ψ x.2)) (u,z) (v,w) = + e'*v*(φ z+δ u*ψ z)+e u*(Dφ w+δ'*v*ψ z+δ u*Dψ w) := by + have hfst : HasFDerivAt (fun x : ℝ × ℂ => x.1) (ContinuousLinearMap.fst ℝ ℝ ℂ) (u,z) := hasFDerivAt_fst + have hsnd : HasFDerivAt (fun x : ℝ × ℂ => x.2) (ContinuousLinearMap.snd ℝ ℝ ℂ) (u,z) := hasFDerivAt_snd + have heF := he.hasFDerivAt.comp (u,z) hfst + have hδF := hδ.hasFDerivAt.comp (u,z) hfst + have hφF := hφ.comp (u,z) hsnd + have hψF := hψ.comp (u,z) hsnd + have hd := heF.mul (hφF.add (hδF.mul hψF)) + simp only [Function.comp_def,Pi.mul_apply,Pi.add_apply] at hd + change HasFDerivAt (fun x : ℝ × ℂ => e x.1*(φ x.2+δ x.1*ψ x.2)) _ (u,z) at hd + rw [hd.fderiv] + simp only [add_apply,ContinuousLinearMap.comp_apply, + smul_apply, + ContinuousLinearMap.toSpanSingleton_apply,smul_eq_mul] + change e u * (Dφ w + (δ u * Dψ w + ψ z * (v * δ'))) + (φ z + δ u * ψ z) * (v * e') = _ + ring + +lemma secondDeriv_linear (C δ : ℝ) (φ ψ : ℝ → ℝ) + (hφ : ∀ x, DifferentiableAt ℝ φ x) (hψ : ∀ x, DifferentiableAt ℝ ψ x) + (hφ' : ∀ x, DifferentiableAt ℝ (deriv φ) x) + (hψ' : ∀ x, DifferentiableAt ℝ (deriv ψ) x) (b : ℝ) : + deriv (deriv (fun x => C*(φ x+δ*(1+ψ x)))) b = + C*(deriv (deriv φ) b+δ*deriv (deriv ψ) b) := by + have he : deriv (fun x => C*(φ x+δ*(1+ψ x))) = + fun x => C*(deriv φ x+δ*deriv ψ x) := by + funext x + simpa using ((hφ x).hasDerivAt.add (((hψ x).hasDerivAt.const_add 1).const_mul δ)).const_mul C |>.deriv + rw [he] + simpa using (((hφ' b).hasDerivAt.add ((hψ' b).hasDerivAt.const_mul δ)).const_mul C).deriv + +end SLEExactGauge.Calculus + +namespace SLEExactGauge.Parameter +open AngleCalculus Calculus + + + +def physicalFactor (P : Parameter) (δ : ℝ → ℝ) (x : ℝ × ℂ) (b : ℝ) : ℝ := + Real.exp (P.p*x.1/2)/3 * P.f (δ x.1) (Real.sin (x.2-b).arg) + +lemma physical_factor_state_derivative (P : Parameter) (δ : ℝ → ℝ) + (u σ b v : ℝ) (z w : ℂ) (hy : 0 < z.im) + (hδ : HasDerivAt δ (σ*δ u) u) : + fderiv ℝ (fun x : ℝ × ℂ => P.physicalFactor δ x b) (u,z) (v,w) = + Real.exp (P.p*u/2)/3 * + (fderiv ℝ (fun z : ℂ => P.f (δ u) (Real.sin (z-b).arg)) z w+ + (P.p/2*P.f (δ u) (Real.sin (z-b).arg)+σ*δ u*(1+Real.sin (z-b).arg^P.q))*v) := by + let e : ℝ → ℝ := fun r => Real.exp (P.p*r/2)/3 + let φ : ℂ → ℝ := fun w => Real.sin (w-b).arg^P.p + let ψ : ℂ → ℝ := fun w => 1+Real.sin (w-b).arg^P.q + have hs : 0 < Real.sin (z-(b:ℂ)).arg := sin_angle_pos (by simpa using hy) + have ha : HasFDerivAt (fun w : ℂ => (w-b).arg) (angleD (z-b)) z := by + convert! (hasFDerivAt_arg (show z-(b:ℂ) ∈ Complex.slitPlane from Or.inr (by simpa using hy.ne'))).comp z + ((hasFDerivAt_id z).sub_const (b:ℂ)) using 1 + have hφ := (hasDerivAt_sinePower P.p (z-b).arg hs).hasFDerivAt.comp z ha + have hψ := ((hasDerivAt_sinePower P.q (z-b).arg hs).const_add 1).hasFDerivAt.comp z ha + change HasFDerivAt φ _ z at hφ + change HasFDerivAt ψ _ z at hψ + have he : HasDerivAt e (P.p/2*e u) u := by + convert! (((hasDerivAt_id u).const_mul P.p).div_const 2).exp.div_const 3 using 1 + dsimp [e] + ring + have hd := fderiv_separable e δ φ ψ u z (P.p/2*e u) (σ*δ u) _ _ he hδ hφ hψ v w + have hc := hφ.add (hψ.const_mul (δ u)) + change HasFDerivAt (fun z : ℂ => P.f (δ u) (Real.sin (z-b).arg)) _ z at hc + change fderiv ℝ (fun x : ℝ × ℂ => e x.1*(φ x.2+δ x.1*ψ x.2)) (u,z) (v,w) = _ + rw [hd,hc.fderiv] + simp only [add_apply,smul_apply] + change (P.p/2*e u)*v*(φ z+δ u*ψ z)+e u*(_+σ*δ u*v*ψ z+δ u*_) = + e u*(_+δ u*_+(P.p/2*(φ z+δ u*ψ z)+σ*δ u*ψ z)*v) + ring + + + +theorem physical_factor_generator (P : Parameter) (δ : ℝ → ℝ) (u σ b : ℝ) + (z : ℂ) (hy : 0 < z.im) (hδ0 : 0 < δ u) + (hδ : HasDerivAt δ (σ*δ u) u) : + fderiv ℝ (fun x : ℝ × ℂ => P.physicalFactor δ x b) (u,z) + ((V (z-b))^2,(P.a:ℂ)/(z-b))+ + deriv (deriv (P.physicalFactor δ (u,z))) b/2 = + P.physicalFactor δ (u,z) b*(V (z-b))^2* + P.drift (δ u) (Real.sin (z-b).arg) σ := by + have hs : 0 < Real.sin (z-(b:ℂ)).arg := sin_angle_pos (by simpa using hy) + have hphy := physical_generator_angle P.a (fun θ => P.f (δ u) (Real.sin θ)) + (fun θ hθ => (P.hasDerivAt_factor hθ).differentiableAt.hasDerivAt) + (fun θ hθ => (P.factor_deriv_differentiable hθ).differentiableAt.hasDerivAt) hy b + change physicalGenerator P.a (fun θ => P.f (δ u) (Real.sin θ)) z b = + (V (z-b))^2*P.angleGenerator (fun θ => P.f (δ u) (Real.sin θ)) (z-b).arg at hphy + have hsecond : deriv (deriv (P.physicalFactor δ (u,z))) b = + Real.exp (P.p*u/2)/3*deriv (deriv (fun c : ℝ => P.f (δ u) (Real.sin (z-c).arg))) b := by + change deriv (deriv (fun c : ℝ => Real.exp (P.p*u/2)/3*P.f (δ u) (Real.sin (z-c).arg))) b = _ + rw [deriv_const_mul_field',deriv_const_mul_field] + rw [P.physical_factor_state_derivative δ u σ b _ z _ hy hδ,hsecond] + have heq := (div_eq_iff (P.f_pos hδ0 hs).ne').mp (P.exact_factor_drift hδ0 hs σ) + unfold physicalGenerator at hphy + unfold physicalFactor + linear_combination (Real.exp (P.p*u/2)/3)*hphy + + (Real.exp (P.p*u/2)/3*(V (z-b))^2)*heq + +end SLEExactGauge.Parameter + +namespace SLEExactGauge.Parameter +open AngleCalculus Calculus + +open scoped ContDiff +lemma contDiffAt_arg_real {z : ℂ} (hz : z ∈ Complex.slitPlane) (n : ℕ∞ω) : + ContDiffAt ℝ n Complex.arg z := by + have h := Complex.imCLM.contDiff.contDiffAt.comp z + ((Complex.contDiffAt_log (n := n) hz).restrict_scalars ℝ) + change ContDiffAt ℝ n (fun x => (Complex.log x).im) z at h + simpa only [Complex.log_im] using h + +lemma contDiffAt_physical_factor (P : Parameter) (δ : ℝ → ℝ) + (u b : ℝ) (z : ℂ) (hy : 0 < z.im) (n : ℕ∞ω) + (hδ : ContDiffAt ℝ n δ u) : + ContDiffAt ℝ n (fun x : ℝ × ℂ => P.physicalFactor δ x b) (u,z) := by + have hs : 0 < Real.sin (z-(b:ℂ)).arg := sin_angle_pos (by simpa using hy) + have ha := (contDiffAt_arg_real (show z-(b:ℂ) ∈ Complex.slitPlane + from Or.inr (by simpa using hy.ne')) n).comp (u,z) + (contDiffAt_snd.sub contDiffAt_const) + have hsin := ha.sin + have hp := hsin.rpow_const_of_ne (p := P.p) hs.ne' + have hq := hsin.rpow_const_of_ne (p := P.q) hs.ne' + have he : ContDiffAt ℝ n (fun x : ℝ × ℂ => Real.exp (P.p*x.1/2)/3) (u,z) := by fun_prop + exact he.mul (hp.add ((hδ.comp (u,z) contDiffAt_fst).mul (contDiffAt_const.add hq))) + +end SLEExactGauge.Parameter + +namespace SLEExactGauge.BrownianCalculus +open Classical +end SLEExactGauge.BrownianCalculus +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/EulerFlow.lean b/lean/OAI/Probability/SLEGauge/EulerFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..48b2faa7c04ee546e694744701cbb14be56c12ea --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/EulerFlow.lean @@ -0,0 +1,451 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.CutoffFlow + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.Euler +def interpolate (f : ℝ → ℂ → ℂ) (h : ℝ) (z : ℂ) (t : ℝ) : ℂ := + let k := ⌊t/h⌋₊ + let w := t/h-(k:ℝ) + (1-w) • nodes f h z k + w • nodes f h z (k+1) + +lemma finite_gronwall {e : ℕ → ℝ} {L h ε : ℝ} (hL : 0 ≤ L) (hh : 0 ≤ h) + (hε : 0 ≤ ε) (he0 : e 0 ≤ 0) {N : ℕ} + (hrec : ∀ k < N, e (k+1) ≤ (1+L*h)*e k + ε*h) : + e N ≤ ε*((N:ℝ)*h)*Real.exp (L*((N:ℝ)*h)) := by + have hstep : ∀ k ≤ N, e k ≤ ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h)) := by + intro k hk + induction k with + | zero => simpa using he0 + | succ k ih => + have hi := ih (by omega) + have hk' : k < N := by omega + have he : 1+L*h ≤ Real.exp (L*h) := by + simpa only [add_comm] using Real.add_one_le_exp (L*h) + have he1 : 1 ≤ Real.exp (L*(((k+1:ℕ):ℝ)*h)) := + Real.one_le_exp (by positivity) + calc e (k+1) + ≤ (1+L*h)*(ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h))) + ε*h := + (hrec k hk').trans (add_le_add (mul_le_mul_of_nonneg_left hi + (show 0 ≤ 1+L*h from by positivity)) le_rfl) + _ ≤ Real.exp (L*h)*(ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h))) + + (ε*h)*Real.exp (L*(((k+1:ℕ):ℝ)*h)) := by + exact add_le_add (mul_le_mul_of_nonneg_right he (by positivity)) + (le_mul_of_one_le_right (mul_nonneg hε hh) he1) + _ = ε*(((k+1:ℕ):ℝ)*h)*Real.exp (L*(((k+1:ℕ):ℝ)*h)) := by + have hex : Real.exp (L*(((k+1:ℕ):ℝ)*h)) = + Real.exp (L*h)*Real.exp (L*((k:ℝ)*h)) := by + rw [← Real.exp_add] + congr 1 + push_cast + ring + rw [hex] + push_cast + ring + exact hstep N le_rfl + +lemma nodes_error {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {z : ℂ} {L h ε T : ℝ} + (hL : 0 ≤ L) (hh : 0 ≤ h) (hε : 0 ≤ ε) (hg0 : g 0 = z) + (hlip : ∀ t ∈ Icc 0 T, ∀ x y, ‖f t x-f t y‖ ≤ L*‖x-y‖) + (hres : ∀ k : ℕ, ((k+1:ℕ):ℝ)*h ≤ T → + ‖g (((k+1:ℕ):ℝ)*h) - g ((k:ℝ)*h) - h • f ((k:ℝ)*h) (g ((k:ℝ)*h))‖ ≤ ε*h) + (N : ℕ) (hN : (N:ℝ)*h ≤ T) : + ‖nodes f h z N - g ((N:ℝ)*h)‖ ≤ ε*T*Real.exp (L*T) := by + have hrec (k : ℕ) (hk : k < N) : + ‖nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h)‖ ≤ + (1+L*h)*‖nodes f h z k-g ((k:ℝ)*h)‖ + ε*h := by + have hkT : ((k+1:ℕ):ℝ)*h ≤ T := + (mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.succ_le_of_lt hk) hh).trans hN + have hk0 : 0 ≤ (k:ℝ)*h := by positivity + have hkT' : (k:ℝ)*h ≤ T := (by push_cast; nlinarith : (k:ℝ)*h ≤ ((k+1:ℕ):ℝ)*h).trans hkT + let r := g (((k+1:ℕ):ℝ)*h)-g ((k:ℝ)*h)-h • f ((k:ℝ)*h) (g ((k:ℝ)*h)) + have he : nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h) = + (nodes f h z k-g ((k:ℝ)*h)) + + h • (f ((k:ℝ)*h) (nodes f h z k)-f ((k:ℝ)*h) (g ((k:ℝ)*h))) - r := by + simp only [nodes, r, smul_sub] + abel + rw [he] + calc _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖ + + ‖h • (f ((k:ℝ)*h) (nodes f h z k)-f ((k:ℝ)*h) (g ((k:ℝ)*h)))‖ + ‖r‖ := + (norm_sub_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) + _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖ + + h*(L*‖nodes f h z k-g ((k:ℝ)*h)‖) + ε*h := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg hh] + exact add_le_add (add_le_add le_rfl (mul_le_mul_of_nonneg_left + (hlip _ ⟨hk0,hkT'⟩ _ _) hh)) (hres k hkT) + _ = _ := by ring + have hb := finite_gronwall (e := fun k => ‖nodes f h z k-g ((k:ℝ)*h)‖) + hL hh hε (by simp [nodes, hg0]) hrec + have hT : 0 ≤ T := (mul_nonneg (Nat.cast_nonneg _) hh).trans hN + exact hb.trans (by gcongr) + +lemma residual_bound {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {T s h ε : ℝ} + (hder : ∀ t ∈ Icc 0 T, HasDerivWithinAt g (f t (g t)) (Icc 0 T) t) + (hs : 0 ≤ s) (hh : 0 ≤ h) (hsh : s+h ≤ T) + (hosc : ∀ t ∈ Icc s (s+h), ‖f t (g t)-f s (g s)‖ ≤ ε) : + ‖g (s+h)-g s-h • f s (g s)‖ ≤ ε*h := by + have hsub : Icc s (s+h) ⊆ Icc 0 T := fun t ht => ⟨hs.trans ht.1, ht.2.trans hsh⟩ + have hd (t : ℝ) (ht : t ∈ Icc s (s+h)) : + HasDerivWithinAt (fun u => g u-u • f s (g s)) + (f t (g t)-f s (g s)) (Icc s (s+h)) t := by + convert! ((hder t (hsub ht)).mono hsub).sub + (((hasDerivAt_id t).smul_const (f s (g s))).hasDerivWithinAt) using 1 + simp only [one_smul] + have hb := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hd hosc + (convex_Icc s (s+h)) (left_mem_Icc.mpr (by linarith)) + (right_mem_Icc.mpr (by linarith)) + have he : (g (s+h)-(s+h) • f s (g s))-(g s-s • f s (g s)) = + g (s+h)-g s-h • f s (g s) := by rw [add_smul]; abel + simpa only [he, add_sub_cancel_left, Real.norm_eq_abs, abs_of_nonneg hh] using hb + +lemma exists_residual_bound {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {T : ℝ} + (hder : ∀ t ∈ Icc 0 T, HasDerivWithinAt g (f t (g t)) (Icc 0 T) t) + (hcf : ContinuousOn (fun t => f t (g t)) (Icc 0 T)) {ε : ℝ} (hε : 0 < ε) : + ∃ δ > 0, ∀ h : ℝ, 0 ≤ h → h < δ → ∀ s : ℝ, 0 ≤ s → s+h ≤ T → + ‖g (s+h)-g s-h • f s (g s)‖ ≤ ε*h := by + have hu := isCompact_Icc.uniformContinuousOn_of_continuous hcf + obtain ⟨δ,hδ,hb⟩ := Metric.uniformContinuousOn_iff.mp hu ε hε + refine ⟨δ,hδ, fun h hh hhδ s hs hsT => residual_bound hder hs hh hsT ?_⟩ + intro u hu + apply le_of_lt + have huT : u ∈ Icc 0 T := ⟨hs.trans hu.1, hu.2.trans hsT⟩ + have hsT' : s ∈ Icc 0 T := ⟨hs, by linarith⟩ + have hd : dist u s < δ := by + rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hu.1)] + linarith [hu.2] + simpa only [dist_eq_norm] using hb u huT s hsT' hd + +lemma norm_interpolate_sub_le {x y z : ℂ} {w E : ℝ} + (hw : 0 ≤ w) (hw1 : w ≤ 1) (hx : ‖x-z‖ ≤ E) (hy : ‖y-z‖ ≤ E) : + ‖(1-w) • x+w • y-z‖ ≤ E := by + have he : (1-w) • x+w • y-z = (1-w) • (x-z)+w • (y-z) := by + simp only [sub_smul, one_smul, smul_sub] + abel + rw [he] + calc _ ≤ ‖(1-w) • (x-z)‖+‖w • (y-z)‖ := norm_add_le _ _ + _ = (1-w)*‖x-z‖+w*‖y-z‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hw1), abs_of_nonneg hw] + _ ≤ (1-w)*E+w*E := add_le_add (mul_le_mul_of_nonneg_left hx (sub_nonneg.mpr hw1)) + (mul_le_mul_of_nonneg_left hy hw) + _ = E := by ring + +lemma interpolate_error {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {z : ℂ} {L M h ε T t : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hh : 0 < h) (hε : 0 ≤ ε) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hres : ∀ k : ℕ, ((k+1:ℕ):ℝ)*h ≤ T → + ‖g (((k+1:ℕ):ℝ)*h) - g ((k:ℝ)*h) - h • f ((k:ℝ)*h) (g ((k:ℝ)*h))‖ ≤ ε*h) + (hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v|) + (ht : 0 ≤ t) (htT : t+h ≤ T) : + ‖interpolate f h z t-g t‖ ≤ ε*T*Real.exp (L*T)+M*h := by + let k := ⌊t/h⌋₊ + have hf0 : (k:ℝ) ≤ t/h := Nat.floor_le (div_nonneg ht hh.le) + have hf1 : t/h < (k:ℝ)+1 := Nat.lt_floor_add_one _ + have hk0 : 0 ≤ (k:ℝ)*h := by positivity + have hkt : (k:ℝ)*h ≤ t := (le_div_iff₀ hh).mp hf0 + have htks : t < ((k+1:ℕ):ℝ)*h := by + push_cast + exact (div_lt_iff₀ hh).mp hf1 + have hksT : ((k+1:ℕ):ℝ)*h ≤ T := by push_cast; nlinarith + have hkT : (k:ℝ)*h ≤ T := hkt.trans (by linarith) + have hw : 0 ≤ t/h-(k:ℝ) := by linarith + have hw1 : t/h-(k:ℝ) ≤ 1 := by linarith + apply norm_interpolate_sub_le hw hw1 + · calc _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖+‖g ((k:ℝ)*h)-g t‖ := + norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ ε*T*Real.exp (L*T)+M*h := add_le_add + (nodes_error hL hh.le hε hg0 hlip hres k hkT) + ((hpath _ ⟨hk0,hkT⟩ _ ⟨ht,by linarith⟩).trans (by + rw [abs_of_nonpos (sub_nonpos.mpr hkt)] + apply mul_le_mul_of_nonneg_left _ hM + push_cast at htks + linarith)) + · calc _ ≤ ‖nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h)‖+ + ‖g (((k+1:ℕ):ℝ)*h)-g t‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ ε*T*Real.exp (L*T)+M*h := add_le_add + (nodes_error hL hh.le hε hg0 hlip hres (k+1) hksT) + ((hpath _ ⟨by positivity,hksT⟩ _ ⟨ht,by linarith⟩).trans (by + rw [abs_of_nonneg (by linarith : 0 ≤ ((k+1:ℕ):ℝ)*h-t)] + apply mul_le_mul_of_nonneg_left _ hM + push_cast + linarith)) + +lemma converge {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {z : ℂ} {L M T t : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (ht : 0 ≤ t) (htT : t < T) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) : + Tendsto (fun n => interpolate f (h n) z t) atTop (𝓝 (g t)) := by + have hT : 0 < T := lt_of_le_of_lt ht htT + have hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v| := by + intro u hu v hv + simpa only [Real.norm_eq_abs] using + Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hder hbound (convex_Icc 0 T) hv hu + rw [Metric.tendsto_nhds] + intro ε hε + let E := T*Real.exp (L*T) + have hE : 0 < E := mul_pos hT (Real.exp_pos _) + let η := ε/(2*E) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨δ,hδ,hres⟩ := exists_residual_bound hder hcf hη + have hev1 : ∀ᶠ n in atTop, h n < δ := (tendsto_order.1 hh0).2 δ hδ + have hev2 : ∀ᶠ n in atTop, h n < T-t := + (tendsto_order.1 hh0).2 (T-t) (sub_pos.mpr htT) + have hev3 : ∀ᶠ n in atTop, h n < ε/(2*(M+1)) := + (tendsto_order.1 hh0).2 _ (div_pos hε (by positivity)) + filter_upwards [hev1,hev2,hev3] with n hnδ hnT hnε + rw [dist_eq_norm] + have hb := interpolate_error hL hM (hh n) hη.le hg0 hlip + (fun k hk => by + have hc : ((k+1:ℕ):ℝ)*h n = (k:ℝ)*h n+h n := by push_cast; ring + rw [hc] at hk ⊢ + exact hres (h n) (hh n).le hnδ ((k:ℝ)*h n) (mul_nonneg (Nat.cast_nonneg _) (hh n).le) hk) + hpath ht (by linarith : t+h n ≤ T) + apply lt_of_le_of_lt hb + have hηE : η*T*Real.exp (L*T) = ε/2 := by + dsimp [η, E] + field_simp + have hsmall : M*h n < ε/2 := by + have hhε := (lt_div_iff₀ (by positivity : 0 < 2*(M+1))).mp hnε + nlinarith [hh n] + rw [hηE] + linarith + +lemma converge_uniformOn {f : ℝ → ℂ → ℂ} {g : ℝ → ℂ} {z : ℂ} {L M T U : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (hU : 0 ≤ U) (hUT : U < T) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) : + TendstoUniformlyOn (fun n => interpolate f (h n) z) g atTop (Icc 0 U) := by + have hT : 0 < T := lt_of_le_of_lt hU hUT + have hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v| := by + intro u hu v hv + simpa only [Real.norm_eq_abs] using + Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hder hbound (convex_Icc 0 T) hv hu + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + let E := T*Real.exp (L*T) + have hE : 0 < E := mul_pos hT (Real.exp_pos _) + let η := ε/(2*E) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨δ,hδ,hres⟩ := exists_residual_bound hder hcf hη + have hev1 : ∀ᶠ n in atTop, h n < δ := (tendsto_order.1 hh0).2 δ hδ + have hev2 : ∀ᶠ n in atTop, h n < T-U := + (tendsto_order.1 hh0).2 (T-U) (sub_pos.mpr hUT) + have hev3 : ∀ᶠ n in atTop, h n < ε/(2*(M+1)) := + (tendsto_order.1 hh0).2 _ (div_pos hε (by positivity)) + filter_upwards [hev1,hev2,hev3] with n hnδ hnT hnε + intro t ht + rw [dist_comm, dist_eq_norm] + have hb := interpolate_error hL hM (hh n) hη.le hg0 hlip + (fun k hk => by + have hc : ((k+1:ℕ):ℝ)*h n = (k:ℝ)*h n+h n := by push_cast; ring + rw [hc] at hk ⊢ + exact hres (h n) (hh n).le hnδ ((k:ℝ)*h n) + (mul_nonneg (Nat.cast_nonneg _) (hh n).le) hk) + hpath ht.1 (by linarith [ht.2] : t+h n ≤ T) + apply lt_of_le_of_lt hb + have hηE : η*T*Real.exp (L*T) = ε/2 := by + dsimp [η, E] + field_simp + have hsmall : M*h n < ε/2 := by + have hhε := (lt_div_iff₀ (by positivity : 0 < 2*(M+1))).mp hnε + nlinarith [hh n] + rw [hηE] + linarith + +end SLEExactGauge.Euler + +namespace SLEExactGauge.LiteralTrace + +lemma continuous_driverValue (b : Driver) : Continuous (driverValue b) := + (map_continuous b).comp continuous_real_toNNReal + +lemma mesh_pos (n : ℕ) : 0 < mesh n := zpow_pos (by norm_num) _ + +lemma mesh_tendsto_zero : Tendsto mesh atTop (𝓝 0) := by + have he : mesh = fun n : ℕ => ((2:ℝ)⁻¹)^n := by + funext n + simp only [mesh, zpow_neg, zpow_natCast, inv_pow] + rw [he] + exact tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + +lemma cutoffField_eq (κ : ℝ) (b : Driver) (j : ℕ) : + cutoffField κ b j = Cutoff.field (a κ) ((j:ℝ)^(-(2:ℤ))) (driverValue b) := by + funext t z + have hp : ((j:ℝ)^(-(2:ℤ)))^2 = (j:ℝ)^(-(4:ℤ)) := by + rw [← zpow_natCast, ← zpow_mul] + norm_num + simp only [cutoffField, Cutoff.field, Cutoff.inverse, Cutoff.denominator, hp, mul_div_assoc] + +lemma eulerSteps_eq_nodes (κ : ℝ) (b : Driver) (j N : ℕ) (z : ℂ) : + eulerSteps κ b j N z = Euler.nodes (cutoffField κ b j) (mesh N) z := by + funext k + induction k with + | zero => rfl + | succ k ih => simp only [eulerSteps, Euler.nodes, ih, Complex.real_smul] + +lemma eulerFlow_eq_interpolate (κ : ℝ) (b : Driver) (j N : ℕ) (z : ℂ) : + eulerFlow κ b j N z = Euler.interpolate (cutoffField κ b j) (mesh N) z := by + funext t + simp only [eulerFlow, Euler.interpolate, eulerSteps_eq_nodes, Complex.real_smul] + + + +theorem cutoffFlow_solution (κ : ℝ) (b : Driver) (j : ℕ) (hj : 1 ≤ j) (z : ℂ) + {T : ℝ} (hT : 0 ≤ T) : + TendstoUniformlyOn (fun N => eulerFlow κ b j N z) (cutoffFlow κ b j z) atTop (Icc 0 T) ∧ + cutoffFlow κ b j z 0 = z ∧ + ∀ t ∈ Icc 0 T, HasDerivWithinAt (cutoffFlow κ b j z) + (cutoffField κ b j t (cutoffFlow κ b j z t)) (Icc 0 T) t := by + let q : ℝ := (j:ℝ)^(-(2:ℤ)) + have hq : 0 < q := zpow_pos (by exact_mod_cast hj) _ + obtain ⟨g,hg0,hg⟩ := Cutoff.exists_solution_on_compact hq (a κ) (continuous_driverValue b) z + (show 0 ≤ T+1 by linarith) + have hg' : ∀ t ∈ Icc 0 (T+1), + HasDerivWithinAt g (cutoffField κ b j t (g t)) (Icc 0 (T+1)) t := by + simpa only [cutoffField_eq] using hg + have hgc : ContinuousOn g (Icc 0 (T+1)) := fun t ht => (hg' t ht).continuousWithinAt + have hfc : ContinuousOn (fun t => cutoffField κ b j t (g t)) (Icc 0 (T+1)) := by + simp only [cutoffField_eq, Cutoff.field] + exact continuousOn_const.mul ((Cutoff.lipschitz_inverse hq).continuous.comp_continuousOn + (hgc.sub ((Complex.continuous_ofReal.comp (continuous_driverValue b)).continuousOn))) + have hconv : TendstoUniformlyOn (fun N => eulerFlow κ b j N z) g atTop (Icc 0 T) := by + simp only [eulerFlow_eq_interpolate] + apply Euler.converge_uniformOn (L := |a κ| * 3/q^2) (M := |a κ|/q) + (by positivity) (by positivity) hg0 _ hg' hfc _ hT (by linarith) + mesh_pos mesh_tendsto_zero + · intro t ht x y + rw [cutoffField_eq] + exact Cutoff.field_sub_le hq _ _ _ _ _ + · intro t ht + rw [cutoffField_eq] + exact Cutoff.norm_field_le hq _ _ _ _ + have heq : ∀ t ∈ Icc 0 T, cutoffFlow κ b j z t = g t := by + intro t ht + exact (hconv.tendsto_at ht).limUnder_eq + refine ⟨?_, (heq 0 ⟨le_rfl,hT⟩).trans hg0, ?_⟩ + · exact hconv.congr_right (fun t ht => (heq t ht).symm) + · intro t ht + rw [heq t ht] + exact ((hg' t ⟨ht.1,by linarith [ht.2]⟩).mono + (show Icc 0 T ⊆ Icc 0 (T+1) from fun u hu => ⟨hu.1,by linarith [hu.2]⟩)).congr heq (heq t ht) + +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace + + +def PositiveSolution (κ : ℝ) (b : Driver) (z : ℂ) (T : ℝ) (f : ℝ → ℂ) : Prop := + 0 ≤ T ∧ ContinuousOn f (Icc 0 T) ∧ f 0 = z ∧ + (∀ t ∈ Icc 0 T, 0 < (f t).im) ∧ + ∀ t ∈ Icc 0 T, HasDerivWithinAt f ((a κ : ℂ)/(f t-driverValue b t)) (Icc 0 T) t + +lemma cutoffField_of_height (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) + {t : ℝ} {z : ℂ} (hz : (j:ℝ)⁻¹ ≤ z.im) : + cutoffField κ b j t z = (a κ : ℂ)/(z-driverValue b t) := by + have hjpos : (0:ℝ) < j := by exact_mod_cast (Nat.zero_lt_of_lt hj) + have hjone : (1:ℝ) ≤ j := by exact_mod_cast hj + have hi : (j:ℝ)⁻¹ ≤ 1 := (inv_le_one₀ hjpos).mpr hjone + have hin : 0 ≤ (j:ℝ)⁻¹ := (inv_pos.mpr hjpos).le + have hn : (j:ℝ)⁻¹ ≤ ‖z-driverValue b t‖ := + hz.trans (by simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using Complex.im_le_norm (z-driverValue b t)) + have hsq : (j:ℝ)⁻¹^2 ≤ (j:ℝ)⁻¹ := by nlinarith + have hpow : (j:ℝ)^(-(4:ℤ)) ≤ ‖z-driverValue b t‖^2 := by + norm_num only [zpow_neg,zpow_ofNat] + rw [← inv_pow] + calc + (j:ℝ)⁻¹^4 = ((j:ℝ)⁻¹^2)^2 := by ring + _ ≤ ((j:ℝ)⁻¹)^2 := pow_le_pow_left₀ (sq_nonneg _) hsq 2 + _ ≤ ‖z-driverValue b t‖^2 := pow_le_pow_left₀ hin hn 2 + unfold cutoffField + simp only [max_eq_left hpow,div_eq_mul_inv] + rw [Complex.inv_def (z-driverValue b t)] + simp only [Complex.normSq_eq_norm_sq,Complex.ofReal_inv,starRingEnd_apply,mul_assoc] + +lemma cutoffFlow_continuous (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) (z : ℂ) + {T : ℝ} (hT : 0 ≤ T) : ContinuousOn (cutoffFlow κ b j z) (Icc 0 T) := + fun t ht => ((cutoffFlow_solution κ b j hj z hT).2.2 t ht).continuousWithinAt + +lemma cutoff_solution_unique (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) + {z : ℂ} {T : ℝ} (hT : 0 ≤ T) {f : ℝ → ℂ} + (hc : ContinuousOn f (Icc 0 T)) (h0 : f 0 = z) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt f (cutoffField κ b j t (f t)) (Icc 0 T) t) : + EqOn (cutoffFlow κ b j z) f (Icc 0 T) := by + let q : ℝ := (j:ℝ)^(-(2:ℤ)) + have hq : 0 < q := zpow_pos (by exact_mod_cast (Nat.zero_lt_of_lt hj)) _ + let K : ℝ≥0 := ⟨|a κ| * 3/q^2,by positivity⟩ + apply ODE_solution_unique (v := cutoffField κ b j) (K := K) + · intro t + apply LipschitzWith.of_dist_le_mul + intro z w + simp only [dist_eq_norm,cutoffField_eq] + exact Cutoff.field_sub_le hq _ _ _ _ _ + · exact cutoffFlow_continuous κ b hj z hT + · intro t ht + exact ((cutoffFlow_solution κ b j hj z hT).2.2 t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE ht.2) (Icc_subset_Icc_left ht.1)) + · exact hc + · intro t ht + exact (hd t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE ht.2) (Icc_subset_Icc_left ht.1)) + · rw [(cutoffFlow_solution κ b j hj z hT).2.1,h0] + +lemma PositiveSolution.cutoff_eq {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {j : ℕ} (hj : 1 ≤ j) + (hgap : ∀ t ∈ Icc 0 T, (j:ℝ)⁻¹ ≤ (f t).im) : + EqOn (cutoffFlow κ b j z) f (Icc 0 T) := by + apply cutoff_solution_unique κ b hj hf.1 hf.2.1 hf.2.2.1 + intro t ht + rw [cutoffField_of_height κ b hj (hgap t ht)] + exact hf.2.2.2.2 t ht + +lemma PositiveSolution.exists_cutoff {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : + ∃ j : ℕ, 1 ≤ j ∧ ∀ t ∈ Icc 0 T, (j:ℝ)⁻¹ < (f t).im := by + obtain ⟨t0,ht0,hmin⟩ := isCompact_Icc.exists_isMinOn ⟨0,le_rfl,hf.1⟩ + (Complex.continuous_im.comp_continuousOn hf.2.1) + have hy := hf.2.2.2.1 t0 ht0 + have ht : Tendsto (fun n : ℕ => (n:ℝ)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop (R := ℝ)) + obtain ⟨j,hj,hj'⟩ := ((eventually_ge_atTop 1).and (ht.eventually (eventually_lt_nhds hy))).exists + exact ⟨j,hj,fun t ht => hj'.trans_le (hmin ht)⟩ + +lemma PositiveSolution.unique {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f g : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) (hg : PositiveSolution κ b z T g) : EqOn f g (Icc 0 T) := by + obtain ⟨j,hj,hjf⟩ := hf.exists_cutoff + obtain ⟨k,hk,hkg⟩ := hg.exists_cutoff + let n := max j k + have hn : 1 ≤ n := hj.trans (le_max_left _ _) + have hinj : (n:ℝ)⁻¹ ≤ (j:ℝ)⁻¹ := inv_anti₀ (by exact_mod_cast (Nat.zero_lt_of_lt hj)) (by exact_mod_cast le_max_left j k) + have hink : (n:ℝ)⁻¹ ≤ (k:ℝ)⁻¹ := inv_anti₀ (by exact_mod_cast (Nat.zero_lt_of_lt hk)) (by exact_mod_cast le_max_right j k) + have he := hf.cutoff_eq hn (fun t ht => hinj.trans (hjf t ht).le) + have hg' := hg.cutoff_eq hn (fun t ht => hink.trans (hkg t ht).le) + exact fun t ht => (he ht).symm.trans (hg' ht) + +end SLEExactGauge.LiteralTrace +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/EulerMeasurability.lean b/lean/OAI/Probability/SLEGauge/EulerMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a60e8c4ed65ddd6c8f1e2f0a80deed7b4dddd92 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/EulerMeasurability.lean @@ -0,0 +1,438 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.BrownianNodes + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +namespace SLEExactGauge.BrownianCalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] +lemma measurable_nodes_driver (v : E → ℝ → E) + (hv : Measurable (Function.uncurry v)) (h : ℝ≥0) (x : E) (k : ℕ) : + Measurable (fun b : Driver => stochasticNodes v h x k b) := + (measurable_stochasticNodes v hv h x k).comp + (Measurable.of_eval fun time => (continuous_eval_const time).measurable) + +lemma expected_nodes_step {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) + (mv : Measurable (Function.uncurry v)) (M : ℝ) (hv : ∀ x b, ‖v x b‖ ≤ M) + (hgen : ∀ x b, A.D x b (v x b)+deriv (deriv (A.F x)) b/2 ≤ 0) + (h : ℝ≥0) (x : E) (k : ℕ) : + (∫ b : Driver, A.F (stochasticNodes v h x (k+1) b) (b (((k+1:ℕ):ℝ≥0)*h))- + A.F (stochasticNodes v h x k b) (b ((k:ℝ≥0)*h)) ∂W) ≤ + (A.Cx*M^2+A.Ccross*M/2)*(h:ℝ)^2 + A.C₃/3*(h:ℝ)*Real.sqrt h := by + let s := (k:ℝ≥0)*h + let X := fun p : Iic s → ℝ => stochasticNodes v h x k (extendHistory s p) + let V := fun p : Iic s → ℝ => v (X p) (p ⟨s,by simp⟩) + have mX : Measurable X := (measurable_stochasticNodes v mv h x k).comp + (measurable_extendHistory s) + have mV : Measurable V := mv.comp (mX.prodMk (measurable_pi_apply _)) + have he := expected_euler_step hW s h A.F A.D X V A.mF A.mB1 A.mB2 mX mV + A.hD A.hsm A.hC₃ A.hCx A.hCcross A.hF A.hB1 A.hB2 A.hB3 A.hLipD A.hLipB2 + (fun p => hv _ _) (fun p => hgen _ _) + have hn (b : Driver) : X (history s b) = stochasticNodes v h x k b := + stochasticNodes_history v h x k b + have hs : ((k+1:ℕ):ℝ≥0)*h = s+h := by dsimp [s]; push_cast; ring + simpa only [X, V, hn, history, stochasticNodes, hs] using he + + + +theorem expected_nodes {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) + (mv : Measurable (Function.uncurry v)) (M : ℝ) (hv : ∀ x b, ‖v x b‖ ≤ M) + (hgen : ∀ x b, A.D x b (v x b)+deriv (deriv (A.F x)) b/2 ≤ 0) + (h : ℝ≥0) (x : E) (k : ℕ) : + (∫ b : Driver, A.F (stochasticNodes v h x k b) (b ((k:ℝ≥0)*h)) ∂W) ≤ + A.F x 0+(k:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h:ℝ)^2 + A.C₃/3*(h:ℝ)*Real.sqrt h) := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hi (k : ℕ) : Integrable (fun b : Driver => + A.F (stochasticNodes v h x k b) (b ((k:ℝ≥0)*h))) W := by + apply (integrable_const A.C₀).mono' + · exact (A.mF.comp ((measurable_nodes_driver v mv h x k).prodMk + (continuous_eval_const _).measurable)).aestronglyMeasurable + · exact Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using A.hF _ _ + induction k with + | zero => simp [stochasticNodes, map_zero] + | succ k ih => + have he := expected_nodes_step hW A v mv M hv hgen h x k + rw [integral_sub (hi (k+1)) (hi k)] at he + push_cast at he ⊢ + linarith + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem expected_nodes_limit {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) + (mv : Measurable (Function.uncurry v)) (M : ℝ) (hv : ∀ x b, ‖v x b‖ ≤ M) + (hgen : ∀ x b, A.D x b (v x b)+deriv (deriv (A.F x)) b/2 ≤ 0) + (h : ℕ → ℝ≥0) (k : ℕ → ℕ) (x : E) (t : ℝ≥0) (X : Driver → E) + (hh : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0)) + (htime : Tendsto (fun n => (k n:ℝ≥0)*h n) atTop (𝓝 t)) + (hX : ∀ᵐ (b : Driver) ∂W, Tendsto (fun n => stochasticNodes v (h n) x (k n) b) atTop (𝓝 (X b))) : + (∫ b, A.F (X b) (b t) ∂W) ≤ A.F x 0 := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hc : ∀ᵐ (b : Driver) ∂W, Tendsto (fun n => + A.F (stochasticNodes v (h n) x (k n) b) (b ((k n:ℝ≥0)*h n))) + atTop (𝓝 (A.F (X b) (b t))) := by + filter_upwards [hX] with b hb + exact A.cF.continuousAt.tendsto.comp (hb.prodMk_nhds (b.continuous.continuousAt.tendsto.comp htime)) + have hi : Tendsto (fun n => ∫ b : Driver, + A.F (stochasticNodes v (h n) x (k n) b) (b ((k n:ℝ≥0)*h n)) ∂W) + atTop (𝓝 (∫ b, A.F (X b) (b t) ∂W)) := + tendsto_integral_of_dominated_convergence (fun _ : Driver => A.C₀) + (fun n => (A.mF.comp ((measurable_nodes_driver v mv (h n) x (k n)).prodMk + (continuous_eval_const _).measurable)).aestronglyMeasurable) + (integrable_const A.C₀) + (fun n => Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using A.hF _ _) hc + have hk : Tendsto (fun n => (k n:ℝ)*(h n:ℝ)) atTop (𝓝 (t:ℝ)) := by + simpa only [Function.comp_def, NNReal.coe_mul, NNReal.coe_natCast] using + NNReal.continuous_coe.continuousAt.tendsto.comp htime + have hs : Tendsto (fun n => Real.sqrt (h n:ℝ)) atTop (𝓝 0) := by + simpa only [Function.comp_def, Real.sqrt_zero] using (Real.continuous_sqrt.tendsto 0).comp hh + have he : Tendsto (fun n => (k n:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h n:ℝ)^2 + + A.C₃/3*(h n:ℝ)*Real.sqrt (h n))) atTop (𝓝 0) := by + have hh' := hk.mul (((tendsto_const_nhds (x := A.Cx*M^2+A.Ccross*M/2)).mul hh).add + ((tendsto_const_nhds (x := A.C₃/3)).mul hs)) + convert! hh' using 1 + · ext n + ring + · simp + have hb : Tendsto (fun n => A.F x 0+(k n:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h n:ℝ)^2 + + A.C₃/3*(h n:ℝ)*Real.sqrt (h n))) atTop (𝓝 (A.F x 0)) := by + simpa using tendsto_const_nhds.add he + exact le_of_tendsto_of_tendsto hi hb + (Filter.Eventually.of_forall fun n => expected_nodes hW A v mv M hv hgen (h n) x (k n)) + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + + + +lemma expected_shifted_taylor {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (F : (Iic s → ℝ) → ℝ → ℝ) (B : (Iic s → ℝ) → ℝ) + (hsm : ∀ p, ContDiff ℝ 3 (F p)) + (hm1 : Measurable (fun p => deriv (F p) (B p))) + (hm2 : Measurable (fun p => deriv (deriv (F p)) (B p))) + {C M₁ M₂ : ℝ} (hC : 0 ≤ C) + (hb1 : ∀ p, |deriv (F p) (B p)| ≤ M₁) + (hb2 : ∀ p, |deriv (deriv (F p)) (B p)| ≤ M₂) + (hb3 : ∀ p x, |iteratedDeriv 3 (F p) x| ≤ C) + (hi : Integrable (fun b => F (history s b) (B (history s b)+increment s h b) - + F (history s b) (B (history s b))) W) : + |(∫ b, F (history s b) (B (history s b)+increment s h b) - + F (history s b) (B (history s b)) ∂W) - + (h:ℝ)/2 * (∫ b, deriv (deriv (F (history s b))) (B (history s b)) ∂W)| ≤ + C/3 * (h:ℝ) * Real.sqrt h := by + let c := fun p : Iic s → ℝ => B p-p ⟨s,by simp⟩ + let f := fun p u => F p (u+c p) + have hbase (p : Iic s → ℝ) : p ⟨s,by simp⟩+c p = B p := by dsimp [c]; ring + have hd1 (p : Iic s → ℝ) : deriv (f p) = fun u => deriv (F p) (u+c p) := by + ext u + exact deriv_comp_add_const (F p) (c p) u + have hd2 (p : Iic s → ℝ) : deriv (deriv (f p)) = fun u => deriv (deriv (F p)) (u+c p) := by + rw [hd1] + ext u + exact deriv_comp_add_const (deriv (F p)) (c p) u + have hsmooth (p : Iic s → ℝ) : ContDiff ℝ 3 (f p) := + (hsm p).comp (contDiff_id.add contDiff_const) + have hm1' : Measurable (fun p => deriv (f p) (p ⟨s,by simp⟩)) := by + simpa only [hd1, hbase] using hm1 + have hm2' : Measurable (fun p => deriv (deriv (f p)) (p ⟨s,by simp⟩)) := by + simpa only [hd2, hbase] using hm2 + have hf (b : Driver) : f (history s b) (b (s+h))-f (history s b) (b s) = + F (history s b) (B (history s b)+increment s h b)-F (history s b) (B (history s b)) := by + dsimp [f,c,history,increment] + congr 2 <;> ring + have hi' : Integrable (fun b => f (history s b) (b (s+h))-f (history s b) (b s)) W := by + simpa only [hf] using hi + have he := expected_taylor_step hW s h f hsmooth hm1' hm2' hC + (fun p => by simpa only [hd1,hbase] using hb1 p) + (fun p => by simpa only [hd2,hbase] using hb2 p) + (fun p u => by simpa only [f, iteratedDeriv_comp_add_const, Function.comp_apply] using hb3 p (u+c p)) hi' + simpa only [hf,hd2,show ∀ b : Driver, b s+c (history s b) = B (history s b) from + fun b => hbase (history s b)] using he + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus + + + +lemma expected_shift_with_drift {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (f : (Iic s → ℝ) → ℝ → ℝ) (B old : (Iic s → ℝ) → ℝ) + (mf : Measurable (Function.uncurry f)) (mB : Measurable B) (mOld : Measurable old) + (hsm : ∀ p, ContDiff ℝ 3 (f p)) + (hm1 : Measurable (fun p => deriv (f p) (B p))) + (hm2 : Measurable (fun p => deriv (deriv (f p)) (B p))) + {C₀ C₁ C₂ C₃ R : ℝ} (hC₃ : 0 ≤ C₃) + (hb0 : ∀ p u, |f p u| ≤ C₀) (hOld : ∀ p, |old p| ≤ C₀) + (hb1 : ∀ p, |deriv (f p) (B p)| ≤ C₁) + (hb2 : ∀ p, |deriv (deriv (f p)) (B p)| ≤ C₂) + (hb3 : ∀ p u, |iteratedDeriv 3 (f p) u| ≤ C₃) + (hstep : ∀ p, f p (B p)-old p+(h:ℝ)/2*deriv (deriv (f p)) (B p) ≤ R) : + (∫ b, f (history s b) (B (history s b)+increment s h b)-old (history s b) ∂W) ≤ + R + C₃/3*(h:ℝ)*Real.sqrt h := by + let := hW.isGaussianProcess.isProbabilityMeasure + let step := fun b : Driver => f (history s b) (B (history s b)) + let next := fun b : Driver => f (history s b) (B (history s b)+increment s h b) + let prev := fun b : Driver => old (history s b) + let Q := fun b : Driver => deriv (deriv (f (history s b))) (B (history s b)) + have ms : Measurable step := mf.comp ((measurable_history s).prodMk (mB.comp (measurable_history s))) + have mn : Measurable next := mf.comp ((measurable_history s).prodMk + ((mB.comp (measurable_history s)).add (measurable_increment s h))) + have mp : Measurable prev := mOld.comp (measurable_history s) + have mq : Measurable Q := hm2.comp (measurable_history s) + have is : Integrable step W := (integrable_const C₀).mono' ms.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hb0 _ _) + have inx : Integrable next W := (integrable_const C₀).mono' mn.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hb0 _ _) + have ip : Integrable prev W := (integrable_const C₀).mono' mp.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hOld _) + have iq : Integrable Q W := (integrable_const C₂).mono' mq.aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using hb2 _) + have ht := expected_shifted_taylor hW s h f B hsm hm1 hm2 hC₃ hb1 hb2 hb3 (inx.sub is) + change |(∫ b, next b-step b ∂W)-(h:ℝ)/2*(∫ b, Q b ∂W)| ≤ _ at ht + have hi := integral_mono_ae ((is.sub ip).add (iq.const_mul ((h:ℝ)/2))) + (integrable_const R) (Filter.Eventually.of_forall fun b => hstep (history s b)) + have hi' : (∫ b, step b-prev b+(h:ℝ)/2*Q b ∂W) ≤ R := by + simpa only [integral_const, Measure.real, measure_univ, ENNReal.toReal_one, one_smul, + Pi.add_apply, Pi.sub_apply] using hi + change (∫ b, (step-prev) b+(h:ℝ)/2*Q b ∂W) ≤ R at hi' + rw [integral_add (is.sub ip) (iq.const_mul ((h:ℝ)/2)), integral_const_mul] at hi' + change (∫ b, step b-prev b ∂W)+(h:ℝ)/2*(∫ b, Q b ∂W) ≤ R at hi' + rw [integral_sub is ip] at hi' + rw [integral_sub inx is] at ht + change (∫ b, next b-prev b ∂W) ≤ _ + rw [integral_sub inx ip] + linarith [le_abs_self ((∫ b, next b ∂W)-(∫ b, step b ∂W)-(h:ℝ)/2*(∫ b, Q b ∂W))] + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +omit [BorelSpace E] [SecondCountableTopology E] in +lemma SmoothTest.euler_generator_error (A : SmoothTest E) (x v : E) (b : ℝ) + {h M : ℝ} (hh : 0 ≤ h) (hv : ‖v‖ ≤ M) + (hg : A.D x b v+deriv (deriv (A.F x)) b/2 ≤ 0) : + A.F (x+h • v) b-A.F x b+h/2*deriv (deriv (A.F (x+h • v))) b ≤ + (A.Cx*M^2+A.Ccross*M/2)*h^2 := by + have hy : ‖x+h • v-x‖ ≤ h*M := by + simp only [add_sub_cancel_left, norm_smul, Real.norm_eq_abs, abs_of_nonneg hh] + exact mul_le_mul_of_nonneg_left hv hh + have hd := state_euler_remainder (fun x => A.hD x b) A.hCx + (fun x y => A.hLipD x y b) x v hh hv + have hb := (le_abs_self _).trans (A.hLipB2 (x+h • v) x b) + have hc := hb.trans (mul_le_mul_of_nonneg_left hy A.hCcross) + have hg' := mul_nonpos_of_nonneg_of_nonpos hh hg + have hc' := mul_le_mul_of_nonneg_left hc (div_nonneg hh (by norm_num : (0:ℝ) ≤ 2)) + nlinarith + + + +lemma expected_active_euler_step {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (A : SmoothTest E) + (X V : (Iic s → ℝ) → E) (B : (Iic s → ℝ) → ℝ) + (mX : Measurable X) (mV : Measurable V) (mB : Measurable B) + (S : Set (Iic s → ℝ)) (hS : MeasurableSet S) + {M : ℝ} (hV : ∀ p, ‖V p‖ ≤ M) + (hgen : ∀ p ∈ S, A.D (X p) (B p) (V p)+deriv (deriv (A.F (X p))) (B p)/2 ≤ 0) : + (∫ b, (if history s b ∈ S then + A.F (X (history s b)+(h:ℝ) • V (history s b)) (B (history s b)+increment s h b) + else A.F (X (history s b)) (B (history s b)))- + A.F (X (history s b)) (B (history s b)) ∂W) ≤ + (A.Cx*M^2+A.Ccross*M/2)*(h:ℝ)^2+A.C₃/3*(h:ℝ)*Real.sqrt h := by + classical + let Y := fun p => X p+(h:ℝ) • V p + let old := fun p => A.F (X p) (B p) + let f := fun p u => if p ∈ S then A.F (Y p) u else old p + have mY : Measurable Y := mX.add (mV.const_smul (h:ℝ)) + have mOld : Measurable old := A.mF.comp (mX.prodMk mB) + have mf : Measurable (Function.uncurry f) := + (A.mF.comp ((mY.comp measurable_fst).prodMk measurable_snd)).ite + (hS.preimage measurable_fst) (mOld.comp measurable_fst) + have hd1 (p : Iic s → ℝ) : deriv (f p) = fun u => if p ∈ S then deriv (A.F (Y p)) u else 0 := by + by_cases hp : p ∈ S <;> simp [f,hp] + have hd2 (p : Iic s → ℝ) : deriv (deriv (f p)) = fun u => + if p ∈ S then deriv (deriv (A.F (Y p))) u else 0 := by + rw [hd1] + by_cases hp : p ∈ S <;> simp [hp] + have hm1 : Measurable (fun p => deriv (f p) (B p)) := by + simp only [hd1] + exact (A.mB1.comp (mY.prodMk mB)).ite hS measurable_const + have hm2 : Measurable (fun p => deriv (deriv (f p)) (B p)) := by + simp only [hd2] + exact (A.mB2.comp (mY.prodMk mB)).ite hS measurable_const + have hC₁ : 0 ≤ A.C₁ := (abs_nonneg _).trans (A.hB1 0 0) + have hC₂ : 0 ≤ A.C₂ := (abs_nonneg _).trans (A.hB2 0 0) + have hM : 0 ≤ M := (norm_nonneg _).trans (hV (fun _ => 0)) + refine expected_shift_with_drift (C₀ := A.C₀) (C₁ := A.C₁) (C₂ := A.C₂) + hW s h f B old mf mB mOld ?_ hm1 hm2 A.hC₃ ?_ ?_ ?_ ?_ ?_ ?_ + · intro p + by_cases hp : p ∈ S + · simpa only [f,ite_eq_left hp] using A.hsm (Y p) + · simpa only [f,ite_eq_right hp] using (contDiff_const (c := old p) : ContDiff ℝ 3 _) + · intro p u + by_cases hp : p ∈ S + · simpa only [f,ite_eq_left hp] using A.hF (Y p) u + · simpa only [f,ite_eq_right hp,old] using A.hF (X p) (B p) + · intro p + exact A.hF _ _ + · intro p + by_cases hp : p ∈ S + · simpa only [hd1,ite_eq_left hp] using A.hB1 (Y p) (B p) + · simpa only [hd1,ite_eq_right hp,abs_zero] using hC₁ + · intro p + by_cases hp : p ∈ S + · simpa only [hd2,ite_eq_left hp] using A.hB2 (Y p) (B p) + · simpa only [hd2,ite_eq_right hp,abs_zero] using hC₂ + · intro p u + by_cases hp : p ∈ S + · simpa only [f,ite_eq_left hp] using A.hB3 (Y p) u + · simpa [f,hp,iteratedDeriv_const] using A.hC₃ + · intro p + rw [hd2] + by_cases hp : p ∈ S + · simpa only [f,ite_eq_left hp,old,Y] using A.euler_generator_error (X p) (V p) (B p) + h.coe_nonneg (hV p) (hgen p hp) + · simp only [f,ite_eq_right hp,sub_self,mul_zero,add_zero] + exact mul_nonneg (add_nonneg (mul_nonneg A.hCx (sq_nonneg M)) + (div_nonneg (mul_nonneg A.hCcross hM) (by norm_num))) (sq_nonneg _) + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +def frozenNodes (v : E → ℝ → E) (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) + (h : ℝ≥0) (q : E × ℝ) : ℕ → (ℝ≥0 → ℝ) → E × ℝ + | 0, _ => q + | k+1, b => + let qk := frozenNodes v U h q k b + if (b,qk) ∈ U k then + (qk.1+(h:ℝ) • v qk.1 qk.2, qk.2+(b (((k:ℝ≥0)+1)*h)-b ((k:ℝ≥0)*h))) + else qk + +lemma measurable_frozenNodes (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mU : ∀ k, MeasurableSet (U k)) + (h : ℝ≥0) (q : E × ℝ) (k : ℕ) : Measurable (frozenNodes v U h q k) := by + induction k with + | zero => exact measurable_const + | succ k ih => + exact ((ih.fst.add ((mv.comp ih).const_smul (h:ℝ))).prodMk + (ih.snd.add ((measurable_pi_apply _).sub (measurable_pi_apply _)))).ite + ((mU k).preimage (measurable_id.prodMk ih)) ih + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma frozenNodes_congr (v : E → ℝ → E) (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) + (h : ℝ≥0) (q : E × ℝ) + (hU : ∀ (k : ℕ) b c, (∀ t ≤ (k:ℝ≥0)*h, b t = c t) → ∀ x, + ((b,x) ∈ U k ↔ (c,x) ∈ U k)) (k : ℕ) + {b c : ℝ≥0 → ℝ} (he : ∀ t ≤ (k:ℝ≥0)*h, b t = c t) : + frozenNodes v U h q k b = frozenNodes v U h q k c := by + induction k with + | zero => rfl + | succ k ih => + have hle : (k:ℝ≥0)*h ≤ ((k+1:ℕ):ℝ≥0)*h := + mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.le_succ k) h.coe_nonneg + have he' : ∀ t ≤ (k:ℝ≥0)*h, b t = c t := fun t ht => he t (ht.trans hle) + have hn := ih he' + have hu := hU k b c he' (frozenNodes v U h q k c) + have hb := he (((k:ℝ≥0)+1)*h) (by push_cast; exact le_rfl) + simp only [frozenNodes, hn, hu, hb, he _ hle] + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma frozenNodes_history (v : E → ℝ → E) (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) + (h : ℝ≥0) (q : E × ℝ) + (hU : ∀ (k : ℕ) b c, (∀ t ≤ (k:ℝ≥0)*h, b t = c t) → ∀ x, + ((b,x) ∈ U k ↔ (c,x) ∈ U k)) (k : ℕ) (b : Driver) : + frozenNodes v U h q k (extendHistory ((k:ℝ≥0)*h) (history ((k:ℝ≥0)*h) b)) = + frozenNodes v U h q k b := by + apply frozenNodes_congr v U h q hU + intro t ht + simp only [extendHistory,dite_eq_left ht,history] + +lemma expected_frozen_step {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mU : ∀ k, MeasurableSet (U k)) + (h : ℝ≥0) (q : E × ℝ) + (hU : ∀ (k : ℕ) b c, (∀ t ≤ (k:ℝ≥0)*h, b t = c t) → ∀ x, + ((b,x) ∈ U k ↔ (c,x) ∈ U k)) + {M : ℝ} (hv : ∀ x b, ‖v x b‖ ≤ M) + (hg : ∀ k b x, (b,x) ∈ U k → A.D x.1 x.2 (v x.1 x.2)+deriv (deriv (A.F x.1)) x.2/2 ≤ 0) + (k : ℕ) : + (∫ b : Driver, A.F (frozenNodes v U h q (k+1) b).1 (frozenNodes v U h q (k+1) b).2- + A.F (frozenNodes v U h q k b).1 (frozenNodes v U h q k b).2 ∂W) ≤ + (A.Cx*M^2+A.Ccross*M/2)*(h:ℝ)^2+A.C₃/3*(h:ℝ)*Real.sqrt h := by + let s := (k:ℝ≥0)*h + let X := fun p : Iic s → ℝ => frozenNodes v U h q k (extendHistory s p) + have mX : Measurable X := (measurable_frozenNodes v mv U mU h q k).comp (measurable_extendHistory s) + let S := {p : Iic s → ℝ | (extendHistory s p,X p) ∈ U k} + have mS : MeasurableSet S := (mU k).preimage ((measurable_extendHistory s).prodMk mX) + have he := expected_active_euler_step hW s h A (fun p => (X p).1) + (fun p => v (X p).1 (X p).2) (fun p => (X p).2) mX.fst (mv.comp mX) mX.snd S mS + (fun p => hv _ _) (fun p hp => hg k (extendHistory s p) (X p) hp) + have hx (b : Driver) : X (history s b) = frozenNodes v U h q k b := + frozenNodes_history v U h q hU k b + have hs (b : Driver) : history s b ∈ S ↔ ((b : ℝ≥0 → ℝ),frozenNodes v U h q k b) ∈ U k := by + change (extendHistory s (history s b),X (history s b)) ∈ U k ↔ _ + rw [hx] + apply hU k _ _ + intro t ht + change t ≤ s at ht + simp only [extendHistory,dite_eq_left ht,history] + have ht : s+h = ((k:ℝ≥0)+1)*h := by dsimp [s]; ring + convert! he using 1 + congr 1 + funext b + rw [hx,hs] + simp only [frozenNodes,increment,ht,s] + split_ifs <;> rfl + +end SLEExactGauge.BrownianCalculus +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/EulerMoments.lean b/lean/OAI/Probability/SLEGauge/EulerMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..de66e475bcc1863bccb0ef3255543897ef04f926 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/EulerMoments.lean @@ -0,0 +1,432 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.FrozenExpectations + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.EulerGeneral +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] +omit [CompleteSpace E] in +lemma interpolate_at_node (f : ℝ → E → E) {h : ℝ} (hh : 0 < h) (z : E) (k : ℕ) : + interpolate f h z ((k:ℝ)*h) = nodes f h z k := by + simp [interpolate, mul_div_cancel_right₀ _ hh.ne'] + + + +omit [CompleteSpace E] in +lemma nodes_converge_moving {f : ℝ → E → E} {g : ℝ → E} {z : E} {L M T U s : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (hU : 0 ≤ U) (hUT : U < T) (hs : s ∈ Icc 0 U) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) + (k : ℕ → ℕ) (hk : ∀ᶠ n in atTop, (k n:ℝ)*h n ≤ U) + (hks : Tendsto (fun n => (k n:ℝ)*h n) atTop (𝓝 s)) : + Tendsto (fun n => nodes f (h n) z (k n)) atTop (𝓝 (g s)) := by + have hu := converge_uniformOn hL hM hg0 hlip hder hcf hbound hU hUT hh hh0 + have hgs : ContinuousWithinAt g (Icc 0 U) s := + (hder s ⟨hs.1, hs.2.trans hUT.le⟩).continuousWithinAt.mono (Icc_subset_Icc_right hUT.le) + have hs' : Tendsto (fun n => (k n:ℝ)*h n) atTop (𝓝[Icc 0 U] s) := by + rw [tendsto_nhdsWithin_iff] + exact ⟨hks, hk.mono fun n hn => ⟨mul_nonneg (Nat.cast_nonneg _) (hh n).le,hn⟩⟩ + simpa only [interpolate_at_node _ (hh _) _ _] using hu.tendsto_comp hgs hs' + +end SLEExactGauge.EulerGeneral + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma frozenNodes_eq_min (v : E → ℝ → E) (f : ℝ → E → E) + (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (h : ℝ≥0) (z : E) (b : ℝ≥0 → ℝ) + (hf : ∀ (k : ℕ) x, f ((k:ℝ)*h) x = v x (b ((k:ℝ≥0)*h))) (K : ℕ) + (ha : ∀ k < K, (b,(EulerGeneral.nodes f h z k,b ((k:ℝ≥0)*h))) ∈ U k) + (hi : ∀ k ≥ K, ∀ x, (b,x) ∉ U k) (k : ℕ) : + frozenNodes v U h (z,b 0) k b = + (EulerGeneral.nodes f h z (min k K),b (((min k K:ℕ):ℝ≥0)*h)) := by + induction k with + | zero => simp [frozenNodes,EulerGeneral.nodes] + | succ k ih => + by_cases hk : k < K + · have hk1 : k+1 ≤ K := hk + rw [frozenNodes,ih] + simp only [min_eq_left hk.le, min_eq_left hk1, ha k hk, ite_eq_left, EulerGeneral.nodes, hf] + congr 1 + simp only [Nat.cast_add,Nat.cast_one] + ring + · have hk' : K ≤ k := Nat.le_of_not_gt hk + have hk1 : K ≤ k+1 := hk'.trans (Nat.le_succ _) + rw [frozenNodes,ih] + simp only [min_eq_right hk',min_eq_right hk1,hi k hk',ite_false] + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.EulerGeneral + +lemma ceil_mesh_times_converge {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) + (hh0 : Tendsto h atTop (𝓝 0)) {τ : ℝ} (hτ : 0 ≤ τ) : + Tendsto (fun n => (⌈τ/h n⌉₊:ℝ)*h n) atTop (𝓝 τ) := by + have hb (n : ℕ) : 0 ≤ (⌈τ/h n⌉₊:ℝ)*h n-τ ∧ (⌈τ/h n⌉₊:ℝ)*h n-τ ≤ h n := by + have hl := Nat.le_ceil (τ/h n) + have hu := Nat.ceil_lt_add_one (div_nonneg hτ (hh n).le) + have hl' := (div_le_iff₀ (hh n)).mp hl + have hu' := (mul_lt_mul_of_pos_right hu (hh n)) + rw [add_mul,div_mul_cancel₀ _ (hh n).ne',one_mul] at hu' + constructor <;> linarith + have hz : Tendsto (fun n => (⌈τ/h n⌉₊:ℝ)*h n-τ) atTop (𝓝 0) := + squeeze_zero (fun n => (hb n).1) (fun n => (hb n).2) hh0 + simpa using hz.add_const τ + +lemma effective_stop_times_converge {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) + (hh0 : Tendsto h atTop (𝓝 0)) {τ t : ℝ} (hτ : 0 ≤ τ) (ht : 0 ≤ t) : + Tendsto (fun n => ((min ⌊t/h n⌋₊ ⌈τ/h n⌉₊:ℕ):ℝ)*h n) atTop (𝓝 (min t τ)) := by + have h1 := mesh_times_converge hh hh0 ht + have h2 := ceil_mesh_times_converge hh hh0 hτ + simpa only [Nat.cast_min, min_mul_of_nonneg _ _ (hh _).le] using h1.min h2 + +end SLEExactGauge.EulerGeneral + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + + +omit [CompleteSpace E] in +lemma ordinary_nodes_eventually_inside (f : ℝ → E → E) (g : ℝ → E) (z : E) + (b : ℝ≥0 → ℝ) (D : Set (E × ℝ)) {τ T L M ε : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (hτ : 0 ≤ τ) (hτT : τ < T) (hε : 0 < ε) + (hD : ∀ u ∈ Icc 0 τ, ∀ x, ‖x-g u‖ < ε → (x,b u.toNNReal) ∈ D) + {h : ℕ → ℝ≥0} (hh : ∀ n, 0 < h n) (hh0 : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0)) : + ∀ᶠ n in atTop, ∀ k : ℕ, (k:ℝ)*(h n:ℝ) < τ → + (EulerGeneral.nodes f (h n) z k,b ((k:ℝ≥0)*h n)) ∈ D := by + have hu := EulerGeneral.converge_uniformOn hL hM hg0 hlip hder hcf hbound hτ hτT + (fun n => show 0 < (h n:ℝ) from hh n) hh0 + have he := (Metric.tendstoUniformlyOn_iff.mp hu) ε hε + filter_upwards [he] with n hn + intro k hk + have htime : (k:ℝ)*(h n:ℝ) ∈ Icc 0 τ := ⟨by positivity,hk.le⟩ + have hn' := hn _ htime + rw [EulerGeneral.interpolate_at_node _ (show 0 < (h n:ℝ) from hh n) _ _] at hn' + have hb : ((k:ℝ)*(h n:ℝ)).toNNReal = (k:ℝ≥0)*h n := by + apply NNReal.coe_injective + simp [Real.toNNReal_of_nonneg (show 0 ≤ (k:ℝ)*(h n:ℝ) by positivity)] + rw [← hb] + apply hD _ htime _ + rw [dist_comm] at hn' + simpa only [dist_eq_norm] using hn' + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + + +omit [CompleteSpace E] in +theorem frozen_nodes_path_limit (v : E → ℝ → E) (g : ℝ → E) (z : E) + (b : ℝ≥0 → ℝ) (cb : Continuous b) (D : Set (E × ℝ)) + (U : ℕ → ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) {τ T t L M ε : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖v x (b u.toNNReal)-v y (b u.toNNReal)‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (v (g u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => v (g u) (b u.toNNReal)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖v (g u) (b u.toNNReal)‖ ≤ M) + (hτ : 0 ≤ τ) (hτT : τ < T) (ht : 0 ≤ t) (hε : 0 < ε) + (hD : ∀ u ∈ Icc 0 τ, ∀ x, ‖x-g u‖ < ε → (x,b u.toNNReal) ∈ D) + {h : ℕ → ℝ≥0} (hh : ∀ n, 0 < h n) (hh0 : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0)) + (hU : ∀ n k x, (b,x) ∈ U n k ↔ (k:ℝ)*(h n:ℝ) < τ ∧ x ∈ D) : + Tendsto (fun n => frozenNodes v (U n) (h n) (z,b 0) ⌊t/(h n:ℝ)⌋₊ b) + atTop (𝓝 (g (min t τ),b (min t τ).toNNReal)) := by + let f : ℝ → E → E := fun u x => v x (b u.toNNReal) + let K : ℕ → ℕ := fun n => ⌈τ/(h n:ℝ)⌉₊ + let k : ℕ → ℕ := fun n => min ⌊t/(h n:ℝ)⌋₊ (K n) + have hn := ordinary_nodes_eventually_inside f g z b D hL hM hg0 hlip hder hcf hbound + hτ hτT hε hD hh hh0 + have he : ∀ᶠ n in atTop, frozenNodes v (U n) (h n) (z,b 0) ⌊t/(h n:ℝ)⌋₊ b = + (EulerGeneral.nodes f (h n) z (k n),b ((k n:ℝ≥0)*h n)) := by + filter_upwards [hn] with n hn + refine frozenNodes_eq_min v f (U n) (h n) z b ?_ (K n) ?_ ?_ _ + · intro j x + dsimp [f] + congr 2 + apply NNReal.coe_injective + simp [Real.toNNReal_of_nonneg (show 0 ≤ (j:ℝ)*(h n:ℝ) by positivity)] + · intro j hj + have htj : (j:ℝ)*(h n:ℝ) < τ := + (lt_div_iff₀ (show 0 < (h n:ℝ) from hh n)).mp (Nat.lt_ceil.mp hj) + exact (hU n j _).mpr ⟨htj,hn j htj⟩ + · intro j hj x hx + have htj : τ ≤ (j:ℝ)*(h n:ℝ) := + (div_le_iff₀ (show 0 < (h n:ℝ) from hh n)).mp (Nat.ceil_le.mp hj) + exact (not_lt_of_ge htj) ((hU n j x).mp hx).1 + have hk0 : Tendsto (fun n => (k n:ℝ)*(h n:ℝ)) atTop (𝓝 (min t τ)) := + EulerGeneral.effective_stop_times_converge (fun n => hh n) hh0 hτ ht + let S : ℝ := (τ+T)/2 + have hsS : min t τ < S := lt_of_le_of_lt (min_le_right _ _) (by dsimp [S]; linarith) + have hkS : ∀ᶠ n in atTop, (k n:ℝ)*(h n:ℝ) ≤ S := + (hk0.eventually (gt_mem_nhds hsS)).mono fun _ hn => hn.le + have hg := EulerGeneral.nodes_converge_moving hL hM hg0 hlip hder hcf hbound + (show 0 ≤ S by dsimp [S]; linarith) (show S < T by dsimp [S]; linarith) + (show min t τ ∈ Icc 0 S from ⟨le_min ht hτ,hsS.le⟩) + (fun n => show 0 < (h n:ℝ) from hh n) hh0 k hkS hk0 + have hb0 : Tendsto (fun n => (k n:ℝ≥0)*h n) atTop (𝓝 (min t τ).toNNReal) := by + convert! continuous_real_toNNReal.continuousAt.tendsto.comp hk0 using 1 + funext n + apply NNReal.coe_injective + simp [Real.toNNReal_of_nonneg (show 0 ≤ (k n:ℝ)*(h n:ℝ) by positivity)] + exact (hg.prodMk_nhds (cb.continuousAt.tendsto.comp hb0)).congr' (Filter.EventuallyEq.symm he) + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +omit [CompleteSpace E] in +theorem expected_stopped_smooth {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : (ℝ≥0 → ℝ) → ℝ) (mτ : Measurable τ) + (hτpast : ∀ (s : ℝ≥0) b c, (∀ u ≤ s, b u = c u) → ((s:ℝ) < τ b ↔ (s:ℝ) < τ c)) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (D : Set (E × ℝ)) (mD : MeasurableSet D) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ D) + (hgen : ∀ x ∈ D, A.D x.1 x.2 (v x.1 x.2)+deriv (deriv (A.F x.1)) x.2/2 ≤ 0) + (ht : 0 ≤ t) : + (∫ b : Driver, A.F (g b (min t (τ b))) (b (min t (τ b)).toNNReal) ∂W) ≤ A.F z 0 := by + let h : ℕ → ℝ≥0 := fun n => (1/2)^n + have hh : ∀ n, 0 < h n := fun n => pow_pos (by norm_num) n + have hh0 : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0) := by + simp only [h,NNReal.coe_pow,NNReal.coe_div,NNReal.coe_one,NNReal.coe_ofNat] + exact tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + let U : ℕ → ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ)) := + fun n k => {q | (k:ℝ)*(h n:ℝ) < τ q.1 ∧ q.2 ∈ D} + have mU : ∀ n k, MeasurableSet (U n k) := by + intro n k + exact (measurableSet_lt measurable_const (mτ.comp measurable_fst)).inter + (mD.preimage measurable_snd) + have hu : ∀ n (k : ℕ) b c, (∀ u ≤ (k:ℝ≥0)*h n, b u = c u) → ∀ x, + ((b,x) ∈ U n k ↔ (c,x) ∈ U n k) := by + intro n k b c hbc x + change ((k:ℝ)*(h n:ℝ) < τ b ∧ x ∈ D ↔ (k:ℝ)*(h n:ℝ) < τ c ∧ x ∈ D) + rw [show (k:ℝ)*(h n:ℝ) = (((k:ℝ≥0)*h n):ℝ) by simp] + exact and_congr_left fun _ => hτpast _ b c hbc + apply expected_frozen_limit hW A v mv U mU h (fun n => ⌊t/(h n:ℝ)⌋₊) (z,0) hu M hv + (fun _ _ _ x hx => hgen x hx.2) + (fun b => (g b (min t (τ b)), b (min t (τ b)).toNNReal)) t hh0 + (EulerGeneral.mesh_times_converge (fun n => hh n) hh0 ht) + filter_upwards [] with b + obtain ⟨ε,hε,hDb⟩ := hD b + have hp := frozen_nodes_path_limit v (g b) z b b.continuous D U hL hM (hg0 b) + (fun _ _ => hlip _) (hder b) (hcf b) (fun u _ => hv _ _) (hτ b).1 (hτ b).2 ht + hε hDb hh hh0 (fun _ _ _ => Iff.rfl) + simpa only [map_zero] using hp + +end SLEExactGauge.BrownianCalculus + +open scoped ContDiff Manifold +namespace SLEExactGauge.BrownianCalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + +def driverJets (F : E × ℝ → ℝ) : ℕ → E × ℝ → ℝ + | 0 => F + | n+1 => fun q => fderiv ℝ (driverJets F n) q (0,1) + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma driverJets_smooth {F : E × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) (n : ℕ) : + ContDiff ℝ ∞ (driverJets F n) := by + induction n with + | zero => exact hF + | succ n ih => + exact (contDiff_infty_iff_fderiv.mp ih).2.clm_apply contDiff_const + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma driverJets_compact {F : E × ℝ → ℝ} (hF : HasCompactSupport F) (n : ℕ) : + HasCompactSupport (driverJets F n) := by + induction n with + | zero => exact hF + | succ n ih => exact ih.fderiv_apply ℝ (0,1) + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma driverJets_restriction {F : E × ℝ → ℝ} (hF : ContDiff ℝ ∞ F) (n : ℕ) + (x : E) (b : ℝ) : driverJets F n (x,b) = iteratedDeriv n (fun c => F (x,c)) b := by + induction n generalizing b with + | zero => rfl + | succ n ih => + have he : iteratedDeriv n (fun c => F (x,c)) = fun c => driverJets F n (x,c) := by + funext c + exact (ih c).symm + rw [iteratedDeriv_succ,he] + have hd := ((driverJets_smooth hF n).differentiable (by simp) (x,b)).hasFDerivAt.comp_hasDerivAt b + ((hasDerivAt_const b x).prodMk (hasDerivAt_id b)) + exact hd.deriv.symm + + + +omit [SecondCountableTopology E] in +theorem exists_smoothTest_of_compact (F : E × ℝ → ℝ) + (hF : ContDiff ℝ ∞ F) (hK : HasCompactSupport F) : + ∃ A : SmoothTest E, A.F = fun x b => F (x,b) := by + let D : E × ℝ → E →L[ℝ] ℝ := fun q => + (fderiv ℝ F q).comp (ContinuousLinearMap.inl ℝ E ℝ) + have hD : ContDiff ℝ ∞ D := + (contDiff_infty_iff_fderiv.mp hF).2.clm_comp contDiff_const + have hDK : HasCompactSupport D := by + exact (hK.fderiv ℝ).comp_left (g := fun A : E × ℝ →L[ℝ] ℝ => A.comp (ContinuousLinearMap.inl ℝ E ℝ)) (show (0 : E × ℝ →L[ℝ] ℝ).comp (ContinuousLinearMap.inl ℝ E ℝ) = 0 from rfl) + obtain ⟨C₀,hC₀⟩ := hK.exists_bound_of_continuous hF.continuous + obtain ⟨C₁,hC₁⟩ := (driverJets_compact hK 1).exists_bound_of_continuous + (driverJets_smooth hF 1).continuous + obtain ⟨C₂,hC₂⟩ := (driverJets_compact hK 2).exists_bound_of_continuous + (driverJets_smooth hF 2).continuous + obtain ⟨C₃,hC₃⟩ := (driverJets_compact hK 3).exists_bound_of_continuous + (driverJets_smooth hF 3).continuous + obtain ⟨Cx,hCx⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hDK hD (by simp) + obtain ⟨Cc,hCc⟩ := ContDiff.lipschitzWith_of_hasCompactSupport (driverJets_compact hK 2) + (driverJets_smooth hF 2) (by simp) + have hj1 (x : E) (b : ℝ) : driverJets F 1 (x,b) = deriv (fun c => F (x,c)) b := by + simpa using driverJets_restriction hF 1 x b + have hj2 (x : E) (b : ℝ) : driverJets F 2 (x,b) = deriv (deriv (fun c => F (x,c))) b := by + simpa only [iteratedDeriv_succ,iteratedDeriv_zero] using driverJets_restriction hF 2 x b + refine ⟨{ + F := fun x b => F (x,b) + D := fun x b => D (x,b) + C₀ := C₀ + C₁ := C₁ + C₂ := C₂ + C₃ := max C₃ 0 + Cx := Cx + Ccross := Cc + hC₃ := le_max_right _ _ + hCx := Cx.coe_nonneg + hCcross := Cc.coe_nonneg + cF := hF.continuous + mF := hF.continuous.measurable + mB1 := ?_ + mB2 := ?_ + hD := ?_ + hsm := ?_ + hF := ?_ + hB1 := ?_ + hB2 := ?_ + hB3 := ?_ + hLipD := ?_ + hLipB2 := ?_ }, rfl⟩ + · convert! (driverJets_smooth hF 1).continuous.measurable using 1 + funext q + exact (hj1 q.1 q.2).symm + · convert! (driverJets_smooth hF 2).continuous.measurable using 1 + funext q + exact (hj2 q.1 q.2).symm + · intro x b + have hi : HasFDerivAt (fun y : E => (y,b)) (ContinuousLinearMap.inl ℝ E ℝ) x := by + convert! (hasFDerivAt_id x).prodMk (hasFDerivAt_const b x) using 1 + exact ((hF.differentiable (by simp) (x,b)).hasFDerivAt).comp x hi + · intro x + exact (hF.comp (contDiff_const.prodMk contDiff_id)).of_le (WithTop.coe_le_coe.mpr le_top) + · intro x b + simpa only [Real.norm_eq_abs] using hC₀ (x,b) + · intro x b + simpa only [hj1,Real.norm_eq_abs] using hC₁ (x,b) + · intro x b + simpa only [hj2,Real.norm_eq_abs] using hC₂ (x,b) + · intro x b + rw [← driverJets_restriction hF 3 x b,← Real.norm_eq_abs] + exact (hC₃ (x,b)).trans (le_max_left _ _) + · intro x y b + simpa [Prod.norm_def] using hCx.norm_sub_le (x,b) (y,b) + · intro x y b + simpa [hj2,Prod.norm_def,Real.norm_eq_abs] using hCc.norm_sub_le (x,b) (y,b) + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.Localization +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] + + + +theorem compact_extension {K O : Set E} (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) + (f : E → F) (hf : ContDiffOn ℝ ∞ f O) : + ∃ g : E → F, ContDiff ℝ ∞ g ∧ HasCompactSupport g ∧ ∀ x ∈ K, g =ᶠ[𝓝 x] f := by + obtain ⟨L,hL,hKL,hLO⟩ := exists_compact_between hK hO hKO + obtain ⟨φ,hφ1,hφ0,hφbound⟩ := + exists_contMDiffMap_one_nhds_of_subset_interior (𝓘(ℝ,E)) hK.isClosed hKL (n := ⊤) + have hφsmooth : ContDiff ℝ ∞ (φ : E → ℝ) := contMDiff_iff_contDiff.mp φ.contMDiff + have hsupp : tsupport (φ : E → ℝ) ⊆ L := by + apply closure_minimal _ hL.isClosed + intro x hx + by_contra hn + exact hx (hφ0 x hn) + have hφK : HasCompactSupport (φ : E → ℝ) := hL.of_isClosed_subset isClosed_closure hsupp + refine ⟨fun x => φ x • f x,?_,hφK.smul_right,?_⟩ + · apply contDiff_iff_contDiffAt.mpr + intro x + by_cases hx : x ∈ tsupport (φ : E → ℝ) + · exact hφsmooth.contDiffAt.smul ((hf x (hLO (hsupp hx))).contDiffAt (hO.mem_nhds (hLO (hsupp hx)))) + · have he : (φ : E → ℝ) =ᶠ[𝓝 x] 0 := by + exact (notMem_tsupport_iff_eventuallyEq.mp hx) + apply (contDiffAt_const (c := (0 : F))).congr_of_eventuallyEq + filter_upwards [he] with y hy + simp [hy] + · intro x hx + have hnear : ∀ᶠ y in 𝓝 x, φ y = 1 := hφ1.filter_mono (nhds_le_nhdsSet hx) + filter_upwards [hnear] with y hy + simp [hy] + +end SLEExactGauge.Localization + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +end SLEExactGauge.BrownianCalculus +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ExactGaugeEndpoint.lean b/lean/OAI/Probability/SLEGauge/ExactGaugeEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc4d452338e73d234e26681c1b9f023948d966a0 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ExactGaugeEndpoint.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.CleanupCost + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart CenteredMoments BoxGrid + +lemma allFrontiers_im_nonneg (a : ℝ) (b : GDriver) {z : ℂ} + (hz : z∈allFrontiers a b) : 0≤z.im := by + obtain ⟨T,hT⟩ := mem_iUnion.mp hz + exact closure_minimal (fun w hw=>(alive_initial_im hw).le) + (isClosed_le continuous_const Complex.continuous_im) (frontier_subset_closure hT) + +lemma compact_subset_integer_box (K : Set ℂ) (hK : IsCompact K) + (hH : ∀z∈K,0≤z.im) : ∃m : ℕ,K⊆box m := by + obtain ⟨R,hR⟩ := (Metric.isBounded_iff_subset_closedBall (0:ℂ)).mp hK.isBounded + obtain ⟨m,hm⟩ := exists_nat_gt R + refine ⟨m,fun z hz=>?_⟩ + have hn : ‖z‖≤(m:ℝ) := (by simpa only [mem_closedBall,dist_zero_right] using hR hz : ‖z‖≤R).trans hm.le + have hx := abs_le.mp ((Complex.abs_re_le_norm z).trans hn) + have hy := (le_abs_self z.im).trans ((Complex.abs_im_le_norm z).trans hn) + exact ⟨hx,⟨hH z hz,hy⟩⟩ + +lemma capacity_dimension_eq (κ : ℝ) (_hκ : 0<κ) : + dimension κ = 2-alpha (Target.a κ) := by + unfold dimension alpha Target.a + field_simp + ring + +namespace Target + + + +theorem exactHausdorffGauge : + ∀ κ : ℝ, 0 < κ → κ < 8 → + ∃ h : ℝ → ℝ, IsHausdorffGauge h ∧ + ∀ W : WienerLaw, IsWiener W → + ∀ᵐ b ∂W, ∀ s t : ℝ, 0 < s → s < t → + 0 < hausdorff h ((trace κ b) '' Icc s t) ∧ + hausdorff h ((trace κ b) '' Icc s t) < ∞ := by + intro κ hκ hκ8 + refine ⟨parameterMomentGauge κ hκ hκ8,parameterMomentGauge_admissible κ hκ hκ8,?_⟩ + intro W hW + let : IsProbabilityMeasure W := hW.isGaussianProcess.isProbabilityMeasure + let : IsProbabilityMeasure (W.map driverHomeomorph) := inferInstance + obtain ⟨M,hM⟩ := parameterMomentGauge_model κ hκ hκ8 W hW + rw [hM,capacity_dimension_eq κ hκ] + have hB := brownian_map_driver W hW + have hl := driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mp (M.hausdorff_positive hκ hB) + have hu := driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mp (M.frontier_boxes_finite hB) + filter_upwards [hl,hu,trace_regular_actual_domains hκ hκ8 hW] with b hl hu hreg + intro s t hs hst + refine ⟨?_,?_⟩ + · simpa only [show driverMeasurableEquiv b=driverHomeomorph b from rfl, + Homeomorph.symm_apply_apply] using hl s t hs hst + · let K := trace κ b '' Icc s t + have hK : IsCompact K := isCompact_Icc.image_of_continuousOn + (hreg.1.mono (fun u hu=>hs.le.trans hu.1)) + have hKF : K⊆allFrontiers (a κ) (driverHomeomorph b) := by + rintro z ⟨u,hu,rfl⟩ + exact mem_iUnion.mpr ⟨(κ*u).toNNReal,hreg.2.1 u (hs.le.trans hu.1)⟩ + obtain ⟨m,hm⟩ := compact_subset_integer_box K hK + (fun z hz=>allFrontiers_im_nonneg _ _ (hKF hz)) + exact (hausdorff (M.gauge (2-alpha (a κ)))).mono + (subset_inter hKF hm) |>.trans_lt (hu m) + +end Target +end SLEExactGauge +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/FiniteAngleEigen.lean b/lean/OAI/Probability/SLEGauge/FiniteAngleEigen.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2d162b567268c2537ff68aad86bc7939f4614b2 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/FiniteAngleEigen.lean @@ -0,0 +1,535 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.GlobalAngleBudget +import OAI.Probability.SLEGauge.JacobiKernel + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator ExactSLEMain + +def angleEigenCutoff (g : ℝ → ℝ) (a cap lam ε : ℝ) (N : ℝ≥0) (v : State) : ℝ := + greenCutoff a ε N v * (clockExp a cap lam v * angleLift g v) + +lemma angleEigenCutoff_smooth (g : ℝ → ℝ) + (hg : ∀ θ ∈ Ioo 0 Real.pi, ContDiffAt ℝ (↑(⊤ : ℕ∞)) g θ) + (a cap lam ε : ℝ) (hε : 0<ε) (N : ℝ≥0) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (angleEigenCutoff g a cap lam ε N) := by + rw [contDiff_iff_contDiffAt] + intro v + by_cases hv : 0 physicalGreen a w * (clockExp a cap lam w * angleLift g w) := + (greenCutoff_eq_near a ε hε N v hv hy).mul (EventuallyEq.refl _ _) + +lemma angleEigenCutoff_generator (g : ℝ → ℝ) + (hg : ∀ θ ∈ Ioo 0 Real.pi, ContDiffAt ℝ 2 g θ) + (a cap lam ε : ℝ) (ha : a≠0) + (heigen : ∀ θ ∈ Ioo 0 Real.pi, angleGenerator (2*a) g θ = -lam*g θ) + (hε : 0<ε) (N : ℝ≥0) (v : State) (hv : ‖v‖≤N) (hy : ε≤Y v) : + generator (angleEigenCutoff g a cap lam ε N) (cutoffDrift a ε) noise v = 0 := by + have he := angleEigenCutoff_eq_near g a cap lam ε hε N v hv hy + have hd : (fun w => fderiv ℝ (angleEigenCutoff g a cap lam ε N) w noise) =ᶠ[𝓝 v] + (fun w => fderiv ℝ (fun u => physicalGreen a u * + (clockExp a cap lam u * angleLift g u)) w noise) := + he.fderiv.mono (fun w hw => congrArg (fun f : State →L[ℝ] ℝ => f noise) hw) + change (1/2:ℝ) * fderiv ℝ (fun w => fderiv ℝ + (angleEigenCutoff g a cap lam ε N) w noise) v noise + + fderiv ℝ (angleEigenCutoff g a cap lam ε N) v (cutoffDrift a ε v) = 0 + rw [hd.fderiv_eq,he.fderiv_eq,cutoffDrift_eq_physical a ε v hy] + change L (fun w => physicalGreen a w * (clockExp a cap lam w * angleLift g w)) + (physicalDrift a v) noise v = 0 + rw [green_exponential_angle_generator g a cap lam ha v (hε.trans_le hy) + (hg _ (physicalTheta_mem v)),heigen _ (physicalTheta_mem v)] + ring + + +theorem local_angle_eigen (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (g : ℝ → ℝ) (hg : ∀ θ ∈ Ioo 0 Real.pi, ContDiffAt ℝ (↑(⊤ : ℕ∞)) g θ) + (a cap lam ε : ℝ) (ha : a≠0) + (heigen : ∀ θ ∈ Ioo 0 Real.pi, angleGenerator (2*a) g θ = -lam*g θ) + (hε : 0<ε) (z : ℂ) (N B : ℝ≥0) (T : ExactSLEGenerator.Driver → ℝ≥0) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hTB : ∀ b, T b≤B) + (hsafe : ∀ b t, t≤T b → ε≤Y (localState a ε hε z t b) ∧ + ‖localState a ε hε z t b‖≤N) : + Integrable (fun b => physicalGreen a (localState a ε hε z (T b) b) * + (clockExp a cap lam (localState a ε hε z (T b) b) * + angleLift g (localState a ε hε z (T b) b))) W ∧ + (∫ b, physicalGreen a (localState a ε hε z (T b) b) * + (clockExp a cap lam (localState a ε hε z (T b) b) * + angleLift g (localState a ε hε z (T b) b)) ∂W) = + physicalGreen a (z,0) * (clockExp a cap lam (z,0) * angleLift g (z,0)) := by + let V := localState a ε hε z + let f := angleEigenCutoff g a cap lam ε N + let D := generator f (cutoffDrift a ε) noise + have hf := angleEigenCutoff_smooth g hg a cap lam ε hε N + have hfc := angleEigenCutoff_compact g a cap lam ε N + have he (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t≤T b) : + f (V t b) = physicalGreen a (V t b) * (clockExp a cap lam (V t b)*angleLift g (V t b)) := + (angleEigenCutoff_eq_near g a cap lam ε hε N _ (hsafe b t ht).2 + (hsafe b t ht).1).eq_of_nhds + have hgen (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t≤T b) : D (V t b)=0 := + angleEigenCutoff_generator g (fun θ hθ => (hg θ hθ).of_le (by norm_cast)) + a cap lam ε ha heigen hε N _ (hsafe b t ht).2 (hsafe b t ht).1 + have hDy := compact_test_stopped_dynkin W hW V + (localState_continuous a ε hε z) (localState_adapted a ε hε z) + (cutoffDrift a ε) (cutoffDrift_lipschitz a ε hε).continuous + (max (|a|/ε) (|a|/ε^2)) (by positivity) (cutoffDrift_bound a ε hε) noise + (by simp [noise,Prod.norm_def]) (localState_eq a ε hε z) f hf hfc T B hT hTB + have hzero (b : ExactSLEGenerator.Driver) : (∫ u in (0:ℝ)..(T b : ℝ), generator f (cutoffDrift a ε) noise (V u.toNNReal b)) = 0 := by + rw [intervalIntegral.integral_of_le (T b).coe_nonneg] + apply setIntegral_eq_zero_of_forall_eq_zero + intro u hu + exact hgen b u.toNNReal (by simpa using Real.toNNReal_le_toNNReal hu.2) + have hinit (b : ExactSLEGenerator.Driver) : f (V 0 b) = + physicalGreen a (z,0)*(clockExp a cap lam (z,0)*angleLift g (z,0)) := by + rw [he b 0 bot_le] + simp only [V,localState_zero] + refine ⟨by simpa only [he _ _ le_rfl] using hDy.1, ?_⟩ + have hd := hDy.2.2 + simp_rw [hinit,he _ _ le_rfl,hzero] at hd + simpa only [integral_const,probReal_univ,one_smul,integral_zero,add_zero] using hd + + + +theorem finite_level_angle_eigen (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (g : ℝ → ℝ) (hg : ∀ θ ∈ Ioo 0 Real.pi, ContDiffAt ℝ (↑(⊤ : ℕ∞)) g θ) + (C : ℝ) (hC : 0≤C) (hbound : ∀ θ ∈ Ioo 0 Real.pi, ‖g θ‖≤C) + (a lam : ℝ) (ha : 1/4 radialTestWeight a (angleLift g) b.1 z + (levelRadius a (2*z.im) s)) W ∧ + (∫ b, radialTestWeight a (angleLift g) b.1 z + (levelRadius a (2*z.im) s) ∂W) = + physicalGreen a (z,0) * Real.exp (-lam*s) * g (physicalTheta (z,0)) := by + have ha0 : 0 f n b) atTop (𝓝 (F b)) := by + by_cases ht : radialTime a b.1 z ρ=∞ + · have hF : F b=0 := by simp only [F,radialTestWeight,ite_eq_left ht,mul_zero] + rw [hF] + have hG := radialApproximation_tendsto a ha ha0 z hz ρ hρ hr b + have hG0 : radialWeight a b.1 z ρ=0 := by simp only [radialWeight,ite_eq_left ht] + rw [hG0] at hG + apply tendsto_zero_iff_norm_tendsto_zero.mpr + apply squeeze_zero (fun n => norm_nonneg _) (fun n => hb n b) + simpa only [zero_mul] using hG.mul_const (Real.exp (lam*s)*C) + · apply tendsto_const_nhds.congr' + filter_upwards [radialStop_eventually_eq a ha0 z hz ρ hρ hr b ht] with n hn + have he : T n b=(radialTime a b.1 z ρ).toNNReal := by + have hh := congrArg ENNReal.toNNReal hn + simpa only [ENNReal.toNNReal_coe] using hh + have hv : V n b=actualState a b.1 (radialTime a b.1 z ρ).toNNReal z := by + rw [←(hact n b).2,he] + have hclock : physicalClock a cap (V n b)=s := by + rw [hv,actual_physicalClock_at a ha0 z hz cap ρ hcap hρ hr b ht] + exact levelRadius_clock ha0.ne' hcap + dsimp only [f,F] + rw [clockExp,hclock,radialTestWeight,ite_eq_right ht,hv] + ring + let bound := Real.exp (-alpha a*Real.log ρ)*(Real.exp (lam*s)*C) + have hbnd (n : ℕ) : ∀ᵐ b ∂W, ‖f n b‖≤bound := Eventually.of_forall fun b => + (hb n b).trans (mul_le_mul_of_nonneg_right + (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).2 + (mul_nonneg (Real.exp_pos _).le hC)) + have hFm : AEStronglyMeasurable F W := aestronglyMeasurable_of_tendsto_ae + atTop (fun n => (hfi n).1.aestronglyMeasurable) + (Eventually.of_forall hlim) + have hFi : Integrable F W := Integrable.of_bound hFm bound (by + filter_upwards [] with b + exact le_of_tendsto (hlim b).norm (Eventually.of_forall fun n => + (hb n b).trans (mul_le_mul_of_nonneg_right + (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).2 + (mul_nonneg (Real.exp_pos _).le hC)))) + have hexp : Real.exp (-lam*s)*Real.exp (lam*s)=1 := by + rw [←Real.exp_add] + convert Real.exp_zero using 1 + ring_nf + have hconst : (fun b : ExactSLEGenerator.Driver => radialTestWeight a (angleLift g) b.1 z ρ) = + fun b => Real.exp (-lam*s)*F b := by + funext b + dsimp only [F] + rw [←mul_assoc,hexp,one_mul] + have hint : (∫ b, F b ∂W)=physicalGreen a (z,0)*angleLift g (z,0) := by + have hconv := tendsto_integral_of_dominated_convergence (fun _ : ExactSLEGenerator.Driver => bound) + (fun n => (hfi n).1.aestronglyMeasurable) (integrable_const bound) hbnd + (Eventually.of_forall hlim) + apply tendsto_nhds_unique hconv + simpa only [(hfi _).2] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => physicalGreen a (z,0)*angleLift g (z,0)) + atTop (𝓝 (physicalGreen a (z,0)*angleLift g (z,0)))) + change Integrable (fun b : ExactSLEGenerator.Driver => radialTestWeight a (angleLift g) b.1 z ρ) W ∧ _ + rw [hconst] + refine ⟨hFi.const_mul _, ?_⟩ + rw [integral_const_mul,hint] + dsimp only [angleLift] + ring + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open Polynomial MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.Jacobi +open ExactSLEGreen ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator ExactSLEMain + +def anglePoly (nu : ℝ) (n : ℕ) (θ : ℝ) : ℝ := (poly nu n).eval (Real.cos θ) + +lemma eval_cos_deriv (p : ℝ[X]) (θ : ℝ) : + deriv (fun θ => p.eval (Real.cos θ)) θ = p.derivative.eval (Real.cos θ)*(-Real.sin θ) := + ((p.hasDerivAt (Real.cos θ)).comp θ (Real.hasDerivAt_cos θ)).deriv + +lemma eval_cos_second (p : ℝ[X]) (θ : ℝ) : + deriv (deriv (fun θ => p.eval (Real.cos θ))) θ = + p.derivative.derivative.eval (Real.cos θ)*Real.sin θ^2 + -p.derivative.eval (Real.cos θ)*Real.cos θ := by + have he : deriv (fun θ => p.eval (Real.cos θ)) = + fun θ => p.derivative.eval (Real.cos θ)*(-Real.sin θ) := funext (eval_cos_deriv p) + rw [he] + have hd := (((p.derivative.hasDerivAt (Real.cos θ)).comp θ (Real.hasDerivAt_cos θ)).mul + (Real.hasDerivAt_sin θ).neg).deriv + change deriv (fun θ => p.derivative.eval (Real.cos θ)*(-Real.sin θ)) θ = _ at hd + rw [hd] + dsimp only [Function.comp_apply, Pi.neg_apply] + ring + +lemma angleGenerator_poly (p : ℝ[X]) (nu : ℝ) (θ : ℝ) (hθ : 0 p.eval (Real.cos θ)) θ = + (operator nu p).eval (Real.cos θ)/2 := by + rw [angleGenerator,eval_cos_second,eval_cos_deriv] + simp only [operator,eval_sub,eval_mul,eval_pow,eval_one,eval_X,eval_C,Real.cot_eq_cos_div_sin] + have hid := Real.sin_sq_add_cos_sq θ + field_simp + linear_combination p.derivative.derivative.eval (Real.cos θ) * hid + +lemma anglePoly_smooth (nu : ℝ) (n : ℕ) : ContDiff ℝ (↑(⊤ : ℕ∞)) (anglePoly nu n) := by + change ContDiff ℝ _ ((fun x : ℝ => (poly nu n).eval x) ∘ Real.cos) + have hp (p : ℝ[X]) : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun x : ℝ => p.eval x) := by + induction p using Polynomial.induction_on' with + | add p q hp hq => simpa only [eval_add] using hp.add hq + | monomial n c => + simp only [eval_monomial] + exact (contDiff_const (c:=c)).mul (contDiff_id.pow n) + exact (hp _).comp Real.contDiff_cos + +lemma anglePoly_bound (nu : ℝ) (hnu : 0 b.1 t) W) + (a : ℝ) (ha : 1/4 + radialTestWeight a (angleLift (anglePoly (4*a) n)) b.1 z (levelRadius a (2*z.im) s)) W ∧ + (∫ b, radialTestWeight a (angleLift (anglePoly (4*a) n)) b.1 z (levelRadius a (2*z.im) s) ∂W)= + physicalGreen a (z,0)*Real.exp (-s*eigenvalue (4*a) n)* + (poly (4*a) n).eval (Real.cos (physicalTheta (z,0))) := by + simpa only [mul_comm (eigenvalue (4*a) n) s,neg_mul,anglePoly] using + finite_level_angle_eigen W hW (anglePoly (4*a) n) + (fun θ _ => (anglePoly_smooth (4*a) n).contDiffAt) (2^n) (by positivity) + (fun θ _ => anglePoly_bound (4*a) (by linarith) n θ) a (eigenvalue (4*a) n) ha + (eigenvalue_nonneg (4*a) (by linarith) n) (anglePoly_eigen a n) z hz s hs + +end SLEExactGauge.Jacobi +end +end + + + +section + + +noncomputable section +open Polynomial MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.Jacobi +open ExactSLEGreen ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator ExactSLEMain + +lemma radialState_measurable (a : ℝ) (ha : 0 radialState a b.1 z ρ) := by + have he : z.im*(ρ/z.im)=ρ := mul_div_cancel₀ _ hz.ne' + simpa only [Function.comp_def, id_eq, he] using (joint_radialState_measurable a ha (ρ/z.im) (div_pos hρ hz) + ((div_le_one hz).mpr hr)).comp + (measurable_id.prodMk (measurable_const (a:= (⟨z,hz⟩ : UpperPlane)))) + +lemma radialWeight_measurable (a : ℝ) (ha : 1/4 radialWeight a b.1 z ρ) := by + have he : z.im*(ρ/z.im)=ρ := mul_div_cancel₀ _ hz.ne' + simpa only [Function.comp_def, id_eq, he] using (joint_radialWeight_measurable a ha (ρ/z.im) (div_pos hρ hz) + ((div_le_one hz).mpr hr)).comp + (measurable_id.prodMk (measurable_const (a:= (⟨z,hz⟩ : UpperPlane)))) + +def cosState (v : State) : Interval := + ⟨Real.cos (physicalTheta v),Real.neg_one_le_cos _,Real.cos_le_one _⟩ + +lemma cosState_measurable : Measurable cosState := by + unfold cosState physicalTheta + fun_prop + +def finiteCos (a : ℝ) (z : ℂ) (ρ : ℝ) (b : ExactSLEGenerator.Driver) : Interval := + cosState (radialState a b.1 z ρ) + +lemma finiteCos_measurable (a : ℝ) (ha : 0 b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 (poly (4*a) n).eval (w:ℝ)) (finiteCosLaw W a z s) := + ((poly (4*a) n).continuous.comp continuous_subtype_val).aestronglyMeasurable + rw [finiteCosLaw,integral_map (finiteCos_measurable a (by linarith) z hz ρ hρ hr).aemeasurable hf] + rw [radialLaw,integral_withDensity_eq_integral_toReal_smul + ((radialWeight_measurable a ha z hz ρ hρ hr).div_const _).ennreal_ofReal + (Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] + have hn (b : ExactSLEGenerator.Driver) : 0≤radialWeight a b.1 z ρ/physicalGreen a (z,0) := + div_nonneg (radialWeight_bound a ha z hz ρ hρ hr b).1 hG.le + simp_rw [ENNReal.toReal_ofReal (hn _),smul_eq_mul] + have he (b : ExactSLEGenerator.Driver) : + (radialWeight a b.1 z ρ/physicalGreen a (z,0))*(poly (4*a) n).eval (finiteCos a z ρ b:ℝ)= + radialTestWeight a (angleLift (anglePoly (4*a) n)) b.1 z ρ/physicalGreen a (z,0) := by + rw [radialTestWeight_eq_mul] + dsimp only [finiteCos,cosState,angleLift,anglePoly] + ring + simp_rw [he] + rw [integral_div,(finite_angle_poly W hW a ha z hz s hs n).2] + dsimp only [cosState] + field_simp + + + +theorem finiteCosLaw_eq_transition (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 linarith [Real.pi_pos]⟩ + +lemma arccosAngle_measurable : Measurable arccosAngle := by + suffices Measurable (fun x : Interval => (arccosAngle x : ℝ)) from this.subtype_mk + simp only [arccosAngle,apply_dite,dite_eq_ite] + exact (Real.continuous_arccos.measurable.comp measurable_subtype_coe).ite + ((Real.continuous_arccos.measurable.comp measurable_subtype_coe) measurableSet_Ioo) + measurable_const + +@[simp] lemma arccosAngle_angleCos (θ : Angle) : arccosAngle (angleCos θ)=θ := by + have hc : Real.arccos (Real.cos (θ:ℝ))=(θ:ℝ) := Real.arccos_cos θ.2.1.le θ.2.2.le + have hh : Real.arccos (angleCos θ : ℝ)∈Ioo 0 Real.pi := by + change Real.arccos (Real.cos (θ:ℝ))∈Ioo 0 Real.pi + rw [hc] + exact θ.2 + apply Subtype.ext + simp only [arccosAngle,dite_eq_left hh] + exact hc + +def angleState (v : State) : Angle := ⟨physicalTheta v,physicalTheta_mem v⟩ + +lemma angleState_measurable : Measurable angleState := by + unfold angleState physicalTheta + fun_prop + +lemma arccosAngle_cosState (v : State) : arccosAngle (cosState v)=angleState v := + arccosAngle_angleCos (angleState v) + +def finiteAngle (a : ℝ) (z : ℂ) (ρ : ℝ) (b : ExactSLEGenerator.Driver) : Angle := + angleState (radialState a b.1 z ρ) + +lemma finiteAngle_measurable (a : ℝ) (ha : 0 b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 (μ i).prod (ν i)) l (𝓝 (μ₀.prod ν₀)) := by + have hm : Tendsto (fun i => ((μ i).prod (ν i)).mass) l + (𝓝 (μ₀.mass * ν₀.mass)) := by + simp only [FiniteMeasure.mass_prod] + exact hμ.mass.mul hν.mass + by_cases hμ0 : μ₀ = 0 + · simp only [hμ0, FiniteMeasure.zero_mass, zero_mul] at hm + simpa only [hμ0, FiniteMeasure.zero_prod] using + FiniteMeasure.tendsto_zero_of_tendsto_zero_mass hm + by_cases hν0 : ν₀ = 0 + · simp only [hν0, FiniteMeasure.zero_mass, mul_zero] at hm + simpa only [hν0, FiniteMeasure.prod_zero] using + FiniteMeasure.tendsto_zero_of_tendsto_zero_mass hm + have : Nonempty X := by + by_contra h + have : IsEmpty X := not_nonempty_iff.mp h + exact hμ0 (Subtype.ext (Measure.eq_zero_of_isEmpty _)) + have : Nonempty Y := by + by_contra h + have : IsEmpty Y := not_nonempty_iff.mp h + exact hν0 (Subtype.ext (Measure.eq_zero_of_isEmpty _)) + have hp := ProbabilityMeasure.continuous_prod.tendsto + (μ₀.normalize, ν₀.normalize) |>.comp + ((μ₀.tendsto_normalize_of_tendsto hμ hμ0).prodMk_nhds + (ν₀.tendsto_normalize_of_tendsto hν hν0)) + have he (m : FiniteMeasure X) (n : FiniteMeasure Y) : + m.prod n = (m.mass * n.mass) • + (m.normalize.prod n.normalize).toFiniteMeasure := by + apply Subtype.ext + change m.toMeasure.prod n.toMeasure = + (((m.mass * n.mass) • (m.normalize.prod n.normalize).toFiniteMeasure).toMeasure) + rw [FiniteMeasure.toMeasure_smul] + change m.toMeasure.prod n.toMeasure = + (m.mass * n.mass) • (m.normalize.toMeasure.prod n.normalize.toMeasure) + have hm' := congrArg FiniteMeasure.toMeasure m.self_eq_mass_smul_normalize + have hn' := congrArg FiniteMeasure.toMeasure n.self_eq_mass_smul_normalize + simp only [FiniteMeasure.toMeasure_smul, + ProbabilityMeasure.toMeasure_comp_toFiniteMeasure_eq_toMeasure] at hm' hn' + calc + _ = (m.mass • m.normalize.toMeasure).prod (n.mass • n.normalize.toMeasure) := + congrArg₂ Measure.prod hm' hn' + _ = _ := by rw [Measure.prod_smul_left, Measure.prod_smul_right, smul_smul] + simp_rw [he] + exact (hμ.mass.mul hν.mass).smul + (ProbabilityMeasure.toFiniteMeasure_continuous.tendsto _ |>.comp hp) + +end SLEExactGauge.MassVersions +end + + + +section +open MeasureTheory Filter Topology Set CompactlySupported +open scoped ENNReal NNReal + +namespace SLEExactGauge.MassVersions + +variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] + +noncomputable def localizedFinite (μ : Measure X) [IsFiniteMeasureOnCompacts μ] + (φ : C_c(X,ℝ≥0)) : FiniteMeasure X := + ⟨μ.withDensity (fun x => φ x), isFiniteMeasure_withDensity (by + rw [lintegral_coe_eq_integral _ (by + have h : Integrable (fun x => φ.toReal x) μ := φ.toReal.integrable + simpa only [CompactlySupportedContinuousMap.toReal_apply] using h)] + exact ENNReal.ofReal_ne_top)⟩ + +lemma localizedFinite_integral (μ : Measure X) [IsFiniteMeasureOnCompacts μ] + (φ : C_c(X,ℝ≥0)) (f : X → ℝ) : + (∫x, f x ∂localizedFinite μ φ) = ∫x, (φ x:ℝ)*f x ∂μ := by + exact integral_withDensity_eq_integral_smul φ.continuous.measurable f + + + +theorem localizedFinite_tendsto {I : Type*} {l : Filter I} + (μ : I → Measure X) (μ₀ : Measure X) + [∀ i, IsFiniteMeasureOnCompacts (μ i)] [IsFiniteMeasureOnCompacts μ₀] + (h : ∀ f : C_c(X,ℝ), Tendsto (fun i => ∫x,f x∂μ i) l (𝓝 (∫x,f x∂μ₀))) + (φ : C_c(X,ℝ≥0)) : + Tendsto (fun i => localizedFinite (μ i) φ) l (𝓝 (localizedFinite μ₀ φ)) := by + apply FiniteMeasure.tendsto_iff_forall_integral_tendsto.mpr + intro f + let F : C_c(X,ℝ) := f • φ.toReal + simpa only [localizedFinite_integral, F, CompactlySupportedContinuousMap.smulc_apply, + smul_eq_mul, CompactlySupportedContinuousMap.toReal_apply, mul_comm] using h F + + +theorem measure_le_of_nonnegative_compact_tests + [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + (μ ν : Measure X) [IsFiniteMeasureOnCompacts μ] [ν.OuterRegular] + (h : ∀ f : C_c(X,ℝ), (∀ x, 0≤f x) → + ENNReal.ofReal (∫x,f x∂μ) ≤ ∫⁻x, ENNReal.ofReal (f x)∂ν) : μ≤ν := by + have ho (U : Set X) (hU : IsOpen U) : μ U≤ν U := by + obtain ⟨f,hf,hf0,he⟩ := open_countable_tests U hU + rw [he μ inferInstance] + refine iSup_le (fun n => (h (f n) (fun x => (hf n x).1)).trans ?_) + calc + _ ≤ ∫⁻x, U.indicator (fun _ => (1:ℝ≥0∞)) x∂ν := by + apply lintegral_mono + intro x + by_cases hx : x∈U + · simp only [indicator_of_mem hx] + exact (ENNReal.ofReal_le_ofReal (hf n x).2).trans_eq (by simp) + · simp [hx, hf0 n hx] + _ = ν U := by simp [hU.measurableSet] + intro S + rw [S.measure_eq_iInf_isOpen ν] + exact le_iInf (fun U => le_iInf (fun hSU => le_iInf (fun hU => + (measure_mono hSU).trans (ho U hU)))) + +end SLEExactGauge.MassVersions +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] + + + +theorem bind_le_of_weak_limit (W : Measure Ω) + (μ : ℕ → Ω → FiniteMeasure X) (ν : Ω → FiniteMeasure X) + (hμ : ∀ n, Measurable (μ n)) (hν : Measurable ν) + (hconv : ∀ᵐ ω ∂W, Tendsto (fun n => μ n ω) atTop (𝓝 (ν ω))) + (Q : Measure X) [IsFiniteMeasure Q] [Q.OuterRegular] + (hb : ∀ n, W.bind (fun ω => (μ n ω).toMeasure) ≤ Q) : + W.bind (fun ω => (ν ω).toMeasure) ≤ Q := by + have hm (n : ℕ) : Measurable (fun ω => (μ n ω).toMeasure) := + measurable_subtype_coe.comp (hμ n) + have hn : Measurable (fun ω => (ν ω).toMeasure) := measurable_subtype_coe.comp hν + have ht (f : BoundedContinuousFunction X ℝ≥0) : + (∫⁻x, (f x : ℝ≥0∞) ∂W.bind (fun ω => (ν ω).toMeasure)) ≤ ∫⁻x, (f x : ℝ≥0∞) ∂Q := by + have hf : Measurable (fun x => (f x : ℝ≥0∞)) := f.continuous.measurable.coe_nnreal_ennreal + rw [Measure.lintegral_bind hn.aemeasurable hf.aemeasurable] + calc + _ = ∫⁻ω, liminf (fun n => ∫⁻x, (f x : ℝ≥0∞) ∂(μ n ω)) atTop ∂W := by + apply lintegral_congr_ae + filter_upwards [hconv] with ω hω + exact (FiniteMeasure.tendsto_iff_forall_lintegral_tendsto.mp hω f).liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ω, ∫⁻x, (f x : ℝ≥0∞) ∂(μ n ω) ∂W) atTop := + lintegral_liminf_le (fun n => (Measure.measurable_lintegral hf).comp (hm n)) + _ ≤ ∫⁻x, (f x : ℝ≥0∞) ∂Q := by + have hh (n : ℕ) : (∫⁻ω, ∫⁻x, (f x : ℝ≥0∞) ∂(μ n ω) ∂W) ≤ ∫⁻x, (f x : ℝ≥0∞) ∂Q := by + rw [← Measure.lintegral_bind (hm n).aemeasurable hf.aemeasurable] + exact lintegral_mono' (hb n) le_rfl + simpa only [liminf_const] using liminf_le_liminf (f := atTop) (Eventually.of_forall hh) + have havg : IsFiniteMeasure (W.bind (fun ω => (ν ω).toMeasure)) := by + constructor + have h := ht (BoundedContinuousFunction.const X 1) + simp only [BoundedContinuousFunction.const_apply, ENNReal.coe_one, lintegral_one] at h + exact h.trans_lt (measure_lt_top Q univ) + apply measure_le_of_nonnegative_compact_tests + intro f hf + rw [ofReal_integral_eq_lintegral_ofReal f.integrable (Eventually.of_forall hf)] + exact ht f.nnrealPart.toBoundedContinuousFunction + + + +theorem average_prod_le_of_weak_limit + [TopologicalSpace.PseudoMetrizableSpace X] + (W : Measure Ω) (μ : ℕ → Ω → FiniteMeasure X) (ν : Ω → FiniteMeasure X) + (hμ : ∀ n, Measurable (μ n)) (hν : Measurable ν) + (hconv : ∀ᵐ ω ∂W, Tendsto (fun n => μ n ω) atTop (𝓝 (ν ω))) + (Q : Measure (X × X)) [IsFiniteMeasure Q] [Q.OuterRegular] + (hb : ∀ n, W.bind (fun ω => (μ n ω).toMeasure.prod (μ n ω).toMeasure) ≤ Q) : + W.bind (fun ω => (ν ω).toMeasure.prod (ν ω).toMeasure) ≤ Q := by + apply bind_le_of_weak_limit W + (fun n ω => (μ n ω).prod (μ n ω)) (fun ω => (ν ω).prod (ν ω)) + (fun n => (FiniteMeasure.measurable_fun_prod.comp ((hμ n).prodMk (hμ n))).subtype_mk) + ((FiniteMeasure.measurable_fun_prod.comp (hν.prodMk hν)).subtype_mk) _ Q hb + filter_upwards [hconv] with ω hω + exact tendsto_finiteMeasure_prod hω hω + + + +omit [LocallyCompactSpace X] in +theorem ae_nullSingleton_of_average_prod_diagonal [LocallyCompactSpace X] + (W : Measure Ω) (ν : Ω → FiniteMeasure X) (hν : Measurable ν) + (hdiag : W.bind (fun ω => (ν ω).toMeasure.prod (ν ω).toMeasure) (diagonal X) = 0) : + ∀ᵐ ω ∂W, NullSingletonClass (ν ω).toMeasure := by + have hm : Measurable (fun ω => (ν ω).toMeasure.prod (ν ω).toMeasure) := + FiniteMeasure.measurable_fun_prod.comp (hν.prodMk hν) + have hd : MeasurableSet (diagonal X) := isClosed_diagonal.measurableSet + rw [Measure.bind_apply hd hm.aemeasurable] at hdiag + have hae := (lintegral_eq_zero_iff' ((Measure.measurable_coe hd).comp hm).aemeasurable).mp hdiag + filter_upwards [hae] with ω hω + constructor + intro x + apply mul_self_eq_zero.mp + apply le_antisymm _ bot_le + have hsub : ({x} : Set X) ×ˢ {x} ⊆ diagonal X := by + rintro p ⟨hp,hq⟩ + simp only [mem_singleton_iff] at hp hq + exact hp.trans hq.symm + simpa only [Measure.prod_prod, Pi.zero_apply, bot_eq_zero] using + (measure_mono (μ := (ν ω).toMeasure.prod (ν ω).toMeasure) hsub).trans_eq hω + + + +omit [LocallyCompactSpace X] in +lemma diagonal_null_of_ac_prod [LocallyCompactSpace X] + (V : Measure X) [SFinite V] [NullSingletonClass V] + (Q : Measure (X × X)) (hQ : Q ≪ V.prod V) : Q (diagonal X) = 0 := by + apply hQ + rw [Measure.prod_apply isClosed_diagonal.measurableSet] + have he (x : X) : Prod.mk x ⁻¹' diagonal X = {x} := by ext y; simp [diagonal, eq_comm] + simp_rw [he, measure_singleton, lintegral_zero] + +end SLEExactGauge.MassVersions +end + + + +section +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEKernel + + + +theorem actual_mixed_density_product_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ (x : Fin m → UpperPlane) (c : ℝ), 0 (x i).1) := by + obtain ⟨C,hC,hCb⟩ := actual_density_product_bound a ha m + refine ⟨C,hC,?_⟩ + intro W hprob hW x c hc hcx q hq hq1 t + let z : Fin m → ℂ := fun i => (x i).1 + have hz (i) : 0<(z i).im := (x i).2 + apply (lintegral_mono (fun b => Finset.prod_le_prod + (fun i _ => timeMassDensity_le a (q i) (t i) b (z i)))).trans + by_cases hinj : Function.Injective z + · let cap := fun i => cappedDistance c z i + let target := fun i => 2*(z i).im*q i + have hcap (i) : 0 ⟨hcap i,(cappedDistance_le c z i).trans (hcx i)⟩) + (fun i j hij => by simpa [dist_eq_norm] using cappedDistance_le_dist c z i j hij.symm) ht + have he (b : ExactSLEGenerator.Driver) (i) : massDensity a (q i) b (z i)= + ENNReal.ofReal (fullRadialDensity a b.1 (z i) (target i)) := by + simp [massDensity,hz i,target] + simp_rw [he] + have hk : ENNReal.ofReal (C*∏ i, cap i^(-alpha a))=ENNReal.ofReal C*kernel (alpha a) c z := by + rw [ENNReal.ofReal_mul hC.le,ENNReal.ofReal_prod_of_nonneg + (fun i _ => Real.rpow_nonneg (hcap i).le _)] + congr 1 + unfold kernel + apply Finset.prod_congr rfl + intro i _ + exact (ENNReal.ofReal_rpow_of_pos (hcap i)).symm + exact hh.trans_eq hk + · rw [kernel_top_of_not_injective (alpha a) c (alpha_pos ha) hc z hinj, + ENNReal.mul_top (ne_of_gt (ENNReal.ofReal_pos.mpr hC))] + exact le_top + + +def pairKernel (α c : ℝ) (p : UpperPlane × UpperPlane) : ℝ≥0∞ := + kernel α c (fun i => (MeasurableEquiv.finTwoArrow.symm p i).1) + +lemma pairKernel_measurable (α c : ℝ) (hα : 0≤α) : Measurable (pairKernel α c) := + (measurable_kernel hα c).comp (by + apply Measurable.of_eval + intro i + exact measurable_subtype_coe.comp + ((measurable_pi_apply i).comp MeasurableEquiv.finTwoArrow.symm.measurable)) + +lemma pairKernel_integrable_on_compact (α c : ℝ) (hα : 0<α) (hα1 : α<1) + (hc : 0 kernel α c (MeasurableEquiv.finTwoArrow.symm p) + have hF : Measurable F := (measurable_kernel hα.le c).comp + MeasurableEquiv.finTwoArrow.symm.measurable + have he (x y : UpperPlane) : pairKernel α c (x,y)=F (x.1,y.1) := by + unfold pairKernel F + congr 1 + funext i + fin_cases i <;> rfl + rw [←Measure.prod_restrict,lintegral_prod _ (pairKernel_measurable α c hα.le).aemeasurable] + simp_rw [he] + have hsub (x : ℂ) : (∫⁻ y in K, F (x,y.1) ∂upperArea) = + ∫⁻ y in Subtype.val '' K, F (x,y) := + setLIntegral_subtype upperPlane_open.measurableSet K (fun y => F (x,y)) + simp_rw [hsub] + rw [show (∫⁻ x in K, ∫⁻ y in Subtype.val '' K, F (x.1,y) ∂volume ∂upperArea) = + ∫⁻ x in Subtype.val '' K, ∫⁻ y in Subtype.val '' K, F (x,y) ∂volume ∂volume from + setLIntegral_subtype (μ := (volume : Measure ℂ)) upperPlane_open.measurableSet K + (fun x => ∫⁻y in Subtype.val '' K, F (x,y))] + rw [←lintegral_prod _ hF.aemeasurable, + (measurePreserving_finTwoArrow (volume.restrict (Subtype.val '' K))).symm.lintegral_comp + (measurable_kernel hα.le c)] + exact capped_distance_kernel_integral α c hα hα1 hc 2 (Subtype.val '' K) + (hK.image continuous_subtype_val).measurableSet (hK.image continuous_subtype_val).isBounded + +instance upperArea_atomless : NullSingletonClass upperArea := by + constructor + intro z + rw [upperArea,upper_embedding.comap_apply] + simp + +end ExactSLEGreen +end +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + + + +lemma average_density_prod_le (W : Measure Ω) [SFinite W] + (V : Measure X) [SFinite V] (ρ : Ω → X → ℝ≥0∞) + (hρ : Measurable (Function.uncurry ρ)) (q : X × X → ℝ≥0∞) + (hb : ∀ x y, (∫⁻ω, ρ ω x * ρ ω y ∂W) ≤ q (x,y)) : + W.bind (fun ω => (V.withDensity (ρ ω)).prod (V.withDensity (ρ ω))) ≤ + (V.prod V).withDensity q := by + have hr : Measurable (fun p : Ω × (X × X) => ρ p.1 p.2.1 * ρ p.1 p.2.2) := + (hρ.comp (measurable_fst.prodMk measurable_snd.fst)).mul + (hρ.comp (measurable_fst.prodMk measurable_snd.snd)) + have he (ω : Ω) : (V.withDensity (ρ ω)).prod (V.withDensity (ρ ω)) = + (V.prod V).withDensity (fun p => ρ ω p.1 * ρ ω p.2) := + prod_withDensity (hρ.comp (measurable_const.prodMk measurable_id)) + (hρ.comp (measurable_const.prodMk measurable_id)) + simp_rw [he] + apply Measure.le_iff.mpr + intro S hS + rw [Measure.bind_apply hS (measurable_withDensity hr).aemeasurable] + simp_rw [withDensity_apply _ hS] + rw [lintegral_lintegral_swap hr.aemeasurable] + exact lintegral_mono (fun p => hb p.1 p.2) + + +lemma average_localized_density_prod_le [TopologicalSpace X] [BorelSpace X] + (W : Measure Ω) [SFinite W] (V : Measure X) [SFinite V] + (ρ : Ω → X → ℝ≥0∞) (hρ : Measurable (Function.uncurry ρ)) + (φ : C_c(X,ℝ≥0)) (q : X × X → ℝ≥0∞) + (hb : ∀ x∈tsupport φ,∀ y∈tsupport φ,(∫⁻ω,ρ ω x*ρ ω y∂W)≤q (x,y)) : + W.bind (fun ω => (V.withDensity (fun x => ρ ω x*(φ x:ℝ≥0∞))).prod + (V.withDensity (fun x => ρ ω x*(φ x:ℝ≥0∞)))) ≤ + (V.prod V).withDensity (fun p => (φ p.1:ℝ≥0∞)*(φ p.2:ℝ≥0∞)*q p) := by + have hφ : Measurable (fun x => (φ x:ℝ≥0∞)) := φ.continuous.measurable.coe_nnreal_ennreal + refine average_density_prod_le W V (fun ω x => ρ ω x*(φ x:ℝ≥0∞)) + (hρ.mul (hφ.comp measurable_snd)) _ ?_ + intro x y + by_cases hx : x∈tsupport φ + · by_cases hy : y∈tsupport φ + · have hm : Measurable (fun ω => ρ ω x*ρ ω y) := + (hρ.comp (measurable_id.prodMk measurable_const)).mul + (hρ.comp (measurable_id.prodMk measurable_const)) + have he (ω : Ω) : (ρ ω x*(φ x:ℝ≥0∞))*(ρ ω y*(φ y:ℝ≥0∞)) = + ((φ x:ℝ≥0∞)*(φ y:ℝ≥0∞))*(ρ ω x*ρ ω y) := by ac_rfl + simp_rw [he] + rw [lintegral_const_mul _ hm] + exact mul_le_mul' le_rfl (hb x hx y hy) + · simp [image_eq_zero_of_notMem_tsupport hy] + · simp [image_eq_zero_of_notMem_tsupport hx] + + +lemma convex_density_moment_le (W : Measure Ω) {ι : Type*} + (s : Finset ι) (c : ι → ℝ≥0∞) (hc : ∑i∈s,c i=1) + (f g : ι → Ω → ℝ≥0∞) (hf : ∀ i∈s,Measurable (f i)) + (hg : ∀ i∈s,Measurable (g i)) (Q : ℝ≥0∞) + (hb : ∀ i∈s,∀ j∈s,(∫⁻ω,f i ω*g j ω∂W)≤Q) : + (∫⁻ω,(∑i∈s,c i*f i ω)*(∑i∈s,c i*g i ω)∂W) ≤ Q := by + have he (ω : Ω) : (∑i∈s,c i*f i ω)*(∑i∈s,c i*g i ω) = + ∑i∈s,∑j∈s, (c i*c j)*(f i ω*g j ω) := by + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + ac_rfl + simp_rw [he] + rw [lintegral_finsetSum s (f := fun i ω => ∑j∈s, (c i*c j)*(f i ω*g j ω)) (fun i hi => + Finset.measurable_sum s (fun j hj => measurable_const.mul ((hf i hi).mul (hg j hj))))] + calc + _ = ∑i∈s,∑j∈s,(c i*c j)*(∫⁻ω,f i ω*g j ω∂W) := by + apply Finset.sum_congr rfl + intro i hi + rw [lintegral_finsetSum s (f := fun j ω => (c i*c j)*(f i ω*g j ω)) (fun j hj => measurable_const.mul ((hf i hi).mul (hg j hj)))] + apply Finset.sum_congr rfl + intro j hj + exact lintegral_const_mul _ ((hf i hi).mul (hg j hj)) + _ ≤ ∑i∈s,∑j∈s,(c i*c j)*Q := Finset.sum_le_sum (fun i hi => + Finset.sum_le_sum (fun j hj => mul_le_mul' le_rfl (hb i hi j hj))) + _ = Q := by simp only [←Finset.sum_mul,←Finset.mul_sum,hc,mul_one,one_mul] + +lemma measurable_localizedFinite [TopologicalSpace X] [BorelSpace X] + (μ : Ω → Measure X) [∀ ω, IsFiniteMeasureOnCompacts (μ ω)] + (hμ : Measurable μ) (φ : C_c(X,ℝ≥0)) : + Measurable (fun ω => localizedFinite (μ ω) φ) := by + apply Measurable.subtype_mk + apply Measure.measurable_of_measurable_coe + intro S hS + simp only [withDensity_apply _ hS] + simp_rw [←lintegral_indicator hS] + exact (Measure.measurable_lintegral + (φ.continuous.measurable.coe_nnreal_ennreal.indicator hS)).comp hμ + +end SLEExactGauge.MassVersions +end + + + +section +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEKernel SLEExactGauge.MassVersions + +def actualConvexMass (a : ℝ) (s : Finset ℕ) (c : ℕ → ℝ) + (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : Measure UpperPlane := + ∑j∈s, ENNReal.ofReal (c j) • actualUpperMass a (Real.exp (-2*a*((j:ℝ)+1))) t b + +def actualConvexDensity (a : ℝ) (s : Finset ℕ) (c : ℕ → ℝ) + (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) (z : UpperPlane) : ℝ≥0∞ := + ∑j∈s, ENNReal.ofReal (c j) * timeMassDensity a (Real.exp (-2*a*((j:ℝ)+1))) t b z.1 + +lemma actualConvexDensity_measurable (a : ℝ) (ha : 1/4 + timeMassDensity a (Real.exp (-2*a*((j:ℝ)+1))) t b z.1) := + (timeMassDensity_measurable a ha _ (Real.exp_pos _) (level_step_le_one a ha j) t).comp + (measurable_const.prodMk measurable_subtype_coe) + rw [lintegral_finsetSum s (f := fun j (z : UpperPlane) => ENNReal.ofReal (c j) * + timeMassDensity a (Real.exp (-2*a*((j:ℝ)+1))) t b z.1) + (fun j _ => measurable_const.mul (hm j))] + exact Finset.sum_congr rfl (fun j _ => (lintegral_const_mul _ (hm j)).symm) + +lemma actualConvexMass_measurable (a : ℝ) (ha : 1/4 upperArea.withDensity (actualConvexDensity a s c t b) from + funext (actualConvexMass_density a ha s c t)] + exact measurable_withDensity (actualConvexDensity_measurable a ha s c t) + +lemma actualConvexMass_finiteOnCompacts (a : ℝ) (ha : 1/4 + f.integrable.smul_measure ENNReal.ofReal_ne_top)] + apply Finset.sum_congr rfl + intro j hj + rw [integral_smul_measure, ENNReal.toReal_ofReal (hc j hj),smul_eq_mul] + +lemma actual_pair_density_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ (x y : UpperPlane) (c : ℝ),0 assumption) ![q,r] + (by intro i; fin_cases i <;> assumption) + (by intro i; fin_cases i <;> assumption) ![u,v] + simpa only [Fin.prod_univ_two,Matrix.cons_val_zero,Matrix.cons_val_one, + pairKernel,MeasurableEquiv.finTwoArrow_symm_apply,Fin.cons_zero,Fin.cons_one] using h + + + +theorem actualConvexDensity_pair_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ (s : Finset ℕ) (c : ℕ → ℝ), (∀ j∈s,0≤c j) → (∑j∈s,c j=1) → + ∀ (t : ℝ≥0∞) (x y : UpperPlane) (d : ℝ),0 ENNReal.ofReal (c j)) hc' + · intro j _ + exact (timeMassDensity_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) t).comp (measurable_id.prodMk measurable_const) + · intro j _ + exact (timeMassDensity_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) t).comp (measurable_id.prodMk measurable_const) + · intro i _ j _ + exact hb W hW x y d hd hx hy _ _ (Real.exp_pos _) (level_step_le_one a ha i) + (Real.exp_pos _) (level_step_le_one a ha j) t t + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/FiniteVariationMartingale.lean b/lean/OAI/Probability/SLEGauge/FiniteVariationMartingale.lean new file mode 100644 index 0000000000000000000000000000000000000000..45713fe853eaa792a3d2b75fdda321341372b496 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/FiniteVariationMartingale.lean @@ -0,0 +1,536 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.PostStopPotential + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.FiniteVariationMartingale +open MeshEnergy TaylorVariation +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] +variable {P : Measure Ω} [IsFiniteMeasure P] {ℱ : Filtration ℝ≥0 mΩ} +variable {M : ℝ≥0 → Ω → ℝ} + + + +lemma integral_weighted_increment (hM : Martingale M ℱ P) + {s t : ℝ≥0} (hst : s≤t) {H : Ω → ℝ} + (hm : StronglyMeasurable[ℱ s] H) {L : ℝ} + (hb : ∀ᵐ ω ∂P, ‖H ω‖≤L) : + ∫ ω, H ω*(M t ω-M s ω) ∂P = 0 := by + have hi := (hM.integrable t).sub (hM.integrable s) + have hprod : Integrable (H*(M t-M s)) P := + hi.bdd_mul (hm.mono (ℱ.le s)).aestronglyMeasurable hb + have hzero : P[M t-M s | ℱ s] =ᵐ[P] 0 := by + have hc := condExp_sub (hM.integrable t) (hM.integrable s) (ℱ s) + have hs := condExp_of_stronglyMeasurable (ℱ.le s) (hM.stronglyMeasurable s) + (hM.integrable s) + filter_upwards [hc,hM.condExp_ae_eq hst] with ω he ht + simp only [Pi.sub_apply,hs,ht,sub_self] at he + exact he + have hp := condExp_mul_of_stronglyMeasurable_left hm hprod hi + calc + _ = ∫ ω, P[H*(M t-M s) | ℱ s] ω ∂P := (integral_condExp (ℱ.le s)).symm + _ = ∫ ω, (0:ℝ) ∂P := by + apply integral_congr_ae + filter_upwards [hp,hzero] with ω he hz + simpa [hz] using he + _ = 0 := integral_zero _ _ + +omit [IsFiniteMeasure P] in +lemma integrable_detector [IsFiniteMeasure P] (hM : Martingale M ℱ P) (t : ℝ≥0) : + Integrable (fun ω => detector (M t ω)) P := + (hM.integrable t).norm.mono' + (lipschitz_detector.continuous.comp_aestronglyMeasurable + (hM.integrable t).aestronglyMeasurable) + (ae_of_all _ fun ω => abs_detector_le (M t ω)) + + + +theorem ae_eq_zero_at (hM : Martingale M ℱ P) + (hz : M 0 =ᵐ[P] 0) (C : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) + (hc : ∀ᵐ ω ∂P, ContinuousOn (fun t => C t ω) (Icc 0 T)) + (hcontrol : ∀ᵐ ω ∂P, ∀ s t, s≤t → t≤T → |M t ω-M s ω|≤C t ω-C s ω) + (hint : Integrable (fun ω => C T ω-C 0 ω) P) : M T =ᵐ[P] 0 := by + let H (n i : ℕ) (ω : Ω) := detectorDeriv (M (grid T n i) ω) + have hm (n i : ℕ) : StronglyMeasurable[ℱ (grid T n i)] (H n i) := + lipschitz_detectorDeriv.continuous.comp_stronglyMeasurable (hM.stronglyMeasurable _) + have hb (n i : ℕ) : ∀ᵐ ω ∂P, ‖H n i ω‖≤1 := + ae_of_all _ fun ω => abs_detectorDeriv_le _ + have hi (n i : ℕ) : Integrable + (fun ω => H n i ω * (M (grid T n (i+1)) ω-M (grid T n i) ω)) P := + ((hM.integrable _).sub (hM.integrable _)).bdd_mul + ((hm n i).mono (ℱ.le _)).aestronglyMeasurable (hb n i) + have hzero (n i : ℕ) : (∫ ω, H n i ω * + (M (grid T n (i+1)) ω-M (grid T n i) ω) ∂P)=0 := + integral_weighted_increment hM (grid_mono T n (Nat.le_succ i)) (hm n i) (hb n i) + have hsint (n : ℕ) : Integrable (fun ω => ∑ i ∈ Finset.range (n+1), H n i ω * + (M (grid T n (i+1)) ω-M (grid T n i) ω)) P := + integrable_finsetSum _ fun i _ => hi n i + have hsz (n : ℕ) : (∫ ω, ∑ i ∈ Finset.range (n+1), H n i ω * + (M (grid T n (i+1)) ω-M (grid T n i) ω) ∂P)=0 := by + rw [integral_finsetSum _ (fun i _ => hi n i)] + simp only [hzero,Finset.sum_const_zero] + let F (n : ℕ) (ω : Ω) := error detector detectorDeriv (fun t => M t ω) T n + have hFi (n : ℕ) : Integrable (F n) P := + ((integrable_detector hM T).sub (integrable_detector hM 0)).sub (hsint n) + have hz0 : (∫ ω, detector (M 0 ω) ∂P)=0 := by + calc + _ = ∫ ω, (0:ℝ) ∂P := integral_congr_ae (hz.mono fun ω he => by simp [he]) + _ = 0 := integral_zero _ _ + have hFint (n : ℕ) : (∫ ω, F n ω ∂P) = ∫ ω, detector (M T ω) ∂P := by + change (∫ ω, detector (M T ω)-detector (M 0 ω)- + ∑ i ∈ Finset.range (n+1), H n i ω * + (M (grid T n (i+1)) ω-M (grid T n i) ω) ∂P)=_ + have hh := integral_sub ((integrable_detector hM T).sub (integrable_detector hM 0)) (hsint n) + simp only [Pi.sub_apply] at hh + rw [hh, integral_sub (integrable_detector hM T) (integrable_detector hM 0), + hz0,hsz,sub_zero,sub_zero] + have hFb (n : ℕ) : ∀ᵐ ω ∂P, ‖F n ω‖≤2*(C T ω-C 0 ω) := by + filter_upwards [hcontrol] with ω hω + simpa [F] using abs_error_le_variation detector detectorDeriv hasDerivAt_detector + (L := 1) abs_detectorDeriv_le (fun t => M t ω) (fun t => C t ω) T hω n + have hFl : ∀ᵐ ω ∂P, Tendsto (fun n => F n ω) atTop (𝓝 0) := by + filter_upwards [hc,hcontrol] with ω hcω hω + exact tendsto_error_zero detector detectorDeriv hasDerivAt_detector + lipschitz_detectorDeriv (fun t => M t ω) (fun t => C t ω) T hcω hω + have hlim : Tendsto (fun n => ∫ ω, F n ω ∂P) atTop (𝓝 0) := by + simpa only [integral_zero] using tendsto_integral_of_dominated_convergence + (fun ω => 2*(C T ω-C 0 ω)) (fun n => (hFi n).aestronglyMeasurable) + (hint.const_mul 2) hFb hFl + simp only [hFint] at hlim + have he : (∫ ω, detector (M T ω) ∂P)=0 := + tendsto_nhds_unique tendsto_const_nhds hlim + have hdet := (integral_eq_zero_iff_of_nonneg + (fun ω => detector_nonneg (M T ω)) (integrable_detector hM T)).mp he + filter_upwards [hdet] with ω hω + exact (detector_eq_zero_iff _).mp hω + + +theorem ae_all_eq_zero (hM : Martingale M ℱ P) (hz : M 0 =ᵐ[P] 0) + (hmc : ∀ᵐ ω ∂P, Continuous (fun t => M t ω)) + (C : ℝ≥0 → Ω → ℝ) (hc : ∀ᵐ ω ∂P, Continuous (fun t => C t ω)) + (hcontrol : ∀ᵐ ω ∂P, ∀ s t, s≤t → |M t ω-M s ω|≤C t ω-C s ω) + (hint : ∀ T, Integrable (fun ω => C T ω-C 0 ω) P) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, M t ω=0 := by + obtain ⟨D,hD,hd⟩ := TopologicalSpace.exists_countable_dense ℝ≥0 + have heq : ∀ᵐ ω ∂P, ∀ t∈D, M t ω=0 := by + apply (ae_ball_iff hD).mpr + intro t _ + exact ae_eq_zero_at hM hz C t (hc.mono fun _ h => h.continuousOn) + (hcontrol.mono fun _ h s u hsu _ => h s u hsu) (hint t) + filter_upwards [heq,hmc] with ω hω hmω + have he : (fun t => M t ω)=(fun _ => (0:ℝ)) := + Continuous.ext_on hd hmω continuous_const hω + exact fun t => congrFun he t + +end SLEExactGauge.FiniteVariationMartingale +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CompensatorUniqueness +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] +variable {P : Measure Ω} [IsFiniteMeasure P] {ℱ : Filtration ℝ≥0 mΩ} +variable {A B : ℝ≥0 → Ω → ℝ} {TA TB : Ω → ℝ} + + + +omit [IsFiniteMeasure P] in +lemma integrable_at [IsFiniteMeasure P] (hm : StronglyAdapted ℱ A) + (hz : A 0 =ᵐ[P] 0) (hmono : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hdom : ∀ᵐ ω ∂P, ∀ t, A t ω ≤ TA ω) (hi : Integrable TA P) (t : ℝ≥0) : + Integrable (A t) P := by + apply hi.norm.mono' ((hm t).mono (ℱ.le t)).aestronglyMeasurable + filter_upwards [hz,hmono,hdom] with ω hzω hmω hdω + have hnonneg : 0 ≤ A t ω := by simpa only [hzω,Pi.zero_apply] using hmω (show 0 ≤ t from bot_le) + simpa only [Real.norm_eq_abs,abs_of_nonneg hnonneg] using + (hdω t).trans (le_abs_self (TA ω)) + + + +lemma martingale_sub (hAm : StronglyAdapted ℱ A) (hBm : StronglyAdapted ℱ B) + (hAi : ∀ t, Integrable (A t) P) (hBi : ∀ t, Integrable (B t) P) + (hTA : Integrable TA P) (hTB : Integrable TB P) + (hpot : ∀ t, P[TA - A t | ℱ t] =ᵐ[P] P[TB - B t | ℱ t]) : + Martingale (A-B) ℱ P := by + apply (martingale_condExp (TA-TB) ℱ P).congr (hAm.sub hBm) + intro t + have ha := condExp_of_stronglyMeasurable (ℱ.le t) (hAm t) (hAi t) + have hb := condExp_of_stronglyMeasurable (ℱ.le t) (hBm t) (hBi t) + filter_upwards [condExp_sub hTA hTB (ℱ t),condExp_sub hTA (hAi t) (ℱ t), + condExp_sub hTB (hBi t) (ℱ t),hpot t] with ω hab hae hbe hp + simp only [Pi.sub_apply,ha,hb] at hab hae hbe ⊢ + linarith + + + +theorem ae_all_eq (hAm : StronglyAdapted ℱ A) (hBm : StronglyAdapted ℱ B) + (hAz : A 0 =ᵐ[P] 0) (hBz : B 0 =ᵐ[P] 0) + (hAc : ∀ᵐ ω ∂P, Continuous (fun t => A t ω)) + (hBc : ∀ᵐ ω ∂P, Continuous (fun t => B t ω)) + (hAo : ∀ᵐ ω ∂P, Monotone (fun t => A t ω)) + (hBo : ∀ᵐ ω ∂P, Monotone (fun t => B t ω)) + (hAd : ∀ᵐ ω ∂P, ∀ t, A t ω ≤ TA ω) + (hBd : ∀ᵐ ω ∂P, ∀ t, B t ω ≤ TB ω) + (hTA : Integrable TA P) (hTB : Integrable TB P) + (hpot : ∀ t, P[TA-A t | ℱ t] =ᵐ[P] P[TB-B t | ℱ t]) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, A t ω=B t ω := by + have hAi := integrable_at hAm hAz hAo hAd hTA + have hBi := integrable_at hBm hBz hBo hBd hTB + have hM := martingale_sub hAm hBm hAi hBi hTA hTB hpot + have hz : (A-B) 0 =ᵐ[P] 0 := by + filter_upwards [hAz,hBz] with ω ha hb + simp only [Pi.sub_apply,ha,hb,sub_self,Pi.zero_apply] + have hmc : ∀ᵐ ω ∂P, Continuous (fun t => (A-B) t ω) := by + filter_upwards [hAc,hBc] with ω ha hb + exact ha.sub hb + have hc : ∀ᵐ ω ∂P, Continuous (fun t => (A+B) t ω) := by + filter_upwards [hAc,hBc] with ω ha hb + exact ha.add hb + have hcontrol : ∀ᵐ ω ∂P, ∀ s t, s≤t → + |(A-B) t ω-(A-B) s ω|≤(A+B) t ω-(A+B) s ω := by + filter_upwards [hAo,hBo] with ω ha hb s t hst + have hat := ha hst + have hbt := hb hst + simp only [Pi.sub_apply,Pi.add_apply] + exact abs_le.mpr ⟨by linarith,by linarith⟩ + have hint (T : ℝ≥0) : Integrable (fun ω => (A+B) T ω-(A+B) 0 ω) P := + ((hAi T).add (hBi T)).sub ((hAi 0).add (hBi 0)) + have he := FiniteVariationMartingale.ae_all_eq_zero hM hz hmc (A+B) hc hcontrol hint + filter_upwards [he] with ω hω t + exact sub_eq_zero.mp (hω t) + + +omit [IsFiniteMeasure P] in +theorem ae_terminal_eq_of_ae_all_eq [IsFiniteMeasure P] + (hab : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, A t ω=B t ω) + (hAl : ∀ᵐ ω ∂P, Tendsto (fun t => A t ω) atTop (𝓝 (TA ω))) + (hBl : ∀ᵐ ω ∂P, Tendsto (fun t => B t ω) atTop (𝓝 (TB ω))) : + TA =ᵐ[P] TB := by + filter_upwards [hab,hAl,hBl] with ω he ha hb + simp only [he] at ha + exact tendsto_nhds_unique ha hb + +end SLEExactGauge.CompensatorUniqueness +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CompensatorUniqueness +open MassVersions +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + {P : Measure Ω} [IsFiniteMeasure P] {ℱ : Filtration ℝ≥0 mΩ} + (μ ν : ℝ≥0 → Ω → Measure X) (Tμ Tν : Ω → Measure X) + [∀ t ω, (μ t ω).Regular] [∀ t ω, (ν t ω).Regular] + [∀ ω, (Tμ ω).Regular] [∀ ω, (Tν ω).Regular] + + +theorem ae_all_measure_eq + (hμm : ∀ f : C_c(X,ℝ), StronglyAdapted ℱ (fun t ω => ∫x,f x∂μ t ω)) + (hνm : ∀ f : C_c(X,ℝ), StronglyAdapted ℱ (fun t ω => ∫x,f x∂ν t ω)) + (hμ0 : μ 0 =ᵐ[P] 0) (hν0 : ν 0 =ᵐ[P] 0) + (hμc : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, Continuous (fun t => ∫x,f x∂μ t ω)) + (hνc : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, Continuous (fun t => ∫x,f x∂ν t ω)) + (hμo : ∀ᵐ ω ∂P, Monotone (fun t => μ t ω)) + (hνo : ∀ᵐ ω ∂P, Monotone (fun t => ν t ω)) + (hμd : ∀ᵐ ω ∂P, ∀ t, μ t ω≤Tμ ω) + (hνd : ∀ᵐ ω ∂P, ∀ t, ν t ω≤Tν ω) + (hμi : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x,f x∂Tμ ω) P) + (hνi : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x,f x∂Tν ω) P) + (hpot : ∀ f : C_c(X,ℝ), (∀ x, 0≤f x) → ∀ t, + P[(fun ω => (∫x,f x∂Tμ ω)-(∫x,f x∂μ t ω)) | ℱ t] =ᵐ[P] + P[(fun ω => (∫x,f x∂Tν ω)-(∫x,f x∂ν t ω)) | ℱ t]) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, μ t ω=ν t ω := by + have hpos (f : C_c(X,ℝ)) (hf : ∀ x,0≤f x) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, (∫x,f x∂μ t ω)=∫x,f x∂ν t ω := by + have hμz : (fun ω => ∫x,f x∂μ 0 ω) =ᵐ[P] 0 := by + filter_upwards [hμ0] with ω hω + simp only [hω,Pi.zero_apply,integral_zero_measure] + have hνz : (fun ω => ∫x,f x∂ν 0 ω) =ᵐ[P] 0 := by + filter_upwards [hν0] with ω hω + simp only [hω,Pi.zero_apply,integral_zero_measure] + have hμo' : ∀ᵐ ω ∂P, Monotone (fun t => ∫x,f x∂μ t ω) := by + filter_upwards [hμo] with ω hω s t hst + exact integral_mono_measure (hω hst) (Eventually.of_forall hf) f.integrable + have hνo' : ∀ᵐ ω ∂P, Monotone (fun t => ∫x,f x∂ν t ω) := by + filter_upwards [hνo] with ω hω s t hst + exact integral_mono_measure (hω hst) (Eventually.of_forall hf) f.integrable + have hμd' : ∀ᵐ ω ∂P, ∀ t, (∫x,f x∂μ t ω)≤∫x,f x∂Tμ ω := by + filter_upwards [hμd] with ω hω t + exact integral_mono_measure (hω t) (Eventually.of_forall hf) f.integrable + have hνd' : ∀ᵐ ω ∂P, ∀ t, (∫x,f x∂ν t ω)≤∫x,f x∂Tν ω := by + filter_upwards [hνd] with ω hω t + exact integral_mono_measure (hω t) (Eventually.of_forall hf) f.integrable + exact ae_all_eq (hμm f) (hνm f) hμz hνz (hμc f) (hνc f) + hμo' hνo' hμd' hνd' (hμi f) (hνi f) (hpot f hf) + apply ae_all_measure_eq_of_test_eq P μ ν + intro i + let f : C_c(X,ℝ) := determiningTests i + filter_upwards [hpos (positiveTest f) (positiveTest_nonneg f), + hpos (positiveTest (-f)) (positiveTest_nonneg (-f))] with ω hp hn t + calc + (∫x,f x∂μ t ω) = (∫x,positiveTest f x∂μ t ω)-(∫x,positiveTest (-f) x∂μ t ω) := + (integral_positiveTest_sub f _).symm + _ = (∫x,positiveTest f x∂ν t ω)-(∫x,positiveTest (-f) x∂ν t ω) := by rw [hp t,hn t] + _ = (∫x,f x∂ν t ω) := integral_positiveTest_sub f _ + + +omit [IsFiniteMeasure P] [∀ time sample, (μ time sample).Regular] + [∀ time sample, (ν time sample).Regular] in +theorem ae_terminal_measure_eq [IsFiniteMeasure P] + [∀ time sample, (μ time sample).Regular] [∀ time sample, (ν time sample).Regular] + (he : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, μ t ω=ν t ω) + (hμl : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, + Tendsto (fun t : ℝ≥0 => ∫x,f x∂μ t ω) atTop (𝓝 (∫x,f x∂Tμ ω))) + (hνl : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, + Tendsto (fun t : ℝ≥0 => ∫x,f x∂ν t ω) atTop (𝓝 (∫x,f x∂Tν ω))) : + Tμ =ᵐ[P] Tν := by + have hi (i : ℕ) : (fun ω => ∫x,determiningTests i x∂Tμ ω) =ᵐ[P] + (fun ω => ∫x,determiningTests i x∂Tν ω) := by + filter_upwards [he,hμl (determiningTests i),hνl (determiningTests i)] with ω hω hμω hνω + simp only [hω] at hμω + exact tendsto_nhds_unique hμω hνω + filter_upwards [ae_all_iff.mpr hi] with ω hω + exact measure_eq_of_determiningTests _ _ hω + + + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] [BorelSpace X] + [IsFiniteMeasure P] [∀ time sample, (μ time sample).Regular] + [∀ time sample, (ν time sample).Regular] in +theorem ae_all_random_weight_eq [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] [IsFiniteMeasure P] + [∀ time sample, (μ time sample).Regular] [∀ time sample, (ν time sample).Regular] + (he : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, μ t ω=ν t ω) : + ∀ᵐ ω ∂P, ∀ (t : Ω → ℝ≥0) (w : Ω → X → ℝ≥0∞), + (∫⁻x,w ω x∂μ (t ω) ω)=∫⁻x,w ω x∂ν (t ω) ω := by + filter_upwards [he] with ω hω t w + rw [hω (t ω)] + +end SLEExactGauge.CompensatorUniqueness +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CompensatorUniqueness +open MassVersions +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + {P : Measure Ω} [IsFiniteMeasure P] {ℱ : Filtration ℝ≥0 mΩ} + + + +theorem ae_all_measure_eq_of_ae_regular + (μ ν : ℝ≥0 → Ω → Measure X) (Tμ Tν : Ω → Measure X) + (hμr : ∀ᵐ ω ∂P, ∀t, (μ t ω).Regular) + (hνr : ∀ᵐ ω ∂P, ∀t, (ν t ω).Regular) + (hTμr : ∀ᵐ ω ∂P, (Tμ ω).Regular) + (hTνr : ∀ᵐ ω ∂P, (Tν ω).Regular) + (hμm : ∀ f : C_c(X,ℝ), StronglyAdapted ℱ (fun t ω => ∫x,f x∂μ t ω)) + (hνm : ∀ f : C_c(X,ℝ), StronglyAdapted ℱ (fun t ω => ∫x,f x∂ν t ω)) + (hμ0 : μ 0 =ᵐ[P] 0) (hν0 : ν 0 =ᵐ[P] 0) + (hμc : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, Continuous (fun t => ∫x,f x∂μ t ω)) + (hνc : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, Continuous (fun t => ∫x,f x∂ν t ω)) + (hμo : ∀ᵐ ω ∂P, Monotone (fun t => μ t ω)) + (hνo : ∀ᵐ ω ∂P, Monotone (fun t => ν t ω)) + (hμd : ∀ᵐ ω ∂P, ∀ t, μ t ω≤Tμ ω) + (hνd : ∀ᵐ ω ∂P, ∀ t, ν t ω≤Tν ω) + (hμi : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x,f x∂Tμ ω) P) + (hνi : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x,f x∂Tν ω) P) + (hpot : ∀ f : C_c(X,ℝ), (∀ x, 0≤f x) → ∀ t, + P[(fun ω => (∫x,f x∂Tμ ω)-(∫x,f x∂μ t ω)) | ℱ t] =ᵐ[P] + P[(fun ω => (∫x,f x∂Tν ω)-(∫x,f x∂ν t ω)) | ℱ t]) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, μ t ω=ν t ω := by + have hpos (f : C_c(X,ℝ)) (hf : ∀ x,0≤f x) : + ∀ᵐ ω ∂P, ∀ t : ℝ≥0, (∫x,f x∂μ t ω)=∫x,f x∂ν t ω := by + have hμz : (fun ω => ∫x,f x∂μ 0 ω) =ᵐ[P] 0 := by + filter_upwards [hμ0] with ω hω + simp only [hω,Pi.zero_apply,integral_zero_measure] + have hνz : (fun ω => ∫x,f x∂ν 0 ω) =ᵐ[P] 0 := by + filter_upwards [hν0] with ω hω + simp only [hω,Pi.zero_apply,integral_zero_measure] + have hμo' : ∀ᵐ ω ∂P, Monotone (fun t => ∫x,f x∂μ t ω) := by + filter_upwards [hμo,hμr] with ω hω hr s t hst + let := hr t + exact integral_mono_measure (hω hst) (Eventually.of_forall hf) f.integrable + have hνo' : ∀ᵐ ω ∂P, Monotone (fun t => ∫x,f x∂ν t ω) := by + filter_upwards [hνo,hνr] with ω hω hr s t hst + let := hr t + exact integral_mono_measure (hω hst) (Eventually.of_forall hf) f.integrable + have hμd' : ∀ᵐ ω ∂P, ∀ t, (∫x,f x∂μ t ω)≤∫x,f x∂Tμ ω := by + filter_upwards [hμd,hTμr] with ω hω hr t + let := hr + exact integral_mono_measure (hω t) (Eventually.of_forall hf) f.integrable + have hνd' : ∀ᵐ ω ∂P, ∀ t, (∫x,f x∂ν t ω)≤∫x,f x∂Tν ω := by + filter_upwards [hνd,hTνr] with ω hω hr t + let := hr + exact integral_mono_measure (hω t) (Eventually.of_forall hf) f.integrable + exact ae_all_eq (hμm f) (hνm f) hμz hνz (hμc f) (hνc f) + hμo' hνo' hμd' hνd' (hμi f) (hνi f) (hpot f hf) + have he (i : ℕ) : ∀ᵐ ω ∂P, ∀t, + (∫x,determiningTests i x∂μ t ω)=∫x,determiningTests i x∂ν t ω := by + let f : C_c(X,ℝ) := determiningTests i + filter_upwards [hμr,hνr,hpos (positiveTest f) (positiveTest_nonneg f), + hpos (positiveTest (-f)) (positiveTest_nonneg (-f))] with ω hr hs hp hn t + let := hr t + let := hs t + calc + (∫x,f x∂μ t ω) = (∫x,positiveTest f x∂μ t ω)-(∫x,positiveTest (-f) x∂μ t ω) := + (integral_positiveTest_sub f _).symm + _ = (∫x,positiveTest f x∂ν t ω)-(∫x,positiveTest (-f) x∂ν t ω) := by rw [hp t,hn t] + _ = (∫x,f x∂ν t ω) := integral_positiveTest_sub f _ + filter_upwards [ae_all_iff.mpr he,hμr,hνr] with ω hω hr hs t + let := hr t + let := hs t + exact measure_eq_of_determiningTests _ _ (fun i => hω i t) + + +omit [IsFiniteMeasure P] in +theorem ae_terminal_measure_eq_of_ae_regular [IsFiniteMeasure P] + (μ ν : ℝ≥0 → Ω → Measure X) (Tμ Tν : Ω → Measure X) + (hTμr : ∀ᵐ ω ∂P, (Tμ ω).Regular) + (hTνr : ∀ᵐ ω ∂P, (Tν ω).Regular) + (he : ∀ᵐ ω ∂P, ∀ t : ℝ≥0, μ t ω=ν t ω) + (hμl : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, + Tendsto (fun t : ℝ≥0 => ∫x,f x∂μ t ω) atTop (𝓝 (∫x,f x∂Tμ ω))) + (hνl : ∀ f : C_c(X,ℝ), ∀ᵐ ω ∂P, + Tendsto (fun t : ℝ≥0 => ∫x,f x∂ν t ω) atTop (𝓝 (∫x,f x∂Tν ω))) : + Tμ =ᵐ[P] Tν := by + have hi (i : ℕ) : (fun ω => ∫x,determiningTests i x∂Tμ ω) =ᵐ[P] + (fun ω => ∫x,determiningTests i x∂Tν ω) := by + filter_upwards [he,hμl (determiningTests i),hνl (determiningTests i)] with ω hω hμω hνω + simp only [hω] at hμω + exact tendsto_nhds_unique hμω hνω + filter_upwards [ae_all_iff.mpr hi,hTμr,hTνr] with ω hω hr hs + let := hr + let := hs + exact measure_eq_of_determiningTests _ _ hω + +end SLEExactGauge.CompensatorUniqueness +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.MassVersions + + + +lemma integrable_test_of_ae_measure_le {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (W : Measure Ω) (M T : Ω→Measure X) {f : X→ℝ} (hf : ∀x,0≤f x) + (hm : AEStronglyMeasurable (fun ω => ∫x,f x∂M ω) W) + (hl : ∀ᵐ ω ∂W, Integrable f (T ω)) + (hi : Integrable (fun ω => ∫x,f x∂T ω) W) + (hd : ∀ᵐ ω ∂W, M ω≤T ω) : Integrable (fun ω => ∫x,f x∂M ω) W := by + apply hi.norm.mono' hm + filter_upwards [hl,hd] with ω hω hdω + simp only [Real.norm_eq_abs] + rw [abs_of_nonneg (integral_nonneg (μ:=M ω) hf),abs_of_nonneg (integral_nonneg (μ:=T ω) hf)] + exact integral_mono_measure hdω (Eventually.of_forall hf) hω + +lemma double_lintegral_ofReal_eq {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (W : Measure Ω) (M : Ω→Measure X) {f : X→ℝ} (hf : ∀x,0≤f x) + (hlocal : ∀ᵐ ω ∂W, Integrable f (M ω)) + (hmean : Integrable (fun ω => ∫x,f x∂M ω) W) (A : Set Ω) : + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂M ω∂W)= + ENNReal.ofReal (∫ω in A,∫x,f x∂M ω∂W) := by + calc + _ = ∫⁻ω in A,ENNReal.ofReal (∫x,f x∂M ω)∂W := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae hlocal] with ω hω + exact (ofReal_integral_eq_lintegral_ofReal hω (Eventually.of_forall hf)).symm + _ = _ := (ofReal_integral_eq_lintegral_ofReal hmean.restrict + (Eventually.of_forall fun ω => integral_nonneg hf)).symm + + + +lemma condExp_sub_eq_of_lintegral_potential {Ω X : Type*} [mΩ : MeasurableSpace Ω] + [MeasurableSpace X] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + (W : @Measure Ω mΩ) [IsFiniteMeasure W] + (K L TK TL : Ω→Measure X) {f : X→ℝ} (hf : ∀x,0≤f x) + (hKi : Integrable (fun ω => ∫x,f x∂K ω) W) + (hLi : Integrable (fun ω => ∫x,f x∂L ω) W) + (hTKi : Integrable (fun ω => ∫x,f x∂TK ω) W) + (hTLi : Integrable (fun ω => ∫x,f x∂TL ω) W) + (hKl : ∀ᵐ ω ∂W, Integrable f (K ω)) + (hLl : ∀ᵐ ω ∂W, Integrable f (L ω)) + (hTKl : ∀ᵐ ω ∂W, Integrable f (TK ω)) + (hTLl : ∀ᵐ ω ∂W, Integrable f (TL ω)) + (V : Set Ω→ℝ≥0∞) + (hK : ∀A,MeasurableSet[m] A → + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂TK ω∂W)= + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂K ω∂W)+V A) + (hL : ∀A,MeasurableSet[m] A → + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂TL ω∂W)= + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂L ω∂W)+V A) : + W[(fun ω => (∫x,f x∂TK ω)-(∫x,f x∂K ω)) | m] =ᵐ[W] + W[(fun ω => (∫x,f x∂TL ω)-(∫x,f x∂L ω)) | m] := by + apply ae_eq_condExp_of_forall_setIntegral_eq hm (hTLi.sub hLi) + (fun _ _ _ => integrable_condExp.integrableOn) _ + stronglyMeasurable_condExp.aestronglyMeasurable + intro A hA _ + have hk : Integrable (fun ω => (∫x,f x∂TK ω)-(∫x,f x∂K ω)) W := hTKi.sub hKi + rw [setIntegral_condExp hm hk hA] + simp only [Pi.sub_apply] + rw [integral_sub hTKi.restrict hKi.restrict,integral_sub hTLi.restrict hLi.restrict] + have he : (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂TK ω∂W)+ + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂L ω∂W)= + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂TL ω∂W)+ + (∫⁻ω in A,∫⁻x,ENNReal.ofReal (f x)∂K ω∂W) := by + rw [hK A hA,hL A hA] + ac_rfl + rw [@double_lintegral_ofReal_eq Ω X mΩ _ W TK f hf hTKl hTKi, + @double_lintegral_ofReal_eq Ω X mΩ _ W L f hf hLl hLi, + @double_lintegral_ofReal_eq Ω X mΩ _ W TL f hf hTLl hTLi, + @double_lintegral_ofReal_eq Ω X mΩ _ W K f hf hKl hKi] at he + have hh := congrArg ENNReal.toReal he + have hn (M : Ω→Measure X) : 0≤∫ω in A,∫x,f x∂M ω∂W := + integral_nonneg (fun _ => integral_nonneg hf) + simp only [ENNReal.toReal_add ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top, + ENNReal.toReal_ofReal (hn TK),ENNReal.toReal_ofReal (hn L), + ENNReal.toReal_ofReal (hn TL),ENNReal.toReal_ofReal (hn K)] at hh + linarith + +end SLEExactGauge.MassVersions +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/FlowDerivatives.lean b/lean/OAI/Probability/SLEGauge/FlowDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d45b0a01da02f0ffeb4332440cf73554ddd72fd --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/FlowDerivatives.lean @@ -0,0 +1,461 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.DynkinIdentity + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +namespace ExactSLEFlow +variable {E Ω : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] [MeasurableSpace Ω] +omit [MeasurableSpace E] [BorelSpace E] in +lemma integral_flow_hasDerivWithinAt + {A : E → E} (hA : Continuous A) {u f : ℝ≥0 → E} + (hu : Continuous u) (hf : Continuous f) {x : E} + (heq : ∀ t, f t = x + ∫ v in (0 : ℝ)..(t : ℝ), A (f v.toNNReal + u v.toNNReal)) + (T : ℝ≥0) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun v : ℝ => f v.toNNReal) (A (f t.toNNReal + u t.toNNReal)) + (Icc (0 : ℝ) T) t := by + have hc : Continuous (fun v : ℝ => A (f v.toNNReal + u v.toNNReal)) := + hA.comp ((hf.comp continuous_real_toNNReal).add (hu.comp continuous_real_toNNReal)) + have hd := (intervalIntegral.integral_hasDerivAt_right + (hc.intervalIntegrable 0 t) hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt).const_add x + apply hd.hasDerivWithinAt.congr_of_mem _ ht + intro v hv + simpa only [Real.coe_toNNReal _ hv.1] using heq v.toNNReal + +omit [MeasurableSpace E] [BorelSpace E] in +lemma integral_flow_unique + {A : E → E} {K : ℝ≥0} (hA : LipschitzWith K A) {u v f g : ℝ≥0 → E} + (hu : Continuous u) (hv : Continuous v) (hf : Continuous f) (hg : Continuous g) {x : E} + (hfe : ∀ t, f t = x + ∫ w in (0 : ℝ)..(t : ℝ), A (f w.toNNReal + u w.toNNReal)) + (hge : ∀ t, g t = x + ∫ w in (0 : ℝ)..(t : ℝ), A (g w.toNNReal + v w.toNNReal)) + {T : ℝ≥0} (huv : ∀ t ≤ T, u t = v t) {t : ℝ≥0} (ht : t ≤ T) : f t = g t := by + have hfd := integral_flow_hasDerivWithinAt hA.continuous hu hf hfe T + have hgd : ∀ w ∈ Icc (0 : ℝ) T, HasDerivWithinAt (fun w : ℝ => g w.toNNReal) + (A (g w.toNNReal + u w.toNNReal)) (Icc (0 : ℝ) T) w := by + intro w hw + rw [huv w.toNNReal ((Real.toNNReal_le_toNNReal hw.2).trans_eq (by simp))] + exact integral_flow_hasDerivWithinAt hA.continuous hv hg hge T w hw + have hf0 : f 0 = x := by simpa using hfe 0 + have hg0 : g 0 = x := by simpa using hge 0 + have h0 : f 0 = g 0 := hf0.trans hg0.symm + have he := additive_flow_unique hA + ((hf.comp continuous_real_toNNReal).continuousOn) + ((hg.comp continuous_real_toNNReal).continuousOn) hfd hgd (by simpa using h0) + (show (t : ℝ) ∈ Icc (0 : ℝ) T from ⟨t.coe_nonneg, ht⟩) + simpa using he + + + +theorem additive_flow_adapted + (A : E → E) (L K : ℝ≥0) (hA : LipschitzWith K A) (hb : ∀ x, ‖A x‖ ≤ L) + (u : ℝ≥0 → Ω → E) (huc : ∀ ω, Continuous (fun t => u t ω)) + (x : Ω → E) (Y : ℝ≥0 → Ω → E) (hYc : ∀ ω, Continuous (fun t => Y t ω)) + (hYe : ∀ ω t, Y t ω = x ω + ∫ v in (0 : ℝ)..(t : ℝ), + A (Y v.toNNReal ω + u v.toNNReal ω)) + (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (hum : ∀ t, Measurable[F t] (u t)) (hxm : Measurable[F 0] x) : + ∀ t, Measurable[F t] (Y t) := by + intro T + let : MeasurableSpace Ω := F T + let uT : ℝ≥0 → Ω → E := fun t ω => u (min t T) ω + have huTc (ω : Ω) : Continuous (fun t => uT t ω) := + (huc ω).comp (continuous_id.min continuous_const) + have huTm (t : ℝ≥0) : Measurable (uT t) := + (hum (min t T)).mono (F.mono (min_le_right _ _)) le_rfl + have hx : Measurable x := hxm.mono (F.mono bot_le) le_rfl + obtain ⟨Z, hZc, hZm, hZe⟩ := measurable_additive_flow A L K hA hb uT huTc huTm x hx + have he : Y T = Z T := by + funext ω + exact integral_flow_unique hA (huc ω) (huTc ω) (hYc ω) (hZc ω) (hYe ω) (hZe ω) + (T := T) (fun t ht => by simp [uT, min_eq_left ht]) le_rfl + rw [he] + exact hZm T + +end ExactSLEFlow + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem exists_adapted_additive_brownian + (A : E → E) (L K : ℝ≥0) (hA : LipschitzWith K A) (hb : ∀ x, ‖A x‖ ≤ L) + (x e : E) : + ∃ X : ℝ≥0 → Driver → E, + (∀ b, Continuous (fun t => X t b)) ∧ + (∀ t, Measurable[rawFiltration t] (X t)) ∧ + (∀ b, X 0 b = x) ∧ + (∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) := by + let u : ℝ≥0 → Driver → E := fun t b => b.1 t • e + have huc (b : Driver) : Continuous (fun t => u t b) := b.1.continuous.smul continuous_const + have hum (t : ℝ≥0) : Measurable (u t) := (driver_eval_measurable t).measurable.smul_const e + have humF (t : ℝ≥0) : Measurable[rawFiltration t] (u t) := by + have h := Filtration.stronglyAdapted_natural driver_eval_measurable t + exact h.measurable.smul_const e + obtain ⟨Y, hYc, hYm, hYe⟩ := ExactSLEFlow.measurable_additive_flow A L K hA hb + u huc hum (fun _ => x) measurable_const + have hYF := ExactSLEFlow.additive_flow_adapted A L K hA hb u huc (fun _ => x) + Y hYc hYe rawFiltration humF measurable_const + let X : ℝ≥0 → Driver → E := fun t b => Y t b + u t b + refine ⟨X, fun b => (hYc b).add (huc b), fun t => (hYF t).add (humF t), ?_, ?_⟩ + · intro b + have h0 := hYe b 0 + simp only [NNReal.coe_zero, intervalIntegral.integral_same, add_zero] at h0 + simp [X, u, b.2, h0] + · intro s h b + have hc : Continuous (fun t : ℝ => A (X t.toNNReal b)) := + hA.continuous.comp (((hYc b).add (huc b)).comp continuous_real_toNNReal) + have hi := intervalIntegral.integral_add_adjacent_intervals (μ := volume) + (hc.intervalIntegrable (0 : ℝ) s) (hc.intervalIntegrable (s : ℝ) (s+h : ℝ≥0)) + have hYs := hYe b s + have hYt := hYe b (s+h) + change Y (s+h) b + b.1 (s+h) • e = + Y s b + b.1 s • e + (b.1 (s+h) - b.1 s) • e + ∫ t in (s : ℝ)..(s+h : ℝ≥0), A (X t.toNNReal b) + change Y s b = x + ∫ t in (0 : ℝ)..(s : ℝ), A (X t.toNNReal b) at hYs + change Y (s+h) b = x + ∫ t in (0 : ℝ)..(s+h : ℝ≥0), A (X t.toNNReal b) at hYt + rw [hYs, hYt, ← hi, sub_smul] + abel + + +omit [CompleteSpace E] in +lemma adapted_intervalIntegral {Ω : Type*} [MeasurableSpace Ω] + (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) (g : ℝ≥0 → Ω → E) + (hc : ∀ ω, Continuous (fun t => g t ω)) (hm : ∀ t, Measurable[F t] (g t)) + (T : ℝ≥0) : + Measurable[F T] (fun ω => ∫ t in (0 : ℝ)..(T : ℝ), g t.toNNReal ω) := by + let : MeasurableSpace Ω := F T + have hc' (ω : Ω) : Continuous (fun t : ℝ => g (min t.toNNReal T) ω) := + (hc ω).comp (continuous_real_toNNReal.min continuous_const) + have hm' (t : ℝ) : Measurable (g (min t.toNNReal T)) := + (hm _).mono (F.mono (min_le_right _ _)) le_rfl + have hme := stronglyMeasurable_intervalIntegral_of_continuous + (fun t ω => g (min t.toNNReal T) ω) hc' hm' 0 T + have he : (fun ω => ∫ t in (0 : ℝ)..(T : ℝ), g t.toNNReal ω) = + (fun ω => ∫ t in (0 : ℝ)..(T : ℝ), g (min t.toNNReal T) ω) := by + funext ω + apply intervalIntegral.integral_congr + intro t ht + have ht' : t ≤ (T : ℝ) := (by simpa only [uIcc_of_le T.coe_nonneg] using ht : t ∈ Set.Icc 0 (T : ℝ)).2 + change g t.toNNReal ω = g (min t.toNNReal T) ω + have htT : t.toNNReal ≤ T := (Real.toNNReal_le_toNNReal ht').trans_eq (by simp) + rw [min_eq_left htT] + rw [he] + exact hme.measurable + +end ExactSLEGenerator + +namespace ExactSLEGenerator + + + +theorem martingale_compensated_of_weighted + (W : Measure Driver) [IsProbabilityMeasure W] + (F G : ℝ≥0 → Driver → ℝ) + (hFm : ∀ t, Measurable[rawFiltration t] (F t)) + (hFi : ∀ t, Integrable (F t) W) + (hGc : ∀ b, Continuous (fun t => G t b)) + (hGm : ∀ t, Measurable[rawFiltration t] (G t)) + (C : ℝ) (hGb : ∀ b t, |G t b| ≤ C) + (hw : ∀ (s h : ℝ≥0) (J : Driver → ℝ), Measurable[rawFiltration s] J → + (∀ b, |J b| ≤ 1) → + (∫ b, J b * F (s+h) b ∂W) - (∫ b, J b * F s b ∂W) = + ∫ b, J b * (∫ u in (s : ℝ)..(s+h : ℝ≥0), G u.toNNReal b) ∂W) : + Martingale (fun t b => F t b - ∫ u in (0 : ℝ)..(t : ℝ), G u.toNNReal b) + rawFiltration W := by + let I : ℝ≥0 → Driver → ℝ := fun t b => ∫ u in (0 : ℝ)..(t : ℝ), G u.toNNReal b + have hIm (t : ℝ≥0) : Measurable[rawFiltration t] (I t) := + adapted_intervalIntegral rawFiltration G hGc hGm t + have hGg (t : ℝ≥0) : Measurable (G t) := (hGm t).mono (rawFiltration.le t) le_rfl + have hseg (s t : ℝ) : Integrable (fun b => ∫ u in s..t, G u.toNNReal b) W := by + apply Integrable.of_bound + (stronglyMeasurable_intervalIntegral_of_continuous (fun u b => G u.toNNReal b) + (fun b => (hGc b).comp continuous_real_toNNReal) (fun u => hGg _) s t).aestronglyMeasurable + (C * |t-s|) + exact ae_of_all W (fun b => intervalIntegral.norm_integral_le_of_norm_le_const + (fun u hu => by simpa only [Real.norm_eq_abs] using hGb b u.toNNReal)) + have hIi (t : ℝ≥0) : Integrable (I t) W := hseg 0 t + have hMa (t : ℝ≥0) : StronglyMeasurable[rawFiltration t] (fun b => F t b - I t b) := + ((hFm t).sub (hIm t)).stronglyMeasurable + have hMi (t : ℝ≥0) : Integrable (fun b => F t b - I t b) W := (hFi t).sub (hIi t) + refine ⟨hMa, ?_⟩ + intro s t hst + symm + apply ae_eq_condExp_of_forall_setIntegral_eq (rawFiltration.le s) (hMi t) + (fun E hE hEfin => (hMi s).integrableOn) _ (hMa s).aestronglyMeasurable + intro E hE hEfin + have hEe : MeasurableSet E := rawFiltration.le s _ hE + let J : Driver → ℝ := E.indicator (fun _ => 1) + have hJm : Measurable[rawFiltration s] J := measurable_const.indicator hE + have hJb (b : Driver) : |J b| ≤ 1 := by + by_cases hb : b ∈ E <;> simp [J, hb] + have hJF (H : Driver → ℝ) : (fun b => J b * H b) = E.indicator H := by + funext b + by_cases hb : b ∈ E <;> simp [J, hb] + have he := hw s (t-s) J hJm hJb + rw [add_tsub_cancel_of_le hst] at he + simp only [hJF, integral_indicator hEe] at he + have hIadd (b : Driver) : I t b = I s b + ∫ u in (s : ℝ)..(t : ℝ), G u.toNNReal b := by + have hc := (hGc b).comp continuous_real_toNNReal + exact (intervalIntegral.integral_add_adjacent_intervals (μ := volume) + (hc.intervalIntegrable (0 : ℝ) s) (hc.intervalIntegrable (s : ℝ) t)).symm + have hIset : (∫ b in E, I t b ∂W) = (∫ b in E, I s b ∂W) + + (∫ b in E, (∫ u in (s : ℝ)..(t : ℝ), G u.toNNReal b) ∂W) := by + simp_rw [hIadd] + exact integral_add (hIi s).integrableOn (hseg s t).integrableOn + change (∫ b in E, F s b - I s b ∂W) = ∫ b in E, F t b - I t b ∂W + rw [integral_sub (hFi s).integrableOn (hIi s).integrableOn, + integral_sub (hFi t).integrableOn (hIi t).integrableOn, hIset] + linarith + +end ExactSLEGenerator + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma intervalIntegral_nnreal_shift (H : ℝ≥0 → E) (start s t : ℝ≥0) : + (∫ u in (s : ℝ)..(t : ℝ), H (start+u.toNNReal)) = + ∫ u in (start+s : ℝ≥0)..(start+t : ℝ≥0), H u.toNNReal := by + calc + _ = ∫ u in (s : ℝ)..(t : ℝ), H (((start : ℝ)+u).toNNReal) := by + apply intervalIntegral.integral_congr + intro u hu + have hu0 : 0 ≤ u := le_trans (le_min s.coe_nonneg t.coe_nonneg) hu.1 + change H (start+u.toNNReal) = H (((start : ℝ)+u).toNNReal) + congr 1 + ext + simp only [NNReal.coe_add, Real.coe_toNNReal _ hu0, + Real.coe_toNNReal _ (add_nonneg start.coe_nonneg hu0)] + _ = _ := by + simpa only [NNReal.coe_add] using + (intervalIntegral.integral_comp_add_left (fun u : ℝ => H u.toNNReal) (start : ℝ)) + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma shift_additive_equation + (X : ℝ≥0 → Driver → E) (A : E → E) (e : E) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (start s h : ℝ≥0) (b : Driver) : + X (start+(s+h)) b = X (start+s) b + increment (start+s) h b • e + + ∫ t in (s : ℝ)..(s+h : ℝ≥0), A (X (start+t.toNNReal) b) := by + rw [intervalIntegral_nnreal_shift (fun v => A (X v b)) start s (s+h), ← add_assoc] + exact hXeq (start+s) h b + +lemma integrable_intervalIntegral_of_bound + (W : Measure Driver) [IsProbabilityMeasure W] (G : ℝ≥0 → Driver → ℝ) + (hc : ∀ b, Continuous (fun t => G t b)) (hm : ∀ t, Measurable (G t)) + (C : ℝ) (hb : ∀ b t, |G t b| ≤ C) (s t : ℝ) : + Integrable (fun b => ∫ u in s..t, G u.toNNReal b) W := by + apply Integrable.of_bound + (stronglyMeasurable_intervalIntegral_of_continuous (fun u b => G u.toNNReal b) + (fun b => (hc b).comp continuous_real_toNNReal) (fun u => hm _) s t).aestronglyMeasurable + (C * |t-s|) + exact ae_of_all W (fun b => intervalIntegral.norm_integral_le_of_norm_le_const + (fun u hu => by simpa only [Real.norm_eq_abs] using hb b u.toNNReal)) + + + +theorem additive_brownian_martingale (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (D : E → E →L[ℝ] ℝ) (hD : ∀ x, HasFDerivAt f (D x) x) + (hDc : Continuous D) + (C M : ℝ) (hC : 0 ≤ C) (hM : 0 ≤ M) + (hLip : ∀ x y, ‖D y - D x‖ ≤ C * ‖y-x‖) + (hSmooth : ∀ x, ContDiff ℝ 3 (fun w : ℝ => f (x + w • e))) + (hThird : ∀ x w, |iteratedDeriv 3 (fun r : ℝ => f (x + r • e)) w| ≤ C) + (hQc : Continuous (fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0)) + (hfb : ∀ x, |f x| ≤ M) (hDb : ∀ x, ‖D x‖ ≤ M) + (hQb : ∀ x, |iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0| ≤ M) : + Martingale (fun t b => f (X t b) - ∫ u in (0 : ℝ)..(t : ℝ), + ((1/2 : ℝ) * iteratedDeriv 2 (fun r : ℝ => f (X u.toNNReal b + r • e)) 0 + + D (X u.toNNReal b) (A (X u.toNNReal b)))) rawFiltration W := by + let Q : E → ℝ := fun x => iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0 + let V : E → ℝ := fun x => D x (A x) + let G : E → ℝ := fun x => (1/2 : ℝ)*Q x + V x + have hVc : Continuous V := hDc.clm_apply hAc + have hGc : Continuous G := (continuous_const.mul hQc).add hVc + have hVb (x : E) : |V x| ≤ M*K := by + calc + _ = ‖D x (A x)‖ := (Real.norm_eq_abs _).symm + _ ≤ ‖D x‖ * ‖A x‖ := (D x).le_opNorm _ + _ ≤ M*K := mul_le_mul (hDb x) (hAb x) (norm_nonneg _) hM + have hGb (x : E) : |G x| ≤ M/2 + M*K := by + calc + _ ≤ |(1/2 : ℝ)*Q x| + |V x| := abs_add_le _ _ + _ ≤ (1/2 : ℝ)*M + M*K := add_le_add (by + rw [abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 1/2)] + exact mul_le_mul_of_nonneg_left (hQb x) (by norm_num)) (hVb x) + _ = _ := by ring + have hfc : Continuous f := continuous_iff_continuousAt.mpr (fun x => (hD x).continuousAt) + have hXg (t : ℝ≥0) : Measurable (X t) := (hXm t).mono (rawFiltration.le t) le_rfl + apply martingale_compensated_of_weighted W (fun t b => f (X t b)) + (fun t b => G (X t b)) + (fun t => hfc.measurable.comp (hXm t)) + (fun t => Integrable.of_bound (hfc.measurable.comp (hXg t)).aestronglyMeasurable M + (ae_of_all W (fun b => by simpa only [Real.norm_eq_abs] using hfb (X t b)))) + (fun b => hGc.comp (hXc b)) + (fun t => hGc.measurable.comp (hXm t)) (M/2+M*K) (fun b t => hGb _) + intro s h J hJm hJb + have hc (b : Driver) : Continuous (fun t => X (s+t) b) := + (hXc b).comp (continuous_const.add continuous_id) + have hdyn := additive_brownian_weighted_dynkin W hW s (fun t b => X (s+t) b) + hc (fun t => hXm (s+t)) A hAc K hK hAb e he (shift_additive_equation X A e hXeq s) + f D hD hDc C M hC hM hLip hSmooth hThird hQc hfb hDb hQb J hJm hJb h + have hiQ (b : Driver) : (∫ u in (0 : ℝ)..(h : ℝ), Q (X (s+u.toNNReal) b)) = + ∫ u in (s : ℝ)..(s+h : ℝ≥0), Q (X u.toNNReal b) := by + simpa only [NNReal.coe_zero, add_zero] using + (intervalIntegral_nnreal_shift (fun t => Q (X t b)) s 0 h) + have hiV (b : Driver) : (∫ u in (0 : ℝ)..(h : ℝ), V (X (s+u.toNNReal) b)) = + ∫ u in (s : ℝ)..(s+h : ℝ≥0), V (X u.toNNReal b) := by + simpa only [NNReal.coe_zero, add_zero] using + (intervalIntegral_nnreal_shift (fun t => V (X t b)) s 0 h) + change (∫ b, J b * f (X (s+h) b) ∂W) - (∫ b, J b * f (X (s+0) b) ∂W) = + (1/2 : ℝ) * (∫ b, J b * (∫ u in (0 : ℝ)..(h : ℝ), Q (X (s+u.toNNReal) b)) ∂W) + + (∫ b, J b * (∫ u in (0 : ℝ)..(h : ℝ), V (X (s+u.toNNReal) b)) ∂W) at hdyn + simp_rw [add_zero, hiQ, hiV] at hdyn + rw [hdyn] + have hJ : AEStronglyMeasurable J W := (hJm.mono (rawFiltration.le _) le_rfl).aestronglyMeasurable + have hJi : ∀ᵐ b ∂W, ‖J b‖ ≤ 1 := ae_of_all W (fun b => by simpa only [Real.norm_eq_abs] using hJb b) + have hQi := integrable_intervalIntegral_of_bound W (fun t b => Q (X t b)) + (fun b => hQc.comp (hXc b)) (fun t => hQc.measurable.comp (hXg t)) M + (fun b t => hQb _) s (s+h : ℝ≥0) + have hVi := integrable_intervalIntegral_of_bound W (fun t b => V (X t b)) + (fun b => hVc.comp (hXc b)) (fun t => hVc.measurable.comp (hXg t)) (M*K) + (fun b t => hVb _) s (s+h : ℝ≥0) + have hiG (b : Driver) : (∫ u in (s : ℝ)..(s+h : ℝ≥0), G (X u.toNNReal b)) = + (1/2 : ℝ)*(∫ u in (s : ℝ)..(s+h : ℝ≥0), Q (X u.toNNReal b)) + + (∫ u in (s : ℝ)..(s+h : ℝ≥0), V (X u.toNNReal b)) := by + have hqc : Continuous (fun u : ℝ => Q (X u.toNNReal b)) := + hQc.comp ((hXc b).comp continuous_real_toNNReal) + have hvc : Continuous (fun u : ℝ => V (X u.toNNReal b)) := + hVc.comp ((hXc b).comp continuous_real_toNNReal) + rw [show (fun u : ℝ => G (X u.toNNReal b)) = + (fun u : ℝ => (1/2 : ℝ)*Q (X u.toNNReal b) + V (X u.toNNReal b)) from rfl] + rw [intervalIntegral.integral_add ((hqc.intervalIntegrable _ _).const_mul _) (hvc.intervalIntegrable _ _), + intervalIntegral.integral_const_mul] + simp_rw [hiG, mul_add, ← mul_assoc, mul_comm _ (1/2 : ℝ), mul_assoc] + rw [integral_add ((hQi.bdd_mul hJ hJi).const_mul _) (hVi.bdd_mul hJ hJi), integral_const_mul] + +end ExactSLEGenerator + +namespace ExactSLEGenerator +open Set +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +noncomputable def directional (n : ℕ) (f : E → ℝ) (e : E) : E → ℝ := + Nat.rec f (fun _ g x => fderiv ℝ g x e) n + +omit [CompleteSpace E] in +lemma directional_contDiff (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (e : E) (n : ℕ) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (directional n f e) := by + induction n with + | zero => exact hf + | succ n ih => + exact (ih.fderiv_right (by simp)).clm_apply contDiff_const + +omit [CompleteSpace E] in +lemma directional_compact (f : E → ℝ) (hf : HasCompactSupport f) (e : E) (n : ℕ) : + HasCompactSupport (directional n f e) := by + induction n with + | zero => exact hf + | succ n ih => exact ih.fderiv_apply ℝ e + +omit [CompleteSpace E] in +lemma iteratedDeriv_line (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (e x : E) (n : ℕ) : + iteratedDeriv n (fun r : ℝ => f (x + r • e)) = fun r => directional n f e (x+r • e) := by + induction n with + | zero => rfl + | succ n ih => + rw [iteratedDeriv_succ,ih] + funext r + have hd : HasDerivAt (fun r : ℝ => x+r • e) e r := by + convert (hasDerivAt_const r x).add ((hasDerivAt_id r).smul_const e) using 1 <;> first | rfl | simp only [zero_add,one_smul] + exact (((directional_contDiff f hf e n).differentiable (by simp) (x+r • e)).hasFDerivAt.comp_hasDerivAt r hd).deriv + +omit [CompleteSpace E] in +lemma compact_smooth_fderiv_bound (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) + (hfc : HasCompactSupport f) : + ∃ C : ℝ, ∀ x y, ‖fderiv ℝ f y - fderiv ℝ f x‖ ≤ C * ‖y-x‖ := by + have hd : ContDiff ℝ (↑(⊤ : ℕ∞)) (fderiv ℝ f) := hf.fderiv_right (by simp) + have hdc : HasCompactSupport (fderiv ℝ f) := hfc.fderiv ℝ + have hddc : HasCompactSupport (fderiv ℝ (fderiv ℝ f)) := hdc.fderiv ℝ + have hdd : Continuous (fderiv ℝ (fderiv ℝ f)) := hd.continuous_fderiv (by simp) + have hbnd : ∃ C : ℝ, ∀ x : E, ‖fderiv ℝ (fderiv ℝ f) x‖ ≤ C := HasCompactSupport.exists_bound_of_continuous (f := fderiv ℝ (fderiv ℝ f)) hddc hdd + obtain ⟨C,hC⟩ := hbnd + refine ⟨C, fun x y => ?_⟩ + exact Convex.norm_image_sub_le_of_norm_fderiv_le + (fun u _ => hd.differentiable (by simp) u) (fun u _ => hC u) + convex_univ (mem_univ x) (mem_univ y) + +omit [CompleteSpace E] in +lemma compact_smooth_line_bound (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) + (hfc : HasCompactSupport f) (e : E) (n : ℕ) : + ∃ C : ℝ, ∀ x w, |iteratedDeriv n (fun r : ℝ => f (x+r • e)) w| ≤ C := by + obtain ⟨C,hC⟩ := (directional_compact f hfc e n).exists_bound_of_continuous + (directional_contDiff f hf e n).continuous + refine ⟨C, fun x w => ?_⟩ + rw [iteratedDeriv_line f hf e x n] + exact (show |directional n f e (x+w • e)| ≤ C by + simpa only [Real.norm_eq_abs] using hC (x+w • e)) + +omit [CompleteSpace E] in +lemma compact_smooth_test_bounds (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) + (hfc : HasCompactSupport f) (e : E) : + ∃ C M : ℝ, 0 ≤ C ∧ 0 ≤ M ∧ + (∀ x y, ‖fderiv ℝ f y - fderiv ℝ f x‖ ≤ C * ‖y-x‖) ∧ + (∀ x w, |iteratedDeriv 3 (fun r : ℝ => f (x+r • e)) w| ≤ C) ∧ + (∀ x, |f x| ≤ M) ∧ (∀ x, ‖fderiv ℝ f x‖ ≤ M) ∧ + (∀ x, |iteratedDeriv 2 (fun r : ℝ => f (x+r • e)) 0| ≤ M) := by + obtain ⟨C₀,hC₀⟩ := compact_smooth_fderiv_bound f hf hfc + obtain ⟨C₁,hC₁⟩ := compact_smooth_line_bound f hf hfc e 3 + obtain ⟨M₀,hM₀⟩ := hfc.exists_bound_of_continuous hf.continuous + have hdc : HasCompactSupport (fderiv ℝ f) := hfc.fderiv ℝ + obtain ⟨M₁,hM₁⟩ := hdc.exists_bound_of_continuous (hf.continuous_fderiv (by simp)) + obtain ⟨M₂,hM₂⟩ := compact_smooth_line_bound f hf hfc e 2 + let C := max 0 (max C₀ C₁) + let M := max 0 (max M₀ (max M₁ M₂)) + have hC₀' : C₀ ≤ C := (le_max_left _ _).trans (le_max_right _ _) + have hC₁' : C₁ ≤ C := (le_max_right _ _).trans (le_max_right _ _) + have hM₀' : M₀ ≤ M := (le_max_left _ _).trans (le_max_right _ _) + have hM₁' : M₁ ≤ M := (le_max_left _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) + have hM₂' : M₂ ≤ M := (le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) + refine ⟨C,M,le_max_left _ _,le_max_left _ _,?_,?_,?_,?_,?_⟩ + · intro x y + exact (hC₀ x y).trans (mul_le_mul_of_nonneg_right hC₀' (norm_nonneg _)) + · intro x w + exact (hC₁ x w).trans hC₁' + · intro x + exact (show |f x| ≤ M₀ by simpa only [Real.norm_eq_abs] using hM₀ x).trans hM₀' + · intro x + exact (hM₁ x).trans hM₁' + · intro x + exact (hM₂ x 0).trans hM₂' + +variable [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +end ExactSLEGenerator +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/FrozenExpectations.lean b/lean/OAI/Probability/SLEGauge/FrozenExpectations.lean new file mode 100644 index 0000000000000000000000000000000000000000..b9c766fe28f621b0a448b4a18d42758a070fdede --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/FrozenExpectations.lean @@ -0,0 +1,465 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.EulerMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] +lemma expected_frozen_nodes {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (U : ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mU : ∀ k, MeasurableSet (U k)) + (h : ℝ≥0) (q : E × ℝ) + (hU : ∀ (k : ℕ) b c, (∀ t ≤ (k:ℝ≥0)*h, b t = c t) → ∀ x, + ((b,x) ∈ U k ↔ (c,x) ∈ U k)) + {M : ℝ} (hv : ∀ x b, ‖v x b‖ ≤ M) + (hg : ∀ k b x, (b,x) ∈ U k → A.D x.1 x.2 (v x.1 x.2)+deriv (deriv (A.F x.1)) x.2/2 ≤ 0) + (k : ℕ) : + (∫ b : Driver, A.F (frozenNodes v U h q k b).1 (frozenNodes v U h q k b).2 ∂W) ≤ + A.F q.1 q.2+(k:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h:ℝ)^2+A.C₃/3*(h:ℝ)*Real.sqrt h) := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hi (i : ℕ) : Integrable (fun b : Driver => + A.F (frozenNodes v U h q i b).1 (frozenNodes v U h q i b).2) W := by + have hm := (measurable_frozenNodes v mv U mU h q i).comp + (Measurable.of_eval fun time => (show Continuous (fun driver : Driver => driver time) from continuous_eval_const time).measurable) + exact (integrable_const A.C₀).mono' (A.mF.comp hm).aestronglyMeasurable + (Filter.Eventually.of_forall fun b => by simpa only [Real.norm_eq_abs] using A.hF _ _) + induction k with + | zero => simp [frozenNodes,Measure.real] + | succ k ih => + have he := expected_frozen_step hW A v mv U mU h q hU hv hg k + rw [integral_sub (hi (k+1)) (hi k)] at he + push_cast + linarith + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem expected_frozen_limit {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (U : ℕ → ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ))) + (mU : ∀ n k, MeasurableSet (U n k)) (h : ℕ → ℝ≥0) (k : ℕ → ℕ) (q : E × ℝ) + (hU : ∀ n (k : ℕ) b c, (∀ t ≤ (k:ℝ≥0)*h n, b t = c t) → ∀ x, + ((b,x) ∈ U n k ↔ (c,x) ∈ U n k)) + (M : ℝ) (hv : ∀ x b, ‖v x b‖ ≤ M) + (hg : ∀ n k b x, (b,x) ∈ U n k → + A.D x.1 x.2 (v x.1 x.2)+deriv (deriv (A.F x.1)) x.2/2 ≤ 0) + (X : Driver → E × ℝ) (t : ℝ) + (hh : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0)) + (ht : Tendsto (fun n => (k n:ℝ)*(h n:ℝ)) atTop (𝓝 t)) + (hX : ∀ᵐ (b : Driver) ∂W, Tendsto (fun n => frozenNodes v (U n) (h n) q (k n) b) + atTop (𝓝 (X b))) : + (∫ b, A.F (X b).1 (X b).2 ∂W) ≤ A.F q.1 q.2 := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hc : ∀ᵐ (b : Driver) ∂W, Tendsto (fun n => + A.F (frozenNodes v (U n) (h n) q (k n) b).1 (frozenNodes v (U n) (h n) q (k n) b).2) + atTop (𝓝 (A.F (X b).1 (X b).2)) := by + filter_upwards [hX] with b hb + exact A.cF.continuousAt.tendsto.comp hb + have hi : Tendsto (fun n => ∫ b : Driver, + A.F (frozenNodes v (U n) (h n) q (k n) b).1 (frozenNodes v (U n) (h n) q (k n) b).2 ∂W) + atTop (𝓝 (∫ b, A.F (X b).1 (X b).2 ∂W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ : Driver => A.C₀) + · intro n + have hm : Measurable (fun b : Driver => (b : ℝ≥0 → ℝ)) := + Measurable.of_eval fun time => (continuous_eval_const time).measurable + exact (A.mF.comp ((measurable_frozenNodes v mv (U n) (mU n) (h n) q (k n)).comp hm)).aestronglyMeasurable + · exact integrable_const A.C₀ + · intro n + exact Filter.Eventually.of_forall fun b => by + simpa only [Real.norm_eq_abs] using A.hF _ _ + · exact hc + have hs : Tendsto (fun n => Real.sqrt (h n:ℝ)) atTop (𝓝 0) := by + simpa only [Function.comp_def,Real.sqrt_zero] using (Real.continuous_sqrt.tendsto 0).comp hh + have he : Tendsto (fun n => (k n:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h n:ℝ)^2+ + A.C₃/3*(h n:ℝ)*Real.sqrt (h n))) atTop (𝓝 0) := by + have hh' := ht.mul (((tendsto_const_nhds (x := A.Cx*M^2+A.Ccross*M/2)).mul hh).add + ((tendsto_const_nhds (x := A.C₃/3)).mul hs)) + convert! hh' using 1 + · ext n; ring + · simp + have hb : Tendsto (fun n => A.F q.1 q.2+(k n:ℝ)*((A.Cx*M^2+A.Ccross*M/2)*(h n:ℝ)^2+ + A.C₃/3*(h n:ℝ)*Real.sqrt (h n))) atTop (𝓝 (A.F q.1 q.2)) := by + simpa using tendsto_const_nhds.add he + exact le_of_tendsto_of_tendsto hi hb (Filter.Eventually.of_forall fun n => + expected_frozen_nodes hW A v mv (U n) (mU n) (h n) q (hU n) hv (hg n) (k n)) + +end SLEExactGauge.BrownianCalculus + + + +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.EulerGeneral + +variable {Vspace : Type*} [NormedAddCommGroup Vspace] [NormedSpace ℝ Vspace] [CompleteSpace Vspace] + +def nodes (f : ℝ → Vspace → Vspace) (h : ℝ) (z : Vspace) : ℕ → Vspace + | 0 => z + | k+1 => nodes f h z k + h • f ((k:ℝ)*h) (nodes f h z k) + +def interpolate (f : ℝ → Vspace → Vspace) (h : ℝ) (z : Vspace) (t : ℝ) : Vspace := + let k := ⌊t/h⌋₊ + let w := t/h-(k:ℝ) + (1-w) • nodes f h z k + w • nodes f h z (k+1) + +lemma finite_gronwall {e : ℕ → ℝ} {L h ε : ℝ} (hL : 0 ≤ L) (hh : 0 ≤ h) + (hε : 0 ≤ ε) (he0 : e 0 ≤ 0) {N : ℕ} + (hrec : ∀ k < N, e (k+1) ≤ (1+L*h)*e k + ε*h) : + e N ≤ ε*((N:ℝ)*h)*Real.exp (L*((N:ℝ)*h)) := by + have hstep : ∀ k ≤ N, e k ≤ ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h)) := by + intro k hk + induction k with + | zero => simpa using he0 + | succ k ih => + have hi := ih (by omega) + have hk' : k < N := by omega + have he : 1+L*h ≤ Real.exp (L*h) := by + simpa only [add_comm] using Real.add_one_le_exp (L*h) + have he1 : 1 ≤ Real.exp (L*(((k+1:ℕ):ℝ)*h)) := + Real.one_le_exp (by positivity) + calc e (k+1) + ≤ (1+L*h)*(ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h))) + ε*h := + (hrec k hk').trans (add_le_add (mul_le_mul_of_nonneg_left hi + (show 0 ≤ 1+L*h from by positivity)) le_rfl) + _ ≤ Real.exp (L*h)*(ε*((k:ℝ)*h)*Real.exp (L*((k:ℝ)*h))) + + (ε*h)*Real.exp (L*(((k+1:ℕ):ℝ)*h)) := by + exact add_le_add (mul_le_mul_of_nonneg_right he (by positivity)) + (le_mul_of_one_le_right (mul_nonneg hε hh) he1) + _ = ε*(((k+1:ℕ):ℝ)*h)*Real.exp (L*(((k+1:ℕ):ℝ)*h)) := by + have hex : Real.exp (L*(((k+1:ℕ):ℝ)*h)) = + Real.exp (L*h)*Real.exp (L*((k:ℝ)*h)) := by + rw [← Real.exp_add] + congr 1 + push_cast + ring + rw [hex] + push_cast + ring + exact hstep N le_rfl + +omit [CompleteSpace Vspace] in +lemma nodes_error {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {z : Vspace} {L h ε T : ℝ} + (hL : 0 ≤ L) (hh : 0 ≤ h) (hε : 0 ≤ ε) (hg0 : g 0 = z) + (hlip : ∀ t ∈ Icc 0 T, ∀ x y, ‖f t x-f t y‖ ≤ L*‖x-y‖) + (hres : ∀ k : ℕ, ((k+1:ℕ):ℝ)*h ≤ T → + ‖g (((k+1:ℕ):ℝ)*h) - g ((k:ℝ)*h) - h • f ((k:ℝ)*h) (g ((k:ℝ)*h))‖ ≤ ε*h) + (N : ℕ) (hN : (N:ℝ)*h ≤ T) : + ‖nodes f h z N - g ((N:ℝ)*h)‖ ≤ ε*T*Real.exp (L*T) := by + have hrec (k : ℕ) (hk : k < N) : + ‖nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h)‖ ≤ + (1+L*h)*‖nodes f h z k-g ((k:ℝ)*h)‖ + ε*h := by + have hkT : ((k+1:ℕ):ℝ)*h ≤ T := + (mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.succ_le_of_lt hk) hh).trans hN + have hk0 : 0 ≤ (k:ℝ)*h := by positivity + have hkT' : (k:ℝ)*h ≤ T := (by push_cast; nlinarith : (k:ℝ)*h ≤ ((k+1:ℕ):ℝ)*h).trans hkT + let r := g (((k+1:ℕ):ℝ)*h)-g ((k:ℝ)*h)-h • f ((k:ℝ)*h) (g ((k:ℝ)*h)) + have he : nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h) = + (nodes f h z k-g ((k:ℝ)*h)) + + h • (f ((k:ℝ)*h) (nodes f h z k)-f ((k:ℝ)*h) (g ((k:ℝ)*h))) - r := by + simp only [nodes, r, smul_sub] + abel + rw [he] + calc _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖ + + ‖h • (f ((k:ℝ)*h) (nodes f h z k)-f ((k:ℝ)*h) (g ((k:ℝ)*h)))‖ + ‖r‖ := + (norm_sub_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) + _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖ + + h*(L*‖nodes f h z k-g ((k:ℝ)*h)‖) + ε*h := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg hh] + exact add_le_add (add_le_add le_rfl (mul_le_mul_of_nonneg_left + (hlip _ ⟨hk0,hkT'⟩ _ _) hh)) (hres k hkT) + _ = _ := by ring + have hb := finite_gronwall (e := fun k => ‖nodes f h z k-g ((k:ℝ)*h)‖) + hL hh hε (by simp [nodes, hg0]) hrec + have hT : 0 ≤ T := (mul_nonneg (Nat.cast_nonneg _) hh).trans hN + exact hb.trans (by gcongr) + +omit [CompleteSpace Vspace] in +lemma residual_bound {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {T s h ε : ℝ} + (hder : ∀ t ∈ Icc 0 T, HasDerivWithinAt g (f t (g t)) (Icc 0 T) t) + (hs : 0 ≤ s) (hh : 0 ≤ h) (hsh : s+h ≤ T) + (hosc : ∀ t ∈ Icc s (s+h), ‖f t (g t)-f s (g s)‖ ≤ ε) : + ‖g (s+h)-g s-h • f s (g s)‖ ≤ ε*h := by + have hsub : Icc s (s+h) ⊆ Icc 0 T := fun t ht => ⟨hs.trans ht.1, ht.2.trans hsh⟩ + have hd (t : ℝ) (ht : t ∈ Icc s (s+h)) : + HasDerivWithinAt (fun u => g u-u • f s (g s)) + (f t (g t)-f s (g s)) (Icc s (s+h)) t := by + convert! ((hder t (hsub ht)).mono hsub).sub + (((hasDerivAt_id t).smul_const (f s (g s))).hasDerivWithinAt) using 1 + simp only [one_smul] + have hb := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hd hosc + (convex_Icc s (s+h)) (left_mem_Icc.mpr (by linarith)) + (right_mem_Icc.mpr (by linarith)) + have he : (g (s+h)-(s+h) • f s (g s))-(g s-s • f s (g s)) = + g (s+h)-g s-h • f s (g s) := by rw [add_smul]; abel + simpa only [he, add_sub_cancel_left, Real.norm_eq_abs, abs_of_nonneg hh] using hb + +omit [CompleteSpace Vspace] in +lemma exists_residual_bound {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {T : ℝ} + (hder : ∀ t ∈ Icc 0 T, HasDerivWithinAt g (f t (g t)) (Icc 0 T) t) + (hcf : ContinuousOn (fun t => f t (g t)) (Icc 0 T)) {ε : ℝ} (hε : 0 < ε) : + ∃ δ > 0, ∀ h : ℝ, 0 ≤ h → h < δ → ∀ s : ℝ, 0 ≤ s → s+h ≤ T → + ‖g (s+h)-g s-h • f s (g s)‖ ≤ ε*h := by + have hu := isCompact_Icc.uniformContinuousOn_of_continuous hcf + obtain ⟨δ,hδ,hb⟩ := Metric.uniformContinuousOn_iff.mp hu ε hε + refine ⟨δ,hδ, fun h hh hhδ s hs hsT => residual_bound hder hs hh hsT ?_⟩ + intro u hu + apply le_of_lt + have huT : u ∈ Icc 0 T := ⟨hs.trans hu.1, hu.2.trans hsT⟩ + have hsT' : s ∈ Icc 0 T := ⟨hs, by linarith⟩ + have hd : dist u s < δ := by + rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hu.1)] + linarith [hu.2] + simpa only [dist_eq_norm] using hb u huT s hsT' hd + +omit [CompleteSpace Vspace] in +lemma norm_interpolate_sub_le {x y z : Vspace} {w E : ℝ} + (hw : 0 ≤ w) (hw1 : w ≤ 1) (hx : ‖x-z‖ ≤ E) (hy : ‖y-z‖ ≤ E) : + ‖(1-w) • x+w • y-z‖ ≤ E := by + have he : (1-w) • x+w • y-z = (1-w) • (x-z)+w • (y-z) := by + simp only [sub_smul, one_smul, smul_sub] + abel + rw [he] + calc _ ≤ ‖(1-w) • (x-z)‖+‖w • (y-z)‖ := norm_add_le _ _ + _ = (1-w)*‖x-z‖+w*‖y-z‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hw1), abs_of_nonneg hw] + _ ≤ (1-w)*E+w*E := add_le_add (mul_le_mul_of_nonneg_left hx (sub_nonneg.mpr hw1)) + (mul_le_mul_of_nonneg_left hy hw) + _ = E := by ring + +omit [CompleteSpace Vspace] in +lemma interpolate_error {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {z : Vspace} {L M h ε T t : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hh : 0 < h) (hε : 0 ≤ ε) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hres : ∀ k : ℕ, ((k+1:ℕ):ℝ)*h ≤ T → + ‖g (((k+1:ℕ):ℝ)*h) - g ((k:ℝ)*h) - h • f ((k:ℝ)*h) (g ((k:ℝ)*h))‖ ≤ ε*h) + (hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v|) + (ht : 0 ≤ t) (htT : t+h ≤ T) : + ‖interpolate f h z t-g t‖ ≤ ε*T*Real.exp (L*T)+M*h := by + let k := ⌊t/h⌋₊ + have hf0 : (k:ℝ) ≤ t/h := Nat.floor_le (div_nonneg ht hh.le) + have hf1 : t/h < (k:ℝ)+1 := Nat.lt_floor_add_one _ + have hk0 : 0 ≤ (k:ℝ)*h := by positivity + have hkt : (k:ℝ)*h ≤ t := (le_div_iff₀ hh).mp hf0 + have htks : t < ((k+1:ℕ):ℝ)*h := by + push_cast + exact (div_lt_iff₀ hh).mp hf1 + have hksT : ((k+1:ℕ):ℝ)*h ≤ T := by push_cast; nlinarith + have hkT : (k:ℝ)*h ≤ T := hkt.trans (by linarith) + have hw : 0 ≤ t/h-(k:ℝ) := by linarith + have hw1 : t/h-(k:ℝ) ≤ 1 := by linarith + apply norm_interpolate_sub_le hw hw1 + · calc _ ≤ ‖nodes f h z k-g ((k:ℝ)*h)‖+‖g ((k:ℝ)*h)-g t‖ := + norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ ε*T*Real.exp (L*T)+M*h := add_le_add + (nodes_error hL hh.le hε hg0 hlip hres k hkT) + ((hpath _ ⟨hk0,hkT⟩ _ ⟨ht,by linarith⟩).trans (by + rw [abs_of_nonpos (sub_nonpos.mpr hkt)] + apply mul_le_mul_of_nonneg_left _ hM + push_cast at htks + linarith)) + · calc _ ≤ ‖nodes f h z (k+1)-g (((k+1:ℕ):ℝ)*h)‖+ + ‖g (((k+1:ℕ):ℝ)*h)-g t‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ ε*T*Real.exp (L*T)+M*h := add_le_add + (nodes_error hL hh.le hε hg0 hlip hres (k+1) hksT) + ((hpath _ ⟨by positivity,hksT⟩ _ ⟨ht,by linarith⟩).trans (by + rw [abs_of_nonneg (by linarith : 0 ≤ ((k+1:ℕ):ℝ)*h-t)] + apply mul_le_mul_of_nonneg_left _ hM + push_cast + linarith)) + +omit [CompleteSpace Vspace] in +lemma converge {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {z : Vspace} {L M T t : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (ht : 0 ≤ t) (htT : t < T) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) : + Tendsto (fun n => interpolate f (h n) z t) atTop (𝓝 (g t)) := by + have hT : 0 < T := lt_of_le_of_lt ht htT + have hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v| := by + intro u hu v hv + simpa only [Real.norm_eq_abs] using + Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hder hbound (convex_Icc 0 T) hv hu + rw [Metric.tendsto_nhds] + intro ε hε + let E := T*Real.exp (L*T) + have hE : 0 < E := mul_pos hT (Real.exp_pos _) + let η := ε/(2*E) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨δ,hδ,hres⟩ := exists_residual_bound hder hcf hη + have hev1 : ∀ᶠ n in atTop, h n < δ := (tendsto_order.1 hh0).2 δ hδ + have hev2 : ∀ᶠ n in atTop, h n < T-t := + (tendsto_order.1 hh0).2 (T-t) (sub_pos.mpr htT) + have hev3 : ∀ᶠ n in atTop, h n < ε/(2*(M+1)) := + (tendsto_order.1 hh0).2 _ (div_pos hε (by positivity)) + filter_upwards [hev1,hev2,hev3] with n hnδ hnT hnε + rw [dist_eq_norm] + have hb := interpolate_error hL hM (hh n) hη.le hg0 hlip + (fun k hk => by + have hc : ((k+1:ℕ):ℝ)*h n = (k:ℝ)*h n+h n := by push_cast; ring + rw [hc] at hk ⊢ + exact hres (h n) (hh n).le hnδ ((k:ℝ)*h n) (mul_nonneg (Nat.cast_nonneg _) (hh n).le) hk) + hpath ht (by linarith : t+h n ≤ T) + apply lt_of_le_of_lt hb + have hηE : η*T*Real.exp (L*T) = ε/2 := by + dsimp [η, E] + field_simp + have hsmall : M*h n < ε/2 := by + have hhε := (lt_div_iff₀ (by positivity : 0 < 2*(M+1))).mp hnε + nlinarith [hh n] + rw [hηE] + linarith + +omit [CompleteSpace Vspace] in +lemma converge_uniformOn {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {z : Vspace} {L M T U : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Icc 0 T, HasDerivWithinAt g (f u (g u)) (Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Icc 0 T)) + (hbound : ∀ u ∈ Icc 0 T, ‖f u (g u)‖ ≤ M) + (hU : 0 ≤ U) (hUT : U < T) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) : + TendstoUniformlyOn (fun n => interpolate f (h n) z) g atTop (Icc 0 U) := by + have hT : 0 < T := lt_of_le_of_lt hU hUT + have hpath : ∀ u ∈ Icc 0 T, ∀ v ∈ Icc 0 T, ‖g u-g v‖ ≤ M*|u-v| := by + intro u hu v hv + simpa only [Real.norm_eq_abs] using + Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hder hbound (convex_Icc 0 T) hv hu + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + let E := T*Real.exp (L*T) + have hE : 0 < E := mul_pos hT (Real.exp_pos _) + let η := ε/(2*E) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨δ,hδ,hres⟩ := exists_residual_bound hder hcf hη + have hev1 : ∀ᶠ n in atTop, h n < δ := (tendsto_order.1 hh0).2 δ hδ + have hev2 : ∀ᶠ n in atTop, h n < T-U := + (tendsto_order.1 hh0).2 (T-U) (sub_pos.mpr hUT) + have hev3 : ∀ᶠ n in atTop, h n < ε/(2*(M+1)) := + (tendsto_order.1 hh0).2 _ (div_pos hε (by positivity)) + filter_upwards [hev1,hev2,hev3] with n hnδ hnT hnε + intro t ht + rw [dist_comm, dist_eq_norm] + have hb := interpolate_error hL hM (hh n) hη.le hg0 hlip + (fun k hk => by + have hc : ((k+1:ℕ):ℝ)*h n = (k:ℝ)*h n+h n := by push_cast; ring + rw [hc] at hk ⊢ + exact hres (h n) (hh n).le hnδ ((k:ℝ)*h n) + (mul_nonneg (Nat.cast_nonneg _) (hh n).le) hk) + hpath ht.1 (by linarith [ht.2] : t+h n ≤ T) + apply lt_of_le_of_lt hb + have hηE : η*T*Real.exp (L*T) = ε/2 := by + dsimp [η, E] + field_simp + have hsmall : M*h n < ε/2 := by + have hhε := (lt_div_iff₀ (by positivity : 0 < 2*(M+1))).mp hnε + nlinarith [hh n] + rw [hηE] + linarith + +end SLEExactGauge.EulerGeneral + +namespace SLEExactGauge.EulerGeneral +variable {Vspace : Type*} [NormedAddCommGroup Vspace] [NormedSpace ℝ Vspace] [CompleteSpace Vspace] + +omit [CompleteSpace Vspace] in +lemma norm_nodes_sub_interpolate {f : ℝ → Vspace → Vspace} {h t M : ℝ} {z : Vspace} + (hh : 0 < h) (ht : 0 ≤ t) (hM : 0 ≤ M) + (hf : ∀ u ≥ 0, ∀ w, ‖f u w‖ ≤ M) : + ‖nodes f h z ⌊t/h⌋₊ - interpolate f h z t‖ ≤ h*M := by + let k := ⌊t/h⌋₊ + let w := t/h-(k:ℝ) + have hfloor : (k:ℝ) ≤ t/h := Nat.floor_le (div_nonneg ht hh.le) + have hlt : t/h < (k:ℝ)+1 := Nat.lt_floor_add_one (t/h) + have hw : 0 ≤ w := sub_nonneg.mpr hfloor + have hw1 : w ≤ 1 := by dsimp [w]; linarith + have he : nodes f h z k - interpolate f h z t = + -(w*h) • f ((k:ℝ)*h) (nodes f h z k) := by + dsimp only [interpolate] + change nodes f h z k- ((1-w) • nodes f h z k+w • nodes f h z (k+1)) = _ + rw [nodes, smul_add, sub_smul, one_smul, smul_smul] + module + change ‖nodes f h z k - interpolate f h z t‖ ≤ _ + rw [he, norm_smul, Real.norm_eq_abs, abs_neg, abs_of_nonneg (mul_nonneg hw hh.le)] + calc w*h*‖f ((k:ℝ)*h) (nodes f h z k)‖ + ≤ w*h*M := mul_le_mul_of_nonneg_left (hf _ (by positivity) _) (by positivity) + _ ≤ h*M := by nlinarith [mul_nonneg hh.le hM] + +omit [CompleteSpace Vspace] in +lemma nodes_converge {f : ℝ → Vspace → Vspace} {g : ℝ → Vspace} {z : Vspace} {L M T t : ℝ} + (hL : 0 ≤ L) (hM : 0 ≤ M) (hg0 : g 0 = z) + (hlip : ∀ u ∈ Set.Icc 0 T, ∀ x y, ‖f u x-f u y‖ ≤ L*‖x-y‖) + (hder : ∀ u ∈ Set.Icc 0 T, HasDerivWithinAt g (f u (g u)) (Set.Icc 0 T) u) + (hcf : ContinuousOn (fun u => f u (g u)) (Set.Icc 0 T)) + (hbound : ∀ u ≥ 0, ∀ w, ‖f u w‖ ≤ M) + (ht : 0 ≤ t) (htT : t < T) + {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) (hh0 : Tendsto h atTop (𝓝 0)) : + Tendsto (fun n => nodes f (h n) z ⌊t/h n⌋₊) atTop (𝓝 (g t)) := by + have hi := converge hL hM hg0 hlip hder hcf (fun u hu => hbound u hu.1 _) ht htT hh hh0 + have hd : Tendsto (fun n => nodes f (h n) z ⌊t/h n⌋₊-interpolate f (h n) z t) + atTop (𝓝 0) := by + apply squeeze_zero_norm (fun n => norm_nodes_sub_interpolate (hh n) ht hM hbound) + simpa using hh0.mul_const M + have he := hd.add hi + simpa only [sub_add_cancel, zero_add] using he + +lemma mesh_times_converge {h : ℕ → ℝ} (hh : ∀ n, 0 < h n) + (hh0 : Tendsto h atTop (𝓝 0)) {t : ℝ} (ht : 0 ≤ t) : + Tendsto (fun n => (⌊t/h n⌋₊:ℝ)*h n) atTop (𝓝 t) := by + have hb (n : ℕ) : 0 ≤ t-(⌊t/h n⌋₊:ℝ)*h n ∧ t-(⌊t/h n⌋₊:ℝ)*h n ≤ h n := by + have hl := Nat.floor_le (div_nonneg ht (hh n).le) + have hu := Nat.lt_floor_add_one (t/h n) + have hl' := (le_div_iff₀ (hh n)).mp hl + have hu' := (div_lt_iff₀ (hh n)).mp hu + constructor <;> linarith + have hz : Tendsto (fun n => t-(⌊t/h n⌋₊:ℝ)*h n) atTop (𝓝 0) := + squeeze_zero (fun n => (hb n).1) (fun n => (hb n).2) hh0 + have he := (tendsto_const_nhds (x := t) (f := atTop)).sub hz + simpa only [sub_sub_cancel, sub_zero] using he + +end SLEExactGauge.EulerGeneral + +namespace SLEExactGauge.EulerGeneral +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +end SLEExactGauge.EulerGeneral +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/FutureSupport.lean b/lean/OAI/Probability/SLEGauge/FutureSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..45a3b629eb94fa5031f1d157dba100f93aaf3880 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/FutureSupport.lean @@ -0,0 +1,416 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadialRestart +import OAI.Probability.SLEGauge.RadonKernels + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] + + + +theorem random_set_sub_null_of_compact_means (μ ν : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (μ ω)] [∀ ω, IsFiniteMeasureOnCompacts (ν ω)] + (W : Measure Ω) [IsFiniteMeasureOnCompacts (ν ∘ₘ W)] + (D : Set (Ω × X)) (hD : MeasurableSet D) + (hle : ∀ᵐ ω ∂W, μ ω≤ν ω) + (he : ∀ K : Set X, IsCompact K → + (∫⁻ω, ν ω ({x | (ω,x)∈D}∩K) ∂W) = ∫⁻ω, μ ω ({x | (ω,x)∈D}∩K) ∂W) : + ∀ᵐ ω ∂W, (ν ω-μ ω) {x | (ω,x)∈D}=0 := by + have := isSFiniteKernel_of_locally_finite μ + have := isSFiniteKernel_of_locally_finite ν + let K := CompactExhaustion.choice X + have hfinite (n : ℕ) : (∫⁻ω, ν ω ({x | (ω,x)∈D}∩K n) ∂W)<∞ := + lt_of_le_of_lt (lintegral_mono (fun ω => measure_mono inter_subset_right)) (by + rw [← Measure.bind_apply (K.isCompact n).measurableSet ν.aemeasurable] + exact (K.isCompact n).measure_lt_top) + have heq (n : ℕ) : (fun ω => μ ω ({x | (ω,x)∈D}∩K n)) =ᵐ[W] + (fun ω => ν ω ({x | (ω,x)∈D}∩K n)) := by + apply ae_eq_of_ae_le_of_lintegral_le + · filter_upwards [hle] with ω hω + exact hω _ + · rw [← he (K n) (K.isCompact n)] + exact (hfinite n).ne + · exact (Kernel.measurable_kernel_prodMk_left + (hD.inter (measurable_snd (K.isCompact n).measurableSet))).aemeasurable + · exact (he (K n) (K.isCompact n)).le + filter_upwards [hle,ae_all_iff.mpr heq] with ω hω heω + have hsec : MeasurableSet {x | (ω,x)∈D} := measurable_prodMk_left hD + have hnull (n : ℕ) : (ν ω-μ ω) ({x | (ω,x)∈D}∩K n)=0 := by + have : IsFiniteMeasure ((μ ω).restrict (K n)) := + ⟨by simpa only [Measure.restrict_apply_univ] using (K.isCompact n).measure_lt_top (μ := μ ω)⟩ + rw [← Measure.restrict_apply hsec, + Measure.restrict_sub_eq_restrict_sub_restrict (K.isCompact n).measurableSet, + Measure.sub_apply hsec (Measure.restrict_mono Subset.rfl hω), + Measure.restrict_apply hsec,Measure.restrict_apply hsec,heω n,tsub_self] + have heU : (⋃ n, {x | (ω,x)∈D}∩K n)={x | (ω,x)∈D} := by + rw [← inter_iUnion,K.iUnion_eq,inter_univ] + rw [← heU] + exact measure_iUnion_null hnull + +end SLEExactGauge.MassVersions + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma survivingGreen_eq_zero_iff (a : ℝ) (t : ℝ≥0) + (b : ExactSLEGenerator.Driver) (z : ℂ) : + survivingGreen a t b z=0 ↔ ¬alive a b.1 t z := by + unfold survivingGreen + split_ifs with h <;> simp [h,physicalGreen,Real.exp_ne_zero] + + + +lemma deadSet_raw_measurable (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (μ ν : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] [∀ b, IsFiniteMeasureOnCompacts (ν b)] + (hμ : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z, f z ∂μ b) W) + (hν : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z, f z ∂ν b) W) + (hle : ∀ᵐ b ∂W, μ b≤ν b) + (he : ∀ f : C_c(UpperPlane,ℝ), ∀ U : Set ExactSLEGenerator.Driver, + MeasurableSet[rawFiltration t] U → + (∫b in U, (∫z,f z∂ν b)-(∫z,f z∂μ b) ∂W) = + ∫b in U, (∫z,f z*survivingGreen a t b z.1 ∂upperArea) ∂W) : + ∀ᵐ b ∂W, (ν b-μ b) {z : UpperPlane | ¬alive a b.1 t z.1}=0 := by + let D : Set (ExactSLEGenerator.Driver × UpperPlane) := + {p | ¬alive a p.1.1 t p.2.1} + have hD := deadSet_raw_measurable a ha t + have hD₀ : MeasurableSet D := prod_sigma_le (rawFiltration.le t) _ _ hD + have := average_finiteOnCompacts ν W hν + apply random_set_sub_null_of_compact_means μ ν W D hD₀ hle + intro K hK + let E : Set (ExactSLEGenerator.Driver × UpperPlane) := D∩Prod.snd ⁻¹' K + have hE : MeasurableSet[(rawFiltration t).prod (inferInstance : MeasurableSpace UpperPlane)] E := + hD.inter (measurable_snd hK.measurableSet) + have hE₀ : MeasurableSet E := prod_sigma_le (rawFiltration.le t) _ _ hE + let H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞ := E.indicator (fun _ => 1) + have hH : Measurable[(rawFiltration t).prod (inferInstance : MeasurableSpace UpperPlane)] H := + measurable_const.indicator hE + have hid := compact_conditional_to_random_tests a ha W hW t μ ν hμ hν he H hH + have hev (ρ : Measure UpperPlane) (b : ExactSLEGenerator.Driver) : + (∫⁻z, H (b,z) ∂ρ)=ρ ({z | (b,z)∈D}∩K) := by + have hh := lintegral_indicator_const_comp (μ:=ρ) + ((measurable_const (a:=b)).prodMk measurable_id) hE₀ (1 : ℝ≥0∞) + have hs : (fun z : UpperPlane => (b,id z)) ⁻¹' E = {z | (b,z)∈D}∩K := by + ext z + rfl + rw [hs, one_mul] at hh + exact hh + have hz (b : ExactSLEGenerator.Driver) (z : UpperPlane) : + H (b,z)*ENNReal.ofReal (survivingGreen a t b z.1)=0 := by + by_cases h : (b,z)∈E + · rw [(survivingGreen_eq_zero_iff a t b z.1).mpr h.1,ENNReal.ofReal_zero,mul_zero] + · simp only [H,indicator_of_notMem h,zero_mul] + simpa only [hev,hz,lintegral_zero,add_zero] using hid + +end ExactSLEGreen +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + +lemma radialTime_ne_zero (a : ℝ) (ha : 0 ∫x, f x ∂μ ω) p W) + (K : Set X) (hK : IsCompact K) : + MemLp (fun ω => (μ ω K).toReal) p W := by + obtain ⟨g,hg1,-,hgc,hg01⟩ := exists_continuous_one_zero_of_isCompact + hK isClosed_empty (disjoint_empty K) + let f : C_c(X,ℝ) := ⟨g,hgc⟩ + apply (hp f).mono' + ((μ.measurable_coe hK.measurableSet).ennreal_toReal.aestronglyMeasurable) + apply Eventually.of_forall + intro ω + rw [Real.norm_of_nonneg ENNReal.toReal_nonneg] + have hpos : 0≤∫x,f x∂μ ω := integral_nonneg (fun x => (hg01 x).1) + exact ENNReal.toReal_le_of_le_ofReal hpos + (f.integrable.measure_le_integral (Eventually.of_forall (fun x => (hg01 x).1)) + (fun x hx => le_of_eq ((hg1 hx).symm))) + +end SLEExactGauge.MassVersions +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +noncomputable def initialGreen (a : ℝ) (z : UpperPlane) : ℝ := + Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0) + +lemma initialGreen_pos (a : ℝ) (z : UpperPlane) : 0 < initialGreen a z := + mul_pos (Real.exp_pos _) (Real.exp_pos _) + +lemma initialGreen_continuous (a : ℝ) : Continuous (initialGreen a) := by + have hc : Continuous (fun z : UpperPlane => (z.1,(0:ℝ))) := + continuous_subtype_val.prodMk continuous_const + have hg : Continuous (fun z : UpperPlane => physicalGreen a (z.1,0)) := by + apply continuous_iff_continuousAt.mpr + intro z + exact (hasFDerivAt_physicalGreen a (z.1,0) z.2).continuousAt.comp (f := fun z : UpperPlane => (z.1,(0:ℝ))) hc.continuousAt + exact continuous_const.mul hg + + +noncomputable def initialGreenMeasure (a : ℝ) : Measure UpperPlane := + upperArea.withDensity (fun z => ENNReal.ofReal (initialGreen a z)) + +lemma initialGreenMeasure_compact_integrable (a : ℝ) (f : C_c(UpperPlane,ℝ)) : + Integrable f (initialGreenMeasure a) := by + rw [initialGreenMeasure,integrable_withDensity_iff_integrable_smul' + (initialGreen_continuous a).measurable.ennreal_ofReal + (Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] + simp only [ENNReal.toReal_ofReal (initialGreen_pos a _).le,smul_eq_mul] + let g : C_c(UpperPlane,ℝ) := ⟨⟨fun z => initialGreen a z*f z, + (initialGreen_continuous a).mul f.continuous⟩, f.hasCompactSupport.mul_left⟩ + exact g.integrable + +instance initialGreenMeasure_finite (a : ℝ) : IsFiniteMeasureOnCompacts (initialGreenMeasure a) := + finiteOnCompacts_of_integrable_tests _ (initialGreenMeasure_compact_integrable a) + +lemma initialGreenMeasure_compact_eval (a : ℝ) (f : C_c(UpperPlane,ℝ)) : + (∫z,f z∂initialGreenMeasure a) = ∫z, f z*initialGreen a z∂upperArea := by + rw [initialGreenMeasure,integral_withDensity_eq_integral_toReal_smul] + · simp only [ENNReal.toReal_ofReal (initialGreen_pos a _).le,smul_eq_mul,mul_comm] + · exact (initialGreen_continuous a).measurable.ennreal_ofReal + · exact Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top) + + + +theorem initialGreenMeasure_eq_average (a : ℝ) + (μ : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] (W : Measure ExactSLEGenerator.Driver) + (hμ : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂μ b) W) + (he : ∀ f : C_c(UpperPlane,ℝ), (∫b, (∫z,f z∂μ b) ∂W)=∫z, f z*initialGreen a z∂upperArea) : + μ ∘ₘ W=initialGreenMeasure a := by + have := average_finiteOnCompacts μ W hμ + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + rw [average_compact_eval μ W hμ,initialGreenMeasure_compact_eval,he] + + + +theorem terminal_null_of_area_null (a : ℝ) + (μ : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] (W : Measure ExactSLEGenerator.Driver) + (he : μ ∘ₘ W=initialGreenMeasure a) (A : Set UpperPlane) + (hA : MeasurableSet A) (hz : upperArea A=0) : ∀ᵐ b ∂W, μ b A=0 := by + apply (lintegral_eq_zero_iff (μ.measurable_coe hA)).mp + rw [← Measure.bind_apply hA μ.aemeasurable,he] + exact withDensity_absolutelyContinuous _ _ hz + +end ExactSLEGreen +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma remainingMassDensity_mean_antitone (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (q : ℝ) (hq : 0 < q) (hq1 : q ≤ 1) : + Antitone (fun t : ℝ≥0 => ∫ b, remainingMassDensity a q t b z.1 ∂W) := by + let ρ := z.1.im * q + have hρ : 0 < ρ := mul_pos z.2 hq + have hr : ρ ≤ z.1.im := mul_le_of_le_one_right z.2.le hq1 + let K : ℝ≥0 → ExactSLEGenerator.Driver → ℝ := fun t b => + if (t : ℝ≥0∞) < radialTime a b.1 z.1 ρ then radialWeight a b.1 z.1 ρ else 0 + have hK (t : ℝ≥0) : Integrable (K t) W := by + have hm : MeasurableSet {b : ExactSLEGenerator.Driver | + (t : ℝ≥0∞) < radialTime a b.1 z.1 ρ} := by + have hle : MeasurableSet {b : ExactSLEGenerator.Driver | + radialTime a b.1 z.1 ρ ≤ (t : ℝ≥0∞)} := rawFiltration.le t _ + ((radialTime_stopping a (by linarith) z.1 z.2 ρ hρ hr).measurableSet_le t) + simpa only [compl_ofPred, not_le] using hle.compl + apply ((radialWeight_mean W hW a ha z.1 z.2 ρ hρ hr).1.indicator hm).congr + filter_upwards [] with b + simp only [K, indicator_apply, mem_ofPred_eq] + have hmean (t : ℝ≥0) : (∫b, remainingMassDensity a q t b z.1 ∂W) = + Real.exp (-alpha a*Real.log 2) * ∫b, K t b ∂W := by + have H := (radial_conditional_weight W hW a ha z.1 z.2 ρ hρ hr + (fun _ => t) (isStoppingTime_const rawFiltration t) univ MeasurableSet.univ).2 + simp only [setIntegral_univ] at H + simp only [remainingMassDensity,ite_eq_left z.2,integral_const_mul] + rw [← H] + intro s t hst + dsimp only + rw [hmean,hmean] + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + apply integral_mono (hK t) (hK s) + intro b + have hn := (radialWeight_bound a ha z.1 z.2 ρ hρ hr b).1 + have hst' : (s : ℝ≥0∞) ≤ t := ENNReal.coe_le_coe.mpr hst + dsimp only [K] + split_ifs with ht hs hs + · exact le_rfl + · exact False.elim (hs (hst'.trans_lt ht)) + · exact hn + · exact le_rfl + +lemma survivingGreen_mean_antitone (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Antitone (fun t : ℝ≥0 => ∫b, survivingGreen a t b z.1 ∂W) := by + let q : ℕ → ℝ := fun n => 1 / ((n : ℝ) + 1) + have hq (n : ℕ) : 0 < q n ∧ q n ≤ 1 := by + constructor + · exact div_pos zero_lt_one (by positivity) + · apply div_le_one_of_le₀ (by linarith [Nat.cast_nonneg (α := ℝ) n]) (by positivity) + have hq0 : Tendsto q atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + have hlim (t : ℝ≥0) : + Tendsto (fun n => ∫b, remainingMassDensity a (q n) t b z.1 ∂W) atTop + (𝓝 (∫b, survivingGreen a t b z.1 ∂W)) := by + apply tendsto_integral_of_dominated_convergence (fun b => survivingGreen a t b z.1) + · intro n + exact (remainingMassDensity_mean_bound a ha W hW (q n) (hq n).1 (hq n).2 t z.1 z.2).1.aestronglyMeasurable + · exact (actual_surviving_green a ha t).2.2 W hW z.1 z.2 |>.1 + · intro n + filter_upwards [] with b + rw [Real.norm_of_nonneg (remainingMassDensity_nonneg a (q n) t b z.1)] + exact remainingMassDensity_le_surviving a (q n) t b z.1 z.2 + · exact Eventually.of_forall (fun b => remaining_to_surviving a ha t q hq hq0 b z.1 z.2) + intro s t hst + exact le_of_tendsto_of_tendsto' (hlim t) (hlim s) (fun n => + remainingMassDensity_mean_antitone a ha W hW z (q n) (hq n).1 (hq n).2 hst) + +lemma survivingGreen_eq_killed (a : ℝ) (t : ℝ≥0) + (b : ExactSLEGenerator.Driver) (z : UpperPlane) : + survivingGreen a t b z.1 = Real.exp (-alpha a * Real.log 2) * + killedObservable a z (physicalGreen a) t b := by + unfold survivingGreen killedObservable + split_ifs <;> simp only [mul_zero] + +lemma physicalGreen_measurable (a : ℝ) : Measurable (physicalGreen a) := by + unfold physicalGreen logGreen Q X Y J + fun_prop + +lemma killedGreen_nonneg (a : ℝ) (z : UpperPlane) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : + 0 ≤ killedObservable a z (physicalGreen a) t b := + killedObservable_nonneg a z (physicalGreen a) (fun _ _ => (Real.exp_pos _).le) t b + +lemma killedGreen_integrable (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (t : ℝ≥0) : + Integrable (killedObservable a z (physicalGreen a) t) W := by + have h := (actual_surviving_green a ha t).2.2 W hW z.1 z.2 |>.1 + simpa only [survivingGreen_eq_killed,integrable_const_mul_iff (isUnit_iff_ne_zero.mpr (Real.exp_ne_zero _))] using h + +lemma killedGreen_mean_antitone (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Antitone (fun t : ℝ≥0 => ∫b, killedObservable a z (physicalGreen a) t b ∂W) := by + intro s t hst + have h := survivingGreen_mean_antitone a ha W hW z hst + simpa only [survivingGreen_eq_killed,integral_const_mul, + mul_le_mul_iff_right₀ (Real.exp_pos _)] using h + +lemma killedGreen_lintegral_antitone (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + Antitone (fun t : ℝ≥0 => ∫⁻b, ENNReal.ofReal + (killedObservable a z (physicalGreen a) t b) ∂W) := by + intro s t hst + dsimp only + rw [← ofReal_integral_eq_lintegral_ofReal (killedGreen_integrable a ha W hW z t) + (Eventually.of_forall (killedGreen_nonneg a z t)), + ← ofReal_integral_eq_lintegral_ofReal (killedGreen_integrable a ha W hW z s) + (Eventually.of_forall (killedGreen_nonneg a z s))] + exact ENNReal.ofReal_le_ofReal (killedGreen_mean_antitone a ha W hW z hst) + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/GaugeBounds.lean b/lean/OAI/Probability/SLEGauge/GaugeBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f5b898d65e1f746c57b39b484bee1884489f01c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/GaugeBounds.lean @@ -0,0 +1,439 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology + +namespace SLEExactGauge.Target + +open scoped ContinuousMapZero + +end SLEExactGauge.Target + + + + + +namespace SLEExactGauge.BrownianLaw +open SLEExactGauge.Target +open ProbabilityTheory Function +open scoped ContinuousMapZero + +instance : PolishSpace Driver := ContinuousMapZero.isClosedEmbedding_toContinuousMap.polishSpace + +def code (b : Driver) : ℚ → ℝ := fun q => b (Real.toNNReal (q:ℝ)) + +lemma measurable_code : Measurable code := + Measurable.of_eval fun _ => (continuous_eval_const _).measurable + +lemma dense_rational_time : DenseRange (fun q : ℚ => Real.toNNReal (q:ℝ)) := by + have hd : Surjective Real.toNNReal := fun x => ⟨(x:ℝ),Real.toNNReal_coe⟩ + exact hd.denseRange.comp Rat.denseRange_cast continuous_real_toNNReal + +lemma code_injective : Injective code := by + intro b c h + apply ContinuousMapZero.ext + have he := dense_rational_time.equalizer (map_continuous b) (map_continuous c) h + exact congrFun he + +lemma code_embedding : MeasurableEmbedding code := measurable_code.measurableEmbedding code_injective + +lemma evaluation_law_unique {W V : Measure Driver} + (hW : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) W) + (hV : IsBrownianReal (fun (s : ℝ≥0) (b : Driver) => b s) V) : W = V := by + let ev : Driver → (ℝ≥0 → ℝ) := fun b => b + have mev : Measurable ev := Measurable.of_eval fun time => (continuous_eval_const time).measurable + have hw : IsProjectiveLimit (W.map ev) BrownianReal.projectiveFamily := by + intro I + rw [Measure.map_map I.measurable_restrict mev] + exact (hW.hasLaw I).map_eq + have hv : IsProjectiveLimit (V.map ev) BrownianReal.projectiveFamily := by + intro I + rw [Measure.map_map I.measurable_restrict mev] + exact (hV.hasLaw I).map_eq + have he := hw.unique hv + have mr : Measurable (fun f : ℝ≥0 → ℝ => fun q : ℚ => f (Real.toNNReal (q:ℝ))) := + Measurable.of_eval fun _ => measurable_pi_apply _ + have hc := congrArg (Measure.map (fun f : ℝ≥0 → ℝ => fun q : ℚ => f (Real.toNNReal (q:ℝ)))) he + rw [Measure.map_map mr mev, Measure.map_map mr mev] at hc + exact code_embedding.map_injective hc + +end SLEExactGauge.BrownianLaw + +namespace SLEExactGauge.Deterministic + +open SLEExactGauge.Target + + + +def diameterCost (h : ℝ → ℝ) (r : ℝ≥0∞) : ℝ≥0∞ := + if r = ∞ then ∞ else ENNReal.ofReal (h r.toReal) + +lemma diameterCost_zero {h : ℝ → ℝ} (h0 : h 0 = 0) : + diameterCost h 0 = 0 := by + simp [diameterCost, h0] + +lemma gauge_nonneg {h : ℝ → ℝ} (hh : IsHausdorffGauge h) + {r : ℝ} (hr : 0 ≤ r) : 0 ≤ h r := by + rw [← hh.2.2.1] + exact hh.2.1 (by simp) hr hr + + + +theorem hausdorff_countable_covers {h : ℝ → ℝ} (h0 : h 0 = 0) (E : Set ℂ) : + hausdorff h E = + ⨆ (δ : ℝ≥0∞) (_ : 0 < δ), + ⨅ (U : ℕ → Set ℂ) (_ : E ⊆ ⋃ n, U n) (_ : ∀ n, Metric.ediam (U n) ≤ δ), + ∑' n, diameterCost h (Metric.ediam (U n)) := by + change OuterMeasure.mkMetric (diameterCost h) E = _ + rw [OuterMeasure.coe_mkMetric, Measure.mkMetric_apply] + congr 1 with δ + congr 1 with hδ + congr 1 with U + congr 1 with hEU + congr 1 with hU + apply tsum_congr + intro n + by_cases hn : (U n).Nonempty + · simp [hn] + · have hempty : U n = ∅ := Set.not_nonempty_iff_eq_empty.mp hn + simp [hempty, diameterCost_zero h0] + + +theorem hausdorff_tendsto_content (h : ℝ → ℝ) (E : Set ℂ) : + Tendsto + (fun δ : ℝ≥0∞ => + OuterMeasure.mkMetric'.pre (fun U : Set ℂ => diameterCost h (Metric.ediam U)) δ E) + (𝓝[>] 0) (𝓝 (hausdorff h E)) := + OuterMeasure.mkMetric'.tendsto_pre _ _ + + + +theorem mass_bound {h : ℝ → ℝ} {ν : OuterMeasure ℂ} {δ c : ℝ≥0∞} + (hδ : 0 < δ) (hc0 : c ≠ 0) (hc : c ≠ ∞) + (hν : ∀ U : Set ℂ, Metric.ediam U ≤ δ → + ν U ≤ c * diameterCost h (Metric.ediam U)) : + ν ≤ c • hausdorff h := by + have hm : ν ≤ OuterMeasure.mkMetric (c • diameterCost h) := + OuterMeasure.le_mkMetric _ ν δ hδ hν + change ν ≤ c • OuterMeasure.mkMetric (diameterCost h) + simpa only [OuterMeasure.mkMetric_smul _ hc hc0] using hm + + + +theorem hausdorff_pos_of_mass_bound {h : ℝ → ℝ} {ν : OuterMeasure ℂ} + {δ c : ℝ≥0∞} {E : Set ℂ} + (hδ : 0 < δ) (hc0 : c ≠ 0) (hc : c ≠ ∞) + (hν : ∀ U : Set ℂ, Metric.ediam U ≤ δ → + ν U ≤ c * diameterCost h (Metric.ediam U)) + (hE : 0 < ν E) : 0 < hausdorff h E := by + have H := mass_bound hδ hc0 hc hν E + by_contra hn + have hz : hausdorff h E = 0 := le_antisymm (not_lt.mp hn) zero_le + have hle : ν E ≤ 0 := by simpa [smul_apply, hz] using H + exact hE.not_ge hle + + + +theorem hausdorff_le_liminf_cost {ι : ℕ → Type*} [∀ n, Countable (ι n)] + (h : ℝ → ℝ) (E : Set ℂ) (r : ℕ → ℝ≥0∞) + (hr : Tendsto r atTop (𝓝 0)) (U : ∀ n, ι n → Set ℂ) + (hdiam : ∀ᶠ n in atTop, ∀ i, Metric.ediam (U n i) ≤ r n) + (hcover : ∀ᶠ n in atTop, E ⊆ ⋃ i, U n i) : + hausdorff h E ≤ liminf (fun n => ∑' i, diameterCost h (Metric.ediam (U n i))) atTop := by + change OuterMeasure.mkMetric (diameterCost h) E ≤ _ + rw [OuterMeasure.coe_mkMetric] + exact Measure.mkMetric_le_liminf_tsum E r hr U hdiam hcover _ + +section Intervals + +variable {X Ω : Type*} + + + +theorem all_real_intervals_of_rational (ν : OuterMeasure X) (γ : ℝ → X) + (H : ∀ p q : ℚ, 0 < p → p < q → + 0 < ν (γ '' Icc (p : ℝ) (q : ℝ)) ∧ + ν (γ '' Icc (p : ℝ) (q : ℝ)) < ∞) : + ∀ s t : ℝ, 0 < s → s < t → + 0 < ν (γ '' Icc s t) ∧ ν (γ '' Icc s t) < ∞ := by + intro s t hs hst + obtain ⟨p, hsp, hpt⟩ := exists_rat_btwn hst + obtain ⟨q, hpq, hqt⟩ := exists_rat_btwn hpt + have hp0 : (0 : ℚ) < p := by exact_mod_cast hs.trans hsp + have hpq' : p < q := by exact_mod_cast hpq + have hinner : γ '' Icc (p : ℝ) (q : ℝ) ⊆ γ '' Icc s t := + image_mono (Icc_subset_Icc hsp.le hqt.le) + have hpos := (H p q hp0 hpq').1.trans_le (ν.mono hinner) + obtain ⟨u, hu0, hus⟩ := exists_rat_btwn hs + obtain ⟨v, htv, _⟩ := exists_rat_btwn (lt_add_one t) + have hu0' : (0 : ℚ) < u := by exact_mod_cast hu0 + have huv : u < v := by exact_mod_cast hus.trans (hst.trans htv) + have houter : γ '' Icc s t ⊆ γ '' Icc (u : ℝ) (v : ℝ) := + image_mono (Icc_subset_Icc hus.le htv.le) + exact ⟨hpos, (ν.mono houter).trans_lt (H u v hu0' huv).2⟩ + + + +theorem ae_all_real_intervals_iff_rational [MeasurableSpace Ω] + (P : Measure Ω) (ν : OuterMeasure X) (γ : Ω → ℝ → X) : + (∀ᵐ ω ∂P, ∀ s t : ℝ, 0 < s → s < t → + 0 < ν (γ ω '' Icc s t) ∧ ν (γ ω '' Icc s t) < ∞) ↔ + (∀ p q : ℚ, 0 < p → p < q → + ∀ᵐ ω ∂P, 0 < ν (γ ω '' Icc (p : ℝ) (q : ℝ)) ∧ + ν (γ ω '' Icc (p : ℝ) (q : ℝ)) < ∞) := by + constructor + · intro H p q hp hpq + filter_upwards [H] with ω hω + exact hω p q (by exact_mod_cast hp) (by exact_mod_cast hpq) + · intro H + have H' : ∀ᵐ ω ∂P, ∀ p q : ℚ, 0 < p → p < q → + 0 < ν (γ ω '' Icc (p : ℝ) (q : ℝ)) ∧ + ν (γ ω '' Icc (p : ℝ) (q : ℝ)) < ∞ := by + simpa only [ae_all_iff] using H + filter_upwards [H'] with ω hω + exact all_real_intervals_of_rational ν (γ ω) hω + +end Intervals +end SLEExactGauge.Deterministic +end +end + + + +section + + +noncomputable section +open Set Filter Topology +namespace SLEExactGauge.QuadraticGauge + + + +def entry (d b ρ r : ℝ) : ℝ := b * ρ ^ d * max 1 ((r / ρ)^2) + + +def gauge {ι : Type*} (d : ℝ) (b ρ : ι → ℝ) (r : ℝ) : ℝ := + ⨅ i, entry d (b i) (ρ i) r + +lemma entry_nonneg {d b ρ r : ℝ} (hb : 0 ≤ b) (hρ : 0 < ρ) : + 0 ≤ entry d b ρ r := by + unfold entry + positivity + +lemma base_le_entry {d b ρ r : ℝ} (hb : 0 ≤ b) (hρ : 0 < ρ) : + b * ρ^d ≤ entry d b ρ r := by + unfold entry + exact le_mul_of_one_le_right (mul_nonneg hb (Real.rpow_nonneg hρ.le _)) (le_max_left _ _) + +lemma entry_eq_base {d b ρ r : ℝ} (hρ : 0 < ρ) (hr : 0 ≤ r) (hrρ : r ≤ ρ) : + entry d b ρ r = b * ρ^d := by + have hq : 0 ≤ r/ρ := div_nonneg hr hρ.le + have hq1 : r/ρ ≤ 1 := (div_le_one hρ).mpr hrρ + have hs : (r/ρ)^2 ≤ 1 := by nlinarith + simp only [entry,max_eq_left hs,mul_one] + +lemma entry_mono {d b ρ : ℝ} (hb : 0 ≤ b) (hρ : 0 < ρ) : + MonotoneOn (entry d b ρ) (Ici 0) := by + intro r hr s hs hrs + apply mul_le_mul_of_nonneg_left _ (mul_nonneg hb (Real.rpow_nonneg hρ.le _)) + apply max_le_max le_rfl + exact pow_le_pow_left₀ (div_nonneg hr hρ.le) (div_le_div_of_nonneg_right hrs hρ.le) 2 + +lemma entry_scale {d b ρ C r : ℝ} (hb : 0 ≤ b) (hρ : 0 < ρ) (hC : 1 ≤ C) : + entry d b ρ (C*r) ≤ C^2 * entry d b ρ r := by + have hC2 : 1 ≤ C^2 := by nlinarith + have ht : max 1 ((C*r/ρ)^2) ≤ C^2 * max 1 ((r/ρ)^2) := by + apply max_le + · exact hC2.trans (le_mul_of_one_le_right (sq_nonneg C) (le_max_left _ _)) + · calc + (C*r/ρ)^2 = C^2 * (r/ρ)^2 := by ring + _ ≤ C^2 * max 1 ((r/ρ)^2) := mul_le_mul_of_nonneg_left (le_max_right _ _) (sq_nonneg C) + have hm := mul_le_mul_of_nonneg_left ht (mul_nonneg hb (Real.rpow_nonneg hρ.le d)) + dsimp only [entry] + nlinarith only [hm] + +lemma power_le_entry {d b ρ r c : ℝ} (hd : 0 ≤ d) (hd2 : d ≤ 2) + (hc : 0 ≤ c) (hcb : c ≤ b) (hρ : 0 < ρ) (hr : 0 < r) : + c*r^d ≤ entry d b ρ r := by + have hb : 0 ≤ b := hc.trans hcb + by_cases hrρ : r ≤ ρ + · calc + c*r^d ≤ b*ρ^d := mul_le_mul hcb (Real.rpow_le_rpow hr.le hrρ hd) + (Real.rpow_nonneg hr.le _) hb + _ ≤ entry d b ρ r := base_le_entry hb hρ + · have hρr : ρ ≤ r := (lt_of_not_ge hrρ).le + have he : (r/ρ)^d ≤ (r/ρ)^2 := by + simpa only [Real.rpow_two] using + Real.rpow_le_rpow_of_exponent_le ((one_le_div hρ).mpr hρr) hd2 + have hh : r^d ≤ ρ^d * (r/ρ)^2 := by + rw [Real.div_rpow hr.le hρ.le] at he + have hρd : 0 < ρ^d := Real.rpow_pos_of_pos hρ _ + nlinarith [(div_le_iff₀ hρd).mp he] + calc + c*r^d ≤ b*(ρ^d * (r/ρ)^2) := mul_le_mul hcb hh (Real.rpow_nonneg hr.le _) hb + _ ≤ entry d b ρ r := by + unfold entry + nlinarith only [mul_le_mul_of_nonneg_left (le_max_right 1 ((r/ρ)^2)) + (mul_nonneg hb (Real.rpow_nonneg hρ.le d))] + +section Envelope +variable {ι : Type*} [Nonempty ι] {d : ℝ} {b ρ : ι → ℝ} +variable (hb : ∀ i, 0 ≤ b i) (hρ : ∀ i, 0 < ρ i) +include hb hρ + +omit [Nonempty ι] in +lemma entry_bddBelow (r : ℝ) : BddBelow (range (fun i => entry d (b i) (ρ i) r)) := by + refine ⟨0,?_⟩ + rintro _ ⟨i,rfl⟩ + exact entry_nonneg (hb i) (hρ i) + +lemma gauge_nonneg (r : ℝ) : 0 ≤ gauge d b ρ r := + le_ciInf (fun i => entry_nonneg (hb i) (hρ i)) + +omit [Nonempty ι] in +lemma gauge_le_entry (r : ℝ) (i : ι) : gauge d b ρ r ≤ entry d (b i) (ρ i) r := + ciInf_le (entry_bddBelow hb hρ r) i + +omit [Nonempty ι] in +lemma gauge_mono : MonotoneOn (gauge d b ρ) (Ici 0) := by + intro r hr s hs hrs + exact ciInf_mono (entry_bddBelow hb hρ r) (fun i => entry_mono (hb i) (hρ i) hr hs hrs) + +lemma gauge_scale {C r : ℝ} (hC : 1 ≤ C) : + gauge d b ρ (C*r) ≤ C^2 * gauge d b ρ r := by + have hCp : 0 < C^2 := sq_pos_of_pos (lt_of_lt_of_le zero_lt_one hC) + rw [mul_comm (C^2)] + apply (div_le_iff₀ hCp).mp + apply le_ciInf + intro i + apply (div_le_iff₀ hCp).mpr + exact (gauge_le_entry hb hρ (C*r) i).trans (by + simpa only [mul_comm] using entry_scale (hb i) (hρ i) hC) + +lemma gauge_comparison {r s : ℝ} (hr : 0 < r) (hs : 0 < s) : + gauge d b ρ r ≤ max 1 ((r/s)^2) * gauge d b ρ s := by + by_cases hrs : r ≤ s + · have hh : (r/s)^2 ≤ 1 := by + have hq : 0 ≤ r/s := div_nonneg hr.le hs.le + have hq1 : r/s ≤ 1 := (div_le_one hs).mpr hrs + nlinarith + rw [max_eq_left hh,one_mul] + exact gauge_mono hb hρ hr.le hs.le hrs + · have hq : 1 ≤ r/s := (one_le_div hs).mpr (le_of_not_ge hrs) + have hq2 : 1 ≤ (r/s)^2 := by nlinarith + rw [max_eq_right hq2] + convert gauge_scale (d := d) hb hρ (r := s) hq using 1 + field_simp + +lemma gauge_continuousAt {r : ℝ} (hr : 0 < r) : ContinuousAt (gauge d b ρ) r := by + have hu : ContinuousAt (fun s : ℝ => max 1 ((s/r)^2) * gauge d b ρ r) r := by + fun_prop + have hl : ContinuousAt (fun s : ℝ => gauge d b ρ r / max 1 ((r/s)^2)) r := by + apply ContinuousAt.div continuousAt_const + · apply ContinuousAt.sup continuousAt_const + exact ((continuousAt_const.div continuousAt_id hr.ne').pow 2) + · exact ne_of_gt (lt_of_lt_of_le zero_lt_one (le_max_left _ _)) + have hu' : Tendsto (fun s : ℝ => max 1 ((s/r)^2) * gauge d b ρ r) (𝓝 r) + (𝓝 (gauge d b ρ r)) := by simpa [hr.ne'] using hu.tendsto + have hl' : Tendsto (fun s : ℝ => gauge d b ρ r / max 1 ((r/s)^2)) (𝓝 r) + (𝓝 (gauge d b ρ r)) := by simpa [hr.ne'] using hl.tendsto + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hl' hu' + · filter_upwards [Ioi_mem_nhds hr] with s hs + exact (div_le_iff₀ (lt_of_lt_of_le zero_lt_one (le_max_left _ _))).mpr + (by simpa only [mul_comm] using gauge_comparison hb hρ hr hs) + · filter_upwards [Ioi_mem_nhds hr] with s hs + exact gauge_comparison hb hρ hs hr + +lemma gauge_zero (hsmall : ∀ ε : ℝ, 0 < ε → ∃ i, b i*(ρ i)^d < ε) : + gauge d b ρ 0 = 0 := by + apply le_antisymm _ (gauge_nonneg hb hρ 0) + by_contra! hp + obtain ⟨i,hi⟩ := hsmall _ hp + have he := gauge_le_entry (d := d) hb hρ 0 i + rw [entry_eq_base (hρ i) le_rfl (hρ i).le] at he + exact (not_lt_of_ge he) hi + +lemma gauge_continuousWithinAt_zero + (hsmall : ∀ ε : ℝ, 0 < ε → ∃ i, b i*(ρ i)^d < ε) : + ContinuousWithinAt (gauge d b ρ) (Ici 0) 0 := by + rw [Metric.continuousWithinAt_iff] + intro ε hε + obtain ⟨i,hi⟩ := hsmall ε hε + refine ⟨ρ i,hρ i,?_⟩ + intro r hr hrd + change 0 ≤ r at hr + have hrρ : r ≤ ρ i := by + exact le_of_lt (by simpa only [Real.dist_eq, sub_zero,abs_of_nonneg hr] using hrd) + rw [gauge_zero hb hρ hsmall,Real.dist_eq,sub_zero,abs_of_nonneg (gauge_nonneg hb hρ r)] + exact (gauge_le_entry hb hρ r i).trans_lt (by + rwa [entry_eq_base (hρ i) hr hrρ]) + + + +theorem isHausdorffGauge (hd : 0 ≤ d) (hd2 : d ≤ 2) + {c : ℝ} (hc : 0 < c) (hcb : ∀ i, c ≤ b i) + (hsmall : ∀ ε : ℝ, 0 < ε → ∃ i, b i*(ρ i)^d < ε) : + Target.IsHausdorffGauge (gauge d b ρ) := by + refine ⟨?_,gauge_mono hb hρ,gauge_zero hb hρ hsmall,?_⟩ + · intro r hr + rcases (show 0 ≤ r from hr).eq_or_lt with he | hp + · subst r + exact gauge_continuousWithinAt_zero hb hρ hsmall + · exact (gauge_continuousAt hb hρ hp).continuousWithinAt + · intro r hr + exact (mul_pos hc (Real.rpow_pos_of_pos hr d)).trans_le + (le_ciInf (fun i => power_le_entry hd hd2 hc.le (hcb i) (hρ i) hr)) + +end Envelope + + + +theorem finite_exclusions {ι : Type*} [Nonempty ι] (d : ℝ) (b ρ : ι → ℝ) + (hb : ∀ i, 0 < b i) (hρ : ∀ i, 0 < ρ i) (E : Finset ι) + (F : ℝ → ℝ) (M C : ℝ) + (hF : ∀ r, 0 < r → 0 ≤ F r ∧ F r ≤ M) + (hbound : ∀ i, i ∉ E → ∀ r, 0 < r → F r ≤ C * entry d (b i) (ρ i) r) : + ∃ C' : ℝ, 0 < C' ∧ ∀ r, 0 < r → F r ≤ C' * gauge d b ρ r := by + classical + let A : ι → ℝ := fun i => b i * (ρ i)^d + have hA (i : ι) : 0 < A i := mul_pos (hb i) (Real.rpow_pos_of_pos (hρ i) d) + let D : ℝ := max (max 1 C) (∑ i ∈ E, max (M/A i) 0) + have h1 : 1 ≤ D := (le_max_left 1 C).trans (le_max_left _ _) + have hD : 0 < D := zero_lt_one.trans_le h1 + have hCD : C ≤ D := (le_max_right 1 C).trans (le_max_left _ _) + refine ⟨D,hD,?_⟩ + intro r hr + have hi (i : ι) : F r ≤ D * entry d (b i) (ρ i) r := by + by_cases hie : i ∈ E + · have hm : M/A i ≤ D := calc + M/A i ≤ max (M/A i) 0 := le_max_left _ _ + _ ≤ ∑ j ∈ E, max (M/A j) 0 := + Finset.single_le_sum (f := fun j => max (M/A j) 0) (fun j _ => le_max_right _ _) hie + _ ≤ D := le_max_right _ _ + calc + F r ≤ M := (hF r hr).2 + _ ≤ D * A i := (div_le_iff₀ (hA i)).mp hm + _ ≤ D * entry d (b i) (ρ i) r := + mul_le_mul_of_nonneg_left (base_le_entry (hb i).le (hρ i)) hD.le + · exact (hbound i hie r hr).trans + (mul_le_mul_of_nonneg_right hCD (entry_nonneg (hb i).le (hρ i))) + rw [mul_comm D] + apply (div_le_iff₀ hD).mp + apply le_ciInf + intro i + exact (div_le_iff₀ hD).mpr (by simpa only [mul_comm] using hi i) + +end SLEExactGauge.QuadraticGauge +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/GlobalAngleBudget.lean b/lean/OAI/Probability/SLEGauge/GlobalAngleBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e03b971e938031e724dc3fd08508ab7dca8b6e9 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/GlobalAngleBudget.lean @@ -0,0 +1,512 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.AngleLyapunov + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt + +def radialTestWeight (a : ℝ) (F : State→ℝ) (b : ℝ≥0→ℝ) (z : ℂ) (ρ : ℝ) : ℝ := + if radialTime a b z ρ=∞ then 0 else + let v := actualState a b (radialTime a b z ρ).toNNReal z + physicalGreen a v * F v + +lemma radialTestWeight_nonneg (a : ℝ) (F : State→ℝ) (hF : ∀v, 0≤F v) + (b : ℝ≥0→ℝ) (z : ℂ) (ρ : ℝ) : 0≤radialTestWeight a F b z ρ := by + unfold radialTestWeight + split_ifs + · exact le_rfl + · exact mul_nonneg (Real.exp_pos _).le (hF _) + +lemma sinePower_angleLift_pos (q : ℝ) (v : State) : 0 b.1 t) W) + (a q C : ℝ) (ha : 0 ENNReal.ofReal (f n b)) atTop := by + by_cases ht : radialTime a b.1 z ρ=∞ + · simp only [radialTestWeight,ite_eq_left ht,ENNReal.ofReal_zero] + exact bot_le + · apply le_liminf_of_le (by isBoundedDefault) + filter_upwards [radialStop_eventually_eq a ha z hz ρ hρ hr b ht] with n hn + have he : T n b=(radialTime a b.1 z ρ).toNNReal := by + have hh := congrArg ENNReal.toNNReal hn + simpa only [ENNReal.toNNReal_coe] using hh + have hv : V n b=actualState a b.1 (radialTime a b.1 z ρ).toNNReal z := by + rw [←(hact n b).2,he] + have htC : physicalClock a cap (V n b)=s := by + rw [hv, actual_physicalClock_at a ha z hz cap ρ hcap hρ hr b ht] + exact levelRadius_clock ha.ne' hcap + have hexp : Real.exp (-s)*Real.exp s=1 := by rw [←Real.exp_add]; simp + apply le_of_eq + congr 1 + simp only [radialTestWeight,ite_eq_right ht,f,angleBudgetFactor_terminal a q cap s C _ htC] + rw [hv] + nlinarith only [congrArg (fun x => x*(physicalGreen a + (actualState a b.1 (radialTime a b.1 z ρ).toNNReal z)* + angleLift (sinePower (-q)) (actualState a b.1 (radialTime a b.1 z ρ).toNNReal z))) hexp] + exact (lintegral_mono hlim).trans ((lintegral_liminf_le' (fun n => + (hb n).1.aestronglyMeasurable.aemeasurable.ennreal_ofReal)).trans + (liminf_le_of_frequently_le (Eventually.of_forall hbf).frequently)) + + + +theorem exists_finite_level_angle_bound (a q : ℝ) (ha : 1/4 b.1 t) W → + ∀ (z : ℂ), 0 + radialState a p.1.1 p.2.1 (p.2.1.im*q)) := by + let Ω := ExactSLEGenerator.Driver×UpperPlane + let z : Ω→ℂ := fun p => p.2.1 + let b : Ω→ExactSLEGenerator.Driver := Prod.fst + have hz (ω : Ω) : 0<(z ω).im := ω.2.2 + have hzM : Measurable z := measurable_subtype_coe.comp measurable_snd + have hbM : Measurable b := measurable_fst + let ρ : Ω→ℝ := fun ω => (z ω).im*q + have hρ (ω : Ω) : 0<ρ ω := mul_pos (hz ω) hq + have hr (ω : Ω) : ρ ω≤(z ω).im := mul_le_of_le_one_right (hz ω).le hq1 + let δ : ℕ→Ω→ℝ := fun n ω => angleThreshold (z ω) n + let L (n : ℕ) (ω : Ω) := explicitRadialLocalization a ha (z ω) (hz ω) (ρ ω) (δ n ω) + (hρ ω) (hr ω) (angleThreshold_pos (z ω) (hz ω) n) (angleThreshold_initial (z ω) (hz ω) n) + have hρM : Measurable ρ := hzM.im.mul_const q + have hδM (n : ℕ) : Measurable (δ n) := by + dsimp [δ,angleThreshold] + exact (hzM.im.div hzM.norm).div_const _ + have hεM (n : ℕ) : Measurable (fun ω => (L n ω).ε) := by + change Measurable (fun ω => heightFloor (z ω).im (ρ ω) (δ n ω)/2) + unfold heightFloor + fun_prop + have hNM (n : ℕ) : Measurable (fun ω => (L n ω).N) := by + change Measurable (fun ω => (⟨(z ω).im/δ n ω+logCeiling (z ω).im (ρ ω) (δ n ω)+1,_⟩ : ℝ≥0)) + apply Measurable.subtype_mk + unfold logCeiling heightFloor + fun_prop + have hBM (n : ℕ) : Measurable (fun ω => (L n ω).B) := by + change Measurable (fun ω => (⟨(z ω).im^2/(2*a*(δ n ω)^2)+1,_⟩ : ℝ≥0)) + apply Measurable.subtype_mk + fun_prop + let T (n : ℕ) (ω : Ω) := regionStop a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (b ω) + have hTM (n : ℕ) : Measurable (T n) := + regionStop_parameter_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b _ ρ (δ n) _ + (hεM n) hzM hbM (measurable_subtype_coe.comp (hNM n)) hρM (hδM n) (hBM n) + let V (n : ℕ) (ω : Ω) := localState a (L n ω).ε (L n ω).hε (z ω) (T n ω) (b ω) + have hVM (n : ℕ) : Measurable (V n) := + (localState_parameter_joint_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) + z b (hεM n) hzM hbM).comp ((hTM n).prodMk measurable_id) + apply measurable_of_tendsto_metrizable + (f := fun n ω => if physicalRadius (V n ω)=ρ ω then V n ω else (0:State)) + · intro n + exact Measurable.ite (measurableSet_eq_fun + (physicalRadius_continuous.measurable.comp (hVM n)) hρM) (hVM n) measurable_const + · apply tendsto_pi_nhds.mpr + intro ω + apply tendsto_const_nhds.congr' + exact (localizedState_eventually_eq a ha (z ω) (hz ω) (ρ ω) (hρ ω) (hr ω) (b ω) + (fun n => L n ω)).mono (fun n hn => hn.symm) + +lemma radialTestWeight_eq_mul (a : ℝ) (F : State→ℝ) (b : ℝ≥0→ℝ) (z : ℂ) (ρ : ℝ) : + radialTestWeight a F b z ρ=radialWeight a b z ρ*F (radialState a b z ρ) := by + unfold radialTestWeight radialWeight radialState + split_ifs <;> simp + +lemma joint_radialTestWeight_measurable (a : ℝ) (ha : 1/4 + radialTestWeight a F p.1.1 p.2.1 (p.2.1.im*q)) := by + simp_rw [radialTestWeight_eq_mul] + exact (joint_radialWeight_measurable a ha q hq hq1).mul + (hF.comp (joint_radialState_measurable a (by linarith) q hq hq1)) + +lemma angleLift_sinePower_measurable (q : ℝ) : Measurable (angleLift (sinePower q)) := by + unfold angleLift sinePower physicalTheta + fun_prop + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerScaling +open ExactSLEMain ExactSLEGreen + +def scaleState (c : ℝ≥0) (v : State) : State := (((c:ℝ):ℂ)⁻¹*v.1,v.2) + +lemma scaleState_Y (c : ℝ≥0) (v : State) : + Y (scaleState c v)=(c:ℝ)⁻¹*Y v := by + simp [scaleState,←Complex.ofReal_inv,Complex.mul_im] + +lemma scaleState_X (c : ℝ≥0) (v : State) : + X (scaleState c v)=(c:ℝ)⁻¹*X v := by + simp [scaleState,←Complex.ofReal_inv,Complex.mul_re] + +lemma scaleState_Q (c : ℝ≥0) (v : State) : + Q (scaleState c v)=((c:ℝ)⁻¹)^2*Q v := by + simp only [Q,scaleState_X,scaleState_Y] + ring + +lemma scaleState_J (c : ℝ≥0) (v : State) : J (scaleState c v)=J v := rfl + +lemma scaleState_radius (c : ℝ≥0) (v : State) : + physicalRadius (scaleState c v)=(c:ℝ)⁻¹*physicalRadius v := by + simp only [physicalRadius,scaleState_Y,scaleState_J] + ring + +lemma scaleState_logGreen (a : ℝ) {c : ℝ≥0} (hc : 0 (c:ℝ≥0∞)^2*u) '' + {u : ℝ≥0∞ | ∃ t : ℝ≥0, u=t ∧ alive a (scaled c b) t z ∧ + physicalRadius (actualState a (scaled c b) t z)=ρ} = + {u : ℝ≥0∞ | ∃ t : ℝ≥0, u=t ∧ alive a b t (((c:ℝ):ℂ)*z) ∧ + physicalRadius (actualState a b t (((c:ℝ):ℂ)*z))=(c:ℝ)*ρ} := by + have hn : (c:ℝ)≠0 := NNReal.coe_ne_zero.mpr hc.ne' + ext u + constructor + · rintro ⟨w,⟨t,rfl,ht,hr⟩,rfl⟩ + refine ⟨c^2*t,by simp, (alive_scaled_iff a hc b t z).mp ht,?_⟩ + rw [physicalRadius_scaled a hc hb t z ht] at hr + calc + _ = (c:ℝ)*((c:ℝ)⁻¹*physicalRadius (actualState a b (c^2*t) (((c:ℝ):ℂ)*z))) := by simp [hn] + _ = _ := by rw [hr] + · rintro ⟨t,rfl,ht,hr⟩ + let v : ℝ≥0 := (c^2)⁻¹*t + have hvt : c^2*v=t := by simp [v,hc.ne'] + have hv : alive a (scaled c b) v z := by + rw [alive_scaled_iff a hc b v z,hvt] + exact ht + refine ⟨v,⟨v,rfl,hv,?_⟩,?_⟩ + · rw [physicalRadius_scaled a hc hb v z hv,hvt,hr] + simp [hn] + · simp only [←ENNReal.coe_pow,←ENNReal.coe_mul,hvt] + + +lemma radialTime_scaled (a : ℝ) {c : ℝ≥0} (hc : 0 simp + +end SLEExactGauge.LoewnerScaling +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/GreenIdentities.lean b/lean/OAI/Probability/SLEGauge/GreenIdentities.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ce384e42392c99b5c75027930667242f60b741f --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/GreenIdentities.lean @@ -0,0 +1,458 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.SurvivalLocalization + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +open Filter Topology +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open MeasureTheory Filter Topology Set CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal Topology +theorem actual_surviving_green (a : ℝ) (ha : 1/4 survivingGreen a t p.1 p.2.1)) ∧ + (∀ (q : ℕ → ℝ), (∀n,0 remainingMassDensity a (q n) t b z) atTop (𝓝 (survivingGreen a t b z))) ∧ + ∀ (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W], + IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W → + ∀ (z : ℂ), 0 survivingGreen a t b z) W ∧ + (∫b, survivingGreen a t b z ∂W) ≤ Real.exp (-alpha a*Real.log 2)*physicalGreen a (z,0) + := by + let q : ℕ → ℝ := fun n => 1/((n:ℝ)+1) + have hq (n : ℕ) : 0 survivingGreen a t p.1 p.2.1) := by + let : MeasurableSpace ExactSLEGenerator.Driver := rawFiltration t + apply measurable_of_tendsto_metrizable (f:=fun n p => remainingMassDensity a (q n) t p.1 p.2.1) + · intro n + have H := (radialRemaining_raw_joint a ha (q n) (hq n).1 (hq n).2 t).const_mul + (Real.exp (-alpha a*Real.log 2)) + convert H using 1 + funext p + simp only [remainingMassDensity,ite_eq_left p.2.2] + · exact tendsto_pi_nhds.mpr (fun p => remaining_to_surviving a ha t q hq hlim p.1 p.2.1 p.2.2) + refine ⟨hm,fun q hq hlim => remaining_to_surviving a ha t q hq hlim,?_⟩ + intro W inst hW z hz + let F : ℕ → ExactSLEGenerator.Driver → ℝ := fun n b => remainingMassDensity a (q n) t b z + let G : ExactSLEGenerator.Driver → ℝ := fun b => survivingGreen a t b z + let C : ℝ := Real.exp (-alpha a*Real.log 2)*physicalGreen a (z,0) + have hC : 0≤C := by unfold C physicalGreen; positivity + have hFi (n : ℕ) := (remainingMassDensity_mean_bound a ha W hW (q n) (hq n).1 (hq n).2 t z hz).1 + have hFm (n : ℕ) : AEStronglyMeasurable (F n) W := (hFi n).aestronglyMeasurable + have hconv : ∀ᵐ b ∂W,Tendsto (fun n => F n b) atTop (𝓝 (G b)) := + Eventually.of_forall (fun b => remaining_to_surviving a ha t q hq hlim b z hz) + have hbound (n : ℕ) : eLpNorm (F n) 1 W≤ENNReal.ofReal C := by + rw [eLpNorm_one_eq_lintegral_enorm (hFm n),←ofReal_integral_norm_eq_lintegral_enorm (hFi n)] + have he : (fun b => ‖F n b‖) = F n := by + funext b + exact Real.norm_of_nonneg (remainingMassDensity_nonneg a (q n) t b z) + rw [he] + exact ENNReal.ofReal_le_ofReal + (remainingMassDensity_mean_bound a ha W hW (q n) (hq n).1 (hq n).2 t z hz).2 + have hGm := aestronglyMeasurable_of_tendsto_ae atTop hFm hconv + have hGb := Lp.eLpNorm_le_of_ae_tendsto (Eventually.of_forall hbound) hFm hGm hconv + have hGi : Integrable G W := memLp_one_iff_integrable.mp (hGb.trans_lt ENNReal.ofReal_lt_top) + refine ⟨hGi,?_⟩ + rw [eLpNorm_one_eq_lintegral_enorm hGm,←ofReal_integral_norm_eq_lintegral_enorm hGi] at hGb + have he : (fun b => ‖G b‖) = G := by + funext b + exact Real.norm_of_nonneg (survivingGreen_nonneg a t b z) + rw [he] at hGb + exact (ENNReal.ofReal_le_ofReal_iff hC).mp hGb +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal Topology +lemma remainingMassDensity_le_surviving (a q : ℝ) (t : ℝ≥0) + (b : ExactSLEGenerator.Driver) (z : ℂ) (hz : 0 b.1 t) W) + (t : ℝ≥0) (K : Set UpperPlane) (hK : MeasurableSet K) + (hKfin : upperArea K<∞) (c : ℝ) (hc : 0 f p.1*survivingGreen a t p.2 p.1.1) + ((upperArea.restrict K).prod W) ∧ + Tendsto (fun n => ∫p : UpperPlane × ExactSLEGenerator.Driver, + ‖f p.1*remainingMassDensity a (q n) t p.2 p.1.1-f p.1*survivingGreen a t p.2 p.1.1‖ + ∂((upperArea.restrict K).prod W)) atTop (𝓝 0) + := by + let ν := upperArea.restrict K + have : IsFiniteMeasure ν := ⟨by simpa [ν] using hKfin⟩ + let F : UpperPlane × ExactSLEGenerator.Driver → ℝ := fun p => f p.1*survivingGreen a t p.2 p.1.1 + let H : ℕ → UpperPlane × ExactSLEGenerator.Driver → ℝ := fun n p => f p.1*remainingMassDensity a (q n) t p.2 p.1.1 + have hHm (n : ℕ) : Measurable (H n) := + (hf.comp measurable_fst).mul ((remainingMassDensity_measurable a ha (q n) (hq n).1 (hq n).2 t).comp + (measurable_snd.prodMk (measurable_subtype_coe.comp measurable_fst))) + have hconv (p : UpperPlane × ExactSLEGenerator.Driver) : Tendsto (fun n => H n p) atTop (𝓝 (F p)) := + (remaining_to_surviving a ha t q hq hlim p.2 p.1.1 p.1.2).const_mul (f p.1) + have hFm : Measurable F := measurable_of_tendsto_metrizable hHm (tendsto_pi_nhds.mpr hconv) + have hi (z : UpperPlane) : Integrable (fun b => F (z,b)) W := + ((actual_surviving_green a ha t).2.2 W hW z.1 z.2).1.const_mul (f z) + have he (z : UpperPlane) : (∫b,‖F (z,b)‖∂W) = ‖f z‖*(∫b,survivingGreen a t b z.1∂W) := by + simp only [F,norm_mul,Real.norm_of_nonneg (survivingGreen_nonneg _ _ _ _),integral_const_mul] + let C := Real.exp (-alpha a*Real.log 2)*Real.exp (-alpha a*Real.log c) + have hC : 0≤C := by dsimp [C]; positivity + have hb (z : UpperPlane) (hz : z∈K) : (∫b,‖F (z,b)‖∂W)≤B*C := by + rw [he] + have hG := ((actual_surviving_green a ha t).2.2 W hW z.1 z.2).2 + have hgreen : physicalGreen a (z.1,0)≤Real.exp (-alpha a*Real.log c) := by + apply physicalGreen_bound a c ha hc _ z.2 + simpa [physicalRadius,Y] using hcK z hz + have hpos : 0≤(∫b,survivingGreen a t b z.1∂W) := integral_nonneg (fun b => survivingGreen_nonneg _ _ _ _) + exact mul_le_mul (hfB z hz) (hG.trans (mul_le_mul_of_nonneg_left hgreen (Real.exp_pos _).le)) + hpos hB + have hFi : Integrable F (ν.prod W) := by + apply (integrable_prod_iff hFm.aestronglyMeasurable).mpr + refine ⟨Eventually.of_forall hi,?_⟩ + apply Integrable.of_bound (hFm.aestronglyMeasurable.norm.integral_prod_right') (B*C) + filter_upwards [ae_restrict_mem hK] with z hz + rw [Real.norm_of_nonneg (integral_nonneg (fun b => norm_nonneg (F (z,b))))] + exact hb z hz + refine ⟨hFi,?_⟩ + have hD : Integrable (fun p => 2*‖F p‖) (ν.prod W) := hFi.norm.const_mul 2 + have hbound (n : ℕ) (p : UpperPlane × ExactSLEGenerator.Driver) : ‖H n p-F p‖≤2*‖F p‖ := by + have hle : ‖H n p‖≤‖F p‖ := by + dsimp only [H,F] + rw [norm_mul,norm_mul,Real.norm_of_nonneg (remainingMassDensity_nonneg _ _ _ _ _), + Real.norm_of_nonneg (survivingGreen_nonneg _ _ _ _)] + exact mul_le_mul_of_nonneg_left (remainingMassDensity_le_surviving _ _ _ _ _ p.1.2) (norm_nonneg _) + calc ‖H n p-F p‖≤‖H n p‖+‖F p‖ := norm_sub_le _ _ + _≤2*‖F p‖ := by linarith + have hlim' := tendsto_integral_of_dominated_convergence (fun p => 2*‖F p‖) + (fun n => ((hHm n).sub hFm).norm.aestronglyMeasurable) hD + (fun n => Eventually.of_forall (fun p => by simpa using hbound n p)) + (Eventually.of_forall (fun p => by simpa using ((hconv p).sub_const (F p)).norm)) + simpa using hlim' +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped Classical NNReal ENNReal +lemma actualMassEval_raw_measurable (a : ℝ) (ha : 1/4 f p.2*(timeMassDensity a q t p.1 p.2).toReal) := + (hf.comp measurable_snd).mul hD.ennreal_toReal + exact hm.stronglyMeasurable.integral_prod_right'.measurable +lemma actualUpperMass_eval_raw_measurable (a : ℝ) (ha : 1/4 ∫z,f z∂actualUpperMass a q t b) := by + simp_rw [actualUpperMass_eval a ha q hq hq1] + exact actualMassEval_raw_measurable a ha q hq hq1 t _ _ (upperExtension_measurable f) +lemma raw_ae_measurable_limit {Ω : Type*} {m m₀ : MeasurableSpace Ω} (W : Measure[m₀] Ω) + (F : ℕ → Ω → ℝ) (g : Ω → ℝ) (hF : ∀ k, Measurable[m] (F k)) + (h : ∀ᵐ b ∂W, Tendsto (fun k => F k b) atTop (𝓝 (g b))) : + AEStronglyMeasurable[m] g W := by + refine ⟨fun b => limsup (fun k => F k b) atTop, (Measurable.limsup hF).stronglyMeasurable,?_⟩ + filter_upwards [h] with b hb + exact hb.limsup_eq.symm + + +theorem actual_radon_raw_evaluations (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ b i) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → ∀ f : C_c(UpperPlane,ℝ), + (∫b, (∫z,f z∂μ b i) ∂W) = ∫z : UpperPlane, + f z * (Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea) ∧ + (∀ i (t₀ : ℝ≥0), t i=t₀ → ∀ f : C_c(UpperPlane,ℝ), + AEStronglyMeasurable[rawFiltration t₀] (fun b => ∫z,f z∂μ b i) W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + obtain ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,hmean,h⟩ := actual_radon_terminal_mean a ha W hW t + refine ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,hmean,?_,h⟩ + intro i t₀ hi f + apply raw_ae_measurable_limit W + (fun k b => ∑ j∈s k,c k j*∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + (fun b => ∫z,f z∂μ b i) + · intro k + rw [hi] + apply Finset.measurable_sum + intro j hj + have hq1 : Real.exp (-2*a*(j+1))≤1 := by + apply Real.exp_le_one_iff.mpr + have ha0 : 0 b.1 t) W) + (q : ℝ) (hq : 0 ?_)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] + · rw [upperExtension_zero f z (by rintro ⟨w,hw,rfl⟩; exact hz w.2),zero_mul] + · rw [upperExtension_zero f z hz,zero_mul] + · exact (integral_subtype_comap (μ := (volume : Measure ℂ)) upperPlane_open.measurableSet + (fun z : ℂ => upperExtension f z*remainingMassDensity a q t b z)).symm +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped Classical NNReal ENNReal Topology +lemma actualUpper_remaining_integral_tendsto (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (f : C_c(UpperPlane,ℝ)) (U : Set ExactSLEGenerator.Driver) + (q : ℕ → ℝ) (hq : ∀n,0 ∫b in U, (∫z : UpperPlane,f z*remainingMassDensity a (q n) t b z.1∂upperArea) ∂W) + atTop (𝓝 (∫b in U, (∫z : UpperPlane,f z*survivingGreen a t b z.1∂upperArea) ∂W)) := by + let K := tsupport f + have hK : IsCompact K := f.hasCompactSupport + have hfin : upperArea K<∞ := by + rw [upperArea,upper_embedding.comap_apply] + exact (hK.image continuous_subtype_val).measure_lt_top + have : IsFiniteMeasure (upperArea.restrict K) := ⟨by simpa using hfin⟩ + obtain ⟨c,hc,hcK⟩ := upper_compact_lower K hK + obtain ⟨B,hB,hBf⟩ := upperExtension_bounded f + have H := actual_remaining_spatial_L1 a ha W hW t K hK.measurableSet hfin (c/2) (by positivity) + (fun z hz => by have := hcK z hz; linarith) f f.continuous.measurable B hB + (fun z hz => by simpa only [upperExtension_apply] using hBf z.1 ⟨z,hz,rfl⟩) q hq hlim + let F : UpperPlane × ExactSLEGenerator.Driver → ℝ := fun p => f p.1*survivingGreen a t p.2 p.1.1 + let R : ℕ → UpperPlane × ExactSLEGenerator.Driver → ℝ := fun n p => f p.1*remainingMassDensity a (q n) t p.2 p.1.1 + let μ := (upperArea.restrict K).prod (W.restrict U) + have hFi : Integrable F μ := H.1.mono_measure (Measure.prod_mono le_rfl Measure.restrict_le_self) + have hRm (n : ℕ) : Measurable (R n) := + (f.continuous.measurable.comp measurable_fst).mul + ((remainingMassDensity_measurable a ha (q n) (hq n).1 (hq n).2 t).comp + (measurable_snd.prodMk (measurable_subtype_coe.comp measurable_fst))) + have hbound (n : ℕ) (p : UpperPlane × ExactSLEGenerator.Driver) : ‖R n p‖≤‖F p‖ := by + dsimp only [R,F] + rw [norm_mul,norm_mul,Real.norm_of_nonneg (remainingMassDensity_nonneg _ _ _ _ _), + Real.norm_of_nonneg (survivingGreen_nonneg _ _ _ _)] + exact mul_le_mul_of_nonneg_left (remainingMassDensity_le_surviving _ _ _ _ _ p.1.2) (norm_nonneg _) + have hRi (n : ℕ) : Integrable (R n) μ := hFi.norm.mono' (hRm n).aestronglyMeasurable + (Eventually.of_forall (hbound n)) + have ht := tendsto_integral_of_dominated_convergence (fun p => ‖F p‖) + (fun n => (hRm n).aestronglyMeasurable) hFi.norm (fun n => Eventually.of_forall (hbound n)) + (Eventually.of_forall (fun p => (remaining_to_surviving a ha t q hq hlim p.2 p.1.1 p.1.2).const_mul (f p.1))) + have he (g : UpperPlane → ℝ) : (∫z in K,f z*g z∂upperArea) = ∫z,f z*g z∂upperArea := + setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => by rw [image_eq_zero_of_notMem_tsupport hz,zero_mul]) + have hRint (n : ℕ) : (∫p,R n p∂μ) = ∫b in U,(∫z : UpperPlane,f z*remainingMassDensity a (q n) t b z.1∂upperArea)∂W := by + rw [integral_prod_symm (R n) (hRi n)] + apply integral_congr_ae + filter_upwards [] with b + exact he _ + have hFint : (∫p,F p∂μ) = ∫b in U,(∫z : UpperPlane,f z*survivingGreen a t b z.1∂upperArea)∂W := by + rw [integral_prod_symm F hFi] + apply integral_congr_ae + filter_upwards [] with b + exact he _ + change Tendsto (fun n => ∫p,R n p∂μ) atTop (𝓝 (∫p,F p∂μ)) at ht + simpa only [hRint,hFint] using ht +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped Classical NNReal ENNReal Topology +lemma setIntegral_tendsto_of_L1 {Ω : Type*} [MeasurableSpace Ω] (W : Measure Ω) + (F : ℕ → Ω → ℝ) (g : Ω → ℝ) (hF : ∀n,Integrable (F n) W) (hg : Integrable g W) + (hlim : Tendsto (fun n => eLpNorm (fun b => F n b-g b) 1 W) atTop (𝓝 0)) (U : Set Ω) : + Tendsto (fun n => ∫b in U,F n b∂W) atTop (𝓝 (∫b in U,g b∂W)) := by + have hsmall : Tendsto (fun n => eLpNorm (fun b => F n b-g b) 1 (W.restrict U)) atTop (𝓝 0) := + tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hlim + (Eventually.of_forall (fun _ => bot_le)) + (Eventually.of_forall (fun n => eLpNorm_mono_measure _ Measure.restrict_le_self)) + exact tendsto_integral_of_L1 g hg.integrableOn.aestronglyMeasurable + (Eventually.of_forall (fun n => (hF n).integrableOn)) + (hsmall.congr fun index => eLpNorm_one_eq_lintegral_enorm + ((hF index).integrableOn.aestronglyMeasurable.sub hg.integrableOn.aestronglyMeasurable)) +lemma scalar_convex_tail_limit (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hs : ∀k j,j∈s k→k≤j) (hc : ∀k j,j∈s k→0≤c k j) (hsum : ∀k,∑j∈s k,c k j=1) + (x : ℕ → ℝ) (L : ℝ) (hx : Tendsto x atTop (𝓝 L)) : + Tendsto (fun k => ∑j∈s k,c k j*x j) atTop (𝓝 L) := by + rw [Metric.tendsto_atTop] at hx ⊢ + intro ε hε + obtain ⟨N,hN⟩ := hx (ε/2) (by positivity) + refine ⟨N,fun k hk => ?_⟩ + rw [Real.dist_eq] + have he : (∑j∈s k,c k j*x j)-L = ∑j∈s k,c k j*(x j-L) := by + simp only [mul_sub,Finset.sum_sub_distrib,←Finset.sum_mul,hsum k,one_mul] + rw [he] + calc + |∑j∈s k,c k j*(x j-L)| ≤ ∑j∈s k,|c k j*(x j-L)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑j∈s k,c k j*(ε/2) := by + apply Finset.sum_le_sum + intro j hj + rw [abs_mul,abs_of_nonneg (hc k j hj)] + exact mul_le_mul_of_nonneg_left (by simpa [Real.dist_eq] using (hN j (hk.trans (hs k j hj))).le) (hc k j hj) + _ = ε/2 := by rw [←Finset.sum_mul,hsum k,one_mul] + _ < ε := by linarith +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped Classical NNReal ENNReal +theorem actual_radon_compact_conditional (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ b i) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → ∀ f : C_c(UpperPlane,ℝ), + (∫b, (∫z,f z∂μ b i) ∂W) = ∫z : UpperPlane, + f z * (Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea) ∧ + (∀ i (t₀ : ℝ≥0), t i=t₀ → ∀ f : C_c(UpperPlane,ℝ), + AEStronglyMeasurable[rawFiltration t₀] (fun b => ∫z,f z∂μ b i) W) ∧ + (∀ i j (t₀ : ℝ≥0), t i=t₀ → t j=∞ → ∀ f : C_c(UpperPlane,ℝ), + ∀ U : Set ExactSLEGenerator.Driver, MeasurableSet[rawFiltration t₀] U → + (∫b in U, (∫z,f z∂μ b j)-(∫z,f z∂μ b i) ∂W) = + ∫b in U, (∫z : UpperPlane,f z*survivingGreen a t₀ b z.1 ∂upperArea) ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + obtain ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,hmean,hraw,h⟩ := actual_radon_raw_evaluations a ha W hW t + refine ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,hmean,hraw,?_,h⟩ + intro i j t₀ hi hj f U hU + let q : ℕ → ℝ := fun n => Real.exp (-2*a*((n:ℝ)+1)) + have hq (n : ℕ) : 0 (n:ℝ)) atTop atTop).eventually (eventually_ge_atTop B)] with n hn + linarith + let F : ℕ → ℕ → ExactSLEGenerator.Driver → ℝ := fun l k b => + ∑ n∈s k,c k n*∫z,f z∂actualUpperMass a (q n) (t l) b + obtain ⟨C,hC,hCb⟩ := actualUpperMass_Lp_bound a ha W hW 1 (by norm_num) f + have hEval (n : ℕ) (v : ℝ≥0∞) : Integrable (fun b => ∫z,f z∂actualUpperMass a (q n) v b) W := + (hCb (q n) (hq n).1 (hq n).2 v).1.integrable (by norm_num) + have hFi (l k : ℕ) : Integrable (F l k) W := + integrable_finsetSum (s k) (fun n hn => (hEval n (t l)).const_mul (c k n)) + have hμi (l : ℕ) : Integrable (fun b => ∫z,f z∂μ b l) W := + (hmom l f 1).integrable (by norm_num) + have hlim (l : ℕ) := setIntegral_tendsto_of_L1 W (F l) (fun b => ∫z,f z∂μ b l) + (hFi l) (hμi l) (hL1 l f) U + let R : ℕ → ℝ := fun n => ∫b in U,(∫z : UpperPlane,f z*remainingMassDensity a (q n) t₀ b z.1∂upperArea)∂W + let L : ℝ := ∫b in U,(∫z : UpperPlane,f z*survivingGreen a t₀ b z.1∂upperArea)∂W + have hRlim : Tendsto R atTop (𝓝 L) := actualUpper_remaining_integral_tendsto a ha W hW t₀ f U q hq hqlim + have hcombo := scalar_convex_tail_limit s c hs hc hsum R L hRlim + have he (k : ℕ) : (∫b in U,F j k b∂W)-(∫b in U,F i k b∂W) = ∑n∈s k,c k n*R n := by + dsimp only [F] + rw [integral_finsetSum _ (fun n hn => ((hEval n (t j)).const_mul (c k n)).integrableOn), + integral_finsetSum _ (fun n hn => ((hEval n (t i)).const_mul (c k n)).integrableOn)] + simp only [integral_const_mul] + rw [←Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro n hn + rw [←mul_sub,←integral_sub (hEval n (t j)).integrableOn (hEval n (t i)).integrableOn] + rw [hj,hi,actualUpperMass_finite_kernel a ha W hW (q n) (hq n).1 (hq n).2 t₀ f U hU] + rw [integral_sub (hμi j).integrableOn (hμi i).integrableOn] + exact tendsto_nhds_unique ((hlim j).sub (hlim i)) (by simpa only [he] using hcombo) +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/HalfPlaneDistortion.lean b/lean/OAI/Probability/SLEGauge/HalfPlaneDistortion.lean new file mode 100644 index 0000000000000000000000000000000000000000..085d74e1ac637de278e3f1d6595f29668109e358 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/HalfPlaneDistortion.lean @@ -0,0 +1,505 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ModelFiniteTests + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain LoewnerRestart FlowIdentification + +lemma lineMap_im_lower {z w : ℂ} {y : ℝ} (hz : y≤z.im) (hw : y≤w.im) + {t : ℝ} (ht : t∈Icc 0 1) : y≤(AffineMap.lineMap z w t).im := by + rw [AffineMap.lineMap_apply] + simp only [vadd_eq_add,vsub_eq_sub,Complex.sub_im,Complex.add_im,Complex.real_smul,Complex.mul_im,Complex.ofReal_re, + Complex.ofReal_im,zero_mul,add_zero] + nlinarith [mul_nonneg (sub_nonneg.mpr ht.2) (sub_nonneg.mpr hz), + mul_nonneg ht.1 (sub_nonneg.mpr hw)] + +lemma lineMap_hasDerivAt_complex_comp {f : ℂ→ℂ} {f' z w : ℂ} {t : ℝ} + (hd : HasDerivAt f f' (AffineMap.lineMap z w t)) : + HasDerivAt (fun t : ℝ=>f (AffineMap.lineMap z w t)) (f'*(w-z)) t := by + have hh := (hd.hasFDerivAt.restrictScalars ℝ).comp_hasDerivAt t + (AffineMap.hasDerivAt_lineMap (𝕜 := ℝ) (a := z) (b := w) (x := t)) + convert! hh using 1 + change f'*(w-z)=(w-z)*f' + ring + + +lemma norm_exp_bound_on_halfPlane_segment {f : ℂ→ℂ} {M y : ℝ} + (hy : 0f (AffineMap.lineMap z w t) + let dg : ℝ→ℂ := fun t=>deriv f (AffineMap.lineMap z w t)*(w-z) + have hi (t : ℝ) (ht : t∈Icc 0 1) : 0<(AffineMap.lineMap z w t).im := + hy.trans_le (lineMap_im_lower hz hw ht) + have hg (t : ℝ) (ht : t∈Icc 0 1) : HasDerivAt g (dg t) t := + lineMap_hasDerivAt_complex_comp (hd _ (hi t ht)).hasDerivAt + have hc : ContinuousOn g (Icc 0 1) := fun t ht=>(hg t ht).continuousAt.continuousWithinAt + have hdb (t : ℝ) (ht : t∈Ico 0 1) : ‖dg t‖≤K*‖g t‖+0 := by + dsimp only [dg,g,K] + rw [norm_mul,add_zero] + calc + _ ≤ ((M/(AffineMap.lineMap z w t).im)*‖f (AffineMap.lineMap z w t)‖)*‖w-z‖ := + mul_le_mul_of_nonneg_right (hb _ (hi t (Ico_subset_Icc_self ht))) (norm_nonneg _) + _ ≤ ((M/y)*‖f (AffineMap.lineMap z w t)‖)*‖w-z‖ := by + gcongr + exact lineMap_im_lower hz hw (Ico_subset_Icc_self ht) + _ = _ := by ring + have hh := norm_le_gronwallBound_of_norm_deriv_right_le hc + (fun t ht=>(hg t (Ico_subset_Icc_self ht)).hasDerivWithinAt) + (le_rfl : ‖g 0‖≤‖g 0‖) hdb 1 (by norm_num : (1:ℝ)∈Icc 0 1) + simpa only [g,AffineMap.lineMap_apply_zero,AffineMap.lineMap_apply_one,sub_zero, + gronwallBound_ε0,mul_one] using hh + + +theorem inverseMap_deriv_segment_bound {a : ℝ} (ha : 0(hasDerivAt_deriv_inverseMap ha b T hv).differentiableAt) + (fun v hv=>inverseMap_preSchwarzian_bound ha b T hv) hz hw + + + +theorem inverseMap_deriv_two_sided {a : ℝ} (ha : 0by simpa only [ContinuousLinearMap.norm_toSpanSingleton] using + inverseMap_second_deriv_smallBall_bound ha b T hz hv) + (mem_closedBall_self (by positivity)) hw + have hn : ‖w-z‖≤z.im/100 := by simpa only [mem_closedBall,dist_eq_norm] using hw + apply hh.trans + calc + _ ≤ ((18/z.im)*‖deriv (inverseMap a b T) z‖)*(z.im/100) := by gcongr + _ = (18/100:ℝ)*‖deriv (inverseMap a b T) z‖ := by field_simp + _ ≤ ‖deriv (inverseMap a b T) z‖/2 := by nlinarith [norm_nonneg (deriv (inverseMap a b T) z)] + +lemma inverseMap_approximates_smallBall {a : ℝ} (ha : 0f w-D*w) + (ContinuousLinearMap.toSpanSingleton ℂ (deriv f v-D)) (closedBall z (z.im/100)) v := by + have hh := (inverseMap_hasStrictDerivAt ha b T + (lt_of_lt_of_le (by positivity : 0by simpa only [ContinuousLinearMap.norm_toSpanSingleton] using + inverseMap_deriv_close_on_smallBall ha b T hz hv) hy hx + convert! hh using 1 + · congr 1 + change f x-f y-(x-y)*D=f x-D*x-(f y-D*y) + ring + + +def spanRightInverse (D : ℂ) (hD : D≠0) : + (ContinuousLinearMap.toSpanSingleton ℂ D).NonlinearRightInverse where + toFun w := w/D + nnnorm := ‖D‖₊⁻¹ + bound' w := by simp only [norm_div,NNReal.coe_inv,coe_nnnorm]; exact le_of_eq (by ring) + right_inv' w := by change (w/D)*D=w; exact div_mul_cancel₀ w hD + + + +theorem inverseMap_inner_ball {a : ℝ} (ha : 0 simp + rw [diskAt,affine_apply] + rw [show (w.re:ℂ)+(w.im:ℂ)*v-w=(w.im:ℂ)*(v-Complex.I) by + apply Complex.ext <;> simp; ring, + hconj,show (w.re:ℂ)+(w.im:ℂ)*v-((w.re:ℂ)-(w.im:ℂ)*Complex.I)= + (w.im:ℂ)*(v+Complex.I) by ring,mul_div_mul_left _ _ hy] + +lemma centeredRegion_bounds {w v : ℂ} (hw : 0 simp; ring,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hw] + constructor + · rw [hn] + exact mul_le_mul_of_nonneg_left (by simpa only [dist_eq_norm,subdiskReach] using hb.1) hw.le + · rw [←he,affine_apply] + simp only [Complex.add_im,Complex.ofReal_im,Complex.mul_im,Complex.ofReal_re, + zero_mul,zero_add,add_zero] + exact mul_le_mul_of_nonneg_left hb.2 hw.le + +lemma smallBall_subset_centeredRegion {w : ℂ} (hw : 0inverseMap a b T (AffineMap.lineMap w v t)) + (deriv (inverseMap a b T) (AffineMap.lineMap w v t)*(v-w)) t := by + apply lineMap_hasDerivAt_complex_comp + exact ((inverseMap_hasStrictDerivAt ha b T (hy.trans_le (hxy t ht))).hasDerivAt).differentiableAt.hasDerivAt + have hbound (t : ℝ) (ht : t∈Icc 0 1) : + ‖deriv (inverseMap a b T) (AffineMap.lineMap w v t)*(v-w)‖≤ + (‖deriv (inverseMap a b T) w‖*subdiskDistortion q)*‖v-w‖ := by + rw [norm_mul] + refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _) + have hh := (inverseMap_deriv_two_sided ha b T hy hw' (hxy t ht) (hdist t ht)).2 + rwa [he] at hh + have hh := (convex_Icc (0:ℝ) 1).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun t ht=>(hd t ht).hasDerivWithinAt) hbound + (by norm_num : (0:ℝ)∈Icc 0 1) (by norm_num : (1:ℝ)∈Icc 0 1) + simp only [AffineMap.lineMap_apply_zero,AffineMap.lineMap_apply_one,sub_zero,norm_one,mul_one] at hh + exact hh.trans (by + calc + _ ≤ (‖deriv (inverseMap a b T) w‖*subdiskDistortion q)*(w.im*subdiskReach q) := mul_le_mul_of_nonneg_left hb.1 + (mul_nonneg (norm_nonneg _) (subdiskDistortion_pos q).le) + _ = _ := by ring) + + + +theorem inverseMap_centered_localization {a : ℝ} (ha : 0 simp; ring + +lemma diskAt_deriv_norm {w v : ℂ} (hw : 0 simp; ring,norm_mul,Complex.norm_real,Real.norm_eq_abs, + abs_of_pos (mul_pos (by norm_num) hw),Complex.norm_I,mul_one] + _ ≤ _ := by linarith [hb.1] + have hq' : 0 Real.log (y t)+j t) + (-2*a*(q t-(y t)^2)/(q t)^2) (Icc 0 (T : ℝ)) t := by + convert (h.logHeight_deriv ht).add (h.jd t ht) using 1; try rfl + field_simp [(h.qp t ht).ne'] + ring + +lemma Evolution.logHeight_add_le (h : Evolution a T y j q) (ha : 0≤a) + (hq : ∀ u∈Icc 0 (T : ℝ), (y u)^2≤q u) + (t : ℝ) (ht : t∈Icc 0 (T : ℝ)) : + Real.log (y t)+j t≤Real.log (y 0)+j 0 := by + have hc : ContinuousOn (fun t => Real.log (y t)+j t) (Icc 0 (T : ℝ)) := + (h.yc.log (fun u hu => (h.yp u hu).ne')).add h.jc + have hm : AntitoneOn (fun t => Real.log (y t)+j t) (Icc 0 (T : ℝ)) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 (T : ℝ)) hc + (fun u hu => (h.logHeight_add_deriv (interior_subset hu)).mono interior_subset) + (fun u hu => div_nonpos_of_nonpos_of_nonneg + (mul_nonpos_of_nonpos_of_nonneg (by linarith) + (sub_nonneg.mpr (hq u (interior_subset hu)))) (sq_nonneg _)) + exact hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + +lemma Evolution.height_sq_le_radius (h : Evolution a T y j q) (ha : 0≤a) + (hq : ∀ u∈Icc 0 (T : ℝ), (y u)^2≤q u) (hj0 : j 0=0) + (t : ℝ) (ht : t∈Icc 0 (T : ℝ)) : + (y t)^2≤y 0*(y t*Real.exp (-j t)) := by + have hl := h.logHeight_add_le ha hq t ht + rw [hj0,add_zero] at hl + have he : y t≤y 0*Real.exp (-j t) := by + have hh := Real.exp_le_exp.mpr (show Real.log (y t)≤Real.log (y 0)+ -j t by linarith) + simpa only [Real.exp_add,Real.exp_log (h.yp t ht), + Real.exp_log (h.yp 0 ⟨le_rfl,T.coe_nonneg⟩)] using hh + have hh := mul_le_mul_of_nonneg_left he (h.yp t ht).le + nlinarith only [hh] + +lemma Evolution.height_sq_lower (h : Evolution a T y j q) (ha : 0≤a) + (hq : ∀ u∈Icc 0 (T : ℝ), (y u)^2≤q u) + (t : ℝ) (ht : t∈Icc 0 (T : ℝ)) : + (y 0)^2≤(y t)^2+2*a*t := by + let F : ℝ→ℝ := fun u => (y u)^2+2*a*u + have hc : ContinuousOn F (Icc 0 (T : ℝ)) := + (h.yc.pow 2).add (continuousOn_const.mul continuousOn_id) + have hd (u : ℝ) (hu : u∈Icc 0 (T : ℝ)) : + HasDerivWithinAt F (2*a*(1-(y u)^2/q u)) (Icc 0 (T : ℝ)) u := by + convert ((h.yd u hu).pow 2).add ((hasDerivWithinAt_id u _).const_mul (2*a)) using 1 <;> try rfl + simp only [Nat.reduceSub,pow_one,Nat.cast_ofNat] + ring + have hm : MonotoneOn F (Icc 0 (T : ℝ)) := + monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 (T : ℝ)) hc + (fun u hu => (hd u (interior_subset hu)).mono interior_subset) + (fun u hu => mul_nonneg (by positivity) (sub_nonneg.mpr + ((div_le_one (h.qp u (interior_subset hu))).mpr (hq u (interior_subset hu))))) + simpa only [F,mul_zero,add_zero] using hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + +end ExactSLEBarrier +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator + + + +lemma actualState_evolution (a : ℝ) (b : ExactSLEGenerator.Driver) (z : UpperPlane) + (T : ℝ≥0) (hT : alive a b.1 T z.1) : + ExactSLEBarrier.Evolution a T + (fun u => Y (actualState a b.1 u.toNNReal z.1)) + (fun u => J (actualState a b.1 u.toNNReal z.1)) + (fun u => Q (actualState a b.1 u.toNNReal z.1)) := by + obtain ⟨n,hn⟩ := (exhaustionStop_eventually a z b T hT).exists + let ε := exhaustionHeight z n + let V := localState a ε (exhaustionHeight_pos z n) z.1 + have hsafe (u : ℝ≥0) (hu : u≤T) : ε≤Y (V u b) := + (regionStop_safe a ε (exhaustionHeight_pos z n) z.1 (exhaustionNorm z n) 0 0 n + (exhaustionRegion_initial z n) b u (hu.trans hn)).1 + have he (u : ℝ) (hu : u∈Icc 0 (T : ℝ)) : + V u.toNNReal b=actualState a b.1 u.toNNReal z.1 := + (exhaustionStop_agrees a z n b u.toNNReal + ((show u.toNNReal≤T by simpa using Real.toNNReal_le_toNNReal hu.2).trans hn)).2.symm + dsimp only [V] at he + have h := localState_evolution a ε (exhaustionHeight_pos z n) z.1 b T hsafe + refine ⟨?_,?_,?_,?_,?_,?_⟩ + · exact h.yc.congr (fun u hu => congrArg Y (he u hu).symm) + · exact h.jc.congr (fun u hu => congrArg J (he u hu).symm) + · intro u hu; simpa only [←he u hu] using h.yp u hu + · intro u hu; simpa only [←he u hu] using h.qp u hu + · intro u hu + have hh := (h.yd u hu).congr_of_mem (fun v hv => congrArg Y (he v hv).symm) hu + simpa only [he u hu] using hh + · intro u hu + have hh := (h.jd u hu).congr_of_mem (fun v hv => congrArg J (he v hv).symm) hu + simpa only [he u hu] using hh + +lemma actual_height_sq_le_radius (a : ℝ) (ha : 0 by dsimp [Q]; nlinarith only [sq_nonneg (X (actualState a b.1 u.toNNReal z.1))]) + (by simp [actualState_zero ha b z.2]) (t : ℝ) ⟨t.coe_nonneg,le_rfl⟩ + simpa only [Real.toNNReal_coe,Real.toNNReal_zero,actualState_zero ha b z.2,Y_apply, + physicalRadius] using h + +lemma actual_height_sq_lower (a : ℝ) (ha : 0 by dsimp [Q]; nlinarith only [sq_nonneg (X (actualState a b.1 u.toNNReal z.1))]) + (t : ℝ) ⟨t.coe_nonneg,le_rfl⟩ + simpa only [Real.toNNReal_coe,Real.toNNReal_zero,actualState_zero ha b z.2,Y_apply] using h + + + +lemma level_height_bound (a : ℝ) (ha : 0 + simp only [levelRadius,mul_div_cancel_left₀ _ (by norm_num : (2:ℝ)≠0),hexp] + have hpos : 0 F (φ n)) g atTop (closedBall c r) ∧ + DifferentiableOn ℂ g (ball c r) := by + classical + let K := closedBall c r + have : CompactSpace K := isCompact_iff_compactSpace.mp (isCompact_closedBall c r) + have hl (n : ℕ) := lipschitzOn_subball hr hrR (hF n) (hM n) + let f : ℕ → K →ᵇ ℂ := fun n => BoundedContinuousFunction.mkOfCompact + ⟨fun z => F n z, (hl n).continuousOn.domRestrict⟩ + have hlf (n : ℕ) : LipschitzWith (2*M/(R-r)).toNNReal (f n) := + lipschitzOnWith_iff_restrict.mp (hl n) + have heq : Equicontinuous ((↑) : range f → K → ℂ) := by + apply UniformEquicontinuous.equicontinuous + apply LipschitzWith.uniformEquicontinuous _ (2*M/(R-r)).toNNReal + rintro ⟨g,⟨n,rfl⟩⟩ + exact hlf n + have hc := BoundedContinuousFunction.arzela_ascoli (closedBall (0:ℂ) M) + (isCompact_closedBall _ _) (range f) (by + rintro g z ⟨n,rfl⟩ + change dist (F n z) 0 ≤ M + simpa only [dist_zero_right] using + hM n z (closedBall_subset_ball hrR z.2)) heq + obtain ⟨g,-,φ,hφ,hg⟩ := hc.tendsto_subseq (fun n => subset_closure (mem_range_self n)) + let g' : ℂ → ℂ := fun z => if hz : z ∈ K then g ⟨z,hz⟩ else 0 + have he (z : ℂ) (hz : z ∈ K) : g' z = g ⟨z,hz⟩ := dite_eq_left hz + have hu : TendstoUniformlyOn (fun n => F (φ n)) g' atTop K := by + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + have hh := Metric.tendstoUniformly_iff.mp + (BoundedContinuousFunction.tendsto_iff_tendstoUniformly.mp hg) ε hε + filter_upwards [hh] with n hn z hz + rw [he z hz] + exact hn ⟨z,hz⟩ + refine ⟨g',φ,hφ,hu,?_⟩ + exact (hu.mono ball_subset_closedBall).tendstoLocallyUniformlyOn.differentiableOn + (Eventually.of_forall (fun n => (hF (φ n)).mono (ball_subset_ball hrR.le))) isOpen_ball + + + +theorem uniform_zero_of_accumulation {F : ℕ → ℂ → ℂ} {c : ℂ} {r R M : ℝ} + (hr : 0 < r) (hrR : r < R) + (hF : ∀ n, DifferentiableOn ℂ (F n) (ball c R)) + (hM : ∀ n z, z ∈ ball c R → ‖F n z‖ ≤ M) + (z : ℕ → ℂ) (hz : ∀ j, z j ∈ closedBall c r) + (hzc : ∀ j, z j ≠ c) (hzlim : Tendsto z atTop (𝓝 c)) + (hFz : ∀ j, Tendsto (fun n => F n (z j)) atTop (𝓝 0)) : + TendstoUniformlyOn F (fun _ => 0) atTop (closedBall c r) := by + classical + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + by_contra hbad + have hb : ∃ᶠ n in atTop, ∃ w ∈ closedBall c r, ε ≤ ‖F n w‖ := by + simpa only [not_forall,exists_prop,not_lt,dist_zero_left] using (show ∃ᶠ n in atTop, + ¬∀ w ∈ closedBall c r, dist (0:ℂ) (F n w)<ε from Filter.not_eventually.mp hbad) + obtain ⟨ψ,hψ,hψbad⟩ := subseq_forall_of_frequently (x := fun n : ℕ => n) + (p := fun n => ∃ w ∈ closedBall c r, ε ≤ ‖F n w‖) tendsto_id hb + let s : ℝ := (r+R)/2 + have hrs : r hF (ψ n)) (fun n => hM (ψ n)) + have hgzero (j : ℕ) : g (z j)=0 := by + have hpt := hg.tendsto_at (closedBall_subset_closedBall hrs.le (hz j)) + exact tendsto_nhds_unique hpt ((hFz j).comp (hψ.comp hφ.tendsto_atTop)) + have hcl : c∈closure ({w : ℂ | g w=0} \ {c}) := by + apply mem_closure_of_tendsto hzlim + exact Eventually.of_forall (fun j => ⟨hgzero j,hzc j⟩) + have heq : EqOn g (fun _ => 0) (ball c s) := + hgd.analyticOnNhd isOpen_ball |>.eqOn_of_preconnected_of_mem_closure + analyticOnNhd_const (convex_ball c s).isPreconnected (mem_ball_self hs) hcl + have hsmall := Metric.tendstoUniformlyOn_iff.mp hg ε hε + obtain ⟨n,hn⟩ := hsmall.exists + obtain ⟨w,hw,hwbad⟩ := hψbad (φ n) + have hh := hn w (closedBall_subset_closedBall hrs.le hw) + rw [heq (closedBall_subset_ball hrs hw),dist_zero_left] at hh + exact (not_lt_of_ge hwbad) hh + + + +theorem uniform_zero_on_horizontal {F : ℕ → ℂ → ℂ} {C M : ℝ} (hC : 0 ≤ C) + (hF : ∀ n, DifferentiableOn ℂ (F n) {z : ℂ | 0 < z.im}) + (hM : ∀ n z, z ∈ ball (((C^2+2 : ℝ) : ℂ)*Complex.I) (C^2+2-1/4) → + ‖F n z‖ ≤ M) + (hv : ∀ y : ℝ, 0 < y → Tendsto (fun n => F n ((y:ℂ)*Complex.I)) atTop (𝓝 0)) : + TendstoUniformlyOn F (fun _ => 0) atTop {z : ℂ | z.im=1 ∧ |z.re|≤C} := by + let A : ℝ := C^2+2 + let c : ℂ := (A:ℂ)*Complex.I + let r : ℝ := A-1/2 + let R : ℝ := A-1/4 + have hA : 2 ≤ A := by dsimp [A]; nlinarith [sq_nonneg C] + have hr : 0 < r := by dsimp [r]; linarith + have hrR : r < R := by dsimp [r,R]; linarith + have hcim : c.im=A := by simp [c] + have hcre : c.re=0 := by simp [c] + have hball : ball c R ⊆ {z : ℂ | 0 < z.im} := by + intro z hz + have hh := Complex.im_le_norm (c-z) + rw [Complex.sub_im,hcim,norm_sub_rev,← dist_eq_norm] at hh + have hz' : dist z c < A-1/4 := hz + change 0 < z.im + linarith + let z : ℕ → ℂ := fun j => c + ((1/((j:ℝ)+2):ℝ):ℂ)*Complex.I + have hz (j : ℕ) : z j∈closedBall c r := by + have hj : 0 < 1/((j:ℝ)+2) := by positivity + have hj1 : 1/((j:ℝ)+2) ≤ 1/2 := by + apply one_div_le_one_div_of_le (by norm_num) + linarith [Nat.cast_nonneg (α := ℝ) j] + rw [mem_closedBall,dist_eq_norm] + simp only [z,add_sub_cancel_left,norm_mul,Complex.norm_real, + Real.norm_eq_abs,abs_of_pos hj,Complex.norm_I,mul_one] + dsimp [r] + linarith + have hzc (j : ℕ) : z j≠c := by + intro h + have hh := congrArg Complex.im h + simp only [z,Complex.add_im,Complex.mul_I_im,Complex.ofReal_re] at hh + have hp : 0 < 1/((j:ℝ)+2) := by positivity + linarith + have hzlim : Tendsto z atTop (𝓝 c) := by + have hh : Tendsto (fun j : ℕ => 1/((j:ℝ)+2)) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop (tendsto_atTop_add_const_right atTop 2 tendsto_natCast_atTop_atTop) + have h' := (Complex.continuous_ofReal.tendsto 0 |>.comp hh).mul_const Complex.I |>.const_add c + simpa only [z,Function.comp_apply,Complex.ofReal_zero,zero_mul,add_zero] using h' + have hFz (j : ℕ) : Tendsto (fun n => F n (z j)) atTop (𝓝 0) := by + have he : z j = (((A+1/((j:ℝ)+2):ℝ):ℂ)*Complex.I) := by + dsimp [z,c] + push_cast + ring + rw [he] + apply hv + have hp : 0 < 1/((j:ℝ)+2) := by positivity + linarith + apply (uniform_zero_of_accumulation hr hrR (fun n => (hF n).mono hball) + hM z hz hzc hzlim hFz).mono + intro w hw + rw [mem_closedBall,dist_eq_norm] + have hsq : ‖w-c‖^2=w.re^2+(1-A)^2 := by + rw [← Complex.normSq_eq_norm_sq,Complex.normSq_apply] + simp only [Complex.sub_re,Complex.sub_im,hcim,hcre,sub_zero,hw.1] + ring + have hsq2 : w.re^2 ≤ C^2 := by + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg w.re) hC).mpr hw.2 + have hbound : ‖w-c‖^2 ≤ r^2 := by + rw [hsq] + dsimp [r,A] at * + nlinarith + exact (sq_le_sq₀ (norm_nonneg _) hr.le).mp hbound + +end SLEExactGauge.AnalyticCompactness +end +end + + + +section + + +noncomputable section +open Metric Set Filter Topology +namespace SLEExactGauge.AngularLimits +open AnalyticCompactness + + + +theorem uniform_angular_of_radial {X : Type*} (f : X → ℂ → ℂ) (g : X → ℂ) + (S : Set X) {M : ℝ} + (hf : ∀ x∈S, DifferentiableOn ℂ (f x) {z : ℂ | 0 fun x => f x ((y:ℂ)*Complex.I)) + g (𝓝[>] 0) S) {C : ℝ} (hC : 0≤C) : + TendstoUniformlyOn + (fun y : ℝ => fun p : X×ℝ => f p.1 ((y:ℂ)*((p.2:ℂ)+Complex.I))) + (fun p => g p.1) (𝓝[>] 0) (S ×ˢ Icc (-C) C) := by + classical + apply tendstoUniformlyOn_of_seq_tendstoUniformlyOn + intro y hy + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + by_contra hbad + let A : ℝ := C^2+2 + have hA : 0 n) + (p := fun n => (∃ p∈S ×ˢ Icc (-C) C, + ε≤‖g p.1-f p.1 ((y n:ℂ)*((p.2:ℂ)+Complex.I))‖) ∧ + 0 (hψbad n).1) + have hyp (n : ℕ) : 0 g (p n).1-f (p n).1 ((y (ψ n):ℂ)*z) + have hF (n : ℕ) : DifferentiableOn ℂ (F n) {z : ℂ | 0 F n ((v:ℂ)*Complex.I)) atTop (𝓝 0) := by + have hy0 := tendsto_nhds_of_tendsto_nhdsWithin (hy.comp hψ) + have hz : Tendsto (fun n => y (ψ n)*v) atTop (𝓝[>] 0) := by + apply tendsto_nhdsWithin_iff.mpr + refine ⟨?_,Eventually.of_forall (fun n => mul_pos (hyp n) hv)⟩ + simpa only [Function.comp_apply,zero_mul] using hy0.mul_const v + have hu := hr.seq_tendstoUniformlyOn _ hz + rw [Metric.tendsto_nhds] + intro η hη + filter_upwards [Metric.tendstoUniformlyOn_iff.mp hu η hη] with n hn + have hh := hn (p n).1 (hp n).1 + simpa only [F,dist_zero_right,dist_eq_norm,Complex.ofReal_mul,mul_assoc,sub_zero] using hh + have hu := uniform_zero_on_horizontal hC hF hFM hFv + have hs := Metric.tendstoUniformlyOn_iff.mp hu ε hε + obtain ⟨n,hn⟩ := hs.exists + have hseg : ((p n).2:ℂ)+Complex.I ∈ {z : ℂ | z.im=1 ∧ |z.re|≤C} := by + simpa only [mem_ofPred_eq,Complex.add_im,Complex.add_re,Complex.ofReal_im,Complex.ofReal_re, + Complex.I_im,Complex.I_re,zero_add,add_zero] using + (show (1:ℝ)=1 ∧ |(p n).2|≤C from ⟨rfl,abs_le.mpr (hp n).2⟩) + have hh := hn _ hseg + rw [dist_zero_left] at hh + exact (not_lt_of_ge (hpb n)) hh + +end SLEExactGauge.AngularLimits +end +end + + + +section + + +noncomputable section +open Metric Set Filter Topology MeasureTheory +namespace SLEExactGauge.TraceChaining + + + +theorem radial_uniform_limit_nhds_of_bands {X E : Type*} [MetricSpace E] + [CompleteSpace E] (f : X → ℝ → E) (g : X → E) (S : Set X) + {r : ℝ} (hr : 0] 0) (𝓝 (g t))) : + TendstoUniformlyOn (fun y t => f t y) g (𝓝[>] 0) S := by + have hu := radial_uniform_limit_of_bands f g S hr hr1 he hb hg + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + have hε2 : 0<ε/2 := by linarith + obtain ⟨n₀,hn₀⟩ := eventually_atTop.mp hb + obtain ⟨n₁,hn₁⟩ := eventually_atTop.mp + (he.tendsto_atTop_zero.eventually (Iio_mem_nhds hε2)) + obtain ⟨n₂,hn₂⟩ := eventually_atTop.mp + (Metric.tendstoUniformlyOn_iff.mp hu (ε/2) hε2) + let n₃ := max n₀ (max n₁ n₂) + have hv : 0] 0, y radialValue κ b t y) + (fun t => trace κ b (t/κ)) (𝓝[>] 0) (Icc (1/((m:ℝ)+1)) H) := by + obtain ⟨N,hN,hbands⟩ := radial_uniform_bands hκ hκ8 hW + filter_upwards [hbands,trace_limit_all_positive hκ hκ8 hW] with b hb hlim + intro m H + apply radial_uniform_limit_nhds_of_bands (fun t => radialValue κ b t) + (fun t => trace κ b (t/κ)) _ (traceRatio_pos N) (traceRatio_lt_one hN) + (traceError_summable hκ hκ8 hN H) + · filter_upwards [hb m H] with n hn t ht y hy hy' + simpa only [dist_eq_norm] using hn t ht.1 ht.2 y hy hy' + · intro t ht + have ht0 : 0 fun p : ℝ×ℝ => inverseFlow κ b p.1 + (driverValue b p.1+(y:ℂ)*((p.2:ℂ)+Complex.I))) + (fun p => trace κ b (p.1/κ)) (𝓝[>] 0) + (Icc (1/((m:ℝ)+1)) H ×ˢ Icc (-C) C) := by + filter_upwards [radial_uniform_all_windows hκ hκ8 hW] with b hb + intro m H C hC + have hc : Continuous (driverValue b) := (map_continuous b).comp continuous_real_toNNReal + obtain ⟨R,hR,hRB⟩ := (isCompact_Icc.image hc).isBounded.exists_pos_norm_le + have hB : ∀ u∈Icc (0:ℝ) H, |driverValue b u|≤R := by + intro u hu + simpa only [Real.norm_eq_abs] using hRB _ (mem_image_of_mem _ hu) + let B : ℝ := R+3+2*a κ*H + let S := Icc (1/((m:ℝ)+1)) (H:ℝ) + have ht0 (t : ℝ) (ht : t∈S) : 0≤t := + (by positivity : (0:ℝ)≤1/((m:ℝ)+1)).trans ht.1 + have hg (t : ℝ) (ht : t∈S) : ‖trace κ b (t/κ)‖≤B := by + apply le_of_tendsto ((hb m H).tendsto_at ht).norm + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ y : ℝ in 𝓝[>] 0, y<1 from nhdsWithin_le_nhds (Iio_mem_nhds zero_lt_one))] + with y hy hy1 + exact inverseFlow_shift_bound hκ (ht0 t ht) ht.2 b hB + (by simpa using hy) (by simp only [norm_mul,Complex.norm_real,Real.norm_eq_abs, + abs_of_pos (show 0 inverseFlow κ b t (driverValue b t+z)) + (fun t => trace κ b (t/κ)) S (M := 2*B) _ _ (hb m H) hC + · intro t ht z hz + apply ((inverseFlow_hasStrictDerivAt hκ b (ht0 t ht) (by simpa using hz)).hasDerivAt.comp z + ((hasDerivAt_id z).const_add (driverValue b t:ℂ))).differentiableAt.differentiableWithinAt + · intro t ht z hzi hzn + exact (norm_sub_le _ _).trans (by + have hh := inverseFlow_shift_bound hκ (ht0 t ht) ht.2 b hB hzi hzn + have hh' := hg t ht + change ‖inverseFlow κ b t (driverValue b t+z)‖≤B at hh + linarith) + +end SLEExactGauge.LiteralTrace +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/InitialTrace.lean b/lean/OAI/Probability/SLEGauge/InitialTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6da55ca53eb0bd59b0e55336cfd1d32b256309e --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/InitialTrace.lean @@ -0,0 +1,409 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TraceBoundary + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero +noncomputable section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped Topology +noncomputable section +open Set Filter Metric +open scoped Topology +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.LiteralTrace +open TraceChaining +lemma PositiveSolution.initial_abs_re_le {κ : ℝ} {b : Driver} {z : ℂ} {T R : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) (hκ : 0 < κ) (hT : 0 ≤ T) + (hB : ∀ u ∈ Icc 0 T, |driverValue b u| ≤ R) (hfT : |(f T).re| ≤ R) : + |z.re| ≤ R := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hn (u : ℝ) (hu : u ∈ Icc 0 T) : 0 < ‖f u-driverValue b u‖^2 := + sq_pos_of_pos (norm_pos_iff.mpr (hf.shifted_ne_zero hu)) + apply abs_le.mpr + constructor + · have hh := initial_le_of_outward_deriv (R := R) hT + (Complex.continuous_re.comp_continuousOn hf.2.1).neg + (fun u hu => (hf.re_hasDeriv hu).neg) (by + change -(f T).re ≤ R + linarith [(abs_le.mp hfT).1]) + (by + intro u hu hg + change R < -(f u).re at hg + have hBu := (abs_le.mp (hB u hu)).1 + have hm : 0 < -(a κ*((f u).re-driverValue b u)) := by nlinarith + simpa only [neg_div] using div_pos hm (hn u hu)) + change -(f 0).re ≤ R at hh + rw [hf.2.2.1] at hh + linarith + · have hh := initial_le_of_outward_deriv (R := R) hT + (Complex.continuous_re.comp_continuousOn hf.2.1) + (fun u hu => hf.re_hasDeriv hu) (abs_le.mp hfT).2 + (by + intro u hu hg + change R < (f u).re at hg + have hBu := (abs_le.mp (hB u hu)).2 + exact div_pos (mul_pos ha (by linarith)) (hn u hu)) + change (f 0).re ≤ R at hh + simpa only [hf.2.2.1] using hh + +lemma inverseFlow_abs_re_le {κ T R y : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) + (hy : 0 < y) (b : Driver) (hB : ∀ u ∈ Icc 0 T, |driverValue b u| ≤ R) : + |(radialValue κ b T y).re| ≤ R := by + have hw : 0 < ((driverValue b T:ℂ)+y*Complex.I).im := by simpa using hy + have hf := surviving_flow_positiveSolution hT (inverseFlow_surviving hκ b hT hw) + apply hf.initial_abs_re_le hκ hT hB + rw [flow_inverseFlow hκ b hT hw] + simpa using hB T (right_mem_Icc.mpr hT) + +lemma radial_limit_early_bound {κ T R : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) + (hB : ∀ u ∈ Icc 0 T, |driverValue b u| ≤ R) {z : ℂ} + (hz : Tendsto (radialValue κ b T) (𝓝[>] 0) (𝓝 z)) : + ‖z‖ ≤ R+Real.sqrt (2*a κ*T) := by + have hre : |z.re| ≤ R := by + apply le_of_tendsto ((Complex.continuous_re.tendsto z).comp hz |>.abs) + filter_upwards [self_mem_nhdsWithin] with y hy + exact inverseFlow_abs_re_le hκ hT hy b hB + have him0 : 0 ≤ z.im := by + apply ge_of_tendsto ((Complex.continuous_im.tendsto z).comp hz) + filter_upwards [self_mem_nhdsWithin] with y hy + exact (inverseFlow_im_pos hκ hT b (by simpa using hy)).le + have hi : z.im^2 ≤ 2*a κ*T := by + have hlim : Tendsto (fun y : ℝ => y^2+2*a κ*T) (𝓝[>] 0) (𝓝 (2*a κ*T)) := by + simpa using (((tendsto_id'.mpr nhdsWithin_le_nhds : + Tendsto (fun y : ℝ => y) (𝓝[>] (0:ℝ)) (𝓝 0)).pow 2).add_const (2*a κ*T)) + apply le_of_tendsto_of_tendsto (((Complex.continuous_im.tendsto z).comp hz).pow 2) hlim + filter_upwards [self_mem_nhdsWithin] with y hy + simpa using inverseFlow_im_sq_bound hκ hT b + (show 0 < ((driverValue b T:ℂ)+y*Complex.I).im by simpa using hy) + have hi' : z.im ≤ Real.sqrt (2*a κ*T) := (Real.le_sqrt him0 (by exact mul_nonneg (mul_nonneg (by norm_num) (div_pos (by norm_num) hκ).le) hT)).mpr hi + calc + ‖z‖ ≤ |z.re|+|z.im| := Complex.norm_le_abs_re_add_abs_im z + _ ≤ R+Real.sqrt (2*a κ*T) := by rw [abs_of_nonneg him0]; linarith +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open Set Filter Topology + +lemma inverseFlow_zero (κ : ℝ) (hκ : 0 < κ) (b : Driver) {w : ℂ} (hw : 0 < w.im) : + inverseFlow κ b 0 w = w := by + have hs := inverseFlow_surviving hκ b (le_refl 0) hw + have hf := surviving_flow_positiveSolution (le_refl 0) hs + have he := flow_inverseFlow hκ b (le_refl 0) hw + rwa [hf.2.2.1] at he + + + +lemma trace_zero (κ : ℝ) (hκ : 0 < κ) (b : Driver) : trace κ b 0 = 0 := by + unfold trace + simp only [mul_zero,driverValue,Real.toNNReal_zero,map_zero,Complex.ofReal_zero,zero_add] + apply Filter.Tendsto.limUnder_eq + have hc : Tendsto (fun ε : ℝ => (ε:ℂ)*Complex.I) (nhdsWithin 0 (Ioi 0)) (𝓝 (0:ℂ)) := by + have hc0 : Continuous (fun ε : ℝ => (ε:ℂ)*Complex.I) := + Complex.continuous_ofReal.mul continuous_const + have h : Tendsto (fun ε : ℝ => (ε:ℂ)*Complex.I) + (nhdsWithin 0 (Ioi 0)) (𝓝 ((0:ℂ)*Complex.I)) := + (hc0.tendsto (0:ℝ)).mono_left nhdsWithin_le_nhds + simpa using h + apply hc.congr' + filter_upwards [self_mem_nhdsWithin] with ε hε + exact (inverseFlow_zero κ hκ b (by simpa using hε)).symm +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace + +lemma trace_limit_zero {κ : ℝ} (hκ : 0 < κ) (b : Driver) : + Tendsto (fun y : ℝ => inverseFlow κ b (κ*0) + (driverValue b (κ*0)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b 0)) := by + rw [trace_zero κ hκ b] + simp only [mul_zero,driverValue,Real.toNNReal_zero,map_zero,Complex.ofReal_zero,zero_add] + have hc : Tendsto (fun y : ℝ => (y:ℂ)*Complex.I) (𝓝[>] 0) (𝓝 (0:ℂ)) := by + simpa only [Complex.ofReal_zero,zero_mul] using + ((Complex.continuous_ofReal.tendsto 0).mul_const Complex.I).mono_left nhdsWithin_le_nhds + apply hc.congr' + filter_upwards [self_mem_nhdsWithin] with y hy + exact (inverseFlow_zero κ hκ b (by simpa using hy)).symm + +lemma trace_continuousWithinAt_zero {κ : ℝ} (hκ : 0 < κ) (b : Driver) + (hlim : ∀ t : ℝ, 0 < t → Tendsto (fun y : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t))) : + ContinuousWithinAt (trace κ b) (Ici 0) 0 := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hB : Continuous (driverValue b) := (map_continuous b).comp continuous_real_toNNReal + have hB0 : driverValue b 0 = 0 := by simp [driverValue] + have hz := trace_zero κ hκ b + rw [Metric.continuousWithinAt_iff] + intro ε hε + obtain ⟨δ,hδ,hδB⟩ := Metric.continuousAt_iff.mp (hB.continuousAt (x := 0)) + (ε/2) (by linarith) + have hi : 0 < ε^2/(8*a κ*κ) := by positivity + refine ⟨min (δ/κ) (ε^2/(8*a κ*κ)),lt_min (div_pos hδ hκ) hi,?_⟩ + intro t ht htd + have ht0 : 0 ≤ t := ht + have hts : t < min (δ/κ) (ε^2/(8*a κ*κ)) := by + simpa only [Real.dist_eq,sub_zero,abs_of_nonneg ht0] using htd + rcases ht0.eq_or_lt with he | hp + · subst t + simp only [dist_self] + exact hε + have htδ : κ*t < δ := by + have hh := (lt_div_iff₀ hκ).mp (hts.trans_le (min_le_left _ _)) + nlinarith + have hdr (u : ℝ) (hu : u ∈ Icc 0 (κ*t)) : |driverValue b u| ≤ ε/2 := by + have hh := hδB (show dist u (0:ℝ) < δ from by + rw [Real.dist_eq,sub_zero,abs_of_nonneg hu.1] + exact hu.2.trans_lt htδ) + simpa only [Real.dist_eq,hB0,sub_zero] using hh.le + have hbnd := radial_limit_early_bound hκ (mul_nonneg hκ.le ht0) b hdr (hlim t hp) + have hroot : Real.sqrt (2*a κ*(κ*t)) < ε/2 := by + apply (Real.sqrt_lt (by positivity) (by linarith : 0 ≤ ε/2)).mpr + have hh := (lt_div_iff₀ (by positivity : 0 < 8*a κ*κ)).mp + (hts.trans_le (min_le_right _ _)) + nlinarith + rw [hz,dist_zero_right] + linarith +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open MeasureTheory + +lemma surviving_of_le {κ : ℝ} {b : Driver} {z : ℂ} {s t : ℝ} + (hs : 0 ≤ s) (hst : s ≤ t) (hz : Surviving κ b z t) : Surviving κ b z s := + ((surviving_flow_positiveSolution (hs.trans hst) hz).restrict hs hst).surviving + +lemma radial_limit_mem_closure {κ T s : ℝ} (hκ : 0 < κ) (hs : 0 ≤ s) (hsT : s ≤ T) + (b : Driver) {z : ℂ} + (hz : Tendsto (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) + (𝓝[>] 0) (𝓝 z)) : z ∈ closure {w | Surviving κ b w s} := by + apply mem_closure_of_tendsto hz + filter_upwards [self_mem_nhdsWithin] with y hy + apply surviving_of_le hs hsT + exact inverseFlow_surviving hκ b (hs.trans hsT) (by simpa using hy) + +lemma radial_limit_not_surviving {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) + {z : ℂ} (hz : Tendsto (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) + (𝓝[>] 0) (𝓝 z)) : ¬ Surviving κ b z T := by + intro hs + have hg := (flow_continuousAt_initial hT hs).tendsto.comp hz + have he : (fun y : ℝ => flow κ b (inverseFlow κ b T (driverValue b T+y*Complex.I)) T) =ᶠ[𝓝[>] 0] + (fun y : ℝ => (driverValue b T:ℂ)+y*Complex.I) := by + filter_upwards [self_mem_nhdsWithin] with y hy + exact flow_inverseFlow hκ b hT (by simpa using hy) + have hl : Tendsto (fun y : ℝ => (driverValue b T:ℂ)+y*Complex.I) + (𝓝[>] 0) (𝓝 (driverValue b T:ℂ)) := by + simpa only [Complex.ofReal_zero,zero_mul,add_zero] using + (((Complex.continuous_ofReal.tendsto 0).mul_const Complex.I).const_add (driverValue b T:ℂ)).mono_left + nhdsWithin_le_nhds + have hid : flow κ b z T = driverValue b T := tendsto_nhds_unique (hg.congr' he) hl + have hpos := (surviving_flow_positiveSolution hT hs).2.2.2.1 T ⟨hT,le_rfl⟩ + rw [hid,Complex.ofReal_im] at hpos + exact (lt_irrefl 0) hpos + +lemma radial_limit_mem_frontier {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) + {z : ℂ} (hz : Tendsto (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) + (𝓝[>] 0) (𝓝 z)) : z ∈ frontier {w | Surviving κ b w T} := by + rw [(isOpen_surviving κ b hT).frontier_eq] + exact ⟨radial_limit_mem_closure hκ hT le_rfl b hz,radial_limit_not_surviving hκ hT b hz⟩ + + + +theorem trace_countable_boundary {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) (t : ℕ → ℝ) (ht : ∀ n, 0 ≤ t n) : + ∀ᵐ b ∂W, ∀ n : ℕ, + trace κ b (t n) ∈ frontier {z | Surviving κ b z (κ*t n)} ∧ + ∀ s : ℝ, 0 ≤ s → s ≤ t n → + trace κ b (t n) ∈ closure {z | Surviving κ b z (κ*s)} := by + filter_upwards [trace_limit_countable hκ hκ8 hW t ht] with b hb + intro n + refine ⟨radial_limit_mem_frontier hκ (mul_nonneg hκ.le (ht n)) b (hb n),?_⟩ + intro s hs hst + exact radial_limit_mem_closure hκ (mul_nonneg hκ.le hs) + (mul_le_mul_of_nonneg_left hst hκ.le) b (hb n) +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open Set Filter Topology MeasureTheory + + + +theorem trace_regular_all_times {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, + (∀ t : ℝ, 0 ≤ t → + Tendsto (fun y : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t))) ∧ + ContinuousOn (trace κ b) (Ici 0) ∧ + (∀ t : ℝ, 0 ≤ t → trace κ b t ∈ frontier {z | Surviving κ b z (κ*t)}) ∧ + (∀ s : ℝ, 0 ≤ s → + (trace κ b) '' Ici s ⊆ closure {z | Surviving κ b z (κ*s)}) := by + filter_upwards [trace_limit_all_positive hκ hκ8 hW, + trace_continuous_positive hκ hκ8 hW] with b hlim hc + have hall (t : ℝ) (ht : 0 ≤ t) : + Tendsto (fun y : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t)) := by + rcases ht.eq_or_lt with he | hp + · subst t + exact trace_limit_zero hκ b + · exact hlim t hp + refine ⟨hall,?_,?_,?_⟩ + · intro t ht + rcases (show 0 ≤ t from ht).eq_or_lt with he | hp + · subst t + exact trace_continuousWithinAt_zero hκ b hlim + · exact (hc.continuousAt (isOpen_Ioi.mem_nhds hp)).continuousWithinAt + · intro t ht + exact radial_limit_mem_frontier hκ (mul_nonneg hκ.le ht) b (hall t ht) + · intro s hs z hz + obtain ⟨t,ht,rfl⟩ := hz + exact radial_limit_mem_closure hκ (mul_nonneg hκ.le hs) + (mul_le_mul_of_nonneg_left ht hκ.le) b (hall t (hs.trans ht)) + +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open Set Filter Topology MeasureTheory + + +def unboundedHalfPlaneComponent (K : Set ℂ) : Set ℂ := + {z | z ∈ {w : ℂ | 0 < w.im} \ K ∧ + ¬ Bornology.IsBounded (connectedComponentIn ({w : ℂ | 0 < w.im} \ K) z)} + +lemma inverseFlow_image_upper {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) : + inverseFlow κ b T '' {w : ℂ | 0 < w.im} = {z : ℂ | Surviving κ b z T} := by + ext z + constructor + · rintro ⟨w,hw,rfl⟩ + exact inverseFlow_surviving hκ b hT hw + · intro hz + refine ⟨flow κ b z T,?_,inverseFlow_flow hT hz⟩ + exact (surviving_flow_positiveSolution hT hz).2.2.2.1 T ⟨hT,le_rfl⟩ + +lemma isPreconnected_surviving {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) : + IsPreconnected {z : ℂ | Surviving κ b z T} := by + rw [← inverseFlow_image_upper hκ hT b] + exact (convex_halfSpace_im_gt 0).isPreconnected.image _ + (fun w hw => (inverseFlow_hasStrictDerivAt hκ b hT hw).hasDerivAt.continuousAt.continuousWithinAt) + +lemma not_isBounded_surviving {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) : + ¬ Bornology.IsBounded {z : ℂ | Surviving κ b z T} := by + intro hb + obtain ⟨R,hR,hb⟩ := hb.exists_pos_norm_le + let w : ℂ := (R+1)*Complex.I + have hw : 0 < w.im := by dsimp [w]; simpa using (show 0 < R+1 by linarith) + have hz := inverseFlow_surviving hκ b hT hw + have hf := surviving_flow_positiveSolution hT hz + have hi := hf.im_antitone hκ (left_mem_Icc.mpr hT) (right_mem_Icc.mpr hT) hT + dsimp only at hi + rw [hf.2.2.1,flow_inverseFlow hκ b hT hw] at hi + have hn := (Complex.im_le_norm (inverseFlow κ b T w)).trans (hb _ hz) + have he : w.im = R+1 := by simp [w] + rw [he] at hi + linarith + + + +theorem surviving_subset_trace_component {κ : ℝ} (hκ : 0 < κ) (b : Driver) + (hlim : ∀ t : ℝ, 0 ≤ t → + Tendsto (fun y : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t))) + {t : ℝ} (ht : 0 ≤ t) : + {z : ℂ | Surviving κ b z (κ*t)} ⊆ + unboundedHalfPlaneComponent ((trace κ b) '' Icc 0 t) := by + have hT : 0 ≤ κ*t := mul_nonneg hκ.le ht + have hsub : {z : ℂ | Surviving κ b z (κ*t)} ⊆ + {w : ℂ | 0 < w.im} \ ((trace κ b) '' Icc 0 t) := by + intro z hz + refine ⟨?_,?_⟩ + · have hh := (surviving_flow_positiveSolution hT hz).2.2.2.1 0 + (left_mem_Icc.mpr hT) + rwa [(surviving_flow_positiveSolution hT hz).2.2.1] at hh + · rintro ⟨s,hs,rfl⟩ + exact radial_limit_not_surviving hκ (mul_nonneg hκ.le hs.1) b (hlim s hs.1) + (surviving_of_le (mul_nonneg hκ.le hs.1) + (mul_le_mul_of_nonneg_left hs.2 hκ.le) hz) + intro z hz + refine ⟨hsub hz,?_⟩ + intro hb + exact not_isBounded_surviving hκ hT b (hb.subset + ((isPreconnected_surviving hκ hT b).subset_connectedComponentIn hz hsub)) + +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open Set Filter Topology MeasureTheory + + + +theorem trace_generation_partial {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, + (∀ t : ℝ, 0 ≤ t → + Tendsto (fun ε : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+ε*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t))) ∧ + ContinuousOn (trace κ b) (Ici 0) ∧ + (∀ t : ℝ, 0 ≤ t → + {z : ℂ | Surviving κ b z (κ*t)} ⊆ + unboundedHalfPlaneComponent ((trace κ b) '' Icc 0 t)) ∧ + (∀ t : ℝ, 0 ≤ t → + (trace κ b) '' Ici t ⊆ closure {z : ℂ | Surviving κ b z (κ*t)}) := by + filter_upwards [trace_regular_all_times hκ hκ8 hW] with b hb + exact ⟨hb.1,hb.2.1,fun t ht => surviving_subset_trace_component hκ b hb.1 ht, + hb.2.2.2⟩ + + + +def MissingReverseTraceDomainObligation : Prop := + ∀ κ : ℝ, 0 < κ → κ < 8 → ∀ W : WienerLaw, IsWiener W → + ∀ᵐ b ∂W, ∀ t : ℝ, 0 ≤ t → + unboundedHalfPlaneComponent ((trace κ b) '' Icc 0 t) ⊆ + {z : ℂ | Surviving κ b z (κ*t)} + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/InverseDomains.lean b/lean/OAI/Probability/SLEGauge/InverseDomains.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea5ba48f6c85eefe13831a5eaf2c186e0da4fe25 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/InverseDomains.lean @@ -0,0 +1,421 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.EulerFlow + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.LiteralTrace +lemma PositiveSolution.surviving {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : Surviving κ b z T := by + obtain ⟨j,hj,hgap⟩ := hf.exists_cutoff + have he := hf.cutoff_eq hj (fun t ht => (hgap t ht).le) + obtain ⟨t0,ht0,hmin⟩ := isCompact_Icc.exists_isMinOn ⟨0,le_rfl,hf.1⟩ + (Complex.continuous_im.comp_continuousOn hf.2.1) + refine ⟨j,hj,(hgap t0 ht0).trans_le ?_⟩ + apply le_csInf (s := (fun u : ℝ => (cutoffFlow κ b j z u).im) '' Icc 0 T) + (Set.Nonempty.image _ ⟨0,le_rfl,hf.1⟩) + rintro y ⟨t,ht,rfl⟩ + dsimp only + rw [he ht] + exact hmin ht +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace + +lemma cutoff_positiveSolution {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} (hT : 0 ≤ T) + {j : ℕ} (hj : 1 ≤ j) + (hgap : (j:ℝ)⁻¹ < sInf ((fun u : ℝ => (cutoffFlow κ b j z u).im) '' Icc 0 T)) : + PositiveSolution κ b z T (cutoffFlow κ b j z) := by + have hc := cutoffFlow_continuous κ b hj z hT + have hb := (isCompact_Icc.image_of_continuousOn (Complex.continuous_im.comp_continuousOn hc)).bddBelow + have hg t (ht : t ∈ Icc 0 T) : (j:ℝ)⁻¹ < (cutoffFlow κ b j z t).im := + hgap.trans_le (csInf_le hb ⟨t,ht,rfl⟩) + refine ⟨hT,hc,(cutoffFlow_solution κ b j hj z hT).2.1,?_,?_⟩ + · intro t ht + exact lt_trans (inv_pos.mpr (by exact_mod_cast (Nat.zero_lt_of_lt hj))) (hg t ht) + · intro t ht + rw [← cutoffField_of_height κ b hj (hg t ht).le] + exact (cutoffFlow_solution κ b j hj z hT).2.2 t ht + +lemma PositiveSolution.restrict {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : 0 ≤ t) (htT : t ≤ T) : + PositiveSolution κ b z t f := by + have hi : Icc 0 t ⊆ Icc 0 T := Icc_subset_Icc_right htT + exact ⟨ht,hf.2.1.mono hi,hf.2.2.1,fun u hu => hf.2.2.2.1 u (hi hu), + fun u hu => (hf.2.2.2.2 u (hi hu)).mono hi⟩ + +lemma PositiveSolution.flow_eq {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : flow κ b z T = f T := by + have hs := hf.surviving + have hn := Nat.find_spec hs + rw [flow,dite_eq_left hs] + exact (cutoff_positiveSolution hf.1 hn.1 hn.2).unique hf ⟨hf.1,le_rfl⟩ + +lemma PositiveSolution.flow_eqOn {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : EqOn (flow κ b z) f (Icc 0 T) := + fun _ ht => (hf.restrict ht.1 ht.2).flow_eq + +lemma surviving_iff_positiveSolution {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} (hT : 0 ≤ T) : + Surviving κ b z T ↔ ∃ f, PositiveSolution κ b z T f := by + constructor + · rintro ⟨j,hj,hgap⟩ + exact ⟨cutoffFlow κ b j z,cutoff_positiveSolution hT hj hgap⟩ + · rintro ⟨f,hf⟩ + exact hf.surviving + +lemma surviving_flow_positiveSolution {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hs : Surviving κ b z T) : PositiveSolution κ b z T (flow κ b z) := by + obtain ⟨f,hf⟩ := (surviving_iff_positiveSolution hT).mp hs + have he := hf.flow_eqOn + refine ⟨hT,hf.2.1.congr (fun t ht => he ht),?_,?_,?_⟩ + · rw [he ⟨le_rfl,hT⟩,hf.2.2.1] + · intro t ht + rw [he ht] + exact hf.2.2.2.1 t ht + · intro t ht + rw [he ht] + exact (hf.2.2.2.2 t ht).congr (fun u hu => he hu) (he ht) +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace + + + +lemma PositiveSolution.extend {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : + ∃ U : ℝ, T < U ∧ ∃ g : ℝ → ℂ, PositiveSolution κ b z U g ∧ EqOn g f (Icc 0 T) := by + obtain ⟨j,hj,hgap⟩ := hf.exists_cutoff + let g := cutoffFlow κ b j z + have he : EqOn g f (Icc 0 T) := hf.cutoff_eq hj (fun t ht => (hgap t ht).le) + have hc := cutoffFlow_continuous κ b hj z (show 0 ≤ T+1 by linarith [hf.1]) + have hy : (j:ℝ)⁻¹ < (g T).im := by rw [he ⟨hf.1,le_rfl⟩]; exact hgap T ⟨hf.1,le_rfl⟩ + have hci := (Complex.continuous_im.comp_continuousOn hc) T (show T ∈ Icc 0 (T+1) by constructor <;> linarith [hf.1]) + obtain ⟨δ,hδ,hnear⟩ := Metric.continuousWithinAt_iff.mp hci ((g T).im-(j:ℝ)⁻¹) (sub_pos.mpr hy) + let U := T+min (δ/2) (1/2) + have hTU : T < U := by dsimp [U]; have := lt_min (by linarith : 0 < δ/2) (by norm_num : (0:ℝ)<1/2); linarith + have hU1 : U ≤ T+1 := by dsimp [U]; have := min_le_right (δ/2) (1/2:ℝ); linarith + have hU : 0 ≤ U := hf.1.trans hTU.le + have hg t (ht : t ∈ Icc 0 U) : (j:ℝ)⁻¹ < (g t).im := by + by_cases htT : t ≤ T + · rw [he ⟨ht.1,htT⟩] + exact hgap _ ⟨ht.1,htT⟩ + · have hdist : dist t T < δ := by + rw [Real.dist_eq,abs_of_nonneg (by linarith)] + have hδU : U ≤ T+δ/2 := by dsimp [U]; exact add_le_add le_rfl (min_le_left (δ/2) (1/2:ℝ)) + linarith [ht.2] + have hn := hnear ⟨ht.1,ht.2.trans hU1⟩ hdist + rw [Real.dist_eq] at hn + have hh := (abs_lt.mp hn).1 + change -((g T).im-(j:ℝ)⁻¹) < (g t).im-(g T).im at hh + linarith + refine ⟨U,hTU,g,⟨hU,hc.mono (Icc_subset_Icc_right hU1),?_,?_,?_⟩,he⟩ + · exact (cutoffFlow_solution κ b j hj z hU).2.1 + · intro t ht + exact (inv_pos.mpr (by exact_mod_cast (Nat.zero_lt_of_lt hj))).trans (hg t ht) + · intro t ht + rw [← cutoffField_of_height κ b hj (hg t ht).le] + exact (cutoffFlow_solution κ b j hj z hU).2.2 t ht + +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace + +def clockIntegrand (b : Driver) (f : ℝ → ℂ) (t : ℝ) : ℝ := + (f t).im^2/‖f t-driverValue b t‖^4 + +def rawClock (κ : ℝ) (b : Driver) (z : ℂ) (t : ℝ) : ℝ := + ∫ u in Icc (0:ℝ) t, clockIntegrand b (flow κ b z) u + +lemma PositiveSolution.shifted_ne_zero {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : t ∈ Icc 0 T) : f t-driverValue b t ≠ 0 := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + exact (hf.2.2.2.1 t ht).ne' hi + +lemma PositiveSolution.continuous_clockIntegrand {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : ContinuousOn (clockIntegrand b f) (Icc 0 T) := by + apply ((Complex.continuous_im.comp_continuousOn hf.2.1).pow 2).div + ((hf.2.1.sub (Complex.continuous_ofReal.comp (continuous_driverValue b)).continuousOn).norm.pow 4) + intro t ht + exact pow_ne_zero _ (norm_ne_zero_iff.mpr (hf.shifted_ne_zero ht)) + +def timeClip (T t : ℝ) : ℝ := max 0 (min T t) +lemma continuous_timeClip (T : ℝ) : Continuous (timeClip T) := continuous_const.max (continuous_const.min continuous_id) +lemma timeClip_mem {T : ℝ} (hT : 0 ≤ T) (t : ℝ) : timeClip T t ∈ Icc 0 T := + ⟨le_max_left _ _,max_le hT (min_le_left _ _)⟩ +lemma timeClip_eq {T t : ℝ} (ht : t ∈ Icc 0 T) : timeClip T t = t := + by rw [timeClip,min_eq_right ht.2,max_eq_right ht.1] + + + +def pathClock (b : Driver) (f : ℝ → ℂ) (T t : ℝ) : ℝ := + ∫ u in (0:ℝ)..t, clockIntegrand b f (timeClip T u) + +lemma PositiveSolution.continuous_timeClippedIntegrand {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : Continuous (fun t => clockIntegrand b f (timeClip T t)) := + hf.continuous_clockIntegrand.comp_continuous (continuous_timeClip T) (timeClip_mem hf.1) + +lemma PositiveSolution.pathClock_deriv {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivAt (pathClock b f T) (clockIntegrand b f t) t := by + have hc := hf.continuous_timeClippedIntegrand + have hd := intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + convert hd using 1 <;> first | rfl | simp only [timeClip_eq ht] + +lemma PositiveSolution.pathClock_continuous {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : ContinuousOn (pathClock b f T) (Icc 0 T) := + fun _ ht => (hf.pathClock_deriv ht).continuousAt.continuousWithinAt + +lemma PositiveSolution.rawClock_eq {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : t ∈ Icc 0 T) : + rawClock κ b z t = pathClock b f T t := by + rw [rawClock,integral_Icc_eq_integral_Ioc,pathClock,intervalIntegral.integral_of_le ht.1] + apply setIntegral_congr_fun measurableSet_Ioc + intro u hu + have huT : u ∈ Icc 0 T := ⟨hu.1.le,hu.2.trans ht.2⟩ + dsimp only + rw [timeClip_eq huT] + simp only [clockIntegrand,hf.flow_eqOn huT] + +lemma PositiveSolution.pathClock_strictMono {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : StrictMonoOn (pathClock b f T) (Icc 0 T) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc _ _) hf.pathClock_continuous + (fun t ht => (hf.pathClock_deriv (interior_subset ht)).hasDerivWithinAt) + intro t ht + unfold clockIntegrand + exact div_pos (sq_pos_of_pos (hf.2.2.2.1 t (interior_subset ht))) + (pow_pos (norm_pos_iff.mpr (hf.shifted_ne_zero (interior_subset ht))) _) + +lemma PositiveSolution.rawClock_strictMono {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : StrictMonoOn (rawClock κ b z) (Icc 0 T) := by + intro u hu v hv huv + rw [hf.rawClock_eq hu,hf.rawClock_eq hv] + exact hf.pathClock_strictMono hu hv huv +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace + +def rawLevelTime (κ : ℝ) (b : Driver) (z : ℂ) (s : ℝ) : ℝ≥0∞ := + sInf {t | ∃ q : ℚ, 0 < q ∧ t = ENNReal.ofReal (q:ℝ) ∧ + Surviving κ b z q ∧ s < rawClock κ b z q} + +lemma clock_eq_rawClock (κ θ : ℝ) (b : Driver) (x : ℂ) (t : ℝ) : + clock κ θ b x t = rawClock κ b (diskMapInv θ x) t := rfl +lemma levelTime_eq_rawLevelTime (κ θ : ℝ) (b : Driver) (s : ℝ) : + levelTime κ θ b s = rawLevelTime κ b (diskMapInv θ 0) s := rfl +lemma rawClock_zero (κ : ℝ) (b : Driver) (z : ℂ) : rawClock κ b z 0 = 0 := by + simp [rawClock] + +lemma PositiveSolution.rawClock_continuous {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : ContinuousOn (rawClock κ b z) (Icc 0 T) := + hf.pathClock_continuous.congr (fun _ ht => hf.rawClock_eq ht) + + + +lemma PositiveSolution.rawLevelTime_eq {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) : + rawLevelTime κ b z (rawClock κ b z T) = ENNReal.ofReal T := by + apply le_antisymm + · obtain ⟨U,hTU,g,hg,_⟩ := hf.extend + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + have hεr : (0:ℝ) < ε := by exact_mod_cast hε + have hbar : T < min U (T+ε) := lt_min hTU (by linarith) + obtain ⟨q,hTq,hq⟩ := exists_rat_btwn hbar + have hq0 : (0:ℝ) < q := hf.1.trans_lt hTq + have hqU : (q:ℝ) ≤ U := (hq.trans_le (min_le_left _ _)).le + have hcq := hg.rawClock_strictMono ⟨hf.1,hTU.le⟩ ⟨hq0.le,hqU⟩ hTq + have hle : rawLevelTime κ b z (rawClock κ b z T) ≤ ENNReal.ofReal (q:ℝ) := + sInf_le ⟨q,by exact_mod_cast hq0,rfl,(hg.restrict hq0.le hqU).surviving,hcq⟩ + refine hle.trans ?_ + calc + ENNReal.ofReal (q:ℝ) ≤ ENNReal.ofReal (T+(ε:ℝ)) := + ENNReal.ofReal_le_ofReal (hq.trans_le (min_le_right _ _)).le + _ = ENNReal.ofReal T + ε := by + convert ENNReal.ofReal_add hf.1 ε.2 using 1 + all_goals try rfl + exact congrArg (fun x : ℝ≥0∞ => ENNReal.ofReal T + x) + (ENNReal.ofReal_coe_nnreal (p := ε)).symm + · apply le_sInf + rintro _ ⟨q,hq,rfl,_,hclock⟩ + apply ENNReal.ofReal_le_ofReal + by_contra hTq + have hq0 : (0:ℝ) ≤ q := by exact_mod_cast hq.le + have hqt : (q:ℝ) < T := lt_of_not_ge hTq + exact (not_lt_of_ge (hf.rawClock_strictMono ⟨hq0,hqt.le⟩ ⟨hf.1,le_rfl⟩ hqt).le) hclock + +lemma rawLevelTime_eq_top_of_no_hit {κ : ℝ} {b : Driver} {z : ℂ} {s : ℝ} + (hs : 0 ≤ s) + (hn : ¬ ∃ T f, PositiveSolution κ b z T f ∧ rawClock κ b z T = s) : + rawLevelTime κ b z s = ∞ := by + apply top_unique + apply le_sInf + rintro _ ⟨q,hq,rfl,hqS,hqs⟩ + exfalso + have hq0 : (0:ℝ) ≤ q := by exact_mod_cast hq.le + let hf := surviving_flow_positiveSolution hq0 hqS + have hr : s ∈ Icc (rawClock κ b z 0) (rawClock κ b z q) := + ⟨by simpa only [rawClock_zero] using hs,hqs.le⟩ + obtain ⟨T,hT,hTs⟩ := intermediate_value_Icc hq0 hf.rawClock_continuous hr + exact hn ⟨T,flow κ b z,hf.restrict hT.1 hT.2,hTs⟩ + +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric +open scoped NNReal Topology + +lemma cutoffField_lipschitz (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) (t : ℝ) : + LipschitzWith ⟨|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2,by positivity⟩ (cutoffField κ b j t) := by + apply LipschitzWith.of_dist_le_mul + intro z w + simp only [dist_eq_norm,cutoffField_eq] + exact Cutoff.field_sub_le (zpow_pos (by exact_mod_cast (Nat.zero_lt_of_lt hj)) _) _ _ _ _ _ + + + +lemma PositiveSolution.initial_eq_of_terminal_eq {κ : ℝ} {b : Driver} {z w : ℂ} + {T : ℝ} {f g : ℝ → ℂ} (hf : PositiveSolution κ b z T f) + (hg : PositiveSolution κ b w T g) (hfg : f T = g T) : z = w := by + obtain ⟨j,hj,hjf⟩ := hf.exists_cutoff + obtain ⟨k,hk,hkg⟩ := hg.exists_cutoff + let n := max j k + have hn : 1 ≤ n := hj.trans (le_max_left _ _) + have hinj : (n:ℝ)⁻¹ ≤ (j:ℝ)⁻¹ := + inv_anti₀ (by exact_mod_cast (Nat.zero_lt_of_lt hj)) (by exact_mod_cast le_max_left j k) + have hink : (n:ℝ)⁻¹ ≤ (k:ℝ)⁻¹ := + inv_anti₀ (by exact_mod_cast (Nat.zero_lt_of_lt hk)) (by exact_mod_cast le_max_right j k) + have hd1 (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt f (cutoffField κ b n t (f t)) (Icc 0 T) t := by + rw [cutoffField_of_height κ b hn (hinj.trans (hjf t ht).le)] + exact hf.2.2.2.2 t ht + have hd2 (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt g (cutoffField κ b n t (g t)) (Icc 0 T) t := by + rw [cutoffField_of_height κ b hn (hink.trans (hkg t ht).le)] + exact hg.2.2.2.2 t ht + have he : EqOn f g (Icc 0 T) := by + apply ODE_solution_unique_of_mem_Icc_left + (v := cutoffField κ b n) (s := fun _ => univ) + (K := ⟨|a κ| *3/((n:ℝ)^(-(2:ℤ)))^2,by positivity⟩) + (fun t _ => (cutoffField_lipschitz κ b hn t).lipschitzOnWith) + hf.2.1 _ (fun _ _ => mem_univ _) hg.2.1 _ (fun _ _ => mem_univ _) hfg + · intro t ht + exact (hd1 t ⟨ht.1.le,ht.2⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsLE ht.1) (Icc_subset_Icc_right ht.2)) + · intro t ht + exact (hd2 t ⟨ht.1.le,ht.2⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsLE ht.1) (Icc_subset_Icc_right ht.2)) + exact hf.2.2.1.symm.trans ((he ⟨le_rfl,hf.1⟩).trans hg.2.2.1) + +lemma flow_injOn (κ : ℝ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) : + InjOn (fun z => flow κ b z T) {z | Surviving κ b z T} := by + intro z hz w hw he + exact (surviving_flow_positiveSolution hT hz).initial_eq_of_terminal_eq + (surviving_flow_positiveSolution hT hw) he + +lemma inverseFlow_spec {κ : ℝ} {b : Driver} {T : ℝ} {w : ℂ} + (hw : ∃ z, Surviving κ b z T ∧ flow κ b z T = w) : + Surviving κ b (inverseFlow κ b T w) T ∧ flow κ b (inverseFlow κ b T w) T = w := by + unfold inverseFlow + rw [ite_eq_left hw] + exact Classical.epsilon_spec hw + +lemma inverseFlow_flow {κ : ℝ} {b : Driver} {T : ℝ} (hT : 0 ≤ T) {z : ℂ} + (hz : Surviving κ b z T) : inverseFlow κ b T (flow κ b z T) = z := by + have h := inverseFlow_spec (show ∃ w, Surviving κ b w T ∧ flow κ b w T = flow κ b z T from + ⟨z,hz,rfl⟩) + exact flow_injOn κ b hT h.1 hz h.2 +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric MeasureTheory +open scoped Topology + + +lemma reverse_height_formula {T : ℝ} {y r : ℝ → ℝ} (hT : 0 ≤ T) + (hy : ContinuousOn y (Icc 0 T)) (hr : ContinuousOn r (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt y (r t*y t) (Icc 0 T) t) : + ∀ t ∈ Icc 0 T, y t = y 0 * Real.exp (∫ u in (0:ℝ)..t, r (timeClip T u)) := by + let A (t : ℝ) := ∫ u in (0:ℝ)..t, r (timeClip T u) + have hc : Continuous (fun u => r (timeClip T u)) := + hr.comp_continuous (continuous_timeClip T) (timeClip_mem hT) + have hA (t : ℝ) : HasDerivAt A (r (timeClip T t)) t := + intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + have hA' : Continuous A := continuous_iff_continuousAt.mpr fun t => (hA t).continuousAt + have hd0 (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => y u * Real.exp (-A u)) 0 (Icc 0 T) t := by + have he := (hd t ht).mul ((hA t).neg.exp.hasDerivWithinAt) + rw [timeClip_eq ht] at he + convert! he using 1 + ring + have hconst := constant_of_has_deriv_right_zero + (hy.mul ((Real.continuous_exp.comp hA'.neg).continuousOn)) (fun t (ht : t ∈ Ico 0 T) => + (hd0 t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE ht.2) (Icc_subset_Icc_left ht.1))) + intro t ht + have he := hconst t ht + dsimp only [Pi.mul_apply,Function.comp_def,Pi.neg_apply] at he + have hA0 : A 0 = 0 := by simp [A] + rw [hA0,neg_zero,Real.exp_zero,mul_one] at he + calc + y t = (y t * Real.exp (-A t))*Real.exp (A t) := by + rw [mul_assoc,← Real.exp_add,neg_add_cancel,Real.exp_zero,mul_one] + _ = y 0 * Real.exp (A t) := by rw [he] + +lemma reverse_height_le {T : ℝ} {y r : ℝ → ℝ} (hT : 0 ≤ T) + (hy : ContinuousOn y (Icc 0 T)) (hr : ContinuousOn r (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt y (r t*y t) (Icc 0 T) t) + (hy0 : 0 ≤ y 0) (hr0 : ∀ t ∈ Icc 0 T, 0 ≤ r t) (t : ℝ) (ht : t ∈ Icc 0 T) : + y 0 ≤ y t := by + rw [reverse_height_formula hT hy hr hd t ht] + apply le_mul_of_one_le_right hy0 + apply Real.one_le_exp_iff.mpr + apply intervalIntegral.integral_nonneg ht.1 + intro u _ + exact hr0 (timeClip T u) (timeClip_mem hT u) +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.Cutoff +open Set +lemma field_im (a q : ℝ) (b : ℝ → ℝ) (t : ℝ) (z : ℂ) : + (field a q b t z).im = -a*z.im/denominator q (z-b t) := by + simp [field,inverse,Complex.mul_im,Complex.div_ofReal_im] + ring + +lemma field_eq_div {q : ℝ} (hq : 0 < q) (a : ℝ) (b : ℝ → ℝ) (t : ℝ) (z : ℂ) + (hz : q ≤ z.im) : field a q b t z = (a:ℂ)/(z-b t) := by + have hqn : q ≤ ‖z-b t‖ := hz.trans (by simpa using Complex.im_le_norm (z-b t)) + have hsq : q^2 ≤ ‖z-b t‖^2 := pow_le_pow_left₀ hq.le hqn 2 + simp only [field,inverse,denominator,max_eq_left hsq,div_eq_mul_inv] + rw [Complex.inv_def (z-b t)] + simp only [Complex.normSq_eq_norm_sq,Complex.ofReal_inv,starRingEnd_apply] +end SLEExactGauge.Cutoff + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric MeasureTheory +open scoped Topology + + + +end SLEExactGauge.LiteralTrace +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/InverseRegularity.lean b/lean/OAI/Probability/SLEGauge/InverseRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f4c72ca7b73eb298fc98c4caa3b14f71494e3bb --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/InverseRegularity.lean @@ -0,0 +1,465 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.InverseDomains + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric MeasureTheory +open scoped Topology +theorem exists_inverseFlow (κ : ℝ) (hκ : 0 < κ) (b : Driver) {T : ℝ} + (hT : 0 ≤ T) (w : ℂ) (hw : 0 < w.im) : + ∃ z, Surviving κ b z T ∧ flow κ b z T = w := by + let q : ℝ := w.im/2 + have hq : 0 < q := by dsimp [q]; positivity + let br (t : ℝ) : ℝ := driverValue b (T-t) + have hbr : Continuous br := (continuous_driverValue b).comp (continuous_const.sub continuous_id) + obtain ⟨g,hg0,hgd⟩ := Cutoff.exists_solution_on_compact hq (-a κ) hbr w hT + have hgc : ContinuousOn g (Icc 0 T) := fun t ht => (hgd t ht).continuousWithinAt + let r (t : ℝ) : ℝ := a κ / Cutoff.denominator q (g t-br t) + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hr : ContinuousOn r (Icc 0 T) := by + apply continuousOn_const.div + · exact ((continuous_norm.comp_continuousOn + (hgc.sub ((Complex.continuous_ofReal.comp hbr).continuousOn))).pow 2).sup continuousOn_const + · intro t _ + exact (Cutoff.denominator_pos hq _).ne' + have hyd (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => (g u).im) (r t*(g t).im) (Icc 0 T) t := by + have hi := Complex.imCLM.hasFDerivAt.comp_hasDerivWithinAt t (hgd t ht) + convert! hi using 1 + simp only [Complex.imCLM_apply,Cutoff.field_im,neg_neg,r,div_mul_eq_mul_div] + have hheight (t : ℝ) (ht : t ∈ Icc 0 T) : w.im ≤ (g t).im := by + have hh := reverse_height_le hT (Complex.continuous_im.comp_continuousOn hgc) hr hyd + (by simpa [hg0] using hw.le) (fun u _ => div_nonneg ha.le (Cutoff.denominator_pos hq _).le) t ht + simpa [hg0] using hh + have hrev (t : ℝ) (ht : t ∈ Icc 0 T) : T-t ∈ Icc 0 T := by + constructor <;> linarith [ht.1,ht.2] + let f (t : ℝ) : ℂ := g (T-t) + have hf : PositiveSolution κ b (g T) T f := by + refine ⟨hT,hgc.comp (continuous_const.sub continuous_id).continuousOn hrev,?_,?_,?_⟩ + · simp [f] + · intro t ht + exact hw.trans_le (hheight (T-t) (hrev t ht)) + · intro t ht + have hcut := Cutoff.field_eq_div hq (-a κ) br (T-t) (g (T-t)) + ((by dsimp [q]; linarith : q ≤ w.im).trans (hheight (T-t) (hrev t ht))) + have hd := (hgd (T-t) (hrev t ht)).scomp t + (((hasDerivAt_const t T).sub (hasDerivAt_id t)).hasDerivWithinAt) hrev + rw [hcut] at hd + convert! hd using 1 + simp [f,br] + ring + refine ⟨g T,hf.surviving,?_⟩ + rw [hf.flow_eq] + simpa [f] using hg0 + +lemma inverseFlow_surviving {κ : ℝ} (hκ : 0 < κ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) + {w : ℂ} (hw : 0 < w.im) : Surviving κ b (inverseFlow κ b T w) T := + (inverseFlow_spec (exists_inverseFlow κ hκ b hT w hw)).1 + +lemma flow_inverseFlow {κ : ℝ} (hκ : 0 < κ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) + {w : ℂ} (hw : 0 < w.im) : flow κ b (inverseFlow κ b T w) T = w := + (inverseFlow_spec (exists_inverseFlow κ hκ b hT w hw)).2 +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric +open scoped NNReal Topology + +lemma cutoffFlow_dist_le (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) + (z w : ℂ) {T : ℝ} (hT : 0 ≤ T) {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (cutoffFlow κ b j z t) (cutoffFlow κ b j w t) ≤ + dist z w * Real.exp ((|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2)*T) := by + have hd (x : ℂ) (u : ℝ) (hu : u ∈ Ico 0 T) := + ((cutoffFlow_solution κ b j hj x hT).2.2 u ⟨hu.1,hu.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE hu.2) (Icc_subset_Icc_left hu.1)) + have hh := dist_le_of_trajectories_ODE (fun u => cutoffField_lipschitz κ b hj u) + (cutoffFlow_continuous κ b hj z hT) (hd z) + (cutoffFlow_continuous κ b hj w hT) (hd w) + (show dist (cutoffFlow κ b j z 0) (cutoffFlow κ b j w 0) ≤ dist z w by + rw [(cutoffFlow_solution κ b j hj z hT).2.1,(cutoffFlow_solution κ b j hj w hT).2.1]) t ht + simp only [sub_zero] at hh + change dist _ _ ≤ dist z w * Real.exp ((|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2)*t) at hh + have hK : 0 ≤ |a κ| *3/((j:ℝ)^(-(2:ℤ)))^2 := by positivity + exact hh.trans (mul_le_mul_of_nonneg_left + (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left ht.2 hK)) dist_nonneg) + +lemma cutoffFlow_continuous_initial (κ : ℝ) (b : Driver) {j : ℕ} (hj : 1 ≤ j) + {T : ℝ} (hT : 0 ≤ T) : Continuous (fun z => cutoffFlow κ b j z T) := by + apply LipschitzWith.continuous (K := ⟨Real.exp ((|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2)*T),by positivity⟩) + apply LipschitzWith.of_dist_le_mul + intro z w + change dist _ _ ≤ Real.exp ((|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2)*T) * dist z w + simpa only [mul_comm] using cutoffFlow_dist_le κ b hj z w hT ⟨hT,le_rfl⟩ + + + +lemma surviving_eventually_cutoff_height {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + ∃ j : ℕ, 1 ≤ j ∧ ∀ᶠ w in 𝓝 z, + Surviving κ b w T ∧ (∀ t ∈ Icc 0 T, flow κ b w t = cutoffFlow κ b j w t) ∧ + ∀ t ∈ Icc 0 T, (j:ℝ)⁻¹ < (flow κ b w t).im := by + obtain ⟨j,hj,hgap⟩ := hz + let m := sInf ((fun u : ℝ => (cutoffFlow κ b j z u).im) '' Icc 0 T) + let C := Real.exp ((|a κ| *3/((j:ℝ)^(-(2:ℤ)))^2)*T) + let ε := (m-(j:ℝ)⁻¹)/2 + have hε : 0 < ε := by dsimp [ε,m]; linarith + have hC : 0 < C := Real.exp_pos _ + have hb := (isCompact_Icc.image_of_continuousOn + (Complex.continuous_im.comp_continuousOn (cutoffFlow_continuous κ b hj z hT))).bddBelow + refine ⟨j,hj,?_⟩ + filter_upwards [Metric.ball_mem_nhds z (div_pos hε hC)] with w hw + have hd : dist z w*C < ε := by + rw [← lt_div_iff₀ hC,dist_comm] + exact hw + have hg (t : ℝ) (ht : t ∈ Icc 0 T) : m-ε ≤ (cutoffFlow κ b j w t).im := by + have h0 : m ≤ (cutoffFlow κ b j z t).im := csInf_le hb ⟨t,ht,rfl⟩ + have hh := cutoffFlow_dist_le κ b hj z w hT ht + have hi : (cutoffFlow κ b j z t).im - (cutoffFlow κ b j w t).im ≤ + dist (cutoffFlow κ b j z t) (cutoffFlow κ b j w t) := by + simpa only [dist_eq_norm,Complex.sub_im] using + Complex.im_le_norm (cutoffFlow κ b j z t-cutoffFlow κ b j w t) + change dist _ _ ≤ dist z w*C at hh + linarith + have hgapw : (j:ℝ)⁻¹ < sInf ((fun u : ℝ => (cutoffFlow κ b j w u).im) '' Icc 0 T) := by + apply lt_of_lt_of_le (show (j:ℝ)⁻¹ < m-ε by dsimp [ε]; linarith) + apply le_csInf (Set.Nonempty.image _ (show (Icc (0:ℝ) T).Nonempty from ⟨0,le_rfl,hT⟩)) + rintro y ⟨t,ht,rfl⟩ + exact hg t ht + have hp := cutoff_positiveSolution hT hj hgapw + refine ⟨hp.surviving,fun t ht => hp.flow_eqOn ht,?_⟩ + intro t ht + rw [hp.flow_eqOn ht] + exact lt_of_lt_of_le (show (j:ℝ)⁻¹ < m-ε by dsimp [ε]; linarith) (hg t ht) + +lemma surviving_eventually_cutoff {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + ∃ j : ℕ, 1 ≤ j ∧ ∀ᶠ w in 𝓝 z, + Surviving κ b w T ∧ ∀ t ∈ Icc 0 T, flow κ b w t = cutoffFlow κ b j w t := by + obtain ⟨j,hj,he⟩ := surviving_eventually_cutoff_height hT hz + exact ⟨j,hj,he.mono fun w hw => ⟨hw.1,hw.2.1⟩⟩ + +lemma isOpen_surviving (κ : ℝ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) : + IsOpen {z | Surviving κ b z T} := by + rw [isOpen_iff_mem_nhds] + intro z hz + obtain ⟨j,hj,he⟩ := surviving_eventually_cutoff hT hz + exact he.mono fun w hw => hw.1 + +lemma flow_continuousAt_initial {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : ContinuousAt (fun w => flow κ b w T) z := by + obtain ⟨j,hj,he⟩ := surviving_eventually_cutoff hT hz + apply (cutoffFlow_continuous_initial κ b hj hT).continuousAt.congr + exact he.mono fun w hw => (hw.2 T ⟨hT,le_rfl⟩).symm +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric MeasureTheory +open scoped Topology + +lemma complex_linear_formula {T : ℝ} {y r : ℝ → ℂ} (hT : 0 ≤ T) + (hy : ContinuousOn y (Icc 0 T)) (hr : ContinuousOn r (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt y (r t*y t) (Icc 0 T) t) : + ∀ t ∈ Icc 0 T, y t = y 0 * Complex.exp (∫ u in (0:ℝ)..t, r (timeClip T u)) := by + let A (t : ℝ) := ∫ u in (0:ℝ)..t, r (timeClip T u) + have hc : Continuous (fun u => r (timeClip T u)) := + hr.comp_continuous (continuous_timeClip T) (timeClip_mem hT) + have hA (t : ℝ) : HasDerivAt A (r (timeClip T t)) t := + intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + have hA' : Continuous A := continuous_iff_continuousAt.mpr fun t => (hA t).continuousAt + have hd0 (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => y u * Complex.exp (-A u)) 0 (Icc 0 T) t := by + have he := (hd t ht).mul ((hA t).neg.cexp.hasDerivWithinAt) + rw [timeClip_eq ht] at he + convert! he using 1 + ring + have hconst := constant_of_has_deriv_right_zero + (hy.mul ((Complex.continuous_exp.comp hA'.neg).continuousOn)) (fun t (ht : t ∈ Ico 0 T) => + (hd0 t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE ht.2) (Icc_subset_Icc_left ht.1))) + intro t ht + have he := hconst t ht + dsimp only [Pi.mul_apply,Function.comp_def,Pi.neg_apply] at he + have hA0 : A 0 = 0 := by simp [A] + rw [hA0,neg_zero,Complex.exp_zero,mul_one] at he + calc + y t = (y t * Complex.exp (-A t))*Complex.exp (A t) := by + rw [mul_assoc,← Complex.exp_add,neg_add_cancel,Complex.exp_zero,mul_one] + _ = y 0 * Complex.exp (A t) := by rw [he] + +lemma surviving_centered_ne_zero {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) {t : ℝ} (ht : t ∈ Icc 0 T) : + flow κ b z t-driverValue b t ≠ 0 := by + have hi := (surviving_flow_positiveSolution hT hz).2.2.2.1 t ht + intro he + have := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,Complex.zero_im,sub_zero] at this + linarith + + +lemma flow_difference_formula {κ : ℝ} {b : Driver} {z w : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) (hw : Surviving κ b w T) : + flow κ b w T-flow κ b z T = (w-z)*Complex.exp + (∫ u in (0:ℝ)..T, -(a κ:ℂ)/ + ((flow κ b z (timeClip T u)-driverValue b (timeClip T u))* + (flow κ b w (timeClip T u)-driverValue b (timeClip T u)))) := by + let f := flow κ b z + let g := flow κ b w + let r (u : ℝ) : ℂ := -(a κ:ℂ)/((f u-driverValue b u)*(g u-driverValue b u)) + have hf := surviving_flow_positiveSolution hT hz + have hg := surviving_flow_positiveSolution hT hw + have hcB : ContinuousOn (fun u => (driverValue b u:ℂ)) (Icc 0 T) := + (Complex.continuous_ofReal.comp (continuous_driverValue b)).continuousOn + have hr : ContinuousOn r (Icc 0 T) := + continuousOn_const.div ((hf.2.1.sub hcB).mul (hg.2.1.sub hcB)) (fun t ht => + mul_ne_zero (surviving_centered_ne_zero hT hz ht) (surviving_centered_ne_zero hT hw ht)) + have hd (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => g u-f u) (r t*(g t-f t)) (Icc 0 T) t := by + have h := (hg.2.2.2.2 t ht).sub (hf.2.2.2.2 t ht) + have hnz := surviving_centered_ne_zero hT hz ht + have hnw := surviving_centered_ne_zero hT hw ht + convert! h using 1 + dsimp [r,f,g] + field_simp [hnz,hnw] + ring + have he := complex_linear_formula hT (hg.2.1.sub hf.2.1) hr hd T ⟨hT,le_rfl⟩ + have hf0 : f 0 = z := hf.2.2.1 + have hg0 : g 0 = w := hg.2.2.1 + simpa only [Pi.sub_apply,hf.2.2.1,hg.2.2.1] using he +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric MeasureTheory +open scoped Topology + +lemma surviving_centered_continuous_clip {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + Continuous (fun u => flow κ b z (timeClip T u)-driverValue b (timeClip T u)) := + ((surviving_flow_positiveSolution hT hz).2.1.comp_continuous (continuous_timeClip T) + (timeClip_mem hT)).sub + (Complex.continuous_ofReal.comp ((continuous_driverValue b).comp (continuous_timeClip T))) + +def flowDifferenceExponent (κ : ℝ) (b : Driver) (z : ℂ) (T : ℝ) (w : ℂ) : ℂ := + ∫ u in (0:ℝ)..T, -(a κ:ℂ)/ + ((flow κ b z (timeClip T u)-driverValue b (timeClip T u))* + (flow κ b w (timeClip T u)-driverValue b (timeClip T u))) + +lemma flowDifferenceExponent_continuousAt {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + ContinuousAt (flowDifferenceExponent κ b z T) z := by + obtain ⟨j,hj,he⟩ := surviving_eventually_cutoff_height hT hz + have hz' := he.self_of_nhds + have hj0 : (0:ℝ) < j := by exact_mod_cast (Nat.zero_lt_of_lt hj) + have hq : 0 < (j:ℝ)⁻¹ := inv_pos.mpr hj0 + have hf := surviving_flow_positiveSolution hT hz + have hzn (u : ℝ) : (j:ℝ)⁻¹ ≤ + ‖flow κ b z (timeClip T u)-driverValue b (timeClip T u)‖ := by + exact (hz'.2.2 _ (timeClip_mem hT u)).le.trans + (by simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using + Complex.im_le_norm (flow κ b z (timeClip T u)-driverValue b (timeClip T u))) + unfold flowDifferenceExponent + apply intervalIntegral.continuousAt_of_dominated_interval + (bound := fun _ => |a κ|/((j:ℝ)⁻¹*(j:ℝ)⁻¹)) + · filter_upwards [he] with w hw + exact (continuous_const.div + ((surviving_centered_continuous_clip hT hz).mul (surviving_centered_continuous_clip hT hw.1)) + (fun u => mul_ne_zero (surviving_centered_ne_zero hT hz (timeClip_mem hT u)) + (surviving_centered_ne_zero hT hw.1 (timeClip_mem hT u)))).aestronglyMeasurable + · filter_upwards [he] with w hw + apply Filter.Eventually.of_forall + intro u _ + have hwn : (j:ℝ)⁻¹ ≤ ‖flow κ b w (timeClip T u)-driverValue b (timeClip T u)‖ := by + exact (hw.2.2 _ (timeClip_mem hT u)).le.trans + (by simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using + Complex.im_le_norm (flow κ b w (timeClip T u)-driverValue b (timeClip T u))) + rw [norm_div,norm_neg,Complex.norm_real,Real.norm_eq_abs,norm_mul] + exact div_le_div_of_nonneg_left (abs_nonneg _) (mul_pos hq hq) + (mul_le_mul (hzn u) hwn hq.le (norm_nonneg _)) + · exact continuous_const.intervalIntegrable 0 T + · apply Filter.Eventually.of_forall + intro u _ + let t := timeClip T u + have ht : t ∈ Icc 0 T := timeClip_mem hT u + have hzt := (hf.restrict ht.1 ht.2).surviving + apply continuousAt_const.div + (continuousAt_const.mul ((flow_continuousAt_initial ht.1 hzt).sub continuousAt_const)) + exact mul_ne_zero (surviving_centered_ne_zero hT hz ht) (surviving_centered_ne_zero hT hz ht) + + + +theorem flow_hasDerivAt_initial {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + HasDerivAt (fun w => flow κ b w T) + (Complex.exp (∫ u in (0:ℝ)..T, -(a κ:ℂ)/ + (flow κ b z (timeClip T u)-driverValue b (timeClip T u))^2)) z := by + have hc := Complex.continuous_exp.continuousAt.comp (flowDifferenceExponent_continuousAt hT hz) + have hh := hc.tendsto.mono_left (nhdsWithin_le_nhds (s := {z}ᶜ)) + apply hasDerivAt_iff_tendsto_slope.mpr + have he : ∀ᶠ w in 𝓝 z, Surviving κ b w T := (isOpen_surviving κ b hT).mem_nhds hz + have heq : (fun w => Complex.exp (flowDifferenceExponent κ b z T w)) =ᶠ[𝓝[≠] z] + slope (fun w => flow κ b w T) z := by + filter_upwards [he.filter_mono nhdsWithin_le_nhds,self_mem_nhdsWithin] with w hw hne + have hn : w-z ≠ 0 := sub_ne_zero.mpr (by simpa using hne) + rw [slope_def_field,flow_difference_formula hT hz hw] + change _ = ((w-z)*Complex.exp (flowDifferenceExponent κ b z T w))/(w-z) + field_simp + simpa only [Function.comp_def,flowDifferenceExponent,pow_two] using hh.congr' heq + +lemma flow_deriv_ne_zero {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : deriv (fun w => flow κ b w T) z ≠ 0 := by + rw [(flow_hasDerivAt_initial hT hz).deriv] + exact Complex.exp_ne_zero _ + +lemma flow_differentiableOn (κ : ℝ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) : + DifferentiableOn ℂ (fun z => flow κ b z T) {z | Surviving κ b z T} := by + intro z hz + exact (flow_hasDerivAt_initial hT hz).differentiableAt.differentiableWithinAt +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric +open scoped Topology + +lemma flow_hasStrictDerivAt_initial {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} + (hT : 0 ≤ T) (hz : Surviving κ b z T) : + HasStrictDerivAt (fun w => flow κ b w T) (deriv (fun w => flow κ b w T) z) z := + ((flow_differentiableOn κ b hT).analyticAt ((isOpen_surviving κ b hT).mem_nhds hz)).hasStrictDerivAt + +lemma inverseFlow_hasStrictDerivAt {κ : ℝ} (hκ : 0 < κ) (b : Driver) {T : ℝ} + (hT : 0 ≤ T) {w : ℂ} (hw : 0 < w.im) : + HasStrictDerivAt (inverseFlow κ b T) + (deriv (fun z => flow κ b z T) (inverseFlow κ b T w))⁻¹ w := by + have hz := inverseFlow_surviving hκ b hT hw + have hf := flow_hasStrictDerivAt_initial hT hz + have he : ∀ᶠ z in 𝓝 (inverseFlow κ b T w), inverseFlow κ b T (flow κ b z T) = z := by + filter_upwards [(isOpen_surviving κ b hT).mem_nhds hz] with z hz' + exact inverseFlow_flow hT hz' + have hh := hf.to_local_left_inverse (flow_deriv_ne_zero hT hz) he + rwa [flow_inverseFlow hκ b hT hw] at hh + + + +theorem flow_conformal_bijection {κ : ℝ} (hκ : 0 < κ) (b : Driver) {T : ℝ} (hT : 0 ≤ T) : + IsOpen {z | Surviving κ b z T} ∧ + BijOn (fun z => flow κ b z T) {z | Surviving κ b z T} {w | 0 < w.im} ∧ + DifferentiableOn ℂ (fun z => flow κ b z T) {z | Surviving κ b z T} ∧ + DifferentiableOn ℂ (inverseFlow κ b T) {w | 0 < w.im} := by + refine ⟨isOpen_surviving κ b hT,⟨?_,flow_injOn κ b hT,?_⟩, + flow_differentiableOn κ b hT,?_⟩ + · intro z hz + exact (surviving_flow_positiveSolution hT hz).2.2.2.1 T ⟨hT,le_rfl⟩ + · intro w hw + exact exists_inverseFlow κ hκ b hT w hw + · intro w hw + exact (inverseFlow_hasStrictDerivAt hκ b hT hw).hasDerivAt.differentiableAt.differentiableWithinAt +end SLEExactGauge.LiteralTrace + + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.BrownianCalculus + +lemma integral_sq_gaussian (v : ℝ≥0) : + (∫ x : ℝ, x ^ 2 ∂gaussianReal 0 v) = v := by + have hv := variance_fun_id_gaussianReal (μ := 0) (v := v) + rw [variance_eq_integral (X := fun x : ℝ => x) (by fun_prop)] at hv + simpa using hv + +lemma integral_fourth_gaussian (v : ℝ≥0) : + (∫ x : ℝ, x ^ 4 ∂gaussianReal 0 v) = 3 * (v : ℝ)^2 := by + let f : ℝ → ℝ := fun t => Real.exp ((v : ℝ) * t^2 / 2) + have hf (t : ℝ) : HasDerivAt f ((v:ℝ) * t * f t) t := by + convert! ((((hasDerivAt_id t).pow 2).const_mul (v:ℝ)).div_const 2).exp using 1 + dsimp [f] + ring + have d0 : deriv f = fun t => (v:ℝ) * t * f t := funext fun t => (hf t).deriv + have d1 : deriv (fun t => (v:ℝ) * t * f t) = + fun t => ((v:ℝ) + (v:ℝ)^2*t^2) * f t := by + ext t + convert! (((hasDerivAt_id t).const_mul (v:ℝ)).mul (hf t)).deriv using 1 + dsimp + ring + have d2 : deriv (fun t => ((v:ℝ) + (v:ℝ)^2*t^2) * f t) = + fun t => (3*(v:ℝ)^2*t + (v:ℝ)^3*t^3) * f t := by + ext t + convert! (((((hasDerivAt_id t).pow 2).const_mul ((v:ℝ)^2)).const_add (v:ℝ)).mul + (hf t)).deriv using 1 + dsimp + ring + have d3 : deriv (fun t => (3*(v:ℝ)^2*t + (v:ℝ)^3*t^3) * f t) = + fun t => (3*(v:ℝ)^2 + 6*(v:ℝ)^3*t^2 + (v:ℝ)^4*t^4) * f t := by + ext t + have hp := ((hasDerivAt_id t).const_mul (3*(v:ℝ)^2)).add + (((hasDerivAt_id t).pow 3).const_mul ((v:ℝ)^3)) + convert! (hp.mul (hf t)).deriv using 1 + dsimp + ring + have hm := iteratedDeriv_mgf_zero + (X := fun x : ℝ => x) (μ := gaussianReal 0 v) (by simp) 4 + have he : mgf (fun x : ℝ => x) (gaussianReal 0 v) = f := by + rw [mgf_fun_id_gaussianReal] + simp only [zero_mul, zero_add, f] + rw [he] at hm + change iteratedDeriv 4 f 0 = (∫ x : ℝ, x^4 ∂gaussianReal 0 v) at hm + rw [← hm] + norm_num [iteratedDeriv_succ, iteratedDeriv_zero, d0, d1, d2, d3, f] + +open scoped ContinuousMapZero +abbrev Driver := C(ℝ≥0, ℝ)₀ +instance : MeasurableSpace Driver := borel Driver +instance : BorelSpace Driver := ⟨rfl⟩ + +def increment (s h : ℝ≥0) (b : Driver) : ℝ := b (s+h) - b s + +def history (s : ℝ≥0) (b : Driver) : Iic s → ℝ := fun t => b t + +lemma measurable_increment (s h : ℝ≥0) : Measurable (increment s h) := by + unfold increment + exact (continuous_eval_const (s+h)).measurable.sub + (continuous_eval_const s).measurable + +lemma measurable_history (s : ℝ≥0) : Measurable (history s) := by + exact Measurable.of_eval (fun time => (continuous_eval_const (time : ℝ≥0)).measurable) + +variable {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) +include hW + +lemma increment_law (s h : ℝ≥0) : HasLaw (increment s h) (gaussianReal 0 h) W := by + exact (hW.toIsPreBrownianReal.shift s).hasLaw_eval h + +lemma increment_mean (s h : ℝ≥0) : (∫ b, increment s h b ∂W) = 0 := by + rw [(increment_law hW s h).integral_eq, integral_id_gaussianReal] + +lemma increment_sq (s h : ℝ≥0) : (∫ b, (increment s h b)^2 ∂W) = h := by + exact ((increment_law hW s h).integral_comp (f := fun x : ℝ => x^2) (by fun_prop)).trans + (integral_sq_gaussian h) + +lemma increment_fourth (s h : ℝ≥0) : + (∫ b, (increment s h b)^4 ∂W) = 3*(h:ℝ)^2 := by + exact ((increment_law hW s h).integral_comp (f := fun x : ℝ => x^4) (by fun_prop)).trans + (integral_fourth_gaussian h) + +end SLEExactGauge.BrownianCalculus +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/JacobiKernel.lean b/lean/OAI/Probability/SLEGauge/JacobiKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d3b09e25d0662d1a56133ec80eee689e8d07643 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/JacobiKernel.lean @@ -0,0 +1,435 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.AngleGenerators +import OAI.Probability.SLEGauge.AngleMeasure + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open Polynomial MeasureTheory Filter Set +open scoped ENNReal Topology +namespace SLEExactGauge.Jacobi + +def eigenvalue (nu : ℝ) (n : ℕ) : ℝ := (n:ℝ)*(n+nu)/2 +def majorantBase (nu : ℝ) : ℝ := 4*(nu+2)^2 +def mixingTime (nu : ℝ) : ℝ := 4*majorantBase nu + +def mode (nu s : ℝ) (n : ℕ) (v w : Interval) : ℝ := + Real.exp (-s*eigenvalue nu n) * (normSq nu 0/normSq nu n) * + (poly nu n).eval (v:ℝ) * (poly nu n).eval (w:ℝ) + +def kernel (nu s : ℝ) (v w : Interval) : ℝ := ∑' n, mode nu s n v w + +lemma eigenvalue_nonneg (nu : ℝ) (hnu : 0≤nu) (n : ℕ) : 0≤eigenvalue nu n := by + unfold eigenvalue + positivity + +lemma eigenvalue_ge (nu : ℝ) (hnu : 1≤nu) (n : ℕ) : (n:ℝ)≤eigenvalue nu n := by + cases n with + | zero => simp [eigenvalue] + | succ n => + have hn : (0:ℝ)≤n := Nat.cast_nonneg n + dsimp [eigenvalue] + push_cast + nlinarith [mul_nonneg hn (sub_nonneg.mpr hnu),sq_nonneg (n:ℝ)] + +lemma norm_ratio_le (nu : ℝ) (hnu : 1 mode nu s n v w) := + Summable.of_norm_bounded (summable_geometric_of_lt_one (by norm_num : (0:ℝ)≤1/4) (by norm_num)) + (fun n => mode_geometric_bound nu hnu s hs n v w) + +lemma mode_continuous (nu s : ℝ) (n : ℕ) (v : Interval) : Continuous (mode nu s n v) := by + exact continuous_const.mul ((poly nu n).continuous.comp continuous_subtype_val) + +lemma kernel_continuous (nu : ℝ) (hnu : 1 mode_continuous nu s n v) + (summable_geometric_of_lt_one (by norm_num : (0:ℝ)≤1/4) (by norm_num)) + (fun n w => mode_geometric_bound nu hnu s hs n v w) + +lemma mode_zero (nu : ℝ) (hnu : 1 (1/4:ℝ)^(n+1)) (1/3:ℝ) := by + have hg : HasSum (fun n : ℕ => (1/4:ℝ)^n) ((1-(1/4:ℝ))⁻¹) := + hasSum_geometric_of_lt_one (by norm_num) (by norm_num) + have hh := hg.mul_right (1/4:ℝ) + norm_num only [show (1-(1/4:ℝ))⁻¹*(1/4)=1/3 by norm_num] at hh + simpa only [pow_succ] using hh + exact tsum_of_norm_bounded hh (fun n => mode_geometric_bound nu hnu s hs (n+1) v w) + rw [Real.norm_eq_abs,abs_le] at htail + have he := (mode_summable nu hnu s hs v w).sum_add_tsum_nat_add 1 + simp only [Finset.sum_range_one,mode_zero nu hnu s v w] at he + unfold kernel + rw [←he] + constructor <;> linarith [htail.1,htail.2] + +end SLEExactGauge.Jacobi +end +end + + + +section + + +noncomputable section +open Polynomial MeasureTheory Filter Set +open scoped ENNReal Topology CompactlySupported +namespace SLEExactGauge.Jacobi + +lemma integral_mode_poly (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (n m : ℕ) (v : Interval) : + (∫ w : Interval, mode nu s n v w * (poly nu m).eval (w:ℝ) ∂pi nu) = + if n=m then Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ) else 0 := by + have he : (fun w : Interval => mode nu s n v w * (poly nu m).eval (w:ℝ)) = + fun w : Interval => (Real.exp (-s*eigenvalue nu n)*(normSq nu 0/normSq nu n)* + (poly nu n).eval (v:ℝ))*((poly nu n).eval (w:ℝ)*(poly nu m).eval (w:ℝ)) := by + funext w; unfold mode; ring + rw [he,integral_const_mul,integral_pi_poly nu hnu] + split_ifs with hnm + · subst n + have hn := (normSq_pos nu hnu m).ne' + have hz := (normSq_zero_pos nu hnu.le).ne' + field_simp + · ring + +lemma integral_kernel_poly (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (m : ℕ) (v : Interval) : + (∫ w : Interval, kernel nu s v w * (poly nu m).eval (w:ℝ) ∂pi nu) = + Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ) := by + let := pi_probability nu hnu.le + let F (n : ℕ) (w : Interval) := mode nu s n v w * (poly nu m).eval (w:ℝ) + have hc (n : ℕ) : Continuous (F n) := (mode_continuous nu s n v).mul + ((poly nu m).continuous.comp continuous_subtype_val) + have hb (n : ℕ) (w : Interval) : ‖F n w‖ ≤ (1/4:ℝ)^n*2^m := by + dsimp only [F] + rw [norm_mul] + exact mul_le_mul (mode_geometric_bound nu hnu s hs n v w) + (poly_eval_bound nu (by linarith) m w (abs_le.mpr w.2)) + (norm_nonneg _) (by positivity) + have hg : Summable (fun n : ℕ => (1/4:ℝ)^n*2^m) := + (summable_geometric_of_lt_one (by norm_num : (0:ℝ)≤1/4) (by norm_num)).mul_right _ + have hi := hasSum_integral_of_dominated_convergence (μ := pi nu) (F := F) + (f := fun w => kernel nu s v w * (poly nu m).eval (w:ℝ)) + (fun n (_ : Interval) => (1/4:ℝ)^n*2^m) + (fun n => (hc n).aestronglyMeasurable) + (fun n => Eventually.of_forall (hb n)) (Eventually.of_forall fun _ => hg) + (integrable_const _) (Eventually.of_forall fun w => + (mode_summable nu hnu s hs v w).hasSum.mul_right ((poly nu m).eval (w:ℝ))) + have he (n : ℕ) : (∫ w, F n w ∂pi nu) = + if n=m then Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ) else 0 := + integral_mode_poly nu hnu s n m v + have ht := hi.tsum_eq.symm + rw [show (∑' n, ∫ w, F n w ∂pi nu) = + Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ) by simp only [he,tsum_ite_eq]] at ht + exact ht + +lemma kernel_integrable (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) : Integrable (kernel nu s v) (pi nu) := by + let := pi_probability nu hnu.le + exact (kernel_continuous nu hnu s hs v).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +lemma integral_kernel (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) : (∫ w, kernel nu s v w ∂pi nu)=1 := by + simpa only [poly_zero,eval_one,mul_one,eigenvalue,Nat.cast_zero,zero_mul,zero_div, + mul_zero,Real.exp_zero] using integral_kernel_poly nu hnu s hs 0 v + + +def transition (nu s : ℝ) (v : Interval) : Measure Interval := + (pi nu).withDensity (fun w => ENNReal.ofReal (kernel nu s v w)) + +lemma transition_probability (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) : IsProbabilityMeasure (transition nu s v) := by + constructor + rw [transition,withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ, + ←ofReal_integral_eq_lintegral_ofReal (kernel_integrable nu hnu s hs v) + (Eventually.of_forall fun w => le_trans (by norm_num : (0:ℝ)≤1/2) + (kernel_bounds nu hnu s hs v w).1),integral_kernel nu hnu s hs v] + norm_num + +lemma integral_transition_poly (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) (m : ℕ) : + (∫ w : Interval, (poly nu m).eval (w:ℝ) ∂transition nu s v) = + Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ) := by + rw [transition,integral_withDensity_eq_integral_toReal_smul + (kernel_continuous nu hnu s hs v).measurable.ennreal_ofReal + (Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] + simp_rw [ENNReal.toReal_ofReal (le_trans (by norm_num : (0:ℝ)≤1/2) + (kernel_bounds nu hnu s hs v _).1),smul_eq_mul] + exact integral_kernel_poly nu hnu s hs m v + +end SLEExactGauge.Jacobi +end +end + + + +section + +noncomputable section +open Polynomial MeasureTheory Filter Set +open scoped ENNReal Topology CompactlySupported +namespace SLEExactGauge.Jacobi + +lemma polynomial_integrable (μ : Measure Interval) [IsFiniteMeasure μ] (p : ℝ[X]) : + Integrable (fun x : Interval => p.eval (x:ℝ)) μ := + (p.continuous.comp continuous_subtype_val).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + + +lemma measure_eq_of_polynomial_integral (μ ν : Measure Interval) + [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + (he : ∀ p : ℝ[X], (∫ x : Interval, p.eval (x:ℝ) ∂μ)=∫ x : Interval, p.eval (x:ℝ) ∂ν) : + μ=ν := by + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + apply eq_of_forall_dist_le + intro ε hε + obtain ⟨p,hp⟩ := exists_polynomial_near_continuousMap (-1) 1 + f.toContinuousMap (ε/2) (by positivity) + have hb (x : Interval) : ‖p.eval (x:ℝ)-f x‖≤ε/2 := + ((p.toContinuousMapOn Interval-f.toContinuousMap).norm_coe_le_norm x).trans hp.le + have hbμ : ‖(∫ x : Interval,p.eval (x:ℝ) ∂μ)-(∫ x,f x∂μ)‖≤ε/2 := by + rw [←integral_sub (polynomial_integrable μ p) f.integrable] + simpa only [probReal_univ,mul_one] using norm_integral_le_of_norm_le_const + (μ:=μ) (Eventually.of_forall hb) + have hbν : ‖(∫ x : Interval,p.eval (x:ℝ) ∂ν)-(∫ x,f x∂ν)‖≤ε/2 := by + rw [←integral_sub (polynomial_integrable ν p) f.integrable] + simpa only [probReal_univ,mul_one] using norm_integral_le_of_norm_le_const + (μ:=ν) (Eventually.of_forall hb) + calc + _ ≤ dist (∫ x,f x∂μ) (∫ x : Interval,p.eval (x:ℝ) ∂μ)+ + dist (∫ x : Interval,p.eval (x:ℝ) ∂μ) (∫ x,f x∂ν) := dist_triangle _ _ _ + _ ≤ ε/2+ε/2 := by + apply add_le_add + · simpa only [dist_eq_norm,norm_sub_rev] using hbμ + · simpa only [he p,dist_eq_norm] using hbν + _ = ε := by ring + +def polynomialIntegral (μ : Measure Interval) [IsFiniteMeasure μ] : ℝ[X] →ₗ[ℝ] ℝ where + toFun p := ∫ x : Interval, p.eval (x:ℝ) ∂μ + map_add' p q := by + simp only [eval_add] + exact integral_add (polynomial_integrable μ p) (polynomial_integrable μ q) + map_smul' c p := by + simp only [eval_smul,smul_eq_mul,RingHom.id_apply] + exact integral_const_mul _ _ + +lemma measure_eq_of_poly_integral (nu : ℝ) (hnu : 0 < nu) + (μ ν : Measure Interval) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + (he : ∀ n, (∫ x : Interval,(poly nu n).eval (x:ℝ) ∂μ)= + ∫ x : Interval,(poly nu n).eval (x:ℝ) ∂ν) : μ=ν := by + have heq : polynomialIntegral μ=polynomialIntegral ν := by + apply (basis nu hnu).ext + intro n + simpa only [basis_apply, polynomialIntegral, LinearMap.coe_mk, AddHom.coe_mk] using he n + apply measure_eq_of_polynomial_integral + intro p + exact congrArg (fun L : ℝ[X] →ₗ[ℝ] ℝ => L p) heq + + + +lemma transition_identified (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) (μ : Measure Interval) [IsProbabilityMeasure μ] + (he : ∀ m, (∫ w : Interval,(poly nu m).eval (w:ℝ) ∂μ)= + Real.exp (-s*eigenvalue nu m)*(poly nu m).eval (v:ℝ)) : μ=transition nu s v := by + let := transition_probability nu hnu s hs v + apply measure_eq_of_poly_integral nu (by linarith) + intro m + rw [he m,integral_transition_poly nu hnu s hs v m] + + + +lemma transition_lintegral_bounds (nu : ℝ) (hnu : 1 < nu) (s : ℝ) (hs : mixingTime nu ≤ s) + (v : Interval) (f : Interval→ℝ≥0∞) (hf : Measurable f) : + (1/2:ℝ≥0∞)*(∫⁻w,f w∂pi nu) ≤ ∫⁻w,f w∂transition nu s v ∧ + (∫⁻w,f w∂transition nu s v) ≤ 2*(∫⁻w,f w∂pi nu) := by + rw [transition,lintegral_withDensity_eq_lintegral_mul _ + (kernel_continuous nu hnu s hs v).measurable.ennreal_ofReal hf] + constructor + · rw [←lintegral_const_mul _ hf] + apply lintegral_mono + intro w + apply mul_le_mul_left + have h := ENNReal.ofReal_le_ofReal (kernel_bounds nu hnu s hs v w).1 + norm_num only [ENNReal.ofReal_div_of_pos (by norm_num : (0:ℝ)<2), ENNReal.ofReal_one, ENNReal.ofReal_ofNat, one_div] at h ⊢ + exact h + · rw [←lintegral_const_mul _ hf] + apply lintegral_mono + intro w + apply mul_le_mul_left + have h := ENNReal.ofReal_le_ofReal (kernel_bounds nu hnu s hs v w).2 + norm_num only [ENNReal.ofReal_div_of_pos (by norm_num : (0:ℝ)<2), ENNReal.ofReal_one, ENNReal.ofReal_ofNat, one_div] at h ⊢ + exact h + +end SLEExactGauge.Jacobi +end +end + + + +section + + +noncomputable section +open Polynomial MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology Interval +namespace SLEExactGauge.Jacobi +open CenteredMoments + +lemma weight_cos_sin (nu : ℝ) (hnu : 1 Real.hasDerivAt_cos θ) + Real.continuous_sin.neg.continuousOn ((continuous_weight nu hnu.le).mul p.continuous) + simp only [Real.cos_zero,Real.cos_pi,Function.comp_apply,Pi.mul_apply] at hsub + rw [intervalIntegral.integral_symm (a := (-1:ℝ)) (b := 1)] at hsub + have he : (∫θ in 0..Real.pi,weight nu (Real.cos θ)*p.eval (Real.cos θ)*(-Real.sin θ))= + -(∫θ in 0..Real.pi,(Real.sin θ)^nu*p.eval (Real.cos θ)) := by + rw [←intervalIntegral.integral_neg] + apply intervalIntegral.integral_congr + intro θ hθ + have hθ' : θ∈Icc 0 Real.pi := by + simpa only [uIcc_of_le Real.pi_pos.le] using hθ + dsimp only + rw [show weight nu (Real.cos θ)*p.eval (Real.cos θ)*(-Real.sin θ)= + -(weight nu (Real.cos θ)*Real.sin θ)*p.eval (Real.cos θ) by ring, + weight_cos_sin nu hnu θ hθ'] + ring + rw [he] at hsub + exact neg_injective hsub + +lemma integral_angleArea (f : ℝ→ℝ) : + (∫θ : Angle,f θ∂angleArea)=∫θ in 0..Real.pi,f θ := by + rw [angleArea,integral_subtype_comap measurableSet_Ioo,←integral_Ioc_eq_integral_Ioo, + intervalIntegral.integral_of_le Real.pi_pos.le] + +lemma angleNormalization_jacobi (a : ℝ) (ha : 1<4*a) : + angleNormalization a=ENNReal.ofReal (normSq (4*a) 0) := by + have ha0 : 0≤4*a := by linarith + have hm : AEStronglyMeasurable (fun θ : Angle => (Real.sin θ)^(4*a)) angleArea := by + fun_prop + have hb (θ : Angle) : ‖(Real.sin θ)^(4*a)‖≤1 := by + rw [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg + (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2).le _)] + exact Real.rpow_le_one (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2).le (Real.sin_le_one _) (by linarith) + have hi : Integrable (fun θ : Angle => (Real.sin θ)^(4*a)) angleArea := + Integrable.of_bound hm 1 (Eventually.of_forall hb) + unfold angleNormalization + simp only [angleWeight] + rw [←ofReal_integral_eq_lintegral_ofReal hi + (Eventually.of_forall (fun θ : Angle => Real.rpow_nonneg + (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2).le _)),integral_angleArea (fun θ : ℝ => (Real.sin θ)^(4*a))] + have hh := integral_sin_cos (4*a) ha (1:ℝ[X]) + simp only [eval_one,mul_one] at hh + rw [hh] + simp only [normSq,inner,poly_zero,eval_one,mul_one] + +def angleCos (θ : Angle) : Interval := ⟨Real.cos θ,Real.neg_one_le_cos _,Real.cos_le_one _⟩ + +lemma angleCos_measurable : Measurable angleCos := by + unfold angleCos + fun_prop + +lemma integral_angleLaw_poly (a : ℝ) (ha : 1<4*a) (p : ℝ[X]) : + (∫θ : Angle,p.eval (Real.cos θ)∂angleLaw a)= + (∫v in (-1:ℝ)..1,weight (4*a) v*p.eval v)/normSq (4*a) 0 := by + rw [angleLaw,integral_smul_measure,integral_withDensity_eq_integral_toReal_smul + (angleWeight_measurable a) (Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] + have hn (θ : Angle) : 0≤(Real.sin θ)^(4*a) := Real.rpow_nonneg + (Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2).le _ + simp_rw [angleWeight,ENNReal.toReal_ofReal (hn _),smul_eq_mul] + rw [angleNormalization_jacobi a ha,ENNReal.toReal_inv, + ENNReal.toReal_ofReal (normSq_zero_pos (4*a) ha.le).le,integral_angleArea (fun θ : ℝ => (Real.sin θ)^(4*a)*p.eval (Real.cos θ)),integral_sin_cos (4*a) ha p] + ring + + +lemma map_angleLaw_eq_pi (a : ℝ) (ha : 1<4*a) : + (angleLaw a).map angleCos=pi (4*a) := by + have := angleLaw_probability a (by linarith) + have := pi_probability (4*a) ha.le + apply measure_eq_of_polynomial_integral + intro p + have hf : AEStronglyMeasurable (fun v : Interval => p.eval (v:ℝ)) ((angleLaw a).map angleCos) := + (p.continuous.comp continuous_subtype_val).aestronglyMeasurable + rw [integral_map angleCos_measurable.aemeasurable hf] + change (∫θ : Angle,p.eval (Real.cos θ)∂angleLaw a)=_ + rw [integral_angleLaw_poly a ha] + have hh := integral_pi_mul (4*a) ha.le p (1:ℝ[X]) + simpa only [eval_one,mul_one,inner] using hh.symm + +end SLEExactGauge.Jacobi +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/KernelBounds.lean b/lean/OAI/Probability/SLEGauge/KernelBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..39420697aa3e936cf4736e17d8da5a79553f5072 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/KernelBounds.lean @@ -0,0 +1,433 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.KernelMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +namespace ExactSLEKernel +lemma kernel_cons_bound {m : ℕ} {α b : ℝ} (ha : 0 ≤ α) (hb : 0 < b) + (z : ℂ) (x : Fin m → ℂ) : + kernel α b (Fin.cons z x) ≤ + ipow α (1/2)^m * kernel α b x * + (ipow α b + ∑ i, ipow α (dist z (x i)) + + ENNReal.ofReal b ^ α * ∑ i, ipow (2*α) (dist z (x i))) := by + classical + have hD : 1 ≤ ipow α (1/2) := by + have := ipow_anti ha (show (1:ℝ)/2 ≤ 1 by norm_num) + simpa [ipow] using this + by_cases hn : ∃ i, dist z (x i) < cappedDistance b x i / 2 + · obtain ⟨i,hi⟩ := hn + have hp : (∏ j : Fin m, ipow α (cappedDistance b (Fin.cons z x) j.succ)) ≤ + ipow α (1/2)^m * kernel α b x * (ENNReal.ofReal b ^ α * ipow α (dist z (x i))) := by + calc + _ ≤ ∏ j : Fin m, (ipow α (1/2) * ipow α (cappedDistance b x j)) * + (if j=i then ENNReal.ofReal b ^ α * ipow α (dist z (x i)) else 1) := by + apply Finset.prod_le_prod + intro j hj + by_cases hji : j=i + · subst j + rw [ite_eq_left rfl,cappedDistance_cons_succ,min_eq_right (by have := dist_nonneg (x:=z) (y:=x i); linarith)] + calc + _ = 1 * ipow α (dist z (x i)) := by simp + _ ≤ (ipow α (1/2) * (ipow α (cappedDistance b x i) * ENNReal.ofReal b ^ α)) * ipow α (dist z (x i)) := by + exact mul_le_mul' (one_le_mul_of_one_le_of_one_le hD (cap_compensated ha hb x i)) le_rfl + _ = _ := by ac_rfl + · rw [ite_eq_right hji,mul_one] + apply far_cap_factor ha hb.le + by_contra h + exact hji (half_cap_unique b z x j i (lt_of_not_ge h) hi) + _ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_mul_distrib]; simp [Finset.prod_ite_eq',kernel,ipow] + rw [kernel,Fin.prod_univ_succ] + change ipow α (cappedDistance b (Fin.cons z x) 0) * _ ≤ _ + rw [near_cap_nearest b z x i hi] + calc + _ ≤ ipow α (dist z (x i)) * + (ipow α (1/2)^m * kernel α b x * (ENNReal.ofReal b ^ α * ipow α (dist z (x i)))) := mul_le_mul' le_rfl hp + _ = ipow α (1/2)^m * kernel α b x * (ENNReal.ofReal b ^ α * ipow (2*α) (dist z (x i))) := by rw [ipow_twice]; ac_rfl + _ ≤ _ := by + apply mul_le_mul' le_rfl + exact (mul_le_mul' le_rfl (Finset.single_le_sum (fun k _ => (by positivity : (0:ℝ≥0∞) ≤ ipow (2*α) (dist z (x k)))) (Finset.mem_univ i))).trans le_add_self + · push Not at hn + have hp : (∏ j : Fin m, ipow α (cappedDistance b (Fin.cons z x) j.succ)) ≤ + ipow α (1/2)^m * kernel α b x := by + calc + _ ≤ ∏ j : Fin m, ipow α (1/2) * ipow α (cappedDistance b x j) := + Finset.prod_le_prod (fun j _ => far_cap_factor ha hb.le z x j (hn j)) + _ = _ := by simp [Finset.prod_mul_distrib,kernel,ipow] + rw [kernel,Fin.prod_univ_succ] + change ipow α (cappedDistance b (Fin.cons z x) 0) * _ ≤ _ + calc + _ ≤ (ipow α b + ∑ i, ipow α (dist z (x i))) * + (ipow α (1/2)^m * kernel α b x) := mul_le_mul' (cap_cons_factor_sum ha b z x) hp + _ ≤ _ := by rw [mul_comm]; exact mul_le_mul' le_rfl le_self_add + +open Metric + +lemma singular_ball_finite {p : ℝ} (_hp : 0 < p) (hp2 : p < 2) (R : ℝ) : + (∫⁻ x : ℂ in ball 0 R, edist x 0 ^ (-p)) < ∞ := by + have hi : IntegrableOn (fun x : ℂ => ‖x‖ ^ (-p)) (ball 0 R) := by + refine integrableOn_ball_of_norm_le_rpow (C:=1) (α:=p) (by simp) (by simpa using hp2) ?_ ?_ + · filter_upwards [] with x + simp [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg (norm_nonneg _) _)] + · exact (measurable_norm.pow_const _).aestronglyMeasurable + have hn : ∀ᵐ x : ℂ ∂volume.restrict (ball 0 R), x ≠ 0 := + ae_restrict_of_ae (by simp [ae_iff]) + have he : (fun x : ℂ => edist x 0 ^ (-p)) =ᵐ[volume.restrict (ball 0 R)] + fun x => ENNReal.ofReal (‖x‖ ^ (-p)) := by + filter_upwards [hn] with x hx + rw [edist_dist,dist_zero_right,ENNReal.ofReal_rpow_of_pos (norm_pos_iff.mpr hx)] + rw [lintegral_congr_ae he] + exact hi.lintegral_lt_top +lemma singular_ball_translate (p : ℝ) (z : ℂ) (R : ℝ) : + (∫⁻ x : ℂ in ball z R, edist x z ^ (-p)) = ∫⁻ x : ℂ in ball 0 R, edist x 0 ^ (-p) := by + rw [← lintegral_indicator measurableSet_ball,← lintegral_indicator measurableSet_ball] + convert lintegral_sub_right_eq_self (μ:=volume) ((ball (0:ℂ) R).indicator (fun x => edist x 0 ^ (-p))) z using 1 + congr 1 + funext x + simp [Set.indicator,mem_ball,dist_eq_norm,sub_zero,edist_dist] +lemma singular_uniform {p : ℝ} (hp : 0 < p) (hp2 : p < 2) (K : Set ℂ) + (hKb : Bornology.IsBounded K) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ z : ℂ, (∫⁻ x in K, edist x z ^ (-p)) ≤ C := by + let C := volume K + ∫⁻ x : ℂ in ball 0 1, edist x 0 ^ (-p) + refine ⟨C,ENNReal.add_lt_top.mpr ⟨hKb.measure_lt_top,(singular_ball_finite hp hp2 1)⟩,?_⟩ + intro z + calc + _ ≤ ∫⁻ x in K, 1 + (ball z 1).indicator (fun x => edist x z ^ (-p)) x := by + apply lintegral_mono + intro x + dsimp only + by_cases hx : x ∈ ball z 1 + · simp [indicator_of_mem hx] + · rw [indicator_of_notMem hx,add_zero] + have hd : (1:ℝ≥0∞) ≤ edist x z := by + rw [edist_dist,ENNReal.one_le_ofReal] + simpa [mem_ball,dist_comm] using hx + calc + _ ≤ edist x z ^ (0:ℝ) := ENNReal.rpow_le_rpow_of_exponent_le hd (by linarith) + _ = 1 := by simp + _ = volume K + ∫⁻ x in K, (ball z 1).indicator (fun x => edist x z ^ (-p)) x := by + rw [lintegral_add_left measurable_const,lintegral_const,Measure.restrict_apply_univ,one_mul] + _ ≤ volume K + ∫⁻ x, (ball z 1).indicator (fun x => edist x z ^ (-p)) x := + add_le_add le_rfl (lintegral_mono' Measure.restrict_le_self (fun _ => le_rfl)) + _ = C := by rw [lintegral_indicator measurableSet_ball,singular_ball_translate] +lemma conditional_kernel_bound {α b : ℝ} (ha : 0 < α) (ha1 : α < 1) (hb : 0 < b) + (m : ℕ) (K : Set ℂ) (hKb : Bornology.IsBounded K) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ x : Fin m → ℂ, + (∫⁻ z in K, kernel α b (Fin.cons z x)) ≤ C * kernel α b x := by + obtain ⟨A,hA,hAb⟩ := singular_uniform ha (by linarith) K hKb + obtain ⟨B,hB,hBb⟩ := singular_uniform (show 0 < 2*α by linarith) (by linarith) K hKb + let Q := ipow α b * volume K + (m:ℝ≥0∞)*A + ENNReal.ofReal b ^ α * ((m:ℝ≥0∞)*B) + let C := ipow α (1/2)^m * Q + have hQ : Q < ∞ := by + apply ENNReal.add_lt_top.mpr + refine ⟨ENNReal.add_lt_top.mpr ⟨?_,?_⟩,?_⟩ + · exact ENNReal.mul_lt_top (ipow_finite hb) hKb.measure_lt_top + · exact ENNReal.mul_lt_top (by simp) hA + · exact ENNReal.mul_lt_top (lt_top_iff_ne_top.mpr (ENNReal.rpow_ne_top_of_nonneg ha.le ENNReal.ofReal_ne_top)) (ENNReal.mul_lt_top (by simp) hB) + refine ⟨C,ENNReal.mul_lt_top (ENNReal.pow_lt_top (ipow_finite (by norm_num))) hQ,?_⟩ + intro x + have hm (p : ℝ) (i : Fin m) : Measurable (fun z : ℂ => ipow p (dist z (x i))) := by unfold ipow; fun_prop + have hsum (p : ℝ) : Measurable (fun z : ℂ => ∑ i, ipow p (dist z (x i))) := Finset.measurable_sum _ (fun _ _ => hm _ _) + have hs : (∫⁻ z in K, ipow α b + ∑ i, ipow α (dist z (x i)) + + ENNReal.ofReal b ^ α * ∑ i, ipow (2*α) (dist z (x i))) ≤ Q := by + rw [lintegral_add_left (f:=fun z : ℂ => ipow α b + ∑ i, ipow α (dist z (x i))) (by fun_prop),lintegral_add_left (f:=fun _ : ℂ => ipow α b) measurable_const, + lintegral_const,Measure.restrict_apply_univ, + lintegral_finsetSum _ (fun _ _ => hm _ _),lintegral_const_mul _ (hsum _), + lintegral_finsetSum _ (fun _ _ => hm _ _)] + apply add_le_add + · apply add_le_add le_rfl + calc + _ ≤ ∑ i : Fin m, A := Finset.sum_le_sum (fun i _ => by simpa [ipow,edist_dist] using hAb (x i)) + _ = _ := by simp + · apply mul_le_mul' le_rfl + calc + _ ≤ ∑ i : Fin m, B := Finset.sum_le_sum (fun i _ => by simpa [ipow,edist_dist] using hBb (x i)) + _ = _ := by simp + calc + _ ≤ ∫⁻ z in K, ipow α (1/2)^m * kernel α b x * + (ipow α b + ∑ i, ipow α (dist z (x i)) + + ENNReal.ofReal b ^ α * ∑ i, ipow (2*α) (dist z (x i))) := lintegral_mono (fun z => kernel_cons_bound ha.le hb z x) + _ = _ := lintegral_const_mul _ ((measurable_const.add (hsum α)).add (measurable_const.mul (hsum _))) + _ ≤ (ipow α (1/2)^m * kernel α b x) * Q := mul_le_mul' le_rfl hs + _ = C * kernel α b x := by dsimp [C]; ac_rfl +lemma cap_equiv {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + (e : ι ≃ κ) (b : ℝ) (x : κ → ℂ) (i : ι) : + cappedDistance b (x ∘ e) i = cappedDistance b x (e i) := by + apply le_antisymm + · apply (le_cappedDistance_iff _ _ _ _).mpr + refine ⟨cappedDistance_le _ _ _,?_⟩ + intro j hj + have := cappedDistance_le_dist b (x ∘ e) i (e.symm j) (fun h => hj (by rw [←e.apply_symm_apply j,h])) + simpa using this + · apply (le_cappedDistance_iff _ _ _ _).mpr + exact ⟨cappedDistance_le _ _ _,fun j hj => cappedDistance_le_dist b x (e i) (e j) (fun h => hj (e.injective h))⟩ +lemma kernel_equiv {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + (e : ι ≃ κ) (α b : ℝ) (x : κ → ℂ) : kernel α b (x ∘ e) = kernel α b x := by + unfold kernel + simp_rw [cap_equiv] + exact e.prod_comp (fun i => ENNReal.ofReal (cappedDistance b x i) ^ (-α)) +lemma kernel_swap_cons {m : ℕ} (α b : ℝ) (z y : ℂ) (x : Fin m → ℂ) : + kernel α b (Fin.cons z (Fin.cons y x)) = kernel α b (Fin.cons y (Fin.cons z x)) := by + classical + have he : Fin.cons z (Fin.cons y x) = + (Fin.cons y (Fin.cons z x)) ∘ Equiv.swap 0 (1 : Fin (m+2)) := by + funext i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · refine Fin.cases ?_ (fun k => ?_) j + · simp + · simp [Equiv.swap_apply_of_ne_of_ne,Fin.succ_succ_ne_one] + rw [he,kernel_equiv] +lemma lintegral_cons {m : ℕ} (μ : Measure ℂ) [SigmaFinite μ] + (f : (Fin (m+1) → ℂ) → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ x, f x ∂Measure.pi (fun _ => μ)) = + ∫⁻ x : Fin m → ℂ, ∫⁻ z : ℂ, f (Fin.cons z x) ∂μ ∂Measure.pi (fun _ => μ) := by + let e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (m+1) => ℂ) 0 + have he := (measurePreserving_piFinSuccAbove (fun _ : Fin (m+1) => μ) 0).symm + have hi := he.lintegral_comp hf + rw [←hi] + change (∫⁻ a : ℂ × (Fin m → ℂ), (f ∘ e.symm) a ∂μ.prod (Measure.pi fun _ => μ)) = _ + rw [lintegral_prod_symm _ (hf.comp e.symm.measurable).aemeasurable] + apply lintegral_congr + intro x + apply lintegral_congr + intro z + simp [e,MeasurableEquiv.piFinSuccAbove_symm_apply,Fin.insertNthEquiv] + +theorem capped_distance_kernel_integral (α b : ℝ) (hα : 0 < α) (hα1 : α < 1) + (hb : 0 < b) (m : ℕ) (K : Set ℂ) (_hK : MeasurableSet K) (hKb : Bornology.IsBounded K) : + (∫⁻ x : Fin m → ℂ, kernel α b x ∂Measure.pi (fun _ => volume.restrict K)) < ∞ := by + induction m with + | zero => simp [kernel] + | succ m ih => + obtain ⟨C,hC,hCb⟩ := conditional_kernel_bound hα hα1 hb m K hKb + rw [lintegral_cons _ _ (measurable_kernel hα.le b)] + calc + _ ≤ ∫⁻ x : Fin m → ℂ, C * kernel α b x ∂Measure.pi (fun _ => volume.restrict K) := lintegral_mono hCb + _ = C * ∫⁻ x : Fin m → ℂ, kernel α b x ∂Measure.pi (fun _ => volume.restrict K) := lintegral_const_mul _ (measurable_kernel hα.le b) + _ < ∞ := ENNReal.mul_lt_top hC ih + +theorem capped_distance_fixed_center (α b : ℝ) (hα : 0 < α) (hα1 : α < 1) + (hb : 0 < b) (m : ℕ) (K K₀ : Set ℂ) (_hK : MeasurableSet K) + (hKb : Bornology.IsBounded K) (_hK₀b : Bornology.IsBounded K₀) : + ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ z ∈ K₀, + (∫⁻ x : Fin m → ℂ, kernel α b (Fin.cons z x) ∂Measure.pi (fun _ => volume.restrict K)) ≤ C := by + have hmain : ∀ m : ℕ, ∃ C : ℝ≥0∞, C < ∞ ∧ ∀ z : ℂ, + (∫⁻ x : Fin m → ℂ, kernel α b (Fin.cons z x) ∂Measure.pi (fun _ => volume.restrict K)) ≤ C := by + intro m + induction m with + | zero => + refine ⟨ipow α b,ipow_finite hb,fun z => ?_⟩ + simp [kernel,cappedDistance,ipow] + | succ m ih => + obtain ⟨A,hA,hAb⟩ := ih + obtain ⟨C,hC,hCb⟩ := conditional_kernel_bound hα hα1 hb (m+1) K hKb + refine ⟨C*A,ENNReal.mul_lt_top hC hA,fun z => ?_⟩ + have hm : Measurable (fun x : Fin (m+1) → ℂ => kernel α b (Fin.cons z x)) := + (measurable_kernel hα.le b).comp (by fun_prop) + rw [lintegral_cons _ _ hm] + simp_rw [kernel_swap_cons α b z] + calc + _ ≤ ∫⁻ x : Fin m → ℂ, C * kernel α b (Fin.cons z x) ∂Measure.pi (fun _ => volume.restrict K) := lintegral_mono (fun x => hCb (Fin.cons z x)) + _ = C * ∫⁻ x : Fin m → ℂ, kernel α b (Fin.cons z x) ∂Measure.pi (fun _ => volume.restrict K) := lintegral_const_mul _ ((measurable_kernel hα.le b).comp (by fun_prop)) + _ ≤ _ := mul_le_mul' le_rfl (hAb z) + obtain ⟨C,hC,hCb⟩ := hmain m + exact ⟨C,hC,fun z _ => hCb z⟩ +end ExactSLEKernel + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Set ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal +noncomputable def fullRadialDensity (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (target : ℝ) : ℝ := + Real.exp (-alpha a * Real.log 2) * radialWeight a b z (target/2) +lemma fullRadialDensity_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ z : Fin m → ℂ, Function.Injective z → (∀ i, 0<(z i).im) → + ∀ cap target : Fin m → ℝ, + (∀ i, 0 actual_multipoint_hit_bound a ha k + let C := 1+∑ k∈Finset.range (m+1), D k + have hCle (k : ℕ) (hk : k ≤ m) : D k ≤ C := by + have hs : D k≤∑ j∈Finset.range (m+1), D j := + Finset.single_le_sum (fun j _ => (hD j).le) (Finset.mem_range.mpr (by omega)) + dsimp [C]; linarith + have hCp : 0 z (e i)) + (hinj.comp (Subtype.val_injective.comp e.injective)) (fun i => hz (e i)) + (fun i => cap (e i)) (fun i => target (e i)) (fun i => hc (e i)) + (fun i j hij => hsep (e i) (e j) (fun he => hij (e.injective (Subtype.ext he)))) + (fun i => ht (e i) (e i).2) + have he : {b : ExactSLEGenerator.Driver | ∀ i : Fin (Fintype.card I), radialTime a b.1 (z (e i)) (target (e i)/2)<∞} = + {b : ExactSLEGenerator.Driver | ∀ i∈I, radialTime a b.1 (z i) (target i/2)<∞} := by + ext b; simp only [mem_ofPred_eq] + constructor + · intro H i hi; obtain ⟨j,hj⟩ := e.surjective ⟨i,hi⟩; simpa [hj] using H j + · intro H i; exact H (e i) (e i).2 + have hp : (∏ i : Fin (Fintype.card I), (target (e i)/cap (e i))^(alpha a)) = + ∏ i∈I, (target i/cap i)^(alpha a) := by + rw [e.prod_comp (fun i : I => (target i/cap i)^(alpha a))] + exact Finset.prod_coe_sort I (fun i => (target i/cap i)^(alpha a)) + rw [he,hp] at hb + refine hb.trans (ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_right (hCle _ h) ?_)) + exact Finset.prod_nonneg fun i hi => Real.rpow_nonneg (le_of_lt (div_pos (ht i hi).1 (hc i).1)) _ + +theorem actual_density_product_bound (a : ℝ) (ha : 1/4 < a) (m : ℕ) : + ∃ C : ℝ, 0 < C ∧ ∀ (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W], + IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W → + ∀ z : Fin m → ℂ, Function.Injective z → (∀ i, 0 < (z i).im) → + ∀ cap target : Fin m → ℝ, + (∀ i, 0 target i≤cap i) + let E := {b : ExactSLEGenerator.Driver | ∀ i∈I, radialTime a b.1 (z i) (target i/2)<∞} + let A := ∏ i, (target i)^(-alpha a) + have hA : 0≤A := Finset.prod_nonneg fun i _ => Real.rpow_nonneg (ht i).1.le _ + have hhit : W E≤ENNReal.ofReal (C*∏ i∈I, (target i/cap i)^(alpha a)) := + hCb W hW z hinj hz cap target hc hsep I (fun i hi => ⟨(ht i).1,(Finset.mem_filter.mp hi).2⟩) + have hpoint (b : ExactSLEGenerator.Driver) : + (∏ i, ENNReal.ofReal (fullRadialDensity a b.1 (z i) (target i))) ≤ E.indicator (fun _ => ENNReal.ofReal A) b := by + by_cases hb : b∈E + · rw [Set.indicator_of_mem hb,ENNReal.ofReal_prod_of_nonneg (fun i _ => Real.rpow_nonneg (ht i).1.le _)] + exact Finset.prod_le_prod₀ (fun _ _ => bot_le) (fun i _ => ENNReal.ofReal_le_ofReal + (fullRadialDensity_bound a ha (z i) (hz i) (target i) (ht i).1 (ht i).2 b).2) + · rw [Set.indicator_of_notMem hb] + have he : ∃ i∈I, radialTime a b.1 (z i) (target i/2)=∞ := by + by_contra hn + apply hb + intro i hi + exact lt_top_iff_ne_top.mpr (fun he => hn ⟨i,hi,he⟩) + obtain ⟨i,hi,he⟩ := he + have hz0 : ENNReal.ofReal (fullRadialDensity a b.1 (z i) (target i))=0 := by + simp [fullRadialDensity,radialWeight,he] + exact le_of_eq (Finset.prod_eq_zero (Finset.mem_univ i) hz0) + have halg : A*(∏ i∈I, (target i/cap i)^(alpha a)) ≤ ∏ i, (cap i)^(-alpha a) := by + unfold A I + rw [Finset.prod_filter,←Finset.prod_mul_distrib] + apply Finset.prod_le_prod₀ + · intro i _ + apply mul_nonneg (Real.rpow_nonneg (ht i).1.le _) + split_ifs + · exact Real.rpow_nonneg (div_nonneg (ht i).1.le (hc i).1.le) _ + · norm_num + · intro i _ + by_cases hi : target i≤cap i + · rw [ite_eq_left hi,Real.div_rpow (ht i).1.le (hc i).1.le, + Real.rpow_neg (ht i).1.le,Real.rpow_neg (hc i).1.le] + have hp := Real.rpow_pos_of_pos (ht i).1 (alpha a) + field_simp + rfl + · rw [ite_eq_right hi,mul_one] + exact Real.rpow_le_rpow_of_nonpos (hc i).1 (le_of_not_ge hi) (neg_nonpos.mpr (alpha_pos ha).le) + calc + _ ≤ ∫⁻ b, E.indicator (fun _ => ENNReal.ofReal A) b ∂W := lintegral_mono hpoint + _ ≤ ENNReal.ofReal A*W E := lintegral_indicator_const_le E _ + _ ≤ ENNReal.ofReal A*ENNReal.ofReal (C*∏ i∈I, (target i/cap i)^(alpha a)) := mul_le_mul' le_rfl hhit + _ = ENNReal.ofReal (C*(A*∏ i∈I, (target i/cap i)^(alpha a))) := by rw [←ENNReal.ofReal_mul hA]; congr 1; ring + _ ≤ _ := ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left halg hC.le) +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Set ExactSLEGenerator ExactSLEMain ExactSLEKernel +open scoped Classical NNReal ENNReal +noncomputable def massDensity (a q : ℝ) (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ≥0∞ := + if 0 massDensity a q p.1 p.2) := by + let U : Set (ExactSLEGenerator.Driver × ℂ) := {p | 0 ENNReal.ofReal + (Real.exp (-alpha a*Real.log 2)*radialWeight a p.1.1.1 p.1.2 (p.1.2.im*q))) := by + have hp : Measurable (fun p : U => (p.1.1, (⟨p.1.2,p.2⟩ : {z : ℂ // 0 0) measurable_const hU + convert h using 1 + funext p + simp only [massDensity,fullRadialDensity] + have he : 2*p.2.im*q/2=p.2.im*q := by ring + simp only [he] + rfl + +lemma lintegral_power_pi (μ : Measure ℂ) [SigmaFinite μ] (f : ℂ → ℝ≥0∞) + (hf : Measurable f) (m : ℕ) : + (∫⁻ z, f z ∂μ)^m = ∫⁻ x : Fin m → ℂ, ∏ i, f (x i) ∂Measure.pi (fun _ => μ) := by + induction m with + | zero => simp + | succ m ih => + rw [lintegral_cons _ _ (by fun_prop)] + simp_rw [Fin.prod_univ_succ,Fin.cons_zero,Fin.cons_succ,lintegral_mul_const _ hf] + rw [lintegral_const_mul _ (by fun_prop),←ih,pow_succ'] + +lemma kernel_top_of_not_injective (α c : ℝ) (ha : 0<α) (hc : 0 + ne_of_gt (ipow_pos ha.le) + unfold kernel + rw [←Finset.mul_prod_erase Finset.univ _ (Finset.mem_univ i),hz,ENNReal.ofReal_zero, + ENNReal.zero_rpow_def] + simp only [neg_pos,not_lt.mpr ha.le,ite_false,neg_eq_zero,ha.ne'] + exact ENNReal.top_mul (Finset.prod_ne_zero_iff.mpr (fun k _ => hp k)) + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/KernelMeasurability.lean b/lean/OAI/Probability/SLEGauge/KernelMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..637aa351e542ecbc3a902baba6d1fb1a0079c437 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/KernelMeasurability.lean @@ -0,0 +1,437 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ProductIntegrability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEFlow +variable {Ω : Type*} [MeasurableSpace Ω] +lemma localState_parameter_measurable (a : ℝ) (ε : Ω → ℝ) (hε : ∀ ω, 0 < ε ω) + (z : Ω → ℂ) (b : Ω → ExactSLEGenerator.Driver) + (hεm : Measurable ε) (hzm : Measurable z) (hbm : Measurable b) (t : ℝ≥0) : + Measurable (fun ω => localState a (ε ω) (hε ω) (z ω) t (b ω)) := by + let A : Ω → State → State := fun ω => cutoffDrift a (ε ω) + let L : Ω → ℝ≥0 := fun ω => ⟨max (|a|/ε ω) (|a|/(ε ω)^2), by positivity⟩ + let K : Ω → ℝ≥0 := fun ω => ⟨max (2*|a|/(ε ω)^2) (4*|a|/(ε ω)^3), by positivity⟩ + have hA : ∀ ω, LipschitzWith (K ω) (A ω) := fun ω => cutoffDrift_lipschitz a (ε ω) (hε ω) + have hb : ∀ ω v, ‖A ω v‖ ≤ L ω := fun ω => cutoffDrift_bound a (ε ω) (hε ω) + have hmA : Measurable (Function.uncurry A) := by + change Measurable (fun w : Ω × State => cutoffDrift a (ε w.1) w.2) + unfold cutoffDrift cutoffVector heightClamp + simp only [Complex.mk_eq_add_mul_I] + fun_prop + let u : ℝ≥0 → Ω → State := fun t ω => (b ω).1 t • noise + have huc (ω : Ω) : Continuous (fun t => u t ω) := (b ω).1.continuous.smul continuous_const + have hum (t : ℝ≥0) : Measurable (u t) := ((driver_eval_measurable t).measurable.comp hbm).smul_const noise + obtain ⟨F,hFc,hFm,hFe⟩ := measurable_parameter_flow A L K hA hb hmA u huc hum + (fun ω => (z ω,0)) (hzm.prodMk measurable_const) + have he (ω : Ω) (t : ℝ≥0) : F t ω = localState a (ε ω) (hε ω) (z ω) t (b ω) - u t ω := by + apply integral_flow_unique (hA ω) (huc ω) (huc ω) (hFc ω) + ((localState_continuous a (ε ω) (hε ω) (z ω) (b ω)).sub (huc ω)) (hFe ω) + (fun s => ?_) (T := t) (fun _ _ => rfl) le_rfl + simp only [Pi.sub_apply,sub_add_cancel] + rw [localState_eq_zero] + dsimp [u,A] + abel + convert (hFm t).add (hum t) using 1 + funext ω + change localState a (ε ω) (hε ω) (z ω) t (b ω) = F t ω + u t ω + rw [he] + simp + +lemma localState_parameter_joint_measurable (a : ℝ) (ε : Ω → ℝ) (hε : ∀ ω, 0 < ε ω) + (z : Ω → ℂ) (b : Ω → ExactSLEGenerator.Driver) + (hεm : Measurable ε) (hzm : Measurable z) (hbm : Measurable b) : + Measurable (fun p : ℝ≥0 × Ω => localState a (ε p.2) (hε p.2) (z p.2) p.1 (b p.2)) := by + exact measurable_uncurry_of_continuous_of_measurable + (fun ω => localState_continuous a (ε ω) (hε ω) (z ω) (b ω)) + (fun t => localState_parameter_measurable a ε hε z b hεm hzm hbm t) +end ExactSLEGreen + +namespace ExactSLEHitting +variable {Ω : Type*} [MeasurableSpace Ω] +lemma boundedContact_parameter_measurable (f : ℝ≥0 → Ω → ℝ) + (hc : ∀ ω, Continuous (fun t => f t ω)) (hm : ∀ t, Measurable (f t)) + (B : Ω → ℝ≥0) (hB : Measurable B) : + Measurable (fun ω => hittingBtwn f (Iic 0) 0 (B ω) ω) := by + apply measurable_of_Iic + intro t + have he : (fun ω => hittingBtwn f (Iic 0) 0 (B ω) ω) ⁻¹' Iic t = + {ω | B ω ≤ t} ∪ {ω | ∃ u ≤ t, f u ω ≤ 0} := by + ext ω + simp only [mem_preimage,mem_Iic,mem_union,mem_ofPred_eq] + by_cases h : B ω ≤ t + · exact iff_of_true ((hittingBtwn_le ω).trans h) (Or.inl h) + · rw [or_iff_right h] + exact boundedContact_le_iff f hc ω (B ω) t (lt_of_not_ge h) + rw [he] + exact (measurableSet_le hB measurable_const).union + (measurable_has_contact (Filtration.const ℝ≥0 (inferInstance : MeasurableSpace Ω) le_rfl) f hc (fun t => hm t) t) +end ExactSLEHitting + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEHitting +variable {Ω : Type*} [MeasurableSpace Ω] +lemma regionStop_parameter_measurable (a : ℝ) (ε : Ω → ℝ) (hε : ∀ ω, 0 < ε ω) + (z : Ω → ℂ) (b : Ω → ExactSLEGenerator.Driver) (N ρ δ : Ω → ℝ) (B : Ω → ℝ≥0) + (hεm : Measurable ε) (hzm : Measurable z) (hbm : Measurable b) + (hN : Measurable N) (hρ : Measurable ρ) (hδ : Measurable δ) (hB : Measurable B) : + Measurable (fun ω => regionStop a (ε ω) (hε ω) (z ω) (N ω) (ρ ω) (δ ω) (B ω) (b ω)) := by + apply boundedContact_parameter_measurable + (fun t ω => regionMonitor (ε ω) (N ω) (ρ ω) (δ ω) + (localState a (ε ω) (hε ω) (z ω) t (b ω))) + (fun ω => (regionMonitor_continuous _ _ _ _).comp (localState_continuous _ _ _ _ _)) _ B hB + intro t + have hv := localState_parameter_measurable a ε hε z b hεm hzm hbm t + have hy : Measurable (fun ω => Y (localState a (ε ω) (hε ω) (z ω) t (b ω))) := + Y.continuous.measurable.comp hv + have hr : Measurable (fun ω => physicalRadius (localState a (ε ω) (hε ω) (z ω) t (b ω))) := + physicalRadius_continuous.measurable.comp hv + unfold regionMonitor + exact (hy.sub hεm).min ((hN.sub hv.norm).min ((hr.sub hρ).min (hy.sub (hδ.mul hv.fst.norm)))) +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +noncomputable def explicitRadialLocalization (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ δ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (hδ : 0 < δ) + (hs : δ*‖z‖ ≤ z.im) : RadialLocalization a z ρ δ := by + let m := heightFloor z.im ρ δ + let C := logCeiling z.im ρ δ + have hm : 0 < m := heightFloor_pos _ _ _ + have hC : 0 ≤ C := logCeiling_nonneg _ _ _ + have hmz : m ≤ z.im := heightFloor_le hz hρ hr + let N : ℝ≥0 := ⟨z.im/δ+C+1,by positivity⟩ + let B : ℝ≥0 := ⟨z.im^2/(2*a*δ^2)+1,by positivity⟩ + have hinit : 0 ≤ regionMonitor (m/2) N ρ δ (z,0) := by + apply (regionMonitor_nonneg_iff _ _ _ _ _).mpr + have hnorm : ‖z‖ ≤ z.im/δ := (le_div_iff₀ hδ).mpr (by simpa only [mul_comm] using hs) + refine ⟨?_,?_,?_,hs⟩ + · change m/2 ≤ z.im + linarith + · simpa only [Prod.norm_def,Real.norm_eq_abs,abs_zero,max_eq_left (norm_nonneg z)] using + (show ‖z‖ ≤ (N : ℝ) by change ‖z‖ ≤ z.im/δ+C+1; linarith) + · simpa only [physicalRadius,Y_apply,J_apply,neg_zero,Real.exp_zero,mul_one] using hr + refine ⟨m/2,by positivity,N,B,hinit,by change m/2 < m; linarith,?_,?_⟩ + · change z.im/δ+C < z.im/δ+C+1 + linarith + · change z.im^2 < 2*a*δ^2*(z.im^2/(2*a*δ^2)+1) + have hp : 0 < 2*a*δ^2 := by positivity + field_simp + nlinarith + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +lemma localizationApproximation_tendsto (a : ℝ) (ha : 1/4 < a) (ha0 : 0 < a) + (z : ℂ) (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (_hr : ρ ≤ z.im) + (b : ExactSLEGenerator.Driver) + (L : ∀ n, RadialLocalization a z ρ (angleThreshold z n)) : + Tendsto (fun n => physicalGreen a (localState a (L n).ε (L n).hε z + (regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b) b)) atTop + (𝓝 (radialWeight a b.1 z ρ)) := by + classical + let T (n : ℕ) := regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b + let V (n : ℕ) := localState a (L n).ε (L n).hε z (T n) b + have hexit (n : ℕ) : physicalRadius (V n) = ρ ∨ Y (V n) = angleThreshold z n*‖(V n).1‖ := + regionStop_true_exit a (L n).ε ha0 (L n).hε z (L n).N ρ (angleThreshold z n) + hρ (angleThreshold_pos z hz n) (L n).B (L n).initial (L n).small (L n).large (L n).time b + have hactual (n : ℕ) : alive a b.1 (T n) z ∧ actualState a b.1 (T n) z = V n := + regionStop_actualState a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b _ le_rfl + by_cases hex : ∃ t : ℝ≥0, alive a b.1 t z ∧ physicalRadius (actualState a b.1 t z) = ρ + · obtain ⟨t,ht,htr⟩ := hex + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht + have he : ∀ᶠ n in atTop, physicalGreen a (localState a (L n).ε (L n).hε z + (regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b) b) = radialWeight a b.1 z ρ := by + filter_upwards [(angleThreshold_tendsto z).eventually (gt_mem_nhds hη)] with n hn + have ht' : T n ≤ t := regionStop_le_hit a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b t htr + have hη' := hηs (T n) ht' + rw [(hactual n).2] at hη' + rcases hexit n with hR|hS + · exact regionStop_weight_eq a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b hR + · have hsafe := regionStop_safe a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b (T n) le_rfl + have hnp : 0 < ‖(V n).1‖ := ((L n).hε.trans_le hsafe.1).trans_le (Complex.im_le_norm _) + have hd : Y (V n)/‖(V n).1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + rw [hd] at hη' + exact False.elim (not_le.mpr hn hη') + exact Filter.Tendsto.congr' (he.mono fun n hn => hn.symm) tendsto_const_nhds + · have hw : radialWeight a b.1 z ρ = 0 := by rw [radialWeight,ite_eq_left (radialTime_top_of_no_hit a b.1 z ρ hex)] + rw [hw] + have hbound (n : ℕ) : physicalGreen a (localState a (L n).ε (L n).hε z + (regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b) b) ≤ + Real.exp (-alpha a*Real.log ρ) * (angleThreshold z n)^(p a) := by + rcases hexit n with hR|hS + · exact False.elim (hex ⟨T n,(hactual n).1,by simpa only [(hactual n).2] using hR⟩) + · have hs := regionStop_safe a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b (T n) le_rfl + exact physicalGreen_angle_bound a ρ (angleThreshold z n) ha hρ (V n) + ((L n).hε.trans_le hs.1) hs.2.2.1 hS + have hp : 0 < p a := by unfold p; linarith + have hu : Tendsto (fun n => Real.exp (-alpha a*Real.log ρ) * (angleThreshold z n)^(p a)) atTop (𝓝 0) := by + simpa only [mul_zero] using ((angleThreshold_tendsto z).rpow_const_nhds_zero hp).const_mul + (Real.exp (-alpha a*Real.log ρ)) + exact squeeze_zero (fun n => (Real.exp_pos _).le) hbound hu + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +theorem joint_radialWeight_measurable (a : ℝ) (ha : 1/4 < a) (q : ℝ) + (hq : 0 < q) (hq1 : q ≤ 1) : + Measurable (fun p : ExactSLEGenerator.Driver × {z : ℂ // 0 < z.im} => + radialWeight a p.1.1 p.2.1 (p.2.1.im*q)) := by + have ha0 : 0 p.2.1 + let b : Ω → ExactSLEGenerator.Driver := Prod.fst + have hz (ω : Ω) : 0<(z ω).im := ω.2.2 + have hzM : Measurable z := measurable_subtype_coe.comp measurable_snd + have hbM : Measurable b := measurable_fst + let ρ : Ω → ℝ := fun ω => (z ω).im*q + have hρ (ω : Ω) : 0<ρ ω := mul_pos (hz ω) hq + have hr (ω : Ω) : ρ ω≤(z ω).im := mul_le_of_le_one_right (hz ω).le hq1 + let δ : ℕ → Ω → ℝ := fun n ω => angleThreshold (z ω) n + let L (n : ℕ) (ω : Ω) := explicitRadialLocalization a ha0 (z ω) (hz ω) (ρ ω) (δ n ω) + (hρ ω) (hr ω) (angleThreshold_pos (z ω) (hz ω) n) (angleThreshold_initial (z ω) (hz ω) n) + have hρM : Measurable ρ := hzM.im.mul_const q + have hδM (n : ℕ) : Measurable (δ n) := by + dsimp [δ,angleThreshold] + exact (hzM.im.div hzM.norm).div_const _ + have hεM (n : ℕ) : Measurable (fun ω => (L n ω).ε) := by + change Measurable (fun ω => heightFloor (z ω).im (ρ ω) (δ n ω)/2) + unfold heightFloor + fun_prop + have hNM (n : ℕ) : Measurable (fun ω => (L n ω).N) := by + change Measurable (fun ω => (⟨(z ω).im/δ n ω+logCeiling (z ω).im (ρ ω) (δ n ω)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + unfold logCeiling heightFloor + fun_prop + have hBM (n : ℕ) : Measurable (fun ω => (L n ω).B) := by + change Measurable (fun ω => (⟨(z ω).im^2/(2*a*(δ n ω)^2)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + fun_prop + let T (n : ℕ) (ω : Ω) := regionStop a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (b ω) + have hTM (n : ℕ) : Measurable (T n) := + regionStop_parameter_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b _ ρ (δ n) _ (hεM n) hzM hbM + (measurable_subtype_coe.comp (hNM n)) hρM (hδM n) (hBM n) + have hPM : Measurable (physicalGreen a) := by + have hx := X.continuous.measurable + have hy := Y.continuous.measurable + have hj := J.continuous.measurable + unfold physicalGreen logGreen Q + fun_prop + let F (n : ℕ) (ω : Ω) := physicalGreen a (localState a (L n ω).ε (L n ω).hε (z ω) (T n ω) (b ω)) + have hFM (n : ℕ) : Measurable (F n) := hPM.comp + ((localState_parameter_joint_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b (hεM n) hzM hbM).comp + ((hTM n).prodMk measurable_id)) + apply measurable_of_tendsto_metrizable hFM + apply tendsto_pi_nhds.mpr + intro ω + exact localizationApproximation_tendsto a ha ha0 (z ω) (hz ω) (ρ ω) (hρ ω) (hr ω) (b ω) + (fun n => L n ω) +end ExactSLEGreen + + + +open MeasureTheory Set +open scoped ENNReal +namespace ExactSLEKernel +noncomputable def cappedDistance {ι : Type*} [Fintype ι] [DecidableEq ι] + (b : ℝ) (x : ι → ℂ) (i : ι) : ℝ := + (insert b ((Finset.univ.erase i).image fun j => dist (x i) (x j))).min' (by simp) +noncomputable def kernel {ι : Type*} [Fintype ι] [DecidableEq ι] + (α b : ℝ) (x : ι → ℂ) : ℝ≥0∞ := + ∏ i, (ENNReal.ofReal (cappedDistance b x i)) ^ (-α) + +section Basic +variable {ι : Type*} [Fintype ι] [DecidableEq ι] +lemma le_cappedDistance_iff (b r : ℝ) (x : ι → ℂ) (i : ι) : + r ≤ cappedDistance b x i ↔ r ≤ b ∧ ∀ j, j ≠ i → r ≤ dist (x i) (x j) := by + classical + unfold cappedDistance + constructor + · intro h + refine ⟨h.trans (Finset.min'_le _ _ (by simp)),?_⟩ + intro j hj + exact h.trans (Finset.min'_le _ _ (by simp only [Finset.mem_insert,Finset.mem_image,Finset.mem_erase,Finset.mem_univ,and_true]; exact Or.inr ⟨j,hj,rfl⟩)) + · rintro ⟨hb,h⟩ + apply Finset.le_min' + intro y hy + rcases Finset.mem_insert.mp hy with rfl|hy + · exact hb + obtain ⟨j,hj,rfl⟩ := Finset.mem_image.mp hy + exact h j (Finset.mem_erase.mp hj).1 +lemma cappedDistance_le (b : ℝ) (x : ι → ℂ) (i : ι) : cappedDistance b x i ≤ b := + ((le_cappedDistance_iff b _ x i).mp le_rfl).1 +lemma cappedDistance_le_dist (b : ℝ) (x : ι → ℂ) (i j : ι) (hji : j ≠ i) : + cappedDistance b x i ≤ dist (x i) (x j) := + ((le_cappedDistance_iff b _ x i).mp le_rfl).2 j hji +lemma cappedDistance_pos {b : ℝ} (hb : 0 < b) (x : ι → ℂ) (hx : Function.Injective x) (i : ι) : + 0 < cappedDistance b x i := by + classical + have h := Finset.min'_mem (insert b ((Finset.univ.erase i).image fun j => dist (x i) (x j))) (by simp) + change cappedDistance b x i ∈ _ at h + rcases Finset.mem_insert.mp h with h|h + · rwa [h] + · obtain ⟨j,hj,h⟩ := Finset.mem_image.mp h + rw [←h] + exact dist_pos.mpr (fun he => (Finset.mem_erase.mp hj).1 (hx he).symm) +lemma cappedDistance_nonneg {b : ℝ} (hb : 0 ≤ b) (x : ι → ℂ) (i : ι) : + 0 ≤ cappedDistance b x i := (le_cappedDistance_iff _ _ _ _).mpr ⟨hb,fun _ _ => dist_nonneg⟩ +end Basic +lemma cappedDistance_cons_succ {m : ℕ} (b : ℝ) (z : ℂ) (x : Fin m → ℂ) (i : Fin m) : + cappedDistance b (Fin.cons z x) i.succ = min (cappedDistance b x i) (dist z (x i)) := by + apply le_antisymm + · apply le_min + · apply (le_cappedDistance_iff _ _ _ _).mpr + refine ⟨cappedDistance_le _ _ _,fun j hj => ?_⟩ + simpa using cappedDistance_le_dist b (Fin.cons z x) i.succ j.succ (by simpa using hj) + · simpa [dist_comm] using cappedDistance_le_dist b (Fin.cons z x) i.succ 0 (Ne.symm (Fin.succ_ne_zero i)) + · apply (le_cappedDistance_iff _ _ _ _).mpr + refine ⟨(min_le_left _ _).trans (cappedDistance_le _ _ _),?_⟩ + intro j hj + revert hj + refine Fin.cases (fun hj => ?_) (fun k hj => ?_) j + · simp [dist_comm] + · have hki : k ≠ i := by intro he; subst k; exact hj rfl + exact (min_le_left _ _).trans (by simpa using cappedDistance_le_dist b x i k hki) +lemma half_cap_unique {m : ℕ} (b : ℝ) (z : ℂ) (x : Fin m → ℂ) + (i j : Fin m) (hi : dist z (x i) < cappedDistance b x i / 2) + (hj : dist z (x j) < cappedDistance b x j / 2) : i = j := by + by_contra hij + have h1 := cappedDistance_le_dist b x i j (Ne.symm hij) + have h2 := cappedDistance_le_dist b x j i hij + have h3 := dist_triangle (x i) z (x j) + rw [dist_comm (x i) z] at h3 + rw [dist_comm (x j) (x i)] at h2 + linarith +lemma near_cap_nearest {m : ℕ} (b : ℝ) (z : ℂ) (x : Fin m → ℂ) + (i : Fin m) (hi : dist z (x i) < cappedDistance b x i / 2) : + cappedDistance b (Fin.cons z x) 0 = dist z (x i) := by + apply le_antisymm + · simpa using cappedDistance_le_dist b (Fin.cons z x) 0 i.succ (by simp) + · apply (le_cappedDistance_iff _ _ _ _).mpr + refine ⟨by have := cappedDistance_le b x i; have := dist_nonneg (x:=z) (y:=x i); linarith,?_⟩ + intro j hj + revert hj + refine Fin.cases (fun hj => False.elim (hj rfl)) (fun k hj => ?_) j + simp only [Fin.cons_zero,Fin.cons_succ] + by_cases hki : k=i + · simp [hki] + · have h1 := cappedDistance_le_dist b x i k hki + have h2 := dist_triangle (x i) z (x k) + rw [dist_comm (x i) z] at h2 + linarith +noncomputable def ipow (α r : ℝ) : ℝ≥0∞ := ENNReal.ofReal r ^ (-α) +lemma ipow_anti {α r s : ℝ} (ha : 0 ≤ α) (hrs : r ≤ s) : ipow α s ≤ ipow α r := by + unfold ipow + rw [ENNReal.rpow_neg,ENNReal.rpow_neg] + exact ENNReal.inv_le_inv.mpr (ENNReal.rpow_le_rpow (ENNReal.ofReal_le_ofReal hrs) ha) +lemma ipow_pos {α r : ℝ} (ha : 0 ≤ α) : 0 < ipow α r := by + rw [ipow,ENNReal.rpow_neg,ENNReal.inv_pos] + exact ENNReal.rpow_ne_top_of_nonneg ha ENNReal.ofReal_ne_top +lemma ipow_finite {α r : ℝ} (hr : 0 < r) : ipow α r < ∞ := by + exact lt_top_iff_ne_top.mpr (ENNReal.rpow_ne_top_of_ne_zero (ne_of_gt (ENNReal.ofReal_pos.mpr hr)) ENNReal.ofReal_ne_top) +lemma ipow_mul (α : ℝ) {r : ℝ} (hr : 0 ≤ r) (s : ℝ) : + ipow α (r*s) = ipow α r * ipow α s := by + rw [ipow,ENNReal.ofReal_mul hr,ENNReal.mul_rpow_of_ne_top ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top] + rfl +lemma ipow_twice (α r : ℝ) : ipow (2*α) r = ipow α r * ipow α r := by + unfold ipow + rw [show -(2*α)=(-α)*(2:ℕ) by norm_num; ring,ENNReal.rpow_mul,ENNReal.rpow_natCast,pow_two] +lemma cap_factor_sup {ι : Type*} [Fintype ι] [DecidableEq ι] + {α : ℝ} (ha : 0 ≤ α) (b : ℝ) (x : ι → ℂ) (i : ι) : + ipow α (cappedDistance b x i) = ipow α b ⊔ ⨆ j, if j=i then 0 else ipow α (dist (x i) (x j)) := by + classical + apply le_antisymm + · have h := Finset.min'_mem (insert b ((Finset.univ.erase i).image fun j => dist (x i) (x j))) (by simp) + change cappedDistance b x i ∈ _ at h + rcases Finset.mem_insert.mp h with h|h + · rw [h]; exact le_sup_left + · obtain ⟨j,hj,hj'⟩ := Finset.mem_image.mp h + rw [←hj'] + exact (le_iSup_of_le j (by simp [(Finset.mem_erase.mp hj).1])).trans le_sup_right + · apply sup_le + · exact ipow_anti ha (cappedDistance_le _ _ _) + · apply iSup_le + intro j + split_ifs with h + · exact bot_le + · exact ipow_anti ha (cappedDistance_le_dist _ _ _ _ h) +lemma measurable_kernel {ι : Type*} [Fintype ι] [DecidableEq ι] + {α : ℝ} (ha : 0 ≤ α) (b : ℝ) : Measurable (kernel (ι:=ι) α b) := by + classical + unfold kernel + apply Finset.measurable_prod + intro i hi + change Measurable (fun x : ι → ℂ => ipow α (cappedDistance b x i)) + simp_rw [cap_factor_sup ha] + apply Measurable.sup measurable_const + apply Measurable.iSup + intro j + split_ifs + · exact measurable_const + · unfold ipow + fun_prop +lemma cap_cons_factor_sum {m : ℕ} {α : ℝ} (ha : 0 ≤ α) (b : ℝ) + (z : ℂ) (x : Fin m → ℂ) : + ipow α (cappedDistance b (Fin.cons z x) 0) ≤ ipow α b + ∑ i, ipow α (dist z (x i)) := by + rw [cap_factor_sup ha] + apply sup_le + · exact le_self_add + · apply iSup_le; intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · simp only [Fin.succ_ne_zero,ite_false,Fin.cons_zero,Fin.cons_succ] + exact (Finset.single_le_sum (fun k _ => (by positivity : (0:ℝ≥0∞) ≤ ipow α (dist z (x k)))) (Finset.mem_univ j)).trans le_add_self +lemma far_cap_factor {m : ℕ} {α b : ℝ} (ha : 0 ≤ α) (hb : 0 ≤ b) + (z : ℂ) (x : Fin m → ℂ) (i : Fin m) + (hi : cappedDistance b x i / 2 ≤ dist z (x i)) : + ipow α (cappedDistance b (Fin.cons z x) i.succ) ≤ ipow α (1/2) * ipow α (cappedDistance b x i) := by + have hn := cappedDistance_nonneg hb x i + have h : cappedDistance b x i / 2 ≤ cappedDistance b (Fin.cons z x) i.succ := by + rw [cappedDistance_cons_succ] + exact le_min (by linarith) hi + have hh := ipow_anti ha h + convert hh using 1 + rw [show cappedDistance b x i / 2 = cappedDistance b x i * (1/2) by ring, ipow_mul α hn,mul_comm] +lemma cap_compensated {m : ℕ} {α b : ℝ} (ha : 0 ≤ α) (hb : 0 < b) + (x : Fin m → ℂ) (i : Fin m) : + 1 ≤ ipow α (cappedDistance b x i) * ENNReal.ofReal b ^ α := by + have h := mul_le_mul' (ipow_anti ha (cappedDistance_le b x i)) (le_refl (ENNReal.ofReal b ^ α)) + have he : ipow α b * ENNReal.ofReal b ^ α = 1 := by + rw [ipow,←ENNReal.rpow_add _ _ (ne_of_gt (ENNReal.ofReal_pos.mpr hb)) ENNReal.ofReal_ne_top] + simp + rwa [he] at h +end ExactSLEKernel +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/LocalFiniteness.lean b/lean/OAI/Probability/SLEGauge/LocalFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..7aad4b4942e7d0c54c9d4d2824345389b1d890cb --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/LocalFiniteness.lean @@ -0,0 +1,449 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadialMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +open Filter Topology +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open MeasureTheory Filter Topology Set CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal +lemma actualUpperMass_finiteOnCompacts (a : ℝ) (ha : 1/4 timeMassDensity a q t b z.1) := + (timeMassDensity_measurable a ha q hq hq1 t).comp + (measurable_const.prodMk measurable_subtype_coe) + rw [actualUpperMass,withDensity_apply _ hK.measurableSet] + apply lt_of_le_of_lt (setLIntegral_mono' hK.measurableSet + (fun z hz => timeMassDensity_local_bound a ha q hq hq1 t b c hc z.1 (hcz z hz))) + rw [lintegral_const] + apply ENNReal.mul_lt_top ENNReal.ofReal_lt_top + rw [Measure.restrict_apply_univ] + rw [upperArea,upper_embedding.comap_apply] + exact (hK.image continuous_subtype_val).measure_lt_top + +noncomputable def upperExtension (f : C_c(UpperPlane, ℝ)) : ℂ → ℝ := + Function.extend Subtype.val f 0 + +lemma upperExtension_apply (f : C_c(UpperPlane, ℝ)) (z : UpperPlane) : + upperExtension f z.1=f z := Subtype.val_injective.extend_apply _ _ _ + +lemma upperExtension_measurable (f : C_c(UpperPlane, ℝ)) : Measurable (upperExtension f) := + upper_embedding.measurable_extend f.continuous.measurable measurable_const + +lemma upperExtension_zero (f : C_c(UpperPlane, ℝ)) (z : ℂ) + (hz : z∉Subtype.val '' tsupport f) : upperExtension f z=0 := by + by_cases h : 0 hz ⟨⟨z,h⟩,H,rfl⟩) + · apply Function.extend_apply' + rintro ⟨w,rfl⟩ + exact h w.2 + +lemma actualUpperMass_eval (a : ℝ) (ha : 1/4 timeMassDensity a q t b z.1) := + (timeMassDensity_measurable a ha q hq hq1 t).comp (measurable_const.prodMk measurable_subtype_coe) + rw [actualUpperMass,integral_withDensity_eq_integral_toReal_smul hm + (Filter.Eventually.of_forall (fun z => timeMassDensity_finite a q t b z.1))] + simp only [smul_eq_mul] + simp_rw [← upperExtension_apply f] + rw [upperArea] + trans ∫ z in {z : ℂ | 0 (timeMassDensity a q t b z).toReal * upperExtension f z) + · rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] + unfold actualMassEval + rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] + · apply integral_congr_ae + exact Filter.Eventually.of_forall (fun z => mul_comm _ _) + · rw [upperExtension_zero f z hz,zero_mul] + · rw [upperExtension_zero f z (by rintro ⟨w,hw,rfl⟩; exact hz w.2), mul_zero] + +lemma upperExtension_bounded (f : C_c(UpperPlane, ℝ)) : + ∃ B : ℝ, 0≤B ∧ ∀ z∈Subtype.val '' tsupport f, ‖upperExtension f z‖≤B := by + obtain ⟨B,hB⟩ := f.hasCompactSupport.exists_bound_of_continuousOn f.continuous.continuousOn + refine ⟨max B 0, le_max_right _ _, ?_⟩ + rintro z ⟨w,hw,rfl⟩ + rw [upperExtension_apply] + exact (hB w hw).trans (le_max_left _ _) + +noncomputable def positive_mass_combination + (μ : ℕ → Measure UpperPlane) (hμ : ∀ j, IsFiniteMeasureOnCompacts (μ j)) + (s : Finset ℕ) (c : ℕ → ℝ) (hc : ∀ j∈s,0≤c j) : C_c(UpperPlane, ℝ) →ₚ[ℝ] ℝ := by + letI := hμ + exact PositiveLinearMap.mk₀ + (∑ j∈s, c j • (CompactlySupportedContinuousMap.integralPositiveLinearMap (μ j)).toLinearMap) + (by + intro f hf + simp only [LinearMap.sum_apply,LinearMap.smul_apply, + smul_eq_mul] + exact Finset.sum_nonneg (fun j hj => mul_nonneg (hc j hj) (integral_nonneg hf))) + +lemma positive_mass_combination_apply + (μ : ℕ → Measure UpperPlane) (hμ : ∀ j, IsFiniteMeasureOnCompacts (μ j)) + (s : Finset ℕ) (c : ℕ → ℝ) (hc : ∀ j∈s,0≤c j) (f : C_c(UpperPlane, ℝ)) : + positive_mass_combination μ hμ s c hc f = ∑ j∈s, c j * ∫z, f z∂μ j := by + change (∑ j∈s, c j • (CompactlySupportedContinuousMap.integralPositiveLinearMap (μ j)).toLinearMap) f = _ + simp only [LinearMap.sum_apply, LinearMap.smul_apply, smul_eq_mul] + rfl +theorem actual_radon_mass_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + ∀ᵐ b ∂W, ∃ μ : ℕ → Measure UpperPlane, + (∀ i, IsFiniteMeasureOnCompacts (μ i) ∧ (μ i).Regular) ∧ + ∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ i)) + := by + classical + obtain ⟨tests,htests⟩ := determining_tests_radon_limit UpperPlane + let F : ℕ → C_c(UpperPlane, ℝ) := fun i => tests (Nat.unpair i).2 + let K : ℕ → Set ℂ := fun i => Subtype.val '' tsupport (F i) + have hK (i : ℕ) : IsCompact (K i) := (F i).hasCompactSupport.image continuous_subtype_val + choose c hc hcz using fun i => upper_compact_lower (tsupport (F i)) (F i).hasCompactSupport + have hcK (i : ℕ) (z : ℂ) (hz : z∈K i) : c i≤2*z.im := by + obtain ⟨w,hw,rfl⟩ := hz + exact hcz i w hw + obtain ⟨X,s,coeff,v,hX,hs,hcoeff,hsum,hconv,hae⟩ := actual_common_mass_extraction a ha W hW + K (fun i => (hK i).measurableSet) (fun i => (hK i).isBounded) c hc hcK + (fun i => upperExtension (F i)) (fun i => upperExtension_measurable (F i)) + (fun i => upperExtension_bounded (F i)) (fun i => t (Nat.unpair i).1) + refine ⟨s,coeff,hs,hcoeff,hsum,?_⟩ + let q := fun j : ℕ => Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 + positive_mass_combination (fun j => actualUpperMass a (q j) (t i) b) + (hμ i) (s k) (coeff k) (hcoeff k) + have hi (i : ℕ) : ∃ μ : Measure UpperPlane, IsFiniteMeasureOnCompacts μ ∧ μ.Regular ∧ + ∀ f : C_c(UpperPlane, ℝ), Tendsto (fun k => L i k f) atTop (𝓝 (∫z,f z∂μ)) := by + apply htests (L i) + intro n + refine ⟨v (Nat.pair i n) b, ?_⟩ + have h := hb (Nat.pair i n) + simpa only [L,positive_mass_combination_apply,actualUpperMass_eval a ha _ (hq _) (hq1 _), + F,K,Nat.unpair_pair] using h + choose μ hμlim using hi + refine ⟨μ,fun i => ⟨(hμlim i).1,(hμlim i).2.1⟩,fun i f => ?_⟩ + simpa only [L,positive_mass_combination_apply] using (hμlim i).2.2 f + +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal + +lemma radon_le_of_positive_integrals {X : Type*} [TopologicalSpace X] [T2Space X] + [LocallyCompactSpace X] [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + (μ ν : Measure X) [μ.Regular] [ν.Regular] + (h : ∀ f : C_c(X, ℝ), (∀ x, 0≤f x) → ∫x,f x∂μ ≤ ∫x,f x∂ν) : μ≤ν := by + let A := CompactlySupportedContinuousMap.integralPositiveLinearMap μ + let B := CompactlySupportedContinuousMap.integralPositiveLinearMap ν + let D : C_c(X, ℝ) →ₚ[ℝ] ℝ := PositiveLinearMap.mk₀ (B.toLinearMap-A.toLinearMap) + (fun f hf => sub_nonneg.mpr (h f hf)) + let δ := RealRMK.rieszMeasure D + let : TopologicalSpace.PseudoMetrizableSpace X := inferInstance + let : SigmaCompactSpace X := inferInstance + let : IsFiniteMeasureOnCompacts δ := inferInstance + let : IsFiniteMeasureOnCompacts (μ+δ) := ⟨fun K hK => by + rw [Measure.add_apply] + exact ENNReal.add_lt_top.mpr ⟨hK.measure_lt_top,hK.measure_lt_top⟩⟩ + have he : μ+δ=ν := by + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + rw [integral_add_measure f.integrable f.integrable] + have hd : ∫x,f x∂δ=∫x,f x∂ν-∫x,f x∂μ := by + exact RealRMK.integral_rieszMeasure D f + rw [hd] + ring + rw [←he] + exact le_add_of_nonneg_right bot_le + +lemma actualUpperMass_mono_time (a q : ℝ) (b : ExactSLEGenerator.Driver) : + Monotone (fun t => actualUpperMass a q t b) := by + intro s t hst + apply withDensity_mono + filter_upwards [] with z + unfold timeMassDensity + split_ifs with hs ht + · exact le_rfl + · exact False.elim (ht (hs.trans hst)) + · exact bot_le + · exact le_rfl + +lemma ordered_radon_limits + (a : ℝ) (ha : 1/4 ∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ i))) : + ∀ i j, t i≤t j → μ i≤μ j := by + intro i j ht + let := (hμ i).1 + let := (hμ j).1 + let := (hμ i).2 + let := (hμ j).2 + apply radon_le_of_positive_integrals + intro f hf + apply le_of_tendsto_of_tendsto' (hlim i f) (hlim j f) + intro k + apply Finset.sum_le_sum + intro n hn + apply mul_le_mul_of_nonneg_left _ (hc k n hn) + have hq1 : Real.exp (-2*a*(n+1))≤1 := by + apply Real.exp_le_one_iff.mpr + have ha0 : 0 ∫z,f z∂actualUpperMass a q t b) := by + simp_rw [actualUpperMass_eval a ha q hq hq1] + exact actualMassEval_measurable a ha q hq hq1 t _ _ (upperExtension_measurable f) + + + +theorem actual_ordered_radon_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + AEStronglyMeasurable (fun b => ∫ z, f z ∂μ b i) W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + classical + obtain ⟨s,c,hs,hc,hsum,h⟩ := actual_radon_mass_extraction a ha W hW t + let P (b : ExactSLEGenerator.Driver) (μ : ℕ → Measure UpperPlane) : Prop := + (∀ i, IsFiniteMeasureOnCompacts (μ i) ∧ (μ i).Regular) ∧ + ∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ i)) + let μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane := fun b => + if H : ∃ ν, P b ν then H.choose else fun _ => 0 + have hμ (b) (i) : IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular := by + dsimp [μ] + split_ifs with H + · exact H.choose_spec.1 i + · exact ⟨inferInstance,inferInstance⟩ + have hae : ∀ᵐ b ∂W, P b (μ b) := by + filter_upwards [h] with b hb + dsimp [μ] + rw [dite_eq_left hb] + exact hb.choose_spec + refine ⟨s,c,μ,hs,hc,hsum,hμ,?_,?_⟩ + · intro i f + apply aestronglyMeasurable_of_tendsto_ae atTop + (f := fun k b => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + · intro k + suffices H : AEStronglyMeasurable (∑ j∈s k, fun b => c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) W by + convert H using 1 + funext b + simp only [Finset.sum_apply] + apply Finset.aestronglyMeasurable_sum + intro j hj + have hq1 : Real.exp (-2*a*(j+1))≤1 := by + apply Real.exp_le_one_iff.mpr + have ha0 : 0 b.1 t) W) + (m : ℕ) (hm : 1 ≤ m) + (K : Set ℂ) (hK : MeasurableSet K) (hKb : Bornology.IsBounded K) + (c : ℝ) (hc : 0 ‖f z‖) hf.norm + (fun _ _ => norm_nonneg _) hfB + let A := ∫⁻ x : Fin m → ℂ, (∏ i, ENNReal.ofReal ‖f (x i)‖)* + ExactSLEKernel.kernel (alpha a) c x ∂Measure.pi (fun _ => volume.restrict K) + let D := (ENNReal.ofReal C*A)^(1/(m:ℝ)) + have hD : D<∞ := ENNReal.rpow_lt_top_of_nonneg (by positivity) (ENNReal.mul_lt_top ENNReal.ofReal_lt_top hAfin).ne + refine ⟨D,hD,?_⟩ + intro q hq hq1 t + have hnorm : eLpNorm (actualMassEval a q t K f) (m : ℝ≥0∞) W≤D := by + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal (by exact_mod_cast (Nat.ne_zero_of_lt hm)) + (by simp) (actualMassEval_measurable a ha q hq hq1 t K f hf).aestronglyMeasurable] + rw [ENNReal.toReal_natCast] + apply ENNReal.rpow_le_rpow _ (by positivity) + calc + _ ≤ ∫⁻ b, (∫⁻ z in K, ENNReal.ofReal ‖f z‖*massDensity a q b z)^m ∂W := by + apply lintegral_mono + intro b + change ‖actualMassEval a q t K f b‖ₑ^(m:ℝ) ≤ + (∫⁻ z in K, ENNReal.ofReal ‖f z‖*massDensity a q b z)^m + rw [ENNReal.rpow_natCast] + exact pow_le_pow_left' (actualMassEval_enorm_bound a q t K f b) m + _ ≤ _ := hB q hq hq1 + exact ⟨hnorm.trans_lt hD,hnorm⟩ + +lemma convex_eLpNorm_bound {Ω : Type*} [MeasurableSpace Ω] (W : Measure Ω) + (p C : ℝ≥0∞) (hp : 1≤p) (s : Finset ℕ) (c : ℕ → ℝ) + (hc : ∀ j∈s, 0≤c j) (hsum : ∑ j∈s,c j=1) + (F : ℕ → Ω → ℝ) (_hF : ∀ j∈s, AEStronglyMeasurable (F j) W) + (hbound : ∀ j∈s, eLpNorm (F j) p W≤C) : + eLpNorm (fun b => ∑ j∈s,c j*F j b) p W≤C := by + have he : (fun b => ∑ j∈s,c j*F j b) = ∑ j∈s,c j • F j := by + funext b + simp only [Finset.sum_apply,Pi.smul_apply,smul_eq_mul] + rw [he] + calc + _ ≤ ∑ j∈s,eLpNorm (c j • F j) p W := + eLpNorm_sum_le hp + _ = ∑ j∈s,ENNReal.ofReal (c j)*eLpNorm (F j) p W := by + apply Finset.sum_congr rfl + intro j hj + rw [eLpNorm_const_smul,←ofReal_norm,Real.norm_eq_abs,abs_of_nonneg (hc j hj)] + _ ≤ ∑ j∈s,ENNReal.ofReal (c j)*C := by + apply Finset.sum_le_sum + intro j hj + gcongr + exact hbound j hj + _ = C := by + rw [←Finset.sum_mul,←ENNReal.ofReal_sum_of_nonneg hc,hsum,ENNReal.ofReal_one,one_mul] + +lemma actualUpperMass_Lp_bound (a : ℝ) (ha : 1/4 b.1 t) W) + (m : ℕ) (hm : 1 ≤ m) (f : C_c(UpperPlane, ℝ)) : + ∃ C : ℝ≥0∞, C<∞ ∧ ∀ q : ℝ, 0 ∫z,f z∂actualUpperMass a q t b) (m : ℝ≥0∞) W ∧ + eLpNorm (fun b => ∫z,f z∂actualUpperMass a q t b) (m : ℝ≥0∞) W ≤ C := by + let K := Subtype.val '' tsupport f + have hK : IsCompact K := f.hasCompactSupport.image continuous_subtype_val + obtain ⟨c,hc,hcz⟩ := upper_compact_lower (tsupport f) f.hasCompactSupport + have hcK (z : ℂ) (hz : z∈K) : c≤2*z.im := by + obtain ⟨w,hw,rfl⟩ := hz + exact hcz w hw + obtain ⟨C,hC,h⟩ := actualMassEval_Lp_bound a ha W hW m hm K hK.measurableSet hK.isBounded + c hc hcK (upperExtension f) (upperExtension_measurable f) (upperExtension_bounded f) + refine ⟨C,hC,fun q hq hq1 t => ?_⟩ + simpa only [actualUpperMass_eval a ha q hq hq1] using h q hq hq1 t + +lemma actual_radon_limit_memLp (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0∞) (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤coeff k j) (hsum : ∀ k, ∑ j∈s k,coeff k j=1) + (μ : ExactSLEGenerator.Driver → Measure UpperPlane) + (f : C_c(UpperPlane, ℝ)) + (hlim : ∀ᵐ b ∂W, Tendsto (fun k => ∑ j∈s k,coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) t b) atTop (𝓝 (∫z,f z∂μ b))) + (m : ℕ) : MemLp (fun b => ∫z,f z∂μ b) (m : ℝ≥0∞) W := by + let q (j : ℕ) := Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 + ∑ j∈s k,coeff k j * ∫z,f z∂actualUpperMass a (q j) t b + have hF (k : ℕ) : AEStronglyMeasurable (F k) W := by + have H := Finset.aestronglyMeasurable_sum (μ := W) (s k) (fun j hj => + (actualUpperMass_eval_measurable a ha (q j) (hq j) (hq1 j) t f).aestronglyMeasurable.const_mul (coeff k j)) + convert H using 1 + funext b + simp only [F,Finset.sum_apply] + have hmeas : AEStronglyMeasurable (fun b => ∫z,f z∂μ b) W := + aestronglyMeasurable_of_tendsto_ae atTop hF hlim + by_cases hm : m=0 + · simpa [hm] using (memLp_zero_iff_aestronglyMeasurable.mpr hmeas) + have hmpos : 1 ≤ m := Nat.one_le_iff_ne_zero.mpr hm + obtain ⟨C,hC,hCb⟩ := actualUpperMass_Lp_bound a ha W hW m hmpos f + have hbound (k : ℕ) : eLpNorm (F k) (m : ℝ≥0∞) W≤C := + convex_eLpNorm_bound W _ C (by exact_mod_cast hmpos) (s k) (coeff k) (hc k) (hsum k) + (fun j b => ∫z,f z∂actualUpperMass a (q j) t b) + (fun j hj => (hCb (q j) (hq j) (hq1 j) t).1.aestronglyMeasurable) + (fun j hj => (hCb (q j) (hq j) (hq1 j) t).2) + exact (Lp.eLpNorm_le_of_ae_tendsto (Filter.Eventually.of_forall hbound) hF hmeas hlim).trans_lt hC + + + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/LoewnerScaling.lean b/lean/OAI/Probability/SLEGauge/LoewnerScaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..139d0619283fc88e384b6c3b133488e70850cceb --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/LoewnerScaling.lean @@ -0,0 +1,481 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.GaugeBounds +import OAI.Probability.SLEGauge.InitialTrace +import OAI.Probability.SLEGauge.AngleGenerators + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerScaling +open ExactSLEMain ExactSLEGreen + + +def scaled (c : ℝ≥0) (b : ℝ≥0 → ℝ) (t : ℝ≥0) : ℝ := + (c : ℝ)⁻¹ * b (c^2*t) + +@[simp] lemma scaled_scaled {c : ℝ≥0} (hc : c≠0) (b : ℝ≥0 → ℝ) : + scaled c⁻¹ (scaled c b)=b := by + ext t + simp only [scaled, NNReal.coe_inv, inv_inv, inv_pow] + have htime : c^2*(c^2)⁻¹*t=t := by rw [mul_inv_cancel₀ (pow_ne_zero _ hc),one_mul] + simp only [←mul_assoc,htime,mul_inv_cancel₀ (NNReal.coe_ne_zero.mpr hc),one_mul] + +lemma scaled_continuous (c : ℝ≥0) {b : ℝ≥0 → ℝ} (hb : Continuous b) : + Continuous (scaled c b) := continuous_const.mul (hb.comp (continuous_const.mul continuous_id)) + + +def scaleDriver (c : ℝ≥0) (b : ExactSLEGenerator.Driver) : ExactSLEGenerator.Driver := + ⟨⟨scaled c b.1,scaled_continuous c b.1.continuous⟩,by simp [scaled,b.2]⟩ + +@[simp] lemma scaleDriver_apply (c : ℝ≥0) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + (scaleDriver c b).1 t=(c:ℝ)⁻¹*b.1 (c^2*t) := rfl + +@[simp] lemma scaleDriver_inv {c : ℝ≥0} (hc : c≠0) (b : ExactSLEGenerator.Driver) : + scaleDriver c⁻¹ (scaleDriver c b)=b := by + apply Subtype.ext + apply ContinuousMap.ext + exact congrFun (scaled_scaled hc b.1) + +lemma continuous_scaleDriver (c : ℝ≥0) : Continuous (scaleDriver c) := by + apply Continuous.subtype_mk + apply ContinuousMap.continuous_of_continuous_uncurry + change Continuous (fun p : ExactSLEGenerator.Driver × ℝ≥0 => + (c:ℝ)⁻¹*p.1.1 (c^2*p.2)) + exact continuous_const.mul (continuous_eval.comp + ((continuous_subtype_val.comp continuous_fst).prodMk (continuous_const.mul continuous_snd))) + +lemma odeUntil_scaled {a : ℝ} {c : ℝ≥0} (hc : 0 ((c:ℝ):ℂ)⁻¹*f ((c:ℝ)^2*u)) := by + have hcR : 0<(c:ℝ) := hc + have hcC : ((c:ℝ):ℂ)≠0 := Complex.ofReal_ne_zero.mpr hcR.ne' + refine ⟨?_,fun u hu => ?_⟩ + · simp only [mul_zero,hf.1,←mul_assoc,inv_mul_cancel₀ hcC,one_mul] + have hmaps : MapsTo (fun u : ℝ => (c:ℝ)^2*u) (Icc 0 (t:ℝ)) + (Icc 0 ((c^2*t:ℝ≥0):ℝ)) := by + intro v hv + simp only [NNReal.coe_mul,NNReal.coe_pow,mem_Icc] + exact ⟨mul_nonneg (sq_nonneg _) hv.1,mul_le_mul_of_nonneg_left hv.2 (sq_nonneg _)⟩ + have hnn : ((c:ℝ)^2*u).toNNReal=c^2*u.toNNReal := by + apply NNReal.coe_injective + simp only [NNReal.coe_mul,NNReal.coe_pow, + Real.coe_toNNReal _ (mul_nonneg (sq_nonneg _) hu.1),Real.coe_toNNReal _ hu.1] + constructor + · simpa [←Complex.ofReal_inv,Complex.mul_im] using + mul_pos (inv_pos.mpr hcR) (hf.2 _ (hmaps hu)).1 + · have hd := (hf.2 _ (hmaps hu)).2.scomp u + ((hasDerivAt_id u).const_mul ((c:ℝ)^2)).hasDerivWithinAt hmaps + have hd' := hd.const_mul ((c:ℝ):ℂ)⁻¹ + convert! hd' using 1 + change (a:ℂ) / (((c:ℝ):ℂ)⁻¹*f ((c:ℝ)^2*u) - + (((c:ℝ)⁻¹*b (c^2*u.toNNReal):ℝ):ℂ)) = _ + rw [hnn] + simp only [Complex.ofReal_mul,Complex.ofReal_inv,Complex.real_smul,Complex.ofReal_pow] + field_simp + norm_num + +lemma alive_scaled_iff (a : ℝ) {c : ℝ≥0} (hc : 0 ((c:ℝ):ℂ)⁻¹* + (loewnerMap a b (c^2*t) ∘ fun w => ((c:ℝ):ℂ)*w) w) = + loewnerMap a (scaled c b) t := by + funext w + exact (loewnerMap_scaled a hc b t w).symm + rw [hf] at hder + rw [hder.deriv,(hasDerivAt_loewnerMap hb h).deriv] + simp only [mul_one] + field_simp [Complex.ofReal_ne_zero.mpr (NNReal.coe_ne_zero.mpr hc.ne')] + +lemma actualState_scaled (a : ℝ) {c : ℝ≥0} (hc : 0 b.1 t) (W.map driverHomeomorph) where + hasLaw I := by + refine ⟨(Measurable.of_eval (fun t : I => + (ExactSLEGenerator.driver_eval_measurable t).measurable)).aemeasurable,?_⟩ + change (W.map driverHomeomorph).map (fun b : GDriver => fun t : I => b.1 t)=_ + rw [Measure.map_map (Measurable.of_eval (fun t : I => + (ExactSLEGenerator.driver_eval_measurable t).measurable)) measurable_driverHomeomorph] + exact (hW.hasLaw I).map_eq + cont := Eventually.of_forall (fun b => b.1.continuous) + +lemma positiveSolution_iff (κ : ℝ) (b : TDriver) (z : ℂ) (t : ℝ≥0) (f : ℝ → ℂ) : + LiteralTrace.PositiveSolution κ b z t f ↔ + ExactSLEMain.odeUntil (Target.a κ) (driverHomeomorph b).1 z t f := by + constructor + · intro hf + exact ⟨hf.2.2.1,fun u hu => ⟨hf.2.2.2.1 u hu,hf.2.2.2.2 u hu⟩⟩ + · intro hf + exact ⟨t.coe_nonneg,ExactSLEMain.odeUntil_continuousOn hf,hf.1, + fun u hu => (hf.2 u hu).1,fun u hu => (hf.2 u hu).2⟩ + +lemma eulerSteps_eq (κ : ℝ) (b : TDriver) (j N : ℕ) (z : ℂ) (k : ℕ) : + Target.eulerSteps κ b j N z k=LiteralTrace.eulerSteps κ b j N z k := by + induction k with + | zero => rfl + | succ k ih => + simp only [Target.eulerSteps,LiteralTrace.eulerSteps,ih] + rfl + +lemma eulerFlow_eq (κ : ℝ) (b : TDriver) (j N : ℕ) (z : ℂ) (t : ℝ) : + Target.eulerFlow κ b j N z t=LiteralTrace.eulerFlow κ b j N z t := by + simp only [Target.eulerFlow,LiteralTrace.eulerFlow,eulerSteps_eq] + rfl + +lemma cutoffFlow_eq (κ : ℝ) (b : TDriver) (j : ℕ) (z : ℂ) (t : ℝ) : + Target.cutoffFlow κ b j z t=LiteralTrace.cutoffFlow κ b j z t := by + simp only [Target.cutoffFlow,LiteralTrace.cutoffFlow,eulerFlow_eq] + +lemma surviving_eq (κ : ℝ) (b : TDriver) (z : ℂ) (t : ℝ) : + Target.Surviving κ b z t = LiteralTrace.Surviving κ b z t := by + simp only [Target.Surviving,LiteralTrace.Surviving,cutoffFlow_eq] + +lemma surviving_iff_alive (κ : ℝ) (b : TDriver) (z : ℂ) (t : ℝ≥0) : + Target.Surviving κ b z t ↔ ExactSLEMain.alive (Target.a κ) (driverHomeomorph b).1 t z := by + rw [surviving_eq,LiteralTrace.surviving_iff_positiveSolution t.coe_nonneg] + exact exists_congr (positiveSolution_iff κ b z t) + +lemma flow_eq_literal (κ : ℝ) (b : TDriver) (z : ℂ) (t : ℝ) : + Target.flow κ b z t=LiteralTrace.flow κ b z t := by + classical + unfold Target.flow LiteralTrace.flow + split_ifs with ht hl hl + · have he : Nat.find ht=Nat.find hl := by + apply le_antisymm + · apply Nat.find_min' ht + simpa only [cutoffFlow_eq] using Nat.find_spec hl + · apply Nat.find_min' hl + simpa only [cutoffFlow_eq] using Nat.find_spec ht + rw [he,cutoffFlow_eq] + · exact False.elim (hl ((surviving_eq κ b z t).mp ht)) + · exact False.elim (ht ((surviving_eq κ b z t).mpr hl)) + · rfl + +lemma flow_eq_loewnerMap (κ : ℝ) (b : TDriver) (z : ℂ) (t : ℝ≥0) : + Target.flow κ b z t=ExactSLEMain.loewnerMap (Target.a κ) (driverHomeomorph b).1 t z := by + by_cases ht : Target.Surviving κ b z t + · have ht' : LiteralTrace.Surviving κ b z t := (surviving_eq κ b z t).mp ht + have hp := LiteralTrace.surviving_flow_positiveSolution t.coe_nonneg ht' + rw [flow_eq_literal] + exact (ExactSLEMain.loewnerMap_eq ((positiveSolution_iff κ b z t _).mp hp)).symm + · have hn : ¬ExactSLEMain.alive (Target.a κ) (driverHomeomorph b).1 t z := + fun h => ht ((surviving_iff_alive κ b z t).mpr h) + simp [Target.flow,ExactSLEMain.loewnerMap,ht,hn] + +lemma flow_eq_loewnerMap_real (κ : ℝ) (b : TDriver) (z : ℂ) {t : ℝ} (ht : 0 ≤ t) : + Target.flow κ b z t=ExactSLEMain.loewnerMap (Target.a κ) (driverHomeomorph b).1 t.toNNReal z := by + simpa only [Real.coe_toNNReal _ ht] using flow_eq_loewnerMap κ b z t.toNNReal + +lemma inverseFlow_eq_literal (κ : ℝ) (b : TDriver) (t : ℝ) (w : ℂ) : + Target.inverseFlow κ b t w=LiteralTrace.inverseFlow κ b t w := by + classical + have he : (fun z : ℂ => Target.Surviving κ b z t ∧ Target.flow κ b z t=w)= + (fun z : ℂ => LiteralTrace.Surviving κ b z t ∧ LiteralTrace.flow κ b z t=w) := by + funext z + rw [surviving_eq,flow_eq_literal] + unfold Target.inverseFlow LiteralTrace.inverseFlow + rw [he] + +lemma trace_eq_literal (κ : ℝ) (b : TDriver) : + Target.trace κ b=LiteralTrace.trace κ b := by + funext t + simp only [Target.trace,LiteralTrace.trace,inverseFlow_eq_literal] + rfl + + + +theorem trace_regular_actual_domains {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : Measure TDriver} (hW : Target.IsWiener W) : + ∀ᵐ b ∂W, + ContinuousOn (Target.trace κ b) (Ici 0) ∧ + (∀ t : ℝ, 0 ≤ t → Target.trace κ b t ∈ + frontier {z | ExactSLEMain.alive (Target.a κ) (driverHomeomorph b).1 (κ*t).toNNReal z}) ∧ + (∀ s : ℝ, 0 ≤ s → (Target.trace κ b) '' Ici s ⊆ + closure {z | ExactSLEMain.alive (Target.a κ) (driverHomeomorph b).1 (κ*s).toNNReal z}) := by + have hdomain (b : TDriver) (t : ℝ) (ht : 0 ≤ t) : + {z | LiteralTrace.Surviving κ b z (κ*t)}= + {z | ExactSLEMain.alive (Target.a κ) (driverHomeomorph b).1 (κ*t).toNNReal z} := by + ext z + simp only [Set.mem_ofPred_eq] + simpa only [surviving_eq,Real.coe_toNNReal _ (mul_nonneg hκ.le ht)] using + surviving_iff_alive κ b z (κ*t).toNNReal + filter_upwards [LiteralTrace.trace_regular_all_times hκ hκ8 hW] with b hb + simp only [trace_eq_literal] + refine ⟨hb.2.1,?_,?_⟩ + · intro t ht + rw [←hdomain b t ht] + exact hb.2.2.1 t ht + · intro s hs + rw [←hdomain b s hs] + exact hb.2.2.2 s hs + +end SLEExactGauge.FlowIdentification +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerScaling +open FlowIdentification + +lemma brownian_map_inverse_driver (W : Measure GDriver) + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) : + Target.IsWiener (W.map driverHomeomorph.symm) where + hasLaw I := by + refine ⟨(Measurable.of_eval (fun t : I => + (continuous_eval_const (t:ℝ≥0)).measurable)).aemeasurable,?_⟩ + change (W.map driverHomeomorph.symm).map + (fun b : TDriver => fun t : I => b t)=_ + rw [Measure.map_map (Measurable.of_eval (fun t : I => + (continuous_eval_const (t:ℝ≥0)).measurable)) measurable_driverHomeomorph_symm] + exact (hW.hasLaw I).map_eq + cont := Eventually.of_forall (fun b => b.continuous) + +lemma brownian_evaluation_law_unique {W V : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (hV : IsBrownianReal (fun t (b : GDriver) => b.1 t) V) : W=V := by + apply driverMeasurableEquiv.symm.measurableEmbedding.map_injective + exact BrownianLaw.evaluation_law_unique (brownian_map_inverse_driver W hW) + (brownian_map_inverse_driver V hV) + +lemma brownian_scaled {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {c : ℝ≥0} (hc : 0 (scaleDriver c b).1 t) W := by + simpa [scaleDriver_apply,Real.sqrt_sq c.coe_nonneg] using hW.smul (pow_ne_zero 2 hc.ne') + +lemma brownian_map_scaled {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {c : ℝ≥0} (hc : 0 b.1 t) (W.map (scaleDriver c)) where + hasLaw I := by + refine ⟨(Measurable.of_eval (fun t : I => + (ExactSLEGenerator.driver_eval_measurable t).measurable)).aemeasurable,?_⟩ + change (W.map (scaleDriver c)).map (fun b : GDriver => fun t : I => b.1 t)=_ + rw [Measure.map_map (Measurable.of_eval (fun t : I => + (ExactSLEGenerator.driver_eval_measurable t).measurable)) (continuous_scaleDriver c).measurable] + exact ((brownian_scaled hW hc).hasLaw I).map_eq + cont := Eventually.of_forall (fun b => b.1.continuous) + +lemma map_scaleDriver_eq {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {c : ℝ≥0} (hc : 0 b.1 t) W) + {c : ℝ≥0} (hc : 0 if u ≤ s then f u else g (u-s)+(b s : ℂ)) := by + classical + let k : ℝ → ℂ := fun u => if u ≤ s then f u else g (u-s)+(b s : ℂ) + have hk₁ : EqOn k f (Icc 0 (s:ℝ)) := fun u hu => ite_eq_left hu.2 + have hk₂ : EqOn k (fun u => g (u-s)+(b s : ℂ)) (Icc (s:ℝ) (s+t)) := by + intro u hu + dsimp only [k] + split_ifs with h + · have he : u=(s:ℝ) := le_antisymm h hu.1 + simp only [he,sub_self,hg.1,sub_add_cancel] + · rfl + have hmaps : MapsTo (fun u : ℝ => u-s) (Icc (s:ℝ) (s+t)) (Icc 0 (t:ℝ)) := by + intro u hu + constructor <;> linarith [hu.1,hu.2] + have hd₁ (u : ℝ) (hu : u ∈ Icc 0 (s:ℝ)) : + HasDerivWithinAt k ((a:ℂ)/(k u-(b u.toNNReal:ℂ))) (Icc 0 (s:ℝ)) u := by + rw [hk₁ hu] + exact (hf.2 u hu).2.congr_of_mem hk₁ hu + have hd₂ (u : ℝ) (hu : u ∈ Icc (s:ℝ) (s+t)) : + HasDerivWithinAt k ((a:ℂ)/(k u-(b u.toNNReal:ℂ))) (Icc (s:ℝ) (s+t)) u := by + have hnn : s+(u-(s:ℝ)).toNNReal=u.toNNReal := by + apply NNReal.coe_injective + rw [NNReal.coe_add,Real.coe_toNNReal _ (sub_nonneg.mpr hu.1), + Real.coe_toNNReal _ (s.coe_nonneg.trans hu.1)] + ring + have h := ((hg.2 _ (hmaps hu)).2.scomp u + ((hasDerivAt_id u).sub_const (s:ℝ)).hasDerivWithinAt hmaps).add_const (b s:ℂ) + simp only [one_smul,shiftDriver,hnn,Complex.ofReal_sub] at h + rw [hk₂ hu] + convert h.congr_of_mem hk₂ hu using 1; congr 1; ring + refine ⟨by change k 0=z; rw [hk₁ (by simp),hf.1],fun u hu => ?_⟩ + have hu' : u ∈ Icc 0 ((s:ℝ)+t) := hu + change 0<(k u).im ∧ HasDerivWithinAt k _ _ u + constructor + · by_cases hs : u≤(s:ℝ) + · rw [hk₁ ⟨hu.1,hs⟩] + exact (hf.2 u ⟨hu.1,hs⟩).1 + · have hu₂ : u ∈ Icc (s:ℝ) (s+t) := ⟨(le_of_not_ge hs),hu.2⟩ + rw [hk₂ hu₂] + simpa only [Complex.add_im,Complex.ofReal_im,add_zero] using (hg.2 _ (hmaps hu₂)).1 + · rcases lt_trichotomy u (s:ℝ) with hs | hs | hs + · apply (hd₁ u ⟨hu.1,hs.le⟩).mono_of_mem_nhdsWithin + filter_upwards [self_mem_nhdsWithin, + nhdsWithin_le_nhds (Iio_mem_nhds hs)] with v hv hvs + exact ⟨hv.1,hvs.le⟩ + · subst u + have h := (hd₁ (s:ℝ) ⟨s.coe_nonneg,le_rfl⟩).union + (hd₂ (s:ℝ) ⟨le_rfl,le_add_of_nonneg_right t.coe_nonneg⟩) + rw [Icc_union_Icc_eq_Icc s.coe_nonneg (le_add_of_nonneg_right t.coe_nonneg)] at h + exact h + · apply (hd₂ u ⟨hs.le,hu.2⟩).mono_of_mem_nhdsWithin + filter_upwards [self_mem_nhdsWithin, + nhdsWithin_le_nhds (Ioi_mem_nhds hs)] with v hv hsv + exact ⟨hsv.le,hv.2⟩ + + +theorem alive_restart_iff (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (s t : ℝ≥0) : + alive a b (s+t) z ↔ alive a b s z ∧ + alive a (shiftDriver b s) t (loewnerMap a b s z-(b s:ℂ)) := by + constructor + · intro h + exact ⟨alive_mono h (by exact le_add_of_nonneg_right bot_le), + (loewnerMap_restart a b z s t h).1⟩ + · rintro ⟨⟨f,hf⟩,g,hg⟩ + rw [loewnerMap_eq hf] at hg + exact ⟨_,odeUntil_join hf hg⟩ + +lemma continuous_shiftDriver {b : ℝ≥0 → ℝ} (hb : Continuous b) (s : ℝ≥0) : + Continuous (shiftDriver b s) := + (hb.comp (continuous_const.add continuous_id)).sub continuous_const + + + +lemma deriv_loewnerMap_restart {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {s t : ℝ≥0} (hz : alive a b (s+t) z) : + deriv (loewnerMap a b (s+t)) z = + deriv (loewnerMap a (shiftDriver b s) t) (loewnerMap a b s z-(b s:ℂ)) * + deriv (loewnerMap a b s) z := by + have hs := (alive_restart_iff a b z s t).mp hz + have hd := ((hasDerivAt_loewnerMap (continuous_shiftDriver hb s) hs.2).comp z + ((hasDerivAt_loewnerMap hb hs.1).sub_const (b s:ℂ))).add_const (b s:ℂ) + have he : (fun w => loewnerMap a (shiftDriver b s) t (loewnerMap a b s w-(b s:ℂ))+(b s:ℂ)) + =ᶠ[𝓝 z] loewnerMap a b (s+t) := by + filter_upwards [(isOpen_alive hb (s+t)).mem_nhds hz] with w hw + rw [(loewnerMap_restart a b w s t hw).2,sub_add_cancel] + rw [(hd.congr_of_eventuallyEq he.symm).deriv, + (hasDerivAt_loewnerMap hb hs.1).deriv, + (hasDerivAt_loewnerMap (continuous_shiftDriver hb s) hs.2).deriv] + +end ExactSLEMain +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/LoewnerSolutions.lean b/lean/OAI/Probability/SLEGauge/LoewnerSolutions.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bf971cf8d78412656956bb2e20088b033d7cfaa --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/LoewnerSolutions.lean @@ -0,0 +1,416 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.BrownianMartingales + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +namespace ExactSLEMain +theorem loewner_local_existence (A : ℝ) (b : ℝ≥0 → ℝ) (hb : Continuous b) + (z : ℂ) (hz : 0 < z.im) : ∃ t : ℝ≥0, 0 < t ∧ alive A b t z := by + let ε : ℝ := z.im / 2 + have hε : 0 < ε := by dsimp [ε]; positivity + let L : ℝ := (|A| + 1) / ε + have hL : 0 < L := div_pos (by positivity) hε + let τ : ℝ := ε / L + have hτ : 0 < τ := div_pos hε hL + let v : ℝ → ℂ → ℂ := fun u x => (A : ℂ) / (x - (b u.toNNReal : ℂ)) + have hheight : ∀ x ∈ Metric.closedBall z ε, ε ≤ x.im := by + intro x hx + have hx' : ‖x - z‖ ≤ ε := by simpa only [Metric.mem_closedBall, dist_eq_norm] using hx + have hh := Complex.im_le_norm (z - x) + rw [Complex.sub_im, norm_sub_rev] at hh + dsimp [ε] at * + linarith + let εn : ℝ≥0 := ⟨ε, hε.le⟩ + let Ln : ℝ≥0 := ⟨L, hL.le⟩ + let Kn : ℝ≥0 := ⟨|A| / ε ^ 2, by positivity⟩ + let t₀ : Set.Icc (0 : ℝ) τ := ⟨0, ⟨le_rfl, hτ.le⟩⟩ + have hp : IsPicardLindelof v t₀ z εn 0 Ln Kn := by + constructor + · intro u hu + apply LipschitzOnWith.of_dist_le_mul + intro x hx y hy + rw [dist_eq_norm, dist_eq_norm] + exact loewner_vector_difference A (b u.toNNReal) ε hε x y (hheight x hx) (hheight y hy) + · intro x hx + apply Continuous.continuousOn + apply Continuous.div continuous_const + (continuous_const.sub (Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal))) + intro u + have hi : 0 < (x - (b u.toNNReal : ℂ)).im := by + simpa using hε.trans_le (hheight x hx) + intro he + change x - (b u.toNNReal : ℂ) = 0 at he + rw [he] at hi + simp at hi + · intro u hu x hx + change ‖(A : ℂ) / (x - (b u.toNNReal : ℂ))‖ ≤ L + have hlo : ε ≤ ‖x - (b u.toNNReal : ℂ)‖ := by + calc + ε ≤ x.im := hheight x hx + _ = (x - (b u.toNNReal : ℂ)).im := by simp + _ ≤ _ := Complex.im_le_norm _ + rw [norm_div, Complex.norm_real, Real.norm_eq_abs] + calc + |A| / ‖x - (b u.toNNReal : ℂ)‖ ≤ |A| / ε := + div_le_div_of_nonneg_left (abs_nonneg _) hε hlo + _ ≤ (|A| + 1) / ε := by gcongr; linarith + · change L * max (τ - 0) (0 - 0) ≤ εn - (0 : ℝ≥0) + simp only [sub_zero, max_eq_left hτ.le, NNReal.coe_zero, εn] + dsimp [τ] + rw [mul_div_cancel₀ _ hL.ne'] + exact le_rfl + have hx : z ∈ Metric.closedBall z (0 : ℝ≥0) := by simp + obtain ⟨f, hf⟩ := ODE.FunSpace.exists_isFixedPt_next hp hx + have hinit : f.compProj t₀ = z := by + rw [ODE.FunSpace.compProj_val, ← hf, ODE.FunSpace.next_apply₀] + have hderiv : ∀ u ∈ Set.Icc (0 : ℝ) τ, + HasDerivWithinAt f.compProj (v u (f.compProj u)) (Set.Icc 0 τ) u := by + intro u hu + apply ODE.hasDerivWithinAt_picard_Icc t₀.2 hp.continuousOn_uncurry + f.continuous_compProj.continuousOn + (fun _ _ => f.compProj_mem_closedBall hp.mul_max_le) z hu |>.congr_of_mem _ hu + intro u' hu' + nth_rw 1 [← hf] + rw [ODE.FunSpace.compProj_of_mem hu', ODE.FunSpace.next_apply] + refine ⟨⟨τ, hτ.le⟩, hτ, f.compProj, hinit, ?_⟩ + intro u hu + refine ⟨hε.trans_le (hheight _ (f.compProj_mem_closedBall hp.mul_max_le)), hderiv u hu⟩ + +end ExactSLEMain + + + +open MeasureTheory Filter Set Metric Function ODE +open scoped NNReal Topology + +namespace ExactSLEMain +open Set Metric + + +def heightClamp (ε : ℝ) (z : ℂ) : ℂ := ⟨z.re, max ε z.im⟩ + +lemma heightClamp_eq {ε : ℝ} {z : ℂ} (hz : ε ≤ z.im) : heightClamp ε z = z := by + apply Complex.ext <;> simp [heightClamp, max_eq_right hz] + +lemma heightClamp_lipschitz (ε : ℝ) : LipschitzWith 2 (heightClamp ε) := by + apply LipschitzWith.of_dist_le_mul + intro z w + rw [dist_eq_norm, dist_eq_norm] + have hIm : LipschitzWith 1 Complex.im := LipschitzWith.of_dist_le_mul (fun z w => by + simpa only [Real.dist_eq, dist_eq_norm, Real.norm_eq_abs, NNReal.coe_one, _root_.one_mul, Complex.sub_im] using + Complex.abs_im_le_norm (z-w)) + have him := (hIm.const_max ε).dist_le_mul z w + have hre := Complex.abs_re_le_norm (z-w) + have him' : |max ε z.im - max ε w.im| ≤ ‖z-w‖ := by + simpa only [Real.dist_eq, dist_eq_norm, Real.norm_eq_abs, NNReal.coe_one, _root_.one_mul] using him + calc + ‖heightClamp ε z - heightClamp ε w‖ ≤ + |(heightClamp ε z - heightClamp ε w).re| + |(heightClamp ε z - heightClamp ε w).im| := + Complex.norm_le_abs_re_add_abs_im _ + _ ≤ ‖z-w‖ + ‖z-w‖ := add_le_add hre him' + _ = (2 : ℝ≥0) * ‖z-w‖ := by norm_num; ring + +noncomputable def cutoffVector (A ε : ℝ) (z : ℂ) : ℂ := (A : ℂ) / heightClamp ε z + +lemma cutoffVector_bound (A ε : ℝ) (hε : 0 < ε) (z : ℂ) : + ‖cutoffVector A ε z‖ ≤ |A|/ε := by + rw [cutoffVector, norm_div, Complex.norm_real, Real.norm_eq_abs] + exact div_le_div_of_nonneg_left (abs_nonneg _) hε + ((show ε ≤ (heightClamp ε z).im from le_max_left _ _).trans (Complex.im_le_norm _)) + +lemma cutoffVector_lipschitz (A ε : ℝ) (hε : 0 < ε) : + LipschitzWith ⟨2*|A|/ε^2, by positivity⟩ (cutoffVector A ε) := by + apply LipschitzWith.of_dist_le_mul + intro z w + rw [dist_eq_norm, dist_eq_norm] + have hv := loewner_vector_difference A 0 ε hε (heightClamp ε z) (heightClamp ε w) + (le_max_left _ _) (le_max_left _ _) + simp only [Complex.ofReal_zero, sub_zero] at hv + calc + ‖cutoffVector A ε z - cutoffVector A ε w‖ ≤ + (|A|/ε^2)*‖heightClamp ε z - heightClamp ε w‖ := hv + _ ≤ (|A|/ε^2)*(2*‖z-w‖) := mul_le_mul_of_nonneg_left + (by simpa only [dist_eq_norm, NNReal.coe_ofNat] using (heightClamp_lipschitz ε).dist_le_mul z w) + (by positivity) + _ = _ := by change _ = (2*|A|/ε^2)*‖z-w‖; ring + + + +theorem exists_cutoff_loewner (A ε : ℝ) (hε : 0 < ε) (b : ℝ≥0 → ℝ) + (hb : Continuous b) : + ∃ F : ℝ≥0 → ℂ → ℂ, + (∀ z, Continuous (fun t => F t z)) ∧ + (∀ z t, F t z = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal z - (b u.toNNReal : ℂ))) := by + let L : ℝ≥0 := ⟨|A|/ε, by positivity⟩ + let K : ℝ≥0 := ⟨2*|A|/ε^2, by positivity⟩ + have hu : ∀ z : ℂ, Continuous (fun t : ℝ≥0 => -(b t : ℂ)) := + fun _ => (Complex.continuous_ofReal.comp hb).neg + obtain ⟨F,hFc,hFm,hFe⟩ := ExactSLEFlow.measurable_additive_flow + (cutoffVector A ε) L K (cutoffVector_lipschitz A ε hε) + (cutoffVector_bound A ε hε) (fun t (_ : ℂ) => -(b t : ℂ)) hu + (fun _ => measurable_const) id measurable_id + exact ⟨F,hFc,by simpa only [id_eq, sub_eq_add_neg] using hFe⟩ + +lemma cutoff_loewner_hasDerivWithinAt {A ε : ℝ} (hε : 0 < ε) + {b : ℝ≥0 → ℝ} (hb : Continuous b) {F : ℝ≥0 → ℂ → ℂ} + (hFc : ∀ z, Continuous (fun t => F t z)) + (hFe : ∀ z t, F t z = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal z - (b u.toNNReal : ℂ))) + (z : ℂ) (T : ℝ≥0) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun u : ℝ => F u.toNNReal z) + (cutoffVector A ε (F t.toNNReal z - (b t.toNNReal : ℂ))) (Icc (0 : ℝ) T) t := by + simpa only [sub_eq_add_neg, Function.comp_def, Pi.neg_apply] using + ExactSLEFlow.integral_flow_hasDerivWithinAt (cutoffVector_lipschitz A ε hε).continuous + ((Complex.continuous_ofReal.comp hb).neg) (hFc z) (by + simpa only [sub_eq_add_neg, Function.comp_def, Pi.neg_apply] using hFe z) T t ht + +lemma cutoff_loewner_dist {A ε : ℝ} (hε : 0 < ε) + {b : ℝ≥0 → ℝ} (hb : Continuous b) {F : ℝ≥0 → ℂ → ℂ} + (hFc : ∀ z, Continuous (fun t => F t z)) + (hFe : ∀ z t, F t z = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal z - (b u.toNNReal : ℂ))) + (z w : ℂ) (T : ℝ≥0) : + dist (F T z) (F T w) ≤ dist z w * Real.exp ((2*|A|/ε^2)*(T : ℝ)) := by + have hd (z : ℂ) (t : ℝ) (ht : t ∈ Ico (0 : ℝ) T) := + (cutoff_loewner_hasDerivWithinAt hε hb hFc hFe z T t (mem_Icc_of_Ico ht)).mono_of_mem_nhdsWithin + (Icc_mem_nhdsGE_of_mem ht) + have hv (t : ℝ) : LipschitzWith ⟨2*|A|/ε^2, by positivity⟩ + (fun z : ℂ => cutoffVector A ε (z - (b t.toNNReal : ℂ))) := by + apply LipschitzWith.of_dist_le_mul + intro z w + change dist (cutoffVector A ε (z - (b t.toNNReal : ℂ))) + (cutoffVector A ε (w - (b t.toNNReal : ℂ))) ≤ (2*|A|/ε^2)*dist z w + convert (cutoffVector_lipschitz A ε hε).dist_le_mul + (z-(b t.toNNReal : ℂ)) (w-(b t.toNNReal : ℂ)) using 1 + simp only [dist_sub_right] + rfl + have h0 (z : ℂ) : F 0 z = z := by simpa using hFe z 0 + have hg := dist_le_of_trajectories_ODE hv + ((hFc z).comp continuous_real_toNNReal).continuousOn (hd z) + ((hFc w).comp continuous_real_toNNReal).continuousOn (hd w) + (show dist (F (0 : ℝ).toNNReal z) (F (0 : ℝ).toNNReal w) ≤ dist z w by simp [h0]) + (T : ℝ) (show (T : ℝ) ∈ Icc (0 : ℝ) T by simp) + change dist (F (T : ℝ).toNNReal z) (F (T : ℝ).toNNReal w) ≤ + dist z w * Real.exp ((2*|A|/ε^2)*((T : ℝ)-0)) at hg + simpa only [Real.toNNReal_coe, sub_zero] using hg + +end ExactSLEMain + +namespace ExactSLEMain +open Set Metric +lemma cutoff_loewner_eq_solution {A ε : ℝ} (hε : 0 < ε) + {b : ℝ≥0 → ℝ} (hb : Continuous b) {F : ℝ≥0 → ℂ → ℂ} + (hFc : ∀ z, Continuous (fun t => F t z)) + (hFe : ∀ z t, F t z = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal z - (b u.toNNReal : ℂ))) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil A b z T f) + (hlower : ∀ u ∈ Icc (0 : ℝ) T, ε ≤ (f u).im) : + ∀ u ∈ Icc (0 : ℝ) T, F u.toNNReal z = f u := by + have hfd := cutoff_loewner_hasDerivWithinAt hε hb hFc hFe z T + have hgd (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt f (cutoffVector A ε (f u + (-(b u.toNNReal : ℂ)))) (Icc (0 : ℝ) T) u := by + have hc : heightClamp ε (f u - (b u.toNNReal : ℂ)) = f u - (b u.toNNReal : ℂ) := + heightClamp_eq (by simpa only [Complex.sub_im, Complex.ofReal_im, sub_zero] using hlower u hu) + simpa only [cutoffVector, ← sub_eq_add_neg, hc] using (hf.2 u hu).2 + apply ExactSLEFlow.additive_flow_unique (cutoffVector_lipschitz A ε hε) + ((hFc z).comp continuous_real_toNNReal).continuousOn (odeUntil_continuousOn hf) + (fun u hu => by simpa only [sub_eq_add_neg,Function.comp_def] using hfd u hu) hgd + simpa [hf.1, Function.comp_def] using hFe z 0 + + + +theorem loewner_local_cutoff {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hz : alive A b T z) : + ∃ (ε δ : ℝ) (F : ℝ≥0 → ℂ → ℂ), 0 < ε ∧ 0 < δ ∧ + (∀ w, Continuous (fun t => F t w)) ∧ + (∀ w t, F t w = w + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal w - (b u.toNNReal : ℂ))) ∧ + (∀ w ∈ ball z δ, odeUntil A b w T (fun u => F u.toNNReal w)) ∧ + (∀ w ∈ ball z δ, ∀ u ≤ T, loewnerMap A b u w = F u w) ∧ + (∀ w ∈ ball z δ, ∀ u ≤ T, ε < (F u w).im) := by + obtain ⟨f,hf⟩ := hz + obtain ⟨η,hη,hmin⟩ := odeUntil_height_lower hf + let ε := η/2 + have hε : 0 < ε := half_pos hη + let K : ℝ := 2*|A|/ε^2 + let δ := ε / Real.exp (K*(T : ℝ)) + have hδ : 0 < δ := div_pos hε (Real.exp_pos _) + obtain ⟨F,hFc,hFe⟩ := exists_cutoff_loewner A ε hε b hb + have hFf := cutoff_loewner_eq_solution hε hb hFc hFe hf + (fun u hu => (show ε ≤ η by dsimp [ε]; linarith).trans (hmin u hu)) + have hIm (w : ℂ) (hw : w ∈ ball z δ) (u : ℝ≥0) (hu : u ≤ T) : ε < (F u w).im := by + have hd := cutoff_loewner_dist hε hb hFc hFe w z u + have hdt : dist (F u w) (F u z) < ε := by + calc + dist (F u w) (F u z) ≤ dist w z * Real.exp (K*(u : ℝ)) := hd + _ ≤ dist w z * Real.exp (K*(T : ℝ)) := mul_le_mul_of_nonneg_left + (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (show (u : ℝ) ≤ T from hu) + (by dsimp [K]; positivity))) dist_nonneg + _ < δ * Real.exp (K*(T : ℝ)) := mul_lt_mul_of_pos_right hw (Real.exp_pos _) + _ = ε := div_mul_cancel₀ _ (Real.exp_ne_zero _) + have him := Complex.im_le_norm (F u z - F u w) + have hbase : η ≤ (F u z).im := by + rw [show F u z = f u by simpa only [Real.toNNReal_coe] using hFf u ⟨u.coe_nonneg,hu⟩] + exact hmin u ⟨u.coe_nonneg,hu⟩ + rw [Complex.sub_im, ← dist_eq_norm, dist_comm] at him + dsimp [ε] at * + linarith + have hode (w : ℂ) (hw : w ∈ ball z δ) : + odeUntil A b w T (fun u => F u.toNNReal w) := by + refine ⟨by simpa using hFe w 0, fun u hu => ?_⟩ + have huT : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have hpos := hIm w hw u.toNNReal huT + refine ⟨hε.trans hpos, ?_⟩ + have hd := cutoff_loewner_hasDerivWithinAt hε hb hFc hFe w T u hu + have hc : heightClamp ε (F u.toNNReal w - (b u.toNNReal : ℂ)) = + F u.toNNReal w - (b u.toNNReal : ℂ) := + heightClamp_eq (by simpa using hpos.le) + simpa only [cutoffVector,hc] using hd + refine ⟨ε,δ,F,hε,hδ,hFc,hFe,hode,?_,hIm⟩ + intro w hw u hu + simpa only [Real.toNNReal_coe] using loewnerMap_eq (odeUntil_mono (hode w hw) hu) + +lemma isOpen_alive {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) (T : ℝ≥0) : + IsOpen {z | alive A b T z} := by + rw [Metric.isOpen_iff] + intro z hz + obtain ⟨ε,δ,F,hε,hδ,hFc,hFe,hode,hmap,hIm⟩ := loewner_local_cutoff hb hz + exact ⟨δ,hδ,fun w hw => ⟨_,hode w hw⟩⟩ + +lemma continuousAt_loewnerMap {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {T : ℝ≥0} {z : ℂ} (hz : alive A b T z) : ContinuousAt (loewnerMap A b T) z := by + obtain ⟨ε,δ,F,hε,hδ,hFc,hFe,hode,hmap,hIm⟩ := loewner_local_cutoff hb hz + have hLip : LipschitzWith ⟨Real.exp ((2*|A|/ε^2)*(T : ℝ)), (Real.exp_pos _).le⟩ (F T) := by + apply LipschitzWith.of_dist_le_mul + intro w v + change dist (F T w) (F T v) ≤ Real.exp ((2*|A|/ε^2)*(T : ℝ))*dist w v + simpa only [_root_.mul_comm] using cutoff_loewner_dist hε hb hFc hFe w v T + apply hLip.continuous.continuousAt.congr + filter_upwards [Metric.ball_mem_nhds z hδ] with w hw + exact (hmap w hw T le_rfl).symm + +end ExactSLEMain + +namespace ExactSLEMain +open Set + +lemma scalar_linear_solution (H c : ℝ → ℂ) (hc : Continuous c) (T : ℝ≥0) + (hH : ∀ u ∈ Icc (0 : ℝ) T, HasDerivWithinAt H (c u * H u) (Icc (0 : ℝ) T) u) : + H T = H 0 * Complex.exp (∫ u in (0 : ℝ)..(T : ℝ), c u) := by + let P : ℝ → ℂ := fun t => H t * Complex.exp (-(∫ u in (0 : ℝ)..t, c u)) + have hd (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt P 0 (Icc (0 : ℝ) T) u := by + have hi := intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 u) + hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + convert (hH u hu).mul (hi.neg.cexp.hasDerivWithinAt) using 1 + first | rfl | ring + have hnorm := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le hd + (fun u hu => by simp : ∀ u ∈ Icc (0 : ℝ) T, ‖(0 : ℂ)‖ ≤ 0) + (convex_Icc (0 : ℝ) T) (show (0 : ℝ) ∈ Icc (0 : ℝ) T by simp) + (show (T : ℝ) ∈ Icc (0 : ℝ) T by simp) + have hp : P T = P 0 := sub_eq_zero.mp (norm_eq_zero.mp + (le_antisymm (by simpa only [zero_mul] using hnorm) (norm_nonneg _))) + have he : H T * (Complex.exp (∫ u in (0 : ℝ)..(T : ℝ), c u))⁻¹ = H 0 := by + simpa [P, Complex.exp_neg] using hp + exact (mul_inv_eq_iff_eq_mul₀ (Complex.exp_ne_zero _)).mp he + +lemma scalar_linear_solution_on (H c : ℝ → ℂ) (T : ℝ≥0) + (hc : ContinuousOn c (Icc (0 : ℝ) T)) + (hH : ∀ u ∈ Icc (0 : ℝ) T, HasDerivWithinAt H (c u * H u) (Icc (0 : ℝ) T) u) : + H T = H 0 * Complex.exp (∫ u in (0 : ℝ)..(T : ℝ), c u) := by + let c' : ℝ → ℂ := fun u => c (projIcc (0 : ℝ) T T.coe_nonneg u) + have hc' : Continuous c' := hc.domRestrict.comp continuous_projIcc + have he (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : c' u = c u := by + dsimp [c']; rw [projIcc_of_mem _ hu] + have h := scalar_linear_solution H c' hc' T (fun u hu => by rw [he u hu]; exact hH u hu) + rw [h] + congr 2 + apply intervalIntegral.integral_congr + intro u hu + exact he u (by simpa only [uIcc_of_le T.coe_nonneg] using hu) + + +theorem loewner_solution_difference {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z w : ℂ} {T : ℝ≥0} {f g : ℝ → ℂ} + (hf : odeUntil A b z T f) (hg : odeUntil A b w T g) : + f T - g T = (z-w) * Complex.exp (∫ u in (0 : ℝ)..(T : ℝ), + -(A : ℂ) / ((f u - (b u.toNNReal : ℂ)) * (g u - (b u.toNNReal : ℂ)))) := by + let c : ℝ → ℂ := fun u => -(A : ℂ) / + ((f u - (b u.toNNReal : ℂ)) * (g u - (b u.toNNReal : ℂ))) + have hfn (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : f u - (b u.toNNReal : ℂ) ≠ 0 := by + intro he + have hy := (hf.2 u hu).1 + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + linarith + have hgn (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : g u - (b u.toNNReal : ℂ) ≠ 0 := by + intro he + have hy := (hg.2 u hu).1 + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + linarith + have hbc : Continuous (fun u : ℝ => (b u.toNNReal : ℂ)) := + Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal) + have hc : ContinuousOn c (Icc (0 : ℝ) T) := continuousOn_const.div + (((odeUntil_continuousOn hf).sub hbc.continuousOn).mul + ((odeUntil_continuousOn hg).sub hbc.continuousOn)) + (fun u hu => mul_ne_zero (hfn u hu) (hgn u hu)) + have hd (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : HasDerivWithinAt (fun u => f u-g u) + (c u*(f u-g u)) (Icc (0 : ℝ) T) u := by + convert (hf.2 u hu).2.sub (hg.2 u hu).2 using 1 + try rfl + dsimp [c] + field_simp [hfn u hu, hgn u hu] + ring + simpa only [hf.1,hg.1] using scalar_linear_solution_on (fun u => f u-g u) c T hc hd + +end ExactSLEMain + +namespace ExactSLEMain +open Set Metric + +lemma heightClamp_norm_lower (ε : ℝ) (z : ℂ) : ε ≤ ‖heightClamp ε z‖ := + (show ε ≤ (heightClamp ε z).im from le_max_left _ _).trans (Complex.im_le_norm _) + +lemma heightClamp_ne_zero {ε : ℝ} (hε : 0 < ε) (z : ℂ) : heightClamp ε z ≠ 0 := + norm_pos_iff.mp (hε.trans_le (heightClamp_norm_lower ε z)) + +lemma invprod_heightClamp_bound (A ε : ℝ) (hε : 0 < ε) (z w : ℂ) : + ‖-(A : ℂ)/(heightClamp ε z * heightClamp ε w)‖ ≤ |A|/ε^2 := by + rw [norm_div,norm_neg,Complex.norm_real,Real.norm_eq_abs,norm_mul] + exact div_le_div_of_nonneg_left (abs_nonneg _) (sq_pos_of_pos hε) + (by simpa only [pow_two] using (mul_le_mul (heightClamp_norm_lower ε z) + (heightClamp_norm_lower ε w) hε.le (norm_nonneg _))) + +lemma cutoff_loewner_continuous_start {A ε : ℝ} (hε : 0 < ε) + {b : ℝ≥0 → ℝ} (hb : Continuous b) {F : ℝ≥0 → ℂ → ℂ} + (hFc : ∀ z, Continuous (fun t => F t z)) + (hFe : ∀ z t, F t z = z + ∫ u in (0 : ℝ)..(t : ℝ), + cutoffVector A ε (F u.toNNReal z - (b u.toNNReal : ℂ))) (T : ℝ≥0) : + Continuous (F T) := by + have hLip : LipschitzWith ⟨Real.exp ((2*|A|/ε^2)*(T : ℝ)), (Real.exp_pos _).le⟩ (F T) := by + apply LipschitzWith.of_dist_le_mul + intro w v + change dist (F T w) (F T v) ≤ Real.exp ((2*|A|/ε^2)*(T : ℝ))*dist w v + simpa only [_root_.mul_comm] using cutoff_loewner_dist hε hb hFc hFe w v T + exact hLip.continuous + + + +end ExactSLEMain +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/Main.lean b/lean/OAI/Probability/SLEGauge/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a22a52cfa09e7b53b3dce34c8c4556e620cca9e --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/Main.lean @@ -0,0 +1 @@ +import OAI.Probability.SLEGauge.ExactGaugeEndpoint diff --git a/lean/OAI/Probability/SLEGauge/MarkedMomentBound.lean b/lean/OAI/Probability/SLEGauge/MarkedMomentBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..5daa383e313202543ddacf3a85063003d2e387ed --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/MarkedMomentBound.lean @@ -0,0 +1,509 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ConformalRestartMap + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEKernel + +lemma target_cap_cancellation {ι : Type*} [Fintype ι] [DecidableEq ι] + (α : ℝ) (hα : 0≤α) (cap target : ι→ℝ) + (hc : ∀i,0 target i≤cap i), + (target i/cap i)^α) ≤ ∏i,cap i^(-α) := by + rw [Finset.prod_filter,←Finset.prod_mul_distrib] + apply Finset.prod_le_prod₀ + · intro i _ + apply mul_nonneg (Real.rpow_nonneg (ht i).le _) + split_ifs + · exact Real.rpow_nonneg (div_nonneg (ht i).le (hc i).le) _ + · norm_num + · intro i _ + by_cases hi : target i≤cap i + · rw [ite_eq_left hi,Real.div_rpow (ht i).le (hc i).le, + Real.rpow_neg (ht i).le,Real.rpow_neg (hc i).le] + have hp := Real.rpow_pos_of_pos (ht i) α + field_simp + rfl + · rw [ite_eq_right hi,mul_one] + exact Real.rpow_le_rpow_of_nonpos (hc i) (le_of_not_ge hi) (neg_nonpos.mpr hα) + + + +theorem actual_hit_density_product_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀z : Fin (m+1)→ℂ, Function.Injective z → (∀i,0<(z i).im) → + ∀cap target : Fin (m+1)→ℝ, + (∀i,0 target i≤cap i) + let E := {b : ExactSLEGenerator.Driver | ∀i∈I,radialTime a b.1 (z i) (target i/2)<∞} + let E₀ := {b : ExactSLEGenerator.Driver | radialTime a b.1 (z 0) (target 0/2)<∞} + let A := ∏i : Fin m, (target i.succ)^(-alpha a) + have hA : 0≤A := Finset.prod_nonneg (fun i _ => Real.rpow_nonneg (ht _).1.le _) + have hhit : W E≤ENNReal.ofReal (C*∏i∈I,(target i/cap i)^(alpha a)) := + hCb W hW z hinj hz cap target hc hsep I + (fun i hi => ⟨(ht i).1,(Finset.mem_filter.mp hi).2⟩) + have hS := radialTime_stopping a (lt_trans (by norm_num) ha) (z 0) (hz 0) + (target 0/2) (by have := (ht 0).1; positivity) (by have := (ht 0).2; linarith) + have hE₀ : MeasurableSet E₀ := hS.measurableSpace_le _ (hS.measurable measurableSet_Iio) + have hpoint (b : ExactSLEGenerator.Driver) : + E₀.indicator (fun b => ∏i : Fin m, + ENNReal.ofReal (fullRadialDensity a b.1 (z i.succ) (target i.succ))) b ≤ + E.indicator (fun _ => ENNReal.ofReal A) b := by + by_cases h0 : b∈E₀ + · rw [Set.indicator_of_mem h0] + by_cases hb : b∈E + · rw [Set.indicator_of_mem hb,ENNReal.ofReal_prod_of_nonneg + (fun i _ => Real.rpow_nonneg (ht i.succ).1.le _)] + exact Finset.prod_le_prod₀ (fun _ _ => bot_le) (fun i _ => ENNReal.ofReal_le_ofReal + (fullRadialDensity_bound a ha (z i.succ) (hz _) (target i.succ) + (ht _).1 (ht _).2 b).2) + · rw [Set.indicator_of_notMem hb] + have he : ∃i∈I,radialTime a b.1 (z i) (target i/2)=∞ := by + by_contra hn + apply hb + intro i hi + exact lt_top_iff_ne_top.mpr (fun he => hn ⟨i,hi,he⟩) + obtain ⟨i,hi,he⟩ := he + have hi0 : i≠0 := by + intro h + subst i + exact (ne_of_lt (show radialTime a b.1 (z 0) (target 0/2)<∞ from h0)) he + obtain ⟨j,rfl⟩ := Fin.exists_succ_eq.mpr hi0 + have hj : ENNReal.ofReal (fullRadialDensity a b.1 (z j.succ) (target j.succ))=0 := by + simp [fullRadialDensity,radialWeight,he] + exact le_of_eq (Finset.prod_eq_zero (Finset.mem_univ j) hj) + · rw [Set.indicator_of_notMem h0] + exact bot_le + have halg : A*(∏i∈I,(target i/cap i)^(alpha a)) ≤ + (target 0)^(alpha a)*∏i,cap i^(-alpha a) := by + have he : A=(target 0)^(alpha a)*(∏i,target i^(-alpha a)) := by + rw [Fin.prod_univ_succ,←mul_assoc,←Real.rpow_add (ht 0).1] + simp only [add_neg_cancel,Real.rpow_zero,one_mul,A] + rw [he,mul_assoc] + exact mul_le_mul_of_nonneg_left + (target_cap_cancellation (alpha a) (alpha_pos ha).le cap target + (fun i => (hc i).1) (fun i => (ht i).1)) + (Real.rpow_nonneg (ht 0).1.le _) + calc + _ = ∫⁻b,E₀.indicator (fun b => ∏i : Fin m, + ENNReal.ofReal (fullRadialDensity a b.1 (z i.succ) (target i.succ))) b∂W := + (lintegral_indicator hE₀ _).symm + _ ≤ ∫⁻b,E.indicator (fun _ => ENNReal.ofReal A) b∂W := lintegral_mono hpoint + _ ≤ ENNReal.ofReal A*W E := lintegral_indicator_const_le E _ + _ ≤ ENNReal.ofReal A*ENNReal.ofReal (C*∏i∈I,(target i/cap i)^(alpha a)) := + mul_le_mul' le_rfl hhit + _ = ENNReal.ofReal (C*(A*∏i∈I,(target i/cap i)^(alpha a))) := by + rw [←ENNReal.ofReal_mul hA] + congr 1 + ring + _ ≤ _ := ENNReal.ofReal_le_ofReal (by nlinarith [mul_le_mul_of_nonneg_left halg hC.le]) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEKernel + + + +theorem actual_hit_mass_moment_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀K : Set ℂ, MeasurableSet K → Bornology.IsBounded K → + ∀c : ℝ, 0 volume.restrict K) + A<∞ ∧ ∀ρ : ℝ, 0<ρ → ρ≤z.im → ∀q : ℝ,0 μ) + have hKae : ∀ᵐ x∂ν,∀i,x i∈K := by + apply ae_all_iff.mpr + intro i + exact (Measure.tendsto_eval_ae_ae (μ:=fun _ : Fin m=>μ) (i:=i)).eventually + (ae_restrict_mem hK) + have halpha : alpha a<1 := by + have ha0 : 0 kernel (alpha a) c (Fin.cons z x)) := + (measurable_kernel (alpha_pos ha).le c).comp (by fun_prop) + have hAfin : (∫⁻x,(∏i,ENNReal.ofReal (f (x i)))*kernel (alpha a) c + (Fin.cons z x)∂ν)<∞ := by + calc + _ ≤ ∫⁻x,(ENNReal.ofReal B)^m*kernel (alpha a) c (Fin.cons z x)∂ν := by + apply lintegral_mono_ae + filter_upwards [hKae] with x hx + apply mul_le_mul' _ le_rfl + have hp := Finset.prod_le_prod₀ (fun _ _ => (bot_le : (0:ℝ≥0∞)≤_)) + (fun i (_ : i∈Finset.univ) => ENNReal.ofReal_le_ofReal (hBf (x i) (hx i))) + simpa using hp + _ = (ENNReal.ofReal B)^m*∫⁻x,kernel (alpha a) c (Fin.cons z x)∂ν := + lintegral_const_mul _ hkm + _ < ∞ := ENNReal.mul_lt_top (ENNReal.pow_lt_top ENNReal.ofReal_lt_top) hkfin + refine ⟨hAfin,?_⟩ + intro ρ hρ hρz q hq hq1 + have hz : 0 ∏i,massDensity a q b (x i)) := by + apply Finset.measurable_prod + intro i hi + exact hd.comp (measurable_id.prodMk measurable_const) + have hprod (x : Fin m→ℂ) (hx : ∀i,x i∈K) : + (∫⁻b in E,∏i,massDensity a q b (x i)∂W) ≤ + ENNReal.ofReal (C*(2*ρ)^(alpha a))*kernel (alpha a) c (Fin.cons z x) := by + let Z : Fin (m+1)→ℂ := Fin.cons z x + have hZ (i : Fin (m+1)) : 0<(Z i).im := by + refine Fin.cases hz (fun j => ?_) i + have := hcK (x j) (hx j) + simp only [Z, Fin.cons_succ] + linarith + have hcz (i : Fin (m+1)) : c≤2*(Z i).im := by + exact Fin.cases hzc (fun j => hcK (x j) (hx j)) i + by_cases hinj : Function.Injective Z + · let cap := fun i => cappedDistance c Z i + let target : Fin (m+1)→ℝ := Fin.cons (2*ρ) (fun i => 2*(x i).im*q) + have hcap (i) : 0 ?_) i + · simp only [target, Z, Fin.cons_zero] + constructor <;> linarith + · simp only [target, Z, Fin.cons_succ] + have hxi := hZ j.succ + simp only [Z,Fin.cons_succ] at hxi + constructor + · positivity + · nlinarith + have hh := hCb W hW Z hinj hZ cap target + (fun i => ⟨hcap i,(cappedDistance_le c Z i).trans (hcz i)⟩) + (fun i j hij => by simpa [dist_eq_norm] using + cappedDistance_le_dist c Z i j hij.symm) ht + have he (b : ExactSLEGenerator.Driver) (i) : massDensity a q b (x i)= + ENNReal.ofReal (fullRadialDensity a b.1 (Z i.succ) (target i.succ)) := by + have hxi : 0 < (x i).im := by simpa [Z] using hZ i.succ + simp [massDensity, hxi, Z, target] + simp_rw [he] + have hk : ENNReal.ofReal (C*(target 0)^(alpha a)*∏i,cap i^(-alpha a))= + ENNReal.ofReal (C*(2*ρ)^(alpha a))*kernel (alpha a) c (Fin.cons z x) := by + rw [ENNReal.ofReal_mul (mul_nonneg hC.le (Real.rpow_nonneg (ht 0).1.le _)), + ENNReal.ofReal_prod_of_nonneg (fun i _ => Real.rpow_nonneg (hcap i).le _)] + congr 1 + unfold kernel + apply Finset.prod_congr rfl + intro i hi + exact (ENNReal.ofReal_rpow_of_pos (hcap i)).symm + simpa only [Z,target,Fin.cons_zero,mul_div_cancel_left₀ _ (two_ne_zero : (2:ℝ)≠0)] + using hh.trans_eq hk + · rw [kernel_top_of_not_injective (alpha a) c (alpha_pos ha) hc Z hinj, + ENNReal.mul_top (ne_of_gt (ENNReal.ofReal_pos.mpr + (mul_pos hC (Real.rpow_pos_of_pos (by positivity) _))))] + exact le_top + have hjoint : Measurable (fun p : ExactSLEGenerator.Driver × (Fin m→ℂ) => + ∏i,ENNReal.ofReal (f (p.2 i))*massDensity a q p.1 (p.2 i)) := by + apply Finset.measurable_prod + intro i hi + exact ((hf.comp ((measurable_pi_apply i).comp measurable_snd)).ennreal_ofReal).mul + (hd.comp (measurable_fst.prodMk ((measurable_pi_apply i).comp measurable_snd))) + calc + _ = ∫⁻b in E,∫⁻x : Fin m→ℂ,∏i,ENNReal.ofReal (f (x i))*massDensity a q b (x i)∂ν∂W := by + apply lintegral_congr + intro b + exact lintegral_power_pi μ _ (hf.ennreal_ofReal.mul (hdz b)) m + _ = ∫⁻x : Fin m→ℂ,∫⁻b in E,∏i,ENNReal.ofReal (f (x i))*massDensity a q b (x i)∂W∂ν := + lintegral_lintegral_swap hjoint.aemeasurable + _ ≤ ∫⁻x,ENNReal.ofReal (C*(2*ρ)^(alpha a))* + ((∏i,ENNReal.ofReal (f (x i)))*kernel (alpha a) c (Fin.cons z x))∂ν := by + apply lintegral_mono_ae + filter_upwards [hKae] with x hx + simp_rw [Finset.prod_mul_distrib] + rw [lintegral_const_mul _ (hdm x)] + calc + _ ≤ (∏i,ENNReal.ofReal (f (x i)))* + (ENNReal.ofReal (C*(2*ρ)^(alpha a))*kernel (alpha a) c (Fin.cons z x)) := + mul_le_mul' le_rfl (hprod x hx) + _ = _ := by ring + _ = _ := by + have hfm : Measurable (fun x : Fin m→ℂ => ∏i,ENNReal.ofReal (f (x i))) := by fun_prop + exact lintegral_const_mul _ (hfm.mul hkm) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEKernel + +lemma convex_limit_moment_bound {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (m : ℕ) (hm : 1 ≤ m) (A : ℝ≥0∞) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hsum : ∀k,∑j∈s k,c k j=1) + (F : ℕ→Ω→ℝ) (hF : ∀j,AEStronglyMeasurable (F j) P) + (hbound : ∀j,(∫⁻b,‖F j b‖ₑ^m∂P)≤A) + (G : Ω→ℝ) + (hlim : ∀ᵐ b∂P,Tendsto (fun k=>∑j∈s k,c k j*F j b) atTop (𝓝 (G b))) : + (∫⁻b,‖G b‖ₑ^m∂P)≤A := by + have hm0 : (m:ℝ)≠0 := by exact_mod_cast Nat.ne_zero_of_lt hm + let D := A^(1/(m:ℝ)) + have hn (j) : eLpNorm (F j) (m:ℝ≥0∞) P≤D := by + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal + (by exact_mod_cast Nat.ne_zero_of_lt hm) (by simp) (hF j), + ENNReal.toReal_natCast] + simpa only [ENNReal.rpow_natCast] using + ENNReal.rpow_le_rpow (hbound j) (show (0:ℝ)≤1/(m:ℝ) by positivity) + have hFn (k) : AEStronglyMeasurable (fun b=>∑j∈s k,c k j*F j b) P := by + have h := Finset.aestronglyMeasurable_sum (μ:=P) (s k) + (fun j hj => (hF j).const_mul (c k j)) + convert h using 1 + funext b + simp only [Finset.sum_apply] + have hnb (k) : eLpNorm (fun b=>∑j∈s k,c k j*F j b) (m:ℝ≥0∞) P≤D := + convex_eLpNorm_bound P _ D (by exact_mod_cast hm) (s k) (c k) (hc k) (hsum k) + F (fun j _ => hF j) (fun j _ => hn j) + have hGm := aestronglyMeasurable_of_tendsto_ae atTop hFn hlim + have hg : eLpNorm G (m:ℝ≥0∞) P≤D := + Lp.eLpNorm_le_of_ae_tendsto (Filter.Eventually.of_forall hnb) hFn hGm hlim + have hid : (eLpNorm G (m:ℝ≥0∞) P)^m=∫⁻b,‖G b‖ₑ^m∂P := by + simpa using (eLpNorm_nnreal_pow_eq_lintegral (f:=G) (μ:=P) (p:=(m:ℝ≥0)) + (by exact_mod_cast Nat.ne_zero_of_lt hm) hGm) + rw [←hid] + calc + _ ≤ D^m := pow_le_pow_left' hg m + _ = A := by + dsimp [D] + rw [←ENNReal.rpow_natCast,←ENNReal.rpow_mul,one_div_mul_cancel hm0,ENNReal.rpow_one] + + + +theorem actual_hit_radon_moment_bound (a : ℝ) (ha : 1/4b.1 t) W → + ∀f : C_c(UpperPlane,ℝ), ∀c : ℝ,0 volume.restrict (Subtype.val '' tsupport f)) + A<∞ ∧ ∀(s : ℕ→Finset ℕ) (coeff : ℕ→ℕ→ℝ), + (∀k j,j∈s k→0≤coeff k j) → (∀k,∑j∈s k,coeff k j=1) → + ∀(t : ℝ≥0∞) (μ : ExactSLEGenerator.Driver→Measure UpperPlane), + (∀ᵐ b∂W,Tendsto (fun k=>∑j∈s k,coeff k j* + ∫x,f x∂actualUpperMass a (Real.exp (-2*a*(j+1))) t b) + atTop (𝓝 (∫x,f x∂μ b))) → + ∀ρ : ℝ,0<ρ → ρ≤z.im → + (∫⁻b in {b | radialTime a b.1 z ρ<∞},‖∫x,f x∂μ b‖ₑ^m∂W)≤ + ENNReal.ofReal (C*(2*ρ)^(alpha a))*A := by + obtain ⟨C,hC,hCb⟩ := actual_hit_mass_moment_bound a ha m + refine ⟨C,hC,?_⟩ + intro W hprob hW f c hc hcf z hzc + let K := Subtype.val '' tsupport f + have hK : IsCompact K := f.hasCompactSupport.image continuous_subtype_val + have hcK (x : ℂ) (hx : x∈K) : c≤2*x.im := by + obtain ⟨y,hy,rfl⟩ := hx + exact hcf y hy + obtain ⟨hAfin,hB⟩ := hCb W hW K hK.measurableSet hK.isBounded c hc hcK z hzc + (fun x=>‖upperExtension f x‖) (upperExtension_measurable f).norm + (fun _ _ => norm_nonneg _) (upperExtension_bounded f) + refine ⟨hAfin,?_⟩ + intro s coeff hcoeff hsum t μ hlim ρ hρ hρz + let E := {b : ExactSLEGenerator.Driver | radialTime a b.1 z ρ<∞} + let q (j : ℕ) := Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0∫x,f x∂actualUpperMass a (q j) t b) + (fun j=>(actualUpperMass_eval_measurable a ha (q j) (hq j) (hq1 j) t f).aestronglyMeasurable.restrict) + _ _ (ae_restrict_of_ae hlim) + intro j + calc + _ ≤ ∫⁻b in E,(∫⁻x in K,ENNReal.ofReal ‖upperExtension f x‖*massDensity a (q j) b x)^m∂W := by + apply lintegral_mono + intro b + dsimp only + rw [actualUpperMass_eval a ha (q j) (hq j) (hq1 j)] + exact pow_le_pow_left' (actualMassEval_enorm_bound a (q j) t K (upperExtension f) b) m + _ ≤ _ := hB ρ hρ hρz (q j) (hq j) (hq1 j) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.KernelSimilarity +open ExactSLEKernel + + +def affine (x : ℂ) (y : ℝ) (hy : 0(div_le_iff₀ hy).mpr ?_⟩ + · simpa [mul_comm] using cappedDistance_le (y*c) (affine x y hy ∘ z) i + · simpa only [Function.comp_apply,dist_affine,mul_comm] using + cappedDistance_le_dist (y*c) (affine x y hy ∘ z) i j hji + · rw [le_cappedDistance_iff] + refine ⟨mul_le_mul_of_nonneg_left (cappedDistance_le c z i) hy.le,?_⟩ + intro j hji + simp only [Function.comp_apply,dist_affine] + exact mul_le_mul_of_nonneg_left (cappedDistance_le_dist c z i j hji) hy.le + +lemma kernel_affine {ι : Type*} [Fintype ι] [DecidableEq ι] + (α c : ℝ) (x : ℂ) {y : ℝ} (hy : 0r • μ)=(r:ℝ≥0∞)^m • Measure.pi (fun _ : Fin m=>μ) := by + apply Measure.pi_eq + intro s hs + simp only [Measure.smul_apply,smul_eq_mul,Measure.pi_pi,Finset.prod_mul_distrib, + Finset.prod_const,Finset.card_univ,Fintype.card_fin,ENNReal.smul_def] + +lemma affine_area (x : ℂ) {y : ℝ} (hy : 0x+(y:ℂ)*w) (y:ℂ) z + simpa only [mul_one,id_eq] using ((hasDerivAt_id z).const_mul (y:ℂ)).const_add x + ext A hA + have h := Conformal.lintegral_image_complex hK + (fun z _ => (hder z).differentiableAt) T.injective.injOn (A.indicator (fun _=>1)) + change (∫⁻z in T '' K,A.indicator (fun _=>(1:ℝ≥0∞)) z)=_ at h + simp_rw [fun z=> (hder z).deriv,Complex.norm_real,Real.norm_eq_abs,sq_abs] at h + have hAcomp : Measurable (fun z=>A.indicator (fun _=>(1:ℝ≥0∞)) (T z)) := + (measurable_const.indicator hA).comp T.measurable + rw [lintegral_const_mul _ hAcomp] at h + rw [←lintegral_map (measurable_const.indicator hA) T.measurable] at h + rw [lintegral_indicator hA,lintegral_indicator hA,setLIntegral_one,setLIntegral_one] at h + rw [Measure.smul_apply,ENNReal.smul_def] + exact h.trans (by congr 1; simp only [ENNReal.ofReal,Real.toNNReal_of_nonneg (sq_nonneg y)]) + +lemma affine_pi_integral (x : ℂ) {y : ℝ} (hy : 0volume.restrict (affine x y hy '' K)))= + (ENNReal.ofReal y)^(2*m)* + ∫⁻z,F (affine x y hy ∘ z)∂Measure.pi (fun _=>volume.restrict K) := by + let T := affine x y hy + have : SigmaFinite ((volume.restrict K).map T) := T.toMeasurableEquiv.sigmaFinite_map + rw [affine_area x hy hK,pi_const_smul,lintegral_smul_measure, + ←Measure.pi_map_pi (fun _ : Fin m=>T.measurable.aemeasurable)] + rw [lintegral_map hF (by fun_prop)] + change ((NNReal.mk (y^2) (sq_nonneg y)):ℝ≥0∞)^m*_= _ + rw [show ((NNReal.mk (y^2) (sq_nonneg y)):ℝ≥0∞)=(ENNReal.ofReal y)^2 by + rw [←ENNReal.ofReal_pow hy.le]; simp only [ENNReal.ofReal,Real.toNNReal_of_nonneg (sq_nonneg y)], + ←pow_mul] + rfl + + + +theorem fixed_center_integral_affine (α c : ℝ) (hα : 0≤α) + (x z₀ : ℂ) {y : ℝ} (hy : 0volume.restrict (affine x y hy '' K)))= + (ENNReal.ofReal y)^(2*(m:ℝ)-α*((m:ℝ)+1))* + ∫⁻z : Fin m→ℂ,kernel α c (Fin.cons z₀ z) + ∂Measure.pi (fun _=>volume.restrict K) := by + have hm : Measurable (fun z : Fin m→ℂ=>kernel α (y*c) (Fin.cons (affine x y hy z₀) z)) := + (measurable_kernel hα _).comp (by fun_prop) + rw [affine_pi_integral x hy hK m _ hm] + have he (z : Fin m→ℂ) : Fin.cons (affine x y hy z₀) (affine x y hy ∘ z)= + affine x y hy ∘ Fin.cons z₀ z := by + funext i + refine Fin.cases ?_ (fun j=>?_) i <;> simp + simp_rw [he,kernel_affine,Fintype.card_fin] + have hf : Measurable (fun z : Fin m→ℂ=>kernel α c (Fin.cons z₀ z)) := + (measurable_kernel hα c).comp (by fun_prop) + rw [lintegral_const_mul _ hf,←mul_assoc, + ←ENNReal.rpow_natCast,←ENNReal.rpow_add _ _ (ne_of_gt (ENNReal.ofReal_pos.mpr hy)) ENNReal.ofReal_ne_top] + congr 2 + push_cast + ring + +end SLEExactGauge.KernelSimilarity +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/MassMoments.lean b/lean/OAI/Probability/SLEGauge/MassMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..78be2f77a2e67972b94649ef8521c80093e4e604 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/MassMoments.lean @@ -0,0 +1,402 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.KernelBounds + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Set ExactSLEGenerator ExactSLEMain ExactSLEKernel +open scoped Classical NNReal ENNReal +theorem actual_mass_moment_bound (a : ℝ) (ha : 1/4 b.1 t) W → + ∀ (K : Set ℂ), MeasurableSet K → Bornology.IsBounded K → + ∀ c : ℝ, 0 volume.restrict K) + A<∞ ∧ ∀ q : ℝ, 0 μ) + have hKae : ∀ᵐ x ∂ν, ∀ i, x i∈K := by + apply ae_all_iff.mpr + intro i + exact (Measure.tendsto_eval_ae_ae (μ:=fun _ : Fin m => μ) (i:=i)).eventually (ae_restrict_mem hK) + have halpha : alpha a<1 := by + have ha0 : 0 (bot_le : (0:ℝ≥0∞)≤_)) + (fun i (_ : i∈Finset.univ) => ENNReal.ofReal_le_ofReal (hBf (x i) (hx i))) + simpa using hp + _ = (ENNReal.ofReal B)^m * ∫⁻ x, kernel (alpha a) c x ∂ν := lintegral_const_mul _ hkm + _ < ∞ := ENNReal.mul_lt_top (ENNReal.pow_lt_top ENNReal.ofReal_lt_top) hkfin + refine ⟨hAfin,?_⟩ + intro q hq hq1 + have hd := massDensity_measurable a ha q hq hq1 + have hdz (b : ExactSLEGenerator.Driver) : Measurable (massDensity a q b) := hd.comp (measurable_const.prodMk measurable_id) + have hdm (x : Fin m → ℂ) : Measurable (fun b => ∏ i, massDensity a q b (x i)) := by + apply Finset.measurable_prod + intro i hi + exact hd.comp (measurable_id.prodMk measurable_const) + have hprod (x : Fin m → ℂ) (hx : ∀ i,x i∈K) : + (∫⁻ b, ∏ i, massDensity a q b (x i) ∂W) ≤ ENNReal.ofReal C*kernel (alpha a) c x := by + have hz (i) : 0<(x i).im := by have := hcK (x i) (hx i); linarith + by_cases hinj : Function.Injective x + · let cap := fun i => cappedDistance c x i + let target := fun i => 2*(x i).im*q + have hcap (i) : 0 ⟨hcap i,(cappedDistance_le c x i).trans (hcK (x i) (hx i))⟩) + (fun i j hij => by simpa [dist_eq_norm] using cappedDistance_le_dist c x i j hij.symm) ht + have he (b : ExactSLEGenerator.Driver) (i) : massDensity a q b (x i)= + ENNReal.ofReal (fullRadialDensity a b.1 (x i) (target i)) := by simp [massDensity,hz i,target] + simp_rw [he] + have hk : ENNReal.ofReal (C*∏ i, cap i^(-alpha a))=ENNReal.ofReal C*kernel (alpha a) c x := by + rw [ENNReal.ofReal_mul hC.le,ENNReal.ofReal_prod_of_nonneg (fun i _ => Real.rpow_nonneg (hcap i).le _)] + congr 1 + unfold kernel + apply Finset.prod_congr rfl + intro i hi + exact (ENNReal.ofReal_rpow_of_pos (hcap i)).symm + exact hh.trans_eq hk + · rw [kernel_top_of_not_injective (alpha a) c (alpha_pos ha) hc x hinj, + ENNReal.mul_top (ne_of_gt (ENNReal.ofReal_pos.mpr hC))] + exact le_top + have hjoint : Measurable (fun p : ExactSLEGenerator.Driver × (Fin m → ℂ) => + ∏ i, ENNReal.ofReal (f (p.2 i))*massDensity a q p.1 (p.2 i)) := by + apply Finset.measurable_prod + intro i hi + exact ((hf.comp ((measurable_pi_apply i).comp measurable_snd)).ennreal_ofReal).mul + (hd.comp (measurable_fst.prodMk ((measurable_pi_apply i).comp measurable_snd))) + calc + _ = ∫⁻ b, ∫⁻ x : Fin m → ℂ, ∏ i, ENNReal.ofReal (f (x i))*massDensity a q b (x i) ∂ν ∂W := by + apply lintegral_congr + intro b + exact lintegral_power_pi μ _ (hf.ennreal_ofReal.mul (hdz b)) m + _ = ∫⁻ x : Fin m → ℂ, ∫⁻ b, ∏ i, ENNReal.ofReal (f (x i))*massDensity a q b (x i) ∂W ∂ν := + lintegral_lintegral_swap hjoint.aemeasurable + _ ≤ ∫⁻ x, ENNReal.ofReal C*((∏ i, ENNReal.ofReal (f (x i)))*kernel (alpha a) c x) ∂ν := by + apply lintegral_mono_ae + filter_upwards [hKae] with x hx + simp_rw [Finset.prod_mul_distrib] + rw [lintegral_const_mul _ (hdm x)] + calc + _ ≤ (∏ i, ENNReal.ofReal (f (x i)))*(ENNReal.ofReal C*kernel (alpha a) c x) := mul_le_mul' le_rfl (hprod x hx) + _ = _ := by ring + _ = _ := by + have hfm : Measurable (fun x : Fin m → ℂ => ∏ i, ENNReal.ofReal (f (x i))) := by fun_prop + exact lintegral_const_mul _ (hfm.mul hkm) +end ExactSLEGreen + +open Filter Topology +noncomputable section +namespace ExactSLEMassExtraction + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + +theorem closed_convex_tail_intersection (X : ℕ → E) + (C : ℝ) (hX : ∀ j, ‖X j‖ ≤ C) : + ∃ v, ∀ k, v ∈ closure (convexHull ℝ (X '' Set.Ici k)) := by + let K := fun k => closure (convexHull ℝ (X '' Set.Ici k)) + have hne (k) : (K k).Nonempty := + ⟨X k, subset_closure (subset_convexHull ℝ _ ⟨k, Set.mem_Ici.mpr le_rfl, rfl⟩)⟩ + have hcv (k) : Convex ℝ (K k) := (convex_convexHull ℝ _).closure + have hcl (k) : IsClosed (K k) := isClosed_closure + have hanti : Antitone K := by + intro k l hkl + exact closure_mono (convexHull_mono (Set.image_mono (Set.Ici_subset_Ici.mpr hkl))) + have hex (k) := exists_norm_eq_iInf_of_complete_convex (hne k) (hcl k).isComplete (hcv k) (0 : E) + choose y hy hmin using hex + have hle (k) (w) (hw : w ∈ K k) : ‖y k‖ ≤ ‖w‖ := by + have hb : BddBelow (Set.range (fun w : K k => ‖(0 : E) - w‖)) := + ⟨0, by rintro _ ⟨i, rfl⟩; exact norm_nonneg _⟩ + have := ciInf_le hb (⟨w, hw⟩ : K k) + rw [← hmin] at this + simpa using this + have hbd (k) : ‖y k‖ ≤ C := + (hle k (X k) (subset_closure (subset_convexHull ℝ _ ⟨k, Set.mem_Ici.mpr le_rfl, rfl⟩))).trans (hX k) + have hm : Monotone (fun k => ‖y k‖ ^ 2) := by + intro k l hkl + exact pow_le_pow_left₀ (norm_nonneg _) (hle k _ (hanti hkl (hy l))) 2 + have hb : BddAbove (Set.range (fun k => ‖y k‖ ^ 2)) := by + refine ⟨C ^ 2, ?_⟩ + rintro _ ⟨k, rfl⟩ + exact pow_le_pow_left₀ (norm_nonneg _) (hbd k) 2 + have hdiff (k l) (hkl : k ≤ l) : ‖y l - y k‖ ^ 2 ≤ ‖y l‖ ^ 2 - ‖y k‖ ^ 2 := by + have hi := (norm_eq_iInf_iff_real_inner_le_zero (hcv k) (hy k)).mp (hmin k) + (y l) (hanti hkl (hy l)) + simp only [zero_sub, inner_neg_left, inner_sub_right, real_inner_self_eq_norm_sq] at hi + rw [norm_sub_sq_real, ← real_inner_comm (y l) (y k)] + linarith + have hcy : CauchySeq y := by + have hc := (tendsto_atTop_ciSup hm hb).cauchySeq + rw [Metric.cauchySeq_iff] at hc ⊢ + intro ε hε + obtain ⟨N, hN⟩ := hc (ε ^ 2) (sq_pos_of_pos hε) + refine ⟨N, fun m hm n hn => ?_⟩ + have hmn := hN m hm n hn + rw [Real.dist_eq, abs_sub_lt_iff] at hmn + rw [dist_eq_norm] + rcases le_total m n with h | h + · have := hdiff m n h + rw [norm_sub_rev (y n) (y m)] at this + nlinarith [norm_nonneg (y m - y n)] + · have := hdiff n m h + nlinarith [norm_nonneg (y m - y n)] + obtain ⟨v, hv⟩ := cauchySeq_tendsto_of_complete hcy + refine ⟨v, fun k => (hcl k).mem_of_tendsto hv ?_⟩ + exact (eventually_ge_atTop k).mono fun n hn => hanti hn (hy n) + +omit [CompleteSpace E] in +theorem convex_tail_coefficients (X : ℕ → E) (k : ℕ) (v : E) + (hv : v ∈ convexHull ℝ (X '' Set.Ici k)) : + ∃ (s : Finset ℕ) (c : ℕ → ℝ), + (∀ j ∈ s, k ≤ j) ∧ (∀ j ∈ s, 0 ≤ c j) ∧ + (∑ j ∈ s, c j = 1) ∧ ∑ j ∈ s, c j • X j = v := by + classical + obtain ⟨ι, inst, w, z, hw, hw1, hz, hzv⟩ := mem_convexHull_iff_exists_fintype.mp hv + choose f hf hzf using hz + let s := Finset.univ.image f + let c := fun j => ∑ i ∈ Finset.univ.filter (fun i => f i = j), w i + have hmap : ∀ i ∈ (Finset.univ : Finset ι), f i ∈ s := by simp [s] + refine ⟨s, c, ?_, ?_, ?_, ?_⟩ + · intro j hj + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hj + exact hf i + · intro j _ + exact Finset.sum_nonneg fun i _ => hw i + · exact (Finset.sum_fiberwise_of_maps_to hmap w).trans hw1 + · calc + ∑ j ∈ s, c j • X j = ∑ j ∈ s, ∑ i ∈ Finset.univ.filter (fun i => f i = j), w i • z i := by + apply Finset.sum_congr rfl + intro j _ + rw [show c j = _ from rfl, Finset.sum_smul] + apply Finset.sum_congr rfl + intro i hi + congr 1 + rw [← hzf i, (Finset.mem_filter.mp hi).2] + _ = ∑ i, w i • z i := Finset.sum_fiberwise_of_maps_to hmap _ + _ = v := hzv + +theorem convex_tails_hilbert (X : ℕ → E) + (hX : ∃ C : ℝ, ∀ j, ‖X j‖ ≤ C) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (v : E), + (∀ k j, j ∈ s k → k ≤ j) ∧ + (∀ k j, j ∈ s k → 0 ≤ c k j) ∧ + (∀ k, ∑ j ∈ s k, c k j = 1) ∧ + Tendsto (fun k => ∑ j ∈ s k, c k j • X j) atTop (𝓝 v) := by + rcases hX with ⟨C, hC⟩ + obtain ⟨v, hv⟩ := closed_convex_tail_intersection X C hC + have hex (k) := Metric.mem_closure_iff.mp (hv k) (1 / ((k : ℝ) + 1)) (by positivity) + choose u hu hdist using hex + have hcoef (k) := convex_tail_coefficients X k (u k) (hu k) + choose s c hs hc hsum heq using hcoef + refine ⟨s, c, v, hs, hc, hsum, ?_⟩ + have ht : Tendsto (fun k => dist (u k) v) atTop (𝓝 (0 : ℝ)) := by + apply squeeze_zero (fun k => dist_nonneg) _ tendsto_one_div_add_atTop_nhds_zero_nat + intro k + rw [dist_comm] + exact (hdist k).le + simpa only [heq] using (tendsto_iff_dist_tendsto_zero.mpr ht) + + + +theorem common_convex_tails + (X : ℕ → ℕ → E) (hX : ∀ i, ∃ C : ℝ, ∀ j, ‖X j i‖ ≤ C) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (v : ℕ → E), + (∀ k j, j ∈ s k → k ≤ j) ∧ + (∀ k j, j ∈ s k → 0 ≤ c k j) ∧ + (∀ k, ∑ j ∈ s k, c k j = 1) ∧ + (∀ i, Tendsto (fun k => ∑ j ∈ s k, c k j • X j i) atTop (𝓝 (v i))) := by + classical + choose C hC using hX + have hC0 (i) : 0 ≤ C i := (norm_nonneg (X 0 i)).trans (hC i 0) + let w := fun i => (1 / 2 : ℝ) ^ i / (C i + 1) + have hw (i) : 0 < w i := div_pos (pow_pos (by norm_num) _) (by linarith [hC0 i]) + have hnorm (j i) : ‖w i • X j i‖ ≤ (1 / 2 : ℝ) ^ i := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (hw i)] + change (1 / 2 : ℝ) ^ i / (C i + 1) * ‖X j i‖ ≤ _ + rw [div_mul_eq_mul_div, div_le_iff₀ (by linarith [hC0 i])] + exact mul_le_mul_of_nonneg_left (by linarith [hC i j]) (by positivity) + have hsq (j i) : ‖w i • X j i‖ ^ 2 ≤ (1 / 2 : ℝ) ^ i := by + have hu : (1 / 2 : ℝ) ^ i ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + have hp : 0 ≤ (1 / 2 : ℝ) ^ i := by positivity + have hn := hnorm j i + nlinarith [norm_nonneg (w i • X j i)] + have hsumm (j) : Summable (fun i => ‖w i • X j i‖ ^ 2) := + .of_nonneg_of_le (fun _ => sq_nonneg _) (hsq j) + (summable_geometric_of_abs_lt_one (by norm_num)) + let Y : ℕ → lp (fun _ : ℕ => E) 2 := + fun j => ⟨fun i => w i • X j i, memℓp_gen (by simpa using hsumm j)⟩ + have hY : ∀ j, ‖Y j‖ ≤ 2 := by + intro j + apply lp.norm_le_of_tsum_le (by norm_num) (by norm_num) + change ∑' i, ‖w i • X j i‖ ^ (2 : ℝ) ≤ (2 : ℝ) ^ (2 : ℝ) + simp only [Real.rpow_two] + have hh := (hsumm j).tsum_le_tsum (hsq j) + (summable_geometric_of_abs_lt_one (by norm_num : |(1 / 2 : ℝ)| < 1)) + have he : ∑' i : ℕ, (1 / 2 : ℝ) ^ i = 2 := by + rw [tsum_geometric_of_abs_lt_one (by norm_num)] + norm_num + change ∑' i, ‖w i • X j i‖ ^ 2 ≤ 2 ^ 2 + rw [he] at hh + linarith + obtain ⟨s, c, v, hs, hc, hsum, ht⟩ := convex_tails_hilbert Y ⟨2, hY⟩ + refine ⟨s, c, fun i => (w i)⁻¹ • v i, hs, hc, hsum, fun i => ?_⟩ + have he := ((lp.evalCLM ℝ (fun _ : ℕ => E) 2 i).continuous.tendsto v).comp ht + have him := he.const_smul ((w i)⁻¹) + convert him using 1 + · ext k + simp only [Function.comp_apply, map_sum, map_smul] + change ∑ j ∈ s k, c k j • X j i = + (w i)⁻¹ • ∑ j ∈ s k, c k j • (w i • X j i) + rw [Finset.smul_sum] + apply Finset.sum_congr rfl + intro j _ + rw [← smul_assoc, smul_smul] + have hh : (w i)⁻¹ * c k j * w i = c k j := by + field_simp [(hw i).ne'] + rw [smul_eq_mul, hh] + · rfl + +open MeasureTheory +open scoped ENNReal + +theorem simultaneous_ae_subsequence {Ω F : Type*} [MeasurableSpace Ω] + [PseudoEMetricSpace F] (μ : Measure Ω) (f : ℕ → ℕ → Ω → F) (g : ℕ → Ω → F) + (hf : ∀ i, TendstoInMeasure μ (fun n => f n i) atTop (g i)) : + ∃ ns : ℕ → ℕ, StrictMono ns ∧ + ∀ᵐ ω ∂μ, ∀ i, Tendsto (fun n => f (ns n) i ω) atTop (𝓝 (g i ω)) := by + classical + let r := fun i => ExistsSeqTendstoAe.seqTendstoAeSeq (hf i) + have hr (i) : StrictMono (r i) := ExistsSeqTendstoAe.seqTendstoAeSeq_strictMono (hf i) + let b := fun n => (Finset.range (n+1)).sup (fun i => r i n) + have hb (n i) (hi : i ≤ n) : r i n ≤ b n := by + exact Finset.le_sup (f := fun i => r i n) (Finset.mem_range.mpr (by omega)) + have hbm : Monotone b := by + intro n m hnm + apply Finset.sup_le + intro i hi + exact ((hr i).monotone hnm).trans (hb m i (by simp only [Finset.mem_range] at hi; omega)) + let ns := fun n => n + b n + have hns : StrictMono ns := by + intro n m hnm + have hm := hbm hnm.le + dsimp [ns] + omega + refine ⟨ns, hns, ae_all_iff.mpr fun i => ?_⟩ + let S := fun n => {ω | (2 : ℝ≥0∞)⁻¹ ^ n ≤ edist (f (ns (n+i)) i ω) (g i ω)} + have hS (n) : μ (S n) ≤ (2 : ℝ≥0∞)⁻¹ ^ n := by + apply ExistsSeqTendstoAe.seqTendstoAeSeq_spec (hf i) n (ns (n+i)) + exact ((hr i).monotone (by omega : n ≤ n+i)).trans + ((hb (n+i) i (by omega)).trans (Nat.le_add_left _ _)) + have hfin : (∑' n, μ (S n)) ≠ ∞ := by + apply ne_top_of_le_ne_top _ (ENNReal.tsum_le_tsum hS) + simpa only [ENNReal.tsum_geometric, ENNReal.one_sub_inv_two, inv_inv] using + (ENNReal.ofNat_ne_top (n := 2)) + filter_upwards [ae_eventually_notMem hfin] with ω hω + apply (tendsto_add_atTop_iff_nat i).mp + apply EMetric.tendsto_atTop.mpr + intro ε hε + obtain ⟨N, hN⟩ := eventually_atTop.mp hω + obtain ⟨K, hK⟩ := eventually_atTop.mp + ((ENNReal.tendsto_pow_atTop_nhds_zero_of_lt_one + (by norm_num : (2 : ℝ≥0∞)⁻¹ < 1)).eventually (gt_mem_nhds hε)) + refine ⟨max N K, fun n hn => ?_⟩ + exact (not_le.mp (hN n ((le_max_left _ _).trans hn))).trans + (hK n ((le_max_right _ _).trans hn)) + +theorem coe_Lp_sum_smul {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (s : Finset ℕ) (c : ℕ → ℝ) (X : ℕ → Lp ℝ 2 μ) : + (fun ω => (∑ j ∈ s, c j • X j) ω) =ᵐ[μ] (fun ω => ∑ j ∈ s, c j * X j ω) := by + classical + induction s using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + filter_upwards [Lp.coeFn_zero ℝ 2 μ] with ω hω + exact hω + | @insert j s hj ih => + simp only [Finset.sum_insert hj] + filter_upwards [Lp.coeFn_add (c j • X j) (∑ i ∈ s, c i • X i), + Lp.coeFn_smul (c j) (X j), ih] with ω h1 h2 h3 + simpa only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, h2, h3] using h1 + + +theorem common_L2_convex_tails + {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (X : ℕ → ℕ → Lp ℝ 2 μ) (hX : ∀ i, ∃ C : ℝ, ∀ j, ‖X j i‖ ≤ C) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (v : ℕ → Lp ℝ 2 μ), + (∀ k j, j ∈ s k → k ≤ j) ∧ + (∀ k j, j ∈ s k → 0 ≤ c k j) ∧ + (∀ k, ∑ j ∈ s k, c k j = 1) ∧ + (∀ i, Tendsto (fun k => ∑ j ∈ s k, c k j • X j i) atTop (𝓝 (v i))) ∧ + (∀ᵐ ω ∂μ, ∀ i, + Tendsto (fun k => ∑ j ∈ s k, c k j * X j i ω) atTop (𝓝 (v i ω))) := by + obtain ⟨s, c, v, hs, hc, hsum, ht⟩ := common_convex_tails X hX + let f := fun k i ω => (∑ j ∈ s k, c k j • X j i) ω + obtain ⟨ns, hns, hae⟩ := simultaneous_ae_subsequence μ f (fun i ω => v i ω) + (fun i => tendstoInMeasure_of_tendsto_Lp (ht i)) + refine ⟨s ∘ ns, c ∘ ns, v, ?_, ?_, ?_, ?_, ?_⟩ + · intro k j hj + exact (hns.id_le k).trans (hs (ns k) j hj) + · exact fun k => hc (ns k) + · exact fun k => hsum (ns k) + · exact fun i => (ht i).comp hns.tendsto_atTop + · have he : ∀ᵐ ω ∂μ, ∀ k i, f (ns k) i ω = ∑ j ∈ s (ns k), c (ns k) j * X j i ω := + ae_all_iff.mpr fun k => ae_all_iff.mpr fun i => coe_Lp_sum_smul μ _ _ _ + filter_upwards [hae, he] with ω hω heω + intro i + simpa only [Function.comp_apply, ← heω] using hω i + +end ExactSLEMassExtraction + +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/MassVersionsCore.lean b/lean/OAI/Probability/SLEGauge/MassVersionsCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..959d0ed3f412926c4aca977fdae0a382c8ddae1c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/MassVersionsCore.lean @@ -0,0 +1,430 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.GreenIdentities + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory Filter Topology Set CompactlySupported +open scoped ENNReal NNReal + +namespace SLEExactGauge.MassVersions + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + + +theorem open_countable_tests (U : Set X) (hU : IsOpen U) : + ∃ f : ℕ → C_c(X, ℝ), + (∀ n x, f n x ∈ Icc 0 1) ∧ (∀ n, EqOn (f n) 0 Uᶜ) ∧ + ∀ μ : Measure X, IsFiniteMeasureOnCompacts μ → + μ U = ⨆ n, ENNReal.ofReal (∫ x, f n x ∂μ) := by + classical + let : LocallyCompactSpace U := hU.locallyCompactSpace + let K := CompactExhaustion.choice U + let A : ℕ → Set X := fun n => Subtype.val '' K n + have hAc (n : ℕ) : IsCompact (A n) := (K.isCompact n).image continuous_subtype_val + have hAU (n : ℕ) : A n ⊆ U := by + rintro x ⟨y, hy, rfl⟩ + exact y.2 + choose g hg1 hg0 hgc hg01 using fun n => + exists_continuous_one_zero_of_isCompact (hAc n) hU.isClosed_compl + (disjoint_compl_right_iff_subset.mpr (hAU n)) + let f : ℕ → C_c(X, ℝ) := fun n => ⟨g n, hgc n⟩ + refine ⟨f, hg01, hg0, fun μ hμ => ?_⟩ + let := hμ + have hmono : Monotone A := fun n m h => image_mono (K.subset h) + have hcover : ⋃ n, A n = U := by + ext x + constructor + · intro hx + obtain ⟨n, hn⟩ := mem_iUnion.mp hx + exact hAU n hn + · intro hx + obtain ⟨n, hn⟩ := K.exists_mem ⟨x, hx⟩ + exact mem_iUnion.mpr ⟨n, ⟨⟨x, hx⟩, hn, rfl⟩⟩ + apply le_antisymm + · rw [← hcover, hmono.measure_iUnion] + apply iSup_mono + intro n + apply (f n).integrable.measure_le_integral + · exact Eventually.of_forall (fun x => (hg01 n x).1) + · intro x hx + exact le_of_eq ((hg1 n hx).symm) + · apply iSup_le + intro n + exact integral_le_measure (fun x _ => (hg01 n x).2) (fun x hx => (hg0 n hx).le) + + + +theorem measurable_measure_of_compact_tests {Ω : Type*} [MeasurableSpace Ω] + (μ : Ω → Measure X) [∀ ω, IsFiniteMeasureOnCompacts (μ ω)] + (hμ : ∀ f : C_c(X, ℝ), Measurable (fun ω => ∫ x, f x ∂μ ω)) : + Measurable μ := by + classical + have hopen (U : Set X) (hU : IsOpen U) : Measurable (fun ω => μ ω U) := by + obtain ⟨f, -, -, hf⟩ := open_countable_tests U hU + have he (ω : Ω) := hf (μ ω) inferInstance + simp_rw [he] + exact Measurable.iSup (fun n => (hμ (f n)).ennreal_ofReal) + let K := CompactExhaustion.choice X + let V : ℕ → Set X := fun n => interior (K n) + have hV (n : ℕ) : IsOpen (V n) := isOpen_interior + have hVmono : Monotone V := fun n m h => interior_mono (K.subset h) + have hVcover : ⋃ n, V n = univ := by + apply iUnion_eq_univ_iff.mpr + intro x + obtain ⟨n, hn⟩ := K.exists_mem x + exact ⟨n+1, K.subset_interior_succ n hn⟩ + have hm (n : ℕ) : Measurable (fun ω => (μ ω).restrict (V n)) := by + have (ω : Ω) : IsFiniteMeasure ((μ ω).restrict (V n)) := by + refine ⟨?_⟩ + rw [Measure.restrict_apply_univ] + exact (measure_mono interior_subset).trans_lt (K.isCompact n).measure_lt_top + refine Measurable.measure_of_isPiSystem + (μ := fun ω => (μ ω).restrict (V n)) + (S := {s : Set X | IsOpen s}) ?_ + (fun s hs t ht _ => hs.inter ht) ?_ ?_ + · exact BorelSpace.measurable_eq (α := X) + · intro U hU + simp_rw [Measure.restrict_apply hU.measurableSet] + exact hopen (U ∩ V n) (hU.inter (hV n)) + · simp_rw [Measure.restrict_apply_univ] + exact hopen (V n) (hV n) + apply Measure.measurable_of_measurable_coe + intro U hU + have he (ω : Ω) : μ ω U = ⨆ n, ((μ ω).restrict (V n)) U := by + simp_rw [Measure.restrict_apply hU] + have hmono : Monotone (fun n => U ∩ V n) := fun n m h => inter_subset_inter_right U (hVmono h) + rw [← hmono.measure_iUnion, ← inter_iUnion, hVcover, inter_univ] + simp_rw [he] + exact Measurable.iSup (fun n => (Measure.measurable_coe hU).comp (hm n)) + + +noncomputable def determiningTests : ℕ → C_c(X, ℝ) := + Classical.choose (ExactSLEMassExtraction.determining_tests_radon_limit X) + + + +def TestConverges (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) : Prop := + ∀ i, ∃ v : ℝ, Tendsto (fun j => L j (determiningTests i)) atTop (𝓝 v) + +lemma exists_radon_of_testConverges (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) + (h : TestConverges L) : + ∃ μ : Measure X, IsFiniteMeasureOnCompacts μ ∧ μ.Regular ∧ + ∀ f : C_c(X, ℝ), Tendsto (fun j => L j f) atTop (𝓝 (∫ x, f x ∂μ)) := + (Classical.choose_spec (ExactSLEMassExtraction.determining_tests_radon_limit X)) L h + + + +noncomputable def radonLimit (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) : Measure X := by + classical + exact if h : TestConverges L then Classical.choose (exists_radon_of_testConverges L h) else 0 + +lemma radonLimit_finite (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) : + IsFiniteMeasureOnCompacts (radonLimit L) := by + classical + unfold radonLimit + split_ifs with h + · exact (Classical.choose_spec (exists_radon_of_testConverges L h)).1 + · infer_instance + +lemma radonLimit_regular (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) : + (radonLimit L).Regular := by + classical + unfold radonLimit + split_ifs with h + · exact (Classical.choose_spec (exists_radon_of_testConverges L h)).2.1 + · infer_instance + +lemma tendsto_radonLimit (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) (h : TestConverges L) + (f : C_c(X, ℝ)) : + Tendsto (fun j => L j f) atTop (𝓝 (∫ x, f x ∂radonLimit L)) := by + classical + simpa only [radonLimit, dite_eq_left h] using + (Classical.choose_spec (exists_radon_of_testConverges L h)).2.2 f + +lemma radonLimit_eq (L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) + (μ : Measure X) [μ.Regular] + (h : ∀ f : C_c(X, ℝ), Tendsto (fun j => L j f) atTop (𝓝 (∫ x, f x ∂μ))) : + radonLimit L = μ := by + have hr := radonLimit_regular L + have hconv : TestConverges L := fun i => ⟨_, h (determiningTests i)⟩ + exact Measure.ext_of_integral_eq_on_compactlySupported + (fun f => tendsto_nhds_unique (tendsto_radonLimit L hconv f) (h f)) + +lemma measurableSet_testConverges {Ω : Type*} [MeasurableSpace Ω] + (L : Ω → ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) + (hL : ∀ j (f : C_c(X, ℝ)), Measurable (fun ω => L ω j f)) : + MeasurableSet {ω | TestConverges (L ω)} := by + simp only [TestConverges, ofPred_forall] + exact MeasurableSet.iInter (fun i => measurableSet_exists_tendsto + (fun j => hL j (determiningTests i))) + + + +theorem measurable_radonLimit {Ω : Type*} [MeasurableSpace Ω] + (L : Ω → ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) + (hL : ∀ j (f : C_c(X, ℝ)), Measurable (fun ω => L ω j f)) : + Measurable (fun ω => radonLimit (L ω)) := by + classical + have (ω : Ω) := radonLimit_finite (L ω) + apply measurable_measure_of_compact_tests + intro f + let G := {ω | TestConverges (L ω)} + have he : (fun ω => ∫ x, f x ∂radonLimit (L ω)) = + G.piecewise (fun ω => limsup (fun j => L ω j f) atTop) (fun _ => 0) := by + funext ω + by_cases h : ω ∈ G + · rw [piecewise_eq_of_mem G _ _ h] + exact (tendsto_radonLimit (L ω) h f).limsup_eq.symm + · simp [radonLimit, G] at h ⊢ + simp [h] + rw [he] + exact (Measurable.limsup (fun j => hL j f)).piecewise + (measurableSet_testConverges L hL) measurable_const + + + +theorem radonLimit_ae_eq {Ω : Type*} [MeasurableSpace Ω] (W : Measure Ω) + {I : Type*} (L : I → Ω → ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) + (μ : I → Ω → Measure X) [∀ i ω, (μ i ω).Regular] + (h : ∀ᵐ ω ∂W, ∀ i (f : C_c(X, ℝ)), + Tendsto (fun j => L i ω j f) atTop (𝓝 (∫ x, f x ∂μ i ω))) : + ∀ᵐ ω ∂W, ∀ i, radonLimit (L i ω) = μ i ω := by + filter_upwards [h] with ω hω + exact fun i => radonLimit_eq (L i ω) (μ i ω) (hω i) + +end SLEExactGauge.MassVersions +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma level_step_le_one (a : ℝ) (ha : 1/4 < a) (j : ℕ) : + Real.exp (-2*a*((j:ℝ)+1)) ≤ 1 := by + apply Real.exp_le_one_iff.mpr + have ha0 : 0 < a := by linarith + have hj0 : (0:ℝ) ≤ j := Nat.cast_nonneg _ + nlinarith + + +noncomputable def actualMassFunctionals (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j ∈ s k → 0 ≤ c k j) + (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : ℕ → (C_c(UpperPlane, ℝ) →ₚ[ℝ] ℝ) := + fun k => positive_mass_combination + (fun j => actualUpperMass a (Real.exp (-2*a*((j:ℝ)+1))) t b) + (fun j => actualUpperMass_finiteOnCompacts a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) t b) (s k) (c k) (hc k) + +lemma actualMassFunctionals_apply (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j ∈ s k → 0 ≤ c k j) + (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) (k : ℕ) (f : C_c(UpperPlane, ℝ)) : + actualMassFunctionals a ha s c hc t b k f = + ∑ j ∈ s k, c k j * ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*((j:ℝ)+1))) t b := + positive_mass_combination_apply _ _ _ _ _ _ + + + +noncomputable def recoveredMass (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j ∈ s k → 0 ≤ c k j) + (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : Measure UpperPlane := + radonLimit (actualMassFunctionals a ha s c hc t b) + +lemma recoveredMass_measurable (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j ∈ s k → 0 ≤ c k j) + (t : ℝ≥0∞) : Measurable (recoveredMass a ha s c hc t) := by + apply measurable_radonLimit + intro k f + simp_rw [actualMassFunctionals_apply] + apply Finset.measurable_sum + intro j hj + exact measurable_const.mul (actualUpperMass_eval_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) t f) + +lemma recoveredMass_raw_measurable (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j ∈ s k → 0 ≤ c k j) + (t : ℝ≥0) : Measurable[rawFiltration t] (recoveredMass a ha s c hc t) := by + apply @measurable_radonLimit _ _ _ _ _ _ _ _ (rawFiltration t) + intro k f + simp_rw [actualMassFunctionals_apply] + apply Finset.measurable_sum + intro j hj + exact measurable_const.mul (actualUpperMass_eval_raw_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) t f) + + + +theorem actual_radon_measurable_conditional (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i, Measurable (fun b => μ b i)) ∧ + (∀ i (t₀ : ℝ≥0), t i=t₀ → Measurable[rawFiltration t₀] (fun b => μ b i)) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ b i) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → ∀ f : C_c(UpperPlane,ℝ), + (∫b, (∫z,f z∂μ b i) ∂W) = ∫z : UpperPlane, + f z * (Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea) ∧ + (∀ i j (t₀ : ℝ≥0), t i=t₀ → t j=∞ → ∀ f : C_c(UpperPlane,ℝ), + ∀ U : Set ExactSLEGenerator.Driver, MeasurableSet[rawFiltration t₀] U → + (∫b in U, (∫z,f z∂μ b j)-(∫z,f z∂μ b i) ∂W) = + ∫b in U, (∫z : UpperPlane,f z*survivingGreen a t₀ b z.1 ∂upperArea) ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) := by + obtain ⟨s,c,ν,hs,hc,hsum,hν,hmom,hL1,hmean,-,hcond,h⟩ := + actual_radon_compact_conditional a ha W hW t + let μ := fun b i => recoveredMass a ha s c hc (t i) b + have he : ∀ᵐ b ∂W, ∀ i, μ b i = ν b i := by + filter_upwards [h] with b hb + intro i + have := (hν b i).2 + apply radonLimit_eq + intro f + simpa only [actualMassFunctionals_apply] using hb.2 i f + have heI (i : ℕ) (f : C_c(UpperPlane, ℝ)) : + (fun b => ∫z, f z∂μ b i) =ᵐ[W] (fun b => ∫z, f z∂ν b i) := by + filter_upwards [he] with b hb + rw [hb i] + refine ⟨s,c,μ,hs,hc,hsum,?_,?_,?_,?_,?_,?_,?_,?_⟩ + · exact fun b i => ⟨radonLimit_finite _, radonLimit_regular _⟩ + · exact fun i => recoveredMass_measurable a ha s c hc (t i) + · intro i t₀ hi + dsimp [μ] + rw [hi] + exact recoveredMass_raw_measurable a ha s c hc t₀ + · intro i f m + exact ((memLp_congr_ae (heI i f)).mpr (hmom i f m)) + · intro i f + have hnorm (k : ℕ) : + eLpNorm (fun b => (∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) - ∫z,f z∂μ b i) 1 W = + eLpNorm (fun b => (∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) - ∫z,f z∂ν b i) 1 W := + eLpNorm_congr_ae (EventuallyEq.sub (Filter.EventuallyEq.refl _ _) (heI i f)) + simpa only [hnorm] using hL1 i f + · intro i hi f + exact (integral_congr_ae (heI i f)).trans (hmean i hi f) + · intro i j t₀ hi hj f U hU + exact (integral_congr_ae (ae_restrict_of_ae ((heI j f).sub (heI i f)))).trans + (hcond i j t₀ hi hj f U hU) + · filter_upwards [he,h] with b hb hb' + simpa only [hb] using hb' + +end ExactSLEGreen +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + +lemma timeMassDensity_joint_measurable (a : ℝ) (ha : 1/4 + timeMassDensity a q p.1.1 p.1.2 p.2) := by + let U : Set ((ℝ≥0∞ × ExactSLEGenerator.Driver) × ℂ) := {p | 0 ENNReal.ofReal (Real.exp (-alpha a*Real.log 2)* + (if radialTime a p.1.1.2.1 p.1.2 (p.1.2.im*q)≤p.1.1.1 then + radialWeight a p.1.1.2.1 p.1.2 (p.1.2.im*q) else 0))) := by + have hp : Measurable (fun p : U => + ((p.1.1.2, (⟨p.1.2,p.2⟩ : {z : ℂ // 0 0) measurable_const hU + convert h using 1 + funext p + have he : 2*p.2.im*q/2=p.2.im*q := by ring + by_cases hz : 0 + by_cases ht : radialTime a p.1.2.1 p.2 (p.2.im*q)≤p.1.1 <;> + simp [timeMassDensity,massDensity,fullRadialDensity,U,hz,ht,he] + + + +lemma timeMassDensity_raw_progressive_joint (a : ℝ) (ha : 1/4 + timeMassDensity a q p.1.1.1 p.1.2 p.2) := by + have h := timeMassDensity_joint_measurable a ha q hq hq1 + have hb := pastDriver_raw_measurable T + let mD : MeasurableSpace ExactSLEGenerator.Driver := inferInstance + let : MeasurableSpace ExactSLEGenerator.Driver := rawFiltration T + have hp : @Measurable ((Iic T × ExactSLEGenerator.Driver) × ℂ) + ((ℝ≥0∞ × ExactSLEGenerator.Driver) × ℂ) inferInstance + ((ENNReal.measurableSpace.prod mD).prod (borel ℂ)) + (fun p => (((p.1.1.1 : ℝ≥0∞), pastDriver T p.1.2),p.2)) := + (((measurable_subtype_coe.comp (measurable_fst.comp measurable_fst)).coe_nnreal_ennreal).prodMk + (hb.comp (measurable_snd.comp measurable_fst))).prodMk measurable_snd + convert h.comp hp using 1 + funext p + exact timeMassDensity_driver_congr a (by linarith) q hq hq1 + p.1.2 (pastDriver T p.1.2) p.1.1.1 + (fun s hs => (pastDriver_eq T p.1.2 s (hs.trans p.1.1.2)).symm) p.2 + +lemma actualMassEval_progressive (a : ℝ) (ha : 1/4 actualMassEval a q t K f) := by + intro T + have hD := timeMassDensity_raw_progressive_joint a ha q hq hq1 T + let : MeasurableSpace ExactSLEGenerator.Driver := rawFiltration T + have hm : Measurable (fun p : (Iic T × ExactSLEGenerator.Driver) × ℂ => + f p.2*(timeMassDensity a q p.1.1.1 p.1.2 p.2).toReal) := + (hf.comp measurable_snd).mul hD.ennreal_toReal + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +lemma actualUpperMass_eval_progressive (a : ℝ) (ha : 1/4 fun b => ∫z, f z ∂actualUpperMass a q t b) := by + simp_rw [actualUpperMass_eval a ha q hq hq1] + exact actualMassEval_progressive a ha q hq hq1 _ _ (upperExtension_measurable f) + + + +theorem recoveredMass_progressive (a : ℝ) (ha : 1/4 < a) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) (hc : ∀ k j, j∈s k → 0≤c k j) : + IsProgressive rawFiltration + (fun t : ℝ≥0 => recoveredMass a ha s c hc t) := by + intro T + apply @measurable_radonLimit _ _ _ _ _ _ _ _ + (Subtype.instMeasurableSpace.prod (rawFiltration T)) + intro k f + simp_rw [actualMassFunctionals_apply] + apply Finset.measurable_sum + intro j hj + exact measurable_const.mul + (actualUpperMass_eval_progressive a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) f T) + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ModelCandidates.lean b/lean/OAI/Probability/SLEGauge/ModelCandidates.lean new file mode 100644 index 0000000000000000000000000000000000000000..174345bf30f45a84b6e93ea19cd0e54336c0bebb --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ModelCandidates.lean @@ -0,0 +1,578 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.AdaptedFailure + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart LoewnerGeometry CompactSequence MomentBatches + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4M.spatialMass b A) := + spatialRestriction_measurable _ M.canonical.terminal_measurable _ MeasurableSet.univ _ hA + + +def candidate (n i : ℕ) (z : ℂ) (b : GDriver) : Prop := + ENNReal.ofReal (M.candidateLower*M.testThreshold n i*(batchRadius a (M.batchLevel n) n i)^(2-alpha a)) ≤ + M.spatialMass b (closedBall z (M.candidateScale*batchRadius a (M.batchLevel n) n i)) + +lemma candidate_measurable (n i : ℕ) (z : ℂ) : MeasurableSet {b | M.candidate n i z b} := + measurableSet_le measurable_const (M.spatialMass_measurable _ measurableSet_closedBall) + + + +lemma success_implies_candidate (z : ℂ) (hz : 0M.success_implies_candidate z hz n i + ((batchBoundary_start a z.im (by linarith) hz _ _ hr hy i).1.trans + (batchBoundary_le a z.im (by linarith) hz _ _ hr hy i))) + filter_upwards [hs] with b hb hn i hi hsu + exact hn ⟨i,hi,hb i hsu⟩ + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry + +lemma diskAt_norm_le_one {w v : ℂ} (hw : 0diskAt (f z) (f w) + have hd : DifferentiableOn ℂ g (ball z r) := by + intro w hw + exact ((diskAt_hasDerivAt (hpos z hz) (hpos w hw)).differentiableAt.comp_differentiableWithinAt + w (hf w hw)) + have hzero : g z=0 := by simp [g,diskAt] + have hm : MapsTo g (ball z r) (closedBall (g z) 1) := by + intro w hw + simpa only [mem_closedBall,hzero,dist_zero_right] using diskAt_norm_le_one (hpos z hz) (hpos w hw) + have hs := Complex.dist_le_div_mul_dist_of_mapsTo_ball hd hm hv' + rw [hzero,dist_zero_right] at hs + have hg : ‖g v‖≤1/2 := hs.trans (by + calc + _ ≤ (1/r)*(r/2) := mul_le_mul_of_nonneg_left hv (by positivity) + _ = _ := by field_simp) + have hden : 0<‖f v-star (f z)‖ := norm_pos_iff.mpr (diskAt_denominator_ne (hpos z hz) (hpos v hv')) + have hnum : ‖f v-f z‖≤(1/2)*‖f v-star (f z)‖ := by + exact (div_le_iff₀ hden).mp (show ‖f v-f z‖/‖f v-star (f z)‖≤1/2 by + simpa only [g,diskAt,norm_div] using hg) + have hu : ‖f v-star (f z)‖≤‖f v-f z‖+2*(f z).im := by + calc + _ = ‖(f v-f z)+(f z-star (f z))‖ := by congr 1; ring + _ ≤ ‖f v-f z‖+‖f z-star (f z)‖ := norm_add_le _ _ + _ = _ := by + rw [show f z-star (f z)=((2*(f z).im:ℝ):ℂ)*Complex.I by + apply Complex.ext <;> simp; ring,norm_mul,Complex.norm_real,Real.norm_eq_abs, + abs_of_pos (mul_pos (by norm_num) (hpos z hz)),Complex.norm_I,mul_one] + have hi := Complex.im_le_norm (f v-f z) + rw [Complex.sub_im] at hi + linarith + +end SLEExactGauge.LoewnerGeometry +end +end + + + +section + + +noncomputable section +open Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain ExactSLEGreen LoewnerRestart FlowIdentification + + + +theorem alive_of_height_floor (a : ℝ) {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {ε : ℝ} (hε : 0<ε) (hz : ε≤z.im) + (hfloor : ∀s≤T,alive a b s z → ε≤(loewnerMap a b s z).im) : + alive a b T z := by + have hη : 0<ε/2 := half_pos hε + obtain ⟨F,hFc,hFe⟩ := exists_cutoff_loewner a (ε/2) hη b hb + have hF0 : F 0 z=z := by simpa using hFe z 0 + let H : ℝ→ℝ := fun t=>(F t.toNNReal z).im + have hc : Continuous H := Complex.continuous_im.comp ((hFc z).comp continuous_real_toNNReal) + have he0 : H 0=z.im := by simp [H,hF0] + have hode (s : ℝ≥0) (hs : ∀u∈Icc (0:ℝ) s,ε/2≤H u) : + odeUntil a b z s (fun u=>F u.toNNReal z) := by + refine ⟨by simpa using hF0,?_⟩ + intro u hu + have hi := hs u hu + refine ⟨hη.trans_le hi,?_⟩ + have hd := cutoff_loewner_hasDerivWithinAt hη hb hFc hFe z s u hu + have hh : heightClamp (ε/2) (F u.toNNReal z-(b u.toNNReal:ℂ))= + F u.toNNReal z-(b u.toNNReal:ℂ) := heightClamp_eq (by simpa [H] using hi) + simpa only [cutoffVector,hh] using hd + have hs : ∀u∈Icc (0:ℝ) T,ε/2≤H u := by + by_contra! hn + obtain ⟨u,hu,hlow⟩ := hn + let S : Set ℝ := Icc 0 T ∩ {t | H t≤ε/2} + have hS : IsCompact S := isCompact_Icc.inter_right (isClosed_le hc continuous_const) + obtain ⟨s,hs⟩ := hS.exists_isLeast ⟨u,hu,hlow.le⟩ + have hs0 : 0hpref' ht) + have hh := hfloor s' hs.1.1.2 ⟨_,ho⟩ + rw [loewnerMap_eq ho] at hh + change ε≤H s at hh + have hsH : H s≤ε/2 := hs.1.2 + linarith + exact ⟨_,hode T hs⟩ + + +lemma loewnerMap_height_antitone {a : ℝ} (ha : 0≤a) {b : ℝ≥0→ℝ} + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {s t : ℝ≥0} (hs : s≤t) (ht : t≤T) : + (loewnerMap a b t z).im≤(loewnerMap a b s z).im := by + obtain ⟨f,hf⟩ := hT + have hc := Complex.continuous_im.comp_continuousOn (odeUntil_continuousOn hf) + have hd (u : ℝ) (hu : u∈Icc (0:ℝ) T) : + HasDerivWithinAt (fun u=>(f u).im) + (-a*(f u).im/Complex.normSq (f u-(b u.toNNReal:ℂ))) (Icc (0:ℝ) T) u := by + have hh := Complex.imCLM.hasFDerivAt.comp_hasDerivWithinAt u (hf.2 u hu).2 + convert! hh using 1 + simp only [Complex.imCLM_apply,Complex.div_im,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,zero_div,zero_sub,Complex.sub_im,sub_zero] + ring + have hm : AntitoneOn (fun u=>(f u).im) (Icc (0:ℝ) T) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 (T:ℝ)) hc + (fun u hu=>(hd u (interior_subset hu)).mono interior_subset) + (fun u hu=>div_nonpos_of_nonpos_of_nonneg + (mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr ha) (hf.2 u (interior_subset hu)).1.le) + (Complex.normSq_nonneg _)) + rw [loewnerMap_eq (odeUntil_mono hf ht),loewnerMap_eq (odeUntil_mono hf (hs.trans ht))] + exact hm ⟨s.coe_nonneg,show (s:ℝ)≤T from hs.trans ht⟩ ⟨t.coe_nonneg,ht⟩ hs + + + +theorem center_alive_of_ball_survival {a : ℝ} (ha : 0(hasDerivAt_loewnerMap b.1.continuous (hball s hs hsz hw)).differentiableAt.differentiableWithinAt + have hh := halfPlane_harnack_ball hr hd + (fun w hw=>loewnerMap_im_pos (hball s hs hsz hw)) hv + have hm := loewnerMap_height_antitone ha.le hT hs le_rfl + exact (min_le_right z.im _).trans ((div_le_iff₀ (by norm_num : (0:ℝ)<3)).mpr (by linarith)) + +end SLEExactGauge.LoewnerGeometry +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain ExactSLEGreen LoewnerRestart FlowIdentification + + + +theorem frontier_avoids_ball_of_no_crossing {a : ℝ} (ha : 0hball s hs) _ hvT + have hh := mem_ball.mp hv + linarith + apply Set.disjoint_left.mpr + intro v hv hf + have hc := frontier_subset_closure hf + obtain ⟨w,hw,hws⟩ := mem_closure_iff_nhds.mp hc (ball z (2*r)) (isOpen_ball.mem_nhds hv) + exact Set.disjoint_left.mp hd hw hws + + + +theorem radial_crossing_of_frontier_visit {a : ℝ} (ha : 0b.1 t) W) + (z : ℂ) (hz : 0.trans' (by norm_num) + +lemma cleanup_far [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0Classical.epsilon (fun U : ι n→Set ℂ=> + (∀i,ediam (U i)≤r n) ∧ E⊆⋃i,U i ∧ + (∑'i,diameterCost h (ediam (U i)))≤C n) + have hU : ∀ᶠ n in atTop,(∀i,ediam (U n i)≤r n) ∧ E⊆⋃i,U n i ∧ + (∑'i,diameterCost h (ediam (U n i)))≤C n := by + filter_upwards [hcovers] with n hn + exact Classical.epsilon_spec hn + exact hausdorff_le_liminf_bound h E r hr U C (hU.mono fun _ hn=>hn.1) + (hU.mono fun _ hn=>hn.2.1) (hU.mono fun _ hn=>hn.2.2) + + + +theorem liminf_cost_bound {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (C : ℕ→Ω→ℝ≥0∞) (hC : ∀n,Measurable (C n)) (B : ℝ≥0∞) + (hB : B<∞) (hbound : ∀ᶠ n in atTop,(∫⁻ω,C n ω∂P) ≤ B) : + Measurable (fun ω=>liminf (fun n=>C n ω) atTop) ∧ + (∫⁻ω,liminf (fun n=>C n ω) atTop∂P) ≤ B ∧ + ∀ᵐ ω∂P,liminf (fun n=>C n ω) atTop<∞ := by + have hmeas := Measurable.liminf hC + have hI : (∫⁻ω,liminf (fun n=>C n ω) atTop∂P) ≤ B := + (lintegral_liminf_le hC).trans (liminf_le_of_frequently_le hbound.frequently) + exact ⟨hmeas,hI,ae_lt_top hmeas (hI.trans_lt hB).ne⟩ + + + +theorem ae_hausdorff_finite_of_covers {Ω : Type*} [MeasurableSpace Ω] + {ι : ℕ→Type*} [∀n,Countable (ι n)] + (P : Measure Ω) (h : ℝ→ℝ) (E : Ω→Set ℂ) + (r : ℕ→ℝ≥0∞) (hr : Tendsto r atTop (𝓝 0)) + (U : ∀n,Ω→ι n→Set ℂ) (C : ℕ→Ω→ℝ≥0∞) + (hC : ∀n,Measurable (C n)) (B : ℝ≥0∞) (hB : B<∞) + (hbound : ∀ᶠ n in atTop,(∫⁻ω,C n ω∂P) ≤ B) + (hdiam : ∀ᵐ ω∂P,∀ᶠ n in atTop,∀i,ediam (U n ω i) ≤ r n) + (hcover : ∀ᵐ ω∂P,∀ᶠ n in atTop,E ω ⊆ ⋃i,U n ω i) + (hcost : ∀ᵐ ω∂P,∀ᶠ n in atTop,(∑'i,diameterCost h (ediam (U n ω i))) ≤ C n ω) : + (∀ᵐ ω∂P,Target.hausdorff h (E ω) ≤ liminf (fun n=>C n ω) atTop) ∧ + (∫⁻ω,liminf (fun n=>C n ω) atTop∂P) ≤ B ∧ + ∀ᵐ ω∂P,Target.hausdorff h (E ω)<∞ := by + obtain ⟨hmeas,hI,hfin⟩ := liminf_cost_bound P C hC B hB hbound + have hdom : ∀ᵐ ω∂P,Target.hausdorff h (E ω) ≤ liminf (fun n=>C n ω) atTop := by + filter_upwards [hdiam,hcover,hcost] with ω hd hc hb + exact hausdorff_le_liminf_bound h (E ω) r hr (fun n=>U n ω) (fun n=>C n ω) hd hc hb + exact ⟨hdom,hI,by filter_upwards [hdom,hfin] with ω hd hf; exact hd.trans_lt hf⟩ + +end SLEExactGauge.CoverCost +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ModelFiniteTests.lean b/lean/OAI/Probability/SLEGauge/ModelFiniteTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..00beac4ba7214a9928fdbd857d666dfb4387d64c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ModelFiniteTests.lean @@ -0,0 +1,559 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TailBatches + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator LoewnerRestart CompactSequence + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4subdiskMass a M.mass (subdiskRadius M.radiusIndex) l (θ,b)) := by + let (v : ℝ≥0∞) (b : GDriver) : IsFiniteMeasureOnCompacts (M.mass v b) := M.canonical.finite_compact v b + exact subdiskMass_raw_measurable _ a ha M.mass θ l + (M.canonical.optional_measurable _ (centeredTime_stopping a ha θ l)) + +lemma subdisk_ge_law (l : ℕ) (H : ℝ≥0∞) : + (finiteAngleLaw W a l) {p | H ≤ subdiskMass a M.mass (subdiskRadius M.radiusIndex) l p}= + M.law {x | H ≤ x l} := by + have he := lintegral_coordinate M.law (finiteAngleLaw W a l) + (subdiskMass a M.mass (subdiskRadius M.radiusIndex)) M.subdisk_measurable l (M.finite_laws l) + ((Ici H).indicator (fun _=>(1:ℝ≥0∞))) (measurable_const.indicator measurableSet_Ici) + have he₁ : (fun x : ℕ→ℝ≥0∞=>(Ici H).indicator (fun _=>(1:ℝ≥0∞)) (x l))= + {x : ℕ→ℝ≥0∞ | H ≤ x l}.indicator (fun _=>(1:ℝ≥0∞)) := by ext x; rfl + have he₂ : (fun p=>(Ici H).indicator (fun _=>(1:ℝ≥0∞)) + (subdiskMass a M.mass (subdiskRadius M.radiusIndex) l p))= + {p | H ≤ subdiskMass a M.mass (subdiskRadius M.radiusIndex) l p}.indicator (fun _=>(1:ℝ≥0∞)) := by ext x; rfl + rw [he₁,he₂,lintegral_indicator (measurableSet_le measurable_const (measurable_pi_apply l)), + lintegral_indicator (measurableSet_le measurable_const (M.subdisk_measurable l)),lintegral_one,lintegral_one,Measure.restrict_apply_univ,Measure.restrict_apply_univ] at he + exact he.symm + +lemma subdisk_tail_le (l : ℕ) (H : ℝ) (_hH : 0 ≤ H) : + (finiteAngleLaw W a l) {p | ENNReal.ofReal H ≤ subdiskMass a M.mass (subdiskRadius M.radiusIndex) l p} ≤ + M.law {x | H ≤ sequenceMassReal x} := by + rw [M.subdisk_ge_law] + apply measure_mono_ae + filter_upwards [M.increasing_finite] with x hx + intro hh + exact (ENNReal.ofReal_le_iff_le_toReal hx.2.ne).mp (hh.trans (le_iSup x l)) + + + +lemma normalized_tail_le [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0(1:ℝ≥0∞))) + (measurable_const.indicator hE)).2 + have he : LoewnerRestart.normalizedTest a z σ (E.indicator (fun _=>(1:ℝ≥0∞)))= + {b | ENNReal.ofReal H ≤ LoewnerRestart.normalizedTest a z σ + (subdiskMass a M.mass (subdiskRadius M.radiusIndex) l) b}.indicator (fun _=>(1:ℝ≥0∞)) := by + funext b + rfl + have := radialLaw_probability W hW a ha z hz (σ*Real.exp (-2*a*l)) + (mul_pos hσ (Real.exp_pos _)) ((mul_le_of_le_one_right hσ.le + (Real.exp_le_one_iff.mpr (by have := Nat.cast_nonneg (α:=ℝ) l; nlinarith))).trans hσz) + rw [he,setLIntegral_univ,lintegral_indicator hF,lintegral_indicator hE,lintegral_one,lintegral_one, + Measure.restrict_apply_univ,Measure.restrict_apply_univ,measure_univ,mul_one] at hh + exact hh.trans (by gcongr; exact M.subdisk_tail_le l H hH) + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain + +lemma hasDerivWithinAt_primitive_Icc {f : ℝ→ℂ} {T u : ℝ} (hT : 0≤T) + (hf : ContinuousOn f (Icc 0 T)) (hu : u∈Icc 0 T) : + HasDerivWithinAt (fun v=>∫s in (0:ℝ)..v,f s) (f u) (Icc 0 T) u := by + let F : ℝ→ℂ := fun s=>f (projIcc 0 T hT s) + have hF : Continuous F := hf.domRestrict.comp continuous_projIcc + have he (s : ℝ) (hs : s∈Icc 0 T) : F s=f s := by + dsimp [F]; rw [projIcc_of_mem _ hs] + have hi (v : ℝ) (hv : v∈Icc 0 T) : (∫s in (0:ℝ)..v,F s)=∫s in (0:ℝ)..v,f s := by + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le hv.1] at hs + exact he s ⟨hs.1,hs.2.trans hv.2⟩ + have hd := intervalIntegral.integral_hasDerivAt_right + (hF.intervalIntegrable 0 u) hF.aestronglyMeasurable.stronglyMeasurableAtFilter hF.continuousAt + rw [he u hu] at hd + exact hd.hasDerivWithinAt.congr_of_mem (fun v hv=>(hi v hv).symm) hu + + +def logVariation (a : ℝ) (b : ℝ≥0→ℝ) (z : ℂ) (u : ℝ) : ℂ := + ∫s in (0:ℝ)..u,-(a:ℂ)/(loewnerMap a b s.toNNReal z-(b s.toNNReal:ℂ))^2 + +def firstVariation (a : ℝ) (b : ℝ≥0→ℝ) (z : ℂ) (u : ℝ) : ℂ := + Complex.exp (logVariation a b z u) + +lemma firstVariation_eq_deriv {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {u : ℝ≥0} (hu : alive a b u z) : + firstVariation a b z u=deriv (loewnerMap a b u) z := + (hasDerivAt_loewnerMap hb hu).deriv.symm + +lemma logVariation_hasDerivWithinAt {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : + HasDerivWithinAt (logVariation a b z) + (-(a:ℂ)/(loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))^2) (Icc 0 (T:ℝ)) u := by + obtain ⟨f,hf⟩ := hT + apply hasDerivWithinAt_primitive_Icc T.coe_nonneg _ hu + have hc : ContinuousOn (fun s:ℝ=>-(a:ℂ)/(f s-(b s.toNNReal:ℂ))^2) (Icc 0 (T:ℝ)) := + continuousOn_const.div ((odeUntil_center_continuousOn hb hf).pow 2) + (fun s hs=>pow_ne_zero _ (odeUntil_center_ne_zero hf hs)) + exact hc.congr (fun s hs=>by rw [loewnerMap_eq_solution_time hf hs]) + +lemma firstVariation_hasDerivWithinAt {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : + HasDerivWithinAt (firstVariation a b z) + (-(a:ℂ)/(loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))^2 * firstVariation a b z u) + (Icc 0 (T:ℝ)) u := by + convert! (logVariation_hasDerivWithinAt hb hT hu).cexp using 1; first | rfl | (dsimp only [firstVariation]; ring) + +lemma firstVariation_continuousOn {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) : + ContinuousOn (firstVariation a b z) (Icc 0 (T:ℝ)) := + fun _ hu=>(firstVariation_hasDerivWithinAt hb hT hu).continuousWithinAt + + +def secondVariationIntegral (a : ℝ) (b : ℝ≥0→ℝ) (z : ℂ) (t : ℝ) : ℂ := + ∫u in (0:ℝ)..t,2*(a:ℂ)*firstVariation a b z u / + (loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))^3 + +lemma secondVariationIntegral_hasDerivWithinAt {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : + HasDerivWithinAt (secondVariationIntegral a b z) + (2*(a:ℂ)*firstVariation a b z u / + (loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))^3) (Icc 0 (T:ℝ)) u := by + have hc := firstVariation_continuousOn hb hT + obtain ⟨f,hf⟩ := hT + apply hasDerivWithinAt_primitive_Icc T.coe_nonneg _ hu + have hd : ContinuousOn (fun s=>2*(a:ℂ)*firstVariation a b z s/(f s-(b s.toNNReal:ℂ))^3) + (Icc 0 (T:ℝ)) := (continuousOn_const.mul hc).div ((odeUntil_center_continuousOn hb hf).pow 3) + (fun s hs=>pow_ne_zero _ (odeUntil_center_ne_zero hf hs)) + exact hd.congr (fun s hs=>by rw [loewnerMap_eq_solution_time hf hs]) + +lemma secondVariationIntegral_continuousOn {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) : + ContinuousOn (secondVariationIntegral a b z) (Icc 0 (T:ℝ)) := + fun _ hu=>(secondVariationIntegral_hasDerivWithinAt hb hT hu).continuousWithinAt + + + +theorem hasDerivAt_deriv_loewnerMap {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) : + HasDerivAt (deriv (loewnerMap a b T)) + (firstVariation a b z T * secondVariationIntegral a b z T) z := by + obtain ⟨ε,δ,F,hε,hδ,hFc,hFe,hode,hmap,hIm⟩ := loewner_local_cutoff hb hT + let Z : ℂ→ℝ→ℂ := fun w u=>heightClamp ε (F u.toNNReal w-(b u.toNNReal:ℂ)) + let K : ℂ→ℝ→ℂ := fun w u=>-(a:ℂ)/(Z w u)^2 + let D : ℂ→ℝ→ℂ := fun w u=>Complex.exp (∫v in (0:ℝ)..u,K w v) + let P : ℂ→ℝ→ℂ := fun w u=>2*(a:ℂ)*D w u/(Z w u)^3 + have hZ (w : ℂ) : Continuous (Z w) := (heightClamp_lipschitz ε).continuous.comp + (((hFc w).comp continuous_real_toNNReal).sub + (Complex.continuous_ofReal.comp (hb.comp continuous_real_toNNReal))) + have hZn (w : ℂ) (u : ℝ) : Z w u≠0 := heightClamp_ne_zero hε _ + have hK (w : ℂ) : Continuous (K w) := continuous_const.div ((hZ w).pow 2) + (fun u=>pow_ne_zero _ (hZn w u)) + have hD (w : ℂ) : Continuous (D w) := by + apply Complex.continuous_exp.comp + exact intervalIntegral.continuous_primitive (hK w).intervalIntegrable 0 + have hP (w : ℂ) : Continuous (P w) := (continuous_const.mul (hD w)).div ((hZ w).pow 3) + (fun u=>pow_ne_zero _ (hZn w u)) + have htime {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : u.toNNReal≤T := by + simpa using Real.toNNReal_le_toNNReal hu.2 + have hZe (w : ℂ) (hw : w∈ball z δ) (u : ℝ) (hu : u∈Icc 0 (T:ℝ)) : + Z w u=loewnerMap a b u.toNNReal w-(b u.toNNReal:ℂ) := by + rw [hmap w hw _ (htime hu)] + exact heightClamp_eq (by simpa using (hIm w hw _ (htime hu)).le) + have hDe (w : ℂ) (hw : w∈ball z δ) (u : ℝ) (hu : u∈Icc 0 (T:ℝ)) : + D w u=firstVariation a b w u := by + dsimp only [D,firstVariation,logVariation] + apply congrArg Complex.exp + apply intervalIntegral.integral_congr + intro v hv + rw [uIcc_of_le hu.1] at hv + change -(a:ℂ)/(Z w v)^2= _ + rw [hZe w hw v ⟨hv.1,hv.2.trans hu.2⟩] + have hDd (w : ℂ) (hw : w∈ball z δ) (u : ℝ) (hu : u∈Icc 0 (T:ℝ)) : + D w u=deriv (loewnerMap a b u.toNNReal) w := by + rw [hDe w hw u hu] + convert! firstVariation_eq_deriv hb ⟨_,odeUntil_mono (hode w hw) (htime hu)⟩ using 1 + rw [Real.coe_toNNReal _ hu.1] + have hd (u : ℝ) (hu : u∈Icc 0 (T:ℝ)) (w : ℂ) (hw : w∈ball z δ) : + HasDerivAt (fun w=>K w u) (P w u) w := by + have h := ((hasDerivAt_loewnerMap hb + (show alive a b u.toNNReal w from ⟨_,odeUntil_mono (hode w hw) (htime hu)⟩)).sub_const + (b u.toNNReal:ℂ)).pow 2 + rw [←(hasDerivAt_loewnerMap hb + (show alive a b u.toNNReal w from ⟨_,odeUntil_mono (hode w hw) (htime hu)⟩)).deriv, + ←hDd w hw u hu] at h + change HasDerivAt (fun x=>(loewnerMap a b u.toNNReal x-(b u.toNNReal:ℂ))^2) + ((2:ℂ)*(loewnerMap a b u.toNNReal w-(b u.toNNReal:ℂ))^(2-1)*D w u) w at h + have hq := (hasDerivAt_const w (-(a:ℂ))).div h + (by rw [←hZe w hw u hu]; exact pow_ne_zero _ (hZn w u)) + have he : (fun x=>K x u)=ᶠ[𝓝 w] + (fun x=>-(a:ℂ)/(loewnerMap a b u.toNNReal x-(b u.toNNReal:ℂ))^2) := by + filter_upwards [isOpen_ball.mem_nhds hw] with x hx + dsimp only [K]; rw [hZe x hx u hu] + convert! hq.congr_of_eventuallyEq he using 1 + dsimp only [P] + rw [hZe w hw u hu] + simp only [Nat.reduceSub,pow_one] + field_simp + ring + let L : ℝ := Real.exp ((2*|a|/ε^2)*(T:ℝ)) + have hL : 02 * |a| * L/ε^3) (a := 0) (b := (T:ℝ)) + (ball_mem_nhds z hδ) + (Eventually.of_forall (fun w=>(hK w).aestronglyMeasurable.restrict)) + ((hK z).intervalIntegrable 0 T) (hP z).aestronglyMeasurable.restrict + (ae_of_all volume (fun u hu=>hPb u (by rw [uIoc_of_le T.coe_nonneg] at hu; exact Ioc_subset_Icc_self hu))) + intervalIntegrable_const + (ae_of_all volume (fun u hu=>hd u (by rw [uIoc_of_le T.coe_nonneg] at hu; exact Ioc_subset_Icc_self hu))) + have he : (fun w=>D w T)=ᶠ[𝓝 z] (deriv (loewnerMap a b T)) := by + filter_upwards [ball_mem_nhds z hδ] with w hw + simpa only [Real.toNNReal_coe] using hDd w hw T ⟨T.coe_nonneg,le_rfl⟩ + have hfinal := hdiff.2.cexp.congr_of_eventuallyEq he.symm + have hpi : (∫u in (0:ℝ)..(T:ℝ),P z u)=secondVariationIntegral a b z T := by + apply intervalIntegral.integral_congr + intro u hu + rw [uIcc_of_le T.coe_nonneg] at hu + dsimp only [P,secondVariationIntegral] + rw [hDe z (mem_ball_self hδ) u hu,hZe z (mem_ball_self hδ) u hu] + rw [hpi] at hfinal + convert! hfinal using 1 + change firstVariation a b z T * secondVariationIntegral a b z T = + D z T * secondVariationIntegral a b z T + rw [hDe z (mem_ball_self hδ) T ⟨T.coe_nonneg,le_rfl⟩] + +end SLEExactGauge.LoewnerGeometry +end +end + + + +section + + +noncomputable section +open Set Filter Topology +open scoped RealInnerProductSpace InnerProductSpace +namespace SLEExactGauge.LoewnerGeometry + +lemma real_inner_mul_self (v c : ℂ) : ⟪v,c*v⟫_ℝ=c.re*‖v‖^2 := by + rw [real_inner_eq_re_inner ℂ] + change (inner ℂ v (c • v)).re = _ + rw [inner_smul_right,inner_self_eq_norm_sq_to_K] + change (c*(‖v‖:ℂ)^2).re = _ + simp only [pow_two,Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im] + ring + +lemma norm_le_of_affine_dissipative {B c f : ℝ→ℂ} {T R : ℝ} + (hT : 0≤T) (hR : 0≤R) + (hd : ∀ u∈Icc 0 T, HasDerivWithinAt B (c u*B u+f u) (Icc 0 T) u) + (h0 : ‖B 0‖≤R) + (hc : ∀ u∈Icc 0 T,(c u).re<0) + (hf : ∀ u∈Icc 0 T,‖f u‖≤-R*(c u).re) : ‖B T‖≤R := by + have cont : ContinuousOn (fun u=>‖B u‖^2) (Icc 0 T) := + fun u hu=>(hd u hu).norm_sq.continuousWithinAt + have deriv (u : ℝ) (hu : u∈Ico 0 T) : + HasDerivWithinAt (fun u=>‖B u‖^2) + (2*⟪B u,c u*B u+f u⟫_ℝ) (Ici u) u := by + apply (hd u ⟨hu.1,hu.2.le⟩).norm_sq.mono_of_mem_nhdsWithin + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ v:ℝ in 𝓝[Ici u] u,v (R+ε)^2) (B' := fun _=>0) + (by nlinarith [norm_nonneg (B 0)]) + (fun _=>hasDerivAt_const _ _) + (by + intro u hu he + have hh : ‖B u‖=R+ε := (sq_eq_sq₀ (norm_nonneg _) hpos.le).mp he + have hcf := hc u ⟨hu.1,hu.2.le⟩ + have hb := (real_inner_le_norm (B u) (f u)).trans + (mul_le_mul_of_nonneg_left (hf u ⟨hu.1,hu.2.le⟩) (norm_nonneg _)) + rw [inner_add_right,real_inner_mul_self] + rw [hh] at hb ⊢ + have hn : (c u).re*(R+ε)*ε<0 := mul_neg_of_neg_of_pos + (mul_neg_of_neg_of_pos hcf hpos) hε + nlinarith) + have ht := barrier (right_mem_Icc.mpr hT) + nlinarith [norm_nonneg (B T)] + +end SLEExactGauge.LoewnerGeometry +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain LoewnerRestart + +lemma loewner_time_hasDerivWithinAt {a : ℝ} {b : ℝ≥0→ℝ} + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : + HasDerivWithinAt (fun t=>loewnerMap a b t.toNNReal z) + ((a:ℂ)/(loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))) (Icc 0 (T:ℝ)) u := by + obtain ⟨f,hf⟩ := hT + rw [loewnerMap_eq_solution_time hf hu] + exact (hf.2 u hu).2.congr_of_mem (fun v hv=>loewnerMap_eq_solution_time hf hv) hu + +lemma loewner_height_hasDerivWithinAt {a : ℝ} {b : ℝ≥0→ℝ} + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) {u : ℝ} (hu : u∈Icc 0 (T:ℝ)) : + HasDerivWithinAt (fun t=>(loewnerMap a b t.toNNReal z).im) + (-a*(loewnerMap a b u.toNNReal z).im / + Complex.normSq (loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ))) (Icc 0 (T:ℝ)) u := by + have hd := Complex.imCLM.hasFDerivAt.comp_hasDerivWithinAt u + (loewner_time_hasDerivWithinAt hT hu) + convert! hd using 1 + simp only [Complex.imCLM_apply,Complex.div_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.sub_im,sub_zero,zero_mul,zero_div,zero_sub] + ring + +def coefficientDrift (a : ℝ) (Z : ℂ) : ℂ := + -(a:ℂ)/(Complex.normSq Z:ℂ)+(a:ℂ)/Z^2 + +def coefficientForcing (a : ℝ) (Z : ℂ) : ℂ := + -coefficientDrift a Z-Complex.I*(2*(a:ℂ)*(Z.im:ℂ)/Z^3) + +lemma coefficientDrift_re (a : ℝ) {Z : ℂ} (hZ : Z≠0) : + (coefficientDrift a Z).re= -(2*a*Z.im^2/(Complex.normSq Z)^2) := by + have hn : Complex.normSq Z≠0 := mt Complex.normSq_eq_zero.mp hZ + dsimp only [coefficientDrift] + simp only [Complex.add_re,Complex.neg_re,Complex.div_re,Complex.ofReal_re, + Complex.ofReal_im,Complex.normSq_ofReal, + pow_two,Complex.mul_re,Complex.mul_im] + field_simp + simp only [Complex.normSq_apply,pow_two,Complex.mul_re,Complex.mul_im] + ring + +lemma coefficientForcing_eq (a : ℝ) {Z : ℂ} (hZ : Z≠0) : + coefficientForcing a Z = + (-(4*a*Z.im^2/(Complex.normSq Z)^2):ℝ)*(star Z/Z) := by + have hN : (Complex.normSq Z:ℂ)=Z*star Z := (Complex.mul_conj Z).symm + have hY : (Z.im:ℂ)=(Z-star Z)/(2*Complex.I) := Complex.im_eq_sub_conj Z + have hZn : star Z≠0 := star_ne_zero.mpr hZ + simp only [Complex.ofReal_neg,Complex.ofReal_div,Complex.ofReal_mul,Complex.ofReal_pow, + Complex.ofReal_ofNat] + dsimp only [coefficientForcing,coefficientDrift] + rw [hN,hY] + field_simp + simp only [Complex.I_sq] + ring_nf + +lemma coefficientForcing_norm {a : ℝ} (ha : 0secondCoefficient_hasDerivWithinAt hb hT hu) + · rw [secondCoefficient_zero]; norm_num + · intro u hu + obtain ⟨f,hf⟩ := hT + have hy : 0<(loewnerMap a b u.toNNReal z-(b u.toNNReal:ℂ)).im := by + rw [loewnerMap_eq_solution_time hf hu] + simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using (hf.2 u hu).1 + have hn := odeUntil_center_ne_zero hf hu + rw [←loewnerMap_eq_solution_time hf hu] at hn + rw [coefficientDrift_re a hn] + exact neg_neg_of_pos (div_pos (by positivity) (sq_pos_of_ne_zero + (mt Complex.normSq_eq_zero.mp hn))) + · intro u hu + obtain ⟨f,hf⟩ := hT + have hn := odeUntil_center_ne_zero hf hu + rw [←loewnerMap_eq_solution_time hf hu] at hn + exact (coefficientForcing_norm ha hn).le + +end SLEExactGauge.LoewnerGeometry +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerGeometry +open ExactSLEMain LoewnerRestart FlowIdentification + +lemma hasDerivAt_deriv_inverseMap {a : ℝ} (ha : 0 (deriv (loewnerMap a b.1 T) (inverseMap a b T w))⁻¹) := by + filter_upwards [(isOpen_lt continuous_const Complex.continuous_im).mem_nhds hw] with v hv + exact deriv_inverseMap ha b T hv + convert! hd.congr_of_eventuallyEq he using 1 + dsimp only [Function.comp_def] + rw [←firstVariation_eq_deriv b.1.continuous hz] + field_simp + +lemma inverseMap_second_coefficient {a : ℝ} (ha : 0 (L ω)^n) P) : + (moment P L 1)^n ≤ moment P L n := by + simpa only [moment,pow_one] using + (convexOn_pow (𝕜 := ℝ) n).map_integral_le (by fun_prop) isClosed_Ici hL h1 hn + + +def cutoff (m : ℕ → ℝ) (n : ℕ) : ℝ := 4*m (n+1)/m n + + +def multiplicity (m : ℕ → ℝ) (n : ℕ) (k : ℤ) : ℕ := + if (2:ℝ)^k ≤ cutoff m n then ⌊(4:ℝ)^n*((2:ℝ)^k)^n/m n⌋₊ else 0 + +lemma multiplicity_bounds {m : ℕ → ℝ} {n : ℕ} {k : ℤ} + (hn : 0 < n) (hm1 : 0 < m 1) (hmn : 0 < m n) (hJ : (m 1)^n ≤ m n) + (hk : multiplicity m n k ≠ 0) : m 1/4 ≤ (2:ℝ)^k ∧ (2:ℝ)^k ≤ cutoff m n := by + unfold multiplicity at hk + split_ifs at hk with hcut + · have hw : 1 ≤ (4:ℝ)^n*((2:ℝ)^k)^n/m n := + Nat.floor_pos.mp (Nat.pos_of_ne_zero hk) + have hp : (m 1)^n ≤ (4*(2:ℝ)^k)^n := by + rw [mul_pow] + exact hJ.trans (by simpa only [one_mul] using (le_div_iff₀ hmn).mp hw) + have hml := (pow_le_pow_iff_left₀ hm1.le (by positivity) hn.ne').mp hp + exact ⟨by linarith,hcut⟩ + · exact (hk rfl).elim + +lemma finite_multiplicity_support {m : ℕ → ℝ} {n : ℕ} + (hn : 0 < n) (hm1 : 0 < m 1) (hmn : 0 < m n) (hmnext : 0 < m (n+1)) + (hJ : (m 1)^n ≤ m n) : {k : ℤ | multiplicity m n k ≠ 0}.Finite := by + obtain ⟨l,hl,hl'⟩ := exists_mem_Ico_zpow (show 0 < m 1/4 by positivity) (by norm_num : (1:ℝ) < 2) + obtain ⟨u,hu,hu'⟩ := exists_mem_Ico_zpow + (show 0 < cutoff m n by unfold cutoff; positivity) (by norm_num : (1:ℝ) < 2) + refine (finite_Icc l u).subset ?_ + intro k hk + have hb := multiplicity_bounds hn hm1 hmn hJ hk + refine ⟨(zpow_le_zpow_iff_right₀ (by norm_num : (1:ℝ) < 2)).mp (hl.trans hb.1),?_⟩ + have hlt : k < u+1 := (zpow_lt_zpow_iff_right₀ (by norm_num : (1:ℝ) < 2)).mp + (hb.2.trans_lt hu') + omega + + + +def support (m : ℕ → ℝ) (n : ℕ) : Finset ℤ := by + classical + exact if h : {k : ℤ | multiplicity m n k ≠ 0}.Finite then h.toFinset else ∅ + +lemma mem_support {m : ℕ → ℝ} {n : ℕ} + (hfin : {k : ℤ | multiplicity m n k ≠ 0}.Finite) (k : ℤ) : + k∈support m n ↔ multiplicity m n k ≠ 0 := by + simp only [support,dite_eq_left hfin,Finite.mem_toFinset,mem_ofPred_eq] + + + +def noncleanup (m : ℕ → ℝ) (n : ℕ) : List ℝ := + ((support m n).sort (· ≤ ·)).flatMap (fun k => List.replicate (multiplicity m n k) ((2:ℝ)^k)) + +def batch (m : ℕ → ℝ) (n : ℕ) : List ℝ := noncleanup m n ++ [(n:ℝ)] + +lemma batch_length_pos (m : ℕ → ℝ) (n : ℕ) : 0 < (batch m n).length := by + simp [batch] + +lemma batch_entry_lower {m : ℕ → ℝ} {n : ℕ} + (hn : 0 < n) (hm1 : 0 < m 1) (hmn : 0 < m n) (hJ : (m 1)^n ≤ m n) + {b : ℝ} (hb : b∈batch m n) : min 1 (m 1/4) ≤ b := by + simp only [batch,List.mem_append,List.mem_singleton] at hb + rcases hb with hb | rfl + · obtain ⟨k,hks,hkb⟩ := List.mem_flatMap.mp hb + obtain ⟨hk,rfl⟩ := List.mem_replicate.mp hkb + exact (min_le_right _ _).trans (multiplicity_bounds hn hm1 hmn hJ hk).1 + · exact (min_le_left _ _).trans (by exact_mod_cast hn) + + +lemma batch_cleanup (m : ℕ → ℝ) (n : ℕ) : + (batch m n)[(noncleanup m n).length]'(by simp [batch])=(n:ℝ) := by + simp [batch,List.getElem_append_right] + + + +def badLevels (v : ℕ → ℝ) (M : ℝ) : Set ℕ := {j | 1 ≤ j ∧ v j ≤ 3*M/4} + +lemma finite_badLevels {v : ℕ → ℝ} {M : ℝ} (hM : 0 < M) + (hv : Tendsto v atTop (𝓝 M)) : (badLevels v M).Finite := by + have hev : ∀ᶠ j in atTop, 3*M/4 < v j := hv.eventually_const_lt (by linarith) + obtain ⟨N,hN⟩ := eventually_atTop.mp hev + refine (finite_Iio N).subset ?_ + intro j hj + change j < N + by_contra! hh + exact (not_lt_of_ge hj.2) (hN j hh) + + + +def level (v : ℕ → ℝ) (M : ℝ) : ℕ := by + classical + exact 1 + if h : (badLevels v M).Finite then h.toFinset.card else 0 + +lemma level_pos (v : ℕ → ℝ) (M : ℝ) : 0 < level v M := by + unfold level + omega + +lemma level_moment_gt {v : ℕ → ℝ} {M : ℝ} (hM : 0 < M) (hv : Monotone v) + (hlim : Tendsto v atTop (𝓝 M)) : 3*M/4 < v (level v M) := by + classical + have hfin := finite_badLevels hM hlim + by_contra! hh + have hsub : Finset.Icc 1 (level v M) ⊆ hfin.toFinset := by + intro j hj + rw [Finite.mem_toFinset] + have hj' := Finset.mem_Icc.mp hj + exact ⟨hj'.1,(hv hj'.2).trans hh⟩ + have hcard := Finset.card_le_card hsub + rw [Nat.card_Icc] at hcard + simp only [level,dite_eq_left hfin] at hcard + omega + + +abbrev EntryIndex (m : ℕ → ℝ) := Σ n : {n : ℕ // 0 < n}, Fin (batch m n.1).length + +instance (m : ℕ → ℝ) : Nonempty (EntryIndex m) := + ⟨⟨⟨1,by norm_num⟩,⟨0,batch_length_pos m 1⟩⟩⟩ + +def threshold (m : ℕ → ℝ) (i : EntryIndex m) : ℝ := (batch m i.1.1)[i.2.1] + + + +def radius (m : ℕ → ℝ) (a : ℝ) (ell : ℕ → ℕ) (i : EntryIndex m) : ℝ := + Real.exp (-((i.1.1:ℝ)^2)-2*a*(i.2.1:ℝ)*((ell i.1.1:ℝ)+(i.1.1:ℝ))) + +lemma radius_pos (m : ℕ → ℝ) (a : ℝ) (ell : ℕ → ℕ) (i : EntryIndex m) : + 0 < radius m a ell i := Real.exp_pos _ + +lemma radius_le (m : ℕ → ℝ) {a : ℝ} (ha : 0 ≤ a) (ell : ℕ → ℕ) (i : EntryIndex m) : + radius m a ell i ≤ Real.exp (-((i.1.1:ℝ)^2)) := by + unfold radius + apply Real.exp_le_exp.mpr + have : 0 ≤ 2*a*(i.2.1:ℝ)*((ell i.1.1:ℝ)+(i.1.1:ℝ)) := by positivity + linarith + +def cleanupIndex (m : ℕ → ℝ) (n : ℕ) (hn : 0 < n) : EntryIndex m := + ⟨⟨n,hn⟩,⟨(noncleanup m n).length,by simp [batch]⟩⟩ + +lemma cleanup_threshold (m : ℕ → ℝ) (n : ℕ) (hn : 0 < n) : + threshold m (cleanupIndex m n hn)=(n:ℝ) := batch_cleanup m n + +lemma cleanup_cost_small (m : ℕ → ℝ) {a d : ℝ} (ha : 0 ≤ a) (hd : 0 < d) + (ell : ℕ → ℕ) (ε : ℝ) (hε : 0 < ε) : + ∃ i : EntryIndex m, threshold m i * (radius m a ell i)^d < ε := by + have hlim : Tendsto (fun n : ℕ => (n:ℝ)*Real.exp (-d*(n:ℝ))) atTop (𝓝 0) := by + have h := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 1 d hd).comp + (tendsto_natCast_atTop_atTop (R := ℝ)) + change Tendsto (fun n : ℕ => (n:ℝ)^(1:ℝ)*Real.exp (-d*(n:ℝ))) atTop (𝓝 0) at h + simpa only [Real.rpow_one] using h + obtain ⟨n,hn,hnε⟩ := ((eventually_ge_atTop 1).and (hlim.eventually_lt_const hε)).exists + have hnp : 0 < n := lt_of_lt_of_le Nat.zero_lt_one hn + have hnR : (1:ℝ) ≤ n := by exact_mod_cast hn + have hρ : (radius m a ell (cleanupIndex m n hnp))^d ≤ Real.exp (-d*(n:ℝ)) := by + calc + (radius m a ell (cleanupIndex m n hnp))^d ≤ (Real.exp (-((n:ℝ)^2)))^d := + Real.rpow_le_rpow (radius_pos m a ell _).le (radius_le m ha ell _) hd.le + _ = Real.exp (-((n:ℝ)^2)*d) := (Real.exp_mul _ _).symm + _ ≤ Real.exp (-d*(n:ℝ)) := by + apply Real.exp_le_exp.mpr + nlinarith [mul_nonneg hd.le (show (n:ℝ) ≤ (n:ℝ)^2 by nlinarith |> sub_nonneg.mpr)] + refine ⟨cleanupIndex m n hnp,?_⟩ + rw [cleanup_threshold] + exact (mul_le_mul_of_nonneg_left hρ (Nat.cast_nonneg n)).trans_lt hnε + + +def momentGauge (m : ℕ → ℝ) (a d : ℝ) (ell : ℕ → ℕ) : ℝ → ℝ := + QuadraticGauge.gauge d (threshold m) (radius m a ell) + + + +theorem momentGauge_admissible (m : ℕ → ℝ) (hm : ∀ n, 0 < n → 0 < m n) + (hJ : ∀ n, 0 < n → (m 1)^n ≤ m n) {a d : ℝ} + (ha : 0 ≤ a) (hd : 0 < d) (hd2 : d ≤ 2) (ell : ℕ → ℕ) : + Target.IsHausdorffGauge (momentGauge m a d ell) := by + have hm1 := hm 1 Nat.zero_lt_one + have hc : 0 < min 1 (m 1/4) := lt_min zero_lt_one (by positivity) + have hb (i : EntryIndex m) : min 1 (m 1/4) ≤ threshold m i := + batch_entry_lower i.1.2 (hm 1 Nat.zero_lt_one) (hm _ i.1.2) (hJ _ i.1.2) + (List.getElem_mem i.2.2) + exact QuadraticGauge.isHausdorffGauge (fun i => hc.le.trans (hb i)) + (radius_pos m a ell) hd.le hd2 hc hb (cleanup_cost_small m ha hd ell) + +lemma momentGauge_doubling (m : ℕ → ℝ) (hm : ∀ n, 0 < n → 0 < m n) + (hJ : ∀ n, 0 < n → (m 1)^n ≤ m n) (a d : ℝ) (ell : ℕ → ℕ) + {C r : ℝ} (hC : 1 ≤ C) : momentGauge m a d ell (C*r) ≤ C^2*momentGauge m a d ell r := by + have hm1 := hm 1 Nat.zero_lt_one + have hc : 0 ≤ min 1 (m 1/4) := le_min zero_le_one (by positivity) + have hb (i : EntryIndex m) : 0 ≤ threshold m i := hc.trans + (batch_entry_lower i.1.2 (hm 1 Nat.zero_lt_one) (hm _ i.1.2) (hJ _ i.1.2) + (List.getElem_mem i.2.2)) + exact QuadraticGauge.gauge_scale hb (radius_pos m a ell) hC + +end SLEExactGauge.MomentBatches +end +end + + + +section + + +noncomputable section +open Set Filter Topology +namespace SLEExactGauge.MomentBatches + +lemma dyadic_predecessor (n : ℕ) (k : ℤ) : + ((2:ℝ)^(k-1))^n = (1/2:ℝ)^n * ((2:ℝ)^k)^n := by + rw [zpow_sub₀ (by norm_num : (2:ℝ)≠0),zpow_one,div_pow,div_pow,one_pow] + ring + +lemma dyadic_sum_le (n : ℕ) (hn : 0 < n) (S : Finset ℤ) (K : ℤ) + (hK : ∀ k∈S, k ≤ K) : + (∑ k∈S, ((2:ℝ)^k)^n) ≤ ((2:ℝ)^K)^n/(1-(1/2:ℝ)^n) := by + have hq : (1/2:ℝ)^n < 1 := pow_lt_one₀ (by norm_num) (by norm_num) hn.ne' + have hden : 0 < 1-(1/2:ℝ)^n := sub_pos.mpr hq + induction S using Finset.induction_on_max generalizing K with + | empty => simp only [Finset.sum_empty]; positivity + | insert a S hmax ih => + have haS : a∉S := by intro ha; exact lt_irrefl a (hmax a ha) + rw [Finset.sum_insert haS] + have hs := ih (a-1) (fun k hk => by have := hmax k hk; omega) + have hstep : ((2:ℝ)^a)^n + ((2:ℝ)^(a-1))^n/(1-(1/2:ℝ)^n) = + ((2:ℝ)^a)^n/(1-(1/2:ℝ)^n) := by + rw [dyadic_predecessor] + field_simp + ring + calc + ((2:ℝ)^a)^n + ∑ k∈S, ((2:ℝ)^k)^n ≤ + ((2:ℝ)^a)^n + ((2:ℝ)^(a-1))^n/(1-(1/2:ℝ)^n) := add_le_add le_rfl hs + _ = ((2:ℝ)^a)^n/(1-(1/2:ℝ)^n) := hstep + _ ≤ ((2:ℝ)^K)^n/(1-(1/2:ℝ)^n) := by + apply div_le_div_of_nonneg_right _ hden.le + apply pow_le_pow_left₀ (by positivity) + exact zpow_le_zpow_right₀ (by norm_num) (hK a (Finset.mem_insert_self _ _)) + + + +lemma dyadic_sum_below (n : ℕ) (hn : 0 < n) (S : Finset ℤ) (x : ℝ) (hx : 0 ≤ x) : + (∑ k∈S with (2:ℝ)^k ≤ x, ((2:ℝ)^k)^n) ≤ x^n/(1-(1/2:ℝ)^n) := by + classical + rcases hx.eq_or_lt with rfl | hxp + · simp only [show ∀ k : ℤ, ¬(2:ℝ)^k≤0 from fun k => not_le_of_gt (by positivity), + Finset.filter_false,Finset.sum_empty,zero_pow hn.ne',zero_div,le_refl] + · obtain ⟨K,hKlo,hKhi⟩ := exists_mem_Ico_zpow hxp (by norm_num : (1:ℝ)<2) + have hb : ∀ k∈S.filter (fun k => (2:ℝ)^k ≤ x), k ≤ K := by + intro k hk + have hkle := (Finset.mem_filter.mp hk).2 + have hlt : k < K+1 := (zpow_lt_zpow_iff_right₀ (by norm_num : (1:ℝ)<2)).mp + (hkle.trans_lt hKhi) + omega + calc + (∑ k∈S with (2:ℝ)^k ≤ x, ((2:ℝ)^k)^n) ≤ ((2:ℝ)^K)^n/(1-(1/2:ℝ)^n) := + dyadic_sum_le n hn _ K hb + _ ≤ x^n/(1-(1/2:ℝ)^n) := div_le_div_of_nonneg_right + (pow_le_pow_left₀ (by positivity) hKlo n) + (by have := pow_lt_one₀ (by norm_num : (0:ℝ)≤1/2) (by norm_num : (1/2:ℝ)<1) hn.ne'; linarith) + +lemma multiplicity_le_weight {m : ℕ → ℝ} {n : ℕ} (hm : 0 < m n) (k : ℤ) : + (multiplicity m n k:ℝ) ≤ (4:ℝ)^n*((2:ℝ)^k)^n/m n := by + unfold multiplicity + split_ifs + · exact Nat.floor_le (by positivity) + · simp only [Nat.cast_zero] + positivity + + +def counts (m : ℕ → ℝ) (n : ℕ) (x : ℝ) : ℝ := + ∑ k∈support m n, if (2:ℝ)^k ≤ x then (multiplicity m n k:ℝ) else 0 + +lemma counts_nonneg (m : ℕ → ℝ) (n : ℕ) (x : ℝ) : 0 ≤ counts m n x := by + unfold counts + exact Finset.sum_nonneg (fun k hk => by split_ifs <;> positivity) + +lemma counts_eq_sum_filter (m : ℕ → ℝ) (n : ℕ) (x : ℝ) : + counts m n x = ∑ k∈support m n with (2:ℝ)^k ≤ x, (multiplicity m n k:ℝ) := by + classical + exact (Finset.sum_filter (s := support m n) (fun k => (2:ℝ)^k≤x) (fun k => (multiplicity m n k:ℝ))).symm + +lemma counts_upper {m : ℕ → ℝ} {n : ℕ} (hn : 0 < n) (hmn : 0 < m n) + {x : ℝ} (hx : 0 ≤ x) : + counts m n x ≤ ((4:ℝ)^n/m n) * (x^n/(1-(1/2:ℝ)^n)) := by + classical + rw [counts_eq_sum_filter] + calc + (∑ k∈support m n with (2:ℝ)^k ≤ x, (multiplicity m n k:ℝ)) ≤ + ∑ k∈support m n with (2:ℝ)^k ≤ x, ((4:ℝ)^n/m n)*((2:ℝ)^k)^n := by + apply Finset.sum_le_sum + intro k hk + simpa only [div_mul_eq_mul_div] using multiplicity_le_weight hmn k + _ = ((4:ℝ)^n/m n) * (∑ k∈support m n with (2:ℝ)^k ≤ x, ((2:ℝ)^k)^n) := by + rw [Finset.mul_sum] + _ ≤ ((4:ℝ)^n/m n) * (x^n/(1-(1/2:ℝ)^n)) := + mul_le_mul_of_nonneg_left (dyadic_sum_below n hn _ x hx) (by positivity) + +lemma multiplicity_le_counts {m : ℕ → ℝ} {n : ℕ} + (hfin : {k : ℤ | multiplicity m n k≠0}.Finite) (k : ℤ) {x : ℝ} (hkx : (2:ℝ)^k ≤ x) : + (multiplicity m n k:ℝ) ≤ counts m n x := by + classical + by_cases hk : multiplicity m n k=0 + · simpa only [hk,Nat.cast_zero] using counts_nonneg m n x + · calc + (multiplicity m n k:ℝ) = (if (2:ℝ)^k ≤ x then (multiplicity m n k:ℝ) else 0) := by rw [ite_eq_left hkx] + _ ≤ ∑ j∈support m n, if (2:ℝ)^j ≤ x then (multiplicity m n j:ℝ) else 0 := + Finset.single_le_sum (f := fun j => if (2:ℝ)^j≤x then (multiplicity m n j:ℝ) else 0) + (fun j hj => by split_ifs <;> positivity) ((mem_support hfin k).mpr hk) + + + +lemma counts_lower {m : ℕ → ℝ} {n : ℕ} (hn : 0 < n) (hmn : 0 < m n) + (hfin : {k : ℤ | multiplicity m n k≠0}.Finite) + {x : ℝ} (hx : 0 ≤ x) (hcut : x ≤ cutoff m n) : + (2:ℝ)^n*x^n/m n-1 ≤ counts m n x := by + rcases hx.eq_or_lt with rfl | hxp + · simp only [zero_pow hn.ne',mul_zero,zero_div,zero_sub] + exact (by norm_num : (-1:ℝ)≤0).trans (counts_nonneg m n 0) + · obtain ⟨k,hkx,hxk⟩ := exists_mem_Ico_zpow hxp (by norm_num : (1:ℝ)<2) + have hx2 : x ≤ 2*(2:ℝ)^k := by + rw [zpow_add₀ (by norm_num : (2:ℝ)≠0),zpow_one] at hxk + linarith + have hpow : (2:ℝ)^n*x^n ≤ (4:ℝ)^n*((2:ℝ)^k)^n := by + rw [← mul_pow,← mul_pow] + exact pow_le_pow_left₀ (by positivity) (by linarith) n + have hw : (2:ℝ)^n*x^n/m n-1 ≤ (multiplicity m n k:ℝ) := by + rw [multiplicity,ite_eq_left (hkx.trans hcut)] + have hf := Nat.lt_floor_add_one ((4:ℝ)^n*((2:ℝ)^k)^n/m n) + have hdiv := div_le_div_of_nonneg_right hpow hmn.le + linarith + exact hw.trans (multiplicity_le_counts hfin k hkx) + + + +lemma finite_entries_before (m : ℕ → ℝ) (N : ℕ) : + {i : EntryIndex m | i.1.1 < N}.Finite := by + have hf (n : ℕ) : {i : EntryIndex m | i.1.1=n}.Finite := by + by_cases hn : 0 < n + · have him : {i : EntryIndex m | i.1.1=n} ⊆ + range (fun k : Fin (batch m n).length => (⟨⟨n,hn⟩,k⟩ : EntryIndex m)) := by + rintro ⟨⟨j,hj⟩,k⟩ h + change j=n at h + subst j + exact ⟨k,rfl⟩ + exact (finite_range _).subset him + · have he : {i : EntryIndex m | i.1.1=n} = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro i hi + exact hn (hi ▸ i.1.2) + rw [he] + exact finite_empty + have hunion : (⋃ n : Fin N, {i : EntryIndex m | i.1.1=n.1}).Finite := finite_iUnion (fun n => hf n.1) + apply hunion.subset + intro i hi + exact mem_iUnion.mpr ⟨⟨i.1.1,hi⟩,rfl⟩ + +theorem momentGauge_finite_exclusions (m : ℕ → ℝ) + (hm : ∀ n, 0 < n → 0 < m n) (hJ : ∀ n, 0 < n → (m 1)^n ≤ m n) + (a d : ℝ) (ell : ℕ → ℕ) (n₀ : ℕ) (F : ℝ → ℝ) (M C : ℝ) + (hF : ∀ r, 0 < r → 0 ≤ F r ∧ F r ≤ M) + (hbound : ∀ i : EntryIndex m, n₀ ≤ i.1.1 → ∀ r, 0 < r → + F r ≤ C*QuadraticGauge.entry d (threshold m i) (radius m a ell i) r) : + ∃ C' : ℝ, 0 < C' ∧ ∀ r, 0 < r → F r ≤ C'*momentGauge m a d ell r := by + have hm1 := hm 1 Nat.zero_lt_one + have hc : 0 < min 1 (m 1/4) := lt_min zero_lt_one (by positivity) + have hb (i : EntryIndex m) : 0 < threshold m i := hc.trans_le + (batch_entry_lower i.1.2 hm1 (hm _ i.1.2) (hJ _ i.1.2) (List.getElem_mem i.2.2)) + apply QuadraticGauge.finite_exclusions d (threshold m) (radius m a ell) hb + (radius_pos m a ell) (finite_entries_before m n₀).toFinset F M C hF + intro i hi + apply hbound i + exact le_of_not_gt (by simpa only [Finite.mem_toFinset,mem_ofPred_eq] using hi) + +end SLEExactGauge.MomentBatches +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +namespace SLEExactGauge.MomentBatches + +variable {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +lemma integrable_counts (m : ℕ → ℝ) (n : ℕ) {X : Ω → ℝ} (hX : Measurable X) : + Integrable (fun ω => counts m n (X ω)) P := by + apply integrable_finsetSum + intro k hk + exact (integrable_const (multiplicity m n k:ℝ)).indicator (measurableSet_le measurable_const hX) + +lemma integral_counts (m : ℕ → ℝ) (n : ℕ) {X : Ω → ℝ} (hX : Measurable X) : + (∫ ω, counts m n (X ω) ∂P) = + ∑ k∈support m n, (multiplicity m n k:ℝ)*P.real {ω | (2:ℝ)^k ≤ X ω} := by + rw [show (fun ω => counts m n (X ω)) = + (fun ω => ∑ k∈support m n, {ω | (2:ℝ)^k ≤ X ω}.indicator + (fun _ => (multiplicity m n k:ℝ)) ω) from rfl] + rw [integral_finsetSum _ (fun k hk => (integrable_const (multiplicity m n k:ℝ)).indicator + (measurableSet_le measurable_const hX))] + apply Finset.sum_congr rfl + intro k hk + rw [integral_indicator_const _ (measurableSet_le measurable_const hX),smul_eq_mul,mul_comm] + + + +theorem upper_tail_finite (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (n : ℕ) (hn : 0 < n) (hLn : Integrable (fun ω => (L ω)^n) P) + (hmn : 0 < moment P L n) : + (∑ k∈support (moment P L) n, (multiplicity (moment P L) n k:ℝ)* + P.real {ω | 16*(2:ℝ)^k ≤ L ω}) ≤ (4:ℝ)^n/(16:ℝ)^n/(1-(1/2:ℝ)^n) := by + let m := moment P L + let C := ((4:ℝ)^n/m n)/(16:ℝ)^n/(1-(1/2:ℝ)^n) + have hmaj : (fun ω => counts m n (L ω/16)) ≤ᵐ[P] (fun ω => C*(L ω)^n) := by + filter_upwards [hL0] with ω hω + calc + counts m n (L ω/16) ≤ ((4:ℝ)^n/m n)*((L ω/16)^n/(1-(1/2:ℝ)^n)) := + counts_upper hn hmn (by positivity) + _ = C*(L ω)^n := by dsimp only [C]; rw [div_pow]; ring + have hI := integral_mono_ae (integrable_counts P m n (hL.div_const 16)) (hLn.const_mul C) hmaj + rw [integral_counts P m n (hL.div_const 16),integral_const_mul] at hI + have hsets (k : ℤ) : {ω | (2:ℝ)^k ≤ L ω/16} = {ω | 16*(2:ℝ)^k ≤ L ω} := by + ext ω + simp only [mem_ofPred_eq,le_div_iff₀ (by norm_num : (0:ℝ)<16),mul_comm] + simp_rw [hsets] at hI + have he : C*(∫ ω,(L ω)^n∂P) = (4:ℝ)^n/(16:ℝ)^n/(1-(1/2:ℝ)^n) := by + change (((4:ℝ)^n/m n)/(16:ℝ)^n/(1-(1/2:ℝ)^n))*m n = _ + field_simp [show m n ≠ 0 from hmn.ne'] + exact he ▸ hI + +lemma sum_eq_tsum_multiplicity {m : ℕ → ℝ} {n : ℕ} + (hfin : {k : ℤ | multiplicity m n k≠0}.Finite) (p : ℤ → ℝ) : + (∑ k∈support m n, (multiplicity m n k:ℝ)*p k) = + ∑' k : ℤ, (multiplicity m n k:ℝ)*p k := by + symm + apply tsum_eq_sum + intro k hk + have hn : multiplicity m n k=0 := not_not.mp (by rwa [mem_support hfin] at hk) + simp only [hn,Nat.cast_zero,zero_mul] + + + +lemma moment_sequence_properties (L : Ω → ℝ) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) : + (∀ n, 0 < n → 0 < moment P L n) ∧ + (∀ n, 0 < n → (moment P L 1)^n ≤ moment P L n) := by + have hJ (n : ℕ) : (moment P L 1)^n ≤ moment P L n := + mean_pow_le_moment P L hL0 (by simpa only [pow_one] using hint 1) n (hint n) + exact ⟨fun n hn => (pow_pos hmean n).trans_le (hJ n),fun n hn => hJ n⟩ + +theorem upper_tail (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) + (n : ℕ) (hn : 0 < n) : + (∑' k : ℤ, (multiplicity (moment P L) n k:ℝ)*P.real {ω | 16*(2:ℝ)^k ≤ L ω}) ≤ + (4:ℝ)^n/(16:ℝ)^n/(1-(1/2:ℝ)^n) := by + obtain ⟨hm,hJ⟩ := moment_sequence_properties P L hL0 hint hmean + rw [← sum_eq_tsum_multiplicity + (finite_multiplicity_support hn hmean (hm n hn) (hm (n+1) (by omega)) (hJ n hn))] + exact upper_tail_finite P L hL hL0 n hn (hint n) (hm n hn) + + + +omit [IsProbabilityMeasure P] in +lemma truncated_moment_lower [IsProbabilityMeasure P] (L Y : Ω → ℝ) (hY : Measurable Y) + (hYL : ∀ᵐ ω ∂P, 0 ≤ Y ω ∧ Y ω ≤ L ω) (n : ℕ) + (hLn : Integrable (fun ω => (L ω)^(n+1)) P) + (hYn : Integrable (fun ω => (Y ω)^n) P) + (hmn : 0 < moment P L n) (hmnext : 0 < moment P L (n+1)) + (happrox : 3*moment P L n/4 ≤ moment P Y n) : + moment P L n/2 ≤ + ∫ ω, {ω | Y ω ≤ cutoff (moment P L) n}.indicator (fun ω => (Y ω)^n) ω ∂P := by + let T := cutoff (moment P L) n + let G := {ω | Y ω ≤ T} + have hT : 0 < T := by dsimp [T,cutoff]; positivity + have hG : MeasurableSet G := measurableSet_le hY measurable_const + have hpoint : (fun ω => (Y ω)^n) ≤ᵐ[P] + (fun ω => G.indicator (fun ω => (Y ω)^n) ω + (L ω)^(n+1)/T) := by + filter_upwards [hYL] with ω hω + have hL0 : 0 ≤ L ω := hω.1.trans hω.2 + by_cases hg : ω∈G + · rw [indicator_of_mem hg] + exact le_add_of_nonneg_right (by positivity) + · rw [indicator_of_notMem hg,zero_add] + apply (le_div_iff₀ hT).mpr + calc + (Y ω)^n*T ≤ (Y ω)^n*Y ω := + mul_le_mul_of_nonneg_left (le_of_not_ge hg) (pow_nonneg hω.1 _) + _ = (Y ω)^(n+1) := (pow_succ _ _).symm + _ ≤ (L ω)^(n+1) := pow_le_pow_left₀ hω.1 hω.2 _ + have hI := integral_mono_ae hYn ((hYn.indicator hG).add (hLn.div_const T)) hpoint + simp only [Pi.add_apply] at hI + rw [integral_add (hYn.indicator hG) (hLn.div_const T),integral_div] at hI + have he : (∫ ω,(L ω)^(n+1)∂P)/T = moment P L n/4 := by + change moment P L (n+1)/(4*moment P L (n+1)/moment P L n) = _ + field_simp [hmn.ne', hmnext.ne'] + rw [he] at hI + change moment P Y n ≤ _ at hI + change moment P L n/2 ≤ ∫ ω,G.indicator (fun ω => (Y ω)^n) ω∂P + linarith + + + +theorem success_strong (L Y : Ω → ℝ) (hY : Measurable Y) + (hYL : ∀ᵐ ω ∂P, 0 ≤ Y ω ∧ Y ω ≤ L ω) (n : ℕ) (hn : 0 < n) + (hLn : Integrable (fun ω => (L ω)^(n+1)) P) + (hYn : Integrable (fun ω => (Y ω)^n) P) + (hmn : 0 < moment P L n) (hmnext : 0 < moment P L (n+1)) + (hfin : {k : ℤ | multiplicity (moment P L) n k≠0}.Finite) + (happrox : 3*moment P L n/4 ≤ moment P Y n) : + (2:ℝ)^n/2-1 ≤ ∑ k∈support (moment P L) n, (multiplicity (moment P L) n k:ℝ)* + P.real {ω | (2:ℝ)^k ≤ Y ω} := by + let m := moment P L + let G := {ω | Y ω ≤ cutoff m n} + let f := G.indicator (fun ω => (Y ω)^n) + let D := (2:ℝ)^n/m n + have hG : MeasurableSet G := measurableSet_le hY measurable_const + have hD : 0 ≤ D := by dsimp [D,m]; positivity + have hpoint : (fun ω => D*f ω-1) ≤ᵐ[P] (fun ω => counts m n (Y ω)) := by + filter_upwards [hYL] with ω hω + by_cases hg : ω∈G + · have he : f ω = (Y ω)^n := indicator_of_mem hg _ + rw [he] + simpa only [D,div_mul_eq_mul_div] using counts_lower hn hmn hfin hω.1 hg + · have he : f ω=0 := indicator_of_notMem hg _ + rw [he,mul_zero,zero_sub] + exact (by norm_num : (-1:ℝ)≤0).trans (counts_nonneg m n (Y ω)) + have hI := integral_mono_ae (((hYn.indicator hG).const_mul D).sub (integrable_const 1)) + (integrable_counts P m n hY) hpoint + simp only [Pi.sub_apply] at hI + rw [integral_sub ((hYn.indicator hG).const_mul D) (integrable_const 1), + integral_const_mul,integral_const,probReal_univ,one_smul,integral_counts P m n hY] at hI + have htr := truncated_moment_lower P L Y hY hYL n hLn hYn hmn hmnext happrox + have hmul := mul_le_mul_of_nonneg_left htr hD + have he : D*(m n/2) = (2:ℝ)^n/2 := by dsimp [D]; field_simp [show m n ≠ 0 from hmn.ne'] + rw [he] at hmul + exact (sub_le_sub_right hmul 1).trans hI + +lemma success_numerics (n : ℕ) (hn : 3 ≤ n) : + (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) ≤ (2:ℝ)^n/2-1 ∧ + (2:ℝ)^n/8 ≤ (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) := by + have hlow : (8:ℝ) ≤ 2^n := by + have hp := pow_le_pow_right₀ (by norm_num : (1:ℝ)≤2) hn + norm_num at hp ⊢ + exact hp + have hq : (1/2:ℝ)^n ≤ 1/2 := by + simpa using pow_le_pow_of_le_one (by norm_num : (0:ℝ)≤1/2) (by norm_num : (1/2:ℝ)≤1) + (show 1 ≤ n by omega) + have hden : 1 ≤ 2*(1-(1/2:ℝ)^n) := by linarith + have hsub0 : 0 ≤ 1/(2*(1-(1/2:ℝ)^n)) := by positivity + have hsub1 : 1/(2*(1-(1/2:ℝ)^n)) ≤ 1 := (div_le_one (by linarith)).mpr hden + have hpow : (2:ℝ)^(n-2) = (2:ℝ)^n/4 := by + obtain ⟨j,hj⟩ := Nat.exists_eq_add_of_le (show 2 ≤ n by omega) + rw [hj,Nat.add_sub_cancel_left,pow_add] + norm_num + rw [hpow] + constructor <;> linarith + + + +theorem success (L Y : Ω → ℝ) (hY : Measurable Y) + (hYL : ∀ᵐ ω ∂P, 0 ≤ Y ω ∧ Y ω ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) + (n : ℕ) (hn : 3 ≤ n) (hYn : Integrable (fun ω => (Y ω)^n) P) + (happrox : 3*moment P L n/4 ≤ moment P Y n) : + (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) ≤ + (∑' k : ℤ, (multiplicity (moment P L) n k:ℝ)*P.real {ω | (2:ℝ)^k ≤ Y ω}) ∧ + (2:ℝ)^n/8 ≤ (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) := by + have hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω := hYL.mono (fun ω hω => hω.1.trans hω.2) + obtain ⟨hm,hJ⟩ := moment_sequence_properties P L hL0 hint hmean + have hnp : 0 < n := by omega + have hfin := finite_multiplicity_support hnp hmean (hm n hnp) (hm (n+1) (by omega)) (hJ n hnp) + have hb := success_strong P L Y hY hYL n hnp (hint (n+1)) hYn + (hm n hnp) (hm (n+1) (by omega)) hfin happrox + rw [sum_eq_tsum_multiplicity hfin] at hb + exact ⟨(success_numerics n hn).1.trans hb,(success_numerics n hn).2⟩ + +end SLEExactGauge.MomentBatches +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/NormalizedDiskMass.lean b/lean/OAI/Probability/SLEGauge/NormalizedDiskMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe7fbd60189cb4317133d95608eb4c6dc7b46a25 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/NormalizedDiskMass.lean @@ -0,0 +1,537 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.HalfPlaneDistortion + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator CenteredMoments LoewnerScaling +open LoewnerGeometry MassVersions + +lemma diskAt_fromDisk (θ : ℝ) : diskAt (fromDisk θ 0)=diskMap θ := by + funext v + rw [fromDisk_zero] + have he : star (Complex.exp (Complex.I*θ))=Complex.exp (-Complex.I*θ) := by + rw [Complex.star_def,←Complex.exp_conj] + simp + simp only [diskAt,he,diskMap] + +lemma diskAt_scaled (c : ℝ) (hc : 0ENNReal.ofReal + ((2*w.1.im/‖v.1-star w.1‖^2)^(2-alpha a)) := by + funext v + rw [pointDiskWeight,diskAt_deriv_norm w.2 v.2] + rw [he] + fun_prop + +lemma pointDiskMass_diskMass (a θ q : ℝ) (ν : Measure UpperPlane) + (hθ : 0<θ) (hθπ : θ(restartWeight_disk_bounds a ha b t w hq hq1 v hv).1) + · exact setLIntegral_mono' (pointDiskRegion_measurable w q) + (fun v hv=>(restartWeight_disk_bounds a ha b t w hq hq1 v hv).2) + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator CenteredMoments LoewnerScaling +open LoewnerGeometry MassVersions TraceMassContinuity + + + +def radialDiskRegion (a : ℝ) (ha : 0radialTime a b.1 z σ + let R := radialDiskRegion a (lt_trans (by norm_num) ha) z σ q + ∀ᵐ b∂W,S b≠∞→μ (S b) b (R b)=0 ∧ ∀l : ℕ, + ENNReal.ofReal ((diskLower q*σ)^(2-alpha a))*normalizedTest a z σ (subdiskMass a μ q l) b ≤ + μ (radialTime a b.1 z (σ*Real.exp (-2*a*l))) b (R b) ∧ + μ (radialTime a b.1 z (σ*Real.exp (-2*a*l))) b (R b) ≤ + ENNReal.ofReal ((diskUpper q*σ)^(2-alpha a))*normalizedTest a z σ (subdiskMass a μ q l) b := by + dsimp only + let μ := recoveredMass a ha s c hc + let S := fun b : GDriver=>radialTime a b.1 z σ + let ha0 : 0ν R) hrest.1 + rwa [Measure.restrict_apply hR,inter_eq_left.mpr hRA,Measure.coe_zero,Pi.zero_apply] at hh + refine ⟨hzero,?_⟩ + intro l + let w := radialPoint a z σ b + let t := (‖w.1‖₊:ℝ≥0∞)^2*levelTime a (pointAngle w).1 (normalizeDriver w (restartAt S b)).1 l + have ht : S b+t=radialTime a b.1 z (σ*Real.exp (-2*a*l)) := + normalized_levelTime_restart a ha0 z hz σ hσ hσz l b hbf + have he : μ (radialTime a b.1 z (σ*Real.exp (-2*a*l))) b R= + restartPush a ha0 b (S b).toNNReal (μ t (restartAt S b)) R := by + have hh := congrArg (fun ν : Measure UpperPlane=>ν R) (hrest.2 t) + rwa [Measure.restrict_apply hR,inter_eq_left.mpr hRA,ht] at hh + have hbounds := restartPush_disk_bounds a ha b (S b).toNNReal w hq hq1 (μ t (restartAt S b)) + rw [radialPoint_spatial_radius a ha0 z hz σ hσ hσz b hbf] at hbounds + have hnorm : normalizedTest a z σ (subdiskMass a μ q l) b= + pointDiskMass a w q (μ t (restartAt S b)) := + normalized_subdiskMass_eq a ha s c hc w (restartAt S b) q l + change ENNReal.ofReal ((diskLower q*σ)^(2-alpha a))*normalizedTest a z σ (subdiskMass a μ q l) b≤ + μ (radialTime a b.1 z (σ*Real.exp (-2*a*l))) b R ∧ _ + rw [hnorm,he] + exact hbounds + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.PastMass +open FlowIdentification ExactSLEGreen TraceMassContinuity TraceRestriction + +lemma denseRange_nnrat_nnreal : DenseRange (fun q : ℚ≥0 => (q : ℝ≥0)) := by + apply dense_of_exists_between + intro a b hab + obtain ⟨q,haq,hqb⟩ := exists_rat_btwn (show (a : ℝ)<(b : ℝ) from hab) + have hq : 0≤q := Rat.cast_nonneg.mp ((a.2.trans haq.le) : (0 : ℝ)≤q) + let r : ℚ≥0 := ⟨q,hq⟩ + refine ⟨(r : ℝ≥0),⟨r,rfl⟩,?_,?_⟩ + · change (a : ℝ) < (r : ℝ) + simpa only [r,NNRat.cast_mk] using haq + · change (r : ℝ) < (b : ℝ) + simpa only [r,NNRat.cast_mk] using hqb + + + +lemma accumulated_continuous (κ : ℝ) (hκ : 0<κ) (b : GDriver) + (μ : ℝ≥0∞→Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : μ ∞ Q≠∞) : + Continuous (fun t : ℝ≥0 => (μ t Q).toReal) := by + let := hμ.atomless + let f : UpperPlane→ℝ := Q.indicator (fun _=>1) + have hf : Integrable f (μ ∞) := (integrable_indicator_iff hQ).mpr (integrableOn_const hfin) + have hγ := continuous_internalTrace hκ _ hμ.continuous_trace + have hc := continuous_integral_visited (μ ∞) (fun z : UpperPlane=>z.1) + measurable_subtype_coe Subtype.val_injective _ hγ f hf + have he (t : ℝ≥0) : (∫z in visited (fun z : UpperPlane=>z.1) + (internalTrace κ (driverHomeomorph.symm b)) t,f z∂μ ∞) = (μ t Q).toReal := by + rw [←hμ.restriction] + simp only [f,integral_indicator hQ,integral_const,Measure.real, + Measure.restrict_apply_univ,smul_eq_mul,mul_one] + simpa only [he] using hc + +lemma accumulated_zero (κ : ℝ) (b : GDriver) (μ : ℝ≥0∞→Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) : μ 0=0 := by + simpa only [ENNReal.coe_zero,not_lt_zero,ofPred_false,Measure.restrict_empty] using + hμ.strict_firstVisit_identity 0 + + + +lemma exists_rational_threshold (κ : ℝ) (hκ : 0<κ) (b : GDriver) + (μ : ℝ≥0∞→Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : μ ∞ Q≠∞) + (H U : ℝ) (hH : 0≤H) (hHU : H(μ t Q).toReal + have hM : Continuous M := accumulated_continuous κ hκ b μ hμ Q hQ hfin + have hzero : M 0=0 := by simp [M,accumulated_zero κ b μ hμ] + have hlim : Tendsto (fun n : ℕ=>M (n:ℝ≥0)) atTop (𝓝 (μ ∞ Q).toReal) := + (ENNReal.tendsto_toReal hfin).comp (hμ.exhaustion Q hQ) + obtain ⟨n,hn⟩ := (hlim.eventually (eventually_gt_nhds hUM)).exists + have hmid : (H+U)/2∈Icc (M 0) (M (n:ℝ≥0)) := by rw [hzero]; constructor <;> linarith + obtain ⟨t,ht⟩ := intermediate_value_univ (0:ℝ≥0) (n:ℝ≥0) hM hmid + exact denseRange_nnrat_nnreal.exists_mem_open (isOpen_Ioo.preimage hM) + ⟨t,by change H linarith⟩ + + + +lemma mass_le_twice_strict_past (κ : ℝ) (hκ : 0<κ) (b : GDriver) + (μ : ℝ≥0∞→Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : μ ∞ Q≠∞) + (H : ℝ) (hH : 0≤H) (hbad : 2*ENNReal.ofReal H<μ ∞ Q) : + μ ∞ Q ≤ 2*μ ∞ (Q∩{z | ∃q : ℚ≥0, + ENNReal.ofReal H<μ ((q:ℝ≥0):ℝ≥0∞) Q ∧ ((q:ℝ≥0):ℝ≥0∞)(q:ℝ≥0)) W a μ Q H + +namespace TracePalmData +variable {κ a : ℝ} {W : Measure GDriver} {μ : ℝ≥0∞→GDriver→Measure UpperPlane} + (D : TracePalmData κ a W μ) +include D + +lemma rational_Palm (ha : 1/4b.1 t) W) + (Q : Set UpperPlane) (hQ : IsCompact Q) (H : ℝ≥0∞) : + (∫⁻b,μ ∞ b (Q∩{z | ∃q : ℚ≥0,H<μ ((q:ℝ≥0):ℝ≥0∞) b Q ∧ + ((q:ℝ≥0):ℝ≥0∞)(q:ℝ≥0)) + rationalTestEnumeration_surjective Q hQ H + +lemma rational_kernel_measurable (ha : 1/4(q:ℝ≥0)) Q hQ H + + + +lemma expected_bad_mass_le (hκ : 0<κ) (ha : 1/4b.1 t) W) + (Q : Set UpperPlane) (hQ : IsCompact Q) (H : ℝ) (hH : 0≤H) : + (∫⁻b, {b | 2*ENNReal.ofReal H<μ ∞ b Q}.indicator (fun b=>μ ∞ b Q) b∂W) ≤ + 2*∫⁻z in Q,ENNReal.ofReal (initialGreen a z)* + rationalPastKernel W a μ Q (ENNReal.ofReal H) z∂upperArea := by + have hm := D.countable_past_aemeasurable rationalTestEnumeration (fun q : ℚ≥0=>(q:ℝ≥0)) + rationalTestEnumeration_surjective Q hQ (ENNReal.ofReal H) + rw [←D.rational_Palm ha hW Q hQ (ENNReal.ofReal H),←lintegral_const_mul'' _ hm] + apply lintegral_mono_ae + filter_upwards [D.path] with b hb + by_cases hbad : 2*ENNReal.ofReal H<μ ∞ b Q + · simp only [indicator,mem_ofPred_eq,ite_eq_left hbad] + exact mass_le_twice_strict_past κ hκ b (fun v=>μ v b) hb Q hQ.measurableSet + (D.compact_finite Q hQ ∞ b) H hH hbad + · simp only [indicator,mem_ofPred_eq,ite_eq_right hbad] + exact bot_le + +end TracePalmData + +end SLEExactGauge.PastMass +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/NormalizedMarkedMoment.lean b/lean/OAI/Probability/SLEGauge/NormalizedMarkedMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e676321ce090d9d9df97c9f8fd668f2dfb9c7d0 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/NormalizedMarkedMoment.lean @@ -0,0 +1,557 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.MarkedMomentBound + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.KernelSimilarity +open ExactSLEMain ExactSLEGenerator ExactSLEGreen ExactSLEKernel + +lemma pi_restrict_mono {K L : Set ℂ} (h : K⊆L) (m : ℕ) : + Measure.pi (fun _ : Fin m=>volume.restrict K) ≤ + Measure.pi (fun _ : Fin m=>volume.restrict L) := by + rw [←Measure.restrict_pi_pi,←Measure.restrict_pi_pi] + exact Measure.restrict_mono (Set.pi_mono (fun _ _=>h)) le_rfl + +lemma normalization_cancel (α C B : ℝ) (hC : 0≤C) (hB : 0≤B) + {y r : ℝ} (hy : 0b.1 t) W → + ∀(x y : ℝ) (hy : 0∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) t b) + atTop (𝓝 (∫z,f z∂μ b))) → + ∀r : ℝ,0volume.restrict K) + have hI : I<∞ := (hD₀b Complex.I (mem_singleton _)).trans_lt hD₀ + refine ⟨ENNReal.ofReal (C*2^(alpha a))*(ENNReal.ofReal B)^m*I, + ENNReal.mul_lt_top (ENNReal.mul_lt_top ENNReal.ofReal_lt_top + (ENNReal.pow_lt_top ENNReal.ofReal_lt_top)) hI,?_⟩ + intro W hprob hW x y hy f hsupport hf s coeff hcoeff hsum t μ hlim r hr hr1 + let T := affine (x:ℂ) y hy + let Kf := Subtype.val '' tsupport f + let ν := Measure.pi (fun _ : Fin m=>volume.restrict Kf) + have hKf : IsCompact Kf := f.hasCompactSupport.image continuous_subtype_val + have hcap (z : UpperPlane) (hz : z∈tsupport f) : y*c≤2*z.1.im := by + obtain ⟨w,hw,hew⟩ := hsupport ⟨z,hz,rfl⟩ + have hi := hcK w hw + rw [←hew,affine_im_real] + nlinarith + have hzc : y*c≤2*(T Complex.I).im := by + simp only [T,affine_im_real,Complex.I_im,mul_one] + nlinarith + obtain ⟨_,hbound⟩ := hCb W hW f (y*c) (mul_pos hy hc) hcap (T Complex.I) hzc + have hmker : Measurable (fun z : Fin m→ℂ=>kernel (alpha a) (y*c) + (Fin.cons (T Complex.I) z)) := + (measurable_kernel (alpha_pos ha).le _).comp (by fun_prop) + have hKae : ∀ᵐ z∂ν,∀i,z i∈Kf := by + apply ae_all_iff.mpr + intro i + exact (Measure.tendsto_eval_ae_ae (μ:=fun _ : Fin m=>volume.restrict Kf) (i:=i)).eventually + (ae_restrict_mem hKf.measurableSet) + have hA : + (∫⁻z : Fin m→ℂ,(∏i,ENNReal.ofReal ‖upperExtension f (z i)‖)* + kernel (alpha a) (y*c) (Fin.cons (T Complex.I) z)∂ν)≤ + (ENNReal.ofReal (B*y^(alpha a-2)))^m* + ((ENNReal.ofReal y)^(2*(m:ℝ)-alpha a*((m:ℝ)+1))*I) := by + calc + _ ≤ ∫⁻z : Fin m→ℂ,(ENNReal.ofReal (B*y^(alpha a-2)))^m* + kernel (alpha a) (y*c) (Fin.cons (T Complex.I) z)∂ν := by + apply lintegral_mono_ae + filter_upwards [hKae] with z hz + apply mul_le_mul' _ le_rfl + have hprod : (∏i : Fin m,ENNReal.ofReal ‖upperExtension f (z i)‖)≤ + ∏i : Fin m,ENNReal.ofReal (B*y^(alpha a-2)) := by + apply Finset.prod_le_prod₀ (fun _ _ => bot_le) + intro i hi + obtain ⟨w,hw,hew⟩ := hz i + exact ENNReal.ofReal_le_ofReal (by rw [←hew,upperExtension_apply]; exact hf w) + simpa using hprod + _ = (ENNReal.ofReal (B*y^(alpha a-2)))^m* + ∫⁻z : Fin m→ℂ,kernel (alpha a) (y*c) (Fin.cons (T Complex.I) z)∂ν := + lintegral_const_mul _ hmker + _ ≤ (ENNReal.ofReal (B*y^(alpha a-2)))^m* + ∫⁻z : Fin m→ℂ,kernel (alpha a) (y*c) (Fin.cons (T Complex.I) z) + ∂Measure.pi (fun _=>volume.restrict (T '' K)) := by + apply mul_le_mul' le_rfl + exact lintegral_mono' (pi_restrict_mono hsupport m) le_rfl + _ = _ := by rw [fixed_center_integral_affine (alpha a) c (alpha_pos ha).le (x:ℂ) Complex.I hy hK] + calc + _ ≤ ENNReal.ofReal (C*(2*(y*r))^(alpha a))* + ∫⁻z : Fin m→ℂ,(∏i,ENNReal.ofReal ‖upperExtension f (z i)‖)* + kernel (alpha a) (y*c) (Fin.cons (T Complex.I) z)∂ν := + hbound s coeff hcoeff hsum t μ hlim (y*r) (mul_pos hy hr) (by + simp only [T,affine_im_real,Complex.I_im,mul_one] + exact mul_le_of_le_one_right hy.le hr1) + _ ≤ ENNReal.ofReal (C*(2*(y*r))^(alpha a))* + ((ENNReal.ofReal (B*y^(alpha a-2)))^m* + ((ENNReal.ofReal y)^(2*(m:ℝ)-alpha a*((m:ℝ)+1))*I)) := + mul_le_mul' le_rfl hA + _ = (ENNReal.ofReal (C*(2*(y*r))^(alpha a))* + ((ENNReal.ofReal (B*y^(alpha a-2)))^m* + (ENNReal.ofReal y)^(2*(m:ℝ)-alpha a*((m:ℝ)+1))))*I := by ring + _ = _ := by rw [normalization_cancel (alpha a) C B hC.le hB hy hr m]; ring + +end SLEExactGauge.KernelSimilarity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen KernelSimilarity + +lemma radialWeight_measurable (a : ℝ) (ha : 1/4 radialWeight a b.1 z (z.im*r)) := + (joint_radialWeight_measurable a ha r hr hr1).comp + (measurable_id.prodMk (measurable_const (a:= (⟨z,hz⟩ : UpperPlane)))) + + + +lemma radialLaw_lintegral_le_hit (W : Measure ExactSLEGenerator.Driver) + (a : ℝ) (ha : 1/4 radialTime a b.1 z (z.im*r)) := hS.measurable' + have hE : MeasurableSet {b : ExactSLEGenerator.Driver | radialTime a b.1 z (z.im*r)<∞} := + measurableSet_lt hmT measurable_const + rw [radialLaw,lintegral_withDensity_eq_lintegral_mul W hm hg, + ←lintegral_indicator hE,←lintegral_const_mul _ (hg.indicator hE)] + apply lintegral_mono + intro b + change _*g b≤_ + by_cases hb : radialTime a b.1 z (z.im*r)<∞ + · simp only [Set.indicator,Set.mem_ofPred_eq,hb,ite_true] + apply mul_le_mul' _ le_rfl + apply ENNReal.ofReal_le_ofReal + apply div_le_div_of_nonneg_right _ hG.le + have h := (radialWeight_bound a ha z hz _ hρ hρz b).2 + calc + _ ≤ Real.exp (-alpha a*Real.log (z.im*r)) := h + _ = _ := by rw [Real.rpow_def_of_pos hρ]; congr 1; ring + · simp only [Set.indicator,Set.mem_ofPred_eq,hb,ite_false,mul_zero] + have ht : radialTime a b.1 z (z.im*r)=∞ := top_le_iff.mp (not_lt.mp hb) + simp [radialWeight,ht] + +lemma center_affine (θ : ℝ) (hθ : 0<θ) (hθπ : θb.1 t) W → + ∀(θ : ℝ) (hθ : 0<θ) (hθπ : θ ∫z,f z∂μ b) → + (∀ᵐ b∂W,Tendsto (fun k=>∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) t b) + atTop (𝓝 (∫z,f z∂μ b))) → + ∀l : ℕ,(∫⁻b,‖∫z,f z∂μ b‖ₑ^m∂radialLaw W a (fromDisk θ 0) + (Real.sin θ*Real.exp (-2*a*l)))≤D*ENNReal.ofReal ((Real.sin θ)^(-p a)) := by + obtain ⟨D,hD,hbound⟩ := actual_normalized_hit_moment_bound a ha m hm K hK hKb c hc hc2 hcK B hB + refine ⟨D,hD,?_⟩ + intro W hprob hW θ hθ hθπ f hsupport hf s coeff hcoeff hsum t μ hμ hlim l + have hy := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + have hz : 0<(fromDisk θ 0).im := by rw [fromDisk_zero_im]; exact hy + let r : ℝ := Real.exp (-2*a*l) + have hr : 0‖∫z,f z∂μ b‖ₑ^m) (hμ.enorm.pow_const m) + rw [fromDisk_zero_im,radial_initial_green a θ hθ hθπ] at ht + refine ht.trans ((mul_le_mul' le_rfl hhit).trans_eq ?_) + rw [←mul_left_comm D,tilt_cancel (alpha a) (p a) hy hr] + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGreen KernelSimilarity + + +def upperAffine (x y : ℝ) (hy : 00by + change dist z.1 Complex.I<3/4 + exact lt_of_le_of_lt hz (by norm_num)) + exact ⟨⟨f,hfc⟩,h01,fun z hz=>hf hz,fun z hz=>hfs hz⟩ + +def diskCutoff : C_c(UpperPlane,ℝ) := Classical.choose cutoff_exists + +lemma diskCutoff_nonneg (z : UpperPlane) : 0≤diskCutoff z := + (Classical.choose_spec cutoff_exists).1 z |>.1 +lemma diskCutoff_le_one (z : UpperPlane) : diskCutoff z≤1 := + (Classical.choose_spec cutoff_exists).1 z |>.2 +lemma diskCutoff_one (z : UpperPlane) (hz : dist z.1 Complex.I≤2/3) : diskCutoff z=1 := + (Classical.choose_spec cutoff_exists).2.1 z hz +lemma diskCutoff_support (z : UpperPlane) (hz : z∈tsupport diskCutoff) : + dist z.1 Complex.I<3/4 := (Classical.choose_spec cutoff_exists).2.2 z hz + + + +def diskWeight (a θ : ℝ) (z : UpperPlane) : ℝ := ‖deriv (diskMap θ) z.1‖^(2-alpha a) + +def diskMass (a θ : ℝ) (ν : Measure UpperPlane) : Measure ℂ := + (ν.withDensity (fun z=>ENNReal.ofReal (diskWeight a θ z))).map (fun z=>diskMap θ z.1) + +lemma diskMap_measurable (θ : ℝ) : Measurable (fun z : UpperPlane=>diskMap θ z.1) := by + unfold diskMap + fun_prop + +lemma diskWeight_measurable (a θ : ℝ) (hθ : 0<θ) (hθπ : θ + ‖((2*Real.sin θ:ℝ):ℂ)*Complex.I/(z.1-Complex.exp (-Complex.I*θ))^2‖^(2-alpha a) := by + funext z; rw [diskWeight,disk_deriv θ hθ hθπ z] + rw [he] + fun_prop + +lemma dimension_pos (a : ℝ) (ha : 1/4by rw [Real.norm_eq_abs,abs_of_nonneg (diskCutoff_nonneg z)]; exact diskCutoff_le_one z) z + +lemma diskTest_support (a θ : ℝ) (hθ : 0<θ) (hθπ : θ (2^(2-alpha a):ℝ)) + (normalizedTest a (Real.cos θ) (Real.sin θ) (Real.sin_pos_of_pos_of_lt_pi hθ hθπ) diskCutoff))).trans + exact normalizedTest_support a _ _ _ diskCutoff + +lemma diskWeight_le_diskTest (a θ : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 ENNReal.ofReal (tiltWeight a θ.1 b.1 l))= + radiusDensity a (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*l)) := by + funext b + rw [radiusDensity,tiltWeight_radialWeight a θ.1 ha θ.2.1 θ.2.2 b l] + unfold finiteTestKernel radialLaw + change (∫⁻b,f (θ,b)∂W.withDensity + (radiusDensity a (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*l))))=_ + rw [←he] + exact lintegral_withDensity_eq_lintegral_mul W hm + (hf.comp (measurable_const.prodMk measurable_id)) + +lemma finiteTestKernel_measurable (W : Measure GDriver) [SFinite W] + (a : ℝ) (ha : 1/4radialTime a c.1 z σ) b)) + +lemma normalizedTest_measurable (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4f (pointAngle p.1,normalizeDriver p.1 p.2) + have hF : Measurable F := hf.comp ((pointAngle_measurable.comp measurable_fst).prodMk + continuous_normalizeDriver.measurable) + have hq1 : Real.exp (-2*a*l)≤1 := Real.exp_le_one_iff.mpr (by + have ha0 : 0radialTime a c.1 z σ) b) + ∂radialLaw W a z (σ*Real.exp (-2*a*l)))=_ + rw [radialLaw_restart W hW a ha z hz σ _ hρ hr hσz A hA F hF] + have hrat : σ*Real.exp (-2*a*l)/σ=Real.exp (-2*a*l) := mul_div_cancel_left₀ _ hσ.ne' + simp_rw [hrat] + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae (radial_hit_ae W a ha z hz σ hσ hσz)] with b hb + change (∫⁻c,f (pointAngle (radialPoint a z σ b),normalizeDriver (radialPoint a z σ b) c) + ∂radialLaw W a (radialPoint a z σ b).1 ((radialPoint a z σ b).1.im*Real.exp (-2*a*l)))=_ + rw [radialLaw_normalize_integral W hW a ha _ _ hq hq1 + (fun c=>f (pointAngle (radialPoint a z σ b),c)) + (hf.comp (measurable_const.prodMk measurable_id)), + pointAngle_radialPoint a (by linarith) z hz σ hσ hσz b hb] + rfl + + + +theorem normalizedTest_conditional_bounds (W : Measure GDriver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/4levelTime a θ.1 b.1 l) := by + have he : (fun b : ExactSLEGenerator.Driver=>levelTime a θ.1 b.1 l)=fun b=> + radialTime a b.1 (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*l)) := by + funext b + exact levelTime_radialTime a θ.1 θ.2.1 θ.2.2 b.1 b.1.continuous l + rw [he] + exact radialTime_stopping a (by linarith) _ + (by rw [fromDisk_zero_im]; exact Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2) + _ (centered_radius_pos a θ l) (centered_radius_le a (by linarith) θ l) + +lemma centeredTime_monotone (a : ℝ) (ha : 1/4μ v b)) (θ : Angle) : + Monotone (fun l=>centeredMass a μ l (θ,b)) := by + intro l k hlk + exact Measure.le_iff'.mp (diskMass_mono + (hμ (centeredTime_monotone a ha θ b hlk)) a θ.1) _ + +lemma centeredMass_raw_measurable (a : ℝ) (ha : 1/4μ (levelTime a θ.1 b.1 l) b)) : + Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>centeredMass a μ l (θ,b)) := by + let : MeasurableSpace ExactSLEGenerator.Driver := (centeredTime_stopping a ha θ l).measurableSpace + have hn := diskMass_joint_measurable a (fun _ : ExactSLEGenerator.Driver=>θ) measurable_const + (fun b : ExactSLEGenerator.Driver=>μ (levelTime a θ.1 b.1 l) b) hμ + exact (Measure.measurable_coe Metric.isClosed_closedBall.measurableSet).comp hn + + +lemma centered_laws_lintegral_consistent (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4levelTime a θ.1 b.1 l)=fun b=> + radialTime a b.1 (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*l)) := by + funext b + exact levelTime_radialTime a θ.1 θ.2.1 θ.2.2 b.1 b.1.continuous l + have hm : (centeredTime_stopping a ha θ l).measurableSpace=hS.measurableSpace := by + congr 1 + have hf' : Measurable[hS.measurableSpace] f := by rwa [hm] at hf + have hme : (radialLaw W a (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*k))).trim + hS.measurableSpace_le = + (radialLaw W a (fromDisk θ.1 0) (Real.sin θ.1*Real.exp (-2*a*l))).trim + hS.measurableSpace_le := by + refine @Measure.ext _ hS.measurableSpace _ _ (fun U hU=> ?_) + rw [trim_measurableSet_eq _ hU,trim_measurableSet_eq _ hU] + exact he U hU + calc + _ = ∫⁻b,f b∂(radialLaw W a (fromDisk θ.1 0) + (Real.sin θ.1*Real.exp (-2*a*k))).trim hS.measurableSpace_le := + (lintegral_trim hS.measurableSpace_le hf').symm + _ = _ := by rw [hme,lintegral_trim hS.measurableSpace_le hf'] + +lemma finiteAngleLaw_lintegral_consistent (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4f (θ,b))) : + (∫⁻p,f p∂finiteAngleLaw W a k)=∫⁻p,f p∂finiteAngleLaw W a l := by + rw [finiteAngleLaw_lintegral W a ha k f hf,finiteAngleLaw_lintegral W a ha l f hf] + exact lintegral_congr (fun θ=>centered_laws_lintegral_consistent W hW a ha θ hlk _ (hr θ)) + + + +theorem finiteMoment_monotone (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + (hmono : ∀ᵐ b∂W,Monotone (fun v=>μ v b)) (m : ℕ) : + Monotone (finiteMoment W a μ m) := by + intro l k hlk + rw [finiteMoment,←finiteAngleLaw_lintegral_consistent W hW a ha hlk _ + ((centeredMass_measurable a ha μ hμ l).pow_const m) + (fun θ=>(centeredMass_raw_measurable a ha μ θ l (hμraw l θ)).pow_const m)] + apply lintegral_mono_ae + have hb : ∀ᵐ p ∂(angleLaw a).prod W,Monotone (fun v=>μ v p.2) := + Measure.quasiMeasurePreserving_snd.tendsto_ae.eventually hmono + filter_upwards [(finiteAngleLaw_absolutelyContinuous W a k).ae_le hb] with p hp + exact pow_le_pow_left' (centeredMass_monotone a ha μ p.2 hp p.1 hlk) m + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator CenteredMoments LoewnerScaling + +lemma raw_stopped_function_congr {E : Type*} [MeasurableSpace E] [MeasurableSingletonClass E] + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {F : GDriver→E} (hF : Measurable[hS.measurableSpace] F) + {b c : GDriver} {u : ℝ≥0} (hb : S b≤u) (h : ∀v≤u,b.1 v=c.1 v) : F b=F c := by + have hh := raw_stopped_event_congr hS (hF (measurableSet_singleton (F b))) hb h + have hc := hh.mp (show b∈F ⁻¹' {F b} from rfl) + exact hc.symm + + + +def finiteStoppedTest (S : GDriver→ℝ≥0∞) (F : GDriver→ℝ≥0∞) (b : GDriver) : ℝ≥0∞ := + if S b=∞ then 0 else F (pastDriver (S b).toNNReal b) + +lemma finiteStoppedTest_raw_measurable {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) (F : GDriver→ℝ≥0∞) (hF : Measurable F) : + Measurable[hS.measurableSpace] (finiteStoppedTest S F) := by + exact Measurable.ite (hS.measurable (measurableSet_singleton ∞)) measurable_const + (hF.comp (pastDriver_stopping_measurable S hS)) + + + +lemma normalized_levelTime_restart (a : ℝ) (ha : 0radialTime a c.1 z σ + let w := radialPoint a z σ b + S b + (‖w.1‖₊:ℝ≥0∞)^2 * levelTime a (pointAngle w).1 + (normalizeDriver w (restartAt S b)).1 l = radialTime a b.1 z (σ*Real.exp (-2*a*l)) := by + dsimp only + let S := fun c : GDriver=>radialTime a c.1 z σ + let w := radialPoint a z σ b + have hs := (pointAngle w).2.1 + have hsπ := (pointAngle w).2.2 + have hq : Real.exp (-2*a*l)≤1 := Real.exp_le_one_iff.mpr (by + have hl : (0:ℝ)≤l := Nat.cast_nonneg l + nlinarith) + have hc := radialTime_scaled a (c:=‖w.1‖₊) (point_norm_pos w) + (restartAt S b).1.continuous (fromDisk (pointAngle w).1 0) + (Real.sin (pointAngle w).1*Real.exp (-2*a*l)) + have hr : ‖w.1‖*(Real.sin (pointAngle w).1*Real.exp (-2*a*l))=w.1.im*Real.exp (-2*a*l) := by + rw [sin_pointAngle] + field_simp [(point_norm_pos w).ne'] + simp only [coe_nnnorm] at hc + rw [norm_mul_fromDisk_pointAngle,hr] at hc + change S b+(‖w.1‖₊:ℝ≥0∞)^2*levelTime a (pointAngle w).1 + (normalizeDriver w (restartAt S b)).1 l=_ + rw [levelTime_radialTime a (pointAngle w).1 hs hsπ _ + (normalizeDriver w (restartAt S b)).1.continuous] + change S b+(‖w.1‖₊:ℝ≥0∞)^2*radialTime a (scaled ‖w.1‖₊ (restartAt S b).1) + (fromDisk (pointAngle w).1 0) (Real.sin (pointAngle w).1*Real.exp (-2*a*l))=_ + rw [hc] + have hh := radialTime_restart a ha z hz σ (σ*Real.exp (-2*a*l)) + (mul_pos hσ (Real.exp_pos _)) (mul_le_of_le_one_right hσ.le hq) hσz b hb + dsimp only at hh + rw [←radialPoint_eq a ha z hz σ hσ hσz b hb,mul_div_cancel_left₀ _ hσ.ne'] at hh + simpa only [S,ENNReal.coe_toNNReal hb,restartAt,w] using hh + +lemma normalizedTest_history_congr (a : ℝ) (ha : 1/4f (θ,b))) + {b c : GDriver} {u : ℝ≥0} + (hb : radialTime a b.1 z (σ*Real.exp (-2*a*l))≤u) + (hbc : ∀v≤u,b.1 v=c.1 v) : + normalizedTest a z σ f b=normalizedTest a z σ f c := by + let S := fun c : GDriver=>radialTime a c.1 z σ + let T := fun c : GDriver=>radialTime a c.1 z (σ*Real.exp (-2*a*l)) + have ha0 : 0hbc v (hv.trans hbs)) + simpa only [ENNReal.coe_toNNReal hbf] using hh + have hw : radialPoint a z σ b=radialPoint a z σ c := + raw_stopped_function_congr hS (radialPoint_raw_measurable a ha z hz σ hσ hσz) hSb hbc + let w := radialPoint a z σ b + let b' := normalizeDriver w (restartAt S b) + let c' := normalizeDriver w (restartAt S c) + let L := levelTime a (pointAngle w).1 b'.1 l + have hsum : S b+(‖w.1‖₊:ℝ≥0∞)^2*L=T b := + normalized_levelTime_restart a ha0 z hz σ hσ hσz l b hbf + have hLf : L≠∞ := by + intro he + have hn : (‖w.1‖₊:ℝ≥0∞)^2≠0 := pow_ne_zero 2 (by + exact ENNReal.coe_ne_zero.mpr (NNReal.coe_ne_zero.mp (point_norm_pos w).ne')) + rw [he,ENNReal.mul_top hn,add_top] at hsum + exact (ne_top_of_le_ne_top ENNReal.coe_ne_top hb) hsum.symm + have htime : (S b).toNNReal+‖w.1‖₊^2*L.toNNReal≤u := by + apply ENNReal.coe_le_coe.mp + simp only [ENNReal.coe_add,ENNReal.coe_mul,ENNReal.coe_pow,ENNReal.coe_toNNReal hLf, + ENNReal.coe_toNNReal hbf] + rw [hsum] + exact hb + have hhistory : ∀v≤L.toNNReal,b'.1 v=c'.1 v := by + intro v hv + change ‖w.1‖⁻¹*((restartAt S b).1 (‖w.1‖₊^2*v))= + ‖w.1‖⁻¹*((restartAt S c).1 (‖w.1‖₊^2*v)) + simp only [restartAt,restart_apply,hSc] + have ht : (S b).toNNReal+‖w.1‖₊^2*v≤u := + (add_le_add le_rfl (mul_le_mul_of_nonneg_left hv (by positivity))).trans htime + rw [hbc _ ht,hbc _ hbs] + have hh := raw_stopped_function_congr (centeredTime_stopping a ha (pointAngle w) l) + (hfraw (pointAngle w)) (le_of_eq (ENNReal.coe_toNNReal hLf).symm) hhistory + change f (pointAngle w,b')=f (pointAngle (radialPoint a z σ c), + normalizeDriver (radialPoint a z σ c) (restartAt S c)) + rw [←hw] + exact hh + + + +lemma finiteStoppedTest_normalizedTest_eq (a : ℝ) (ha : 1/4f (θ,b))) + (b : GDriver) (hb : radialTime a b.1 z (σ*Real.exp (-2*a*l))≠∞) : + finiteStoppedTest (fun c : GDriver=>radialTime a c.1 z (σ*Real.exp (-2*a*l))) + (normalizedTest a z σ f) b=normalizedTest a z σ f b := by + rw [finiteStoppedTest,ite_eq_right hb] + exact (normalizedTest_history_congr a ha z hz σ hσ hσz l f hfraw + (le_of_eq (ENNReal.coe_toNNReal hb).symm) (fun v hv=>(pastDriver_eq _ b v hv).symm)).symm + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology +open scoped ENNReal NNReal Classical +namespace SLEExactGauge.CompactSequence + + +def initialVector {E : Type*} (n : ℕ) (x : ℕ→E) : Fin (n+1)→E := fun i=>x i + +lemma continuous_initialVector {E : Type*} [TopologicalSpace E] (n : ℕ) : + Continuous (initialVector (E:=E) n) := continuous_pi (fun _=>continuous_apply _) + +lemma measurable_initialVector {E : Type*} [MeasurableSpace E] (n : ℕ) : + Measurable (initialVector (E:=E) n) := Measurable.of_eval (fun _=>measurable_pi_apply _) + + + +theorem exists_sequence_law {E Ω : Type*} [TopologicalSpace E] [CompactSpace E] + [T2Space E] [SecondCountableTopology E] [MeasurableSpace E] [BorelSpace E] + [MeasurableSpace Ω] + (P : ℕ→Measure Ω) [∀n,IsProbabilityMeasure (P n)] + (X : ℕ→Ω→E) (hX : ∀n,Measurable (X n)) + (hcons : ∀n k,n≤k → + (P k).map (fun ω : Ω=>fun i : Fin (n+1)=>X i ω)= + (P n).map (fun ω : Ω=>fun i : Fin (n+1)=>X i ω)) : + ∃Q : Measure (ℕ→E),IsProbabilityMeasure Q ∧ + ∀n,Q.map (initialVector n)=(P n).map (fun ω : Ω=>fun i : Fin (n+1)=>X i ω) := by + have hXm : Measurable (fun ω : Ω=>fun n=>X n ω) := Measurable.of_eval hX + let ν : ℕ→ProbabilityMeasure (ℕ→E) := fun n=> + ⟨(P n).map (fun ω : Ω=>fun i=>X i ω),inferInstance⟩ + obtain ⟨Q,hQ⟩ := exists_clusterPt_of_compactSpace (Filter.map ν atTop) + refine ⟨Q,Q.prop,?_⟩ + intro n + have he (k : ℕ) (hkn : n≤k) : + (ν k).map (initialVector n)= + (ν n).map (initialVector n) := by + apply ProbabilityMeasure.toMeasure_injective + change ((P k).map (fun ω : Ω=>fun i=>X i ω)).map (initialVector n)= + ((P n).map (fun ω : Ω=>fun i=>X i ω)).map (initialVector n) + rw [Measure.map_map (measurable_initialVector n) hXm,Measure.map_map (measurable_initialVector n) hXm] + exact hcons n k hkn + have hc : IsClosed {q : ProbabilityMeasure (ℕ→E) | + q.map (initialVector n)=(ν n).map (initialVector n)} := + isClosed_eq (ProbabilityMeasure.continuous_map (continuous_initialVector n)) continuous_const + have hq := hc.mem_of_mapClusterPt hQ (Filter.eventually_atTop.mpr ⟨n,he⟩) + have hqm := congrArg ProbabilityMeasure.toMeasure hq + change Q.toMeasure.map (initialVector n)= + ((P n).map (fun ω : Ω=>fun i=>X i ω)).map (initialVector n) at hqm + rw [Measure.map_map (measurable_initialVector n) hXm] at hqm + exact hqm + + +lemma lintegral_initialVector {E Ω : Type*} [MeasurableSpace E] [MeasurableSpace Ω] + (Q : Measure (ℕ→E)) (P : Measure Ω) (X : ℕ→Ω→E) + (hX : ∀n,Measurable (X n)) (n : ℕ) + (hQ : Q.map (initialVector n)=P.map (fun ω : Ω=>fun i : Fin (n+1)=>X i ω)) + (f : (Fin (n+1)→E)→ℝ≥0∞) (hf : Measurable f) : + (∫⁻x,f (initialVector n x)∂Q)=∫⁻ω,f (fun i=>X i ω)∂P := by + rw [←lintegral_map hf (measurable_initialVector n),hQ, + lintegral_map hf (Measurable.of_eval (fun i=>hX i))] + +lemma lintegral_coordinate {E Ω : Type*} [MeasurableSpace E] [MeasurableSpace Ω] + (Q : Measure (ℕ→E)) (P : Measure Ω) (X : ℕ→Ω→E) + (hX : ∀n,Measurable (X n)) (n : ℕ) + (hQ : Q.map (initialVector n)=P.map (fun ω : Ω=>fun i : Fin (n+1)=>X i ω)) + (f : E→ℝ≥0∞) (hf : Measurable f) : + (∫⁻x,f (x n)∂Q)=∫⁻ω,f (X n ω)∂P := + lintegral_initialVector Q P X hX n hQ (fun x=>f (x ⟨n,by omega⟩)) + (hf.comp (measurable_pi_apply _)) + +end SLEExactGauge.CompactSequence +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/OptionalEstimates.lean b/lean/OAI/Probability/SLEGauge/OptionalEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..c36bfd8603bdedc5bf72f55a580d3a638e4304e6 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/OptionalEstimates.lean @@ -0,0 +1,452 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ProductGenerators + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator Metric +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator + + +theorem discounted_regime_optional {m : ℕ} (s : Finset (Fin m)) {a ε : ℝ} + (ha : 1/4 b.1 t) W) + (Z : ℝ≥0 → Driver → RegimeState m) (hZc : ∀ b, Continuous (fun t => Z t b)) + (hZm : ∀ t, Measurable[rawFiltration t] (Z t)) + (A : RegimeState m → RegimeState m) (hAc : Continuous A) + (K : ℝ) (hK : 0≤K) (hAb : ∀ z, ‖A z‖≤K) + (hZeq : ∀ (u h : ℝ≥0) b, Z (u+h) b = Z u b + increment u h b • (multiNoise m,0) + + ∫ t in (u:ℝ)..((u+h:ℝ≥0):ℝ), A (Z t.toNNReal b)) + (S T : Driver → ℝ≥0) (B N : ℝ≥0) (η : ℝ) (hη : 0<η) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b≤T b) (hTB : ∀ b, T b≤B) + (hsafe : ∀ b t, S b≤t → t≤T b → ‖Z t b‖≤N ∧ + ∀ i∈s, η≤Y ((Z t b).1 i) ∧ physicalDelta a (cap i) (σ i) (off i) ((Z t b).1 i)≤1) + (hA : ∀ b t, S b≤t → t≤T b → + (A (Z t b)).2 = regimeDiscount s a ε cap σ off (Z t b).1 ∧ + ∀ i∈s, (A (Z t b)).1 i = physicalDrift a ((Z t b).1 i)) + (U : Set Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + ∫ b in U, discountedProduct s a cap σ off (Z (T b) b) ∂W ≤ + ∫ b in U, discountedProduct s a cap σ off (Z (S b) b) ∂W := by + + let f := regimeCutoff s a η N cap σ off + have he : ‖(multiNoise m, (0 : ℝ))‖≤1 := by + apply max_le _ (by norm_num) + apply (pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ)≤1)).mpr + intro i + simp [multiNoise,noise,Prod.norm_def] + have hg (b : Driver) (t : ℝ≥0) (hts : S b≤t) (htt : t≤T b) : + generator f A (multiNoise m,0) (Z t b)≤0 := by + have hx := hsafe b t hts htt + have hnear := regimeCutoff_eq_near s a η hη N cap σ off (Z t b) hx.1 + (fun i hi => (hx.2 i hi).1) + have hn : (fun w => fderiv ℝ f w (multiNoise m,0)) =ᶠ[𝓝 (Z t b)] + (fun w => fderiv ℝ (discountedProduct s a cap σ off) w (multiNoise m,0)) := + hnear.fderiv.mono fun w hw => congrArg (fun D : RegimeState m →L[ℝ] ℝ => D (multiNoise m,0)) hw + change (1/2:ℝ)*fderiv ℝ (fun w => fderiv ℝ f w (multiNoise m,0)) (Z t b) (multiNoise m,0)+ + fderiv ℝ f (Z t b) (A (Z t b))≤0 + rw [hn.fderiv_eq,hnear.fderiv_eq] + exact discountedProduct_nonpos s ha hε hsize cap σ off (Z t b) (A (Z t b)) + (fun i hi => hη.trans_le (hx.2 i hi).1) (fun i hi => (hx.2 i hi).2) hσ (hA b t hts htt) + have h := compact_test_optional_inequality W hW Z hZc hZm A hAc K hK hAb + (multiNoise m,0) he hZeq f (regimeCutoff_smooth s a η hη N cap σ off) + (regimeCutoff_compact s a η N cap σ off) S T B hS hT hST hTB hg U hU + have hfS (b : Driver) : f (Z (S b) b)=discountedProduct s a cap σ off (Z (S b) b) := + (regimeCutoff_eq_near s a η hη N cap σ off _ (hsafe b _ le_rfl (hST b)).1 + (fun i hi => ((hsafe b _ le_rfl (hST b)).2 i hi).1)).eq_of_nhds + have hfT (b : Driver) : f (Z (T b) b)=discountedProduct s a cap σ off (Z (T b) b) := + (regimeCutoff_eq_near s a η hη N cap σ off _ (hsafe b _ (hST b) le_rfl).1 + (fun i hi => ((hsafe b _ (hST b) le_rfl).2 i hi).1)).eq_of_nhds + simpa only [hfS,hfT] using h +end ExactSLEGreen + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem compact_test_optional_on_event + (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (hfc : HasCompactSupport f) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b ≤ T b) (hTB : ∀ b, T b ≤ B) + (U : Set Driver) (hU : MeasurableSet[hS.measurableSpace] U) + (hneg : ∀ b∈U, ∀ t, S b ≤ t → t ≤ T b → generator f A e (X t b) ≤ 0) : + ∫ b in U, f (X (T b) b) ∂W ≤ ∫ b in U, f (X (S b) b) ∂W := by + let M : ℝ≥0 → Driver → ℝ := fun t b => f (X t b) - + ∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b) + have hM : Martingale M rawFiltration W := + compact_smooth_brownian_martingale W hW X hXc hXm A hAc K hK hAb e he hXeq f hf hfc + have hgc (b : Driver) : Continuous (fun u : ℝ => generator f A e (X u.toNNReal b)) := + (generator_continuous f hf A hAc e).comp ((hXc b).comp continuous_real_toNNReal) + have hmc (b : Driver) : Continuous (fun t => M t b) := + (hf.continuous.comp (hXc b)).sub + ((intervalIntegral.continuous_primitive (fun s t => (hgc b).intervalIntegrable s t) 0).comp NNReal.continuous_coe) + obtain ⟨C,D,hC,hD,hfb,hgb⟩ := compact_generator_bounds f hf hfc A K hK hAb e + have hmb (t : ℝ≥0) (ht : t ≤ B+1) (b : Driver) : ‖M t b‖ ≤ C+D*(B+1) := by + calc + _ ≤ ‖f (X t b)‖ + ‖∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b)‖ := norm_sub_le _ _ + _ ≤ C+D*(t : ℝ) := add_le_add (hfb _) (by + simpa only [sub_zero,abs_of_nonneg t.coe_nonneg] using + intervalIntegral.norm_integral_le_of_norm_le_const (a := (0 : ℝ)) (b := (t : ℝ)) + (fun u _ => hgb (X u.toNNReal b))) + _ ≤ _ := add_le_add le_rfl (mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hD) + have hFa : StronglyAdapted rawFiltration (fun t b => f (X t b)) := fun t => + (hf.continuous.measurable.comp (hXm t)).stronglyMeasurable + have hFm (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) : + Measurable (fun b => f (X (R b) b)) := + (measurable_stoppedValue (hFa.isStronglyProgressive_of_continuous + (fun b => hf.continuous.comp (hXc b))) hR).mono hR.measurableSpace_le le_rfl + have hFi (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) : + Integrable (fun b => f (X (R b) b)) (W.restrict U) := + Integrable.of_bound (hFm R hR).aestronglyMeasurable C (Filter.Eventually.of_forall fun b => hfb _) + have hMi (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) (hRB : ∀ b, R b≤B) : + Integrable (fun b => M (R b) b) (W.restrict U) := + Integrable.of_bound (ExactSLEOptional.stopped_measurable rawFiltration hM hmc R hR).aestronglyMeasurable + (C+D*(B+1)) (Filter.Eventually.of_forall fun b => hmb _ ((hRB b).trans (le_add_of_nonneg_right zero_le_one)) b) + have hpw (b : Driver) (hb : b∈U) : f (X (T b) b) - f (X (S b) b) ≤ M (T b) b - M (S b) b := by + have hi := intervalIntegral.integral_add_adjacent_intervals (μ := volume) + ((hgc b).intervalIntegrable 0 (S b)) ((hgc b).intervalIntegrable (S b) (T b)) + have hn : (∫ u in (S b : ℝ)..(T b : ℝ), generator f A e (X u.toNNReal b)) ≤ 0 := by + rw [intervalIntegral.integral_of_le (by exact_mod_cast hST b)] + apply setIntegral_nonpos measurableSet_Ioc + intro u hu + apply hneg b hb u.toNNReal + · exact_mod_cast (show (S b : ℝ) ≤ (u.toNNReal : ℝ) by rw [Real.coe_toNNReal _ ((S b).coe_nonneg.trans hu.1.le)]; exact hu.1.le) + · exact (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + dsimp only [M] + linarith + have hcomp := integral_mono_ae ((hFi T hT).sub (hFi S hS)) + ((hMi T hT hTB).sub (hMi S hS (fun b => (hST b).trans (hTB b)))) + ((ae_restrict_mem (hS.measurableSpace_le U hU)).mono fun b hb => hpw b hb) + simp only [Pi.sub_apply] at hcomp + rw [integral_sub (hFi T hT) (hFi S hS), + integral_sub (hMi T hT hTB) (hMi S hS (fun b => (hST b).trans (hTB b)))] at hcomp + have heq := ExactSLEOptional.setIntegral_optional_sampling rawFiltration hM hmc B + (C+D*(B+1)) hmb S T hS hT hST hTB U hU + linarith +end ExactSLEGenerator + +namespace ExactSLEPasting +open MeasureTheory +variable {Ω : Type*} {m m₀ : MeasurableSpace Ω} {μ : Measure[m₀] Ω} [IsFiniteMeasure μ] + + +lemma integral_weighted_le (hm : m ≤ m₀) {f g w : Ω → ℝ} + (hf : Integrable f μ) (hg : Integrable g μ) + (hw : StronglyMeasurable[m] w) (hw0 : ∀ ω, 0≤w ω) + {C : ℝ} (hwb : ∀ ω, ‖w ω‖≤C) + (h : ∀ U, MeasurableSet[m] U → ∫ ω in U, f ω ∂μ ≤ ∫ ω in U, g ω ∂μ) : + ∫ ω, w ω*f ω ∂μ ≤ ∫ ω, w ω*g ω ∂μ := by + have hfm : StronglyMeasurable[m] (μ[f|m]) := stronglyMeasurable_condExp + have hgm : StronglyMeasurable[m] (μ[g|m]) := stronglyMeasurable_condExp + have hf' : Integrable (μ[f|m]) (μ.trim hm) := Integrable.trim hm integrable_condExp hfm + have hg' : Integrable (μ[g|m]) (μ.trim hm) := Integrable.trim hm integrable_condExp hgm + have hle : μ[f|m] ≤ᵐ[μ] μ[g|m] := by + apply ae_of_ae_trim hm + apply ae_le_of_forall_setIntegral_le hf' hg' + intro U hU _ + rw [← setIntegral_trim hm hfm hU,← setIntegral_trim hm hgm hU, + setIntegral_condExp hm hf hU,setIntegral_condExp hm hg hU] + exact h U hU + have hwm : AEStronglyMeasurable w μ := (hw.mono hm).aestronglyMeasurable + have hwf := hf.bdd_mul hwm (Filter.Eventually.of_forall hwb) + have hwg := hg.bdd_mul hwm (Filter.Eventually.of_forall hwb) + have hwf' := (integrable_condExp (f := f) (m := m) (μ := μ)).bdd_mul hwm (Filter.Eventually.of_forall hwb) + have hwg' := (integrable_condExp (f := g) (m := m) (μ := μ)).bdd_mul hwm (Filter.Eventually.of_forall hwb) + have hEqf : ∫ ω, w ω*f ω ∂μ = ∫ ω, w ω*(μ[f|m]) ω ∂μ := by + rw [← integral_condExp hm] + exact integral_congr_ae (condExp_mul_of_stronglyMeasurable_left hw hwf hf) + have hEqg : ∫ ω, w ω*g ω ∂μ = ∫ ω, w ω*(μ[g|m]) ω ∂μ := by + rw [← integral_condExp hm] + exact integral_congr_ae (condExp_mul_of_stronglyMeasurable_left hw hwg hg) + rw [hEqf,hEqg] + exact integral_mono_ae hwf' hwg' (hle.mono fun ω hω => mul_le_mul_of_nonneg_left hω (hw0 ω)) +end ExactSLEPasting +namespace ExactSLEPasting +open MeasureTheory Set +variable {Ω : Type*} {m m₀ : MeasurableSpace Ω} {μ : Measure[m₀] Ω} [IsFiniteMeasure μ] +lemma integral_weighted_le_on_event (hm : m ≤ m₀) {f g w : Ω → ℝ} {E : Set Ω} + (hE : MeasurableSet[m] E) (hf : Integrable f μ) (hg : Integrable g μ) + (hw : StronglyMeasurable[m] w) (hw0 : ∀ ω, 0≤w ω) + {C : ℝ} (hwb : ∀ ω, ‖w ω‖≤C) (hws : ∀ ω∉E, w ω=0) + (h : ∀ U, MeasurableSet[m] U → ∫ ω in E∩U, f ω ∂μ ≤ ∫ ω in E∩U, g ω ∂μ) : + ∫ ω, w ω*f ω ∂μ ≤ ∫ ω, w ω*g ω ∂μ := by + have hE' : MeasurableSet[m₀] E := hm E hE + have hcomp : ∫ ω, w ω*E.indicator f ω ∂μ ≤ ∫ ω, w ω*E.indicator g ω ∂μ := by + apply integral_weighted_le hm (hf.indicator hE') (hg.indicator hE') hw hw0 hwb + intro U hU + simp_rw [integral_indicator hE',Measure.restrict_restrict hE'] + exact h U hU + have he (q : Ω → ℝ) (ω : Ω) : w ω*E.indicator q ω=w ω*q ω := by + by_cases hq : ω∈E + · simp [hq] + · simp [hq,hws ω hq] + simpa only [he] using hcomp +end ExactSLEPasting + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator + + +theorem discounted_regime_weighted_optional {m : ℕ} (s : Finset (Fin m)) {a ε : ℝ} + (ha : 1/4 b.1 t) W) + (Z : ℝ≥0 → Driver → RegimeState m) (hZc : ∀ b, Continuous (fun t => Z t b)) + (hZm : ∀ t, Measurable[rawFiltration t] (Z t)) + (A : RegimeState m → RegimeState m) (hAc : Continuous A) + (K : ℝ) (hK : 0≤K) (hAb : ∀ z, ‖A z‖≤K) + (hZeq : ∀ (u h : ℝ≥0) b, Z (u+h) b = Z u b + increment u h b • (multiNoise m,0) + + ∫ t in (u:ℝ)..((u+h:ℝ≥0):ℝ), A (Z t.toNNReal b)) + (S T : Driver → ℝ≥0) (B N : ℝ≥0) (η : ℝ) (hη : 0<η) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b≤T b) (hTB : ∀ b, T b≤B) + (E : Set Driver) (hE : MeasurableSet[hS.measurableSpace] E) + (w : Driver → ℝ) (hw : StronglyMeasurable[hS.measurableSpace] w) + (hw0 : ∀ b, 0≤w b) (C : ℝ) (hwb : ∀ b, ‖w b‖≤C) + (hws : ∀ b∉E, w b=0) + (hsafe : ∀ b∈E, ∀ t, S b≤t → t≤T b → ‖Z t b‖≤N ∧ + ∀ i∈s, η≤Y ((Z t b).1 i) ∧ physicalDelta a (cap i) (σ i) (off i) ((Z t b).1 i)≤1) + (hA : ∀ b∈E, ∀ t, S b≤t → t≤T b → + (A (Z t b)).2 = regimeDiscount s a ε cap σ off (Z t b).1 ∧ + ∀ i∈s, (A (Z t b)).1 i = physicalDrift a ((Z t b).1 i)) + : ∫ b, w b*discountedProduct s a cap σ off (Z (T b) b) ∂W ≤ + ∫ b, w b*discountedProduct s a cap σ off (Z (S b) b) ∂W := by + let f := regimeCutoff s a η N cap σ off + have he : ‖(multiNoise m, (0 : ℝ))‖≤1 := by + apply max_le _ (by norm_num) + apply (pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ)≤1)).mpr + intro i + simp [multiNoise,noise,Prod.norm_def] + have hg (b : Driver) (hb : b∈E) (t : ℝ≥0) (hts : S b≤t) (htt : t≤T b) : + generator f A (multiNoise m,0) (Z t b)≤0 := by + have hx := hsafe b hb t hts htt + have hnear := regimeCutoff_eq_near s a η hη N cap σ off (Z t b) hx.1 + (fun i hi => (hx.2 i hi).1) + have hn : (fun w => fderiv ℝ f w (multiNoise m,0)) =ᶠ[𝓝 (Z t b)] + (fun w => fderiv ℝ (discountedProduct s a cap σ off) w (multiNoise m,0)) := + hnear.fderiv.mono fun w hw => congrArg (fun D : RegimeState m →L[ℝ] ℝ => D (multiNoise m,0)) hw + change (1/2:ℝ)*fderiv ℝ (fun w => fderiv ℝ f w (multiNoise m,0)) (Z t b) (multiNoise m,0)+ + fderiv ℝ f (Z t b) (A (Z t b))≤0 + rw [hn.fderiv_eq,hnear.fderiv_eq] + exact discountedProduct_nonpos s ha hε hsize cap σ off (Z t b) (A (Z t b)) + (fun i hi => hη.trans_le (hx.2 i hi).1) (fun i hi => (hx.2 i hi).2) hσ (hA b hb t hts htt) + have hfc := regimeCutoff_smooth s a η hη N cap σ off + have hfcompact := regimeCutoff_compact s a η N cap σ off + have hFa : StronglyAdapted rawFiltration (fun t b => f (Z t b)) := fun t => + (hfc.continuous.measurable.comp (hZm t)).stronglyMeasurable + obtain ⟨D,hDb⟩ := hfcompact.exists_bound_of_continuous hfc.continuous + have hFi (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) : + Integrable (fun b => f (Z (R b) b)) W := by + have hm := (measurable_stoppedValue (hFa.isStronglyProgressive_of_continuous + (fun b => hfc.continuous.comp (hZc b))) hR).mono hR.measurableSpace_le le_rfl + exact Integrable.of_bound hm.aestronglyMeasurable D (Filter.Eventually.of_forall fun b => hDb _) + have hcomp : ∫ b, w b*f (Z (T b) b) ∂W ≤ ∫ b, w b*f (Z (S b) b) ∂W := by + apply ExactSLEPasting.integral_weighted_le_on_event hS.measurableSpace_le hE + (hFi T hT) (hFi S hS) hw hw0 hwb hws + intro U hU + apply compact_test_optional_on_event W hW Z hZc hZm A hAc K hK hAb + (multiNoise m,0) he hZeq f hfc hfcompact S T B hS hT hST hTB + (E∩U) (hE.inter hU) + intro b hb t hts htt + exact hg b hb.1 t hts htt + have heq (b : Driver) (t : ℝ≥0) (hts : S b≤t) (htt : t≤T b) : + w b*f (Z t b)=w b*discountedProduct s a cap σ off (Z t b) := by + by_cases hb : b∈E + · change w b*regimeCutoff s a η N cap σ off (Z t b)=_ + rw [(regimeCutoff_eq_near s a η hη N cap σ off _ (hsafe b hb t hts htt).1 + (fun i hi => ((hsafe b hb t hts htt).2 i hi).1)).eq_of_nhds] + · simp [hws b hb] + simpa only [heq _ _ (hST _) le_rfl,heq _ _ le_rfl (hST _)] using hcomp +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLECalculus ExactSLEFiniteTilt Metric +noncomputable def scalarClamp (L x : ℝ) : ℝ := max (-L) (min L x) +lemma scalarClamp_continuous (L : ℝ) : Continuous (scalarClamp L) := + continuous_const.max (continuous_const.min continuous_id) +lemma scalarClamp_bounds (L x : ℝ) (hL : 0≤L) : -L ≤ scalarClamp L x ∧ scalarClamp L x ≤ L := by + exact ⟨le_max_left _ _,max_le (by linarith) (min_le_left _ _)⟩ +lemma scalarClamp_eq (L x : ℝ) (hx : |x|≤L) : scalarClamp L x=x := by + rw [scalarClamp,min_eq_right (abs_le.mp hx).2,max_eq_right (abs_le.mp hx).1] +lemma scalarClamp_idem (L x : ℝ) (hL : 0≤L) : scalarClamp L (scalarClamp L x)=scalarClamp L x := + scalarClamp_eq L _ (abs_le.mpr (scalarClamp_bounds L x hL)) +noncomputable def regimeClamp (η : ℝ) (N : ℝ≥0) (v : State) : State := + (⟨scalarClamp N (X v),max η (min ((N:ℝ)+η+1) (Y v))⟩,scalarClamp N (J v)) +lemma regimeClamp_continuous (η : ℝ) (N : ℝ≥0) : Continuous (regimeClamp η N) := by + have hc : Continuous (fun v : State => + ((scalarClamp N (X v) : ℂ) + (Complex.ofReal (max η (min ((N:ℝ)+η+1) (Y v))))*Complex.I, + scalarClamp N (J v))) := + ((Complex.continuous_ofReal.comp ((scalarClamp_continuous N).comp X.continuous)).add + ((Complex.continuous_ofReal.comp + (continuous_const.max (continuous_const.min Y.continuous))).mul_const Complex.I)).prodMk + ((scalarClamp_continuous N).comp J.continuous) + convert hc using 1 + funext v + apply Prod.ext + · apply Complex.ext <;> simp [regimeClamp] + · rfl +lemma regimeClamp_height (η : ℝ) (N : ℝ≥0) (v : State) : η≤Y (regimeClamp η N v) := + le_max_left _ _ +lemma regimeClamp_idem (η : ℝ) (N : ℝ≥0) (v : State) : + regimeClamp η N (regimeClamp η N v)=regimeClamp η N v := by + have h : η≤(N:ℝ)+η+1 := by linarith [N.coe_nonneg] + apply Prod.ext + · apply Complex.ext + · exact scalarClamp_idem _ _ N.coe_nonneg + · change max η (min ((N:ℝ)+η+1) (max η (min ((N:ℝ)+η+1) (Y v)))) = _ + rw [min_eq_right (max_le h (min_le_left _ _)),max_eq_right (le_max_left _ _)] + rfl + · exact scalarClamp_idem _ _ N.coe_nonneg +lemma regimeClamp_bound (η : ℝ) (N : ℝ≥0) (v : State) : + ‖regimeClamp η N v‖≤2*(N:ℝ)+|η|+1 := by + have hr : |scalarClamp N (X v)|≤N := abs_le.mpr (scalarClamp_bounds N _ N.coe_nonneg) + have hj : |scalarClamp N (J v)|≤N := abs_le.mpr (scalarClamp_bounds N _ N.coe_nonneg) + have hy : |max η (min ((N:ℝ)+η+1) (Y v))|≤(N:ℝ)+|η|+1 := by + apply abs_le.mpr + constructor + · calc + -((N:ℝ)+|η|+1) ≤ -|η| := by linarith [N.coe_nonneg] + _ ≤ η := neg_abs_le η + _ ≤ _ := le_max_left _ _ + · apply max_le + · exact (le_abs_self η).trans (by linarith [N.coe_nonneg]) + · exact (min_le_left _ _).trans (by linarith [le_abs_self η]) + rw [Prod.norm_def] + apply max_le + · exact (Complex.norm_le_abs_re_add_abs_im _).trans (by + change |scalarClamp N (X v)|+|max η (min ((N:ℝ)+η+1) (Y v))|≤_ + linarith) + · change ‖scalarClamp N (J v)‖≤_ + rw [Real.norm_eq_abs] + linarith [abs_nonneg η,N.coe_nonneg] +lemma regimeClamp_eq (η : ℝ) (N : ℝ≥0) (v : State) (hη : 0<η) + (hn : ‖v‖≤N) (hy : η≤Y v) : regimeClamp η N v=v := by + have hx : |X v|≤N := (Complex.abs_re_le_norm v.1).trans ((le_max_left ‖v.1‖ ‖v.2‖).trans hn) + have hj : |J v|≤N := (le_max_right ‖v.1‖ ‖v.2‖).trans hn + have hu : Y v≤(N:ℝ)+η+1 := by + have h : Y v ≤ N := (Complex.im_le_norm v.1).trans ((le_max_left ‖v.1‖ ‖v.2‖).trans hn) + linarith + apply Prod.ext + · apply Complex.ext + · exact scalarClamp_eq _ _ hx + · change max η (min ((N:ℝ)+η+1) (Y v))=Y v + rw [min_eq_right hu,max_eq_right hy] + · exact scalarClamp_eq _ _ hj + +lemma regimeDiscount_continuousAt {m : ℕ} (s : Finset (Fin m)) (a ε : ℝ) + (cap σ off : Fin m → ℝ) (v : Fin m → State) (hy : ∀ i∈s, 0 physicalClock a (cap i) (w i)) v := + (physicalClock_smooth a (cap i) (v i) (hy i hi)).continuousAt.comp_of_eq (continuous_apply i).continuousAt rfl + have hd (i) (hi : i∈s) : ContinuousAt (fun w : Fin m → State => physicalDelta a (cap i) (σ i) (off i) (w i)) v := + (continuousAt_const.add (continuousAt_const.mul (hc i hi))).rexp + have hV (i) (hi : i∈s) : ContinuousAt (fun w : Fin m → State => physicalV (w i)) v := + ((Y.continuous.continuousAt.div ((X.continuous.pow 2).add (Y.continuous.pow 2)).continuousAt (Q_pos (hy i hi)).ne').comp_of_eq + (continuous_apply i).continuousAt rfl) + unfold regimeDiscount + apply ContinuousAt.add + · exact continuousAt_const.mul (tendsto_finsetSum s fun i hi => (hd i hi).mul ((hV i hi).pow 2)) + · apply ContinuousAt.mul continuousAt_const + apply tendsto_finsetSum s + intro i hi + apply tendsto_finsetSum (s.erase i) + intro j hj + exact ((((hd i hi).mul (hd j (Finset.mem_of_mem_erase hj))).rpow_const + (p := -regM a) (Or.inl (mul_pos (Real.exp_pos _) (Real.exp_pos _)).ne')).mul + (hV i hi)).mul (hV j (Finset.mem_of_mem_erase hj)) + +noncomputable def regimeDiscountCut {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (v : Fin m → State) : ℝ := + regimeDiscount s a ε cap σ off (fun i => regimeClamp η N (v i)) +lemma regimeDiscountCut_continuous {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) : Continuous (regimeDiscountCut s a ε η N cap σ off) := by + apply continuous_iff_continuousAt.mpr + intro v + exact (regimeDiscount_continuousAt s a ε cap σ off _ + (fun i _ => hη.trans_le (regimeClamp_height η N (v i)) )).comp_of_eq + ((continuous_pi fun i => (regimeClamp_continuous η N).comp (continuous_apply i)).continuousAt) rfl +lemma regimeDiscountCut_bound {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) : ∃ K : ℝ, 0≤K ∧ ∀ v, ‖regimeDiscountCut s a ε η N cap σ off v‖≤K := by + have hc := regimeDiscountCut_continuous s a ε η hη N cap σ off + obtain ⟨K,hK⟩ := (isCompact_closedBall (0 : Fin m → State) (2*(N:ℝ)+|η|+1)).exists_bound_of_continuousOn hc.continuousOn + refine ⟨max K 0,le_max_right _ _,fun v => ?_⟩ + have hv : (fun i => regimeClamp η N (v i))∈closedBall (0 : Fin m → State) (2*(N:ℝ)+|η|+1) := by + rw [mem_closedBall_zero_iff] + apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr + intro i + exact regimeClamp_bound η N (v i) + have h := hK (fun i => regimeClamp η N (v i)) hv + have he : regimeDiscountCut s a ε η N cap σ off (fun i => regimeClamp η N (v i))= + regimeDiscountCut s a ε η N cap σ off v := by + simp only [regimeDiscountCut,regimeClamp_idem] + exact (he ▸ h).trans (le_max_left _ _) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLECalculus ExactSLEFiniteTilt +noncomputable def vectorState {m : ℕ} (a η : ℝ) (hη : 0<η) (z : Fin m → ℂ) + (t : ℝ≥0) (b : Driver) : Fin m → State := fun i => localState a η hη (z i) t b +lemma vectorState_continuous {m : ℕ} (a η : ℝ) (hη : 0<η) (z : Fin m → ℂ) (b : Driver) : + Continuous (fun t => vectorState a η hη z t b) := + continuous_pi fun i => localState_continuous a η hη (z i) b +lemma vectorState_adapted {m : ℕ} (a η : ℝ) (hη : 0<η) (z : Fin m → ℂ) (t : ℝ≥0) : + Measurable[rawFiltration t] (vectorState a η hη z t) := by + let : MeasurableSpace Driver := rawFiltration t + exact Measurable.of_eval fun index => localState_adapted a η hη (z index) t +noncomputable def regimeDrift {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (v : RegimeState m) : RegimeState m := + (fun i => cutoffDrift a η (v.1 i),regimeDiscountCut s a ε η N cap σ off v.1) +lemma regimeDrift_continuous {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) : Continuous (regimeDrift s a ε η N cap σ off) := + (continuous_pi fun i => (cutoffDrift_lipschitz a η hη).continuous.comp + ((continuous_apply i).comp continuous_fst)).prodMk + ((regimeDiscountCut_continuous s a ε η hη N cap σ off).comp continuous_fst) +lemma regimeDrift_bound {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) : ∃ K : ℝ, 0≤K ∧ ∀ v, ‖regimeDrift s a ε η N cap σ off v‖≤K := by + obtain ⟨K,hK,hKb⟩ := regimeDiscountCut_bound s a ε η hη N cap σ off + refine ⟨max (max (|a|/η) (|a|/η^2)) K,(le_max_right _ _).trans' hK,fun v => ?_⟩ + apply max_le + · apply (pi_norm_le_iff_of_nonneg ((le_max_left _ _).trans' (by positivity))).mpr + intro i + exact (cutoffDrift_bound a η hη _).trans (le_max_left _ _) + · exact (hKb _).trans (le_max_right _ _) +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/OptionalGreen.lean b/lean/OAI/Probability/SLEGauge/OptionalGreen.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3df4a61f06a63784104bbef985bcd57495f5bb4 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/OptionalGreen.lean @@ -0,0 +1,588 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.FutureSupport + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + + + +def stoppedSurvivingGreen (a : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ := + if t = ∞ then 0 else survivingGreen a t.toNNReal b z + + +def stoppedRemainingDensity (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ := + if t = ∞ then 0 else remainingMassDensity a q t.toNNReal b z + +lemma stoppedSurvivingGreen_nonneg (a : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) : + 0 ≤ stoppedSurvivingGreen a t b z := by + unfold stoppedSurvivingGreen + split_ifs + · exact le_rfl + · exact survivingGreen_nonneg _ _ _ _ + +lemma stoppedRemainingDensity_nonneg (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) : + 0 ≤ stoppedRemainingDensity a q t b z := by + unfold stoppedRemainingDensity + split_ifs + · exact le_rfl + · exact remainingMassDensity_nonneg _ _ _ _ _ + +lemma stoppedRemainingDensity_le_surviving (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) (hz : 0 < z.im) : + stoppedRemainingDensity a q t b z ≤ stoppedSurvivingGreen a t b z := by + unfold stoppedRemainingDensity stoppedSurvivingGreen + split_ifs + · exact le_rfl + · exact remainingMassDensity_le_surviving a q t.toNNReal b z hz + +lemma stopped_remaining_to_surviving (a : ℝ) (ha : 1/4 < a) (t : ℝ≥0∞) + (q : ℕ → ℝ) (hq : ∀ n, 0 < q n ∧ q n ≤ 1) (hlim : Tendsto q atTop (𝓝 0)) + (b : ExactSLEGenerator.Driver) (z : ℂ) (hz : 0 < z.im) : + Tendsto (fun n => stoppedRemainingDensity a (q n) t b z) atTop + (𝓝 (stoppedSurvivingGreen a t b z)) := by + unfold stoppedRemainingDensity stoppedSurvivingGreen + by_cases ht : t = ∞ + · simp only [ht,ite_true] + exact tendsto_const_nhds + · simp only [ite_eq_right ht] + exact remaining_to_surviving a ha t.toNNReal q hq hlim b z hz + +lemma stoppedRemainingDensity_eq (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) (hz : 0 < z.im) : + stoppedRemainingDensity a q t b z = Real.exp (-alpha a*Real.log 2) * + stoppedRadialRemaining a b.1 z (z.im*q) t := by + unfold stoppedRemainingDensity stoppedRadialRemaining remainingMassDensity + split_ifs <;> simp_all only [mul_zero] + +lemma stoppedRadialTerminal_integrable (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.1.im) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + Integrable (fun b => if S b < radialTime a b.1 z.1 ρ + then radialWeight a b.1 z.1 ρ else 0) W := by + have hmS : Measurable S := hS.measurable' + have hmT : Measurable (fun b : ExactSLEGenerator.Driver => radialTime a b.1 z.1 ρ) := + (radialTime_stopping a (by linarith) z.1 z.2 ρ hρ hr).measurable' + have hm : MeasurableSet {b : ExactSLEGenerator.Driver | S b < radialTime a b.1 z.1 ρ} := + measurableSet_lt hmS hmT + apply ((radialWeight_mean W hW a ha z.1 z.2 ρ hρ hr).1.indicator hm).congr + filter_upwards [] with b + simp only [indicator_apply,mem_ofPred_eq] + +lemma stoppedRemainingDensity_mean_bound (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (q : ℝ) (hq : 0 < q) (hq1 : q ≤ 1) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + Integrable (fun b => stoppedRemainingDensity a q (S b) b z.1) W ∧ + (∫ b, stoppedRemainingDensity a q (S b) b z.1 ∂W) ≤ initialGreen a z := by + have hρ : 0 < z.1.im*q := mul_pos z.2 hq + have hr : z.1.im*q ≤ z.1.im := mul_le_of_le_one_right z.2.le hq1 + obtain ⟨hi,he⟩ := radial_conditional_weight_all W hW a ha z.1 z.2 + (z.1.im*q) hρ hr S hS univ MeasurableSet.univ + simp only [setIntegral_univ] at he + simp only [stoppedRemainingDensity_eq a q _ _ _ z.2] + refine ⟨hi.const_mul _, ?_⟩ + rw [integral_const_mul, ← he] + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + rw [← (radialWeight_mean W hW a ha z.1 z.2 _ hρ hr).2] + apply integral_mono (stoppedRadialTerminal_integrable a ha W hW z _ hρ hr S hS) + (radialWeight_mean W hW a ha z.1 z.2 _ hρ hr).1 + intro b + dsimp only + split_ifs + · exact le_rfl + · exact (radialWeight_bound a ha z.1 z.2 _ hρ hr b).1 + + + +theorem survivingGreen_optional_bound (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (S : ExactSLEGenerator.Driver → ℝ≥0∞) + (hS : IsStoppingTime rawFiltration S) : + Integrable (fun b => stoppedSurvivingGreen a (S b) b z.1) W ∧ + (∫ b, stoppedSurvivingGreen a (S b) b z.1 ∂W) ≤ initialGreen a z := by + let q : ℕ → ℝ := fun n => 1 / ((n : ℝ) + 1) + have hq (n : ℕ) : 0 < q n ∧ q n ≤ 1 := by + constructor + · exact div_pos zero_lt_one (by positivity) + · apply div_le_one_of_le₀ (by linarith [Nat.cast_nonneg (α := ℝ) n]) (by positivity) + have hlim : Tendsto q atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + let F : ℕ → ExactSLEGenerator.Driver → ℝ := fun n b => + stoppedRemainingDensity a (q n) (S b) b z.1 + let G : ExactSLEGenerator.Driver → ℝ := fun b => stoppedSurvivingGreen a (S b) b z.1 + have hFi (n : ℕ) := (stoppedRemainingDensity_mean_bound a ha W hW z (q n) + (hq n).1 (hq n).2 S hS).1 + have hFm (n : ℕ) : AEStronglyMeasurable (F n) W := (hFi n).aestronglyMeasurable + have hconv : ∀ᵐ b ∂W, Tendsto (fun n => F n b) atTop (𝓝 (G b)) := + Eventually.of_forall (fun b => stopped_remaining_to_surviving a ha (S b) q hq hlim b z.1 z.2) + have hbound (n : ℕ) : eLpNorm (F n) 1 W ≤ ENNReal.ofReal (initialGreen a z) := by + rw [eLpNorm_one_eq_lintegral_enorm (hFm n), ← ofReal_integral_norm_eq_lintegral_enorm (hFi n)] + have he : (fun b => ‖F n b‖) = F n := by + funext b + exact Real.norm_of_nonneg (stoppedRemainingDensity_nonneg a (q n) (S b) b z.1) + rw [he] + exact ENNReal.ofReal_le_ofReal + (stoppedRemainingDensity_mean_bound a ha W hW z (q n) (hq n).1 (hq n).2 S hS).2 + have hGm := aestronglyMeasurable_of_tendsto_ae atTop hFm hconv + have hGb := Lp.eLpNorm_le_of_ae_tendsto (Eventually.of_forall hbound) hFm hGm hconv + have hGi : Integrable G W := + memLp_one_iff_integrable.mp (hGb.trans_lt ENNReal.ofReal_lt_top) + refine ⟨hGi, ?_⟩ + rw [eLpNorm_one_eq_lintegral_enorm hGm, ← ofReal_integral_norm_eq_lintegral_enorm hGi] at hGb + have he : (fun b => ‖G b‖) = G := by + funext b + exact Real.norm_of_nonneg (stoppedSurvivingGreen_nonneg a (S b) b z.1) + rw [he] at hGb + exact (ENNReal.ofReal_le_ofReal_iff (initialGreen_pos a z).le).mp hGb + +lemma stopped_remaining_integral_tendsto (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (S : ExactSLEGenerator.Driver → ℝ≥0∞) + (hS : IsStoppingTime rawFiltration S) + (q : ℕ → ℝ) (hq : ∀ n, 0 < q n ∧ q n ≤ 1) (hlim : Tendsto q atTop (𝓝 0)) + (U : Set ExactSLEGenerator.Driver) : + Tendsto (fun n => ∫ b in U, stoppedRemainingDensity a (q n) (S b) b z.1 ∂W) + atTop (𝓝 (∫ b in U, stoppedSurvivingGreen a (S b) b z.1 ∂W)) := by + apply tendsto_integral_of_dominated_convergence + (fun b => stoppedSurvivingGreen a (S b) b z.1) + · intro n + exact (stoppedRemainingDensity_mean_bound a ha W hW z (q n) + (hq n).1 (hq n).2 S hS).1.aestronglyMeasurable.restrict + · exact (survivingGreen_optional_bound a ha W hW z S hS).1.integrableOn + · intro n + filter_upwards [] with b + rw [Real.norm_of_nonneg (stoppedRemainingDensity_nonneg a (q n) (S b) b z.1)] + exact stoppedRemainingDensity_le_surviving a (q n) (S b) b z.1 z.2 + · exact Eventually.of_forall (fun b => + stopped_remaining_to_surviving a ha (S b) q hq hlim b z.1 z.2) + + + +theorem survivingGreen_optional_comparison (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (S T : ExactSLEGenerator.Driver → ℝ≥0∞) + (hS : IsStoppingTime rawFiltration S) (hT : IsStoppingTime rawFiltration T) + (hst : S ≤ T) (U : Set ExactSLEGenerator.Driver) + (hU : MeasurableSet[hS.measurableSpace] U) : + (∫ b in U, stoppedSurvivingGreen a (T b) b z.1 ∂W) ≤ + ∫ b in U, stoppedSurvivingGreen a (S b) b z.1 ∂W := by + have hUT : MeasurableSet[hT.measurableSpace] U := (hS.measurableSpace_mono hT hst) _ hU + have hc (q : ℝ) (hq : 0 < q) (hq1 : q ≤ 1) : + (∫ b in U, stoppedRemainingDensity a q (T b) b z.1 ∂W) ≤ + ∫ b in U, stoppedRemainingDensity a q (S b) b z.1 ∂W := by + have hρ : 0 < z.1.im*q := mul_pos z.2 hq + have hr : z.1.im*q ≤ z.1.im := mul_le_of_le_one_right z.2.le hq1 + have heS := (radial_conditional_weight_all W hW a ha z.1 z.2 + (z.1.im*q) hρ hr S hS U hU).2 + have heT := (radial_conditional_weight_all W hW a ha z.1 z.2 + (z.1.im*q) hρ hr T hT U hUT).2 + simp only [stoppedRemainingDensity_eq a q _ _ _ z.2,integral_const_mul] + rw [← heS, ← heT] + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + apply integral_mono + (stoppedRadialTerminal_integrable a ha W hW z _ hρ hr T hT).integrableOn + (stoppedRadialTerminal_integrable a ha W hW z _ hρ hr S hS).integrableOn + intro b + dsimp only + split_ifs with ht hs hs + · exact le_rfl + · exact False.elim (hs ((hst b).trans_lt ht)) + · exact (radialWeight_bound a ha z.1 z.2 _ hρ hr b).1 + · exact le_rfl + let q : ℕ → ℝ := fun n => 1 / ((n : ℝ) + 1) + have hq (n : ℕ) : 0 < q n ∧ q n ≤ 1 := by + constructor + · exact div_pos zero_lt_one (by positivity) + · apply div_le_one_of_le₀ (by linarith [Nat.cast_nonneg (α := ℝ) n]) (by positivity) + have hlim : Tendsto q atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + exact le_of_tendsto_of_tendsto' + (stopped_remaining_integral_tendsto a ha W hW z T hT q hq hlim U) + (stopped_remaining_integral_tendsto a ha W hW z S hS q hq hlim U) + (fun n => hc (q n) (hq n).1 (hq n).2) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma radialRemaining_time_joint_measurable (a : ℝ) (ha : 1/4 < a) (q : ℝ) + (hq : 0 < q) (hq1 : q ≤ 1) : + Measurable (fun p : ℝ≥0 × (ExactSLEGenerator.Driver × UpperPlane) => + radialRemaining a p.2.1.1 p.2.2.1 (p.2.2.1.im*q) p.1) := by + have ha0 : 0 p.2.2.1 + let b : Ω → ExactSLEGenerator.Driver := fun p => p.2.1 + let t : Ω → ℝ≥0 := Prod.fst + have hz (ω : Ω) : 0<(z ω).im := ω.2.2.2 + have hzM : Measurable z := measurable_subtype_coe.comp (measurable_snd.comp measurable_snd) + have hbM : Measurable b := measurable_fst.comp measurable_snd + have htM : Measurable t := measurable_fst + let ρ : Ω → ℝ := fun ω => (z ω).im*q + have hρ (ω : Ω) : 0<ρ ω := mul_pos (hz ω) hq + have hr (ω : Ω) : ρ ω≤(z ω).im := mul_le_of_le_one_right (hz ω).le hq1 + let δ : ℕ → Ω → ℝ := fun n ω => angleThreshold (z ω) n + let L (n : ℕ) (ω : Ω) := explicitRadialLocalization a ha0 (z ω) (hz ω) (ρ ω) (δ n ω) + (hρ ω) (hr ω) (angleThreshold_pos (z ω) (hz ω) n) (angleThreshold_initial (z ω) (hz ω) n) + have hρM : Measurable ρ := hzM.im.mul_const q + have hδM (n : ℕ) : Measurable (δ n) := by + dsimp [δ,angleThreshold] + exact (hzM.im.div hzM.norm).div_const _ + have hεM (n : ℕ) : Measurable (fun ω => (L n ω).ε) := by + change Measurable (fun ω => heightFloor (z ω).im (ρ ω) (δ n ω)/2) + unfold heightFloor + fun_prop + have hNM (n : ℕ) : Measurable (fun ω => (L n ω).N) := by + change Measurable (fun ω => (⟨(z ω).im/δ n ω+logCeiling (z ω).im (ρ ω) (δ n ω)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + unfold logCeiling heightFloor + fun_prop + have hBM (n : ℕ) : Measurable (fun ω => (L n ω).B) := by + change Measurable (fun ω => (⟨(z ω).im^2/(2*a*(δ n ω)^2)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + fun_prop + let T (n : ℕ) (ω : Ω) := regionStop a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (b ω) + have hTM (n : ℕ) : Measurable (T n) := + regionStop_parameter_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b _ ρ (δ n) _ (hεM n) hzM hbM + (measurable_subtype_coe.comp (hNM n)) hρM (hδM n) (hBM n) + have hPM : Measurable (physicalGreen a) := by + have hx := X.continuous.measurable + have hy := Y.continuous.measurable + have hj := J.continuous.measurable + unfold physicalGreen logGreen Q + fun_prop + let F (n : ℕ) (ω : Ω) := if t ω < T n ω then physicalGreen a (localState a (L n ω).ε (L n ω).hε (z ω) (t ω) (b ω)) else 0 + have hFM (n : ℕ) : Measurable (F n) := (hPM.comp + ((localState_parameter_joint_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b (hεM n) hzM hbM).comp + (htM.prodMk measurable_id))).ite (measurableSet_lt htM (hTM n)) measurable_const + apply measurable_of_tendsto_metrizable hFM + apply tendsto_pi_nhds.mpr + intro ω + exact localizationRemaining_tendsto a ha0 (z ω) (hz ω) (ρ ω) (hρ ω) (hr ω) + (fun n => L n ω) (b ω) (t ω) + +end ExactSLEGreen + +namespace ExactSLEGenerator + + + +lemma pastDriver_stopping_measurable + (S : Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + Measurable[hS.measurableSpace] (fun b => pastDriver (S b).toNNReal b) := by + classical + have : PolishSpace Driver := (isClosed_eq (continuous_eval_const 0) continuous_const).polishSpace + obtain ⟨u,hu⟩ := TopologicalSpace.exists_dense_seq (α := ℝ≥0) + let e : Driver → (ℕ → ℝ) := fun b n => b.1 (u n) + have hec : Continuous e := continuous_pi fun n => + (continuous_eval_const (u n)).comp continuous_subtype_val + have hei : Function.Injective e := by + intro b c h + apply Subtype.ext + apply DFunLike.coe_injective + exact hu.equalizer b.1.continuous c.1.continuous h + apply hec.measurableEmbedding hei |>.measurable_comp_iff.mp + have hA : StronglyAdapted rawFiltration (fun t (b : Driver) => b.1 t) := + Filtration.stronglyAdapted_natural driver_eval_measurable + have hP := hA.isStronglyProgressive_of_continuous (fun b => b.1.continuous) + have hval (n : ℕ) : Measurable[hS.measurableSpace] + (fun b => b.1 (ExactSLEGreen.capTime S (u n) b)) := by + have h := (measurable_stoppedValue hP (ExactSLEGreen.capTime_stopping S hS (u n))).mono + (ExactSLEGreen.stopped_cap_measurable S hS (u n)) le_rfl + exact h + have htop : MeasurableSet[hS.measurableSpace] {b | S b = ∞} := + hS.measurable (measurableSet_singleton ∞) + let : MeasurableSpace Driver := hS.measurableSpace + apply measurable_pi_iff.mpr + intro n + have h : Measurable (fun b => if S b = ∞ then (0 : ℝ) + else b.1 (ExactSLEGreen.capTime S (u n) b)) := + Measurable.ite htop measurable_const (hval n) + convert h using 1 + funext b + change b.1 (min (u n) (S b).toNNReal) = _ + by_cases hb : S b = ∞ + · simp only [hb,ENNReal.toNNReal_top,min_zero,ite_true,b.2] + · rw [ite_eq_right hb] + congr 1 + unfold ExactSLEGreen.capTime + conv_rhs => rw [← ENNReal.coe_toNNReal hb] + simp only [← ENNReal.coe_min, ENNReal.toNNReal_coe, min_comm] + +end ExactSLEGenerator + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma remainingMassDensity_time_joint_measurable (a : ℝ) (ha : 1/4 < a) + (q : ℝ) (hq : 0 < q) (hq1 : q ≤ 1) : + Measurable (fun p : ℝ≥0 × (ExactSLEGenerator.Driver × UpperPlane) => + remainingMassDensity a q p.1 p.2.1 p.2.2.1) := by + have h := (radialRemaining_time_joint_measurable a ha q hq hq1).const_mul + (Real.exp (-alpha a*Real.log 2)) + convert h using 1 + funext p + exact ite_eq_left p.2.2.2 + +lemma survivingGreen_time_joint_measurable (a : ℝ) (ha : 1/4 < a) : + Measurable (fun p : ℝ≥0 × (ExactSLEGenerator.Driver × UpperPlane) => + survivingGreen a p.1 p.2.1 p.2.2.1) := by + let q : ℕ → ℝ := fun n => 1 / ((n : ℝ)+1) + have hq (n : ℕ) : 0 remainingMassDensity_time_joint_measurable a ha (q n) (hq n).1 (hq n).2) + apply tendsto_pi_nhds.mpr + intro p + exact remaining_to_surviving a ha p.1 q hq + tendsto_one_div_add_atTop_nhds_zero_nat p.2.1 p.2.2.1 p.2.2.2 + +lemma survivingGreen_driver_congr (a : ℝ) (b c : ExactSLEGenerator.Driver) + (t : ℝ≥0) (h : ∀ s≤t, b.1 s=c.1 s) (z : ℂ) : + survivingGreen a t b z = survivingGreen a t c z := by + simp only [survivingGreen,alive_driver_congr h,actualState_driver_congr h] + + + +theorem stoppedSurvivingGreen_raw_joint (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + letI : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + stoppedSurvivingGreen a (S p.1) p.1 p.2.1) := by + have hp : @Measurable (ExactSLEGenerator.Driver × UpperPlane) + (ℝ≥0 × (ExactSLEGenerator.Driver × UpperPlane)) + (hS.measurableSpace.prod inferInstance) inferInstance + (fun p => ((S p.1).toNNReal,(pastDriver (S p.1).toNNReal p.1,p.2))) := by + exact ((ENNReal.measurable_toNNReal.comp hS.measurable).comp + (@measurable_fst _ _ hS.measurableSpace inferInstance)).prodMk + (((pastDriver_stopping_measurable S hS).comp + (@measurable_fst _ _ hS.measurableSpace inferInstance)).prodMk + (@measurable_snd _ _ hS.measurableSpace inferInstance)) + have hM := (survivingGreen_time_joint_measurable a ha).comp hp + have htop : MeasurableSet[hS.measurableSpace] {b | S b=∞} := + hS.measurable (measurableSet_singleton ∞) + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + have hm : Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + if S p.1=∞ then 0 else + survivingGreen a (S p.1).toNNReal (pastDriver (S p.1).toNNReal p.1) p.2.1) := + Measurable.ite (measurable_fst htop) measurable_const hM + convert hm using 1 + funext p + unfold stoppedSurvivingGreen + congr 1 + exact survivingGreen_driver_congr a p.1 _ _ + (fun s hs => (pastDriver_eq (S p.1).toNNReal p.1 s hs).symm) p.2.1 + +lemma stoppedSurvivingGreen_joint_measurable (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + stoppedSurvivingGreen a (S p.1) p.1 p.2.1) := + (stoppedSurvivingGreen_raw_joint a ha S hS).mono + (SLEExactGauge.MassVersions.prod_sigma_le hS.measurableSpace_le _) le_rfl + + + +theorem stoppedRemainingDensity_raw_joint (a : ℝ) (ha : 1/4 < a) + (q : ℝ) (hq : 0 + stoppedRemainingDensity a q (S p.1) p.1 p.2.1) := by + have hp : @Measurable (ExactSLEGenerator.Driver × UpperPlane) + (ℝ≥0 × (ExactSLEGenerator.Driver × UpperPlane)) + (hS.measurableSpace.prod inferInstance) inferInstance + (fun p => ((S p.1).toNNReal,(pastDriver (S p.1).toNNReal p.1,p.2))) := by + exact ((ENNReal.measurable_toNNReal.comp hS.measurable).comp + (@measurable_fst _ _ hS.measurableSpace inferInstance)).prodMk + (((pastDriver_stopping_measurable S hS).comp + (@measurable_fst _ _ hS.measurableSpace inferInstance)).prodMk + (@measurable_snd _ _ hS.measurableSpace inferInstance)) + have hM := (remainingMassDensity_time_joint_measurable a ha q hq hq1).comp hp + have htop : MeasurableSet[hS.measurableSpace] {b | S b=∞} := + hS.measurable (measurableSet_singleton ∞) + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + have hm : Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + if S p.1=∞ then 0 else + remainingMassDensity a q (S p.1).toNNReal (pastDriver (S p.1).toNNReal p.1) p.2.1) := + Measurable.ite (measurable_fst htop) measurable_const hM + convert hm using 1 + funext p + unfold stoppedRemainingDensity + congr 1 + simp only [remainingMassDensity, ite_eq_left p.2.2] + congr 1 + exact radialRemaining_driver_congr a (by linarith) p.2.1 p.2.2 _ + (mul_pos p.2.2 hq) (mul_le_of_le_one_right p.2.2.le hq1) p.1 _ _ + (fun s hs => (pastDriver_eq (S p.1).toNNReal p.1 s hs).symm) + +lemma stoppedRemainingDensity_joint_measurable (a : ℝ) (ha : 1/4 < a) + (q : ℝ) (hq : 0 + stoppedRemainingDensity a q (S p.1) p.1 p.2.1) := + (stoppedRemainingDensity_raw_joint a ha q hq hq1 S hS).mono + (SLEExactGauge.MassVersions.prod_sigma_le hS.measurableSpace_le _) le_rfl + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFlow + +lemma localState_fst_eq_solution {a ε : ℝ} (hε : 0<ε) + (b : ExactSLEGenerator.Driver) {z : ℂ} {T : ℝ≥0} {f : ℝ→ℂ} + (hf : odeUntil a b.1 z T f) + (hlower : ∀u∈Icc (0:ℝ) T, ε≤(f u).im) : + ∀u∈Icc (0:ℝ) T, + (localState a ε hε z u.toNNReal b).1+(b.1 u.toNNReal:ℂ)=f u := by + let g : ℝ→ℂ := fun u => (localState a ε hε z u.toNNReal b).1+(b.1 u.toNNReal:ℂ) + let v : ℝ→ℂ := fun u => -(b.1 u.toNNReal:ℂ) + have hgc : Continuous g := + ((localState_continuous a ε hε z b).fst.comp continuous_real_toNNReal).add + (Complex.continuous_ofReal.comp (b.1.continuous.comp continuous_real_toNNReal)) + have hgd (u : ℝ) (hu : u∈Icc (0:ℝ) T) : + HasDerivWithinAt g (cutoffVector a ε (g u+v u)) (Icc (0:ℝ) T) u := by + have hd := (ContinuousLinearMap.fst ℝ ℂ ℝ).hasFDerivAt.comp_hasDerivWithinAt u + (localState_noiseFree_deriv a ε hε z b T u hu) + simpa only [g,v,ContinuousLinearMap.coe_fst',Prod.fst_sub,Prod.fst_smul, + noise,Prod.smul_mk,Prod.fst,Complex.real_smul,mul_neg,mul_one,sub_neg_eq_add,add_neg_cancel_right, + cutoffDrift,Function.comp_def] using hd + have hfd (u : ℝ) (hu : u∈Icc (0:ℝ) T) : + HasDerivWithinAt f (cutoffVector a ε (f u+v u)) (Icc (0:ℝ) T) u := by + have hy : ε≤(f u-(b.1 u.toNNReal:ℂ)).im := by + simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using hlower u hu + simpa only [v,←sub_eq_add_neg,cutoffVector,heightClamp_eq hy] using (hf.2 u hu).2 + exact additive_flow_unique (cutoffVector_lipschitz a ε hε) hgc.continuousOn + (odeUntil_continuousOn hf) hgd hfd (by simp [localState_zero,hf.1,b.2]) + +lemma localState_eq_actual_of_height {a ε : ℝ} (hε : 0<ε) + (b : ExactSLEGenerator.Driver) {z : ℂ} {T : ℝ≥0} {f : ℝ→ℂ} + (hf : odeUntil a b.1 z T f) + (hlower : ∀u∈Icc (0:ℝ) T, ε≤(f u).im) : + ∀t≤T, localState a ε hε z t b=actualState a b.1 t z := by + have he := localState_fst_eq_solution hε b hf hlower + have hy (t : ℝ≥0) (ht : t≤T) : ε≤(localState a ε hε z t b).1.im := by + have hh := congrArg Complex.im (he t ⟨t.coe_nonneg,ht⟩) + simp only [Real.toNNReal_coe,Complex.add_im,Complex.ofReal_im,add_zero] at hh + rw [hh] + exact hlower t ⟨t.coe_nonneg,ht⟩ + intro t ht + have h := state_eq_loewner_on_safe a ε hε b.1 b.1.continuous b.2 z + (fun u => localState a ε hε z u b) (localState_continuous a ε hε z b) + (fun u => localState_eq_zero a ε hε z u b) t (fun u hu => hy u (hu.trans ht)) + exact Prod.ext (h.2.1 t le_rfl).symm h.2.2.symm + +lemma localState_eventually_eq_actual (a : ℝ) (b : ExactSLEGenerator.Driver) + {z : ℂ} {t : ℝ≥0} (hz : alive a b.1 t z) : + ∀ᶠ n : ℕ in atTop, + localState a (1/((n:ℝ)+1)) (by positivity) z t b=actualState a b.1 t z := by + obtain ⟨f,hf⟩ := hz + obtain ⟨η,hη,hηf⟩ := odeUntil_height_lower hf + filter_upwards [tendsto_one_div_add_atTop_nhds_zero_nat.eventually (gt_mem_nhds hη)] with n hn + exact localState_eq_actual_of_height (by positivity) b hf + (fun u hu => hn.le.trans (hηf u hu)) t le_rfl + +lemma survivingGreen_pos_iff (a : ℝ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) (z : ℂ) : + 0 + killedState a p.1 p.2.1 p.2.2.1) := by + classical + apply measurable_of_tendsto_metrizable (f:=fun (n : ℕ) p => + if alive a p.2.1.1 p.1 p.2.2.1 then + localState a (1/((n:ℝ)+1)) (by positivity) p.2.2.1 p.1 p.2.1 else 0) + · intro n + exact (localState_parameter_joint_measurable a (fun _ => 1/((n:ℝ)+1)) + (fun _ => by positivity) (fun p : ExactSLEGenerator.Driver×UpperPlane => p.2.1) + Prod.fst measurable_const (measurable_subtype_coe.comp measurable_snd) + measurable_fst).ite (measurableSet_alive_joint a ha) measurable_const + · apply tendsto_pi_nhds.mpr + intro p + by_cases hp : alive a p.2.1.1 p.1 p.2.2.1 + · simp only [ite_eq_left hp,killedState] + exact tendsto_const_nhds.congr' ((localState_eventually_eq_actual a p.2.1 hp).mono (fun _ h => h.symm)) + · simp only [ite_eq_right hp,killedState] + exact tendsto_const_nhds + +lemma loewnerMap_time_joint_measurable (a : ℝ) (ha : 1/4 + loewnerMap a p.2.1.1 p.1 p.2.2.1) := by + classical + have he (p : ℝ≥0×(ExactSLEGenerator.Driver×UpperPlane)) : + loewnerMap a p.2.1.1 p.1 p.2.2.1 = + if alive a p.2.1.1 p.1 p.2.2.1 then + (killedState a p.1 p.2.1 p.2.2.1).1+(p.2.1.1 p.1:ℂ) else 0 := by + by_cases h : alive a p.2.1.1 p.1 p.2.2.1 + · simp only [ite_eq_left h,killedState,actualState,sub_add_cancel] + · simp only [ite_eq_right h,loewnerMap,dite_eq_right h] + simp_rw [he] + exact ((killedState_time_joint_measurable a ha).fst.add + ((Complex.continuous_ofReal.comp (continuous_subtype_val.comp (continuous_fst.comp + continuous_snd) |>.eval continuous_fst)).measurable)).ite + (measurableSet_alive_joint a ha) measurable_const + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/OptionalPastPalm.lean b/lean/OAI/Probability/SLEGauge/OptionalPastPalm.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6840cebca6d920a33ead372113114d17ba51728 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/OptionalPastPalm.lean @@ -0,0 +1,449 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.SubdiskMoments + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.PastMass +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen +open TraceMassContinuity MassVersions TraceMassIntegration + +lemma optional_green_set_balance (a : ℝ) (S : GDriver→ℝ≥0∞) + (hS : IsStoppingTime rawFiltration S) (W : Measure GDriver) + (μ : ℝ≥0∞→GDriver→Measure UpperPlane) + (hH : ∀H : GDriver × UpperPlane→ℝ≥0∞, + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂W)= + (∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂W)+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea∂W) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) : + (∫⁻b, μ ∞ b Q∂W) = (∫⁻b, μ (S b) b Q∂W)+ + ∫⁻b,∫⁻z in Q, ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea∂W := by + let H : GDriver × UpperPlane→ℝ≥0∞ := fun p=> Q.indicator (fun _=>1) p.2 + have hm : Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H := + (measurable_const.indicator hQ).comp measurable_snd + have he (ν : Measure UpperPlane) (b : GDriver) : (∫⁻z,H (b,z)∂ν)=ν Q := by + simp only [H,lintegral_indicator hQ,lintegral_one,Measure.restrict_apply_univ] + have hg (b : GDriver) : + (∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea)= + ∫⁻z in Q,ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea := by + rw [show (fun z => H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1))= + Q.indicator (fun z=>ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)) from by + funext z; by_cases hz : z∈Q <;> simp [H,hz], lintegral_indicator hQ] + simpa only [he,hg] using hH H hm + +lemma expected_green_past_kernel (a : ℝ) (ha : 1/4μ v b)) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : ∀b, μ ∞ b Q≠∞) + (S : GDriver→ℝ≥0∞) : + (fun b=>μ ∞ b (Q∩{z | S bμ ∞ b Q-μ (S b) b Q) := + hp.mono fun b hb=>stopped_strictPast_mass κ b (fun v=>μ v b) hb Q hQ (hfin b) (S b) + +lemma strict_past_mass_aemeasurable (κ : ℝ) (W : Measure GDriver) + (μ : ℝ≥0∞→GDriver→Measure UpperPlane) + (hp : ∀ᵐ b∂W, TraceMassFacts κ (driverHomeomorph.symm b) (fun v=>μ v b)) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : ∀b, μ ∞ b Q≠∞) + (S : GDriver→ℝ≥0∞) (hm : Measurable (μ ∞)) + (hsm : Measurable (fun b=>μ (S b) b)) : + AEMeasurable (fun b=>μ ∞ b (Q∩{z | S b.sub ((Measure.measurable_coe hQ).comp hsm)).aemeasurable.congr + (strict_past_mass_ae κ W μ hp Q hQ hfin S).symm + + + +lemma strict_past_Palm (κ a : ℝ) (ha : 1/4μ v b)) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (hsm : Measurable (fun b=>μ (S b) b)) + (hH : ∀H : GDriver × UpperPlane→ℝ≥0∞, + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂W)= + (∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂W)+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea∂W) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : ∀b, μ ∞ b Q≠∞) + (hf : (∫⁻b,μ ∞ b Q∂W)≠∞) : + (∫⁻b,μ ∞ b (Q∩{z | S bμ (S b) b Q) ≤ᵐ[W] (fun b=>μ ∞ b Q) := + hp.mono fun b hb=>hb.monotone le_top Q + have hsf : (∫⁻b,μ (S b) b Q∂W)≠∞ := ne_top_of_le_ne_top hf (lintegral_mono_ae hle) + have hmS : Measurable (fun b=>μ (S b) b Q) := (Measure.measurable_coe hQ).comp hsm + rw [lintegral_congr_ae (strict_past_mass_ae κ W μ hp Q hQ hfin S), + lintegral_sub hmS hsf hle, + optional_green_set_balance a S hS W μ hH Q hQ, ENNReal.add_sub_cancel_left hsf] + exact expected_green_past_kernel a ha W S hS Q + +end SLEExactGauge.PastMass +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.PastMass +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen +open TraceMassContinuity MassVersions TraceMassIntegration + + + +structure TracePalmData (κ a : ℝ) (W : Measure GDriver) + (μ : ℝ≥0∞→GDriver→Measure UpperPlane) : Prop where + terminal_measurable : Measurable (μ ∞) + finite_compact : ∀v b, IsFiniteMeasureOnCompacts (μ v b) + adapted : Adapted rawFiltration (fun t : ℝ≥0=>μ t) + mean : μ ∞ ∘ₘ W=initialGreenMeasure a + path : ∀ᵐ b∂W,TraceMassFacts κ (driverHomeomorph.symm b) (fun v=>μ v b) + optional_measurable : ∀(S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b=>μ (S b) b) + optional_kernel : ∀(S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (H : GDriver × UpperPlane→ℝ≥0∞), + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂W)= + (∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂W)+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)∂upperArea∂W + + + +def countablePastKernel {ι : Type*} (e : ℕ→ι) (q : ι→ℝ≥0) + (W : Measure GDriver) (a : ℝ) (μ : ℝ≥0∞→GDriver→Measure UpperPlane) + (Q : Set UpperPlane) (H : ℝ≥0∞) (z : UpperPlane) : ℝ≥0∞ := + ⨆n : ℕ, pastGreenKernel W a + (finiteTestTime ((Finset.range n).image (q∘e)) (fun t b=>μ t b Q) H) z + +namespace TracePalmData +variable {κ a : ℝ} {W : Measure GDriver} {μ : ℝ≥0∞→GDriver→Measure UpperPlane} + (D : TracePalmData κ a W μ) +include D + +lemma evaluation_adapted (Q : Set UpperPlane) (hQ : MeasurableSet Q) : + Adapted rawFiltration (fun t : ℝ≥0=>fun b=>μ t b Q) := + fun t=>(Measure.measurable_coe hQ).comp (D.adapted t) + +lemma test_stopping (Q : Set UpperPlane) (hQ : MeasurableSet Q) (F : Finset ℝ≥0) (H : ℝ≥0∞) : + IsStoppingTime rawFiltration (finiteTestTime F (fun t b=>μ t b Q) H) := + finiteTestTime_stopping _ _ (D.evaluation_adapted Q hQ) F H + +lemma compact_expected_finite (Q : Set UpperPlane) (hQ : IsCompact Q) : + (∫⁻b,μ ∞ b Q∂W)≠∞ := by + rw [←Measure.bind_apply hQ.measurableSet D.terminal_measurable.aemeasurable,D.mean] + exact hQ.measure_lt_top.ne + +lemma compact_finite (Q : Set UpperPlane) (hQ : IsCompact Q) (v : ℝ≥0∞) (b : GDriver) : + μ v b Q≠∞ := by + let := D.finite_compact v b + exact hQ.measure_lt_top.ne + +lemma stopped_Palm (ha : 1/4μ t b Q) H) z∂upperArea := by + simpa only [finiteTestTime_lt_iff] using + D.stopped_Palm ha _ (D.test_stopping Q hQ.measurableSet F H) Q hQ + +lemma compact_past_aemeasurable (Q : Set UpperPlane) (hQ : IsCompact Q) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + AEMeasurable (fun b=>μ ∞ b (Q∩{z | S bpastGreenKernel_measurable W a ha _ (D.test_stopping Q hQ _ H) + + + +lemma countable_Palm (ha : 1/4b.1 t) W) + {ι : Type*} (e : ℕ→ι) (q : ι→ℝ≥0) (he : Function.Surjective e) + (Q : Set UpperPlane) (hQ : IsCompact Q) (H : ℝ≥0∞) : + (∫⁻b,μ ∞ b (Q∩{z | ∃i,H<μ (q i) b Q ∧ (q i:ℝ≥0∞)μ t b Q) H + have hS (n : ℕ) : IsStoppingTime rawFiltration (S n) := D.test_stopping Q hQ.measurableSet _ H + let A (n : ℕ) (b : GDriver) := μ ∞ b (Q∩{z | S n bA n b) := by + intro b n k hnk + apply measure_mono + intro z hz + exact ⟨hz.1,(finiteTestTime_sequence_antitone e q (fun t b=>μ t b Q) H b hnk).trans_lt hz.2⟩ + have heq : (fun b=>μ ∞ b (Q∩{z | ∃i,H<μ (q i) b Q ∧ (q i:ℝ≥0∞)⨆n,A n b) := D.path.mono fun b hb=> + all_past_mass_eq_iSup e q he κ b (fun v=>μ v b) hb Q hQ.measurableSet H + have hKmono : Monotone (fun n z=>ENNReal.ofReal (initialGreen a z)*pastGreenKernel W a (S n) z) := by + intro n k hnk z + apply mul_le_mul_right + exact pastGreenKernel_antitone W hW a ha (S k) (S n) (hS k) (hS n) + (fun b=>finiteTestTime_sequence_antitone e q (fun t b=>μ t b Q) H b hnk) z + rw [lintegral_congr_ae heq,lintegral_iSup' hAm (Eventually.of_forall hmono)] + simp only [A,D.stopped_Palm ha _ (hS _) Q hQ] + simp only [countablePastKernel,ENNReal.mul_iSup] + exact (lintegral_iSup (fun n=>(initialGreen_continuous a).measurable.ennreal_ofReal.mul + (pastGreenKernel_measurable W a ha (S n) (hS n))) hKmono).symm + +lemma countable_past_aemeasurable {ι : Type*} (e : ℕ→ι) (q : ι→ℝ≥0) + (he : Function.Surjective e) (Q : Set UpperPlane) (hQ : IsCompact Q) (H : ℝ≥0∞) : + AEMeasurable (fun b=>μ ∞ b (Q∩{z | ∃i,H<μ (q i) b Q ∧ (q i:ℝ≥0∞)μ ∞ b (Q∩{z | ∃i,H<μ (q i) b Q ∧ (q i:ℝ≥0∞)⨆n : ℕ,μ ∞ b (Q∩{z | finiteTestTime ((Finset.range n).image (q∘e)) + (fun t b=>μ t b Q) H b + all_past_mass_eq_iSup e q he κ b (fun v=>μ v b) hb Q hQ.measurableSet H + exact (AEMeasurable.iSup (fun n=>D.compact_past_aemeasurable Q hQ _ + (D.test_stopping Q hQ.measurableSet _ H))).congr heq.symm + +end TracePalmData + + + +theorem actual_Palm_data (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + ∃ (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j), + (∀k j,j∈s k→k≤j) ∧ (∀k,∑j∈s k,c k j=1) ∧ + TracePalmData κ (Target.a κ) (W.map driverHomeomorph) + (recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc) := by + obtain ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,hmean,hstop,hpath⟩ := + actual_canonical_trace_mass κ hκ hκ8 W hW + refine ⟨s,c,hc,hs,hsum,hmeas ∞,fun v b=>(hreg v b).1,hprog.adapted,hmean,?_, + fun S hS=>(hstop S hS).1,fun S hS=>(hstop S hS).2.2.2.2.1⟩ + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + filter_upwards [hpath] with b hb + change TraceMassFacts κ (driverHomeomorph.symm (driverHomeomorph b)) + (fun v=>recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v (driverHomeomorph b)) + simpa only [Homeomorph.symm_apply_apply] using hb.1 + +end SLEExactGauge.PastMass +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions TraceMassIntegration +open LoewnerRestart PastMass + +structure CanonicalMassData (κ a : ℝ) (ha : 1/4μ t) + optional_test_moments : ∀(S : GDriver→ℝ≥0∞) (_hS : IsStoppingTime rawFiltration S) + (f : C_c(UpperPlane,ℝ)) (m : ℕ), MemLp (fun b=>∫z,f z∂μ (S b) b) (m:ℝ≥0∞) W + optional_compact_moments : ∀(S : GDriver→ℝ≥0∞) (_hS : IsStoppingTime rawFiltration S) + (K : Set UpperPlane), IsCompact K→∀m : ℕ,MemLp (fun b=>(μ (S b) b K).toReal) (m:ℝ≥0∞) W + restart : ∀(S : GDriver→ℝ≥0∞) (_hS : IsStoppingTime rawFiltration S), + ∀ᵐ b∂W,S b≠∞→(μ (S b) b).restrict {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}=0 ∧ + ∀v : ℝ≥0∞,(μ (S b+v) b).restrict {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}= + restartPush a (lt_trans (by norm_num) ha) b (S b).toNNReal (μ v (restartAt S b)) + positive_increments : ∀ᵐ b∂W,∀u v : ℝ≥0,ueLpNorm (fun b=>(∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) (S b) b)-(∫z,f z∂μ (S b) b)) + 1 (W.map driverHomeomorph)) atTop (𝓝 0)) ∧ + (∀ᵐ b∂(W.map driverHomeomorph),∀v : ℝ≥0∞,∀f : C_c(UpperPlane,ℝ), + Tendsto (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) atTop (𝓝 (∫z,f z∂μ v b))) := by + obtain ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,hmean,hstop,hpath⟩ := + actual_canonical_trace_mass κ hκ hκ8 W hW + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + have hp : ∀ᵐ b∂(W.map driverHomeomorph), + TraceMassFacts κ (driverHomeomorph.symm b) (fun v=>μ v b) ∧ + (∀v : ℝ≥0∞,∀f : C_c(UpperPlane,ℝ),Tendsto + (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) atTop (𝓝 (∫z,f z∂μ v b))) ∧ + (∀u v : ℝ≥0,uμ v (driverHomeomorph b)) ∧ _ + simp only [show driverMeasurableEquiv b=driverHomeomorph b from rfl, + Homeomorph.symm_apply_apply] + exact hb + refine ⟨s,c,hc,hs,hsum,?_,?_,hp.mono (fun b hb=>hb.2.1)⟩ + · exact { + terminal_measurable := hmeas ∞ + finite_compact := fun v b=>(hreg v b).1 + adapted := hprog.adapted + mean := hmean + path := hp.mono (fun b hb=>hb.1) + optional_measurable := fun S hS=>(hstop S hS).1 + optional_kernel := fun S hS=>(hstop S hS).2.2.2.2.1 + regular := fun v b=>(hreg v b).2 + initial_zero := hzero + progressive := hprog + optional_test_moments := fun S hS=>(hstop S hS).2.1 + optional_compact_moments := fun S hS=>(hstop S hS).2.2.1 + restart := fun S hS=>(hstop S hS).2.2.2.2.2 + positive_increments := hp.mono (fun b hb=>hb.2.2) } + · exact fun S hS=>(hstop S hS).2.2.2.1 + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions +open TraceMassIntegration TraceMassContinuity CompactSequence + + + +theorem actual_subdisk_positive_moments (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + ∃ (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j), + (∀k j,j∈s k→k≤j) ∧ (∀k,∑j∈s k,c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + CanonicalMassData κ (Target.a κ) (a_gt_quarter hκ hκ8) (W.map driverHomeomorph) μ ∧ + (∀v b,IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + Measurable (fun p : ℝ≥0∞×GDriver=>μ p.1 p.2) ∧ + (∀(S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b=>μ (S b) b)) ∧ + (∀ᵐ b∂W,TraceMassFacts κ b (fun v=>μ v (driverHomeomorph b)) ∧ + (∀v : ℝ≥0∞,∀f : C_c(UpperPlane,ℝ),Tendsto + (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v (driverHomeomorph b)) + atTop (𝓝 (∫z,f z∂μ v (driverHomeomorph b)))) ∧ + (∀u v : ℝ≥0,ufun i : Fin (n+1)=>subdiskMass (Target.a κ) μ r i p)) ∧ + (∀ᵐ x∂Q,Monotone x ∧ Tendsto x atTop (𝓝 (diskSequenceMass x)) ∧ diskSequenceMass x<∞) ∧ + (∀ m : ℕ, 1 ≤ m → + 0<(∫⁻x,(diskSequenceMass x)^m∂Q) ∧ + (∫⁻x,(diskSequenceMass x)^m∂Q)<∞ ∧ + (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,subdiskMoment (W.map driverHomeomorph) (Target.a κ) μ r m l ∧ + Tendsto (subdiskMoment (W.map driverHomeomorph) (Target.a κ) μ r m) atTop + (𝓝 (∫⁻x,(diskSequenceMass x)^m∂Q))) := by + obtain ⟨s,c,hc,hs,hsum,D,hL,hvAll⟩ := + actual_canonical_mass_data κ hκ hκ8 W hW + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + let V := W.map driverHomeomorph + have hBW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) V := brownian_map_driver W hW + have : IsProbabilityMeasure V := hBW.isGaussianProcess.isProbabilityMeasure + have hreg : ∀v b,IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular := + fun v b=>⟨D.finite_compact v b,D.regular v b⟩ + have (v : ℝ≥0∞) (b : GDriver) : IsFiniteMeasureOnCompacts (μ v b) := D.finite_compact v b + have hμ : Measurable (fun p : ℝ≥0∞×GDriver=>μ p.1 p.2) := + recoveredMass_joint_measurable (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + have hraw (l : ℕ) (θ : Angle) : + Measurable[(centeredTime_stopping (Target.a κ) (a_gt_quarter hκ hκ8) θ l).measurableSpace] + (fun b=>μ (levelTime (Target.a κ) θ.1 b.1 l) b) := D.optional_measurable _ _ + have hp : ∀ᵐ b∂V,TraceMassFacts κ (driverHomeomorph.symm b) (fun v=>μ v b) := D.path + have hv : ∀ᵐ b∂V,∀f : C_c(UpperPlane,ℝ),Tendsto + (fun k=>∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) ∞ b) atTop (𝓝 (∫z,f z∂μ ∞ b)) := + hvAll.mono (fun b hb=>hb ∞) + have hmono : ∀ᵐ b∂V,Monotone (fun v=>μ v b) := hp.mono (fun b hb=>hb.monotone) + obtain ⟨n₀,hn₀⟩ := exists_subdisk_positive_mean V hBW (Target.a κ) + (a_gt_quarter hκ hκ8) μ hμ (hp.mono (fun b hb=>hb.initial_positive)) + let r := subdiskRadius n₀ + have hr : 0≤r := (subdiskRadius_pos n₀).le + have hr1 : r<1 := subdiskRadius_lt_one n₀ + obtain ⟨Q,hQ,hlaw,hQmono⟩ := exists_subdisk_sequence_law V hBW r (Target.a κ) + (a_gt_quarter hκ hκ8) μ hμ hraw hmono + have he (m : ℕ) : (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,subdiskMoment V (Target.a κ) μ r m l := + subdiskSequence_moment V r (Target.a κ) (a_gt_quarter hκ hκ8) μ hμ Q hlaw hQmono m + have hf (m : ℕ) (hm : 1 ≤ m) : (∫⁻x,(diskSequenceMass x)^m∂Q)<∞ := by + obtain ⟨D,hD,hDb⟩ := common_limit_subdisk_mixed_moment_bound r hr hr1 (Target.a κ) (a_gt_quarter hκ hκ8) m hm + rw [he] + apply lt_of_le_of_lt (iSup_le (fun l=> ?_)) hD + exact hDb V hBW s c hc hsum μ (fun v b=>(hreg v b).1) hμ + (hmono.mono (fun b hb v=>hb le_top)) hv l + have hpos1 : 0<∫⁻x,diskSequenceMass x∂Q := by + have hh := he 1 + simp only [pow_one] at hh + rw [hh] + apply hn₀.trans_le + simpa only [subdiskMoment,pow_one] using + le_iSup (fun l=>subdiskMoment V (Target.a κ) μ r 1 l) 1 + have hpos (m : ℕ) (hm : 1 ≤ m) : 0<∫⁻x,(diskSequenceMass x)^m∂Q := by + have heq : Function.support (fun x=>diskSequenceMass x^m)=Function.support diskSequenceMass := by + ext x; simp only [Function.mem_support, ne_eq, pow_eq_zero_iff (by omega : m≠0)] + rw [lintegral_pos_iff_support (diskSequenceMass_measurable.pow_const m), heq] + exact (lintegral_pos_iff_support diskSequenceMass_measurable).mp hpos1 + have hfin : ∀ᵐ x∂Q,diskSequenceMass x<∞ := ae_lt_top (diskSequenceMass_measurable) + (show (∫⁻x,diskSequenceMass x∂Q)≠∞ by simpa only [pow_one] using (hf 1 le_rfl).ne) + refine ⟨s,c,hc,hs,hsum,D,hreg,hμ,D.optional_measurable,?_,n₀,Q,hQ,hlaw,?_,?_⟩ + · have hboth := hp.and (hvAll.and D.positive_increments) + have ht := driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mp hboth + filter_upwards [ht] with b hb + have he : driverMeasurableEquiv b=driverHomeomorph b := rfl + simp only [he,Homeomorph.symm_apply_apply] at hb + exact ⟨hb.1,hb.2.1,fun u v huv=>(hb.2.2 u v huv).1⟩ + · filter_upwards [hQmono,hfin] with x hx hxf + exact ⟨hx,diskSequenceMass_tendsto hx,hxf⟩ + · intro m hm + refine ⟨hpos m hm,hf m hm,he m,?_⟩ + rw [he] + exact tendsto_atTop_iSup (subdiskMoment_monotone V hBW r (Target.a κ) + (a_gt_quarter hκ hκ8) μ hμ hraw hmono m) + +end SLEExactGauge.CenteredMoments +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/PastHullSupport.lean b/lean/OAI/Probability/SLEGauge/PastHullSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..79ea63975d7c712bdefb1e663fe1fd6a0698f7cf --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/PastHullSupport.lean @@ -0,0 +1,508 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.HeightRadius +import OAI.Probability.SLEGauge.AngularControlMass + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma fullLoewnerRadius_continuousOn (a : ℝ) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + ContinuousOn (fun z => fullLoewnerRadius a b.1 z t) {z | alive a b.1 t z} := by + have hd : DifferentiableOn ℂ (loewnerMap a b.1 t) {z | alive a b.1 t z} := + fun _ hz => (hasDerivAt_loewnerMap b.1.continuous hz).differentiableAt.differentiableWithinAt + have hc := hd.continuousOn + exact (continuousOn_const.mul (Complex.continuous_im.comp_continuousOn hc)).div + ((hd.analyticOnNhd (isOpen_alive b.1.continuous t)).deriv.continuousOn.norm) + (fun z hz => norm_ne_zero_iff.mpr (deriv_loewnerMap_ne_zero b.1.continuous hz)) + +lemma physicalRadius_actual_continuousOn (a : ℝ) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + ContinuousOn (fun z => physicalRadius (actualState a b.1 t z)) {z | alive a b.1 t z} := by + have hc := (fullLoewnerRadius_continuousOn a b t).div_const 2 + apply hc.congr + intro z hz + have he := actual_radius_eq_full b.1.continuous hz + linarith + + + +lemma surviving_compact_radius_margin (a : ℝ) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) + (K : Set UpperPlane) (hK : IsCompact K) + (hKs : ∀ z∈K, alive a b.1 t z.1) : + ∃ ε : ℝ, 0<ε ∧ ∀ z∈K, ε≤physicalRadius (actualState a b.1 t z.1)/z.1.im := by + by_cases hne : K.Nonempty + · have hc : ContinuousOn (fun z : UpperPlane => + physicalRadius (actualState a b.1 t z.1)/z.1.im) K := by + apply ContinuousOn.div + ((physicalRadius_actual_continuousOn a b t).comp continuous_subtype_val.continuousOn hKs) + (Complex.continuous_im.comp continuous_subtype_val).continuousOn + exact fun z _ => z.2.ne' + obtain ⟨z,hz,hmin⟩ := hK.exists_isMinOn hne hc + exact ⟨_,div_pos (physicalRadius_actual_pos a b z.1 t (hKs z hz)) z.2, + fun w hw => hmin hw⟩ + · exact ⟨1,zero_lt_one,fun z hz => False.elim (hne ⟨z,hz⟩)⟩ + +lemma timeMassDensity_zero_of_radius_lt (a : ℝ) (ha : 0 timeMassDensity a (q j) t b z.1) := + (timeMassDensity_measurable a ha (q j) (hq j).1 (hq j).2 t).comp + (measurable_const.prodMk measurable_subtype_coe) + rw [actualUpperMass,integral_withDensity_eq_integral_toReal_smul hm + (Eventually.of_forall (fun z => timeMassDensity_finite a (q j) t b z.1))] + apply integral_eq_zero_of_ae + apply Eventually.of_forall + intro z + by_cases hz : z∈tsupport f + · simp only [hj z hz,ENNReal.toReal_zero,zero_smul,Pi.zero_apply] + · simp only [image_eq_zero_of_notMem_tsupport hz,smul_zero,Pi.zero_apply] + +lemma mass_levels_tendsto_zero (a : ℝ) (ha : 0 Real.exp (-2*a*(j+1))) atTop (𝓝 0) := by + apply Real.tendsto_exp_atBot.comp + apply Tendsto.const_mul_atTop_of_neg (by linarith : -2*a<0) + apply Filter.tendsto_atTop.mpr + intro B + filter_upwards [(tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n:ℝ)) atTop atTop).eventually + (eventually_ge_atTop B)] with n hn + linarith + + + +lemma actual_limit_integral_zero_on_surviving (a : ℝ) (ha : 1/4 ∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) t b) atTop (𝓝 (∫z,f z∂μ))) : + (∫z,f z∂μ)=0 := by + have hq (j : ℕ) : 0 f x)=ᵐ[μ] 0 := (integral_eq_zero_iff_of_nonneg + (fun x => (hf01 x).1) (f.continuous.integrable_of_hasCompactSupport hfc)).mp + (htest g hfU) + rw [measure_eq_zero_iff_ae_notMem] + filter_upwards [hz] with x hx hKx + have he := hfK hKx + change f x=0 at hx + change f x=1 at he + linarith + +end SLEExactGauge.MassVersions +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_limit_past_hull_support (a : ℝ) (ha : 1/4 ∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) t b) + atTop (𝓝 (∫z,f z∂μ))) + (_hfinite : IsFiniteMeasureOnCompacts μ := by infer_instance) : + μ {z : UpperPlane | alive a b.1 t z.1}=0 := by + apply open_null_of_compact_tests μ _ ((isOpen_alive b.1.continuous t).preimage continuous_subtype_val) + exact fun f hf => actual_limit_integral_zero_on_surviving a ha s c hs b t μ f hf (hlim f) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceLevelLocalization +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen + + +def AngularRegular (κ : ℝ) (b : TDriver) : Prop := + ∀ m H : ℕ, ∀ C : ℝ, 0≤C → + TendstoUniformlyOn + (fun y : ℝ => fun p : ℝ×ℝ => LiteralTrace.inverseFlow κ b p.1 + (LiteralTrace.driverValue b p.1+(y:ℂ)*((p.2:ℂ)+Complex.I))) + (fun p => LiteralTrace.trace κ b (p.1/κ)) (𝓝[>] 0) + (Icc (1/((m:ℝ)+1)) H ×ˢ Icc (-C) C) + +lemma angularRegular_ae {κ : ℝ} (hκ : 0<κ) (hκ8 : κ<8) + {W : Measure TDriver} (hW : Target.IsWiener W) : ∀ᵐ b ∂W, AngularRegular κ b := + LiteralTrace.angular_uniform_all_windows hκ hκ8 hW + +lemma inverse_actual_state (κ : ℝ) (b : TDriver) (z : UpperPlane) + (t : ℝ≥0) (ht : alive (Target.a κ) (driverHomeomorph b).1 t z.1) : + let v := actualState (Target.a κ) (driverHomeomorph b).1 t z.1 + LiteralTrace.inverseFlow κ b t + (LiteralTrace.driverValue b t+(Y v:ℂ)*((X v/Y v:ℂ)+Complex.I))=z.1 := by + let v := actualState (Target.a κ) (driverHomeomorph b).1 t z.1 + have hy : 0 b t+r) hxy + · simp [v,X,Y,actualState] + change LiteralTrace.inverseFlow κ b t _=z.1 + rw [he] + exact LiteralTrace.inverseFlow_flow t.coe_nonneg hs + + + +theorem level_near_trace (κ : ℝ) (hκ : 0<κ) (b : TDriver) + (hb : AngularRegular κ b) (T : ℝ≥0) (η M C ε : ℝ) + (hη : 0<η) (_hM : 0 Real.exp (-Target.a κ*(j+1))) atTop (𝓝 0) := by + have he := mass_levels_tendsto_zero (Target.a κ/2) (by positivity) + convert he using 1 + funext j + congr 1 + ring + have hg' : Tendsto (fun j : ℕ => M*Real.exp (-Target.a κ*(j+1))) atTop (𝓝 0) := by + simpa using hg.const_mul M + filter_upwards [(mass_levels_tendsto_zero (Target.a κ) ha).eventually + (gt_mem_nhds (show (0:ℝ)<1/2 by norm_num)), hg'.eventually (gt_mem_nhds hδ)] with j hj hj' + intro z hzη hzM τ hτ v hv + have hτf : τ≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top hτ + have hτT : τ.toNNReal≤T := ENNReal.coe_le_coe.mp (by + simpa only [ENNReal.coe_toNNReal hτf] using hτ) + have hr : 0 ρ.restrict D) + (sub_add_cancel_of_locally_finite μ ν h) + simpa only [Measure.restrict_add,hremD,hμD,zero_add] using he + +end SLEExactGauge.MassVersions + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_raw_mass_hull_accounting (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ W=initialGreenMeasure a) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) ∧ + (∀ i, NullSingletonClass (μ (t i) b)) ∧ + (∀ i (v : ℝ≥0), t i=v → μ (t i) b {z : UpperPlane | alive a b.1 v z.1}=0) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + μ (t i) b=(μ (t j) b).restrict {z : UpperPlane | ¬alive a b.1 v z.1}) := by + obtain ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,hconv⟩ := + actual_raw_atomless_mass_endpoint a ha W hW t + let μ := recoveredMass a ha s c hc + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := (hμ v b).1 + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : (μ v b).Regular := (hμ v b).2 + refine ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,?_⟩ + filter_upwards [hconv] with b hb + rcases hb with ⟨horder,hvague,hfuture,hatom⟩ + have hpast (i : ℕ) (v : ℝ≥0) (hi : t i=v) : μ (t i) b {z : UpperPlane | alive a b.1 v z.1}=0 := by + apply actual_limit_past_hull_support a ha s c hs b v (μ (t i) b) + intro f + have he := hvague i f + simpa only [hi] using he + refine ⟨horder,hvague,hatom,hpast,hfuture,?_⟩ + intro i j v hi hj + have hdead := hfuture i j (hi ▸ ENNReal.coe_ne_top) hj + have hreal : (t i).toNNReal=v := by rw [hi,ENNReal.toNNReal_coe] + rw [hreal] at hdead + have hU : MeasurableSet {z : UpperPlane | alive a b.1 v z.1} := by + exact ((isOpen_alive b.1.continuous v).preimage + (continuous_subtype_val : Continuous (Subtype.val : UpperPlane → ℂ))).measurableSet + apply restriction_of_complementary_support (μ (t i) b) (μ (t j) b) + (horder i j (by rw [hj]; exact le_top)) {z : UpperPlane | ¬alive a b.1 v z.1} + hU.compl _ hdead + simpa only [show {z : UpperPlane | ¬alive a b.1 v z.1} = + ({z : UpperPlane | alive a b.1 v z.1})ᶜ from rfl, compl_compl] using hpast i v hi + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassIntegration +open FlowIdentification ExactSLEGenerator ExactSLEMain ExactSLEGreen + +lemma a_gt_quarter {κ : ℝ} (hκ : 0<κ) (hκ8 : κ<8) : + 1/4 LiteralTrace.inverseFlow κ b (κ*v) + (LiteralTrace.driverValue b (κ*v)+y*Complex.I)) (𝓝[>] 0) + (𝓝 (LiteralTrace.trace κ b v))) {t : ℝ} (ht : 0≤t) : + (Target.trace κ b) '' Icc 0 t ⊆ + {z | ¬alive (Target.a κ) (driverHomeomorph b).1 (κ*t).toNNReal z} := by + rintro z ⟨v,hv,rfl⟩ hz + have hs : LiteralTrace.Surviving κ b (LiteralTrace.trace κ b v) (κ*t) := by + simpa only [surviving_eq,trace_eq_literal, + Real.coe_toNNReal _ (mul_nonneg hκ.le ht)] using + (surviving_iff_alive κ b (Target.trace κ b v) (κ*t).toNNReal).mpr hz + exact LiteralTrace.radial_limit_not_surviving hκ (mul_nonneg hκ.le hv.1) b (hlim v hv.1) + (LiteralTrace.surviving_of_le (mul_nonneg hκ.le hv.1) + (mul_le_mul_of_nonneg_left hv.2 hκ.le) hs) + + + +theorem actual_mass_remaining_avoids_past {κ : ℝ} (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) (t i) b) - ∫z,f z∂μ (t i) b) + 1 (W.map driverHomeomorph)) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ (W.map driverHomeomorph)=initialGreenMeasure (Target.a κ)) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂(W.map driverHomeomorph)) = + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂(W.map driverHomeomorph)) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen (Target.a κ) v b z.1) + ∂upperArea ∂(W.map driverHomeomorph)) ∧ + ∀ᵐ b ∂W, + ContinuousOn (Target.trace κ b) (Ici 0) ∧ + (∀ i j, t i≤t j → μ (t i) (driverHomeomorph b)≤μ (t j) (driverHomeomorph b)) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass (Target.a κ) (Real.exp (-2*(Target.a κ)*(j+1))) + (t i) (driverHomeomorph b)) atTop (𝓝 (∫z,f z∂μ (t i) (driverHomeomorph b)))) ∧ + (∀ i, NullSingletonClass (μ (t i) (driverHomeomorph b))) ∧ + (∀ i (v : ℝ≥0), t i=v → + μ (t i) (driverHomeomorph b) + {z : UpperPlane | alive (Target.a κ) (driverHomeomorph b).1 v z.1}=0) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) (driverHomeomorph b)-μ (t i) (driverHomeomorph b)) + {z : UpperPlane | ¬alive (Target.a κ) (driverHomeomorph b).1 (t i).toNNReal z.1}=0) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + μ (t i) (driverHomeomorph b) = + (μ (t j) (driverHomeomorph b)).restrict + {z : UpperPlane | ¬alive (Target.a κ) (driverHomeomorph b).1 v z.1}) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + (μ (t j) (driverHomeomorph b)-μ (t i) (driverHomeomorph b)) + {z : UpperPlane | z.1∈(Target.trace κ b) '' Icc 0 ((v:ℝ)/κ)}=0) := by + have hBW := brownian_map_driver W hW + have : IsProbabilityMeasure (W.map driverHomeomorph) := hBW.isGaussianProcess.isProbabilityMeasure + obtain ⟨s,c,hc,hs,hcs,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hcond,hconv⟩ := + actual_raw_mass_hull_accounting (Target.a κ) (a_gt_quarter hκ hκ8) + (W.map driverHomeomorph) hBW t + refine ⟨s,c,hc,hs,hcs,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hcond,?_⟩ + filter_upwards [ae_of_ae_map measurable_driverHomeomorph.aemeasurable hconv, + LiteralTrace.trace_regular_all_times hκ hκ8 hW] with b hb htrace + rcases hb with ⟨horder, hvague, hatom, hpast, hfuture, haccount⟩ + refine ⟨?_,horder,hvague,hatom,hpast,hfuture,haccount,?_⟩ + · simpa only [trace_eq_literal] using htrace.2.1 + · intro i j v hi hj + have hint : t i ≠ ∞ := hi ▸ ENNReal.coe_ne_top + have hf := hfuture i j hint hj + have hreal : (t i).toNNReal = v := by rw [hi,ENNReal.toNNReal_coe] + rw [hreal] at hf + have hp := past_trace_subset_dead hκ b htrace.1 (t := (v:ℝ)/κ) (by positivity) + have he : (κ*((v:ℝ)/κ)).toNNReal=v := by + rw [mul_div_cancel₀ _ hκ.ne',Real.toNNReal_coe] + rw [he] at hp + exact measure_mono_null (fun z hz => hp hz) hf + +end SLEExactGauge.TraceMassIntegration +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/PhaseIntegrals.lean b/lean/OAI/Probability/SLEGauge/PhaseIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..12f539168f9db1b77a72eb768286b507c2dd4317 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/PhaseIntegrals.lean @@ -0,0 +1,457 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.PhaseStopping + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +namespace ExactSLEPasting +lemma integral_finite_partition {Ω P : Type*} [MeasurableSpace Ω] [Fintype P] + {μ : Measure Ω} (phase : Ω → P) (f : Ω → ℝ) + (hf : ∀ p, Integrable (fun ω => if phase ω=p then f ω else 0) μ) : + (∫ ω, f ω ∂μ)=∑ p, ∫ ω, (if phase ω=p then f ω else 0) ∂μ := by + rw [←integral_finsetSum _ (fun p _ => hf p)] + congr 1 + funext ω + simp +lemma integral_le_of_finite_partition {Ω P : Type*} [MeasurableSpace Ω] [Fintype P] + {μ : Measure Ω} (phase : Ω → P) (f g : Ω → ℝ) + (hf : ∀ p, Integrable (fun ω => if phase ω=p then f ω else 0) μ) + (hg : ∀ p, Integrable (fun ω => if phase ω=p then g ω else 0) μ) + (hle : ∀ p, (∫ ω, (if phase ω=p then f ω else 0) ∂μ)≤ + ∫ ω, (if phase ω=p then g ω else 0) ∂μ) : (∫ ω, f ω ∂μ)≤∫ ω, g ω ∂μ := by + rw [integral_finite_partition phase f hf,integral_finite_partition phase g hg] + exact Finset.sum_le_sum fun p _ => hle p +end ExactSLEPasting + + +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLECalculus MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +lemma clamped_delta_continuous (a η : ℝ) (hη : 0<η) (N : ℝ≥0) (cap σ off : ℝ) : + Continuous (fun v : State => physicalDelta a cap σ off (regimeClamp η N v)) := by + apply continuous_iff_continuousAt.mpr + intro v + have hy := hη.trans_le (regimeClamp_height η N v) + have hc := (physicalClock_smooth a cap (regimeClamp η N v) hy).continuousAt.comp_of_eq + (regimeClamp_continuous η N).continuousAt rfl + exact (continuousAt_const.add (continuousAt_const.mul hc)).rexp +lemma clamped_speed_continuous (η : ℝ) (hη : 0<η) (N : ℝ≥0) : + Continuous (fun v : State => physicalV (regimeClamp η N v)) := by + apply continuous_iff_continuousAt.mpr + intro v + have hy := hη.trans_le (regimeClamp_height η N v) + exact (Y.continuous.continuousAt.div ((X.continuous.pow 2).add (Y.continuous.pow 2)).continuousAt + (Q_pos hy).ne').comp_of_eq (regimeClamp_continuous η N).continuousAt rfl +lemma regimeState_discount_le {m : ℕ} (s : Finset (Fin m)) {a ε η : ℝ} + (ha : 1/4 regimeClamp η N (vectorState a η hη z t.toNNReal b i) + have hd (i : Fin m) : Continuous (fun t : ℝ => physicalDelta a (cap i) (σ i) (off i) (V t i)) := + (clamped_delta_continuous a η hη N (cap i) (σ i) (off i)).comp + ((localState_continuous a η hη (z i) b).comp continuous_real_toNNReal) + have hv (i : Fin m) : Continuous (fun t : ℝ => physicalV (V t i)) := + (clamped_speed_continuous η hη N).comp ((localState_continuous a η hη (z i) b).comp continuous_real_toNNReal) + have hf (i : Fin m) : Continuous (fun t : ℝ => physicalDelta a (cap i) (σ i) (off i) (V t i)*physicalV (V t i)^2) := (hd i).mul ((hv i).pow 2) + have hg (i j : Fin m) : Continuous (fun t : ℝ => + (physicalDelta a (cap i) (σ i) (off i) (V t i)*physicalDelta a (cap j) (σ j) (off j) (V t j))^(-regM a)* + physicalV (V t i)*physicalV (V t j)) := + (((hd i).mul (hd j)).rpow_const (fun t => Or.inl (mul_pos (Real.exp_pos _) (Real.exp_pos _)).ne')).mul (hv i) |>.mul (hv j) + have hk : Continuous (fun t : ℝ => regimeDiscountCut s a ε η N cap σ off (vectorState a η hη z t.toNNReal b)) := + (regimeDiscountCut_continuous s a ε η hη N cap σ off).comp ((vectorState_continuous a η hη z b).comp continuous_real_toNNReal) + have he := intervalIntegral.integral_add_adjacent_intervals (μ:=volume) (hk.intervalIntegrable 0 S) (hk.intervalIntegrable S T) + have hsum (r : Finset (Fin m)) {J : ℝ} (hJ : 0≤J) (f : Fin m → ℝ) (h : ∀ i∈r,f i≤J) : + (∑ i ∈ r, f i) ≤ (m:ℝ)*J := by + calc + _ ≤ ∑ i ∈ r, J := Finset.sum_le_sum h + _ = (r.card:ℝ)*J := by simp + _ ≤ m*J := mul_le_mul_of_nonneg_right (by exact_mod_cast (show r.card ≤ m by simpa only [Fintype.card_fin] using r.card_le_univ)) hJ + change (∫ t in (0:ℝ)..(T:ℝ), _)-(∫ t in (0:ℝ)..(S:ℝ), _)≤_ + rw [←he,add_sub_cancel_left] + unfold regimeDiscountCut regimeDiscount + rw [intervalIntegral.integral_add] + · rw [intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul, + intervalIntegral.integral_finsetSum (f:=fun i t => physicalDelta a (cap i) (σ i) (off i) (V t i)*physicalV (V t i)^2) (fun i hi => (hf i).intervalIntegrable _ _), + intervalIntegral.integral_finsetSum (fun i hi => (continuous_finsetSum _ fun j hj => hg i j).intervalIntegrable _ _)] + apply add_le_add + · exact mul_le_mul_of_nonneg_left (hsum s hJ₀ _ hsingle) (regC_pos ha).le + · apply mul_le_mul_of_nonneg_left _ (by have := regEta_lt_half ha; have := regC2_pos ha; have := regEta_pos ha; unfold regYoungC; apply div_nonneg; apply mul_nonneg; apply mul_nonneg; linarith; positivity; positivity; norm_num) + apply hsum s (mul_nonneg (by positivity) hJ₁) + intro i hi + rw [intervalIntegral.integral_finsetSum (fun j hj => (hg i j).intervalIntegrable _ _)] + exact hsum (s.erase i) hJ₁ _ (hpair i hi) + · exact ((continuous_finsetSum s fun i hi => hf i).const_mul _).intervalIntegrable _ _ + · exact ((continuous_finsetSum s fun i hi => continuous_finsetSum _ fun j hj => hg i j).const_mul _).intervalIntegrable _ _ +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +noncomputable def pairDiscountConstant (a : ℝ) : ℝ := + Real.exp (2*(regM a*regBeta a))/(2*a*(1-Real.exp (2*(regM a*regBeta a)-a))) +lemma pairDiscountConstant_pos {a : ℝ} (ha : 1/4 (levelTime a b (z i) (cap i) 0).toNNReal + have htimes (i) (hi : i∈phaseActive p) := active_phase_interval + (levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b 0 (U i/2) le_rfl (by have := hu i; linarith)) + (levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b (U i/2) (U i) (by have := hu i; linarith) (by have := hu i; linarith)) + (hboundary i) ((phaseActive_mem p i).mp hi) + have hA (i) (hi : i∈phaseActive p) : A i≤S := + ENNReal.coe_le_coe.mp (ENNReal.coe_toNNReal_le_self.trans (htimes i hi).1) + have hR (i) (hi : i∈phaseActive p) : fullLoewnerRadius a b.1 (z i) (A i)=cap i := + levelTime_fullRadius a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b + (ne_top_of_le_ne_top (by simp) (htimes i hi).1) + have hclockT (i) (hi : i∈phaseActive p) : physicalClock a (cap i) (actualState a b.1 T (z i))≤U i := + levelTime_clock_le a ha0 (z i) (hz i) (cap i) (U i) (hc i) (hr i) (hu i) b T + ((hsafe T hST le_rfl).2 i hi).1 (htimes i hi).2.1 + have hclockS (i) (hi : i∈phaseActive p) (hp : p i=2) : + U i/2≤physicalClock a (cap i) (actualState a b.1 S (z i)) := + levelTime_clock_ge a ha0 (z i) (hz i) (cap i) (U i/2) (hc i) (hr i) (by have := hu i; linarith) b S + ((hsafe S le_rfl hST).2 i hi).1 ((htimes i hi).2.2 hp) + have he (t : ℝ) (ht : t∈uIcc (S:ℝ) (T:ℝ)) (i) (hi : i∈phaseActive p) : + regimeClamp η M (vectorState a η hη z t.toNNReal b i)=actualState a b.1 t.toNNReal (z i) := by + have ht' : t∈Icc (S:ℝ) T := by simpa only [uIcc_of_le (show (S:ℝ)≤T from hST)] using ht + have hlo : S≤t.toNNReal := by exact_mod_cast (show (S:ℝ)≤(t.toNNReal:ℝ) by rw [Real.coe_toNNReal _ (S.coe_nonneg.trans ht'.1)]; exact ht'.1) + have hhi : t.toNNReal≤T := by exact_mod_cast (show (t.toNNReal:ℝ)≤T by rw [Real.coe_toNNReal _ (S.coe_nonneg.trans ht'.1)]; exact ht'.2) + have hs := hsafe t.toNNReal hlo hhi + rw [regimeClamp_eq η M _ hη ((norm_le_pi_norm _ i).trans hs.1) (hs.2 i hi).2.1] + exact (hs.2 i hi).2.2 + apply regimeState_discount_le (phaseActive p) ha hε hη M cap (phaseSigma a p) (phaseOffset a U p) z b S T + (1/regBeta a) (pairDiscountConstant a) (by have := regBeta_pos ha; positivity) (pairDiscountConstant_pos ha).le + · intro i hi + obtain ⟨f,hf⟩ := ((hsafe T hST le_rfl).2 i hi).1 + have hh := actual_regularized_single_discount ha b.1.continuous hST (hA i hi) hf (hc i) (hR i hi) + (U:=U i) (σ:=phaseSigma a p i) (off:=phaseOffset a U p i) + have hp : (phaseSigma a p i=-regBeta a ∧ phaseOffset a U p i=0) ∨ + (phaseSigma a p i=regBeta a ∧ phaseOffset a U p i=-regBeta a*U i ∧ activeODEClock b.1 T (A i) f T≤U i) := by + by_cases hh : p i=2 + · right + refine ⟨by simp [phaseSigma,hh],by simp [phaseOffset,hh],?_⟩ + rw [←actual_clock_eq ha0.ne' (hc i) b.1.continuous hf ((hA i hi).trans hST) le_rfl (hR i hi)] + exact hclockT i hi + · exact Or.inl ⟨by simp [phaseSigma,hh],by simp [phaseOffset,hh]⟩ + apply (le_of_eq ?_).trans (hh hp) + apply intervalIntegral.integral_congr + intro t ht + dsimp only + rw [he t ht i hi] + · intro i hi j hj + have hj' := Finset.mem_of_mem_erase hj + obtain ⟨f,hf⟩ := ((hsafe T hST le_rfl).2 i hi).1 + obtain ⟨g,hg⟩ := ((hsafe T hST le_rfl).2 j hj').1 + have hij : i≠j := (Finset.ne_of_mem_erase hj).symm + have hp (k : Fin m) (hk : k∈phaseActive p) (f : ℝ → ℂ) (hf : odeUntil a b.1 (z k) T f) : + (phaseSigma a p k=-regBeta a ∧ phaseOffset a U p k=0) ∨ + (phaseSigma a p k=regBeta a ∧ phaseOffset a U p k=-regBeta a*U k ∧ U k/2≤activeODEClock b.1 T (A k) f S) := by + by_cases hh : p k=2 + · right + refine ⟨by simp [phaseSigma,hh],by simp [phaseOffset,hh],?_⟩ + rw [←actual_clock_eq ha0.ne' (hc k) b.1.continuous hf ((hA k hk).trans hST) hST (hR k hk)] + exact hclockS k hk hh + · exact Or.inl ⟨by simp [phaseSigma,hh],by simp [phaseOffset,hh]⟩ + have hh := actual_regularized_pair_discount ha b.1.continuous hST (hA i hi) (hA j hj') hf hg + (hinj.ne hij) (hc i) (hc j) (hR i hi) (hR j hj') (hsep i j hij) + (by simpa only [norm_sub_rev] using hsep j i hij.symm) (hp i hi f hf) (hp j hj' g hg) + apply (le_of_eq ?_).trans hh + apply intervalIntegral.integral_congr + intro t ht + dsimp only + rw [he t ht i hi,he t ht j hj'] +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory ProbabilityTheory Set Filter +open scoped Classical NNReal ENNReal +lemma stopped_phaseProduct_measurable {m : ℕ} (a : ℝ) (ha : 0 (S b : WithTop ℝ≥0))) : + Measurable (fun b => phaseProduct a cap U (actualPhase a z cap U (S b) b) + (vectorState a η hη z (S b) b)) := by + have hp := (actualPhase_measurable a ha z hz cap U hc hr hu S hS).mono hS.measurableSpace_le le_rfl + have hv := (vectorState_stopped_measurable a η hη z S hS).mono hS.measurableSpace_le le_rfl + have he : (fun b => phaseProduct a cap U (actualPhase a z cap U (S b) b) (vectorState a η hη z (S b) b))= + fun b => ∑ p : PhaseVector m, if actualPhase a z cap U (S b) b=p then + phaseProduct a cap U p (vectorState a η hη z (S b) b) else 0 := by funext b; simp + rw [he] + apply Finset.measurable_sum + intro p hp' + exact ((phaseProduct_measurable a cap U p).comp hv).ite (hp (measurableSet_singleton p)) measurable_const +lemma actual_phase_expectation_step {m : ℕ} {a ε : ℝ} (ha : 1/4 b.1 t) W) + (S T : ExactSLEGenerator.Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b,S b≤T b) (hTB : ∀ b,T b≤B) + (hboundary : ∀ b i, ∀ u∈({0,U i/2,U i}:Finset ℝ), + levelTime a b (z i) (cap i) u≤(S b:ℝ≥0∞) ∨ (T b:ℝ≥0∞)≤levelTime a b (z i) (cap i) u) + (hsafe : ∀ b t, t≤T b → (∃ i, (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i)) → + ‖vectorState a η hη z t b‖≤M ∧ ∀ i, + (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i) → + alive a b.1 t (z i) ∧ η≤Y (vectorState a η hη z t b i) ∧ + vectorState a η hη z t b i=actualState a b.1 t (z i)) : + (∫ b, phaseProduct a cap U (actualPhase a z cap U (T b) b) (vectorState a η hη z (T b) b) ∂W)≤ + Real.exp (phaseDiscountConstant m a ε)* + (∫ b, phaseProduct a cap U (actualPhase a z cap U (S b) b) (vectorState a η hη z (S b) b) ∂W) := by + classical + have ha0 : 0 phaseProduct a cap U (actualPhase a z cap U (Q b) b) (vectorState a η hη z (Q b) b) + let E := fun p : PhaseVector m => {b | actualPhase a z cap U (S b) b=p} + have hE (p) : MeasurableSet[hS.measurableSpace] (E p) := + actualPhase_measurable a ha0 z hz cap U hc hr hu S hS (measurableSet_singleton p) + have hE' (p) : MeasurableSet (E p) := hS.measurableSpace_le _ (hE p) + have htrans (b) : P T b≤phaseProduct a cap U (actualPhase a z cap U (S b) b) (vectorState a η hη z (T b) b) := by + apply actual_phase_transition ha z hz cap U hc hr hu η hη b (S b) (T b) (hST b) (hboundary b) + intro i hi + exact ((hsafe b (T b) le_rfl ⟨i,hi⟩).2 i hi).2.2 + have hint (p : PhaseVector m) (Q : ExactSLEGenerator.Driver → ℝ≥0) + (hQ : IsStoppingTime rawFiltration (fun b => (Q b : WithTop ℝ≥0))) + (hSQ : ∀ b,S b≤Q b) (hQT : ∀ b,Q b≤T b) : + Integrable (fun b => if b∈E p then phaseProduct a cap U p (vectorState a η hη z (Q b) b) else 0) W := by + by_cases hp : (phaseActive p).Nonempty + · have hi : Integrable (fun b => if b∈E p then regularizedProduct (phaseActive p) a cap (phaseSigma a p) + (phaseOffset a U p) (vectorState a η hη z (Q b) b) else 0) W := by + have hs : ∀ b∈E p, ‖vectorState a η hη z (Q b) b‖≤M ∧ ∀ i∈phaseActive p, η≤Y (vectorState a η hη z (Q b) b i) := by + intro b hb + have he : actualPhase a z cap U (S b) b=p := hb + have hn : (phaseActive (actualPhase a z cap U (S b) b)).Nonempty := he ▸ hp + have hh := actual_phase_interval_safe ha z hz cap U hc hr hu η hη M b (S b) (T b) (hST b) hn + (fun i => hboundary b i (U i) (by simp)) (hsafe b) + (Q b) (hSQ b) (hQT b) + rw [he] at hh + exact ⟨hh.1,fun i hi => (hh.2 i hi).1⟩ + convert regularizedProduct_indicator_integrable (phaseActive p) a η hη M cap (phaseSigma a p) (phaseOffset a U p) z W Q hQ (E p) (hE' p) hs using 1 + funext b + by_cases hb : b∈E p <;> simp only [ite_eq_left,ite_eq_right,hb,not_false_eq_true] + convert hi.const_mul (phaseConstant a U p) using 1 + funext b + dsimp only [phaseProduct] + split_ifs <;> simp + · have he : phaseActive p=∅ := Finset.not_nonempty_iff_eq_empty.mp hp + simp only [phaseProduct,he,regularizedProduct,Finset.prod_empty,mul_one] + have hic : Integrable (fun _ : ExactSLEGenerator.Driver => phaseConstant a U p) W := integrable_const _ + convert hic.indicator (hE' p) using 1 + all_goals first | rfl | (funext b; by_cases hb : b∈E p <;> simp [hb,Set.indicator]) + have hPi (p) : Integrable (fun b => if b∈E p then P T b else 0) W := by + have hm : Measurable (fun b => if b∈E p then P T b else 0) := + (stopped_phaseProduct_measurable a ha0 z hz cap U hc hr hu η hη T hT).ite (hE' p) measurable_const + apply (hint p T hT hST (fun _ => le_rfl)).mono' hm.aestronglyMeasurable + apply Eventually.of_forall + intro b + by_cases hb : b∈E p + · simp only [ite_eq_left hb,Real.norm_eq_abs,abs_of_pos (show 0

if b∈E p then P S b else 0) W := by + convert hint p S hS (fun _ => le_rfl) hST using 1 + funext b + by_cases hb : b∈E p + · simp only [ite_eq_left hb,P,show actualPhase a z cap U (S b) b=p from hb] + · simp only [ite_eq_right hb] + have hlocal (p) : (∫ b, (if b∈E p then phaseProduct a cap U p (vectorState a η hη z (T b) b) else 0) ∂W)≤ + Real.exp (phaseDiscountConstant m a ε)*(∫ b, (if b∈E p then phaseProduct a cap U p (vectorState a η hη z (S b) b) else 0) ∂W) := by + by_cases hp : (phaseActive p).Nonempty + · have hsiz : ε*(((phaseActive p).card:ℝ)-1)≤regK a/2 := by + have hcard : ((phaseActive p).card:ℝ)≤ m := by exact_mod_cast (show (phaseActive p).card ≤ m by simpa using (phaseActive p).card_le_univ) + exact (mul_le_mul_of_nonneg_left (sub_le_sub_right hcard 1) hε.le).trans hsize + have hh := vector_regime_event_comparison (phaseActive p) ha hε hη hsiz M cap (phaseSigma a p) (phaseOffset a U p) + (fun i hi => phaseSigma_bound ha p i) z W hW S T B hS hT hST hTB (E p) (hE p) + have hsafe' : ∀ b∈E p, ∀ t, S b≤t → t≤T b → ‖vectorState a η hη z t b‖≤M ∧ + ∀ i∈phaseActive p, η≤Y (vectorState a η hη z t b i) ∧ + physicalDelta a (cap i) (phaseSigma a p i) (phaseOffset a U p i) (vectorState a η hη z t b i)≤1 := by + intro b hb + have he : actualPhase a z cap U (S b) b=p := hb + have hh := actual_phase_interval_safe ha z hz cap U hc hr hu η hη M b (S b) (T b) (hST b) + (he ▸ hp) (fun i => hboundary b i (U i) (by simp)) (hsafe b) + simpa only [he] using hh + have hD : ∀ b∈E p, + (regimeState (phaseActive p) a ε η hη M cap (phaseSigma a p) (phaseOffset a U p) z (T b) b).2- + (regimeState (phaseActive p) a ε η hη M cap (phaseSigma a p) (phaseOffset a U p) z (S b) b).2≤phaseDiscountConstant m a ε := by + intro b hb + have he : actualPhase a z cap U (S b) b=p := hb + have h := actual_phase_discount ha hε z hz hinj cap U hc hr hsep hu η hη M b (S b) (T b) (hST b) + (fun i => hboundary b i (U i) (by simp)) + apply (he ▸ h) + intro t hst htt + have h1 := hsafe' b hb t hst htt + refine ⟨h1.1,?_⟩ + intro i hi + have hi' : i∈phaseActive (actualPhase a z cap U (S b) b) := he ▸ hi + have htarg := (active_phase_interval + (levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b 0 (U i/2) le_rfl (by have := hu i; linarith)) + (levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b (U i/2) (U i) (by have := hu i; linarith) (by have := hu i; linarith)) + (hboundary b i (U i) (by simp)) ((phaseActive_mem _ i).mp hi')).2.1 + have hti := (ENNReal.coe_le_coe.mpr htt).trans htarg + exact (hsafe b t htt ⟨i,hti⟩).2 i hti + have hh' := mul_le_mul_of_nonneg_left (hh hsafe' _ hD) (phaseConstant_pos a U p).le + simpa only [←integral_const_mul,phaseProduct,mul_ite,mul_zero,mul_assoc,mul_left_comm] using hh' + · have he : phaseActive p=∅ := Finset.not_nonempty_iff_eq_empty.mp hp + have hnon : 0≤∫ b, (if b∈E p then phaseConstant a U p else 0) ∂W := integral_nonneg fun b => by have := phaseConstant_pos a U p; split_ifs <;> positivity + simp only [phaseProduct,he,regularizedProduct,Finset.prod_empty,mul_one] + exact le_mul_of_one_le_left hnon (Real.one_le_exp_iff.mpr (phaseDiscountConstant_nonneg m ha hε)) + rw [←integral_const_mul] + apply ExactSLEPasting.integral_le_of_finite_partition (fun b => actualPhase a z cap U (S b) b) + · intro p + convert hPi p using 1 + funext b + by_cases hb : b∈E p <;> simp [E] at hb ⊢ <;> simp [hb,P] + · intro p + convert (hSi p).const_mul (Real.exp (phaseDiscountConstant m a ε)) using 1 + funext b + by_cases hb : b∈E p <;> simp [E] at hb ⊢ <;> simp [hb,P] + · intro p + have h1 : (∫ b, (if b∈E p then P T b else 0) ∂W) ≤ + ∫ b, (if b∈E p then phaseProduct a cap U p (vectorState a η hη z (T b) b) else 0) ∂W := + integral_mono (hPi p) (hint p T hT hST (fun _ => le_rfl)) (fun b => by + split_ifs with hb + · simpa only [show actualPhase a z cap U (S b) b=p from hb] using htrans b + · exact le_rfl) + have h2 : (∫ b, (if b∈E p then phaseProduct a cap U p (vectorState a η hη z (S b) b) else 0) ∂W) = + ∫ b, (if b∈E p then P S b else 0) ∂W := by + congr 1 + funext b + by_cases hb : b∈E p + · simp only [ite_eq_left hb,P,show actualPhase a z cap U (S b) b=p from hb] + · simp only [ite_eq_right hb] + have h3 := h1.trans (hlocal p) + rw [h2,←integral_const_mul] at h3 + convert h3 using 1 <;> congr 1 <;> funext b <;> + (by_cases hb : b∈E p <;> simp [E] at hb ⊢ <;> simp [hb,P]) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +lemma actualState_zero {a : ℝ} (ha : 0 positivity +lemma phaseSigma_bound {m : ℕ} {a : ℝ} (ha : 1/4 simp [abs_of_pos (regBeta_pos ha)] +lemma physicalRegularized_pos (a cap σ off : ℝ) (v : State) : + 0 physicalRegularized_pos a (cap i) (σ i) (off i) (v i) +lemma phaseProduct_pos {m : ℕ} (a : ℝ) (cap U : Fin m → ℝ) + (p : PhaseVector m) (v : Fin m → State) : 0 (physicalRegularized_measurable a (cap i) _ _).comp (measurable_pi_apply i) +end ExactSLEGreen + + +namespace ExactSLEStops +open scoped ENNReal NNReal +lemma phase_mono (A B C : ℝ≥0∞) : Monotone (phase A B C) := by + intro S T hST + have hst : (S:ℝ≥0∞)≤T := ENNReal.coe_le_coe.mpr hST + unfold phase + split_ifs <;> norm_num [Fin.le_def] at * <;> + have hst' : (S:ℝ≥0∞)≤T := ENNReal.coe_le_coe.mpr hST + all_goals exfalso; order +lemma boundary_eq {τ : ℝ≥0∞} {S T : ℝ≥0} + (h : τ≤(S:ℝ≥0∞) ∨ (T:ℝ≥0∞)≤τ) (hS : (S:ℝ≥0∞)<τ) (hT : τ≤(T:ℝ≥0∞)) : τ=(T:ℝ≥0∞) := + le_antisymm hT (h.resolve_left (not_le.mpr hS)) +end ExactSLEStops +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops +open scoped Classical ENNReal NNReal +noncomputable def phaseFactor (a cap U : ℝ) (p : Fin 4) (v : State) : ℝ := + if p=0 then 1 else if p=3 then Real.exp (regP a*U/2)/3 else + physicalRegularized a cap (if p=2 then regBeta a else -regBeta a) + (if p=2 then -regBeta a*U else 0) v +lemma phaseProduct_eq_prod {m : ℕ} (a : ℝ) (cap U : Fin m → ℝ) (p : PhaseVector m) + (v : Fin m → State) : phaseProduct a cap U p v=∏ i, phaseFactor a (cap i) (U i) (p i) (v i) := by + unfold phaseProduct phaseConstant regularizedProduct phaseActive + rw [Finset.prod_filter,←Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i hi + unfold phaseSigma phaseOffset phaseFactor + generalize hp : p i=j + fin_cases j <;> norm_num [Fin.ext_iff] +lemma phaseFactor_pos (a cap U : ℝ) (p : Fin 4) (v : State) : 0 fin_cases q <;> try (norm_num [Fin.le_def] at hpq) <;> try exact le_rfl + · have hsa := (phase_zero_iff A B C S hAB hBC).mp hp + have hat := ((phase_one_iff A B C T hAB hBC).mp hq).1 + have hu := huA (boundary_eq hA hsa hat) + simpa [phaseFactor,Fin.ext_iff] using physicalRegularized_activation (σ := -regBeta a) (off := 0) ha v hu rfl + · have hsa := (phase_zero_iff A B C S hAB hBC).mp hp + have hbt := ((phase_two_iff A B C T hAB hBC).mp hq).1 + have hua := huA (boundary_eq hA hsa (hAB.trans hbt)) + have hub := huB (boundary_eq hB (hsa.trans_le hAB) hbt) + have hu0 : U=0 := by linarith + simpa [phaseFactor,Fin.ext_iff,hu0] using + physicalRegularized_activation (σ := regBeta a) (off := 0) ha v hua rfl + · have hsa := (phase_zero_iff A B C S hAB hBC).mp hp + have hct := (phase_three_iff A B C T).mp hq + have hua := huA (boundary_eq hA hsa (hAB.trans (hBC.trans hct))) + have huc := huC (boundary_eq hC (hsa.trans_le (hAB.trans hBC)) hct) + have hu0 : U=0 := by linarith + norm_num [phaseFactor,Fin.ext_iff,hu0] + · have hsb := ((phase_one_iff A B C S hAB hBC).mp hp).2 + have hbt := ((phase_two_iff A B C T hAB hBC).mp hq).1 + have hu := huB (boundary_eq hB hsb hbt) + simpa [phaseFactor,Fin.ext_iff] using (physicalRegularized_midpoint a cap U v hu).le + · have hsb := ((phase_one_iff A B C S hAB hBC).mp hp).2 + have hct := (phase_three_iff A B C T).mp hq + have hub := huB (boundary_eq hB hsb (hBC.trans hct)) + have huc := huC (boundary_eq hC (hsb.trans_le hBC) hct) + have hu0 : U=0 := by linarith + have h := physicalRegularized_completion (σ := -regBeta a) (off := 0) ha v huc (by rw [hu0]; ring) + simpa [phaseFactor,Fin.ext_iff] using h + · have hsc := ((phase_two_iff A B C S hAB hBC).mp hp).2 + have hct := (phase_three_iff A B C T).mp hq + have hu := huC (boundary_eq hC hsc hct) + have h := physicalRegularized_completion (σ := regBeta a) (off := -regBeta a*U) ha v hu (by ring) + simpa [phaseFactor,Fin.ext_iff] using h +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +noncomputable def actualPhase {m : ℕ} (a : ℝ) (z : Fin m → ℂ) (cap U : Fin m → ℝ) + (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : PhaseVector m := fun i => + phase (levelTime a b (z i) (cap i) 0) (levelTime a b (z i) (cap i) (U i/2)) + (levelTime a b (z i) (cap i) (U i)) t +lemma actualPhase_measurable {m : ℕ} (a : ℝ) (ha : 0 (S b : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun b => actualPhase a z cap U (S b) b) := by + apply @Measurable.of_eval _ _ _ hS.measurableSpace _ + intro i + apply phase_measurable rawFiltration _ _ _ S _ _ _ hS + all_goals apply radialTime_stopping a ha (z i) (hz i) _ (levelRadius_pos _ _ _ (hc i)) + · exact (levelRadius_le ha (hc i) le_rfl).trans (by have := hr i; linarith) + · exact (levelRadius_le ha (hc i) (by have := hu i; linarith : 0≤U i/2)).trans (by have := hr i; linarith) + · exact (levelRadius_le ha (hc i) (hu i)).trans (by have := hr i; linarith) +lemma active_phase_interval {A B C : ℝ≥0∞} {S T : ℝ≥0} (hAB : A≤B) (hBC : B≤C) + (hC : C≤(S:ℝ≥0∞) ∨ (T:ℝ≥0∞)≤C) + (hi : phase A B C S=1 ∨ phase A B C S=2) : + A≤(S:ℝ≥0∞) ∧ (T:ℝ≥0∞)≤C ∧ (phase A B C S=2 → B≤(S:ℝ≥0∞)) := by + rcases hi with hi|hi + · have hp := (phase_one_iff A B C S hAB hBC).mp hi + refine ⟨hp.1,hC.resolve_left (not_le.mpr (hp.2.trans_le hBC)),?_⟩ + intro hh + have : (1:Fin 4)=2 := hi.symm.trans hh + norm_num [Fin.ext_iff] at this + · have hp := (phase_two_iff A B C S hAB hBC).mp hi + exact ⟨hAB.trans hp.1,hC.resolve_left (not_le.mpr hp.2),fun _ => hp.1⟩ +lemma phase_delta_le {a cap U : ℝ} (ha : 1/4 ⟨(hs.2 i (hti i hi)).2.1,?_⟩⟩ + rw [(hs.2 i (hti i hi)).2.2] + apply phase_delta_le ha + · exact levelTime_clock_ge a ha0 (z i) (hz i) (cap i) 0 (hc i) (hr i) le_rfl b t + (hs.2 i (hti i hi)).1 ((htimes i hi).1.trans (ENNReal.coe_le_coe.mpr hts)) + · exact levelTime_clock_le a ha0 (z i) (hz i) (cap i) (U i) (hc i) (hr i) (hu i) b t + (hs.2 i (hti i hi)).1 (hti i hi) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +lemma levelTime_clock_at_eq (a : ℝ) (ha : 0 (S b : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun b => vectorState a η hη z (S b) b) := by + have hA : StronglyAdapted rawFiltration (vectorState a η hη z) := + fun t => (vectorState_adapted a η hη z t).stronglyMeasurable + exact measurable_stoppedValue (hA.isStronglyProgressive_of_continuous + (vectorState_continuous a η hη z)) hS +lemma regimeState_stopped_measurable {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) + (hη : 0<η) (N : ℝ≥0) (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) + (S : Driver → ℝ≥0) (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun b => regimeState s a ε η hη N cap σ off z (S b) b) := by + have hA : StronglyAdapted rawFiltration (regimeState s a ε η hη N cap σ off z) := + fun t => (regimeState_adapted s a ε η hη N cap σ off z t).stronglyMeasurable + exact measurable_stoppedValue (hA.isStronglyProgressive_of_continuous + (regimeState_continuous s a ε η hη N cap σ off z)) hS +lemma regularizedProduct_measurable {m : ℕ} (s : Finset (Fin m)) (a : ℝ) + (cap σ off : Fin m → ℝ) : Measurable (regularizedProduct s a cap σ off) := by + unfold regularizedProduct + exact Finset.measurable_prod _ fun i _ => + (physicalRegularized_measurable a (cap i) (σ i) (off i)).comp (measurable_pi_apply i) +lemma regularizedProduct_bound {m : ℕ} (s : Finset (Fin m)) (a η : ℝ) (hη : 0<η) + (N : ℝ≥0) (cap σ off : Fin m → ℝ) : ∃ C : ℝ, ∀ v : Fin m → State, + ‖v‖≤N → (∀ i∈s, η≤Y (v i)) → ‖regularizedProduct s a cap σ off v‖≤C := by + obtain ⟨C,hC⟩ := (regimeCutoff_compact s a η N cap σ off).exists_bound_of_continuous + (regimeCutoff_smooth s a η hη N cap σ off).continuous + refine ⟨C,fun v hv hy => ?_⟩ + have he := (regimeCutoff_eq_near s a η hη N cap σ off (v,0) + (max_le hv (by simp)) hy).eq_of_nhds + simpa only [he,discountedProduct,neg_zero,Real.exp_zero,one_mul] using hC (v,0) +lemma regimeState_discount_bound {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) + (hη : 0<η) (N B : ℝ≥0) (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) : + ∃ L : ℝ, 0≤L ∧ ∀ (b : Driver) (t : ℝ≥0), t≤B → + |(regimeState s a ε η hη N cap σ off z t b).2|≤L := by + obtain ⟨K,hK,hKb⟩ := regimeDiscountCut_bound s a ε η hη N cap σ off + refine ⟨K*B,by positivity,fun b t ht => ?_⟩ + change ‖∫ u in (0:ℝ)..(t:ℝ), regimeDiscountCut s a ε η N cap σ off + (vectorState a η hη z u.toNNReal b)‖≤_ + calc + _ ≤ K*|(t:ℝ)-0| := intervalIntegral.norm_integral_le_of_norm_le_const fun u _ => hKb _ + _ ≤ K*B := by rw [sub_zero,abs_of_nonneg t.coe_nonneg]; exact mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hK +lemma regularizedProduct_indicator_integrable {m : ℕ} (s : Finset (Fin m)) (a η : ℝ) + (hη : 0<η) (N : ℝ≥0) (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) + (W : Measure Driver) [IsProbabilityMeasure W] (S : Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (E : Set Driver) (hE : MeasurableSet E) + (hsafe : ∀ b∈E, ‖vectorState a η hη z (S b) b‖≤N ∧ + ∀ i∈s, η≤Y (vectorState a η hη z (S b) b i)) : + Integrable (fun b => if b∈E then regularizedProduct s a cap σ off + (vectorState a η hη z (S b) b) else 0) W := by + obtain ⟨C,hC⟩ := regularizedProduct_bound s a η hη N cap σ off + have hm := (regularizedProduct_measurable s a cap σ off).comp + ((vectorState_stopped_measurable a η hη z S hS).mono hS.measurableSpace_le le_rfl) + apply Integrable.of_bound (hm.ite hE measurable_const).aestronglyMeasurable (max C 0) + apply Eventually.of_forall + intro b + split_ifs with hb + · exact (hC _ (hsafe b hb).1 (hsafe b hb).2).trans (le_max_left _ _) + · simpa only [norm_zero] using le_max_right C 0 +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEFiniteTilt ExactSLECalculus ProbabilityTheory MeasureTheory Set Filter +open scoped Classical NNReal ENNReal + + +theorem vector_regime_event_comparison {m : ℕ} (s : Finset (Fin m)) {a ε η : ℝ} + (ha : 1/4 b.1 t) W) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b≤T b) (hTB : ∀ b, T b≤B) + (E : Set Driver) (hE : MeasurableSet[hS.measurableSpace] E) + (hsafe : ∀ b∈E, ∀ t, S b≤t → t≤T b → + ‖vectorState a η hη z t b‖≤M ∧ + ∀ i∈s, η≤Y (vectorState a η hη z t b i) ∧ + physicalDelta a (cap i) (σ i) (off i) (vectorState a η hη z t b i)≤1) + (D : ℝ) (hD : ∀ b∈E, + (regimeState s a ε η hη M cap σ off z (T b) b).2- + (regimeState s a ε η hη M cap σ off z (S b) b).2≤D) : + (∫ b, (if b∈E then regularizedProduct s a cap σ off (vectorState a η hη z (T b) b) else 0) ∂W) ≤ + Real.exp D*(∫ b, (if b∈E then regularizedProduct s a cap σ off (vectorState a η hη z (S b) b) else 0) ∂W) := by + let R := fun t b => (regimeState s a ε η hη M cap σ off z t b).2 + let P := fun t b => regularizedProduct s a cap σ off (vectorState a η hη z t b) + obtain ⟨L,hL,hLb⟩ := regimeState_discount_bound s a ε η hη M B cap σ off z + have hSB : ∀ b, S b≤B := fun b => (hST b).trans (hTB b) + have hRS : Measurable[hS.measurableSpace] (fun b => R (S b) b) := + (regimeState_stopped_measurable s a ε η hη M cap σ off z S hS).snd + have hRT : Measurable (fun b => R (T b) b) := + ((regimeState_stopped_measurable s a ε η hη M cap σ off z T hT).mono hT.measurableSpace_le le_rfl).snd + have hRs : Measurable (fun b => R (S b) b) := hRS.mono hS.measurableSpace_le le_rfl + let w : Driver → ℝ := fun b => if b∈E then Real.exp (R (S b) b) else 0 + have hw : StronglyMeasurable[hS.measurableSpace] w := (hRS.exp.ite hE measurable_const).stronglyMeasurable + have hw0 : ∀ b, 0≤w b := by intro b; dsimp [w]; split_ifs <;> positivity + have hwb : ∀ b, ‖w b‖≤Real.exp L := by + intro b + dsimp [w] + split_ifs + · simp only [abs_of_pos (Real.exp_pos _)] + exact Real.exp_le_exp.mpr ((le_abs_self _).trans (hLb b (S b) (hSB b))) + · simpa using (Real.exp_pos L).le + have hopt := vector_regime_weighted_optional_bounded s ha hε hη hsize M cap σ off hσ z W hW + S T B hS hT hST hTB E hE w hw hw0 (Real.exp L) hwb + (by intro b hb; simp [w,hb]) hsafe + have hE' : MeasurableSet E := hS.measurableSpace_le E hE + have hPi (Q : Driver → ℝ≥0) (hQ : IsStoppingTime rawFiltration (fun b => (Q b : WithTop ℝ≥0))) + (hSQ : ∀ b,S b≤Q b) (hQT : ∀ b,Q b≤T b) : + Integrable (fun b => if b∈E then P (Q b) b else 0) W := by + apply regularizedProduct_indicator_integrable s a η hη M cap σ off z W Q hQ E hE' + intro b hb + exact ⟨(hsafe b hb _ (hSQ b) (hQT b)).1,fun i hi => (hsafe b hb _ (hSQ b) (hQT b)).2 i hi |>.1⟩ + have hFi := hPi T hT hST (fun _ => le_rfl) + have hGi := hPi S hS (fun _ => le_rfl) hST + let F := fun b => if b∈E then Real.exp (R (S b) b-R (T b) b)*P (T b) b else 0 + have hF_eq : F=fun b => Real.exp (R (S b) b-R (T b) b)*(if b∈E then P (T b) b else 0) := by + funext b; dsimp [F]; split_ifs <;> simp + have hFint : Integrable F W := by + rw [hF_eq] + apply hFi.bdd_mul (hRs.sub hRT).exp.aestronglyMeasurable + apply Eventually.of_forall + intro b + simp only [Real.norm_eq_abs,abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_exp.mpr (show R (S b) b-R (T b) b≤2*L from ?_) + have h1 := (abs_le.mp (hLb b (S b) (hSB b))).2 + have h2 := (abs_le.mp (hLb b (T b) (hTB b))).1 + change R (S b) b≤L at h1 + change -L≤R (T b) b at h2 + linarith + have heT : (fun b => w b*discountedProduct s a cap σ off + (regimeState s a ε η hη M cap σ off z (T b) b))=F := by + funext b + dsimp [w,F,discountedProduct,P,R,regimeState] + split_ifs <;> simp [Real.exp_sub,div_eq_mul_inv,Real.exp_neg,mul_assoc] + have heS : (fun b => w b*discountedProduct s a cap σ off + (regimeState s a ε η hη M cap σ off z (S b) b))=(fun b => if b∈E then P (S b) b else 0) := by + funext b + dsimp [w,discountedProduct,P,R,regimeState] + split_ifs <;> simp [Real.exp_neg,Real.exp_ne_zero] + rw [heT,heS] at hopt + calc + _ ≤ ∫ b, Real.exp D*F b ∂W := integral_mono hFi (hFint.const_mul _) (fun b => by + dsimp [F] + split_ifs with hb + · have h : 1≤Real.exp D*Real.exp (R (S b) b-R (T b) b) := by + rw [←Real.exp_add] + apply Real.one_le_exp_iff.mpr + have hd := hD b hb + change R (T b) b-R (S b) b≤D at hd + linarith + have h0 := (regularizedProduct_pos s a cap σ off (vectorState a η hη z (T b) b)).le + simpa only [one_mul,mul_assoc] using mul_le_mul_of_nonneg_right h h0 + · simp) + _ = Real.exp D*(∫ b,F b ∂W) := integral_const_mul _ _ + _ ≤ _ := mul_le_mul_of_nonneg_left hopt (Real.exp_pos D).le +end ExactSLEGreen +open MeasureTheory +open scoped Classical +namespace ExactSLEPasting +end ExactSLEPasting +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/PlanarGrid.lean b/lean/OAI/Probability/SLEGauge/PlanarGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..734766ed5ea0f285b47eeeb8e9015bf4d6ff6056 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/PlanarGrid.lean @@ -0,0 +1,471 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.GaugeBounds + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal NNReal +namespace SLEExactGauge.PlanarGrid + + +def cell (r : ℝ) (p : ℤ×ℤ) : Set ℂ := + {z | (p.1:ℝ)*r ≤ z.re ∧ z.re ≤ ((p.1:ℝ)+1)*r ∧ + (p.2:ℝ)*r ≤ z.im ∧ z.im ≤ ((p.2:ℝ)+1)*r} + +lemma cell_measurable (r : ℝ) (p : ℤ×ℤ) : MeasurableSet (cell r p) := by + unfold cell + measurability + + +lemma mem_floor_cell (r : ℝ) (hr : 0 < r) (z : ℂ) : + z ∈ cell r (⌊z.re/r⌋,⌊z.im/r⌋) := by + have lower (x : ℝ) : (⌊x/r⌋:ℝ)*r ≤ x := (le_div_iff₀ hr).mp (Int.floor_le _) + have upper (x : ℝ) : x ≤ ((⌊x/r⌋:ℝ)+1)*r := + (div_le_iff₀ hr).mp (Int.lt_floor_add_one _).le + exact ⟨lower _,upper _,lower _,upper _⟩ + + + +def nearby (r s : ℝ) (z : ℂ) : Finset (ℤ×ℤ) := + (Finset.Icc ⌊(z.re-s)/r⌋ ⌊(z.re+s)/r⌋).product + (Finset.Icc ⌊(z.im-s)/r⌋ ⌊(z.im+s)/r⌋) + +lemma floor_interval_card (r : ℝ) (hr : 0 < r) (x s : ℝ) (hs : 0 ≤ s) : + ((Finset.Icc ⌊(x-s)/r⌋ ⌊(x+s)/r⌋).card:ℝ) ≤ 2*(s/r)+2 := by + have hlo : (x-s)/r ≤ (x+s)/r := div_le_div_of_nonneg_right (by linarith) hr.le + have hf : ⌊(x-s)/r⌋ ≤ ⌊(x+s)/r⌋ := Int.floor_mono hlo + have hc := Int.card_Icc_of_le _ _ (Int.le_add_one hf) + have hc' : ((Finset.Icc ⌊(x-s)/r⌋ ⌊(x+s)/r⌋).card:ℝ) = + (⌊(x+s)/r⌋:ℝ)+1-(⌊(x-s)/r⌋:ℝ) := by exact_mod_cast hc + rw [hc'] + have h1 := Int.floor_le ((x+s)/r) + have h2 := Int.lt_floor_add_one ((x-s)/r) + have he : (x+s)/r-(x-s)/r=2*(s/r) := by ring + linarith + +lemma nearby_card (r : ℝ) (hr : 0 < r) (s : ℝ) (hs : 0 ≤ s) (z : ℂ) : + ((nearby r s z).card:ℝ) ≤ 16*max 1 ((s/r)^2) := by + have h1 := floor_interval_card r hr z.re s hs + have h2 := floor_interval_card r hr z.im s hs + have hq : 0 ≤ s/r := div_nonneg hs hr.le + have hprod : ((nearby r s z).card:ℝ) ≤ (2*(s/r)+2)^2 := by + rw [nearby,Finset.product_eq_sprod,Finset.card_product,Nat.cast_mul,pow_two] + exact mul_le_mul h1 h2 (Nat.cast_nonneg _) (by positivity) + refine hprod.trans ?_ + by_cases hq1 : s/r ≤ 1 + · have hsq : (s/r)^2 ≤ 1 := by nlinarith + rw [max_eq_left hsq] + nlinarith + · have hq1' : 1 ≤ s/r := (le_of_not_ge hq1) + have hsq : 1 ≤ (s/r)^2 := by nlinarith + rw [max_eq_right hsq] + nlinarith [sq_nonneg (s/r-1)] + +lemma subset_nearby (r : ℝ) (hr : 0 < r) (s : ℝ) (hs : 0 ≤ s) + (U : Set ℂ) (hU : ediam U ≤ ENNReal.ofReal s) (z : ℂ) (hz : z ∈ U) : + U ⊆ ⋃p ∈ nearby r s z,cell r p := by + intro w hw + have hd : dist w z ≤ s := by + apply (ENNReal.ofReal_le_ofReal_iff hs).mp + rw [←edist_dist] + exact (edist_le_ediam_of_mem hw hz).trans hU + rw [dist_eq_norm] at hd + have hre : |w.re-z.re| ≤ s := (Complex.abs_re_le_norm (w-z)).trans hd + have him : |w.im-z.im| ≤ s := (Complex.abs_im_le_norm (w-z)).trans hd + rcases abs_le.mp hre with ⟨hre1,hre2⟩ + rcases abs_le.mp him with ⟨him1,him2⟩ + have hindex : (⌊w.re/r⌋,⌊w.im/r⌋) ∈ nearby r s z := by + simp only [nearby,Finset.product_eq_sprod,Finset.mem_product,Finset.mem_Icc] + constructor <;> constructor <;> apply Int.floor_mono <;> + apply div_le_div_of_nonneg_right _ hr.le <;> linarith + exact mem_iUnion.mpr ⟨_,mem_iUnion.mpr ⟨hindex,mem_floor_cell r hr w⟩⟩ + + + +theorem outerMass_le (ν : OuterMeasure ℂ) (r : ℝ) (hr : 0 < r) + (B : ℝ) (hB : 0 ≤ B) (hcell : ∀p,ν (cell r p) ≤ ENNReal.ofReal B) + (s : ℝ) (hs : 0 ≤ s) (U : Set ℂ) (hU : ediam U ≤ ENNReal.ofReal s) : + ν U ≤ ENNReal.ofReal (16*B*max 1 ((s/r)^2)) := by + classical + by_cases hn : U.Nonempty + · obtain ⟨z,hz⟩ := hn + calc + ν U ≤ ν (⋃p ∈ nearby r s z,cell r p) := ν.mono (subset_nearby r hr s hs U hU z hz) + _ ≤ ∑p ∈ nearby r s z,ν (cell r p) := measure_biUnion_finset_le _ _ + _ ≤ ∑_p ∈ nearby r s z,ENNReal.ofReal B := Finset.sum_le_sum (fun p _=>hcell p) + _=ENNReal.ofReal (((nearby r s z).card:ℝ)*B) := by + simp only [Finset.sum_const,nsmul_eq_mul,ENNReal.ofReal_mul (Nat.cast_nonneg _), + ENNReal.ofReal_natCast] + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + nlinarith [mul_le_mul_of_nonneg_right (nearby_card r hr s hs z) hB]) + · simp [Set.not_nonempty_iff_eq_empty.mp hn] + +end SLEExactGauge.PlanarGrid +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology Classical +namespace SLEExactGauge.PlanarGrid + +lemma cell_closed (r : ℝ) (p : ℤ×ℤ) : IsClosed (cell r p) := by + exact (isClosed_le continuous_const Complex.continuous_re).inter + ((isClosed_le Complex.continuous_re continuous_const).inter + ((isClosed_le continuous_const Complex.continuous_im).inter + (isClosed_le Complex.continuous_im continuous_const))) + +lemma cell_dist (r : ℝ) (_hr : 0≤r) (p : ℤ×ℤ) {z w : ℂ} + (hz : z∈cell r p) (hw : w∈cell r p) : dist w z≤2*r := by + have hre : |w.re-z.re|≤r := abs_le.mpr ⟨by linarith [hw.1,hz.2.1],by linarith [hz.1,hw.2.1]⟩ + have him : |w.im-z.im|≤r := abs_le.mpr ⟨by linarith [hw.2.2.1,hz.2.2.2],by linarith [hz.2.2.1,hw.2.2.2]⟩ + rw [dist_eq_norm] + exact (Complex.norm_le_abs_re_add_abs_im (w-z)).trans (by simpa only [two_mul,Complex.sub_re,Complex.sub_im] using (add_le_add hre him)) + + +lemma index_mem_pair (r : ℝ) (hr : 0.trans (by simp) + rw [containingIndices,Finset.product_eq_sprod,Finset.card_product] + exact (Nat.mul_le_mul (h _) (h _)).trans (by norm_num) + + +lemma tsum_cell_mass (ν : Measure ℂ) (r : ℝ) (hr : 01) z∂ν := + (lintegral_indicator_one (cell_measurable _ _)).symm + simp_rw [he] + rw [←lintegral_tsum (fun p=>(measurable_const.indicator (cell_measurable r p)).aemeasurable)] + calc + _≤∫⁻z,(4:ℝ≥0∞)∂ν := by + apply lintegral_mono + intro z + have ht : (∑'p : ℤ×ℤ,(cell r p).indicator (fun _=>(1:ℝ≥0∞)) z)= + ∑p∈containingIndices r z,(cell r p).indicator (fun _=>(1:ℝ≥0∞)) z := by + apply tsum_eq_sum + intro p hp + exact Set.indicator_of_notMem (fun h=>hp (mem_containingIndices r hr z p h)) _ + change (∑'p : ℤ×ℤ,(cell r p).indicator (fun _=>(1:ℝ≥0∞)) z)≤4 + rw [ht] + calc + _≤∑_p∈containingIndices r z,(1:ℝ≥0∞) := by + apply Finset.sum_le_sum + intro p _ + exact Set.indicator_le_self' (fun _ _=>zero_le) _ + _=((containingIndices r z).card:ℝ≥0∞) := by simp + _≤4 := by exact_mod_cast containingIndices_card r z + _=4*ν univ := lintegral_const _ + +end SLEExactGauge.PlanarGrid +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Metric +open scoped ENNReal NNReal +namespace SLEExactGauge.PlanarGrid + + +def maximalMass (ν : Measure ℂ) (s : ℝ) : ℝ := + sSup {v | ∃U : Set ℂ, ediam U ≤ ENNReal.ofReal s ∧ v=(ν U).toReal} + +lemma maximalMass_nonempty (ν : Measure ℂ) (s : ℝ) : + Set.Nonempty {v | ∃U : Set ℂ, ediam U ≤ ENNReal.ofReal s ∧ v=(ν U).toReal} := + ⟨0,∅,by simp,by simp⟩ + +lemma maximalMass_bdd (ν : Measure ℂ) [IsFiniteMeasure ν] (s : ℝ) : + BddAbove {v | ∃U : Set ℂ, ediam U ≤ ENNReal.ofReal s ∧ v=(ν U).toReal} := by + refine ⟨(ν univ).toReal,?_⟩ + rintro v ⟨U,hU,rfl⟩ + exact ENNReal.toReal_mono (measure_ne_top ν univ) (measure_mono (subset_univ _)) + +lemma maximalMass_bounds (ν : Measure ℂ) [IsFiniteMeasure ν] (s : ℝ) : + 0 ≤ maximalMass ν s ∧ maximalMass ν s ≤ (ν univ).toReal := by + constructor + · exact le_csSup (maximalMass_bdd ν s) ⟨∅,by simp,by simp⟩ + · apply csSup_le (maximalMass_nonempty ν s) + rintro v ⟨U,hU,rfl⟩ + exact ENNReal.toReal_mono (measure_ne_top ν univ) (measure_mono (subset_univ _)) + +lemma mass_le_maximalMass (ν : Measure ℂ) [IsFiniteMeasure ν] + (s : ℝ) (U : Set ℂ) (hU : ediam U ≤ ENNReal.ofReal s) : + (ν U).toReal ≤ maximalMass ν s := + le_csSup (maximalMass_bdd ν s) ⟨U,hU,rfl⟩ + +lemma maximalMass_grid (ν : Measure ℂ) [IsFiniteMeasure ν] (r : ℝ) (hr : 0maximalMass_bounds ν s) + (by + intro i hi s hs + have H := maximalMass_grid ν (ρ i) (hρ i) (K*b i*(ρ i)^d) (mul_nonneg (mul_nonneg hK (hb i).le) (Real.rpow_nonneg (hρ i).le _)) + (hcell i hi) s hs.le + dsimp only [QuadraticGauge.entry] + convert H using 1; ring) + refine ⟨C,hC,?_⟩ + intro U hU + have hfin : ediam U≠∞ := ne_top_of_le_ne_top (by norm_num) hU + by_cases hz : ediam U=0 + · have he : ν U=0 := (ediam_eq_zero_iff.mp hz).measure_zero ν + rw [he] + exact bot_le + · have hs : 0<(ediam U).toReal := ENNReal.toReal_pos hz hfin + have hm := (mass_le_maximalMass ν (ediam U).toReal U (by + rw [ENNReal.ofReal_toReal hfin])).trans (hbound _ hs) + have he := ENNReal.ofReal_le_ofReal hm + rw [ENNReal.ofReal_toReal (measure_ne_top ν U),ENNReal.ofReal_mul hC.le] at he + simpa only [Deterministic.diameterCost,ite_eq_right hfin] using he + + + +theorem hausdorff_pos_of_grid {ι : Type*} [Nonempty ι] (d : ℝ) (b ρ : ι→ℝ) + (hb : ∀i,0MeasurableSet.iUnion (fun _=>cell_measurable r p)) + + +def retained {ι X : Type*} (bad : ι→Set X) (E : Finset ι) : Set X := + {z | ∀i,i∉E → z∉bad i} + +lemma retained_measurable {ι X : Type*} [Countable ι] [MeasurableSpace X] + (bad : ι→Set X) (hbad : ∀i,MeasurableSet (bad i)) (E : Finset ι) : + MeasurableSet (retained bad E) := by + have he : retained bad E = ⋂i,⋂(_ : i∉E),(bad i)ᶜ := by ext z; simp [retained] + rw [he] + exact MeasurableSet.iInter (fun i=>MeasurableSet.iInter (fun _=>(hbad i).compl)) + +lemma exists_positive_retained {ι X : Type*} [Countable ι] [MeasurableSpace X] + (σ : Measure X) (bad : ι→Set X) (hfinite : ∀ᵐ z∂σ,{i | z∈bad i}.Finite) + (A : Set X) (hA : 0<σ A) : + ∃E : Finset ι,0<σ (A∩retained bad E) := by + have hc : ∀ᵐ z∂σ,z∈⋃E : Finset ι,retained bad E := by + filter_upwards [hfinite] with z hz + refine mem_iUnion.mpr ⟨hz.toFinset,?_⟩ + intro i hi hmem + exact hi (hz.mem_toFinset.mpr hmem) + by_contra! hh + have hzero : σ (A∩⋃E : Finset ι,retained bad E)=0 := by + rw [Set.inter_iUnion] + exact measure_iUnion_null_iff.mpr (fun E=>le_antisymm (hh E) bot_le) + have he : (A : Set X)=ᵐ[σ] (A∩⋃E : Finset ι,retained bad E : Set X) := by + filter_upwards [hc] with z hz + simp only [mem_inter_iff,hz,and_true] + exact hA.ne' ((measure_congr he).trans hzero) + +lemma retained_cell_bound {ι : Type*} (μ σ : Measure ℂ) (hσ : σ≤μ) + (ρ B : ι→ℝ) (E : Finset ι) (i : ι) (hi : i∉E) (p : ℤ×ℤ) : + (σ.restrict (retained (fun i=>badRegion μ (ρ i) (B i)) E)) (cell (ρ i) p) ≤ + ENNReal.ofReal (B i) := by + by_cases hbad : ENNReal.ofReal (B i)<μ (cell (ρ i) p) + · rw [Measure.restrict_apply (cell_measurable _ _)] + have he : cell (ρ i) p∩retained (fun i=>badRegion μ (ρ i) (B i)) E=∅ := by + apply eq_empty_iff_forall_notMem.mpr + intro z hz + exact hz.2 i hi (mem_iUnion.mpr ⟨p,mem_iUnion.mpr ⟨hbad,hz.1⟩⟩) + rw [he,measure_empty] + exact bot_le + · exact (Measure.restrict_le_self.trans hσ _).trans (le_of_not_gt hbad) + + + +theorem hausdorff_pos_of_finitely_bad {ι : Type*} [Nonempty ι] [Countable ι] + (d : ℝ) (b ρ : ι→ℝ) (hb : ∀i,0badRegion μ (ρ i) (K*b i*(ρ i)^d) + obtain ⟨E,hE⟩ := exists_positive_retained σ bad hfinite A hA + let ν := σ.restrict (retained bad E) + have hνA : 0<ν A := by + dsimp only [ν] + rw [Measure.restrict_apply' (retained_measurable bad (fun i=>badRegion_measurable _ _ _) E)] + exact hE + exact hausdorff_pos_of_grid d b ρ hb hρ E ν K hK + (fun i hi p=>retained_cell_bound μ σ hσ ρ (fun j=>K*b j*(ρ j)^d) E i hi p) A hνA + + + +theorem ae_ae_finite_bad {Ω X ι : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + [Countable ι] (P : Measure Ω) (μ : Ω→Measure X) (bad : ι→Ω→Set X) + (hm : ∀i,AEMeasurable (fun ω=>μ ω (bad i ω)) P) + (hsum : (∑'i,∫⁻ω,μ ω (bad i ω)∂P)≠∞) : + ∀ᵐ ω∂P,∀ᵐ z∂μ ω,{i | z∈bad i ω}.Finite := by + have h : (∫⁻ω,∑'i,μ ω (bad i ω)∂P)≠∞ := by rwa [lintegral_tsum hm] + filter_upwards [ae_lt_top' (AEMeasurable.tsum hm) h] with ω hω + exact ae_finite_setOfPred_mem hω.ne + +end SLEExactGauge.PlanarGrid +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal NNReal Topology Classical +namespace SLEExactGauge.PlanarGrid + + + +def testedBadCell {Ω ι : Type*} [MeasurableSpace Ω] + (μ : Ω→Measure ℂ) (ρ B : ι→ℝ) (good : Set ι) + (j : ι×(ℤ×ℤ)) (ω : Ω) : Set ℂ := + if j.1∈good ∧ ENNReal.ofReal (B j.1) < μ ω (cell (ρ j.1) j.2) + then cell (ρ j.1) j.2 else ∅ + +lemma testedBadCell_mass {Ω ι : Type*} [MeasurableSpace Ω] + (μ : Ω→Measure ℂ) (ρ B : ι→ℝ) (good : Set ι) + (j : ι×(ℤ×ℤ)) (ω : Ω) : + μ ω (testedBadCell μ ρ B good j ω)= + if j.1∈good then + {ω | ENNReal.ofReal (B j.1) < μ ω (cell (ρ j.1) j.2)}.indicator + (fun ω=>μ ω (cell (ρ j.1) j.2)) ω else 0 := by + by_cases hg : j.1∈good <;> + by_cases hb : ENNReal.ofReal (B j.1) < μ ω (cell (ρ j.1) j.2) <;> + simp [testedBadCell,hg,hb] + + + +theorem ae_finitely_bad_of_spatial_tails {Ω ι : Type*} + [MeasurableSpace Ω] [Countable ι] + (P : Measure Ω) (μ : Ω→Measure ℂ) (ν : Measure ℂ) [IsFiniteMeasure ν] + (ρ B : ι→ℝ) (hρ : ∀i,0 < ρ i) + (hm : ∀i p,Measurable (fun ω=>μ ω (cell (ρ i) p))) + (good : Set ι) (hgood : goodᶜ.Finite) + (C : ℝ≥0∞) (hC : C≠∞) (tail : ι→ℝ≥0∞) (htail : (∑'i,tail i)≠∞) + (hbound : ∀i∈good,∀p : ℤ×ℤ, + (∫⁻ω,{ω | ENNReal.ofReal (B i) < μ ω (cell (ρ i) p)}.indicator + (fun ω=>μ ω (cell (ρ i) p)) ω∂P) ≤ C*ν (cell (ρ i) p)*tail i) : + ∀ᵐ ω∂P,∀ᵐ z∂μ ω,{i | z∈badRegion (μ ω) (ρ i) (B i)}.Finite := by + let bad := testedBadCell μ ρ B good + have hbad (j : ι×(ℤ×ℤ)) : + Measurable (fun ω=>μ ω (bad j ω)) := by + simp only [bad,testedBadCell_mass] + by_cases hj : j.1∈good + · simp only [ite_eq_left hj] + exact (hm j.1 j.2).indicator (measurableSet_lt measurable_const (hm j.1 j.2)) + · simp only [ite_eq_right hj] + exact measurable_const + have hi (j : ι×(ℤ×ℤ)) : (∫⁻ω,μ ω (bad j ω)∂P) ≤ + C*ν (cell (ρ j.1) j.2)*tail j.1 := by + simp only [bad,testedBadCell_mass] + by_cases hj : j.1∈good + · simp only [ite_eq_left hj] + exact hbound j.1 hj j.2 + · simp only [ite_eq_right hj,lintegral_zero] + exact bot_le + have hsum : (∑'j : ι×(ℤ×ℤ),∫⁻ω,μ ω (bad j ω)∂P)≠∞ := by + apply ne_top_of_le_ne_top (show (C*(4*ν univ))*(∑'i,tail i)≠∞ from by finiteness) + calc + _≤∑'j : ι×(ℤ×ℤ),C*ν (cell (ρ j.1) j.2)*tail j.1 := ENNReal.tsum_le_tsum hi + _=∑'i,C*(∑'p : ℤ×ℤ,ν (cell (ρ i) p))*tail i := by + rw [ENNReal.tsum_prod'] + simp_rw [ENNReal.tsum_mul_right,ENNReal.tsum_mul_left] + _≤∑'i,C*(4*ν univ)*tail i := by + apply ENNReal.tsum_le_tsum + intro i + gcongr + exact tsum_cell_mass ν (ρ i) (hρ i) + _=(C*(4*ν univ))*(∑'i,tail i) := ENNReal.tsum_mul_left + filter_upwards [ae_ae_finite_bad P μ bad (fun j=>(hbad j).aemeasurable) hsum] with ω hω + filter_upwards [hω] with z hz + apply (hgood.union (hz.image Prod.fst)).subset + intro i hi + by_cases hg : i∈good + · right + obtain ⟨p,hp⟩ := mem_iUnion.mp hi + obtain ⟨hbad,hcell⟩ := mem_iUnion.mp hp + refine ⟨(i,p),?_,rfl⟩ + change z∈testedBadCell μ ρ B good (i,p) ω + simp only [testedBadCell,ite_eq_left (And.intro hg hbad)] + exact hcell + · exact Or.inl hg + +end SLEExactGauge.PlanarGrid +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/PostStopPotential.lean b/lean/OAI/Probability/SLEGauge/PostStopPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b32cb8c5d9f3bbdc447fb8212e86ba80631ddd0 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/PostStopPotential.lean @@ -0,0 +1,505 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RandomRestrictionKernel + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions + +lemma lintegral_finite_stop_guard (W : Measure GDriver) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + (M : GDriver→Measure UpperPlane) (A : Set GDriver) (f : UpperPlane→ℝ≥0∞) : + (∫⁻b in A,∫⁻z,f z∂(if S b=∞ then 0 else M b)∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂M b∂W := by + have hfinite : MeasurableSet {b | S b≠∞} := + (hS.measurable' (measurableSet_singleton ∞)).compl + rw [inter_comm A {b | S b≠∞},←Measure.restrict_restrict hfinite,←lintegral_indicator hfinite] + apply lintegral_congr + intro b + by_cases hb : S b=∞ <;> simp [hb] + + + +theorem recoveredPostStop_potential (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass a ha s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(afterStopFiltration hS) t] A) + {f : UpperPlane→ℝ≥0∞} (hf : Measurable f) : + let ν := recoveredPostStop a ha s c hc S + (∫⁻b in A,∫⁻z,f z∂ν ∞ b∂W)= + (∫⁻b in A,∫⁻z,f z∂ν t b∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂(survivingKernel a ha ((S b).toNNReal+t) b).restrict + {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}∂W := by + intro ν + let := hW.isGaussianProcess.isProbabilityMeasure + let μ := recoveredMass a ha s c hc + let T := shiftStop S t + have hT := shiftStop_isStoppingTime hS t + let R := stoppedSurvivingKernel a ha T hT + have hcond (H : GDriver×UpperPlane→ℝ≥0∞) + (hH : Measurable[hT.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H) : + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂W)=(∫⁻b,∫⁻z,H (b,z)∂μ (T b) b∂W)+ + ∫⁻b,∫⁻z,H (b,z)∂ R b∂W := by + have hi := (recoveredMass_all_stopping a ha W hW s c hc hs hsum hconv T hT).2.2.2.2 H hH + have hn : Measurable H := hH.mono (prod_sigma_le hT.measurableSpace_le _) le_rfl + have he (b : GDriver) : (∫⁻z,H (b,z)∂ R b)= + ∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (T b) b z.1)∂upperArea := by + rw [stoppedSurvivingKernel_apply] + exact (lintegral_withDensity_eq_lintegral_mul upperArea + (stoppedSurvivingGreen_spatial_measurable a ha T hT b).ennreal_ofReal + (hn.comp (measurable_const.prodMk measurable_id))).trans + (lintegral_congr fun _ => mul_comm _ _) + simpa only [he,μ] using hi + let D : GDriver→Set UpperPlane := fun b => {z | alive a b.1 (S b).toNNReal z.1} + have hD : MeasurableSet[hT.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] + {p : GDriver×UpperPlane | p.2∈D p.1} := + (prod_sigma_le (measurableSpace_le_shiftStop hS t) _) _ (measurableSet_alive_atStop_raw a ha hS) + have hB : MeasurableSet[hT.measurableSpace] (A∩{b | S b≠∞}) := + hA.inter ((measurableSpace_le_shiftStop hS t) _ (hS.measurable (measurableSet_singleton ∞)).compl) + have h := conditional_random_restrict_on hT.measurableSpace_le W (μ ∞) + (fun b => μ (T b) b) R hcond D hD hB hf + have he (v : ℝ≥0∞) : (∫⁻b in A,∫⁻z,f z∂ν v b∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂(μ (S b+v) b).restrict (D b)∂W := + lintegral_finite_stop_guard W hS _ A f + rw [he,he] + simp only [add_top] + refine h.trans (congrArg (fun x => (∫⁻b in A∩{b | S b≠∞}, + ∫⁻z,f z∂(μ (T b) b).restrict (D b)∂W)+x) ?_) + apply setLIntegral_congr_fun (hT.measurableSpace_le _ hB) + intro b hb + have hbt : T b≠∞ := ENNReal.add_ne_top.mpr ⟨hb.2,ENNReal.coe_ne_top⟩ + have heR : R b=survivingKernel a ha ((S b).toNNReal+t) b := by + rw [stoppedSurvivingKernel_apply,survivingKernel_apply] + congr 1 + funext z + simp only [stoppedSurvivingGreen,T,shiftStop,ite_eq_right (show S b+(t:ℝ≥0∞)≠∞ from hbt), + ENNReal.toNNReal_add hb.2 ENNReal.coe_ne_top,ENNReal.toNNReal_coe] + change (∫⁻z,f z∂(R b).restrict (D b))=_ + rw [heR] + + +theorem recoveredRestart_potential (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass a ha s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(afterStopFiltration hS) t] A) + {f : UpperPlane→ℝ≥0∞} (hf : Measurable f) : + let ν := recoveredRestart a ha s c hc S + (∫⁻b in A,∫⁻z,f z∂ν ∞ b∂W)= + (∫⁻b in A,∫⁻z,f z∂ν t b∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂(survivingKernel a ha ((S b).toNNReal+t) b).restrict + {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}∂W := by + intro ν + have he (v : ℝ≥0∞) : (∫⁻b in A,∫⁻z,f z∂ν v b∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (recoveredMass a ha s c hc v (restartAt S b))∂W := + lintegral_finite_stop_guard W hS _ A f + rw [he,he] + exact recoveredMass_restarted_potential a ha W hW s c hc hs hsum hconv hS hA hf + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology CompactlySupported +namespace SLEExactGauge.MassVersions +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +lemma measure_eq_of_determiningTests (μ ν : Measure X) + [μ.Regular] [ν.Regular] + (he : ∀ i, (∫x, determiningTests i x ∂μ) = ∫x, determiningTests i x ∂ν) : + μ=ν := by + let L : ℕ → (C_c(X,ℝ) →ₚ[ℝ] ℝ) := fun n => + if n%2=0 then CompactlySupportedContinuousMap.integralPositiveLinearMap μ + else CompactlySupportedContinuousMap.integralPositiveLinearMap ν + have hc : TestConverges L := by + intro i + refine ⟨∫x, determiningTests i x ∂μ,?_⟩ + have hh (n : ℕ) : L n (determiningTests i) = ∫x, determiningTests i x ∂μ := by + dsimp only [L] + split_ifs + · rfl + · exact (he i).symm + simpa only [hh] using (tendsto_const_nhds : Tendsto + (fun _ : ℕ => ∫x, determiningTests i x ∂μ) atTop (𝓝 (∫x, determiningTests i x ∂μ))) + have hmul : Tendsto (fun n : ℕ => 2*n) atTop atTop := by + apply tendsto_atTop.mpr + intro N + filter_upwards [eventually_ge_atTop N] with n hn + omega + have hadd : Tendsto (fun n : ℕ => 2*n+1) atTop atTop := + (tendsto_add_atTop_nat 1).comp hmul + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + have heven := (tendsto_radonLimit L hc f).comp hmul + have hodd := (tendsto_radonLimit L hc f).comp hadd + have hem (n : ℕ) : L (2*n) f=∫x,f x∂μ := by simp [L] + have hov (n : ℕ) : L (2*n+1) f=∫x,f x∂ν := by simp [L] + simp only [Function.comp_def,hem] at heven + simp only [Function.comp_def,hov] at hodd + exact (tendsto_nhds_unique tendsto_const_nhds heven).trans + (tendsto_nhds_unique tendsto_const_nhds hodd).symm + + +theorem ae_all_measure_eq_of_test_eq {Ω I : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (μ ν : I → Ω → Measure X) + [∀ t ω, (μ t ω).Regular] [∀ t ω, (ν t ω).Regular] + (he : ∀ i, ∀ᵐ ω ∂P, ∀ t, (∫x,determiningTests i x∂μ t ω) = + ∫x,determiningTests i x∂ν t ω) : + ∀ᵐ ω ∂P, ∀ t, μ t ω=ν t ω := by + filter_upwards [ae_all_iff.mpr he] with ω hω t + exact measure_eq_of_determiningTests _ _ (fun i => hω i t) + + +def positiveTest (f : C_c(X,ℝ)) : C_c(X,ℝ) := + ⟨⟨fun x => max (f x) 0, f.continuous.max continuous_const⟩, + f.hasCompactSupport.sup (.zero)⟩ + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + [MeasurableSpace X] [BorelSpace X] in +lemma positiveTest_nonneg [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + (f : C_c(X,ℝ)) (x : X) : 0≤positiveTest f x := + le_max_right _ _ + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + [MeasurableSpace X] [BorelSpace X] in +lemma positiveTest_sub [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + (f : C_c(X,ℝ)) (x : X) : + positiveTest f x-positiveTest (-f) x=f x := by + change max (f x) 0-max (-(f x)) 0=f x + exact posPart_sub_negPart (f x) + +lemma integral_positiveTest_sub (f : C_c(X,ℝ)) (μ : Measure X) + [IsFiniteMeasureOnCompacts μ] : + (∫x,positiveTest f x∂μ)-(∫x,positiveTest (-f) x∂μ)=∫x,f x∂μ := by + rw [← integral_sub (positiveTest f).integrable (positiveTest (-f)).integrable] + simp only [positiveTest_sub] + +end SLEExactGauge.MassVersions +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.MeshEnergy + + +def grid (T : ℝ≥0) (n i : ℕ) : ℝ≥0 := T * i / ((n:ℝ≥0)+1) + +@[simp] lemma grid_zero (T : ℝ≥0) (n : ℕ) : grid T n 0=0 := by simp [grid] + +@[simp] lemma grid_last (T : ℝ≥0) (n : ℕ) : grid T n (n+1)=T := by + have h : (n:ℝ≥0)+1≠0 := ne_of_gt (by positivity) + simp [grid,Nat.cast_add,Nat.cast_one,h] + +lemma grid_mono (T : ℝ≥0) (n : ℕ) : Monotone (grid T n) := by + intro i j hij + dsimp [grid] + gcongr + +lemma grid_mem (T : ℝ≥0) (n i : ℕ) (hi : i≤n+1) : grid T n i∈Icc 0 T := + ⟨zero_le, (grid_mono T n hi).trans_eq (grid_last T n)⟩ + +lemma dist_grid_succ (T : ℝ≥0) (n i : ℕ) : + dist (grid T n (i+1)) (grid T n i) = (T:ℝ)/((n:ℝ)+1) := by + rw [NNReal.dist_eq] + simp only [grid,NNReal.coe_div,NNReal.coe_mul,NNReal.coe_natCast,NNReal.coe_add, + NNReal.coe_one,Nat.cast_add,Nat.cast_one] + have he : (T:ℝ)*((i:ℝ)+1)/((n:ℝ)+1)-T*i/((n:ℝ)+1)=T/((n:ℝ)+1) := by ring + rw [he,abs_of_nonneg (by positivity)] + +lemma tendsto_mesh (T : ℝ≥0) : + Tendsto (fun n : ℕ => (T:ℝ)/((n:ℝ)+1)) atTop (𝓝 0) := by + simpa [div_eq_mul_inv] using + (tendsto_const_nhds.mul (tendsto_one_div_add_atTop_nhds_zero_nat : + Tendsto (fun n : ℕ => 1/((n:ℝ)+1)) atTop (𝓝 0))) + + +def energy (M : ℝ≥0 → ℝ) (T : ℝ≥0) (n : ℕ) : ℝ := + ∑ i ∈ Finset.range (n+1), (M (grid T n (i+1))-M (grid T n i))^2 + +lemma energy_nonneg (M : ℝ≥0 → ℝ) (T : ℝ≥0) (n : ℕ) : 0≤energy M T n := + Finset.sum_nonneg fun _ _ => sq_nonneg _ + + +lemma energy_le (M C : ℝ≥0 → ℝ) (T : ℝ≥0) + (hcontrol : ∀ s t, s≤t → t≤T → |M t-M s|≤C t-C s) (n : ℕ) : + energy M T n ≤ (C T-C 0)^2 := by + let A : ℕ → ℝ := fun i => C (grid T n (i+1))-C (grid T n i) + have ha (i : ℕ) (hi : i∈Finset.range (n+1)) : + |M (grid T n (i+1))-M (grid T n i)|≤A i := + hcontrol _ _ (grid_mono T n (Nat.le_succ _)) + (grid_mem T n (i+1) (by simpa using Finset.mem_range.mp hi)).2 + have han (i : ℕ) (hi : i∈Finset.range (n+1)) : 0≤A i := + (abs_nonneg _).trans (ha i hi) + calc + energy M T n ≤ ∑ i ∈ Finset.range (n+1), (A i)^2 := by + apply Finset.sum_le_sum + intro i hi + calc + _ = |M (grid T n (i+1))-M (grid T n i)|^2 := (sq_abs _).symm + _ ≤ (A i)^2 := (sq_le_sq₀ (abs_nonneg _) (han i hi)).mpr (ha i hi) + _ ≤ (∑ i ∈ Finset.range (n+1), A i)^2 := Finset.sum_sq_le_sq_sum_of_nonneg han + _ = (C T-C 0)^2 := by + rw [show (∑ i ∈ Finset.range (n+1), A i)=C (grid T n (n+1))-C (grid T n 0) from + Finset.sum_range_sub (fun i => C (grid T n i)) (n+1)] + simp + + +theorem tendsto_energy_zero (M C : ℝ≥0 → ℝ) (T : ℝ≥0) + (hc : ContinuousOn C (Icc 0 T)) + (hcontrol : ∀ s t, s≤t → t≤T → |M t-M s|≤C t-C s) : + Tendsto (energy M T) atTop (𝓝 0) := by + let V := C T-C 0 + have hv : 0≤V := (abs_nonneg _).trans (hcontrol 0 T (zero_le) le_rfl) + have huc := isCompact_Icc.uniformContinuousOn_of_continuous hc + apply Metric.tendsto_atTop.mpr + intro ε hε + have hη : 0<ε/(V+1) := div_pos hε (by linarith) + obtain ⟨δ,hδ,hd⟩ := Metric.uniformContinuousOn_iff.mp huc (ε/(V+1)) hη + obtain ⟨N,hN⟩ := eventually_atTop.mp ((tendsto_mesh T).eventually (gt_mem_nhds hδ)) + refine ⟨N,fun n hn => ?_⟩ + let A : ℕ → ℝ := fun i => C (grid T n (i+1))-C (grid T n i) + have ha (i : ℕ) (hi : i∈Finset.range (n+1)) : + |M (grid T n (i+1))-M (grid T n i)|≤A i := + hcontrol _ _ (grid_mono T n (Nat.le_succ _)) + (grid_mem T n (i+1) (by simpa using Finset.mem_range.mp hi)).2 + have hb (i : ℕ) (hi : i∈Finset.range (n+1)) : A i<ε/(V+1) := by + have hi' : i C (grid T n i)) (n+1)] + simp [V] + rw [Real.dist_eq,sub_zero,abs_of_nonneg (energy_nonneg _ _ _)] + refine he.trans_lt ?_ + apply (div_mul_eq_mul_div _ _ _).trans_lt + exact (div_lt_iff₀ (by linarith : 0 f z-g x*z) (f' := fun z => g z-g x) + (C := (K:ℝ)*|y-x|) + (fun z _ => (by + convert! ((hd z).sub ((hasDerivAt_id z).const_mul (g x))).hasDerivWithinAt using 1 + simp)) + (fun z hz => (hg.norm_sub_le z x).trans (mul_le_mul_of_nonneg_left + (norm_sub_le_of_mem_segment (by simpa [segment_eq_uIcc] using hz)) K.2)) + left_mem_uIcc right_mem_uIcc + have he : f y-g x*y-(f x-g x*x)=f y-f x-g x*(y-x) := by ring + calc + _ ≤ (K:ℝ) * |y-x| * |y-x| := by simpa only [Real.norm_eq_abs,he] using h + _ = _ := by rw [mul_assoc, ← pow_two, sq_abs] + +lemma lipschitz_of_deriv_bound (f g : ℝ → ℝ) (hd : ∀ x, HasDerivAt f (g x) x) + {L : ℝ≥0} (hg : ∀ x, |g x|≤L) : LipschitzWith L f := by + apply lipschitzWith_of_nnnorm_deriv_le (fun x => (hd x).differentiableAt) + intro x + change |deriv f x|≤(L:ℝ) + rw [(hd x).deriv] + exact hg x + +lemma remainder_le_abs (f g : ℝ → ℝ) (hd : ∀ x, HasDerivAt f (g x) x) + {L : ℝ≥0} (hg : ∀ x, |g x|≤L) (x y : ℝ) : + |f y-f x-g x*(y-x)|≤(2*(L:ℝ))*|y-x| := by + have hf := (lipschitz_of_deriv_bound f g hd hg).norm_sub_le y x + calc + _ ≤ |f y-f x|+|g x*(y-x)| := abs_sub _ _ + _ ≤ L*|y-x|+L*|y-x| := by + rw [abs_mul] + exact add_le_add hf (mul_le_mul_of_nonneg_right (hg x) (abs_nonneg _)) + _ = _ := by ring + + +def error (f g : ℝ → ℝ) (M : ℝ≥0 → ℝ) (T : ℝ≥0) (n : ℕ) : ℝ := + f (M T)-f (M 0) - ∑ i ∈ Finset.range (n+1), + g (M (grid T n i)) * (M (grid T n (i+1))-M (grid T n i)) + +lemma error_eq_sum (f g : ℝ → ℝ) (M : ℝ≥0 → ℝ) (T : ℝ≥0) (n : ℕ) : + error f g M T n = ∑ i ∈ Finset.range (n+1), + (f (M (grid T n (i+1)))-f (M (grid T n i)) - + g (M (grid T n i)) * (M (grid T n (i+1))-M (grid T n i))) := by + rw [Finset.sum_sub_distrib, Finset.sum_range_sub (fun i => f (M (grid T n i))) (n+1)] + simp [error] + +lemma abs_error_le_energy (f g : ℝ → ℝ) (hd : ∀ x, HasDerivAt f (g x) x) + {K : ℝ≥0} (hg : LipschitzWith K g) (M : ℝ≥0 → ℝ) (T : ℝ≥0) (n : ℕ) : + |error f g M T n|≤(K:ℝ)*energy M T n := by + rw [error_eq_sum] + calc + _ ≤ ∑ i ∈ Finset.range (n+1), |f (M (grid T n (i+1)))-f (M (grid T n i)) - + g (M (grid T n i)) * (M (grid T n (i+1))-M (grid T n i))| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i ∈ Finset.range (n+1), (K:ℝ) * (M (grid T n (i+1))-M (grid T n i))^2 := + Finset.sum_le_sum (fun i _ => remainder_le_sq f g hd hg _ _) + _ = _ := by rw [← Finset.mul_sum]; rfl + +lemma abs_error_le_variation (f g : ℝ → ℝ) (hd : ∀ x, HasDerivAt f (g x) x) + {L : ℝ≥0} (hg : ∀ x, |g x|≤L) (M C : ℝ≥0 → ℝ) (T : ℝ≥0) + (hcontrol : ∀ s t, s≤t → t≤T → |M t-M s|≤C t-C s) (n : ℕ) : + |error f g M T n|≤(2*(L:ℝ))*(C T-C 0) := by + rw [error_eq_sum] + calc + _ ≤ ∑ i ∈ Finset.range (n+1), |f (M (grid T n (i+1)))-f (M (grid T n i)) - + g (M (grid T n i)) * (M (grid T n (i+1))-M (grid T n i))| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i ∈ Finset.range (n+1), (2*(L:ℝ)) * (C (grid T n (i+1))-C (grid T n i)) := by + apply Finset.sum_le_sum + intro i hi + exact (remainder_le_abs f g hd hg _ _).trans (mul_le_mul_of_nonneg_left + (hcontrol _ _ (grid_mono T n (Nat.le_succ _)) + (grid_mem T n (i+1) (by simpa using Finset.mem_range.mp hi)).2) (by positivity)) + _ = _ := by + rw [← Finset.mul_sum, Finset.sum_range_sub (fun i => C (grid T n i)) (n+1)] + simp + +lemma tendsto_error_zero (f g : ℝ → ℝ) (hd : ∀ x, HasDerivAt f (g x) x) + {K : ℝ≥0} (hg : LipschitzWith K g) (M C : ℝ≥0 → ℝ) (T : ℝ≥0) + (hc : ContinuousOn C (Icc 0 T)) + (hcontrol : ∀ s t, s≤t → t≤T → |M t-M s|≤C t-C s) : + Tendsto (error f g M T) atTop (𝓝 0) := by + apply squeeze_zero_norm (fun n => ?_) + (show Tendsto (fun n => (K:ℝ)*energy M T n) atTop (𝓝 0) by + simpa using (tendsto_energy_zero M C T hc hcontrol).const_mul (K:ℝ)) + exact abs_error_le_energy f g hd hg M T n + + + +def detector (x : ℝ) : ℝ := Real.sqrt (1+x^2)-1 + +def detectorDeriv (x : ℝ) : ℝ := x / Real.sqrt (1+x^2) + +lemma one_le_root (x : ℝ) : 1≤Real.sqrt (1+x^2) := + Real.one_le_sqrt.mpr (by nlinarith [sq_nonneg x]) + +lemma hasDerivAt_root (x : ℝ) : HasDerivAt (fun x : ℝ => Real.sqrt (1+x^2)) + (x/Real.sqrt (1+x^2)) x := by + have h : 1+x^2≠0 := ne_of_gt (by positivity) + convert! (((hasDerivAt_id x).pow 2).const_add 1).sqrt h using 1 + dsimp + ring + +lemma hasDerivAt_detector (x : ℝ) : HasDerivAt detector (detectorDeriv x) x := + (hasDerivAt_root x).sub_const 1 + +lemma hasDerivAt_detectorDeriv (x : ℝ) : + HasDerivAt detectorDeriv (1/(Real.sqrt (1+x^2))^3) x := by + have hp : 0 (hasDerivAt_detectorDeriv x).differentiableAt) + intro x + change |deriv detectorDeriv x|≤(1:ℝ) + rw [(hasDerivAt_detectorDeriv x).deriv,abs_of_nonneg (by positivity)] + have h := one_le_root x + exact (div_le_one (by positivity)).mpr (one_le_pow₀ h) + +@[simp] lemma detector_zero : detector 0=0 := by simp [detector] + +lemma detector_nonneg (x : ℝ) : 0≤detector x := sub_nonneg.mpr (one_le_root x) + +@[simp] lemma detector_eq_zero_iff (x : ℝ) : detector x=0 ↔ x=0 := by + constructor + · intro h + have hs := Real.sq_sqrt (show 0≤1+x^2 by positivity) + have he : Real.sqrt (1+x^2)=1 := sub_eq_zero.mp h + rw [he] at hs + nlinarith [sq_nonneg x] + · rintro rfl + exact detector_zero + +lemma abs_detector_le (x : ℝ) : |detector x|≤|x| := by + simpa using lipschitz_detector.norm_sub_le x 0 + +end SLEExactGauge.TaylorVariation +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ProductGenerators.lean b/lean/OAI/Probability/SLEGauge/ProductGenerators.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc724f40cb64405016585dc1e3f40727841f17a6 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ProductGenerators.lean @@ -0,0 +1,456 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadialFactors + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +namespace ExactSLECalculus +variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +lemma normalized_product_generator (s : Finset ι) (f : ι → E → ℝ) (x A e : E) + (hf : ∀ i ∈ s, ContDiffAt ℝ 2 (f i) x) (hp : ∀ i ∈ s, f i x ≠ 0) : + N (fun y => ∏ i ∈ s, f i y) e x / (∏ i ∈ s, f i x) = ∑ i ∈ s, N (f i) e x / f i x ∧ + L (fun y => ∏ i ∈ s, f i y) A e x / (∏ i ∈ s, f i x) = + (∑ i ∈ s, L (f i) A e x / f i x) + + ((∑ i ∈ s, N (f i) e x / f i x)^2 - ∑ i ∈ s, (N (f i) e x / f i x)^2)/2 := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + have hfi := hf i (Finset.mem_insert_self _ _) + have hfs : ∀ j∈s, ContDiffAt ℝ 2 (f j) x := fun j hj => hf j (Finset.mem_insert_of_mem hj) + have hpi := hp i (Finset.mem_insert_self _ _) + have hps : ∀ j∈s, f j x ≠ 0 := fun j hj => hp j (Finset.mem_insert_of_mem hj) + have hs := contDiffAt_prod hfs + have hnz : (∏ j∈s, f j x) ≠ 0 := Finset.prod_ne_zero_iff.mpr hps + obtain ⟨ihN,ihL⟩ := ih hfs hps + simp only [Finset.prod_insert hi,Finset.sum_insert hi] + rw [N_mul (hfi.differentiableAt (by norm_num)) (hs.differentiableAt (by norm_num)),L_mul hfi hs] + constructor + · calc + _ = N (f i) e x / f i x + N (fun y => ∏j∈s,f j y) e x / (∏j∈s,f j x) := by field_simp; ring + _ = _ := by rw [ihN] + · have he : (f i x * L (fun y => ∏j∈s,f j y) A e x + + (∏j∈s,f j x)*L (f i) A e x + N (f i) e x*N (fun y => ∏j∈s,f j y) e x) / + (f i x*(∏j∈s,f j x)) = + L (f i) A e x/f i x + L (fun y => ∏j∈s,f j y) A e x/(∏j∈s,f j x) + + (N (f i) e x/f i x)*(N (fun y => ∏j∈s,f j y) e x/(∏j∈s,f j x)) := by field_simp; ring + rw [he,ihN,ihL] + ring +end ExactSLECalculus + +namespace ExactSLECalculus +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] +lemma N_comp_clm (c : E →L[ℝ] F) {f : F → ℝ} {x e : E} + (hf : DifferentiableAt ℝ f (c x)) : + N (f ∘ c) e x = N f (c e) (c x) := by + rw [N,(hf.hasFDerivAt.comp x c.hasFDerivAt).fderiv] + rfl +lemma L_comp_clm (c : E →L[ℝ] F) {f : F → ℝ} {x A e : E} + (hf : ContDiffAt ℝ 2 f (c x)) : + L (f ∘ c) A e x = L f (c A) (c e) (c x) := by + have hfd := hf.differentiableAt (by norm_num) + have heq : N (f ∘ c) e =ᶠ[𝓝 x] (N f (c e) ∘ c) := by + filter_upwards [c.continuous.continuousAt.preimage_mem_nhds (hf.eventually (by norm_num))] with y hy + change ContDiffAt ℝ 2 f (c y) at hy + exact N_comp_clm c (hy.differentiableAt (by norm_num)) + unfold L + rw [N,heq.fderiv_eq,((N_differentiableAt (e := c e) hf).hasFDerivAt.comp x c.hasFDerivAt).fderiv, + (hfd.hasFDerivAt.comp x c.hasFDerivAt).fderiv] + rfl +end ExactSLECalculus + +namespace ExactSLEFiniteTilt +lemma pair_noise_form {a δ₁ δ₂ D₁ D₂ V₁ V₂ : ℝ} + (hδ₁ : 0<δ₁) (hδ₂ : 0<δ₂) (hD₁ : 0≤D₁) (hD₂ : 0≤D₂) + (hV₁ : 0 physicalDrift a (v i) +def multiNoise (m : ℕ) : Fin m → State := fun _ => noise +noncomputable def regularizedProduct {m : ℕ} (s : Finset (Fin m)) + (a : ℝ) (cap σ off : Fin m → ℝ) (v : Fin m → State) : ℝ := + ∏i∈s, physicalRegularized a (cap i) (σ i) (off i) (v i) + +theorem regularized_product_drift {m : ℕ} (s : Finset (Fin m)) {a ε : ℝ} + (ha : 1/4 physicalRegularized a (cap i) (σ i) (off i) (w i) + have hF (i) (hi : i∈s) : ContDiffAt ℝ 2 (F i) v := by + exact (physicalRegularized_smooth a (cap i) (σ i) (off i) (v i) (hY i hi)).comp v + (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State).contDiff.contDiffAt + have hpos (i) (hi : i∈s) : 0 ∏i∈s,F i w) (multiDrift a v) (multiNoise m) v / (∏i∈s,F i v) ≤ _ + rw [(normalized_product_generator s F v (multiDrift a v) (multiNoise m) hF + (fun i hi => (hpos i hi).ne')).2] + have habs := sum_generator_absorption s + (fun i => L (F i) (multiDrift a v) (multiNoise m) v / F i v) + (fun i => N (F i) (multiNoise m) v / F i v) + (fun i => regD a (physicalDelta a (cap i) (σ i) (off i) (v i)) (physicalTheta (v i))*(physicalV (v i))^2) + (fun i => regC a*physicalDelta a (cap i) (σ i) (off i) (v i)*(physicalV (v i))^2) + (fun i j => (physicalDelta a (cap i) (σ i) (off i) (v i)* + physicalDelta a (cap j) (σ j) (off j) (v j))^(-regM a)*physicalV (v i)*physicalV (v j)) + (regK a/2) (regYoungC a ε) ε + (fun i hi => mul_nonneg (hD i hi) (sq_nonneg _)) hsize + refine le_trans (habs ?_ ?_) ?_ + · intro i hi + rw [hL i hi] + have h := (actual_regularized_factor ha (v i) (hY i hi) (hδ i hi) (hσ i hi)).2.1 + convert h using 1 + ring + · intro i hi j hj + have hjs := Finset.mem_of_mem_erase hj + rw [hN i hi,hN j hjs] + have h := actual_noise_pair ha hε (v i) (v j) (hY i hi) (hY j hjs) + (hδ i hi) (hδ j hjs) (hσ i hi) (hσ j hjs) + convert h using 1 + ring + · apply le_of_eq + congr 1 + simp only [mul_assoc,Finset.mul_sum] + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator +abbrev RegimeState (m : ℕ) := (Fin m → State) × ℝ +noncomputable def regimeDiscount {m : ℕ} (s : Finset (Fin m)) + (a ε : ℝ) (cap σ off : Fin m → ℝ) (v : Fin m → State) : ℝ := + regC a*(∑i∈s,physicalDelta a (cap i) (σ i) (off i) (v i)*(physicalV (v i))^2) + + regYoungC a ε/2*(∑i∈s,∑j∈s.erase i, + (physicalDelta a (cap i) (σ i) (off i) (v i)* + physicalDelta a (cap j) (σ j) (off j) (v j))^(-regM a)* + physicalV (v i)*physicalV (v j)) +noncomputable def discountedProduct {m : ℕ} (s : Finset (Fin m)) + (a : ℝ) (cap σ off : Fin m → ℝ) (v : RegimeState m) : ℝ := + Real.exp (-v.2)*regularizedProduct s a cap σ off v.1 +end ExactSLEGreen + +namespace ExactSLECalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +lemma discounted_generator {f : E → ℝ} {x A e : E} (r k : ℝ) + (hf : ContDiffAt ℝ 2 f x) : + L (fun y : E×ℝ => Real.exp (-y.2)*f y.1) (A,k) (e,0) (x,r) = + Real.exp (-r)*(L f A e x-k*f x) := by + let g : E×ℝ → ℝ := fun y => Real.exp (-y.2) + have hd (y : E×ℝ) : HasFDerivAt g + (Real.exp (-y.2) • (-ContinuousLinearMap.snd ℝ E ℝ)) y := by + exact (hasFDerivAt_snd (𝕜 := ℝ) (p := y)).neg.exp + have hn (y : E×ℝ) : N g (e,0) y = 0 := by + rw [N,(hd y).fderiv] + simp + have hl : L g (A,k) (e,0) (x,r) = -Real.exp (-r)*k := by + simp only [L,show N g (e,0) = (fun _ => 0) from funext hn,N_const,mul_zero,zero_add] + rw [(hd (x,r)).fderiv] + simp + have hgs : ContDiffAt ℝ 2 g (x,r) := contDiffAt_snd.neg.exp + have hfs : ContDiffAt ℝ 2 (fun y : E×ℝ => f y.1) (x,r) := hf.comp (x,r) contDiffAt_fst + rw [L_mul hgs hfs] + change g (x,r)*L (f ∘ ContinuousLinearMap.fst ℝ E ℝ) (A,k) (e,0) (x,r)+ + f x*L g (A,k) (e,0) (x,r)+N g (e,0) (x,r)*N (fun y : E×ℝ => f y.1) (e,0) (x,r) = _ + rw [L_comp_clm _ hf,hl,hn] + dsimp [g] + ring +end ExactSLECalculus + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator Metric +lemma physicalRegularized_smooth_infty (a cap σ off : ℝ) (v : State) (hv : 0 physicalRegularized a (cap i) (σ i) (off i) (w i) + have hF (i) (hi : i∈s) : ContDiffAt ℝ 2 (F i) v := + (physicalRegularized_smooth a (cap i) (σ i) (off i) (v i) (hY i hi)).comp v + (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State).contDiff.contDiffAt + have hpos (i) (hi : i∈s) : F i v≠0 := + (actual_regularized_factor ha (v i) (hY i hi) (hδ i hi) (hσ i hi)).1.ne' + have hP : regularizedProduct s a cap σ off v≠0 := Finset.prod_ne_zero_iff.mpr hpos + apply (div_left_inj' hP).mp + change L (fun w => ∏ i ∈ s, F i w) B (multiNoise m) v / (∏ i ∈ s, F i v) = + L (fun w => ∏ i ∈ s, F i w) (multiDrift a v) (multiNoise m) v / (∏ i ∈ s, F i v) + rw [(normalized_product_generator s F v B (multiNoise m) hF hpos).2, + (normalized_product_generator s F v (multiDrift a v) (multiNoise m) hF hpos).2] + congr 1 + apply Finset.sum_congr rfl + intro i hi + congr 1 + have hf := physicalRegularized_smooth a (cap i) (σ i) (off i) (v i) (hY i hi) + change L (physicalRegularized a (cap i) (σ i) (off i) ∘ (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State)) B _ v = _ + rw [L_comp_clm (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State) hf] + change _ = L (physicalRegularized a (cap i) (σ i) (off i) ∘ (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State)) (multiDrift a v) _ v + rw [L_comp_clm (ContinuousLinearMap.proj i : (Fin m → State) →L[ℝ] State) hf] + change L _ (B i) noise (v i) = L _ (physicalDrift a (v i)) noise (v i) + rw [hB i hi] +lemma discountedProduct_nonpos {m : ℕ} (s : Finset (Fin m)) {a ε : ℝ} + (ha : 1/4 Real.exp (-y.2)*regularizedProduct s a cap σ off y.1) + (B.1,B.2) (multiNoise m,0) (v.1,v.2) ≤ 0 + rw [discounted_generator _ _ hf,regularizedProduct_generator_agrees s ha cap σ off v.1 B.1 hY hδ hσ hB.2,hB.1] + have h := regularized_product_drift s ha hε hsize cap σ off v.1 hY hδ hσ + apply mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos _).le + exact sub_nonpos.mpr ((div_le_iff₀ h.1).mp h.2) + +noncomputable def regularizedHeightTurn (η : ℝ) (v : State) : ℝ := + Real.smoothTransition (4*Y v/η-1) +lemma regularizedHeightTurn_smooth (η : ℝ) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (regularizedHeightTurn η) := + Real.smoothTransition.contDiff.comp (((contDiff_const.mul Y.contDiff).div_const η).sub contDiff_const) +lemma regularizedHeightTurn_zero {η : ℝ} (hη : 0<η) (v : State) (hv : Y v≤η/4) : + regularizedHeightTurn η v=0 := by + apply Real.smoothTransition.zero_of_nonpos + rw [sub_nonpos,div_le_iff₀ hη] + linarith +lemma regularizedHeightTurn_one {η : ℝ} (hη : 0<η) (v : State) (hv : η/2≤Y v) : + regularizedHeightTurn η v=1 := by + apply Real.smoothTransition.one_of_one_le + rw [le_sub_iff_add_le,le_div_iff₀ hη] + linarith +lemma height_regularized_smooth (a η cap σ off : ℝ) (hη : 0<η) : + ContDiff ℝ (↑(⊤ : ℕ∞)) (fun v => regularizedHeightTurn η v*physicalRegularized a cap σ off v) := by + rw [contDiff_iff_contDiffAt] + intro v + by_cases hv : 0 Y (w.1 i)) := + Y.continuous.comp ((continuous_apply i).comp continuous_fst) + filter_upwards [hc.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hy)] with w hw + exact regularizedHeightTurn_one hη (w.1 i) hw.le + filter_upwards [(regimeBump m N).eventuallyEq_one_of_mem_ball hb, + (Filter.eventually_all_finset s).mpr hturn] with w hw htw + simp only [regimeCutoff,hw,Pi.one_apply,one_mul,discountedProduct,regularizedProduct] + congr 1 + apply Finset.prod_congr rfl + intro i hi + rw [htw i hi,one_mul] +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ProductIntegrability.lean b/lean/OAI/Probability/SLEGauge/ProductIntegrability.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf2b38865ad33bb0f0e2121e112d3ae9396cad13 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ProductIntegrability.lean @@ -0,0 +1,463 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.PhaseIntegrals + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory Set Filter +open scoped Classical NNReal ENNReal +lemma stopped_phaseProduct_integrable {m : ℕ} {a : ℝ} (ha : 1/4 (S b : WithTop ℝ≥0))) + (hsafe : ∀ b, (∃ i,(S b:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i)) → + ‖vectorState a η hη z (S b) b‖≤M ∧ ∀ i, + (S b:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i) → η≤Y (vectorState a η hη z (S b) b i)) : + Integrable (fun b => phaseProduct a cap U (actualPhase a z cap U (S b) b) (vectorState a η hη z (S b) b)) W := by + have ha0 : 0 actualPhase a z cap U (S b) b + have hm := (actualPhase_measurable a ha0 z hz cap U hc hr hu S hS).mono hS.measurableSpace_le le_rfl + have he : (fun b => phaseProduct a cap U (p b) (vectorState a η hη z (S b) b))= + fun b => ∑ q : PhaseVector m, if p b=q then phaseProduct a cap U q (vectorState a η hη z (S b) b) else 0 := by funext b; simp + rw [he] + apply integrable_finsetSum + intro q hq + by_cases hn : (phaseActive q).Nonempty + · have hi : Integrable (fun b => if p b=q then regularizedProduct (phaseActive q) a cap (phaseSigma a q) + (phaseOffset a U q) (vectorState a η hη z (S b) b) else 0) W := by + have hs : ∀ b∈{b | p b=q}, ‖vectorState a η hη z (S b) b‖≤M ∧ ∀ i∈phaseActive q, η≤Y (vectorState a η hη z (S b) b i) := by + intro b hb + have hmem (i) (hi : i∈phaseActive q) : (S b:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i) := by + have hp : p b i=1 ∨ p b i=2 := by rw [hb]; exact (phaseActive_mem q i).mp hi + have hab := levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b 0 (U i/2) le_rfl (by have := hu i; linarith) + have hbc := levelTime_mono a ha0 (z i) (hz i) (cap i) (hc i) (hr i) b (U i/2) (U i) (by have := hu i; linarith) (by have := hu i; linarith) + rcases hp with hp|hp + · exact (((phase_one_iff _ _ _ _ hab hbc).mp hp).2.trans_le hbc).le + · exact ((phase_two_iff _ _ _ _ hab hbc).mp hp).2.le + obtain ⟨i,hi⟩ := hn + have h := hsafe b ⟨i,hmem i hi⟩ + exact ⟨h.1,fun j hj => h.2 j (hmem j hj)⟩ + convert regularizedProduct_indicator_integrable (phaseActive q) a η hη M cap (phaseSigma a q) (phaseOffset a U q) z W S hS {b | p b=q} (hm (measurableSet_singleton q)) hs using 1 + all_goals first | rfl | (funext b; by_cases hb : p b=q <;> simp [hb]) + convert hi.const_mul (phaseConstant a U q) using 1 + all_goals first | rfl | (funext b; dsimp only [phaseProduct]; split_ifs <;> simp) + · have hq0 : phaseActive q=∅ := Finset.not_nonempty_iff_eq_empty.mp hn + simp only [phaseProduct,hq0,regularizedProduct,Finset.prod_empty,mul_one] + have hi : Integrable (fun _ : ExactSLEGenerator.Driver => phaseConstant a U q) W := integrable_const _ + convert hi.indicator (hm (measurableSet_singleton q)) using 1 + all_goals first | rfl | (funext b; by_cases hb : p b=q <;> simp [p] at hb ⊢ <;> simp [hb,Set.indicator]) +end ExactSLEGreen +namespace ExactSLEStops +open scoped NNReal +variable {Ω : Type*} [MeasurableSpace Ω] +omit [MeasurableSpace Ω] in +lemma sort_first_zero (l : List (Ω → ℝ≥0)) (h0 : (fun _ => 0)∈l) (ω : Ω) : + ((sort l)[0]'(by rw [sort_length]; exact List.length_pos_of_mem h0)) ω=0 := by + let v := (sort l).map (fun τ => τ ω) + have hz : 0∈v := (sort_perm l ω).mem_iff.mpr (List.mem_map_of_mem h0) + obtain ⟨i,hi,he⟩ := List.getElem_of_mem hz + have hv := List.pairwise_iff_getElem.mp (sort_sorted l ω) + apply le_antisymm _ (show (0:ℝ≥0)≤_ from bot_le) + cases i with + | zero => simpa only [v,List.getElem_map] using he.le + | succ i => + have h := hv 0 (i+1) (by simpa [v,sort_length] using List.length_pos_of_mem h0) hi (Nat.zero_lt_succ i) + rw [he] at h + simpa only [v,List.getElem_map] using h +omit [MeasurableSpace Ω] in +lemma sort_last_bound (l : List (Ω → ℝ≥0)) (B : Ω → ℝ≥0) (hB : B∈l) + (hb : ∀ τ∈l, ∀ ω,τ ω≤B ω) (ω : Ω) (N : ℕ) (hN : (sort l).length=N+1) : + ((sort l)[N]'(by omega)) ω=B ω := by + let v := (sort l).map (fun τ => τ ω) + have hz : B ω∈v := (sort_perm l ω).mem_iff.mpr (List.mem_map_of_mem hB) + obtain ⟨i,hi,he⟩ := List.getElem_of_mem hz + have hv := List.pairwise_iff_getElem.mp (sort_sorted l ω) + apply le_antisymm (sort_bounded l B hb _ (List.getElem_mem _) ω) + have hiN : i≤N := by + have hvlen : v.length=N+1 := by simp [v,hN] + omega + rcases hiN.eq_or_lt with rfl|hlt + · simpa only [v,List.getElem_map] using he.ge + · have h := hv i N hi (by simp [hN]) hlt + rw [he] at h + simpa only [v,List.getElem_map] using h +end ExactSLEStops + + +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory ProbabilityTheory Set Filter +open scoped Classical NNReal ENNReal +lemma actual_phase_expectation_bound {m : ℕ} {a ε : ℝ} (ha : 1/4 b.1 t) W) + (B : ExactSLEGenerator.Driver → ℝ≥0) (L : ℝ≥0) + (hB : IsStoppingTime rawFiltration (fun b => (B b : WithTop ℝ≥0))) + (hBL : ∀ b,B b≤L) + (hsafe : ∀ b t, t≤B b → (∃ i, (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i)) → + ‖vectorState a η hη z t b‖≤M ∧ ∀ i, + (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i) → + alive a b.1 t (z i) ∧ η≤Y (vectorState a η hη z t b i) ∧ + vectorState a η hη z t b i=actualState a b.1 t (z i)) : + (∫ b, phaseProduct a cap U (actualPhase a z cap U (B b) b) (vectorState a η hη z (B b) b) ∂W)≤ + Real.exp (phaseDiscountConstant m a ε)^(3*m+1) := by + classical + have ha0 : 0 clip (fun b => levelTime a b (z i) (cap i) u) B + let l : List (ExactSLEGenerator.Driver → ℝ≥0) := [(fun _ => 0),B] ++ + List.ofFn (fun i => C i 0) ++ List.ofFn (fun i => C i (U i/2)) ++ List.ofFn (fun i => C i (U i)) + have hlen : (sort l).length=3*m+2 := by simp only [sort_length,l,List.length_append,List.length_cons,List.length_nil,List.length_ofFn]; omega + have hmem (τ) : τ∈l ↔ τ=(fun _ => 0) ∨ τ=B ∨ + (∃ i,τ=C i 0) ∨ (∃ i,τ=C i (U i/2)) ∨ (∃ i,τ=C i (U i)) := by + simp only [l,List.mem_append,List.mem_cons,List.not_mem_nil,List.mem_ofFn,or_false] + simp only [or_assoc] + constructor + · rintro (h|h|⟨i,h⟩|⟨i,h⟩|⟨i,h⟩) + · exact Or.inl h + · exact Or.inr (Or.inl h) + · exact Or.inr (Or.inr (Or.inl ⟨i,h.symm⟩)) + · exact Or.inr (Or.inr (Or.inr (Or.inl ⟨i,h.symm⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨i,h.symm⟩))) + · rintro (h|h|⟨i,h⟩|⟨i,h⟩|⟨i,h⟩) + · exact Or.inl h + · exact Or.inr (Or.inl h) + · exact Or.inr (Or.inr (Or.inl ⟨i,h.symm⟩)) + · exact Or.inr (Or.inr (Or.inr (Or.inl ⟨i,h.symm⟩))) + · exact Or.inr (Or.inr (Or.inr (Or.inr ⟨i,h.symm⟩))) + have hbnd : ∀ τ∈l, ∀ b,τ b≤B b := by + intro τ ht b + rcases (hmem τ).mp ht with rfl|rfl|⟨i,rfl⟩|⟨i,rfl⟩|⟨i,rfl⟩ + · exact bot_le + · exact le_rfl + all_goals exact clip_le _ _ _ + have hstop : ∀ τ∈l, IsStoppingTime rawFiltration (fun b => (τ b : WithTop ℝ≥0)) := by + intro τ ht + rcases (hmem τ).mp ht with rfl|rfl|⟨i,rfl⟩|⟨i,rfl⟩|⟨i,rfl⟩ + · exact isStoppingTime_const _ _ + · exact hB + all_goals apply clip_stopping rawFiltration _ B _ hB + all_goals apply radialTime_stopping a ha0 (z i) (hz i) _ (levelRadius_pos _ _ _ (hc i)) + · exact (levelRadius_le ha0 (hc i) le_rfl).trans (by have := hr i; linarith) + · exact (levelRadius_le ha0 (hc i) (by have := hu i; linarith : 0≤U i/2)).trans (by have := hr i; linarith) + · exact (levelRadius_le ha0 (hc i) (hu i)).trans (by have := hr i; linarith) + let S := fun (k : Fin (3*m+2)) => (sort l)[k.val]'(by rw [hlen]; exact k.isLt) + have hS (k) : IsStoppingTime rawFiltration (fun b => (S k b : WithTop ℝ≥0)) := + sort_stopping rawFiltration l hstop _ (List.getElem_mem _) + have hSB (k) (b) : S k b≤B b := sort_bounded l B hbnd _ (List.getElem_mem _) b + have h0 : S 0=(fun _ => 0) := by + funext b + convert sort_first_zero l ((hmem _).mpr (Or.inl rfl)) b using 1 + simp [S] + rfl + have hlast : S ⟨3*m+1,by omega⟩=B := by + funext b + exact sort_last_bound l B ((hmem _).mpr (Or.inr (Or.inl rfl))) hbnd b (3*m+1) (by omega) + let P := fun (Q : ExactSLEGenerator.Driver → ℝ≥0) (b : ExactSLEGenerator.Driver) => + phaseProduct a cap U (actualPhase a z cap U (Q b) b) (vectorState a η hη z (Q b) b) + have hind : ∀ k : Fin (3*m+2), (∫ b,P (S k) b ∂W)≤Real.exp (phaseDiscountConstant m a ε)^k.val := by + intro k + induction k using Fin.induction with + | zero => + rw [h0,Fin.val_zero,pow_zero] + have hi := stopped_phaseProduct_integrable ha z hz cap U hc hr hu η hη M W (fun _ => 0) + (isStoppingTime_const _ _) (fun b he => by + have hh := hsafe b 0 bot_le he + exact ⟨hh.1,fun i hi => (hh.2 i hi).2.1⟩) + calc + _ ≤ ∫ _ : ExactSLEGenerator.Driver, (1:ℝ) ∂W := integral_mono hi (integrable_const _) (fun b => actual_phaseProduct_initial ha z hz cap U hc hr hu η hη b) + _ = 1 := by simp + | succ k ih => + have hk : k.val+1<(sort l).length := by rw [hlen]; omega + have hST (b) : S k.castSucc b≤S k.succ b := by + have hh := List.pairwise_iff_getElem.mp (sort_sorted l b) k.val (k.val+1) + (by simp only [List.length_map]; omega) (by simpa only [List.length_map] using hk) (by omega) + simpa only [List.getElem_map,S,Fin.val_castSucc,Fin.val_succ] using hh + have hboundary : ∀ b i, ∀ u∈({0,U i/2,U i}:Finset ℝ), + levelTime a b (z i) (cap i) u≤(S k.castSucc b:ℝ≥0∞) ∨ (S k.succ b:ℝ≥0∞)≤levelTime a b (z i) (cap i) u := by + intro b i u hu' + apply no_actual_change_between l B (fun b => levelTime a b (z i) (cap i) u) _ b k.val hk (hSB k.succ b) + change C i u∈l + simp only [Finset.mem_insert,Finset.mem_singleton] at hu' + rcases hu' with rfl|rfl|rfl + · exact (hmem _).mpr (Or.inr (Or.inr (Or.inl ⟨i,rfl⟩))) + · exact (hmem _).mpr (Or.inr (Or.inr (Or.inr (Or.inl ⟨i,rfl⟩)))) + · exact (hmem _).mpr (Or.inr (Or.inr (Or.inr (Or.inr ⟨i,rfl⟩)))) + have hs := actual_phase_expectation_step ha hε hsize z hz hinj cap U hc hr hsep hu η hη M W hW + (S k.castSucc) (S k.succ) L (hS _) (hS _) hST (fun b => (hSB _ b).trans (hBL b)) hboundary + (fun b t ht he => hsafe b t (ht.trans (hSB _ b)) he) + calc + _ ≤ Real.exp (phaseDiscountConstant m a ε)*(∫ b,P (S k.castSucc) b ∂W) := hs + _ ≤ Real.exp (phaseDiscountConstant m a ε)*Real.exp (phaseDiscountConstant m a ε)^k.val := mul_le_mul_of_nonneg_left ih (Real.exp_pos _).le + _ = _ := by simp only [Fin.val_succ,pow_succ]; ring + simpa only [hlast] using hind ⟨3*m+1,by omega⟩ +end ExactSLEGreen + + +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt ExactSLEStops MeasureTheory ProbabilityTheory Set Filter +open scoped Classical NNReal ENNReal +lemma actual_all_clocks_bound {m : ℕ} {a ε : ℝ} (ha : 1/4 b.1 t) W) : + W {b | ∀ i,levelTime a b (z i) (cap i) (U i)<∞}≤ + ENNReal.ofReal (Real.exp (phaseDiscountConstant m a ε)^(3*m+1) / + (∏ i,Real.exp (regP a*U i/2)/3)) := by + classical + have ha0 : 0 levelRadius a (cap i) (U i) + have hρ (i) : 0<ρ i := levelRadius_pos _ _ _ (hc i) + have hρz (i) : ρ i≤(z i).im := (levelRadius_le ha0 (hc i) (hu i)).trans (by have := hr i; linarith) + let B := fun n => unfinishedCutoff a ha0 z hz ρ hρ hρz n + have hB (n) : IsStoppingTime rawFiltration (fun b => (B n b : WithTop ℝ≥0)) := unfinishedCutoff_stopping a ha0 z hz ρ hρ hρz n + have hBN (n) (b) : B n b≤(n:ℝ≥0) := by + apply ENNReal.coe_le_coe.mp + rw [show (B n b:ℝ≥0∞)=unfinishedCutoffTop a ha0 z hz ρ hρ hρz n b from unfinishedCutoff_coe a ha0 z hz ρ hρ hρz n b] + exact unfinishedCutoffTop_le a ha0 z hz ρ hρ hρz n b + let E := fun n => {b | ∀ i,levelTime a b (z i) (cap i) (U i)≤(B n b:ℝ≥0∞)} + let H := ∏ i,Real.exp (regP a*U i/2)/3 + let A := Real.exp (phaseDiscountConstant m a ε)^(3*m+1) + have hH : 0 div_pos (Real.exp_pos _) (by norm_num) + have hbound (n) : W (E n)≤ENNReal.ofReal (A/H) := by + obtain ⟨η,hη,M,hs⟩ := actual_common_cutoff_safe a ha0 z hz ρ hρ hρz n + have hsafe : ∀ b t, t≤B n b → (∃ i, (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i)) → + ‖vectorState a η hη z t b‖≤M ∧ ∀ i, + (t:ℝ≥0∞)≤levelTime a b (z i) (cap i) (U i) → + alive a b.1 t (z i) ∧ η≤Y (vectorState a η hη z t b i) ∧ + vectorState a η hη z t b i=actualState a b.1 t (z i) := by + intro b t ht he + have hh := hs b t ht he + refine ⟨hh.1,?_⟩ + intro i hi + exact ⟨(actual_unfinished_cutoff a ha0 z hz ρ hρ hρz).2.1 n b t i ht hi,hh.2 i hi⟩ + let P := fun b => phaseProduct a cap U (actualPhase a z cap U (B n b) b) (vectorState a η hη z (B n b) b) + have hi : Integrable P W := stopped_phaseProduct_integrable ha z hz cap U hc hr hu η hη M W (B n) (hB n) + (fun b he => by have h := hsafe b (B n b) le_rfl he; exact ⟨h.1,fun i hi => (h.2 i hi).2.1⟩) + have he : (∫ b,P b ∂W)≤A := actual_phase_expectation_bound ha hε hsize z hz hinj cap U hc hr hsep hu η hη M W hW (B n) n (hB n) (hBN n) hsafe + have hsub : E n⊆{b | H≤P b} := by + intro b hb + exact (actual_phaseProduct_completed a z cap U η hη b (B n b) hb).ge + have hm := mul_meas_ge_le_integral_of_nonneg (Eventually.of_forall fun b => (phaseProduct_pos a cap U _ _).le) hi H + have hh : W.real (E n)≤A/H := by + apply (le_div_iff₀ hH).mpr + calc + W.real (E n)*H = H*W.real (E n) := mul_comm _ _ + _ ≤ H*W.real {b | H≤P b} := mul_le_mul_of_nonneg_left (measureReal_mono hsub) hH.le + _ ≤ A := hm.trans he + rw [←ofReal_measureReal (μ := W) (s := E n)] + exact ENNReal.ofReal_le_ofReal hh + let F := fun N : ℕ => {b | ∀ n≥N,b∈E n} + have hF : Monotone F := by + intro N M hNM b hb n hn + exact hb n (hNM.trans hn) + have hsub : {b | ∀ i,levelTime a b (z i) (cap i) (U i)<∞}⊆⋃ N,F N := by + intro b hb + have he := (actual_unfinished_cutoff a ha0 z hz ρ hρ hρz).2.2 b hb + obtain ⟨N,hN⟩ := eventually_atTop.mp he + apply mem_iUnion.mpr + refine ⟨N,?_⟩ + intro n hn i + exact (hN n hn i).le + calc + _ ≤ W (⋃ N,F N) := measure_mono hsub + _ = ⨆ N,W (F N) := hF.measure_iUnion + _ ≤ ENNReal.ofReal (A/H) := iSup_le fun N => (measure_mono (show F N⊆E N from fun b hb => hb N le_rfl)).trans (hbound N) +end ExactSLEGreen + + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Set ExactSLEGenerator ExactSLEMain ExactSLEFiniteTilt +open scoped Classical NNReal ENNReal + + +theorem actual_multipoint_hit_bound (a : ℝ) (ha : 1/4 < a) (m : ℕ) : + ∃ C : ℝ, 0 < C ∧ ∀ (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W], + IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W → + ∀ z : Fin m → ℂ, Function.Injective z → (∀ i, 0 < (z i).im) → + ∀ cap target : Fin m → ℝ, + (∀ i, 0 -Real.log (target i/cap i)/(2*a) + have hrpos (i) : 0 (hc i).1) (fun i => (hc i).2) hsep hU W hW + have hevent : {b | ∀ i,levelTime a b (z i) (cap i) (U i)<∞}={b | ∀ i,radialTime a b.1 (z i) (target i/2)<∞} := by + simp only [levelTime,hρ] + rw [hevent] at h + have hexp (i) : (Real.exp (regP a*U i/2)/3)⁻¹=3*(target i/cap i)^(alpha a) := by + have he : -(regP a*U i/2)=Real.log (target i/cap i)*alpha a := by + dsimp [U,regP,alpha] + field_simp + ring + rw [inv_div,div_eq_mul_inv,←Real.exp_neg,he,Real.rpow_def_of_pos (hrpos i)] + have hden : (∏ i,Real.exp (regP a*U i/2)/3)⁻¹=3^m*∏ i,(target i/cap i)^(alpha a) := by + rw [←Finset.prod_inv_distrib] + simp_rw [hexp] + rw [Finset.prod_mul_distrib] + simp only [Finset.prod_const,Finset.card_univ,Fintype.card_fin] + rw [div_eq_mul_inv,hden] at h + simpa only [mul_assoc,mul_left_comm,A] using h +end ExactSLEGreen + +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +namespace ExactSLEFlow +variable {E Ω : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] [MeasurableSpace Ω] +theorem measurable_parameter_flow_on_interval + (A : Ω → E → E) (L K : Ω → ℝ≥0) + (hA : ∀ ω, LipschitzWith (K ω) (A ω)) (hb : ∀ ω x, ‖A ω x‖ ≤ L ω) + (hmA : Measurable (Function.uncurry A)) + (u : ℝ → Ω → E) (huc : ∀ ω, Continuous (fun t => u t ω)) + (hum : ∀ t, Measurable (u t)) (x : Ω → E) (hxm : Measurable x) (T : ℝ≥0) : + ∃ Y : ℝ → Ω → E, + (∀ ω, Continuous (fun t => Y t ω)) ∧ + (∀ t, Measurable (Y t)) ∧ + (∀ ω t, t ∈ Icc (0 : ℝ) T → + Y t ω = x ω + ∫ v in 0..t, A ω (Y v ω + u v ω)) ∧ + (∀ ω t, t ∈ Icc (0 : ℝ) T → + HasDerivWithinAt (fun v => Y v ω) (A ω (Y t ω + u t ω)) (Icc (0 : ℝ) T) t) := by + let t₀ : Icc (0 : ℝ) T := ⟨0, by simp⟩ + have hf (ω : Ω) : IsPicardLindelof (fun t y => A ω (y + u t ω)) + t₀ (x ω) (L ω*T) 0 (L ω) (K ω) := bounded_forcing_picard (A ω) (L ω) (K ω) (hA ω) (hb ω) _ (huc ω) _ _ + have hfix (ω : Ω) := ODE.FunSpace.exists_isFixedPt_next (hf ω) + (mem_closedBall_self (by simp) : x ω ∈ closedBall (x ω) (0 : ℝ)) + choose α hα using hfix + let Y : ℝ → Ω → E := fun t ω => (α ω).compProj t + let β : (ω : Ω) → ODE.FunSpace t₀ (x ω) 0 (L ω) := fun ω => default + let N (ω : Ω) := ODE.FunSpace.next (hf ω) + (mem_closedBall_self (by simp) : x ω ∈ closedBall (x ω) (0 : ℝ)) + have hm (n : ℕ) (t : ℝ) : Measurable (fun ω => ((N ω)^[n] (β ω)).compProj t) := by + induction n generalizing t with + | zero => change Measurable x; exact hxm + | succ n ih => + have hc (ω : Ω) : Continuous (fun v => A ω (((N ω)^[n] (β ω)).compProj v + u v ω)) := + (hA ω).continuous.comp ((ODE.FunSpace.continuous_compProj _).add (huc ω)) + have hi := stronglyMeasurable_intervalIntegral_of_continuous + (fun v ω => A ω (((N ω)^[n] (β ω)).compProj v + u v ω)) hc + (fun v => hmA.comp (measurable_id.prodMk ((ih v).add (hum v)))) + 0 (projIcc (0 : ℝ) T T.coe_nonneg t) + simp only [iterate_succ_apply'] + change Measurable (fun ω => x ω + ∫ v in (0 : ℝ).. + (projIcc (0 : ℝ) T T.coe_nonneg t : ℝ), + A ω (((N ω)^[n] (β ω)).compProj v + u v ω)) + exact hxm.add hi.measurable + refine ⟨Y, fun ω => (α ω).continuous_compProj, fun t => ?_, ?_, ?_⟩ + · exact measurable_of_tendsto_metrizable (fun n => hm n t) + (tendsto_pi_nhds.mpr (fun ω => picard_iterates_tendsto (hf ω) (α ω) (hα ω) (β ω) t)) + · intro ω t ht + have he := (ODE.FunSpace.isFixedPt_next_iff (hf ω) + (mem_closedBall_self (by simp))).mp (hα ω) ⟨t, ht⟩ + change (α ω).compProj t = x ω + ∫ v in 0..t, A ω ((α ω).compProj v + u v ω) + rw [ODE.FunSpace.compProj_of_mem ht] + exact he + · intro ω t ht + apply ODE.hasDerivWithinAt_picard_Icc t₀.2 (hf ω).continuousOn_uncurry + (α ω).continuous_compProj.continuousOn + (fun _ _ => (α ω).compProj_mem_closedBall (hf ω).mul_max_le) (x ω) ht |>.congr_of_mem _ ht + intro v hv + change (α ω).compProj v = _ + nth_rw 1 [← hα ω] + rw [ODE.FunSpace.compProj_of_mem hv] + rfl + +theorem measurable_parameter_flow + (A : Ω → E → E) (L K : Ω → ℝ≥0) + (hA : ∀ ω, LipschitzWith (K ω) (A ω)) (hb : ∀ ω x, ‖A ω x‖ ≤ L ω) + (hmA : Measurable (Function.uncurry A)) + (u : ℝ≥0 → Ω → E) (huc : ∀ ω, Continuous (fun t => u t ω)) + (hum : ∀ t, Measurable (u t)) (x : Ω → E) (hxm : Measurable x) : + ∃ Y : ℝ≥0 → Ω → E, + (∀ ω, Continuous (fun t => Y t ω)) ∧ + (∀ t, Measurable (Y t)) ∧ + (∀ ω t, Y t ω = x ω + ∫ v in (0 : ℝ)..(t : ℝ), + A ω (Y v.toNNReal ω + u v.toNNReal ω)) := by + have hex (T : ℝ≥0) := measurable_parameter_flow_on_interval A L K hA hb hmA + (fun t ω => u t.toNNReal ω) (fun ω => (huc ω).comp continuous_real_toNNReal) + (fun t => hum _) x hxm T + choose F hFc hFm hFe hFd using hex + have hF0 (T : ℝ≥0) (ω : Ω) : F T 0 ω = x ω := by + simpa using hFe T ω 0 (by simp) + have hcompat {S T : ℝ≥0} (hST : S ≤ T) (ω : Ω) (v : ℝ) (hv : v ∈ Icc 0 (S : ℝ)) : + F S v ω = F T v ω := by + have hsub : Icc (0 : ℝ) S ⊆ Icc (0 : ℝ) T := Icc_subset_Icc_right hST + apply additive_flow_unique (hA ω) (hFc S ω).continuousOn (hFc T ω).continuousOn + (hFd S ω) (fun t ht => (hFd T ω t (hsub ht)).mono hsub) + (by rw [hF0, hF0]) hv + let Y : ℝ≥0 → Ω → E := fun t ω => F t t ω + have hYF {T t : ℝ≥0} (ht : t ≤ T) (ω : Ω) : Y t ω = F T t ω := + hcompat ht ω t (by simp) + refine ⟨Y, ?_, fun t => hFm t t, ?_⟩ + · intro ω + apply continuous_iff_continuousAt.mpr + intro t + have hc : ContinuousAt (fun v : ℝ≥0 => F (t+1) v ω) t := + ((hFc (t+1) ω).comp continuous_subtype_val).continuousAt + apply hc.congr + filter_upwards [eventually_lt_nhds (show t < t+1 by simp)] with v hv + exact (hYF hv.le ω).symm + · intro ω t + rw [hYF le_rfl ω, hFe t ω t (by simp)] + congr 1 + apply intervalIntegral.integral_congr + intro v hv + have hv' : v ∈ Icc (0 : ℝ) t := by simpa [uIcc_of_le t.coe_nonneg] using hv + have hvt : v.toNNReal ≤ t := (Real.toNNReal_le_toNNReal hv'.2).trans_eq (by simp) + dsimp only + rw [hYF hvt ω, Real.coe_toNNReal _ hv'.1] + +end ExactSLEFlow + +namespace ExactSLEGreen +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadialBounds.lean b/lean/OAI/Probability/SLEGauge/RadialBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..239be6507527cded8bfa6e18010955afad49dba7 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadialBounds.lean @@ -0,0 +1,450 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.CutoffDrift + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +namespace ExactSLEBarrier +variable {a : ℝ} {T : ℝ≥0} {y j q : ℝ → ℝ} +lemma Evolution.logRadius_le (h : Evolution a T y j q) (ha : 0 ≤ a) + (t : ℝ) (ht : t ∈ Icc 0 (T : ℝ)) : + Real.log (y t)-j t ≤ Real.log (y 0)-j 0 := by + have hc : ContinuousOn (fun t => Real.log (y t)-j t) (Icc 0 (T : ℝ)) := + (h.yc.log (fun u hu => (h.yp u hu).ne')).sub h.jc + have hm : AntitoneOn (fun t => Real.log (y t)-j t) (Icc 0 (T : ℝ)) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 (T : ℝ)) hc + (fun u hu => (h.logRadius_deriv (interior_subset hu)).mono interior_subset) + (fun u hu => div_nonpos_of_nonpos_of_nonneg (by nlinarith [sq_nonneg (y u)]) (sq_nonneg _)) + exact hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + + + +theorem Evolution.height_barrier (h : Evolution a T y j q) (ha : 0 ≤ a) + (δ ρ : ℝ) (hδ : 0 < δ) (_hρ : 0 < ρ) (hj0 : j 0 = 0) + (hs : ∀ t ∈ Icc 0 (T : ℝ), δ^2 * q t ≤ (y t)^2) + (hr : ∀ t ∈ Icc 0 (T : ℝ), Real.log ρ ≤ Real.log (y t)-j t) + (t : ℝ) (ht : t ∈ Icc 0 (T : ℝ)) : + Real.exp (Real.log (y 0)+(Real.log ρ-Real.log (y 0))/(2*δ^2)) ≤ y t := by + let F : ℝ → ℝ := fun u => Real.log (y u) - (Real.log (y u)-j u)/(2*δ^2) + have hFc : ContinuousOn F (Icc 0 (T : ℝ)) := + (h.yc.log (fun u hu => (h.yp u hu).ne')).sub + (((h.yc.log (fun u hu => (h.yp u hu).ne')).sub h.jc).div_const _) + have hFd (u : ℝ) (hu : u ∈ Icc 0 (T : ℝ)) : + HasDerivWithinAt F (a*((y u)^2-δ^2*q u)/(δ^2*(q u)^2)) (Icc 0 (T : ℝ)) u := by + convert (h.logHeight_deriv hu).sub ((h.logRadius_deriv hu).div_const (2*δ^2)) using 1 + try rfl + field_simp [hδ.ne',(h.qp u hu).ne'] + ring + have hm : MonotoneOn F (Icc 0 (T : ℝ)) := + monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 (T : ℝ)) hFc + (fun u hu => (hFd u (interior_subset hu)).mono interior_subset) + (fun u hu => div_nonneg (mul_nonneg ha (sub_nonneg.mpr (hs u (interior_subset hu)))) (by positivity)) + have hi := hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + dsimp only [F] at hi + rw [hj0,sub_zero] at hi + have hdr := div_le_div_of_nonneg_right (hr t ht) (by positivity : 0 ≤ 2*δ^2) + have he : Real.log (y 0)+(Real.log ρ-Real.log (y 0))/(2*δ^2) ≤ Real.log (y t) := by + rw [sub_div] + linarith + simpa only [Real.exp_log (h.yp t ht)] using Real.exp_le_exp.mpr he + + + +theorem Evolution.time_barrier (h : Evolution a T y j q) (ha : 0 ≤ a) + (δ : ℝ) (hs : ∀ t ∈ Icc 0 (T : ℝ), δ^2 * q t ≤ (y t)^2) + (t : ℝ) (ht : t ∈ Icc 0 (T : ℝ)) : 2*a*δ^2*t ≤ (y 0)^2 := by + let F : ℝ → ℝ := fun u => (y u)^2 + 2*a*δ^2*u + have hFc : ContinuousOn F (Icc 0 (T : ℝ)) := + (h.yc.pow 2).add (continuousOn_const.mul continuousOn_id) + have hFd (u : ℝ) (hu : u ∈ Icc 0 (T : ℝ)) : + HasDerivWithinAt F (2*a*(δ^2-(y u)^2/q u)) (Icc 0 (T : ℝ)) u := by + convert ((h.yd u hu).pow 2).add ((hasDerivWithinAt_id u _).const_mul (2*a*δ^2)) using 1 <;> try rfl + simp only [Nat.reduceSub,pow_one,Nat.cast_ofNat] + ring + have hm : AntitoneOn F (Icc 0 (T : ℝ)) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 (T : ℝ)) hFc + (fun u hu => (hFd u (interior_subset hu)).mono interior_subset) + (fun u hu => mul_nonpos_of_nonneg_of_nonpos (by positivity) + (sub_nonpos.mpr ((le_div_iff₀ (h.qp u (interior_subset hu))).mpr (hs u (interior_subset hu))))) + have hi := hm ⟨le_rfl,T.coe_nonneg⟩ ht ht.1 + dsimp only [F] at hi + nlinarith [sq_nonneg (y t)] + +end ExactSLEBarrier + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma localState_projection_deriv (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (b : ExactSLEGenerator.Driver) (L : State →L[ℝ] ℝ) (hL : L noise = 0) + (T : ℝ≥0) (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun u => L (localState a ε hε z u.toNNReal b)) + (L (cutoffDrift a ε (localState a ε hε z u.toNNReal b))) (Icc (0 : ℝ) T) u := by + let V := fun t => localState a ε hε z t b + have hVc : Continuous V := localState_continuous a ε hε z b + have hAc : Continuous (fun u : ℝ => cutoffDrift a ε (V u.toNNReal)) := + (cutoffDrift_lipschitz a ε hε).continuous.comp (hVc.comp continuous_real_toNNReal) + have hgc : Continuous (fun u : ℝ => L (cutoffDrift a ε (V u.toNNReal))) := L.continuous.comp hAc + have he (t : ℝ≥0) : L (V t) = L (z,0) + + ∫ u in (0 : ℝ)..(t : ℝ), L (cutoffDrift a ε (V u.toNNReal)) := by + have h := congrArg L (localState_eq_zero a ε hε z t b) + simp only [map_add,map_smul,hL,smul_zero,add_zero] at h + rw [← L.intervalIntegral_comp_comm (hAc.intervalIntegrable 0 t)] at h + exact h + have hd := (intervalIntegral.integral_hasDerivAt_right (hgc.intervalIntegrable 0 u) + hgc.aestronglyMeasurable.stronglyMeasurableAtFilter hgc.continuousAt).const_add (L (z,0)) + apply hd.hasDerivWithinAt.congr_of_mem _ hu + intro v hv + simpa only [Real.coe_toNNReal _ hv.1] using he v.toNNReal + +lemma Y_physicalDrift (a : ℝ) (v : State) : + Y (physicalDrift a v) = -a*Y v/Q v := by + simp only [Y_apply,physicalDrift,Complex.div_im,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,zero_div,zero_sub,← Q_eq] + ring +lemma J_physicalDrift (a : ℝ) (v : State) : + J (physicalDrift a v) = -a*(Q v-2*(Y v)^2)/(Q v)^2 := by + simp only [J_apply,physicalDrift,Complex.div_re,Complex.neg_re,Complex.ofReal_re, + Complex.neg_im,Complex.ofReal_im,neg_zero,zero_mul,zero_div,add_zero,map_pow, + ← Q_eq] + simp only [pow_two,Complex.mul_re] + unfold Q + simp only [X_apply,Y_apply] + ring + +lemma localState_evolution (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (b : ExactSLEGenerator.Driver) (T : ℝ≥0) + (hy : ∀ t ≤ T, ε ≤ Y (localState a ε hε z t b)) : + ExactSLEBarrier.Evolution a T + (fun u => Y (localState a ε hε z u.toNNReal b)) + (fun u => J (localState a ε hε z u.toNNReal b)) + (fun u => Q (localState a ε hε z u.toNNReal b)) := by + have hVc := (localState_continuous a ε hε z b).comp continuous_real_toNNReal + have ht (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : u.toNNReal ≤ T := + (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have hp (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : 0 < Y (localState a ε hε z u.toNNReal b) := + hε.trans_le (hy _ (ht u hu)) + refine ⟨(Y.continuous.comp hVc).continuousOn,(J.continuous.comp hVc).continuousOn, + hp,fun u hu => Q_pos (hp u hu),?_,?_⟩ + · intro u hu + have hd := localState_projection_deriv a ε hε z b Y (by simp [noise]) T u hu + rw [cutoffDrift_eq_physical a ε _ (hy _ (ht u hu))] at hd + exact (show HasDerivWithinAt _ (Y (physicalDrift a _)) _ _ from hd).congr_deriv (Y_physicalDrift a _) + · intro u hu + have hd := localState_projection_deriv a ε hε z b J (by simp [noise]) T u hu + rw [cutoffDrift_eq_physical a ε _ (hy _ (ht u hu))] at hd + exact (show HasDerivWithinAt _ (J (physicalDrift a _)) _ _ from hd).congr_deriv (J_physicalDrift a _) + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEHitting + +noncomputable def regionMonitor (ε N ρ δ : ℝ) (v : State) : ℝ := + min (Y v-ε) (min (N-‖v‖) (min (physicalRadius v-ρ) (Y v-δ*‖v.1‖))) +lemma regionMonitor_continuous (ε N ρ δ : ℝ) : Continuous (regionMonitor ε N ρ δ) := + (Y.continuous.sub continuous_const).min ((continuous_const.sub continuous_norm).min + ((physicalRadius_continuous.sub continuous_const).min + (Y.continuous.sub (continuous_const.mul (continuous_fst.norm))))) +lemma regionMonitor_nonneg_iff (ε N ρ δ : ℝ) (v : State) : + 0 ≤ regionMonitor ε N ρ δ v ↔ + ε ≤ Y v ∧ ‖v‖ ≤ N ∧ ρ ≤ physicalRadius v ∧ δ*‖v.1‖ ≤ Y v := by + simp only [regionMonitor,le_min_iff,sub_nonneg] +lemma regionMonitor_nonpos_iff (ε N ρ δ : ℝ) (v : State) : + regionMonitor ε N ρ δ v ≤ 0 ↔ + Y v ≤ ε ∨ N ≤ ‖v‖ ∨ physicalRadius v ≤ ρ ∨ Y v ≤ δ*‖v.1‖ := by + simp only [regionMonitor,min_le_iff,sub_nonpos] + +noncomputable def regionStop (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) : ExactSLEGenerator.Driver → ℝ≥0 := + hittingBtwn (fun t b => regionMonitor ε N ρ δ (localState a ε hε z t b)) (Iic 0) 0 B + +lemma regionStop_stopping (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) : + IsStoppingTime rawFiltration (fun b => (regionStop a ε hε z N ρ δ B b : WithTop ℝ≥0)) := by + exact boundedContact_stopping rawFiltration _ + (fun b => (regionMonitor_continuous ε N ρ δ).comp (localState_continuous a ε hε z b)) + (fun t => (regionMonitor_continuous ε N ρ δ).measurable.comp (localState_adapted a ε hε z t)) B + +lemma regionStop_le (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (b : ExactSLEGenerator.Driver) : + regionStop a ε hε z N ρ δ B b ≤ B := hittingBtwn_le b + +lemma regionStop_safe (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t ≤ regionStop a ε hε z N ρ δ B b) : + ε ≤ Y (localState a ε hε z t b) ∧ ‖localState a ε hε z t b‖ ≤ N ∧ + ρ ≤ physicalRadius (localState a ε hε z t b) ∧ + δ*‖(localState a ε hε z t b).1‖ ≤ Y (localState a ε hε z t b) := by + apply (regionMonitor_nonneg_iff ε N ρ δ _).mp + exact nonneg_before_boundedContact _ + (fun b => (regionMonitor_continuous ε N ρ δ).comp (localState_continuous a ε hε z b)) + (fun b => by simpa only [Function.comp_apply,localState_zero] using h0) B b t ht + +lemma regionStop_contact (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) (ht : regionStop a ε hε z N ρ δ B b < B) : + let v := localState a ε hε z (regionStop a ε hε z N ρ δ B b) b + Y v = ε ∨ ‖v‖ = N ∨ physicalRadius v = ρ ∨ Y v = δ*‖v.1‖ := by + dsimp only + have hsafe := regionStop_safe a ε hε z N ρ δ B h0 b _ le_rfl + have hz := boundedContact_eq_zero _ + (fun b => (regionMonitor_continuous ε N ρ δ).comp (localState_continuous a ε hε z b)) + (fun b => by simpa only [Function.comp_apply,localState_zero] using h0) B b ht + rcases (regionMonitor_nonpos_iff ε N ρ δ _).mp (le_of_eq hz) with h|h|h|h + · exact Or.inl (le_antisymm h hsafe.1) + · exact Or.inr (Or.inl (le_antisymm hsafe.2.1 h)) + · exact Or.inr (Or.inr (Or.inl (le_antisymm h hsafe.2.2.1))) + · exact Or.inr (Or.inr (Or.inr (le_antisymm h hsafe.2.2.2))) + +lemma localState_stopped_measurable (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) : + Measurable (fun b => localState a ε hε z (S b) b) := by + have hA : StronglyAdapted rawFiltration (localState a ε hε z) := + fun t => (localState_adapted a ε hε z t).stronglyMeasurable + exact (measurable_stoppedValue (hA.isStronglyProgressive_of_continuous + (localState_continuous a ε hε z)) hS).mono hS.measurableSpace_le le_rfl + + + +lemma regionStop_green_mean (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a ε : ℝ) (ha : a ≠ 0) (hε : 0 < ε) (z : ℂ) + (N B : ℝ≥0) (ρ δ : ℝ) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) : + Integrable (fun b => physicalGreen a (localState a ε hε z (regionStop a ε hε z N ρ δ B b) b)) W ∧ + (∫ b, physicalGreen a (localState a ε hε z (regionStop a ε hε z N ρ δ B b) b) ∂W) = physicalGreen a (z,0) := by + let S := regionStop a ε hε z N ρ δ B + have hS := regionStop_stopping a ε hε z N ρ δ B + have he (b : ExactSLEGenerator.Driver) : + greenCutoff a ε N (localState a ε hε z (S b) b) = + physicalGreen a (localState a ε hε z (S b) b) := by + have hs := regionStop_safe a ε hε z N ρ δ B h0 b (S b) le_rfl + exact (greenCutoff_eq_near a ε hε N _ hs.2.1 hs.1).eq_of_nhds + constructor + · have hm : Measurable (fun b => greenCutoff a ε N (localState a ε hε z (S b) b)) := + (greenCutoff_smooth a ε hε N).continuous.measurable.comp (localState_stopped_measurable a ε hε z S hS) + obtain ⟨C,hC⟩ := (greenCutoff_compact a ε N).exists_bound_of_continuous + (greenCutoff_smooth a ε hε N).continuous + have hi : Integrable (fun b => greenCutoff a ε N (localState a ε hε z (S b) b)) W := Integrable.of_bound hm.aestronglyMeasurable C (Filter.Eventually.of_forall fun b => hC _) + simpa only [he] using hi + · have ho := localGreen_optional W hW a ε ha hε z N B (fun _ => 0) S + (isStoppingTime_const rawFiltration 0) hS (fun _ => bot_le) + (regionStop_le a ε hε z N ρ δ B) + (fun b t ht => ⟨(regionStop_safe a ε hε z N ρ δ B h0 b t ht).1, + (regionStop_safe a ε hε z N ρ δ B h0 b t ht).2.1⟩) + univ MeasurableSet.univ + simpa only [localState_zero,Measure.restrict_univ,integral_const,probReal_univ,one_smul] using ho.symm + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +noncomputable def heightFloor (y0 ρ δ : ℝ) : ℝ := + Real.exp (Real.log y0+(Real.log ρ-Real.log y0)/(2*δ^2)) +noncomputable def logCeiling (y0 ρ δ : ℝ) : ℝ := + |Real.log (heightFloor y0 ρ δ)| + 2*|Real.log y0| + |Real.log ρ| + +lemma heightFloor_pos (y0 ρ δ : ℝ) : 0 < heightFloor y0 ρ δ := Real.exp_pos _ +lemma logCeiling_nonneg (y0 ρ δ : ℝ) : 0 ≤ logCeiling y0 ρ δ := by + unfold logCeiling + positivity + +lemma heightFloor_le {y0 ρ δ : ℝ} (hy0 : 0 < y0) (hρ : 0 < ρ) (hr : ρ ≤ y0) : + heightFloor y0 ρ δ ≤ y0 := by + calc + heightFloor y0 ρ δ ≤ Real.exp (Real.log y0) := ?_ + _ = y0 := Real.exp_log hy0 + unfold heightFloor + apply Real.exp_le_exp.mpr + have he := Real.log_le_log hρ hr + have hd : (Real.log ρ-Real.log y0)/(2*δ^2) ≤ 0 := + div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr he) (by positivity) + linarith + + + +lemma regionStop_barriers (a ε : ℝ) (ha : 0 ≤ a) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (hρ : 0 < ρ) (hδ : 0 < δ) (B : ℝ≥0) + (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) + (ht : t ≤ regionStop a ε hε z N ρ δ B b) : + heightFloor z.im ρ δ ≤ Y (localState a ε hε z t b) ∧ + Y (localState a ε hε z t b) ≤ z.im ∧ + |J (localState a ε hε z t b)| ≤ logCeiling z.im ρ δ ∧ + ‖localState a ε hε z t b‖ ≤ z.im/δ + logCeiling z.im ρ δ ∧ + 2*a*δ^2*(t : ℝ) ≤ z.im^2 := by + let T := regionStop a ε hε z N ρ δ B b + let V := fun u => localState a ε hε z u b + have hsafe (u : ℝ≥0) (hu : u ≤ T) := regionStop_safe a ε hε z N ρ δ B h0 b u hu + have he := localState_evolution a ε hε z b T (fun u hu => (hsafe u hu).1) + have hg : ∀ u ∈ Icc (0 : ℝ) T, δ^2 * Q (V u.toNNReal) ≤ (Y (V u.toNNReal))^2 := by + intro u hu + have hut : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have hs := (hsafe _ hut).2.2.2 + have hh := pow_le_pow_left₀ (mul_nonneg hδ.le (norm_nonneg _)) hs 2 + simpa only [Q_eq,Complex.normSq_eq_norm_sq,mul_pow] using hh + have hr : ∀ u ∈ Icc (0 : ℝ) T, Real.log ρ ≤ Real.log (Y (V u.toNNReal))-J (V u.toNNReal) := by + intro u hu + have hut : u.toNNReal ≤ T := (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + have hs := hsafe _ hut + have hh := Real.log_le_log hρ hs.2.2.1 + have hyp : 0 < Y (V u.toNNReal) := hε.trans_le hs.1 + change Real.log ρ ≤ Real.log (physicalRadius (V u.toNNReal)) at hh + rw [physicalRadius,Real.log_mul hyp.ne' (Real.exp_ne_zero _),Real.log_exp] at hh + simpa only [sub_eq_add_neg] using hh + have hj0 : J (V (0 : ℝ).toNNReal) = 0 := by simp [V,localState_zero] + have hym : heightFloor z.im ρ δ ≤ Y (V t) := by + have hh := he.height_barrier ha δ ρ hδ hρ hj0 hg hr t ⟨t.coe_nonneg,ht⟩ + simpa only [Real.toNNReal_coe,Real.toNNReal_zero,localState_zero,Y_apply,heightFloor] using hh + have hyM : Y (V t) ≤ z.im := by + have hh := he.height_le ha t ⟨t.coe_nonneg,ht⟩ + simpa only [Real.toNNReal_coe,Real.toNNReal_zero,localState_zero,Y_apply] using hh + have hy0 : 0 < z.im := by + have hs := (regionMonitor_nonneg_iff ε N ρ δ (z,0)).mp h0 + exact hε.trans_le hs.1 + have htpos : 0 < Y (V t) := (heightFloor_pos _ _ _).trans_le hym + have hlr := hr t ⟨t.coe_nonneg,ht⟩ + have hLR : Real.log (Y (V t))-J (V t) ≤ Real.log z.im := by + have hh := he.logRadius_le ha t ⟨t.coe_nonneg,ht⟩ + simpa only [Real.toNNReal_coe,Real.toNNReal_zero,localState_zero,Y_apply,J_apply,sub_zero] using hh + simp only [Real.toNNReal_coe] at hlr + have hlY := Real.log_le_log htpos hyM + have hly := Real.log_le_log (heightFloor_pos z.im ρ δ) hym + have hj : |J (V t)| ≤ logCeiling z.im ρ δ := by + apply abs_le.mpr + unfold logCeiling + constructor <;> linarith [le_abs_self (Real.log z.im),neg_le_abs (Real.log z.im), + le_abs_self (Real.log ρ),neg_le_abs (Real.log ρ), + le_abs_self (Real.log (heightFloor z.im ρ δ)),neg_le_abs (Real.log (heightFloor z.im ρ δ)), + abs_nonneg (Real.log z.im),abs_nonneg (Real.log ρ),abs_nonneg (Real.log (heightFloor z.im ρ δ))] + have hv : ‖V t‖ ≤ z.im/δ+logCeiling z.im ρ δ := by + have hzn : ‖(V t).1‖ ≤ z.im/δ := (le_div_iff₀ hδ).mpr (by + rw [mul_comm] + exact (hsafe t ht).2.2.2.trans hyM) + change max ‖(V t).1‖ ‖(V t).2‖ ≤ _ + apply max_le + · linarith [logCeiling_nonneg z.im ρ δ] + · change |J (V t)| ≤ _ + linarith [div_pos hy0 hδ] + have htime : 2*a*δ^2*(t : ℝ) ≤ z.im^2 := by + have hh := he.time_barrier ha δ hg t ⟨t.coe_nonneg,ht⟩ + simpa only [Real.toNNReal_zero,localState_zero,Y_apply] using hh + exact ⟨hym,hyM,hj,hv,htime⟩ + + + +lemma regionStop_true_exit (a ε : ℝ) (ha : 0 < a) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (hρ : 0 < ρ) (hδ : 0 < δ) (B : ℝ≥0) + (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (hεm : ε < heightFloor z.im ρ δ) + (hN : z.im/δ+logCeiling z.im ρ δ < N) + (hB : z.im^2 < 2*a*δ^2*(B : ℝ)) (b : ExactSLEGenerator.Driver) : + let v := localState a ε hε z (regionStop a ε hε z N ρ δ B b) b + physicalRadius v = ρ ∨ Y v = δ*‖v.1‖ := by + let T := regionStop a ε hε z N ρ δ B b + have hs := regionStop_barriers a ε ha.le hε z N ρ δ hρ hδ B h0 b T le_rfl + have hTB : T < B := by + have hc : 0 < 2*a*δ^2 := by positivity + exact_mod_cast (show (T : ℝ) < B by nlinarith) + have hc := regionStop_contact a ε hε z N ρ δ B h0 b hTB + rcases hc with h|h|h|h + · exfalso + have hh := hs.1 + rw [h] at hh + exact (not_le.mpr hεm) hh + · exfalso + have hh := hs.2.2.2.1 + rw [h] at hh + exact (not_le.mpr hN) hh + · exact Or.inl h + · exact Or.inr h + +lemma regionStop_loewner (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) : + let T := regionStop a ε hε z N ρ δ B b + alive a b.1 T z ∧ + (∀ t ≤ T, loewnerMap a b.1 t z - (b.1 t : ℂ) = (localState a ε hε z t b).1) ∧ + Real.log ‖deriv (loewnerMap a b.1 T) z‖ = (localState a ε hε z T b).2 := by + exact state_eq_loewner_on_safe a ε hε b.1 b.1.continuous b.2 z _ + (localState_continuous a ε hε z b) (fun t => localState_eq_zero a ε hε z t b) _ + (fun t ht => (regionStop_safe a ε hε z N ρ δ B h0 b t ht).1) + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + + + +noncomputable def actualState (a : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (z : ℂ) : State := + (loewnerMap a b t z - (b t : ℂ), Real.log ‖deriv (loewnerMap a b t) z‖) +noncomputable def radialTime (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (ρ : ℝ) : ℝ≥0∞ := + sInf {u : ℝ≥0∞ | ∃ t : ℝ≥0, u = t ∧ alive a b t z ∧ physicalRadius (actualState a b t z) = ρ} +noncomputable def radialWeight (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (ρ : ℝ) : ℝ := + if radialTime a b z ρ = ∞ then 0 else + physicalGreen a (actualState a b (radialTime a b z ρ).toNNReal z) + +lemma regionStop_actualState (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) + (ht : t ≤ regionStop a ε hε z N ρ δ B b) : + alive a b.1 t z ∧ actualState a b.1 t z = localState a ε hε z t b := by + have h := state_eq_loewner_on_safe a ε hε b.1 b.1.continuous b.2 z _ + (localState_continuous a ε hε z b) (fun u => localState_eq_zero a ε hε z u b) t + (fun u hu => (regionStop_safe a ε hε z N ρ δ B h0 b u (hu.trans ht)).1) + exact ⟨h.1, Prod.ext (h.2.1 t le_rfl) h.2.2⟩ + +lemma regionStop_le_hit (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) + (ht : physicalRadius (actualState a b.1 t z) = ρ) : + regionStop a ε hε z N ρ δ B b ≤ t := by + by_contra hn + have hlt := lt_of_not_ge hn + have he := (regionStop_actualState a ε hε z N ρ δ B h0 b t hlt.le).2 + have hc : regionMonitor ε N ρ δ (localState a ε hε z t b) ≤ 0 := by + apply (regionMonitor_nonpos_iff _ _ _ _ _).mpr + exact Or.inr (Or.inr (Or.inl (by simpa only [← he,ht] using (le_rfl : ρ ≤ ρ)))) + exact hn (hittingBtwn_le_of_mem bot_le + (hlt.le.trans (regionStop_le a ε hε z N ρ δ B b)) hc) + +lemma regionStop_eq_radialTime (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) + (hr : physicalRadius (localState a ε hε z (regionStop a ε hε z N ρ δ B b) b) = ρ) : + radialTime a b.1 z ρ = (regionStop a ε hε z N ρ δ B b : ℝ≥0∞) := by + let T := regionStop a ε hε z N ρ δ B b + have he := regionStop_actualState a ε hε z N ρ δ B h0 b T le_rfl + apply le_antisymm + · exact sInf_le ⟨T,rfl,he.1,by simpa only [he.2] using hr⟩ + · apply le_sInf + rintro u ⟨t,rfl,_,ht⟩ + exact ENNReal.coe_le_coe.mpr (regionStop_le_hit a ε hε z N ρ δ B h0 b t ht) + +lemma radialTime_top_of_no_hit (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (ρ : ℝ) + (h : ¬ ∃ t : ℝ≥0, alive a b t z ∧ physicalRadius (actualState a b t z) = ρ) : + radialTime a b z ρ = ∞ := by + have he : {u : ℝ≥0∞ | ∃ t : ℝ≥0, u = t ∧ alive a b t z ∧ physicalRadius (actualState a b t z) = ρ} = ∅ := by + apply eq_empty_iff_forall_notMem.mpr + rintro u ⟨t,_,ht⟩ + exact h ⟨t,ht⟩ + simp only [radialTime,he,sInf_empty] + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadialConditionalMixing.lean b/lean/OAI/Probability/SLEGauge/RadialConditionalMixing.lean new file mode 100644 index 0000000000000000000000000000000000000000..471f9d1f317a500429c417d3888d5a86bb8b038c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadialConditionalMixing.lean @@ -0,0 +1,501 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RecoveredInteriorRestart +import OAI.Probability.SLEGauge.RadialRestartRaw + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator CenteredMoments + +lemma radialLaw_consistent_le (W : Measure GDriver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 (hb' (radialPoint a z σ b)).1) + · simpa only [lintegral_const,Measure.restrict_apply_univ] using + lintegral_mono (μ := (radialLaw W a z σ).restrict A) + (fun b => (hb' (radialPoint a z σ b)).2) + + + +theorem finiteAngle_conditional_bounds (W : Measure GDriver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/41)) + (measurable_const.indicator hA) + have hi : (fun b => ENNReal.ofReal + ((Real.sin (Jacobi.finiteAngle a z ρ b : ℝ))^(-p a))*A.indicator (fun _=>1) b) = + A.indicator (fun b => ENNReal.ofReal + ((Real.sin (Jacobi.finiteAngle a z ρ b : ℝ))^(-p a))) := by + funext b + by_cases hb : b∈A <;> simp [hb] + simp only [hi,lintegral_indicator hA,Measure.restrict_restrict hA,lintegral_one, + Measure.restrict_apply_univ] at he + simpa only [inter_comm] using he + + + +theorem radial_change_law_past_bound (W : Measure GDriver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/4ENNReal.ofReal ((Real.sin θ)^(-p a))) (by fun_prop)).2 + have hG : ENNReal.ofReal (ρ^(alpha a)*physicalGreen a (z,0)) ≤ + ENNReal.ofReal ((ρ/z.im)^(alpha a)) := by + apply ENNReal.ofReal_le_ofReal + rw [Real.div_rpow hρ.le hz.le,div_eq_mul_inv,←Real.rpow_neg hz.le] + exact mul_le_mul_of_nonneg_left (Jacobi.physicalGreen_initial_bound a ha z hz) + (Real.rpow_nonneg hρ.le _) + calc + _ ≤ ENNReal.ofReal ((ρ/z.im)^(alpha a))* + (2*(∫⁻θ : Angle,ENNReal.ofReal ((Real.sin θ)^(-p a))∂angleLaw a)*radialLaw W a z ρ A) := + mul_le_mul hG hb zero_le zero_le + _ ≤ _ := by + rw [←mul_assoc,mul_comm (ENNReal.ofReal _) (2*_)] + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (le_add_right le_rfl) zero_le) zero_le + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions + +lemma actualUpperMass_eval_joint_measurable (a : ℝ) (ha : 1/4∫z,f z∂actualUpperMass a q p.1 p.2) := by + simp_rw [actualUpperMass_eval a ha q hq hq1] + have hm : Measurable (fun p : (ℝ≥0∞×ExactSLEGenerator.Driver) × ℂ => + upperExtension f p.2*(timeMassDensity a q p.1.1 p.1.2 p.2).toReal) := + ((upperExtension_measurable f).comp measurable_snd).mul + (timeMassDensity_joint_measurable a ha q hq hq1).ennreal_toReal + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +lemma recoveredMass_joint_measurable (a : ℝ) (ha : 1/4recoveredMass a ha s c hc p.1 p.2) := by + apply measurable_radonLimit + intro k f + simp_rw [actualMassFunctionals_apply] + apply Finset.measurable_sum + intro j hj + exact measurable_const.mul (actualUpperMass_eval_joint_measurable a ha _ + (Real.exp_pos _) (level_step_le_one a ha j) f) + +lemma centeredTime_measurable (a : ℝ) (ha : 1/4levelTime a p.1.1 p.2.1 l) := by + have hz : Measurable (fun θ : Angle => (⟨fromDisk θ.1 0,by + rw [fromDisk_zero_im] + exact Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2⟩ : UpperPlane)) := by + apply Measurable.subtype_mk + simp only [fromDisk_zero] + fun_prop + have hr : Real.exp (-2*a*l)≤1 := Real.exp_le_one_iff.mpr (by + have hl : (0:ℝ)≤l := Nat.cast_nonneg _ + have ha0 : 0tiltWeight a p.1.1 p.2.1 l) := by + have hz : Measurable (fun θ : Angle => (⟨fromDisk θ.1 0,by + rw [fromDisk_zero_im] + exact Real.sin_pos_of_pos_of_lt_pi θ.2.1 θ.2.2⟩ : UpperPlane)) := by + apply Measurable.subtype_mk + simp only [fromDisk_zero] + fun_prop + have hr : Real.exp (-2*a*l)≤1 := Real.exp_le_one_iff.mpr (by + have hl : (0:ℝ)≤l := Nat.cast_nonneg _ + have ha0 : 0physicalGreen a (fromDisk θ.1 0,0)) := by + have he : (fun θ : Angle=>physicalGreen a (fromDisk θ.1 0,0))= + fun θ : Angle => Real.sin θ.1^(-alpha a)*Real.sin θ.1^(p a) := by + funext θ + exact radial_initial_green a θ.1 θ.2.1 θ.2.2 + rw [he] + fun_prop + convert ((joint_radialWeight_measurable a ha _ (Real.exp_pos _) hr).comp + (measurable_snd.prodMk (hz.comp measurable_fst))).div (hG.comp measurable_fst) using 1 + funext p + simp only [tiltWeight_radialWeight a p.1.1 ha p.1.2.1 p.1.2.2 p.2 l,Function.comp_apply,Pi.div_apply,fromDisk_zero_im] + +lemma diskMap_joint_measurable : + Measurable (fun p : Angle×UpperPlane => diskMap p.1.1 p.2.1) := by + unfold diskMap + fun_prop + +lemma diskWeight_joint_measurable (a : ℝ) : + Measurable (fun p : Angle×UpperPlane => diskWeight a p.1.1 p.2) := by + have he : (fun p : Angle×UpperPlane=>diskWeight a p.1.1 p.2)= + fun p : Angle×UpperPlane => + ‖((2*Real.sin p.1.1:ℝ):ℂ)*Complex.I/(p.2.1-Complex.exp (-Complex.I*p.1.1))^2‖^(2-alpha a) := by + funext p + rw [diskWeight,disk_deriv p.1.1 p.1.2.1 p.1.2.2 p.2] + rw [he] + fun_prop + + + +lemma diskMass_joint_measurable {Ω : Type*} [MeasurableSpace Ω] + (a : ℝ) (θ : Ω→Angle) (hθ : Measurable θ) (ν : Ω→Measure UpperPlane) + (hν : Measurable ν) [∀ω,IsFiniteMeasureOnCompacts (ν ω)] : + Measurable (fun ω=>diskMass a (θ ω).1 (ν ω)) := by + let k : Kernel Ω UpperPlane := ⟨ν,hν⟩ + have : IsSFiniteKernel k := isSFiniteKernel_of_locally_finite k + apply Measure.measurable_of_measurable_coe + intro A hA + have hm : Measurable (fun p : Ω×UpperPlane => + A.indicator (fun _=> (1:ℝ≥0∞)) (diskMap (θ p.1).1 p.2.1)* + ENNReal.ofReal (diskWeight a (θ p.1).1 p.2)) := + ((measurable_const.indicator hA).comp (diskMap_joint_measurable.comp + ((hθ.comp measurable_fst).prodMk measurable_snd))).mul + ((diskWeight_joint_measurable a).comp + ((hθ.comp measurable_fst).prodMk measurable_snd)).ennreal_ofReal + have he (ω : Ω) : diskMass a (θ ω).1 (ν ω) A = + ∫⁻z,A.indicator (fun _=>(1:ℝ≥0∞)) (diskMap (θ ω).1 z.1)* + ENNReal.ofReal (diskWeight a (θ ω).1 z)∂k ω := by + rw [diskMass,Measure.map_apply (diskMap_measurable _) hA, + withDensity_apply _ ((diskMap_measurable _) hA), + ←lintegral_indicator ((diskMap_measurable _) hA)] + apply lintegral_congr + intro z + by_cases hz : diskMap (θ ω).1 z.1∈A <;> + simp [Set.indicator,Set.mem_preimage,hz] + simp_rw [he] + exact hm.lintegral_kernel_prod_right + + + +def centeredMass (a : ℝ) (μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane) + (l : ℕ) (p : Angle×ExactSLEGenerator.Driver) : ℝ≥0∞ := + diskMass a p.1.1 (μ (levelTime a p.1.1 p.2.1 l) p.2) (Metric.closedBall (0:ℂ) (1/4)) + +lemma centeredMass_measurable (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] (l : ℕ) : + Measurable (centeredMass a μ l) := by + have hn := diskMass_joint_measurable a Prod.fst measurable_fst + (fun p : Angle×ExactSLEGenerator.Driver=>μ (levelTime a p.1.1 p.2.1 l) p.2) + (hμ.comp ((centeredTime_measurable a ha l).prodMk measurable_snd)) + exact (Measure.measurable_coe (Metric.isClosed_closedBall).measurableSet).comp hn + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions + + + +def finiteAngleLaw (W : Measure ExactSLEGenerator.Driver) (a : ℝ) (l : ℕ) : + Measure (Angle×ExactSLEGenerator.Driver) := + ((angleLaw a).prod W).withDensity (fun p=>ENNReal.ofReal (tiltWeight a p.1.1 p.2.1 l)) + +lemma finiteAngleLaw_absolutelyContinuous (W : Measure ExactSLEGenerator.Driver) + (a : ℝ) (l : ℕ) : finiteAngleLaw W a l≪(angleLaw a).prod W := + withDensity_absolutelyContinuous _ _ + +lemma finiteAngleLaw_lintegral (W : Measure ExactSLEGenerator.Driver) [SFinite W] + (a : ℝ) (ha : 1/4ENNReal.ofReal (tiltWeight a θ.1 b.1 l))= + fun b : ExactSLEGenerator.Driver=>ENNReal.ofReal (radialWeight a b.1 (fromDisk θ.1 0) + (Real.sin θ.1*Real.exp (-2*a*l))/physicalGreen a (fromDisk θ.1 0,0)) := by + funext b + rw [tiltWeight_radialWeight a θ.1 ha θ.2.1 θ.2.2 b l] + change (∫⁻b,ENNReal.ofReal (tiltWeight a θ.1 b.1 l)*f (θ,b)∂W)=_ + rw [radialLaw,←he] + exact (lintegral_withDensity_eq_lintegral_mul W hd ht).symm + +lemma finiteAngleLaw_probability (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (a : ℝ) (ha : 1/4b.1 t) W → + ∀(s : ℕ→Finset ℕ) (coeff : ℕ→ℕ→ℝ), + (∀k j,j∈s k→0≤coeff k j) → (∀k,∑j∈s k,coeff k j=1) → + ∀μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane, + (∀v b,IsFiniteMeasureOnCompacts (μ v b)) → + Measurable (fun p : ℝ≥0∞×ExactSLEGenerator.Driver=>μ p.1 p.2) → + (∀ᵐ b∂W,∀v : ℝ≥0∞,μ v b≤μ ∞ b) → + (∀ᵐ b∂W,∀f : C_c(UpperPlane,ℝ),Tendsto (fun k=>∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂μ ∞ b))) → + ∀l, finiteMoment W a μ m l≤D := by + obtain ⟨C,hC,hCb⟩ := common_limit_disk_tilted_moment a ha m hm + let J := ∫⁻θ : Angle,ENNReal.ofReal (Real.sin θ.1^(-p a))∂angleLaw a + refine ⟨C*J,ENNReal.mul_lt_top hC (angle_inverse_power_finite a),?_⟩ + intro W hprob hW s coeff hcoeff hsum μ hμfin hμ hmono hlim l + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := hμfin v b + rw [finiteMoment,finiteAngleLaw_lintegral W a ha l _ + ((centeredMass_measurable a ha μ hμ l).pow_const m)] + calc + _ ≤ ∫⁻θ : Angle,C*ENNReal.ofReal (Real.sin θ.1^(-p a))∂angleLaw a := by + apply lintegral_mono + intro θ + let T := fun b : ExactSLEGenerator.Driver=>levelTime a θ.1 b.1 l + exact hCb W hW s coeff hcoeff hsum μ (hμfin ∞) + (hμ.comp (measurable_const.prodMk measurable_id)) hmono hlim + θ.1 θ.2.1 θ.2.2 l T + _ = C*J := lintegral_const_mul _ (by fun_prop) + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator CenteredMoments LoewnerScaling + + +def pointAngle (w : UpperPlane) : Angle := Jacobi.angleState (w.1,0) + +lemma pointAngle_measurable : Measurable pointAngle := + Jacobi.angleState_measurable.comp (measurable_subtype_coe.prodMk measurable_const) + +lemma point_norm_pos (w : UpperPlane) : 0<‖w.1‖ := w.2.trans_le (Complex.im_le_norm _) + +lemma fromDisk_pointAngle (w : UpperPlane) : + fromDisk (pointAngle w).1 0 = ((‖w.1‖:ℝ):ℂ)⁻¹*w.1 := by + have hn := point_norm_pos w + have hs := Jacobi.sin_physicalTheta (w.1,0) w.2 + have hc := physicalTheta_cot (w.1,0) + have hsin := Real.sin_pos_of_pos_of_lt_pi (pointAngle w).2.1 (pointAngle w).2.2 + change Real.sin (pointAngle w).1 = w.1.im/‖w.1‖ at hs + change Real.cot (pointAngle w).1 = w.1.re/w.1.im at hc + rw [Real.cot_eq_cos_div_sin,hs,div_eq_div_iff (div_ne_zero w.2.ne' hn.ne') w.2.ne'] at hc + have hcos : Real.cos (pointAngle w).1=w.1.re/‖w.1‖ := by + apply (eq_div_iff hn.ne').mpr + field_simp at hc + exact (mul_left_cancel₀ w.2.ne' (by nlinarith : + w.1.im * (Real.cos (pointAngle w).1 * ‖w.1‖) = w.1.im * w.1.re)) + rw [fromDisk_zero,mul_comm,Complex.exp_mul_I,←Complex.ofReal_inv] + simp only [←Complex.ofReal_cos, ←Complex.ofReal_sin] + apply Complex.ext <;> simp only [Complex.add_re,Complex.add_im,Complex.mul_re,Complex.mul_im, + Complex.ofReal_re,Complex.ofReal_im,Complex.I_re,Complex.I_im,mul_zero,zero_mul, + add_zero,zero_add,mul_one,sub_zero] + · rw [hcos]; ring + · rw [hs]; ring + +lemma norm_mul_fromDisk_pointAngle (w : UpperPlane) : + ((‖w.1‖:ℝ):ℂ)*fromDisk (pointAngle w).1 0=w.1 := by + rw [fromDisk_pointAngle,←mul_assoc,mul_inv_cancel₀ + (Complex.ofReal_ne_zero.mpr (point_norm_pos w).ne'),one_mul] + +lemma sin_pointAngle (w : UpperPlane) : Real.sin (pointAngle w).1=w.1.im/‖w.1‖ := + Jacobi.sin_physicalTheta (w.1,0) w.2 + + +def normalizeDriver (w : UpperPlane) (b : GDriver) : GDriver := + scaleDriver ‖w.1‖₊ b + +lemma continuous_normalizeDriver : Continuous (fun p : UpperPlane×GDriver => normalizeDriver p.1 p.2) := by + apply Continuous.subtype_mk + apply ContinuousMap.continuous_of_continuous_uncurry + change Continuous (fun p : (UpperPlane×GDriver)×ℝ≥0 => + ‖p.1.1.1‖⁻¹*p.1.2.1 (‖p.1.1.1‖₊^2*p.2)) + have hn : Continuous (fun p : (UpperPlane×GDriver)×ℝ≥0 => ‖p.1.1.1‖) := by fun_prop + have ht : Continuous (fun p : (UpperPlane×GDriver)×ℝ≥0 => + ‖p.1.1.1‖₊^2*p.2) := by + exact ((hn.pow 2).mul (NNReal.continuous_coe.comp continuous_snd)).subtype_mk _ + exact (hn.inv₀ (fun p=>(point_norm_pos p.1.1).ne')).mul + (continuous_eval.comp ((continuous_subtype_val.comp continuous_fst.snd).prodMk + ht)) + +lemma radiusDensity_scaled (a : ℝ) (ha : 0 b.1 t) W) + (a : ℝ) (ha : 1/4 Real.cos x*r*Real.sin x^(r-1)) + (deriv (deriv (sinePower r)) θ) θ := by + rw [sinePower_secondDeriv r θ hθ] + convert ((Real.hasDerivAt_cos θ).mul_const r).mul + ((Real.hasDerivAt_sin θ).rpow_const (p := r-1) (Or.inl hθ.ne')) using 1 + congr 2 + ring_nf + +lemma regFactor_secondDeriv (a δ θ : ℝ) (hθ : 0 < Real.sin θ) : + deriv (deriv (regFactor a δ)) θ = deriv (deriv (sinePower (regP a))) θ + + δ*deriv (deriv (sinePower (regQ a))) θ := by + have he : deriv (regFactor a δ) =ᶠ[𝓝 θ] + (fun x => Real.cos x*regP a*Real.sin x^(regP a-1) + + δ*(Real.cos x*regQ a*Real.sin x^(regQ a-1))) := by + have hp : ∀ᶠ x in 𝓝 θ, 0 < Real.sin x := + (isOpen_lt continuous_const Real.continuous_sin).mem_nhds hθ + filter_upwards [hp] with x hx using (regFactor_hasDerivAt a δ x hx).deriv + rw [he.deriv_eq] + exact ((sineDerivative_hasDerivAt (regP a) θ hθ).add + ((sineDerivative_hasDerivAt (regQ a) θ hθ).const_mul δ)).deriv + +lemma regFactor_generator (a δ θ : ℝ) (hθ : 0 < Real.sin θ) : + angleGenerator (1-2*a) (regFactor a δ) θ = + angleGenerator (1-2*a) (sinePower (regP a)) θ + + δ*angleGenerator (1-2*a) (sinePower (regQ a)) θ := by + dsimp only [angleGenerator] + rw [regFactor_secondDeriv a δ θ hθ,(regFactor_hasDerivAt a δ θ hθ).deriv, + (sinePower_hasDerivAt (regP a) θ hθ).deriv, + (sinePower_hasDerivAt (regQ a) θ hθ).deriv] + ring + +lemma sinePower_mul_cot_sq (r θ : ℝ) (hθ : 0 < Real.sin θ) : + sinePower r θ*Real.cot θ^2 = Real.sin θ^(r-2)-sinePower r θ := by + dsimp only [sinePower] + rw [Real.cot_eq_cos_div_sin,div_pow,Real.rpow_sub hθ,Real.rpow_two] + field_simp + nlinarith [Real.sin_sq_add_cos_sq θ] + +lemma regFactor_exact_drift (a δ σ θ : ℝ) (hθ : 0 < Real.sin θ) : + regNormalizedDrift a δ σ θ = δ/regFactor a δ θ * + (regP a/2+(regP a-regQ a)*(1+regQ a)/2*Real.sin θ^(regQ a) - + regK a*Real.sin θ^(regQ a-2) + σ*(1+Real.sin θ^(regQ a))) := by + have hG := angleGenerator_sinePower (1-2*a) (regQ a) θ hθ + have hP := angleGenerator_sinePower (1-2*a) (regP a) θ hθ + have hpq : regP a-1+2*(1-2*a) = 0 := by dsimp [regP]; ring + have hqp : regQ a-1+2*(1-2*a) = regQ a-regP a := by dsimp [regP]; ring + simp only [hpq,hqp] at hP hG + rw [show sinePower (regQ a) θ * + (-regQ a/2+regQ a*(regQ a-regP a)/2*Real.cot θ^2) = + -regQ a/2*sinePower (regQ a) θ + regQ a*(regQ a-regP a)/2* + (sinePower (regQ a) θ*Real.cot θ^2) by ring, + sinePower_mul_cot_sq _ _ hθ] at hG + dsimp only [regNormalizedDrift] + rw [regFactor_generator a δ θ hθ,hP,hG] + dsimp only [regFactor,regK,sinePower] + ring + +end ExactSLEFiniteTilt + +namespace ExactSLEFiniteTilt + +lemma regFactor_bounds {a δ θ : ℝ} (ha : 1/4 < a) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hθ : 0 < Real.sin θ) : + 0 < regFactor a δ θ ∧ δ ≤ regFactor a δ θ ∧ + Real.sin θ^(regP a) ≤ regFactor a δ θ ∧ regFactor a δ θ ≤ 3 := by + have hs1 := Real.sin_le_one θ + have hp := Real.rpow_pos_of_pos hθ (regP a) + have hq := Real.rpow_pos_of_pos hθ (regQ a) + have hp1 := Real.rpow_le_one hθ.le hs1 (regP_pos ha).le + have hq1 := Real.rpow_le_one hθ.le hs1 (regQ_pos ha).le + dsimp only [regFactor,sinePower] + have hmul := mul_nonneg hδ.le hq.le + have hm1 := mul_le_mul_of_nonneg_left hq1 hδ.le + constructor + · positivity + constructor + · nlinarith + constructor + · nlinarith + · nlinarith + +lemma regDrift_bound {a δ σ θ : ℝ} (ha : 1/4 < a) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hσ : |σ| ≤ regBeta a) (hθ : 0 < Real.sin θ) : + regNormalizedDrift a δ σ θ ≤ regC a*δ-regK a/2*regD a δ θ := by + obtain ⟨hfp,hδf,hspf,hf3⟩ := regFactor_bounds ha hδ hδ1 hθ + have hp := regP_pos ha + have hq := regQ_pos ha + have hq1 := regQ_lt_one ha + have hpq := sub_pos.mpr (regQ_lt_p ha) + have hk := regK_pos ha + have hA := regA_pos ha + have hs0 := Real.rpow_pos_of_pos hθ (regQ a) + have hs1 := Real.rpow_le_one hθ.le (Real.sin_le_one θ) hq.le + have hσ1 : σ ≤ 1 := (le_abs_self σ).trans (hσ.trans (regBeta_le_one a)) + have hσterm := mul_le_mul_of_nonneg_right hσ1 (show 0 ≤ 1+Real.sin θ^(regQ a) by positivity) + have hqterm := mul_le_mul_of_nonneg_left hs1 + (show 0 ≤ (regP a-regQ a)*(1+regQ a)/2 by positivity) + have hbracket : regP a/2+(regP a-regQ a)*(1+regQ a)/2*Real.sin θ^(regQ a) - + regK a*Real.sin θ^(regQ a-2) + σ*(1+Real.sin θ^(regQ a)) ≤ + regA a-regK a*Real.sin θ^(regQ a-2) := by + dsimp only [regA]; linarith + have hx : 0 ≤ δ/regFactor a δ θ := (div_pos hδ hfp).le + have hraw := mul_le_mul_of_nonneg_left hbracket hx + rw [←regFactor_exact_drift a δ σ θ hθ] at hraw + have hD : 0 ≤ regD a δ θ := mul_nonneg hx (Real.rpow_nonneg hθ.le _) + by_cases hsmall : Real.sin θ < regH a + · have hpow := Real.rpow_le_rpow_of_nonpos hθ hsmall.le (show regQ a-2 ≤ 0 by linarith) + rw [regH_power ha] at hpow + have hthresh : regA a ≤ regK a/2*Real.sin θ^(regQ a-2) := by + have hh := (div_le_iff₀ hk).mp hpow + nlinarith + have hh := mul_le_mul_of_nonneg_left hthresh hx + have hCδ : 0 ≤ regC a*δ := mul_nonneg (regC_pos ha).le hδ.le + dsimp only [regD] + nlinarith + · have hpow := Real.rpow_le_rpow (regH_pos ha).le (le_of_not_gt hsmall) hp.le + have hpowf := hpow.trans hspf + have hdiv := div_le_div_of_nonneg_left hA.le (Real.rpow_pos_of_pos (regH_pos ha) (regP a)) hpowf + have hh := mul_le_mul_of_nonneg_left hdiv hδ.le + have hC : regC a = regA a/(regH a^(regP a)) := by + dsimp [regC]; rw [Real.rpow_neg (regH_pos ha).le]; ring + rw [←hC] at hh + have hKD := mul_nonneg hk.le hD + dsimp only [regD] at hD hKD ⊢ + simp only [div_eq_mul_inv] at hraw hh hKD ⊢ + nlinarith only [hraw,hh,hKD] + +end ExactSLEFiniteTilt + +namespace ExactSLEFiniteTilt + +lemma regFactor_derivative_simple {a δ θ : ℝ} (ha : 1/4 < a) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hθ : 0 < Real.sin θ) : + |deriv (regFactor a δ) θ| ≤ (regP a+regQ a)*Real.sin θ^(regQ a-1) := by + have hp := regP_pos ha + have hq := regQ_pos ha + have hpq := regQ_lt_p ha + have hs1 := Real.sin_le_one θ + have hsp := Real.rpow_pos_of_pos hθ (regP a-1) + have hsq := Real.rpow_pos_of_pos hθ (regQ a-1) + have hpow := Real.rpow_le_rpow_of_exponent_ge hθ hs1 (show regQ a-1 ≤ regP a-1 by linarith) + have hpp := mul_le_mul_of_nonneg_left hpow hp.le + have hδp := mul_le_mul_of_nonneg_right hδ1 (mul_nonneg hq.le hsq.le) + have hcos := mul_le_mul_of_nonneg_right (Real.abs_cos_le_one θ) + (show 0 ≤ regP a*Real.sin θ^(regP a-1)+δ*regQ a*Real.sin θ^(regQ a-1) by positivity) + rw [(regFactor_hasDerivAt a δ θ hθ).deriv] + rw [show Real.cos θ*regP a*Real.sin θ^(regP a-1)+ + δ*(Real.cos θ*regQ a*Real.sin θ^(regQ a-1)) = + Real.cos θ*(regP a*Real.sin θ^(regP a-1)+δ*regQ a*Real.sin θ^(regQ a-1)) by ring] + rw [abs_mul,abs_of_nonneg (show 0 ≤ regP a*Real.sin θ^(regP a-1)+ + δ*regQ a*Real.sin θ^(regQ a-1) by positivity)] + nlinarith + +lemma regFactor_interpolation {a δ θ : ℝ} (ha : 1/4 < a) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hθ : 0 < Real.sin θ) : + Real.sin θ^(regQ a-1)/regFactor a δ θ ≤ + 3^(regEta a)*δ^(-1-regEta a)*(regD a δ θ)^(regEta a) := by + obtain ⟨hfp,hδf,hspf,hf3⟩ := regFactor_bounds ha hδ hδ1 hθ + have hη := regEta_pos ha + have hs := Real.rpow_pos_of_pos hθ (regQ a-1) + have hiden : 3^(regEta a)*δ^(-1-regEta a)*(regD a δ θ)^(regEta a) = + (3/regFactor a δ θ)^(regEta a)*Real.sin θ^(regQ a-1)/δ := by + dsimp only [regD] + rw [Real.mul_rpow (div_nonneg hδ.le hfp.le) (Real.rpow_nonneg hθ.le _), + Real.div_rpow hδ.le hfp.le,←Real.rpow_mul hθ.le, + mul_comm (regQ a-2) (regEta a),regEta_identity ha, + Real.rpow_sub hδ,Real.rpow_neg_one, + Real.div_rpow (by norm_num : (0 : ℝ) ≤ 3) hfp.le] + field_simp + have hpow : 1 ≤ (3/regFactor a δ θ)^(regEta a) := + Real.one_le_rpow ((one_le_div hfp).mpr hf3) hη.le + have hdiv := div_le_div_of_nonneg_left hs.le hδ hδf + rw [hiden] + calc + _ ≤ Real.sin θ^(regQ a-1)/δ := hdiv + _ ≤ _ := div_le_div_of_nonneg_right + (by nlinarith [mul_le_mul_of_nonneg_right hpow hs.le]) hδ.le + +lemma regDerivative_bound {a δ θ : ℝ} (ha : 1/4 < a) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hθ : 0 < Real.sin θ) : + |deriv (regFactor a δ) θ|/regFactor a δ θ ≤ + (regP a+regQ a)*3^(regEta a)*δ^(-1-regEta a)*(regD a δ θ)^(regEta a) := by + have hf := (regFactor_bounds ha hδ hδ1 hθ).1 + have hsimple := div_le_div_of_nonneg_right (regFactor_derivative_simple ha hδ hδ1 hθ) hf.le + have hinter := mul_le_mul_of_nonneg_left (regFactor_interpolation ha hδ hδ1 hθ) + (add_nonneg (regP_pos ha).le (regQ_pos ha).le) + calc + _ ≤ (regP a+regQ a)*Real.sin θ^(regQ a-1)/regFactor a δ θ := hsimple + _ = (regP a+regQ a)*(Real.sin θ^(regQ a-1)/regFactor a δ θ) := by ring + _ ≤ _ := hinter + _ = _ := by ring + + +theorem regularized_factor_estimates {a δ σ θ : ℝ} (ha : 1/4 < a) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hσ : |σ| ≤ regBeta a) + (hθ : θ ∈ Set.Ioo 0 Real.pi) : + 0 < regBeta a ∧ 2*regM a*regBeta a < a ∧ + 0 < regK a ∧ 0 < regC a ∧ + regNormalizedDrift a δ σ θ ≤ regC a*δ-regK a/2*regD a δ θ ∧ + |deriv (regFactor a δ) θ|/regFactor a δ θ ≤ + (regP a+regQ a)*3^(regEta a)*δ^(-1-regEta a)*(regD a δ θ)^(regEta a) := by + have hs := Real.sin_pos_of_pos_of_lt_pi hθ.1 hθ.2 + exact ⟨regBeta_pos ha,regBeta_discount ha,regK_pos ha,regC_pos ha, + regDrift_bound ha hδ hδ1 hσ hs,regDerivative_bound ha hδ hδ1 hs⟩ + +end ExactSLEFiniteTilt + +namespace ExactSLEGreen +open ExactSLECalculus ExactSLEFiniteTilt +noncomputable def physicalDelta (a cap σ off : ℝ) (v : State) : ℝ := + Real.exp (off+σ*physicalClock a cap v) +noncomputable def physicalRegularized (a cap σ off : ℝ) (v : State) : ℝ := + clockExp a cap (regP a/2) v/3*regFactor a (physicalDelta a cap σ off v) (physicalTheta v) +lemma clockExp_shift (a cap c σ off : ℝ) (v : State) : + clockExp a cap c v*physicalDelta a cap σ off v = Real.exp off*clockExp a cap (c+σ) v := by + dsimp only [clockExp,physicalDelta] + rw [← Real.exp_add,← Real.exp_add] + congr 1 + ring +lemma physicalRegularized_decomposition (a cap σ off : ℝ) : + physicalRegularized a cap σ off = fun v => (1/3:ℝ)* + (clockExp a cap (regP a/2) v*angleLift (sinePower (regP a)) v + + Real.exp off*(clockExp a cap (regP a/2+σ) v + + clockExp a cap (regP a/2+σ) v*angleLift (sinePower (regQ a)) v)) := by + funext v + have h := clockExp_shift a cap (regP a/2) σ off v + dsimp only [physicalRegularized,regFactor,angleLift] + nlinarith only [h,h |> congrArg (fun x => x*sinePower (regQ a) (physicalTheta v))] +lemma physicalRegularized_smooth (a cap σ off : ℝ) (v : State) (hv : 0 Real.exp off) v := differentiableAt_const _ + erw [physicalRegularized_decomposition,N_const_mul ((he.mul hp).add (hconst.mul (hc.add (hc.mul hq)))) (1/3:ℝ), + N_add (he.mul hp) (hconst.mul (hc.add (hc.mul hq))),N_const_mul (hc.add (hc.mul hq)) (Real.exp off), + N_add hc (hc.mul hq),N_mul he hp,N_mul hc hq, + clockExp_N a cap (regP a/2) v hv,clockExp_N a cap (regP a/2+σ) v hv, + angleLift_N _ v hv (sinePower_hasDerivAt (regP a) _ hs).differentiableAt, + angleLift_N _ v hv (sinePower_hasDerivAt (regQ a) _ hs).differentiableAt, + (regFactor_hasDerivAt a _ _ hs).deriv, + (sinePower_hasDerivAt (regP a) _ hs).deriv,(sinePower_hasDerivAt (regQ a) _ hs).deriv] + have h := clockExp_shift a cap (regP a/2) σ off v + linear_combination -(Real.cos (physicalTheta v)*regQ a* + Real.sin (physicalTheta v)^(regQ a-1)*physicalV v/3)*h + + +theorem actual_regularized_factor {a cap σ off : ℝ} (ha : 1/4 + radialTime a p.1.1 p.2.1 (p.2.1.im*q)) := by + have ha0 : 0 p.2.1 + let b : Ω → ExactSLEGenerator.Driver := Prod.fst + have hz (ω : Ω) : 0<(z ω).im := ω.2.2 + have hzM : Measurable z := measurable_subtype_coe.comp measurable_snd + have hbM : Measurable b := measurable_fst + let ρ : Ω → ℝ := fun ω => (z ω).im*q + have hρ (ω : Ω) : 0<ρ ω := mul_pos (hz ω) hq + have hr (ω : Ω) : ρ ω≤(z ω).im := mul_le_of_le_one_right (hz ω).le hq1 + let δ : ℕ → Ω → ℝ := fun n ω => angleThreshold (z ω) n + let L (n : ℕ) (ω : Ω) := explicitRadialLocalization a ha0 (z ω) (hz ω) (ρ ω) (δ n ω) + (hρ ω) (hr ω) (angleThreshold_pos (z ω) (hz ω) n) (angleThreshold_initial (z ω) (hz ω) n) + have hρM : Measurable ρ := hzM.im.mul_const q + have hδM (n : ℕ) : Measurable (δ n) := by + dsimp [δ,angleThreshold] + exact (hzM.im.div hzM.norm).div_const _ + have hεM (n : ℕ) : Measurable (fun ω => (L n ω).ε) := by + change Measurable (fun ω => heightFloor (z ω).im (ρ ω) (δ n ω)/2) + unfold heightFloor + fun_prop + have hNM (n : ℕ) : Measurable (fun ω => (L n ω).N) := by + change Measurable (fun ω => (⟨(z ω).im/δ n ω+logCeiling (z ω).im (ρ ω) (δ n ω)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + unfold logCeiling heightFloor + fun_prop + have hBM (n : ℕ) : Measurable (fun ω => (L n ω).B) := by + change Measurable (fun ω => (⟨(z ω).im^2/(2*a*(δ n ω)^2)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + fun_prop + let T (n : ℕ) (ω : Ω) := regionStop a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (b ω) + have hTM (n : ℕ) : Measurable (T n) := + regionStop_parameter_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b _ ρ (δ n) _ (hεM n) hzM hbM + (measurable_subtype_coe.comp (hNM n)) hρM (hδM n) (hBM n) + let V (n : ℕ) (ω : Ω) := localState a (L n ω).ε (L n ω).hε (z ω) (T n ω) (b ω) + have hVM (n : ℕ) : Measurable (V n) := + ((localState_parameter_joint_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) + z b (hεM n) hzM hbM).comp ((hTM n).prodMk measurable_id)) + apply measurable_of_Iic + intro t + by_cases ht : t=∞ + · subst t + simp + have he : (fun ω : Ω => radialTime a (b ω).1 (z ω) (ρ ω)) ⁻¹' Iic t = + ⋃ n : ℕ, {ω | T n ω ≤ t.toNNReal} ∩ {ω | physicalRadius (V n ω) = ρ ω} := by + ext ω + simp only [mem_preimage,mem_Iic,mem_iUnion,mem_inter_iff,mem_ofPred_eq] + constructor + · intro hrt + have hfin : radialTime a (b ω).1 (z ω) (ρ ω) ≠ ∞ := ne_top_of_le_ne_top ht hrt + let r := (radialTime a (b ω).1 (z ω) (ρ ω)).toNNReal + have hhit := radialTime_attained a ha0 (z ω) (hz ω) (ρ ω) (hρ ω) (hr ω) (b ω) hfin + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a (b ω).1 (b ω).1.continuous (z ω) r hhit.1 + obtain ⟨n,hn⟩ := ((angleThreshold_tendsto (z ω)).eventually (gt_mem_nhds hη)).exists + have hTr : T n ω≤r := regionStop_le_hit a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (L n ω).initial (b ω) r hhit.2 + have hrt' : r≤t.toNNReal := ENNReal.toNNReal_mono ht hrt + refine ⟨n,hTr.trans hrt',?_⟩ + rcases regionStop_true_exit a (L n ω).ε ha0 (L n ω).hε (z ω) (L n ω).N + (ρ ω) (δ n ω) (hρ ω) (angleThreshold_pos (z ω) (hz ω) n) (L n ω).B + (L n ω).initial (L n ω).small (L n ω).large (L n ω).time (b ω) with hR|hS + · exact hR + · have hact := regionStop_actualState a (L n ω).ε (L n ω).hε (z ω) (L n ω).N + (ρ ω) (δ n ω) (L n ω).B (L n ω).initial (b ω) (T n ω) le_rfl + have hs := regionStop_safe a (L n ω).ε (L n ω).hε (z ω) (L n ω).N + (ρ ω) (δ n ω) (L n ω).B (L n ω).initial (b ω) (T n ω) le_rfl + have hp : 0 < ‖(V n ω).1‖ := ((L n ω).hε.trans_le hs.1).trans_le (Complex.im_le_norm _) + have hd : Y (V n ω)/‖(V n ω).1‖ = δ n ω := (div_eq_iff hp.ne').mpr hS + have hη' := hηs (T n ω) hTr + rw [hact.2,hd] at hη' + exact False.elim (not_le.mpr hn hη') + · rintro ⟨n,hnt,hR⟩ + have heq := regionStop_eq_radialTime a (L n ω).ε (L n ω).hε (z ω) (L n ω).N + (ρ ω) (δ n ω) (L n ω).B (L n ω).initial (b ω) hR + rw [heq] + exact (ENNReal.coe_le_coe.mpr hnt).trans_eq (ENNReal.coe_toNNReal ht) + rw [he] + exact MeasurableSet.iUnion (fun n => (measurableSet_le (hTM n) measurable_const).inter + (measurableSet_eq_fun (physicalRadius_continuous.measurable.comp (hVM n)) hρM)) + +theorem joint_radial_approximant_measurable (a : ℝ) (ha : 1/4 < a) (q : ℝ) + (hq : 0 < q) (hq1 : q ≤ 1) : + Measurable (fun p : (ExactSLEGenerator.Driver × {z : ℂ // 0 < z.im}) × ℝ≥0∞ => + if radialTime a p.1.1.1 p.1.2.1 (p.1.2.1.im*q) ≤ p.2 then + radialWeight a p.1.1.1 p.1.2.1 (p.1.2.1.im*q) else 0) := by + exact ((joint_radialWeight_measurable a ha q hq hq1).comp measurable_fst).ite + (measurableSet_le ((joint_radialTime_measurable a ha q hq hq1).comp measurable_fst) measurable_snd) + measurable_const +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Set Filter Topology +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped Classical NNReal ENNReal +noncomputable def timeMassDensity (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ≥0∞ := + if radialTime a b.1 z (z.im*q) ≤ t then massDensity a q b z else 0 +noncomputable def actualMassEval (a q : ℝ) (t : ℝ≥0∞) + (K : Set ℂ) (f : ℂ → ℝ) (b : ExactSLEGenerator.Driver) : ℝ := + ∫ z in K, f z * (timeMassDensity a q t b z).toReal +lemma timeMassDensity_le (a q : ℝ) (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) (z : ℂ) : + timeMassDensity a q t b z ≤ massDensity a q b z := by + unfold timeMassDensity + split_ifs <;> simp + +lemma timeMassDensity_measurable (a : ℝ) (ha : 1/4 timeMassDensity a q t p.1 p.2) := by + let U : Set (ExactSLEGenerator.Driver × ℂ) := {p | 0 ENNReal.ofReal (Real.exp (-alpha a*Real.log 2)* + (if radialTime a p.1.1.1 p.1.2 (p.1.2.im*q)≤t then + radialWeight a p.1.1.1 p.1.2 (p.1.2.im*q) else 0))) := by + have hp : Measurable (fun p : U => ((p.1.1, (⟨p.1.2,p.2⟩ : {z : ℂ // 0 0) measurable_const hU + convert h using 1 + funext p + have he : 2*p.2.im*q/2=p.2.im*q := by ring + by_cases hz : 0 by_cases ht : radialTime a p.1.1 p.2 (p.2.im*q)≤t <;> + simp [timeMassDensity,massDensity,fullRadialDensity,U,hz,ht,he] + +lemma actualMassEval_measurable (a : ℝ) (ha : 1/4 + f p.2 * (timeMassDensity a q t p.1 p.2).toReal) := + (hf.comp measurable_snd).mul (timeMassDensity_measurable a ha q hq hq1 t).ennreal_toReal + exact hm.stronglyMeasurable.integral_prod_right.measurable + +lemma actualMassEval_enorm_bound (a q : ℝ) (t : ℝ≥0∞) (K : Set ℂ) (f : ℂ → ℝ) + (b : ExactSLEGenerator.Driver) : + ‖actualMassEval a q t K f b‖ₑ ≤ + ∫⁻ z in K, ENNReal.ofReal ‖f z‖ * massDensity a q b z := by + refine (enorm_integral_le_lintegral_enorm _).trans ?_ + apply lintegral_mono + intro z + dsimp only + rw [enorm_mul, Real.enorm_eq_ofReal_abs, ←Real.norm_eq_abs, + Real.enorm_eq_ofReal ENNReal.toReal_nonneg] + exact mul_le_mul' le_rfl (ENNReal.ofReal_toReal_le.trans (timeMassDensity_le a q t b z)) + +lemma actualMassEval_L2_bound (a : ℝ) (ha : 1/4 b.1 t) W) + (K : Set ℂ) (hK : MeasurableSet K) (hKb : Bornology.IsBounded K) + (c : ℝ) (hc : 0 ‖f z‖) hf.norm + (fun _ _ => norm_nonneg _) hfB + let A := ∫⁻ x : Fin 2 → ℂ, (∏ i, ENNReal.ofReal ‖f (x i)‖)* + ExactSLEKernel.kernel (alpha a) c x ∂Measure.pi (fun _ => volume.restrict K) + let D := (ENNReal.ofReal C*A)^(1/(2:ℝ)) + have hD : D<∞ := ENNReal.rpow_lt_top_of_nonneg (by norm_num) (ENNReal.mul_lt_top ENNReal.ofReal_lt_top hAfin).ne + refine ⟨D,hD,?_⟩ + intro q hq hq1 t + have hnorm : eLpNorm (actualMassEval a q t K f) 2 W≤D := by + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal (by norm_num) (by norm_num) + (actualMassEval_measurable a ha q hq hq1 t K f hf).aestronglyMeasurable] + norm_num only [ENNReal.toReal_ofNat] + apply ENNReal.rpow_le_rpow _ (by norm_num) + calc + _ ≤ ∫⁻ b, (∫⁻ z in K, ENNReal.ofReal ‖f z‖*massDensity a q b z)^2 ∂W := by + apply lintegral_mono + intro b + change ‖actualMassEval a q t K f b‖ₑ^(2:ℝ) ≤ + (∫⁻ z in K, ENNReal.ofReal ‖f z‖*massDensity a q b z)^(2:ℕ) + rw [ENNReal.rpow_two] + exact pow_le_pow_left' (actualMassEval_enorm_bound a q t K f b) 2 + _ ≤ _ := hB q hq hq1 + exact ⟨hnorm.trans_lt hD,hnorm⟩ + +theorem actualMassEval_integrable (a : ℝ) (ha : 1/4 f z*(timeMassDensity a q t b z).toReal) (volume.restrict K) := by + obtain ⟨B,hB,hBf⟩ := hfB + let D := (c*q)^(-alpha a) + have hD : 0≤D := Real.rpow_nonneg (mul_pos hc hq).le _ + have hd (z : ℂ) (hzK : z∈K) : (timeMassDensity a q t b z).toReal≤D := by + have hz : 0 timeMassDensity a q t b z) := + (timeMassDensity_measurable a ha q hq hq1 t).comp (measurable_const.prodMk measurable_id) + apply Integrable.of_bound ((hf.mul hm.ennreal_toReal).aestronglyMeasurable) (B*D) + filter_upwards [ae_restrict_mem hK] with z hz + change ‖f z*(timeMassDensity a q t b z).toReal‖ ≤ B*D + rw [norm_mul,Real.norm_of_nonneg ENNReal.toReal_nonneg] + exact mul_le_mul (hBf z hz) (hd z hz) ENNReal.toReal_nonneg hB +theorem actual_common_mass_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (K : ℕ → Set ℂ) (hK : ∀ i, MeasurableSet (K i)) + (hKb : ∀ i, Bornology.IsBounded (K i)) + (c : ℕ → ℝ) (hc : ∀ i, 0 X j i b) =ᵐ[W] + actualMassEval a (Real.exp (-2*a*(j+1))) (t i) (K i) (f i)) ∧ + (∀ k j, j∈s k → k≤j) ∧ + (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ i, Tendsto (fun k => ∑ j∈s k, coeff k j • X j i) atTop (𝓝 (v i))) ∧ + (∀ᵐ b ∂W, ∀ i, Tendsto (fun k => ∑ j∈s k, coeff k j * + actualMassEval a (Real.exp (-2*a*(j+1))) (t i) (K i) (f i) b) + atTop (𝓝 (v i b))) + := by + choose C hC hBound using fun i => actualMassEval_L2_bound a ha W hW (K i) (hK i) (hKb i) + (c i) (hc i) (hcK i) (f i) (hf i) (hfB i) + let q := fun j : ℕ => Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 (hBound i (q j) (hq j) (hq1 j) (t i)).1 + let X := fun j i => (hLp j i).toLp (actualMassEval a (q j) (t i) (K i) (f i)) + have hX (i : ℕ) : ∃ B : ℝ, ∀ j, ‖X j i‖≤B := by + refine ⟨(C i).toReal,?_⟩ + intro j + rw [Lp.norm_toLp] + exact ENNReal.toReal_mono (hC i).ne (hBound i (q j) (hq j) (hq1 j) (t i)).2 + obtain ⟨s,coeff,v,hs,hcoeff,hsum,hconv,hae⟩ := common_L2_convex_tails W X hX + have he j i : (fun b => X j i b) =ᵐ[W] actualMassEval a (q j) (t i) (K i) (f i) := + (hLp j i).coeFn_toLp + refine ⟨X,s,coeff,v,he,hs,hcoeff,hsum,hconv,?_⟩ + have heall : ∀ᵐ b ∂W, ∀ j i, X j i b=actualMassEval a (q j) (t i) (K i) (f i) b := + ae_all_iff.mpr fun j => ae_all_iff.mpr fun i => he j i + filter_upwards [hae,heall] with b hb heq + intro i + simpa only [heq] using hb i + +end ExactSLEGreen + +open MeasureTheory Filter Topology Set CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEMassExtraction +variable {X : Type*} [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +omit [T2Space X] [MeasurableSpace X] [BorelSpace X] in +theorem supported_dense_tests (K : Set X) (hK : IsCompact K) : + ∃ g : ℕ → C_c(X, ℝ), (∀ i, tsupport (g i) ⊆ K) ∧ + ∀ f : C_c(X, ℝ), tsupport f ⊆ K → ∀ ε > 0, + ∃ i, ∀ x, |f x - g i x| < ε := by + classical + let S := {f : C(X, ℝ) // tsupport f ⊆ K} + have : SecondCountableTopology C(X, ℝ) := inferInstance + have : SecondCountableTopology S := TopologicalSpace.Subtype.secondCountableTopology _ + have : Nonempty S := ⟨⟨0, by simp⟩⟩ + let d := TopologicalSpace.denseSeq S + let g : ℕ → C_c(X, ℝ) := fun i => + ⟨(d i).1, hK.of_isClosed_subset (isClosed_tsupport _) (d i).2⟩ + refine ⟨g, fun i => (d i).2, ?_⟩ + intro f hf ε hε + let s : S := ⟨f.toContinuousMap, hf⟩ + have hs : s ∈ closure (range d) := TopologicalSpace.denseRange_denseSeq S s + obtain ⟨v, hv, ht⟩ := mem_closure_iff_seq_limit.mp hs + have ht' : Tendsto (fun n => (v n).1) atTop (𝓝 s.1) := + continuous_subtype_val.continuousAt.tendsto.comp ht + have hu := (ContinuousMap.tendsto_iff_forall_isCompact_tendstoUniformlyOn.mp ht') K hK + obtain ⟨n, hn⟩ := (Metric.tendstoUniformlyOn_iff.mp hu ε hε).exists + obtain ⟨i, hi⟩ := hv n + refine ⟨i, fun x => ?_⟩ + by_cases hx : x ∈ K + · have H := hn x hx + rw [← hi] at H + exact H + · have hf0 : f x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx (hf h)) + have hg0 : g i x = 0 := image_eq_zero_of_notMem_tsupport (fun h => hx ((d i).2 h)) + simpa [hf0, hg0] using hε + +omit [MeasurableSpace X] [BorelSpace X] in +theorem cutoff_test (K : Set X) (hK : IsCompact K) : + ∃ g : C_c(X, ℝ), (∀ x, 0 ≤ g x) ∧ ∀ x ∈ K, g x = 1 := by + obtain ⟨g, hg, _, hc, hn⟩ := exists_continuous_one_zero_of_isCompact hK + isClosed_empty (disjoint_empty K) + exact ⟨⟨g, hc⟩, fun x => (hn x).1, fun x hx => hg hx⟩ + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + [MeasurableSpace X] [BorelSpace X] in +theorem positive_map_error (L : C_c(X, ℝ) →ₚ[ℝ] ℝ) + (f h g : C_c(X, ℝ)) (K : Set X) (hf : tsupport f ⊆ K) + (hh : tsupport h ⊆ K) (hg : ∀ x, 0 ≤ g x) (hg1 : ∀ x ∈ K, g x = 1) + {ε : ℝ} (hε : 0 ≤ ε) (he : ∀ x, |f x - h x| ≤ ε) : + |L f - L h| ≤ ε * L g := by + have hp : f - h ≤ ε • g := by + intro x + by_cases hx : x ∈ K + · simpa [hg1 x hx] using (abs_le.mp (he x)).2 + · have hf0 := image_eq_zero_of_notMem_tsupport (fun H => hx (hf H)) + have hh0 := image_eq_zero_of_notMem_tsupport (fun H => hx (hh H)) + simpa [hf0, hh0] using mul_nonneg hε (hg x) + have hm : -(ε • g) ≤ f - h := by + intro x + by_cases hx : x ∈ K + · simpa [hg1 x hx] using (abs_le.mp (he x)).1 + · have hf0 := image_eq_zero_of_notMem_tsupport (fun H => hx (hf H)) + have hh0 := image_eq_zero_of_notMem_tsupport (fun H => hx (hh H)) + simpa [hf0, hh0] using neg_nonpos.mpr (mul_nonneg hε (hg x)) + exact abs_le.mpr ⟨by simpa using L.monotone' hm, by simpa using L.monotone' hp⟩ + +theorem determining_tests_radon_limit + (X : Type*) [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] : + ∃ tests : ℕ → C_c(X, ℝ), ∀ L : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ), + (∀ i, ∃ v : ℝ, Tendsto (fun j => L j (tests i)) atTop (𝓝 v)) → + ∃ μ : Measure X, IsFiniteMeasureOnCompacts μ ∧ μ.Regular ∧ + ∀ f : C_c(X, ℝ), Tendsto (fun j => L j f) atTop (𝓝 (∫ x, f x ∂μ)) := by + classical + let K := CompactExhaustion.choice X + choose d hd hdense using fun n => supported_dense_tests (K n) (K.isCompact n) + choose g hg hg1 using fun n => cutoff_test (K n) (K.isCompact n) + let e := Denumerable.eqv ((ℕ × ℕ) ⊕ ℕ) + let tests : ℕ → C_c(X, ℝ) := fun i => Sum.elim (fun p => d p.1 p.2) g (e.symm i) + refine ⟨tests, ?_⟩ + intro L hL + have hdL (n i : ℕ) : ∃ v : ℝ, Tendsto (fun j => L j (d n i)) atTop (𝓝 v) := by + simpa [tests] using hL (e (.inl (n,i))) + have hgL (n : ℕ) : ∃ v : ℝ, Tendsto (fun j => L j (g n)) atTop (𝓝 v) := by + simpa [tests] using hL (e (.inr n)) + have hc (f : C_c(X, ℝ)) : CauchySeq (fun j => L j f) := by + obtain ⟨n, hn⟩ := K.exists_superset_of_isCompact f.hasCompactSupport + obtain ⟨v, hv⟩ := hgL n + obtain ⟨C, hC⟩ := hv.bddAbove_range + let D := max C 1 + have hD : 0 < D := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hDj (j : ℕ) : L j (g n) ≤ D := (hC (mem_range_self j)).trans (le_max_left _ _) + apply Metric.cauchySeq_iff.mpr + intro ε hε + let δ := ε / (4*D) + have hδ : 0 < δ := div_pos hε (mul_pos (by norm_num) hD) + obtain ⟨i, hi⟩ := hdense n f hn δ hδ + have herr (j : ℕ) : |L j f-L j (d n i)| ≤ ε/4 := by + have H := positive_map_error (L j) f (d n i) (g n) (K n) hn (hd n i) + (hg n) (hg1 n) hδ.le (fun x => (hi x).le) + have hh : δ*D=ε/4 := by dsimp [δ]; field_simp + exact H.trans ((mul_le_mul_of_nonneg_left (hDj j) hδ.le).trans_eq hh) + obtain ⟨w, hw⟩ := hdL n i + obtain ⟨N, hN⟩ := Metric.cauchySeq_iff.mp hw.cauchySeq (ε/2) (by positivity) + refine ⟨N, fun j hj k hk => ?_⟩ + have hjk := hN j hj k hk + rw [Real.dist_eq] at hjk ⊢ + have H := abs_sub_le (L j f) (L j (d n i)) (L k f) + have H' := abs_sub_le (L j (d n i)) (L k (d n i)) (L k f) + have he := herr k + rw [abs_sub_comm] at he + linarith [herr j] + choose V hV using fun f : C_c(X, ℝ) => cauchySeq_tendsto_of_complete (hc f) + let Λ : C_c(X, ℝ) →ₚ[ℝ] ℝ := PositiveLinearMap.mk₀ + { toFun := V + map_add' := fun f h => by + apply tendsto_nhds_unique (hV (f+h)) + simpa only [map_add] using (hV f).add (hV h) + map_smul' := fun r f => by + apply tendsto_nhds_unique (hV (r • f)) + simpa only [map_smul, smul_eq_mul, RingHom.id_apply] using (hV f).const_mul r } + (fun f hf => ge_of_tendsto' (hV f) (fun j => (L j).map_nonneg hf)) + refine ⟨RealRMK.rieszMeasure Λ, inferInstance, inferInstance, fun f => ?_⟩ + rw [RealRMK.integral_rieszMeasure] + exact hV f + +end ExactSLEMassExtraction + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal +abbrev UpperPlane := {z : ℂ // 0 < z.im} +noncomputable def upperArea : Measure UpperPlane := volume.comap Subtype.val +noncomputable def actualUpperMass (a q : ℝ) (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : + Measure UpperPlane := upperArea.withDensity (fun z => timeMassDensity a q t b z.1) +lemma upperPlane_open : IsOpen {z : ℂ | 0 < z.im} := isOpen_lt continuous_const Complex.continuous_im + +instance upperPlane_locallyCompact : LocallyCompactSpace UpperPlane := + upperPlane_open.isOpenEmbedding_subtypeVal.locallyCompactSpace + +lemma upper_embedding : MeasurableEmbedding (Subtype.val : UpperPlane → ℂ) := + MeasurableEmbedding.subtype_coe upperPlane_open.measurableSet + +lemma upper_compact_lower (K : Set UpperPlane) (hK : IsCompact K) : + ∃ c : ℝ, 0 hmin hw⟩ + · exact ⟨1, by norm_num, fun z hz => False.elim (hn ⟨z,hz⟩)⟩ + +lemma timeMassDensity_finite (a q : ℝ) (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) (z : ℂ) : + timeMassDensity a q t b z < ⊤ := by + apply lt_of_le_of_lt (timeMassDensity_le a q t b z) + unfold massDensity + split_ifs <;> simp + +lemma timeMassDensity_local_bound (a : ℝ) (ha : 1/4 ENNReal.ofReal ‖radialCoeff κ b T u‖ + have hm : Measurable (Function.uncurry F) := + (measurable_radial_norm hκ hT0).ennreal_ofReal.comp measurable_swap + have hmass : (volume.restrict (Ioc (0:ℝ) y)) univ = ENNReal.ofReal y := by simp + calc + _ ≤ ∫⁻ b : Driver, (ENNReal.ofReal y)^(lambda (a κ)-1)* + (∫⁻ u in Ioc (0:ℝ) y, (F b u)^(lambda (a κ))) ∂W := by + apply lintegral_mono + intro b + simpa [radialLength,F,hmass,Function.uncurry] using lintegral_pow_le_mass + (volume.restrict (Ioc (0:ℝ) y)) ((hm.comp (measurable_const.prodMk measurable_id)).aemeasurable) hl + _ = (ENNReal.ofReal y)^(lambda (a κ)-1)* + (∫⁻ u in Ioc (0:ℝ) y, ∫⁻ b : Driver, (F b u)^(lambda (a κ)) ∂W) := by + rw [lintegral_const_mul' _ _ (by finiteness), + lintegral_lintegral_swap (hm.pow_const _).aemeasurable] + _ ≤ (ENNReal.ofReal y)^(lambda (a κ)-1)* + (∫⁻ _u in Ioc (0:ℝ) y, ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)))) := by + apply mul_le_mul' le_rfl + apply setLIntegral_mono' measurableSet_Ioc + intro u hu + have he : (∫⁻ b : Driver, (F b u)^(lambda (a κ)) ∂W) = + ∫⁻ b : Driver, ENNReal.ofReal + (‖deriv (inverseFlow κ b T) (driverValue b T+u*Complex.I)‖^(lambda (a κ))) ∂W := by + congr 1 + funext b + simp only [F,radialCoeff,ite_eq_left hu.1,norm_mul,Complex.norm_I,mul_one] + exact ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) hp0.le + rw [he] + apply (inverse_deriv_moment_away hκ hκ8 hu.1 hδ hT hW).trans + apply ENNReal.ofReal_le_ofReal + gcongr <;> linarith [hu.1,hu.2] + _ = _ := by + rw [lintegral_const,hmass,ENNReal.ofReal_rpow_of_nonneg hy.le (by linarith : 0 ≤ lambda (a κ)-1), + ← ENNReal.ofReal_mul (by positivity),← ENNReal.ofReal_mul (by positivity)] + congr 1 + calc + y^(lambda (a κ)-1)*((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ))*y) = + (3/δ)^(zeta (a κ)/2)*(y^(lambda (a κ)-1)*y^(zeta (a κ))*y^((1:ℝ))) := by rw [Real.rpow_one]; ring + _ = (3/δ)^(zeta (a κ)/2)*y^(lambda (a κ)+zeta (a κ)) := by + rw [← Real.rpow_add hy,← Real.rpow_add hy] + congr 2 + ring +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory + +lemma measurable_radialLength {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (y : ℝ) : + Measurable (fun b : Driver => radialLength κ b T y) := + ((measurable_radial_norm hκ hT).ennreal_ofReal.comp measurable_swap).lintegral_prod_right' + +lemma radial_length_beta_tail {κ y T δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hδ : 0 < δ) (hT : δ ≤ T) {W : WienerLaw} (hW : IsWiener W) : + W {b : Driver | ENNReal.ofReal (y^(traceBeta κ)) ≤ radialLength κ b T y} ≤ + ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(2+traceEta κ)) := by + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + have hp := trace_exponents hκ hκ8 + have hl := (parameters ha).2.1 + have hK : 0 < y^(traceBeta κ) := Real.rpow_pos_of_pos hy _ + have hKP : 0 < (y^(traceBeta κ))^(lambda (a κ)) := Real.rpow_pos_of_pos hK _ + have hm := (measurable_radialLength hκ (hδ.le.trans hT) y).pow_const (lambda (a κ)) + calc + _ ≤ W {b : Driver | ENNReal.ofReal ((y^(traceBeta κ))^(lambda (a κ))) ≤ + (radialLength κ b T y)^(lambda (a κ))} := by + apply measure_mono + intro b hb + rw [← ENNReal.ofReal_rpow_of_nonneg hK.le hl.le] + exact ENNReal.rpow_le_rpow hb hl.le + _ ≤ (∫⁻ b : Driver, (radialLength κ b T y)^(lambda (a κ)) ∂W)/ + ENNReal.ofReal ((y^(traceBeta κ))^(lambda (a κ))) := + meas_ge_le_lintegral_div hm.aemeasurable (ne_of_gt (ENNReal.ofReal_pos.mpr hKP)) ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(lambda (a κ)+zeta (a κ)))/ + ENNReal.ofReal ((y^(traceBeta κ))^(lambda (a κ))) := + ENNReal.div_le_div_right (radial_length_moment hκ hκ8 hy hδ hT hW) _ + _ = _ := by + rw [← ENNReal.ofReal_div_of_pos hKP,← Real.rpow_mul hy.le,mul_div_assoc,← Real.rpow_sub hy] + congr 3 + linarith [hp.2.2.2] +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory +lemma refined_ratio (N : ℕ) (η : ℝ) : + (2:ℝ)^(2*N+1)*(((1/2:ℝ)^N)^(2+η)) = (1/2:ℝ)^((N:ℝ)*η-1) := by + rw [← Real.rpow_natCast_mul (by norm_num : (0:ℝ) ≤ 1/2)] + have he : (2:ℝ)^(2*N+1) = (1/2:ℝ)^(-((2*N+1:ℕ):ℝ)) := by + rw [Real.rpow_neg (by norm_num : (0:ℝ) ≤ 1/2),Real.rpow_natCast,← inv_pow] + norm_num + rw [he,← Real.rpow_add (by norm_num : (0:ℝ) < 1/2)] + congr 1 + push_cast + ring +lemma refined_sum_term (M N n : ℕ) (C η : ℝ) : + (((M*(2^(2*N+1))^n:ℕ):ℝ))*(C*(((1/2:ℝ)^N)^n)^(2+η)) = + ((M:ℝ)*C)*(((1/2:ℝ)^((N:ℝ)*η-1))^n) := by + rw [← refined_ratio N η,mul_pow] + push_cast + rw [← Real.rpow_natCast_mul (by positivity : 0 ≤ (1/2:ℝ)^N), + mul_comm (n:ℝ) (2+η),Real.rpow_mul_natCast (by positivity : 0 ≤ (1/2:ℝ)^N)] + ring + +def refinedHeight (N n : ℕ) : ℝ := ((1/2:ℝ)^N)^n + +def refinedGridTime (δ : ℝ) (N n k : ℕ) : ℝ := δ+(k:ℝ)/((2:ℝ)^(2*N+1))^n + +lemma refinedGridTime_ge (δ : ℝ) (N n k : ℕ) : δ ≤ refinedGridTime δ N n k := by + unfold refinedGridTime + exact le_add_of_nonneg_right (by positivity) + +def radialGridBad (κ δ : ℝ) (M N n : ℕ) : Set Driver := + ⋃ k : Fin (M*(2^(2*N+1))^n), {b : Driver | + ENNReal.ofReal ((refinedHeight N n)^(traceBeta κ)) ≤ + radialLength κ b (refinedGridTime δ N n k) (refinedHeight N n)} + +lemma radialGridBad_measure {κ δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hδ : 0 < δ) {W : WienerLaw} (hW : IsWiener W) (M N n : ℕ) : + W (radialGridBad κ δ M N n) ≤ + ENNReal.ofReal (((M:ℝ)*(3/δ)^(zeta (a κ)/2))* + (((1/2:ℝ)^((N:ℝ)*traceEta κ-1))^n)) := by + have hy : 0 < refinedHeight N n := by unfold refinedHeight; positivity + calc + _ ≤ ∑ k : Fin (M*(2^(2*N+1))^n), W {b : Driver | + ENNReal.ofReal ((refinedHeight N n)^(traceBeta κ)) ≤ + radialLength κ b (refinedGridTime δ N n k) (refinedHeight N n)} := + measure_iUnion_fintype_le W _ + _ ≤ ∑ _k : Fin (M*(2^(2*N+1))^n), ENNReal.ofReal + ((3/δ)^(zeta (a κ)/2)*(refinedHeight N n)^(2+traceEta κ)) := by + apply Finset.sum_le_sum + intro k _ + exact radial_length_beta_tail hκ hκ8 hy hδ (refinedGridTime_ge δ N n k) hW + _ = ENNReal.ofReal (((M*(2^(2*N+1))^n:ℕ):ℝ)* + ((3/δ)^(zeta (a κ)/2)*(refinedHeight N n)^(2+traceEta κ))) := by + rw [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ← ENNReal.ofReal_natCast,← ENNReal.ofReal_mul (Nat.cast_nonneg _)] + _ = _ := by rw [refinedHeight,refined_sum_term] + +lemma radialGridBad_summable {κ δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hδ : 0 < δ) {W : WienerLaw} (hW : IsWiener W) (M N : ℕ) + (hN : 1 < (N:ℝ)*traceEta κ) : + (∑' n : ℕ, W (radialGridBad κ δ M N n)) ≠ (∞:ℝ≥0∞) := by + have hr : |(1/2:ℝ)^((N:ℝ)*traceEta κ-1)| < 1 := by + rw [abs_of_pos (Real.rpow_pos_of_pos (by norm_num) _)] + exact Real.rpow_lt_one (by norm_num) (by norm_num) (by linarith) + apply ne_top_of_le_ne_top + (((summable_geometric_of_abs_lt_one hr).mul_left + ((M:ℝ)*(3/δ)^(zeta (a κ)/2))).tsum_ofReal_ne_top) + exact ENNReal.tsum_le_tsum (radialGridBad_measure hκ hκ8 hδ hW M N) + + + +theorem radial_length_refined_eventually {κ δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hδ : 0 < δ) {W : WienerLaw} (hW : IsWiener W) (M N : ℕ) + (hN : 1 < (N:ℝ)*traceEta κ) : + ∀ᵐ b ∂W, ∀ᶠ n : ℕ in atTop, ∀ k : Fin (M*(2^(2*N+1))^n), + radialLength κ b (refinedGridTime δ N n k) (refinedHeight N n) < + ENNReal.ofReal ((refinedHeight N n)^(traceBeta κ)) := by + filter_upwards [ae_eventually_notMem (radialGridBad_summable hκ hκ8 hδ hW M N hN)] with b hb + filter_upwards [hb] with n hn + intro k + apply lt_of_not_ge + intro h + exact hn (mem_iUnion.mpr ⟨k,h⟩) + + + +theorem radial_length_all_refined_grids {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∃ N : ℕ, 0 < N ∧ 1 < (N:ℝ)*traceEta κ ∧ + ∀ᵐ b ∂W, ∀ m M : ℕ, ∀ᶠ n : ℕ in atTop, ∀ k : Fin (M*(2^(2*N+1))^n), + radialLength κ b (refinedGridTime (1/((m:ℝ)+1)) N n k) (refinedHeight N n) < + ENNReal.ofReal ((refinedHeight N n)^(traceBeta κ)) := by + have hp := trace_exponents hκ hκ8 + obtain ⟨N,hN⟩ := exists_nat_gt (1/traceEta κ) + have hN' : 1 < (N:ℝ)*traceEta κ := (div_lt_iff₀ hp.2.2.1).mp hN + have hN0 : 0 < N := by + by_contra hh + have : N = 0 := Nat.eq_zero_of_not_pos hh + subst N + norm_num at hN' + refine ⟨N,hN0,hN',?_⟩ + apply ae_all_iff.mpr + intro m + apply ae_all_iff.mpr + intro M + exact radial_length_refined_eventually hκ hκ8 (by positivity) hW M N hN' +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open MeasureTheory + + + +lemma radial_increment_le {κ T y z : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) + (hz : 0 < z) (hzy : z ≤ y) (b : Driver) : + ENNReal.ofReal ‖inverseFlow κ b T (driverValue b T+y*Complex.I)- + inverseFlow κ b T (driverValue b T+z*Complex.I)‖ ≤ radialLength κ b T y := by + have hsub : Icc z y ⊆ Ioi (0:ℝ) := fun u hu => hz.trans_le hu.1 + have hc := (continuousOn_radialCoeff hκ hT b).mono hsub + have hi : IntervalIntegrable (radialCoeff κ b T) volume z y := + hc.intervalIntegrable_of_Icc hzy + have hd (u : ℝ) (hu : u ∈ uIcc z y) : + HasDerivAt (fun v : ℝ => inverseFlow κ b T (driverValue b T+v*Complex.I)) + (radialCoeff κ b T u) u := by + rw [uIcc_of_le hzy] at hu + exact hasDerivAt_radial hκ hT (hsub hu) b + rw [← intervalIntegral.integral_eq_sub_of_hasDerivAt hd hi, + intervalIntegral.integral_of_le hzy,ofReal_norm] + apply (enorm_integral_le_lintegral_enorm _).trans + change (∫⁻ u in Ioc z y, ‖radialCoeff κ b T u‖ₑ) ≤ radialLength κ b T y + simp only [radialLength,ofReal_norm] + exact lintegral_mono_set (Ioc_subset_Ioc hz.le le_rfl) +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open Set Filter Metric +open scoped Topology + +lemma halfPlane_sub_conj_ne_zero {w v : ℂ} (hw : 0 < w.im) (hv : 0 < v.im) : + w-star v ≠ 0 := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.star_def,Complex.conj_im,Complex.zero_im] at hi + linarith + +lemma halfPlane_disk_norm_lt_one {w v : ℂ} (hw : 0 < w.im) (hv : 0 < v.im) : + ‖(w-v)/(w-star v)‖ < 1 := by + have hs : ‖w-v‖^2 < ‖w-star v‖^2 := by + rw [← Complex.normSq_eq_norm_sq,← Complex.normSq_eq_norm_sq] + simp only [Complex.normSq_apply,Complex.sub_re,Complex.sub_im, + Complex.star_def,Complex.conj_re,Complex.conj_im] + nlinarith [mul_pos hw hv] + rw [norm_div,div_lt_one (norm_pos_iff.mpr (halfPlane_sub_conj_ne_zero hw hv))] + nlinarith [norm_nonneg (w-v),norm_nonneg (w-star v)] + +lemma halfPlane_self_sub_conj_norm {w : ℂ} (hw : 0 < w.im) : + ‖w-star w‖ = 2*w.im := by + have he : w-star w = (2*w.im:ℂ)*Complex.I := by + apply Complex.ext <;> simp [Complex.mul_re,Complex.mul_im]; ring + rw [he,norm_mul,Complex.norm_I,mul_one] + norm_cast + rw [Real.norm_eq_abs,abs_of_nonneg (by positivity)] + + + +lemma ball_radius_le_conformal_radius {f : ℂ → ℂ} {z : ℂ} {r : ℝ} (hr : 0 < r) + (hf : DifferentiableOn ℂ f (ball z r)) + (hH : ∀ w ∈ ball z r, 0 < (f w).im) (hd : deriv f z ≠ 0) : + r ≤ 2*(f z).im / ‖deriv f z‖ := by + have hz : z ∈ ball z r := by simpa using hr + have hy := hH z hz + let F (w : ℂ) : ℂ := (f w-f z)/(f w-star (f z)) + have hn (w : ℂ) (hw : w ∈ ball z r) : f w-star (f z) ≠ 0 := + halfPlane_sub_conj_ne_zero (hH w hw) hy + have hF : DifferentiableOn ℂ F (ball z r) := + (hf.sub_const (f z)).div (hf.sub_const (star (f z))) hn + have hFz : F z = 0 := by simp [F] + have hm : MapsTo F (ball z r) (closedBall (F z) 1) := by + intro w hw + rw [hFz,mem_closedBall,dist_zero_right] + exact (halfPlane_disk_norm_lt_one (hH w hw) hy).le + have hh := Complex.norm_deriv_le_div_of_mapsTo_ball hF hm hr + have hfd := (hf.differentiableAt (ball_mem_nhds z hr)).hasDerivAt + have hFd : HasDerivAt F (deriv f z/(f z-star (f z))) z := by + have h := (hfd.sub_const (f z)).div (hfd.sub_const (star (f z))) (hn z hz) + convert! h using 1; first | rfl | (simp only [sub_self,zero_mul,sub_zero]; field_simp) + rw [hFd.deriv,norm_div,halfPlane_self_sub_conj_norm hy] at hh + have hi := (div_le_div_iff₀ (show 0 < 2*(f z).im by positivity) hr).mp hh + apply (le_div_iff₀ (norm_pos_iff.mpr hd)).mpr + nlinarith +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace + +lemma PositiveSolution.im_hasDeriv {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => (f u).im) + (-a κ*(f t).im/‖f t-driverValue b t‖^2) (Icc 0 T) t := by + have hi := Complex.imCLM.hasFDerivAt.comp_hasDerivWithinAt t (hf.2.2.2.2 t ht) + convert! hi using 1; first | rfl | + (simp only [Complex.imCLM_apply,Complex.div_im,Complex.ofReal_im,Complex.ofReal_re, + Complex.sub_im,sub_zero,Complex.normSq_eq_norm_sq,zero_mul,zero_div,zero_sub]; ring) + +lemma PositiveSolution.im_antitone {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) (hκ : 0 < κ) : + AntitoneOn (fun u => (f u).im) (Icc 0 T) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc _ _) + (Complex.continuous_im.comp_continuousOn hf.2.1) + (fun t ht => (hf.im_hasDeriv (interior_subset ht)).mono interior_subset) + intro t ht + apply div_nonpos_of_nonpos_of_nonneg _ (sq_nonneg _) + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hy := hf.2.2.2.1 t (interior_subset ht) + nlinarith + +lemma PositiveSolution.im_sq_bound {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) (hκ : 0 < κ) {s t : ℝ} + (hs : s ∈ Icc 0 T) (ht : t ∈ Icc 0 T) (hst : s ≤ t) : + (f s).im^2 ≤ (f t).im^2+2*a κ*(t-s) := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hm : MonotoneOn (fun u => (f u).im^2+2*a κ*u) (Icc 0 T) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) + ((Complex.continuous_im.comp_continuousOn hf.2.1).pow 2 |>.add + ((continuous_const.mul continuous_id).continuousOn)) + (fun u hu => (((hf.im_hasDeriv (interior_subset hu)).pow 2).add + ((hasDerivAt_id u).const_mul (2*a κ)).hasDerivWithinAt).mono interior_subset) + intro u hu + have ht := interior_subset hu + have hn := Complex.im_le_norm (f u-driverValue b u) + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero] at hn + have hp := hf.2.2.2.1 u ht + have hs : (f u).im^2 ≤ ‖f u-driverValue b u‖^2 := pow_le_pow_left₀ hp.le hn 2 + have hn0 : 0 < ‖f u-driverValue b u‖^2 := sq_pos_of_pos (hp.trans_le hn) + norm_num only [Nat.cast_ofNat,pow_one,mul_one] + convert! (div_nonneg (mul_nonneg (show 0 ≤ 2*a κ by positivity) (sub_nonneg.mpr hs)) hn0.le) using 1; field_simp [ne_of_gt (hp.trans_le hn)]; ring + have hh := hm hs ht hst + dsimp only at hh + linarith + +lemma inverseFlow_im_sq_bound {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) + (b : Driver) {w : ℂ} (hw : 0 < w.im) : + (inverseFlow κ b T w).im^2 ≤ w.im^2+2*a κ*T := by + have hf := surviving_flow_positiveSolution hT (inverseFlow_surviving hκ b hT hw) + have hh := hf.im_sq_bound hκ (left_mem_Icc.mpr hT) (right_mem_Icc.mpr hT) hT + simpa only [hf.2.2.1,flow_inverseFlow hκ b hT hw,sub_zero] using hh + +lemma inverseFlow_im_pos {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) + (b : Driver) {w : ℂ} (hw : 0 < w.im) : 0 < (inverseFlow κ b T w).im := by + have hf := surviving_flow_positiveSolution hT (inverseFlow_surviving hκ b hT hw) + simpa only [hf.2.2.1] using hf.2.2.2.1 0 (left_mem_Icc.mpr hT) + +lemma inverseFlow_deriv_absolute {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) + (b : Driver) {w : ℂ} (hw : 0 < w.im) : + ‖deriv (inverseFlow κ b T) w‖ ≤ 2*(inverseFlow κ b T w).im/w.im := by + have hs : ball w w.im ⊆ {u : ℂ | 0 < u.im} := by + intro u hu + rw [mem_ball,dist_eq_norm] at hu + have hh := Complex.im_le_norm (w-u) + rw [norm_sub_rev,Complex.sub_im] at hh + change 0 < u.im + linarith + have hd : deriv (inverseFlow κ b T) w ≠ 0 := by + rw [(inverseFlow_hasStrictDerivAt hκ b hT hw).hasDerivAt.deriv] + exact inv_ne_zero (flow_deriv_ne_zero hT (inverseFlow_surviving hκ b hT hw)) + have hh := ball_radius_le_conformal_radius hw + ((flow_conformal_bijection hκ b hT).2.2.2.mono hs) + (fun u hu => inverseFlow_im_pos hκ hT b (hs hu)) hd + have hh' := (le_div_iff₀ (norm_pos_iff.mpr hd)).mp hh + apply (le_div_iff₀ hw).mpr + nlinarith +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace + +lemma PositiveSolution.displacement_le {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) (hκ : 0 < κ) {s t : ℝ} + (hs : s ∈ Icc 0 T) (ht : t ∈ Icc 0 T) (hst : s ≤ t) : + ‖f t-f s‖ ≤ (a κ/(f t).im)*(t-s) := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hy := hf.2.2.2.1 t ht + have hin : Icc s t ⊆ Icc 0 T := Icc_subset_Icc hs.1 ht.2 + have hh := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun u hu => (hf.2.2.2.2 u (hin hu)).mono hin) + (show ∀ u ∈ Icc s t, ‖(a κ:ℂ)/(f u-driverValue b u)‖ ≤ a κ/(f t).im from by + intro u hu + rw [norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_pos ha] + apply div_le_div_of_nonneg_left ha.le hy + apply (hf.im_antitone hκ (hin hu) ht hu.2).trans + simpa using Complex.im_le_norm (f u-driverValue b u)) + (convex_Icc s t) (left_mem_Icc.mpr hst) (right_mem_Icc.mpr hst) + simpa only [Real.norm_eq_abs,abs_of_nonneg (sub_nonneg.mpr hst)] using hh + +lemma inverseFlow_im_le {κ t T R : ℝ} (hκ : 0 < κ) (ht : 0 ≤ t) (htT : t ≤ T) + (b : Driver) {w : ℂ} (hw : 0 < w.im) (hR : w.im ≤ R) : + (inverseFlow κ b t w).im ≤ R+2*a κ*T+1 := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hT : 0 ≤ T := ht.trans htT + have hR0 : 0 ≤ R := hw.le.trans hR + have hA : 0 ≤ 2*a κ*T := by positivity + have him := inverseFlow_im_sq_bound hκ ht b hw + have hnon := inverseFlow_im_pos hκ ht b hw + have hup : w.im^2 ≤ R^2 := pow_le_pow_left₀ hw.le hR 2 + have hat : 2*a κ*t ≤ 2*a κ*T := mul_le_mul_of_nonneg_left htT (by positivity) + nlinarith [sq_nonneg (2*a κ*T),mul_nonneg hR0 hA] + +lemma inverseFlow_lipschitz_strip {κ t T y R : ℝ} (hκ : 0 < κ) (ht : 0 ≤ t) + (htT : t ≤ T) (hy : 0 < y) (b : Driver) {v w : ℂ} + (hv : y ≤ v.im ∧ v.im ≤ R) (hw : y ≤ w.im ∧ w.im ≤ R) : + ‖inverseFlow κ b t v-inverseFlow κ b t w‖ ≤ + (2*(R+2*a κ*T+1)/y)*‖v-w‖ := by + have hs : Convex ℝ {u : ℂ | y ≤ u.im ∧ u.im ≤ R} := + (convex_Icc y R).linear_preimage Complex.imCLM.toLinearMap + apply Convex.norm_image_sub_le_of_norm_deriv_le (𝕜 := ℂ) + (fun u hu => (inverseFlow_hasStrictDerivAt hκ b ht (hy.trans_le hu.1)).hasDerivAt.differentiableAt) _ hs hw hv + intro u hu + apply (inverseFlow_deriv_absolute hκ ht b (hy.trans_le hu.1)).trans + calc + _ ≤ 2*(R+2*a κ*T+1)/u.im := by + apply div_le_div_of_nonneg_right _ (hy.le.trans hu.1) + exact mul_le_mul_of_nonneg_left (inverseFlow_im_le hκ ht htT b (hy.trans_le hu.1) hu.2) (by norm_num) + _ ≤ 2*(R+2*a κ*T+1)/y := by + apply div_le_div_of_nonneg_left _ hy hu.1 + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hT : 0 ≤ T := ht.trans htT + have hR0 : 0 < R := hy.trans_le (hu.1.trans hu.2) + positivity + + + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadialRestart.lean b/lean/OAI/Probability/SLEGauge/RadialRestart.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d4d361c0269644ad93e2338d7fb81022c0a9ff8 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadialRestart.lean @@ -0,0 +1,459 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.AngleLyapunov + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator + +lemma physicalRadius_actual_eq_inv_deriv (a : ℝ) (b : GDriver) (s : ℝ≥0) + (z : ℂ) (hs : alive a b.1 s z) : + physicalRadius (actualState a b.1 s z) = + ‖deriv (loewnerMap a b.1 s) z‖⁻¹ * (actualState a b.1 s z).1.im := by + unfold physicalRadius actualState + simp only [Y_apply, J_apply, Real.exp_neg] + rw [Real.exp_log (norm_pos_iff.mpr (deriv_loewnerMap_ne_zero b.1.continuous hs))] + ring + +lemma radialTime_restart (a : ℝ) (ha : 0 (s:ℝ≥0∞)+u) '' + {u : ℝ≥0∞ | ∃t : ℝ≥0, u=t ∧ alive a (restart s b).1 t w ∧ + physicalRadius (actualState a (restart s b).1 t w)=w.im*(ρ/σ)} = + {u : ℝ≥0∞ | ∃t : ℝ≥0, u=t ∧ alive a b.1 t z ∧ + physicalRadius (actualState a b.1 t z)=ρ} := by + ext u + constructor + · rintro ⟨u,⟨t,rfl,ht,hR⟩,rfl⟩ + have ht' : alive a b.1 (s+t) z := (alive_restart_iff a b.1 z s t).mpr ⟨hs.1,ht⟩ + refine ⟨s+t,by simp,ht',?_⟩ + rw [physicalRadius_restart b.1.continuous ht'] + change c⁻¹*physicalRadius (actualState a (restart s b).1 t w)=ρ + rw [hR,hr] + · rintro ⟨t,rfl,ht,hR⟩ + have hst := hle t ht hR + let v := t-s + have heq : s+v=t := add_tsub_cancel_of_le hst + have ht' : alive a (restart s b).1 v w := + ((alive_restart_iff a b.1 z s v).mp (heq ▸ ht)).2 + refine ⟨v,⟨v,rfl,ht',?_⟩,by simp [←ENNReal.coe_add,heq]⟩ + apply (mul_left_cancel₀ (inv_ne_zero hc.ne')) + rw [hr] + calc + c⁻¹*physicalRadius (actualState a (restart s b).1 v w) = + physicalRadius (actualState a b.1 (s+v) z) := + (physicalRadius_restart b.1.continuous (heq ▸ ht)).symm + _ = ρ := by rw [heq,hR] + change (s:ℝ≥0∞)+sInf _=sInf _ + rw [ENNReal.add_sInf,←sInf_image,he] + +lemma radialTime_restart_top_iff (a : ℝ) (ha : 0 hf (htop.mp h) + have ht : s+τ.toNNReal=(radialTime a b.1 z ρ).toNNReal := by + have hh := congrArg ENNReal.toNNReal (radialTime_restart a ha z hz σ ρ hρ hρσ hσ b hb) + change ((s:ℝ≥0∞)+τ).toNNReal=(radialTime a b.1 z ρ).toNNReal at hh + simpa only [ENNReal.toNNReal_add ENNReal.coe_ne_top hτ,ENNReal.toNNReal_coe] using hh + have hfull := (radialTime_attained a ha z hz ρ hρ (hρσ.trans hσ) b hf).1 + rw [show radialWeight a b.1 z ρ = _ from ite_eq_right hf, + show radialWeight a b.1 z σ = _ from ite_eq_right hb, + show radialWeight a (restart s b).1 w (w.im*(ρ/σ)) = _ from ite_eq_right hτ] + rw [←ht,actualState_restart b.1.continuous (ht ▸ hfull),physicalGreen_add_log] + have hi : physicalGreen a (actualState a b.1 s z) = + Real.exp (alpha a*(actualState a b.1 s z).2)*physicalGreen a (w,0) := by + convert physicalGreen_add_log a (w,0) (actualState a b.1 s z).2 using 1 + simp [w] + change Real.exp (alpha a*(actualState a b.1 s z).2)* + physicalGreen a (actualState a (restart s b).1 τ.toNNReal w) = _ + rw [hi] + have hG : physicalGreen a (w,0) ≠ 0 := (Real.exp_pos _).ne' + field_simp [hG] + simp only [τ,mul_div_assoc] + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma actualState_continuousOn {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) : + ContinuousOn (fun u : ℝ => actualState a b u.toNNReal z) (Icc 0 (T : ℝ)) := by + obtain ⟨f,hf⟩ := hT + let Z : ℝ → ℂ := fun u => f u - (b u.toNNReal : ℂ) + let A : ℝ → ℝ := fun u => (-(a : ℂ) / (Z u)^2).re + have hZ : ContinuousOn Z (Icc 0 (T : ℝ)) := odeUntil_center_continuousOn hb hf + have hA : ContinuousOn A (Icc 0 (T : ℝ)) := + Complex.continuous_re.comp_continuousOn (continuousOn_const.div (hZ.pow 2) + (fun u hu => pow_ne_zero _ (odeUntil_center_ne_zero hf hu))) + have hAi : IntervalIntegrable A volume 0 T := hA.intervalIntegrable_of_Icc T.coe_nonneg + have hprim : ContinuousOn (fun u : ℝ => ∫ v in (0 : ℝ)..u, A v) + (Icc 0 (T : ℝ)) := by + simpa only [uIcc_of_le T.coe_nonneg] using + intervalIntegral.continuousOn_primitive_interval' hAi + (show (0 : ℝ) ∈ uIcc 0 (T : ℝ) from left_mem_uIcc) + have hC := hZ.prodMk hprim + apply hC.congr + intro u hu + have huT : u.toNNReal ≤ T := by simpa using Real.toNNReal_le_toNNReal hu.2 + apply Prod.ext + · simp only [actualState,Z,loewnerMap_eq_solution_time hf hu] + · change Real.log ‖deriv (loewnerMap a b u.toNNReal) z‖ = _ + rw [log_norm_deriv_loewnerMap hb ⟨f,odeUntil_mono hf huT⟩, + Real.coe_toNNReal _ hu.1] + apply intervalIntegral.integral_congr + intro v hv + have hv' : v ∈ Icc 0 (T : ℝ) := + (Icc_subset_Icc_right hu.2) (by simpa only [uIcc_of_le hu.1] using hv) + simp only [Z,loewnerMap_eq_solution_time hf hv'] + +lemma actualState_bounded_until {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} (hT : alive a b T z) : + ∃ η C : ℝ, 0 < η ∧ ∀ t : ℝ≥0, t ≤ T → + η ≤ Y (actualState a b t z) ∧ ‖actualState a b t z‖ ≤ C := by + obtain ⟨f,hf⟩ := hT + obtain ⟨η,hη,hmin⟩ := odeUntil_height_lower hf + obtain ⟨C,hC⟩ := isCompact_Icc.exists_bound_of_continuousOn + (actualState_continuousOn hb ⟨f,hf⟩) + refine ⟨η,C,hη,?_⟩ + intro t ht + have hmem : (t : ℝ) ∈ Icc 0 (T : ℝ) := ⟨t.coe_nonneg,ht⟩ + constructor + · have he : loewnerMap a b t z = f t := by + simpa only [Real.toNNReal_coe] using loewnerMap_eq_solution_time hf hmem + simpa only [actualState,Y_apply,he,Complex.sub_im,Complex.ofReal_im,sub_zero] + using hmin (t : ℝ) hmem + · simpa only [Real.toNNReal_coe] using hC (t : ℝ) hmem + +noncomputable def exhaustionHeight (z : UpperPlane) (n : ℕ) : ℝ := + z.1.im / ((n : ℝ) + 2) + +lemma exhaustionHeight_pos (z : UpperPlane) (n : ℕ) : 0 < exhaustionHeight z n := + div_pos z.2 (by positivity) + +lemma exhaustionHeight_le (z : UpperPlane) (n : ℕ) : exhaustionHeight z n ≤ z.1.im := by + exact div_le_self z.2.le (by linarith [Nat.cast_nonneg (α := ℝ) n]) + +lemma exhaustionHeight_tendsto (z : UpperPlane) : + Tendsto (exhaustionHeight z) atTop (𝓝 0) := by + have h : Tendsto (fun n : ℕ => 1 / ((n : ℝ) + 2)) atTop (𝓝 0) := + by simpa only [Function.comp_def, Nat.cast_add,Nat.cast_ofNat] using + (tendsto_one_div_atTop_nhds_zero_nat (𝕜 := ℝ)).comp (tendsto_add_atTop_nat 2) + change Tendsto (fun n : ℕ => z.1.im / ((n : ℝ) + 2)) atTop (𝓝 0) + simpa only [mul_one_div,mul_zero] using h.const_mul z.1.im + +noncomputable def exhaustionNorm (z : UpperPlane) (n : ℕ) : ℝ≥0 := + ⟨‖z.1‖ + n + 1, by positivity⟩ + +noncomputable def exhaustionStop (a : ℝ) (z : UpperPlane) (n : ℕ) : ExactSLEGenerator.Driver → ℝ≥0 := + regionStop a (exhaustionHeight z n) (exhaustionHeight_pos z n) z.1 + (exhaustionNorm z n) 0 0 n + +lemma exhaustionRegion_initial (z : UpperPlane) (n : ℕ) : + 0 ≤ regionMonitor (exhaustionHeight z n) (exhaustionNorm z n) 0 0 (z.1,0) := by + apply (regionMonitor_nonneg_iff _ _ _ _ _).mpr + refine ⟨exhaustionHeight_le z n, ?_, ?_, ?_⟩ + · simp only [Prod.norm_def,norm_zero,max_eq_left (norm_nonneg z.1)] + change ‖z.1‖ ≤ ‖z.1‖ + (n : ℝ) + 1 + linarith [Nat.cast_nonneg (α := ℝ) n] + · simp only [physicalRadius,Y_apply,J_apply,neg_zero,Real.exp_zero,mul_one] + exact z.2.le + · simp only [zero_mul,Y_apply] + exact z.2.le + +lemma exhaustionStop_stopping (a : ℝ) (z : UpperPlane) (n : ℕ) : + IsStoppingTime rawFiltration (fun b => (exhaustionStop a z n b : WithTop ℝ≥0)) := + regionStop_stopping a _ _ z.1 _ 0 0 n + +lemma exhaustionStop_le (a : ℝ) (z : UpperPlane) (n : ℕ) (b : ExactSLEGenerator.Driver) : + exhaustionStop a z n b ≤ n := regionStop_le a _ _ z.1 _ 0 0 n b + +lemma exhaustionStop_agrees (a : ℝ) (z : UpperPlane) (n : ℕ) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) (ht : t ≤ exhaustionStop a z n b) : + alive a b.1 t z.1 ∧ actualState a b.1 t z.1 = + localState a (exhaustionHeight z n) (exhaustionHeight_pos z n) z.1 t b := + regionStop_actualState a _ _ z.1 _ 0 0 n (exhaustionRegion_initial z n) b t ht + + + +lemma exhaustionStop_eventually (a : ℝ) (z : UpperPlane) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) + (ht : alive a b.1 t z.1) : + ∀ᶠ n in atTop, t ≤ exhaustionStop a z n b := by + obtain ⟨η,C,hη,hbound⟩ := actualState_bounded_until b.1.continuous ht + have hheight : ∀ᶠ n in atTop, exhaustionHeight z n < η := + (exhaustionHeight_tendsto z).eventually (gt_mem_nhds hη) + have hlarge : ∀ᶠ n : ℕ in atTop, max (t : ℝ) C < n := + (tendsto_natCast_atTop_atTop (R := ℝ)).eventually (eventually_gt_atTop _) + filter_upwards [hheight,hlarge] with n hn hlarge + by_contra hnot + have hs : exhaustionStop a z n b < t := lt_of_not_ge hnot + have hsn : exhaustionStop a z n b < n := + hs.trans (by exact_mod_cast (lt_of_le_of_lt (le_max_left _ _) hlarge)) + have he := (exhaustionStop_agrees a z n b _ le_rfl).2 + have hb := hbound (exhaustionStop a z n b) hs.le + have hcontact := regionStop_contact a _ (exhaustionHeight_pos z n) z.1 + (exhaustionNorm z n) 0 0 n (exhaustionRegion_initial z n) b hsn + simp only [exhaustionStop] at he hb + rw [← he] at hcontact + rcases hcontact with h | h | h | h + · linarith only [hb.1, h, hn] + · have hCN : C < (exhaustionNorm z n : ℝ) := by + change C < ‖z.1‖ + (n : ℝ) + 1 + have hCn := lt_of_le_of_lt (le_max_right (t : ℝ) C) hlarge + linarith [norm_nonneg z.1] + linarith only [hb.2,h,hCN] + · have hp := physicalRadius_actual_pos a b z.1 _ (exhaustionStop_agrees a z n b _ le_rfl).1 + simp only [exhaustionStop] at hp + rw [h] at hp + exact lt_irrefl _ hp + · simp only [zero_mul] at h + linarith only [hb.1,h,hη] + +lemma exhaustionStop_measurable (a : ℝ) (z : UpperPlane) (n : ℕ) : + Measurable (exhaustionStop a z n) := by + apply measurable_of_Iic + intro t + simpa only [preimage, mem_Iic, WithTop.coe_le_coe] using + rawFiltration.le t _ ((exhaustionStop_stopping a z n).measurableSet_le t) + + + +noncomputable def killedObservable (a : ℝ) (z : UpperPlane) (F : State → ℝ) + (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : ℝ := + if alive a b.1 t z.1 then F (actualState a b.1 t z.1) else 0 + +noncomputable def localizedObservable (a : ℝ) (z : UpperPlane) (F : State → ℝ) + (n : ℕ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : ℝ := + if t ≤ exhaustionStop a z n b then + F (localState a (exhaustionHeight z n) (exhaustionHeight_pos z n) z.1 t b) else 0 + +lemma localizedObservable_joint_measurable (a : ℝ) (z : UpperPlane) + (F : State → ℝ) (hF : Measurable F) (n : ℕ) : + Measurable (fun p : ℝ≥0 × ExactSLEGenerator.Driver => localizedObservable a z F n p.1 p.2) := by + exact Measurable.ite + (measurableSet_le measurable_fst ((exhaustionStop_measurable a z n).comp measurable_snd)) + (hF.comp (localState_parameter_joint_measurable a (fun _ => exhaustionHeight z n) + (fun _ => exhaustionHeight_pos z n) (fun _ => z.1) id + measurable_const measurable_const measurable_id)) measurable_const + +lemma localizedObservable_tendsto (a : ℝ) (z : UpperPlane) (F : State → ℝ) + (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : + Tendsto (fun n => localizedObservable a z F n t b) atTop (𝓝 (killedObservable a z F t b)) := by + by_cases ht : alive a b.1 t z.1 + · apply tendsto_const_nhds.congr' + filter_upwards [exhaustionStop_eventually a z b t ht] with n hn + simp only [localizedObservable,ite_eq_left hn,killedObservable,ite_eq_left ht, + (exhaustionStop_agrees a z n b t hn).2] + · have hn (n : ℕ) : ¬t ≤ exhaustionStop a z n b := + fun hn => ht (exhaustionStop_agrees a z n b t hn).1 + simpa only [localizedObservable,ite_eq_right (hn _),killedObservable,ite_eq_right ht] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (𝓝 0)) + +lemma killedObservable_joint_measurable (a : ℝ) (z : UpperPlane) + (F : State → ℝ) (hF : Measurable F) : + Measurable (fun p : ℝ≥0 × ExactSLEGenerator.Driver => killedObservable a z F p.1 p.2) := + measurable_of_tendsto_metrizable (localizedObservable_joint_measurable a z F hF) + (tendsto_pi_nhds.mpr (fun p => localizedObservable_tendsto a z F p.1 p.2)) + +lemma killedObservable_nonneg (a : ℝ) (z : UpperPlane) + (F : State → ℝ) (hF : ∀ v, 0 < Y v → 0 ≤ F v) + (t : ℝ≥0) (b : ExactSLEGenerator.Driver) : 0 ≤ killedObservable a z F t b := by + unfold killedObservable + split_ifs with ht + · obtain ⟨f,hf⟩ := ht + apply hF + have he : loewnerMap a b.1 t z.1 = f t := by + simpa only [Real.toNNReal_coe] using + loewnerMap_eq_solution_time hf (right_mem_Icc.mpr t.coe_nonneg) + simpa only [actualState,Y_apply,he,Complex.sub_im,Complex.ofReal_im, + sub_zero] using (hf.2 (t : ℝ) (right_mem_Icc.mpr t.coe_nonneg)).1 + · exact le_rfl + +lemma greenLifetime_measurable (a : ℝ) : + Measurable (fun v => physicalGreen a v * lifetimeTest (lifetimeExponent a) v) := by + unfold physicalGreen logGreen lifetimeTest Q X Y J + fun_prop + +lemma lifetimeCost_measurable (a : ℝ) : Measurable (lifetimeCost a) := by + unfold lifetimeCost physicalGreen logGreen Q X Y J + fun_prop + + + +theorem global_lifetime_test_budget (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) (t : ℝ≥0) : + (∫⁻ b, ENNReal.ofReal (killedObservable a z + (fun v => physicalGreen a v * lifetimeTest (lifetimeExponent a) v) t b) ∂W) ≤ + ENNReal.ofReal (physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0)) := by + let F : State → ℝ := fun v => physicalGreen a v * lifetimeTest (lifetimeExponent a) v + have hpos (v : State) (hv : 0 < Y v) : 0 ≤ F v := + mul_nonneg (Real.exp_pos _).le (lifetimeTest_nonneg _ _ hv.le) + have hbound (n : ℕ) : (∫⁻ b, ENNReal.ofReal (localizedObservable a z F n t b) ∂W) ≤ + ENNReal.ofReal (F (z.1,0)) := by + let ε := exhaustionHeight z n + let V := localState a ε (exhaustionHeight_pos z n) z.1 + let S : ExactSLEGenerator.Driver → ℝ≥0 := fun b => min (exhaustionStop a z n b) t + have hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0)) := by + simpa only [S, WithTop.coe_min] using (exhaustionStop_stopping a z n).min_const t + have hsafe (b : ExactSLEGenerator.Driver) (u : ℝ≥0) (hu : u ≤ S b) : + ε ≤ Y (V u b) ∧ ‖V u b‖ ≤ exhaustionNorm z n := by + have h := regionStop_safe a ε (exhaustionHeight_pos z n) z.1 + (exhaustionNorm z n) 0 0 n (exhaustionRegion_initial z n) b u + (hu.trans (min_le_left _ _)) + exact ⟨h.1,h.2.1⟩ + have hb := local_lifetime_budget W hW a ε ha (exhaustionHeight_pos z n) + z.1 (exhaustionNorm z n) n S hS + (fun b => (min_le_left _ _).trans (exhaustionStop_le a z n b)) hsafe + calc + _ ≤ ∫⁻ b, ENNReal.ofReal (F (V (S b) b)) ∂W := by + apply lintegral_mono + intro b + apply ENNReal.ofReal_le_ofReal + by_cases ht : t ≤ exhaustionStop a z n b + · simp only [localizedObservable,ite_eq_left ht,S,min_eq_right ht,F,V,ε,le_refl] + · rw [localizedObservable,ite_eq_right ht] + exact hpos _ ((exhaustionHeight_pos z n).trans_le (hsafe b (S b) le_rfl).1) + _ = ENNReal.ofReal (∫ b, F (V (S b) b) ∂W) := + (ofReal_integral_eq_lintegral_ofReal hb.1 (Eventually.of_forall (fun b => + hpos _ ((exhaustionHeight_pos z n).trans_le (hsafe b (S b) le_rfl).1)))).symm + _ ≤ _ := ENNReal.ofReal_le_ofReal hb.2.1 + have hlim (b : ExactSLEGenerator.Driver) : + liminf (fun n => ENNReal.ofReal (localizedObservable a z F n t b)) atTop = + ENNReal.ofReal (killedObservable a z F t b) := + (ENNReal.tendsto_ofReal (localizedObservable_tendsto a z F t b)).liminf_eq + change (∫⁻ b, ENNReal.ofReal (killedObservable a z F t b) ∂W) ≤ _ + simp_rw [← hlim] + exact (lintegral_liminf_le (fun n => + ((localizedObservable_joint_measurable a z F (greenLifetime_measurable a) n).comp + (measurable_const.prodMk measurable_id)).ennreal_ofReal)).trans + (liminf_le_of_frequently_le (Eventually.of_forall hbound).frequently) + +lemma localizedObservable_occupation (a : ℝ) (z : UpperPlane) (F : State → ℝ) + (n : ℕ) (b : ExactSLEGenerator.Driver) : + (∫⁻ u in Ioi (0 : ℝ), ENNReal.ofReal (localizedObservable a z F n u.toNNReal b)) = + ∫⁻ u in Ioc (0 : ℝ) (exhaustionStop a z n b : ℝ), + ENNReal.ofReal (F (localState a (exhaustionHeight z n) + (exhaustionHeight_pos z n) z.1 u.toNNReal b)) := by + have he (u : ℝ) : ENNReal.ofReal (localizedObservable a z F n u.toNNReal b) = + (Iic (exhaustionStop a z n b : ℝ)).indicator + (fun u : ℝ => ENNReal.ofReal (F (localState a (exhaustionHeight z n) + (exhaustionHeight_pos z n) z.1 u.toNNReal b))) u := by + by_cases hu : u ≤ (exhaustionStop a z n b : ℝ) + · simp only [localizedObservable,Real.toNNReal_le_iff_le_coe,indicator,mem_Iic,hu,ite_true] + · simp only [localizedObservable,Real.toNNReal_le_iff_le_coe,indicator,mem_Iic,hu,ite_false, + ENNReal.ofReal_zero] + simp_rw [he] + rw [setLIntegral_indicator measurableSet_Iic, inter_comm, Ioi_inter_Iic] + + + +theorem global_lifetime_occupation_budget (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (z : UpperPlane) : + (∫⁻ b, ∫⁻ u in Ioi (0 : ℝ), + ENNReal.ofReal (killedObservable a z (lifetimeCost a) u.toNNReal b) ∂volume ∂W) ≤ + ENNReal.ofReal (physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0)) := by + let G : ℕ → ExactSLEGenerator.Driver × ℝ → ℝ≥0∞ := fun n p => + ENNReal.ofReal (localizedObservable a z (lifetimeCost a) n p.2.toNNReal p.1) + let H : ExactSLEGenerator.Driver × ℝ → ℝ≥0∞ := fun p => + ENNReal.ofReal (killedObservable a z (lifetimeCost a) p.2.toNNReal p.1) + have hG (n : ℕ) : Measurable (G n) := + ((localizedObservable_joint_measurable a z (lifetimeCost a) (lifetimeCost_measurable a) n).comp + ((measurable_real_toNNReal.comp measurable_snd).prodMk measurable_fst)).ennreal_ofReal + have hH : Measurable H := + ((killedObservable_joint_measurable a z (lifetimeCost a) (lifetimeCost_measurable a)).comp + ((measurable_real_toNNReal.comp measurable_snd).prodMk measurable_fst)).ennreal_ofReal + have hbound (n : ℕ) : + (∫⁻ p, G n p ∂W.prod (volume.restrict (Ioi (0 : ℝ)))) ≤ + ENNReal.ofReal (physicalGreen a (z.1,0) * lifetimeTest (lifetimeExponent a) (z.1,0)) := by + rw [lintegral_prod _ (hG n).aemeasurable] + change (∫⁻ b, ∫⁻ u in Ioi (0 : ℝ), + ENNReal.ofReal (localizedObservable a z (lifetimeCost a) n u.toNNReal b) ∂volume ∂W) ≤ _ + simp_rw [localizedObservable_occupation] + apply (local_lifetime_budget W hW a (exhaustionHeight z n) ha (exhaustionHeight_pos z n) + z.1 (exhaustionNorm z n) n (exhaustionStop a z n) (exhaustionStop_stopping a z n) + (exhaustionStop_le a z n) ?_).2.2 + intro b u hu + have h := regionStop_safe a (exhaustionHeight z n) (exhaustionHeight_pos z n) z.1 + (exhaustionNorm z n) 0 0 n (exhaustionRegion_initial z n) b u hu + exact ⟨h.1,h.2.1⟩ + have hlim (p : ExactSLEGenerator.Driver × ℝ) : + liminf (fun n => G n p) atTop = H p := + (ENNReal.tendsto_ofReal (localizedObservable_tendsto a z (lifetimeCost a) p.2.toNNReal p.1)).liminf_eq + rw [← lintegral_prod H hH.aemeasurable] + simp_rw [← hlim] + exact (lintegral_liminf_le hG).trans + (liminf_le_of_frequently_le (Eventually.of_forall hbound).frequently) + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadialRestartRaw.lean b/lean/OAI/Probability/SLEGauge/RadialRestartRaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c6cd3016989142eacb1ec4d84362327e41e9bb3 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadialRestartRaw.lean @@ -0,0 +1,495 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RawRestartTests +import OAI.Probability.SLEGauge.FiniteAngleEigen + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped Classical NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator + +lemma radialState_raw_measurable (a : ℝ) (ha : 1/4 radialState a b.1 z σ) := by + let S := fun b : GDriver => radialTime a b.1 z σ + have hS := radialTime_stopping a (by linarith) z hz σ hσ hσz + have hD := stoppedData_raw_measurable hS + have hm : Measurable[hS.measurableSpace] (fun b : GDriver => + killedState a (stoppedData S b).1 (stoppedData S b).2 z) := + (killedState_time_joint_measurable a ha).comp + (hD.fst.prodMk (hD.snd.prodMk (measurable_const (a := (⟨z,hz⟩ : UpperPlane))))) + have he (b : GDriver) : radialState a b.1 z σ = + if S b=∞ then 0 else killedState a (stoppedData S b).1 (stoppedData S b).2 z := by + by_cases hb : S b=∞ + · exact (ite_eq_left hb).trans (ite_eq_left hb).symm + · have hs := (radialTime_attained a (by linarith) z hz σ hσ hσz b hb).1 + have hc := pastDriver_eq (S b).toNNReal b + have hp := (alive_driver_congr hc).mpr hs + rw [radialState,ite_eq_right hb,ite_eq_right hb] + change actualState a b.1 (S b).toNNReal z = + if alive a (pastDriver (S b).toNNReal b).1 (S b).toNNReal z then + actualState a (pastDriver (S b).toNNReal b).1 (S b).toNNReal z else 0 + rw [ite_eq_left hp,actualState_driver_congr hc] + simp_rw [he] + exact Measurable.ite (hS.measurable (measurableSet_singleton ∞)) measurable_const hm + + + +def radialPoint (a : ℝ) (z : ℂ) (σ : ℝ) (b : GDriver) : UpperPlane := + if h : 0<(radialState a b.1 z σ).1.im then ⟨(radialState a b.1 z σ).1,h⟩ + else ⟨Complex.I,by simp⟩ + +lemma radialPoint_raw_measurable (a : ℝ) (ha : 1/4 (radialPoint a z σ b : ℂ)) from this.subtype_mk + simp only [radialPoint,apply_dite,dite_eq_ite] + exact hm.fst.ite (measurableSet_lt measurable_const hm.fst.im) measurable_const + +lemma radialPoint_eq (a : ℝ) (ha : 0 radialWeight a b.1 z σ) := by + have he (b : GDriver) : radialWeight a b.1 z σ = + if radialTime a b.1 z σ=∞ then 0 else physicalGreen a (radialState a b.1 z σ) := by + unfold radialWeight radialState + split_ifs <;> rfl + simp_rw [he] + apply Measurable.ite (hS.measurable (measurableSet_singleton ∞)) measurable_const + exact (show Measurable (physicalGreen a) by unfold physicalGreen logGreen Q; fun_prop).comp + (radialState_raw_measurable a ha z hz σ hσ hσz) + exact (hm.div_const _).ennreal_ofReal + +lemma radiusDensity_measurable (a : ℝ) (ha : 1/4 radiusDensity a p.2.1 (p.2.1.im*q) p.1) := by + apply Measurable.ennreal_ofReal + apply (joint_radialWeight_measurable a ha q hq hq1).div + unfold physicalGreen logGreen Q + fun_prop + +lemma radiusDensity_eq_zero (a : ℝ) (z : ℂ) (σ : ℝ) (b : GDriver) + (hb : radialTime a b.1 z σ=∞) : radiusDensity a z σ b=0 := by + simp only [radiusDensity,radialWeight,ite_eq_left hb,zero_div,ENNReal.ofReal_zero] + +lemma radiusDensity_restart (a : ℝ) (ha : 1/4 radialTime a c.1 z σ) b) := by + have ha0 : 0 radialTime a c.1 z σ) b) := by + have hb := ne_top_of_le_ne_top hf (radialTime_antitone a ha z hz ρ σ hρ hρσ hσ b) + let s := (radialTime a b.1 z σ).toNNReal + let w := (actualState a b.1 s z).1 + let τ := radialTime a (restart s b).1 w (w.im*(ρ/σ)) + have hτ : τ≠∞ := (radialTime_restart_top_iff a ha z hz σ ρ hρ hρσ hσ b hb).not.mpr hf + have ht : s+τ.toNNReal=(radialTime a b.1 z ρ).toNNReal := by + have hh := congrArg ENNReal.toNNReal (radialTime_restart a ha z hz σ ρ hρ hρσ hσ b hb) + change ((s:ℝ≥0∞)+τ).toNNReal=(radialTime a b.1 z ρ).toNNReal at hh + simpa only [ENNReal.toNNReal_add ENNReal.coe_ne_top hτ,ENNReal.toNNReal_coe] using hh + have hs := (radialTime_attained a ha z hz ρ hρ (hρσ.trans hσ) b hf).1 + rw [radialPoint_eq a ha z hz σ (hρ.trans_le hρσ) hσ b hb] + apply Subtype.ext + change physicalTheta (radialState a b.1 z ρ) = + physicalTheta (radialState a (restart s b).1 w (w.im*(ρ/σ))) + rw [radialState,ite_eq_right hf,radialState,ite_eq_right hτ,←ht, + actualState_restart b.1.continuous (ht ▸ hs)] + rfl + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator + +lemma setLIntegral_eq_inter_of_zero {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) (A B : Set Ω) (hB : MeasurableSet B) (f : Ω→ℝ≥0∞) + (hf : ∀ b, b∉B → f b=0) : (∫⁻b in A,f b∂μ)=∫⁻b in A∩B,f b∂μ := by + have he : f=B.indicator f := by + funext b + by_cases hb : b∈B + · simp only [indicator_of_mem hb] + · simp only [indicator_of_notMem hb,hf b hb] + calc + _ = ∫⁻b in A,B.indicator f b∂μ := by rw [←he] + _ = ∫⁻b in A∩B,f b∂μ := by + rw [lintegral_indicator hB,Measure.restrict_restrict hB,inter_comm] + +lemma radial_hit_ae (W : Measure GDriver) (a : ℝ) (ha : 1/4 hb (radiusDensity_eq_zero a z ρ b hf)) + + + +theorem radialLaw_restart (W : Measure GDriver) + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/4 radialTime a c.1 z σ) b) + ∂radialLaw W a z ρ) = + ∫⁻b in A,∫⁻c,F (radialPoint a z σ b,c) + ∂radialLaw W a (radialPoint a z σ b).1 ((radialPoint a z σ b).1.im*(ρ/σ)) + ∂radialLaw W a z σ := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hσ0 := hρ.trans_le hρσ + have hS := radialTime_stopping a (by linarith) z hz σ hσ0 hσ + let S : GDriver→ℝ≥0∞ := fun b => radialTime a b.1 z σ + let Z := radialPoint a z σ + let D : GDriver→ℝ≥0∞×UpperPlane := fun b => (radiusDensity a z σ b,Z b) + have hD : Measurable[hS.measurableSpace] D := + (radiusDensity_raw_measurable a ha z hz σ hσ0 hσ).prodMk + (radialPoint_raw_measurable a ha z hz σ hσ0 hσ) + have hZ : Measurable Z := (radialPoint_raw_measurable a ha z hz σ hσ0 hσ).mono + hS.measurableSpace_le le_rfl + have hY := measurable_restartAt hS + have hA' : MeasurableSet A := hS.measurableSpace_le _ hA + have hhit : MeasurableSet {b : GDriver | S b≠∞} := + (hS.measurable' (measurableSet_singleton ∞)).compl + have hq : 0<ρ/σ := div_pos hρ hσ0 + have hq1 : ρ/σ≤1 := (div_le_one hσ0).mpr hρσ + let K : UpperPlane×GDriver→ℝ≥0∞ := fun p => + radiusDensity a p.1.1 (p.1.1.im*(ρ/σ)) p.2 * F p + have hK : Measurable K := + ((joint_radiusDensity_measurable a ha (ρ/σ) hq hq1).comp measurable_swap).mul hF + let H : (ℝ≥0∞×UpperPlane)×GDriver→ℝ≥0∞ := fun p => p.1.1*K (p.1.2,p.2) + have hH : Measurable H := measurable_fst.fst.mul + (hK.comp (measurable_fst.snd.prodMk measurable_snd)) + have he (b : GDriver) : radiusDensity a z ρ b * F (Z b,restartAt S b)=H (D b,restartAt S b) := by + rw [radiusDensity_restart a ha z hz σ ρ hρ hρσ hσ] + exact mul_assoc _ _ _ + have hi (b : GDriver) : (∫⁻c,H (D b,c)∂W)=radiusDensity a z σ b * + ∫⁻c,F (Z b,c)∂radialLaw W a (Z b).1 ((Z b).1.im*(ρ/σ)) := by + have hm : Measurable (fun c : GDriver => F (Z b,c)) := + hF.comp (measurable_const.prodMk measurable_id) + have he' : (∫⁻c,F (Z b,c)∂radialLaw W a (Z b).1 ((Z b).1.im*(ρ/σ)))= + ∫⁻c,K (Z b,c)∂W := + lintegral_withDensity_eq_lintegral_mul W + (radiusDensity_measurable a ha (Z b).1 (Z b).2 _ (mul_pos (Z b).2 hq) + (mul_le_of_le_one_right (Z b).2.le hq1)) hm + rw [he'] + exact lintegral_const_mul _ (hK.comp (measurable_const.prodMk measurable_id)) + have hkm : Measurable (fun b => ∫⁻c,F (Z b,c) + ∂radialLaw W a (Z b).1 ((Z b).1.im*(ρ/σ))) := by + have he' (b : GDriver) : (∫⁻c,F (Z b,c) + ∂radialLaw W a (Z b).1 ((Z b).1.im*(ρ/σ)))=∫⁻c,K (Z b,c)∂W := by + exact lintegral_withDensity_eq_lintegral_mul W + (radiusDensity_measurable a ha (Z b).1 (Z b).2 _ (mul_pos (Z b).2 hq) + (mul_le_of_le_one_right (Z b).2.le hq1)) (hF.comp (measurable_const.prodMk measurable_id)) + simp_rw [he'] + exact hK.lintegral_prod_right'.comp hZ + change (∫⁻b in A,F (Z b,restartAt S b)∂W.withDensity (radiusDensity a z ρ)) = + ∫⁻b in A,∫⁻c,F (Z b,c)∂radialLaw W a (Z b).1 ((Z b).1.im*(ρ/σ)) + ∂W.withDensity (radiusDensity a z σ) + have hfm : Measurable (fun b : GDriver => F (Z b,restartAt S b)) := hF.comp (hZ.prodMk hY) + rw [setLIntegral_withDensity_eq_setLIntegral_mul W (radiusDensity_measurable a ha z hz ρ hρ (hρσ.trans hσ)) + hfm hA', + setLIntegral_withDensity_eq_setLIntegral_mul W (radiusDensity_measurable a ha z hz σ hσ0 hσ) hkm hA'] + simp only [Pi.mul_apply,he,←hi] + calc + _ = ∫⁻b in A∩{b | S b≠∞},H (D b,restartAt S b)∂W := + setLIntegral_eq_inter_of_zero W A _ hhit _ (fun b hb => by + have hb' : S b=∞ := not_not.mp hb + simp only [H,D,radiusDensity_eq_zero a z σ b hb',zero_mul]) + _ = ∫⁻b in A∩{b | S b≠∞},∫⁻c,H (D b,c)∂W ∂W := + lintegral_data_restartAt_on hW hS hD hA hH + _ = ∫⁻b in A,∫⁻c,H (D b,c)∂W ∂W := + (setLIntegral_eq_inter_of_zero W A _ hhit _ (fun b hb => by + have hb' : S b=∞ := not_not.mp hb + simp only [H,D,radiusDensity_eq_zero a z σ b hb',zero_mul,lintegral_zero])).symm + + +theorem finiteAngle_conditional (W : Measure GDriver) + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (a : ℝ) (ha : 1/4 f (Jacobi.finiteAngle a p.1.1 (p.1.1.im*(ρ/σ)) p.2) + have hF : Measurable F := hf.comp (Jacobi.angleState_measurable.comp + ((joint_radialState_measurable a (by linarith) (ρ/σ) hq hq1).comp measurable_swap)) + rw [←radialLaw_restart W hW a ha z hz σ ρ hρ hρσ hσ A hA F hF] + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae (radial_hit_ae W a ha z hz ρ hρ (hρσ.trans hσ))] with b hb + exact congrArg f (finiteAngle_restart a (by linarith) z hz σ ρ hρ hρσ hσ b hb) + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.Jacobi +open CenteredMoments ExactSLEGreen ExactSLECalculus ExactSLEFiniteTilt ExactSLEGenerator ExactSLEMain + +lemma sin_physicalTheta (v : State) (hy : 0 < Y v) : + Real.sin (physicalTheta v) = Y v / ‖v.1‖ := by + have hn : 0 < ‖v.1‖ := hy.trans_le (Complex.im_le_norm _) + have hs := Real.sin_pos_of_pos_of_lt_pi (physicalTheta_mem v).1 (physicalTheta_mem v).2 + have hc := physicalTheta_cot v + rw [Real.cot_eq_cos_div_sin, div_eq_div_iff hs.ne' hy.ne'] at hc + have he : (X v)^2 + (Y v)^2 = ‖v.1‖^2 := by + simpa only [X_apply, Y_apply, Complex.normSq_apply, pow_two] using Complex.normSq_eq_norm_sq v.1 + have hid := Real.sin_sq_add_cos_sq (physicalTheta v) + have heq : (Real.sin (physicalTheta v) * ‖v.1‖)^2 = (Y v)^2 := by + nlinarith [sq_nonneg (Real.sin (physicalTheta v) * X v - Real.cos (physicalTheta v) * Y v), + congrArg (fun x : ℝ => x^2) hc, + congrArg (fun x : ℝ => x * (Y v)^2) hid, + congrArg (fun x : ℝ => x * (Real.sin (physicalTheta v))^2) he] + apply (eq_div_iff hn.ne').mpr + nlinarith [mul_pos hs hn] + + +lemma radialWeight_inverse_sine (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) + (hb : radialTime a b.1 z ρ ≠ ∞) : + radialWeight a b.1 z ρ * (Real.sin (finiteAngle a z ρ b : ℝ)) ^ (-p a) = + ρ ^ (-alpha a) := by + have ht := radialTime_attained a ha z hz ρ hρ hr b hb + have hy := LoewnerScaling.Y_actual_pos ht.1 + have hs := Real.sin_pos_of_pos_of_lt_pi (finiteAngle a z ρ b).2.1 + (finiteAngle a z ρ b).2.2 + have hθ : Real.sin (finiteAngle a z ρ b : ℝ) = + Y (actualState a b.1 (radialTime a b.1 z ρ).toNNReal z) / + ‖(actualState a b.1 (radialTime a b.1 z ρ).toNNReal z).1‖ := by + simpa only [finiteAngle, angleState, radialState, ite_eq_right hb] using sin_physicalTheta _ hy + rw [radialWeight, ite_eq_right hb, physicalGreen_eq_radius_sine a _ hy, ht.2, ← hθ, + mul_assoc, ← Real.rpow_add hs] + simp + +lemma inverse_radial_density (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) : + (ρ^(alpha a) * physicalGreen a (z,0)) * + ((radialWeight a b.1 z ρ / physicalGreen a (z,0)) * + (Real.sin (finiteAngle a z ρ b : ℝ))^(-p a)) = + if radialTime a b.1 z ρ ≠ ∞ then 1 else 0 := by + by_cases hb : radialTime a b.1 z ρ ≠ ∞ + · rw [ite_eq_left hb] + have hp : physicalGreen a (z,0) ≠ 0 := (Real.exp_pos _).ne' + calc + _ = ρ^(alpha a) * (radialWeight a b.1 z ρ * + (Real.sin (finiteAngle a z ρ b : ℝ))^(-p a)) := by field_simp + _ = 1 := by + rw [radialWeight_inverse_sine a ha z hz ρ hρ hr b hb, ← Real.rpow_add hρ] + simp + · simp only [ite_eq_right hb, radialWeight, ite_eq_left (not_not.mp hb), zero_div, zero_mul, mul_zero] + + + +theorem radial_change_law (W : Measure ExactSLEGenerator.Driver) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (g : ExactSLEGenerator.Driver → ℝ≥0∞) (hg : Measurable g) : + (∫⁻b in {b | radialTime a b.1 z ρ ≠ ∞}, g b ∂W) = + ENNReal.ofReal (ρ^(alpha a) * physicalGreen a (z,0)) * + ∫⁻b, ENNReal.ofReal ((Real.sin (finiteAngle a z ρ b : ℝ))^(-p a)) * g b + ∂radialLaw W a z ρ := by + have ha0 : 0 < a := by linarith + have hhit : MeasurableSet {b : ExactSLEGenerator.Driver | radialTime a b.1 z ρ ≠ ∞} := + ((radialTime_stopping a ha0 z hz ρ hρ hr).measurable' (measurableSet_singleton ∞)).compl + have hs : Measurable (fun b : ExactSLEGenerator.Driver => + ENNReal.ofReal ((Real.sin (finiteAngle a z ρ b : ℝ))^(-p a))) := by + exact (show Measurable (fun θ : Angle => ENNReal.ofReal ((Real.sin θ)^(-p a))) by fun_prop).comp + (finiteAngle_measurable a ha0 z hz ρ hρ hr) + have hd : Measurable (fun b : ExactSLEGenerator.Driver => + ENNReal.ofReal (radialWeight a b.1 z ρ / physicalGreen a (z,0))) := + ((radialWeight_measurable a ha z hz ρ hρ hr).div_const _).ennreal_ofReal + have hf : Measurable (fun b => + ENNReal.ofReal ((Real.sin (finiteAngle a z ρ b : ℝ))^(-p a)) * g b) := hs.mul hg + rw [radialLaw, lintegral_withDensity_eq_lintegral_mul W hd hf, ← lintegral_const_mul _ (hd.mul hf)] + rw [← lintegral_indicator hhit] + apply lintegral_congr + intro b + have hpos : 0 ≤ (radialWeight a b.1 z ρ / physicalGreen a (z,0)) := + div_nonneg (radialWeight_bound a ha z hz ρ hρ hr b).1 (Real.exp_pos _).le + have hc : 0 ≤ ρ^(alpha a) * physicalGreen a (z,0) := + mul_nonneg (Real.rpow_nonneg hρ.le _) (Real.exp_pos _).le + have he := congrArg ENNReal.ofReal (inverse_radial_density a ha0 z hz ρ hρ hr b) + rw [ENNReal.ofReal_mul hc, ENNReal.ofReal_mul hpos] at he + simp only [Pi.mul_apply] + rw [← mul_assoc _ _ (g b), ← mul_assoc _ _ (g b), he] + by_cases hb : radialTime a b.1 z ρ ≠ ∞ <;> simp [hb] + +lemma radial_hit_probability_eq (W : Measure ExactSLEGenerator.Driver) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (s : ℝ) (hs : 0 ≤ s) : + W {b | radialTime a b.1 z (levelRadius a (2*z.im) s) ≠ ∞} = + ENNReal.ofReal ((levelRadius a (2*z.im) s)^(alpha a) * physicalGreen a (z,0)) * + ∫⁻θ : Angle, ENNReal.ofReal ((Real.sin θ)^(-p a)) ∂finiteAngleLaw W a z s := by + have hρ := levelRadius_pos a (2*z.im) s (by positivity : 0 < 2*z.im) + have hr := levelRadius_initial_le a (by linarith) z hz s hs + have he := radial_change_law W a ha z hz _ hρ hr (fun _ => 1) measurable_const + simp only [lintegral_one, Measure.restrict_apply_univ, mul_one] at he + rw [finiteAngleLaw, lintegral_map (by fun_prop) + (finiteAngle_measurable a (by linarith) z hz _ hρ hr)] + exact he + +lemma physicalGreen_initial_bound (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) : + physicalGreen a (z,0) ≤ z.im^(-alpha a) := by + have hr : physicalRadius (z,0) = z.im := by simp [physicalRadius, Y_apply, J_apply] + rw [Real.rpow_def_of_pos hz] + simpa only [mul_comm] using physicalGreen_bound a z.im ha hz (z,0) hz hr.ge + + + +theorem radial_hit_probability_long (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (s : ℝ) (hs : mixingTime (4*a) ≤ s) : + W {b | radialTime a b.1 z (levelRadius a (2*z.im) s) ≠ ∞} ≤ + ENNReal.ofReal ((levelRadius a (2*z.im) s / z.im)^(alpha a)) * + (2 * ∫⁻θ : Angle, ENNReal.ofReal ((Real.sin θ)^(-p a)) ∂angleLaw a) := by + have hs0 : 0 ≤ s := le_trans (by unfold mixingTime majorantBase; positivity) hs + have hρ := levelRadius_pos a (2*z.im) s (by positivity : 0 < 2*z.im) + rw [radial_hit_probability_eq W a ha z hz s hs0] + apply mul_le_mul + · apply ENNReal.ofReal_le_ofReal + rw [Real.div_rpow hρ.le hz.le, div_eq_mul_inv, ← Real.rpow_neg hz.le] + exact mul_le_mul_of_nonneg_left (physicalGreen_initial_bound a ha z hz) + (Real.rpow_nonneg hρ.le _) + · exact (finiteAngleLaw_integral_bounds W hW a ha z hz s hs _ (by fun_prop)).2 + all_goals positivity + + +def visitConstant (a : ℝ) : ℝ≥0∞ := + 2 * (∫⁻θ : Angle, ENNReal.ofReal ((Real.sin θ)^(-p a)) ∂angleLaw a) + + ENNReal.ofReal (Real.exp (2*a*mixingTime (4*a)*alpha a)) + +lemma visitConstant_lt_top (a : ℝ) : visitConstant a < ∞ := + ENNReal.add_lt_top.mpr ⟨ENNReal.mul_lt_top (by norm_num) (angle_inverse_power_finite a), + ENNReal.ofReal_lt_top⟩ + +lemma visitConstant_pos (a : ℝ) : 0 < visitConstant a := + lt_of_lt_of_le (ENNReal.ofReal_pos.mpr (Real.exp_pos _)) (le_add_left le_rfl) + +lemma levelRadius_ratio (a : ℝ) (z : ℂ) (hz : 0 < z.im) (s : ℝ) : + levelRadius a (2*z.im) s / z.im = Real.exp (-2*a*s) := by + unfold levelRadius + field_simp + + + +theorem radial_hit_probability (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) (s : ℝ) (_hs : 0 ≤ s) : + W {b | radialTime a b.1 z (levelRadius a (2*z.im) s) ≠ ∞} ≤ + visitConstant a * ENNReal.ofReal ((levelRadius a (2*z.im) s / z.im)^(alpha a)) := by + by_cases hm : mixingTime (4*a) ≤ s + · exact (radial_hit_probability_long W hW a ha z hz s hm).trans (by + rw [mul_comm] + exact mul_le_mul_of_nonneg_right (le_add_right le_rfl) zero_le) + · have hh : ENNReal.ofReal (Real.exp (2*a*mixingTime (4*a)*alpha a)) * + ENNReal.ofReal ((levelRadius a (2*z.im) s / z.im)^(alpha a)) ≥ 1 := by + rw [levelRadius_ratio a z hz s, ← ENNReal.ofReal_mul (Real.exp_pos _).le, + ← Real.exp_mul, ← Real.exp_add, ← ENNReal.ofReal_one] + apply ENNReal.ofReal_le_ofReal + rw [Real.one_le_exp_iff] + have hp := alpha_pos ha + nlinarith [mul_nonneg (show 0 ≤ 2*a by linarith) + (sub_nonneg.mpr (not_le.mp hm).le)] + exact (prob_le_one (μ := W)).trans (hh.trans + (mul_le_mul_of_nonneg_right (le_add_left le_rfl) zero_le)) + + +theorem radial_hit_probability_radius (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) : + W {b | radialTime a b.1 z ρ ≠ ∞} ≤ visitConstant a * ENNReal.ofReal ((ρ/z.im)^(alpha a)) := by + let s : ℝ := -(Real.log (ρ/z.im))/(2*a) + have ha0 : 0 < a := by linarith + have hq : 0 < ρ/z.im := div_pos hρ hz + have hs : 0 ≤ s := div_nonneg (neg_nonneg.mpr (Real.log_nonpos hq.le ((div_le_one hz).mpr hr))) + (by positivity) + have he : levelRadius a (2*z.im) s = ρ := by + have hexp : -2*a*s = Real.log (ρ/z.im) := by dsimp [s]; field_simp + unfold levelRadius + rw [hexp, Real.exp_log hq] + field_simp + simpa only [he] using radial_hit_probability W hW a ha z hz s hs + +end SLEExactGauge.Jacobi +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadialStopping.lean b/lean/OAI/Probability/SLEGauge/RadialStopping.lean new file mode 100644 index 0000000000000000000000000000000000000000..69e06591eed09555c212927b57d4e97f99ca107e --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadialStopping.lean @@ -0,0 +1,433 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TiltedMeasures + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open scoped Classical +lemma capTime_eq (S : ExactSLEGenerator.Driver → ℝ≥0∞) (n : ℝ≥0) (b : ExactSLEGenerator.Driver) + (h : S b ≤ n) : capTime S n b = (S b).toNNReal := by simp only [capTime,min_eq_left h] +lemma stopped_before_cap (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (n : ℝ≥0) (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + MeasurableSet[(capTime_stopping S hS n).measurableSpace] (U ∩ {b | S b < n}) := by + have hc : IsStoppingTime rawFiltration (fun _ : ExactSLEGenerator.Driver => (n : WithTop ℝ≥0)) := isStoppingTime_const _ _ + have he : U ∩ {b | S b < n} = (U ∩ {b | S b ≤ n}) \ {b | S b = n} := by + ext b + simp only [Set.mem_inter_iff,Set.mem_ofPred_eq,Set.mem_sdiff] + exact ⟨fun h => ⟨⟨h.1,h.2.le⟩,h.2.ne⟩,fun h => ⟨h.1.1,lt_of_le_of_ne h.1.2 h.2⟩⟩ + have hm := (hS.measurableSet_inter_le hc U hU).diff (hS.measurableSet_eq_stopping_time_min hc) + have heq : (fun b => (capTime S n b : WithTop ℝ≥0)) = fun b => min (S b) (n : ℝ≥0∞) := funext (capTime_coe S n) + rw [he] + exact ((hS.min hc).measurableSpace_mono (capTime_stopping S hS n) (fun b => by + change min (S b) (n : ℝ≥0∞) ≤ (capTime S n b : ℝ≥0∞) + rw [capTime_coe])) _ hm + +lemma stopped_cap_measurable (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (n : ℝ≥0) : (capTime_stopping S hS n).measurableSpace ≤ hS.measurableSpace := + (capTime_stopping S hS n).measurableSpace_mono hS (fun b => by + change (capTime S n b : ℝ≥0∞) ≤ S b + rw [capTime_coe] + exact min_le_left _ _) +lemma stopping_before_measurable (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (n : ℝ≥0) : MeasurableSet {b | S b < n} := + hS.measurableSpace_le _ (hS.measurableSet_lt' n) + +lemma eventually_before_nat {v : ℝ≥0∞} (hv : v ≠ ∞) : ∀ᶠ n : ℕ in atTop, v < ((n : ℝ≥0) : ℝ≥0∞) := by + obtain ⟨N,hN⟩ := exists_nat_gt v.toNNReal + filter_upwards [eventually_ge_atTop N] with n hn + rw [← ENNReal.coe_toNNReal hv,ENNReal.coe_lt_coe] + exact hN.trans_le (Nat.cast_le.mpr hn) + + + +theorem radial_conditional_weight_all (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + Integrable (fun b => stoppedRadialRemaining a b.1 z ρ (S b)) W ∧ + (∫ b in U, (if S b < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0) ∂W) = + ∫ b in U, stoppedRadialRemaining a b.1 z ρ (S b) ∂W := by + let C : ℕ → Set ExactSLEGenerator.Driver := fun n => {b | S b < (n : ℝ≥0)} + let F := fun n => (C n).indicator (fun b => radialRemaining a b.1 z ρ (capTime S n b)) + let H := fun n => (C n).indicator (fun b => if (capTime S n b : ℝ≥0∞) < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0) + let G := fun b : ExactSLEGenerator.Driver => stoppedRadialRemaining a b.1 z ρ (S b) + let K := fun b : ExactSLEGenerator.Driver => if S b < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0 + let c := Real.exp (-alpha a*Real.log ρ) + have hFi (n : ℕ) : Integrable (F n) W := + (radial_conditional_weight W hW a ha z hz ρ hρ hr (capTime S n) (capTime_stopping S hS n) + Set.univ MeasurableSet.univ).1.indicator (stopping_before_measurable S hS n) + have hHi (n : ℕ) : Integrable (H n) W := + (radial_terminal_integrable W hW a ha z hz ρ hρ hr (capTime S n) (capTime_stopping S hS n)).indicator + (stopping_before_measurable S hS n) + have hFc (b : ExactSLEGenerator.Driver) : Tendsto (fun n => F n b) atTop (𝓝 (G b)) := by + by_cases hb : S b = ∞ + · have he : (fun n => F n b) = fun _ : ℕ => 0 := by + funext n + apply Set.indicator_of_notMem + simp [C,hb] + have hg : G b = 0 := by simp [G,stoppedRadialRemaining,hb] + rw [he,hg] + exact tendsto_const_nhds + · apply Filter.Tendsto.congr' _ tendsto_const_nhds + filter_upwards [eventually_before_nat hb] with n hn + dsimp only [G,F,stoppedRadialRemaining] + rw [ite_eq_right hb,Set.indicator_of_mem (show b ∈ C n from hn),capTime_eq S n b hn.le] + have hHc (b : ExactSLEGenerator.Driver) : Tendsto (fun n => H n b) atTop (𝓝 (K b)) := by + by_cases hb : S b = ∞ + · have he : (fun n => H n b) = fun _ : ℕ => 0 := by + funext n + apply Set.indicator_of_notMem + simp [C,hb] + have hk : K b = 0 := by simp [K,hb] + rw [he,hk] + exact tendsto_const_nhds + · apply Filter.Tendsto.congr' _ tendsto_const_nhds + filter_upwards [eventually_before_nat hb] with n hn + dsimp only [K,H] + rw [Set.indicator_of_mem (show b ∈ C n from hn),capTime_coe,min_eq_left hn.le] + have hFb (n : ℕ) (b : ExactSLEGenerator.Driver) : ‖F n b‖ ≤ c := by + by_cases hb : b ∈ C n + · dsimp only [F] + rw [Set.indicator_of_mem hb] + exact radialRemaining_bound a ha z hz ρ hρ hr b (capTime S n b) + · simpa only [F,Set.indicator_of_notMem hb,norm_zero] using (Real.exp_pos (-alpha a*Real.log ρ)).le + have hHb (n : ℕ) (b : ExactSLEGenerator.Driver) : ‖H n b‖ ≤ c := by + by_cases hb : b ∈ C n + · dsimp only [H] + rw [Set.indicator_of_mem hb] + split_ifs + · have h := radialWeight_bound a ha z hz ρ hρ hr b + simpa only [Real.norm_eq_abs,abs_of_nonneg h.1] using h.2 + · simpa only [norm_zero] using (Real.exp_pos (-alpha a*Real.log ρ)).le + · simpa only [H,Set.indicator_of_notMem hb,norm_zero] using (Real.exp_pos (-alpha a*Real.log ρ)).le + have hGi : Integrable G W := Integrable.of_bound + (aestronglyMeasurable_of_tendsto_ae atTop (fun n => (hFi n).aestronglyMeasurable) (Eventually.of_forall hFc)) c + (Eventually.of_forall fun b => le_of_tendsto (hFc b).norm (Eventually.of_forall fun n => hFb n b)) + refine ⟨hGi,?_⟩ + have he (n : ℕ) : (∫ b in U, F n b ∂W) = ∫ b in U, H n b ∂W := by + have hC := stopping_before_measurable S hS n + dsimp only [F,H] + rw [integral_indicator hC,integral_indicator hC,Measure.restrict_restrict hC,Set.inter_comm (C n) U] + exact (radial_conditional_weight W hW a ha z hz ρ hρ hr (capTime S n) (capTime_stopping S hS n) + (U ∩ C n) (stopped_before_cap S hS n U hU)).2.symm + have hFl := tendsto_integral_of_dominated_convergence (μ := W.restrict U) (fun _ => c) + (fun n => (hFi n).aestronglyMeasurable.restrict) (integrable_const c) + (fun n => Eventually.of_forall (hFb n)) (Eventually.of_forall hFc) + have hHl := tendsto_integral_of_dominated_convergence (μ := W.restrict U) (fun _ => c) + (fun n => (hHi n).aestronglyMeasurable.restrict) (integrable_const c) + (fun n => Eventually.of_forall (hHb n)) (Eventually.of_forall hHc) + have heq : (fun n => ∫ b in U, F n b ∂W) = fun n => ∫ b in U, H n b ∂W := funext he + rw [heq] at hFl + exact tendsto_nhds_unique hHl hFl + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open scoped Classical + +noncomputable def radialLaw (W : Measure ExactSLEGenerator.Driver) (a : ℝ) (z : ℂ) + (ρ : ℝ) : Measure ExactSLEGenerator.Driver := + W.withDensity (fun b => ENNReal.ofReal (radialWeight a b.1 z ρ / physicalGreen a (z,0))) + +lemma radialTime_stopping (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) : + IsStoppingTime rawFiltration (fun b : ExactSLEGenerator.Driver => radialTime a b.1 z ρ) := by + intro t + let T := radialStop a ha z hz ρ hρ hr + let L := fun n => radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let F := fun n (b : ExactSLEGenerator.Driver) => + physicalRadius (localState a (L n).ε (L n).hε z (min (T n b) t) b) + have hFm (n : ℕ) : Measurable[rawFiltration t] (F n) := by + have hT := radialStop_stopping a ha z hz ρ hρ hr n + have hmin : IsStoppingTime rawFiltration (fun b => (min (T n b) t : WithTop ℝ≥0)) := by + simpa only [WithTop.coe_min] using hT.min (isStoppingTime_const rawFiltration t) + have hle : hmin.measurableSpace ≤ rawFiltration t := + hmin.measurableSpace_le_of_le_const (fun b => WithTop.coe_le_coe.mpr (min_le_right _ _)) + have hA : StronglyAdapted rawFiltration (localState a (L n).ε (L n).hε z) := + fun u => (localState_adapted a (L n).ε (L n).hε z u).stronglyMeasurable + exact physicalRadius_continuous.measurable.comp + ((measurable_stoppedValue (hA.isStronglyProgressive_of_continuous + (localState_continuous a (L n).ε (L n).hε z)) hmin).mono hle le_rfl) + have he : {b : ExactSLEGenerator.Driver | radialTime a b.1 z ρ ≤ (t : ℝ≥0∞)} = + ⋃ n : ℕ, {b | T n b ≤ t} ∩ {b | F n b = ρ} := by + ext b + simp only [Set.mem_ofPred_eq,Set.mem_iUnion,Set.mem_inter_iff] + constructor + · intro hb + have hfin : radialTime a b.1 z ρ ≠ ∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top hb + obtain ⟨n,hn⟩ := (radialStop_eventually_eq a ha z hz ρ hρ hr b hfin).exists + have hnt : T n b ≤ t := by + apply ENNReal.coe_le_coe.mp + exact hn.trans_le hb + refine ⟨n,hnt,?_⟩ + dsimp only [F] + rw [min_eq_left hnt] + have hr' := (radialTime_attained a ha z hz ρ hρ hr b hfin).2 + rw [← hn,ENNReal.toNNReal_coe] at hr' + have hact := (regionStop_actualState a (L n).ε (L n).hε z (L n).N ρ + (angleThreshold z n) (L n).B (L n).initial b (T n b) le_rfl).2 + rw [hact] at hr' + exact hr' + · rintro ⟨n,hnt,hR⟩ + dsimp only [F] at hR + rw [min_eq_left hnt] at hR + have htime := regionStop_eq_radialTime a (L n).ε (L n).hε z (L n).N ρ + (angleThreshold z n) (L n).B (L n).initial b hR + rw [htime] + exact ENNReal.coe_le_coe.mpr hnt + change MeasurableSet[rawFiltration t] {b : ExactSLEGenerator.Driver | radialTime a b.1 z ρ ≤ (t : ℝ≥0∞)} + rw [he] + apply MeasurableSet.iUnion + intro n + have hT := radialStop_stopping a ha z hz ρ hρ hr n + have htm : MeasurableSet[rawFiltration t] {b | T n b ≤ t} := by + simpa only [WithTop.coe_le_coe] using hT t + exact htm.inter (measurableSet_eq_fun (hFm n) measurable_const) + +lemma radialTime_le_of_hit (a : ℝ) (z : ℂ) (ρ : ℝ) (b : ExactSLEGenerator.Driver) + (t : ℝ≥0) (ht : alive a b.1 t z) (hR : physicalRadius (actualState a b.1 t z) = ρ) : + radialTime a b.1 z ρ ≤ (t : ℝ≥0∞) := + sInf_le ⟨t,rfl,ht,hR⟩ + +lemma radialTime_strict_of_finite (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ σ : ℝ) (hρ : 0 < ρ) (hρσ : ρ < σ) (hσ : σ ≤ z.im) + (b : ExactSLEGenerator.Driver) (hfin : radialTime a b.1 z ρ ≠ ∞) : + radialTime a b.1 z σ < radialTime a b.1 z ρ := by + have hr : ρ ≤ z.im := hρσ.le.trans hσ + obtain ⟨n,hn⟩ := (radialStop_eventually_eq a ha z hz ρ hρ hr b hfin).exists + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := radialStop a ha z hz ρ hρ hr n b + let f := fun t : ℝ≥0 => physicalRadius (localState a L.ε L.hε z t b) + have hfc : Continuous f := physicalRadius_continuous.comp (localState_continuous a L.ε L.hε z b) + have hR : f T = ρ := by + have h := (radialTime_attained a ha z hz ρ hρ hr b hfin).2 + rw [← hn,ENNReal.toNNReal_coe] at h + rw [(regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl).2] at h + exact h + have h0 : f 0 = z.im := by simp [f,localState_zero,physicalRadius,Y,J] + obtain ⟨u,hu,huR⟩ := intermediate_value_Icc' (show (0 : ℝ≥0) ≤ T from bot_le) hfc.continuousOn + (show σ ∈ Icc (f T) (f 0) by rw [hR,h0]; exact ⟨hρσ.le,hσ⟩) + have huT : u < T := hu.2.lt_of_ne (by intro he; rw [he,hR] at huR; exact hρσ.ne huR) + have hact := regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b u hu.2 + have hle : radialTime a b.1 z σ ≤ (u : ℝ≥0∞) := + radialTime_le_of_hit a z σ b u hact.1 (by rw [hact.2]; exact huR) + exact hle.trans_lt ((ENNReal.coe_lt_coe.mpr huT).trans_eq hn) + +lemma radialTime_strict_of_first_finite (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ σ : ℝ) (hρ : 0 < ρ) (hρσ : ρ < σ) (hσ : σ ≤ z.im) + (b : ExactSLEGenerator.Driver) (hfin : radialTime a b.1 z σ ≠ ∞) : + radialTime a b.1 z σ < radialTime a b.1 z ρ := by + by_cases h : radialTime a b.1 z ρ = ∞ + · rw [h] + exact lt_top_iff_ne_top.mpr hfin + · exact radialTime_strict_of_finite a ha z hz ρ σ hρ hρσ hσ b h + +lemma radialWeight_consistency + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ σ : ℝ) (hρ : 0 < ρ) (hρσ : ρ < σ) (hσ : σ ≤ z.im) + (hS : IsStoppingTime rawFiltration (fun b : ExactSLEGenerator.Driver => radialTime a b.1 z σ)) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + (∫ b in U, radialWeight a b.1 z ρ ∂W) = ∫ b in U, radialWeight a b.1 z σ ∂W := by + have ha0 : 0 < a := by linarith + have hsmall (b : ExactSLEGenerator.Driver) : + (if radialTime a b.1 z σ < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0) = radialWeight a b.1 z ρ := by + by_cases hf : radialTime a b.1 z ρ = ∞ + · simp [radialWeight,hf] + · rw [ite_eq_left (radialTime_strict_of_finite a ha0 z hz ρ σ hρ hρσ hσ b hf)] + have hlarge (b : ExactSLEGenerator.Driver) : + stoppedRadialRemaining a b.1 z ρ (radialTime a b.1 z σ) = radialWeight a b.1 z σ := by + by_cases hf : radialTime a b.1 z σ = ∞ + · simp [stoppedRadialRemaining,radialWeight,hf] + · have hat := (radialTime_attained a ha0 z hz σ (hρ.trans hρσ) hσ b hf).1 + have hlt := radialTime_strict_of_first_finite a ha0 z hz ρ σ hρ hρσ hσ b hf + rw [stoppedRadialRemaining,ite_eq_right hf,radialRemaining,radialWeight,ite_eq_right hf] + rw [ite_eq_left ⟨hat,by simpa only [ENNReal.coe_toNNReal hf] using hlt⟩] + have hc := (radial_conditional_weight_all W hW a ha z hz ρ hρ (hρσ.le.trans hσ) + (fun b => radialTime a b.1 z σ) hS U hU).2 + simpa only [hsmall,hlarge] using hc + +lemma radialLaw_apply + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet U) : + radialLaw W a z ρ U = ENNReal.ofReal ((∫ b in U, radialWeight a b.1 z ρ ∂W) / physicalGreen a (z,0)) := by + rw [radialLaw,MeasureTheory.withDensity_apply _ hU] + have hi := ((radialWeight_mean W hW a ha z hz ρ hρ hr).1.restrict (s := U)).div_const (physicalGreen a (z,0)) + have hn : 0 ≤ᵐ[W.restrict U] (fun b : ExactSLEGenerator.Driver => radialWeight a b.1 z ρ / physicalGreen a (z,0)) := + Eventually.of_forall (fun b => div_nonneg (radialWeight_bound a ha z hz ρ hρ hr b).1 (Real.exp_pos _).le) + rw [← ofReal_integral_eq_lintegral_ofReal hi hn,integral_div] + +lemma radialLaw_probability + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) : + IsProbabilityMeasure (radialLaw W a z ρ) := by + rw [isProbabilityMeasure_iff,radialLaw_apply W hW a ha z hz ρ hρ hr Set.univ MeasurableSet.univ, + Measure.restrict_univ,(radialWeight_mean W hW a ha z hz ρ hρ hr).2, + div_self (show physicalGreen a (z,0) ≠ 0 from (Real.exp_pos _).ne'),ENNReal.ofReal_one] + +theorem finite_radial_laws_consistent + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ σ : ℝ) (hρ : 0 < ρ) (hρσ : ρ < σ) (hσ : σ ≤ z.im) : + IsProbabilityMeasure (radialLaw W a z ρ) ∧ IsProbabilityMeasure (radialLaw W a z σ) ∧ + ∃ hS : IsStoppingTime rawFiltration (fun b : ExactSLEGenerator.Driver => radialTime a b.1 z σ), + ∀ U, MeasurableSet[hS.measurableSpace] U → radialLaw W a z ρ U = radialLaw W a z σ U := by + have hσ0 : 0 < σ := hρ.trans hρσ + have hr : ρ ≤ z.im := hρσ.le.trans hσ + have ha0 : 0 < a := by linarith + have hS := radialTime_stopping a ha0 z hz σ hσ0 hσ + refine ⟨radialLaw_probability W hW a ha z hz ρ hρ hr, + radialLaw_probability W hW a ha z hz σ hσ0 hσ,hS,?_⟩ + intro U hU + have hU' : MeasurableSet U := hS.measurableSpace_le _ hU + rw [radialLaw_apply W hW a ha z hz ρ hρ hr U hU', + radialLaw_apply W hW a ha z hz σ hσ0 hσ U hU', + radialWeight_consistency W hW a ha z hz ρ σ hρ hρσ hσ hS U hU] + +end ExactSLEGreen + +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +theorem compact_test_optional_inequality + (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (X : ℝ≥0 → Driver → E) (hXc : ∀ b, Continuous (fun t => X t b)) + (hXm : ∀ t, Measurable[rawFiltration t] (X t)) + (A : E → E) (hAc : Continuous A) (K : ℝ) (hK : 0 ≤ K) (hAb : ∀ x, ‖A x‖ ≤ K) + (e : E) (he : ‖e‖ ≤ 1) + (hXeq : ∀ (s h : ℝ≥0) b, X (s+h) b = X s b + increment s h b • e + + ∫ t in (s : ℝ)..((s+h : ℝ≥0) : ℝ), A (X t.toNNReal b)) + (f : E → ℝ) (hf : ContDiff ℝ (↑(⊤ : ℕ∞)) f) (hfc : HasCompactSupport f) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b ≤ T b) (hTB : ∀ b, T b ≤ B) + (hneg : ∀ b t, S b ≤ t → t ≤ T b → generator f A e (X t b) ≤ 0) + (U : Set Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + ∫ b in U, f (X (T b) b) ∂W ≤ ∫ b in U, f (X (S b) b) ∂W := by + let M : ℝ≥0 → Driver → ℝ := fun t b => f (X t b) - + ∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b) + have hM : Martingale M rawFiltration W := + compact_smooth_brownian_martingale W hW X hXc hXm A hAc K hK hAb e he hXeq f hf hfc + have hgc (b : Driver) : Continuous (fun u : ℝ => generator f A e (X u.toNNReal b)) := + (generator_continuous f hf A hAc e).comp ((hXc b).comp continuous_real_toNNReal) + have hmc (b : Driver) : Continuous (fun t => M t b) := + (hf.continuous.comp (hXc b)).sub + ((intervalIntegral.continuous_primitive (fun s t => (hgc b).intervalIntegrable s t) 0).comp NNReal.continuous_coe) + obtain ⟨C,D,hC,hD,hfb,hgb⟩ := compact_generator_bounds f hf hfc A K hK hAb e + have hmb (t : ℝ≥0) (ht : t ≤ B+1) (b : Driver) : ‖M t b‖ ≤ C+D*(B+1) := by + calc + _ ≤ ‖f (X t b)‖ + ‖∫ u in (0 : ℝ)..(t : ℝ), generator f A e (X u.toNNReal b)‖ := norm_sub_le _ _ + _ ≤ C+D*(t : ℝ) := add_le_add (hfb _) (by + simpa only [sub_zero,abs_of_nonneg t.coe_nonneg] using + intervalIntegral.norm_integral_le_of_norm_le_const (a := (0 : ℝ)) (b := (t : ℝ)) + (fun u _ => hgb (X u.toNNReal b))) + _ ≤ _ := add_le_add le_rfl (mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hD) + have hFa : StronglyAdapted rawFiltration (fun t b => f (X t b)) := fun t => + (hf.continuous.measurable.comp (hXm t)).stronglyMeasurable + have hFm (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) : + Measurable (fun b => f (X (R b) b)) := + (measurable_stoppedValue (hFa.isStronglyProgressive_of_continuous + (fun b => hf.continuous.comp (hXc b))) hR).mono hR.measurableSpace_le le_rfl + have hFi (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) : + Integrable (fun b => f (X (R b) b)) (W.restrict U) := + Integrable.of_bound (hFm R hR).aestronglyMeasurable C (Filter.Eventually.of_forall fun b => hfb _) + have hMi (R : Driver → ℝ≥0) + (hR : IsStoppingTime rawFiltration (fun b => (R b : WithTop ℝ≥0))) (hRB : ∀ b, R b≤B) : + Integrable (fun b => M (R b) b) (W.restrict U) := + Integrable.of_bound (ExactSLEOptional.stopped_measurable rawFiltration hM hmc R hR).aestronglyMeasurable + (C+D*(B+1)) (Filter.Eventually.of_forall fun b => hmb _ ((hRB b).trans (le_add_of_nonneg_right zero_le_one)) b) + have hpw (b : Driver) : f (X (T b) b) - f (X (S b) b) ≤ M (T b) b - M (S b) b := by + have hi := intervalIntegral.integral_add_adjacent_intervals (μ := volume) + ((hgc b).intervalIntegrable 0 (S b)) ((hgc b).intervalIntegrable (S b) (T b)) + have hn : (∫ u in (S b : ℝ)..(T b : ℝ), generator f A e (X u.toNNReal b)) ≤ 0 := by + rw [intervalIntegral.integral_of_le (by exact_mod_cast hST b)] + apply setIntegral_nonpos measurableSet_Ioc + intro u hu + apply hneg b u.toNNReal + · exact_mod_cast (show (S b : ℝ) ≤ (u.toNNReal : ℝ) by rw [Real.coe_toNNReal _ ((S b).coe_nonneg.trans hu.1.le)]; exact hu.1.le) + · exact (Real.toNNReal_le_toNNReal hu.2).trans_eq (by simp) + dsimp only [M] + linarith + have hcomp := integral_mono ((hFi T hT).sub (hFi S hS)) + ((hMi T hT hTB).sub (hMi S hS (fun b => (hST b).trans (hTB b)))) hpw + simp only [Pi.sub_apply] at hcomp + rw [integral_sub (hFi T hT) (hFi S hS), + integral_sub (hMi T hT hTB) (hMi S hS (fun b => (hST b).trans (hTB b)))] at hcomp + have heq := ExactSLEOptional.setIntegral_optional_sampling rawFiltration hM hmc B + (C+D*(B+1)) hmb S T hS hT hST hTB U hU + linarith +end ExactSLEGenerator + +namespace ExactSLEGreen +noncomputable def physicalTheta (v : State) : ℝ := Real.pi/2-Real.arctan (X v/Y v) +noncomputable def thetaDeriv (v : State) : State →L[ℝ] ℝ := + -(Y v/Q v) • X + (X v/Q v) • Y +noncomputable def physicalV (v : State) : ℝ := Y v/Q v +noncomputable def velocityDeriv (v : State) : State →L[ℝ] ℝ := + (1/Q v) • Y - (Y v/(Q v)^2) • ((2*X v) • X+(2*Y v) • Y) + +lemma physicalTheta_mem (v : State) : physicalTheta v ∈ Ioo 0 Real.pi := by + have h := Real.arctan_mem_Ioo (X v/Y v) + dsimp only [physicalTheta] + constructor <;> linarith [h.1,h.2] + +lemma physicalTheta_cot (v : State) : Real.cot (physicalTheta v) = X v/Y v := by + rw [physicalTheta,Real.cot_eq_cos_div_sin,Real.cos_pi_div_two_sub,Real.sin_pi_div_two_sub, + ← Real.tan_eq_sin_div_cos,Real.tan_arctan] + +lemma hasFDerivAt_physicalTheta (v : State) (hv : 0 try rfl + apply ContinuousLinearMap.ext + intro w + simp only [thetaDeriv,add_apply,smul_apply, + neg_apply,smul_eq_mul,Pi.mul_apply,Function.comp_apply] + field_simp + dsimp only [Q] + ring + +lemma thetaDeriv_noise (v : State) : thetaDeriv v noise = physicalV v := by + simp [thetaDeriv,noise,physicalV,X,Y] + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadiusComparison.lean b/lean/OAI/Probability/SLEGauge/RadiusComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..f41ce7d9d525d9e77154b0c7208939083fbed8fe --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadiusComparison.lean @@ -0,0 +1,451 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TwoPointGrowth + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt +lemma actual_radius_eq_full {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {t : ℝ≥0} (ht : alive a b t z) : + 2*physicalRadius (actualState a b t z)=fullLoewnerRadius a b z t := by + have hd := norm_pos_iff.mpr (deriv_loewnerMap_ne_zero hb ht) + simp only [physicalRadius,actualState,Y_apply,J_apply,Complex.sub_im,Complex.ofReal_im,sub_zero, + Real.exp_neg,Real.exp_log hd,fullLoewnerRadius,div_eq_mul_inv] + ring +lemma physicalClock_radius (a cap : ℝ) (hcap : 0 (activeODEClock_deriv hb hf A t).continuousAt + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (f:=fun t => Real.exp (off+σ*u t)/σ) + (f':=fun t => Real.exp (off+σ*u t)*v t^2) + (a:=(S:ℝ)) (b:=(T:ℝ)) + (fun t _ => by + exact (((((activeODEClock_deriv hb hf A t).const_mul σ).const_add off).exp).div_const σ).congr_deriv (by + dsimp only [u,v]; field_simp [hσ])) + (((Real.continuous_exp.comp (continuous_const.add (continuous_const.mul hc))).mul + ((odeSpeed_continuous hb hf).pow 2)).intervalIntegrable _ _) + simpa only [sub_div] using he +end ExactSLEMain +namespace ExactSLEMain +lemma activeODEClock_monotone {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T A : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil a b z T f) : + Monotone (activeODEClock b T A f) := by + exact monotone_of_hasDerivAt_nonneg (fun t => activeODEClock_deriv hb hf A t) (fun t => sq_nonneg _) +end ExactSLEMain +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt + + +theorem actual_regularized_pair_discount {a : ℝ} (ha : 1/4 (activeODEClock_deriv hb hf A t).continuousAt + have hvc : Continuous v := continuous_iff_continuousAt.mpr fun t => (activeODEClock_deriv hb hg B t).continuousAt + let F := fun t => Real.exp ((off₁+σ₁*u t+off₂+σ₂*v t)*(-regM a))*V t*W t + let G := fun t => Real.exp ((regM a*regBeta a)*(u t+v t))*V t*W t + have hFc : Continuous F := (((Real.continuous_exp.comp + (((continuous_const.add (continuous_const.mul huc)).add continuous_const).add + (continuous_const.mul hvc) |>.mul continuous_const)).mul (odeSpeed_continuous hb hf)).mul + (odeSpeed_continuous hb hg)) + have hGc : Continuous G := ((Real.continuous_exp.comp + (continuous_const.mul (huc.add hvc))).mul (odeSpeed_continuous hb hf)).mul (odeSpeed_continuous hb hg) + have hST' : (S:ℝ)≤T := by exact_mod_cast hST + have he : (∫ t in (S:ℝ)..(T:ℝ), + (physicalDelta a cap₁ σ₁ off₁ (actualState a b t.toNNReal z)* + physicalDelta a cap₂ σ₂ off₂ (actualState a b t.toNNReal w))^(-regM a)* + physicalV (actualState a b t.toNNReal z)*physicalV (actualState a b t.toNNReal w))= + ∫ t in (S:ℝ)..(T:ℝ), F t := by + apply intervalIntegral.integral_congr + intro t ht + have ht' : t∈Icc (S:ℝ) T := by simpa only [uIcc_of_le hST'] using ht + have ht0 := S.coe_nonneg.trans ht'.1 + have htT : t.toNNReal≤T := by exact_mod_cast (show (t.toNNReal:ℝ)≤T by simpa only [Real.coe_toNNReal _ ht0] using ht'.2) + simp only [physicalDelta] + rw [actual_clock_eq ha0.ne' hcap₁ hb hf (hA.trans hST) htT hR₁, + actual_clock_eq ha0.ne' hcap₂ hb hg (hB.trans hST) htT hR₂, + actual_speed_eq hf htT,actual_speed_eq hg htT,Real.coe_toNNReal _ ht0,←Real.exp_add, + Real.rpow_def_of_pos (Real.exp_pos _),Real.log_exp] + dsimp only [F,u,v,V,W] + congr 3 + ring + rw [he] + calc + _ ≤ ∫ t in (S:ℝ)..(T:ℝ), G t := by + apply intervalIntegral.integral_mono_on hST' (hFc.intervalIntegrable _ _) (hGc.intervalIntegrable _ _) + intro t ht + have ht0 : 0≤t := S.coe_nonneg.trans ht.1 + have hV : 0≤V t := by + change 0≤odeSpeed b T f t + rw [odeSpeed_eq f ⟨ht0,ht.2⟩] + exact div_nonneg ((hf.2 t ⟨ht0,ht.2⟩).1.le) (Complex.normSq_nonneg _) + have hW : 0≤W t := by + change 0≤odeSpeed b T g t + rw [odeSpeed_eq g ⟨ht0,ht.2⟩] + exact div_nonneg ((hg.2 t ⟨ht0,ht.2⟩).1.le) (Complex.normSq_nonneg _) + have h1 : -(off₁+σ₁*u t)≤regBeta a*u t := by + rcases hp₁ with ⟨rfl,rfl⟩|⟨rfl,rfl,hmid⟩ + · simp + · have hu : U₁/2≤u t := hmid.trans (activeODEClock_monotone hb hf ht.1) + nlinarith [mul_le_mul_of_nonneg_left hu hβ.le] + have h2 : -(off₂+σ₂*v t)≤regBeta a*v t := by + rcases hp₂ with ⟨rfl,rfl⟩|⟨rfl,rfl,hmid⟩ + · simp + · have hv : U₂/2≤v t := hmid.trans (activeODEClock_monotone hb hg ht.1) + nlinarith [mul_le_mul_of_nonneg_left hv hβ.le] + apply mul_le_mul_of_nonneg_right _ hW + apply mul_le_mul_of_nonneg_right _ hV + apply Real.exp_le_exp.mpr + have hh := mul_le_mul_of_nonneg_left (add_le_add h1 h2) hM.le + nlinarith only [hh] + _ ≤ _ := actual_pair_interaction ha0 (mul_pos hM hβ).le + (by nlinarith [regBeta_discount ha]) hb hST hA hB hf hg hzw + (hR₁.le.trans hsep₁) (hR₂.le.trans hsep₂) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt +lemma actual_regularized_single_discount {a : ℝ} (ha : 1/4 + if (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b : ℝ≥0∞)=radialTime a b.1 (z i) (ρ i) + then ∞ else (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b : ℝ≥0∞)) +noncomputable def unfinishedCutoff {m : ℕ} (a : ℝ) (ha : 0 [τ] + | σ::l => (fun ω => min (τ ω) (σ ω)) :: insert (fun ω => max (τ ω) (σ ω)) l +def sort : List (Ω → ℝ≥0) → List (Ω → ℝ≥0) + | [] => [] + | τ::l => insert τ (sort l) +omit [MeasurableSpace Ω] in +lemma insert_length (τ : Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) : + (insert τ l).length=l.length+1 := by + induction l generalizing τ with + | nil => rfl + | cons σ l ih => simp only [insert,List.length_cons,ih] +omit [MeasurableSpace Ω] in +lemma sort_length (l : List (Ω → ℝ≥0)) : (sort l).length=l.length := by + induction l with + | nil => rfl + | cons τ l ih => simp only [sort,insert_length,List.length_cons,ih] +lemma insert_stopping (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (τ : Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) + (hτ : IsStoppingTime F (fun ω => (τ ω : WithTop ℝ≥0))) + (hl : ∀ σ ∈ l, IsStoppingTime F (fun ω => (σ ω : WithTop ℝ≥0))) : + ∀ σ ∈ insert τ l, IsStoppingTime F (fun ω => (σ ω : WithTop ℝ≥0)) := by + induction l generalizing τ with + | nil => simpa only [insert,List.mem_singleton] using fun σ (h : σ=τ) => h ▸ hτ + | cons π l ih => + intro σ hσ + have hπ := hl π (by simp) + rcases List.mem_cons.mp hσ with h|h + · subst σ + simpa only [WithTop.coe_min] using hτ.min hπ + · apply ih (fun ω => max (τ ω) (π ω)) ?_ (fun σ h => hl σ (by simp [h])) σ h + simpa only [WithTop.coe_max] using hτ.max hπ +lemma sort_stopping (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (l : List (Ω → ℝ≥0)) + (hl : ∀ σ ∈ l, IsStoppingTime F (fun ω => (σ ω : WithTop ℝ≥0))) : + ∀ σ ∈ sort l, IsStoppingTime F (fun ω => (σ ω : WithTop ℝ≥0)) := by + induction l with + | nil => simp [sort] + | cons τ l ih => + exact insert_stopping F τ (sort l) (hl τ (by simp)) (ih (fun σ h => hl σ (by simp [h]))) +omit [MeasurableSpace Ω] in +lemma insert_perm (τ : Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (ω : Ω) : + ((insert τ l).map (fun σ => σ ω)).Perm ((τ::l).map (fun σ => σ ω)) := by + induction l generalizing τ with + | nil => exact List.Perm.refl _ + | cons σ l ih => + simp only [insert,List.map_cons] + have h := (ih (fun ω => max (τ ω) (σ ω))).cons (min (τ ω) (σ ω)) + rcases le_total (τ ω) (σ ω) with ht|ht + · simpa only [List.map_cons,min_eq_left ht,max_eq_right ht] using h + · simpa only [List.map_cons,min_eq_right ht,max_eq_left ht] using h.trans (List.Perm.swap _ _ _) +omit [MeasurableSpace Ω] in +lemma sort_perm (l : List (Ω → ℝ≥0)) (ω : Ω) : + ((sort l).map (fun σ => σ ω)).Perm (l.map (fun σ => σ ω)) := by + induction l with + | nil => exact List.Perm.refl _ + | cons τ l ih => exact (insert_perm τ (sort l) ω).trans (ih.cons (τ ω)) +omit [MeasurableSpace Ω] in +lemma insert_sorted (τ : Ω → ℝ≥0) (l : List (Ω → ℝ≥0)) (ω : Ω) + (hl : ((l.map (fun σ => σ ω))).Pairwise (· ≤ ·)) : + ((insert τ l).map (fun σ => σ ω)).Pairwise (· ≤ ·) := by + induction l generalizing τ with + | nil => simp [insert] + | cons σ l ih => + simp only [List.map_cons,List.pairwise_cons] at hl + simp only [insert,List.map_cons,List.pairwise_cons] + refine ⟨?_,ih _ hl.2⟩ + intro x hx + have hx' := (insert_perm (fun ω => max (τ ω) (σ ω)) l ω).mem_iff.mp hx + simp only [List.map_cons,List.mem_cons] at hx' + rcases hx' with rfl|hx' + · exact (min_le_left _ _).trans (le_max_left _ _) + · exact (min_le_right _ _).trans (hl.1 x hx') +omit [MeasurableSpace Ω] in +lemma sort_sorted (l : List (Ω → ℝ≥0)) (ω : Ω) : + ((sort l).map (fun σ => σ ω)).Pairwise (· ≤ ·) := by + induction l with + | nil => simp [sort] + | cons τ l ih => exact insert_sorted τ (sort l) ω ih + +omit [MeasurableSpace Ω] in +lemma no_change_between (l : List (Ω → ℝ≥0)) (ω : Ω) (k : ℕ) + (hk : k+1<(sort l).length) (τ : Ω → ℝ≥0) (hτ : τ∈l) : + τ ω ≤ (sort l)[k] ω ∨ (sort l)[k+1] ω ≤ τ ω := by + let v := (sort l).map (fun σ => σ ω) + have hv : v.Pairwise (· ≤ ·) := sort_sorted l ω + have ht : τ ω∈v := (sort_perm l ω).mem_iff.mpr (List.mem_map_of_mem hτ) + obtain ⟨i,hi,he⟩ := List.getElem_of_mem ht + have hm := List.pairwise_iff_getElem.mp hv + by_cases hik : i≤k + · left + rcases hik.eq_or_lt with rfl|hi' + · simpa [v] using he.symm.le + · have h := hm i k hi (by simpa [v] using (Nat.lt_of_succ_lt hk)) hi' + rw [he] at h + simpa only [v,List.getElem_map] using h + · right + have hki : k+1 ≤ i := Nat.succ_le_of_lt (lt_of_not_ge hik) + rcases hki.eq_or_lt with heq|hlt + · subst i + simpa [v] using he.le + · have h := hm (k+1) i (by simpa [v] using hk) hi hlt + rw [he] at h + simpa only [v,List.getElem_map] using h +end ExactSLEStops +namespace ExactSLEStops +open Set Filter +open scoped Classical +variable {Ω : Type*} [MeasurableSpace Ω] +lemma deferred_stopping (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (τ : Ω → ℝ≥0∞) (hτ : IsStoppingTime F τ) (A : Set Ω) + (hA : MeasurableSet[hτ.measurableSpace] A) : + IsStoppingTime F (fun ω => if ω∈A then ∞ else τ ω) := by + intro t + change MeasurableSet[F t] {ω | (if ω∈A then ∞ else τ ω)≤(t:ℝ≥0∞)} + have he : {ω | (if ω∈A then ∞ else τ ω)≤(t:ℝ≥0∞)}=Aᶜ∩{ω | τ ω≤(t:ℝ≥0∞)} := by + ext ω + by_cases h : ω∈A <;> simp [h] + rw [he] + exact (hτ.measurableSet Aᶜ).mp hA.compl |>.2 t +lemma finset_inf_stopping {ι : Type*} (F : Filtration ℝ≥0 ‹MeasurableSpace Ω›) + (s : Finset ι) (τ : ι → Ω → ℝ≥0∞) + (hτ : ∀ i∈s, IsStoppingTime F (τ i)) : + IsStoppingTime F (fun ω => s.inf fun i => τ i ω) := by + induction s using Finset.induction_on with + | empty => + intro t + change MeasurableSet[F t] {ω | ((∅ : Finset ι).inf fun i => τ i ω)≤(t:ℝ≥0∞)} + simp + | @insert i s hi ih => + have h := (hτ i (Finset.mem_insert_self _ _)).min (ih fun j hj => hτ j (Finset.mem_insert_of_mem hj)) + intro t + change MeasurableSet[F t] {ω | ((Insert.insert i s).inf fun i => τ i ω)≤(t:ℝ≥0∞)} + have hh := h t + change MeasurableSet[F t] {ω | min (τ i ω) (s.inf fun i => τ i ω)≤(t:ℝ≥0∞)} at hh + simpa only [Finset.inf_insert] using hh +omit [MeasurableSpace Ω] in +lemma sort_bounded (l : List (Ω → ℝ≥0)) (B : Ω → ℝ≥0) + (hl : ∀ τ∈l, ∀ ω, τ ω≤B ω) : ∀ τ∈sort l, ∀ ω, τ ω≤B ω := by + intro τ hτ ω + have h : τ ω∈l.map (fun σ => σ ω) := + (sort_perm l ω).mem_iff.mp (List.mem_map_of_mem hτ) + obtain ⟨σ,hσ,he⟩ := List.mem_map.mp h + exact he ▸ hl σ hσ ω +end ExactSLEStops + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEStops +open scoped Classical +lemma unfinishedCutoffTop_le {m : ℕ} (a : ℝ) (ha : 0 (unfinishedCutoff a ha z hz ρ hρ hr n b : WithTop ℝ≥0)) := by + have htop : IsStoppingTime rawFiltration (unfinishedCutoffTop a ha z hz ρ hρ hr n) := by + apply (isStoppingTime_const rawFiltration (n:ℝ≥0)).min + apply finset_inf_stopping + intro i hi + let A := {b | (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b : ℝ≥0∞)=radialTime a b.1 (z i) (ρ i)} + have htau := radialStop_stopping a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n + have hA : MeasurableSet[htau.measurableSpace] A := htau.measurableSet_eq_stopping_time + (radialTime_stopping a ha (z i) (hz i) (ρ i) (hρ i) (hr i)) + intro t + change MeasurableSet[rawFiltration t] {b | (if (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b : ℝ≥0∞)=radialTime a b.1 (z i) (ρ i) then ∞ else (radialStop a ha (z i) (hz i) (ρ i) (hρ i) (hr i) n b : ℝ≥0∞))≤(t:ℝ≥0∞)} + have hd := ((htau.measurableSet Aᶜ).mp hA.compl).2 t + convert hd using 1 + ext b + by_cases he : b∈A + · simp only [A,Set.mem_ofPred_eq] at he + simp [he,A] + try exact WithTop.coe_le_coe.symm + · simp only [A,Set.mem_ofPred_eq] at he + simp [he,A] + try exact WithTop.coe_le_coe.symm + + intro t + have h := htop t + change MeasurableSet[rawFiltration t] {b | unfinishedCutoffTop a ha z hz ρ hρ hr n b≤(t:ℝ≥0∞)} at h + change MeasurableSet[rawFiltration t] {b | (unfinishedCutoff a ha z hz ρ hρ hr n b : ℝ≥0∞)≤(t:ℝ≥0∞)} + simpa only [unfinishedCutoff_coe] using h +lemma unfinishedCutoff_before_individual {m : ℕ} (a : ℝ) (ha : 0 + if (radialStop a ha (z j) (hz j) (ρ j) (hρ j) (hr j) n b : ℝ≥0∞)=radialTime a b.1 (z j) (ρ j) + then ∞ else (radialStop a ha (z j) (hz j) (ρ j) (hρ j) (hr j) n b : ℝ≥0∞)) (Finset.mem_univ i) + simpa only [ite_eq_right he] using h + exact ENNReal.coe_le_coe.mp ((ENNReal.coe_le_coe.mpr ht).trans (by rw [unfinishedCutoff_coe]; exact hb)) +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadonKernels.lean b/lean/OAI/Probability/SLEGauge/RadonKernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..b42431a75021ea5d277012d657582c26a01d9eca --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadonKernels.lean @@ -0,0 +1,587 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.MassVersionsCore + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Set Filter CompactlySupported +open scoped ENNReal NNReal Topology + +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace X] + + + +theorem isSFiniteKernel_of_pointwise_finite (κ : Kernel Ω X) + [∀ ω, IsFiniteMeasure (κ ω)] : IsSFiniteKernel κ := by + let r : Ω → ℝ≥0∞ := fun ω => κ ω univ + 1 + have hr : Measurable r := (κ.measurable_coe MeasurableSet.univ).add_const 1 + have hr0 (ω : Ω) : r ω ≠ 0 := by simp [r] + have hrtop (ω : Ω) : r ω ≠ ∞ := by simp [r, measure_ne_top] + let η : Kernel Ω X := ⟨fun ω => (r ω)⁻¹ • κ ω, by + apply Measure.measurable_of_measurable_coe + intro A hA + simp only [Measure.smul_apply, smul_eq_mul] + exact hr.inv.mul (κ.measurable_coe hA)⟩ + have hη : IsFiniteKernel η := by + refine ⟨⟨1, ENNReal.one_lt_top, fun ω => ?_⟩⟩ + change (r ω)⁻¹ * κ ω univ ≤ 1 + calc + _ ≤ (r ω)⁻¹ * r ω := mul_le_mul_of_nonneg_left (le_add_right le_rfl) zero_le + _ = 1 := ENNReal.inv_mul_cancel (hr0 ω) (hrtop ω) + have he : κ = η.withDensity (fun ω _ => r ω) := by + apply Kernel.ext + intro ω + rw [Kernel.withDensity_apply η (f := fun ω (_ : X) => r ω) + (hr.comp measurable_fst), withDensity_const] + change κ ω = r ω • ((r ω)⁻¹ • κ ω) + rw [smul_smul, ENNReal.mul_inv_cancel (hr0 ω) (hrtop ω), one_smul] + rw [he] + exact Kernel.IsSFiniteKernel.withDensity η (fun ω _ => hrtop ω) + +variable [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] + + + +theorem isSFiniteKernel_of_locally_finite (κ : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] : IsSFiniteKernel κ := by + let K := CompactExhaustion.choice X + let V := disjointed (fun n => K n) + have hV (n : ℕ) : MeasurableSet (V n) := + MeasurableSet.disjointed (fun n => (K.isCompact n).measurableSet) n + let η : ℕ → Kernel Ω X := fun n => κ.restrict (hV n) + have hη (n : ℕ) : IsSFiniteKernel (η n) := by + have (ω : Ω) : IsFiniteMeasure (η n ω) := by + refine ⟨?_⟩ + rw [show η n ω = (κ ω).restrict (V n) from rfl, Measure.restrict_apply_univ] + exact (measure_mono (disjointed_subset _ _)).trans_lt (K.isCompact n).measure_lt_top + exact isSFiniteKernel_of_pointwise_finite (η n) + have he : Kernel.sum η = κ := by + apply Kernel.ext + intro ω + change Measure.sum (fun n => (κ ω).restrict (V n)) = κ ω + rw [← Measure.restrict_iUnion (disjoint_disjointed _) (fun n => hV n)] + simp only [iUnion_disjointed, K.iUnion_eq, Measure.restrict_univ] + rw [← he] + exact Kernel.isSFiniteKernel_sum + + + +theorem average_finiteOnCompacts (κ : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] (W : Measure Ω) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) : + IsFiniteMeasureOnCompacts (κ ∘ₘ W) := by + constructor + intro K hK + obtain ⟨g,hg1,-,hgc,hg01⟩ := exists_continuous_one_zero_of_isCompact + hK isClosed_empty (disjoint_empty K) + let f : C_c(X,ℝ) := ⟨g,hgc⟩ + rw [Measure.bind_apply hK.measurableSet κ.aemeasurable] + apply lt_of_le_of_lt _ (hκ f).lintegral_lt_top + apply lintegral_mono + intro ω + exact f.integrable.measure_le_integral (Eventually.of_forall (fun x => (hg01 x).1)) + (fun x hx => le_of_eq ((hg1 hx).symm)) + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] in +lemma average_integrable_compact_test (κ : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] (W : Measure Ω) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) + (f : C_c(X,ℝ)) : Integrable f (κ ∘ₘ W) := by + let g : C_c(X,ℝ) := ⟨⟨fun x => ‖f x‖, f.continuous.norm⟩, f.hasCompactSupport.norm⟩ + apply (Measure.integrable_comp_iff f.continuous.measurable.aestronglyMeasurable).mpr + exact ⟨Eventually.of_forall (fun _ => f.integrable), hκ g⟩ + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] in +lemma average_compact_eval (κ : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] (W : Measure Ω) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) + (f : C_c(X,ℝ)) : + (∫x, f x ∂(κ ∘ₘ W)) = ∫ω, (∫x, f x ∂κ ω) ∂W := by + have hf := average_integrable_compact_test κ W hκ f + rw [Measure.comp_eq_comp_const_apply] at hf ⊢ + exact Kernel.integral_comp hf + +variable [TopologicalSpace.PseudoMetrizableSpace X] + + + +theorem average_eq_of_compact_tests (κ η : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] [∀ ω, IsFiniteMeasureOnCompacts (η ω)] + (W : Measure Ω) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) + (hη : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂η ω) W) + (he : ∀ f : C_c(X,ℝ), (∫ω, (∫x, f x ∂κ ω) ∂W) = ∫ω, (∫x, f x ∂η ω) ∂W) : + κ ∘ₘ W = η ∘ₘ W := by + have := average_finiteOnCompacts κ W hκ + have := average_finiteOnCompacts η W hη + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + simpa only [average_compact_eval _ _ hκ, average_compact_eval _ _ hη] using he f + +omit mΩ [MeasurableSpace X] [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] [TopologicalSpace.PseudoMetrizableSpace X] in +lemma prod_sigma_le {m m₀ : MeasurableSpace Ω} (hm : m ≤ m₀) + (n : MeasurableSpace X) : m.prod n ≤ m₀.prod n := + sup_le_sup (MeasurableSpace.comap_mono hm) le_rfl + + + +theorem conditional_product_eq_of_compact_tests (κ η : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] [∀ ω, IsFiniteMeasureOnCompacts (η ω)] + (W : Measure Ω) [SFinite W] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) + (hη : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂η ω) W) + (he : ∀ U : Set Ω, MeasurableSet[m] U → ∀ f : C_c(X,ℝ), + (∫ω in U, (∫x, f x ∂κ ω) ∂W) = ∫ω in U, (∫x, f x ∂η ω) ∂W) : + (W ⊗ₘ κ).trim (prod_sigma_le hm _) = (W ⊗ₘ η).trim (prod_sigma_le hm _) := by + let : MeasurableSpace Ω := mΩ + have := isSFiniteKernel_of_locally_finite κ + have := isSFiniteKernel_of_locally_finite η + have havg (U : Set Ω) (hU : MeasurableSet[m] U) : + κ ∘ₘ (W.restrict U) = η ∘ₘ (W.restrict U) := + average_eq_of_compact_tests κ η (W.restrict U) + (fun f => (hκ f).restrict) (fun f => (hη f).restrict) (he U hU) + have hrect (U : Set Ω) (hU : MeasurableSet[m] U) (A : Set X) (hA : MeasurableSet A) : + (W ⊗ₘ κ).trim (prod_sigma_le hm _) (U ×ˢ A) = + (W ⊗ₘ η).trim (prod_sigma_le hm _) (U ×ˢ A) := by + rw [trim_measurableSet_eq _ (hU.prod hA), trim_measurableSet_eq _ (hU.prod hA), + Measure.compProd_apply_prod (hm _ hU) hA, Measure.compProd_apply_prod (hm _ hU) hA, + ← Measure.bind_apply hA κ.aemeasurable, ← Measure.bind_apply hA η.aemeasurable, havg U hU] + let K := CompactExhaustion.choice X + have := average_finiteOnCompacts κ W hκ + have hfin (n : ℕ) : (W ⊗ₘ κ).trim (prod_sigma_le hm _) (univ ×ˢ K n) ≠ ∞ := by + rw [trim_measurableSet_eq _ (MeasurableSet.univ.prod (K.isCompact n).measurableSet), + Measure.compProd_apply_prod MeasurableSet.univ (K.isCompact n).measurableSet, + setLIntegral_univ, ← Measure.bind_apply (K.isCompact n).measurableSet κ.aemeasurable] + exact (K.isCompact n).measure_lt_top.ne + let : MeasurableSpace Ω := m + apply Measure.ext_of_generateFrom_of_iUnion + (image2 (· ×ˢ ·) {U : Set Ω | MeasurableSet U} {A : Set X | MeasurableSet A}) + (fun n => univ ×ˢ K n) generateFrom_prod.symm isPiSystem_prod + · ext p + simp only [mem_iUnion, mem_prod, mem_univ, true_and, iff_true] + exact K.exists_mem p.2 + · intro n + exact ⟨univ, MeasurableSet.univ, K n, (K.isCompact n).measurableSet, rfl⟩ + · exact hfin + · rintro _ ⟨U, hU, A, hA, rfl⟩ + exact hrect U hU A hA + + + +theorem conditional_lintegral_eq_of_compact_tests (κ η : Kernel Ω X) + [∀ ω, IsFiniteMeasureOnCompacts (κ ω)] [∀ ω, IsFiniteMeasureOnCompacts (η ω)] + (W : Measure Ω) [SFinite W] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + (hκ : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂κ ω) W) + (hη : ∀ f : C_c(X,ℝ), Integrable (fun ω => ∫x, f x ∂η ω) W) + (he : ∀ U : Set Ω, MeasurableSet[m] U → ∀ f : C_c(X,ℝ), + (∫ω in U, (∫x, f x ∂κ ω) ∂W) = ∫ω in U, (∫x, f x ∂η ω) ∂W) + (H : Ω × X → ℝ≥0∞) (hH : Measurable[m.prod ‹MeasurableSpace X›] H) : + (∫⁻ω, ∫⁻x, H (ω,x) ∂κ ω ∂W) = ∫⁻ω, ∫⁻x, H (ω,x) ∂η ω ∂W := by + let : MeasurableSpace Ω := mΩ + have := isSFiniteKernel_of_locally_finite κ + have := isSFiniteKernel_of_locally_finite η + have hH₀ : Measurable H := hH.mono (prod_sigma_le hm _) le_rfl + rw [← Measure.lintegral_compProd hH₀, ← Measure.lintegral_compProd hH₀, + ← lintegral_trim (prod_sigma_le hm _) hH, + ← lintegral_trim (μ := W ⊗ₘ η) (prod_sigma_le hm _) hH, + conditional_product_eq_of_compact_tests κ η W m hm hκ hη he] + +end SLEExactGauge.MassVersions + +namespace SLEExactGauge.MassVersions + +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace X] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [BorelSpace X] + [TopologicalSpace.PseudoMetrizableSpace X] + +omit [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + [BorelSpace X] [TopologicalSpace.PseudoMetrizableSpace X] in +lemma average_mono (κ : Kernel Ω X) {W V : Measure Ω} (h : V ≤ W) : κ ∘ₘ V ≤ κ ∘ₘ W := by + apply Measure.le_iff.mpr + intro A hA + rw [Measure.bind_apply hA κ.aemeasurable, Measure.bind_apply hA κ.aemeasurable] + exact lintegral_mono' h le_rfl + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] [BorelSpace X] + [TopologicalSpace.PseudoMetrizableSpace X] in +lemma average_restrict_finite (κ : Kernel Ω X) (W : Measure Ω) + [IsFiniteMeasureOnCompacts (κ ∘ₘ W)] (U : Set Ω) : + IsFiniteMeasureOnCompacts (κ ∘ₘ W.restrict U) := by + constructor + intro K hK + exact ((average_mono κ Measure.restrict_le_self) K).trans_lt hK.measure_lt_top + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] + [TopologicalSpace.PseudoMetrizableSpace X] in +lemma average_compact_eval_of_average_finite (κ : Kernel Ω X) (W : Measure Ω) + [IsFiniteMeasureOnCompacts (κ ∘ₘ W)] (f : C_c(X, ℝ)) : + (∫x, f x ∂(κ ∘ₘ W)) = ∫ω, (∫x, f x ∂κ ω) ∂W := by + have hf : Integrable f (κ ∘ₘ W) := f.integrable + rw [Measure.comp_eq_comp_const_apply] at hf ⊢ + exact Kernel.integral_comp hf + + + +theorem conditional_product_eq_of_average_finite (κ η : Kernel Ω X) + [IsSFiniteKernel κ] [IsSFiniteKernel η] (W : Measure Ω) [SFinite W] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + [IsFiniteMeasureOnCompacts (κ ∘ₘ W)] [IsFiniteMeasureOnCompacts (η ∘ₘ W)] + (he : ∀ U : Set Ω, MeasurableSet[m] U → ∀ f : C_c(X,ℝ), + (∫ω in U, (∫x, f x ∂κ ω) ∂W) = ∫ω in U, (∫x, f x ∂η ω) ∂W) : + (W ⊗ₘ κ).trim (prod_sigma_le hm _) = (W ⊗ₘ η).trim (prod_sigma_le hm _) := by + let : MeasurableSpace Ω := mΩ + have havg (U : Set Ω) (hU : MeasurableSet[m] U) : + κ ∘ₘ (W.restrict U) = η ∘ₘ (W.restrict U) := by + have := average_restrict_finite κ W U + have := average_restrict_finite η W U + apply Measure.ext_of_integral_eq_on_compactlySupported + intro f + simpa only [average_compact_eval_of_average_finite] using he U hU f + have hrect (U : Set Ω) (hU : MeasurableSet[m] U) (A : Set X) (hA : MeasurableSet A) : + (W ⊗ₘ κ).trim (prod_sigma_le hm _) (U ×ˢ A) = + (W ⊗ₘ η).trim (prod_sigma_le hm _) (U ×ˢ A) := by + rw [trim_measurableSet_eq _ (hU.prod hA), trim_measurableSet_eq _ (hU.prod hA), + Measure.compProd_apply_prod (hm _ hU) hA, Measure.compProd_apply_prod (hm _ hU) hA, + ← Measure.bind_apply hA κ.aemeasurable, ← Measure.bind_apply hA η.aemeasurable, havg U hU] + let K := CompactExhaustion.choice X + have hfin (n : ℕ) : (W ⊗ₘ κ).trim (prod_sigma_le hm _) (univ ×ˢ K n) ≠ ∞ := by + rw [trim_measurableSet_eq _ (MeasurableSet.univ.prod (K.isCompact n).measurableSet), + Measure.compProd_apply_prod MeasurableSet.univ (K.isCompact n).measurableSet, + setLIntegral_univ, ← Measure.bind_apply (K.isCompact n).measurableSet κ.aemeasurable] + exact (K.isCompact n).measure_lt_top.ne + let : MeasurableSpace Ω := m + apply Measure.ext_of_generateFrom_of_iUnion + (image2 (· ×ˢ ·) {U : Set Ω | MeasurableSet U} {A : Set X | MeasurableSet A}) + (fun n => univ ×ˢ K n) generateFrom_prod.symm isPiSystem_prod + · ext p + simp only [mem_iUnion, mem_prod, mem_univ, true_and, iff_true] + exact K.exists_mem p.2 + · intro n + exact ⟨univ, MeasurableSet.univ, K n, (K.isCompact n).measurableSet, rfl⟩ + · exact hfin + · rintro _ ⟨U, hU, A, hA, rfl⟩ + exact hrect U hU A hA + +theorem conditional_lintegral_eq_of_average_finite (κ η : Kernel Ω X) + [IsSFiniteKernel κ] [IsSFiniteKernel η] (W : Measure Ω) [SFinite W] + (m : MeasurableSpace Ω) (hm : m ≤ mΩ) + [IsFiniteMeasureOnCompacts (κ ∘ₘ W)] [IsFiniteMeasureOnCompacts (η ∘ₘ W)] + (he : ∀ U : Set Ω, MeasurableSet[m] U → ∀ f : C_c(X,ℝ), + (∫ω in U, (∫x, f x ∂κ ω) ∂W) = ∫ω in U, (∫x, f x ∂η ω) ∂W) + (H : Ω × X → ℝ≥0∞) (hH : Measurable[m.prod ‹MeasurableSpace X›] H) : + (∫⁻ω, ∫⁻x, H (ω,x) ∂κ ω ∂W) = ∫⁻ω, ∫⁻x, H (ω,x) ∂η ω ∂W := by + let : MeasurableSpace Ω := mΩ + have hH₀ : Measurable H := hH.mono (prod_sigma_le hm _) le_rfl + rw [← Measure.lintegral_compProd hH₀, ← Measure.lintegral_compProd hH₀, + ← lintegral_trim (prod_sigma_le hm _) hH, + ← lintegral_trim (μ := W ⊗ₘ η) (prod_sigma_le hm _) hH, + conditional_product_eq_of_average_finite κ η W m hm he] + +end SLEExactGauge.MassVersions + +namespace SLEExactGauge.MassVersions +open MeasureTheory ProbabilityTheory Set CompactlySupported +variable {Ω X : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace X] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [BorelSpace X] + +omit [BorelSpace X] in +lemma finiteOnCompacts_of_integrable_tests (ν : Measure X) + (hν : ∀ f : C_c(X,ℝ), Integrable f ν) : IsFiniteMeasureOnCompacts ν := by + constructor + intro K hK + obtain ⟨g,hg1,-,hgc,hg01⟩ := exists_continuous_one_zero_of_isCompact + hK isClosed_empty (disjoint_empty K) + let f : C_c(X,ℝ) := ⟨g,hgc⟩ + exact ((hν f).measure_le_integral (Eventually.of_forall (fun x => (hg01 x).1)) + (fun x hx => le_of_eq ((hg1 hx).symm))).trans_lt ENNReal.ofReal_lt_top + +omit [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] [BorelSpace X] in +lemma average_add (κ η : Kernel Ω X) (W : Measure Ω) : + (κ + η) ∘ₘ W = κ ∘ₘ W + η ∘ₘ W := by + rw [Measure.comp_eq_comp_const_apply, Kernel.comp_add_left, + add_apply, ← Measure.comp_eq_comp_const_apply, ← Measure.comp_eq_comp_const_apply] + +end SLEExactGauge.MassVersions +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +instance upperArea_finiteOnCompacts : IsFiniteMeasureOnCompacts upperArea := by + constructor + intro K hK + rw [upperArea, upper_embedding.comap_apply] + exact (hK.image continuous_subtype_val).measure_lt_top + +lemma survivingGreen_joint_measurable (a : ℝ) (ha : 1/4 survivingGreen a t p.1 p.2.1) := + (actual_surviving_green a ha t).1.mono (prod_sigma_le (rawFiltration.le t) _) le_rfl + +lemma survivingGreen_spatial_measurable (a : ℝ) (ha : 1/4 survivingGreen a t b z.1) := + (survivingGreen_joint_measurable a ha t).comp (measurable_const.prodMk measurable_id) + + +noncomputable def survivingKernel (a : ℝ) (_ha : 1/4 ENNReal.ofReal (survivingGreen a t b z.1)) + +instance survivingKernel_sfinite (a : ℝ) (ha : 1/4 ENNReal.ofReal_ne_top) + +lemma survivingKernel_apply (a : ℝ) (ha : 1/4 ENNReal.ofReal (survivingGreen a t b z.1)) := + Kernel.withDensity_apply _ (survivingGreen_joint_measurable a ha t).ennreal_ofReal b + +lemma survivingKernel_compact_eval (a : ℝ) (ha : 1/4 ENNReal.ofReal_lt_top) + +lemma surviving_compact_spatial_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (f : C_c(UpperPlane,ℝ)) : + Integrable (fun p : UpperPlane × ExactSLEGenerator.Driver => f p.1*survivingGreen a t p.2 p.1.1) + ((upperArea.restrict (tsupport f)).prod W) := by + obtain ⟨c,hc,hcK⟩ := upper_compact_lower (tsupport f) f.hasCompactSupport + obtain ⟨B,hB,hBf⟩ := upperExtension_bounded f + exact (actual_remaining_spatial_L1 a ha W hW t (tsupport f) f.hasCompactSupport.measurableSet + f.hasCompactSupport.measure_lt_top (c/2) (by positivity) + (fun z hz => by have := hcK z hz; linarith) f f.continuous.measurable B hB + (fun z hz => by simpa only [upperExtension_apply] using hBf z.1 ⟨z,hz,rfl⟩) + (fun n : ℕ => 1/((n:ℝ)+1)) + (fun n => ⟨by positivity, (div_le_one (by positivity)).mpr (by linarith [Nat.cast_nonneg (α:=ℝ) n])⟩) + tendsto_one_div_add_atTop_nhds_zero_nat).1 + +lemma survivingKernel_compact_mean_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (f : C_c(UpperPlane,ℝ)) : + Integrable (fun b => ∫z, f z ∂survivingKernel a ha t b) W := by + simp_rw [survivingKernel_compact_eval] + convert (surviving_compact_spatial_integrable a ha W hW t f).integral_prod_right using 1 + funext b + exact (setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => by + rw [image_eq_zero_of_notMem_tsupport hz, zero_mul])).symm + +lemma survivingKernel_compact_ae_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (f : C_c(UpperPlane,ℝ)) : + ∀ᵐ b ∂W, Integrable f (survivingKernel a ha t b) := by + filter_upwards [(surviving_compact_spatial_integrable a ha W hW t f).prod_left_ae] with b hb + rw [survivingKernel_apply, integrable_withDensity_iff_integrable_smul' + (survivingGreen_spatial_measurable a ha t b).ennreal_ofReal + (Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top))] + simp only [ENNReal.toReal_ofReal (survivingGreen_nonneg _ _ _ _), smul_eq_mul] + have hs : Function.support (fun z : UpperPlane => f z * survivingGreen a t b z.1) ⊆ tsupport f := + (Function.support_mul_subset_left _ _).trans (subset_tsupport f) + simpa only [mul_comm] using (integrableOn_iff_integrable_of_support_subset hs).mp hb + +lemma survivingKernel_average_compact_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (f : C_c(UpperPlane,ℝ)) : + Integrable f (survivingKernel a ha t ∘ₘ W) := by + let g : C_c(UpperPlane,ℝ) := ⟨⟨fun z => ‖f z‖,f.continuous.norm⟩,f.hasCompactSupport.norm⟩ + apply (Measure.integrable_comp_iff f.continuous.measurable.aestronglyMeasurable).mpr + exact ⟨survivingKernel_compact_ae_integrable a ha W hW t f, + survivingKernel_compact_mean_integrable a ha W hW t g⟩ + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma survivingKernel_average_finiteOnCompacts (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) : IsFiniteMeasureOnCompacts (survivingKernel a ha t ∘ₘ W) := + finiteOnCompacts_of_integrable_tests _ (survivingKernel_average_compact_integrable a ha W hW t) + + + +theorem compact_conditional_to_random_tests (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℝ≥0) (μ ν : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] [∀ b, IsFiniteMeasureOnCompacts (ν b)] + (hμ : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z, f z ∂μ b) W) + (hν : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z, f z ∂ν b) W) + (he : ∀ f : C_c(UpperPlane,ℝ), ∀ U : Set ExactSLEGenerator.Driver, + MeasurableSet[rawFiltration t] U → + (∫b in U, (∫z, f z ∂ν b) - (∫z, f z ∂μ b) ∂W) = + ∫b in U, (∫z, f z*survivingGreen a t b z.1 ∂upperArea) ∂W) + (H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞) + (hH : Measurable[(rawFiltration t).prod (inferInstance : MeasurableSpace UpperPlane)] H) : + (∫⁻b, ∫⁻z, H (b,z) ∂ν b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a t b z.1) ∂upperArea ∂W := by + have := isSFiniteKernel_of_locally_finite μ + have := isSFiniteKernel_of_locally_finite ν + have := average_finiteOnCompacts μ W hμ + have := average_finiteOnCompacts ν W hν + have := survivingKernel_average_finiteOnCompacts a ha W hW t + have : IsFiniteMeasureOnCompacts ((μ + survivingKernel a ha t) ∘ₘ W) := by + rw [SLEExactGauge.MassVersions.average_add] + constructor + intro K hK + rw [Measure.add_apply] + exact ENNReal.add_lt_top.mpr ⟨hK.measure_lt_top,hK.measure_lt_top⟩ + have hidentity := conditional_lintegral_eq_of_average_finite ν (μ + survivingKernel a ha t) W + (rawFiltration t) (rawFiltration.le t) ?_ H hH + · rw [hidentity] + have hH₀ : Measurable H := hH.mono (prod_sigma_le (rawFiltration.le t) _) le_rfl + have heval (b : ExactSLEGenerator.Driver) : + (∫⁻z, H (b,z) ∂(μ+survivingKernel a ha t) b) = + (∫⁻z, H (b,z) ∂μ b) + ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a t b z.1) ∂upperArea := by + have hHb : Measurable (fun z : UpperPlane => H (b,z)) := + hH₀.comp ((measurable_const (a := b)).prodMk measurable_id) + rw [add_apply, lintegral_add_measure, survivingKernel_apply] + congr 1 + exact (lintegral_withDensity_eq_lintegral_mul upperArea + (survivingGreen_spatial_measurable a ha t b).ennreal_ofReal hHb).trans + (lintegral_congr (fun _ => mul_comm _ _)) + simp_rw [heval] + rw [lintegral_add_left] + exact hH₀.lintegral_kernel_prod_right' + · intro U hU f + have hadd : (fun b => ∫z, f z ∂(μ+survivingKernel a ha t) b) =ᵐ[W] + (fun b => (∫z, f z ∂μ b)+(∫z, f z ∂survivingKernel a ha t b)) := by + filter_upwards [survivingKernel_compact_ae_integrable a ha W hW t f] with b hb + exact integral_add_measure f.integrable hb + rw [integral_congr_ae (ae_restrict_of_ae hadd), + integral_add (hμ f).restrict (survivingKernel_compact_mean_integrable a ha W hW t f).restrict] + have hf := he f U hU + rw [integral_sub (hν f).restrict (hμ f).restrict] at hf + simp_rw [survivingKernel_compact_eval] + linarith + +end ExactSLEGreen +end + + + +section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_raw_mass_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → ∀ f : C_c(UpperPlane,ℝ), + (∫b, (∫z,f z∂μ (t i) b) ∂W) = ∫z : UpperPlane, + f z * (Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → ∀ f : C_c(UpperPlane,ℝ), + ∀ U : Set ExactSLEGenerator.Driver, MeasurableSet[rawFiltration v] U → + (∫b in U, (∫z,f z∂μ (t j) b)-(∫z,f z∂μ (t i) b) ∂W) = + ∫b in U, (∫z : UpperPlane,f z*survivingGreen a v b z.1 ∂upperArea) ∂W) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) := by + obtain ⟨s,c,ν,hs,hc,hsum,hν,hmom,hL1,hmean,-,hcond,h⟩ := + actual_radon_compact_conditional a ha W hW t + let μ := recoveredMass a ha s c hc + have hμ (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : + IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular := + ⟨radonLimit_finite _, radonLimit_regular _⟩ + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := (hμ v b).1 + have hmeas (v : ℝ≥0∞) : Measurable (μ v) := recoveredMass_measurable a ha s c hc v + have he : ∀ᵐ b ∂W, ∀ i, μ (t i) b = ν b i := by + filter_upwards [h] with b hb + intro i + have := (hν b i).2 + apply radonLimit_eq + intro f + simpa only [actualMassFunctionals_apply] using hb.2 i f + have heI (i : ℕ) (f : C_c(UpperPlane,ℝ)) : + (fun b => ∫z,f z∂μ (t i) b) =ᵐ[W] (fun b => ∫z,f z∂ν b i) := by + filter_upwards [he] with b hb + rw [hb i] + have hmoment (i : ℕ) (f : C_c(UpperPlane,ℝ)) (m : ℕ) : + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W := + (memLp_congr_ae (heI i f)).mpr (hmom i f m) + have hcompact (i j : ℕ) (v : ℝ≥0) (hi : t i=v) (hj : t j=∞) + (f : C_c(UpperPlane,ℝ)) (U : Set ExactSLEGenerator.Driver) + (hU : MeasurableSet[rawFiltration v] U) : + (∫b in U, (∫z,f z∂μ (t j) b)-(∫z,f z∂μ (t i) b) ∂W) = + ∫b in U, (∫z : UpperPlane,f z*survivingGreen a v b z.1 ∂upperArea) ∂W := + (integral_congr_ae (ae_restrict_of_ae ((heI j f).sub (heI i f)))).trans + (hcond i j v hi hj f U hU) + refine ⟨s,c,hc,hs,hsum,hμ,hmeas,recoveredMass_progressive a ha s c hc,hmoment,?_,?_,hcompact,?_,?_⟩ + · intro i f + have hnorm (k : ℕ) : + eLpNorm (fun b => (∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) - ∫z,f z∂μ (t i) b) 1 W = + eLpNorm (fun b => (∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) - ∫z,f z∂ν b i) 1 W := + eLpNorm_congr_ae (EventuallyEq.sub (Filter.EventuallyEq.refl _ _) (heI i f)) + dsimp only [μ] at hnorm + simpa only [hnorm] using hL1 i f + · intro i hi f + exact (integral_congr_ae (heI i f)).trans (hmean i hi f) + · intro i j v hi hj H hH + let K : ℝ≥0∞ → Kernel ExactSLEGenerator.Driver UpperPlane := fun r => ⟨μ r,hmeas r⟩ + exact compact_conditional_to_random_tests a ha W hW v (K (t i)) (K (t j)) + (fun f => by + change Integrable (fun b => ∫z,f z∂μ (t i) b) W + exact memLp_one_iff_integrable.mp (by simpa only [Nat.cast_one] using hmoment i f 1)) + (fun f => by + change Integrable (fun b => ∫z,f z∂μ (t j) b) W + exact memLp_one_iff_integrable.mp (by simpa only [Nat.cast_one] using hmoment j f 1)) + (hcompact i j v hi hj) H hH + · filter_upwards [he,h] with b hb hb' + dsimp only [μ] at hb + simpa only [hb] using hb' + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RadonMoments.lean b/lean/OAI/Probability/SLEGauge/RadonMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb0d11f4ea97094bf274e43e2665c9767c70173c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RadonMoments.lean @@ -0,0 +1,472 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.LocalFiniteness + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +open Filter Topology +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open MeasureTheory Filter Topology Set CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal +theorem actual_radon_all_moments (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + AEStronglyMeasurable (fun b => ∫ z, f z ∂μ b i) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + obtain ⟨s,c,μ,hs,hc,hsum,hμ,hmeas,h⟩ := actual_ordered_radon_extraction a ha W hW t + refine ⟨s,c,μ,hs,hc,hsum,hμ,hmeas,?_,h⟩ + intro i f m + apply actual_radon_limit_memLp a ha W hW (t i) s c hc hsum (fun b => μ b i) f _ m + filter_upwards [h] with b hb + exact hb.2 i f + +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal + +lemma unifIntegrable_of_L2_bound {Ω : Type*} [MeasurableSpace Ω] + (W : Measure Ω) (F : ℕ → Ω → ℝ) + (hF : ∀ n, AEStronglyMeasurable (F n) W) + (C : ℝ≥0∞) (hC : C<∞) (hbound : ∀ n, eLpNorm (F n) 2 W≤C) : + UnifIntegrable F 1 W := by + apply unifIntegrable_iff.mpr + intro ε hε + have ht : Tendsto (fun δ : ℝ => C * (ENNReal.ofReal δ)^((1:ℝ)/2)) (𝓝 0) (𝓝 0) := by + have h := (ENNReal.continuous_rpow_const (y := (1:ℝ)/2)).continuousAt.tendsto.comp + (ENNReal.continuous_ofReal.continuousAt.tendsto (x := (0:ℝ))) + have hzero : (ENNReal.ofReal (0:ℝ))^((1:ℝ)/2)=(0:ℝ≥0∞) := by simp + rw [hzero] at h + simpa using ENNReal.Tendsto.const_mul h (Or.inr hC.ne) + obtain ⟨r,hr,hrb⟩ := Metric.eventually_nhds_iff.mp + ((tendsto_order.mp ht).2 ε hε) + have hδ : 0 b.1 t) W) + (t : ℝ≥0∞) (q : ℕ → ℝ) (hq : ∀ j,0 ∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (q j) t b) atTop (𝓝 (∫z,f z∂μ b))) : + Tendsto (fun k => eLpNorm (fun b => (∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (q j) t b)-(∫z,f z∂μ b)) 1 W) atTop (𝓝 0) := by + let F := fun k b => ∑j∈s k,coeff k j*∫z,f z∂actualUpperMass a (q j) t b + have hF (k : ℕ) : AEStronglyMeasurable (F k) W := by + have H := Finset.aestronglyMeasurable_sum (μ := W) (s k) (fun j hj => + (actualUpperMass_eval_measurable a ha (q j) (hq j) (hq1 j) t f).aestronglyMeasurable.const_mul (coeff k j)) + convert H using 1 + funext b + simp only [F,Finset.sum_apply] + obtain ⟨C,hC,hCb⟩ := actualUpperMass_Lp_bound a ha W hW 2 (by norm_num) f + have hbound (k : ℕ) : eLpNorm (F k) 2 W≤C := + convex_eLpNorm_bound W _ C (by norm_num) (s k) (coeff k) (hc k) (hsum k) + (fun j b => ∫z,f z∂actualUpperMass a (q j) t b) + (fun j hj => (hCb (q j) (hq j) (hq1 j) t).1.aestronglyMeasurable) + (fun j hj => (hCb (q j) (hq j) (hq1 j) t).2) + have hg2 : MemLp (fun b => ∫z,f z∂μ b) 2 W := + (Lp.eLpNorm_le_of_ae_tendsto (Filter.Eventually.of_forall hbound) hF + (aestronglyMeasurable_of_tendsto_ae atTop hF hlim) hlim).trans_lt hC + have hg := hg2.mono_exponent (by norm_num : (1:ℝ≥0∞)≤2) + exact tendsto_Lp_finite_of_tendsto_ae le_rfl (by simp) hF (by simpa using hg) + (unifIntegrable_of_L2_bound W F hF C hC hbound) hlim + + + +theorem actual_radon_L1_convergence (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ b i) 1 W) atTop (𝓝 0)) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + obtain ⟨s,c,μ,hs,hc,hsum,hμ,hmeas,hmom,h⟩ := actual_radon_all_moments a ha W hW t + refine ⟨s,c,μ,hs,hc,hsum,hμ,hmom,?_,h⟩ + intro i f + have hq1 (j : ℕ) : Real.exp (-2*a*(j+1))≤1 := by + apply Real.exp_le_one_iff.mpr + have ha0 : 0 Real.exp (-2*a*(j+1))) + (fun j => Real.exp_pos _) hq1 s c hc hsum (fun b => μ b i) f + filter_upwards [h] with b hb + exact hb.2 i f + +end ExactSLEGreen + +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction +open scoped NNReal ENNReal + +lemma actualMassEval_joint_integrable (a : ℝ) (ha : 1/4 + f p.2 * (timeMassDensity a q t p.1 p.2).toReal) (W.prod (volume.restrict K)) := by + obtain ⟨B,hB,hBf⟩ := hfB + have : IsFiniteMeasure (volume.restrict K) := ⟨by simpa using hKb.measure_lt_top⟩ + have hm : Measurable (fun p : ExactSLEGenerator.Driver × ℂ => + f p.2 * (timeMassDensity a q t p.1 p.2).toReal) := + (hf.comp measurable_snd).mul (timeMassDensity_measurable a ha q hq hq1 t).ennreal_toReal + apply Integrable.of_bound hm.aestronglyMeasurable (B*((c*q)^(-alpha a))) + have hmem : ∀ᵐ p ∂W.prod (volume.restrict K), p.2∈K := + (Measure.ae_prod_iff_ae_ae (hK.preimage measurable_snd)).mpr + (Eventually.of_forall fun _ => ae_restrict_mem hK) + filter_upwards [hmem] with p hp + have hb := timeMassDensity_local_bound a ha q hq hq1 t p.1 c hc p.2 (hcK _ hp) + have hD : 0≤(c*q)^(-alpha a) := Real.rpow_nonneg (by positivity) _ + have hd : (timeMassDensity a q t p.1 p.2).toReal≤(c*q)^(-alpha a) := by + exact ENNReal.toReal_le_of_le_ofReal hD hb + rw [norm_mul,Real.norm_of_nonneg ENNReal.toReal_nonneg] + exact mul_le_mul (hBf _ hp) hd ENNReal.toReal_nonneg hB + +lemma terminal_density_mean (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 b.1 t) W) + (q : ℝ) (hq : 0 b.1 t) W) + (q : ℝ) (hq : 0 ?_)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => ?_)] + · rw [upperExtension_zero f z (by rintro ⟨w,hw,rfl⟩; exact hz w.2), zero_mul] + · rw [upperExtension_zero f z hz, zero_mul] + · exact (integral_subtype_comap (μ := (volume : Measure ℂ)) upperPlane_open.measurableSet + (fun z : ℂ => upperExtension f z*(Real.exp (-alpha a*Real.log 2)*physicalGreen a (z,0)))).symm + +lemma actual_radon_limit_mean (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (hsum : ∀ k,∑j∈s k,coeff k j=1) + (μ : ExactSLEGenerator.Driver → Measure UpperPlane) (f : C_c(UpperPlane,ℝ)) + (hg : MemLp (fun b => ∫z,f z∂μ b) 1 W) + (hlim : Tendsto (fun k => eLpNorm (fun b => (∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b)-(∫z,f z∂μ b)) 1 W) atTop (𝓝 0)) : + (∫b, (∫z,f z∂μ b) ∂W) = ∫z : UpperPlane, + f z*(Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea := by + let q (j : ℕ) := Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 ∑j∈s k,coeff k j*∫z,f z∂actualUpperMass a (q j) ∞ b + obtain ⟨C,hC,hCb⟩ := actualUpperMass_Lp_bound a ha W hW 1 (by norm_num) f + have hFi (k : ℕ) : Integrable (F k) W := + integrable_finsetSum (s k) (fun j hj => + ((hCb (q j) (hq j) (hq1 j) ∞).1.integrable (by norm_num)).const_mul (coeff k j)) + change Tendsto (fun k => eLpNorm (fun b => F k b - ∫z,f z∂μ b) 1 W) atTop (𝓝 0) at hlim + have ht := tendsto_integral_of_L1 (fun b => ∫z,f z∂μ b) hg.aestronglyMeasurable + (Eventually.of_forall hFi) (by + exact hlim.congr fun index => eLpNorm_one_eq_lintegral_enorm + ((hFi index).aestronglyMeasurable.sub hg.aestronglyMeasurable)) + have he (k : ℕ) : (∫b,F k b∂W) = ∫z : UpperPlane, + f z*(Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea := by + dsimp only [F] + rw [integral_finsetSum _ (fun j hj => + ((hCb (q j) (hq j) (hq1 j) ∞).1.integrable (by norm_num)).const_mul (coeff k j))] + simp_rw [integral_const_mul] + simp_rw [actualUpperMass_terminal_mean a ha W hW _ (hq _) (hq1 _) f] + rw [← Finset.sum_mul,hsum k,one_mul] + exact tendsto_nhds_unique ht (by simpa only [he] using tendsto_const_nhds) + + + +theorem actual_radon_terminal_mean (a : ℝ) (ha : 1/4 b.1 t) W) + (t : ℕ → ℝ≥0∞) : + ∃ (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (μ : ExactSLEGenerator.Driver → ℕ → Measure UpperPlane), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤coeff k j) ∧ + (∀ k, ∑ j∈s k, coeff k j=1) ∧ + (∀ b i, IsFiniteMeasureOnCompacts (μ b i) ∧ (μ b i).Regular) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ b i) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ b i) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → ∀ f : C_c(UpperPlane,ℝ), + (∫b, (∫z,f z∂μ b i) ∂W) = ∫z : UpperPlane, + f z * (Real.exp (-alpha a*Real.log 2)*physicalGreen a (z.1,0)) ∂upperArea) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i ≤ t j → μ b i ≤ μ b j) ∧ + (∀ i (f : C_c(UpperPlane, ℝ)), + Tendsto (fun k => ∑ j∈s k, coeff k j * + ∫ z, f z ∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫ z, f z ∂μ b i))) + := by + obtain ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,h⟩ := actual_radon_L1_convergence a ha W hW t + refine ⟨s,c,μ,hs,hc,hsum,hμ,hmom,hL1,?_,h⟩ + intro i hi f + apply actual_radon_limit_mean a ha W hW s c hsum (fun b => μ b i) f + (by simpa using hmom i f 1) + simpa only [hi] using hL1 i f + +end ExactSLEGreen + +namespace ExactSLEGenerator +open MeasureTheory ProbabilityTheory Filter Topology +open scoped NNReal ENNReal +noncomputable def pastDriver (t : ℝ≥0) (b : Driver) : Driver := + ⟨⟨fun s => b.1 (min s t), b.1.continuous.comp (continuous_id.min continuous_const)⟩, by simpa using b.2⟩ +lemma pastDriver_eq (t : ℝ≥0) (b : Driver) (s : ℝ≥0) (hs : s≤t) : + (pastDriver t b).1 s = b.1 s := by simp [pastDriver,min_eq_left hs] +lemma pastDriver_raw_measurable (t : ℝ≥0) : Measurable[rawFiltration t] (pastDriver t) := by + have : PolishSpace Driver := (isClosed_eq (continuous_eval_const 0) continuous_const).polishSpace + obtain ⟨u,hu⟩ := TopologicalSpace.exists_dense_seq (α:=ℝ≥0) + let e : Driver → (ℕ → ℝ) := fun b n => b.1 (u n) + have hec : Continuous e := continuous_pi fun n => (continuous_eval_const (u n)).comp continuous_subtype_val + have hei : Function.Injective e := by + intro b c h + apply Subtype.ext + apply DFunLike.coe_injective + exact hu.equalizer b.1.continuous c.1.continuous h + have hem := hec.measurableEmbedding hei + apply hem.measurable_comp_iff.mp + let : MeasurableSpace Driver := rawFiltration t + apply measurable_pi_iff.mpr + intro n + exact ((Filtration.stronglyAdapted_natural driver_eval_measurable) (min (u n) t)).measurable.mono + (rawFiltration.mono (min_le_right _ _)) le_rfl +end ExactSLEGenerator +namespace ExactSLEMain +open MeasureTheory ExactSLEGenerator +open scoped NNReal ENNReal +lemma odeUntil_driver_congr {a : ℝ} {b c : ℝ≥0 → ℝ} {z : ℂ} {t : ℝ≥0} + (h : ∀ s≤t, b s=c s) {f : ℝ → ℂ} (hf : odeUntil a b z t f) : odeUntil a c z t f := by + refine ⟨hf.1,fun u hu => ?_⟩ + have he := h u.toNNReal ((Real.toNNReal_le_iff_le_coe).mpr hu.2) + simpa only [he] using hf.2 u hu +lemma alive_driver_congr {a : ℝ} {b c : ℝ≥0 → ℝ} {z : ℂ} {t : ℝ≥0} + (h : ∀ s≤t, b s=c s) : alive a b t z ↔ alive a c t z := by + exact ⟨fun ⟨f,hf⟩ => ⟨f,odeUntil_driver_congr h hf⟩, + fun ⟨f,hf⟩ => ⟨f,odeUntil_driver_congr (fun s hs => (h s hs).symm) hf⟩⟩ +lemma loewnerMap_driver_congr {a : ℝ} {b c : ℝ≥0 → ℝ} {t : ℝ≥0} + (h : ∀ s≤t, b s=c s) : loewnerMap a b t = loewnerMap a c t := by + funext z + by_cases hb : alive a b t z + · obtain ⟨f,hf⟩ := hb + exact (loewnerMap_eq hf).trans (loewnerMap_eq (odeUntil_driver_congr h hf)).symm + · have hc := mt (alive_driver_congr h).mpr hb + simp [loewnerMap,hb,hc] +end ExactSLEMain +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal +lemma actualState_driver_congr {a : ℝ} {b c : ℝ≥0 → ℝ} {t : ℝ≥0} (h : ∀ s≤t,b s=c s) (z : ℂ) : + actualState a b t z = actualState a c t z := by + simp only [actualState,loewnerMap_driver_congr h,h t le_rfl] +lemma radialTime_driver_congr_before (a : ℝ) (ha : 0 h s (hs.trans hbr)) z + have hc : radialTime a c.1 z ρ≤radialTime a b.1 z ρ := by + have hh := radialTime_le_of_hit a z ρ c (radialTime a b.1 z ρ).toNNReal + ((alive_driver_congr (fun s hs => h s (hs.trans hbr))).mp hba) (by rw [← he]; exact hbh) + simpa only [ENNReal.coe_toNNReal hbfin] using hh + have hcfin : radialTime a c.1 z ρ≠∞ := ne_top_of_le_ne_top hbfin hc + have hcr : (radialTime a c.1 z ρ).toNNReal≤t := by + exact ENNReal.coe_le_coe.mp (by simpa only [ENNReal.coe_toNNReal hcfin] using hc.trans hb) + obtain ⟨hca,hch⟩ := radialTime_attained a ha z hz ρ hρ hr c hcfin + have he' := actualState_driver_congr (a:=a) (fun s hs => (h s (hs.trans hcr)).symm) z + have hh := radialTime_le_of_hit a z ρ b (radialTime a c.1 z ρ).toNNReal + ((alive_driver_congr (fun s hs => (h s (hs.trans hcr)).symm)).mp hca) (by rw [← he']; exact hch) + exact le_antisymm (by simpa only [ENNReal.coe_toNNReal hcfin] using hh) hc +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal +lemma timeMassDensity_driver_congr (a : ℝ) (ha : 0 (h s hs).symm) hc] + by_cases hb : radialTime a b.1 z (z.im*q)≤t + · have he := radialTime_driver_congr_before a ha z hz _ hρ hr b c t h hb + have hfin : radialTime a b.1 z (z.im*q)≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top hb + have ht : (radialTime a b.1 z (z.im*q)).toNNReal≤t := by + exact ENNReal.coe_le_coe.mp (by simpa only [ENNReal.coe_toNNReal hfin] using hb) + have hs := actualState_driver_congr (a:=a) (fun s hs => h s (hs.trans ht)) z + have hw : radialWeight a b.1 z (z.im*q)=radialWeight a c.1 z (z.im*q) := by + unfold radialWeight + rw [ite_eq_right hfin,ite_eq_right (ne_of_eq_of_ne he.symm hfin),← he,hs] + have hn : 2*z.im*q/2=z.im*q := by ring + simp only [timeMassDensity,ite_eq_left hb,ite_eq_left (hiff.mp hb),massDensity,ite_eq_left hz,fullRadialDensity,hn,hw] + · simp only [timeMassDensity,ite_eq_right hb,ite_eq_right (mt hiff.mpr hb)] + · simp only [timeMassDensity,massDensity,ite_eq_right hz,ite_self] +lemma timeMassDensity_past_eq (a : ℝ) (ha : 1/4 timeMassDensity a q t p.1 p.2) = + (fun p : ExactSLEGenerator.Driver × ℂ => timeMassDensity a q t (pastDriver t p.1) p.2) := by + funext p + exact timeMassDensity_driver_congr a (by linarith) q hq hq1 p.1 (pastDriver t p.1) t + (fun s hs => (pastDriver_eq t p.1 s hs).symm) p.2 +lemma rawPastPair_measurable (t : ℝ≥0) : + @Measurable (ExactSLEGenerator.Driver × ℂ) (ExactSLEGenerator.Driver × ℂ) + ((rawFiltration t).prod (borel ℂ)) inferInstance (fun p => (pastDriver t p.1,p.2)) := by + exact ((pastDriver_raw_measurable t).comp + (@measurable_fst _ _ (rawFiltration t) (borel ℂ))).prodMk + (@measurable_snd _ _ (rawFiltration t) (borel ℂ)) + +theorem timeMassDensity_raw_joint (a : ℝ) (ha : 1/4 timeMassDensity a q t p.1 p.2) := by + change @Measurable (ExactSLEGenerator.Driver × ℂ) ℝ≥0∞ + ((rawFiltration t).prod (borel ℂ)) inferInstance _ + rw [timeMassDensity_past_eq a ha q hq hq1 t] + exact @Measurable.comp (ExactSLEGenerator.Driver × ℂ) (ExactSLEGenerator.Driver × ℂ) ℝ≥0∞ + ((rawFiltration t).prod (borel ℂ)) inferInstance inferInstance + (fun p => timeMassDensity a q (t : ℝ≥0∞) p.1 p.2) + (fun p => (pastDriver t p.1,p.2)) + (timeMassDensity_measurable a ha q hq hq1 (t : ℝ≥0∞)) (rawPastPair_measurable t) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RandomRestrictionKernel.lean b/lean/OAI/Probability/SLEGauge/RandomRestrictionKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..9dd5d76b2beca9adb41808b855a82c673aa2dd64 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RandomRestrictionKernel.lean @@ -0,0 +1,595 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RawRestartTests + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.MassVersions + +lemma measurable_random_restrict {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (K : Kernel Ω X) [IsSFiniteKernel K] {A : Set (Ω×X)} (hA : MeasurableSet A) : + Measurable (fun ω => (K ω).restrict {x | (ω,x)∈A}) := by + let F : Ω→X→ℝ≥0∞ := fun ω x => if (ω,x)∈A then 1 else 0 + have hF : Measurable (Function.uncurry F) := by + change Measurable (fun p : Ω×X => if p∈A then (1:ℝ≥0∞) else 0) + exact Measurable.ite hA measurable_const measurable_const + have he (ω : Ω) : K.withDensity F ω=(K ω).restrict {x | (ω,x)∈A} := by + rw [Kernel.withDensity_apply K hF] + change (K ω).withDensity ({x | (ω,x)∈A}.indicator (fun _ => 1))=_ + have hB : MeasurableSet {x | (ω,x)∈A} := hA.preimage (measurable_const.prodMk measurable_id) + rw [withDensity_indicator hB] + exact MeasureTheory.withDensity_one + have he' : (K.withDensity F : Ω→Measure X)=(fun ω => (K ω).restrict {x | (ω,x)∈A}) := funext he + rw [←he'] + exact (K.withDensity F).measurable + +end SLEExactGauge.MassVersions +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.TraceRestriction +variable {X Y : Type*} [MeasurableSpace X] [MetricSpace Y] + [MeasurableSpace Y] [BorelSpace Y] + +lemma tendsto_integral_visited_atTop (ν : Measure X) + (ι : X→Y) (hι : Measurable ι) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (hfull : ∀ᵐ x ∂ν, ι x∈range γ) (f : X→ℝ) (hf : Integrable f ν) : + Tendsto (fun t : ℝ≥0 => ∫x in visited ι γ t,f x∂ν) atTop (𝓝 (∫x,f x∂ν)) := by + simp_rw [←integral_indicator (measurableSet_visited ι hι γ hγ _)] + apply tendsto_integral_filter_of_dominated_convergence (fun x => ‖f x‖) + · exact Eventually.of_forall (fun t => hf.aestronglyMeasurable.indicator + (measurableSet_visited ι hι γ hγ t)) + · exact Eventually.of_forall (fun _ => Eventually.of_forall fun _ => norm_indicator_le_norm_self _ _) + · exact hf.norm + · filter_upwards [hfull] with x hx + obtain ⟨u,hu⟩ := hx + apply tendsto_const_nhds.congr' + filter_upwards [eventually_ge_atTop u] with t ht + exact (indicator_of_mem (show x∈visited ι γ t from ⟨u,⟨bot_le,ht⟩,hu⟩) f).symm + +lemma continuous_integral_restrict_visited (ν : Measure X) [NullSingletonClass ν] + (ι : X→Y) (hι : Measurable ι) (hinj : Function.Injective ι) + (γ : ℝ≥0→Y) (hγ : Continuous γ) {A : Set X} (hA : MeasurableSet A) + (f : X→ℝ) (hf : Integrable f ν) : + Continuous (fun t : ℝ≥0 => ∫x,f x∂(ν.restrict (visited ι γ t)).restrict A) := by + simp_rw [←integral_indicator hA] + exact continuous_integral_visited ν ι hι hinj γ hγ (A.indicator f) (hf.indicator hA) + +lemma tendsto_integral_restrict_visited_atTop (ν : Measure X) + (ι : X→Y) (hι : Measurable ι) (γ : ℝ≥0→Y) (hγ : Continuous γ) + (hfull : ∀ᵐ x ∂ν, ι x∈range γ) {A : Set X} (hA : MeasurableSet A) + (f : X→ℝ) (hf : Integrable f ν) : + Tendsto (fun t : ℝ≥0 => ∫x,f x∂(ν.restrict (visited ι γ t)).restrict A) + atTop (𝓝 (∫x in A,f x∂ν)) := by + simp_rw [←integral_indicator hA] + exact tendsto_integral_visited_atTop ν ι hι γ hγ hfull (A.indicator f) (hf.indicator hA) + +end SLEExactGauge.TraceRestriction +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions +open TraceRestriction TraceMassContinuity TraceMassIntegration + +lemma measurableSet_alive_atStop_raw (a : ℝ) (ha : 1/4 + ((stoppedData S p.1).1,((stoppedData S p.1).2,p.2))) := + (hD.fst.comp measurable_fst).prodMk ((hD.snd.comp measurable_fst).prodMk measurable_snd) + have he : {p : GDriver×UpperPlane | alive a p.1.1 (S p.1).toNNReal p.2.1}= + (fun p : GDriver×UpperPlane => ((stoppedData S p.1).1,((stoppedData S p.1).2,p.2))) ⁻¹' + {p : ℝ≥0×(GDriver×UpperPlane) | alive a p.2.1.1 p.1 p.2.2.1} := by + ext p + exact (alive_driver_congr (pastDriver_eq (S p.1).toNNReal p.1)).symm + rw [he] + exact (measurableSet_alive_joint a ha).preimage hin + +lemma measurableSet_alive_spatial (a : ℝ) (b : GDriver) (t : ℝ≥0) : + MeasurableSet {z : UpperPlane | alive a b.1 t z.1} := + ((isOpen_alive b.1.continuous t).preimage continuous_subtype_val).measurableSet + + +def recoveredPostStop (a : ℝ) (ha : 1/4 recoveredMass a ha s c hc (S b+t) b, + recoveredMass_stopping_raw_measurable a ha s c hc _ (shiftStop_isStoppingTime hS t)⟩ + let (b : GDriver) : IsFiniteMeasureOnCompacts (K b) := radonLimit_finite _ + have : IsSFiniteKernel K := isSFiniteKernel_of_locally_finite K + have hA : MeasurableSet {p : GDriver×UpperPlane | alive a p.1.1 (S p.1).toNNReal p.2.1} := + (prod_sigma_le (measurableSpace_le_shiftStop hS t) _ ) _ (measurableSet_alive_atStop_raw a ha hS) + have htop : MeasurableSet {b : GDriver | S b=∞} := + (measurableSpace_le_shiftStop hS t) _ (hS.measurable (measurableSet_singleton ∞)) + exact Measurable.ite htop measurable_const (measurable_random_restrict K hA) + +lemma recoveredPostStop_terminal_measurable (a : ℝ) (ha : 1/4 if S b=∞ then (0:Measure UpperPlane) else + (K b).restrict {z | alive a b.1 (S b).toNNReal z.1}) := + Measurable.ite htop measurable_const (measurable_random_restrict K hA) + change Measurable (fun b => recoveredPostStop a ha s c hc S ∞ b) + simpa only [recoveredPostStop,add_top,K,Kernel.coe_mk] using hh + +lemma recoveredPostStop_measurable (a : ℝ) (ha : 1/4 exact recoveredPostStop_terminal_measurable a ha s c hc hS + | coe t => + exact (recoveredPostStop_raw_measurable a ha s c hc hS t).mono + ((afterStopFiltration hS).le t) le_rfl + +lemma recoveredPostStop_finiteOnCompacts (a : ℝ) (ha : 1/4 fun b => ∫z,f z∂recoveredPostStop a ha s c hc S t b) := by + intro t + let : MeasurableSpace GDriver := (afterStopFiltration hS) t + let K : Kernel GDriver UpperPlane := ⟨recoveredPostStop a ha s c hc S t, + recoveredPostStop_raw_measurable a ha s c hc hS t⟩ + exact f.continuous.stronglyMeasurable.integral_kernel (κ:=K) + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.MassVersions +variable {Ω X : Type*} [MeasurableSpace Ω] + [TopologicalSpace X] [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] [MeasurableSpace X] [BorelSpace X] + +theorem ae_finiteOnCompacts_of_average (K : Kernel Ω X) (W : Measure Ω) + [IsFiniteMeasureOnCompacts (K ∘ₘ W)] : + ∀ᵐ ω ∂W, IsFiniteMeasureOnCompacts (K ω) := by + let C := CompactExhaustion.choice X + have hn (n : ℕ) : ∀ᵐ ω ∂W, K ω (C n)<∞ := by + apply ae_lt_top (K.measurable_coe (C.isCompact n).measurableSet) + rw [←Measure.bind_apply (C.isCompact n).measurableSet K.aemeasurable] + exact (C.isCompact n).measure_lt_top.ne + filter_upwards [ae_all_iff.mpr hn] with ω hω + constructor + intro A hA + obtain ⟨n,hn⟩ := C.exists_superset_of_isCompact hA + exact (measure_mono hn).trans_lt (hω n) + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] in +lemma compact_eval_integrable_of_average [T2Space X] [LocallyCompactSpace X] + [SecondCountableTopology X] (K : Kernel Ω X) (W : Measure Ω) + [IsFiniteMeasureOnCompacts (K ∘ₘ W)] (f : C_c(X,ℝ)) : + Integrable (fun ω => ∫x,f x∂K ω) W := by + have hi : Integrable f (K ∘ₘ W) := f.integrable + rw [Measure.comp_eq_comp_const_apply] at hi + exact hi.integral_comp + +lemma ae_compact_integrable_of_average (K : Kernel Ω X) (W : Measure Ω) + [IsFiniteMeasureOnCompacts (K ∘ₘ W)] : + ∀ᵐ ω ∂W, ∀f : C_c(X,ℝ), Integrable f (K ω) := by + filter_upwards [ae_finiteOnCompacts_of_average K W] with ω hω f + let := hω + exact f.integrable + +end SLEExactGauge.MassVersions +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions +open TraceRestriction TraceMassContinuity TraceMassIntegration + +lemma recoveredPostStop_terminal_le (a : ℝ) (ha : 1/4 ∫z,f z∂recoveredPostStop a ha s c hc S ∞ b) W := by + let K : Kernel GDriver UpperPlane := ⟨recoveredPostStop a ha s c hc S ∞, + recoveredPostStop_terminal_measurable a ha s c hc hS⟩ + have hle : K ∘ₘ W ≤ initialGreenMeasure a := by + rw [←hmean] + apply Measure.le_iff.mpr + intro A hA + rw [Measure.bind_apply hA K.aemeasurable, + Measure.bind_apply hA (recoveredMass_measurable a ha s c hc ∞).aemeasurable] + exact lintegral_mono (fun b => (recoveredPostStop_terminal_le a ha s c hc S b) A) + let : IsFiniteMeasureOnCompacts (K ∘ₘ W) := + ⟨fun A hA => (hle A).trans_lt hA.measure_lt_top⟩ + exact compact_eval_integrable_of_average K W f + +lemma recoveredPostStop_zero_of_convergence (a : ℝ) (ha : 1/4 ∑j∈s k,c k j*∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass a ha s c hc v b))) : + recoveredPostStop a ha s c hc S 0 b=0 := by + unfold recoveredPostStop + split_ifs with hb + · rfl + · rw [add_zero,←ENNReal.coe_toNNReal hb] + let : IsFiniteMeasureOnCompacts (recoveredMass a ha s c hc (S b).toNNReal b) := + radonLimit_finite _ + apply Measure.restrict_eq_zero.mpr + exact actual_limit_past_hull_support a ha s c hs b (S b).toNNReal _ + (hconv (S b).toNNReal) + + + +theorem recoveredPostStop_path_properties (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure GDriver) (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b))) + (S : GDriver→ℝ≥0∞) : + let ν := recoveredPostStop (Target.a κ) (a_gt_quarter hκ hκ8) s c hc S + ∀ᵐ b ∂W, ν 0 b=0 ∧ Monotone (fun v => ν v b) ∧ + (∀f : C_c(UpperPlane,ℝ), Continuous (fun t : ℝ≥0 => ∫z,f z∂ν t b) ∧ + Tendsto (fun t : ℝ≥0 => ∫z,f z∂ν t b) atTop (𝓝 (∫z,f z∂ν ∞ b))) := by + intro ν + let a := Target.a κ + have ha : 1/4 ⟨continuous_const,tendsto_const_nhds⟩ + · let A : Set UpperPlane := {z | alive a b.1 (S b).toNNReal z.1} + have hA : MeasurableSet A := measurableSet_alive_spatial a b _ + have he (t : ℝ≥0) : ν t b=(μ (((S b).toNNReal+t : ℝ≥0) : ℝ≥0∞) b).restrict A := by + simp only [ν,recoveredPostStop,ite_eq_right hb,μ,ENNReal.coe_add,ENNReal.coe_toNNReal hb,A,a] + have het : ν ∞ b=(μ ∞ b).restrict A := by + simp only [ν,recoveredPostStop,ite_eq_right hb,add_top,μ,A,a] + change TraceMassFacts κ (driverHomeomorph.symm b) (fun v => μ v b) at hp + let := hp.atomless + let : IsFiniteMeasureOnCompacts (μ ∞ b) := radonLimit_finite _ + have hγ := continuous_internalTrace hκ _ hp.continuous_trace + have hfull : ∀ᵐ z ∂μ ∞ b, z.1∈range (internalTrace κ (driverHomeomorph.symm b)) := by + filter_upwards [hp.firstVisit_finite] with z hz + exact (firstVisit_lt_top_iff _ _ _).mp hz + have hshift : Tendsto (fun t : ℝ≥0 => (S b).toNNReal+t) atTop atTop := by + apply tendsto_atTop.mpr + intro u + filter_upwards [eventually_ge_atTop u] with t ht + exact ht.trans (le_add_self) + intro f + simp_rw [he,het,hp.restriction] + exact ⟨(continuous_integral_restrict_visited (μ ∞ b) _ measurable_subtype_coe + Subtype.val_injective _ hγ hA f f.integrable).comp (continuous_const.add continuous_id), + (tendsto_integral_restrict_visited_atTop (μ ∞ b) _ measurable_subtype_coe _ + hγ hfull hA f f.integrable).comp hshift⟩ + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions + +lemma restartPush_integral (a : ℝ) (ha : 1/4 lt_top_iff_ne_top.mpr (restartWeight_ne_top a b s w)))] + rfl + +lemma integrable_restartPush_iff (a : ℝ) (ha : 1/4 (restartWeight a b s w).toReal* + f (inverseUpper a (lt_trans (by norm_num) ha) b s w)) μ := by + have hJ := (continuous_inverseUpper a (lt_trans (by norm_num) ha) b s).measurable + rw [restartPush,integrable_map_measure hf.aestronglyMeasurable hJ.aemeasurable, + integrable_withDensity_iff_integrable_smul' (restartWeight_measurable a ha b s) + (Eventually.of_forall (fun w => lt_top_iff_ne_top.mpr (restartWeight_ne_top a b s w)))] + rfl + +lemma restartPush_mono (a : ℝ) (ha : 0 b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {p : GDriver→Prop} (hp : ∀ᵐ b ∂W, p b) : + ∀ᵐ b ∂W, S b≠∞ → p (restartAt S b) := by + apply (ae_restrict_iff' (hS.measurable' (measurableSet_singleton ∞)).compl).mp + apply ae_of_ae_map (measurable_restartAt hS).aemeasurable + have he := map_restartAt_restrict hW hS (A:=univ) MeasurableSet.univ + rw [univ_inter] at he + change ∀ᵐ b ∂(W.restrict {b | S b≠∞}).map (restartAt S), p b + rw [he] + exact Measure.ae_smul_measure hp _ + + + +theorem restartCandidateKernel_terminal_regular (a : ℝ) (ha : 1/4 b.1 t) W) + (hμ : μ ∘ₘ W=initialGreenMeasure a) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + (∀ᵐ b ∂W, IsFiniteMeasureOnCompacts (restartCandidateKernel a ha μ S hS b) ∧ + (restartCandidateKernel a ha μ S hS b).Regular) ∧ + ∀f : C_c(UpperPlane,ℝ), Integrable + (fun b => ∫z,f z∂restartCandidateKernel a ha μ S hS b) W := by + let K := restartCandidateKernel a ha μ S hS + have hav : K ∘ₘ W ≤ initialGreenMeasure a := + restartCandidateKernel_average_le_initial a ha μ W hW hμ S hS + let : IsFiniteMeasureOnCompacts (K ∘ₘ W) := ⟨fun A hA => + (hav A).trans_lt hA.measure_lt_top⟩ + refine ⟨?_,compact_eval_integrable_of_average K W⟩ + filter_upwards [ae_finiteOnCompacts_of_average K W] with b hb + let := hb + exact ⟨hb,inferInstance⟩ + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions TraceRestriction +open TraceMassContinuity TraceMassIntegration + +lemma continuous_restartPush_visited (a : ℝ) (ha : 1/4 ∫z,f z∂restartPush a (lt_trans (by norm_num) ha) + b s (ν.restrict (visited (fun z : UpperPlane => z.1) γ t))) := by + simp_rw [restartPush_integral a ha b s _ hf] + exact continuous_integral_visited ν _ measurable_subtype_coe Subtype.val_injective γ hγ _ + ((integrable_restartPush_iff a ha b s ν hf).mp hfi) + +lemma tendsto_restartPush_visited_atTop (a : ℝ) (ha : 1/4 ∫z,f z∂restartPush a (lt_trans (by norm_num) ha) + b s (ν.restrict (visited (fun z : UpperPlane => z.1) γ t))) atTop + (𝓝 (∫z,f z∂restartPush a (lt_trans (by norm_num) ha) b s ν)) := by + simp_rw [restartPush_integral a ha b s _ hf] + exact tendsto_integral_visited_atTop ν _ measurable_subtype_coe γ hγ hfull _ + ((integrable_restartPush_iff a ha b s ν hf).mp hfi) + + + +theorem recoveredRestart_path_properties (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure GDriver) (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j) + (hmean : recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc ∞ ∘ₘ W= + initialGreenMeasure (Target.a κ)) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + let ν := recoveredRestart (Target.a κ) (a_gt_quarter hκ hκ8) s c hc S + (∀f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂ν ∞ b) W) ∧ + (∀ᵐ b ∂W, (∀v, IsFiniteMeasureOnCompacts (ν v b) ∧ (ν v b).Regular) ∧ + ν 0 b=0 ∧ Monotone (fun v => ν v b) ∧ + (∀f : C_c(UpperPlane,ℝ), Continuous (fun t : ℝ≥0 => ∫z,f z∂ν t b) ∧ + Tendsto (fun t : ℝ≥0 => ∫z,f z∂ν t b) atTop (𝓝 (∫z,f z∂ν ∞ b)))) := by + intro ν + let a := Target.a κ + have ha : 1/4 ⟨inferInstance,inferInstance⟩,True.intro,monotone_const, + fun _ => ⟨continuous_const,tendsto_const_nhds⟩⟩ + · have hp := hp hb + change TraceMassFacts κ (driverHomeomorph.symm (restartAt S b)) (fun v => μ v (restartAt S b)) at hp + have he (v : ℝ≥0∞) : ν v b=restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (μ v (restartAt S b)) := by simp only [hν,ite_eq_right hb] + have hmono : Monotone (fun v => ν v b) := by + intro v w hvw + change ν v b≤ν w b + rw [he,he] + exact restartPush_mono _ _ _ _ (hp.monotone hvw) + have hdom (v : ℝ≥0∞) : ν v b≤ν ∞ b := hmono le_top + have hlocal (v : ℝ≥0∞) : IsFiniteMeasureOnCompacts (ν v b) := by + let := hr.1 + exact ⟨fun A hA => ((hdom v) A).trans_lt hA.measure_lt_top⟩ + refine ⟨fun v => ⟨hlocal v,?_⟩,?_,hmono,?_⟩ + · let := hlocal v + infer_instance + · rw [he] + simp only [μ,recoveredMass_zero a ha s c hc] + simp only [restartPush,withDensity_zero_left,Measure.map_zero] + · intro f + let := hr.1 + let := hp.atomless + have hfi : Integrable f (restartPush a (lt_trans (by norm_num) ha) b + (S b).toNNReal (μ ∞ (restartAt S b))) := by rw [←he]; exact f.integrable + have hγ := continuous_internalTrace hκ _ hp.continuous_trace + have hfull : ∀ᵐ z ∂μ ∞ (restartAt S b), z.1∈range (internalTrace κ (driverHomeomorph.symm (restartAt S b))) := by + filter_upwards [hp.firstVisit_finite] with z hz + exact (firstVisit_lt_top_iff _ _ _).mp hz + simp_rw [he,hp.restriction] + exact ⟨continuous_restartPush_visited a ha b _ _ _ hγ f.continuous.measurable hfi, + tendsto_restartPush_visited_atTop a ha b _ _ _ hγ hfull f.continuous.measurable hfi⟩ + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped Classical ENNReal +namespace SLEExactGauge.MassVersions + +lemma random_restrict_test_lintegral {Ω X : Type*} [MeasurableSpace Ω] [MeasurableSpace X] + (W : Measure Ω) (K : Ω→Measure X) (D : Ω→Set X) + (hD : ∀ω,MeasurableSet (D ω)) {B : Set Ω} (hB : MeasurableSet B) (f : X→ℝ≥0∞) : + (∫⁻ω,∫⁻x,(if ω∈B then (D ω).indicator f x else 0)∂K ω∂W)= + ∫⁻ω in B,∫⁻x,f x∂(K ω).restrict (D ω)∂W := by + rw [←lintegral_indicator hB] + apply lintegral_congr + intro ω + by_cases hω : ω∈B + · simp only [ite_eq_left hω,indicator_of_mem hω] + exact lintegral_indicator (hD ω) f + · simp only [ite_eq_right hω,indicator_of_notMem hω,lintegral_zero] + +lemma conditional_random_restrict_on {Ω X : Type*} [mΩ : MeasurableSpace Ω] + [MeasurableSpace X] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + (W : @Measure Ω mΩ) (K L R : Ω→Measure X) + (hcond : ∀H : Ω×X→ℝ≥0∞, Measurable[m.prod (inferInstance : MeasurableSpace X)] H → + (∫⁻ω,∫⁻x,H (ω,x)∂K ω∂W)=(∫⁻ω,∫⁻x,H (ω,x)∂L ω∂W)+ + ∫⁻ω,∫⁻x,H (ω,x)∂ R ω∂W) + (D : Ω→Set X) (hD : MeasurableSet[m.prod (inferInstance : MeasurableSpace X)] + {p : Ω×X | p.2∈D p.1}) {B : Set Ω} (hB : MeasurableSet[m] B) + {f : X→ℝ≥0∞} (hf : Measurable f) : + (∫⁻ω in B,∫⁻x,f x∂(K ω).restrict (D ω)∂W)= + (∫⁻ω in B,∫⁻x,f x∂(L ω).restrict (D ω)∂W)+ + ∫⁻ω in B,∫⁻x,f x∂(R ω).restrict (D ω)∂W := by + let F : Ω×X→ℝ≥0∞ := fun p => if p.2∈D p.1 then f p.2 else 0 + have hF : Measurable[m.prod (inferInstance : MeasurableSpace X)] F := + Measurable.ite hD (hf.comp measurable_snd) measurable_const + let H : Ω×X→ℝ≥0∞ := fun p => if p.1∈B then F p else 0 + have hH : Measurable[m.prod (inferInstance : MeasurableSpace X)] H := + Measurable.ite (hB.preimage measurable_fst) hF measurable_const + have hsec (ω : Ω) : MeasurableSet (D ω) := by + exact hD.preimage (measurable_const.prodMk measurable_id) + have he (M : Ω→Measure X) : (∫⁻ω,∫⁻x,H (ω,x)∂M ω∂W)= + ∫⁻ω in B,∫⁻x,f x∂(M ω).restrict (D ω)∂W := by + change (∫⁻ω,∫⁻x,(if ω∈B then (D ω).indicator f x else 0)∂M ω∂W)=_ + exact @random_restrict_test_lintegral Ω X mΩ _ W M D hsec B (hm B hB) f + simpa only [he] using hcond H hH + +end SLEExactGauge.MassVersions +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RawBrownianRestart.lean b/lean/OAI/Probability/SLEGauge/RawBrownianRestart.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f8f6b0671dc788a5301ffb708cd08782a9a03e9 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RawBrownianRestart.lean @@ -0,0 +1,483 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.BrownianRestart +import OAI.Probability.SLEGauge.SurvivalLocalization +import OAI.Probability.SLEGauge.LoewnerScaling + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology Function +open scoped NNReal ENNReal ContinuousMapZero BoundedContinuousFunction +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEGenerator ExactSLEMain + + +def restart (t : ℝ≥0) (b : GDriver) : GDriver := + driverHomeomorph (BrownianRestart.shift t (driverHomeomorph.symm b)) + +@[simp] lemma restart_apply (t u : ℝ≥0) (b : GDriver) : + (restart t b).1 u=b.1 (t+u)-b.1 t := rfl + +lemma continuous_restart_joint : Continuous (fun p : ℝ≥0×GDriver => restart p.1 p.2) := + driverHomeomorph.continuous.comp (BrownianRestart.continuous_shift_joint.comp + (continuous_fst.prodMk (driverHomeomorph.symm.continuous.comp continuous_snd))) + + +def restartAt (S : GDriver→ℝ≥0∞) (b : GDriver) : GDriver := restart (S b).toNNReal b + +lemma comap_rawFiltration (t : ℝ≥0) : + MeasurableSpace.comap driverHomeomorph (rawFiltration t)=BrownianRestart.filtration t := by + simp only [rawFiltration,BrownianRestart.filtration,Filtration.natural_eq_comap, + MeasurableSpace.comap_comp] + rfl + +lemma measurable_driver_raw (t : ℝ≥0) : + @Measurable TDriver GDriver (BrownianRestart.filtration t) (rawFiltration t) driverHomeomorph := + measurable_iff_comap_le.mpr (comap_rawFiltration t).le + +lemma measurable_driver_raw_all : + @Measurable TDriver GDriver (⨆t,BrownianRestart.filtration t) (⨆t,rawFiltration t) driverHomeomorph := by + apply measurable_iff_comap_le.mpr + simp only [MeasurableSpace.comap_iSup,comap_rawFiltration,le_refl] + +lemma stoppingTime_transport {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + IsStoppingTime BrownianRestart.filtration (S ∘ driverHomeomorph) := by + intro t + exact measurable_driver_raw t (hS t) + +lemma measurable_driver_stopped {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + @Measurable TDriver GDriver (stoppingTime_transport hS).measurableSpace hS.measurableSpace + driverHomeomorph := by + intro A hA + refine ⟨measurable_driver_raw_all hA.1,fun t => ?_⟩ + exact measurable_driver_raw t (hA.2 t) + +lemma measurable_restartAt {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + Measurable (restartAt S) := + continuous_restart_joint.measurable.comp + ((ENNReal.measurable_toNNReal.comp hS.measurable').prodMk measurable_id) + +lemma restartAt_transport (S : GDriver→ℝ≥0∞) (b : TDriver) : + driverHomeomorph (BrownianRestart.shiftAt (S ∘ driverHomeomorph) b)= + restartAt S (driverHomeomorph b) := by + simp only [restartAt,restart,BrownianRestart.shiftAt,Function.comp_apply, + Homeomorph.symm_apply_apply] + +lemma setIntegral_restartAt {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) (f : GDriver→ᵇℝ) : + (∫b in A ∩ {b | S b≠∞}, f (restartAt S b) ∂W)= + ∫_b in A ∩ {b | S b≠∞}, (∫b,f b∂W) ∂W := by + have h := BrownianRestart.setIntegral_shiftAt_finite + (LoewnerScaling.brownian_map_inverse_driver W hW) (stoppingTime_transport hS) + (measurable_driver_stopped hS hA) (f.compContinuous ⟨driverHomeomorph,driverHomeomorph.continuous⟩) + have hm : MeasurableEmbedding driverHomeomorph.symm := + driverMeasurableEquiv.symm.measurableEmbedding + rw [hm.setIntegral_map,hm.setIntegral_map,hm.integral_map] at h + change + (∫b in driverHomeomorph.symm ⁻¹' (driverHomeomorph ⁻¹' A ∩ + {b | S (driverHomeomorph b)≠∞}), + f (driverHomeomorph (BrownianRestart.shiftAt + (fun b => S (driverHomeomorph b)) (driverHomeomorph.symm b))) ∂W)= + ∫_b in driverHomeomorph.symm ⁻¹' (driverHomeomorph ⁻¹' A ∩ + {b | S (driverHomeomorph b)≠∞}), + (∫b,f (driverHomeomorph (driverHomeomorph.symm b))∂W) ∂W at h + have hA' : driverHomeomorph.symm ⁻¹' (driverHomeomorph ⁻¹' A)=A := by + ext b + change driverHomeomorph (driverHomeomorph.symm b) ∈ A ↔ b∈A + rw [driverHomeomorph.apply_symm_apply] + simpa [restartAt,restart,BrownianRestart.shiftAt,hA'] using h + + + +theorem map_restartAt_restrict {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) : + (W.restrict (A ∩ {b | S b≠∞})).map (restartAt S)=W (A ∩ {b | S b≠∞}) • W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have : IsFiniteMeasure (W (A ∩ {b | S b≠∞}) • W) := W.smul_finite (measure_ne_top W _) + have : PolishSpace GDriver := (isClosed_eq (continuous_eval_const 0) continuous_const).polishSpace + apply ext_of_forall_integral_eq_of_IsFiniteMeasure + intro f + rw [integral_map (measurable_restartAt hS).aemeasurable f.continuous.aestronglyMeasurable, + setIntegral_restartAt hW hS hA f,integral_smul_measure] + simp only [integral_const,measureReal_def,Measure.restrict_apply_univ] + + + +theorem map_data_restartAt {X : Type*} [MeasurableSpace X] {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {D : GDriver→X} (hD : Measurable[hS.measurableSpace] D) : + (W.restrict {b | S b≠∞}).map (fun b => (D b,restartAt S b))= + ((W.restrict {b | S b≠∞}).map D).prod W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + have hY := measurable_restartAt hS + apply Measure.ext_prod + intro A B hA hB + rw [Measure.map_apply (hD'.prodMk hY) (hA.prod hB),Measure.prod_prod, + Measure.map_apply hD' hA,Measure.restrict_apply (hD' hA)] + have he := congrArg (fun μ : Measure GDriver => μ B) (map_restartAt_restrict hW hS (hD hA)) + rw [Measure.map_apply hY hB,Measure.restrict_apply (hY hB),Measure.smul_apply,smul_eq_mul] at he + rw [Measure.restrict_apply ((hD'.prodMk hY) (hA.prod hB))] + convert he using 1 + congr 1 + ext b + simp only [mem_inter_iff,mem_preimage,mem_prod,mem_ofPred_eq] + tauto + + +theorem lintegral_data_restartAt {X : Type*} [MeasurableSpace X] {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {D : GDriver→X} (hD : Measurable[hS.measurableSpace] D) + {F : X×GDriver→ℝ≥0∞} (hF : Measurable F) : + (∫⁻b in {b | S b≠∞},F (D b,restartAt S b) ∂W)= + ∫⁻b in {b | S b≠∞},∫⁻c,F (D b,c) ∂W ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + rw [←lintegral_map hF (hD'.prodMk (measurable_restartAt hS)),map_data_restartAt hW hS hD, + lintegral_prod _ hF.aemeasurable,lintegral_map hF.lintegral_prod_right' hD'] + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEMain + +lemma actualState_restart {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {s t : ℝ≥0} {z : ℂ} (hz : alive a b (s+t) z) : + actualState a b (s+t) z = + ((actualState a (shiftDriver b s) t (loewnerMap a b s z-(b s:ℂ))).1, + (actualState a (shiftDriver b s) t (loewnerMap a b s z-(b s:ℂ))).2+ + (actualState a b s z).2) := by + have hs := (alive_restart_iff a b z s t).mp hz + apply Prod.ext + · simp only [actualState,shiftDriver,Complex.ofReal_sub] + rw [(loewnerMap_restart a b z s t hz).2] + ring + · simp only [actualState,deriv_loewnerMap_restart hb hz,norm_mul, + Real.log_mul (norm_ne_zero_iff.mpr (deriv_loewnerMap_ne_zero + (continuous_shiftDriver hb s) hs.2)) + (norm_ne_zero_iff.mpr (deriv_loewnerMap_ne_zero hb hs.1))] + +lemma physicalRadius_add_log (v : State) (l : ℝ) : + physicalRadius (v.1,v.2+l)=Real.exp (-l)*physicalRadius v := by + simp only [physicalRadius,Y_apply,J_apply,neg_add,Real.exp_add] + ring + +lemma logGreen_add_log (a : ℝ) (v : State) (l : ℝ) : + logGreen a (v.1,v.2+l)=alpha a*l+logGreen a v := by + simp only [logGreen,J_apply,Y_apply,Q,X_apply] + ring + +lemma physicalGreen_add_log (a : ℝ) (v : State) (l : ℝ) : + physicalGreen a (v.1,v.2+l)=Real.exp (alpha a*l)*physicalGreen a v := by + rw [physicalGreen,logGreen_add_log,Real.exp_add] + rfl + + +lemma physicalRadius_restart {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {s t : ℝ≥0} {z : ℂ} (hz : alive a b (s+t) z) : + physicalRadius (actualState a b (s+t) z)= + ‖deriv (loewnerMap a b s) z‖⁻¹ * + physicalRadius (actualState a (shiftDriver b s) t (loewnerMap a b s z-(b s:ℂ))) := by + rw [actualState_restart hb hz,physicalRadius_add_log] + congr 1 + rw [actualState,Real.exp_neg,Real.exp_log] + exact norm_pos_iff.mpr (deriv_loewnerMap_ne_zero hb + ((alive_restart_iff a b z s t).mp hz).1) + + +lemma physicalGreen_restart {a : ℝ} {b : ℝ≥0→ℝ} (hb : Continuous b) + {s t : ℝ≥0} {z : ℂ} (hz : alive a b (s+t) z) : + physicalGreen a (actualState a b (s+t) z)= + ‖deriv (loewnerMap a b s) z‖^(alpha a) * + physicalGreen a (actualState a (shiftDriver b s) t (loewnerMap a b s z-(b s:ℂ))) := by + rw [actualState_restart hb hz,physicalGreen_add_log] + congr 1 + rw [Real.rpow_def_of_pos (norm_pos_iff.mpr (deriv_loewnerMap_ne_zero hb + ((alive_restart_iff a b z s t).mp hz).1))] + congr 1 + exact mul_comm _ _ + +end ExactSLEGreen + +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen + +lemma restart_eq_shiftDriver (s : ℝ≥0) (b : GDriver) : + ((restart s b).1 : ℝ≥0→ℝ)=shiftDriver b.1 s := rfl + + + +theorem survivingGreen_restart (a : ℝ) (b : GDriver) (s t : ℝ≥0) {z : ℂ} + (hz : alive a b.1 s z) : + survivingGreen a (s+t) b z = ‖deriv (loewnerMap a b.1 s) z‖^(alpha a) * + survivingGreen a t (restart s b) (loewnerMap a b.1 s z-(b.1 s:ℂ)) := by + classical + have hc : alive a b.1 (s+t) z ↔ + alive a (restart s b).1 t (loewnerMap a b.1 s z-(b.1 s:ℂ)) := by + rw [alive_restart_iff] + exact and_iff_right hz + by_cases h : alive a b.1 (s+t) z + · unfold survivingGreen + rw [ite_eq_left h, ite_eq_left (hc.mp h),physicalGreen_restart b.1.continuous h, + restart_eq_shiftDriver] + ring + · simp only [survivingGreen,ite_eq_right h,ite_eq_right (hc.not.mp h),mul_zero] + + +theorem survivingGreen_restart_ratio (a : ℝ) (b : GDriver) (s t : ℝ≥0) {z : ℂ} + (hz : alive a b.1 s z) : + survivingGreen a (s+t) b z / survivingGreen a s b z = + survivingGreen a t (restart s b) (loewnerMap a b.1 s z-(b.1 s:ℂ)) / + survivingGreen a 0 (restart s b) (loewnerMap a b.1 s z-(b.1 s:ℂ)) := by + have he := survivingGreen_restart a b s 0 hz + simp only [add_zero] at he + rw [survivingGreen_restart a b s t hz,he] + exact mul_div_mul_left _ _ (Real.rpow_pos_of_pos + (norm_pos_iff.mpr (deriv_loewnerMap_ne_zero b.1.continuous hz)) _).ne' + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +namespace ExactSLECalculus +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma N_rpow {f : E → ℝ} {v e : E} (r : ℝ) + (hf : DifferentiableAt ℝ f v) (hp : 0 < f v) : + N (fun w => f w ^ r) e v = r * f v ^ (r-1) * N f e v := by + have hh := Real.contDiffAt_rpow_const (n := 1) (p := r) (Or.inl hp.ne') + simpa only [Function.comp_def, Real.deriv_rpow_const] using + N_comp (e := e) hf hh.differentiableAt_one + +lemma L_rpow {f : E → ℝ} {v A e : E} (r : ℝ) + (hf : ContDiffAt ℝ 2 f v) (hp : 0 < f v) : + L (fun w => f w ^ r) A e v = r * f v ^ (r-1) * L f A e v + + (1/2:ℝ) * (r * (r-1) * f v ^ (r-2)) * N f e v ^ 2 := by + have hh := Real.contDiffAt_rpow_const (n := 2) (p := r) (Or.inl hp.ne') + have he : deriv (deriv (fun x : ℝ => x ^ r)) (f v) = + r * (r-1) * f v ^ (r-2) := by + rw [Real.deriv_rpow_const', deriv_const_mul_field, Real.deriv_rpow_const] + rw [show r - 1 - 1 = r - 2 by ring] + ring + simpa only [Function.comp_def, Real.deriv_rpow_const, he] using + L_comp (A := A) (e := e) hf hh + +end ExactSLECalculus + +namespace ExactSLEGreen +open ExactSLECalculus + + + +noncomputable def centeredGenerator (a : ℝ) (f : State → ℝ) (v : State) : ℝ := + L f (physicalDrift a v) noise v + noiseLog a v * N f noise v + +lemma green_product_generator (a : ℝ) (ha : a ≠ 0) (f : State → ℝ) + (v : State) (hv : 0 < Y v) (hf : ContDiffAt ℝ 2 f v) : + L (fun w => physicalGreen a w * f w) (physicalDrift a v) noise v = + physicalGreen a v * centeredGenerator a f v := by + have hg : ContDiffAt ℝ 2 (physicalGreen a) v := + (contDiffAt_physicalGreen a v hv).of_le (by norm_cast) + rw [L_mul hg hf] + have hz : L (physicalGreen a) (physicalDrift a v) noise v = 0 := + green_generator_zero a ha v hv + rw [hz, show N (physicalGreen a) noise v = physicalGreen a v * noiseLog a v from + green_fderiv_noise a v hv] + dsimp [centeredGenerator] + ring + +lemma N_Q (v : State) : N Q noise v = -2 * X v := by + rw [N, (hasFDerivAt_Q v).fderiv] + simp [noise] + +lemma L_Q (a : ℝ) (v : State) : + L Q (physicalDrift a v) noise v = + 1 + 2 * a * (X v ^ 2 - Y v ^ 2) / Q v := by + have hn : N Q noise = fun w => -2 * X w := funext N_Q + rw [L, hn, N, (X.hasFDerivAt.const_mul (-2 : ℝ)).fderiv, + (hasFDerivAt_Q v).fderiv] + simp only [_root_.smul_apply, _root_.add_apply, smul_eq_mul, + regX_drift, regY_drift] + simp only [X_apply, noise, Complex.neg_re, Complex.one_re] + ring + +lemma N_Y (v : State) : N Y noise v = 0 := by + rw [N, Y.hasFDerivAt.fderiv] + simp [noise] + +lemma L_Y (a : ℝ) (v : State) : + L Y (physicalDrift a v) noise v = -a * Y v / Q v := by + have hn : N Y noise = fun _ => (0 : ℝ) := funext N_Y + rw [L, hn, N, fderiv_const_apply, _root_.zero_apply, + Y.hasFDerivAt.fderiv, regY_drift] + ring + +lemma centeredGenerator_Qpow (a q : ℝ) (v : State) (hv : 0 < Y v) : + centeredGenerator a (fun w => Q w ^ (q/2)) v = + q * Q v ^ (q/2-2) * ((1/2-a) * Q v + (q/2-2*a) * X v ^ 2) := by + have hc : ContDiffAt ℝ 2 Q v := ((X.contDiff.pow 2).add (Y.contDiff.pow 2)).contDiffAt + have hq := Q_pos hv + have he : Q v ^ (q/2-1) = Q v ^ (q/2-2) * Q v := by + rw [← Real.rpow_add_one hq.ne'] + congr 1 + ring + rw [centeredGenerator, L_rpow _ hc hq, N_rpow _ (hasFDerivAt_Q v).differentiableAt hq, + L_Q, N_Q, he] + dsimp only [noiseLog, p] + field_simp + ring_nf + simp only [Q] + ring + +lemma centeredGenerator_Ypow (a q : ℝ) (v : State) (hv : 0 < Y v) : + centeredGenerator a (fun w => Y w ^ q) v = -a * q * Y v ^ q / Q v := by + have he : Y v ^ (q-1) * Y v = Y v ^ q := by + rw [← Real.rpow_add_one hv.ne'] + congr 1 + ring + rw [centeredGenerator, L_rpow _ Y.contDiff.contDiffAt hv, + N_rpow _ Y.differentiableAt hv, N_Y, L_Y] + calc + _ = -a * q * (Y v ^ (q-1) * Y v) / Q v := by ring + _ = _ := by rw [he] + + +noncomputable def lifetimeTest (q : ℝ) (v : State) : ℝ := + Q v ^ (q/2) + 2 * Y v ^ q + +lemma lifetimeTest_smooth (q : ℝ) (v : State) (hv : 0 < Y v) : + ContDiffAt ℝ (↑(⊤ : ℕ∞)) (lifetimeTest q) v := by + exact ((((X.contDiff.pow 2).add (Y.contDiff.pow 2)).contDiffAt.rpow_const_of_ne + (Q_pos hv).ne').add (contDiffAt_const.mul (Y.contDiff.contDiffAt.rpow_const_of_ne hv.ne'))) + +lemma lifetimeTest_nonneg (q : ℝ) (v : State) (hv : 0 ≤ Y v) : + 0 ≤ lifetimeTest q v := by + unfold lifetimeTest Q + positivity + +lemma lifetimeTest_coercive (q : ℝ) (v : State) (hv : 0 ≤ Y v) : + Q v ^ (q/2) ≤ lifetimeTest q v := by + dsimp [lifetimeTest] + exact le_add_of_nonneg_right (mul_nonneg (by norm_num) (Real.rpow_nonneg hv _)) + +lemma centeredGenerator_lifetimeTest (a q : ℝ) (v : State) (hv : 0 < Y v) : + centeredGenerator a (lifetimeTest q) v = + q * Q v ^ (q/2-2) * ((1/2-a) * Q v + (q/2-2*a) * X v ^ 2) - + 2 * a * q * Y v ^ q / Q v := by + have hQ : ContDiffAt ℝ 2 (fun w => Q w ^ (q/2)) v := + (((X.contDiff.pow 2).add (Y.contDiff.pow 2)).contDiffAt.rpow_const_of_ne (Q_pos hv).ne') + have hY : ContDiffAt ℝ 2 (fun w => Y w ^ q) v := + Y.contDiff.contDiffAt.rpow_const_of_ne hv.ne' + have split : centeredGenerator a (lifetimeTest q) v = + centeredGenerator a (fun w => Q w ^ (q/2)) v + + 2 * centeredGenerator a (fun w => Y w ^ q) v := by + unfold centeredGenerator lifetimeTest + rw [L_add hQ (contDiffAt_const.mul hY), L_const_mul hY, + N_add (hQ.differentiableAt (by norm_num)) ((contDiffAt_const.mul hY).differentiableAt (by norm_num)), + N_const_mul (hY.differentiableAt (by norm_num))] + ring + rw [split, centeredGenerator_Qpow _ _ _ hv, centeredGenerator_Ypow _ _ _ hv] + ring + +lemma height_power_comparison (q : ℝ) (hq : q ≤ 2) (v : State) (hv : 0 < Y v) : + Y v ^ 2 * Q v ^ (q/2-1) ≤ Y v ^ q := by + have hsq : 0 < Y v ^ 2 := sq_pos_of_pos hv + have hle : Y v ^ 2 ≤ Q v := by dsimp only [Q]; nlinarith [sq_nonneg (X v)] + have h := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_nonpos hsq hle (by linarith : q/2-1 ≤ 0)) hsq.le + have he : Y v ^ 2 * (Y v ^ 2) ^ (q/2-1) = Y v ^ q := by + rw [← Real.rpow_two (Y v), ← Real.rpow_mul hv.le, ← Real.rpow_add hv] + congr 1 + ring + exact h.trans_eq he + + + +lemma centeredGenerator_lifetimeTest_le (a q : ℝ) (ha : 0 < a) + (hq : 0 < q) (hq2 : q ≤ 2) (v : State) (hv : 0 < Y v) : + centeredGenerator a (lifetimeTest q) v ≤ + -(q * (6*a-1-q)/2) * Q v ^ (q/2-1) := by + have hQ := Q_pos hv + have hp := height_power_comparison q hq2 v hv + have he : Q v ^ (q/2-1) = Q v ^ (q/2-2) * Q v := by + rw [← Real.rpow_add_one hQ.ne'] + congr 1 + ring + have hdiv : Y v ^ 2 * Q v ^ (q/2-2) ≤ Y v ^ q / Q v := by + apply (le_div_iff₀ hQ).mpr + nlinarith only [hp.trans_eq (by rfl), show Y v ^ 2 * Q v ^ (q/2-1) = + (Y v ^ 2 * Q v ^ (q/2-2)) * Q v by rw [he]; ring] + rw [centeredGenerator_lifetimeTest _ _ _ hv, he] + have hs : X v ^ 2 ≤ Q v := by dsimp only [Q]; nlinarith [sq_nonneg (Y v)] + have hn := mul_le_mul_of_nonneg_left hdiv (show 0 ≤ 2*a*q by positivity) + have hpos : 0 ≤ q * Q v ^ (q/2-2) := by positivity + have hx := mul_le_mul_of_nonneg_left hs (show 0 ≤ q/2 * (q * Q v ^ (q/2-2)) by positivity) + dsimp only [Q] at hn hx ⊢ + simp only [div_eq_mul_inv] at hn hx ⊢ + nlinarith only [hn, hx] + +noncomputable def lifetimeExponent (a : ℝ) : ℝ := min 1 (3*a-1/2) +noncomputable def lifetimeDrift (a : ℝ) : ℝ := + lifetimeExponent a * (6*a-1-lifetimeExponent a)/2 + +lemma lifetimeExponent_pos {a : ℝ} (ha : 1/4 < a) : 0 < lifetimeExponent a := by + dsimp [lifetimeExponent] + exact lt_min (by norm_num) (by linarith) + +lemma lifetimeExponent_le_one (a : ℝ) : lifetimeExponent a ≤ 1 := min_le_left _ _ + +lemma lifetimeDrift_pos {a : ℝ} (ha : 1/4 < a) : 0 < lifetimeDrift a := by + have hq := lifetimeExponent_pos ha + have hq' : lifetimeExponent a ≤ 3*a-1/2 := min_le_right _ _ + exact div_pos (mul_pos hq (by linarith)) (by norm_num) + + +lemma green_lifetime_generator_le (a : ℝ) (ha : 1/4 < a) + (v : State) (hv : 0 < Y v) : + L (fun w => physicalGreen a w * lifetimeTest (lifetimeExponent a) w) + (physicalDrift a v) noise v ≤ + -lifetimeDrift a * physicalGreen a v * Q v ^ (lifetimeExponent a/2-1) := by + rw [green_product_generator a (by linarith) _ _ hv + ((lifetimeTest_smooth _ _ hv).of_le (by norm_cast))] + have h := mul_le_mul_of_nonneg_left + (centeredGenerator_lifetimeTest_le a (lifetimeExponent a) (by linarith) + (lifetimeExponent_pos ha) ((lifetimeExponent_le_one a).trans (by norm_num)) v hv) + (Real.exp_pos (logGreen a v)).le + dsimp only [lifetimeDrift, physicalGreen] at * + convert h using 1 + first | rfl | ring + +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RawRestartTests.lean b/lean/OAI/Probability/SLEGauge/RawRestartTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5abf468947bec95619227629417ebca35bfaba5 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RawRestartTests.lean @@ -0,0 +1,604 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.CommonStoppedMass + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEGenerator ExactSLEMain + +theorem map_data_restartAt_on {X : Type*} [MeasurableSpace X] {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {D : GDriver→X} (hD : Measurable[hS.measurableSpace] D) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) : + (W.restrict (A∩{b | S b≠∞})).map (fun b => (D b,restartAt S b))= + ((W.restrict (A∩{b | S b≠∞})).map D).prod W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + have hY := measurable_restartAt hS + apply Measure.ext_prod + intro B C hB hC + rw [Measure.map_apply (hD'.prodMk hY) (hB.prod hC),Measure.prod_prod, + Measure.map_apply hD' hB,Measure.restrict_apply (hD' hB)] + have he := congrArg (fun μ : Measure GDriver => μ C) + (map_restartAt_restrict hW hS ((hD hB).inter hA)) + rw [Measure.map_apply hY hC,Measure.restrict_apply (hY hC), + Measure.smul_apply,smul_eq_mul] at he + rw [Measure.restrict_apply ((hD'.prodMk hY) (hB.prod hC))] + convert he using 1 <;> congr 1 + ext b + simp only [mem_inter_iff,mem_preimage,mem_prod,mem_ofPred_eq] + tauto + simp only [inter_assoc] + + + +theorem lintegral_data_restartAt_on {X : Type*} [MeasurableSpace X] {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {D : GDriver→X} (hD : Measurable[hS.measurableSpace] D) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) + {F : X×GDriver→ℝ≥0∞} (hF : Measurable F) : + (∫⁻b in A∩{b | S b≠∞},F (D b,restartAt S b) ∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻c,F (D b,c) ∂W ∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hD' : Measurable D := hD.mono hS.measurableSpace_le le_rfl + rw [←lintegral_map hF (hD'.prodMk (measurable_restartAt hS)), + map_data_restartAt_on hW hS hD hA,lintegral_prod _ hF.aemeasurable, + lintegral_map hF.lintegral_prod_right' hD'] + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGenerator + +lemma kernel_with_data_measurable {X : Type*} [MeasurableSpace X] + (K : Kernel GDriver X) [IsSFiniteKernel K] + {F : (ℝ≥0×GDriver)×X→ℝ≥0∞} (hF : Measurable F) : + Measurable (fun p : (ℝ≥0×GDriver)×GDriver => ∫⁻z,F (p.1,z)∂K p.2) := by + let L : Kernel ((ℝ≥0×GDriver)×GDriver) X := K.comap Prod.snd measurable_snd + exact (hF.comp (measurable_fst.fst.prodMk measurable_snd)).lintegral_kernel_prod_right' (κ:=L) + + + +lemma lintegral_kernel_restartAt_on_shift {X : Type*} [MeasurableSpace X] + (K : Kernel GDriver X) [IsSFiniteKernel K] {W : Measure GDriver} + (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) + {F : (ℝ≥0×GDriver)×X→ℝ≥0∞} (hF : Measurable F) : + (∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂K (restartAt S b)∂W)= + ∫⁻b in {b | S b≠∞},∫⁻c,(concatenatedEvent S A).indicator + (fun p : (ℝ≥0×GDriver)×GDriver => ∫⁻z,F (p.1,z)∂K p.2) + (stoppedData S b,c)∂W∂W := by + have hAe : MeasurableSet A := (shiftStop_isStoppingTime hS t).measurableSpace_le A hA + have hfinite : MeasurableSet {b | S b≠∞} := + (hS.measurable' (measurableSet_singleton ∞)).compl + have htest := (kernel_with_data_measurable K hF).indicator + (concatenatedEvent_measurable hS hAe) + have hi := lintegral_data_restartAt_on hW hS (stoppedData_raw_measurable hS) + MeasurableSet.univ htest + simp only [univ_inter] at hi + rw [←hi,←Measure.restrict_restrict hAe,←lintegral_indicator hAe] + apply setLIntegral_congr_fun hfinite + intro b hb + have he : (stoppedData S b,restartAt S b)∈concatenatedEvent S A ↔ b∈A := + concatenatedEvent_stoppedData hb + by_cases h : b∈A + · simp only [Set.indicator_of_mem h,Set.indicator_of_mem (he.mpr h)] + · simp only [Set.indicator_of_notMem h,Set.indicator_of_notMem (mt he.mp h)] + + + +theorem restartAt_conditional_kernel {X : Type*} [MeasurableSpace X] + (K L G : Kernel GDriver X) [IsSFiniteKernel K] [IsSFiniteKernel L] [IsSFiniteKernel G] + {W : Measure GDriver} (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + {t : ℝ≥0} + (hcond : ∀H : GDriver×X→ℝ≥0∞, + @Measurable (GDriver×X) ℝ≥0∞ ((rawFiltration t).prod inferInstance) inferInstance H → + (∫⁻c,∫⁻z,H (c,z)∂K c∂W)=(∫⁻c,∫⁻z,H (c,z)∂L c∂W)+∫⁻c,∫⁻z,H (c,z)∂G c∂W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) + {F : (ℝ≥0×GDriver)×X→ℝ≥0∞} (hF : Measurable F) : + (∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂K (restartAt S b)∂W)= + (∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂L (restartAt S b)∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂G (restartAt S b)∂W := by + let := hW.isGaussianProcess.isProbabilityMeasure + let E := concatenatedEvent S A + let T (M : Kernel GDriver X) (p : ℝ≥0×GDriver) (c : GDriver) := + E.indicator (fun q : (ℝ≥0×GDriver)×GDriver => ∫⁻z,F (q.1,z)∂M q.2) (p,c) + have hsection (p : ℝ≥0×GDriver) : MeasurableSet[rawFiltration t] {c | (p,c)∈E} := + (concatenatedEvent_raw_joint hS hA).preimage (measurable_const.prodMk measurable_id) + have hFsection (p : ℝ≥0×GDriver) : Measurable (fun z : X => F (p,z)) := + hF.comp (measurable_const.prodMk measurable_id) + have hi (p : ℝ≥0×GDriver) : (∫⁻c,T K p c∂W)=(∫⁻c,T L p c∂W)+∫⁻c,T G p c∂W := by + let H : GDriver×X→ℝ≥0∞ := fun q => + ({c | (p,c)∈E}).indicator (fun _ => F (p,q.2)) q.1 + have hH : @Measurable (GDriver×X) ℝ≥0∞ ((rawFiltration t).prod inferInstance) + inferInstance H := by + exact ((hFsection p).comp measurable_snd).indicator + ((hsection p).preimage measurable_fst) + have he (M : Kernel GDriver X) (c : GDriver) : (∫⁻z,H (c,z)∂M c)=T M p c := by + by_cases hc : (p,c)∈E + · simp only [H,T,Set.indicator_apply,Set.mem_ofPred_eq,hc,ite_true] + · simp only [H,T,Set.indicator_apply,Set.mem_ofPred_eq,hc,ite_false,lintegral_zero] + simpa only [he] using hcond H hH + rw [lintegral_kernel_restartAt_on_shift K hW hS hA hF, + lintegral_kernel_restartAt_on_shift L hW hS hA hF, + lintegral_kernel_restartAt_on_shift G hW hS hA hF] + change (∫⁻b in {b | S b≠∞},∫⁻c,T K (stoppedData S b) c∂W∂W)= + (∫⁻b in {b | S b≠∞},∫⁻c,T L (stoppedData S b) c∂W∂W)+ + ∫⁻b in {b | S b≠∞},∫⁻c,T G (stoppedData S b) c∂W∂W + simp_rw [hi] + apply lintegral_add_left + have hM := ((kernel_with_data_measurable L hF).indicator + (concatenatedEvent_measurable hS ((shiftStop_isStoppingTime hS t).measurableSpace_le A hA))) + exact hM.lintegral_prod_right'.comp + ((stoppedData_raw_measurable hS).mono hS.measurableSpace_le le_rfl) + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator + +lemma survivingGreen_zero (a : ℝ) (ha : 0 + ∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) p.1.2 p.1.1 (μ p.2)) := by + simp_rw [restartPush_lintegral a ha _ _ _ hf] + let K : Kernel ((ℝ≥0×GDriver)×GDriver) UpperPlane := μ.comap Prod.snd measurable_snd + have hin : Measurable (fun p : ((ℝ≥0×GDriver)×GDriver)×UpperPlane => + (p.1.1.1,(p.1.1.2,p.2))) := + (measurable_fst.fst.fst).prodMk ((measurable_fst.fst.snd).prodMk measurable_snd) + exact ((restartWeight_joint_measurable a ha).comp hin |>.mul + (hf.comp ((inverseUpper_joint_measurable a ha).comp hin))).lintegral_kernel_prod_right' (κ:=K) + +lemma restartPush_mean (a : ℝ) (ha : 1/4 restartWeight a b s z* + f (inverseUpper a (lt_trans (by norm_num) ha) b s z)) := + (restartWeight_measurable a ha b s).mul (hf.comp hJ) + simp_rw [restartPush_lintegral a ha b s _ hf] + rw [←Measure.lintegral_bind (m:=W) μ.aemeasurable hg.aemeasurable] + change (∫⁻z,restartWeight a b s z*f (inverseUpper a (lt_trans (by norm_num) ha) b s z) + ∂μ ∘ₘ W)=_ + rw [hμ,←restartPush_lintegral a ha b s _ hf,restartPush_initialGreen] + + + +theorem restartPush_stopped_terminal_mean (a : ℝ) (ha : 1/4 b.1 t) W) + (hμ : μ ∘ₘ W=initialGreenMeasure a) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) + {f : UpperPlane→ℝ≥0∞} (hf : Measurable f) : + (∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (μ (restartAt S b))∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂stoppedSurvivingKernel a ha S hS b∂W := by + let F : ((ℝ≥0×GDriver)×GDriver)→ℝ≥0∞ := fun p => + ∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) p.1.2 p.1.1 (μ p.2) + have h := lintegral_data_restartAt_on hW hS (stoppedData_raw_measurable hS) hA + (restartPush_test_joint_measurable a ha μ hf) + have he (b c : GDriver) : F (stoppedData S b,c)= + ∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) b (S b).toNNReal (μ c) := by + simp only [F,restartPush,inverseUpper_stoppedData, + restartWeight_stoppedData a (lt_trans (by norm_num) ha)] + change (∫⁻b in A∩{b | S b≠∞},F (stoppedData S b,restartAt S b)∂W)= + ∫⁻b in A∩{b | S b≠∞},∫⁻c,F (stoppedData S b,c)∂W∂W at h + simp_rw [he] at h + rw [h] + apply setLIntegral_congr_fun ((hS.measurableSpace_le A hA).inter + (hS.measurable' (measurableSet_singleton ∞)).compl) + intro b hb + dsimp only + rw [restartPush_mean a ha _ _ μ W hμ hf,stoppedSurvivingKernel_apply] + have hbfin : S b≠∞ := hb.2 + simp only [stoppedSurvivingGreen,ite_eq_right hbfin,survivingKernel_apply] + +lemma restartPush_measure_joint_measurable (a : ℝ) (ha : 1/4 + restartPush a (lt_trans (by norm_num) ha) p.1.2 p.1.1 (μ p.2)) := by + apply Measure.measurable_of_measurable_coe + intro A hA + have h := restartPush_test_joint_measurable a ha μ + (measurable_const.indicator hA : Measurable (A.indicator (fun _ => (1:ℝ≥0∞)))) + simpa only [lintegral_indicator hA,setLIntegral_one] using h + + + +def restartCandidateKernel (a : ℝ) (ha : 1/4 (((S b).toNNReal,b),restartAt S b)) := + ((ENNReal.measurable_toNNReal.comp hS.measurable').prodMk measurable_id).prodMk + (measurable_restartAt hS) + have h := (restartPush_measure_joint_measurable a ha μ).comp hin + change Measurable (fun b => restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (μ (restartAt S b))) at h + exact Measurable.ite (hS.measurable' (measurableSet_singleton ∞)) measurable_const h + +lemma restartCandidateKernel_apply (a : ℝ) (ha : 1/4 b.1 t) W) + (hμ : μ ∘ₘ W=initialGreenMeasure a) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[hS.measurableSpace] A) : + restartCandidateKernel a ha μ S hS ∘ₘ (W.restrict A)= + stoppedSurvivingKernel a ha S hS ∘ₘ (W.restrict A) := by + have hfinite : MeasurableSet {b | S b≠∞} := + (hS.measurable' (measurableSet_singleton ∞)).compl + ext B hB + rw [Measure.bind_apply hB (Kernel.aemeasurable _),Measure.bind_apply hB (Kernel.aemeasurable _)] + have he := restartPush_stopped_terminal_mean a ha μ W hW hμ S hS hA + (measurable_const.indicator hB : Measurable (B.indicator (fun _ => (1:ℝ≥0∞)))) + simp only [lintegral_indicator hB,setLIntegral_one] at he + calc + _ = ∫⁻b in A∩{b | S b≠∞}, + restartPush a (lt_trans (by norm_num) ha) b (S b).toNNReal (μ (restartAt S b)) B ∂W := by + rw [inter_comm A {b | S b≠∞},←Measure.restrict_restrict hfinite,←lintegral_indicator hfinite] + apply lintegral_congr + intro b + by_cases hb : S b=∞ <;> simp [restartCandidateKernel_apply,hb] + _ = _ := he + _ = ∫⁻b in A,stoppedSurvivingKernel a ha S hS b B∂W := by + rw [inter_comm A {b | S b≠∞},←Measure.restrict_restrict hfinite,←lintegral_indicator hfinite] + apply lintegral_congr + intro b + by_cases hb : S b=∞ + · simp [hb,stoppedSurvivingKernel_apply,stoppedSurvivingGreen] + · simp [hb] + + + +theorem restartCandidateKernel_average_le_initial (a : ℝ) (ha : 1/4 b.1 t) W) + (hμ : μ ∘ₘ W=initialGreenMeasure a) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + restartCandidateKernel a ha μ S hS ∘ₘ W ≤ initialGreenMeasure a := by + let := hW.isGaussianProcess.isProbabilityMeasure + have h := restartCandidateKernel_average_on a ha μ W hW hμ S hS MeasurableSet.univ + rw [Measure.restrict_univ] at h + rw [h] + exact stoppedSurvivingKernel_average_le_initial a ha W hW S hS + + + +theorem restartCandidateKernel_compact_lintegral_lt_top (a : ℝ) (ha : 1/4 b.1 t) W) + (hμ : μ ∘ₘ W=initialGreenMeasure a) + (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + {K : Set UpperPlane} (hK : IsCompact K) : + (∫⁻b,restartCandidateKernel a ha μ S hS b K∂W)<∞ := by + rw [←Measure.bind_apply hK.measurableSet (Kernel.aemeasurable _)] + exact ((restartCandidateKernel_average_le_initial a ha μ W hW hμ S hS) K).trans_lt + hK.measure_lt_top + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions + +lemma restartPullback_joint_measurable (a : ℝ) (ha : 1/4 + restartWeight a p.1.2 p.1.1 p.2* + f (inverseUpper a (lt_trans (by norm_num) ha) p.1.2 p.1.1 p.2)) := by + have hin : Measurable (fun p : (ℝ≥0×GDriver)×UpperPlane => (p.1.1,(p.1.2,p.2))) := + measurable_fst.fst.prodMk (measurable_fst.snd.prodMk measurable_snd) + have hweight : Measurable (fun p : (ℝ≥0×GDriver)×UpperPlane => + restartWeight a p.1.2 p.1.1 p.2) := by + simpa only [Function.comp_def] using (restartWeight_joint_measurable a ha).comp hin + have hinverse : Measurable (fun p : (ℝ≥0×GDriver)×UpperPlane => + inverseUpper a (lt_trans (by norm_num) ha) p.1.2 p.1.1 p.2) := by + simpa only [Function.comp_def] using (inverseUpper_joint_measurable a ha).comp hin + exact hweight.mul (hf.comp hinverse) + + + +theorem restartPush_conditional_kernel (a : ℝ) (ha : 1/4 b.1 t) W) + {t : ℝ≥0} + (hcond : ∀H : GDriver×UpperPlane→ℝ≥0∞, + Measurable[(rawFiltration t).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻c,∫⁻z,H (c,z)∂K c∂W)=(∫⁻c,∫⁻z,H (c,z)∂L c∂W)+ + ∫⁻c,∫⁻z,H (c,z)∂survivingKernel a ha t c∂W) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {A : Set GDriver} (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) + {f : UpperPlane→ℝ≥0∞} (hf : Measurable f) : + (∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (K (restartAt S b))∂W)= + (∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (L (restartAt S b))∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂(survivingKernel a ha ((S b).toNNReal+t) b).restrict + {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}∂W := by + let F : (ℝ≥0×GDriver)×UpperPlane→ℝ≥0∞ := fun p => + restartWeight a p.1.2 p.1.1 p.2* + f (inverseUpper a (lt_trans (by norm_num) ha) p.1.2 p.1.1 p.2) + have h := restartAt_conditional_kernel K L (survivingKernel a ha t) hW hcond hS hA + (restartPullback_joint_measurable a ha hf) + have he (M : Kernel GDriver UpperPlane) (b : GDriver) : + (∫⁻z,F (stoppedData S b,z)∂M (restartAt S b))= + ∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) b (S b).toNNReal (M (restartAt S b)) := by + rw [restartPush_lintegral a ha _ _ _ hf] + simp only [F,inverseUpper_stoppedData,restartWeight_stoppedData a (lt_trans (by norm_num) ha)] + change (∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂K (restartAt S b)∂W)= + (∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂L (restartAt S b)∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,F (stoppedData S b,z)∂survivingKernel a ha t (restartAt S b)∂W at h + simp_rw [he] at h + simpa only [restartAt,restartPush_survivingKernel] using h + + + +theorem recoveredMass_restarted_potential (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass a ha s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) + {t : ℝ≥0} {A : Set GDriver} + (hA : MeasurableSet[(shiftStop_isStoppingTime hS t).measurableSpace] A) + {f : UpperPlane→ℝ≥0∞} (hf : Measurable f) : + let μ := recoveredMass a ha s c hc + (∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (μ ∞ (restartAt S b))∂W)= + (∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂restartPush a (lt_trans (by norm_num) ha) + b (S b).toNNReal (μ t (restartAt S b))∂W)+ + ∫⁻b in A∩{b | S b≠∞},∫⁻z,f z∂(survivingKernel a ha ((S b).toNNReal+t) b).restrict + {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}∂W := by + intro μ + let := hW.isGaussianProcess.isProbabilityMeasure + let K : ℝ≥0∞→Kernel GDriver UpperPlane := fun v => + ⟨μ v,recoveredMass_measurable a ha s c hc v⟩ + let (v : ℝ≥0∞) (b : GDriver) : IsFiniteMeasureOnCompacts (K v b) := radonLimit_finite _ + have (v : ℝ≥0∞) : IsSFiniteKernel (K v) := isSFiniteKernel_of_locally_finite (K v) + have hcond (H : GDriver×UpperPlane→ℝ≥0∞) + (hH : Measurable[(rawFiltration t).prod (inferInstance : MeasurableSpace UpperPlane)] H) : + (∫⁻b,∫⁻z,H (b,z)∂K ∞ b∂W)=(∫⁻b,∫⁻z,H (b,z)∂K t b∂W)+ + ∫⁻b,∫⁻z,H (b,z)∂survivingKernel a ha t b∂W := by + have hi := (recoveredMass_all_stopping a ha W hW s c hc hs hsum hconv + _ (isStoppingTime_const rawFiltration t)).2.2.2.2 H + rw [IsStoppingTime.measurableSpace_const] at hi + have hn : Measurable H := hH.mono (prod_sigma_le (rawFiltration.le t) _) le_rfl + have he (b : GDriver) : (∫⁻z,H (b,z)∂survivingKernel a ha t b)= + ∫⁻z,H (b,z)*ENNReal.ofReal (survivingGreen a t b z.1)∂upperArea := by + rw [survivingKernel_apply] + exact (lintegral_withDensity_eq_lintegral_mul upperArea + (survivingGreen_spatial_measurable a ha t b).ennreal_ofReal + (hn.comp (measurable_const.prodMk measurable_id))).trans + (lintegral_congr fun _ => mul_comm _ _) + simp_rw [he] + simpa only [K,Kernel.coe_mk,μ,stoppedSurvivingGreen, ENNReal.some_eq_coe', ENNReal.coe_ne_top, ↓reduceIte, + ENNReal.toNNReal_coe] using hi hH + exact restartPush_conditional_kernel a ha (K ∞) (K t) hW hcond hS hA hf + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions + + +def afterStopFiltration {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + Filtration ℝ≥0 (inferInstance : MeasurableSpace GDriver) where + seq t := (shiftStop_isStoppingTime hS t).measurableSpace + mono' := fun t u htu => (shiftStop_isStoppingTime hS t).measurableSpace_mono + (shiftStop_isStoppingTime hS u) (fun b => by + change S b+(t:ℝ≥0∞) ≤ S b+(u:ℝ≥0∞) + exact add_le_add le_rfl (ENNReal.coe_le_coe.mpr htu)) + le' t := (shiftStop_isStoppingTime hS t).measurableSpace_le + +lemma raw_function_congr {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + {t : ℝ≥0} {f : GDriver→X} (hf : Measurable[rawFiltration t] f) + {b c : GDriver} (h : ∀ u≤t,b.1 u=c.1 u) : f b=f c := by + have he := (raw_event_congr (hf (measurableSet_singleton (f b))) h).mp + (show b∈f ⁻¹' {f b} from rfl) + exact he.symm + +lemma raw_measure_congr {X : Type*} [MeasurableSpace X] {t : ℝ≥0} + {K : GDriver→Measure X} (hK : Measurable[rawFiltration t] K) + {b c : GDriver} (h : ∀ u≤t,b.1 u=c.1 u) : K b=K c := by + ext A hA + exact raw_function_congr ((Measure.measurable_coe hA).comp hK) h + + + +def freshPast (S : GDriver→ℝ≥0∞) (t : ℝ≥0) (b : GDriver) : GDriver := + pastDriver t (restart (S b).toNNReal + (pastDriver (shiftStop S t b).toNNReal b)) + +lemma freshPast_raw_measurable {S : GDriver→ℝ≥0∞} + (hS : IsStoppingTime rawFiltration S) (t : ℝ≥0) : + Measurable[(afterStopFiltration hS) t] (freshPast S t) := by + have htime : Measurable[(afterStopFiltration hS) t] + (fun b => (S b).toNNReal) := + (ENNReal.measurable_toNNReal.comp hS.measurable).mono (measurableSpace_le_shiftStop hS t) le_rfl + have hfrozen := pastDriver_stopping_measurable (shiftStop S t) (shiftStop_isStoppingTime hS t) + exact ((pastDriver_raw_measurable t).mono (rawFiltration.le t) le_rfl).comp + (continuous_restart_joint.measurable.comp (htime.prodMk hfrozen)) + +lemma freshPast_eq (S : GDriver→ℝ≥0∞) (t : ℝ≥0) {b : GDriver} (hb : S b≠∞) : + freshPast S t b=pastDriver t (restartAt S b) := by + have he : (shiftStop S t b).toNNReal=(S b).toNNReal+t := by + rw [shiftStop,ENNReal.toNNReal_add hb ENNReal.coe_ne_top,ENNReal.toNNReal_coe] + apply Subtype.ext + ext u + change (restart (S b).toNNReal (pastDriver (shiftStop S t b).toNNReal b)).1 (min u t)= + (restart (S b).toNNReal b).1 (min u t) + simp only [restart_apply,he] + rw [pastDriver_eq _ b _ (add_le_add (le_refl (S b).toNNReal) (min_le_right u t)), + pastDriver_eq _ b _ (le_self_add)] + + + +lemma restartCandidateKernel_raw_measurable (a : ℝ) (ha : 1/4 + if S b=∞ then (0:Measure UpperPlane) else restartPush a (lt_trans (by norm_num) ha) + (stoppedData S b).2 (stoppedData S b).1 (K (freshPast S t b))) := + Measurable.ite htop measurable_const hM + convert hh using 1 + funext b + change (if S b=∞ then 0 else restartPush a _ b (S b).toNNReal (K (restartAt S b)))= + if S b=∞ then 0 else restartPush a _ (stoppedData S b).2 (stoppedData S b).1 + (K (freshPast S t b)) + by_cases hb : S b=∞ + · simp only [hb,ite_true] + · simp only [ite_eq_right hb,freshPast_eq S t hb] + rw [raw_measure_congr hK (pastDriver_eq t (restartAt S b))] + simp only [restartPush,inverseUpper_stoppedData, + restartWeight_stoppedData a (lt_trans (by norm_num) ha)] + + +def recoveredRestart (a : ℝ) (ha : 1/4 fun b => ∫z,f z∂recoveredRestart a ha s c hc S t b) := by + intro t + let K : Kernel GDriver UpperPlane := + ⟨recoveredMass a ha s c hc t,recoveredMass_measurable a ha s c hc t⟩ + let (b : GDriver) : IsFiniteMeasureOnCompacts (K b) := radonLimit_finite _ + have : IsSFiniteKernel K := isSFiniteKernel_of_locally_finite K + have hh := restartCandidateKernel_raw_measurable a ha K + (recoveredMass_raw_measurable a ha s c hc t) hS + let : MeasurableSpace GDriver := (afterStopFiltration hS) t + let L : @Kernel GDriver UpperPlane ((afterStopFiltration hS) t) inferInstance := + ⟨recoveredRestart a ha s c hc S t,hh⟩ + exact f.continuous.stronglyMeasurable.integral_kernel (κ:=L) + +end SLEExactGauge.LoewnerRestart +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RecoveredInteriorRestart.lean b/lean/OAI/Probability/SLEGauge/RecoveredInteriorRestart.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea92e9fc76aa7b061ce23a430d3eb5cebfb432d1 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RecoveredInteriorRestart.lean @@ -0,0 +1,575 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.NormalizedMarkedMoment +import OAI.Probability.SLEGauge.FiniteVariationMartingale + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions +open TraceRestriction TraceMassContinuity TraceMassIntegration CompensatorUniqueness + + + +theorem recoveredPostStop_eq_recoveredRestart (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure GDriver) (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hmean : recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc ∞ ∘ₘ W= + initialGreenMeasure (Target.a κ)) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + ∀ᵐ b ∂W, ∀v : ℝ≥0∞, + recoveredPostStop (Target.a κ) (a_gt_quarter hκ hκ8) s c hc S v b= + recoveredRestart (Target.a κ) (a_gt_quarter hκ hκ8) s c hc S v b := by + let := hW.isGaussianProcess.isProbabilityMeasure + let a := Target.a κ + have ha : 1/4 (hb.1 v).2) + have hμo : ∀ᵐ b ∂W, Monotone (fun v : ℝ≥0∞ => μ v b) := hμp.mono (fun b hb => hb.2.1) + have hνo : ∀ᵐ b ∂W, Monotone (fun v : ℝ≥0∞ => ν v b) := hνp.2.mono (fun b hb => hb.2.2.1) + have hμi (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂μ ∞ b) W := + recoveredPostStop_terminal_integrable a ha s c hc W hmean hS f + have hνi (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂ν ∞ b) W := hνp.1 f + have hμm (f : C_c(UpperPlane,ℝ)) : StronglyAdapted ℱ (fun t : ℝ≥0 => fun b => ∫z,f z∂μ t b) := + recoveredPostStop_compact_stronglyAdapted a ha s c hc hS f + have hνm (f : C_c(UpperPlane,ℝ)) : StronglyAdapted ℱ (fun t : ℝ≥0 => fun b => ∫z,f z∂ν t b) := + recoveredRestart_compact_stronglyAdapted a ha s c hc hS f + have hμl (v : ℝ≥0∞) (f : C_c(UpperPlane,ℝ)) : ∀ᵐ b ∂W, Integrable f (μ v b) := by + apply Eventually.of_forall + intro b + let := hμr v b + exact f.integrable + have hνl (v : ℝ≥0∞) (f : C_c(UpperPlane,ℝ)) : ∀ᵐ b ∂W, Integrable f (ν v b) := by + filter_upwards [hνr] with b hb + let := hb v + exact f.integrable + have hpot (f : C_c(UpperPlane,ℝ)) (hf : ∀z,0≤f z) (t : ℝ≥0) : + W[(fun b => (∫z,f z∂μ ∞ b)-(∫z,f z∂μ t b)) | ℱ t] =ᵐ[W] + W[(fun b => (∫z,f z∂ν ∞ b)-(∫z,f z∂ν t b)) | ℱ t] := by + have hμti := integrable_test_of_ae_measure_le W (μ t) (μ ∞) hf + (((hμm f t).mono (ℱ.le t)).aestronglyMeasurable) (hμl ∞ f) (hμi f) + (hμo.mono (fun b hb => hb le_top)) + have hνti := integrable_test_of_ae_measure_le W (ν t) (ν ∞) hf + (((hνm f t).mono (ℱ.le t)).aestronglyMeasurable) (hνl ∞ f) (hνi f) + (hνo.mono (fun b hb => hb le_top)) + let V : Set GDriver→ℝ≥0∞ := fun A => ∫⁻b in A∩{b | S b≠∞}, + ∫⁻z,ENNReal.ofReal (f z)∂(survivingKernel a ha ((S b).toNNReal+t) b).restrict + {z : UpperPlane | alive a b.1 (S b).toNNReal z.1}∂W + exact condExp_sub_eq_of_lintegral_potential (ℱ.le t) W (μ t) (ν t) (μ ∞) (ν ∞) hf + hμti hνti (hμi f) (hνi f) (hμl t f) (hνl t f) (hμl ∞ f) (hνl ∞ f) V + (fun A hA => recoveredPostStop_potential a ha W hW s c hc hs hsum hconv hS hA + f.continuous.measurable.ennreal_ofReal) + (fun A hA => recoveredRestart_potential a ha W hW s c hc hs hsum hconv hS hA + f.continuous.measurable.ennreal_ofReal) + have he : ∀ᵐ b ∂W, ∀t : ℝ≥0, μ t b=ν t b := by + apply ae_all_measure_eq_of_ae_regular (ℱ:=ℱ) (fun t : ℝ≥0 => μ t) (fun t : ℝ≥0 => ν t) + (μ ∞) (ν ∞) + (Eventually.of_forall fun b t => hμr t b) + (hνr.mono (fun b hb t => hb t)) + (Eventually.of_forall (hμr ∞)) (hνr.mono (fun b hb => hb ∞)) + hμm hνm (hμp.mono fun b hb => hb.1) (hνp.2.mono fun b hb => hb.2.1) + (fun f => hμp.mono fun b hb => (hb.2.2 f).1) + (fun f => hνp.2.mono fun b hb => (hb.2.2.2 f).1) + (hμo.mono fun b hb u v huv => hb (ENNReal.coe_le_coe.mpr huv)) + (hνo.mono fun b hb u v huv => hb (ENNReal.coe_le_coe.mpr huv)) + (hμo.mono fun b hb t => hb le_top) (hνo.mono fun b hb t => hb le_top) + hμi hνi hpot + have het : μ ∞ =ᵐ[W] ν ∞ := ae_terminal_measure_eq_of_ae_regular + (fun t : ℝ≥0 => μ t) (fun t : ℝ≥0 => ν t) (μ ∞) (ν ∞) + (Eventually.of_forall (hμr ∞)) (hνr.mono (fun b hb => hb ∞)) he + (fun f => hμp.mono fun b hb => (hb.2.2 f).2) + (fun f => hνp.2.mono fun b hb => (hb.2.2.2 f).2) + filter_upwards [he,het] with b hb ht v + induction v using ENNReal.recTopCoe with + | top => exact ht + | coe t => exact hb t + + + +theorem recoveredMass_interior_restart (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure GDriver) (hW : IsBrownianReal (fun t (b : GDriver) => b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hmean : recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc ∞ ∘ₘ W= + initialGreenMeasure (Target.a κ)) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + ∀ᵐ b ∂W, S b≠∞ → + (μ (S b) b).restrict {z : UpperPlane | alive (Target.a κ) b.1 (S b).toNNReal z.1}=0 ∧ + ∀v : ℝ≥0∞, (μ (S b+v) b).restrict + {z : UpperPlane | alive (Target.a κ) b.1 (S b).toNNReal z.1}= + restartPush (Target.a κ) (lt_trans (by norm_num) (a_gt_quarter hκ hκ8)) b + (S b).toNNReal (μ v (restartAt S b)) := by + intro μ + filter_upwards [recoveredPostStop_eq_recoveredRestart κ hκ hκ8 W hW s c hc hs hsum + hmean hpath hconv hS,hconv] with b hb hcV hSb + refine ⟨?_,?_⟩ + · have hz := recoveredPostStop_zero_of_convergence (Target.a κ) (a_gt_quarter hκ hκ8) + s c hc hs S b hcV + simpa only [recoveredPostStop,ite_eq_right hSb,add_zero,μ] using hz + · intro v + simpa only [recoveredPostStop,recoveredRestart,ite_eq_right hSb,μ] using hb v + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.LoewnerRestart +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator MassVersions +open TraceMassContinuity TraceMassIntegration + +lemma restartPush_positive (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hmean : recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc ∞ ∘ₘ W= + initialGreenMeasure (Target.a κ)) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b))) + {S : GDriver→ℝ≥0∞} (hS : IsStoppingTime rawFiltration S) : + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + ∀ᵐ b ∂W, S b≠∞ → ∀v : ℝ≥0∞, 0 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hmean : recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc ∞ ∘ₘ W= + initialGreenMeasure (Target.a κ)) + (hpath : ∀ᵐ b ∂W, TraceMassFacts κ (driverHomeomorph.symm b) + (fun v => recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b)) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀g : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,g z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,g z∂recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc v b))) : + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + ∀ᵐ b ∂W, ∀u v : ℝ≥0, u (Real.toNNReal (q:ℝ):ℝ≥0∞)) (isStoppingTime_const rawFiltration _) + filter_upwards [hh] with b hb + exact hb ENNReal.coe_ne_top + filter_upwards [hall,hpath] with b hb hp u v huv + obtain ⟨q,huq,hqv⟩ := exists_rat_btwn (show (u:ℝ)<(v:ℝ) from huv) + let p : ℝ≥0 := Real.toNNReal (q:ℝ) + have hq0 : 0≤(q:ℝ) := u.coe_nonneg.trans huq.le + have huc : u≤p := by + rw [←NNReal.coe_le_coe,Real.coe_toNNReal _ hq0] + exact huq.le + have hpc : p + ((Measure.sub_le : μ v b-μ u b≤μ v b) K).trans_lt hK.measure_lt_top⟩ + obtain ⟨K,-,hK,hpK⟩ := isOpen_univ.exists_lt_isCompact hpos' + exact ⟨hpos',K,hK,hpK,hK.measure_lt_top⟩ + +end SLEExactGauge.LoewnerRestart +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma recoveredMass_compact_stronglyAdapted (a : ℝ) (ha : 1/4 fun b => + ∫z,f z∂recoveredMass a ha s c hc t b) := by + intro t + let : MeasurableSpace ExactSLEGenerator.Driver := rawFiltration t + let K : Kernel ExactSLEGenerator.Driver UpperPlane := + ⟨recoveredMass a ha s c hc t,recoveredMass_raw_measurable a ha s c hc t⟩ + exact f.continuous.stronglyMeasurable.integral_kernel (κ:=K) + + + +theorem recoveredMass_stopped_condExp (a : ℝ) (ha : 1/4 b.1 t) W) + (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) + (hc : ∀k j,j∈s k→0≤c k j) (hs : ∀k j,j∈s k→k≤j) + (hsum : ∀k,∑j∈s k,c k j=1) + (hconv : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass a ha s c hc v b))) + (S : ExactSLEGenerator.Driver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (f : C_c(UpperPlane,ℝ)) : + W[(fun b => (∫z,f z∂recoveredMass a ha s c hc ∞ b)- + (∫z,f z∂recoveredMass a ha s c hc (S b) b)) | hS.measurableSpace] =ᵐ[W] + fun b => ∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1∂upperArea := by + let μ := recoveredMass a ha s c hc + have hcv (v : ExactSLEGenerator.Driver→ℝ≥0∞) : ∀ᵐ b ∂W, Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass a + (Real.exp (-2*a*(j+1))) (v b) b) + atTop (𝓝 (∫z,f z∂μ (v b) b)) := hconv.mono (fun b hb => hb (v b) f) + have htop : IsStoppingTime rawFiltration (fun _ : ExactSLEGenerator.Driver => (∞:ℝ≥0∞)) := + fun t => by simp + have hi (v : ExactSLEGenerator.Driver→ℝ≥0∞) (hv : IsStoppingTime rawFiltration v) : + Integrable (fun b => ∫z,f z∂μ (v b) b) W := + memLp_one_iff_integrable.mp (by simpa only [Nat.cast_one] using + actual_stopped_radon_limit_memLp a ha W hW v hv s c hc hsum _ f (hcv v) 1) + have hg := stoppedSurvivingKernel_compact_mean_integrable a ha W hW S hS f + simp_rw [stoppedSurvivingKernel_compact_eval] at hg + have hgm : StronglyMeasurable[hS.measurableSpace] + (fun b => ∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1∂upperArea) := by + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + let K : Kernel ExactSLEGenerator.Driver UpperPlane := + ⟨stoppedSurvivingKernel a ha S hS,stoppedSurvivingKernel_raw_measurable a ha S hS⟩ + have h := f.continuous.stronglyMeasurable.integral_kernel (κ:=K) + change StronglyMeasurable (fun b => ∫z,f z∂stoppedSurvivingKernel a ha S hS b) at h + simpa only [stoppedSurvivingKernel_compact_eval] using h + symm + apply ae_eq_condExp_of_forall_setIntegral_eq hS.measurableSpace_le + ((hi _ htop).sub (hi S hS)) (fun _ _ _ => hg.integrableOn) _ hgm.aestronglyMeasurable + intro U hU _ + exact (actual_stopped_limit_compact_conditional a ha W hW S hS s c hs hc hsum + (fun b => μ (S b) b) (μ ∞) f (hcv S) (hcv (fun _ => ∞)) U hU).symm + + + +theorem recoveredMass_extraction_unique (a : ℝ) (ha : 1/4 b.1 t) W) + (s₁ s₂ : ℕ→Finset ℕ) (c₁ c₂ : ℕ→ℕ→ℝ) + (hc₁ : ∀k j,j∈s₁ k→0≤c₁ k j) (hc₂ : ∀k j,j∈s₂ k→0≤c₂ k j) + (hs₁ : ∀k j,j∈s₁ k→k≤j) (hs₂ : ∀k j,j∈s₂ k→k≤j) + (hsum₁ : ∀k,∑j∈s₁ k,c₁ k j=1) (hsum₂ : ∀k,∑j∈s₂ k,c₂ k j=1) + (hconv₁ : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s₁ k,c₁ k j*∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass a ha s₁ c₁ hc₁ v b))) + (hconv₂ : ∀ᵐ b ∂W, ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s₂ k,c₂ k j*∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) v b) + atTop (𝓝 (∫z,f z∂recoveredMass a ha s₂ c₂ hc₂ v b))) + (hcont₁ : ∀f : C_c(UpperPlane,ℝ), ∀ᵐ b ∂W, Continuous (fun v : ℝ≥0 => + ∫z,f z∂recoveredMass a ha s₁ c₁ hc₁ v b)) + (hcont₂ : ∀f : C_c(UpperPlane,ℝ), ∀ᵐ b ∂W, Continuous (fun v : ℝ≥0 => + ∫z,f z∂recoveredMass a ha s₂ c₂ hc₂ v b)) + (hmono₁ : ∀ᵐ b ∂W, Monotone (fun v : ℝ≥0∞ => recoveredMass a ha s₁ c₁ hc₁ v b)) + (hmono₂ : ∀ᵐ b ∂W, Monotone (fun v : ℝ≥0∞ => recoveredMass a ha s₂ c₂ hc₂ v b)) + (hexh₁ : ∀ᵐ b ∂W, ∀A : Set UpperPlane, MeasurableSet A → Tendsto + (fun n : ℕ => recoveredMass a ha s₁ c₁ hc₁ (n:ℝ≥0) b A) + atTop (𝓝 (recoveredMass a ha s₁ c₁ hc₁ ∞ b A))) + (hexh₂ : ∀ᵐ b ∂W, ∀A : Set UpperPlane, MeasurableSet A → Tendsto + (fun n : ℕ => recoveredMass a ha s₂ c₂ hc₂ (n:ℝ≥0) b A) + atTop (𝓝 (recoveredMass a ha s₂ c₂ hc₂ ∞ b A))) : + ∀ᵐ b ∂W, ∀v : ℝ≥0∞, + recoveredMass a ha s₁ c₁ hc₁ v b=recoveredMass a ha s₂ c₂ hc₂ v b := by + let μ := recoveredMass a ha s₁ c₁ hc₁ + let ν := recoveredMass a ha s₂ c₂ hc₂ + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : (μ v b).Regular := radonLimit_regular _ + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : (ν v b).Regular := radonLimit_regular _ + have htop : IsStoppingTime rawFiltration (fun _ : ExactSLEGenerator.Driver => (∞:ℝ≥0∞)) := + fun t => by simp + have hi₁ (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂μ ∞ b) W := by + apply memLp_one_iff_integrable.mp + simpa only [Nat.cast_one] using (actual_stopped_radon_limit_memLp a ha W hW + _ htop s₁ c₁ hc₁ hsum₁ (μ ∞) f (hconv₁.mono (fun b hb => hb ∞ f)) 1) + have hi₂ (f : C_c(UpperPlane,ℝ)) : Integrable (fun b => ∫z,f z∂ν ∞ b) W := by + apply memLp_one_iff_integrable.mp + simpa only [Nat.cast_one] using (actual_stopped_radon_limit_memLp a ha W hW + _ htop s₂ c₂ hc₂ hsum₂ (ν ∞) f (hconv₂.mono (fun b hb => hb ∞ f)) 1) + have hzero₁ : μ 0=ᵐ[W] 0 := Eventually.of_forall (recoveredMass_zero a ha s₁ c₁ hc₁) + have hzero₂ : ν 0=ᵐ[W] 0 := Eventually.of_forall (recoveredMass_zero a ha s₂ c₂ hc₂) + have he : ∀ᵐ b ∂W, ∀v : ℝ≥0, μ v b=ν v b := by + apply SLEExactGauge.CompensatorUniqueness.ae_all_measure_eq + (ℱ:=rawFiltration) (fun v : ℝ≥0 => μ v) (fun v : ℝ≥0 => ν v) (μ ∞) (ν ∞) + (recoveredMass_compact_stronglyAdapted a ha s₁ c₁ hc₁) + (recoveredMass_compact_stronglyAdapted a ha s₂ c₂ hc₂) + hzero₁ hzero₂ hcont₁ hcont₂ + (hmono₁.mono (fun b hb s t hst => hb (ENNReal.coe_le_coe.mpr hst))) + (hmono₂.mono (fun b hb s t hst => hb (ENNReal.coe_le_coe.mpr hst))) + (hmono₁.mono (fun b hb v => hb le_top)) + (hmono₂.mono (fun b hb v => hb le_top)) hi₁ hi₂ + intro f _ t + have h₁ := recoveredMass_stopped_condExp a ha W hW s₁ c₁ hc₁ hs₁ hsum₁ hconv₁ + _ (isStoppingTime_const rawFiltration t) f + have h₂ := recoveredMass_stopped_condExp a ha W hW s₂ c₂ hc₂ hs₂ hsum₂ hconv₂ + _ (isStoppingTime_const rawFiltration t) f + have hh := h₁.trans h₂.symm + rw [IsStoppingTime.measurableSpace_const] at hh + simpa only [μ, ν, ENNReal.some_eq_coe'] using hh + filter_upwards [he,hexh₁,hexh₂] with b hb h₁ h₂ v + induction v using ENNReal.recTopCoe with + | coe v => exact hb v + | top => + apply Measure.ext + intro A hA + have h : Tendsto (fun n : ℕ => μ (n:ℝ≥0) b A) atTop (𝓝 (μ ∞ b A)) := h₁ A hA + simp only [hb] at h + exact tendsto_nhds_unique h (h₂ A hA) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions TraceMassIntegration +open LoewnerRestart + + + +theorem actual_canonical_trace_mass (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + ∃ (s : ℕ→Finset ℕ) (c : ℕ→ℕ→ℝ) (hc : ∀k j,j∈s k→0≤c k j), + (∀k j,j∈s k→k≤j) ∧ (∀k,∑j∈s k,c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + (∀v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀b, μ 0 b=0) ∧ (∀v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + μ ∞ ∘ₘ (W.map driverHomeomorph)=initialGreenMeasure (Target.a κ) ∧ + (∀ (S : GDriver→ℝ≥0∞) (hS : IsStoppingTime rawFiltration S), + Measurable[hS.measurableSpace] (fun b => μ (S b) b) ∧ + (∀f : C_c(UpperPlane,ℝ), ∀m : ℕ, + MemLp (fun b => ∫z,f z∂μ (S b) b) (m:ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀K : Set UpperPlane, IsCompact K → ∀m : ℕ, + MemLp (fun b => (μ (S b) b K).toReal) (m:ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀f : C_c(UpperPlane,ℝ), Tendsto (fun k => eLpNorm + (fun b => (∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) (S b) b)-(∫z,f z∂μ (S b) b)) + 1 (W.map driverHomeomorph)) atTop (𝓝 0)) ∧ + (∀H : GDriver × UpperPlane→ℝ≥0∞, + Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b,∫⁻z,H (b,z)∂μ ∞ b∂(W.map driverHomeomorph))= + (∫⁻b,∫⁻z,H (b,z)∂μ (S b) b∂(W.map driverHomeomorph))+ + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen (Target.a κ) (S b) b z.1) + ∂upperArea∂(W.map driverHomeomorph)) ∧ + (∀ᵐ b ∂(W.map driverHomeomorph), S b≠∞ → + (μ (S b) b).restrict {z : UpperPlane | alive (Target.a κ) b.1 (S b).toNNReal z.1}=0 ∧ + ∀v : ℝ≥0∞, (μ (S b+v) b).restrict + {z : UpperPlane | alive (Target.a κ) b.1 (S b).toNNReal z.1}= + restartPush (Target.a κ) (lt_trans (by norm_num) (a_gt_quarter hκ hκ8)) b + (S b).toNNReal (μ v (restartAt S b)))) ∧ + ∀ᵐ b ∂W, TraceMassFacts κ b (fun v => μ v (driverHomeomorph b)) ∧ + (∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v (driverHomeomorph b)) + atTop (𝓝 (∫z,f z∂μ v (driverHomeomorph b)))) ∧ + (∀u v : ℝ≥0, u μ v b) := by + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + filter_upwards [hpath] with b hb + change TraceMassFacts κ (driverHomeomorph.symm (driverHomeomorph b)) + (fun v => μ v (driverHomeomorph b)) + simpa only [Homeomorph.symm_apply_apply] using hb.1 + have hv : ∀ᵐ b ∂(W.map driverHomeomorph), ∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v b) + atTop (𝓝 (∫z,f z∂μ v b)) := by + apply driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mpr + exact hpath.mono (fun b hb => hb.2) + refine ⟨s,c,hc,hs,hsum,hreg,hzero,hmeas,hprog,hmean,?_,?_⟩ + · intro S hS + rcases hstop S hS with ⟨hsm,hmom,hK,hL,hH⟩ + exact ⟨hsm,hmom,hK,hL,hH,recoveredMass_interior_restart κ hκ hκ8 + (W.map driverHomeomorph) hBW s c hc hs hsum hmean hp hv hS⟩ + · have hpos := recoveredMass_positive_increments κ hκ hκ8 + (W.map driverHomeomorph) hBW s c hc hs hsum hmean hp hv + have hpos' := driverMeasurableEquiv.measurableEmbedding.ae_map_iff.mp hpos + filter_upwards [hpath,hpos'] with b hb hbp + exact ⟨hb.1,hb.2,hbp⟩ + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen KernelSimilarity + +lemma diskMass_mono {ν η : Measure UpperPlane} (h : ν≤η) (a θ : ℝ) : + diskMass a θ ν≤diskMass a θ η := by + apply Measure.map_mono _ (diskMap_measurable θ) + apply Measure.le_iff.mpr + intro U hU + rw [withDensity_apply _ hU,withDensity_apply _ hU] + exact lintegral_mono' (Measure.restrict_mono le_rfl h) le_rfl + +lemma diskMass_inner_le_enorm (a θ : ℝ) (ha : 1/4b.1 t) W → + ∀(s : ℕ→Finset ℕ) (coeff : ℕ→ℕ→ℝ), + (∀k j,j∈s k→0≤coeff k j) → (∀k,∑j∈s k,coeff k j=1) → + ∀μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane, + (∀b,IsFiniteMeasureOnCompacts (μ ∞ b)) → Measurable (μ ∞) → + (∀ᵐ b∂W,∀v : ℝ≥0∞,μ v b≤μ ∞ b) → + (∀ᵐ b∂W,∀f : C_c(UpperPlane,ℝ),Tendsto (fun k=>∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂μ ∞ b))) → + ∀(θ : ℝ) (_hθ : 0<θ) (_hθπ : θ∫z,f z∂μ ∞ b) := by + let Kμ : Kernel ExactSLEGenerator.Driver UpperPlane := ⟨μ ∞,hμ⟩ + exact (f.continuous.stronglyMeasurable.integral_kernel (κ:=Kμ)).measurable + have hb := hDb W hW θ hθ hθπ f (diskTest_support a θ hθ hθπ) + (diskTest_bound a θ hθ hθπ) s coeff hcoeff hsum ∞ (μ ∞) hfm + (hlim.mono (fun b hb=>hb f)) l + refine le_trans (lintegral_mono_ae ?_) hb + have habs : radialLaw W a (fromDisk θ 0) (Real.sin θ*Real.exp (-2*a*l)) ≪ W := + withDensity_absolutelyContinuous W _ + filter_upwards [habs.ae_le hmono] with b hb + exact pow_le_pow_left' ((Measure.le_iff'.mp (diskMass_mono (hb (T b)) a θ) + _).trans (diskMass_inner_le_enorm a θ ha hθ hθπ (μ ∞ b))) m + +end SLEExactGauge.CenteredMoments +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ReverseFlow.lean b/lean/OAI/Probability/SLEGauge/ReverseFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c49bba349fe889411e9d6ee30a65d997292a89a --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ReverseFlow.lean @@ -0,0 +1,462 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ReverseMoments +import OAI.Probability.SLEGauge.BrownianShifts + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero +noncomputable section +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative +lemma forward_integral_eq_reverse {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : + (∫ u in (0:ℝ)..T, -(a κ:ℂ)/ + (flow κ b (reversedCurve κ y T b T+driverValue b T) (timeClip T u)-driverValue b (timeClip T u))^2) = + -(∫ s in (0:ℝ)..T, reverseCoeff κ y T b s) := by + have hf := reverse_reparam_solution hκ hy hT b + have hrev (u : ℝ) (hu : u ∈ Icc 0 T) : T-u ∈ Icc 0 T := by constructor <;> linarith [hu.1,hu.2] + have heq (u : ℝ) (hu : u ∈ Icc 0 T) : + -(a κ:ℂ)/(flow κ b (reversedCurve κ y T b T+driverValue b T) (timeClip T u)-driverValue b (timeClip T u))^2 = + -reverseCoeff κ y T b (T-u) := by + rw [timeClip_eq hu,hf.flow_eqOn hu] + have hβ := BrownianRestart.backward_before (hrev u hu) b + simp only [sub_sub_cancel] at hβ + simp only [reverseCoeff,hβ,driverValue,Complex.ofReal_sub] + have hden : reversedCurve κ y T b (T-u)+(b T.toNNReal:ℂ)-b u.toNNReal = + reversedCurve κ y T b (T-u)-((b u.toNNReal:ℂ)-b T.toNNReal) := by ring + rw [hden] + simp only [div_eq_mul_inv,inv_pow,neg_mul] + calc + _ = (∫ u in (0:ℝ)..T, -reverseCoeff κ y T b (T-u)) := by + apply intervalIntegral.integral_congr + intro u hu + exact heq u (by simpa only [uIcc_of_le hT] using hu) + _ = -(∫ u in (0:ℝ)..T, reverseCoeff κ y T b (T-u)) := intervalIntegral.integral_neg + _ = -(∫ s in (0:ℝ)..T, reverseCoeff κ y T b s) := by + rw [intervalIntegral.integral_comp_sub_left] + simp only [sub_self,sub_zero] + + + +theorem inverseFlow_deriv_norm_eq_reverse {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) + (b : Driver) : ‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖ = + Real.exp ((reversedState κ y T b T).2.2) := by + have hw : 0 < ((driverValue b T:ℂ)+y*Complex.I).im := by simpa using hy + have hd := (inverseFlow_hasStrictDerivAt hκ b hT hw).hasDerivAt.deriv + rw [hd,inverseFlow_eq_reversedCurve hκ hy hT b, + (flow_hasDerivAt_initial hT (reverse_reparam_solution hκ hy hT b).surviving).deriv, + forward_integral_eq_reverse hκ hy hT b,norm_inv,Complex.norm_exp,Complex.neg_re, + ← Real.exp_neg,neg_neg,reversed_log_eq_integral hκ hy hT b] +end SLEExactGauge.LiteralTrace + +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory ProbabilityTheory + +lemma measurable_reverse_log (a y T : ℝ) (hy : 0 < y) : + Measurable (fun b : Driver => + (ReverseDerivative.reverseFlow a (y/4) (T+y^2) y b T).2.2) := + (ReverseDerivative.measurable_driven (by positivity : 0 < y/4) + a (ReverseDerivative.initial (T+y^2) y) T).fst.snd.snd + +lemma measurable_inverse_deriv_norm {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) (hT : 0 ≤ T) : + Measurable (fun b : Driver => ‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖) := by + simp_rw [inverseFlow_deriv_norm_eq_reverse hκ hy hT] + exact ((measurable_reverse_log (a κ) y T hy).comp (BrownianRestart.measurable_backward T.toNNReal)).exp + + + +theorem inverse_deriv_moment {κ y T : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hT : 0 ≤ T) {W : WienerLaw} (hW : IsWiener W) : + (∫⁻ b : Driver, ENNReal.ofReal + (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ))) ∂W) ≤ + ENNReal.ofReal ((3*y^2/(T+3*y^2))^(zeta (a κ)/2)) := by + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + let F := fun b : Driver => ENNReal.ofReal (Real.exp + (lambda (a κ)*(ReverseDerivative.reverseFlow (a κ) (y/4) (T+y^2) y b T).2.2)) + have mF : Measurable F := + (measurable_const.mul (measurable_reverse_log (a κ) y T hy)).exp.ennreal_ofReal + have hid (b : Driver) : + ENNReal.ofReal (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ))) = + F (BrownianRestart.backward T.toNNReal b) := by + rw [inverseFlow_deriv_norm_eq_reverse hκ hy hT, + Real.rpow_def_of_pos (Real.exp_pos _),Real.log_exp,mul_comm] + rfl + simp_rw [hid] + rw [← lintegral_map mF (BrownianRestart.measurable_backward T.toNNReal), + BrownianRestart.backward_preserves_law hW] + exact ReverseDerivative.reverse_logderiv_moment ha hy hT hW +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory ProbabilityTheory + +lemma lambda_gt_one {a : ℝ} (ha : 0 < a) : 1 < lambda a := by + unfold lambda + have hh : 0 < 3/(16*a) := by positivity + linarith + +lemma inverse_deriv_first_moment {κ y T : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hT : 0 ≤ T) {W : WienerLaw} (hW : IsWiener W) : + (∫⁻ b : Driver, ENNReal.ofReal ‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖ ∂W) ≤ 2 := by + let := hW.isGaussianProcess.isProbabilityMeasure + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + have hl := lambda_gt_one (show 0 < a κ by linarith) + have hp (x : ℝ) (hx : 0 ≤ x) : x ≤ 1+x^(lambda (a κ)) := by + by_cases h : x ≤ 1 + · exact h.trans (le_add_of_nonneg_right (Real.rpow_nonneg hx _)) + · have he := Real.rpow_le_rpow_of_exponent_le (le_of_not_ge h) hl.le + simpa only [Real.rpow_one] using he.trans (le_add_of_nonneg_left (by norm_num : (0:ℝ) ≤ 1)) + calc + _ ≤ ∫⁻ b : Driver, (1+ENNReal.ofReal (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ)))) ∂W := by + apply lintegral_mono + intro b + dsimp only + rw [← ENNReal.ofReal_one,← ENNReal.ofReal_add (by norm_num) (Real.rpow_nonneg (norm_nonneg _) _)] + exact ENNReal.ofReal_le_ofReal (hp _ (norm_nonneg _)) + _ = 1+(∫⁻ b : Driver, ENNReal.ofReal (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ))) ∂W) := by + rw [lintegral_add_left measurable_const] + simp + _ ≤ 1+ENNReal.ofReal ((3*y^2/(T+3*y^2))^(zeta (a κ)/2)) := + add_le_add le_rfl (inverse_deriv_moment hκ hκ8 hy hT hW) + _ ≤ 2 := by + have hr : 3*y^2/(T+3*y^2) ≤ 1 := (div_le_one (by positivity)).mpr (by linarith) + have hh := Real.rpow_le_rpow (by positivity : 0 ≤ 3*y^2/(T+3*y^2)) hr + (by linarith [(parameters ha).1] : 0 ≤ zeta (a κ)/2) + simp only [Real.one_rpow] at hh + have hh' : ENNReal.ofReal ((3*y^2/(T+3*y^2))^(zeta (a κ)/2)) ≤ 1 := by + simpa using ENNReal.ofReal_le_ofReal hh + calc _ ≤ 1+1 := add_le_add le_rfl hh' + _ = 2 := by norm_num + + +def radialCoeff (κ : ℝ) (b : Driver) (T y : ℝ) : ℂ := + if 0 < y then deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)*Complex.I else 0 + +lemma continuousOn_radialCoeff {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) : + ContinuousOn (radialCoeff κ b T) (Ioi 0) := by + have hopen : IsOpen {w : ℂ | 0 < w.im} := isOpen_lt continuous_const Complex.continuous_im + have hc := (((flow_conformal_bijection hκ b hT).2.2.2).analyticOnNhd hopen).deriv.continuousOn + have hline : Continuous (fun y : ℝ => (driverValue b T:ℂ)+y*Complex.I) := by fun_prop + have hh := (hc.comp hline.continuousOn (show MapsTo (fun y : ℝ => (driverValue b T:ℂ)+y*Complex.I) (Ioi 0) {w : ℂ | 0 < w.im} from by intro y hy; simpa using hy)).mul (continuousOn_const (c := Complex.I)) + apply hh.congr + intro y hy + rw [radialCoeff,ite_eq_left (show 0 < y from hy)] + rfl + +lemma measurable_positive_radial_norm {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) : + Measurable (fun p : (Ioi (0:ℝ)) × Driver => + ‖deriv (inverseFlow κ p.2 T) (driverValue p.2 T+(p.1:ℝ)*Complex.I)‖) := by + exact measurable_uncurry_of_continuous_of_measurable + (u := fun (y : Ioi (0:ℝ)) (b : Driver) => ‖deriv (inverseFlow κ b T) (driverValue b T+(y:ℝ)*Complex.I)‖) (by + intro b + have hh := (continuousOn_radialCoeff hκ hT b).norm.domRestrict + have he : ((Ioi (0:ℝ)).domRestrict (fun y => ‖radialCoeff κ b T y‖)) = + (fun y : Ioi (0:ℝ) => ‖deriv (inverseFlow κ b T) (driverValue b T+(y:ℝ)*Complex.I)‖) := by + funext y + change ‖radialCoeff κ b T y‖ = _ + rw [radialCoeff,ite_eq_left (show 0 < (y:ℝ) from y.property),norm_mul,Complex.norm_I,mul_one] + rwa [he] at hh) (by + intro y + exact measurable_inverse_deriv_norm hκ y.property hT) + +lemma measurable_radial_norm {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) : + Measurable (fun p : ℝ × Driver => ‖radialCoeff κ p.2 T p.1‖) := by + have hm := measurable_positive_radial_norm hκ hT + apply measurable_of_restrict_of_restrict_compl (s := {p : ℝ × Driver | 0 < p.1}) + (measurableSet_lt measurable_const measurable_fst) + · have mm : Measurable (fun p : {p : ℝ × Driver | 0 < p.1} => + ((⟨p.val.1,p.property⟩ : Ioi (0:ℝ)),p.val.2)) := + (measurable_subtype_coe.fst.subtype_mk).prodMk measurable_subtype_coe.snd + have he : ({p : ℝ × Driver | 0 < p.1}.domRestrict + (fun p : ℝ × Driver => ‖radialCoeff κ p.2 T p.1‖)) = + (fun p : {p : ℝ × Driver | 0 < p.1} => + ‖deriv (inverseFlow κ p.val.2 T) (driverValue p.val.2 T+p.val.1*Complex.I)‖) := by + funext p + change ‖radialCoeff κ p.val.2 T p.val.1‖ = _ + rw [radialCoeff,ite_eq_left (show 0 < p.val.1 from p.property),norm_mul,Complex.norm_I,mul_one] + rw [he] + have hh := hm.comp mm + change Measurable (fun p : {p : ℝ × Driver | 0 < p.1} => + ‖deriv (inverseFlow κ p.val.2 T) (driverValue p.val.2 T+p.val.1*Complex.I)‖) at hh + exact hh + · have he : ({p : ℝ × Driver | 0 < p.1}ᶜ.domRestrict + (fun p : ℝ × Driver => ‖radialCoeff κ p.2 T p.1‖)) = + (fun _ : ↥({p : ℝ × Driver | 0 < p.1}ᶜ) => (0:ℝ)) := by + funext p + change ‖radialCoeff κ p.val.2 T p.val.1‖ = 0 + rw [radialCoeff,ite_eq_right (show ¬0 < p.val.1 from p.property),norm_zero] + rw [he] + exact measurable_const + +lemma radial_length_ae_finite {κ T : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hT : 0 ≤ T) {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, (∫⁻ y in Icc (0:ℝ) 1, ENNReal.ofReal ‖radialCoeff κ b T y‖) < (∞:ℝ≥0∞) := by + let := hW.isGaussianProcess.isProbabilityMeasure + let F := fun b : Driver => ∫⁻ y in Icc (0:ℝ) 1, ENNReal.ofReal ‖radialCoeff κ b T y‖ + have hm := (measurable_radial_norm hκ hT).ennreal_ofReal + have mF : Measurable F := (hm.comp measurable_swap).lintegral_prod_right' + apply ae_lt_top mF + have hs : (∫⁻ b, F b ∂W) ≤ 2 := by + rw [show (∫⁻ b, F b ∂W) = ∫⁻ y in Icc (0:ℝ) 1, ∫⁻ b, ENNReal.ofReal ‖radialCoeff κ b T y‖ ∂W from + lintegral_lintegral_swap (hm.comp measurable_swap).aemeasurable] + calc + _ ≤ ∫⁻ y in Icc (0:ℝ) 1, (2:ℝ≥0∞) := by + apply lintegral_mono + intro y + by_cases hy : 0 < y + · simpa only [radialCoeff,ite_eq_left hy,norm_mul,Complex.norm_I,mul_one] using + inverse_deriv_first_moment hκ hκ8 hy hT hW + · simp only [radialCoeff,ite_eq_right hy,norm_zero,ENNReal.ofReal_zero,lintegral_zero] + exact bot_le + _ = 2 := by simp + exact ne_top_of_le_ne_top (by norm_num) hs +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open MeasureTheory + +lemma measurable_radialCoeff {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) : + Measurable (radialCoeff κ b T) := by + apply measurable_of_restrict_of_restrict_compl (s := Ioi (0:ℝ)) measurableSet_Ioi + · exact (continuousOn_radialCoeff hκ hT b).domRestrict.measurable + · have he : ((Ioi (0:ℝ))ᶜ.domRestrict (radialCoeff κ b T)) = + (fun _ : ↥((Ioi (0:ℝ))ᶜ) => (0:ℂ)) := by + funext y + change radialCoeff κ b T y.val = 0 + rw [radialCoeff,ite_eq_right (show ¬0 < y.val from y.property)] + rw [he] + exact measurable_const + +lemma hasDerivAt_radial {κ T y : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (hy : 0 < y) (b : Driver) : + HasDerivAt (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) + (radialCoeff κ b T y) y := by + have hw : 0 < ((driverValue b T:ℂ)+y*Complex.I).im := by simpa using hy + have hf := (inverseFlow_hasStrictDerivAt hκ b hT hw).hasDerivAt.differentiableAt.hasDerivAt + have hl : HasDerivAt (fun z : ℂ => (driverValue b T:ℂ)+z*Complex.I) Complex.I (y:ℂ) := by + convert! (hasDerivAt_const (y:ℂ) (driverValue b T:ℂ)).add ((hasDerivAt_id (y:ℂ)).mul_const Complex.I) using 1; simp + convert! (hf.comp (y:ℂ) hl).comp_ofReal using 1; simp only [radialCoeff,ite_eq_left hy] + +lemma radial_limit_of_integrable {κ T : ℝ} (hκ : 0 < κ) (hT : 0 ≤ T) (b : Driver) + (hi : IntegrableOn (radialCoeff κ b T) (Icc (0:ℝ) 1)) : + ∃ z : ℂ, Tendsto (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) + (𝓝[>] 0) (𝓝 z) := by + let f := fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I) + let v := fun y : ℝ => radialCoeff κ b T y + have hi' : IntegrableOn v (uIcc (0:ℝ) 1) := by simpa only [uIcc_of_le zero_le_one] using hi + have hcont := intervalIntegral.continuousOn_primitive_interval_left hi' + have hevent : ∀ᶠ y : ℝ in 𝓝[>] 0, y ∈ Ioc (0:ℝ) 1 := by + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ y : ℝ in 𝓝[>] 0, y < 1 from nhdsWithin_le_nhds (Iio_mem_nhds zero_lt_one))] with y hy hy1 + exact ⟨hy,hy1.le⟩ + have hmap : Tendsto (fun y : ℝ => y) (𝓝[>] 0) (𝓝[uIcc (0:ℝ) 1] 0) := by + apply tendsto_nhdsWithin_iff.mpr + refine ⟨tendsto_id'.mpr nhdsWithin_le_nhds,?_⟩ + filter_upwards [hevent] with y hy + simpa only [uIcc_of_le zero_le_one] using (show y ∈ Icc (0:ℝ) 1 from ⟨hy.1.le,hy.2⟩) + have hlim := ((hcont 0 left_mem_uIcc).tendsto.comp hmap).const_sub (f 1) + refine ⟨f 1-(∫ u in (0:ℝ)..1, v u),hlim.congr' ?_⟩ + filter_upwards [hevent] with y hy + have hd (u : ℝ) (hu : u ∈ uIcc y 1) : HasDerivAt f (v u) u := by + rw [uIcc_of_le hy.2] at hu + exact hasDerivAt_radial hκ hT (hy.1.trans_le hu.1) b + have hint : IntervalIntegrable v volume y 1 := by + apply IntegrableOn.intervalIntegrable + simpa only [uIcc_of_le hy.2] using + (hi.mono_set (show Icc y 1 ⊆ Icc (0:ℝ) 1 from Icc_subset_Icc hy.1.le le_rfl)) + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt hd hint + simp only [Function.comp_apply] + rw [he] + exact sub_sub_cancel _ _ + + + +theorem radial_limit_ae {κ T : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hT : 0 ≤ T) {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, ∃ z : ℂ, + Tendsto (fun y : ℝ => inverseFlow κ b T (driverValue b T+y*Complex.I)) (𝓝[>] 0) (𝓝 z) := by + filter_upwards [radial_length_ae_finite hκ hκ8 hT hW] with b hb + apply radial_limit_of_integrable hκ hT b + exact ⟨(measurable_radialCoeff hκ hT b).aestronglyMeasurable, + (hasFiniteIntegral_iff_norm _).mpr hb⟩ + + + +theorem trace_limit_countable {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) (t : ℕ → ℝ) (ht : ∀ n, 0 ≤ t n) : + ∀ᵐ b ∂W, ∀ n : ℕ, + Tendsto (fun y : ℝ => inverseFlow κ b (κ*t n) (driverValue b (κ*t n)+y*Complex.I)) + (𝓝[>] 0) (𝓝 (trace κ b (t n))) := by + have hh := ae_all_iff.mpr (fun n => radial_limit_ae hκ hκ8 (mul_nonneg hκ.le (ht n)) hW) + filter_upwards [hh] with b hb + intro n + obtain ⟨z,hz⟩ := hb n + have he : trace κ b (t n) = z := by + exact hz.limUnder_eq + rwa [he] +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory + + + +def traceBeta (κ : ℝ) : ℝ := + (lambda (a κ)+zeta (a κ)-2)/(2*lambda (a κ)) + +def traceEta (κ : ℝ) : ℝ := (lambda (a κ)+zeta (a κ)-2)/2 + +lemma trace_exponents {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) : + 0 < traceBeta κ ∧ traceBeta κ < 1 ∧ 0 < traceEta κ ∧ + zeta (a κ)-(traceBeta κ-1)*lambda (a κ) = 2+traceEta κ := by + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + have hp := parameters ha + have hsum : 0 < lambda (a κ)+zeta (a κ)-2 := by linarith [hp.2.2.1] + have hden : 0 < 2*lambda (a κ) := by linarith [hp.2.1] + have hlt : zeta (a κ) < lambda (a κ)+2 := by + unfold lambda zeta + have : 0 < a κ := by linarith + have h1 : 0 ≤ 1/(16*a κ) := by positivity + have h3 : 0 ≤ 3/(16*a κ) := by positivity + linarith + refine ⟨div_pos hsum hden, (div_lt_one hden).mpr (by linarith),div_pos hsum (by norm_num),?_⟩ + unfold traceBeta traceEta + field_simp [ne_of_gt hp.2.1] + ring + +lemma inverse_deriv_moment_away {κ y T δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hδ : 0 < δ) (hT : δ ≤ T) {W : WienerLaw} (hW : IsWiener W) : + (∫⁻ b : Driver, ENNReal.ofReal + (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ))) ∂W) ≤ + ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ))) := by + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + have hz := (parameters ha).1 + have hT0 : 0 ≤ T := hδ.le.trans hT + apply (inverse_deriv_moment hκ hκ8 hy (hδ.le.trans hT) hW).trans + apply ENNReal.ofReal_le_ofReal + calc + _ ≤ ((3/δ)*y^2)^(zeta (a κ)/2) := by + apply Real.rpow_le_rpow (by positivity) _ (by positivity) + calc + _ ≤ 3*y^2/δ := div_le_div_of_nonneg_left (by positivity) hδ (by nlinarith) + _ = (3/δ)*y^2 := by ring + _ = (3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)) := by + rw [Real.mul_rpow (by positivity) (sq_nonneg y), + ← Real.rpow_natCast_mul hy.le 2 (zeta (a κ)/2)] + congr 1 + congr 1 + norm_num + ring + +lemma inverse_deriv_tail_away {κ y T δ K : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hδ : 0 < δ) (hT : δ ≤ T) (hK : 0 < K) + {W : WienerLaw} (hW : IsWiener W) : + W {b : Driver | K ≤ ‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖} ≤ + ENNReal.ofReal (((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)))/K^(lambda (a κ))) := by + have ha : 1/4 < a κ := by unfold a; apply (lt_div_iff₀ hκ).mpr; linarith + have hl := (parameters ha).2.1 + have hm := ((measurable_inverse_deriv_norm hκ hy (hδ.le.trans hT)).pow_const + (lambda (a κ))).ennreal_ofReal + have hKP : 0 < K^(lambda (a κ)) := Real.rpow_pos_of_pos hK _ + calc + _ ≤ W {b : Driver | ENNReal.ofReal (K^(lambda (a κ))) ≤ ENNReal.ofReal + (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ)))} := by + apply measure_mono + intro b hb + exact ENNReal.ofReal_le_ofReal (Real.rpow_le_rpow hK.le hb hl.le) + _ ≤ (∫⁻ b : Driver, ENNReal.ofReal + (‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖^(lambda (a κ))) ∂W)/ + ENNReal.ofReal (K^(lambda (a κ))) := + meas_ge_le_lintegral_div hm.aemeasurable (ne_of_gt (ENNReal.ofReal_pos.mpr hKP)) ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)))/ + ENNReal.ofReal (K^(lambda (a κ))) := by + exact ENNReal.div_le_div_right (inverse_deriv_moment_away hκ hκ8 hy hδ hT hW) _ + _ = ENNReal.ofReal (((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)))/K^(lambda (a κ))) := + (ENNReal.ofReal_div_of_pos hKP).symm + +lemma inverse_deriv_beta_tail {κ y T δ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + (hy : 0 < y) (hδ : 0 < δ) (hT : δ ≤ T) {W : WienerLaw} (hW : IsWiener W) : + W {b : Driver | y^(traceBeta κ-1) ≤ + ‖deriv (inverseFlow κ b T) (driverValue b T+y*Complex.I)‖} ≤ + ENNReal.ofReal ((3/δ)^(zeta (a κ)/2)*y^(2+traceEta κ)) := by + have hp := trace_exponents hκ hκ8 + have he : ((3/δ)^(zeta (a κ)/2)*y^(zeta (a κ)))/(y^(traceBeta κ-1))^(lambda (a κ)) = + (3/δ)^(zeta (a κ)/2)*y^(2+traceEta κ) := by + rw [← Real.rpow_mul hy.le, mul_div_assoc, ← Real.rpow_sub hy, + hp.2.2.2] + simpa only [he] using (inverse_deriv_tail_away hκ hκ8 hy hδ hT + (Real.rpow_pos_of_pos hy (traceBeta κ-1)) hW) +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open ReverseDerivative MeasureTheory + +lemma lintegral_pow_le_mass {α : Type*} [MeasurableSpace α] (μ : Measure α) + {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) {p : ℝ} (hp : 1 < p) : + (∫⁻ x, f x ∂μ)^p ≤ (μ univ)^(p-1)*(∫⁻ x, (f x)^p ∂μ) := by + have hp0 : 0 < p := by linarith + let q := p/(p-1) + have hpq : p.HolderConjugate q := by + rw [Real.holderConjugate_iff] + refine ⟨hp,?_⟩ + dsimp [q] + field_simp + ring + have hh := ENNReal.lintegral_mul_le_Lp_mul_Lq μ hpq hf + (aemeasurable_const (b := (1:ℝ≥0∞))) + simp only [Pi.mul_apply,mul_one,ENNReal.one_rpow,lintegral_const,one_mul] at hh + have hh' := ENNReal.rpow_le_rpow hh hp0.le + rw [ENNReal.mul_rpow_of_nonneg _ _ hp0.le,← ENNReal.rpow_mul, + one_div_mul_cancel (ne_of_gt hp0),ENNReal.rpow_one,← ENNReal.rpow_mul] at hh' + have he : (1/q)*p = p-1 := by dsimp [q]; field_simp + rw [he,mul_comm] at hh' + exact hh' + + +def radialLength (κ : ℝ) (b : Driver) (T y : ℝ) : ℝ≥0∞ := + ∫⁻ u in Ioc (0:ℝ) y, ENNReal.ofReal ‖radialCoeff κ b T u‖ + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ReverseGenerators.lean b/lean/OAI/Probability/SLEGauge/ReverseGenerators.lean new file mode 100644 index 0000000000000000000000000000000000000000..35c07f9d6cc4a36e3c8a7ddc48e20fb28de704bd --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ReverseGenerators.lean @@ -0,0 +1,421 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppingMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +namespace SLEExactGauge.ReverseDerivative +lemma line_deriv_test (a b : ℝ) {q : State} (hu : 0 ≤ q.1) (hy : 0 < q.2.1.im) + (v : State) : + HasDerivAt (fun t : ℝ => test a (q+t • v) b) + (test a q b * (lambda a*v.2.2+Hx a q.1 (q.2.1.re-b) q.2.1.im*v.2.1.re+ + Hy a q.1 (q.2.1.re-b) q.2.1.im*v.2.1.im- + zeta a/(4*D q.1 (q.2.1.re-b) q.2.1.im)*v.1)) 0 := by + let x := q.2.1.re-b + let y := q.2.1.im + let u := q.1 + have dx : HasDerivAt (fun t : ℝ => x+t*v.2.1.re) v.2.1.re 0 := by + simpa using ((hasDerivAt_id (0:ℝ)).mul_const v.2.1.re).const_add x + have dy : HasDerivAt (fun t : ℝ => y+t*v.2.1.im) v.2.1.im 0 := by + simpa using ((hasDerivAt_id (0:ℝ)).mul_const v.2.1.im).const_add y + have du : HasDerivAt (fun t : ℝ => u+t*v.1) v.1 0 := by + simpa using ((hasDerivAt_id (0:ℝ)).mul_const v.1).const_add u + have dl : HasDerivAt (fun t : ℝ => q.2.2+t*v.2.2) v.2.2 0 := by + simpa using ((hasDerivAt_id (0:ℝ)).mul_const v.2.2).const_add q.2.2 + have dr := (dx.pow 2).add (dy.pow 2) + have dd := dr.add (du.div_const 2) + have hR := (R_pos x hy).ne' + have hD := (D_pos hu hy x).ne' + have hlogR := dr.log (by simpa [R,y] using hR) + have hlogD := dd.log (by simpa [D,R,y,u] using hD) + have hlogY := dy.log (by simpa [y] using hy.ne') + have hd := ((((dl.const_mul (lambda a)).add (hlogR.const_mul (r a/2))).add + (hlogY.const_mul (zeta a-r a))).sub (hlogD.const_mul (zeta a/2))).exp + convert! hd using 1 + · ext t + simp [test,F,H,R,D,x,y,u,Complex.add_re,Complex.add_im] + congr 4 <;> ring_nf + · simp only [zero_mul,add_zero] at * + dsimp [test,F,H,Hx,Hy,R,D,x,y,u] at * + simp only [zero_mul,add_zero,pow_one] + congr 1 + field_simp [hR,hD,hy.ne'] + ring + +lemma fderiv_test_vector (a b : ℝ) {q : State} (hu : 0 ≤ q.1) (hy : 0 < q.2.1.im) : + fderiv ℝ (fun q => test a q b) q (vector a q b) = + test a q b * ((-a*(q.2.1.re-b)/R (q.2.1.re-b) q.2.1.im)* + Hx a q.1 (q.2.1.re-b) q.2.1.im+ + (a*q.2.1.im/R (q.2.1.re-b) q.2.1.im)*Hy a q.1 (q.2.1.re-b) q.2.1.im+ + a*((q.2.1.re-b)^2-q.2.1.im^2)/(R (q.2.1.re-b) q.2.1.im)^2*lambda a+ + zeta a/(4*D q.1 (q.2.1.re-b) q.2.1.im)) := by + have hv := (((hasDerivAt_id (0:ℝ)).smul_const (vector a q b)).const_add q) + simp only [id_eq,one_smul] at hv + have hq : q + (0:ℝ) • vector a q b = q := by simp + have houter := (differentiableAt_test a b hu hy).hasFDerivAt + rw [← hq] at houter + have hd := houter.comp_hasDerivAt (0:ℝ) + (show HasDerivAt (fun t : ℝ => q+t • vector a q b) (vector a q b) 0 from hv) + simp only [zero_smul,add_zero] at hd + rw [hd.unique (line_deriv_test a b hu hy (vector a q b))] + congr 1 + simp [vector,Complex.div_re,Complex.div_im,Complex.inv_re,Complex.inv_im, + Complex.mul_re,pow_two,Complex.normSq_apply,R] + simp only [div_eq_mul_inv, mul_inv_rev] + ring + +lemma second_driver_test (a : ℝ) {q : State} (hu : 0 ≤ q.1) (hy : 0 < q.2.1.im) (b : ℝ) : + deriv (deriv (test a q)) b = test a q b * + ((Hx a q.1 (q.2.1.re-b) q.2.1.im)^2+Hxx a q.1 (q.2.1.re-b) q.2.1.im) := by + have hfirst : deriv (test a q) = fun b => -test a q b * Hx a q.1 (q.2.1.re-b) q.2.1.im := by + funext b + have hd := ((hasDerivAt_Hx (a := a) (x := q.2.1.re-b) (l := q.2.2) hu hy).exp).comp b + ((hasDerivAt_id b).const_sub q.2.1.re) + convert! hd.deriv using 1 + simp only [test,F] + ring + rw [hfirst] + have hf := ((hasDerivAt_Hx (a := a) (x := q.2.1.re-b) (l := q.2.2) hu hy).exp).comp b + ((hasDerivAt_id b).const_sub q.2.1.re) + have hh := (hasDerivAt_Hxx (a := a) (x := q.2.1.re-b) hu hy).comp b + ((hasDerivAt_id b).const_sub q.2.1.re) + convert! (hf.neg.mul hh).deriv using 1 + simp only [test,F,Function.comp_apply,Pi.neg_apply] + ring + +lemma test_generator_nonpos {a : ℝ} (ha : 1/4 < a) {q : State} + (hu : 0 ≤ q.1) (hy : 0 < q.2.1.im) (b : ℝ) : + fderiv ℝ (fun q => test a q b) q (vector a q b)+deriv (deriv (test a q)) b/2 ≤ 0 := by + rw [fderiv_test_vector a b hu hy,second_driver_test a hu hy] + have hi := mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos (H a q.1 (q.2.1.re-b) q.2.1.im q.2.2)).le + (generator_nonpos (x := q.2.1.re-b) ha hu hy) + change test a q b * _ ≤ 0 at hi + nlinarith only [hi] + +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open scoped ContDiff + +def domain : Set (State × ℝ) := {q | 0 < q.1.1 ∧ 0 < q.1.2.1.im} + +lemma isOpen_domain : IsOpen domain := by + apply IsOpen.inter + · exact isOpen_lt continuous_const (continuous_fst.comp continuous_fst) + · exact isOpen_lt continuous_const + (Complex.continuous_im.comp (continuous_fst.comp (continuous_snd.comp continuous_fst))) + +lemma contDiffOn_test (a : ℝ) : + ContDiffOn ℝ ∞ (Function.uncurry (test a)) domain := by + intro q hq + apply ContDiffAt.contDiffWithinAt + have hre : ContDiffAt ℝ ∞ (fun q : State × ℝ => q.1.2.1.re-q.2) q := + (Complex.reCLM.contDiff.contDiffAt.comp q + (contDiffAt_fst.comp q (contDiffAt_snd.comp q contDiffAt_fst))).sub contDiffAt_snd + have him : ContDiffAt ℝ ∞ (fun q : State × ℝ => q.1.2.1.im) q := + Complex.imCLM.contDiff.contDiffAt.comp q + (contDiffAt_fst.comp q (contDiffAt_snd.comp q contDiffAt_fst)) + have hr := (hre.pow 2).add (him.pow 2) + have hd := hr.add ((contDiffAt_fst.comp q contDiffAt_fst).div_const 2) + have hl : ContDiffAt ℝ ∞ (fun q : State × ℝ => q.1.2.2) q := + contDiffAt_snd.comp q (contDiffAt_snd.comp q contDiffAt_fst) + have hR := (R_pos (q.1.2.1.re-q.2) hq.2).ne' + have hD := (D_pos hq.1.le hq.2 (q.1.2.1.re-q.2)).ne' + have he := ((((contDiffAt_const (c := lambda a)).mul hl).add + ((contDiffAt_const (c := r a/2)).mul (hr.log hR))).add + ((contDiffAt_const (c := zeta a-r a)).mul (him.log hq.2.ne'))).sub + ((contDiffAt_const (c := zeta a/2)).mul (hd.log hD)) + exact he.exp + +lemma contDiffOn_vector (a : ℝ) : + ContDiffOn ℝ ∞ (Function.uncurry (vector a)) domain := by + intro q hq + apply ContDiffAt.contDiffWithinAt + have hz : ContDiffAt ℝ ∞ (fun q : State × ℝ => q.1.2.1-(q.2:ℂ)) q := + (contDiffAt_fst.comp q (contDiffAt_snd.comp q contDiffAt_fst)).sub + (Complex.ofRealCLM.contDiff.contDiffAt.comp q contDiffAt_snd) + have hn : q.1.2.1-(q.2:ℂ) ≠ 0 := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + exact hq.2.ne' hi + have hi := hz.inv hn + have hg : ContDiffAt ℝ ∞ (fun q : State × ℝ => -(a:ℂ)/(q.1.2.1-q.2)) q := by + convert! (contDiffAt_const (c := -(a:ℂ))).mul hi using 1 + have hl : ContDiffAt ℝ ∞ (fun q : State × ℝ => a*((q.1.2.1-q.2)⁻¹^2).re) q := + contDiffAt_const.mul (Complex.reCLM.contDiff.contDiffAt.comp q (hi.pow 2)) + exact contDiffAt_const.prodMk (hg.prodMk hl) +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open Cutoff + +def globalVector (a q : ℝ) (x : State) (b : ℝ) : State := + (-1, (-(a:ℂ)*inverse q (x.2.1-b), a*(inverse q (x.2.1-b)^2).re)) + +def bound (a q : ℝ) : ℝ := 1+|a| *q⁻¹+|a| *q⁻¹^2 + +def lipBound (a q : ℝ) : ℝ := |a| *(3/q^2)+|a| *(6/q^3) + +lemma continuous_globalVector {q : ℝ} (hq : 0 < q) (a : ℝ) : + Continuous (Function.uncurry (globalVector a q)) := by + have hi : Continuous (fun x : State × ℝ => inverse q (x.1.2.1-x.2)) := + (lipschitz_inverse hq).continuous.comp + ((continuous_fst.comp (continuous_snd.comp continuous_fst)).sub + (Complex.continuous_ofReal.comp continuous_snd)) + exact continuous_const.prodMk ((continuous_const.mul hi).prodMk + (continuous_const.mul (Complex.continuous_re.comp (hi.pow 2)))) + +lemma norm_globalVector_le {q : ℝ} (hq : 0 < q) (a : ℝ) (x : State) (b : ℝ) : + ‖globalVector a q x b‖ ≤ bound a q := by + have hi := norm_inverse_le hq (x.2.1-b) + have h1 : ‖-(a:ℂ)*inverse q (x.2.1-b)‖ ≤ |a| *q⁻¹ := by + rw [norm_mul,norm_neg,Complex.norm_real,Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_left hi (abs_nonneg _) + have h2 : |a*(inverse q (x.2.1-b)^2).re| ≤ |a| *q⁻¹^2 := by + rw [abs_mul] + apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) + exact (Complex.abs_re_le_norm _).trans (by + rw [norm_pow] + exact pow_le_pow_left₀ (norm_nonneg _) hi 2) + change max ‖(-1:ℝ)‖ (max ‖-(a:ℂ)*inverse q (x.2.1-b)‖ + ‖a*(inverse q (x.2.1-b)^2).re‖) ≤ _ + simp only [Real.norm_eq_abs,abs_neg,abs_one] + apply max_le + · dsimp [bound]; nlinarith [show 0 ≤ |a| *q⁻¹ by positivity,show 0 ≤ |a| *q⁻¹^2 by positivity] + · apply max_le + · exact h1.trans (by dsimp [bound]; nlinarith [show 0 ≤ |a| *q⁻¹^2 by positivity]) + · exact h2.trans (by dsimp [bound]; nlinarith [show 0 ≤ |a| *q⁻¹ by positivity]) + +lemma inverse_sq_sub_le {q : ℝ} (hq : 0 < q) (z w : ℂ) : + ‖inverse q z^2-inverse q w^2‖ ≤ (6/q^3)*‖z-w‖ := by + have hh : inverse q z^2-inverse q w^2 = (inverse q z-inverse q w)*(inverse q z+inverse q w) := by ring + rw [hh,norm_mul] + have hi : ‖inverse q z+inverse q w‖ ≤ 2*q⁻¹ := + (norm_add_le _ _).trans (by linarith [norm_inverse_le hq z,norm_inverse_le hq w]) + have h := mul_le_mul (inverse_sub_bound hq z w) hi (norm_nonneg _) (by positivity) + exact h.trans_eq (by ring) + +lemma globalVector_sub_le {q : ℝ} (hq : 0 < q) (a b : ℝ) (x y : State) : + ‖globalVector a q x b-globalVector a q y b‖ ≤ lipBound a q*‖x-y‖ := by + have hxy : ‖x.2.1-y.2.1‖ ≤ ‖x-y‖ := + (norm_fst_le (x.2-y.2)).trans (norm_snd_le (x-y)) + have hz : x.2.1-(b:ℂ)-(y.2.1-b) = x.2.1-y.2.1 := by abel + have h1 : ‖-(a:ℂ)*inverse q (x.2.1-b)- (-(a:ℂ)*inverse q (y.2.1-b))‖ ≤ + |a| *(3/q^2)*‖x-y‖ := by + rw [← mul_sub,norm_mul,norm_neg,Complex.norm_real,Real.norm_eq_abs] + have h := inverse_sub_bound hq (x.2.1-b) (y.2.1-b) + rw [hz] at h + exact (mul_le_mul_of_nonneg_left h (abs_nonneg _)).trans (by + calc |a| * ((3/q^2)*‖x.2.1-y.2.1‖) = |a| *(3/q^2)*‖x.2.1-y.2.1‖ := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hxy (by positivity)) + have h2 : |a*(inverse q (x.2.1-b)^2).re-a*(inverse q (y.2.1-b)^2).re| ≤ + |a| *(6/q^3)*‖x-y‖ := by + rw [← mul_sub,abs_mul,← Complex.sub_re] + have h := inverse_sq_sub_le hq (x.2.1-b) (y.2.1-b) + rw [hz] at h + exact (mul_le_mul_of_nonneg_left ((Complex.abs_re_le_norm _).trans h) (abs_nonneg _)).trans + (by calc + |a| * ((6/q^3)*‖x.2.1-y.2.1‖) = |a| *(6/q^3)*‖x.2.1-y.2.1‖ := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hxy (by positivity)) + change max ‖(-1:ℝ)-(-1)‖ (max _ ‖a*(inverse q (x.2.1-b)^2).re-a*(inverse q (y.2.1-b)^2).re‖) ≤ _ + simp only [sub_self,norm_zero,Real.norm_eq_abs] + apply max_le + · dsimp [lipBound]; positivity + · apply max_le + · exact h1.trans (by dsimp [lipBound]; nlinarith [norm_nonneg (x-y),show 0 ≤ |a| *(6/q^3) by positivity]) + · exact h2.trans (by dsimp [lipBound]; nlinarith [norm_nonneg (x-y),show 0 ≤ |a| *(3/q^2) by positivity]) + +lemma inverse_eq_of_height {q : ℝ} (hq : 0 < q) (z : ℂ) (b : ℝ) (hz : q ≤ z.im) : + inverse q (z-b) = (z-b)⁻¹ := by + have hqn : q ≤ ‖z-b‖ := hz.trans (by simpa using Complex.im_le_norm (z-b)) + have hsq : q^2 ≤ ‖z-b‖^2 := pow_le_pow_left₀ hq.le hqn 2 + rw [inverse, denominator, max_eq_left hsq,Complex.inv_def] + simp only [Complex.normSq_eq_norm_sq,div_eq_mul_inv,Complex.ofReal_inv,starRingEnd_apply] + +lemma globalVector_eq {q : ℝ} (hq : 0 < q) (a : ℝ) (x : State) (b : ℝ) + (hy : q ≤ x.2.1.im) : globalVector a q x b = vector a x b := by + simp only [globalVector,vector,inverse_eq_of_height hq _ _ hy,div_eq_mul_inv] + +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +def timeClip (T t : ℝ) : ℝ := max 0 (min T t) +lemma continuous_timeClip (T : ℝ) : Continuous (timeClip T) := continuous_const.max (continuous_const.min continuous_id) +lemma timeClip_mem {T : ℝ} (hT : 0 ≤ T) (t : ℝ) : timeClip T t ∈ Icc 0 T := + ⟨le_max_left _ _,max_le hT (min_le_left _ _)⟩ +lemma timeClip_eq {T t : ℝ} (ht : t ∈ Icc 0 T) : timeClip T t = t := + by rw [timeClip,min_eq_right ht.2,max_eq_right ht.1] + +lemma reverse_height_formula {T : ℝ} {y r : ℝ → ℝ} (hT : 0 ≤ T) + (hy : ContinuousOn y (Icc 0 T)) (hr : ContinuousOn r (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt y (r t*y t) (Icc 0 T) t) : + ∀ t ∈ Icc 0 T, y t = y 0 * Real.exp (∫ u in (0:ℝ)..t, r (timeClip T u)) := by + let A (t : ℝ) := ∫ u in (0:ℝ)..t, r (timeClip T u) + have hc : Continuous (fun u => r (timeClip T u)) := + hr.comp_continuous (continuous_timeClip T) (timeClip_mem hT) + have hA (t : ℝ) : HasDerivAt A (r (timeClip T t)) t := + intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + have hA' : Continuous A := continuous_iff_continuousAt.mpr fun t => (hA t).continuousAt + have hd0 (t : ℝ) (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => y u * Real.exp (-A u)) 0 (Icc 0 T) t := by + have he := (hd t ht).mul ((hA t).neg.exp.hasDerivWithinAt) + rw [timeClip_eq ht] at he + convert! he using 1 + first | rfl | ring + have hconst := constant_of_has_deriv_right_zero + (hy.mul ((Real.continuous_exp.comp hA'.neg).continuousOn)) (fun t (ht : t ∈ Ico 0 T) => + (hd0 t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE ht.2) (Icc_subset_Icc_left ht.1))) + intro t ht + have he := hconst t ht + dsimp only [Pi.mul_apply,Function.comp_def,Pi.neg_apply] at he + have hA0 : A 0 = 0 := by simp [A] + rw [hA0,neg_zero,Real.exp_zero,mul_one] at he + calc + y t = (y t * Real.exp (-A t))*Real.exp (A t) := by + rw [mul_assoc,← Real.exp_add,neg_add_cancel,Real.exp_zero,mul_one] + _ = y 0 * Real.exp (A t) := by rw [he] + +lemma reverse_height_le {T : ℝ} {y r : ℝ → ℝ} (hT : 0 ≤ T) + (hy : ContinuousOn y (Icc 0 T)) (hr : ContinuousOn r (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt y (r t*y t) (Icc 0 T) t) + (hy0 : 0 ≤ y 0) (hr0 : ∀ t ∈ Icc 0 T, 0 ≤ r t) (t : ℝ) (ht : t ∈ Icc 0 T) : + y 0 ≤ y t := by + rw [reverse_height_formula hT hy hr hd t ht] + apply le_mul_of_one_le_right hy0 + apply Real.one_le_exp_iff.mpr + apply intervalIntegral.integral_nonneg ht.1 + intro u _ + exact hr0 (timeClip T u) (timeClip_mem hT u) + +lemma globalVector_height (a q : ℝ) (x : State) (b : ℝ) : + (globalVector a q x b).2.1.im = (a/Cutoff.denominator q (x.2.1-b))*x.2.1.im := by + simp [globalVector,Cutoff.inverse,Complex.mul_im,Complex.div_ofReal_im] + ring + +def initial (U y : ℝ) : State := (U, (⟨0,y⟩,0)) +def reverseFlow (a q U y : ℝ) (b : ℝ≥0 → ℝ) : ℝ → State := + ODEPath.flow (globalVector a q) (initial U y) b + +lemma reverseFlow_solution {q : ℝ} (hq : 0 < q) (a U y : ℝ) (b : ℝ≥0 → ℝ) + (hb : Continuous b) {T : ℝ} (hT : 0 ≤ T) : + reverseFlow a q U y b 0 = initial U y ∧ + ∀ t ∈ Icc 0 T, HasDerivWithinAt (reverseFlow a q U y b) + (globalVector a q (reverseFlow a q U y b t) (b t.toNNReal)) (Icc 0 T) t := by + exact ODEPath.flow_solution _ (continuous_globalVector hq a) _ b hb + (by dsimp [bound]; positivity) (by dsimp [lipBound]; positivity) hT + (norm_globalVector_le hq a) (globalVector_sub_le hq a) + +lemma reverseFlow_height {q a y : ℝ} (hq : 0 < q) (ha : 0 ≤ a) (hy : 0 ≤ y) + (U : ℝ) (b : ℝ≥0 → ℝ) (hb : Continuous b) {T : ℝ} (hT : 0 ≤ T) + (t : ℝ) (ht : t ∈ Icc 0 T) : y ≤ (reverseFlow a q U y b t).2.1.im := by + let g := reverseFlow a q U y b + have hg := reverseFlow_solution hq a U y b hb hT + have hc : ContinuousOn g (Icc 0 T) := fun s hs => (hg.2 s hs).continuousWithinAt + let proj : State →L[ℝ] ℝ := Complex.imCLM.comp + ((ContinuousLinearMap.fst ℝ ℂ ℝ).comp (ContinuousLinearMap.snd ℝ ℝ (ℂ × ℝ))) + let r := fun s => a/Cutoff.denominator q ((g s).2.1-b s.toNNReal) + have hd : ∀ s ∈ Icc 0 T, HasDerivWithinAt (fun t => proj (g t)) (r s * proj (g s)) (Icc 0 T) s := by + intro s hs + have hh := proj.hasFDerivAt.comp_hasDerivWithinAt s (hg.2 s hs) + convert! hh using 1 + exact (globalVector_height a q (g s) (b s.toNNReal)).symm + have hr : ContinuousOn r (Icc 0 T) := by + apply continuousOn_const.div + · unfold Cutoff.denominator + exact continuous_max.comp_continuousOn + ((((hc.snd.fst.sub ((Complex.continuous_ofReal.comp + (hb.comp continuous_real_toNNReal)).continuousOn)).norm).pow 2).prodMk continuousOn_const) + · intro s hs; exact (Cutoff.denominator_pos hq _).ne' + have he := reverse_height_le hT (proj.continuous.comp_continuousOn hc) hr hd + (by + change 0 ≤ (reverseFlow a q U y b 0).2.1.im + rw [hg.1] + exact hy) + (fun s hs => div_nonneg ha (Cutoff.denominator_pos hq _).le) t ht + change (reverseFlow a q U y b 0).2.1.im ≤ (reverseFlow a q U y b t).2.1.im at he + rw [hg.1] at he + exact he + +lemma reverseFlow_time {q : ℝ} (hq : 0 < q) (a U y : ℝ) (b : ℝ≥0 → ℝ) + (hb : Continuous b) {T : ℝ} (hT : 0 ≤ T) (t : ℝ) (ht : t ∈ Icc 0 T) : + (reverseFlow a q U y b t).1 = U-t := by + let g := reverseFlow a q U y b + have hg := reverseFlow_solution hq a U y b hb hT + have hc : ContinuousOn g (Icc 0 T) := fun s hs => (hg.2 s hs).continuousWithinAt + have hd : ∀ s ∈ Icc 0 T, HasDerivWithinAt (fun s => (g s).1+s) 0 (Icc 0 T) s := by + intro s hs + have hdg := (ContinuousLinearMap.fst ℝ ℝ (ℂ × ℝ)).hasFDerivAt.comp_hasDerivWithinAt s (hg.2 s hs) + convert! hdg.add (hasDerivWithinAt_id s (Icc 0 T)) using 1 + simp [globalVector] + have he := constant_of_has_deriv_right_zero (hc.fst.add continuousOn_id) + (fun s (hs : s ∈ Ico 0 T) => (hd s ⟨hs.1,hs.2.le⟩).mono_of_mem_nhdsWithin + (Filter.mem_of_superset (Icc_mem_nhdsGE hs.2) (Icc_subset_Icc_left hs.1))) t ht + change (reverseFlow a q U y b t).1+t = (reverseFlow a q U y b 0).1+0 at he + rw [hg.1] at he + change (reverseFlow a q U y b t).1+t = U+0 at he + linarith + +lemma reverseFlow_actual {q a y : ℝ} (hq : 0 < q) (ha : 0 ≤ a) (hy : q ≤ y) + (U : ℝ) (b : ℝ≥0 → ℝ) (hb : Continuous b) {T : ℝ} (hT : 0 ≤ T) : + ∀ t ∈ Icc 0 T, HasDerivWithinAt (reverseFlow a q U y b) + (vector a (reverseFlow a q U y b t) (b t.toNNReal)) (Icc 0 T) t := by + intro t ht + have hg := (reverseFlow_solution hq a U y b hb hT).2 t ht + rw [globalVector_eq hq a _ _ + (hy.trans (reverseFlow_height hq ha (hq.le.trans hy) U b hb hT t ht))] at hg + exact hg +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open _root_.OAI.SLEExactGauge.Localization BrownianCalculus ODEPath RationalStop +open MeasureTheory ProbabilityTheory + +end SLEExactGauge.ReverseDerivative +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/ReverseMoments.lean b/lean/OAI/Probability/SLEGauge/ReverseMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..55da58fd62228da62efef307bf89a447da191cc0 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/ReverseMoments.lean @@ -0,0 +1,484 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ReverseGenerators + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +namespace SLEExactGauge.ReverseDerivative +open _root_.OAI.SLEExactGauge.Localization BrownianCalculus ODEPath RationalStop +open MeasureTheory ProbabilityTheory +theorem expected_stopped_reverse_aux {a : ℝ} (ha : 1/4 < a) + {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + {H : ℝ} (hH : 0 ≤ H) (φ : State × ℝ → ℝ) (hφ : Continuous φ) + (hK : IsCompact {x | φ x ≤ 2}) (hKO : {x | φ x ≤ 2} ⊆ domain) + (v : State → ℝ → State) (hv : Continuous (Function.uncurry v)) + {M L : ℝ} (hM : 0 ≤ M) (hL : 0 ≤ L) + (hbound : ∀ x b, ‖v x b‖ ≤ M) + (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hveq : ∀ x, φ x ≤ 2 → v x.1 x.2 = vector a x.1 x.2) + (z : State) (hz : φ (z,0) < 1) : + let g := fun b : Driver => ODEPath.flow v z b + let τ := fun b : Driver => Exit (fun u => φ (g b u,b u.toNNReal)) 1 H + ∀ t ≥ 0, (∫ b : Driver, test a (g b (min t (τ b))) (b (min t (τ b)).toNNReal) ∂W) ≤ test a z 0 := by + let g := fun b : Driver => ODEPath.flow v z b + let f := fun (b : ℝ≥0 → ℝ) u => φ (ODEPath.flow v z b u,b u.toNNReal) + let τ := fun b : Driver => Exit (f b) 1 H + have hg (b : Driver) := ODEPath.flow_solution v hv z b b.continuous + hM hL (by linarith : 0 ≤ H+1) hbound hlip + have hgc (b : Driver) : ContinuousOn (g b) (Icc 0 (H+1)) := + ODEPath.continuousOn_flow v hv z b b.continuous hM hL (by linarith) hbound hlip + have hfc (b : Driver) : ContinuousOn (f b) (Icc 0 (H+1)) := + hφ.comp_continuousOn ((hgc b).prodMk ((b.continuous.comp continuous_real_toNNReal).continuousOn)) + have hfcH (b : Driver) : ContinuousOn (f b) (Icc 0 H) := + (hfc b).mono (Icc_subset_Icc_right (by linarith)) + have hf0 (b : Driver) : f b 0 < 1 := by + simpa only [f,(hg b).1,Real.toNNReal_zero,map_zero] using hz + have hτ (b : Driver) : 0 ≤ τ b ∧ τ b < H+1 := by + have hb := exit_bounds hH (hfcH b) (R := 1) + exact ⟨hb.1,lt_of_le_of_lt hb.2 (by linarith)⟩ + have hsafe (b : Driver) : ∀ u ∈ Icc 0 (τ b), f b u ≤ 1 := + bound_until_exit hH (hfcH b) (hf0 b) + change ∀ t ≥ 0, (∫ b : Driver, test a (g b (min t (τ b))) (b (min t (τ b)).toNNReal) ∂W) ≤ test a z 0 + intro t ht + let K : Set (State × ℝ) := {q | φ q ≤ 2} + have hDo : IsOpen {q | φ q < 2} := isOpen_lt hφ continuous_const + have hK1 : IsCompact {q | φ q ≤ 1} := + hK.of_isClosed_subset (isClosed_le hφ continuous_const) (fun q hq => by dsimp at *; linarith) + obtain ⟨δ,hδ,hδD⟩ := hK1.exists_thickening_subset_open hDo (fun q hq => by dsimp at *; linarith) + have hD (b : Driver) : ∃ δ > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < δ → (x,b u.toNNReal) ∈ K := by + refine ⟨δ,hδ,?_⟩ + intro u hu x hx + have hi : φ (x,b u.toNNReal) < 2 := hδD (by + apply Metric.mem_thickening_iff.mpr + refine ⟨(g b u,b u.toNNReal),hsafe b u hu,?_⟩ + rw [dist_eq_norm] + change max ‖x-g b u‖ ‖b u.toNNReal-b u.toNNReal‖ < δ + simpa using hx) + exact hi.le + have mf (u : ℝ) : Measurable (fun b : ℝ≥0 → ℝ => f b u) := + hφ.measurable.comp ((ODEPath.measurable_flow v hv.measurable z u).prodMk (measurable_pi_apply _)) + have hfpast : ∀ s ≥ 0, ∀ b c : ℝ≥0 → ℝ, + (∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) → f b s = f c s := by + intro s hs b c hbc + have hb := hbc s.toNNReal (by simpa only [Real.coe_toNNReal',max_eq_left hs] using le_refl s) + simp only [f,ODEPath.flow_past v z hs hbc,hb] + let S : ℝ≥0 → Set ((ℝ≥0 → ℝ) × (State × ℝ)) := fun r => + {q | (r:ℝ) < H ∧ Safe (f q.1) 1 r ∧ q.2 ∈ K} + have mS : ∀ r, MeasurableSet (S r) := by + intro r + exact (MeasurableSet.const _).inter + (((measurableSet_safe f mf 1 _).preimage measurable_fst).inter (hK.measurableSet.preimage measurable_snd)) + have hSpast : ∀ r b c, (∀ u ≤ r, b u = c u) → ∀ x, ((b,x) ∈ S r ↔ (c,x) ∈ S r) := by + intro r b c hbc x + have he : Safe (f b) 1 r ↔ Safe (f c) 1 r := safe_past hfpast r.coe_nonneg + (fun u hu => hbc u hu) + exact and_congr_right fun _ => and_congr_left fun _ => he + have hSeq : ∀ (b : Driver) r x, (((b:ℝ≥0 → ℝ),x) ∈ S r ↔ (r:ℝ) < τ b ∧ x ∈ K) := by + intro b r x + change (_ ∧ _ ∧ _) ↔ (_ ∧ _) + rw [lt_exit_iff hH (hfcH b) r.coe_nonneg] + exact and_assoc.symm + apply expected_stopped_local_grid hW ((Function.uncurry (test a))) K domain hK isOpen_domain hKO (contDiffOn_test a) + v hv.measurable g z hL hM hbound hlip (fun b => (hg b).1) (fun b => (hg b).2) + (fun b => hv.comp_continuousOn ((hgc b).prodMk + ((b.continuous.comp continuous_real_toNNReal).continuousOn))) τ hτ hD + (fun q hq => by rw [hveq q hq]; exact test_generator_nonpos ha (hKO hq).1.le (hKO hq).2 q.2) + S mS hSpast hSeq (fun r q hq => hq.2.2) (by change φ (z,0) ≤ 2; linarith) ht + +theorem expected_stopped_reverseFlow {a q : ℝ} (ha : 1/4 < a) (hq : 0 < q) + {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + {H : ℝ} (hH : 0 ≤ H) (φ : State × ℝ → ℝ) (hφ : Continuous φ) + (hK : IsCompact {x | φ x ≤ 2}) (hKO : {x | φ x ≤ 2} ⊆ domain) + (hyK : ∀ x, φ x ≤ 2 → q ≤ x.1.2.1.im) + (z : State) (hz : φ (z,0) < 1) : + let g := fun b : Driver => ODEPath.flow (globalVector a q) z b + let τ := fun b : Driver => Exit (fun u => φ (g b u,b u.toNNReal)) 1 H + ∀ t ≥ 0, (∫ b : Driver, test a (g b (min t (τ b))) (b (min t (τ b)).toNNReal) ∂W) ≤ test a z 0 := by + exact expected_stopped_reverse_aux ha hW hH φ hφ hK hKO (globalVector a q) + (continuous_globalVector hq a) (by dsimp [bound]; positivity) + (by dsimp [lipBound]; positivity) (norm_globalVector_le hq a) (globalVector_sub_le hq a) + (fun x hx => globalVector_eq hq a _ _ (hyK x hx)) z hz +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open MeasureTheory ProbabilityTheory BrownianCalculus RationalStop + +def exhaustion (q : ℝ) (n : ℕ) (x : State × ℝ) : ℝ := + max (‖x‖/((n:ℝ)+1)) (max (3-((n:ℝ)+1)*x.1.1) (3-x.1.2.1.im/q)) + +lemma continuous_exhaustion (q : ℝ) (n : ℕ) : Continuous (exhaustion q n) := by + unfold exhaustion + fun_prop + +lemma exhaustion_compact (q : ℝ) (n : ℕ) : IsCompact {x | exhaustion q n x ≤ 2} := by + apply (isCompact_closedBall (0 : State × ℝ) (2*((n:ℝ)+1))).of_isClosed_subset + (isClosed_le (continuous_exhaustion q n) continuous_const) + intro x hx + have h : ‖x‖/((n:ℝ)+1) ≤ 2 := (le_max_left _ _).trans hx + rw [mem_closedBall,dist_zero_right] + exact (div_le_iff₀ (by positivity : 0 < (n:ℝ)+1)).mp h + +lemma exhaustion_height {q : ℝ} (hq : 0 < q) (n : ℕ) {x : State × ℝ} + (hx : exhaustion q n x ≤ 2) : q ≤ x.1.2.1.im := by + have h : 3-x.1.2.1.im/q ≤ 2 := + (le_max_right _ _).trans ((le_max_right _ _).trans hx) + have hi : 1 ≤ x.1.2.1.im/q := by linarith + simpa using (le_div_iff₀ hq).mp hi + +lemma exhaustion_domain {q : ℝ} (hq : 0 < q) (n : ℕ) : + {x | exhaustion q n x ≤ 2} ⊆ domain := by + intro x hx + refine ⟨?_,hq.trans_le (exhaustion_height hq n hx)⟩ + have h : 3-((n:ℝ)+1)*x.1.1 ≤ 2 := + (le_max_left _ _).trans ((le_max_right _ _).trans hx) + have hn : 0 < (n:ℝ)+1 := by positivity + nlinarith + +lemma exhaustion_lt {q : ℝ} (hq : 0 < q) (n : ℕ) {x : State × ℝ} + (hn : ‖x‖ < (n:ℝ)+1) (hu : 2 < ((n:ℝ)+1)*x.1.1) (hy : 2*q < x.1.2.1.im) : + exhaustion q n x < 1 := by + apply max_lt + · exact (div_lt_one (by positivity)).mpr hn + · apply max_lt + · linarith + · have hi := (lt_div_iff₀ hq).mpr hy + linarith + +lemma eventually_exhaustion_lt {q δ : ℝ} (hq : 0 < q) (hδ : 0 < δ) + {T : ℝ} (_hT : 0 ≤ T) (f : ℝ → State × ℝ) (hf : ContinuousOn f (Icc 0 T)) + (hu : ∀ t ∈ Icc 0 T, δ ≤ (f t).1.1) + (hy : ∀ t ∈ Icc 0 T, 2*q < (f t).1.2.1.im) : + ∀ᶠ n : ℕ in atTop, ∀ t ∈ Icc 0 T, exhaustion q n (f t) < 1 := by + obtain ⟨C,hC⟩ := (isCompact_Icc : IsCompact (Icc (0:ℝ) T)).exists_bound_of_continuousOn hf + obtain ⟨N,hN⟩ := exists_nat_gt (max C (2/δ)) + filter_upwards [eventually_ge_atTop N] with n hn + intro t ht + have hnN : (N:ℝ) ≤ n := by exact_mod_cast hn + have hnC : C < (n:ℝ)+1 := by linarith [le_max_left C (2/δ)] + have hnδ : 2/δ < (n:ℝ)+1 := by linarith [le_max_right C (2/δ)] + apply exhaustion_lt hq n ((hC t ht).trans_lt hnC) _ (hy t ht) + have hi : 2 < ((n:ℝ)+1)*δ := (div_lt_iff₀ hδ).mp hnδ + exact hi.trans_le (mul_le_mul_of_nonneg_left (hu t ht) (by positivity)) + +lemma measurable_test (a : ℝ) : Measurable (Function.uncurry (test a)) := by + change Measurable (fun x : State × ℝ => Real.exp + (lambda a*x.1.2.2+r a/2*Real.log ((x.1.2.1.re-x.2)^2+x.1.2.1.im^2)+ + (zeta a-r a)*Real.log x.1.2.1.im-zeta a/2*Real.log + (((x.1.2.1.re-x.2)^2+x.1.2.1.im^2)+x.1.1/2))) + fun_prop + +lemma test_pos (a : ℝ) (x : State) (b : ℝ) : 0 < test a x b := Real.exp_pos _ + +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open MeasureTheory ProbabilityTheory BrownianCalculus RationalStop + +def driven (a q : ℝ) (z : State) (b : Driver) (t : ℝ) : State × ℝ := + (ODEPath.flow (globalVector a q) z b t,b t.toNNReal) + +lemma measurable_driven {q : ℝ} (hq : 0 < q) (a : ℝ) (z : State) (t : ℝ) : + Measurable (fun b : Driver => driven a q z b t) := by + have mb : Measurable (fun b : Driver => (b : ℝ≥0 → ℝ)) := + Measurable.of_eval fun time => (show Continuous (fun driver : Driver => driver time) from continuous_eval_const time).measurable + exact ((ODEPath.measurable_flow _ (continuous_globalVector hq a).measurable z t).comp mb).prodMk + (show Continuous (fun b : Driver => b t.toNNReal) from continuous_eval_const _).measurable + +lemma continuousOn_driven {q T : ℝ} (hq : 0 < q) (hT : 0 ≤ T) (a : ℝ) (z : State) (b : Driver) : + ContinuousOn (driven a q z b) (Icc 0 T) := by + exact (ODEPath.continuousOn_flow _ (continuous_globalVector hq a) z b b.continuous + (by dsimp [bound]; positivity) (by dsimp [lipBound]; positivity) hT + (norm_globalVector_le hq a) (globalVector_sub_le hq a)).prodMk + ((b.continuous.comp continuous_real_toNNReal).continuousOn) + +lemma exit_eq_horizon {f : ℝ → ℝ} {T : ℝ} (hT : 0 ≤ T) + (hf : ContinuousOn f (Icc 0 T)) (hs : ∀ t ∈ Icc 0 T, f t < 1) : Exit f 1 T = T := by + have hb := exit_bounds hT hf (R := 1) + apply le_antisymm hb.2 + by_contra hn + have he : Exit f 1 T < T := lt_of_not_ge hn + have hs' : Safe f 1 (Exit f 1 T) := (safe_iff hb.1 + (hf.mono (Icc_subset_Icc_right hb.2))).mpr (fun t ht => hs t ⟨ht.1,ht.2.trans hb.2⟩) + exact lt_irrefl _ ((lt_exit_iff hT hf hb.1).mpr ⟨he,hs'⟩) + +lemma stopped_test_integrable {q : ℝ} (hq : 0 < q) (a : ℝ) + {W : Measure Driver} [IsFiniteMeasure W] {T : ℝ} (hT : 0 ≤ T) + (φ : State × ℝ → ℝ) (hφ : Continuous φ) + (hK : IsCompact {x | φ x ≤ 2}) (hKO : {x | φ x ≤ 2} ⊆ domain) + (z : State) (hz : φ (z,0) < 1) : + Integrable (fun b : Driver => test a + (driven a q z b (Exit (fun u => φ (driven a q z b u)) 1 T)).1 + (driven a q z b (Exit (fun u => φ (driven a q z b u)) 1 T)).2) W := by + let f := fun (b : Driver) u => φ (driven a q z b u) + let τ := fun b => Exit (f b) 1 T + have hfc (b : Driver) : ContinuousOn (f b) (Icc 0 T) := + hφ.comp_continuousOn (continuousOn_driven hq hT a z b) + have mτ : Measurable τ := measurable_exit hT + (fun u => hφ.measurable.comp (measurable_driven hq a z u)) hfc + have hτ (b : Driver) : τ b ∈ Icc 0 T := exit_bounds hT (hfc b) + have md : Measurable (fun b => driven a q z b (τ b)) := measurable_stopped_eval hT + (measurable_driven hq a z) (continuousOn_driven hq hT a z) mτ hτ + have hf0 (b : Driver) : f b 0 < 1 := by + have hg := ODEPath.flow_solution (globalVector a q) (continuous_globalVector hq a) z b b.continuous + (by dsimp [bound]; positivity) (by dsimp [lipBound]; positivity) hT + (norm_globalVector_le hq a) (globalVector_sub_le hq a) + simpa only [f,driven,hg.1,Real.toNNReal_zero,map_zero] using hz + have hsafe (b : Driver) : driven a q z b (τ b) ∈ {x | φ x ≤ 2} := by + have hb := bound_until_exit hT (hfc b) (hf0 b) (τ b) ⟨(hτ b).1,le_rfl⟩ + change f b (τ b) ≤ 2 + linarith + obtain ⟨C,hC⟩ := hK.exists_bound_of_continuousOn ((contDiffOn_test a).continuousOn.mono hKO) + exact Integrable.of_bound ((measurable_test a).comp md).aestronglyMeasurable C + (ae_of_all _ fun b => hC _ (hsafe b)) + +lemma lintegral_of_eventually_stopped {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (f : ℕ → Ω → ℝ) (hf : ∀ n, Integrable (f n) μ) (hpos : ∀ n x, 0 ≤ f n x) + (F : Ω → ℝ) (hlim : ∀ x, ∀ᶠ n in atTop, f n x = F x) + (C : ℝ) (he : ∀ n, (∫ x, f n x ∂μ) ≤ C) : + (∫⁻ x, ENNReal.ofReal (F x) ∂μ) ≤ ENNReal.ofReal C := by + have hl (x : Ω) : liminf (fun n => ENNReal.ofReal (f n x)) atTop = ENNReal.ofReal (F x) := + (tendsto_const_nhds.congr' ((hlim x).mono fun n hn => congrArg ENNReal.ofReal hn.symm)).liminf_eq + calc (∫⁻ x, ENNReal.ofReal (F x) ∂μ) + = ∫⁻ x, liminf (fun n => ENNReal.ofReal (f n x)) atTop ∂μ := by simp only [hl] + _ ≤ liminf (fun n => ∫⁻ x, ENNReal.ofReal (f n x) ∂μ) atTop := + lintegral_liminf_le' fun n => (hf n).aestronglyMeasurable.aemeasurable.ennreal_ofReal + _ ≤ liminf (fun _ : ℕ => ENNReal.ofReal C) atTop := by + refine Filter.liminf_le_liminf ?_ + filter_upwards [] with n + rw [← ofReal_integral_eq_lintegral_ofReal (hf n) (ae_of_all _ (hpos n))] + exact ENNReal.ofReal_le_ofReal (he n) + _ = ENNReal.ofReal C := tendsto_const_nhds.liminf_eq +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open MeasureTheory ProbabilityTheory BrownianCalculus RationalStop + + + +theorem reverse_supersolution_bound {a y δ T : ℝ} (ha : 1/4 < a) + (hy : 0 < y) (hδ : 0 < δ) (hT : 0 ≤ T) + {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) : + (∫⁻ b : Driver, ENNReal.ofReal + (test a (reverseFlow a (y/4) (T+δ) y b T) (b T.toNNReal)) ∂W) ≤ + ENNReal.ofReal (test a (initial (T+δ) y) 0) := by + let := hW.isGaussianProcess.isProbabilityMeasure + let q := y/4 + let z := initial (T+δ) y + have hq : 0 < q := by dsimp [q]; positivity + have ha0 : 0 ≤ a := by linarith + have hi : ∀ᶠ n : ℕ in atTop, exhaustion q n (z,0) < 1 := by + have hh := eventually_exhaustion_lt hq hδ (T := 0) le_rfl (fun _ => (z,0)) + continuousOn_const (fun t ht => by change δ ≤ T+δ; linarith) + (fun t ht => by change 2*(y/4) < y; linarith) + filter_upwards [hh] with n hn + exact hn 0 ⟨le_rfl,le_rfl⟩ + obtain ⟨N,hN⟩ := eventually_atTop.mp hi + let φ := fun n => exhaustion q (n+N) + have hφ0 (n : ℕ) : φ n (z,0) < 1 := hN (n+N) (by omega) + let τ := fun n (b : Driver) => Exit (fun u => φ n (driven a q z b u)) 1 T + let f := fun n (b : Driver) => test a (driven a q z b (τ n b)).1 (driven a q z b (τ n b)).2 + have hτ (n : ℕ) (b : Driver) : τ n b ∈ Icc 0 T := exit_bounds hT + ((continuous_exhaustion q (n+N)).comp_continuousOn (continuousOn_driven hq hT a z b)) + have hf (n : ℕ) : Integrable (f n) W := stopped_test_integrable hq a hT (φ n) + (continuous_exhaustion q (n+N)) (exhaustion_compact q (n+N)) (exhaustion_domain hq (n+N)) z (hφ0 n) + have he (n : ℕ) : (∫ b, f n b ∂W) ≤ test a z 0 := by + have hh := expected_stopped_reverseFlow ha hq hW hT (φ n) (continuous_exhaustion q (n+N)) + (exhaustion_compact q (n+N)) (exhaustion_domain hq (n+N)) + (fun x hx => exhaustion_height hq (n+N) hx) z (hφ0 n) T hT + have heq (b : Driver) : min T (τ n b) = τ n b := min_eq_right (hτ n b).2 + change (∫ b : Driver, test a (ODEPath.flow (globalVector a q) z b (min T (τ n b))) + (b (min T (τ n b)).toNNReal) ∂W) ≤ test a z 0 at hh + simpa only [heq,f,driven] using hh + have hlim (b : Driver) : ∀ᶠ n in atTop, + f n b = test a (reverseFlow a q (T+δ) y b T) (b T.toNNReal) := by + have hh := eventually_exhaustion_lt hq hδ hT (driven a q z b) + (continuousOn_driven hq hT a z b) + (fun t ht => by + change δ ≤ (reverseFlow a q (T+δ) y b t).1 + rw [reverseFlow_time hq a (T+δ) y b b.continuous hT t ht] + linarith [ht.2]) + (fun t ht => by + have hb := reverseFlow_height hq ha0 hy.le (T+δ) b b.continuous hT t ht + change 2*q < (reverseFlow a q (T+δ) y b t).2.1.im + dsimp [q] + linarith) + obtain ⟨K,hK⟩ := eventually_atTop.mp hh + filter_upwards [eventually_ge_atTop K] with n hn + have hexit : τ n b = T := exit_eq_horizon hT + ((continuous_exhaustion q (n+N)).comp_continuousOn (continuousOn_driven hq hT a z b)) + (hK (n+N) (by omega)) + simp only [f,hexit,driven] + rfl + exact lintegral_of_eventually_stopped W f hf (fun n b => (test_pos a _ _).le) + (fun b => test a (reverseFlow a q (T+δ) y b T) (b T.toNNReal)) hlim (test a z 0) he +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative + +lemma r_sub_zeta_pos {a : ℝ} (ha : 1/4 < a) : 0 < r a-zeta a := by + have ha0 : 0 < a := by linarith + have he : r a-zeta a = a+1/2+1/(16*a) := by unfold r zeta; ring + rw [he] + positivity + +lemma exp_logderiv_le_test {a : ℝ} (ha : 1/4 < a) (v : State) (b : ℝ) + (hu : 0 ≤ v.1) (hy : 0 < v.2.1.im) (huy : v.1 ≤ v.2.1.im^2) : + Real.exp (lambda a*v.2.2) ≤ Real.exp (zeta a/2*Real.log (3/2))*test a v b := by + let x := v.2.1.re-b + let y := v.2.1.im + have hR := R_pos x hy + have hD := D_pos hu hy x + have hlogR : 2*Real.log y ≤ Real.log (R x y) := by + have hh := Real.log_le_log (sq_pos_of_pos hy) (show y^2 ≤ R x y from by unfold R; nlinarith [sq_nonneg x]) + simpa only [Real.log_pow,Nat.cast_ofNat] using hh + have hlogD : Real.log (D v.1 x y) ≤ Real.log (R x y)+Real.log (3/2) := by + have hle : D v.1 x y ≤ R x y*(3/2) := by + dsimp [D,R,x,y] + nlinarith [sq_nonneg (v.2.1.re-b)] + have hh := Real.log_le_log hD hle + rwa [Real.log_mul hR.ne' (by norm_num : (3/2:ℝ) ≠ 0)] at hh + have hz := (parameters ha).1 + have hrz := r_sub_zeta_pos ha + have h1 := mul_nonneg hrz.le (sub_nonneg.mpr hlogR) + have h2 := mul_nonneg hz.le (sub_nonneg.mpr hlogD) + unfold test F + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + change lambda a*v.2.2 ≤ zeta a/2*Real.log (3/2)+H a v.1 x y v.2.2 + unfold H + nlinarith + +lemma initial_test_scale (a : ℝ) {y T : ℝ} (hy : 0 < y) (hT : 0 ≤ T) : + Real.exp (zeta a/2*Real.log (3/2))*test a (initial (T+y^2) y) 0 = + (3*y^2/(T+3*y^2))^(zeta a/2) := by + have hy2 : 0 < y^2 := sq_pos_of_pos hy + have hD : 0 < y^2+(T+y^2)/2 := by positivity + have hden : 0 < T+3*y^2 := by positivity + have hrat : 0 < 3*y^2/(T+3*y^2) := by positivity + have he : 3*y^2/(T+3*y^2) = ((3/2:ℝ)*y^2)/(y^2+(T+y^2)/2) := by + field_simp + ring + rw [Real.rpow_def_of_pos hrat,he, + Real.log_div (mul_ne_zero (by norm_num) hy2.ne') hD.ne', + Real.log_mul (by norm_num : (3/2:ℝ) ≠ 0) hy2.ne',Real.log_pow] + simp only [test,initial,F,H,D,R,sub_zero,zero_pow (by omega : (2:ℕ) ≠ 0),zero_add,mul_zero,zero_add] + rw [← Real.exp_add,Real.log_pow] + congr 1 + ring +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative +open MeasureTheory ProbabilityTheory BrownianCalculus + + + +theorem reverse_logderiv_moment {a y T : ℝ} (ha : 1/4 < a) + (hy : 0 < y) (hT : 0 ≤ T) + {W : Measure Driver} (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) : + (∫⁻ b : Driver, ENNReal.ofReal (Real.exp + (lambda a*(reverseFlow a (y/4) (T+y^2) y b T).2.2)) ∂W) ≤ + ENNReal.ofReal ((3*y^2/(T+3*y^2))^(zeta a/2)) := by + let C := Real.exp (zeta a/2*Real.log (3/2)) + let g := fun (b : Driver) => reverseFlow a (y/4) (T+y^2) y b T + have hq : 0 < y/4 := by positivity + have htime (b : Driver) : (g b).1 = y^2 := by + dsimp [g] + rw [reverseFlow_time hq a (T+y^2) y b b.continuous hT T ⟨hT,le_rfl⟩] + ring + have hheight (b : Driver) : y ≤ (g b).2.1.im := + reverseFlow_height hq (by linarith) hy.le (T+y^2) b b.continuous hT T ⟨hT,le_rfl⟩ + have hpoint (b : Driver) : Real.exp (lambda a*(g b).2.2) ≤ C*test a (g b) (b T.toNNReal) := by + apply exp_logderiv_le_test ha _ _ + · rw [htime]; positivity + · exact hy.trans_le (hheight b) + · rw [htime] + nlinarith [hheight b] + calc (∫⁻ b : Driver, ENNReal.ofReal (Real.exp (lambda a*(g b).2.2)) ∂W) + ≤ ∫⁻ b : Driver, ENNReal.ofReal (C*test a (g b) (b T.toNNReal)) ∂W := + lintegral_mono fun b => ENNReal.ofReal_le_ofReal (hpoint b) + _ = ENNReal.ofReal C*(∫⁻ b : Driver, ENNReal.ofReal (test a (g b) (b T.toNNReal)) ∂W) := by + simp only [ENNReal.ofReal_mul (show 0 ≤ C from (Real.exp_pos _).le)] + exact lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal C*ENNReal.ofReal (test a (initial (T+y^2) y) 0) := + mul_le_mul' le_rfl (reverse_supersolution_bound ha hy (sq_pos_of_pos hy) hT hW) + _ = ENNReal.ofReal ((3*y^2/(T+3*y^2))^(zeta a/2)) := by + rw [← ENNReal.ofReal_mul (show 0 ≤ C from (Real.exp_pos _).le)] + exact congrArg ENNReal.ofReal (initial_test_scale a hy hT) +end SLEExactGauge.ReverseDerivative + +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero + +noncomputable section +namespace SLEExactGauge.BrownianRestart + +abbrev Driver := C(ℝ≥0, ℝ)₀ +instance : MeasurableSpace Driver := borel Driver +instance : BorelSpace Driver := ⟨rfl⟩ +instance : PolishSpace Driver := ContinuousMapZero.isClosedEmbedding_toContinuousMap.polishSpace + +def code (b : Driver) : ℚ → ℝ := fun q => b (Real.toNNReal (q:ℝ)) + +lemma measurable_code : Measurable code := + Measurable.of_eval fun _ => (continuous_eval_const _).measurable + +lemma dense_rational_time : DenseRange (fun q : ℚ => Real.toNNReal (q:ℝ)) := by + have hd : Surjective Real.toNNReal := fun x => ⟨(x:ℝ),Real.toNNReal_coe⟩ + exact hd.denseRange.comp Rat.denseRange_cast continuous_real_toNNReal + +lemma code_injective : Injective code := by + intro b c h + apply ContinuousMapZero.ext + have he := dense_rational_time.equalizer (map_continuous b) (map_continuous c) h + exact congrFun he + +lemma code_embedding : MeasurableEmbedding code := measurable_code.measurableEmbedding code_injective + +end SLEExactGauge.BrownianRestart +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/RiemannIntegrals.lean b/lean/OAI/Probability/SLEGauge/RiemannIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..088a23abc1482ebfa45839fbc1eb4c4c6d15af0b --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/RiemannIntegrals.lean @@ -0,0 +1,401 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StochasticCalculus + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +namespace ExactSLEGenerator +lemma riemann_sum_tendsto (f : ℝ → ℝ) (hf : Continuous f) (T : ℝ) (hT : 0 ≤ T) : + Tendsto (fun n : ℕ => ∑ i ∈ Finset.range (n+1), + (T / (n+1 : ℕ)) * f ((i : ℝ)*(T / (n+1 : ℕ)))) atTop + (𝓝 (∫ s in 0..T, f s)) := by + by_cases hT0 : T = 0 + · subst T + simp + have hTp : 0 < T := lt_of_le_of_ne hT (Ne.symm hT0) + have hu := (isCompact_Icc : IsCompact (Set.Icc 0 T)).uniformContinuousOn_of_continuous hf.continuousOn + rw [Metric.uniformContinuousOn_iff] at hu + have hmesh : Tendsto (fun n : ℕ => T / (n+1 : ℕ)) atTop (𝓝 0) := by + have hh : Tendsto (fun n : ℕ => (n+1 : ℕ)) atTop atTop := + tendsto_add_atTop_nat 1 + simpa using tendsto_const_nhds.div_atTop (tendsto_natCast_atTop_atTop.comp hh) + apply Metric.tendsto_nhds.mpr + intro ε hε + obtain ⟨δ, hδ, huδ⟩ := hu (ε/(2*T)) (by positivity) + filter_upwards [hmesh.eventually_lt_const hδ] with n hn + rw [Real.dist_eq] + have he := riemann_sum_error_le f hf T hT (n+1) (Nat.succ_pos _) (ε/(2*T)) + (by positivity) (by + intro u hu v hv huv + exact le_of_lt (huδ u hu v hv (by simpa only [Real.dist_eq] using huv.trans_lt hn))) + calc + _ ≤ ε / (2*T) * T := he + _ = ε / 2 := by field_simp + _ < ε := by linarith + +lemma riemann_sum_bound (f : ℝ → ℝ) (T K : ℝ) (hT : 0 ≤ T) (N : ℕ) (hN : 0 < N) + (hbound : ∀ t ∈ Set.Icc 0 T, |f t| ≤ K) : + |∑ i ∈ Finset.range N, (T/N)*f ((i : ℝ)*(T/N))| ≤ K*T := by + have hNr : 0 < (N : ℝ) := by exact_mod_cast hN + have hh : 0 ≤ T / N := div_nonneg hT hNr.le + have hNh : (N : ℝ) * (T / N) = T := by field_simp + calc + _ ≤ ∑ i ∈ Finset.range N, |(T/N)*f ((i : ℝ)*(T/N))| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ _i ∈ Finset.range N, (T/N)*K := by + apply Finset.sum_le_sum + intro i hi + rw [abs_mul, abs_of_nonneg hh] + apply mul_le_mul_of_nonneg_left _ hh + apply hbound + refine ⟨by positivity, ?_⟩ + calc + _ ≤ (N : ℝ)*(T/N) := mul_le_mul_of_nonneg_right + (by exact_mod_cast (Finset.mem_range.mp hi).le) hh + _ = T := hNh + _ = K*((N : ℝ)*(T/N)) := by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; ring + _ = K*T := by rw [hNh] + +lemma expected_riemann_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] + (W : Measure Ω) [IsFiniteMeasure W] (f : ℝ → Ω → ℝ) + (hf : ∀ b, Continuous (fun t => f t b)) + (hm : ∀ t, AEStronglyMeasurable (f t) W) + (T K : ℝ) (hT : 0 ≤ T) + (hbound : ∀ b t, t ∈ Set.Icc 0 T → |f t b| ≤ K) : + Tendsto (fun n : ℕ => ∫ b, ∑ i ∈ Finset.range (n+1), + (T/(n+1 : ℕ))*f ((i : ℝ)*(T/(n+1 : ℕ))) b ∂W) atTop + (𝓝 (∫ b, (∫ t in 0..T, f t b) ∂W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => K*T) + · intro n + have hs := Finset.aestronglyMeasurable_sum + (Finset.range (n+1)) (fun i hi => + (hm ((i : ℝ)*(T/(n+1 : ℕ)))).const_mul (T/(n+1 : ℕ))) + convert hs using 1 + funext b + simp only [Finset.sum_apply] + · exact integrable_const _ + · intro n + refine ae_of_all W ?_ + intro b + simpa only [Real.norm_eq_abs] using + riemann_sum_bound (fun t => f t b) T K hT (n+1) (Nat.succ_pos _) (hbound b) + · exact ae_of_all W (fun b => riemann_sum_tendsto (fun t => f t b) (hf b) T hT) + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +lemma stieltjes_riemann_error_le (D : ℝ → E →L[ℝ] ℝ) (a : ℝ → E) + (ha : Continuous a) (T M ε : ℝ) (hT : 0 ≤ T) (hM : 0 ≤ M) + (N : ℕ) (hN : 0 < N) + (hbound : ∀ t ∈ Set.Icc 0 T, ‖D t‖ ≤ M) + (hmod : ∀ u ∈ Set.Icc 0 T, ∀ v ∈ Set.Icc 0 T, + |u-v| ≤ T/N → ‖a u-a v‖ ≤ ε) : + |(∑ i ∈ Finset.range N, D ((i : ℝ)*(T/N)) + (∫ s in (i : ℝ)*(T/N)..((i+1 : ℕ) : ℝ)*(T/N), a s)) - + ∑ i ∈ Finset.range N, (T/N) * D ((i : ℝ)*(T/N)) (a ((i : ℝ)*(T/N)))| ≤ M*ε*T := by + let h := T / (N : ℝ) + have hNr : 0 < (N : ℝ) := by exact_mod_cast hN + have hh : 0 ≤ h := div_nonneg hT hNr.le + have hNh : (N : ℝ) * h = T := by dsimp [h]; field_simp + have hdiff (i : ℕ) : ((i+1 : ℕ) : ℝ)*h-(i : ℝ)*h = h := by push_cast; ring + have he (i : ℕ) (hi : i < N) : + |D ((i : ℝ)*h) (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s) - + h * D ((i : ℝ)*h) (a ((i : ℝ)*h))| ≤ M*ε*h := by + have hai : (i : ℝ)*h ∈ Set.Icc 0 T := by + refine ⟨by positivity, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi.le) hh + have hbi : ((i+1 : ℕ) : ℝ)*h ∈ Set.Icc 0 T := by + refine ⟨by positivity, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi) hh + have hab : (i : ℝ)*h ≤ ((i+1 : ℕ) : ℝ)*h := by linarith [hdiff i] + have hpt : ∀ s ∈ Set.uIoc ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h), + ‖D ((i : ℝ)*h) (a s-a ((i : ℝ)*h))‖ ≤ M*ε := by + intro s hs + rw [Set.uIoc_of_le hab] at hs + have has : ‖a s - a ((i : ℝ)*h)‖ ≤ ε := by + apply hmod s ⟨hai.1.trans hs.1.le, hs.2.trans hbi.2⟩ _ hai + rw [abs_of_nonneg (sub_nonneg.mpr hs.1.le)] + linarith [hs.2, hdiff i] + calc + _ ≤ ‖D ((i : ℝ)*h)‖ * ‖a s-a ((i : ℝ)*h)‖ := (D _).le_opNorm _ + _ ≤ M * ‖a s-a ((i : ℝ)*h)‖ := mul_le_mul_of_nonneg_right (hbound _ hai) (norm_nonneg _) + _ ≤ M*ε := mul_le_mul_of_nonneg_left has hM + have hi₁ := ((D ((i : ℝ)*h)).continuous.comp ha).intervalIntegrable + (μ := volume) ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h) + simp only [Function.comp_def] at hi₁ + have hi₂ : IntervalIntegrable (fun _ : ℝ => D ((i : ℝ)*h) (a ((i : ℝ)*h))) volume + ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h) := intervalIntegrable_const + have hval : (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, + D ((i : ℝ)*h) (a s-a ((i : ℝ)*h))) = + D ((i : ℝ)*h) (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s) - + h * D ((i : ℝ)*h) (a ((i : ℝ)*h)) := by + simp only [map_sub] + rw [intervalIntegral.integral_sub hi₁ hi₂, + (D _).intervalIntegral_comp_comm (ha.intervalIntegrable _ _), + intervalIntegral.integral_const, hdiff, smul_eq_mul] + have hb := intervalIntegral.norm_integral_le_of_norm_le_const hpt + rw [hval, Real.norm_eq_abs, hdiff, abs_of_nonneg hh] at hb + exact hb + change |(∑ i ∈ Finset.range N, D ((i : ℝ)*h) + (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s)) - + ∑ i ∈ Finset.range N, h*D ((i : ℝ)*h) (a ((i : ℝ)*h))| ≤ _ + rw [← Finset.sum_sub_distrib] + calc + _ ≤ ∑ i ∈ Finset.range N, |D ((i : ℝ)*h) + (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s) - + h*D ((i : ℝ)*h) (a ((i : ℝ)*h))| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ _i ∈ Finset.range N, M*ε*h := Finset.sum_le_sum fun i hi => he i (Finset.mem_range.mp hi) + _ = M*ε*((N : ℝ)*h) := by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; ring + _ = M*ε*T := by rw [hNh] + +lemma stieltjes_sum_tendsto (D : ℝ → E →L[ℝ] ℝ) (a : ℝ → E) + (hD : Continuous D) (ha : Continuous a) (T M : ℝ) (hT : 0 ≤ T) (hM : 0 ≤ M) + (hbound : ∀ t ∈ Set.Icc 0 T, ‖D t‖ ≤ M) : + Tendsto (fun n : ℕ => ∑ i ∈ Finset.range (n+1), D ((i : ℝ)*(T/(n+1 : ℕ))) + (∫ s in (i : ℝ)*(T/(n+1 : ℕ))..((i+1 : ℕ) : ℝ)*(T/(n+1 : ℕ)), a s)) atTop + (𝓝 (∫ t in 0..T, D t (a t))) := by + let S := fun n : ℕ => ∑ i ∈ Finset.range (n+1), D ((i : ℝ)*(T/(n+1 : ℕ))) + (∫ s in (i : ℝ)*(T/(n+1 : ℕ))..((i+1 : ℕ) : ℝ)*(T/(n+1 : ℕ)), a s) + let R := fun n : ℕ => ∑ i ∈ Finset.range (n+1), (T/(n+1 : ℕ)) * + D ((i : ℝ)*(T/(n+1 : ℕ))) (a ((i : ℝ)*(T/(n+1 : ℕ)))) + have hR : Tendsto R atTop (𝓝 (∫ t in 0..T, D t (a t))) := + riemann_sum_tendsto (fun t => D t (a t)) (hD.clm_apply ha) T hT + have hdiff : Tendsto (fun n => S n-R n) atTop (𝓝 0) := by + have hu := (isCompact_Icc : IsCompact (Set.Icc 0 T)).uniformContinuousOn_of_continuous ha.continuousOn + rw [Metric.uniformContinuousOn_iff] at hu + have hmesh : Tendsto (fun n : ℕ => T/(n+1 : ℕ)) atTop (𝓝 0) := + (tendsto_const_div_atTop_nhds_zero_nat T).comp (tendsto_add_atTop_nat 1) + apply Metric.tendsto_nhds.mpr + intro ε hε + have hh : 0 < M*T+1 := by positivity + have hep : 0 < ε / (2*(M*T+1)) := by positivity + obtain ⟨δ, hδ, huδ⟩ := hu (ε/(2*(M*T+1))) hep + filter_upwards [hmesh.eventually_lt_const hδ] with n hn + have herror := stieltjes_riemann_error_le D a ha T M (ε/(2*(M*T+1))) hT hM + (n+1) (Nat.succ_pos _) hbound (by + intro u hu v hv huv + have hub := huδ u hu v hv (by simpa only [Real.dist_eq] using huv.trans_lt hn) + exact le_of_lt (by simpa only [dist_eq_norm] using hub)) + rw [Real.dist_eq, sub_zero] + change |S n-R n| ≤ _ at herror + calc + _ ≤ M*(ε/(2*(M*T+1)))*T := herror + _ ≤ (ε/(2*(M*T+1)))*(M*T+1) := by nlinarith [hep.le] + _ = ε/2 := by field_simp + _ < ε := by linarith + have hh := hdiff.add hR + simpa only [sub_add_cancel, zero_add] using hh + +omit [CompleteSpace E] in +lemma stieltjes_sum_bound (D : ℝ → E →L[ℝ] ℝ) (a : ℝ → E) + (T M K : ℝ) (hT : 0 ≤ T) (hM : 0 ≤ M) (_hK : 0 ≤ K) + (N : ℕ) (hN : 0 < N) + (hD : ∀ t ∈ Set.Icc 0 T, ‖D t‖ ≤ M) + (ha : ∀ t ∈ Set.Icc 0 T, ‖a t‖ ≤ K) : + |∑ i ∈ Finset.range N, D ((i : ℝ)*(T/N)) + (∫ s in (i : ℝ)*(T/N)..((i+1 : ℕ) : ℝ)*(T/N), a s)| ≤ M*K*T := by + let h := T / (N : ℝ) + have hNr : 0 < (N : ℝ) := by exact_mod_cast hN + have hh : 0 ≤ h := div_nonneg hT hNr.le + have hNh : (N : ℝ) * h = T := by dsimp [h]; field_simp + have hdiff (i : ℕ) : ((i+1 : ℕ) : ℝ)*h-(i : ℝ)*h = h := by push_cast; ring + have he (i : ℕ) (hi : i < N) : + |D ((i : ℝ)*h) (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s)| ≤ M*K*h := by + have hai : (i : ℝ)*h ∈ Set.Icc 0 T := by + refine ⟨by positivity, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi.le) hh + have hbi : ((i+1 : ℕ) : ℝ)*h ∈ Set.Icc 0 T := by + refine ⟨by positivity, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi) hh + have hab : (i : ℝ)*h ≤ ((i+1 : ℕ) : ℝ)*h := by linarith [hdiff i] + have hv : ‖∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s‖ ≤ K*h := by + have hb := intervalIntegral.norm_integral_le_of_norm_le_const (fun s hs => + ha s (show s ∈ Set.Icc 0 T from by + rw [Set.uIoc_of_le hab] at hs + exact ⟨hai.1.trans hs.1.le, hs.2.trans hbi.2⟩)) + simpa only [hdiff, abs_of_nonneg hh] using hb + calc + _ ≤ ‖D ((i : ℝ)*h)‖ * ‖∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s‖ := by + simpa only [Real.norm_eq_abs] using (D ((i : ℝ)*h)).le_opNorm _ + _ ≤ M * (K*h) := mul_le_mul (hD _ hai) hv (norm_nonneg _) hM + _ = _ := by ring + change |∑ i ∈ Finset.range N, D ((i : ℝ)*h) + (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s)| ≤ _ + calc + _ ≤ ∑ i ∈ Finset.range N, |D ((i : ℝ)*h) + (∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, a s)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ _i ∈ Finset.range N, M*K*h := Finset.sum_le_sum fun i hi => he i (Finset.mem_range.mp hi) + _ = M*K*((N : ℝ)*h) := by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; ring + _ = M*K*T := by rw [hNh] + +lemma expected_stieltjes_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] + (W : Measure Ω) [IsFiniteMeasure W] (D : ℝ → Ω → E →L[ℝ] ℝ) (a : ℝ → Ω → E) + (hD : ∀ b, Continuous (fun t => D t b)) (ha : ∀ b, Continuous (fun t => a t b)) + (hm : ∀ u v, AEStronglyMeasurable (fun b => D u b (∫ s in u..v, a s b)) W) + (T M K : ℝ) (hT : 0 ≤ T) (hM : 0 ≤ M) (hK : 0 ≤ K) + (hDb : ∀ b t, t ∈ Set.Icc 0 T → ‖D t b‖ ≤ M) + (hab : ∀ b t, t ∈ Set.Icc 0 T → ‖a t b‖ ≤ K) : + Tendsto (fun n : ℕ => ∫ b, ∑ i ∈ Finset.range (n+1), D ((i : ℝ)*(T/(n+1 : ℕ))) b + (∫ s in (i : ℝ)*(T/(n+1 : ℕ))..((i+1 : ℕ) : ℝ)*(T/(n+1 : ℕ)), a s b) ∂W) atTop + (𝓝 (∫ b, (∫ t in 0..T, D t b (a t b)) ∂W)) := by + apply tendsto_integral_of_dominated_convergence (fun _ => M*K*T) + · intro n + have hs := Finset.aestronglyMeasurable_sum (Finset.range (n+1)) (fun i hi => + hm ((i : ℝ)*(T/(n+1 : ℕ))) (((i+1 : ℕ) : ℝ)*(T/(n+1 : ℕ)))) + convert hs using 1 + funext b + simp only [Finset.sum_apply] + · exact integrable_const _ + · intro n + refine ae_of_all W ?_ + intro b + simpa only [Real.norm_eq_abs] using stieltjes_sum_bound (fun t => D t b) + (fun t => a t b) T M K hT hM hK (n+1) (Nat.succ_pos _) (hDb b) (hab b) + · exact ae_of_all W (fun b => stieltjes_sum_tendsto (fun t => D t b) + (fun t => a t b) (hD b) (ha b) T M hT hM (hDb b)) + +end ExactSLEGenerator + +open MeasureTheory ProbabilityTheory Filter +open scoped NNReal Topology +namespace ExactSLEGenerator +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + + +theorem dynkin_of_mixed_taylor (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (start : ℝ≥0) (F Z Y : ℝ → Driver → ℝ) (D : ℝ → Driver → E →L[ℝ] ℝ) (A : ℝ → Driver → E) + (hF : ∀ t : ℝ≥0, Integrable (F t) W) + (hZm : ∀ t : ℝ≥0, Measurable[rawFiltration (start+t)] (Z t)) + (hYm : ∀ t : ℝ≥0, Measurable[rawFiltration (start+t)] (Y t)) + (hZi : ∀ t : ℝ≥0, Integrable (Z t) W) + (hYc : ∀ b, Continuous (fun t => Y t b)) + (hYm' : ∀ t, AEStronglyMeasurable (Y t) W) + (hDc : ∀ b, Continuous (fun t => D t b)) + (hAc : ∀ b, Continuous (fun t => A t b)) + (hVm : ∀ u v, AEStronglyMeasurable (fun b => D u b (∫ t in u..v, A t b)) W) + (C M K : ℝ) (hC : 0 ≤ C) (hM : 0 ≤ M) (hK : 0 ≤ K) + (hYb : ∀ b t, |Y t b| ≤ M) (hDb : ∀ b t, ‖D t b‖ ≤ M) + (hAb : ∀ b t, ‖A t b‖ ≤ K) + (hTaylor : ∀ (s h : ℝ≥0) b, + |F (s+h) b - F s b - Z s b * increment (start+s) h b - + Y s b * increment (start+s) h b ^ 2 / 2 - D s b (∫ t in (s : ℝ)..(s+h : ℝ≥0), A t b)| ≤ + C * (K * h * (|increment (start+s) h b| + K * h) + |increment (start+s) h b| ^ 3)) + (T : ℝ≥0) : + (∫ b, F T b ∂W) - (∫ b, F 0 b ∂W) = + (1/2 : ℝ) * (∫ b, (∫ t in 0..(T : ℝ), Y t b) ∂W) + + (∫ b, (∫ t in 0..(T : ℝ), D t b (A t b)) ∂W) := by + have hYi (t : ℝ) : Integrable (Y t) W := + Integrable.of_bound (hYm' t) M (ae_of_all W (fun b => by simpa [Real.norm_eq_abs] using hYb b t)) + have hVi (u v : ℝ) : Integrable (fun b => D u b (∫ t in u..v, A t b)) W := by + apply Integrable.of_bound (hVm u v) (M * (K * |v-u|)) + refine ae_of_all W (fun b => ?_) + calc + _ ≤ ‖D u b‖ * ‖∫ t in u..v, A t b‖ := (D u b).le_opNorm _ + _ ≤ M * (K * |v-u|) := mul_le_mul (hDb b u) + (intervalIntegral.norm_integral_le_of_norm_le_const (fun t ht => hAb b t)) + (norm_nonneg _) hM + let S : ℕ → ℝ := fun n => ∑ i ∈ Finset.range (n+1), + ((T : ℝ)/(n+1 : ℕ)/2 * (∫ b, Y ((i : ℝ)*((T : ℝ)/(n+1 : ℕ))) b ∂W) + + (∫ b, D ((i : ℝ)*((T : ℝ)/(n+1 : ℕ))) b + (∫ t in ((i : ℝ)*((T : ℝ)/(n+1 : ℕ)))..(((i+1 : ℕ) : ℝ)*((T : ℝ)/(n+1 : ℕ))), A t b) ∂W)) + have hS (n : ℕ) : S n = + (1/2 : ℝ) * (∫ b, ∑ i ∈ Finset.range (n+1), + ((T : ℝ)/(n+1 : ℕ))*Y ((i : ℝ)*((T : ℝ)/(n+1 : ℕ))) b ∂W) + + (∫ b, ∑ i ∈ Finset.range (n+1), D ((i : ℝ)*((T : ℝ)/(n+1 : ℕ))) b + (∫ t in ((i : ℝ)*((T : ℝ)/(n+1 : ℕ)))..(((i+1 : ℕ) : ℝ)*((T : ℝ)/(n+1 : ℕ))), A t b) ∂W) := by + rw [integral_finsetSum _ (fun i hi => (hYi _).const_mul _), + integral_finsetSum _ (fun i hi => hVi _ _)] + simp only [integral_const_mul, Finset.mul_sum] + dsimp [S] + rw [Finset.sum_add_distrib] + congr 1 + apply Finset.sum_congr rfl + intro i hi + ring + have hlim : Tendsto S atTop (𝓝 ((1/2 : ℝ) * (∫ b, (∫ t in 0..(T : ℝ), Y t b) ∂W) + + (∫ b, (∫ t in 0..(T : ℝ), D t b (A t b)) ∂W))) := by + have hy := expected_riemann_sum_tendsto W Y hYc hYm' T M T.coe_nonneg + (fun b t ht => hYb b t) + have hv := expected_stieltjes_sum_tendsto W D A hDc hAc hVm T M K T.coe_nonneg hM hK + (fun b t ht => hDb b t) (fun b t ht => hAb b t) + convert (hy.const_mul (1/2 : ℝ)).add hv using 1 + funext n + exact hS n + have herr (n : ℕ) : |(∫ b, F T b ∂W) - (∫ b, F 0 b ∂W) - S n| ≤ + C * (T : ℝ) * ((K * absMoment 1 + absMoment 3) * + Real.sqrt ((T : ℝ)/(n+1 : ℕ)) + K^2*((T : ℝ)/(n+1 : ℕ))) := by + let h : ℝ≥0 := T / (n+1 : ℕ) + have hnh : ((n+1 : ℕ) : ℝ≥0) * h = T := by dsimp [h]; field_simp + have he := expected_taylor_sum W hW start (n+1) h + (fun i => F (((i : ℝ≥0)*h : ℝ≥0) : ℝ)) (fun i => Z (((i : ℝ≥0)*h : ℝ≥0) : ℝ)) (fun i => Y (((i : ℝ≥0)*h : ℝ≥0) : ℝ)) + (fun i b => D (((i : ℝ≥0)*h : ℝ≥0) : ℝ) b (∫ t in (((i : ℝ≥0)*h) : ℝ)..((((i+1 : ℕ) : ℝ≥0)*h) : ℝ), A t b)) + (fun i => hF _) (fun i => hVi _ _) (fun i => hZm _) (fun i => hYm _) + (fun i => hZi _) (fun i => hYi _) C K hC hK (by + intro i hi b + have ht := hTaylor ((i : ℝ≥0)*h) h b + convert ht using 1; push_cast; ring_nf) + have hnr : ((n+1 : ℕ) : ℝ) * (h : ℝ) = T := by exact_mod_cast hnh + simp only [hnh, Nat.cast_zero, zero_mul, NNReal.coe_zero] at he + simp only [NNReal.coe_mul, NNReal.coe_natCast] at he + have hSn : (∑ i ∈ Finset.range (n+1), + ((h : ℝ)/2 * (∫ b, Y ((i : ℝ)*(h : ℝ)) b ∂W) + + (∫ b, D ((i : ℝ)*(h : ℝ)) b (∫ t in ((i : ℝ)*(h : ℝ))..(((i+1 : ℕ) : ℝ)*(h : ℝ)), A t b) ∂W))) = S n := by + simp only [S, h, NNReal.coe_div, NNReal.coe_natCast] + rw [hSn] at he + have hcoef : ((n+1 : ℕ) : ℝ) * C * (h : ℝ) = C*(T : ℝ) := by + calc + _ = C * (((n+1 : ℕ) : ℝ) * (h : ℝ)) := by ring + _ = C*(T : ℝ) := by rw [hnr] + rw [hcoef] at he + simpa only [h, NNReal.coe_div, NNReal.coe_natCast] using he + have he0 : Tendsto (fun n => |(∫ b, F T b ∂W) - (∫ b, F 0 b ∂W) - S n|) atTop (𝓝 0) := + squeeze_zero (fun n => abs_nonneg _) herr (taylor_error_tendsto_zero T C K) + have hed : Tendsto S atTop (𝓝 ((∫ b, F T b ∂W) - (∫ b, F 0 b ∂W))) := by + rw [tendsto_iff_dist_tendsto_zero] + have heq : (fun n => dist (S n) ((∫ b, F T b ∂W) - (∫ b, F 0 b ∂W))) = + (fun n => |(∫ b, F T b ∂W) - (∫ b, F 0 b ∂W) - S n|) := by + funext n + rw [Real.dist_eq, abs_sub_comm] + rw [heq] + exact he0 + exact tendsto_nhds_unique hed hlim + +end ExactSLEGenerator + +namespace ExactSLEGenerator +variable {E Ω : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace Ω] + +omit [CompleteSpace E] in +lemma stronglyMeasurable_intervalIntegral_of_continuous [MeasurableSpace E] [BorelSpace E] + [SecondCountableTopology E] (A : ℝ → Ω → E) + (hc : ∀ b, Continuous (fun t => A t b)) (hm : ∀ t, Measurable (A t)) (u v : ℝ) : + StronglyMeasurable (fun b => ∫ t in u..v, A t b) := by + have hj : StronglyMeasurable (Function.uncurry A) := + (measurable_uncurry_of_continuous_of_measurable hc hm).stronglyMeasurable + by_cases huv : u ≤ v + · simp_rw [intervalIntegral.integral_of_le huv] + exact hj.integral_prod_left + · simp_rw [intervalIntegral.integral_of_ge (le_of_not_ge huv)] + exact hj.integral_prod_left.neg + +variable [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + + + +end ExactSLEGenerator +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/SpatialPastTail.lean b/lean/OAI/Probability/SLEGauge/SpatialPastTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..bab47676f308d46adb11a6bbf7f1993135ab78da --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/SpatialPastTail.lean @@ -0,0 +1,545 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.PlanarGrid +import OAI.Probability.SLEGauge.NormalizedDiskMass + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart PastMass CompactSequence + +lemma half_le_subdiskRadius (n : ℕ) : (1:ℝ)/2 ≤ subdiskRadius n := by + unfold subdiskRadius + have h : (2:ℝ) ≤ n+2 := by have := Nat.cast_nonneg (α:=ℝ) n; linarith + have hh := one_div_le_one_div_of_le (by norm_num : (0:ℝ)<2) h + linarith + +lemma radial_exp_tendsto (a : ℝ) (ha : 0Real.exp (-2*a*l)) atTop (𝓝 0) := by + have H := tendsto_pow_atTop_nhds_zero_of_lt_one (Real.exp_pos (-2*a)).le + (Real.exp_lt_one_iff.mpr (by linarith : -2*a<0)) + simpa only [←Real.exp_nat_mul, mul_comm (↑_ : ℝ) (-2*a)] using H + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4b.1 t) W) + (z : UpperPlane) (σ : ℝ) (hσ : 0<σ) (hσz : σ ≤ z.1.im) + (s : ℝ) (hs : Jacobi.mixingTime (4*a) ≤ s) (hgap : σ=z.1.im*Real.exp (-2*a*s)) + (Q : Set UpperPlane) (hQ : Q ⊆ (Subtype.val : UpperPlane→ℂ) ⁻¹' closedBall z.1 (σ/200)) + (F : Finset ℝ≥0) (H : ℝ) (hH : 0 ≤ H) (l : ℕ) : + (radialLaw W a z.1 (σ*Real.exp (-2*a*l))) + {b | finiteTestTime F (fun t b=>M.mass t b Q) + (ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H)) b < + radialTime a b.1 z.1 (σ*Real.exp (-2*a*l))} ≤ + 2*M.law {x | H ≤ sequenceMassReal x} := by + let q := subdiskRadius M.radiusIndex + have hq : 0 ≤ q := (subdiskRadius_pos _).le + have hq1 : q<1 := subdiskRadius_lt_one _ + have ha0 : 0b.1 t) W) + (z : UpperPlane) (σ : ℝ) (hσ : 0<σ) (hσz : σ ≤ z.1.im) + (s : ℝ) (hs : Jacobi.mixingTime (4*a) ≤ s) (hgap : σ=z.1.im*Real.exp (-2*a*s)) + (Q : Set UpperPlane) (hQm : MeasurableSet Q) + (hQ : Q ⊆ (Subtype.val : UpperPlane→ℂ) ⁻¹' closedBall z.1 (σ/200)) + (F : Finset ℝ≥0) (H : ℝ) (hH : 0 ≤ H) : + pastGreenKernel W a (finiteTestTime F (fun t b=>M.mass t b Q) + (ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H))) z ≤ + 2*M.law {x | H ≤ sequenceMassReal x} := by + let ratio (l : ℕ) := (σ/z.1.im)*Real.exp (-2*a*l) + have hr (l : ℕ) : 0 + M.finite_past_tail hW z σ hσ hσz s hs hgap Q hQ F H hH l)) + +lemma rational_past_kernel_tail [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : UpperPlane) (σ : ℝ) (hσ : 0<σ) (hσz : σ ≤ z.1.im) + (s : ℝ) (hs : Jacobi.mixingTime (4*a) ≤ s) (hgap : σ=z.1.im*Real.exp (-2*a*s)) + (Q : Set UpperPlane) (hQm : MeasurableSet Q) + (hQ : Q ⊆ (Subtype.val : UpperPlane→ℂ) ⁻¹' closedBall z.1 (σ/200)) + (H : ℝ) (hH : 0 ≤ H) : + rationalPastKernel W a M.mass Q + (ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H)) z ≤ + 2*M.law {x | H ≤ sequenceMassReal x} := by + apply iSup_le + intro n + exact M.past_kernel_tail hW z σ hσ hσz s hs hgap Q hQm hQ _ H hH + + + +lemma expected_spatial_bad_mass [IsProbabilityMeasure W] + (hκ : 0<κ) (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (σ : ℝ) (hσ : 0<σ) (Q : Set UpperPlane) (hQ : IsCompact Q) + (hsize : ∀z∈Q,Q ⊆ (Subtype.val : UpperPlane→ℂ) ⁻¹' closedBall z.1 (σ/200)) + (hgap : ∀z∈Q,σ ≤ z.1.im ∧ ∃s : ℝ,Jacobi.mixingTime (4*a) ≤ s ∧ + σ=z.1.im*Real.exp (-2*a*s)) + (H : ℝ) (hH : 0 ≤ H) : + (∫⁻b,{b | 2*ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H)< + M.mass ∞ b Q}.indicator (fun b=>M.mass ∞ b Q) b∂W) ≤ + 4*initialGreenMeasure a Q*M.law {x | H ≤ sequenceMassReal x} := by + have hh := M.canonical.toTracePalmData.expected_bad_mass_le hκ ha hW Q hQ + (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H) + (mul_nonneg (Real.rpow_nonneg (mul_nonneg + (diskUpper_pos (subdiskRadius_pos _).le (subdiskRadius_lt_one _)).le hσ.le) _) hH) + refine hh.trans ?_ + have hb : (∫⁻z in Q,ENNReal.ofReal (initialGreen a z)*rationalPastKernel W a M.mass Q + (ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H)) z∂upperArea) ≤ + (initialGreenMeasure a Q)*(2*M.law {x | H ≤ sequenceMassReal x}) := by + have hb' : (∫⁻z in Q,ENNReal.ofReal (initialGreen a z)*rationalPastKernel W a M.mass Q + (ENNReal.ofReal (((diskUpper (subdiskRadius M.radiusIndex)*σ)^(2-alpha a))*H)) z∂upperArea) ≤ + ∫⁻z in Q,ENNReal.ofReal (initialGreen a z)*(2*M.law {x | H ≤ sequenceMassReal x})∂upperArea := by + apply setLIntegral_mono' hQ.measurableSet + intro z hz + gcongr + obtain ⟨hsz,s,hs,he⟩ := hgap z hz + exact M.rational_past_kernel_tail hW z σ hσ hsz s hs he Q hQ.measurableSet + (hsize z hz) H hH + refine hb'.trans_eq ?_ + rw [lintegral_mul_const _ (initialGreen_continuous a).measurable.ennreal_ofReal] + rw [initialGreenMeasure,withDensity_apply _ hQ.measurableSet] + calc + _ ≤ 2*(initialGreenMeasure a Q*(2*M.law {x | H ≤ sequenceMassReal x})) := by gcongr; exact hb + _ = _ := by ring + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart PastMass CompactSequence MomentBatches + +lemma clock_gap_of_small (a : ℝ) (ha : 0 < a) (T : ℝ) (hT : 0 ≤ T) + (y σ : ℝ) (hy : 0 < y) (hσ : 0 < σ) (hsmall : σ ≤ y*Real.exp (-2*a*T)) : + σ ≤ y ∧ ∃s : ℝ,T ≤ s ∧ σ=y*Real.exp (-2*a*s) := by + have hq := div_pos hσ hy + have he : σ/y ≤ Real.exp (-2*a*T) := (div_le_iff₀ hy).mpr (by simpa only [mul_comm] using hsmall) + have hlog := Real.log_le_log hq he + rw [Real.log_exp] at hlog + have hσy : σ ≤ y := hsmall.trans (mul_le_of_le_one_right hy.le + (Real.exp_le_one_iff.mpr (by nlinarith))) + refine ⟨hσy,-Real.log (σ/y)/(2*a),?_,?_⟩ + · apply (le_div_iff₀ (by positivity : 0 < 2*a)).mpr + nlinarith + · have ee : -2*a*(-Real.log (σ/y)/(2*a))=Real.log (σ/y) := by field_simp + rw [ee,Real.exp_log hq,mul_div_cancel₀ _ hy.ne'] + +lemma batchRadius_eventually_small (m : ℕ → ℝ) (a : ℝ) (ha : 0 ≤ a) (ell : ℕ → ℕ) + (ε : ℝ) (hε : 0 < ε) : ∃N : ℕ,∀i : EntryIndex m,N ≤ i.1.1 → radius m a ell i ≤ ε := by + have ht : Tendsto (fun n : ℕ=>Real.exp (-(n:ℝ))) atTop (𝓝 0) := by + simpa using radial_exp_tendsto (1/2) (by norm_num : (0:ℝ) < 1/2) + obtain ⟨N,hN⟩ := eventually_atTop.mp (ht.eventually_le_const hε) + refine ⟨N,fun i hi=>(radius_le m ha ell i).trans ((Real.exp_le_exp.mpr ?_).trans (hN i.1.1 hi))⟩ + have hn : (1:ℝ) ≤ i.1.1 := by exact_mod_cast i.1.2 + nlinarith + +lemma compact_batch_mixing (m : ℕ → ℝ) (a : ℝ) (ha : 0 < a) (ell : ℕ → ℕ) + (E : Set UpperPlane) (hE : IsCompact E) : + ∃N : ℕ,∀i : EntryIndex m,N ≤ i.1.1 → ∀z∈E, + 400*radius m a ell i ≤ z.1.im ∧ ∃s : ℝ,Jacobi.mixingTime (4*a) ≤ s ∧ + 400*radius m a ell i=z.1.im*Real.exp (-2*a*s) := by + obtain ⟨η,hη,hηE⟩ := hE.exists_forall_le' + (Complex.continuous_im.comp continuous_subtype_val).continuousOn (fun z _=>z.2) + let T := Jacobi.mixingTime (4*a) + have hT : 0 ≤ T := by unfold T Jacobi.mixingTime Jacobi.majorantBase; positivity + obtain ⟨N,hN⟩ := batchRadius_eventually_small m a ha.le ell + (η*Real.exp (-2*a*T)/400) (by positivity) + refine ⟨N,fun i hi z hz=>clock_gap_of_small a ha T hT z.1.im + (400*radius m a ell i) z.2 (by have := radius_pos m a ell i; positivity) ?_⟩ + calc + 400*radius m a ell i ≤ η*Real.exp (-2*a*T) := by linarith [hN i hi] + _ ≤ z.1.im*Real.exp (-2*a*T) := mul_le_mul_of_nonneg_right (hηE z hz) (Real.exp_pos _).le + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4 < a} {W : Measure GDriver} (M : CenteredMomentModel κ a ha W) + +abbrev Entries := EntryIndex (moment M.law sequenceMassReal) + +def entryThreshold (i : M.Entries) : ℝ := threshold (moment M.law sequenceMassReal) i + +def entryRadius (i : M.Entries) : ℝ := radius (moment M.law sequenceMassReal) a + (momentLevel M.law sequenceMassReal sequenceLevelReal) i + +lemma entryRadius_pos (i : M.Entries) : 0 < M.entryRadius i := radius_pos .. + +lemma entryThreshold_pos (i : M.Entries) : 0 < M.entryThreshold i := by + let := M.probability + have hm1 := M.moments_positive 1 le_rfl + have hh := batch_entry_lower i.1.2 hm1 (M.moments_positive i.1.1 i.1.2) + (mean_pow_le_moment M.law sequenceMassReal + (Eventually.of_forall sequenceMassReal_nonneg) (by simpa only [pow_one] using M.integrable_moments 1) i.1.1 (M.integrable_moments _)) + (List.getElem_mem i.2.2) + exact (lt_min zero_lt_one (by positivity : 0 < moment M.law sequenceMassReal 1/4)).trans_le hh + +lemma gauge_eq_quadratic (d : ℝ) : + M.gauge d=QuadraticGauge.gauge d M.entryThreshold M.entryRadius := rfl + +lemma entry_tails_finite : (∑'i : M.Entries, + M.law {x | 16*M.entryThreshold i ≤ sequenceMassReal x})≠∞ := by + let := M.probability + have h := M.tails_summable.tsum_ofReal_ne_top + simpa only [entryThreshold,Entries,Measure.real,ENNReal.ofReal_toReal (measure_ne_top _ _)] using h + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped ENNReal NNReal Topology +namespace SLEExactGauge.CenteredMoments +open ExactSLEGreen + + +def spatialRestriction (μ : Measure UpperPlane) (E : Set UpperPlane) : Measure ℂ := + (μ.restrict E).map Subtype.val + +lemma spatialRestriction_apply (μ : Measure UpperPlane) (E : Set UpperPlane) + (A : Set ℂ) (hA : MeasurableSet A) : + spatialRestriction μ E A=μ (E∩(Subtype.val : UpperPlane→ℂ) ⁻¹' A) := by + rw [spatialRestriction,Measure.map_apply measurable_subtype_coe hA, + Measure.restrict_apply (measurable_subtype_coe hA),inter_comm] + +lemma spatialRestriction_mono {μ ν : Measure UpperPlane} (h : μ≤ν) (E : Set UpperPlane) : + spatialRestriction μ E ≤ spatialRestriction ν E := by + exact Measure.map_mono (Measure.restrict_mono le_rfl h) measurable_subtype_coe + +lemma spatialRestriction_univ (μ : Measure UpperPlane) (E : Set UpperPlane) : + spatialRestriction μ E univ=μ E := by + rw [spatialRestriction_apply μ E univ MeasurableSet.univ] + simp + +lemma spatialRestriction_finite (μ : Measure UpperPlane) (E : Set UpperPlane) (hE : μ E<∞) : + IsFiniteMeasure (spatialRestriction μ E) := + ⟨by simpa only [spatialRestriction_univ] using hE⟩ + +lemma spatialRestriction_atomless (μ : Measure UpperPlane) [NullSingletonClass μ] + (E : Set UpperPlane) : NullSingletonClass (spatialRestriction μ E) := by + constructor + intro z + rw [spatialRestriction_apply μ E {z} (measurableSet_singleton z)] + exact measure_mono_null inter_subset_right + ((Set.subsingleton_singleton.preimage Subtype.val_injective).measure_zero μ) + +lemma spatialRestriction_measurable {Ω : Type*} [MeasurableSpace Ω] + (μ : Ω→Measure UpperPlane) (hμ : Measurable μ) (E : Set UpperPlane) + (hE : MeasurableSet E) (A : Set ℂ) (hA : MeasurableSet A) : + Measurable (fun ω=>spatialRestriction (μ ω) E A) := by + simp only [spatialRestriction_apply _ _ _ hA] + exact (Measure.measurable_coe (hE.inter (measurable_subtype_coe hA))).comp hμ + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart PastMass CompactSequence MomentBatches + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4b.1 t) W) + (E : Set UpperPlane) (hE : IsCompact E) : + ∀ᵐ b∂W,∀ᵐ z∂spatialRestriction (M.mass ∞ b) E, + {i : M.Entries | z∈PlanarGrid.badRegion (spatialRestriction (M.mass ∞ b) E) + (M.entryRadius i) (M.gridConstant*M.entryThreshold i*(M.entryRadius i)^(2-alpha a))}.Finite := by + let ν := spatialRestriction (initialGreenMeasure a) E + let : IsFiniteMeasure ν := spatialRestriction_finite _ E hE.measure_lt_top + obtain ⟨N,hN⟩ := compact_batch_mixing (moment M.law sequenceMassReal) a (by linarith) + (momentLevel M.law sequenceMassReal sequenceLevelReal) E hE + let good : Set M.Entries := {i | N ≤ i.1.1} + have hg : goodᶜ.Finite := by + simpa only [good,compl_ofPred,not_le] using finite_entries_before (moment M.law sequenceMassReal) N + apply PlanarGrid.ae_finitely_bad_of_spatial_tails W + (fun b=>spatialRestriction (M.mass ∞ b) E) ν M.entryRadius + (fun i=>M.gridConstant*M.entryThreshold i*(M.entryRadius i)^(2-alpha a)) M.entryRadius_pos + (fun i p=>spatialRestriction_measurable (M.mass ∞) M.canonical.terminal_measurable E + hE.measurableSet _ (PlanarGrid.cell_measurable _ _)) good hg 4 (by norm_num) + (fun i=>M.law {x | 16*M.entryThreshold i ≤ sequenceMassReal x}) M.entry_tails_finite + intro i hi p + let Q := E∩(Subtype.val : UpperPlane→ℂ) ⁻¹' PlanarGrid.cell (M.entryRadius i) p + have hQ : IsCompact Q := hE.inter_right + ((PlanarGrid.cell_closed _ _).preimage continuous_subtype_val) + have hs : ∀z∈Q,Q ⊆ (Subtype.val : UpperPlane→ℂ) ⁻¹' closedBall z.1 ((400*M.entryRadius i)/200) := by + intro z hz w hw + apply mem_closedBall.mpr + calc + dist w.1 z.1 ≤ 2*M.entryRadius i := PlanarGrid.cell_dist _ (M.entryRadius_pos i).le p hz.2 hw.2 + _ = (400*M.entryRadius i)/200 := by ring + have hh := M.expected_spatial_bad_mass hκ hW (400*M.entryRadius i) + (by have := M.entryRadius_pos i; positivity) Q hQ hs + (fun z hz=>hN i hi z hz.1) (16*M.entryThreshold i) (by have := M.entryThreshold_pos i; positivity) + rw [M.grid_threshold] at hh + simpa only [ν,spatialRestriction_apply _ _ _ (PlanarGrid.cell_measurable _ _)] using hh + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart PastMass CompactSequence MomentBatches TraceMassContinuity + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4b.1 t) W) : + ∀ᵐ b∂W,∀s t : ℝ,0M.compact_finitely_bad hκ hW (E n) (E.isCompact n)) + filter_upwards [hbad,M.canonical.path,M.canonical.positive_increments] with b hb hf hp + intro s t hs hst + let u := (κ*s).toNNReal + let v := (κ*t).toNNReal + have hu : (u:ℝ)=κ*s := Real.coe_toNNReal _ (mul_pos hκ hs).le + have hv : (v:ℝ)=κ*t := Real.coe_toNNReal _ (mul_pos hκ (hs.trans hst)).le + have huv : umeasure_mono_null (le_refl {z}) + (le_antisymm ((hτ {z}).trans_eq (measure_singleton z)) bot_le)⟩ + let : IsFiniteMeasureOnCompacts (M.mass ∞ b) := M.canonical.finite_compact ∞ b + let σ := spatialRestriction τ (E n) + let μ := spatialRestriction (M.mass ∞ b) (E n) + have hσ : σ≤μ := spatialRestriction_mono hτ (E n) + let : IsFiniteMeasure σ := spatialRestriction_finite τ (E n) + ((hτ (E n)).trans_lt (E.isCompact n).measure_lt_top) + let : NullSingletonClass σ := spatialRestriction_atomless τ (E n) + let A : Set ℂ := (Target.trace κ (driverHomeomorph.symm b)) '' Icc s t + have hA : IsCompact A := isCompact_Icc.image_of_continuousOn + (hf.continuous_trace.mono (fun x hx=>hs.le.trans hx.1)) + have hzero : σ Aᶜ=0 := by + rw [spatialRestriction_apply τ (E n) _ hA.measurableSet.compl] + apply measure_mono_null inter_subset_right + exact hf.capacity_increment_support hκ s t hs.le hst.le + have hpos : 0<σ A := by + have hposU : 0<σ univ := by + rw [spatialRestriction_univ] + exact hKpos.trans_le (measure_mono hKn) + have he := measure_add_measure_compl (μ:=σ) hA.measurableSet + rw [hzero,add_zero] at he + exact he ▸ hposU + rw [M.gauge_eq_quadratic] + exact PlanarGrid.hausdorff_pos_of_finitely_bad (2-alpha a) M.entryThreshold M.entryRadius + M.entryThreshold_pos M.entryRadius_pos μ σ hσ M.gridConstant M.gridConstant_pos.le + ((Measure.absolutelyContinuous_of_le hσ).ae_le (hb n)) A hpos + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Metric +open scoped NNReal ENNReal Topology +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGreen ExactSLEGenerator +open LoewnerRestart PastMass CompactSequence MomentBatches + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4radialTime a b.1 z (τ*Real.exp (-2*a*l))) + (LoewnerRestart.normalizedTest a z τ (subdiskMass a M.mass (subdiskRadius M.radiusIndex) l)) + +lemma testEndpoint_pos (τ : ℝ) (hτ : 0<τ) (l : ℕ) : 0<τ*Real.exp (-2*a*l) := by positivity + +include ha in +lemma testEndpoint_le (τ : ℝ) (hτ : 0 ≤ τ) (l : ℕ) : τ*Real.exp (-2*a*l) ≤ τ := + mul_le_of_le_one_right hτ (Real.exp_le_one_iff.mpr (by + have hl : (0:ℝ) ≤ l := Nat.cast_nonneg l + nlinarith)) + +lemma stoppedTest_measurable (z : ℂ) (hz : 0M.subdisk_raw_measurable θ l) b hb + +lemma subdisk_ge_real_law (l : ℕ) (H : ℝ) (_hH : 0 ≤ H) : + (finiteAngleLaw W a l) {p | ENNReal.ofReal H ≤ subdiskMass a M.mass (subdiskRadius M.radiusIndex) l p}= + M.law {x | H ≤ sequenceLevelReal l x} := by + rw [M.subdisk_ge_law] + apply measure_congr + filter_upwards [M.increasing_finite] with x hx + exact propext (ENNReal.ofReal_le_iff_le_toReal (ne_top_of_le_ne_top hx.2.ne (le_iSup x l))) + + + +theorem stopped_success_lower [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : GDriver)=>b.1 t) W) + (z : ℂ) (hz : 0(1:ℝ≥0∞))) (measurable_const.indicator hE)).1 + rw [lintegral_indicator hE,lintegral_one,Measure.restrict_apply_univ, + M.subdisk_ge_real_law l H hH] at hh + refine hh.trans_eq ?_ + have hm := M.stoppedTest_measurable z hz τ hτ (hτσ.trans hσz) l + have hT := radialTime_stopping a (by linarith) z hz (τ*Real.exp (-2*a*l)) + ((testEndpoint_pos (a := a)) τ hτ l) (((testEndpoint_le (ha := ha)) τ hτ.le l).trans (hτσ.trans hσz)) + have hS : MeasurableSet {b | ENNReal.ofReal H ≤ M.stoppedTest z τ l b} := + hT.measurableSpace_le _ (measurableSet_le measurable_const hm) + have he : (∫⁻b in A,LoewnerRestart.normalizedTest a z τ (E.indicator (fun _=>(1:ℝ≥0∞))) b + ∂radialLaw W a z (τ*Real.exp (-2*a*l)))= + ∫⁻b in A,{b | ENNReal.ofReal H ≤ M.stoppedTest z τ l b}.indicator + (fun _=>(1:ℝ≥0∞)) b∂radialLaw W a z (τ*Real.exp (-2*a*l)) := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_of_ae (radial_hit_ae W a ha z hz (τ*Real.exp (-2*a*l)) + ((testEndpoint_pos (a := a)) τ hτ l) (((testEndpoint_le (ha := ha)) τ hτ.le l).trans (hτσ.trans hσz)))] with b hb + simp only [Set.indicator,Set.mem_ofPred_eq,M.stoppedTest_eq z hz τ hτ (hτσ.trans hσz) l b hb] + simp [LoewnerRestart.normalizedTest,E,Set.indicator]; rfl + rw [he,lintegral_indicator hS,lintegral_one,Measure.restrict_apply_univ,Measure.restrict_apply hS,inter_comm] + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StateBounds.lean b/lean/OAI/Probability/SLEGauge/StateBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee52ac2fa208affcc42fd9d5b55e0f9040fb45ba --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StateBounds.lean @@ -0,0 +1,399 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.OptionalEstimates + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLECalculus ExactSLEFiniteTilt +noncomputable def regimeState {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) (t : ℝ≥0) (b : Driver) : RegimeState m := + (vectorState a η hη z t b, + ∫ u in (0:ℝ)..(t:ℝ), regimeDiscountCut s a ε η N cap σ off (vectorState a η hη z u.toNNReal b)) +lemma regimeState_continuous {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) (b : Driver) : + Continuous (fun t => regimeState s a ε η hη N cap σ off z t b) := by + have hc : Continuous (fun u : ℝ => regimeDiscountCut s a ε η N cap σ off + (vectorState a η hη z u.toNNReal b)) := + (regimeDiscountCut_continuous s a ε η hη N cap σ off).comp + ((vectorState_continuous a η hη z b).comp continuous_real_toNNReal) + exact (vectorState_continuous a η hη z b).prodMk + ((intervalIntegral.continuous_primitive hc.intervalIntegrable 0).comp continuous_subtype_val) +lemma regimeState_adapted {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) (t : ℝ≥0) : + Measurable[rawFiltration t] (regimeState s a ε η hη N cap σ off z t) := by + apply (vectorState_adapted a η hη z t).prodMk + apply adapted_intervalIntegral rawFiltration + (fun u b => regimeDiscountCut s a ε η N cap σ off (vectorState a η hη z u b)) + · intro b + exact (regimeDiscountCut_continuous s a ε η hη N cap σ off).comp + (vectorState_continuous a η hη z b) + · intro u + exact (regimeDiscountCut_continuous s a ε η hη N cap σ off).measurable.comp + (vectorState_adapted a η hη z u) +lemma regimeState_eq {m : ℕ} (s : Finset (Fin m)) (a ε η : ℝ) (hη : 0<η) (N : ℝ≥0) + (cap σ off : Fin m → ℝ) (z : Fin m → ℂ) (u h : ℝ≥0) (b : Driver) : + regimeState s a ε η hη N cap σ off z (u+h) b = + regimeState s a ε η hη N cap σ off z u b+increment u h b • (multiNoise m,0)+ + ∫ t in (u:ℝ)..((u+h:ℝ≥0):ℝ), regimeDrift s a ε η N cap σ off + (regimeState s a ε η hη N cap σ off z t.toNNReal b) := by + let A := regimeDrift s a ε η N cap σ off + let V := regimeState s a ε η hη N cap σ off z + have hc : Continuous (fun t : ℝ => A (V t.toNNReal b)) := + (regimeDrift_continuous s a ε η hη N cap σ off).comp + ((regimeState_continuous s a ε η hη N cap σ off z b).comp continuous_real_toNNReal) + have hi := hc.intervalIntegrable (μ := volume) (u:ℝ) ((u+h:ℝ≥0):ℝ) + apply Prod.ext + · funext i + let L : RegimeState m →L[ℝ] State := (ContinuousLinearMap.proj i).comp (ContinuousLinearMap.fst ℝ _ _) + have he := L.intervalIntegral_comp_comm hi + change localState a η hη (z i) (u+h) b = localState a η hη (z i) u b+ + increment u h b • noise+L (∫ t in (u:ℝ)..((u+h:ℝ≥0):ℝ), A (V t.toNNReal b)) + rw [← he] + exact localState_eq a η hη (z i) u h b + · let L := ContinuousLinearMap.snd ℝ (Fin m → State) ℝ + have he := L.intervalIntegral_comp_comm hi + change (V (u+h) b).2 = (V u b).2+increment u h b • (0:ℝ)+L + (∫ t in (u:ℝ)..((u+h:ℝ≥0):ℝ), A (V t.toNNReal b)) + rw [smul_zero,add_zero,← he] + have hk : Continuous (fun t : ℝ => regimeDiscountCut s a ε η N cap σ off + (vectorState a η hη z t.toNNReal b)) := + (regimeDiscountCut_continuous s a ε η hη N cap σ off).comp + ((vectorState_continuous a η hη z b).comp continuous_real_toNNReal) + exact (intervalIntegral.integral_add_adjacent_intervals (μ := volume) (hk.intervalIntegrable 0 (u:ℝ)) + (hk.intervalIntegrable (u:ℝ) ((u+h:ℝ≥0):ℝ))).symm +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEFiniteTilt ExactSLECalculus +lemma regimeDiscount_congr {m : ℕ} (s : Finset (Fin m)) (a ε : ℝ) + (cap σ off : Fin m → ℝ) (v w : Fin m → State) (h : ∀ i∈s, v i=w i) : + regimeDiscount s a ε cap σ off v=regimeDiscount s a ε cap σ off w := by + unfold regimeDiscount + congr 1 + · congr 1 + apply Finset.sum_congr rfl + intro i hi + rw [h i hi] + · congr 1 + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + rw [h i hi,h j (Finset.mem_of_mem_erase hj)] + + +theorem vector_regime_weighted_optional {m : ℕ} (s : Finset (Fin m)) {a ε η : ℝ} + (ha : 1/4 b.1 t) W) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b≤T b) (hTB : ∀ b, T b≤B) + (E : Set Driver) (hE : MeasurableSet[hS.measurableSpace] E) + (w : Driver → ℝ) (hw : StronglyMeasurable[hS.measurableSpace] w) + (hw0 : ∀ b, 0≤w b) (C : ℝ) (hwb : ∀ b, ‖w b‖≤C) + (hws : ∀ b∉E, w b=0) + (hsafe : ∀ b∈E, ∀ t, S b≤t → t≤T b → + ‖regimeState s a ε η hη N cap σ off z t b‖≤N ∧ + ∀ i∈s, η≤Y (vectorState a η hη z t b i) ∧ + physicalDelta a (cap i) (σ i) (off i) (vectorState a η hη z t b i)≤1) : + ∫ b, w b*discountedProduct s a cap σ off + (regimeState s a ε η hη N cap σ off z (T b) b) ∂W ≤ + ∫ b, w b*discountedProduct s a cap σ off + (regimeState s a ε η hη N cap σ off z (S b) b) ∂W := by + obtain ⟨K,hK,hKb⟩ := regimeDrift_bound s a ε η hη N cap σ off + apply discounted_regime_weighted_optional s ha hε hsize cap σ off hσ W hW + (regimeState s a ε η hη N cap σ off z) + (regimeState_continuous s a ε η hη N cap σ off z) + (regimeState_adapted s a ε η hη N cap σ off z) + (regimeDrift s a ε η N cap σ off) + (regimeDrift_continuous s a ε η hη N cap σ off) K hK hKb + (regimeState_eq s a ε η hη N cap σ off z) + S T B N η hη hS hT hST hTB E hE w hw hw0 C hwb hws hsafe + intro b hb t hts htt + have hn := (hsafe b hb t hts htt).1 + have hy := (hsafe b hb t hts htt).2 + constructor + · change regimeDiscountCut s a ε η N cap σ off _ = _ + apply regimeDiscount_congr + intro i hi + apply regimeClamp_eq η N _ hη _ (hy i hi).1 + have hv : ‖vectorState a η hη z t b‖≤N := + (le_max_left _ _).trans hn + exact (norm_le_pi_norm _ i).trans hv + · intro i hi + exact cutoffDrift_eq_physical a η _ (hy i hi).1 +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEFiniteTilt ExactSLECalculus + + +theorem vector_regime_weighted_optional_bounded {m : ℕ} (s : Finset (Fin m)) {a ε η : ℝ} + (ha : 1/4 b.1 t) W) + (S T : Driver → ℝ≥0) (B : ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (hST : ∀ b, S b≤T b) (hTB : ∀ b, T b≤B) + (E : Set Driver) (hE : MeasurableSet[hS.measurableSpace] E) + (w : Driver → ℝ) (hw : StronglyMeasurable[hS.measurableSpace] w) + (hw0 : ∀ b, 0≤w b) (C : ℝ) (hwb : ∀ b, ‖w b‖≤C) + (hws : ∀ b∉E, w b=0) + (hsafe : ∀ b∈E, ∀ t, S b≤t → t≤T b → + ‖vectorState a η hη z t b‖≤M ∧ + ∀ i∈s, η≤Y (vectorState a η hη z t b i) ∧ + physicalDelta a (cap i) (σ i) (off i) (vectorState a η hη z t b i)≤1) : + ∫ b, w b*discountedProduct s a cap σ off + (regimeState s a ε η hη M cap σ off z (T b) b) ∂W ≤ + ∫ b, w b*discountedProduct s a cap σ off + (regimeState s a ε η hη M cap σ off z (S b) b) ∂W := by + obtain ⟨K,hK,hKb⟩ := regimeDrift_bound s a ε η hη M cap σ off + obtain ⟨L,hL,hLb⟩ := regimeDiscountCut_bound s a ε η hη M cap σ off + let N : ℝ≥0 := ⟨max M (L*B),le_trans M.coe_nonneg (le_max_left _ _)⟩ + have hb (b : Driver) (t : ℝ≥0) (ht : t≤B) : + ‖(regimeState s a ε η hη M cap σ off z t b).2‖≤L*B := by + change ‖∫ u in (0:ℝ)..(t:ℝ), regimeDiscountCut s a ε η M cap σ off + (vectorState a η hη z u.toNNReal b)‖≤_ + calc + _ ≤ L*|(t:ℝ)-0| := intervalIntegral.norm_integral_le_of_norm_le_const fun u _ => hLb _ + _ ≤ L*B := by rw [sub_zero,abs_of_nonneg t.coe_nonneg]; exact mul_le_mul_of_nonneg_left (by exact_mod_cast ht) hL + apply discounted_regime_weighted_optional s ha hε hsize cap σ off hσ W hW + (regimeState s a ε η hη M cap σ off z) + (regimeState_continuous s a ε η hη M cap σ off z) + (regimeState_adapted s a ε η hη M cap σ off z) + (regimeDrift s a ε η M cap σ off) + (regimeDrift_continuous s a ε η hη M cap σ off) K hK hKb + (regimeState_eq s a ε η hη M cap σ off z) + S T B N η hη hS hT hST hTB E hE w hw hw0 C hwb hws + · intro b he t hst htt + refine ⟨max_le ?_ ?_,(hsafe b he t hst htt).2⟩ + · exact (hsafe b he t hst htt).1.trans (le_max_left _ _) + · exact (hb b t (htt.trans (hTB b))).trans (le_max_right _ _) + · intro b he t hst htt + have hs := hsafe b he t hst htt + constructor + · change regimeDiscountCut s a ε η M cap σ off _ = _ + apply regimeDiscount_congr + intro i hi + exact regimeClamp_eq η M _ hη ((norm_le_pi_norm _ i).trans hs.1) (hs.2 i hi).1 + · intro i hi + exact cutoffDrift_eq_physical a η _ (hs.2 i hi).1 +end ExactSLEGreen + +namespace ExactSLEMain +open Set + +lemma upper_pair_norm_sq (z w : ℂ) : + ‖z-star w‖^2 = ‖z-w‖^2 + 4*z.im*w.im := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + Complex.star_def, Complex.conj_re, Complex.conj_im] + ring + +lemma upper_pair_norm_lt {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + ‖z-w‖ < ‖z-star w‖ := by + have h := upper_pair_norm_sq z w + have hp : 0 < 4*z.im*w.im := by positivity + nlinarith [norm_nonneg (z-w),norm_nonneg (z-star w)] + +lemma upper_harnack {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + z.im * (‖z-star w‖ - ‖z-w‖) ≤ w.im * (‖z-star w‖ + ‖z-w‖) := by + have hn : ‖z-w‖^2 = (z.re-w.re)^2+(z.im-w.im)^2 := by + rw [Complex.sq_norm] + simp [Complex.normSq_apply, pow_two] + have hd := upper_pair_norm_sq z w + have he : ((z.im+w.im)*‖z-w‖)^2 - ((z.im-w.im)*‖z-star w‖)^2 = + 4*z.im*w.im*(z.re-w.re)^2 := by + rw [mul_pow, mul_pow, hd, hn] + ring + have hs : ((z.im-w.im)*‖z-star w‖)^2 ≤ ((z.im+w.im)*‖z-w‖)^2 := by + have hp : 0 ≤ 4*z.im*w.im*(z.re-w.re)^2 := by positivity + linarith + have hh : (z.im-w.im)*‖z-star w‖ ≤ (z.im+w.im)*‖z-w‖ := + le_of_sq_le_sq hs (by positivity) + nlinarith + +lemma upper_velocity_harnack {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + (z.im/Complex.normSq z) * (‖z-star w‖ - ‖z-w‖) ≤ + (w.im/Complex.normSq w) * (‖z-star w‖ + ‖z-w‖) := by + have hzn : z ≠ 0 := by intro h; simp [h] at hz + have hwn : w ≠ 0 := by intro h; simp [h] at hw + have hzN := Complex.normSq_pos.mpr hzn + have hwN := Complex.normSq_pos.mpr hwn + have hi : (-z⁻¹).im = z.im/Complex.normSq z := by simp only [Complex.neg_im, Complex.inv_im]; ring + have hj : (-w⁻¹).im = w.im/Complex.normSq w := by simp only [Complex.neg_im, Complex.inv_im]; ring + have hn : ‖-z⁻¹ - -w⁻¹‖ = ‖z-w‖ / (‖z‖*‖w‖) := by + have he : -z⁻¹ - -w⁻¹ = (z-w)/(z*w) := by field_simp; ring + rw [he,norm_div,norm_mul] + have hd : ‖-z⁻¹ - star (-w⁻¹)‖ = ‖z-star w‖ / (‖z‖*‖w‖) := by + have hwc : star w ≠ 0 := star_ne_zero.mpr hwn + have he : -z⁻¹ - star (-w⁻¹) = (z-star w)/(z*star w) := by + simp only [star_neg,star_inv₀] + field_simp + ring + rw [he,norm_div,norm_mul,norm_star] + have h := upper_harnack (z := -z⁻¹) (w := -w⁻¹) + (by rw [hi]; positivity) (by rw [hj]; positivity) + rw [hi,hj,hn,hd,← sub_div,← add_div,← mul_div_assoc,← mul_div_assoc] at h + exact (div_le_div_iff_of_pos_right (mul_pos (norm_pos_iff.mpr hzn) (norm_pos_iff.mpr hwn))).mp h + +lemma upper_initial_growth {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + ‖z-w‖ ≤ 2*z.im * (‖z-w‖/‖z-star w‖) / (1-‖z-w‖/‖z-star w‖)^2 := by + have hnd := upper_pair_norm_lt hz hw + have hd : 0 < ‖z-star w‖ := (norm_nonneg _).trans_lt hnd + have hdiff : 0 < ‖z-star w‖ - ‖z-w‖ := sub_pos.mpr hnd + have htri : ‖z-star w‖ ≤ ‖z-w‖+2*z.im := by + have hh := norm_add_le (star z-w) (z-star z) + have he : star z-w+(z-star z) = z-w := by ring + have hh := norm_add_le (z-w) (w-star w) + have hh' := norm_add_le (star (z-w)) (z-star z) + have hnorm : ‖z-star z‖ = 2*z.im := by + have he : z-star z = (2*z.im : ℝ)*Complex.I := by + apply Complex.ext <;> simp + ring + rw [he,norm_mul,Complex.norm_real,Real.norm_eq_abs,Complex.norm_I,mul_one,abs_of_pos (by positivity)] + have he : star (z-w)+(z-star z) = z-star w := by simp only [star_sub]; ring + rw [he,norm_star,hnorm] at hh' + linarith + have hs : (‖z-star w‖-‖z-w‖)^2 ≤ 2*z.im*‖z-star w‖ := by + calc + (‖z-star w‖-‖z-w‖)^2 ≤ (2*z.im)*(‖z-star w‖-‖z-w‖) := by + nlinarith [mul_nonneg (show 0 ≤ 2*z.im-(‖z-star w‖-‖z-w‖) by linarith) hdiff.le] + _ ≤ _ := mul_le_mul_of_nonneg_left (sub_le_self _ (norm_nonneg _)) (by positivity) + have he : 2*z.im * (‖z-w‖/‖z-star w‖) / (1-‖z-w‖/‖z-star w‖)^2 = + ‖z-w‖ * (2*z.im*‖z-star w‖)/(‖z-star w‖-‖z-w‖)^2 := by + field_simp + rw [he] + exact (le_div_iff₀ (sq_pos_of_pos hdiff)).mpr (mul_le_mul_of_nonneg_left hs (norm_nonneg _)) + +end ExactSLEMain + +namespace ExactSLEMain +open Set + +lemma complex_linear_norm_deriv {f : ℝ → ℂ} {c : ℂ} {D : Set ℝ} {t : ℝ} + (hf : HasDerivWithinAt f (c*f t) D t) (hn : f t ≠ 0) : + HasDerivWithinAt (fun t => ‖f t‖) (c.re*‖f t‖) D t := by + have hN := norm_pos_iff.mpr hn + have h := hf.norm_sq.sqrt (pow_ne_zero 2 hN.ne') + simp only [Real.sqrt_sq (norm_nonneg _)] at h + convert h using 1 + try rfl + rw [Complex.inner, mul_assoc, Complex.mul_conj, Complex.mul_re] + simp only [Complex.ofReal_re,Complex.ofReal_im,mul_zero,sub_zero,Complex.normSq_eq_norm_sq] + field_simp + +lemma loewner_pair_drift (A : ℝ) {z w : ℂ} (_hz : z ≠ 0) (_hw : w ≠ 0) : + (-(A : ℂ)/(z*w)).re - (-(A : ℂ)/(z*star w)).re = + 2*A*(z.im/Complex.normSq z)*(w.im/Complex.normSq w) := by + simp only [div_eq_mul_inv, mul_inv_rev, Complex.mul_re, Complex.mul_im, + Complex.neg_re, Complex.neg_im, Complex.ofReal_re, Complex.ofReal_im, + Complex.inv_re, Complex.inv_im, Complex.star_def, Complex.conj_re,Complex.conj_im, + Complex.normSq_conj] + ring + +end ExactSLEMain + +namespace ExactSLEMain +open Set + +lemma growth_factor_deriv {D : Set ℝ} {t A v w : ℝ} {R r : ℝ → ℝ} + (hR : HasDerivWithinAt R (-2*A*v^2*R t) D t) + (hr : HasDerivWithinAt r (2*A*v*w*r t) D t) (hn : r t ≠ 1) : + HasDerivWithinAt (fun t => R t*r t/(1-r t)^2) + (2*A*R t*r t*v/(1-r t)^3 * (w*(1+r t)-v*(1-r t))) D t := by + have h := (hR.mul hr).div ((hr.const_sub 1).pow 2) (pow_ne_zero 2 (sub_ne_zero.mpr hn.symm)) + convert h using 1 + try rfl + simp only [Pi.pow_apply,Pi.mul_apply] + field_simp + ring + +lemma odeUntil_pair_ne {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z w : ℂ} {T : ℝ≥0} {f g : ℝ → ℂ} + (hf : odeUntil A b z T f) (hg : odeUntil A b w T g) (hzw : z ≠ w) + {u : ℝ} (hu : u ∈ Icc (0 : ℝ) T) : f u-g u ≠ 0 := by + have hsub : Icc (0 : ℝ) u.toNNReal ⊆ Icc (0 : ℝ) T := by + rw [Real.coe_toNNReal _ hu.1] + exact Icc_subset_Icc_right hu.2 + have hf' : odeUntil A b z u.toNNReal f := ⟨hf.1,fun s hs => + ⟨(hf.2 s (hsub hs)).1,((hf.2 s (hsub hs)).2).mono hsub⟩⟩ + have hg' : odeUntil A b w u.toNNReal g := ⟨hg.1,fun s hs => + ⟨(hg.2 s (hsub hs)).1,((hg.2 s (hsub hs)).2).mono hsub⟩⟩ + have he := loewner_solution_difference hb hf' hg' + rw [Real.coe_toNNReal _ hu.1] at he + rw [he] + exact mul_ne_zero (sub_ne_zero.mpr hzw) (Complex.exp_ne_zero _) + +lemma odeUntil_pair_ratio_deriv {A : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z w : ℂ} {T : ℝ≥0} {f g : ℝ → ℂ} + (hf : odeUntil A b z T f) (hg : odeUntil A b w T g) (hzw : z ≠ w) + {u : ℝ} (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt (fun u => ‖f u-g u‖/‖f u-star (g u)‖) + (2*A*((f u).im/Complex.normSq (f u-(b u.toNNReal : ℂ)))* + ((g u).im/Complex.normSq (g u-(b u.toNNReal : ℂ)))* + (‖f u-g u‖/‖f u-star (g u)‖)) (Icc (0 : ℝ) T) u := by + let Z := f u-(b u.toNNReal : ℂ) + let W := g u-(b u.toNNReal : ℂ) + have hZ : Z ≠ 0 := odeUntil_center_ne_zero hf hu + have hW : W ≠ 0 := odeUntil_center_ne_zero hg hu + have hD : f u-star (g u) ≠ 0 := norm_pos_iff.mp + ((norm_nonneg _).trans_lt (upper_pair_norm_lt (hf.2 u hu).1 (hg.2 u hu).1)) + have hd : HasDerivWithinAt (fun u => f u-g u) + ((-(A : ℂ)/(Z*W))*(f u-g u)) (Icc (0 : ℝ) T) u := by + convert (hf.2 u hu).2.sub (hg.2 u hu).2 using 1 + try rfl + dsimp [Z,W] + field_simp [odeUntil_center_ne_zero hf hu,odeUntil_center_ne_zero hg hu] + ring + have hc := Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp_hasDerivWithinAt u (hg.2 u hu).2 + change HasDerivWithinAt (fun s => star (g s)) (star ((A : ℂ)/W)) _ _ at hc + have he : HasDerivWithinAt (fun u => f u-star (g u)) + ((-(A : ℂ)/(Z*star W))*(f u-star (g u))) (Icc (0 : ℝ) T) u := by + convert (hf.2 u hu).2.sub hc using 1 + try rfl + simp only [star_div₀, Complex.star_def, Complex.conj_ofReal] + change -(A : ℂ)/(Z*star W)*(f u-star (g u)) = (A : ℂ)/Z-(A : ℂ)/star W + have he : f u-star (g u) = Z-star W := by simp [Z,W] + rw [he] + rw [div_sub_div _ _ hZ (star_ne_zero.mpr hW)] + ring + have hn := complex_linear_norm_deriv hd (odeUntil_pair_ne hb hf hg hzw hu) + have hm := complex_linear_norm_deriv he hD + have hh := hn.div hm (norm_ne_zero_iff.mpr hD) + convert hh using 1 + try rfl + have hi := loewner_pair_drift A hZ hW + have hiz : Z.im = (f u).im := by simp [Z] + have hiw : W.im = (g u).im := by simp [W] + rw [hiz,hiw] at hi + change (2*A*((f u).im/Complex.normSq Z)*((g u).im/Complex.normSq W))* + (‖f u-g u‖/‖f u-star (g u)‖) = _ + rw [← hi] + field_simp [norm_ne_zero_iff.mpr hD] + +end ExactSLEMain + +namespace ExactSLEMain +open Set + +end ExactSLEMain +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StochasticCalculus.lean b/lean/OAI/Probability/SLEGauge/StochasticCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..535c9c1352424b91931fbfe549cce46bbccb04a4 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StochasticCalculus.lean @@ -0,0 +1,430 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppingMeasurability + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + + + + + + +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +namespace ExactSLEGenerator +instance : MeasurableSpace C(ℝ≥0, ℝ) := borel _ +instance : BorelSpace C(ℝ≥0, ℝ) := ⟨rfl⟩ +abbrev Driver := {b : C(ℝ≥0, ℝ) // b 0 = 0} +instance : MeasurableSpace Driver := borel Driver +instance : BorelSpace Driver := ⟨rfl⟩ +lemma driver_eval_measurable (t : ℝ≥0) : StronglyMeasurable (fun b : Driver => b.1 t) := + ((continuous_eval_const t).comp continuous_subtype_val).stronglyMeasurable +noncomputable def rawFiltration : Filtration ℝ≥0 (borel Driver) := + Filtration.natural (fun t (b : Driver) => b.1 t) driver_eval_measurable + +def increment (s h : ℝ≥0) (b : Driver) : ℝ := b.1 (s+h) - b.1 s +lemma increment_measurable (s h : ℝ≥0) : Measurable (increment s h) := + (driver_eval_measurable (s+h)).measurable.sub (driver_eval_measurable s).measurable +lemma increment_law (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) : + HasLaw (increment s h) (gaussianReal 0 h) W := by + exact (hW.toIsPreBrownianReal.shift s).hasLaw_eval h +lemma increment_integrable (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) : + Integrable (increment s h) W := + (increment_law W hW s h).hasGaussianLaw.integrable +lemma increment_mean (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) : + ∫ b, increment s h b ∂W = 0 := by + rw [(increment_law W hW s h).integral_eq, integral_id_gaussianReal] +lemma increment_abs_moment_integrable (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) (n : ℕ) (hn : n ≠ 0) : + Integrable (fun b => |increment s h b| ^ n) W := by + simpa only [Real.norm_eq_abs] using + ((increment_law W hW s h).hasGaussianLaw.memLp (p := (n : ℝ≥0∞)) (by simp)).integrable_norm_pow hn +lemma increment_sq_integrable (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) : + Integrable (fun b => increment s h b ^ 2) W := by + simpa only [sq_abs] using increment_abs_moment_integrable W hW s h 2 (by norm_num) +lemma increment_second_moment (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) : + ∫ b, increment s h b ^ 2 ∂W = (h : ℝ) := by + have hg : ∫ x, x ^ 2 ∂gaussianReal 0 h = (h : ℝ) := by + have hg := variance_fun_id_gaussianReal (μ := 0) (v := h) + rw [variance_eq_integral (X := fun x : ℝ => x) measurable_id.aemeasurable, + integral_id_gaussianReal] at hg + simpa using hg + calc + _ = ∫ x, x ^ 2 ∂gaussianReal 0 h := + (increment_law W hW s h).integral_comp (measurable_id.pow_const 2).aestronglyMeasurable + _ = _ := hg + +noncomputable def absMoment (n : ℕ) : ℝ := ∫ x, |x| ^ n ∂gaussianReal 0 1 +lemma absMoment_nonneg (n : ℕ) : 0 ≤ absMoment n := + integral_nonneg fun value => pow_nonneg (abs_nonneg value) _ +lemma gaussian_abs_moment (h : ℝ≥0) (n : ℕ) : + ∫ x, |x| ^ n ∂gaussianReal 0 h = (Real.sqrt h) ^ n * absMoment n := by + have he : gaussianReal 0 h = (gaussianReal 0 1).map (fun x => Real.sqrt h * x) := by + rw [gaussianReal_map_const_mul] + congr 1 + · simp + · ext + simp only [NNReal.coe_mk, mul_one] + exact (Real.sq_sqrt h.coe_nonneg).symm + rw [he] + have hm : AEMeasurable (fun x : ℝ => Real.sqrt h * x) (gaussianReal 0 1) := + (measurable_const.mul measurable_id).aemeasurable + have hf : AEStronglyMeasurable (fun x : ℝ => |x| ^ n) + ((gaussianReal 0 1).map (fun x => Real.sqrt h * x)) := + ((measurable_id.abs).pow_const n).aestronglyMeasurable + rw [integral_map hm hf] + simp_rw [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _), mul_pow] + rw [integral_const_mul] + rfl +lemma increment_abs_moment (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) (n : ℕ) : + ∫ b, |increment s h b| ^ n ∂W = (Real.sqrt h) ^ n * absMoment n := by + calc + _ = ∫ x, |x| ^ n ∂gaussianReal 0 h := + (increment_law W hW s h).integral_comp ((measurable_id.abs).pow_const n).aestronglyMeasurable + _ = _ := gaussian_abs_moment h n + +lemma increment_indep (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) + {Z : Driver → ℝ} (hZ : Measurable[rawFiltration s] Z) : + IndepFun Z (increment s h) W := by + let fut : Driver → (ℝ≥0 → ℝ) := fun b t => b.1 (s+t) - b.1 s + have hi : Indep (rawFiltration s) (MeasurableSpace.comap fut inferInstance) W := by + rw [rawFiltration, Filtration.natural_eq_comap] + exact (IndepFun_iff_Indep _ _ _).mp (hW.toIsPreBrownianReal.indepFun_shift s).symm + apply (IndepFun_iff_Indep _ _ _).mpr + apply indep_of_indep_of_le hi hZ.comap_le + have hm : @Measurable Driver ℝ (MeasurableSpace.comap fut inferInstance) _ + (increment s h) := (measurable_pi_apply h).comp (comap_measurable fut) + exact hm.comap_le + +lemma increment_weighted_mean (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) + {Z : Driver → ℝ} (hZ : Measurable[rawFiltration s] Z) : + ∫ b, Z b * increment s h b ∂W = 0 := by + rw [(increment_indep W hW s h hZ).integral_fun_mul_eq_mul_integral + ((hZ.mono (rawFiltration.le s) le_rfl).aestronglyMeasurable) + (increment_measurable s h).aestronglyMeasurable, increment_mean W hW, mul_zero] + +lemma increment_weighted_second_moment (W : Measure Driver) + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) (s h : ℝ≥0) + {Z : Driver → ℝ} (hZ : Measurable[rawFiltration s] Z) : + ∫ b, Z b * increment s h b ^ 2 ∂W = (h : ℝ) * ∫ b, Z b ∂W := by + have hi : IndepFun Z (fun b => increment s h b ^ 2) W := + (increment_indep W hW s h hZ).comp measurable_id (measurable_id.pow_const 2) + rw [hi.integral_fun_mul_eq_mul_integral + ((hZ.mono (rawFiltration.le s) le_rfl).aestronglyMeasurable) + ((increment_measurable s h).pow_const 2).aestronglyMeasurable, + increment_second_moment W hW, mul_comm] + + + +theorem expected_taylor_step (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (s h : ℝ≥0) (F₀ F₁ Z Y V : Driver → ℝ) + (hF₀ : Integrable F₀ W) (hF₁ : Integrable F₁ W) (hV : Integrable V W) + (hZm : Measurable[rawFiltration s] Z) (hYm : Measurable[rawFiltration s] Y) + (hZi : Integrable Z W) (hYi : Integrable Y W) + (C K : ℝ) (_hC : 0 ≤ C) (_hK : 0 ≤ K) + (hTaylor : ∀ b, |F₁ b - F₀ b - Z b * increment s h b - + Y b * increment s h b ^ 2 / 2 - V b| ≤ + C * (K * h * (|increment s h b| + K * h) + |increment s h b| ^ 3)) : + |(∫ b, F₁ b ∂W) - (∫ b, F₀ b ∂W) - (h : ℝ) / 2 * (∫ b, Y b ∂W) - + (∫ b, V b ∂W)| ≤ + C * (K * h * (Real.sqrt h * absMoment 1 + K * h) + Real.sqrt h ^ 3 * absMoment 3) := by + have hprod : Integrable (fun b => Z b * increment s h b) W := + (increment_indep W hW s h hZm).integrable_mul hZi (increment_integrable W hW s h) + have hprod₂ : Integrable (fun b => Y b * increment s h b ^ 2 / 2) W := by + apply Integrable.div_const + exact ((increment_indep W hW s h hYm).comp measurable_id (measurable_id.pow_const 2)).integrable_mul + hYi (increment_sq_integrable W hW s h) + let R := fun b => F₁ b - F₀ b - Z b * increment s h b - Y b * increment s h b ^ 2 / 2 - V b + have hRi : Integrable R W := (((hF₁.sub hF₀).sub hprod).sub hprod₂).sub hV + have hright : Integrable (fun b => C * + (K * h * (|increment s h b| + K * h) + |increment s h b| ^ 3)) W := by + apply Integrable.const_mul + apply Integrable.add + · exact ((increment_integrable W hW s h).abs.add (integrable_const _)).const_mul _ + · exact increment_abs_moment_integrable W hW s h 3 (by norm_num) + have he : (∫ b, R b ∂W) = (∫ b, F₁ b ∂W) - (∫ b, F₀ b ∂W) - + (h : ℝ) / 2 * (∫ b, Y b ∂W) - (∫ b, V b ∂W) := by + dsimp [R] + have he₃ := integral_sub (((hF₁.sub hF₀).sub hprod).sub hprod₂) hV + have he₂ := integral_sub ((hF₁.sub hF₀).sub hprod) hprod₂ + have he₁ := integral_sub (hF₁.sub hF₀) hprod + simp only [Pi.sub_apply] at he₃ he₂ he₁ + rw [he₃, he₂, he₁, integral_sub hF₁ hF₀, + increment_weighted_mean W hW s h hZm, integral_div, + increment_weighted_second_moment W hW s h hYm] + ring + rw [← he] + calc + _ ≤ ∫ b, |R b| ∂W := by simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm R + _ ≤ ∫ b, C * (K * h * (|increment s h b| + K * h) + |increment s h b| ^ 3) ∂W := + integral_mono hRi.abs hright hTaylor + _ = _ := by + have ha := integral_add + (((increment_integrable W hW s h).abs.add (integrable_const (K * (h : ℝ)))).const_mul (K * (h : ℝ))) + (increment_abs_moment_integrable W hW s h 3 (by norm_num)) + have hb := integral_add (increment_integrable W hW s h).abs (integrable_const (K * (h : ℝ))) + simp only [Pi.add_apply] at ha hb + rw [integral_const_mul, ha, integral_const_mul, hb, + integral_const, probReal_univ, smul_eq_mul, one_mul, + increment_abs_moment W hW s h 3] + have habs := increment_abs_moment W hW s h 1 + simp only [pow_one] at habs + rw [habs] + + + +theorem expected_taylor_sum (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : Driver) => b.1 t) W) + (start : ℝ≥0) (N : ℕ) (h : ℝ≥0) (F Z Y V : ℕ → Driver → ℝ) + (hF : ∀ i, Integrable (F i) W) (hV : ∀ i, Integrable (V i) W) + (hZm : ∀ i : ℕ, Measurable[rawFiltration (start + i * h)] (Z i)) + (hYm : ∀ i : ℕ, Measurable[rawFiltration (start + i * h)] (Y i)) + (hZi : ∀ i, Integrable (Z i) W) (hYi : ∀ i, Integrable (Y i) W) + (C K : ℝ) (hC : 0 ≤ C) (hK : 0 ≤ K) + (hTaylor : ∀ i < N, ∀ b, |F (i+1) b - F i b - Z i b * increment (start+i*h) h b - + Y i b * increment (start+i*h) h b ^ 2 / 2 - V i b| ≤ + C * (K * h * (|increment (start+i*h) h b| + K * h) + |increment (start+i*h) h b| ^ 3)) : + |(∫ b, F N b ∂W) - (∫ b, F 0 b ∂W) - + ∑ i ∈ Finset.range N, ((h : ℝ) / 2 * (∫ b, Y i b ∂W) + (∫ b, V i b ∂W))| ≤ + (N : ℝ) * C * h * ((K * absMoment 1 + absMoment 3) * Real.sqrt h + K ^ 2 * h) := by + let e : ℕ → ℝ := fun i => (∫ b, F (i+1) b ∂W) - (∫ b, F i b ∂W) - + (h : ℝ) / 2 * (∫ b, Y i b ∂W) - (∫ b, V i b ∂W) + have he (i : ℕ) (hi : i < N) : |e i| ≤ + C * h * ((K * absMoment 1 + absMoment 3) * Real.sqrt h + K ^ 2 * h) := by + have hs := expected_taylor_step W hW (start+i*h) h (F i) (F (i+1)) (Z i) (Y i) (V i) + (hF i) (hF (i+1)) (hV i) (hZm i) (hYm i) (hZi i) (hYi i) C K hC hK (hTaylor i hi) + change |e i| ≤ _ at hs + convert hs using 1 + rw [show Real.sqrt h ^ 3 = (h : ℝ) * Real.sqrt h by rw [pow_succ, Real.sq_sqrt h.coe_nonneg]] + ring + have htel : ∑ i ∈ Finset.range N, e i = (∫ b, F N b ∂W) - (∫ b, F 0 b ∂W) - + ∑ i ∈ Finset.range N, ((h : ℝ) / 2 * (∫ b, Y i b ∂W) + (∫ b, V i b ∂W)) := by + have heq : e = fun i => ((∫ b, F (i+1) b ∂W) - (∫ b, F i b ∂W)) - + ((h : ℝ) / 2 * (∫ b, Y i b ∂W) + (∫ b, V i b ∂W)) := by + funext i + dsimp [e] + ring + rw [heq, Finset.sum_sub_distrib, Finset.sum_range_sub (fun i => ∫ b, F i b ∂W) N] + rw [← htel] + calc + _ ≤ ∑ i ∈ Finset.range N, |e i| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ _i ∈ Finset.range N, + C * h * ((K * absMoment 1 + absMoment 3) * Real.sqrt h + K ^ 2 * h) := + Finset.sum_le_sum fun i hi => he i (Finset.mem_range.mp hi) + _ = _ := by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; ring + + +lemma taylor_error_tendsto_zero (T C K : ℝ) : + Tendsto (fun n : ℕ => C * T * ((K * absMoment 1 + absMoment 3) * + Real.sqrt (T / (n+1 : ℕ)) + K ^ 2 * (T / (n+1 : ℕ)))) atTop (𝓝 0) := by + have h : Tendsto (fun n : ℕ => T / (n+1 : ℕ)) atTop (𝓝 0) := + (tendsto_const_div_atTop_nhds_zero_nat T).comp (tendsto_add_atTop_nat 1) + have hs : Tendsto (fun n : ℕ => Real.sqrt (T / (n+1 : ℕ))) atTop (𝓝 0) := by + simpa only [Function.comp_def, Real.sqrt_zero] using (Real.continuous_sqrt.tendsto 0).comp h + simpa using ((hs.const_mul (K * absMoment 1 + absMoment 3)).add (h.const_mul (K^2))).const_mul (C*T) +end ExactSLEGenerator + + + +open scoped Topology +open Set +namespace ExactSLEGenerator + +lemma scalar_taylor_cubic (f : ℝ → ℝ) (hf : ContDiff ℝ 3 f) + (C : ℝ) (hC : ∀ x, |iteratedDeriv 3 f x| ≤ C) (w : ℝ) : + |f w - f 0 - deriv f 0 * w - iteratedDeriv 2 f 0 * w ^ 2 / 2| ≤ + C * |w| ^ 3 := by + by_cases hw : w = 0 + · subst w + simp + have hn : (0 : ℝ) ≠ w := Ne.symm hw + obtain ⟨u, hu, he⟩ := taylor_mean_remainder_lagrange_iteratedDeriv (n := 2) hn hf.contDiffOn + have hid (n : ℕ) (hnn : n ≤ 3) : iteratedDerivWithin n f (Set.uIcc 0 w) 0 = + iteratedDeriv n f 0 := by + rw [iteratedDerivWithin_eq_iteratedFDerivWithin, iteratedDeriv_eq_iteratedFDeriv] + congr 1 + exact iteratedFDerivWithin_eq_iteratedFDeriv (uniqueDiffOn_uIcc hn) + ((hf.of_le (by exact_mod_cast hnn)).contDiffAt) (left_mem_uIcc) + have hp : taylorWithinEval f 2 (Set.uIcc 0 w) 0 w = + f 0 + deriv f 0 * w + iteratedDeriv 2 f 0 * w^2/2 := by + rw [taylorWithinEval_succ f 1 (Set.uIcc 0 w) 0 w, + taylorWithinEval_succ f 0 (Set.uIcc 0 w) 0 w, taylor_within_zero_eval] + rw [hid 1 (by norm_num), hid 2 (by norm_num)] + simp only [iteratedDeriv_one, sub_zero, Nat.factorial, Nat.cast_mul, Nat.cast_one, + zero_add, pow_one, smul_eq_mul] + ring + rw [hp] at he + have hh : |f w - f 0 - deriv f 0 * w - iteratedDeriv 2 f 0 * w ^ 2 / 2| = + |iteratedDeriv 3 f u| * |w| ^ 3 / 6 := by + have he' : f w - f 0 - deriv f 0 * w - iteratedDeriv 2 f 0 * w ^ 2 / 2 = + iteratedDeriv 3 f u * w ^ 3 / 6 := by + norm_num at he + linarith only [he] + rw [he', abs_div, abs_mul, abs_pow] + norm_num + rw [hh] + have hC0 : 0 ≤ C := (abs_nonneg _).trans (hC u) + calc + _ ≤ C * |w| ^ 3 / 6 := by gcongr; exact hC u + _ ≤ _ := by nlinarith [mul_nonneg hC0 (pow_nonneg (abs_nonneg w) 3)] + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma first_order_remainder (f : E → ℝ) (D : E → E →L[ℝ] ℝ) + (hD : ∀ x, HasFDerivAt f (D x) x) (C : ℝ) + (hLip : ∀ x y, ‖D y - D x‖ ≤ C * ‖y-x‖) (x v : E) : + |f (x+v) - f x - D x v| ≤ C * ‖v‖^2 := by + let F := fun u => f u - D x u + have hF : ∀ u ∈ Metric.closedBall x ‖v‖, + HasFDerivWithinAt F (D u - D x) (Metric.closedBall x ‖v‖) u := by + intro u hu + exact ((hD u).sub (D x).hasFDerivAt).hasFDerivWithinAt + have hbound : ∀ u ∈ Metric.closedBall x ‖v‖, ‖D u - D x‖ ≤ C * ‖v‖ := by + intro u hu + have hC : 0 ≤ C ∨ v = 0 := by + by_cases hv : v = 0 + · exact Or.inr hv + · left + have hp : 0 < ‖v‖ := norm_pos_iff.mpr hv + have ht := (norm_nonneg (D (x+v)-D x)).trans (hLip x (x+v)) + simp only [add_sub_cancel_left] at ht + exact nonneg_of_mul_nonneg_left ht hp + rcases hC with hC | rfl + · exact (hLip x u).trans (mul_le_mul_of_nonneg_left (by simpa [dist_eq_norm] using hu) hC) + · have hu' : u = x := by simpa using hu + subst u + simp + have hb := Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le hF hbound + (convex_closedBall x ‖v‖) (Metric.mem_closedBall_self (norm_nonneg v)) + (show x+v ∈ Metric.closedBall x ‖v‖ by simp [Metric.mem_closedBall, dist_eq_norm]) + simpa [F, map_add, Real.norm_eq_abs, pow_two, sub_eq_add_neg, add_assoc, add_left_comm, add_comm, + mul_assoc] using hb + + + +lemma mixed_taylor_remainder (f : E → ℝ) (D : E → E →L[ℝ] ℝ) + (hD : ∀ x, HasFDerivAt f (D x) x) (e : E) (he : ‖e‖ ≤ 1) + (C : ℝ) (hC : 0 ≤ C) + (hLip : ∀ x y, ‖D y - D x‖ ≤ C * ‖y-x‖) + (hSmooth : ∀ x, ContDiff ℝ 3 (fun w : ℝ => f (x + w • e))) + (hThird : ∀ x w, |iteratedDeriv 3 (fun r : ℝ => f (x + r • e)) w| ≤ C) + (x v : E) (w : ℝ) : + |f (x + w • e + v) - f x - D x e * w - + iteratedDeriv 2 (fun r : ℝ => f (x + r • e)) 0 * w^2/2 - D x v| ≤ + C * (‖v‖ * (|w| + ‖v‖) + |w|^3) := by + have hd : deriv (fun r : ℝ => f (x + r • e)) 0 = D x e := by + have hi := ((hasDerivAt_id (0 : ℝ)).smul_const e).const_add x + have ho := (hD (x + (0 : ℝ) • e)).comp_hasDerivAt 0 hi + simpa only [Function.comp_def, id_eq, zero_smul, one_smul, add_zero] using ho.deriv + have hb := scalar_taylor_cubic (fun r : ℝ => f (x + r • e)) (hSmooth x) C + (hThird x) w + rw [hd] at hb + simp only [zero_smul, add_zero] at hb + have hv := first_order_remainder f D hD C hLip (x + w • e) v + have hc : |(D (x+w•e)-D x) v| ≤ C * |w| * ‖v‖ := by + calc + _ ≤ ‖D (x+w•e)-D x‖ * ‖v‖ := by + simpa only [Real.norm_eq_abs] using (D (x+w•e)-D x).le_opNorm v + _ ≤ (C * ‖(x+w•e)-x‖) * ‖v‖ := by gcongr; exact hLip x (x+w•e) + _ = (C * (|w| * ‖e‖)) * ‖v‖ := by simp [norm_smul, Real.norm_eq_abs] + _ ≤ _ := by + have hw := mul_le_mul_of_nonneg_left he (abs_nonneg w) + simpa only [mul_one] using mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hw hC) (norm_nonneg v) + have hsum := (abs_add_le (f (x+w•e+v)-f (x+w•e)-D (x+w•e) v) + (f (x+w•e)-f x-D x e*w- + iteratedDeriv 2 (fun r : ℝ => f (x+r•e)) 0*w^2/2)).trans (add_le_add hv hb) + have hsum' := (abs_add_le ((f (x+w•e+v)-f (x+w•e)-D (x+w•e) v)+ + (f (x+w•e)-f x-D x e*w- + iteratedDeriv 2 (fun r : ℝ => f (x+r•e)) 0*w^2/2)) ((D (x+w•e)-D x) v)).trans + (add_le_add hsum hc) + have heq : ((f (x+w•e+v)-f (x+w•e)-D (x+w•e) v)+ + (f (x+w•e)-f x-D x e*w- + iteratedDeriv 2 (fun r : ℝ => f (x+r•e)) 0*w^2/2)) + ((D (x+w•e)-D x) v) = + f (x+w•e+v)-f x-D x e*w- + iteratedDeriv 2 (fun r : ℝ => f (x+r•e)) 0*w^2/2-D x v := by + simp only [sub_apply] + ring + rw [heq] at hsum' + calc + _ ≤ (C * ‖v‖^2 + C * |w|^3) + C * |w| * ‖v‖ := hsum' + _ = _ := by ring + +end ExactSLEGenerator + + +open MeasureTheory Filter +open scoped Topology +namespace ExactSLEGenerator + +lemma riemann_sum_error_le (f : ℝ → ℝ) (hf : Continuous f) (T : ℝ) (hT : 0 ≤ T) + (N : ℕ) (hN : 0 < N) (ε : ℝ) (_hε : 0 ≤ ε) + (hmod : ∀ u ∈ Set.Icc 0 T, ∀ v ∈ Set.Icc 0 T, + |u-v| ≤ T / N → |f u-f v| ≤ ε) : + |(∑ i ∈ Finset.range N, (T/N) * f (i*(T/N))) - ∫ s in 0..T, f s| ≤ ε*T := by + let h := T / (N : ℝ) + have hNr : 0 < (N : ℝ) := by exact_mod_cast hN + have hh : 0 ≤ h := div_nonneg hT hNr.le + have hNh : (N : ℝ) * h = T := by dsimp [h]; field_simp + let G : ℕ → ℝ := fun i => ∫ s in 0..(i : ℝ)*h, f s + have hG (i : ℕ) : ∫ s in (i : ℝ)*h..((i+1 : ℕ) : ℝ)*h, f s = G (i+1)-G i := by + have ha := intervalIntegral.integral_add_adjacent_intervals + (hf.intervalIntegrable (μ := volume) 0 ((i : ℝ)*h)) + (hf.intervalIntegrable (μ := volume) ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h)) + dsimp [G] + linarith only [ha] + have hdiff (i : ℕ) : ((i+1 : ℕ) : ℝ)*h-(i : ℝ)*h = h := by push_cast; ring + have he (i : ℕ) (hi : i < N) : |h*f ((i : ℝ)*h) - (G (i+1)-G i)| ≤ ε*h := by + have hai : (i : ℝ) * h ∈ Set.Icc 0 T := by + refine ⟨mul_nonneg (Nat.cast_nonneg _) hh, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi.le) hh + have hbi : ((i+1 : ℕ) : ℝ) * h ∈ Set.Icc 0 T := by + refine ⟨by positivity, ?_⟩ + rw [← hNh] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hi) hh + have hab : (i : ℝ)*h ≤ ((i+1 : ℕ) : ℝ)*h := by linarith [hdiff i] + have hbound : ∀ s ∈ Set.uIoc ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h), + ‖f ((i : ℝ)*h)-f s‖ ≤ ε := by + intro s hs + rw [Set.uIoc_of_le hab] at hs + rw [Real.norm_eq_abs] + apply hmod _ hai _ ⟨hai.1.trans hs.1.le, hs.2.trans hbi.2⟩ + rw [abs_of_nonpos (by linarith [hs.1])] + linarith [hs.2, hdiff i] + have hb := intervalIntegral.norm_integral_le_of_norm_le_const hbound + have hc : IntervalIntegrable (fun _ : ℝ => f ((i : ℝ)*h)) volume + ((i : ℝ)*h) (((i+1 : ℕ) : ℝ)*h) := intervalIntegrable_const + rw [intervalIntegral.integral_sub hc (hf.intervalIntegrable _ _), + intervalIntegral.integral_const, smul_eq_mul, hdiff, hG, Real.norm_eq_abs, + abs_of_nonneg hh] at hb + exact hb + have hs : ∑ i ∈ Finset.range N, (G (i+1)-G i) = ∫ s in 0..T, f s := by + rw [Finset.sum_range_sub] + simp [G, hNh] + change |(∑ i ∈ Finset.range N, h*f ((i : ℝ)*h)) - _| ≤ _ + rw [← hs, ← Finset.sum_sub_distrib] + calc + _ ≤ ∑ i ∈ Finset.range N, |h*f ((i : ℝ)*h)-(G (i+1)-G i)| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ _i ∈ Finset.range N, ε*h := Finset.sum_le_sum fun i hi => he i (Finset.mem_range.mp hi) + _ = ε*T := by simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul]; rw [← hNh]; ring + +end ExactSLEGenerator +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppedEstimates.lean b/lean/OAI/Probability/SLEGauge/StoppedEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..78828bcd5a44e1fcc8b8ec32c5547c327c791bd8 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppedEstimates.lean @@ -0,0 +1,469 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.EulerMoments + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +theorem expected_stopped_local {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (f : E × ℝ → ℝ) (K O : Set (E × ℝ)) + (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) (hf : ContDiffOn ℝ ∞ f O) + (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : (ℝ≥0 → ℝ) → ℝ) (mτ : Measurable τ) + (hτpast : ∀ (s : ℝ≥0) b c, (∀ u ≤ s, b u = c u) → ((s:ℝ) < τ b ↔ (s:ℝ) < τ c)) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ K) + (hgen : ∀ q ∈ K, + fderiv ℝ (fun x => f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => f (q.1,b))) q.2 / 2 ≤ 0) + (hz : (z,0) ∈ K) (ht : 0 ≤ t) : + (∫ b : Driver, f (g b (min t (τ b)), b (min t (τ b)).toNNReal) ∂W) ≤ f (z,0) := by + obtain ⟨G,hG,hGc,hGeq⟩ := Localization.compact_extension hK hO hKO f hf + obtain ⟨A,hA⟩ := exists_smoothTest_of_compact G hG hGc + have heq (q : E × ℝ) (hq : q ∈ K) : A.F q.1 q.2 = f q := by + rw [hA] + exact (hGeq q hq).self_of_nhds + have hDgen (q : E × ℝ) (hq : q ∈ K) : + A.D q.1 q.2 (v q.1 q.2)+deriv (deriv (A.F q.1)) q.2/2 ≤ 0 := by + have hx : (fun x => A.F x q.2) =ᶠ[𝓝 q.1] fun x => f (x,q.2) := by + rw [hA] + exact (hGeq q hq).comp_tendsto (continuousAt_id.prodMk continuousAt_const) + have hb : A.F q.1 =ᶠ[𝓝 q.2] fun b => f (q.1,b) := by + rw [hA] + exact (hGeq q hq).comp_tendsto (continuousAt_const.prodMk continuousAt_id) + rw [← (A.hD q.1 q.2).fderiv, hx.fderiv_eq, hb.deriv.deriv_eq] + exact hgen q hq + have hineq := expected_stopped_smooth hW A v mv g z hL hM hv hlip hg0 hder hcf + τ mτ hτpast hτ K hK.measurableSet hD hDgen ht + rw [heq (z,0) hz] at hineq + convert hineq using 1 + apply integral_congr_ae + filter_upwards [] with b + symm + apply heq (g b (min t (τ b)), b (min t (τ b)).toNNReal) + obtain ⟨ε,hε,hDb⟩ := hD b + exact hDb (min t (τ b)) ⟨le_min ht (hτ b).1,min_le_right _ _⟩ _ (by simpa using hε) + +end SLEExactGauge.BrownianCalculus + + + +noncomputable section +namespace SLEExactGauge + + +structure Parameter where + κ : ℝ + κ_pos : 0 < κ + κ_lt_eight : κ < 8 + +namespace Parameter + +def a (P : Parameter) : ℝ := 2 / P.κ +def d (P : Parameter) : ℝ := 1 + 1 / (4 * P.a) +def α (P : Parameter) : ℝ := 2 - P.d +def p (P : Parameter) : ℝ := 4 * P.a - 1 + +def q (P : Parameter) : ℝ := (1 / 2 : ℝ) * min 1 P.p +def η (P : Parameter) : ℝ := (1 - P.q) / (2 - P.q) +def M (P : Parameter) : ℝ := (1 + P.η) / (1 - 2 * P.η) +def β (P : Parameter) : ℝ := min 1 (P.a / (4 * P.M)) +def k (P : Parameter) : ℝ := P.q * (P.p - P.q) / 2 +def A (P : Parameter) : ℝ := P.p / 2 + (P.p - P.q) * (1 + P.q) / 2 + 2 +def h₀ (P : Parameter) : ℝ := (P.k / (2 * P.A)) ^ (1 / (2 - P.q)) +def C₁ (P : Parameter) : ℝ := P.A * P.h₀ ^ (-P.p) +def c₁ (P : Parameter) : ℝ := P.k / 2 + +def δ (P : Parameter) (U u : ℝ) : ℝ := Real.exp (-P.β * min u (U - u)) + +def f (P : Parameter) (δ s : ℝ) : ℝ := s ^ P.p + δ * (1 + s ^ P.q) +def D (P : Parameter) (δ s : ℝ) : ℝ := δ / P.f δ s * s ^ (P.q - 2) + +def drift (P : Parameter) (δ s σ : ℝ) : ℝ := + δ / P.f δ s * (P.p / 2 + (P.p - P.q) * (1 + P.q) / 2 * s ^ P.q - + P.k * s ^ (P.q - 2) + σ * (1 + s ^ P.q)) + +lemma a_gt_quarter (P : Parameter) : (1 / 4 : ℝ) < P.a := by + unfold a + apply (lt_div_iff₀ P.κ_pos).2 + linarith [P.κ_lt_eight] + +lemma p_pos (P : Parameter) : 0 < P.p := by + unfold p + linarith [P.a_gt_quarter] + +lemma q_pos (P : Parameter) : 0 < P.q := by + unfold q + exact mul_pos (by norm_num) (lt_min (by norm_num) P.p_pos) + +lemma q_le_half (P : Parameter) : P.q ≤ 1 / 2 := by + unfold q + linarith [min_le_left (1 : ℝ) P.p] + +lemma q_lt_one (P : Parameter) : P.q < 1 := by + linarith [P.q_le_half] + +lemma q_lt_p (P : Parameter) : P.q < P.p := by + unfold q + linarith [min_le_right (1 : ℝ) P.p, P.p_pos] + +lemma k_pos (P : Parameter) : 0 < P.k := by + unfold k + exact div_pos (mul_pos P.q_pos (sub_pos.mpr P.q_lt_p)) (by norm_num) + +lemma A_pos (P : Parameter) : 0 < P.A := by + unfold A + have := mul_pos (sub_pos.mpr P.q_lt_p) (by linarith [P.q_pos] : 0 < 1 + P.q) + linarith [P.p_pos] + +lemma β_le_one (P : Parameter) : P.β ≤ 1 := min_le_left _ _ + +lemma h₀_pos (P : Parameter) : 0 < P.h₀ := by + unfold h₀ + exact Real.rpow_pos_of_pos (div_pos P.k_pos (by linarith [P.A_pos])) _ + +lemma h₀_lt_one (P : Parameter) : P.h₀ < 1 := by + have hbase : P.k / (2 * P.A) < 1 := by + apply (div_lt_one (by linarith [P.A_pos])).2 + unfold k A + have hprod := mul_pos (sub_pos.mpr P.q_lt_p) + (by linarith [P.q_pos] : 0 < 2 + P.q) + nlinarith [P.p_pos] + exact Real.rpow_lt_one (div_nonneg P.k_pos.le (by linarith [P.A_pos])) hbase + (one_div_pos.mpr (by linarith [P.q_lt_one])) + +lemma h₀_power (P : Parameter) : P.h₀ ^ (P.q - 2) = 2 * P.A / P.k := by + have hb : 0 ≤ P.k / (2 * P.A) := + div_nonneg P.k_pos.le (by linarith [P.A_pos]) + have hq : 2 - P.q ≠ 0 := by linarith [P.q_lt_one] + have hexp : (1 / (2 - P.q)) * (P.q - 2) = (-1 : ℝ) := by + field_simp + ring + unfold h₀ + rw [← Real.rpow_mul hb, hexp, Real.rpow_neg_one] + simp only [inv_div] + +lemma f_pos (P : Parameter) {δ s : ℝ} (hδ : 0 < δ) (hs : 0 < s) : + 0 < P.f δ s := by + unfold f + positivity + + +def RegularizedDriftObligation : Prop := + ∀ (P : Parameter) (δ s σ : ℝ), 0 < δ → δ ≤ 1 → 0 < s → s ≤ 1 → + |σ| ≤ P.β → P.drift δ s σ ≤ P.C₁ * δ - P.c₁ * P.D δ s + + +theorem regularized_drift_bound : RegularizedDriftObligation := by + intro P δ s σ hδ _ hs hs_one hσ + have hf : 0 < P.f δ s := P.f_pos hδ hs + have hδf : 0 ≤ δ / P.f δ s := (div_pos hδ hf).le + have hsq : s ^ P.q ≤ 1 := Real.rpow_le_one hs.le hs_one P.q_pos.le + have hsq0 : 0 ≤ s ^ P.q := Real.rpow_nonneg hs.le _ + have hσ_one : σ ≤ 1 := (le_abs_self σ).trans (hσ.trans P.β_le_one) + have hσterm : σ * (1 + s ^ P.q) ≤ 2 := by + calc + _ ≤ 1 * (1 + s ^ P.q) := + mul_le_mul_of_nonneg_right hσ_one (by positivity) + _ ≤ 2 := by linarith + have hcoef : 0 ≤ (P.p - P.q) * (1 + P.q) / 2 := by + have := sub_pos.mpr P.q_lt_p + have := P.q_pos + positivity + have hbracket : P.p / 2 + (P.p - P.q) * (1 + P.q) / 2 * s ^ P.q + + σ * (1 + s ^ P.q) ≤ P.A := by + have hmul := mul_le_mul_of_nonneg_left hsq hcoef + unfold A + linarith + have hrew : P.drift δ s σ + P.c₁ * P.D δ s = + δ / P.f δ s * (P.p / 2 + (P.p - P.q) * (1 + P.q) / 2 * s ^ P.q + + σ * (1 + s ^ P.q) - P.k / 2 * s ^ (P.q - 2)) := by + unfold drift c₁ D + ring + have hbound : P.drift δ s σ + P.c₁ * P.D δ s ≤ + δ / P.f δ s * (P.A - P.k / 2 * s ^ (P.q - 2)) := by + rw [hrew] + exact mul_le_mul_of_nonneg_left (sub_le_sub_right hbracket _) hδf + have hgoal : P.drift δ s σ + P.c₁ * P.D δ s ≤ P.C₁ * δ := by + rcases le_total s P.h₀ with hsmall | hlarge + · have hexp : P.q - 2 ≤ 0 := by linarith [P.q_lt_one] + have hpow := Real.rpow_le_rpow_of_nonpos hs hsmall hexp + rw [P.h₀_power] at hpow + have hcancel : 2 * P.A ≤ s ^ (P.q - 2) * P.k := + (div_le_iff₀ P.k_pos).mp hpow + have hneg : P.A - P.k / 2 * s ^ (P.q - 2) ≤ 0 := by nlinarith + have hzero := mul_nonpos_of_nonneg_of_nonpos hδf hneg + have hc : 0 ≤ P.C₁ * δ := by + unfold C₁ + have := P.A_pos + have := P.h₀_pos + positivity + exact hbound.trans (hzero.trans hc) + · have hsp : P.h₀ ^ P.p ≤ s ^ P.p := + Real.rpow_le_rpow P.h₀_pos.le hlarge P.p_pos.le + have hflow : P.h₀ ^ P.p ≤ P.f δ s := by + unfold f + have hterm : 0 ≤ δ * (1 + s ^ P.q) := by positivity + linarith + have hdiv : δ / P.f δ s ≤ δ / P.h₀ ^ P.p := + div_le_div_of_nonneg_left hδ.le (Real.rpow_pos_of_pos P.h₀_pos _) hflow + have hdrop : P.A - P.k / 2 * s ^ (P.q - 2) ≤ P.A := by + have := P.k_pos + have := Real.rpow_pos_of_pos hs (P.q - 2) + nlinarith + calc + _ ≤ δ / P.f δ s * (P.A - P.k / 2 * s ^ (P.q - 2)) := hbound + _ ≤ δ / P.f δ s * P.A := mul_le_mul_of_nonneg_left hdrop hδf + _ ≤ δ / P.h₀ ^ P.p * P.A := mul_le_mul_of_nonneg_right hdiv P.A_pos.le + _ = P.C₁ * δ := by + unfold C₁ + rw [Real.rpow_neg P.h₀_pos.le] + ring + linarith + + +lemma η_pos (P : Parameter) : 0 < P.η := by + unfold η + exact div_pos (by linarith [P.q_lt_one]) (by linarith [P.q_lt_one]) + +lemma η_lt_half (P : Parameter) : P.η < 1 / 2 := by + unfold η + apply (div_lt_iff₀ (by linarith [P.q_lt_one] : 0 < 2 - P.q)).2 + linarith [P.q_pos] + +lemma η_exponent (P : Parameter) : (P.q - 2) * P.η = P.q - 1 := by + unfold η + have hq : 2 - P.q ≠ 0 := by linarith [P.q_lt_one] + field_simp + ring + +lemma M_pos (P : Parameter) : 0 < P.M := by + unfold M + exact div_pos (by linarith [P.η_pos]) (by linarith [P.η_lt_half]) + +lemma M_formula (P : Parameter) : P.M = 3 / P.q - 2 := by + have hq : P.q ≠ 0 := P.q_pos.ne' + have hq2 : 2 - P.q ≠ 0 := by linarith [P.q_lt_one] + have hη : 1 - 2 * P.η ≠ 0 := by linarith [P.η_lt_half] + unfold M + apply (div_eq_iff hη).2 + unfold η + field_simp + ring + +lemma β_pos (P : Parameter) : 0 < P.β := by + unfold β + exact lt_min (by norm_num) (div_pos (by linarith [P.a_gt_quarter]) (by + have := P.M_pos + positivity)) + +lemma interaction_exponent_lt (P : Parameter) : 2 * (P.M * P.β) < P.a := by + have h := min_le_right (1 : ℝ) (P.a / (4 * P.M)) + change P.β ≤ P.a / (4 * P.M) at h + have hM : 0 < 4 * P.M := by have := P.M_pos; positivity + have hb := (le_div_iff₀ hM).mp h + nlinarith [P.a_gt_quarter] + +lemma f_ge_δ (P : Parameter) {δ s : ℝ} (hδ : 0 ≤ δ) (hs : 0 ≤ s) : + δ ≤ P.f δ s := by + unfold f + have := Real.rpow_nonneg hs P.p + have := Real.rpow_nonneg hs P.q + nlinarith + +lemma f_le_three (P : Parameter) {δ s : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + (hs : 0 ≤ s) (hs1 : s ≤ 1) : P.f δ s ≤ 3 := by + have hp := Real.rpow_le_one hs hs1 P.p_pos.le + have hq := Real.rpow_le_one hs hs1 P.q_pos.le + have hnn := Real.rpow_nonneg hs P.q + unfold f + nlinarith + + +def angularDerivative (P : Parameter) (δ s c : ℝ) : ℝ := + (P.p * s ^ (P.p - 1) + δ * P.q * s ^ (P.q - 1)) * c + +lemma angularDerivative_bound (P : Parameter) {δ s c : ℝ} + (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hs : 0 < s) (hs1 : s ≤ 1) (hc : |c| ≤ 1) : + |P.angularDerivative δ s c| ≤ (P.p + P.q) * s ^ (P.q - 1) := by + have hpq : s ^ (P.p - 1) ≤ s ^ (P.q - 1) := + Real.rpow_le_rpow_of_exponent_ge hs hs1 (by linarith [P.q_lt_p]) + have hp0 := Real.rpow_nonneg hs.le (P.p - 1) + have hq0 := Real.rpow_nonneg hs.le (P.q - 1) + have hcoef : 0 ≤ P.p * s ^ (P.p - 1) + δ * P.q * s ^ (P.q - 1) := by + have := P.p_pos + have := P.q_pos + positivity + unfold angularDerivative + rw [abs_mul, abs_of_nonneg hcoef] + calc + _ ≤ (P.p * s ^ (P.p - 1) + δ * P.q * s ^ (P.q - 1)) * 1 := + mul_le_mul_of_nonneg_left hc hcoef + _ ≤ (P.p + P.q) * s ^ (P.q - 1) := by + have hfirst := mul_le_mul_of_nonneg_left hpq P.p_pos.le + have hsecond := mul_le_mul_of_nonneg_right hδ1 (mul_nonneg P.q_pos.le hq0) + nlinarith + + +theorem normalized_angularDerivative_bound (P : Parameter) {δ s c : ℝ} + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hs : 0 < s) (hs1 : s ≤ 1) (hc : |c| ≤ 1) : + |P.angularDerivative δ s c| / P.f δ s ≤ + (P.p + P.q) * (3 : ℝ) ^ P.η * δ ^ (-1 - P.η) * (P.D δ s) ^ P.η := by + have hf := P.f_pos hδ hs + have hfδ := P.f_ge_δ hδ.le hs.le + have hf3 := P.f_le_three hδ.le hδ1 hs.le hs1 + have hθ := P.angularDerivative_bound hδ.le hδ1 hs hs1 hc + have hbase : |P.angularDerivative δ s c| / P.f δ s ≤ + (P.p + P.q) / δ * s ^ (P.q - 1) := by + calc + _ ≤ ((P.p + P.q) * s ^ (P.q - 1)) / P.f δ s := + div_le_div_of_nonneg_right hθ hf.le + _ ≤ ((P.p + P.q) * s ^ (P.q - 1)) / δ := + div_le_div_of_nonneg_left (by have := P.p_pos; have := P.q_pos; positivity) + hδ hfδ + _ = (P.p + P.q) / δ * s ^ (P.q - 1) := by ring + have hD : (P.D δ s) ^ P.η = + δ ^ P.η / (P.f δ s) ^ P.η * s ^ (P.q - 1) := by + unfold D + rw [Real.mul_rpow (div_pos hδ hf).le (Real.rpow_nonneg hs.le _), + Real.div_rpow hδ.le hf.le, ← Real.rpow_mul hs.le, P.η_exponent] + have hδpow : δ ^ (-1 - P.η) * δ ^ P.η = δ⁻¹ := by + rw [← Real.rpow_add hδ] + convert Real.rpow_neg_one δ using 1 + congr 1 + ring + have hfη : (P.f δ s) ^ P.η ≤ (3 : ℝ) ^ P.η := + Real.rpow_le_rpow hf.le hf3 P.η_pos.le + have hratio : 1 ≤ (3 : ℝ) ^ P.η / (P.f δ s) ^ P.η := + (one_le_div (Real.rpow_pos_of_pos hf _)).2 hfη + rw [hD] + have hrew : (P.p + P.q) * (3 : ℝ) ^ P.η * δ ^ (-1 - P.η) * + (δ ^ P.η / (P.f δ s) ^ P.η * s ^ (P.q - 1)) = + ((P.p + P.q) / δ * s ^ (P.q - 1)) * + ((3 : ℝ) ^ P.η / (P.f δ s) ^ P.η) := by + calc + _ = (P.p + P.q) * s ^ (P.q - 1) * ((3 : ℝ) ^ P.η / + (P.f δ s) ^ P.η) * (δ ^ (-1 - P.η) * δ ^ P.η) := by ring + _ = _ := by rw [hδpow]; ring + rw [hrew] + exact hbase.trans (le_mul_of_one_le_right + (by have := P.p_pos; have := P.q_pos; positivity) hratio) + + +def angleGenerator (P : Parameter) (g : ℝ → ℝ) (θ : ℝ) : ℝ := + deriv (deriv g) θ / 2 + (1 - 2 * P.a) * (Real.cos θ / Real.sin θ) * deriv g θ + +lemma hasDerivAt_sinePower (r θ : ℝ) (hs : 0 < Real.sin θ) : + HasDerivAt (fun t : ℝ => Real.sin t ^ r) + (r * Real.cos θ * Real.sin θ ^ (r - 1)) θ := by + convert! (Real.hasDerivAt_sin θ).rpow_const (Or.inl hs.ne') using 1 + ring + +lemma hasDerivAt_sinePower_first (r θ : ℝ) (hs : 0 < Real.sin θ) : + HasDerivAt (fun t : ℝ => r * Real.cos t * Real.sin t ^ (r - 1)) + (r * (r - 1) * Real.cos θ ^ 2 * Real.sin θ ^ (r - 2) - r * Real.sin θ ^ r) θ := by + have hp : Real.sin θ ^ (r - 1) * Real.sin θ = Real.sin θ ^ r := by + convert! (Real.rpow_add_one hs.ne' (r - 1)).symm using 1 + congr 1 + ring + convert! ((Real.hasDerivAt_cos θ).const_mul r).mul + ((Real.hasDerivAt_sin θ).rpow_const (p := r - 1) (Or.inl hs.ne')) using 1 + rw [show r - 1 - 1 = r - 2 by ring] + rw [← hp] + ring + +lemma deriv_sinePower (r θ : ℝ) (hs : 0 < Real.sin θ) : + deriv (fun t : ℝ => Real.sin t ^ r) θ = r * Real.cos θ * Real.sin θ ^ (r - 1) := + (hasDerivAt_sinePower r θ hs).deriv + +lemma secondDeriv_sinePower (r θ : ℝ) (hs : 0 < Real.sin θ) : + deriv (deriv (fun t : ℝ => Real.sin t ^ r)) θ = + r * (r - 1) * Real.cos θ ^ 2 * Real.sin θ ^ (r - 2) - r * Real.sin θ ^ r := by + have heq : deriv (fun t : ℝ => Real.sin t ^ r) =ᶠ[nhds θ] + (fun t : ℝ => r * Real.cos t * Real.sin t ^ (r - 1)) := by + filter_upwards [Real.continuous_sin.continuousAt.eventually (Ioi_mem_nhds hs)] with t ht + exact deriv_sinePower r t ht + exact ((hasDerivAt_sinePower_first r θ hs).congr_of_eventuallyEq heq).deriv + + +theorem sine_generator (P : Parameter) (r θ : ℝ) (hs : 0 < Real.sin θ) : + P.angleGenerator (fun t : ℝ => Real.sin t ^ r) θ / (Real.sin θ ^ r) = + -r / 2 + r * (r - P.p) / 2 * (Real.cos θ / Real.sin θ) ^ 2 := by + have hpow1 : Real.sin θ ^ (r - 1) = Real.sin θ ^ r / Real.sin θ := by + rw [Real.rpow_sub hs, Real.rpow_one] + have hpow2 : Real.sin θ ^ (r - 2) = Real.sin θ ^ r / Real.sin θ ^ 2 := by + rw [Real.rpow_sub hs, Real.rpow_two] + have hsp : Real.sin θ ^ r ≠ 0 := (Real.rpow_pos_of_pos hs _).ne' + unfold angleGenerator + rw [secondDeriv_sinePower r θ hs, deriv_sinePower r θ hs, hpow1, hpow2] + unfold p + field_simp + ring + +lemma hasDerivAt_factor (P : Parameter) {δ θ : ℝ} (hs : 0 < Real.sin θ) : + HasDerivAt (fun t : ℝ => P.f δ (Real.sin t)) + (P.angularDerivative δ (Real.sin θ) (Real.cos θ)) θ := by + convert! (hasDerivAt_sinePower P.p θ hs).add + (((hasDerivAt_sinePower P.q θ hs).const_add 1).const_mul δ) using 1 + unfold angularDerivative + ring + + +def C₂ (P : Parameter) : ℝ := ((P.p + P.q) * (3 : ℝ) ^ P.η) ^ 2 + + +def youngConstant (P : Parameter) (C ε : ℝ) : ℝ := + (1 - 2 * P.η) * C ^ (1 / (1 - 2 * P.η)) * + (P.η / ε) ^ (2 * P.η / (1 - 2 * P.η)) + +lemma C₂_pos (P : Parameter) : 0 < P.C₂ := by + unfold C₂ + have := P.p_pos + have := P.q_pos + positivity + + + +end Parameter +end SLEExactGauge +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppedFiniteMass.lean b/lean/OAI/Probability/SLEGauge/StoppedFiniteMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..26186e0852320960176d36bacbb307b31cac8c79 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppedFiniteMass.lean @@ -0,0 +1,483 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TraceMassEndpoint + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma timeMassDensity_stopping_joint_measurable (a : ℝ) (ha : 1/4 + timeMassDensity a q (S p.1) p.1 p.2.1) := by + exact (timeMassDensity_joint_measurable a ha q hq hq1).comp + (((hS.measurable'.comp measurable_fst).prodMk measurable_fst).prodMk + (measurable_subtype_coe.comp measurable_snd)) + + + +def stoppedMassKernel (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + Kernel ExactSLEGenerator.Driver UpperPlane := + (Kernel.const ExactSLEGenerator.Driver upperArea).withDensity + (fun b z => timeMassDensity a q (S b) b z.1) + +instance stoppedMassKernel_sfinite (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + IsSFiniteKernel (stoppedMassKernel a q S) := + Kernel.IsSFiniteKernel.withDensity _ (fun b z => (timeMassDensity_finite a q (S b) b z.1).ne) + +lemma stoppedMassKernel_apply (a : ℝ) (ha : 1/4 actualUpperMass a q (S b) b) := by + have he : (fun b => actualUpperMass a q (S b) b) = + (fun b => stoppedMassKernel a q S b) := + funext (fun b => (stoppedMassKernel_apply a ha q hq hq1 S hS b).symm) + rw [he] + exact (stoppedMassKernel a q S).measurable + +lemma actualUpperMass_add_unhit (a : ℝ) (ha : 1/4 timeMassDensity a q ∞ b z.1) = + (fun z => timeMassDensity a q (S b) b z.1) + + (fun z => ENNReal.ofReal (unhitMassDensity a q (S b) b z)) := + funext (fun z => timeMassDensity_add_unhit a q (S b) b z) + rw [he,withDensity_add_left] + exact (timeMassDensity_stopping_joint_measurable a ha q hq hq1 S hS).comp + (measurable_const.prodMk measurable_id) + + + +theorem actualUpperMass_stopped_random_test (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 ∫⁻z, H (b,z) ∂actualUpperMass a q (S b) b) := by + simpa only [stoppedMassKernel_apply a ha q hq hq1 S hS] using + hH₀.lintegral_kernel_prod_right' (κ := stoppedMassKernel a q S) + simp_rw [actualUpperMass_add_unhit a ha q hq hq1 S hS, lintegral_add_measure] + rw [lintegral_add_left hmeas, unhitMassKernel_random_test a ha W hW q hq hq1 S hS H hH] + congr 1 + apply lintegral_congr + intro b + rw [stoppedRemainingKernel_apply a ha q hq hq1 S hS, + lintegral_withDensity_eq_lintegral_mul] + · exact lintegral_congr (fun z => mul_comm _ _) + · exact ((stoppedRemainingDensity_joint_measurable a ha q hq hq1 S hS).comp + (measurable_const.prodMk measurable_id)).ennreal_ofReal + · exact hH₀.comp (measurable_const.prodMk measurable_id) + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma remainingMassDensity_antitone_level (a : ℝ) (ha : 0 z.1.im*q n) atTop (𝓝 0) := by simpa using hlim.const_mul z.1.im + exact hconv.eventually (gt_mem_nhds hR) + filter_upwards [hqR] with n hn + have hnT : (t : ℝ≥0∞) ∫⁻b, ∫⁻z, H (b,z)* + ENNReal.ofReal (stoppedRemainingDensity a (q n) (S b) b z.1) ∂upperArea ∂W) + atTop (𝓝 (∫⁻b, ∫⁻z, H (b,z)* + ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂upperArea ∂W)) := by + have hm (n : ℕ) : Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + H p*ENNReal.ofReal (stoppedRemainingDensity a (q n) (S p.1) p.1 p.2.1)) := + hH.mul (stoppedRemainingDensity_joint_measurable a ha (q n) (hq n).1 (hq n).2 S hS).ennreal_ofReal + have hmono (b : ExactSLEGenerator.Driver) (z : UpperPlane) : + Monotone (fun n => H (b,z)*ENNReal.ofReal (stoppedRemainingDensity a (q n) (S b) b z.1)) := by + intro i j hij + exact mul_le_mul_right (ENNReal.ofReal_le_ofReal + (stoppedRemainingDensity_antitone_level a (by linarith) (S b) b z + (q j) (q i) (hq j).1 (hanti hij) (hq i).2)) _ + apply lintegral_tendsto_of_tendsto_of_monotone + · intro n + exact (hm n).lintegral_prod_right'.aemeasurable + · exact Eventually.of_forall (fun b i j hij => lintegral_mono (fun z => hmono b z hij)) + · filter_upwards [] with b + apply lintegral_tendsto_of_tendsto_of_monotone + · intro n + exact ((hm n).comp (measurable_const.prodMk measurable_id)).aemeasurable + · exact Eventually.of_forall (hmono b) + · filter_upwards [] with z + apply tendsto_const_nhds.congr' + filter_upwards [stoppedRemainingDensity_eventually_eq_surviving a (by linarith) + (S b) q hq hlim b z] with n hn + rw [hn] + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_stopped_remaining_spatial_L1 (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (K : Set UpperPlane) (hK : MeasurableSet K) + (hKfin : upperArea K<∞) (c : ℝ) (hc : 0 f p.1*stoppedSurvivingGreen a (S p.2) p.2 p.1.1) + ((upperArea.restrict K).prod W) ∧ + Tendsto (fun n => ∫p : UpperPlane × ExactSLEGenerator.Driver, + ‖f p.1*stoppedRemainingDensity a (q n) (S p.2) p.2 p.1.1-f p.1*stoppedSurvivingGreen a (S p.2) p.2 p.1.1‖ + ∂((upperArea.restrict K).prod W)) atTop (𝓝 0) + := by + let ν := upperArea.restrict K + have : IsFiniteMeasure ν := ⟨by simpa [ν] using hKfin⟩ + let F : UpperPlane × ExactSLEGenerator.Driver → ℝ := fun p => f p.1*stoppedSurvivingGreen a (S p.2) p.2 p.1.1 + let H : ℕ → UpperPlane × ExactSLEGenerator.Driver → ℝ := fun n p => f p.1*stoppedRemainingDensity a (q n) (S p.2) p.2 p.1.1 + have hHm (n : ℕ) : Measurable (H n) := + (hf.comp measurable_fst).mul ((stoppedRemainingDensity_joint_measurable a ha (q n) (hq n).1 (hq n).2 S hS).comp measurable_swap) + have hconv (p : UpperPlane × ExactSLEGenerator.Driver) : Tendsto (fun n => H n p) atTop (𝓝 (F p)) := + (stopped_remaining_to_surviving a ha (S p.2) q hq hlim p.2 p.1.1 p.1.2).const_mul (f p.1) + have hFm : Measurable F := measurable_of_tendsto_metrizable hHm (tendsto_pi_nhds.mpr hconv) + have hi (z : UpperPlane) : Integrable (fun b => F (z,b)) W := + (survivingGreen_optional_bound a ha W hW z S hS).1.const_mul (f z) + have he (z : UpperPlane) : (∫b,‖F (z,b)‖∂W) = ‖f z‖*(∫b,stoppedSurvivingGreen a (S b) b z.1∂W) := by + simp only [F,norm_mul,Real.norm_of_nonneg (stoppedSurvivingGreen_nonneg _ _ _ _),integral_const_mul] + let C := Real.exp (-alpha a*Real.log 2)*Real.exp (-alpha a*Real.log c) + have hC : 0≤C := by dsimp [C]; positivity + have hb (z : UpperPlane) (hz : z∈K) : (∫b,‖F (z,b)‖∂W)≤B*C := by + rw [he] + have hG := (survivingGreen_optional_bound a ha W hW z S hS).2 + have hgreen : physicalGreen a (z.1,0)≤Real.exp (-alpha a*Real.log c) := by + apply physicalGreen_bound a c ha hc _ z.2 + simpa [physicalRadius,Y] using hcK z hz + have hpos : 0≤(∫b,stoppedSurvivingGreen a (S b) b z.1∂W) := integral_nonneg (fun b => stoppedSurvivingGreen_nonneg _ _ _ _) + exact mul_le_mul (hfB z hz) (hG.trans (mul_le_mul_of_nonneg_left hgreen (Real.exp_pos _).le)) + hpos hB + have hFi : Integrable F (ν.prod W) := by + apply (integrable_prod_iff hFm.aestronglyMeasurable).mpr + refine ⟨Eventually.of_forall hi,?_⟩ + apply Integrable.of_bound (hFm.aestronglyMeasurable.norm.integral_prod_right') (B*C) + filter_upwards [ae_restrict_mem hK] with z hz + rw [Real.norm_of_nonneg (integral_nonneg (fun b => norm_nonneg (F (z,b))))] + exact hb z hz + refine ⟨hFi,?_⟩ + have hD : Integrable (fun p => 2*‖F p‖) (ν.prod W) := hFi.norm.const_mul 2 + have hbound (n : ℕ) (p : UpperPlane × ExactSLEGenerator.Driver) : ‖H n p-F p‖≤2*‖F p‖ := by + have hle : ‖H n p‖≤‖F p‖ := by + dsimp only [H,F] + rw [norm_mul,norm_mul,Real.norm_of_nonneg (stoppedRemainingDensity_nonneg _ _ _ _ _), + Real.norm_of_nonneg (stoppedSurvivingGreen_nonneg _ _ _ _)] + exact mul_le_mul_of_nonneg_left (stoppedRemainingDensity_le_surviving _ _ _ _ _ p.1.2) (norm_nonneg _) + calc ‖H n p-F p‖≤‖H n p‖+‖F p‖ := norm_sub_le _ _ + _≤2*‖F p‖ := by linarith + have hlim' := tendsto_integral_of_dominated_convergence (fun p => 2*‖F p‖) + (fun n => ((hHm n).sub hFm).norm.aestronglyMeasurable) hD + (fun n => Eventually.of_forall (fun p => by simpa using hbound n p)) + (Eventually.of_forall (fun p => by simpa using ((hconv p).sub_const (F p)).norm)) + simpa using hlim' + +lemma actualUpper_stopped_remaining_integral_tendsto (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (f : C_c(UpperPlane,ℝ)) (U : Set ExactSLEGenerator.Driver) + (q : ℕ → ℝ) (hq : ∀n,0 ∫b in U, (∫z : UpperPlane,f z*stoppedRemainingDensity a (q n) (S b) b z.1∂upperArea) ∂W) + atTop (𝓝 (∫b in U, (∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1∂upperArea) ∂W)) := by + let K := tsupport f + have hK : IsCompact K := f.hasCompactSupport + have hfin : upperArea K<∞ := by + rw [upperArea,upper_embedding.comap_apply] + exact (hK.image continuous_subtype_val).measure_lt_top + have : IsFiniteMeasure (upperArea.restrict K) := ⟨by simpa using hfin⟩ + obtain ⟨c,hc,hcK⟩ := upper_compact_lower K hK + obtain ⟨B,hB,hBf⟩ := upperExtension_bounded f + have H := actual_stopped_remaining_spatial_L1 a ha W hW S hS K hK.measurableSet hfin (c/2) (by positivity) + (fun z hz => by have := hcK z hz; linarith) f f.continuous.measurable B hB + (fun z hz => by simpa only [upperExtension_apply] using hBf z.1 ⟨z,hz,rfl⟩) q hq hlim + let F : UpperPlane × ExactSLEGenerator.Driver → ℝ := fun p => f p.1*stoppedSurvivingGreen a (S p.2) p.2 p.1.1 + let R : ℕ → UpperPlane × ExactSLEGenerator.Driver → ℝ := fun n p => f p.1*stoppedRemainingDensity a (q n) (S p.2) p.2 p.1.1 + let μ := (upperArea.restrict K).prod (W.restrict U) + have hFi : Integrable F μ := H.1.mono_measure (Measure.prod_mono le_rfl Measure.restrict_le_self) + have hRm (n : ℕ) : Measurable (R n) := + (f.continuous.measurable.comp measurable_fst).mul + ((stoppedRemainingDensity_joint_measurable a ha (q n) (hq n).1 (hq n).2 S hS).comp measurable_swap) + have hbound (n : ℕ) (p : UpperPlane × ExactSLEGenerator.Driver) : ‖R n p‖≤‖F p‖ := by + dsimp only [R,F] + rw [norm_mul,norm_mul,Real.norm_of_nonneg (stoppedRemainingDensity_nonneg _ _ _ _ _), + Real.norm_of_nonneg (stoppedSurvivingGreen_nonneg _ _ _ _)] + exact mul_le_mul_of_nonneg_left (stoppedRemainingDensity_le_surviving _ _ _ _ _ p.1.2) (norm_nonneg _) + have hRi (n : ℕ) : Integrable (R n) μ := hFi.norm.mono' (hRm n).aestronglyMeasurable + (Eventually.of_forall (hbound n)) + have ht := tendsto_integral_of_dominated_convergence (fun p => ‖F p‖) + (fun n => (hRm n).aestronglyMeasurable) hFi.norm (fun n => Eventually.of_forall (hbound n)) + (Eventually.of_forall (fun p => (stopped_remaining_to_surviving a ha (S p.2) q hq hlim p.2 p.1.1 p.1.2).const_mul (f p.1))) + have he (g : UpperPlane → ℝ) : (∫z in K,f z*g z∂upperArea) = ∫z,f z*g z∂upperArea := + setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz => by rw [image_eq_zero_of_notMem_tsupport hz,zero_mul]) + have hRint (n : ℕ) : (∫p,R n p∂μ) = ∫b in U,(∫z : UpperPlane,f z*stoppedRemainingDensity a (q n) (S b) b z.1∂upperArea)∂W := by + rw [integral_prod_symm (R n) (hRi n)] + apply integral_congr_ae + filter_upwards [] with b + exact he _ + have hFint : (∫p,F p∂μ) = ∫b in U,(∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1∂upperArea)∂W := by + rw [integral_prod_symm F hFi] + apply integral_congr_ae + filter_upwards [] with b + exact he _ + change Tendsto (fun n => ∫p,R n p∂μ) atTop (𝓝 (∫p,F p∂μ)) at ht + simpa only [hRint,hFint] using ht + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma actualUpperMass_stopped_norm_bound (a : ℝ) (ha : 1/4 norm_nonneg _)) + f.integrable.norm) + + + +theorem actualUpperMass_stopped_Lp_bound (a : ℝ) (ha : 1/4 b.1 t) W) + (m : ℕ) (hm : 1 ≤ m) (f : C_c(UpperPlane,ℝ)) : + ∃ C : ℝ≥0∞, C<∞ ∧ ∀ q : ℝ, 0 ∫z, f z ∂actualUpperMass a q (S b) b) (m : ℝ≥0∞) W ∧ + eLpNorm (fun b => ∫z, f z ∂actualUpperMass a q (S b) b) (m : ℝ≥0∞) W ≤ C := by + let g : C_c(UpperPlane,ℝ) := ⟨⟨fun z => ‖f z‖,f.continuous.norm⟩,f.hasCompactSupport.norm⟩ + obtain ⟨C,hC,hCb⟩ := actualUpperMass_Lp_bound a ha W hW m hm g + refine ⟨C,hC,fun q hq hq1 S hS => ?_⟩ + have hmeas : StronglyMeasurable (fun b => ∫z, f z ∂actualUpperMass a q (S b) b) := by + simpa [stoppedMassKernel_apply a ha q hq hq1 S hS] using + (f.continuous.measurable.stronglyMeasurable.integral_kernel + (κ := stoppedMassKernel a q S)) + have hb : ∀ᵐ b ∂W, ‖∫z, f z ∂actualUpperMass a q (S b) b‖ ≤ + ∫z, g z ∂actualUpperMass a q ∞ b := + Eventually.of_forall (fun b => actualUpperMass_stopped_norm_bound a ha q hq hq1 (S b) b f) + refine ⟨(hCb q hq hq1 ∞).1.mono' hmeas.aestronglyMeasurable hb,?_⟩ + exact (eLpNorm_mono_ae hmeas.aestronglyMeasurable (hb.mono (fun _ h => h.trans (le_abs_self _)))).trans + (hCb q hq hq1 ∞).2 + +lemma actualUpperMass_stopped_eval_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 ∫z, f z ∂actualUpperMass a q (S b) b) W := by + obtain ⟨C,hC,hCb⟩ := actualUpperMass_stopped_Lp_bound a ha W hW 1 le_rfl f + exact (hCb q hq hq1 S hS).1.integrable (by norm_num) + +lemma stoppedRemainingKernel_compact_eval (a : ℝ) (ha : 1/4 ENNReal.ofReal_lt_top) + + + +theorem actualUpperMass_stopped_finite_kernel (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 + stoppedRemainingKernel_compact_eval a ha q hq hq1 S hS b f)) + + + +theorem actualUpperMass_stopped_convex_potential_limit (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℕ → ℝ) (hq : ∀ n, 0 ∫b in U, + ∑j∈s k,c k j*((∫z, f z ∂actualUpperMass a (q j) ∞ b)- + (∫z, f z ∂actualUpperMass a (q j) (S b) b)) ∂W) + atTop (𝓝 (∫b in U, (∫z : UpperPlane, f z*stoppedSurvivingGreen a (S b) b z.1 ∂upperArea) ∂W)) := by + have hpot := actualUpper_stopped_remaining_integral_tendsto a ha W hW S hS f U q hq hlim + have hcombo := scalar_convex_tail_limit s c hs hc hsum _ _ hpot + have he (k : ℕ) : (∫b in U, + ∑j∈s k,c k j*((∫z, f z ∂actualUpperMass a (q j) ∞ b)- + (∫z, f z ∂actualUpperMass a (q j) (S b) b)) ∂W) = + ∑j∈s k,c k j*(∫b in U, + (∫z : UpperPlane, f z*stoppedRemainingDensity a (q j) (S b) b z.1 ∂upperArea) ∂W) := by + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro j hj + rw [integral_const_mul, actualUpperMass_stopped_finite_kernel a ha W hW + (q j) (hq j).1 (hq j).2 S hS f U hU] + · intro j hj + exact (((actualUpperMass_stopped_eval_integrable a ha W hW (q j) (hq j).1 (hq j).2 + (fun _ => ∞) (fun t => by simp) f).sub + (actualUpperMass_stopped_eval_integrable a ha W hW (q j) (hq j).1 (hq j).2 S hS f)).const_mul + (c k j)).restrict + simpa only [he] using hcombo + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppedLimits.lean b/lean/OAI/Probability/SLEGauge/StoppedLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..78204e3d71011b78cbb9b012cad2c3586f46a2bf --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppedLimits.lean @@ -0,0 +1,484 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.EulerConvergence + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + + + +theorem expected_stopped_local_eq {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (f : E × ℝ → ℝ) (K O : Set (E × ℝ)) + (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) (hf : ContDiffOn ℝ ∞ f O) + (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : (ℝ≥0 → ℝ) → ℝ) (mτ : Measurable τ) + (hτpast : ∀ (s : ℝ≥0) b c, (∀ u ≤ s, b u = c u) → ((s:ℝ) < τ b ↔ (s:ℝ) < τ c)) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ K) + (hgen : ∀ q ∈ K, + fderiv ℝ (fun x => f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => f (q.1,b))) q.2 / 2 = 0) + (hz : (z,0) ∈ K) (ht : 0 ≤ t) : + (∫ b : Driver, f (g b (min t (τ b)), b (min t (τ b)).toNNReal) ∂W) = f (z,0) := by + have hle := expected_stopped_local hW f K O hK hO hKO hf v mv g z hL hM hv hlip + hg0 hder hcf τ mτ hτpast hτ hD (fun q hq => (hgen q hq).le) hz ht + have hneg : ∀ q ∈ K, + fderiv ℝ (fun x => -f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => -f (q.1,b))) q.2 / 2 ≤ 0 := by + intro q hq + have hfd : DifferentiableAt ℝ (fun x => f (x,q.2)) q.1 := + ((hf q (hKO hq)).contDiffAt (hO.mem_nhds (hKO hq))).differentiableAt (by simp) |>.comp q.1 + (by fun_prop) + rw [fderiv_fun_neg] + simp only [neg_apply,deriv.fun_neg',deriv.fun_neg] + linarith [hgen q hq] + have hge := expected_stopped_local hW (fun q => -f q) K O hK hO hKO hf.neg v mv g z hL hM hv hlip + hg0 hder hcf τ mτ hτpast hτ hD hneg hz ht + rw [integral_neg] at hge + linarith +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.OnePoint +open Parameter AngleCalculus +open scoped ContDiff +abbrev State := ℝ × ℂ + +def domain : Set (State × ℝ) := {q | 0 < q.1.2.im} +def field (P : Parameter) (x : State) (b : ℝ) : State := + ((V (x.2-b))^2, (P.a:ℂ)/(x.2-b)) + +def green (P : Parameter) (q : State × ℝ) : ℝ := + Real.exp (P.p*q.1.1/2) * Real.sin (q.1.2-q.2).arg ^ P.p + +lemma isOpen_domain : IsOpen domain := by + exact isOpen_lt continuous_const (by fun_prop) + +lemma green_nonneg (P : Parameter) {q : State × ℝ} (hq : q ∈ domain) : 0 ≤ green P q := by + exact mul_nonneg (Real.exp_pos _).le (Real.rpow_nonneg (sin_angle_pos (by simpa [domain] using hq)).le _) + +lemma green_le (P : Parameter) {s : ℝ} {q : State × ℝ} (hu : q.1.1 ≤ s) + (hq : q ∈ domain) : green P q ≤ Real.exp (P.p*s/2) := by + have hs : 0 < Real.sin (q.1.2-(q.2:ℂ)).arg := sin_angle_pos (by simpa [domain] using hq) + have hp : Real.sin (q.1.2-(q.2:ℂ)).arg ^ P.p ≤ 1 := + Real.rpow_le_one hs.le (Real.sin_le_one _) P.p_pos.le + calc + green P q ≤ Real.exp (P.p*q.1.1/2) := by + exact mul_le_of_le_one_right (Real.exp_pos _).le hp + _ ≤ Real.exp (P.p*s/2) := Real.exp_le_exp.mpr (by nlinarith [P.p_pos]) + +lemma contDiffOn_green (P : Parameter) : ContDiffOn ℝ ∞ (green P) domain := by + intro q hq + apply ContDiffAt.contDiffWithinAt + have hh : 0 < (q.1.2-(q.2:ℂ)).im := by simpa [domain] using hq + have ha := (contDiffAt_arg_real (show q.1.2-(q.2:ℂ) ∈ Complex.slitPlane from Or.inr hh.ne') ∞).comp q + (show ContDiffAt ℝ ∞ (fun r : State × ℝ => r.1.2-(r.2:ℂ)) q from + (contDiffAt_snd.comp q contDiffAt_fst).sub + (Complex.ofRealCLM.contDiff.contDiffAt.comp q contDiffAt_snd)) + have hs := ha.sin.rpow_const_of_ne (p := P.p) (sin_angle_pos hh).ne' + exact (show ContDiffAt ℝ ∞ (fun r : State × ℝ => Real.exp (P.p*r.1.1/2)) q by fun_prop).mul hs + +lemma green_generator (P : Parameter) {q : State × ℝ} (hq : q ∈ domain) : + fderiv ℝ (fun x => green P (x,q.2)) q.1 (field P q.1 q.2) + + deriv (deriv (fun b => green P (q.1,b))) q.2 / 2 = 0 := by + rcases q with ⟨⟨u,z⟩,b⟩ + have hy : 0 < z.im := hq + have hs : 0 < Real.sin (z-(b:ℂ)).arg := sin_angle_pos (by simpa using hy) + have hphy := physical_generator_angle P.a (fun θ => Real.sin θ^P.p) + (fun θ hθ => (hasDerivAt_sinePower P.p θ hθ).differentiableAt.hasDerivAt) + (fun θ hθ => by + have he : deriv (fun t => Real.sin t^P.p) =ᶠ[𝓝 θ] fun t => P.p*Real.cos t*Real.sin t^(P.p-1) := by + filter_upwards [Real.continuous_sin.continuousAt.eventually (Ioi_mem_nhds hθ)] with t ht + exact deriv_sinePower P.p t ht + exact ((hasDerivAt_sinePower_first P.p θ hθ).congr_of_eventuallyEq he).differentiableAt.hasDerivAt) + hy b + have hzero := P.shifted_sine_generator P.p (z-b).arg hs + simp only [sub_self,zero_mul,mul_zero,zero_div] at hzero + have heq : (fun x : State => green P (x,b)) = fun x => 3*P.physicalFactor (fun _ => 0) x b := by + funext x + simp only [green,Parameter.physicalFactor,Parameter.f,zero_mul,add_zero] + ring + have hfd := P.contDiffAt_physical_factor (fun _ => 0) u b z hy ∞ contDiffAt_const + rw [heq,fderiv_const_mul (hfd.differentiableAt (by simp))] + simp only [smul_apply,smul_eq_mul] + rw [P.physical_factor_state_derivative (fun _ => 0) u 0 b _ z _ hy (by simpa using hasDerivAt_const u (0:ℝ))] + simp only [Parameter.f,zero_mul,add_zero] + have hsecond : deriv (deriv (fun c => green P ((u,z),c))) b = + Real.exp (P.p*u/2)*deriv (deriv (fun c : ℝ => Real.sin (z-c).arg^P.p)) b := by + change deriv (deriv (fun c : ℝ => Real.exp (P.p*u/2)*Real.sin (z-c).arg^P.p)) b = _ + rw [deriv_const_mul_field',deriv_const_mul_field] + rw [hsecond] + unfold physicalGenerator at hphy + change _ = (V (z-b))^2*P.angleGenerator (fun θ => Real.sin θ^P.p) (z-b).arg at hphy + dsimp [field] + linear_combination Real.exp (P.p*u/2)*hphy + Real.exp (P.p*u/2)*(V (z-b))^2*hzero +end SLEExactGauge.OnePoint + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] +omit [CompleteSpace E] in +theorem expected_stopped_smooth_grid {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (A : SmoothTest E) (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : Driver → ℝ) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (D : Set (E × ℝ)) (_mD : MeasurableSet D) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ D) + (hgen : ∀ x ∈ D, A.D x.1 x.2 (v x.1 x.2)+deriv (deriv (A.F x.1)) x.2/2 ≤ 0) + (S : ℝ≥0 → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mS : ∀ r, MeasurableSet (S r)) + (hSpast : ∀ r b c, (∀ u ≤ r, b u = c u) → ∀ x, ((b,x) ∈ S r ↔ (c,x) ∈ S r)) + (hSeq : ∀ (b : Driver) r x, (((b:ℝ≥0 → ℝ),x) ∈ S r ↔ (r:ℝ) < τ b ∧ x ∈ D)) + (hSD : ∀ r q, q ∈ S r → q.2 ∈ D) + (ht : 0 ≤ t) : + (∫ b : Driver, A.F (g b (min t (τ b))) (b (min t (τ b)).toNNReal) ∂W) ≤ A.F z 0 := by + let h : ℕ → ℝ≥0 := fun n => (1/2)^n + have hh : ∀ n, 0 < h n := fun n => pow_pos (by norm_num) n + have hh0 : Tendsto (fun n => (h n:ℝ)) atTop (𝓝 0) := by + simp only [h,NNReal.coe_pow,NNReal.coe_div,NNReal.coe_one,NNReal.coe_ofNat] + exact tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + let U : ℕ → ℕ → Set ((ℝ≥0 → ℝ) × (E × ℝ)) := fun n k => S ((k:ℝ≥0)*h n) + have mU : ∀ n k, MeasurableSet (U n k) := fun n k => mS _ + have hu : ∀ n (k : ℕ) b c, (∀ u ≤ (k:ℝ≥0)*h n, b u = c u) → ∀ x, + ((b,x) ∈ U n k ↔ (c,x) ∈ U n k) := fun _ _ _ _ => hSpast _ _ _ + apply expected_frozen_limit hW A v mv U mU h (fun n => ⌊t/(h n:ℝ)⌋₊) (z,0) hu M hv + (fun _ _ b x hx => hgen x (hSD _ (b,x) hx)) + (fun b => (g b (min t (τ b)), b (min t (τ b)).toNNReal)) t hh0 + (EulerGeneral.mesh_times_converge (fun n => hh n) hh0 ht) + filter_upwards [] with b + obtain ⟨ε,hε,hDb⟩ := hD b + have hp := frozen_nodes_path_limit v (g b) z b b.continuous D U hL hM (hg0 b) + (fun _ _ => hlip _) (hder b) (hcf b) (fun u _ => hv _ _) (hτ b).1 (hτ b).2 ht + hε hDb hh hh0 (fun n k x => by simpa only [U,NNReal.coe_mul,NNReal.coe_natCast] using hSeq b ((k:ℝ≥0)*h n) x) + simpa only [map_zero] using hp + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +theorem expected_stopped_local_grid {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (f : E × ℝ → ℝ) (K O : Set (E × ℝ)) + (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) (hf : ContDiffOn ℝ ∞ f O) + (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : Driver → ℝ) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ K) + (hgen : ∀ q ∈ K, + fderiv ℝ (fun x => f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => f (q.1,b))) q.2 / 2 ≤ 0) + (S : ℝ≥0 → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mS : ∀ r, MeasurableSet (S r)) + (hSpast : ∀ r b c, (∀ u ≤ r, b u = c u) → ∀ x, ((b,x) ∈ S r ↔ (c,x) ∈ S r)) + (hSeq : ∀ (b : Driver) r x, (((b:ℝ≥0 → ℝ),x) ∈ S r ↔ (r:ℝ) < τ b ∧ x ∈ K)) + (hSD : ∀ r q, q ∈ S r → q.2 ∈ K) + (hz : (z,0) ∈ K) (ht : 0 ≤ t) : + (∫ b : Driver, f (g b (min t (τ b)), b (min t (τ b)).toNNReal) ∂W) ≤ f (z,0) := by + obtain ⟨G,hG,hGc,hGeq⟩ := Localization.compact_extension hK hO hKO f hf + obtain ⟨A,hA⟩ := exists_smoothTest_of_compact G hG hGc + have heq (q : E × ℝ) (hq : q ∈ K) : A.F q.1 q.2 = f q := by + rw [hA] + exact (hGeq q hq).self_of_nhds + have hDgen (q : E × ℝ) (hq : q ∈ K) : + A.D q.1 q.2 (v q.1 q.2)+deriv (deriv (A.F q.1)) q.2/2 ≤ 0 := by + have hx : (fun x => A.F x q.2) =ᶠ[𝓝 q.1] fun x => f (x,q.2) := by + rw [hA] + exact (hGeq q hq).comp_tendsto (continuousAt_id.prodMk continuousAt_const) + have hb : A.F q.1 =ᶠ[𝓝 q.2] fun b => f (q.1,b) := by + rw [hA] + exact (hGeq q hq).comp_tendsto (continuousAt_const.prodMk continuousAt_id) + rw [← (A.hD q.1 q.2).fderiv, hx.fderiv_eq, hb.deriv.deriv_eq] + exact hgen q hq + have hineq := expected_stopped_smooth_grid hW A v mv g z hL hM hv hlip hg0 hder hcf + τ hτ K hK.measurableSet hD hDgen S mS hSpast hSeq hSD ht + rw [heq (z,0) hz] at hineq + convert hineq using 1 + apply integral_congr_ae + filter_upwards [] with b + symm + apply heq (g b (min t (τ b)), b (min t (τ b)).toNNReal) + obtain ⟨ε,hε,hDb⟩ := hD b + exact hDb (min t (τ b)) ⟨le_min ht (hτ b).1,min_le_right _ _⟩ _ (by simpa using hε) + +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.BrownianCalculus +open Classical +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + + +theorem expected_stopped_local_grid_eq {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (f : E × ℝ → ℝ) (K O : Set (E × ℝ)) + (hK : IsCompact K) (hO : IsOpen O) (hKO : K ⊆ O) (hf : ContDiffOn ℝ ∞ f O) + (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (g : Driver → ℝ → E) (z : E) {L M T t : ℝ} (hL : 0 ≤ L) (hM : 0 ≤ M) + (hv : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) + (hg0 : ∀ b, g b 0 = z) + (hder : ∀ b u, u ∈ Icc 0 T → HasDerivWithinAt (g b) (v (g b u) (b u.toNNReal)) (Icc 0 T) u) + (hcf : ∀ b, ContinuousOn (fun u => v (g b u) (b u.toNNReal)) (Icc 0 T)) + (τ : Driver → ℝ) + (hτ : ∀ b : Driver, 0 ≤ τ b ∧ τ b < T) + (hD : ∀ b : Driver, ∃ ε > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < ε → (x,b u.toNNReal) ∈ K) + (hgen : ∀ q ∈ K, + fderiv ℝ (fun x => f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => f (q.1,b))) q.2 / 2 = 0) + (S : ℝ≥0 → Set ((ℝ≥0 → ℝ) × (E × ℝ))) (mS : ∀ r, MeasurableSet (S r)) + (hSpast : ∀ r b c, (∀ u ≤ r, b u = c u) → ∀ x, ((b,x) ∈ S r ↔ (c,x) ∈ S r)) + (hSeq : ∀ (b : Driver) r x, (((b:ℝ≥0 → ℝ),x) ∈ S r ↔ (r:ℝ) < τ b ∧ x ∈ K)) + (hSD : ∀ r q, q ∈ S r → q.2 ∈ K) + (hz : (z,0) ∈ K) (ht : 0 ≤ t) : + (∫ b : Driver, f (g b (min t (τ b)), b (min t (τ b)).toNNReal) ∂W) = f (z,0) := by + have hle := expected_stopped_local_grid hW f K O hK hO hKO hf v mv g z hL hM hv hlip + hg0 hder hcf τ hτ hD (fun q hq => (hgen q hq).le) S mS hSpast hSeq hSD hz ht + have hneg : ∀ q ∈ K, + fderiv ℝ (fun x => -f (x,q.2)) q.1 (v q.1 q.2) + + deriv (deriv (fun b => -f (q.1,b))) q.2 / 2 ≤ 0 := by + intro q hq + have hfd : DifferentiableAt ℝ (fun x => f (x,q.2)) q.1 := + ((hf q (hKO hq)).contDiffAt (hO.mem_nhds (hKO hq))).differentiableAt (by simp) |>.comp q.1 + (by fun_prop) + rw [fderiv_fun_neg] + simp only [neg_apply,deriv.fun_neg',deriv.fun_neg] + linarith [hgen q hq] + have hge := expected_stopped_local_grid hW (fun q => -f q) K O hK hO hKO hf.neg v mv g z hL hM hv hlip + hg0 hder hcf τ hτ hD hneg S mS hSpast hSeq hSD hz ht + rw [integral_neg] at hge + linarith +end SLEExactGauge.BrownianCalculus + +namespace SLEExactGauge.Localization +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + + +theorem bounded_lipschitz_ode (v : E → ℝ → E) + (cv : Continuous (Function.uncurry v)) (b : ℝ → ℝ) (cb : Continuous b) + (z : E) {M L T : ℝ} (hM : 0 ≤ M) (hL : 0 ≤ L) (hT : 0 ≤ T) + (hbound : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) : + ∃ g : ℝ → E, g 0 = z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt g (v (g t) (b t)) (Icc 0 T) t := by + let M' : ℝ≥0 := ⟨M,hM⟩ + let L' : ℝ≥0 := ⟨L,hL⟩ + let R : ℝ≥0 := ⟨M*T,mul_nonneg hM hT⟩ + have hp : IsPicardLindelof (fun t x => v x (b t)) (tmin := 0) (tmax := T) + ⟨0,⟨le_rfl,hT⟩⟩ z R 0 M' L' := by + constructor + · intro t _ + apply LipschitzWith.lipschitzOnWith + apply LipschitzWith.of_dist_le_mul + intro x y + change dist (v x (b t)) (v y (b t)) ≤ L * dist x y + simpa only [dist_eq_norm] using hlip (b t) x y + · intro x _ + exact (cv.comp (continuous_const.prodMk cb)).continuousOn + · intro t _ x _ + exact hbound x (b t) + · change M*max (T-0) (0-0) ≤ M*T-0 + simp only [sub_zero,sub_self,max_eq_left hT,le_refl] + exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + +end SLEExactGauge.Localization + +open MeasureTheory +namespace SLEExactGauge.ODEPath +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +def mesh (n : ℕ) : ℝ := (1/2)^n +lemma mesh_pos (n : ℕ) : 0 < mesh n := pow_pos (by norm_num) n +lemma mesh_zero : Tendsto mesh atTop (𝓝 0) := + tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + +def drift (v : E → ℝ → E) (b : ℝ≥0 → ℝ) (t : ℝ) (x : E) : E := v x (b t.toNNReal) +def flow (v : E → ℝ → E) (z : E) (b : ℝ≥0 → ℝ) (t : ℝ) : E := + limUnder atTop (fun n => EulerGeneral.interpolate (drift v b) (mesh n) z t) + +omit [CompleteSpace E] in +lemma measurable_nodes (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (h : ℝ) (z : E) (k : ℕ) : + Measurable (fun b : ℝ≥0 → ℝ => EulerGeneral.nodes (drift v b) h z k) := by + induction k with + | zero => exact measurable_const + | succ k ih => + exact ih.add (measurable_const.smul (mv.comp (ih.prodMk (measurable_pi_apply _)))) + +omit [CompleteSpace E] in +lemma measurable_interpolate (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) + (h : ℝ) (z : E) (t : ℝ) : + Measurable (fun b : ℝ≥0 → ℝ => EulerGeneral.interpolate (drift v b) h z t) := by + unfold EulerGeneral.interpolate + exact (measurable_const.smul (measurable_nodes v mv h z _)).add + (measurable_const.smul (measurable_nodes v mv h z _)) + +lemma measurable_flow (v : E → ℝ → E) (mv : Measurable (Function.uncurry v)) (z : E) (t : ℝ) : + Measurable (fun b : ℝ≥0 → ℝ => flow v z b t) := + (StronglyMeasurable.limUnder (fun n => (measurable_interpolate v mv (mesh n) z t).stronglyMeasurable)).measurable + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma nodes_past (v : E → ℝ → E) {h : ℝ} (hh : 0 < h) (z : E) + {b c : ℝ≥0 → ℝ} {s : ℝ} (hs : 0 ≤ s) + (he : ∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) + (k : ℕ) (hk : (k:ℝ)*h ≤ s+h) : + EulerGeneral.nodes (drift v b) h z k = EulerGeneral.nodes (drift v c) h z k := by + induction k with + | zero => rfl + | succ k ih => + have hk' : (k:ℝ)*h ≤ s := by push_cast at hk; nlinarith + have hb : b (((k:ℝ)*h).toNNReal) = c (((k:ℝ)*h).toNNReal) := + he _ (by simpa only [Real.coe_toNNReal',max_le_iff] using And.intro hk' hs) + simp only [EulerGeneral.nodes,drift,ih (by linarith),hb] + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma interpolate_past (v : E → ℝ → E) {h : ℝ} (hh : 0 < h) (z : E) + {b c : ℝ≥0 → ℝ} {s : ℝ} (hs : 0 ≤ s) + (he : ∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) : + EulerGeneral.interpolate (drift v b) h z s = EulerGeneral.interpolate (drift v c) h z s := by + have hk : (⌊s/h⌋₊:ℝ)*h ≤ s := (le_div_iff₀ hh).mp (Nat.floor_le (div_nonneg hs hh.le)) + unfold EulerGeneral.interpolate + dsimp only + rw [nodes_past v hh z hs he _ (by linarith),nodes_past v hh z hs he _ (by push_cast; linarith)] + +omit [CompleteSpace E] [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma flow_past (v : E → ℝ → E) (z : E) {b c : ℝ≥0 → ℝ} {s : ℝ} (hs : 0 ≤ s) + (he : ∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) : flow v z b s = flow v z c s := by + unfold flow + congr 1 + funext n + exact interpolate_past v (mesh_pos n) z hs he + + + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +theorem flow_solution (v : E → ℝ → E) (cv : Continuous (Function.uncurry v)) + (z : E) (b : ℝ≥0 → ℝ) (cb : Continuous b) {M L T : ℝ} + (hM : 0 ≤ M) (hL : 0 ≤ L) (hT : 0 ≤ T) + (hbound : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) : + flow v z b 0 = z ∧ ∀ t ∈ Icc 0 T, HasDerivWithinAt (flow v z b) + (v (flow v z b t) (b t.toNNReal)) (Icc 0 T) t := by + obtain ⟨g,hg0,hg⟩ := Localization.bounded_lipschitz_ode v cv + (fun t => b t.toNNReal) (cb.comp continuous_real_toNNReal) z hM hL (by linarith : 0 ≤ T+1) hbound hlip + have hgc : ContinuousOn g (Icc 0 (T+1)) := fun t ht => (hg t ht).continuousWithinAt + have hcf : ContinuousOn (fun t => v (g t) (b t.toNNReal)) (Icc 0 (T+1)) := + cv.comp_continuousOn (hgc.prodMk ((cb.comp continuous_real_toNNReal).continuousOn)) + have hconv : TendstoUniformlyOn (fun n => EulerGeneral.interpolate (drift v b) (mesh n) z) + g atTop (Icc 0 T) := + EulerGeneral.converge_uniformOn hL hM hg0 (fun _ _ => hlip _) hg hcf + (fun _ _ => hbound _ _) hT (by linarith) mesh_pos mesh_zero + have heq : ∀ t ∈ Icc 0 T, flow v z b t = g t := + fun t ht => (hconv.tendsto_at ht).limUnder_eq + refine ⟨(heq 0 ⟨le_rfl,hT⟩).trans hg0,?_⟩ + intro t ht + rw [heq t ht] + exact ((hg t ⟨ht.1,by linarith [ht.2]⟩).mono + (show Icc 0 T ⊆ Icc 0 (T+1) from fun u hu => ⟨hu.1,by linarith [hu.2]⟩)).congr heq (heq t ht) + +omit [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] in +lemma continuousOn_flow (v : E → ℝ → E) (cv : Continuous (Function.uncurry v)) + (z : E) (b : ℝ≥0 → ℝ) (cb : Continuous b) {M L T : ℝ} + (hM : 0 ≤ M) (hL : 0 ≤ L) (hT : 0 ≤ T) + (hbound : ∀ x b, ‖v x b‖ ≤ M) (hlip : ∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) : + ContinuousOn (flow v z b) (Icc 0 T) := + fun t ht => ((flow_solution v cv z b cb hM hL hT hbound hlip).2 t ht).continuousWithinAt + +end SLEExactGauge.ODEPath + +namespace SLEExactGauge.RationalStop + +def sample (s r : ℝ) : ℝ := max 0 (min s r) +lemma sample_mem {s : ℝ} (hs : 0 ≤ s) (r : ℝ) : sample s r ∈ Icc 0 s := + ⟨le_max_left _ _,max_le hs (min_le_left _ _)⟩ +lemma sample_self {s u : ℝ} (hu : u ∈ Icc 0 s) : sample s u = u := by + simp [sample,min_eq_right hu.2,max_eq_right hu.1] +lemma continuous_sample (s : ℝ) : Continuous (sample s) := by unfold sample; fun_prop + + + +def Safe (f : ℝ → ℝ) (R s : ℝ) : Prop := + ∃ n : ℕ, ∀ r : ℚ, f (sample s r) ≤ R-1/((n:ℝ)+1) + +lemma safe_iff {f : ℝ → ℝ} {R s : ℝ} (hs : 0 ≤ s) + (hf : ContinuousOn f (Icc 0 s)) : Safe f R s ↔ ∀ u ∈ Icc 0 s, f u < R := by + constructor + · rintro ⟨n,hn⟩ u hu + have hc : Continuous (fun x => f (sample s x)) := + hf.comp_continuous (continuous_sample s) (sample_mem hs) + have h : f (sample s u) ≤ R-1/((n:ℝ)+1) := Rat.denseRange_cast.induction_on u + (isClosed_le hc continuous_const) hn + rw [sample_self hu] at h + have hp : 0 < 1/((n:ℝ)+1) := by positivity + linarith + · intro h + obtain ⟨u,hu,hm⟩ := isCompact_Icc.exists_isMaxOn ⟨0,⟨le_rfl,hs⟩⟩ hf + obtain ⟨n,hn⟩ := exists_nat_one_div_lt (sub_pos.mpr (h u hu)) + refine ⟨n,fun r => ?_⟩ + have hr : f (sample s r) ≤ f u := hm (sample_mem hs (r:ℝ)) + linarith + +end SLEExactGauge.RationalStop +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppedMassMeasurability.lean b/lean/OAI/Probability/SLEGauge/StoppedMassMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..2535e63e6e3de2e5e69150558698c90046a837d8 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppedMassMeasurability.lean @@ -0,0 +1,547 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppedFiniteMass + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal + +namespace ExactSLEGenerator + + +def stoppedPastDriver (S : Driver → ℝ≥0∞) (b : Driver) : Driver := + if S b = ∞ then b else pastDriver (S b).toNNReal b + +lemma stoppedPastDriver_apply (S : Driver → ℝ≥0∞) (b : Driver) (t : ℝ≥0) : + (stoppedPastDriver S b).1 t = b.1 (ExactSLEGreen.capTime S t b) := by + by_cases hb : S b = ∞ + · simp [stoppedPastDriver,hb,ExactSLEGreen.capTime] + · rw [stoppedPastDriver,ite_eq_right hb] + change b.1 (min t (S b).toNNReal) = b.1 (ExactSLEGreen.capTime S t b) + congr 1 + unfold ExactSLEGreen.capTime + conv_rhs => rw [← ENNReal.coe_toNNReal hb] + simp only [← ENNReal.coe_min,ENNReal.toNNReal_coe,min_comm] + +lemma stoppedPastDriver_measurable (S : Driver → ℝ≥0∞) + (hS : IsStoppingTime rawFiltration S) : + Measurable[hS.measurableSpace] (stoppedPastDriver S) := by + have : PolishSpace Driver := (isClosed_eq (continuous_eval_const 0) continuous_const).polishSpace + obtain ⟨u,hu⟩ := TopologicalSpace.exists_dense_seq (α := ℝ≥0) + let e : Driver → (ℕ → ℝ) := fun b n => b.1 (u n) + have hec : Continuous e := continuous_pi fun n => + (continuous_eval_const (u n)).comp continuous_subtype_val + have hei : Function.Injective e := by + intro b c h + apply Subtype.ext + apply DFunLike.coe_injective + exact hu.equalizer b.1.continuous c.1.continuous h + apply hec.measurableEmbedding hei |>.measurable_comp_iff.mp + have hA : StronglyAdapted rawFiltration (fun t (b : Driver) => b.1 t) := + Filtration.stronglyAdapted_natural driver_eval_measurable + have hP := hA.isStronglyProgressive_of_continuous (fun b => b.1.continuous) + have hval (n : ℕ) : Measurable[hS.measurableSpace] + (fun b => b.1 (ExactSLEGreen.capTime S (u n) b)) := by + have h := (measurable_stoppedValue hP (ExactSLEGreen.capTime_stopping S hS (u n))).mono + (ExactSLEGreen.stopped_cap_measurable S hS (u n)) le_rfl + exact h + let : MeasurableSpace Driver := hS.measurableSpace + apply measurable_pi_iff.mpr + intro n + simpa only [Function.comp_apply,e,stoppedPastDriver_apply] using hval n + +end ExactSLEGenerator + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma timeMassDensity_stoppedPastDriver (a : ℝ) (ha : 0 rw [← ENNReal.coe_toNNReal hb] + conv_rhs => rw [← ENNReal.coe_toNNReal hb] + apply timeMassDensity_driver_congr a ha q hq hq1 + intro t ht + simpa only [stoppedPastDriver,ite_eq_right hb] using + (pastDriver_eq (S b).toNNReal b t ht).symm + + +theorem timeMassDensity_stopping_raw_joint (a : ℝ) (ha : 1/4 + timeMassDensity a q (S p.1) p.1 p.2) := by + have hp : @Measurable (ExactSLEGenerator.Driver × ℂ) + ((ℝ≥0∞ × ExactSLEGenerator.Driver) × ℂ) + (hS.measurableSpace.prod inferInstance) inferInstance + (fun p => ((S p.1,stoppedPastDriver S p.1),p.2)) := by + exact ((hS.measurable.comp (@measurable_fst _ _ hS.measurableSpace inferInstance)).prodMk + ((stoppedPastDriver_measurable S hS).comp + (@measurable_fst _ _ hS.measurableSpace inferInstance))).prodMk + (@measurable_snd _ _ hS.measurableSpace inferInstance) + have hm := (timeMassDensity_joint_measurable a ha q hq hq1).comp hp + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + have hm' : Measurable (fun p : ExactSLEGenerator.Driver × ℂ => + timeMassDensity a q (S p.1) (stoppedPastDriver S p.1) p.2) := hm + convert hm' using 1 + funext p + exact timeMassDensity_stoppedPastDriver a (by linarith) q hq hq1 S p.1 p.2 + +lemma actualUpperMass_stopping_raw_measurable (a : ℝ) (ha : 1/4 actualUpperMass a q (S b) b) := by + have hM := timeMassDensity_stopping_raw_joint a ha q hq hq1 S hS + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + have hm : Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => + timeMassDensity a q (S p.1) p.1 p.2.1) := + hM.comp (measurable_fst.prodMk (measurable_subtype_coe.comp measurable_snd)) + apply Measure.measurable_of_measurable_coe + intro A hA + simp only [actualUpperMass,withDensity_apply _ hA] + exact hm.lintegral_prod_right' + +lemma actualUpperMass_stopping_eval_raw_measurable (a : ℝ) (ha : 1/4 ∫z, f z ∂actualUpperMass a q (S b) b) := by + simp_rw [actualUpperMass_eval a ha q hq hq1] + have hD := timeMassDensity_stopping_raw_joint a ha q hq hq1 S hS + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + have hm : Measurable (fun p : ExactSLEGenerator.Driver × ℂ => + upperExtension f p.2*(timeMassDensity a q (S p.1) p.1 p.2).toReal) := + ((upperExtension_measurable f).comp measurable_snd).mul hD.ennreal_toReal + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +lemma actualUpperMass_stopping_eval_measurable (a : ℝ) (ha : 1/4 ∫z, f z ∂actualUpperMass a q (S b) b) := + (actualUpperMass_stopping_eval_raw_measurable a ha q hq hq1 S hS f).mono + hS.measurableSpace_le le_rfl + + + +theorem recoveredMass_stopping_raw_measurable (a : ℝ) (ha : 1/4 recoveredMass a ha s c hc (S b) b) := by + apply @measurable_radonLimit _ _ _ _ _ _ _ _ hS.measurableSpace + intro k f + simp_rw [actualMassFunctionals_apply] + apply Finset.measurable_sum + intro j hj + exact measurable_const.mul (actualUpperMass_stopping_eval_raw_measurable a ha _ (Real.exp_pos _) + (level_step_le_one a ha j) S hS f) + +lemma recoveredMass_stopping_measurable (a : ℝ) (ha : 1/4 recoveredMass a ha s c hc (S b) b) := + (recoveredMass_stopping_raw_measurable a ha s c hc S hS).mono hS.measurableSpace_le le_rfl + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction SLEExactGauge.MassVersions + +lemma actual_stopped_radon_limit_memLp (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) (s : ℕ → Finset ℕ) (coeff : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤coeff k j) (hsum : ∀ k, ∑ j∈s k,coeff k j=1) + (μ : ExactSLEGenerator.Driver → Measure UpperPlane) + (f : C_c(UpperPlane, ℝ)) + (hlim : ∀ᵐ b ∂W, Tendsto (fun k => ∑ j∈s k,coeff k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S b) b) atTop (𝓝 (∫z,f z∂μ b))) + (m : ℕ) : MemLp (fun b => ∫z,f z∂μ b) (m : ℝ≥0∞) W := by + let q (j : ℕ) := Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 + ∑ j∈s k,coeff k j * ∫z,f z∂actualUpperMass a (q j) (S b) b + have hF (k : ℕ) : AEStronglyMeasurable (F k) W := by + have H := Finset.aestronglyMeasurable_sum (μ := W) (s k) (fun j hj => + (actualUpperMass_stopping_eval_measurable a ha (q j) (hq j) (hq1 j) S hS f).aestronglyMeasurable.const_mul (coeff k j)) + convert H using 1 + funext b + simp only [F,Finset.sum_apply] + have hmeas : AEStronglyMeasurable (fun b => ∫z,f z∂μ b) W := + aestronglyMeasurable_of_tendsto_ae atTop hF hlim + by_cases hm : m=0 + · simpa [hm] using (memLp_zero_iff_aestronglyMeasurable.mpr hmeas) + have hmpos : 1 ≤ m := Nat.one_le_iff_ne_zero.mpr hm + obtain ⟨C,hC,hCb⟩ := actualUpperMass_stopped_Lp_bound a ha W hW m hmpos f + have hbound (k : ℕ) : eLpNorm (F k) (m : ℝ≥0∞) W≤C := + convex_eLpNorm_bound W _ C (by exact_mod_cast hmpos) (s k) (coeff k) (hc k) (hsum k) + (fun j b => ∫z,f z∂actualUpperMass a (q j) (S b) b) + (fun j hj => (hCb (q j) (hq j) (hq1 j) S hS).1.aestronglyMeasurable) + (fun j hj => (hCb (q j) (hq j) (hq1 j) S hS).2) + exact (Lp.eLpNorm_le_of_ae_tendsto (Filter.Eventually.of_forall hbound) hF hmeas hlim).trans_lt hC + +lemma actual_stopped_radon_limit_L1 (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) (q : ℕ → ℝ) (hq : ∀ j,0 ∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (q j) (S b) b) atTop (𝓝 (∫z,f z∂μ b))) : + Tendsto (fun k => eLpNorm (fun b => (∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (q j) (S b) b)-(∫z,f z∂μ b)) 1 W) atTop (𝓝 0) := by + let F := fun k b => ∑j∈s k,coeff k j*∫z,f z∂actualUpperMass a (q j) (S b) b + have hF (k : ℕ) : AEStronglyMeasurable (F k) W := by + have H := Finset.aestronglyMeasurable_sum (μ := W) (s k) (fun j hj => + (actualUpperMass_stopping_eval_measurable a ha (q j) (hq j) (hq1 j) S hS f).aestronglyMeasurable.const_mul (coeff k j)) + convert H using 1 + funext b + simp only [F,Finset.sum_apply] + obtain ⟨C,hC,hCb⟩ := actualUpperMass_stopped_Lp_bound a ha W hW 2 (by norm_num) f + have hbound (k : ℕ) : eLpNorm (F k) 2 W≤C := + convex_eLpNorm_bound W _ C (by norm_num) (s k) (coeff k) (hc k) (hsum k) + (fun j b => ∫z,f z∂actualUpperMass a (q j) (S b) b) + (fun j hj => (hCb (q j) (hq j) (hq1 j) S hS).1.aestronglyMeasurable) + (fun j hj => (hCb (q j) (hq j) (hq1 j) S hS).2) + have hg2 : MemLp (fun b => ∫z,f z∂μ b) 2 W := + (Lp.eLpNorm_le_of_ae_tendsto (Filter.Eventually.of_forall hbound) hF + (aestronglyMeasurable_of_tendsto_ae atTop hF hlim) hlim).trans_lt hC + have hg := hg2.mono_exponent (by norm_num : (1:ℝ≥0∞)≤2) + exact tendsto_Lp_finite_of_tendsto_ae le_rfl (by simp) hF (by simpa using hg) + (unifIntegrable_of_L2_bound W F hF C hC hbound) hlim + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction SLEExactGauge.MassVersions + +lemma actual_stopped_radon_mass_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ℕ → ExactSLEGenerator.Driver → ℝ≥0∞) + (hS : ∀ i, IsStoppingTime rawFiltration (S i)) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ), + (∀ k j, j∈s k → k≤j) ∧ (∀ k j, j∈s k → 0≤c k j) ∧ + (∀ k, ∑ j∈s k,c k j=1) ∧ + ∀ᵐ b ∂W, ∃ μ : ℕ → Measure UpperPlane, + (∀ i, IsFiniteMeasureOnCompacts (μ i) ∧ (μ i).Regular) ∧ + ∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k,c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S i b) b) + atTop (𝓝 (∫z,f z∂μ i)) := by + obtain ⟨tests,htests⟩ := determining_tests_radon_limit UpperPlane + let F : ℕ → C_c(UpperPlane,ℝ) := fun i => tests (Nat.unpair i).2 + choose C hC hBound using fun i => actualUpperMass_stopped_Lp_bound a ha W hW 2 (by norm_num) (F i) + let q := fun j : ℕ => Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 + ∫z,F i z∂actualUpperMass a (q j) (S (Nat.unpair i).1 b) b + have hLp (j i : ℕ) : MemLp (A j i) 2 W := by + simpa only [Nat.cast_ofNat] using + (hBound i (q j) (hq j) (hq1 j) (S (Nat.unpair i).1) (hS _)).1 + let X := fun j i => (hLp j i).toLp (A j i) + have hX (i : ℕ) : ∃ B : ℝ, ∀ j, ‖X j i‖≤B := by + refine ⟨(C i).toReal,fun j => ?_⟩ + rw [Lp.norm_toLp] + exact ENNReal.toReal_mono (hC i).ne + (hBound i (q j) (hq j) (hq1 j) (S (Nat.unpair i).1) (hS _)).2 + obtain ⟨s,c,v,hs,hc,hsum,-,hae⟩ := common_L2_convex_tails W X hX + have he : ∀ᵐ b ∂W, ∀ j i, X j i b=A j i b := + ae_all_iff.mpr (fun j => ae_all_iff.mpr (fun i => (hLp j i).coeFn_toLp)) + refine ⟨s,c,hs,hc,hsum,?_⟩ + filter_upwards [hae,he] with b hb heq + let L (i k : ℕ) : C_c(UpperPlane,ℝ) →ₚ[ℝ] ℝ := + actualMassFunctionals a ha s c hc (S i b) b k + have hi (i : ℕ) : ∃ μ : Measure UpperPlane, IsFiniteMeasureOnCompacts μ ∧ μ.Regular ∧ + ∀ f : C_c(UpperPlane,ℝ), Tendsto (fun k => L i k f) atTop (𝓝 (∫z,f z∂μ)) := by + apply htests (L i) + intro n + refine ⟨v (Nat.pair i n) b,?_⟩ + have h := hb (Nat.pair i n) + simpa only [heq,A,F,L,actualMassFunctionals_apply,Nat.unpair_pair] using h + choose μ hμ using hi + refine ⟨μ,fun i => ⟨(hμ i).1,(hμ i).2.1⟩,fun i f => ?_⟩ + simpa only [L,actualMassFunctionals_apply] using (hμ i).2.2 f + + + +theorem actual_raw_stopped_extraction (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ℕ → ExactSLEGenerator.Driver → ℝ≥0∞) + (hS : ∀ i, IsStoppingTime rawFiltration (S i)) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j,j∈s k → 0≤c k j), + (∀ k j,j∈s k → k≤j) ∧ (∀ k,∑ j∈s k,c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ t b, IsFiniteMeasureOnCompacts (μ t b) ∧ (μ t b).Regular) ∧ + IsProgressive rawFiltration (fun t : ℝ≥0 => μ t) ∧ + (∀ i, Measurable[(hS i).measurableSpace] (fun b => μ (S i b) b)) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (S i b) b) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k,c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S i b) b) + - ∫z,f z∂μ (S i b) b) 1 W) atTop (𝓝 0)) ∧ + ∀ᵐ b ∂W, + (∀ i j,S i b≤S j b → μ (S i b) b≤μ (S j b) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k,c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S i b) b) + atTop (𝓝 (∫z,f z∂μ (S i b) b))) := by + obtain ⟨s,c,hs,hc,hsum,h⟩ := actual_stopped_radon_mass_extraction a ha W hW S hS + let μ := recoveredMass a ha s c hc + have hμ (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : + IsFiniteMeasureOnCompacts (μ t b) ∧ (μ t b).Regular := + ⟨radonLimit_finite _,radonLimit_regular _⟩ + have hlim : ∀ᵐ b ∂W, ∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k,c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S i b) b) + atTop (𝓝 (∫z,f z∂μ (S i b) b)) := by + filter_upwards [h] with b hb + obtain ⟨ν,hν,hconv⟩ := hb + have he (i : ℕ) : μ (S i b) b=ν i := by + have := (hν i).2 + apply radonLimit_eq + intro f + simpa only [actualMassFunctionals_apply] using hconv i f + intro i f + rw [he i] + exact hconv i f + refine ⟨s,c,hc,hs,hsum,hμ,recoveredMass_progressive a ha s c hc,?_,?_,?_,?_⟩ + · exact fun i => recoveredMass_stopping_raw_measurable a ha s c hc (S i) (hS i) + · intro i f m + exact actual_stopped_radon_limit_memLp a ha W hW (S i) (hS i) s c hc hsum + (fun b => μ (S i b) b) f (hlim.mono (fun b hb => hb i f)) m + · intro i f + exact actual_stopped_radon_limit_L1 a ha W hW (S i) (hS i) + (fun j => Real.exp (-2*a*(j+1))) (fun j => Real.exp_pos _) + (level_step_le_one a ha) s c hc hsum (fun b => μ (S i b) b) f + (hlim.mono (fun b hb => hb i f)) + · filter_upwards [hlim] with b hb + exact ⟨ordered_radon_limits a ha b (fun i => S i b) s c hc (fun i => μ (S i b) b) + (fun i => hμ (S i b) b) hb,hb⟩ + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain ExactSLEMassExtraction SLEExactGauge.MassVersions + +lemma actual_stopped_limit_compact_conditional (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hs : ∀ k j,j∈s k → k≤j) (hc : ∀ k j,j∈s k → 0≤c k j) + (hsum : ∀ k,∑ j∈s k,c k j=1) + (μ ν : ExactSLEGenerator.Driver → Measure UpperPlane) (f : C_c(UpperPlane,ℝ)) + (hμ : ∀ᵐ b ∂W, Tendsto (fun k => ∑ j∈s k,c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (S b) b) + atTop (𝓝 (∫z,f z∂μ b))) + (hν : ∀ᵐ b ∂W, Tendsto (fun k => ∑ j∈s k,c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂ν b))) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + (∫b in U,(∫z,f z∂ν b)-(∫z,f z∂μ b) ∂W) = + ∫b in U,(∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1 ∂upperArea) ∂W := by + let q := fun j : ℕ => Real.exp (-2*a*(j+1)) + have hq (j : ℕ) : 0 ∞) := + fun t => by simp + have hiμ : Integrable (fun b => ∫z,f z∂μ b) W := by + have := actual_stopped_radon_limit_memLp a ha W hW S hS s c hc hsum μ f hμ 1 + exact this.integrable (by norm_num) + have hiν : Integrable (fun b => ∫z,f z∂ν b) W := by + have := actual_stopped_radon_limit_memLp a ha W hW (fun _ => ∞) htop s c hc hsum ν f hν 1 + exact this.integrable (by norm_num) + let F := fun k b => ∑ j∈s k,c k j * ∫z,f z∂actualUpperMass a (q j) (S b) b + let E := fun k b => ∑ j∈s k,c k j * ∫z,f z∂actualUpperMass a (q j) ∞ b + have hiF (k : ℕ) : Integrable (F k) W := + integrable_finsetSum (s k) (fun j hj => + (actualUpperMass_stopped_eval_integrable a ha W hW (q j) (hq j) (hq1 j) S hS f).const_mul (c k j)) + have hiE (k : ℕ) : Integrable (E k) W := + integrable_finsetSum (s k) (fun j hj => + (actualUpperMass_stopped_eval_integrable a ha W hW (q j) (hq j) (hq1 j) (fun _ => ∞) htop f).const_mul (c k j)) + have hF := setIntegral_tendsto_of_L1 W F (fun b => ∫z,f z∂μ b) hiF hiμ + (actual_stopped_radon_limit_L1 a ha W hW S hS q hq hq1 s c hc hsum μ f hμ) U + have hE := setIntegral_tendsto_of_L1 W E (fun b => ∫z,f z∂ν b) hiE hiν + (actual_stopped_radon_limit_L1 a ha W hW (fun _ => ∞) htop q hq hq1 s c hc hsum ν f hν) U + have hpot := actualUpperMass_stopped_convex_potential_limit a ha W hW q + (fun j => ⟨hq j,hq1 j⟩) hq0 s c hs hc hsum S hS f U hU + have he (k : ℕ) : (∫b in U, E k b ∂W)-(∫b in U, F k b ∂W) = + ∫b in U,∑ j∈s k,c k j*((∫z,f z∂actualUpperMass a (q j) ∞ b)- + (∫z,f z∂actualUpperMass a (q j) (S b) b)) ∂W := by + rw [←integral_sub (hiE k).restrict (hiF k).restrict] + congr 1 + funext b + simp only [E,F,mul_sub,Finset.sum_sub_distrib] + rw [integral_sub hiν.restrict hiμ.restrict] + exact tendsto_nhds_unique (hE.sub hF) (by simpa only [he] using hpot) + + + +theorem stopped_compact_conditional_to_random_tests (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (μ ν : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] [∀ b, IsFiniteMeasureOnCompacts (ν b)] + (hμ : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂μ b) W) + (hν : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂ν b) W) + (he : ∀ f : C_c(UpperPlane,ℝ), ∀ U : Set ExactSLEGenerator.Driver, + MeasurableSet[hS.measurableSpace] U → + (∫b in U,(∫z,f z∂ν b)-(∫z,f z∂μ b) ∂W) = + ∫b in U,(∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1 ∂upperArea) ∂W) + (H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞) + (hH : Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H) : + (∫⁻b,∫⁻z,H (b,z) ∂ν b ∂W) = (∫⁻b,∫⁻z,H (b,z) ∂μ b ∂W) + + ∫⁻b,∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂upperArea ∂W := by + have := isSFiniteKernel_of_locally_finite μ + have := isSFiniteKernel_of_locally_finite ν + have := average_finiteOnCompacts μ W hμ + have := average_finiteOnCompacts ν W hν + have := stoppedSurvivingKernel_average_finiteOnCompacts a ha W hW S hS + have : IsFiniteMeasureOnCompacts ((μ+stoppedSurvivingKernel a ha S hS) ∘ₘ W) := by + rw [SLEExactGauge.MassVersions.average_add] + constructor + intro K hK + rw [Measure.add_apply] + exact ENNReal.add_lt_top.mpr ⟨hK.measure_lt_top,hK.measure_lt_top⟩ + have hidentity := conditional_lintegral_eq_of_average_finite ν + (μ+stoppedSurvivingKernel a ha S hS) W hS.measurableSpace hS.measurableSpace_le ?_ H hH + · rw [hidentity] + have hH₀ : Measurable H := hH.mono (prod_sigma_le hS.measurableSpace_le _) le_rfl + have heval (b : ExactSLEGenerator.Driver) : + (∫⁻z,H (b,z) ∂(μ+stoppedSurvivingKernel a ha S hS) b) = + (∫⁻z,H (b,z) ∂μ b)+ + ∫⁻z,H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂upperArea := by + have hHb : Measurable (fun z : UpperPlane => H (b,z)) := + hH₀.comp ((measurable_const (a:=b)).prodMk measurable_id) + rw [add_apply,lintegral_add_measure,stoppedSurvivingKernel_apply] + congr 1 + exact (lintegral_withDensity_eq_lintegral_mul upperArea + (stoppedSurvivingGreen_spatial_measurable a ha S hS b).ennreal_ofReal hHb).trans + (lintegral_congr (fun _ => mul_comm _ _)) + simp_rw [heval] + rw [lintegral_add_left] + exact hH₀.lintegral_kernel_prod_right' + · intro U hU f + have hadd : (fun b => ∫z,f z∂(μ+stoppedSurvivingKernel a ha S hS) b) =ᵐ[W] + (fun b => (∫z,f z∂μ b)+(∫z,f z∂stoppedSurvivingKernel a ha S hS b)) := by + filter_upwards [stoppedSurvivingKernel_compact_ae_integrable a ha W hW S hS f] with b hb + exact integral_add_measure f.integrable hb + rw [integral_congr_ae (ae_restrict_of_ae hadd), + integral_add (hμ f).restrict (stoppedSurvivingKernel_compact_mean_integrable a ha W hW S hS f).restrict] + have hf := he f U hU + rw [integral_sub (hν f).restrict (hμ f).restrict] at hf + simp_rw [stoppedSurvivingKernel_compact_eval] + linarith + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem stopped_conditional_future_support (a : ℝ) (ha : 1/4 b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (μ ν : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (μ b)] [∀ b, IsFiniteMeasureOnCompacts (ν b)] + (hμ : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂μ b) W) + (hν : ∀ f : C_c(UpperPlane,ℝ), Integrable (fun b => ∫z,f z∂ν b) W) + (hle : ∀ᵐ b ∂W, μ b≤ν b) + (he : ∀ f : C_c(UpperPlane,ℝ), ∀ U : Set ExactSLEGenerator.Driver, + MeasurableSet[hS.measurableSpace] U → + (∫b in U,(∫z,f z∂ν b)-(∫z,f z∂μ b) ∂W) = + ∫b in U,(∫z : UpperPlane,f z*stoppedSurvivingGreen a (S b) b z.1 ∂upperArea) ∂W) : + ∀ᵐ b ∂W, (ν b-μ b) {z : UpperPlane | stoppedSurvivingGreen a (S b) b z.1=0}=0 := by + let D : Set (ExactSLEGenerator.Driver × UpperPlane) := + {p | stoppedSurvivingGreen a (S p.1) p.1 p.2.1=0} + have hD : MeasurableSet[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] D := + (stoppedSurvivingGreen_raw_joint a ha S hS) (measurableSet_singleton (0 : ℝ)) + have hD₀ : MeasurableSet D := prod_sigma_le hS.measurableSpace_le _ _ hD + have := average_finiteOnCompacts ν W hν + apply random_set_sub_null_of_compact_means μ ν W D hD₀ hle + intro K hK + let E := D∩Prod.snd ⁻¹' K + have hE : MeasurableSet[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] E := + hD.inter (measurable_snd hK.measurableSet) + have hE₀ : MeasurableSet E := prod_sigma_le hS.measurableSpace_le _ _ hE + let H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞ := E.indicator (fun _ => 1) + have hH : Measurable[hS.measurableSpace.prod (inferInstance : MeasurableSpace UpperPlane)] H := + measurable_const.indicator hE + have hid := stopped_compact_conditional_to_random_tests a ha W hW S hS μ ν hμ hν he H hH + have hev (ρ : Measure UpperPlane) (b : ExactSLEGenerator.Driver) : + (∫⁻z,H (b,z) ∂ρ)=ρ ({z | (b,z)∈D}∩K) := by + have hh := lintegral_indicator_const_comp (μ:=ρ) + ((measurable_const (a:=b)).prodMk measurable_id) hE₀ (1 : ℝ≥0∞) + have hs : (fun z : UpperPlane => (b,id z)) ⁻¹' E={z | (b,z)∈D}∩K := by + ext z; rfl + rw [hs,one_mul] at hh + exact hh + have hz (b : ExactSLEGenerator.Driver) (z : UpperPlane) : + H (b,z)*ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)=0 := by + by_cases h : (b,z)∈E + · rw [show stoppedSurvivingGreen a (S b) b z.1=0 from h.1,ENNReal.ofReal_zero,mul_zero] + · simp only [H,indicator_of_notMem h,zero_mul] + simpa only [hev,hz,lintegral_zero,add_zero] using hid + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppedWeights.lean b/lean/OAI/Probability/SLEGauge/StoppedWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..4390ee2e1db1f86b9453bd025d5f26f346c99903 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppedWeights.lean @@ -0,0 +1,449 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.ReverseGenerators +import OAI.Probability.SLEGauge.RadialBounds + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +lemma regionStop_weight_eq (a ε : ℝ) (hε : 0 < ε) (z : ℂ) + (N ρ δ : ℝ) (B : ℝ≥0) (h0 : 0 ≤ regionMonitor ε N ρ δ (z,0)) + (b : ExactSLEGenerator.Driver) + (hr : physicalRadius (localState a ε hε z (regionStop a ε hε z N ρ δ B b) b) = ρ) : + physicalGreen a (localState a ε hε z (regionStop a ε hε z N ρ δ B b) b) = + radialWeight a b.1 z ρ := by + have he := regionStop_eq_radialTime a ε hε z N ρ δ B h0 b hr + rw [radialWeight,he,ite_eq_right ENNReal.coe_ne_top,ENNReal.toNNReal_coe] + rw [(regionStop_actualState a ε hε z N ρ δ B h0 b _ le_rfl).2] + +lemma actual_sine_lower (a : ℝ) (b : ℝ≥0 → ℝ) (hb : Continuous b) (z : ℂ) + (T : ℝ≥0) (hT : alive a b T z) : + ∃ η : ℝ, 0 < η ∧ ∀ t : ℝ≥0, t ≤ T → + η ≤ Y (actualState a b t z) / ‖(actualState a b t z).1‖ := by + obtain ⟨f,hf⟩ := hT + let s : ℝ → ℝ := fun u => (f u).im / ‖f u-(b u.toNNReal : ℂ)‖ + have hnp (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : 0 < ‖f u-(b u.toNNReal : ℂ)‖ := + norm_pos_iff.mpr (odeUntil_center_ne_zero hf hu) + have hsc : ContinuousOn s (Icc (0 : ℝ) T) := + (Complex.continuous_im.comp_continuousOn (odeUntil_continuousOn hf)).div + (odeUntil_center_continuousOn hb hf).norm (fun u hu => (hnp u hu).ne') + obtain ⟨u,hu,hmin⟩ := isCompact_Icc.exists_isMinOn + (nonempty_Icc.mpr T.coe_nonneg) hsc + refine ⟨s u,div_pos (hf.2 u hu).1 (hnp u hu),?_⟩ + intro t ht + have hv : (t : ℝ) ∈ Icc (0 : ℝ) T := ⟨t.coe_nonneg,ht⟩ + have hl := hmin hv + change s u ≤ s (t : ℝ) at hl + have he : loewnerMap a b t z = f t := by + simpa only [Real.toNNReal_coe] using loewnerMap_eq_solution_time hf hv + simpa only [s,actualState,Y_apply,he, + Real.toNNReal_coe,Complex.sub_im,Complex.ofReal_im,sub_zero] using hl + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + + + +structure RadialLocalization (a : ℝ) (z : ℂ) (ρ δ : ℝ) where + ε : ℝ + hε : 0 < ε + N : ℝ≥0 + B : ℝ≥0 + initial : 0 ≤ regionMonitor ε N ρ δ (z,0) + small : ε < heightFloor z.im ρ δ + large : z.im/δ+logCeiling z.im ρ δ < N + time : z.im^2 < 2*a*δ^2*(B : ℝ) + +lemma exists_radialLocalization (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ δ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (hδ : 0 < δ) + (hs : δ*‖z‖ ≤ z.im) : Nonempty (RadialLocalization a z ρ δ) := by + let m := heightFloor z.im ρ δ + let C := logCeiling z.im ρ δ + have hm : 0 < m := heightFloor_pos _ _ _ + have hC : 0 ≤ C := logCeiling_nonneg _ _ _ + have hmz : m ≤ z.im := heightFloor_le hz hρ hr + let N : ℝ≥0 := ⟨z.im/δ+C+1,by positivity⟩ + let B : ℝ≥0 := ⟨z.im^2/(2*a*δ^2)+1,by positivity⟩ + have hinit : 0 ≤ regionMonitor (m/2) N ρ δ (z,0) := by + apply (regionMonitor_nonneg_iff _ _ _ _ _).mpr + have hnorm : ‖z‖ ≤ z.im/δ := (le_div_iff₀ hδ).mpr (by simpa only [mul_comm] using hs) + refine ⟨?_,?_,?_,hs⟩ + · change m/2 ≤ z.im + linarith + · simpa only [Prod.norm_def,Real.norm_eq_abs,abs_zero,max_eq_left (norm_nonneg z)] using + (show ‖z‖ ≤ (N : ℝ) by change ‖z‖ ≤ z.im/δ+C+1; linarith) + · simpa only [physicalRadius,Y_apply,J_apply,neg_zero,Real.exp_zero,mul_one] using hr + refine ⟨⟨m/2,by positivity,N,B,hinit,by change m/2 < m; linarith,?_,?_⟩⟩ + · change z.im/δ+C < z.im/δ+C+1 + linarith + · change z.im^2 < 2*a*δ^2*(z.im^2/(2*a*δ^2)+1) + have hp : 0 < 2*a*δ^2 := by positivity + field_simp + nlinarith + +noncomputable def radialLocalization (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ δ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (hδ : 0 < δ) + (hs : δ*‖z‖ ≤ z.im) : RadialLocalization a z ρ δ := + Classical.choice (exists_radialLocalization a ha z hz ρ δ hρ hr hδ hs) + +noncomputable def angleThreshold (z : ℂ) (n : ℕ) : ℝ := + (z.im/‖z‖) / ((n : ℝ)+1) +lemma angleThreshold_pos (z : ℂ) (hz : 0 < z.im) (n : ℕ) : 0 < angleThreshold z n := by + have hn : 0 < ‖z‖ := hz.trans_le (Complex.im_le_norm z) + unfold angleThreshold + positivity +lemma angleThreshold_initial (z : ℂ) (hz : 0 < z.im) (n : ℕ) : + angleThreshold z n * ‖z‖ ≤ z.im := by + have hn : 0 < ‖z‖ := hz.trans_le (Complex.im_le_norm z) + have hle : angleThreshold z n ≤ z.im/‖z‖ := by + exact div_le_self (div_nonneg hz.le hn.le) (by nlinarith [Nat.cast_nonneg (α := ℝ) n]) + exact (mul_le_mul_of_nonneg_right hle hn.le).trans_eq (div_mul_cancel₀ _ hn.ne') +lemma angleThreshold_tendsto (z : ℂ) : Tendsto (angleThreshold z) atTop (𝓝 0) := by + change Tendsto (fun n : ℕ => (z.im/‖z‖)/((n : ℝ)+1)) atTop (𝓝 0) + simpa only [mul_one_div,mul_zero] using + tendsto_one_div_add_atTop_nhds_zero_nat.const_mul (z.im/‖z‖) + +noncomputable def radialApproximation (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) (b : ExactSLEGenerator.Driver) : ℝ := + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + physicalGreen a (localState a L.ε L.hε z + (regionStop a L.ε L.hε z L.N ρ (angleThreshold z n) L.B b) b) + +lemma radialApproximation_mean (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) : + Integrable (radialApproximation a ha z hz ρ hρ hr n) W ∧ + (∫ b, radialApproximation a ha z hz ρ hρ hr n b ∂W) = physicalGreen a (z,0) := by + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + exact regionStop_green_mean W hW a L.ε ha.ne' L.hε z L.N L.B ρ (angleThreshold z n) L.initial + +lemma radialApproximation_bound (a : ℝ) (ha : 1/4 < a) (ha0 : 0 < a) (z : ℂ) + (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) + (b : ExactSLEGenerator.Driver) : + 0 ≤ radialApproximation a ha0 z hz ρ hρ hr n b ∧ + radialApproximation a ha0 z hz ρ hρ hr n b ≤ Real.exp (-alpha a*Real.log ρ) := by + let L := radialLocalization a ha0 z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b _ le_rfl + exact ⟨(Real.exp_pos _).le,physicalGreen_bound a ρ ha hρ _ (L.hε.trans_le hs.1) hs.2.2.1⟩ + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma physicalGreen_angle_bound (a ρ δ : ℝ) (ha : 1/4 < a) (hρ : 0 < ρ) + (v : State) (hy : 0 < Y v) (hr : ρ ≤ physicalRadius v) + (hs : Y v = δ*‖v.1‖) : + physicalGreen a v ≤ Real.exp (-alpha a*Real.log ρ) * δ^(p a) := by + have hn : 0 < ‖v.1‖ := hy.trans_le (Complex.im_le_norm _) + have hd : Y v / ‖v.1‖ = δ := (div_eq_iff hn.ne').mpr hs + rw [physicalGreen_eq_radius_sine a v hy,hd] + have hR : 0 < physicalRadius v := hρ.trans_le hr + apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg (by + rw [← hd]; exact div_nonneg hy.le hn.le) _) + rw [Real.rpow_def_of_pos hR] + apply Real.exp_le_exp.mpr + have hlog := Real.log_le_log hρ hr + nlinarith [mul_le_mul_of_nonneg_left hlog (alpha_pos ha).le] + +lemma radialApproximation_tendsto (a : ℝ) (ha : 1/4 < a) (ha0 : 0 < a) + (z : ℂ) (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (b : ExactSLEGenerator.Driver) : + Tendsto (fun n => radialApproximation a ha0 z hz ρ hρ hr n b) atTop + (𝓝 (radialWeight a b.1 z ρ)) := by + classical + let L (n : ℕ) := radialLocalization a ha0 z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T (n : ℕ) := regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b + let V (n : ℕ) := localState a (L n).ε (L n).hε z (T n) b + have hexit (n : ℕ) : physicalRadius (V n) = ρ ∨ Y (V n) = angleThreshold z n*‖(V n).1‖ := + regionStop_true_exit a (L n).ε ha0 (L n).hε z (L n).N ρ (angleThreshold z n) + hρ (angleThreshold_pos z hz n) (L n).B (L n).initial (L n).small (L n).large (L n).time b + have hactual (n : ℕ) : alive a b.1 (T n) z ∧ actualState a b.1 (T n) z = V n := + regionStop_actualState a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b _ le_rfl + by_cases hex : ∃ t : ℝ≥0, alive a b.1 t z ∧ physicalRadius (actualState a b.1 t z) = ρ + · obtain ⟨t,ht,htr⟩ := hex + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht + have he : ∀ᶠ n in atTop, radialApproximation a ha0 z hz ρ hρ hr n b = radialWeight a b.1 z ρ := by + filter_upwards [(angleThreshold_tendsto z).eventually (gt_mem_nhds hη)] with n hn + have ht' : T n ≤ t := regionStop_le_hit a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b t htr + have hη' := hηs (T n) ht' + rw [(hactual n).2] at hη' + rcases hexit n with hR|hS + · exact regionStop_weight_eq a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b hR + · have hsafe := regionStop_safe a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b (T n) le_rfl + have hnp : 0 < ‖(V n).1‖ := ((L n).hε.trans_le hsafe.1).trans_le (Complex.im_le_norm _) + have hd : Y (V n)/‖(V n).1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + rw [hd] at hη' + exact False.elim (not_le.mpr hn hη') + exact Filter.Tendsto.congr' (he.mono fun n hn => hn.symm) tendsto_const_nhds + · have hw : radialWeight a b.1 z ρ = 0 := by rw [radialWeight,ite_eq_left (radialTime_top_of_no_hit a b.1 z ρ hex)] + rw [hw] + have hbound (n : ℕ) : radialApproximation a ha0 z hz ρ hρ hr n b ≤ + Real.exp (-alpha a*Real.log ρ) * (angleThreshold z n)^(p a) := by + rcases hexit n with hR|hS + · exact False.elim (hex ⟨T n,(hactual n).1,by simpa only [(hactual n).2] using hR⟩) + · have hs := regionStop_safe a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) + (L n).B (L n).initial b (T n) le_rfl + exact physicalGreen_angle_bound a ρ (angleThreshold z n) ha hρ (V n) + ((L n).hε.trans_le hs.1) hs.2.2.1 hS + have hp : 0 < p a := by unfold p; linarith + have hu : Tendsto (fun n => Real.exp (-alpha a*Real.log ρ) * (angleThreshold z n)^(p a)) atTop (𝓝 0) := by + simpa only [mul_zero] using ((angleThreshold_tendsto z).rpow_const_nhds_zero hp).const_mul + (Real.exp (-alpha a*Real.log ρ)) + exact squeeze_zero (fun n => (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).1) hbound hu + + + +theorem radialWeight_mean (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) : + Integrable (fun b : ExactSLEGenerator.Driver => radialWeight a b.1 z ρ) W ∧ + (∫ b : ExactSLEGenerator.Driver, radialWeight a b.1 z ρ ∂W) = physicalGreen a (z,0) := by + have ha0 : 0 < a := by linarith + let F := radialApproximation a ha0 z hz ρ hρ hr + let G := fun b : ExactSLEGenerator.Driver => radialWeight a b.1 z ρ + let C := Real.exp (-alpha a*Real.log ρ) + have hFi (n : ℕ) : Integrable (F n) W := (radialApproximation_mean W hW a ha0 z hz ρ hρ hr n).1 + have hconv (b : ExactSLEGenerator.Driver) : Tendsto (fun n => F n b) atTop (𝓝 (G b)) := + radialApproximation_tendsto a ha ha0 z hz ρ hρ hr b + have hFm (n : ℕ) := (hFi n).aestronglyMeasurable + have hGm : AEStronglyMeasurable G W := aestronglyMeasurable_of_tendsto_ae atTop hFm + (Eventually.of_forall hconv) + have hFb (n : ℕ) : ∀ᵐ b ∂W, ‖F n b‖ ≤ C := by + filter_upwards [] with b + have h := radialApproximation_bound a ha ha0 z hz ρ hρ hr n b + change ‖radialApproximation a ha0 z hz ρ hρ hr n b‖ ≤ Real.exp (-alpha a*Real.log ρ) + simpa only [Real.norm_eq_abs,abs_of_nonneg h.1] using h.2 + have hGb : ∀ᵐ b ∂W, ‖G b‖ ≤ C := by + filter_upwards [] with b + exact le_of_tendsto (hconv b).norm (Eventually.of_forall fun n => by + have h := radialApproximation_bound a ha ha0 z hz ρ hρ hr n b + change ‖radialApproximation a ha0 z hz ρ hρ hr n b‖ ≤ Real.exp (-alpha a*Real.log ρ) + simpa only [Real.norm_eq_abs,abs_of_nonneg h.1] using h.2) + have hGi : Integrable G W := Integrable.of_bound hGm C hGb + refine ⟨hGi,?_⟩ + have hi := tendsto_integral_of_dominated_convergence (fun _ => C) hFm + (integrable_const C) hFb (Eventually.of_forall hconv) + have he : (fun n => ∫ b, F n b ∂W) = fun _ : ℕ => physicalGreen a (z,0) := + funext fun n => (radialApproximation_mean W hW a ha0 z hz ρ hρ hr n).2 + rw [he] at hi + exact tendsto_nhds_unique hi tendsto_const_nhds + +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma radialTime_attained (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) + (hfin : radialTime a b.1 z ρ ≠ ∞) : + alive a b.1 (radialTime a b.1 z ρ).toNNReal z ∧ + physicalRadius (actualState a b.1 (radialTime a b.1 z ρ).toNNReal z) = ρ := by + have hex : ∃ t : ℝ≥0, alive a b.1 t z ∧ physicalRadius (actualState a b.1 t z) = ρ := by + by_contra hn + exact hfin (radialTime_top_of_no_hit a b.1 z ρ hn) + obtain ⟨t,ht,htr⟩ := hex + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht + obtain ⟨n,hn⟩ := ((angleThreshold_tendsto z).eventually (gt_mem_nhds hη)).exists + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := regionStop a L.ε L.hε z L.N ρ (angleThreshold z n) L.B b + let V := localState a L.ε L.hε z T b + have he := regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + have ht' : T ≤ t := regionStop_le_hit a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t htr + have hR : physicalRadius V = ρ := by + rcases regionStop_true_exit a L.ε ha L.hε z L.N ρ (angleThreshold z n) + hρ (angleThreshold_pos z hz n) L.B L.initial L.small L.large L.time b with hR|hS + · exact hR + · have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + have hnp : 0 < ‖V.1‖ := (L.hε.trans_le hs.1).trans_le (Complex.im_le_norm _) + have hd : Y V/‖V.1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + have hη' := hηs T ht' + rw [he.2,hd] at hη' + exact False.elim (not_le.mpr hn hη') + have htime := regionStop_eq_radialTime a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b hR + rw [htime,ENNReal.toNNReal_coe] + change alive a b.1 T z ∧ physicalRadius (actualState a b.1 T z) = ρ + exact ⟨he.1,by rw [he.2]; exact hR⟩ + +end ExactSLEGreen + +open Filter +open scoped Topology +namespace ExactSLEMain +noncomputable def diskMap (θ : ℝ) (z : ℂ) : ℂ := + (z - Complex.exp (Complex.I * θ)) / (z - Complex.exp (-Complex.I * θ)) +noncomputable def fromDisk (θ : ℝ) (x : ℂ) : ℂ := + (x * Complex.exp (-Complex.I * θ) - Complex.exp (Complex.I * θ)) / (x - 1) + +lemma fromDisk_zero (θ : ℝ) : fromDisk θ 0 = Complex.exp (Complex.I*θ) := by simp [fromDisk] +lemma fromDisk_zero_im (θ : ℝ) : (fromDisk θ 0).im = Real.sin θ := by + rw [fromDisk_zero,mul_comm,Complex.exp_ofReal_mul_I_im] +lemma fromDisk_zero_norm (θ : ℝ) : ‖fromDisk θ 0‖ = 1 := by + rw [fromDisk_zero,Complex.norm_exp] + simp +lemma disk_endpoints_difference (θ : ℝ) : + Complex.exp (Complex.I*θ)-Complex.exp (-Complex.I*θ) = (2*Real.sin θ : ℝ)*Complex.I := by + rw [mul_comm Complex.I,show -Complex.I*(θ : ℂ) = ((-θ : ℝ) : ℂ)*Complex.I by push_cast; ring, + Complex.exp_ofReal_mul_I,Complex.exp_ofReal_mul_I,Real.cos_neg,Real.sin_neg] + push_cast + ring +lemma disk_endpoints_ne (θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) : + Complex.exp (Complex.I*θ)-Complex.exp (-Complex.I*θ) ≠ 0 := by + rw [disk_endpoints_difference] + exact mul_ne_zero (Complex.ofReal_ne_zero.mpr (mul_pos (by norm_num) (Real.sin_pos_of_pos_of_lt_pi hθ hθπ)).ne') Complex.I_ne_zero +lemma disk_deriv_at_zero (θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) : + deriv (diskMap θ) (fromDisk θ 0) = + (Complex.exp (Complex.I*θ)-Complex.exp (-Complex.I*θ))⁻¹ := by + rw [fromDisk_zero] + have hn := disk_endpoints_ne θ hθ hθπ + have hd := ((hasDerivAt_id (Complex.exp (Complex.I*θ))).sub_const (Complex.exp (Complex.I*θ))).div + ((hasDerivAt_id (Complex.exp (Complex.I*θ))).sub_const (Complex.exp (-Complex.I*θ))) hn + change deriv (fun z => (z-Complex.exp (Complex.I*θ))/(z-Complex.exp (-Complex.I*θ))) _ = _ + have hd' := hd.deriv + change deriv (fun z => (z-Complex.exp (Complex.I*θ))/(z-Complex.exp (-Complex.I*θ))) _ = _ at hd' + rw [hd'] + simp only [id_eq,sub_self,zero_mul,sub_zero,one_mul] + field_simp [hn] +lemma disk_deriv_norm (θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) : + ‖deriv (diskMap θ) (fromDisk θ 0)‖ = (2*Real.sin θ)⁻¹ := by + rw [disk_deriv_at_zero θ hθ hθπ,disk_endpoints_difference,norm_inv,norm_mul,Complex.norm_real, + Complex.norm_I,mul_one,Real.norm_eq_abs,abs_of_pos (mul_pos (by norm_num) (Real.sin_pos_of_pos_of_lt_pi hθ hθπ))] +end ExactSLEMain + +namespace ExactSLEMain +noncomputable def centeredZ (A : ℝ) (θ : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (x : ℂ) : ℂ := + loewnerMap A b t (fromDisk θ x) - (b t : ℂ) +noncomputable def sineAngle (A θ : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (x : ℂ) : ℝ := + (centeredZ A θ b t x).im / ‖centeredZ A θ b t x‖ +noncomputable def diskRadius (A θ : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (x : ℂ) : ℝ := + ‖deriv (diskMap θ) (fromDisk θ x)‖ * (2 * (centeredZ A θ b t x).im) / + ‖deriv (loewnerMap A b t) (fromDisk θ x)‖ +noncomputable def green (a θ : ℝ) (b : ℝ≥0 → ℝ) (t : ℝ≥0) (x : ℂ) : ℝ := by + classical + exact if alive a b t (fromDisk θ x) then + diskRadius a θ b t x ^ (-(2 - (1 + 1 / (4 * a)))) * sineAngle a θ b t x ^ (4 * a - 1) + else 0 + +noncomputable def levelTime (a θ : ℝ) (b : ℝ≥0 → ℝ) (l : ℕ) : ℝ≥0∞ := + sInf {u : ℝ≥0∞ | ∃ t : ℝ≥0, u = t ∧ alive a b t (fromDisk θ 0) ∧ + diskRadius a θ b t 0 = Real.exp (-2 * a * l)} +noncomputable def tiltWeight (a θ : ℝ) (b : ℝ≥0 → ℝ) (l : ℕ) : ℝ := + if levelTime a θ b l = ∞ then 0 else + Real.exp (2 * a * (2 - (1 + 1 / (4 * a))) * l) * + sineAngle a θ b (levelTime a θ b l).toNNReal 0 ^ (4 * a - 1) / Real.sin θ ^ (4 * a - 1) + +end ExactSLEMain + +namespace ExactSLEMain +open ExactSLEGreen + +lemma diskRadius_actualState (a θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) + (b : ℝ≥0 → ℝ) (hb : Continuous b) (t : ℝ≥0) + (ht : alive a b t (fromDisk θ 0)) : + diskRadius a θ b t 0 = physicalRadius (actualState a b t (fromDisk θ 0)) / Real.sin θ := by + have hs := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + have hd : 0 < ‖deriv (loewnerMap a b t) (fromDisk θ 0)‖ := + norm_pos_iff.mpr (deriv_loewnerMap_ne_zero hb ht) + unfold diskRadius physicalRadius actualState centeredZ + rw [disk_deriv_norm θ hθ hθπ] + simp only [Y_apply,J_apply,Real.exp_neg,Real.exp_log hd] + field_simp + +lemma levelTime_radialTime (a θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) + (b : ℝ≥0 → ℝ) (hb : Continuous b) (l : ℕ) : + levelTime a θ b l = radialTime a b (fromDisk θ 0) (Real.sin θ*Real.exp (-2*a*l)) := by + have hs := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + unfold levelTime radialTime + congr 1 + ext u + constructor + · rintro ⟨t,hu,ht,hR⟩ + refine ⟨t,hu,ht,?_⟩ + rw [diskRadius_actualState a θ hθ hθπ b hb t ht] at hR + simpa only [mul_comm] using (div_eq_iff hs.ne').mp hR + · rintro ⟨t,hu,ht,hR⟩ + refine ⟨t,hu,ht,?_⟩ + rw [diskRadius_actualState a θ hθ hθπ b hb t ht,hR,mul_div_cancel_left₀ _ hs.ne'] + +lemma radial_initial_green (a θ : ℝ) (hθ : 0 < θ) (hθπ : θ < Real.pi) : + physicalGreen a (fromDisk θ 0,0) = + (Real.sin θ)^(-alpha a)*(Real.sin θ)^(p a) := by + have hs := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + rw [physicalGreen_eq_radius_sine a _ (by simpa only [Y_apply,fromDisk_zero_im] using hs)] + simp only [physicalRadius,Y_apply,J_apply,neg_zero,Real.exp_zero,mul_one,fromDisk_zero_im, + fromDisk_zero_norm,div_one] + +lemma tiltWeight_radialWeight (a θ : ℝ) (ha : 1/4 < a) (hθ : 0 < θ) (hθπ : θ < Real.pi) + (b : Driver) (l : ℕ) : + tiltWeight a θ b.1 l = + radialWeight a b.1 (fromDisk θ 0) (Real.sin θ*Real.exp (-2*a*l)) / + physicalGreen a (fromDisk θ 0,0) := by + have ha0 : 0 < a := by linarith + have hs := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + let ρ := Real.sin θ*Real.exp (-2*a*l) + have hρ : 0 < ρ := mul_pos hs (Real.exp_pos _) + have hr : ρ ≤ (fromDisk θ 0).im := by + rw [fromDisk_zero_im] + have he : Real.exp (-2*a*l) ≤ 1 := Real.exp_le_one_iff.mpr (by + have h : (0 : ℝ) ≤ 2*a*l := by positivity + nlinarith) + exact (mul_le_mul_of_nonneg_left he hs.le).trans_eq (mul_one _) + have hz : 0 < (fromDisk θ 0).im := by simpa only [fromDisk_zero_im] using hs + have htime := levelTime_radialTime a θ hθ hθπ b.1 b.1.continuous l + by_cases hfin : radialTime a b.1 (fromDisk θ 0) ρ = ∞ + · rw [tiltWeight,htime,ite_eq_left hfin,radialWeight,ite_eq_left hfin,zero_div] + · have ht := radialTime_attained a ha0 (fromDisk θ 0) hz ρ hρ hr b hfin + let T := (radialTime a b.1 (fromDisk θ 0) ρ).toNNReal + have hy : 0 < Y (actualState a b.1 T (fromDisk θ 0)) := by + obtain ⟨f,hf⟩ := ht.1 + rw [Y_apply,actualState,Complex.sub_im,Complex.ofReal_im,sub_zero,loewnerMap_eq hf] + exact (hf.2 T ⟨T.coe_nonneg,le_rfl⟩).1 + have heα : 2-(1+1/(4*a)) = alpha a := by unfold alpha; ring + rw [tiltWeight,htime,ite_eq_right hfin,radialWeight,ite_eq_right hfin, + physicalGreen_eq_radius_sine a _ hy,ht.2,radial_initial_green a θ hθ hθπ,heα] + change Real.exp (2*a*alpha a*l)* + (Y (actualState a b.1 T (fromDisk θ 0))/‖(actualState a b.1 T (fromDisk θ 0)).1‖)^(p a) / + (Real.sin θ)^(p a) = + ρ^(-alpha a)*(Y (actualState a b.1 T (fromDisk θ 0))/‖(actualState a b.1 T (fromDisk θ 0)).1‖)^(p a) / + ((Real.sin θ)^(-alpha a)*(Real.sin θ)^(p a)) + have he : ρ^(-alpha a) = (Real.sin θ)^(-alpha a)*Real.exp (2*a*alpha a*l) := by + rw [Real.rpow_def_of_pos hρ,Real.rpow_def_of_pos hs] + dsimp only [ρ] + rw [Real.log_mul hs.ne' (Real.exp_ne_zero _),Real.log_exp,← Real.exp_add] + congr 1 + ring + rw [he] + have hn : (Real.sin θ)^(-alpha a) ≠ 0 := (Real.rpow_pos_of_pos hs _).ne' + field_simp + + + +end ExactSLEMain +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/StoppingMeasurability.lean b/lean/OAI/Probability/SLEGauge/StoppingMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f05f0343359bc1bf934decfa1d985ea465c265c --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/StoppingMeasurability.lean @@ -0,0 +1,467 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppedLimits + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +namespace SLEExactGauge.RationalStop +lemma measurableSet_safe {Ω : Type*} [MeasurableSpace Ω] (f : Ω → ℝ → ℝ) + (hf : ∀ u, Measurable (fun b => f b u)) (R s : ℝ) : + MeasurableSet {b | Safe (f b) R s} := by + simp only [Safe,ofPred_exists,ofPred_forall] + exact MeasurableSet.iUnion fun n => MeasurableSet.iInter fun r => + measurableSet_le (hf _) measurable_const + +lemma safe_past {f : (ℝ≥0 → ℝ) → ℝ → ℝ} + (hp : ∀ s ≥ 0, ∀ b c, (∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) → f b s = f c s) + {R s : ℝ} (hs : 0 ≤ s) {b c : ℝ≥0 → ℝ} + (hbc : ∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) : Safe (f b) R s ↔ Safe (f c) R s := by + have he : ∀ r : ℚ, f b (sample s r) = f c (sample s r) := by + intro r + exact hp _ (sample_mem hs r).1 b c (fun u hu => hbc u (hu.trans (sample_mem hs r).2)) + unfold Safe + simp only [he] + + + +def Exit (f : ℝ → ℝ) (R H : ℝ) : ℝ := + sInf ({u | u ∈ Icc 0 H ∧ R ≤ f u} ∪ {H}) + +lemma exit_mem {f : ℝ → ℝ} {R H : ℝ} (hH : 0 ≤ H) + (hf : ContinuousOn f (Icc 0 H)) : + Exit f R H ∈ {u | u ∈ Icc 0 H ∧ R ≤ f u} ∪ {H} := by + have hc : IsClosed {u | u ∈ Icc 0 H ∧ R ≤ f u} := + (hf.upperSemicontinuousOn.isCompact_inter_preimage_Ici isCompact_Icc R).isClosed + exact (hc.union isClosed_singleton).csInf_mem ⟨H,Or.inr rfl⟩ + ⟨0,by intro u hu; rcases hu with hu|hu; exact hu.1.1; simpa only [show u = H from hu] using hH⟩ + +lemma exit_bounds {f : ℝ → ℝ} {R H : ℝ} (hH : 0 ≤ H) + (hf : ContinuousOn f (Icc 0 H)) : Exit f R H ∈ Icc 0 H := by + rcases exit_mem hH hf with ⟨hu,_⟩ | hu + · exact hu + · change Exit f R H = H at hu + rw [hu] + exact ⟨hH,le_rfl⟩ + +lemma exit_le {f : ℝ → ℝ} {R H u : ℝ} (hH : 0 ≤ H) + (hu : u ∈ Icc 0 H) (huR : R ≤ f u) : Exit f R H ≤ u := by + exact csInf_le ⟨0,by intro v hv; rcases hv with hv|hv; exact hv.1.1; simpa only [show v = H from hv] using hH⟩ + (Or.inl ⟨hu,huR⟩) + +lemma lt_exit_iff {f : ℝ → ℝ} {R H s : ℝ} (hH : 0 ≤ H) + (hf : ContinuousOn f (Icc 0 H)) (hs : 0 ≤ s) : + s < Exit f R H ↔ s < H ∧ Safe f R s := by + constructor + · intro h + have hsH := h.trans_le (exit_bounds hH hf).2 + refine ⟨hsH,(safe_iff hs (hf.mono (Icc_subset_Icc_right hsH.le))).mpr ?_⟩ + intro u hu + by_contra! hn + have he := exit_le hH ⟨hu.1,hu.2.trans hsH.le⟩ hn + linarith [hu.2] + · rintro ⟨hsH,hS⟩ + have h := (safe_iff hs (hf.mono (Icc_subset_Icc_right hsH.le))).mp hS + by_contra! hn + rcases exit_mem hH hf with he|he + · exact (h _ ⟨he.1.1,hn⟩).not_ge he.2 + · have he' : Exit f R H = H := he + linarith + + + +lemma bound_until_exit {f : ℝ → ℝ} {R H : ℝ} (hH : 0 ≤ H) + (hf : ContinuousOn f (Icc 0 H)) (h0 : f 0 < R) : + ∀ u ∈ Icc 0 (Exit f R H), f u ≤ R := by + intro u hu + have huH := hu.2.trans (exit_bounds hH hf).2 + by_cases h : u = 0 + · simpa only [h] using h0.le + have hu0 : 0 < u := lt_of_le_of_ne hu.1 (Ne.symm h) + have hd : ∀ t ∈ Ico 0 u, f t ≤ R := by + intro t ht + have htE := ht.2.trans_le hu.2 + exact ((safe_iff ht.1 (hf.mono (Icc_subset_Icc_right (ht.2.le.trans huH)))).mp + ((lt_exit_iff hH hf ht.1).mp htE).2 t ⟨ht.1,le_rfl⟩).le + have hc : IsClosed {t ∈ Icc 0 H | f t ≤ R} := + (hf.lowerSemicontinuousOn.isCompact_inter_preimage_Iic isCompact_Icc R).isClosed + have hsub : Ico 0 u ⊆ {t ∈ Icc 0 H | f t ≤ R} := + fun t ht => ⟨⟨ht.1,ht.2.le.trans huH⟩,hd t ht⟩ + have he := closure_minimal hsub hc + rw [closure_Ico hu0.ne] at he + exact (he ⟨hu0.le,le_rfl⟩).2 + +end SLEExactGauge.RationalStop + +namespace SLEExactGauge.RationalStop +open Set MeasureTheory + +lemma measurable_exit {Ω : Type*} [MeasurableSpace Ω] {f : Ω → ℝ → ℝ} + {H R : ℝ} (hH : 0 ≤ H) (hf : ∀ u, Measurable (fun b => f b u)) + (hc : ∀ b, ContinuousOn (f b) (Icc 0 H)) : + Measurable (fun b => Exit (f b) R H) := by + apply measurable_of_Ioi + intro s + by_cases hs : 0 ≤ s + · have he : (fun b => Exit (f b) R H) ⁻¹' Ioi s = {b | s < H ∧ Safe (f b) R s} := by + ext b + exact lt_exit_iff hH (hc b) hs + rw [he] + exact (MeasurableSet.const _).inter (measurableSet_safe f hf R s) + · have he : (fun b => Exit (f b) R H) ⁻¹' Ioi s = univ := by + ext b + simp only [mem_preimage,mem_Ioi,mem_univ,iff_true] + exact (lt_of_not_ge hs).trans_le (exit_bounds hH (hc b)).1 + rw [he] + exact MeasurableSet.univ + + + +lemma measurable_stopped_eval {Ω E : Type*} [MeasurableSpace Ω] + [MeasurableSpace E] [TopologicalSpace E] [TopologicalSpace.PseudoMetrizableSpace E] [BorelSpace E] + {f : Ω → ℝ → E} {τ : Ω → ℝ} {H : ℝ} (hH : 0 ≤ H) + (hf : ∀ u, Measurable (fun b => f b u)) (hc : ∀ b, ContinuousOn (f b) (Icc 0 H)) + (hτ : Measurable τ) (hτH : ∀ b, τ b ∈ Icc 0 H) : + Measurable (fun b => f b (τ b)) := by + have hm := measurable_uncurry_of_continuous_of_measurable + (u := fun t b => f b (sample H t)) + (fun b => (hc b).comp_continuous (continuous_sample H) (sample_mem hH)) + (fun t => hf (sample H t)) + have he : (fun b => f b (τ b)) = (fun q : ℝ × Ω => f q.2 (sample H q.1)) ∘ (fun b => (τ b,b)) := by + funext b + exact congrArg (f b) (sample_self (hτH b)).symm + rw [he] + exact hm.comp (hτ.prodMk measurable_id) +end SLEExactGauge.RationalStop + +namespace SLEExactGauge.AngleCalculus +open scoped ContDiff +lemma contDiffAt_V {z : ℂ} (hz : z ≠ 0) : ContDiffAt ℝ ∞ V z := by + have hd : ContDiff ℝ ∞ (fun z : ℂ => Complex.normSq z) := by + exact (Complex.reCLM.contDiff.mul Complex.reCLM.contDiff).add + (Complex.imCLM.contDiff.mul Complex.imCLM.contDiff) + exact Complex.imCLM.contDiff.contDiffAt.div hd.contDiffAt (Complex.normSq_pos.mpr hz).ne' +end SLEExactGauge.AngleCalculus +namespace SLEExactGauge.OnePoint +open _root_.OAI.SLEExactGauge.Localization AngleCalculus BrownianCalculus ODEPath RationalStop +open scoped ContDiff + +lemma contDiffOn_field (P : Parameter) : ContDiffOn ℝ ∞ (Function.uncurry (field P)) domain := by + intro q hq + apply ContDiffAt.contDiffWithinAt + have hz : ContDiffAt ℝ ∞ (fun q : State × ℝ => q.1.2-(q.2:ℂ)) q := + (contDiffAt_snd.comp q contDiffAt_fst).sub (Complex.ofRealCLM.contDiff.contDiffAt.comp q contDiffAt_snd) + have hn : q.1.2-(q.2:ℂ) ≠ 0 := by + intro he + have hi := congrArg Complex.im he + have hh : 0 < q.1.2.im := hq + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + linarith + exact (((contDiffAt_V hn).comp q hz).pow 2).prodMk + (by + simpa only [div_eq_mul_inv] using (contDiffAt_const (c := (P.a:ℂ))).mul + (hz.inv hn)) + +lemma exists_cutoff_field (P : Parameter) {K : Set (State × ℝ)} + (hK : IsCompact K) (hKO : K ⊆ domain) : + ∃ v : State → ℝ → State, ∃ M L : ℝ, 0 ≤ M ∧ 0 ≤ L ∧ + ContDiff ℝ ∞ (Function.uncurry v) ∧ + (∀ x b, ‖v x b‖ ≤ M) ∧ + (∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) ∧ + (∀ q ∈ K, v q.1 q.2 = field P q.1 q.2) := by + obtain ⟨V,hV,hVK,hVe⟩ := compact_extension hK isOpen_domain hKO + (Function.uncurry (field P)) (contDiffOn_field P) + obtain ⟨M,hM⟩ := hVK.exists_bound_of_continuous hV.continuous + obtain ⟨L,hL⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hVK hV (by simp) + refine ⟨fun x b => V (x,b),max M 0,L,le_max_right _ _,L.coe_nonneg,hV,?_,?_,?_⟩ + · intro x b + exact (hM (x,b)).trans (le_max_left _ _) + · intro b x y + have H := hL.dist_le_mul (x,b) (y,b) + simpa [dist_eq_norm,Prod.norm_def] using H + · intro q hq + exact (hVe q hq).self_of_nhds + + + +theorem exists_stopped_green (P : Parameter) {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + {H : ℝ} (hH : 0 ≤ H) (φ : State × ℝ → ℝ) (hφ : Continuous φ) + (hK : IsCompact {q | φ q ≤ 2}) (hKO : {q | φ q ≤ 2} ⊆ domain) + (z : State) (hz : φ (z,0) < 1) : + ∃ v : State → ℝ → State, ∃ M L : ℝ, 0 ≤ M ∧ 0 ≤ L ∧ + ContDiff ℝ ∞ (Function.uncurry v) ∧ + (∀ x b, ‖v x b‖ ≤ M) ∧ + (∀ b x y, ‖v x b-v y b‖ ≤ L*‖x-y‖) ∧ + (∀ q, φ q ≤ 2 → v q.1 q.2 = field P q.1 q.2) ∧ + let g := fun b : Driver => ODEPath.flow v z b + let τ := fun b : Driver => Exit (fun u => φ (g b u,b u.toNNReal)) 1 H + (∀ b u, u ∈ Icc 0 (τ b) → φ (g b u,b u.toNNReal) ≤ 1) ∧ + ∀ t ≥ 0, (∫ b : Driver, green P + (g b (min t (τ b)),b (min t (τ b)).toNNReal) ∂W) = green P (z,0) := by + obtain ⟨v,M,L,hM,hL,hv,hbound,hlip,hveq⟩ := exists_cutoff_field P hK hKO + let g := fun b : Driver => ODEPath.flow v z b + let f := fun (b : ℝ≥0 → ℝ) u => φ (ODEPath.flow v z b u,b u.toNNReal) + let τ := fun b : Driver => Exit (f b) 1 H + have hg (b : Driver) := ODEPath.flow_solution v hv.continuous z b b.continuous + hM hL (by linarith : 0 ≤ H+1) hbound hlip + have hgc (b : Driver) : ContinuousOn (g b) (Icc 0 (H+1)) := + ODEPath.continuousOn_flow v hv.continuous z b b.continuous hM hL (by linarith) hbound hlip + have hfc (b : Driver) : ContinuousOn (f b) (Icc 0 (H+1)) := + hφ.comp_continuousOn ((hgc b).prodMk ((b.continuous.comp continuous_real_toNNReal).continuousOn)) + have hfcH (b : Driver) : ContinuousOn (f b) (Icc 0 H) := + (hfc b).mono (Icc_subset_Icc_right (by linarith)) + have hf0 (b : Driver) : f b 0 < 1 := by + simpa only [f,(hg b).1,Real.toNNReal_zero,map_zero] using hz + have hτ (b : Driver) : 0 ≤ τ b ∧ τ b < H+1 := by + have hb := exit_bounds hH (hfcH b) (R := 1) + exact ⟨hb.1,lt_of_le_of_lt hb.2 (by linarith)⟩ + have hsafe (b : Driver) : ∀ u ∈ Icc 0 (τ b), f b u ≤ 1 := + bound_until_exit hH (hfcH b) (hf0 b) + refine ⟨v,M,L,hM,hL,hv,hbound,hlip,hveq,hsafe,?_⟩ + intro t ht + let K : Set (State × ℝ) := {q | φ q ≤ 2} + have hDo : IsOpen {q | φ q < 2} := isOpen_lt hφ continuous_const + have hK1 : IsCompact {q | φ q ≤ 1} := + hK.of_isClosed_subset (isClosed_le hφ continuous_const) (fun q hq => by dsimp at *; linarith) + obtain ⟨δ,hδ,hδD⟩ := hK1.exists_thickening_subset_open hDo (fun q hq => by dsimp at *; linarith) + have hD (b : Driver) : ∃ δ > 0, ∀ u ∈ Icc 0 (τ b), ∀ x, + ‖x-g b u‖ < δ → (x,b u.toNNReal) ∈ K := by + refine ⟨δ,hδ,?_⟩ + intro u hu x hx + have hi : φ (x,b u.toNNReal) < 2 := hδD (by + apply Metric.mem_thickening_iff.mpr + refine ⟨(g b u,b u.toNNReal),hsafe b u hu,?_⟩ + rw [dist_eq_norm] + change max ‖x-g b u‖ ‖b u.toNNReal-b u.toNNReal‖ < δ + simpa using hx) + exact hi.le + have mf (u : ℝ) : Measurable (fun b : ℝ≥0 → ℝ => f b u) := + hφ.measurable.comp ((ODEPath.measurable_flow v hv.continuous.measurable z u).prodMk (measurable_pi_apply _)) + have hfpast : ∀ s ≥ 0, ∀ b c : ℝ≥0 → ℝ, + (∀ u : ℝ≥0, (u:ℝ) ≤ s → b u = c u) → f b s = f c s := by + intro s hs b c hbc + have hb := hbc s.toNNReal (by simpa only [Real.coe_toNNReal',max_eq_left hs] using le_refl s) + simp only [f,ODEPath.flow_past v z hs hbc,hb] + let S : ℝ≥0 → Set ((ℝ≥0 → ℝ) × (State × ℝ)) := fun r => + {q | (r:ℝ) < H ∧ Safe (f q.1) 1 r ∧ q.2 ∈ K} + have mS : ∀ r, MeasurableSet (S r) := by + intro r + exact (MeasurableSet.const _).inter + (((measurableSet_safe f mf 1 _).preimage measurable_fst).inter (hK.measurableSet.preimage measurable_snd)) + have hSpast : ∀ r b c, (∀ u ≤ r, b u = c u) → ∀ x, ((b,x) ∈ S r ↔ (c,x) ∈ S r) := by + intro r b c hbc x + have he : Safe (f b) 1 r ↔ Safe (f c) 1 r := safe_past hfpast r.coe_nonneg + (fun u hu => hbc u hu) + exact and_congr_right fun _ => and_congr_left fun _ => he + have hSeq : ∀ (b : Driver) r x, (((b:ℝ≥0 → ℝ),x) ∈ S r ↔ (r:ℝ) < τ b ∧ x ∈ K) := by + intro b r x + change (_ ∧ _ ∧ _) ↔ (_ ∧ _) + rw [lt_exit_iff hH (hfcH b) r.coe_nonneg] + exact and_assoc.symm + apply expected_stopped_local_grid_eq hW (green P) K domain hK isOpen_domain hKO (contDiffOn_green P) + v hv.continuous.measurable g z hL hM hbound hlip (fun b => (hg b).1) (fun b => (hg b).2) + (fun b => hv.continuous.comp_continuousOn ((hgc b).prodMk + ((b.continuous.comp continuous_real_toNNReal).continuousOn))) τ hτ hD + (fun q hq => by rw [hveq q hq]; exact green_generator P (hKO hq)) + S mS hSpast hSeq (fun r q hq => hq.2.2) (by change φ (z,0) ≤ 2; linarith) ht +end SLEExactGauge.OnePoint + + + +noncomputable section +open Set Filter Real +open scoped Topology +namespace SLEExactGauge.ReverseDerivative + +def r (a : ℝ) : ℝ := 2*a+1/2 +def zeta (a : ℝ) : ℝ := a-1/(16*a) +def lambda (a : ℝ) : ℝ := a+1+3/(16*a) +def R (x y : ℝ) : ℝ := x^2+y^2 +def D (u x y : ℝ) : ℝ := R x y+u/2 + +def H (a u x y l : ℝ) : ℝ := + lambda a*l+r a/2*Real.log (R x y)+(zeta a-r a)*Real.log y- + zeta a/2*Real.log (D u x y) +def F (a u x y l : ℝ) : ℝ := Real.exp (H a u x y l) +def Hx (a u x y : ℝ) : ℝ := r a*x/R x y-zeta a*x/D u x y +def Hxx (a u x y : ℝ) : ℝ := + r a*(y^2-x^2)/(R x y)^2-zeta a/D u x y+2*zeta a*x^2/(D u x y)^2 +def Hy (a u x y : ℝ) : ℝ := + r a*y/R x y+(zeta a-r a)/y-zeta a*y/D u x y + +def residual (a u x y : ℝ) : ℝ := + R x y*((a-1/2+1/(16*a))*x^2+(2*a+1/2)*y^2)+ + u/2*((2*a+3/2)*x^2+(2*a+1/2)*y^2) + +lemma R_pos (x : ℝ) {y : ℝ} (hy : 0 < y) : 0 < R x y := by + unfold R + positivity + +lemma D_pos {u y : ℝ} (hu : 0 ≤ u) (hy : 0 < y) (x : ℝ) : 0 < D u x y := by + exact add_pos_of_pos_of_nonneg (R_pos x hy) (div_nonneg hu (by norm_num)) + +lemma parameters {a : ℝ} (ha : 1/4 < a) : + 0 < zeta a ∧ 0 < lambda a ∧ 2 < zeta a+lambda a ∧ 1 < r a ∧ r a < 4*a := by + have ha0 : 0 < a := by linarith + have h16 : 0 < 16*a := by positivity + have hz : 0 < zeta a := by + unfold zeta + have hsq : 1 < 16*a^2 := by nlinarith + apply sub_pos.mpr + apply (div_lt_iff₀ h16).2 + nlinarith + have hl : 0 < lambda a := by unfold lambda; positivity + have he : zeta a+lambda a-2 = (4*a-1)^2/(8*a) := by + unfold zeta lambda + field_simp + ring + have hsum : 2 < zeta a+lambda a := by + have : 0 < (4*a-1)^2/(8*a) := div_pos (sq_pos_of_pos (by linarith)) (by positivity) + linarith + exact ⟨hz,hl,hsum,by unfold r; linarith,by unfold r; linarith⟩ + +lemma residual_nonneg {a u y : ℝ} (ha : 1/4 < a) (hu : 0 ≤ u) + (hy : 0 < y) (x : ℝ) : 0 ≤ residual a u x y := by + have ha0 : 0 < a := by linarith + have hc : 0 ≤ a-1/2+1/(16*a) := by + have he : a-1/2+1/(16*a) = (4*a-1)^2/(16*a) := by field_simp; ring + rw [he] + positivity + unfold residual + have hR := (R_pos x hy).le + positivity + +lemma hasDerivAt_Hx {a u x y l : ℝ} (hu : 0 ≤ u) (hy : 0 < y) : + HasDerivAt (fun w => H a u w y l) (Hx a u x y) x := by + have hR : HasDerivAt (fun w : ℝ => R w y) (2*x) x := by + convert! ((hasDerivAt_id x).pow 2).add_const (y^2) using 1 + simp + have hD : HasDerivAt (fun w : ℝ => D u w y) (2*x) x := hR.add_const (u/2) + have hd := (((hR.log (R_pos x hy).ne').const_mul (r a/2)).const_add (lambda a*l) + |>.add_const ((zeta a-r a)*Real.log y)).sub + ((hD.log (D_pos hu hy x).ne').const_mul (zeta a/2)) + convert! hd using 1 + · dsimp [Hx]; ring + +lemma hasDerivAt_Hxx {a u x y : ℝ} (hu : 0 ≤ u) (hy : 0 < y) : + HasDerivAt (fun w => Hx a u w y) (Hxx a u x y) x := by + have hR : HasDerivAt (fun w : ℝ => R w y) (2*x) x := by + convert! ((hasDerivAt_id x).pow 2).add_const (y^2) using 1 + simp + have hD : HasDerivAt (fun w : ℝ => D u w y) (2*x) x := hR.add_const (u/2) + have hd := (((hasDerivAt_id x).const_mul (r a)).div hR (R_pos x hy).ne').sub + (((hasDerivAt_id x).const_mul (zeta a)).div hD (D_pos hu hy x).ne') + convert! hd using 1 + dsimp [Hxx] + have hnR := (R_pos x hy).ne' + have hnD := (D_pos hu hy x).ne' + field_simp + simp only [R] + ring + +lemma deriv_Fx {a u y l : ℝ} (hu : 0 ≤ u) (hy : 0 < y) : + deriv (fun x => F a u x y l) = fun x => F a u x y l * Hx a u x y := by + funext x + exact (hasDerivAt_Hx hu hy).exp.deriv + +lemma deriv_Fxx {a u x y l : ℝ} (hu : 0 ≤ u) (hy : 0 < y) : + deriv (deriv (fun w => F a u w y l)) x = + F a u x y l * ((Hx a u x y)^2+Hxx a u x y) := by + rw [deriv_Fx hu hy] + have hd := ((hasDerivAt_Hx (a := a) (x := x) (l := l) hu hy).exp).mul + (hasDerivAt_Hxx (a := a) (x := x) hu hy) + convert! hd.deriv using 1 + dsimp [F] + ring + +lemma generator_identity {a u x y : ℝ} (ha : 0 < a) (hu : 0 ≤ u) (hy : 0 < y) : + ((Hx a u x y)^2+Hxx a u x y)/2 + + (-a*x/R x y)*Hx a u x y+(a*y/R x y)*Hy a u x y+ + (a*(x^2-y^2)/(R x y)^2)*lambda a+zeta a/(4*D u x y) = + -zeta a*residual a u x y/(2*R x y*(D u x y)^2) := by + have ha' := ha.ne' + have hR := (R_pos x hy).ne' + have hD := (D_pos hu hy x).ne' + have hy' := hy.ne' + simp only [Hx,Hxx,Hy,lambda,zeta,r,residual] + field_simp + simp only [D,R] + ring + +lemma generator_nonpos {a u x y : ℝ} (ha : 1/4 < a) (hu : 0 ≤ u) (hy : 0 < y) : + ((Hx a u x y)^2+Hxx a u x y)/2 + + (-a*x/R x y)*Hx a u x y+(a*y/R x y)*Hy a u x y+ + (a*(x^2-y^2)/(R x y)^2)*lambda a+zeta a/(4*D u x y) ≤ 0 := by + rw [generator_identity (by linarith) hu hy] + apply div_nonpos_of_nonpos_of_nonneg + · exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (parameters ha).1.le) + (residual_nonneg ha hu hy x) + · exact mul_nonneg (mul_nonneg (by norm_num) (R_pos x hy).le) (sq_nonneg _) + +end SLEExactGauge.ReverseDerivative + +namespace SLEExactGauge.ReverseDerivative + +abbrev State := ℝ × ℂ × ℝ + +def test (a : ℝ) (q : State) (b : ℝ) : ℝ := + F a q.1 (q.2.1.re-b) q.2.1.im q.2.2 + +def vector (a : ℝ) (q : State) (b : ℝ) : State := + (-1, (-(a:ℂ)/(q.2.1-b),a*((q.2.1-b)⁻¹^2).re)) + +lemma differentiableAt_test (a b : ℝ) {q : State} (hu : 0 ≤ q.1) (hy : 0 < q.2.1.im) : + DifferentiableAt ℝ (fun q => test a q b) q := by + have hR := (R_pos (q.2.1.re-b) hy).ne' + have hD := (D_pos hu hy (q.2.1.re-b)).ne' + have hy' := hy.ne' + have hre : DifferentiableAt ℝ (fun q : State => q.2.1.re) q := + Complex.reCLM.differentiableAt.comp _ (differentiableAt_fst.comp _ differentiableAt_snd) + have him : DifferentiableAt ℝ (fun q : State => q.2.1.im) q := + Complex.imCLM.differentiableAt.comp _ (differentiableAt_fst.comp _ differentiableAt_snd) + dsimp [test, F, H, D, R] at * + fun_prop + +end SLEExactGauge.ReverseDerivative +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/SubdiskMoments.lean b/lean/OAI/Probability/SLEGauge/SubdiskMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d1a5368a54375491f11abda14323ac778e3cad7 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/SubdiskMoments.lean @@ -0,0 +1,538 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.CenteredSequenceLaw + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen KernelSimilarity + + + +theorem common_limit_subdisk_tilted_moment (r : ℝ) (hr : 0≤r) (hr1 : r<1) + (a : ℝ) (ha : 1/4b.1 t) W → + ∀(s : ℕ→Finset ℕ) (coeff : ℕ→ℕ→ℝ), + (∀k j,j∈s k→0≤coeff k j) → (∀k,∑j∈s k,coeff k j=1) → + ∀μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane, + (∀b,IsFiniteMeasureOnCompacts (μ ∞ b)) → Measurable (μ ∞) → + (∀ᵐ b∂W,∀v : ℝ≥0∞,μ v b≤μ ∞ b) → + (∀ᵐ b∂W,∀f : C_c(UpperPlane,ℝ),Tendsto (fun k=>∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂μ ∞ b))) → + ∀(θ : ℝ) (_hθ : 0<θ) (_hθπ : θ∫z,f z∂μ ∞ b) := by + let Kμ : Kernel ExactSLEGenerator.Driver UpperPlane := ⟨μ ∞,hμ⟩ + exact (f.continuous.stronglyMeasurable.integral_kernel (κ:=Kμ)).measurable + have hb := hDb W hW θ hθ hθπ f (subdiskTest_support a ⟨θ,hθ,hθπ⟩ r hr hr1) + (subdiskTest_bound a ⟨θ,hθ,hθπ⟩ r hr hr1) s coeff hcoeff hsum ∞ (μ ∞) hfm + (hlim.mono (fun b hb=>hb f)) l + refine le_trans (lintegral_mono_ae ?_) hb + have habs : radialLaw W a (fromDisk θ 0) (Real.sin θ*Real.exp (-2*a*l)) ≪ W := + withDensity_absolutelyContinuous W _ + filter_upwards [habs.ae_le hmono] with b hb + exact pow_le_pow_left' ((Measure.le_iff'.mp (diskMass_mono (hb (T b)) a θ) + _).trans (subdiskMass_le_enorm a ha ⟨θ,hθ,hθπ⟩ r hr hr1 (μ ∞ b))) m + + + +def subdiskMoment (W : Measure ExactSLEGenerator.Driver) (a : ℝ) + (μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane) (r : ℝ) (m l : ℕ) : ℝ≥0∞ := + ∫⁻p,(subdiskMass a μ r l p)^m∂finiteAngleLaw W a l + + + +theorem common_limit_subdisk_mixed_moment_bound (r : ℝ) (hr : 0≤r) (hr1 : r<1) (a : ℝ) (ha : 1/4b.1 t) W → + ∀(s : ℕ→Finset ℕ) (coeff : ℕ→ℕ→ℝ), + (∀k j,j∈s k→0≤coeff k j) → (∀k,∑j∈s k,coeff k j=1) → + ∀μ : ℝ≥0∞→ExactSLEGenerator.Driver→Measure UpperPlane, + (∀v b,IsFiniteMeasureOnCompacts (μ v b)) → + Measurable (fun p : ℝ≥0∞×ExactSLEGenerator.Driver=>μ p.1 p.2) → + (∀ᵐ b∂W,∀v : ℝ≥0∞,μ v b≤μ ∞ b) → + (∀ᵐ b∂W,∀f : C_c(UpperPlane,ℝ),Tendsto (fun k=>∑j∈s k,coeff k j* + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) ∞ b) + atTop (𝓝 (∫z,f z∂μ ∞ b))) → + ∀l, subdiskMoment W a μ r m l≤D := by + obtain ⟨C,hC,hCb⟩ := common_limit_subdisk_tilted_moment r hr hr1 a ha m hm + let J := ∫⁻θ : Angle,ENNReal.ofReal (Real.sin θ.1^(-p a))∂angleLaw a + refine ⟨C*J,ENNReal.mul_lt_top hC (angle_inverse_power_finite a),?_⟩ + intro W hprob hW s coeff hcoeff hsum μ hμfin hμ hmono hlim l + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := hμfin v b + rw [subdiskMoment,finiteAngleLaw_lintegral W a ha l _ + ((subdiskMass_measurable a ha μ hμ r l).pow_const m)] + calc + _ ≤ ∫⁻θ : Angle,C*ENNReal.ofReal (Real.sin θ.1^(-p a))∂angleLaw a := by + apply lintegral_mono + intro θ + let T := fun b : ExactSLEGenerator.Driver=>levelTime a θ.1 b.1 l + exact hCb W hW s coeff hcoeff hsum μ (hμfin ∞) + (hμ.comp (measurable_const.prodMk measurable_id)) hmono hlim + θ.1 θ.2.1 θ.2.2 l T + _ = C*J := lintegral_const_mul _ (by fun_prop) + +end SLEExactGauge.CenteredMoments +end +end + + + +section + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions CompactSequence + +lemma subdiskMass_monotone (r a : ℝ) (ha : 1/4μ v b)) (θ : Angle) : + Monotone (fun l=>subdiskMass a μ r l (θ,b)) := by + intro l k hlk + exact Measure.le_iff'.mp (diskMass_mono + (hμ (centeredTime_monotone a ha θ b hlk)) a θ.1) _ + +lemma subdiskMass_raw_measurable (r a : ℝ) (ha : 1/4μ (levelTime a θ.1 b.1 l) b)) : + Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>subdiskMass a μ r l (θ,b)) := by + let : MeasurableSpace ExactSLEGenerator.Driver := (centeredTime_stopping a ha θ l).measurableSpace + have hn := diskMass_joint_measurable a (fun _ : ExactSLEGenerator.Driver=>θ) measurable_const + (fun b : ExactSLEGenerator.Driver=>μ (levelTime a θ.1 b.1 l) b) hμ + exact (Measure.measurable_coe Metric.isClosed_closedBall.measurableSet).comp hn + +lemma subdiskMass_raw_measurable_of_le (r a : ℝ) (ha : 1/4μ (levelTime a θ.1 b.1 i) b)) : + Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>subdiskMass a μ r i (θ,b)) := + (subdiskMass_raw_measurable r a ha μ θ i hμ).mono + ((centeredTime_stopping a ha θ i).measurableSpace_mono (centeredTime_stopping a ha θ l) + (fun b=>centeredTime_monotone a ha θ b hil)) le_rfl + +lemma subdisk_vector_consistent (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (r a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + {l k : ℕ} (hlk : l≤k) : + (finiteAngleLaw W a k).map (fun p=>fun i : Fin (l+1)=>subdiskMass a μ r i p)= + (finiteAngleLaw W a l).map (fun p=>fun i : Fin (l+1)=>subdiskMass a μ r i p) := by + have hm : Measurable (fun p=>fun i : Fin (l+1)=>subdiskMass a μ r i p) := + Measurable.of_eval (fun i=>subdiskMass_measurable a ha μ hμ r i) + apply Measure.ext + intro A hA + rw [Measure.map_apply hm hA,Measure.map_apply hm hA] + simp only [←lintegral_indicator_one (hm hA)] + apply finiteAngleLaw_lintegral_consistent W hW a ha hlk + · exact measurable_const.indicator (hm hA) + · intro θ + let : MeasurableSpace ExactSLEGenerator.Driver := (centeredTime_stopping a ha θ l).measurableSpace + have hv : Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>fun i : Fin (l+1)=>subdiskMass a μ r i (θ,b)) := + Measurable.of_eval (fun i=>subdiskMass_raw_measurable_of_le r a ha μ θ + (by omega) (hμraw i θ)) + exact measurable_const.indicator (hv hA) + + + +theorem exists_subdisk_sequence_law (W : Measure ExactSLEGenerator.Driver) + [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (r a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + (hmono : ∀ᵐ b∂W,Monotone (fun v=>μ v b)) : + ∃Q : Measure (ℕ→ℝ≥0∞),IsProbabilityMeasure Q ∧ + (∀n,Q.map (initialVector n)=(finiteAngleLaw W a n).map + (fun p=>fun i : Fin (n+1)=>subdiskMass a μ r i p)) ∧ + (∀ᵐ x∂Q,Monotone x) := by + have (n : ℕ) : IsProbabilityMeasure (finiteAngleLaw W a n) := + finiteAngleLaw_probability W hW a ha n + obtain ⟨Q,hQ,hQlaw⟩ := exists_sequence_law (finiteAngleLaw W a) + (subdiskMass a μ r) (subdiskMass_measurable a ha μ hμ r) + (fun _ _ hlk=>subdisk_vector_consistent W hW r a ha μ hμ hμraw hlk) + refine ⟨Q,hQ,hQlaw,?_⟩ + have hX (l : ℕ) : ∀ᵐ p∂finiteAngleLaw W a l,Monotone (fun n=>subdiskMass a μ r n p) := by + have hb : ∀ᵐ p ∂(angleLaw a).prod W,Monotone (fun v=>μ v p.2) := + Measure.quasiMeasurePreserving_snd.tendsto_ae.eventually hmono + filter_upwards [(finiteAngleLaw_absolutelyContinuous W a l).ae_le hb] with p hp + exact subdiskMass_monotone r a ha μ p.2 hp p.1 + have hs (n : ℕ) : ∀ᵐ x∂Q,x n≤x (n+1) := by + let i : Fin (n+1+1) := ⟨n,by omega⟩ + let j : Fin (n+1+1) := ⟨n+1,by omega⟩ + have hm : MeasurableSet {x : Fin (n+1+1)→ℝ≥0∞ | x i≤x j} := + measurableSet_le (measurable_pi_apply _) (measurable_pi_apply _) + change ∀ᵐ x∂Q,(initialVector (n+1) x) i≤(initialVector (n+1) x) j + rw [←ae_map_iff (measurable_initialVector (n+1)).aemeasurable hm,hQlaw] + apply (ae_map_iff (Measurable.of_eval + (fun i : Fin (n+1+1)=>subdiskMass_measurable a ha μ hμ r i)).aemeasurable hm).mpr + filter_upwards [hX (n+1)] with p hp + exact hp (by simp only [i,j]; omega) + filter_upwards [ae_all_iff.mpr hs] with x hx + exact monotone_nat_of_le_succ hx + + + +theorem subdiskSequence_moment (W : Measure ExactSLEGenerator.Driver) + (r a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (Q : Measure (ℕ→ℝ≥0∞)) + (hQlaw : ∀n,Q.map (initialVector n)=(finiteAngleLaw W a n).map + (fun p=>fun i : Fin (n+1)=>subdiskMass a μ r i p)) + (hQmono : ∀ᵐ x∂Q,Monotone x) (m : ℕ) : + (∫⁻x,(diskSequenceMass x)^m∂Q)=⨆l,subdiskMoment W a μ r m l := by + simp only [diskSequenceMass,ENNReal.iSup_pow] + rw [lintegral_iSup' (fun _=>(measurable_pi_apply _).pow_const m |>.aemeasurable) + (hQmono.mono (fun _ hx _ _ hij=>pow_le_pow_left' (hx hij) m))] + congr with l + exact lintegral_coordinate Q (finiteAngleLaw W a l) (subdiskMass a μ r) + (subdiskMass_measurable a ha μ hμ r) l (hQlaw l) (fun x=>x^m) + (measurable_id.pow_const m) + + + +theorem subdiskMoment_monotone (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver)=>b.1 t) W) + (r a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (hμraw : ∀l θ,Measurable[(centeredTime_stopping a ha θ l).measurableSpace] + (fun b=>μ (levelTime a θ.1 b.1 l) b)) + (hmono : ∀ᵐ b∂W,Monotone (fun v=>μ v b)) (m : ℕ) : + Monotone (subdiskMoment W a μ r m) := by + intro l k hlk + rw [subdiskMoment,←finiteAngleLaw_lintegral_consistent W hW a ha hlk _ + ((subdiskMass_measurable a ha μ hμ r l).pow_const m) + (fun θ=>(subdiskMass_raw_measurable r a ha μ θ l (hμraw l θ)).pow_const m)] + apply lintegral_mono_ae + have hb : ∀ᵐ p ∂(angleLaw a).prod W,Monotone (fun v=>μ v p.2) := + Measure.quasiMeasurePreserving_snd.tendsto_ae.eventually hmono + filter_upwards [(finiteAngleLaw_absolutelyContinuous W a k).ae_le hb] with p hp + exact pow_le_pow_left' (subdiskMass_monotone r a ha μ p.2 hp p.1 hlk) m + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology +namespace SLEExactGauge.PastMass +open ExactSLEGenerator ExactSLEMain ExactSLEGreen + + + +def pastGreenKernel (W : Measure ExactSLEGenerator.Driver) (a : ℝ) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (z : UpperPlane) : ℝ≥0∞ := + (∫⁻b, ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂W) / + ENNReal.ofReal (initialGreen a z) + +lemma pastGreenKernel_measurable (W : Measure ExactSLEGenerator.Driver) [SFinite W] + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 stoppedSurvivingGreen_nonneg a (S b) b z.1))] + rfl + +lemma pastGreenKernel_le_one (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 b.1 t) W) + (a : ℝ) (ha : 1/4 radialTime a b.1 z.1 (z.1.im*q)) := + hT.measurable' + have hE : MeasurableSet {b : ExactSLEGenerator.Driver | S b < radialTime a b.1 z.1 (z.1.im*q)} := + measurableSet_lt hmS hmT + rw [radialLaw_apply W hW a ha z.1 z.2 _ hρ hr _ hE] + have hp := (radial_conditional_weight_all W hW a ha z.1 z.2 _ hρ hr S hS + univ MeasurableSet.univ).2 + simp only [setIntegral_univ] at hp + rw [← integral_indicator hE] + simp only [indicator_apply, mem_ofPred_eq] + rw [hp] + congr 1 + simp only [stoppedRemainingDensity_eq a q _ _ _ z.2, integral_const_mul, initialGreen] + exact (mul_div_mul_left _ _ (Real.exp_ne_zero _)).symm + + + +theorem radialLaw_strict_past_tendsto (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 (radialLaw W a z.1 (z.1.im*q n)) + {b | S b < radialTime a b.1 z.1 (z.1.im*q n)}) atTop + (𝓝 (pastGreenKernel W a S z)) := by + simp_rw [radialLaw_strict_past W hW a ha S hS z _ (hq _).1 (hq _).2] + rw [pastGreenKernel_eq_ofReal W hW a ha S hS] + have he := stopped_remaining_integral_tendsto a ha W hW z S hS q hq hq0 univ + simp only [setIntegral_univ] at he + exact ENNReal.continuous_ofReal.continuousAt.tendsto.comp (he.div_const _) + +end SLEExactGauge.PastMass +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set +open scoped Classical NNReal ENNReal +namespace SLEExactGauge.PastMass + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] + + +def finiteTestTime (F : Finset ℝ≥0) (M : ℝ≥0 → Ω → ℝ≥0∞) + (H : ℝ≥0∞) (ω : Ω) : ℝ≥0∞ := + F.inf (fun q => if H < M q ω then (q : ℝ≥0∞) else ∞) + +omit mΩ in +lemma finiteTestTime_lt_iff [MeasurableSpace Ω] (F : Finset ℝ≥0) (M : ℝ≥0 → Ω → ℝ≥0∞) + (H : ℝ≥0∞) (ω : Ω) (v : ℝ≥0∞) : + finiteTestTime F M H ω < v ↔ ∃ q ∈ F, H < M q ω ∧ (q : ℝ≥0∞) < v := by + rw [finiteTestTime, Finset.inf_lt_iff] + congr! 2 with q + by_cases h : H < M q ω <;> simp [h] + +omit mΩ in +lemma finiteTestTime_le_iff [MeasurableSpace Ω] (F : Finset ℝ≥0) (M : ℝ≥0 → Ω → ℝ≥0∞) + (H : ℝ≥0∞) (ω : Ω) (t : ℝ≥0) : + finiteTestTime F M H ω ≤ (t : ℝ≥0∞) ↔ ∃ q ∈ F, q ≤ t ∧ H < M q ω := by + rw [finiteTestTime, Finset.inf_le_iff ENNReal.coe_lt_top] + congr! 2 with q + by_cases h : H < M q ω <;> simp [h] + +lemma finiteTestTime_stopping (ℱ : Filtration ℝ≥0 mΩ) + (M : ℝ≥0 → Ω → ℝ≥0∞) (hM : Adapted ℱ M) + (F : Finset ℝ≥0) (H : ℝ≥0∞) : + IsStoppingTime ℱ (finiteTestTime F M H) := by + intro t + change MeasurableSet[ℱ t] {ω | finiteTestTime F M H ω ≤ (t : ℝ≥0∞)} + have he : {ω | finiteTestTime F M H ω ≤ (t : ℝ≥0∞)} = + ⋃ q ∈ F, ⋃ (_ : q ≤ t), {ω | H < M q ω} := by + ext ω + simp only [mem_ofPred_eq, finiteTestTime_le_iff, mem_iUnion, exists_prop] + rw [he] + apply MeasurableSet.biUnion F.countable_toSet + intro q hq + apply MeasurableSet.iUnion + intro hqt + exact ℱ.mono hqt _ (measurableSet_lt measurable_const (hM q)) + +omit mΩ in +lemma finiteTestTime_antitone [MeasurableSpace Ω] (M : ℝ≥0 → Ω → ℝ≥0∞) (H : ℝ≥0∞) + (ω : Ω) : Antitone (fun F : Finset ℝ≥0 => finiteTestTime F M H ω) := by + intro F G hFG + exact Finset.inf_mono hFG + + + +lemma finiteTestTime_iUnion {ι : Type*} (e : ℕ → ι) (q : ι → ℝ≥0) + (he : Function.Surjective e) (M : ℝ≥0 → Ω → ℝ≥0∞) (H : ℝ≥0∞) + (ω : Ω) (v : ℝ≥0∞) : + (∃ i, H < M (q i) ω ∧ (q i : ℝ≥0∞) < v) ↔ + ∃ n : ℕ, finiteTestTime ((Finset.range n).image (q ∘ e)) M H ω < v := by + simp only [finiteTestTime_lt_iff, Finset.mem_image, Finset.mem_range, + Function.comp_apply] + constructor + · rintro ⟨i,hi⟩ + obtain ⟨k,rfl⟩ := he i + exact ⟨k+1,q (e k),⟨k,Nat.lt_succ_self k,rfl⟩,hi⟩ + · rintro ⟨n,t,⟨k,hk,rfl⟩,ht⟩ + exact ⟨e k,ht⟩ + +lemma finiteTestTime_sequence_antitone {ι : Type*} (e : ℕ → ι) (q : ι → ℝ≥0) + (M : ℝ≥0 → Ω → ℝ≥0∞) (H : ℝ≥0∞) (ω : Ω) : + Antitone (fun n => finiteTestTime ((Finset.range n).image (q ∘ e)) M H ω) := by + intro n k hnk + exact finiteTestTime_antitone M H ω (Finset.image_subset_image (Finset.range_mono hnk)) + +end SLEExactGauge.PastMass +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set +open scoped Classical NNReal ENNReal Topology +namespace SLEExactGauge.PastMass +open FlowIdentification ExactSLEGreen TraceMassContinuity TraceRestriction + + +def visitTime (κ : ℝ) (b : GDriver) : UpperPlane → ℝ≥0∞ := + firstVisit (fun z : UpperPlane => z.1) (internalTrace κ (driverHomeomorph.symm b)) + +lemma stopped_restriction_add (κ : ℝ) (b : GDriver) + (μ : ℝ≥0∞ → Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (s : ℝ≥0∞) : + μ s Q + μ ∞ (Q ∩ {z | s < visitTime κ b z}) = μ ∞ Q := by + induction s using ENNReal.recTopCoe with + | top => simp + | coe s => + rw [hμ.firstVisit_identity s, Measure.restrict_apply hQ] + have he : Q ∩ {z | (s : ℝ≥0∞) < visitTime κ b z} = + Q \ {z | visitTime κ b z ≤ (s : ℝ≥0∞)} := by + ext z + simp only [mem_inter_iff,Set.mem_sdiff,mem_ofPred_eq,not_le] + rw [he] + exact measure_inter_add_sdiff Q (measurableSet_le hμ.firstVisit_measurable measurable_const) + +lemma stopped_strictPast_mass (κ : ℝ) (b : GDriver) + (μ : ℝ≥0∞ → Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : μ ∞ Q ≠ ∞) (s : ℝ≥0∞) : + μ ∞ (Q ∩ {z | s < visitTime κ b z}) = μ ∞ Q - μ s Q := by + have hsq : μ s Q ≠ ∞ := ne_top_of_le_ne_top hfin (hμ.monotone le_top Q) + rw [← stopped_restriction_add κ b μ hμ Q hQ s, ENNReal.add_sub_cancel_left hsq] + +lemma finite_past_mass (κ : ℝ) (b : GDriver) + (μ : ℝ≥0∞ → Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (hfin : μ ∞ Q ≠ ∞) + (F : Finset ℝ≥0) (H : ℝ≥0∞) : + μ ∞ (Q ∩ {z | ∃q ∈ F, H < μ q Q ∧ (q : ℝ≥0∞) < visitTime κ b z}) = + μ ∞ Q - μ (finiteTestTime F (fun q (_ : Unit) => μ q Q) H ()) Q := by + simpa only [finiteTestTime_lt_iff] using + stopped_strictPast_mass κ b μ hμ Q hQ hfin + (finiteTestTime F (fun q (_ : Unit) => μ q Q) H ()) + + + +lemma all_past_mass_eq_iSup {ι : Type*} (e : ℕ → ι) (q : ι → ℝ≥0) + (he : Function.Surjective e) (κ : ℝ) (b : GDriver) + (μ : ℝ≥0∞ → Measure UpperPlane) + (hμ : TraceMassFacts κ (driverHomeomorph.symm b) μ) + (Q : Set UpperPlane) (hQ : MeasurableSet Q) (H : ℝ≥0∞) : + μ ∞ (Q ∩ {z | ∃i, H < μ (q i) Q ∧ (q i : ℝ≥0∞) < visitTime κ b z}) = + ⨆n : ℕ, μ ∞ (Q ∩ {z | + finiteTestTime ((Finset.range n).image (q ∘ e)) + (fun q (_ : Unit) => μ q Q) H () < visitTime κ b z}) := by + let A (n : ℕ) : Set UpperPlane := Q ∩ {z | + finiteTestTime ((Finset.range n).image (q ∘ e)) + (fun q (_ : Unit) => μ q Q) H () < visitTime κ b z} + have hA (n : ℕ) : MeasurableSet (A n) := hQ.inter + (measurableSet_lt measurable_const hμ.firstVisit_measurable) + have hAm : Monotone A := by + intro n k hnk z hz + exact ⟨hz.1,(finiteTestTime_sequence_antitone e q (fun q (_ : Unit) => μ q Q) + H () hnk).trans_lt hz.2⟩ + have heq : Q ∩ {z | ∃i, H < μ (q i) Q ∧ (q i : ℝ≥0∞) < visitTime κ b z} = + ⋃n : ℕ, A n := by + ext z + simp only [mem_inter_iff,mem_ofPred_eq,mem_iUnion,A, + finiteTestTime_iUnion e q he (fun q (_ : Unit) => μ q Q) H ()] + exact exists_and_left.symm + rw [heq, hAm.measure_iUnion] + +end SLEExactGauge.PastMass +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/SurvivalLocalization.lean b/lean/OAI/Probability/SLEGauge/SurvivalLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..29fe919ffc416ace6e8f24feb911cf748198bfe3 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/SurvivalLocalization.lean @@ -0,0 +1,448 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadonMoments + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +open MeasureTheory Set +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal +open MeasureTheory +open scoped Classical +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open scoped ENNReal +open Filter Topology +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Metric Function +open scoped NNReal ENNReal Topology +open MeasureTheory Filter Topology Set CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology +lemma localizationStop_after_survival (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (_hr : ρ ≤ z.im) + (L : ∀ n, RadialLocalization a z ρ (angleThreshold z n)) (b : ExactSLEGenerator.Driver) + (t : ℝ≥0) (ht : alive a b.1 t z) (htr : (t : ℝ≥0∞) < radialTime a b.1 z ρ) : + ∀ᶠ n in atTop, t < regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b := by + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht + filter_upwards [(angleThreshold_tendsto z).eventually (gt_mem_nhds hη)] with n hn + let Ln := L n + let T := regionStop a Ln.ε Ln.hε z Ln.N ρ (angleThreshold z n) Ln.B b + let V := localState a Ln.ε Ln.hε z T b + by_contra hnt + have hTt : T ≤ t := le_of_not_gt hnt + have he := regionStop_actualState a Ln.ε Ln.hε z Ln.N ρ (angleThreshold z n) Ln.B Ln.initial b T le_rfl + rcases regionStop_true_exit a Ln.ε ha Ln.hε z Ln.N ρ (angleThreshold z n) hρ + (angleThreshold_pos z hz n) Ln.B Ln.initial Ln.small Ln.large Ln.time b with hR|hS + · have htime := regionStop_eq_radialTime a Ln.ε Ln.hε z Ln.N ρ (angleThreshold z n) + Ln.B Ln.initial b hR + have hle : radialTime a b.1 z ρ ≤ (t : ℝ≥0∞) := by + rw [htime] + exact ENNReal.coe_le_coe.mpr hTt + exact not_le.mpr htr hle + · have hs := regionStop_safe a Ln.ε Ln.hε z Ln.N ρ (angleThreshold z n) Ln.B Ln.initial b T le_rfl + have hnp : 0 < ‖V.1‖ := (Ln.hε.trans_le hs.1).trans_le (Complex.im_le_norm _) + have hd : Y V/‖V.1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + have hη' := hηs T hTt + rw [he.2,hd] at hη' + exact not_le.mpr hn hη' + +lemma localizationRemaining_tendsto (a : ℝ) (ha : 0 if t < regionStop a (L n).ε (L n).hε z (L n).N ρ (angleThreshold z n) (L n).B b + then physicalGreen a (localState a (L n).ε (L n).hε z t b) else 0) + atTop (𝓝 (radialRemaining a b.1 z ρ t)) := by + by_cases h : alive a b.1 t z ∧ (t : ℝ≥0∞) (0 : ℝ)) atTop (𝓝 0)) +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped NNReal ENNReal Topology + +theorem joint_radialRemaining_measurable (a : ℝ) (ha : 1/4 < a) (q : ℝ) + (hq : 0 < q) (hq1 : q ≤ 1) (t : ℝ≥0) : + Measurable (fun p : ExactSLEGenerator.Driver × {z : ℂ // 0 < z.im} => + radialRemaining a p.1.1 p.2.1 (p.2.1.im*q) t) := by + have ha0 : 0 p.2.1 + let b : Ω → ExactSLEGenerator.Driver := Prod.fst + have hz (ω : Ω) : 0<(z ω).im := ω.2.2 + have hzM : Measurable z := measurable_subtype_coe.comp measurable_snd + have hbM : Measurable b := measurable_fst + let ρ : Ω → ℝ := fun ω => (z ω).im*q + have hρ (ω : Ω) : 0<ρ ω := mul_pos (hz ω) hq + have hr (ω : Ω) : ρ ω≤(z ω).im := mul_le_of_le_one_right (hz ω).le hq1 + let δ : ℕ → Ω → ℝ := fun n ω => angleThreshold (z ω) n + let L (n : ℕ) (ω : Ω) := explicitRadialLocalization a ha0 (z ω) (hz ω) (ρ ω) (δ n ω) + (hρ ω) (hr ω) (angleThreshold_pos (z ω) (hz ω) n) (angleThreshold_initial (z ω) (hz ω) n) + have hρM : Measurable ρ := hzM.im.mul_const q + have hδM (n : ℕ) : Measurable (δ n) := by + dsimp [δ,angleThreshold] + exact (hzM.im.div hzM.norm).div_const _ + have hεM (n : ℕ) : Measurable (fun ω => (L n ω).ε) := by + change Measurable (fun ω => heightFloor (z ω).im (ρ ω) (δ n ω)/2) + unfold heightFloor + fun_prop + have hNM (n : ℕ) : Measurable (fun ω => (L n ω).N) := by + change Measurable (fun ω => (⟨(z ω).im/δ n ω+logCeiling (z ω).im (ρ ω) (δ n ω)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + unfold logCeiling heightFloor + fun_prop + have hBM (n : ℕ) : Measurable (fun ω => (L n ω).B) := by + change Measurable (fun ω => (⟨(z ω).im^2/(2*a*(δ n ω)^2)+1, _⟩ : ℝ≥0)) + apply Measurable.subtype_mk + fun_prop + let T (n : ℕ) (ω : Ω) := regionStop a (L n ω).ε (L n ω).hε (z ω) + (L n ω).N (ρ ω) (δ n ω) (L n ω).B (b ω) + have hTM (n : ℕ) : Measurable (T n) := + regionStop_parameter_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b _ ρ (δ n) _ (hεM n) hzM hbM + (measurable_subtype_coe.comp (hNM n)) hρM (hδM n) (hBM n) + have hPM : Measurable (physicalGreen a) := by + have hx := X.continuous.measurable + have hy := Y.continuous.measurable + have hj := J.continuous.measurable + unfold physicalGreen logGreen Q + fun_prop + let F (n : ℕ) (ω : Ω) := if t < T n ω then physicalGreen a (localState a (L n ω).ε (L n ω).hε (z ω) t (b ω)) else 0 + have hFM (n : ℕ) : Measurable (F n) := (hPM.comp + ((localState_parameter_joint_measurable a (fun ω => (L n ω).ε) (fun ω => (L n ω).hε) z b (hεM n) hzM hbM).comp + (measurable_const.prodMk measurable_id))).ite (measurableSet_lt measurable_const (hTM n)) measurable_const + apply measurable_of_tendsto_metrizable hFM + apply tendsto_pi_nhds.mpr + intro ω + exact localizationRemaining_tendsto a ha0 (z ω) (hz ω) (ρ ω) (hρ ω) (hr ω) + (fun n => L n ω) (b ω) t +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology +lemma radialRemaining_driver_congr (a : ℝ) (ha : 0 (h s hs).symm) hc] + have hh : (t : ℝ≥0∞) + radialRemaining a p.1.1 p.2.1 (p.2.1.im*q) t) + := by + have he : (fun p : ExactSLEGenerator.Driver × {z : ℂ // 0 + radialRemaining a p.1.1 p.2.1 (p.2.1.im*q) t) = + (fun p : ExactSLEGenerator.Driver × {z : ℂ // 0 + radialRemaining a (pastDriver t p.1).1 p.2.1 (p.2.1.im*q) t) := by + funext p + exact radialRemaining_driver_congr a (by linarith) p.2.1 p.2.2 _ (mul_pos p.2.2 hq) + (mul_le_of_le_one_right p.2.2.le hq1) p.1 (pastDriver t p.1) t + (fun s hs => (pastDriver_eq t p.1 s hs).symm) + change @Measurable (ExactSLEGenerator.Driver × {z : ℂ // 0 (pastDriver t p.1,p.2)) := + ((pastDriver_raw_measurable t).comp + (@measurable_fst _ _ (rawFiltration t) inferInstance)).prodMk + (@measurable_snd _ _ (rawFiltration t) inferInstance) + exact @Measurable.comp (ExactSLEGenerator.Driver × {z : ℂ // 0 radialRemaining a p.1.1 p.2.1 (p.2.1.im*q) t) + (fun p => (pastDriver t p.1,p.2)) + (joint_radialRemaining_measurable a ha q hq hq1 t) hp +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory ExactSLEGenerator ExactSLEMain +open scoped NNReal ENNReal +noncomputable def remainingMassDensity (a q : ℝ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ := + if 0 remainingMassDensity a q t p.1 p.2) := by + let U : Set (ExactSLEGenerator.Driver × ℂ) := {p | 0 + Real.exp (-alpha a*Real.log 2)*radialRemaining a p.1.1.1 p.1.2 (p.1.2.im*q) t) := by + have hp : Measurable (fun p : U => (p.1.1, (⟨p.1.2,p.2⟩ : {z : ℂ // 0 0) measurable_const hU +lemma remainingMassDensity_local_bound (a : ℝ) (ha : 1/4 + f p.2 * remainingMassDensity a q t p.1 p.2) (W.prod (volume.restrict K)) := by + obtain ⟨B,hB,hBf⟩ := hfB + have : IsFiniteMeasure (volume.restrict K) := ⟨by simpa using hKb.measure_lt_top⟩ + have hm : Measurable (fun p : ExactSLEGenerator.Driver × ℂ => + f p.2 * remainingMassDensity a q t p.1 p.2) := + (hf.comp measurable_snd).mul (remainingMassDensity_measurable a ha q hq hq1 t) + apply Integrable.of_bound hm.aestronglyMeasurable (B*((c*q)^(-alpha a))) + have hmem : ∀ᵐ p ∂W.prod (volume.restrict K), p.2∈K := + (Measure.ae_prod_iff_ae_ae (hK.preimage measurable_snd)).mpr + (Eventually.of_forall fun _ => ae_restrict_mem hK) + filter_upwards [hmem] with p hp + rw [norm_mul] + exact mul_le_mul (hBf _ hp) (remainingMassDensity_local_bound a ha q hq hq1 t p.1 c hc p.2 (hcK _ hp)) + (norm_nonneg _) hB +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open MeasureTheory ProbabilityTheory Filter Set +open scoped Classical NNReal ENNReal Topology +lemma finite_density_conditional (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 (t : WithTop ℝ≥0)) := + isStoppingTime_const _ _ + exact (radial_conditional_weight W hW a ha z hz (z.im*q) (mul_pos hz hq) + (mul_le_of_le_one_right hz.le hq1) (fun _ => t) hS U + ((hS.le_measurableSpace_of_const_le (fun _ => le_rfl)) _ hU)).2 +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory ExactSLEGenerator ExactSLEMain +open scoped NNReal ENNReal + + +theorem actual_finite_conditional_mass (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 + f p.2*(timeMassDensity a q v p.1 p.2).toReal) ((W.restrict U).prod (volume.restrict K)) := + (hIm v).mono_measure (Measure.prod_mono Measure.restrict_le_self le_rfl) + have hsub : Integrable (fun p : ExactSLEGenerator.Driver × ℂ => f p.2* + ((timeMassDensity a q ∞ p.1 p.2).toReal-(timeMassDensity a q t p.1 p.2).toReal)) + ((W.restrict U).prod (volume.restrict K)) := by + convert (hI ∞).sub (hI t) using 1 + first | rfl | (funext point; dsimp only [Pi.sub_apply]; ring) + have he (b : ExactSLEGenerator.Driver) : actualMassEval a q ∞ K f b-actualMassEval a q t K f b = + ∫z in K, f z*((timeMassDensity a q ∞ b z).toReal-(timeMassDensity a q t b z).toReal) := by + simp only [actualMassEval,mul_sub] + exact (integral_sub + (actualMassEval_integrable a ha q hq hq1 ∞ K hK hKb c hc hcK f hf hfB b) + (actualMassEval_integrable a ha q hq hq1 t K hK hKb c hc hcK f hf hfB b)).symm + simp_rw [he] + rw [integral_integral_swap hsub] + conv_rhs => rw [integral_integral_swap + (remainingMassEval_joint_integrable a ha (W.restrict U) q hq hq1 t K hK hKb c hc hcK f hf hfB)] + apply setIntegral_congr_fun hK + intro z hzK + dsimp only + rw [integral_const_mul,integral_const_mul] + congr 1 + exact finite_density_conditional a ha W hW q hq hq1 t z (by have := hcK z hzK; linarith) U hU +end ExactSLEGreen + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal + +noncomputable def survivingGreen (a : ℝ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) (z : ℂ) : ℝ := + if alive a b.1 t z then Real.exp (-alpha a*Real.log 2)*physicalGreen a (actualState a b.1 t z) else 0 +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set ExactSLEGenerator ExactSLEMain +open scoped NNReal ENNReal Topology +lemma physicalRadius_actual_pos (a : ℝ) (b : ExactSLEGenerator.Driver) (z : ℂ) + (t : ℝ≥0) (ht : alive a b.1 t z) : 0 positivity +lemma remainingMassDensity_nonneg (a q : ℝ) (t : ℝ≥0) (b : ExactSLEGenerator.Driver) (z : ℂ) : + 0≤remainingMassDensity a q t b z := by + unfold remainingMassDensity radialRemaining physicalGreen + split_ifs <;> positivity +lemma remaining_to_surviving (a : ℝ) (ha : 1/4 remainingMassDensity a (q n) t b z) atTop (𝓝 (survivingGreen a t b z)) := by + by_cases ht : alive a b.1 t z + · have hR := physicalRadius_actual_pos a b z t ht + have hqR : ∀ᶠ n in atTop, z.im*q n z.im*q n) atTop (𝓝 0) := by simpa using hlim.const_mul z.im + exact hconv.eventually (gt_mem_nhds hR) + apply tendsto_const_nhds.congr' + filter_upwards [hqR] with n hn + have hnT : (t : ℝ≥0∞) (0:ℝ)) atTop (𝓝 0)) +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter Set ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal Topology +lemma remainingMassDensity_mean_bound (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 remainingMassDensity a q t b z) W ∧ + (∫b,remainingMassDensity a q t b z∂W)≤Real.exp (-alpha a*Real.log 2)*physicalGreen a (z,0) := by + have hS : IsStoppingTime rawFiltration (fun _ : ExactSLEGenerator.Driver => (t : WithTop ℝ≥0)) := + isStoppingTime_const _ _ + have H := radial_conditional_weight W hW a ha z hz (z.im*q) (mul_pos hz hq) + (mul_le_of_le_one_right hz.le hq1) (fun _ => t) hS univ MeasurableSet.univ + have hmean := radialWeight_mean W hW a ha z hz (z.im*q) (mul_pos hz hq) + (mul_le_of_le_one_right hz.le hq1) + constructor + · simpa only [remainingMassDensity,ite_eq_left hz] using H.1.const_mul (Real.exp (-alpha a*Real.log 2)) + · simp only [remainingMassDensity,ite_eq_left hz] + have He := H.2 + simp only [setIntegral_univ] at He + rw [integral_const_mul,←He] + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + rw [←hmean.2] + apply integral_mono_of_nonneg + · filter_upwards [] with b + split_ifs + · exact (radialWeight_bound a ha z hz _ (mul_pos hz hq) + (mul_le_of_le_one_right hz.le hq1) b).1 + · exact le_rfl + · exact hmean.1 + · filter_upwards [] with b + split_ifs + · exact le_rfl + · exact (radialWeight_bound a ha z hz _ (mul_pos hz hq) + (mul_le_of_le_one_right hz.le hq1) b).1 +end ExactSLEGreen +namespace ExactSLEGreen +open MeasureTheory ProbabilityTheory Filter ExactSLEGenerator ExactSLEMain +open scoped Classical NNReal ENNReal Topology + + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TailBatches.lean b/lean/OAI/Probability/SLEGauge/TailBatches.lean new file mode 100644 index 0000000000000000000000000000000000000000..84a22138b0d47c33803e45101593684ba729490d --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TailBatches.lean @@ -0,0 +1,562 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.OptionalPastPalm +import OAI.Probability.SLEGauge.MomentBatches + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped ENNReal +namespace SLEExactGauge.MomentBatches + +lemma sum_repeated_thresholds (l : List ℤ) (N : ℤ → ℕ) (f : ℝ → ℝ) : + ((l.flatMap (fun k => List.replicate (N k) ((2:ℝ)^k))).map f).sum = + (l.map (fun k => (N k:ℝ)*f ((2:ℝ)^k))).sum := by + induction l with + | nil => simp + | cons k l ih => simpa [List.sum_replicate,nsmul_eq_mul] using congrArg ((N k:ℝ)*f ((2:ℝ)^k)+·) ih + +lemma noncleanup_sum (m : ℕ → ℝ) (n : ℕ) (f : ℝ → ℝ) : + ((noncleanup m n).map f).sum = + ∑ k∈support m n, (multiplicity m n k:ℝ)*f ((2:ℝ)^k) := by + rw [noncleanup,sum_repeated_thresholds] + simpa only [Finset.sort_toFinset] using + (List.sum_toFinset (fun k => (multiplicity m n k:ℝ)*f ((2:ℝ)^k)) + ((support m n).sort_nodup (· ≤ ·))).symm + +lemma batch_sum (m : ℕ → ℝ) (n : ℕ) (f : ℝ → ℝ) : + ((batch m n).map f).sum = + (∑ k∈support m n, (multiplicity m n k:ℝ)*f ((2:ℝ)^k)) + f n := by + simp only [batch,List.map_append,List.map_cons,List.map_nil,List.sum_append, + List.sum_cons,List.sum_nil,add_zero,noncleanup_sum] + +lemma fin_sum_batch (m : ℕ → ℝ) (n : ℕ) (f : ℝ → ℝ) : + (∑ i : Fin (batch m n).length, f ((batch m n)[i.1])) = + ((batch m n).map f).sum := by + rw [← List.sum_ofFn] + change (List.ofFn (f ∘ (fun i : Fin (batch m n).length => (batch m n)[i.1]))).sum = _ + rw [← List.map_ofFn,List.ofFn_getElem] + + + +lemma cleanup_counts_le (S : Finset ℕ) {x : ℝ} (hx : 0 ≤ x) : + (∑ n∈S, if 16*((n:ℝ)+1) ≤ x then (1:ℝ) else 0) ≤ x/16 := by + classical + let A : Finset ℕ := S.filter (fun n : ℕ => 16*((n:ℝ)+1) ≤ x) + have hsub : A ⊆ Finset.range ⌊x/16⌋₊ := by + intro n hn + rw [Finset.mem_range] + have hh := (Finset.mem_filter.mp hn).2 + have hf : n+1 ≤ ⌊x/16⌋₊ := Nat.le_floor (by push_cast; linarith) + omega + calc + (∑ n∈S, if 16*((n:ℝ)+1) ≤ x then (1:ℝ) else 0) = (A.card:ℝ) := by + rw [← Finset.sum_filter] + simp [A] + _ ≤ (⌊x/16⌋₊:ℝ) := by exact_mod_cast (Finset.card_le_card hsub).trans_eq (Finset.card_range _) + _ ≤ x/16 := Nat.floor_le (by positivity) + +variable {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + +lemma cleanup_sum_le (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hInt : Integrable L P) (S : Finset ℕ) : + (∑ n∈S, P.real {ω | 16*((n:ℝ)+1) ≤ L ω}) ≤ moment P L 1/16 := by + let f (n : ℕ) := {ω | 16*((n:ℝ)+1) ≤ L ω}.indicator (fun _ : Ω => (1:ℝ)) + have hint (n : ℕ) : Integrable (f n) P := + (integrable_const 1).indicator (measurableSet_le measurable_const hL) + have he (n : ℕ) : (∫ ω, f n ω ∂P)=P.real {ω | 16*((n:ℝ)+1) ≤ L ω} := by + rw [integral_indicator_const _ (measurableSet_le measurable_const hL),smul_eq_mul,mul_one] + have hpoint : (fun ω => ∑ n∈S, f n ω) ≤ᵐ[P] (fun ω => L ω/16) := + hL0.mono fun ω hω => cleanup_counts_le S hω + have hI := integral_mono_ae (integrable_finsetSum _ (fun n hn => hint n)) (hInt.div_const 16) hpoint + rw [integral_finsetSum _ (fun n hn => hint n),integral_div] at hI + simpa only [he,moment,pow_one] using hI + + + +theorem cleanup_tail (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hInt : Integrable L P) : + Summable (fun n : ℕ => P.real {ω | 16*((n:ℝ)+1) ≤ L ω}) ∧ + (∑' n : ℕ, P.real {ω | 16*((n:ℝ)+1) ≤ L ω}) ≤ moment P L 1/16 := + ⟨summable_of_sum_le (fun _ => measureReal_nonneg) (cleanup_sum_le P L hL hL0 hInt), + Real.tsum_le_of_sum_le (fun _ => measureReal_nonneg) (cleanup_sum_le P L hL hL0 hInt)⟩ + +lemma upper_tail_bound_geometric (n : ℕ) (hn : 0 < n) : + (4:ℝ)^n/(16:ℝ)^n/(1-(1/2:ℝ)^n) ≤ 2*(1/4:ℝ)^n := by + have hq : (1/2:ℝ)^n ≤ 1/2 := by + simpa using pow_le_pow_of_le_one (by norm_num : (0:ℝ)≤1/2) (by norm_num : (1/2:ℝ)≤1) + (show 1 ≤ n from hn) + have hden : (1/2:ℝ) ≤ 1-(1/2:ℝ)^n := by linarith + rw [← div_pow] + norm_num only [show (4:ℝ)/16=1/4 by norm_num] + calc + (1/4:ℝ)^n/(1-(1/2:ℝ)^n) ≤ (1/4:ℝ)^n/(1/2) := + div_le_div_of_nonneg_left (by positivity) (by norm_num) hden + _ = 2*(1/4:ℝ)^n := by ring + +lemma summable_noncleanup_tails (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) : + Summable (fun n : ℕ => + (((noncleanup (moment P L) (n+1)).map (fun b => P.real {ω | 16*b ≤ L ω})).sum)) := by + have hgeom := (summable_geometric_of_lt_one (by norm_num : (0:ℝ)≤1/4) + (by norm_num : (1/4:ℝ)<1)).mul_left 2 + have hgeom' : Summable (fun n : ℕ => 2*(1/4:ℝ)^(n+1)) := + hgeom.comp_injective Nat.succ_injective + apply Summable.of_nonneg_of_le _ _ hgeom' + · intro n + exact List.sum_nonneg (by intro x hx; obtain ⟨b,hb,rfl⟩ := List.mem_map.mp hx; exact measureReal_nonneg) + · intro n + rw [noncleanup_sum] + obtain ⟨hm,hJ⟩ := moment_sequence_properties P L hL0 hint hmean + exact (upper_tail_finite P L hL hL0 (n+1) (by omega) (hint (n+1)) (hm (n+1) (by omega))).trans + (upper_tail_bound_geometric (n+1) (by omega)) + + + +theorem summable_batch_tails (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) : + Summable (fun n : ℕ => + (((batch (moment P L) (n+1)).map (fun b => P.real {ω | 16*b ≤ L ω})).sum)) := by + have hInt : Integrable L P := by simpa only [pow_one] using hint 1 + have hs := (summable_noncleanup_tails P L hL hL0 hint hmean).add + (cleanup_tail P L hL hL0 hInt).1 + simpa only [batch,List.map_append,List.sum_append,List.map_cons,List.map_nil,List.sum_cons, + List.sum_nil,add_zero,Nat.cast_add,Nat.cast_one] using hs + + +theorem summable_entry_tails (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) : + Summable (fun i : EntryIndex (moment P L) => P.real {ω | 16*threshold (moment P L) i ≤ L ω}) := by + have hs := summable_batch_tails P L hL hL0 hint hmean + have hinj : Function.Injective (fun n : {n : ℕ // 0 < n} => n.val-1) := by + intro n j h + have hn := n.property + have hj := j.property + change n.val-1=j.val-1 at h + apply Subtype.ext + omega + have hs' := hs.comp_injective hinj + have hseq : Summable (fun n : {n : ℕ // 0 < n} => + (((batch (moment P L) n.val).map (fun b => P.real {ω | 16*b ≤ L ω})).sum)) := by + apply hs'.congr + intro n + dsimp only [Function.comp_apply] + rw [Nat.sub_add_cancel n.property] + apply (summable_sigma_of_nonneg (fun i => measureReal_nonneg)).mpr + refine ⟨fun n => (hasSum_fintype _).summable,?_⟩ + apply hseq.congr + intro n + rw [tsum_fintype] + exact (fin_sum_batch (moment P L) n.val (fun b => P.real {ω | 16*b ≤ L ω})).symm + + + +theorem tail_summability (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) (hmean : 0 < moment P L 1) : + (∑' i : EntryIndex (moment P L), P {ω | 16*threshold (moment P L) i ≤ L ω}) < ∞ := by + have h := (summable_entry_tails P L hL hL0 hint hmean).tsum_ofReal_lt_top + simpa only [Measure.real,ENNReal.ofReal_toReal (measure_ne_top P _)] using h + +end SLEExactGauge.MomentBatches +end +end + + + +section + + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped ENNReal +namespace SLEExactGauge.MomentBatches + +variable {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + +lemma increasing_level_bounds (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) + (hY0 : ∀ᵐ ω ∂P, ∀ j, 0 ≤ Y j ω) + (hmono : ∀ᵐ ω ∂P, Monotone (fun j => Y j ω)) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun j => Y j ω) atTop (𝓝 (L ω))) : + ∀ᵐ ω ∂P, ∀ j, 0 ≤ Y j ω ∧ Y j ω ≤ L ω := by + filter_upwards [hY0,hmono,hlim] with ω h0 hm hl + exact fun j => ⟨h0 j,hm.ge_of_tendsto hl j⟩ + +lemma integrable_level_pow (L Y : Ω → ℝ) (hY : Measurable Y) + (hYL : ∀ᵐ ω ∂P, 0 ≤ Y ω ∧ Y ω ≤ L ω) (n : ℕ) + (hint : Integrable (fun ω => (L ω)^n) P) : + Integrable (fun ω => (Y ω)^n) P := by + refine hint.mono_nonneg (hY.pow_const n).aestronglyMeasurable ?_ ?_ + · exact hYL.mono fun ω hω => pow_nonneg hω.1 n + · exact hYL.mono fun ω hω => pow_le_pow_left₀ hω.1 hω.2 n + + + +theorem increasing_moments (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) + (hY : ∀ j, Measurable (Y j)) + (hY0 : ∀ᵐ ω ∂P, ∀ j, 0 ≤ Y j ω) + (hmono : ∀ᵐ ω ∂P, Monotone (fun j => Y j ω)) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun j => Y j ω) atTop (𝓝 (L ω))) + (n : ℕ) (hint : Integrable (fun ω => (L ω)^n) P) : + (∀ j, Integrable (fun ω => (Y j ω)^n) P) ∧ + Monotone (fun j => moment P (Y j) n) ∧ + Tendsto (fun j => moment P (Y j) n) atTop (𝓝 (moment P L n)) := by + have hb := increasing_level_bounds P L Y hY0 hmono hlim + have hI (j : ℕ) : Integrable (fun ω => (Y j ω)^n) P := + integrable_level_pow P L (Y j) (hY j) (hb.mono fun ω hω => hω j) n hint + refine ⟨hI,?_,?_⟩ + · intro j k hjk + apply integral_mono_ae (hI j) (hI k) + filter_upwards [hY0,hmono] with ω h0 hm + exact pow_le_pow_left₀ (h0 j) (hm hjk) n + · apply tendsto_integral_of_dominated_convergence (fun ω => (L ω)^n) + (fun j => (hY j |>.pow_const n).aestronglyMeasurable) hint + · intro j + filter_upwards [hb] with ω hω + rw [Real.norm_of_nonneg (pow_nonneg (hω j).1 n)] + exact pow_le_pow_left₀ (hω j).1 (hω j).2 n + · exact hlim.mono fun ω hω => hω.pow n + + + +lemma level_eq_tsum_indicators {v : ℕ → ℝ} {M : ℝ} (hM : 0 < M) + (hlim : Tendsto v atTop (𝓝 M)) : + level v M = 1 + ∑' j : ℕ, if 1 ≤ j ∧ v j ≤ 3*M/4 then 1 else 0 := by + classical + have hfin := finite_badLevels hM hlim + rw [tsum_eq_sum (s := hfin.toFinset) (fun j hj => ?_)] + · simp only [level,dite_eq_left hfin] + congr 1 + calc + hfin.toFinset.card = ∑ _ ∈ hfin.toFinset, (1:ℕ) := by simp + _ = _ := by + apply Finset.sum_congr rfl + intro j hj + have hj' : 1 ≤ j ∧ v j ≤ 3*M/4 := by + simpa only [Finite.mem_toFinset,badLevels,mem_ofPred_eq] using hj + simp only [ite_eq_left hj'] + · have hnj : ¬ (1 ≤ j ∧ v j ≤ 3*M/4) := by + simpa only [Finite.mem_toFinset,badLevels,mem_ofPred_eq] using hj + exact ite_eq_right hnj + + + +def momentLevel (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) (n : ℕ) : ℕ := + level (fun j => moment P (Y j) n) (moment P L n) + +def fullMomentGauge (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) (a d : ℝ) : ℝ → ℝ := + momentGauge (moment P L) a d (momentLevel P L Y) + +variable [IsProbabilityMeasure P] + + + +theorem selected_level_moment (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) + (hY : ∀ j, Measurable (Y j)) + (hY0 : ∀ᵐ ω ∂P, ∀ j, 0 ≤ Y j ω) + (hmono : ∀ᵐ ω ∂P, Monotone (fun j => Y j ω)) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun j => Y j ω) atTop (𝓝 (L ω))) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) + (hmean : 0 < moment P L 1) (n : ℕ) (hn : 0 < n) : + 0 < momentLevel P L Y n ∧ + (badLevels (fun j => moment P (Y j) n) (moment P L n)).Finite ∧ + 3*moment P L n/4 < moment P (Y (momentLevel P L Y n)) n := by + have hb := increasing_level_bounds P L Y hY0 hmono hlim + have hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω := hb.mono fun ω hω => (hω 0).1.trans (hω 0).2 + have hm := (moment_sequence_properties P L hL0 hint hmean).1 n hn + obtain ⟨hI,hmn,hlimn⟩ := increasing_moments P L Y hY hY0 hmono hlim n (hint n) + exact ⟨level_pos _ _,finite_badLevels hm hlimn,level_moment_gt hm hmn hlimn⟩ + + + +theorem success_selected_level (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) + (hY : ∀ j, Measurable (Y j)) + (hY0 : ∀ᵐ ω ∂P, ∀ j, 0 ≤ Y j ω) + (hmono : ∀ᵐ ω ∂P, Monotone (fun j => Y j ω)) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun j => Y j ω) atTop (𝓝 (L ω))) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) + (hmean : 0 < moment P L 1) (n : ℕ) (hn : 3 ≤ n) : + (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) ≤ + (∑' k : ℤ, (multiplicity (moment P L) n k:ℝ)* + P.real {ω | (2:ℝ)^k ≤ Y (momentLevel P L Y n) ω}) ∧ + (2:ℝ)^n/8 ≤ (2:ℝ)^(n-2)-1/(2*(1-(1/2:ℝ)^n)) := by + have hb := (increasing_level_bounds P L Y hY0 hmono hlim).mono + (fun ω hω => hω (momentLevel P L Y n)) + exact success P L (Y (momentLevel P L Y n)) (hY _) hb hint hmean n hn + (integrable_level_pow P L _ (hY _) hb n (hint n)) + (selected_level_moment P L Y hY hY0 hmono hlim hint hmean n (by omega)).2.2.le + + + +theorem fullMomentGauge_properties (L : Ω → ℝ) (Y : ℕ → Ω → ℝ) + (hL0 : ∀ᵐ ω ∂P, 0 ≤ L ω) + (hint : ∀ n, Integrable (fun ω => (L ω)^n) P) + (hmean : 0 < moment P L 1) {a d : ℝ} + (ha : 0 ≤ a) (hd : 0 < d) (hd2 : d ≤ 2) : + Target.IsHausdorffGauge (fullMomentGauge P L Y a d) ∧ + ∀ C r : ℝ, 1 ≤ C → 0 ≤ r → + fullMomentGauge P L Y a d (C*r) ≤ C^2*fullMomentGauge P L Y a d r := by + obtain ⟨hm,hJ⟩ := moment_sequence_properties P L hL0 hint hmean + exact ⟨momentGauge_admissible _ hm hJ ha hd hd2 _, + fun C r hC _ => momentGauge_doubling _ hm hJ a d _ hC⟩ + +end SLEExactGauge.MomentBatches +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions CompactSequence +open MomentBatches + +def sequenceMassReal (x : ℕ→ℝ≥0∞) : ℝ := (diskSequenceMass x).toReal +def sequenceLevelReal (l : ℕ) (x : ℕ→ℝ≥0∞) : ℝ := (x l).toReal + +lemma sequenceMassReal_measurable : Measurable sequenceMassReal := + diskSequenceMass_measurable.ennreal_toReal + +lemma sequenceLevelReal_measurable (l : ℕ) : Measurable (sequenceLevelReal l) := + (measurable_pi_apply l).ennreal_toReal + +lemma sequenceMassReal_nonneg (x : ℕ→ℝ≥0∞) : 0 ≤ sequenceMassReal x := ENNReal.toReal_nonneg +lemma sequenceLevelReal_nonneg (l : ℕ) (x : ℕ→ℝ≥0∞) : 0 ≤ sequenceLevelReal l x := + ENNReal.toReal_nonneg + +lemma sequenceReal_monotone {x : ℕ→ℝ≥0∞} (hmono : Monotone x) + (hfin : diskSequenceMass x<∞) : Monotone (fun l=>sequenceLevelReal l x) := by + intro l k hlk + exact ENNReal.toReal_mono ((le_iSup x k).trans_lt hfin).ne (hmono hlk) + +lemma sequenceReal_tendsto {x : ℕ→ℝ≥0∞} (hmono : Monotone x) + (hfin : diskSequenceMass x<∞) : + Tendsto (fun l=>sequenceLevelReal l x) atTop (𝓝 (sequenceMassReal x)) := + (ENNReal.tendsto_toReal hfin.ne).comp (diskSequenceMass_tendsto hmono) + +lemma sequenceMassReal_integrable_pow (Q : Measure (ℕ→ℝ≥0∞)) + (m : ℕ) (hf : (∫⁻x,diskSequenceMass x^m∂Q)<∞) : + Integrable (fun x=>sequenceMassReal x^m) Q := by + simpa only [ENNReal.toReal_pow, sequenceMassReal] using + integrable_toReal_of_lintegral_ne_top + (diskSequenceMass_measurable.pow_const m).aemeasurable hf.ne + +lemma sequenceMassReal_moment (Q : Measure (ℕ→ℝ≥0∞)) + (hfin : ∀ᵐ x∂Q,diskSequenceMass x<∞) (m : ℕ) : + moment Q sequenceMassReal m=(∫⁻x,diskSequenceMass x^m∂Q).toReal := by + unfold moment sequenceMassReal + simp only [←ENNReal.toReal_pow] + exact integral_toReal (diskSequenceMass_measurable.pow_const m).aemeasurable + (hfin.mono (fun _ hx=>ENNReal.pow_lt_top hx)) + +lemma sequenceLevelReal_moment (W : Measure GDriver) (a : ℝ) (ha : 1/4μ p.1 p.2)) + [∀v b,IsFiniteMeasureOnCompacts (μ v b)] + (r : ℝ) (Q : Measure (ℕ→ℝ≥0∞)) + (hQlaw : ∀n,Q.map (initialVector n)=(finiteAngleLaw W a n).map + (fun p=>fun i : Fin (n+1)=>subdiskMass a μ r i p)) + (hfin : ∀ᵐ x∂Q,diskSequenceMass x<∞) (m l : ℕ) : + moment Q (sequenceLevelReal l) m=(subdiskMoment W a μ r m l).toReal := by + have he := lintegral_coordinate Q (finiteAngleLaw W a l) (subdiskMass a μ r) + (subdiskMass_measurable a ha μ hμ r) l (hQlaw l) (fun x=>x^m) + (measurable_id.pow_const m) + unfold moment sequenceLevelReal + simp only [←ENNReal.toReal_pow] + rw [integral_toReal ((measurable_pi_apply l).pow_const m).aemeasurable + (hfin.mono (fun x hx=>ENNReal.pow_lt_top ((le_iSup x l).trans_lt hx))),he] + rfl + + + +theorem sequenceReal_moment_data (Q : Measure (ℕ→ℝ≥0∞)) [IsProbabilityMeasure Q] + (hmono : ∀ᵐ x∂Q,Monotone x) (hfin : ∀ᵐ x∂Q,diskSequenceMass x<∞) + (hmom : ∀m : ℕ, 1 ≤ m → 0<(∫⁻x,diskSequenceMass x^m∂Q) ∧ + (∫⁻x,diskSequenceMass x^m∂Q)<∞) : + (∀ᵐ x∂Q,Monotone (fun l=>sequenceLevelReal l x) ∧ + Tendsto (fun l=>sequenceLevelReal l x) atTop (𝓝 (sequenceMassReal x))) ∧ + (∀m : ℕ,Integrable (fun x=>sequenceMassReal x^m) Q) ∧ + (∀m : ℕ, 1 ≤ m → 0 < moment Q sequenceMassReal m) ∧ + (∀m : ℕ,Monotone (fun l=>moment Q (sequenceLevelReal l) m) ∧ + Tendsto (fun l=>moment Q (sequenceLevelReal l) m) atTop + (𝓝 (moment Q sequenceMassReal m))) := by + have hp : ∀ᵐ x∂Q,Monotone (fun l=>sequenceLevelReal l x) ∧ + Tendsto (fun l=>sequenceLevelReal l x) atTop (𝓝 (sequenceMassReal x)) := by + filter_upwards [hmono,hfin] with x hx hxf + exact ⟨sequenceReal_monotone hx hxf,sequenceReal_tendsto hx hxf⟩ + have hI (m : ℕ) : Integrable (fun x=>sequenceMassReal x^m) Q := by + rcases m with _|m + · simpa only [pow_zero] using integrable_const (1:ℝ) + · exact sequenceMassReal_integrable_pow Q (m+1) (hmom _ (by omega)).2 + refine ⟨hp,hI,?_,?_⟩ + · intro m hm + rw [sequenceMassReal_moment Q hfin m] + exact ENNReal.toReal_pos (hmom m hm).1.ne' (hmom m hm).2.ne + · intro m + exact (increasing_moments Q sequenceMassReal sequenceLevelReal sequenceLevelReal_measurable + (Eventually.of_forall (fun x l=>sequenceLevelReal_nonneg l x)) + (hp.mono (fun _ hx=>hx.1)) (hp.mono (fun _ hx=>hx.2)) m (hI m)).2 + +end SLEExactGauge.CenteredMoments +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.CenteredMoments +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen MassVersions CompactSequence +open TraceMassIntegration TraceMassContinuity MomentBatches + + + +structure CenteredMomentModel (κ a : ℝ) (ha : 1/4fun i : Fin (n+1)=>subdiskMass a (recoveredMass a ha supports coeff nonneg) + (subdiskRadius radiusIndex) i p) + increasing_finite : ∀ᵐ x∂law,Monotone x ∧ diskSequenceMass x<∞ + positive_moments : ∀m : ℕ, 1 ≤ m → 0<(∫⁻x,diskSequenceMass x^m∂law) ∧ + (∫⁻x,diskSequenceMass x^m∂law)<∞ + canonical : CanonicalMassData κ a ha W (recoveredMass a ha supports coeff nonneg) + + + +theorem actual_centered_moment_model (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) : + Nonempty (CenteredMomentModel κ (Target.a κ) (a_gt_quarter hκ hκ8) + (W.map driverHomeomorph)) := by + obtain ⟨s,c,hc,hs,hsum,D,hreg,hμ,hraw,hpath,n₀,Q,hQ,hlaw,hseq,hmom⟩ := + actual_subdisk_positive_moments κ hκ hκ8 W hW + exact ⟨{ + supports := s + coeff := c + nonneg := hc + tails := hs + normalized := hsum + radiusIndex := n₀ + law := Q + probability := hQ + finite_laws := hlaw + increasing_finite := hseq.mono (fun x hx=>⟨hx.1,hx.2.2⟩) + positive_moments := fun m hm=>⟨(hmom m hm).1,(hmom m hm).2.1⟩ + canonical := D }⟩ + +namespace CenteredMomentModel +variable {κ a : ℝ} {ha : 1/4M.mass p.1 p.2) := + recoveredMass_joint_measurable a ha M.supports M.coeff M.nonneg + +lemma integrable_moments (m : ℕ) : Integrable (fun x=>sequenceMassReal x^m) M.law := by + let := M.probability + exact (sequenceReal_moment_data M.law (M.increasing_finite.mono (fun _ hx=>hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments).2.1 m + +lemma moments_positive (m : ℕ) (hm : 1 ≤ m) : 0 < moment M.law sequenceMassReal m := by + let := M.probability + exact (sequenceReal_moment_data M.law (M.increasing_finite.mono (fun _ hx=>hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments).2.2.1 m hm + +lemma moment_finite_level (m l : ℕ) : + moment M.law (sequenceLevelReal l) m= + (subdiskMoment W a M.mass (subdiskRadius M.radiusIndex) m l).toReal := by + let (v : ℝ≥0∞) (b : GDriver) : IsFiniteMeasureOnCompacts (M.mass v b) := M.canonical.finite_compact v b + exact sequenceLevelReal_moment W a ha M.mass M.mass_measurable (subdiskRadius M.radiusIndex) + M.law M.finite_laws (M.increasing_finite.mono (fun _ hx=>hx.2)) m l + +lemma finite_moments_increasing (m : ℕ) : Monotone + (fun l=>moment M.law (sequenceLevelReal l) m) := by + let := M.probability + exact ((sequenceReal_moment_data M.law (M.increasing_finite.mono (fun _ hx=>hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments).2.2.2 m).1 + +lemma finite_moments_tendsto (m : ℕ) : + Tendsto (fun l=>moment M.law (sequenceLevelReal l) m) atTop + (𝓝 (moment M.law sequenceMassReal m)) := by + let := M.probability + exact ((sequenceReal_moment_data M.law (M.increasing_finite.mono (fun _ hx=>hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments).2.2.2 m).2 + +lemma gauge_admissible {d : ℝ} (hd : 0hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments + have hh := selected_level_moment M.law sequenceMassReal sequenceLevelReal sequenceLevelReal_measurable + (Eventually.of_forall (fun x l=>sequenceLevelReal_nonneg l x)) + (hp.mono (fun _ hx=>hx.1)) (hp.mono (fun _ hx=>hx.2)) hI (hm 1 le_rfl) n hn + exact ⟨hh.1,hh.2.2⟩ + + + +lemma success (n : ℕ) (hn : 3≤n) : + (2:ℝ)^n/8 ≤ ∑'k : ℤ,(multiplicity (moment M.law sequenceMassReal) n k:ℝ)* + M.law.real {x | (2:ℝ)^k ≤ sequenceLevelReal + (momentLevel M.law sequenceMassReal sequenceLevelReal n) x} := by + let := M.probability + obtain ⟨hp,hI,hm,hlim⟩ := sequenceReal_moment_data M.law + (M.increasing_finite.mono (fun _ hx=>hx.1)) + (M.increasing_finite.mono (fun _ hx=>hx.2)) M.positive_moments + have hh := success_selected_level M.law sequenceMassReal sequenceLevelReal sequenceLevelReal_measurable + (Eventually.of_forall (fun x l=>sequenceLevelReal_nonneg l x)) + (hp.mono (fun _ hx=>hx.1)) (hp.mono (fun _ hx=>hx.2)) hI (hm 1 le_rfl) n hn + exact hh.2.trans hh.1 + + +lemma tails_summable : Summable (fun i : EntryIndex (moment M.law sequenceMassReal)=> + M.law.real {x | 16*threshold (moment M.law sequenceMassReal) i ≤ sequenceMassReal x}) := by + let := M.probability + exact summable_entry_tails M.law sequenceMassReal sequenceMassReal_measurable + (Eventually.of_forall sequenceMassReal_nonneg) M.integrable_moments (M.moments_positive 1 le_rfl) + +end CenteredMomentModel +end SLEExactGauge.CenteredMoments +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TerminalExhaustion.lean b/lean/OAI/Probability/SLEGauge/TerminalExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b69a8b9d82f6bf17dc626b448df686f7fe23d5b --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TerminalExhaustion.lean @@ -0,0 +1,486 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TracePastSupport +import OAI.Probability.SLEGauge.BrownianGerm + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem terminal_avoids_eternal_survival (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (μ : ℕ → Kernel ExactSLEGenerator.Driver UpperPlane) + (ν : Kernel ExactSLEGenerator.Driver UpperPlane) + [∀ b, IsFiniteMeasureOnCompacts (ν b)] + (hpast : ∀ᵐ b ∂W, ∀ n : ℕ, μ n b {z : UpperPlane | alive a b.1 n z.1}=0) + (hkernel : ∀ n : ℕ, ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration (n : ℝ≥0)).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂ν b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ n b ∂W) + + ∫⁻b, ∫⁻z, H (b,z)*ENNReal.ofReal (survivingGreen a n b z.1) ∂upperArea ∂W) : + ∀ᵐ b ∂W, ν b {z : UpperPlane | ∀ n : ℕ, alive a b.1 n z.1}=0 := by + have := isSFiniteKernel_of_locally_finite ν + let U : ℕ → Set (ExactSLEGenerator.Driver × UpperPlane) := + fun n => {p | alive a p.1.1 n p.2.1} + have hU (n : ℕ) : + MeasurableSet[(rawFiltration (n : ℝ≥0)).prod (inferInstance : MeasurableSpace UpperPlane)] + (U n) := by + simpa only [compl_ofPred,not_not] using (deadSet_raw_measurable a ha n).compl + have hU₀ (n : ℕ) : MeasurableSet (U n) := prod_sigma_le (rawFiltration.le n) _ _ (hU n) + let D := ⋂ n, U n + have hD : MeasurableSet D := MeasurableSet.iInter hU₀ + have hbound (K : Set UpperPlane) (hK : IsCompact K) (n : ℕ) : + (∫⁻b, ν b ({z | (b,z)∈D}∩K) ∂W) ≤ ∫⁻b, ∫⁻z in K, + ENNReal.ofReal (survivingGreen a n b z.1) ∂upperArea ∂W := by + let E : Set (ExactSLEGenerator.Driver × UpperPlane) := U n ∩ Prod.snd ⁻¹' K + have hE : MeasurableSet[(rawFiltration (n : ℝ≥0)).prod + (inferInstance : MeasurableSpace UpperPlane)] E := + (hU n).inter (measurable_snd hK.measurableSet) + have hE₀ : MeasurableSet E := prod_sigma_le (rawFiltration.le n) _ _ hE + let H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞ := E.indicator (fun _ => 1) + have hH : Measurable[(rawFiltration (n : ℝ≥0)).prod + (inferInstance : MeasurableSpace UpperPlane)] H := measurable_const.indicator hE + have hev (ρ : Measure UpperPlane) (b : ExactSLEGenerator.Driver) : + (∫⁻z, H (b,z) ∂ρ) = ρ ({z | (b,z)∈U n}∩K) := by + have hh := lintegral_indicator_const_comp (μ := ρ) + ((measurable_const (a := b)).prodMk measurable_id) hE₀ (1 : ℝ≥0∞) + have hs : (fun z : UpperPlane => (b,id z)) ⁻¹' E = {z | (b,z)∈U n}∩K := by + ext z + rfl + rw [hs,one_mul] at hh + exact hh + have hzero : (∫⁻b, ∫⁻z, H (b,z) ∂μ n b ∂W)=0 := by + have h : (fun b => ∫⁻z, H (b,z) ∂μ n b) =ᵐ[W] (fun _ => 0) := by + filter_upwards [hpast] with b hb + rw [hev] + exact measure_mono_null inter_subset_left (hb n) + rw [lintegral_congr_ae h,lintegral_zero] + calc + _ ≤ ∫⁻b, ∫⁻z, H (b,z) ∂ν b ∂W := by + apply lintegral_mono + intro b + dsimp only + rw [hev] + exact measure_mono (inter_subset_inter_left K (fun z hz => mem_iInter.mp hz n)) + _ = ∫⁻b, ∫⁻z, H (b,z)*ENNReal.ofReal (survivingGreen a n b z.1) ∂upperArea ∂W := by + rw [hkernel n H hH,hzero,zero_add] + _ ≤ _ := by + apply lintegral_mono + intro b + dsimp only + rw [← lintegral_indicator hK.measurableSet] + apply lintegral_mono + intro z + by_cases hz : z∈K + · rw [indicator_of_mem hz] + by_cases he : (b,z)∈E + · simp only [H,indicator_of_mem he,one_mul,le_refl] + · simp only [H,indicator_of_notMem he,zero_mul,zero_le] + · have he : (b,z)∉E := fun he => hz he.2 + simp only [H,indicator_of_notMem he,indicator_of_notMem hz,zero_mul,le_refl] + let K := CompactExhaustion.choice UpperPlane + have hnull (k : ℕ) : ∀ᵐ b ∂W, ν b ({z | (b,z)∈D}∩K k)=0 := by + apply (lintegral_eq_zero_iff (Kernel.measurable_kernel_prodMk_left + (hD.inter (measurable_snd (K.isCompact k).measurableSet)))).mp + apply le_antisymm _ (bot_le) + exact ge_of_tendsto' (survivingGreen_compact_mean_tendsto_zero a ha W hW (K k) + (K.isCompact k)) (hbound (K k) (K.isCompact k)) + filter_upwards [ae_all_iff.mpr hnull] with b hb + have he : (⋃ k, {z : UpperPlane | (b,z)∈D}∩K k) = + {z : UpperPlane | ∀ n : ℕ, alive a b.1 n z.1} := by + rw [← inter_iUnion,K.iUnion_eq,inter_univ] + ext z + simp only [D,U,mem_ofPred_eq,mem_iInter] + rw [← he] + exact measure_iUnion_null hb + +end ExactSLEGreen +end +end + + + +section + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.MassVersions + +variable {X : Type*} [TopologicalSpace X] [T2Space X] + [MeasurableSpace X] [BorelSpace X] + +omit [TopologicalSpace X] [T2Space X] [BorelSpace X] in +lemma restriction_exhaustion (ν : Measure X) (D : ℕ → Set X) + (hmono : Monotone D) (hnull : ν (⋃ n, D n)ᶜ=0) : + ∀ A : Set X, MeasurableSet A → + Tendsto (fun n => ν.restrict (D n) A) atTop (𝓝 (ν A)) := by + have hfull : ν.restrict (⋃ n, D n)=ν := + Measure.restrict_eq_self_of_ae_mem (by + simpa only [mem_compl_iff,not_not] using measure_eq_zero_iff_ae_notMem.mp hnull) + intro A hA + have hm : Monotone (fun n => A∩D n) := + fun i j hij => inter_subset_inter_right A (hmono hij) + have ht := tendsto_measure_iUnion_atTop (μ := ν) hm + have hset : (⋃ n, A∩D n)=A∩⋃ n, D n := by rw [inter_iUnion] + simp only [Function.comp_def,hset,← Measure.restrict_apply hA,hfull] at ht + exact ht + +lemma locally_finite_sub_restrict_apply (ν : Measure X) + [IsFiniteMeasureOnCompacts ν] (D : Set X) (hD : MeasurableSet D) + (K : Set X) (hK : IsCompact K) : + (ν-ν.restrict D) K=ν (K∩Dᶜ) := by + let : IsFiniteMeasure (ν.restrict K) := + ⟨by simpa only [Measure.restrict_apply_univ] using hK.measure_lt_top (μ := ν)⟩ + have he : (ν-ν.restrict D).restrict K = ν.restrict K - (ν.restrict K).restrict D := by + rw [Measure.restrict_sub_eq_restrict_sub_restrict hK.measurableSet, + Measure.restrict_comm hK.measurableSet] + calc + _ = (ν.restrict K - (ν.restrict K).restrict D) univ := by + rw [← he,Measure.restrict_apply_univ] + _ = ν K - ν (K∩D) := by + rw [Measure.sub_apply MeasurableSet.univ Measure.restrict_le_self] + simp only [Measure.restrict_apply_univ,Measure.restrict_apply hD,inter_comm] + _ = ν (K∩Dᶜ) := by + have hfin : ν (K∩D) ≠ ∞ := (measure_mono inter_subset_left |>.trans_lt hK.measure_lt_top).ne + rw [← measure_inter_add_sdiff K hD,ENNReal.add_sub_cancel_left hfin] + rfl + + + +lemma remaining_restriction_tendsto_zero (ν : Measure X) + [IsFiniteMeasureOnCompacts ν] (D : ℕ → Set X) + (hD : ∀ n, MeasurableSet (D n)) (hmono : Monotone D) + (hnull : ν (⋃ n, D n)ᶜ=0) : + ∀ K : Set X, IsCompact K → + Tendsto (fun n => (ν-ν.restrict (D n)) K) atTop (𝓝 0) := by + intro K hK + let U := fun n => K∩(D n)ᶜ + have hU (n : ℕ) : MeasurableSet (U n) := hK.measurableSet.inter (hD n).compl + have hm : Antitone U := fun i j hij => inter_subset_inter_right K (compl_subset_compl.mpr (hmono hij)) + have hf : ∃ n, ν (U n) ≠ ∞ := ⟨0, + (measure_mono inter_subset_left |>.trans_lt hK.measure_lt_top).ne⟩ + have he : (⋂ n, U n)=K∩(⋃ n, D n)ᶜ := by + ext x + simp only [U,mem_iInter,mem_inter_iff,mem_compl_iff,mem_iUnion,not_exists,forall_and] + simp only [forall_const] + have hzero : ν (⋂ n, U n)=0 := by + rw [he] + exact measure_mono_null inter_subset_right hnull + have ht := tendsto_measure_iInter_atTop (fun n => (hU n).nullMeasurableSet) hm hf + simpa only [Function.comp_def,hzero,locally_finite_sub_restrict_apply ν _ (hD _) K hK] + using ht + +end SLEExactGauge.MassVersions +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + + +theorem actual_raw_mass_exhaustion (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℕ → ℝ≥0∞) (idx : ℕ → ℕ) + (hidx : ∀ n : ℕ, t (idx n) = (n : ℝ≥0)) (j : ℕ) (hj : t j=∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ W=initialGreenMeasure a) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) ∧ + (∀ i, NullSingletonClass (μ (t i) b)) ∧ + (∀ i (v : ℝ≥0), t i=v → μ (t i) b {z : UpperPlane | alive a b.1 v z.1}=0) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + μ (t i) b=(μ (t j) b).restrict {z : UpperPlane | ¬alive a b.1 v z.1}) ∧ + μ ∞ b {z : UpperPlane | ∀ n : ℕ, alive a b.1 n z.1}=0 ∧ + (∀ A : Set UpperPlane, MeasurableSet A → + Tendsto (fun n : ℕ => μ (n : ℝ≥0) b A) atTop (𝓝 (μ ∞ b A))) ∧ + (∀ K : Set UpperPlane, IsCompact K → + Tendsto (fun n : ℕ => (μ ∞ b-μ (n : ℝ≥0) b) K) atTop (𝓝 0)) := by + obtain ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,hconv⟩ := + actual_raw_mass_hull_accounting a ha W hW t + let μ := recoveredMass a ha s c hc + let (v : ℝ≥0∞) (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (μ v b) := (hμ v b).1 + let ν : Kernel ExactSLEGenerator.Driver UpperPlane := ⟨μ ∞,hmeas ∞⟩ + let θ : ℕ → Kernel ExactSLEGenerator.Driver UpperPlane := + fun n => ⟨μ (n : ℝ≥0),hmeas (n : ℝ≥0)⟩ + have (b : ExactSLEGenerator.Driver) : IsFiniteMeasureOnCompacts (ν b) := hμ ∞ b |>.1 + have hpast : ∀ᵐ b ∂W, ∀ n : ℕ, θ n b {z : UpperPlane | alive a b.1 n z.1}=0 := by + filter_upwards [hconv] with b hb + intro n + have h := hb.2.2.2.1 (idx n) n (hidx n) + simpa only [hidx n,θ,ν,Kernel.coe_mk,μ] using h + have he : ∀ n : ℕ, ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration (n : ℝ≥0)).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂ν b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂θ n b ∂W) + + ∫⁻b, ∫⁻z, H (b,z)*ENNReal.ofReal (survivingGreen a n b z.1) ∂upperArea ∂W := by + intro n H hH₀ + simpa only [hidx n,hj,θ,ν,Kernel.coe_mk,μ] using hH (idx n) j n (hidx n) hj H hH₀ + have havoid := terminal_avoids_eternal_survival a ha W hW θ ν hpast he + refine ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,?_⟩ + filter_upwards [hconv,havoid] with b hb hbavoid + rcases hb with ⟨horder,hvague,hatom,hpast,hfuture,hrestrict⟩ + let D : ℕ → Set UpperPlane := fun n => {z | ¬alive a b.1 n z.1} + have hD (n : ℕ) : MeasurableSet (D n) := + ((isOpen_alive b.1.continuous n).preimage + (continuous_subtype_val : Continuous (Subtype.val : UpperPlane → ℂ))).measurableSet.compl + have hm : Monotone D := by + intro n m hnm z hz hn + exact hz (alive_mono hn (Nat.cast_le.mpr hnm)) + have hnull : μ ∞ b (⋃ n, D n)ᶜ=0 := by + have hset : (⋃ n, D n)ᶜ={z : UpperPlane | ∀ n : ℕ, alive a b.1 n z.1} := by + ext z + simp only [D,mem_compl_iff,mem_iUnion,mem_ofPred_eq,not_exists,not_not] + rw [hset] + exact hbavoid + have hr (n : ℕ) : μ (n : ℝ≥0) b=(μ ∞ b).restrict (D n) := by + simpa only [hidx n,hj] using hrestrict (idx n) j n (hidx n) hj + refine ⟨horder,hvague,hatom,hpast,hfuture,hrestrict,hbavoid,?_,?_⟩ + · change ∀ A : Set UpperPlane, MeasurableSet A → + Tendsto (fun n : ℕ => μ (n : ℝ≥0) b A) atTop (𝓝 (μ ∞ b A)) + simp only [hr] + exact restriction_exhaustion (μ ∞ b) D hm hnull + · change ∀ K : Set UpperPlane, IsCompact K → + Tendsto (fun n : ℕ => (μ ∞ b-μ (n : ℝ≥0) b) K) atTop (𝓝 0) + simp only [hr] + exact remaining_restriction_tendsto_zero (μ ∞ b) D hD hm hnull + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions +open SLEExactGauge.LoewnerScaling SLEExactGauge.GermPositivity + +lemma upperArea_univ_pos : 0 ENNReal.ofReal (initialGreen a z))=univ := by + ext z + simp only [Function.mem_support,mem_univ,iff_true] + exact (ENNReal.ofReal_pos.mpr (initialGreen_pos a z)).ne' + rw [he] + exact upperArea_univ_pos + + + +lemma positive_probability_of_exhaustion {Ω X : Type*} + [MeasurableSpace Ω] [MeasurableSpace X] + (P : Measure Ω) (μ : ℝ≥0∞ → Ω → Measure X) + (hm : Measurable (μ ∞)) (hz : ∀ ω, μ 0 ω=0) + (hmean : 0<(μ ∞ ∘ₘ P) univ) + (hex : ∀ᵐ ω ∂P, Tendsto (fun n : ℕ => μ (n : ℝ≥0) ω univ) + atTop (𝓝 (μ ∞ ω univ))) : + ∃ n : ℕ, 0 by simp only [Nat.cast_zero,ENNReal.coe_zero,hz]; rfl) + · rw [ae_iff] + simpa only [pos_iff_ne_zero] using le_antisymm (h n (Nat.pos_of_ne_zero hn)) bot_le + have hzTerminal : ∀ᵐ ω ∂P, μ ∞ ω univ=0 := by + filter_upwards [ae_all_iff.mpr hzero,hex] with ω hω he + have hh : Tendsto (fun n : ℕ => μ (n : ℝ≥0) ω univ) atTop (𝓝 0) := by + simpa only [hω] using (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:ℝ≥0∞)) atTop (𝓝 0)) + exact tendsto_nhds_unique he hh + have hzmean : (μ ∞ ∘ₘ P) univ=0 := by + rw [Measure.bind_apply MeasurableSet.univ hm.aemeasurable] + rw [lintegral_congr_ae hzTerminal,lintegral_zero] + exact hmean.ne' hzmean + + + +lemma recoveredMass_ae_smallTime_positive (a : ℝ) (ha : 1/4 b.1 t) W) + (hmean : recoveredMass a ha s c hc ∞ ∘ₘ W=initialGreenMeasure a) + (hex : ∀ᵐ b ∂W, Tendsto + (fun n : ℕ => recoveredMass a ha s c hc (n : ℝ≥0) b univ) + atTop (𝓝 (recoveredMass a ha s c hc ∞ b univ))) + (hanti : ∀ᵐ b ∂W, Antitone (fun n => recoveredMass a ha s c hc (smallTime n) b univ)) : + ∀ᵐ b ∂W, ∀ n : ℕ, 0 b∈E n) := by + filter_upwards [hanti] with b hb n m hnm hmem + exact hmem.trans_le (hb hnm) + have hlower (n : ℕ) : W {b | 0<μ (u : ℝ≥0) b univ}≤W (E n) := by + exact (recoveredMass_positivity_probability a ha s c hc W hW + (u : ℝ≥0) (smallTime n) (Nat.cast_pos.mpr hu) (smallTime_pos n)).le + exact ae_all_mem (fun t (b : ExactSLEGenerator.Driver) => b.1 t) + driver_eval_measurable (fun b => b.1.continuous) (fun b => b.2) + W hW.toIsPreBrownianReal smallTime tendsto_smallTime E hE heAnti hp hlower + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions +open SLEExactGauge.GermPositivity + +theorem actual_raw_mass_positive (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (t : ℕ → ℝ≥0∞) (idx : ℕ → ℕ) + (hidx : ∀ n : ℕ, t (idx n) = (n : ℝ≥0)) + (is : ℕ → ℕ) (his : ∀ n : ℕ, t (is n)=(smallTime n : ℝ≥0∞)) + (j : ℕ) (hj : t j=∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass a ha s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) W) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) W) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 W) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ W=initialGreenMeasure a) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂W) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂W) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen a v b z.1) ∂upperArea ∂W) ∧ + ∀ᵐ b ∂W, + (∀ i j, t i≤t j → μ (t i) b≤μ (t j) b) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => ∑ j∈s k, c k j * + ∫z,f z∂actualUpperMass a (Real.exp (-2*a*(j+1))) (t i) b) + atTop (𝓝 (∫z,f z∂μ (t i) b))) ∧ + (∀ i, NullSingletonClass (μ (t i) b)) ∧ + (∀ i (v : ℝ≥0), t i=v → μ (t i) b {z : UpperPlane | alive a b.1 v z.1}=0) ∧ + (∀ i j, t i≠∞ → t j=∞ → + (μ (t j) b-μ (t i) b) {z : UpperPlane | ¬alive a b.1 (t i).toNNReal z.1}=0) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + μ (t i) b=(μ (t j) b).restrict {z : UpperPlane | ¬alive a b.1 v z.1}) ∧ + μ ∞ b {z : UpperPlane | ∀ n : ℕ, alive a b.1 n z.1}=0 ∧ + (∀ A : Set UpperPlane, MeasurableSet A → + Tendsto (fun n : ℕ => μ (n : ℝ≥0) b A) atTop (𝓝 (μ ∞ b A))) ∧ + (∀ K : Set UpperPlane, IsCompact K → + Tendsto (fun n : ℕ => (μ ∞ b-μ (n : ℝ≥0) b) K) atTop (𝓝 0)) ∧ + (∀ i, 0 μ (smallTime n) b univ) := by + filter_upwards [hconv] with b hb n m hnm + have ht : t (is m)≤t (is n) := by + rw [his,his] + exact_mod_cast smallTime_antitone hnm + have hh := hb.1 (is m) (is n) ht + rw [his,his] at hh + exact Measure.le_iff'.mp hh univ + have hex : ∀ᵐ b ∂W, Tendsto (fun n : ℕ => μ (n : ℝ≥0) b univ) + atTop (𝓝 (μ ∞ b univ)) := by + filter_upwards [hconv] with b hb + exact hb.2.2.2.2.2.2.2.1 univ MeasurableSet.univ + have hmean' : μ ∞ ∘ₘ W=initialGreenMeasure a := by + simpa only [hj] using hmean j hj + have hpos := recoveredMass_ae_smallTime_positive a ha s c hc W hW hmean' hex hanti + refine ⟨s,c,hc,hs,hsum,hμ,hzero,hmeas,hprog,hmom,hcompact,hL1,hmean,hH,?_⟩ + filter_upwards [hconv,hpos] with b hb hpb + have hpositive (i : ℕ) (hi : 0 (smallTime n : ℝ≥0∞)) atTop (𝓝 0) := + ENNReal.continuous_coe.tendsto 0 |>.comp tendsto_smallTime + obtain ⟨n,hn⟩ := (hlim.eventually (gt_mem_nhds hi)).exists + have hh := hb.1 (is n) i (by simpa only [his] using hn.le) + rw [his] at hh + exact (hpb n).trans_le (Measure.le_iff'.mp hh univ) + rcases hb with ⟨ho,hv,hat,hpa,hfu,hr,he,hx,hk⟩ + refine ⟨ho,hv,hat,hpa,hfu,hr,he,hx,hk,hpositive,?_⟩ + intro i hi + let : (μ (t i) b).Regular := (hμ _ _).2 + let : IsFiniteMeasureOnCompacts (μ (t i) b) := (hμ _ _).1 + obtain ⟨K,-,hK,hpK⟩ := isOpen_univ.exists_lt_isCompact (hpositive i hi) + exact ⟨K,hK,hpK,hK.measure_lt_top⟩ + +end ExactSLEGreen +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TiltedMeasures.lean b/lean/OAI/Probability/SLEGauge/TiltedMeasures.lean new file mode 100644 index 0000000000000000000000000000000000000000..af0bb25fb4a9338b765877a49568cffd82b9a2aa --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TiltedMeasures.lean @@ -0,0 +1,453 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StoppedWeights + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +namespace ExactSLEMain +open ExactSLEGreen +theorem finite_tilt_mean_one (W : Measure Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b.1 t) W) + (a θ : ℝ) (ha : 1 / 4 < a) (hθ : 0 < θ) (hθπ : θ < Real.pi) (l : ℕ) : + Integrable (fun b : Driver => tiltWeight a θ b.1 l) W ∧ + (∫ b : Driver, tiltWeight a θ b.1 l ∂W) = 1 := by + have ha0 : 0 < a := by linarith + have hs := Real.sin_pos_of_pos_of_lt_pi hθ hθπ + have hz : 0 < (fromDisk θ 0).im := by simpa only [fromDisk_zero_im] using hs + have hρ : 0 < Real.sin θ*Real.exp (-2*a*l) := mul_pos hs (Real.exp_pos _) + have hr : Real.sin θ*Real.exp (-2*a*l) ≤ (fromDisk θ 0).im := by + rw [fromDisk_zero_im] + have he : Real.exp (-2*a*l) ≤ 1 := Real.exp_le_one_iff.mpr (by + have h : (0 : ℝ) ≤ 2*a*l := by positivity + nlinarith) + exact (mul_le_mul_of_nonneg_left he hs.le).trans_eq (mul_one _) + have hm := radialWeight_mean W hW a ha (fromDisk θ 0) hz _ hρ hr + have he : (fun b : Driver => tiltWeight a θ b.1 l) = + fun b : Driver => radialWeight a b.1 (fromDisk θ 0) (Real.sin θ*Real.exp (-2*a*l)) / + physicalGreen a (fromDisk θ 0,0) := funext fun b => tiltWeight_radialWeight a θ ha hθ hθπ b l + rw [he] + refine ⟨hm.1.div_const _,?_⟩ + rw [integral_div,hm.2] + exact div_self (show physicalGreen a (fromDisk θ 0,0) ≠ 0 from (Real.exp_pos _).ne') + +end ExactSLEMain + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open scoped Classical + +noncomputable def radialRemaining (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (ρ : ℝ) (t : ℝ≥0) : ℝ := + if alive a b t z ∧ (t : ℝ≥0∞) < radialTime a b z ρ then + physicalGreen a (actualState a b t z) else 0 + +noncomputable def radialStop (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) : ExactSLEGenerator.Driver → ℝ≥0 := + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + regionStop a L.ε L.hε z L.N ρ (angleThreshold z n) L.B + +lemma radialStop_actual (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) (b : ExactSLEGenerator.Driver) + (t : ℝ≥0) (ht : t ≤ radialStop a ha z hz ρ hρ hr n b) : + alive a b.1 t z := by + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + exact (regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t ht).1 + +lemma radialStop_le_radialTime (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) (b : ExactSLEGenerator.Driver) : + (radialStop a ha z hz ρ hρ hr n b : ℝ≥0∞) ≤ radialTime a b.1 z ρ := by + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + apply le_sInf + rintro u ⟨t,rfl,_,ht⟩ + exact ENNReal.coe_le_coe.mpr (regionStop_le_hit a L.ε L.hε z L.N ρ (angleThreshold z n) + L.B L.initial b t ht) + +lemma radialStop_after_survival (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) + (t : ℝ≥0) (ht : alive a b.1 t z) (htr : (t : ℝ≥0∞) < radialTime a b.1 z ρ) : + ∀ᶠ n in atTop, t < radialStop a ha z hz ρ hρ hr n b := by + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht + filter_upwards [(angleThreshold_tendsto z).eventually (gt_mem_nhds hη)] with n hn + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := radialStop a ha z hz ρ hρ hr n b + let V := localState a L.ε L.hε z T b + by_contra hnt + have hTt : T ≤ t := le_of_not_gt hnt + have he := regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + rcases regionStop_true_exit a L.ε ha L.hε z L.N ρ (angleThreshold z n) hρ + (angleThreshold_pos z hz n) L.B L.initial L.small L.large L.time b with hR|hS + · have htime := regionStop_eq_radialTime a L.ε L.hε z L.N ρ (angleThreshold z n) + L.B L.initial b hR + have hle : radialTime a b.1 z ρ ≤ (t : ℝ≥0∞) := by + rw [htime] + exact ENNReal.coe_le_coe.mpr hTt + exact not_le.mpr htr hle + · have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + have hnp : 0 < ‖V.1‖ := (L.hε.trans_le hs.1).trans_le (Complex.im_le_norm _) + have hd : Y V/‖V.1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + have hη' := hηs T hTt + rw [he.2,hd] at hη' + exact not_le.mpr hn hη' + +lemma radialStop_eventually_eq (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) + (hfin : radialTime a b.1 z ρ ≠ ∞) : + ∀ᶠ n in atTop, (radialStop a ha z hz ρ hρ hr n b : ℝ≥0∞) = radialTime a b.1 z ρ := by + let t := (radialTime a b.1 z ρ).toNNReal + have ht := radialTime_attained a ha z hz ρ hρ hr b hfin + obtain ⟨η,hη,hηs⟩ := actual_sine_lower a b.1 b.1.continuous z t ht.1 + filter_upwards [(angleThreshold_tendsto z).eventually (gt_mem_nhds hη)] with n hn + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := radialStop a ha z hz ρ hρ hr n b + let V := localState a L.ε L.hε z T b + have hTt : T ≤ t := regionStop_le_hit a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t ht.2 + have he := regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + rcases regionStop_true_exit a L.ε ha L.hε z L.N ρ (angleThreshold z n) hρ + (angleThreshold_pos z hz n) L.B L.initial L.small L.large L.time b with hR|hS + · exact (regionStop_eq_radialTime a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b hR).symm + · have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b T le_rfl + have hnp : 0 < ‖V.1‖ := (L.hε.trans_le hs.1).trans_le (Complex.im_le_norm _) + have hd : Y V/‖V.1‖ = angleThreshold z n := (div_eq_iff hnp.ne').mpr hS + have hη' := hηs T hTt + rw [he.2,hd] at hη' + exact False.elim (not_le.mpr hn hη') + +lemma radialStop_before_tendsto (a : ℝ) (_ha : 1/4 < a) (ha0 : 0 < a) + (z : ℂ) (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + Tendsto (fun n => if t < radialStop a ha0 z hz ρ hρ hr n b then + physicalGreen a (actualState a b.1 t z) else 0) atTop + (𝓝 (radialRemaining a b.1 z ρ t)) := by + by_cases hg : alive a b.1 t z ∧ (t : ℝ≥0∞) < radialTime a b.1 z ρ + · rw [radialRemaining,ite_eq_left hg] + apply Filter.Tendsto.congr' _ tendsto_const_nhds + filter_upwards [radialStop_after_survival a ha0 z hz ρ hρ hr b t hg.1 hg.2] with n hn + simp only [ite_eq_left hn] + · rw [radialRemaining,ite_eq_right hg] + have hc : ∀ n, ¬ t < radialStop a ha0 z hz ρ hρ hr n b := by + intro n hn + apply hg + exact ⟨radialStop_actual a ha0 z hz ρ hρ hr n b t hn.le, + (ENNReal.coe_lt_coe.mpr hn).trans_le (radialStop_le_radialTime a ha0 z hz ρ hρ hr n b)⟩ + simp only [ite_eq_right (hc _)] + exact tendsto_const_nhds + +lemma radialStop_terminal_tendsto (a : ℝ) (ha : 1/4 < a) (ha0 : 0 < a) + (z : ℂ) (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + Tendsto (fun n => if t < radialStop a ha0 z hz ρ hρ hr n b then + radialApproximation a ha0 z hz ρ hρ hr n b else 0) atTop + (𝓝 (if (t : ℝ≥0∞) < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0)) := by + by_cases hfin : radialTime a b.1 z ρ = ∞ + · have hg : radialWeight a b.1 z ρ = 0 := by rw [radialWeight,ite_eq_left hfin] + simp only [hg,ite_self] + have hc := radialApproximation_tendsto a ha ha0 z hz ρ hρ hr b + rw [hg] at hc + apply squeeze_zero _ _ hc + · intro n + split_ifs + · exact (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).1 + · exact le_rfl + · intro n + split_ifs + · exact le_rfl + · exact (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).1 + · have he : ∀ᶠ n in atTop, (t < radialStop a ha0 z hz ρ hρ hr n b) ↔ + (t : ℝ≥0∞) < radialTime a b.1 z ρ := by + filter_upwards [radialStop_eventually_eq a ha0 z hz ρ hρ hr b hfin] with n hn + rw [← hn,ENNReal.coe_lt_coe] + by_cases hlt : (t : ℝ≥0∞) < radialTime a b.1 z ρ + · rw [ite_eq_left hlt] + apply Filter.Tendsto.congr' _ (radialApproximation_tendsto a ha ha0 z hz ρ hρ hr b) + filter_upwards [he] with n hn + rw [ite_eq_left (hn.mpr hlt)] + · rw [ite_eq_right hlt] + apply Filter.Tendsto.congr' _ tendsto_const_nhds + filter_upwards [he] with n hn + rw [ite_eq_right (fun h => hlt (hn.mp h))] + +lemma radialStop_stopping (a : ℝ) (ha : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) : + IsStoppingTime rawFiltration (fun b => (radialStop a ha z hz ρ hρ hr n b : WithTop ℝ≥0)) := by + let L := radialLocalization a ha z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + exact regionStop_stopping a L.ε L.hε z L.N ρ (angleThreshold z n) L.B + +lemma stopped_event_lt {S T : ExactSLEGenerator.Driver → ℝ≥0} + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (hT : IsStoppingTime rawFiltration (fun b => (T b : WithTop ℝ≥0))) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + MeasurableSet[(hS.min hT).measurableSpace] (U ∩ {b | S b < T b}) := by + have he : U ∩ {b | S b < T b} = + (U ∩ {b | (S b : WithTop ℝ≥0) ≤ T b}) \ {b | (S b : WithTop ℝ≥0) = T b} := by + ext b + simp only [Set.mem_inter_iff,Set.mem_ofPred_eq,Set.mem_sdiff,WithTop.coe_le_coe,WithTop.coe_eq_coe] + exact ⟨fun h => ⟨⟨h.1,h.2.le⟩,h.2.ne⟩,fun h => ⟨h.1.1,lt_of_le_of_ne h.1.2 h.2⟩⟩ + rw [he] + exact (hS.measurableSet_inter_le hT U hU).diff (hS.measurableSet_eq_stopping_time_min hT) + +lemma radialStop_optional (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (_ha : 1/4 < a) (ha0 : 0 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + Integrable (fun b => if S b < radialStop a ha0 z hz ρ hρ hr n b then + physicalGreen a (actualState a b.1 (S b) z) else 0) W ∧ + (∫ b in U, (if S b < radialStop a ha0 z hz ρ hρ hr n b then + physicalGreen a (actualState a b.1 (S b) z) else 0) ∂W) = + ∫ b in U, (if S b < radialStop a ha0 z hz ρ hρ hr n b then + radialApproximation a ha0 z hz ρ hρ hr n b else 0) ∂W := by + let L := radialLocalization a ha0 z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := radialStop a ha0 z hz ρ hρ hr n + have hT := radialStop_stopping a ha0 z hz ρ hρ hr n + let C : Set ExactSLEGenerator.Driver := {b | S b < T b} + have hC : MeasurableSet C := by + exact (iSup_le fun t => rawFiltration.le t) _ (by + simpa only [WithTop.coe_lt_coe] using measurableSet_lt hS.measurable_iSup hT.measurable_iSup) + have hmin : IsStoppingTime rawFiltration (fun b => (min (S b) (T b) : WithTop ℝ≥0)) := by + simpa only [WithTop.coe_min] using hS.min hT + have hUC : MeasurableSet[hmin.measurableSpace] (U ∩ C) := by + simpa only [← WithTop.coe_min] using stopped_event_lt hS hT U hU + have hUC' : MeasurableSet (U ∩ C) := hmin.measurableSpace_le _ hUC + let f := fun b => physicalGreen a (localState a L.ε L.hε z (min (S b) (T b)) b) + have hsafe (b : ExactSLEGenerator.Driver) : + L.ε ≤ Y (localState a L.ε L.hε z (min (S b) (T b)) b) ∧ + ‖localState a L.ε L.hε z (min (S b) (T b)) b‖ ≤ L.N := by + have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b (min (S b) (T b)) (min_le_right (S b) (T b)) + exact ⟨hs.1,hs.2.1⟩ + have hf_eq : f = fun b => greenCutoff a L.ε L.N (localState a L.ε L.hε z (min (S b) (T b)) b) := by + funext b + exact ((greenCutoff_eq_near a L.ε L.hε L.N _ (hsafe b).2 (hsafe b).1).eq_of_nhds).symm + have hfi : Integrable f W := by + rw [hf_eq] + have hm := (greenCutoff_smooth a L.ε L.hε L.N).continuous.measurable.comp + (localState_stopped_measurable a L.ε L.hε z (fun b => min (S b) (T b)) hmin) + obtain ⟨c,hc⟩ := (greenCutoff_compact a L.ε L.N).exists_bound_of_continuous + (greenCutoff_smooth a L.ε L.hε L.N).continuous + exact Integrable.of_bound hm.aestronglyMeasurable c (Eventually.of_forall fun b => hc _) + have he (b : ExactSLEGenerator.Driver) (hb : b ∈ C) : + physicalGreen a (actualState a b.1 (S b) z) = f b := by + have hbt : S b < T b := hb + dsimp only [f] + rw [min_eq_left hbt.le] + rw [(regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b (S b) hbt.le).2] + have hfun : (fun b => if S b < T b then physicalGreen a (actualState a b.1 (S b) z) else 0) = + C.indicator f := by + funext b + by_cases hb : b ∈ C + · rw [Set.indicator_of_mem hb,ite_eq_left (show S b < T b from hb),he b hb] + · rw [Set.indicator_of_notMem hb,ite_eq_right (show ¬S b < T b from hb)] + constructor + · change Integrable (fun b => if S b < T b then physicalGreen a (actualState a b.1 (S b) z) else 0) W + rw [hfun] + exact hfi.indicator hC + · change (∫ b in U, (if S b < T b then physicalGreen a (actualState a b.1 (S b) z) else 0) ∂W) = _ + rw [hfun,integral_indicator hC,Measure.restrict_restrict hC,Set.inter_comm C U] + have ho := localGreen_optional W hW a L.ε ha0.ne' L.hε z L.N L.B + (fun b => min (S b) (T b)) T hmin hT (fun b => min_le_right _ _) (fun b => regionStop_le a L.ε L.hε z L.N ρ (angleThreshold z n) L.B b) + (fun b t ht => let hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t ht + ⟨hs.1,hs.2.1⟩) (U ∩ C) hUC + change (∫ b in U ∩ C, f b ∂W) = _ + rw [ho] + have hfun' : (fun b => if S b < T b then radialApproximation a ha0 z hz ρ hρ hr n b else 0) = + C.indicator (radialApproximation a ha0 z hz ρ hρ hr n) := rfl + change _ = ∫ b in U, (if S b < T b then radialApproximation a ha0 z hz ρ hρ hr n b else 0) ∂W + rw [hfun',integral_indicator hC,Measure.restrict_restrict hC,Set.inter_comm C U] + rfl + +lemma radialStop_before_bound (a : ℝ) (ha : 1/4 < a) (ha0 : 0 < a) (z : ℂ) + (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) + (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + ‖if t < radialStop a ha0 z hz ρ hρ hr n b then + physicalGreen a (actualState a b.1 t z) else 0‖ ≤ Real.exp (-alpha a*Real.log ρ) := by + split_ifs with ht + · let L := radialLocalization a ha0 z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + rw [(regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t ht.le).2] + have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b t ht.le + rw [Real.norm_eq_abs,abs_of_pos (show 0 < physicalGreen a (localState a L.ε L.hε z t b) from Real.exp_pos _)] + exact physicalGreen_bound a ρ ha hρ _ (L.hε.trans_le hs.1) hs.2.2.1 + · simpa only [norm_zero] using (Real.exp_pos (-alpha a*Real.log ρ)).le + +lemma radialStop_before_measurable (a : ℝ) (ha0 : 0 < a) (z : ℂ) + (hz : 0 < z.im) (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (n : ℕ) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun b => if S b < radialStop a ha0 z hz ρ hρ hr n b then + physicalGreen a (actualState a b.1 (S b) z) else 0) := by + let L := radialLocalization a ha0 z hz ρ (angleThreshold z n) hρ hr + (angleThreshold_pos z hz n) (angleThreshold_initial z hz n) + let T := radialStop a ha0 z hz ρ hρ hr n + have hT := radialStop_stopping a ha0 z hz ρ hρ hr n + have hmin : IsStoppingTime rawFiltration (fun b => (min (S b) (T b) : WithTop ℝ≥0)) := by + simpa only [WithTop.coe_min] using hS.min hT + have hle : hmin.measurableSpace ≤ hS.measurableSpace := + hmin.measurableSpace_mono hS (fun b => WithTop.coe_le_coe.mpr (min_le_left _ _)) + have hC : MeasurableSet[hS.measurableSpace] {b | S b < T b} := by + apply hle + simpa only [Set.univ_inter,← WithTop.coe_min] using stopped_event_lt hS hT Set.univ MeasurableSet.univ + have hA : StronglyAdapted rawFiltration (localState a L.ε L.hε z) := + fun t => (localState_adapted a L.ε L.hε z t).stronglyMeasurable + have hv : Measurable[hS.measurableSpace] (fun b => localState a L.ε L.hε z (min (S b) (T b)) b) := + (measurable_stoppedValue (hA.isStronglyProgressive_of_continuous + (localState_continuous a L.ε L.hε z)) hmin).mono hle le_rfl + have hfun : (fun b => if S b < T b then physicalGreen a (actualState a b.1 (S b) z) else 0) = + {b | S b < T b}.indicator + (fun b => greenCutoff a L.ε L.N (localState a L.ε L.hε z (min (S b) (T b)) b)) := by + funext b + by_cases hb : S b < T b + · rw [ite_eq_left hb,Set.indicator_of_mem (show b ∈ {b | S b < T b} from hb),min_eq_left hb.le] + have hs := regionStop_safe a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b (S b) hb.le + rw [(regionStop_actualState a L.ε L.hε z L.N ρ (angleThreshold z n) L.B L.initial b (S b) hb.le).2] + exact ((greenCutoff_eq_near a L.ε L.hε L.N _ hs.2.1 hs.1).eq_of_nhds).symm + · rw [ite_eq_right hb,Set.indicator_of_notMem (show b ∉ {b | S b < T b} from hb)] + change Measurable[hS.measurableSpace] (fun b => if S b < T b then physicalGreen a (actualState a b.1 (S b) z) else 0) + rw [hfun] + exact ((greenCutoff_smooth a L.ε L.hε L.N).continuous.measurable.comp hv).indicator hC + +lemma radialRemaining_measurable (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) : + Measurable[hS.measurableSpace] (fun b => radialRemaining a b.1 z ρ (S b)) := by + have ha0 : 0 < a := by linarith + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + apply measurable_of_tendsto_metrizable + (fun n => radialStop_before_measurable a ha0 z hz ρ hρ hr n S hS) + exact tendsto_pi_nhds.mpr (fun b => radialStop_before_tendsto a ha ha0 z hz ρ hρ hr b (S b)) + + + +theorem radial_conditional_weight (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) + (U : Set ExactSLEGenerator.Driver) (hU : MeasurableSet[hS.measurableSpace] U) : + Integrable (fun b => radialRemaining a b.1 z ρ (S b)) W ∧ + (∫ b in U, (if (S b : ℝ≥0∞) < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0) ∂W) = + ∫ b in U, radialRemaining a b.1 z ρ (S b) ∂W := by + have ha0 : 0 < a := by linarith + let F := fun n (b : ExactSLEGenerator.Driver) => if S b < radialStop a ha0 z hz ρ hρ hr n b + then physicalGreen a (actualState a b.1 (S b) z) else 0 + let H := fun n (b : ExactSLEGenerator.Driver) => if S b < radialStop a ha0 z hz ρ hρ hr n b + then radialApproximation a ha0 z hz ρ hρ hr n b else 0 + let G := fun b : ExactSLEGenerator.Driver => radialRemaining a b.1 z ρ (S b) + let K := fun b : ExactSLEGenerator.Driver => if (S b : ℝ≥0∞) < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0 + let C := Real.exp (-alpha a*Real.log ρ) + have hFi (n : ℕ) : Integrable (F n) W := + (radialStop_optional W hW a ha ha0 z hz ρ hρ hr n S hS U hU).1 + have hHi (n : ℕ) : Integrable (H n) W := by + have hT := radialStop_stopping a ha0 z hz ρ hρ hr n + have hC : MeasurableSet {b | S b < radialStop a ha0 z hz ρ hρ hr n b} := by + exact (iSup_le fun t => rawFiltration.le t) _ (by + simpa only [WithTop.coe_lt_coe] using measurableSet_lt hS.measurable_iSup hT.measurable_iSup) + exact (radialApproximation_mean W hW a ha0 z hz ρ hρ hr n).1.indicator hC + have hFc (b : ExactSLEGenerator.Driver) : Tendsto (fun n => F n b) atTop (𝓝 (G b)) := + radialStop_before_tendsto a ha ha0 z hz ρ hρ hr b (S b) + have hHc (b : ExactSLEGenerator.Driver) : Tendsto (fun n => H n b) atTop (𝓝 (K b)) := + radialStop_terminal_tendsto a ha ha0 z hz ρ hρ hr b (S b) + have hFb (n : ℕ) (b : ExactSLEGenerator.Driver) : ‖F n b‖ ≤ C := + radialStop_before_bound a ha ha0 z hz ρ hρ hr n b (S b) + have hHb (n : ℕ) (b : ExactSLEGenerator.Driver) : ‖H n b‖ ≤ C := by + dsimp only [H] + split_ifs + · have h := radialApproximation_bound a ha ha0 z hz ρ hρ hr n b + simpa only [Real.norm_eq_abs,abs_of_nonneg h.1] using h.2 + · exact (norm_zero.trans_le (Real.exp_pos _).le) + have hGi : Integrable G W := Integrable.of_bound + ((radialRemaining_measurable a ha z hz ρ hρ hr S hS).mono hS.measurableSpace_le le_rfl).aestronglyMeasurable C + (Eventually.of_forall fun b => le_of_tendsto (hFc b).norm (Eventually.of_forall fun n => hFb n b)) + refine ⟨hGi,?_⟩ + have hFl := tendsto_integral_of_dominated_convergence (μ := W.restrict U) (fun _ => C) + (fun n => (hFi n).aestronglyMeasurable.restrict) (integrable_const C) + (fun n => Eventually.of_forall (hFb n)) (Eventually.of_forall hFc) + have hHl := tendsto_integral_of_dominated_convergence (μ := W.restrict U) (fun _ => C) + (fun n => (hHi n).aestronglyMeasurable.restrict) (integrable_const C) + (fun n => Eventually.of_forall (hHb n)) (Eventually.of_forall hHc) + have he : (fun n => ∫ b in U, F n b ∂W) = fun n => ∫ b in U, H n b ∂W := + funext fun n => (radialStop_optional W hW a ha ha0 z hz ρ hρ hr n S hS U hU).2 + rw [he] at hFl + exact tendsto_nhds_unique hHl hFl + +end ExactSLEGreen +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain +open scoped Classical +noncomputable def stoppedRadialRemaining (a : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (ρ : ℝ) (t : ℝ≥0∞) : ℝ := + if t = ∞ then 0 else radialRemaining a b z ρ t.toNNReal + +lemma radialRemaining_bound (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) (t : ℝ≥0) : + ‖radialRemaining a b.1 z ρ t‖ ≤ Real.exp (-alpha a*Real.log ρ) := by + have ha0 : 0 < a := by linarith + exact le_of_tendsto (radialStop_before_tendsto a ha ha0 z hz ρ hρ hr b t).norm + (Eventually.of_forall fun n => radialStop_before_bound a ha ha0 z hz ρ hρ hr n b t) + +lemma radialWeight_bound (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) (b : ExactSLEGenerator.Driver) : + 0 ≤ radialWeight a b.1 z ρ ∧ radialWeight a b.1 z ρ ≤ Real.exp (-alpha a*Real.log ρ) := by + have ha0 : 0 < a := by linarith + have hc := radialApproximation_tendsto a ha ha0 z hz ρ hρ hr b + exact ⟨ge_of_tendsto hc (Eventually.of_forall fun n => (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).1), + le_of_tendsto hc (Eventually.of_forall fun n => (radialApproximation_bound a ha ha0 z hz ρ hρ hr n b).2)⟩ + +lemma radial_terminal_integrable (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (a : ℝ) (ha : 1/4 < a) (z : ℂ) (hz : 0 < z.im) + (ρ : ℝ) (hρ : 0 < ρ) (hr : ρ ≤ z.im) + (S : ExactSLEGenerator.Driver → ℝ≥0) + (hS : IsStoppingTime rawFiltration (fun b => (S b : WithTop ℝ≥0))) : + Integrable (fun b => if (S b : ℝ≥0∞) < radialTime a b.1 z ρ then radialWeight a b.1 z ρ else 0) W := by + have ha0 : 0 < a := by linarith + let H := fun n (b : ExactSLEGenerator.Driver) => if S b < radialStop a ha0 z hz ρ hρ hr n b + then radialApproximation a ha0 z hz ρ hρ hr n b else 0 + have hHi (n : ℕ) : Integrable (H n) W := by + have hT := radialStop_stopping a ha0 z hz ρ hρ hr n + have hC : MeasurableSet {b | S b < radialStop a ha0 z hz ρ hρ hr n b} := by + exact (iSup_le fun t => rawFiltration.le t) _ (by + simpa only [WithTop.coe_lt_coe] using measurableSet_lt hS.measurable_iSup hT.measurable_iSup) + exact (radialApproximation_mean W hW a ha0 z hz ρ hρ hr n).1.indicator hC + apply Integrable.of_bound (aestronglyMeasurable_of_tendsto_ae atTop (fun n => (hHi n).aestronglyMeasurable) + (Eventually.of_forall fun b => radialStop_terminal_tendsto a ha ha0 z hz ρ hρ hr b (S b))) + (Real.exp (-alpha a*Real.log ρ)) + filter_upwards [] with b + split_ifs + · have h := radialWeight_bound a ha z hz ρ hρ hr b + simpa only [Real.norm_eq_abs,abs_of_nonneg h.1] using h.2 + · simpa only [norm_zero] using (Real.exp_pos (-alpha a*Real.log ρ)).le + +noncomputable def capTime (S : ExactSLEGenerator.Driver → ℝ≥0∞) (n : ℝ≥0) (b : ExactSLEGenerator.Driver) : ℝ≥0 := + (min (S b) (n : ℝ≥0∞)).toNNReal +lemma capTime_coe (S : ExactSLEGenerator.Driver → ℝ≥0∞) (n : ℝ≥0) (b : ExactSLEGenerator.Driver) : + (capTime S n b : ℝ≥0∞) = min (S b) (n : ℝ≥0∞) := + ENNReal.coe_toNNReal (ne_of_lt (lt_of_le_of_lt (min_le_right _ _) ENNReal.coe_lt_top)) +lemma capTime_stopping (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (n : ℝ≥0) : IsStoppingTime rawFiltration (fun b => (capTime S n b : WithTop ℝ≥0)) := by + have heq : (fun b => (capTime S n b : WithTop ℝ≥0)) = fun b => min (S b) (n : ℝ≥0∞) := funext (capTime_coe S n) + rw [heq] + exact hS.min_const n +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TraceBoundary.lean b/lean/OAI/Probability/SLEGauge/TraceBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..f49c36457d334d9219acf84a2c55a080c40fafc4 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TraceBoundary.lean @@ -0,0 +1,485 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.TraceContinuity + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero +noncomputable section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped Topology +namespace SLEExactGauge.LiteralTrace +open BrownianCalculus +lemma traceRatio_pos (N : ℕ) : 0 < traceRatio N := by unfold traceRatio; positivity + +lemma traceRatio_lt_one {N : ℕ} (hN : 0 < N) : traceRatio N < 1 := by + exact pow_lt_one₀ (by norm_num) (by norm_num) (by omega) + +lemma traceMeshBase_eq (N : ℕ) : traceMeshBase N = (2^(2*N+1))^4 := by + unfold traceMeshBase modulusBase + rw [← pow_mul] + congr 1 + omega + +lemma traceRate_eq (N : ℕ) : modulusRate (4*N+2) = traceRatio N/2 := by + unfold modulusRate traceRatio + rw [pow_add] + norm_num + ring + +lemma traceMesh_inv (N : ℕ) : 1/(traceMeshBase N:ℝ) = (traceRatio N)^2/16 := by + unfold traceMeshBase modulusBase traceRatio + push_cast + rw [← pow_mul,show 2*(4*N+2) = (4*N)*2+4 by omega,pow_add,div_pow,one_pow] + norm_num + ring + +lemma traceHeight_eq (N n : ℕ) : refinedHeight N (4*n) = (traceRatio N)^n := by + unfold refinedHeight traceRatio + rw [← pow_mul,← pow_mul] + congr 1 + ring + +lemma traceGridTime_eq (δ : ℝ) (N n k : ℕ) : + refinedGridTime δ N (4*n) k = δ+TraceChaining.grid (traceMeshBase N) n k := by + unfold refinedGridTime TraceChaining.grid + rw [traceMeshBase_eq] + push_cast + simp only [← pow_mul] + congr 3; ring + +lemma traceGridCard_eq (M N n : ℕ) : + M*(2^(2*N+1))^(4*n) = M*(traceMeshBase N)^n := by + rw [traceMeshBase_eq] + simp only [← pow_mul] + congr 2; ring + +lemma traceRate_div (N n : ℕ) : + (modulusRate (4*N+2))^n/(traceRatio N)^(n+1) = + 1/traceRatio N*(1/2:ℝ)^n := by + rw [traceRate_eq,div_pow,pow_succ,div_pow,one_pow] + field_simp [ne_of_gt (traceRatio_pos N)] + +lemma traceMesh_div (N n : ℕ) : + (1/(traceMeshBase N:ℝ)^n)/((traceRatio N)^(n+1))^2 = + 1/(traceRatio N)^2*(1/16:ℝ)^n := by + rw [← one_div_pow,traceMesh_inv,div_pow, + show (traceRatio N)^(n+1) = (traceRatio N)^n*traceRatio N by rfl,mul_pow,div_pow,one_pow] + rw [pow_right_comm (traceRatio N) 2 n] + field_simp [ne_of_gt (traceRatio_pos N)] + +lemma traceMesh_eventually (N : ℕ) : ∀ᶠ n : ℕ in atTop, + 1/(traceMeshBase N:ℝ)^n ≤ ((traceRatio N)^(n+1))^2 := by + have hh : Tendsto (fun n : ℕ => 1/(traceRatio N)^2*(1/16:ℝ)^n) atTop (𝓝 0) := by + simpa only [mul_zero] using (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : 0 ≤ (1/16:ℝ)) + (by norm_num : (1/16:ℝ) < 1)).const_mul (1/(traceRatio N)^2) + filter_upwards [hh.eventually (Iio_mem_nhds zero_lt_one)] with n hn + rw [← traceMesh_div] at hn + have hr := traceRatio_pos N + exact ((div_lt_one (by positivity : 0 < ((traceRatio N)^(n+1))^2)).mp hn).le + +lemma traceError_summable {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) {N : ℕ} (hN : 0 < N) (H : ℕ) : + Summable (traceError κ N H) := by + have hp := trace_exponents hκ hκ8 + have hr : |(traceRatio N)^(traceBeta κ)| < 1 := by + rw [abs_of_pos (Real.rpow_pos_of_pos (traceRatio_pos N) _)] + exact Real.rpow_lt_one (traceRatio_pos N).le (traceRatio_lt_one hN) hp.1 + have hs := (summable_geometric_of_abs_lt_one (by norm_num : |(1/2:ℝ)| < 1)).mul_left + (brownianModulusConst (4*N+2)/traceRatio N) + have ht := (summable_geometric_of_abs_lt_one (by norm_num : |(1/16:ℝ)| < 1)).mul_left + (a κ/(traceRatio N)^2) + have hu := (((hs.add ht).mul_left (4*(2+a κ+2*a κ*H))).add (summable_geometric_of_abs_lt_one hr)) + change Summable (fun n : ℕ => 4*(2+a κ+2*a κ*H)* + (brownianModulusConst (4*N+2)/traceRatio N*(1/2:ℝ)^n+ + a κ/(traceRatio N)^2*(1/16:ℝ)^n)+((traceRatio N)^(traceBeta κ))^n) + exact hu +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open BrownianCalculus TraceChaining + + + +theorem radial_uniform_bands {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∃ N : ℕ, 0 < N ∧ ∀ᵐ b ∂W, ∀ m H : ℕ, ∀ᶠ n : ℕ in atTop, + ∀ t : ℝ, 1/((m:ℝ)+1) ≤ t → t ≤ H → + ∀ y : ℝ, (traceRatio N)^(n+1) ≤ y → y ≤ (traceRatio N)^n → + ‖radialValue κ b t y-radialValue κ b t ((traceRatio N)^n)‖ ≤ + traceError κ N H n := by + obtain ⟨N,hN,hNeta,hgrid⟩ := radial_length_all_refined_grids hκ hκ8 hW + refine ⟨N,hN,?_⟩ + filter_upwards [hgrid,brownian_uniform_modulus hW] with b hb hB + intro m H + let δ : ℝ := 1/((m:ℝ)+1) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hr := traceRatio_pos N + have hr1 := traceRatio_lt_one hN + have hq : 0 < traceMeshBase N := by unfold traceMeshBase modulusBase; positivity + have hsub : Tendsto (fun n : ℕ => 4*n) atTop atTop := by + apply tendsto_atTop_mono (f := fun n : ℕ => n) (fun n => by omega) tendsto_id + have hg := hsub.eventually (hb m H) + obtain ⟨n₀,hn₀⟩ := hB (4*N+2) H (by omega) + filter_upwards [hg,traceMesh_eventually N,eventually_ge_atTop n₀] with n hn hmesh hn0 + intro t hδt htH y hvy hyz + let k := index (traceMeshBase N) n (t-δ) + let s := δ+approx (traceMeshBase N) n (t-δ) + have hab := approx_bounds hq n (sub_nonneg.mpr hδt) + have hs : 0 ≤ s := by dsimp [s]; linarith [hab.1] + have hst : s ≤ t := by dsimp [s]; linarith [hab.2.1] + have hclose : t-s ≤ 1/(traceMeshBase N:ℝ)^n := by + dsimp [s]; linarith [hab.2.2] + have hk : k < H*(traceMeshBase N)^n := by + have hp : 0 < (traceMeshBase N:ℝ)^n := pow_pos (by exact_mod_cast hq) _ + have hf := Nat.floor_le (mul_nonneg hp.le (sub_nonneg.mpr hδt)) + have hh : (k:ℝ) < (H:ℝ)*(traceMeshBase N:ℝ)^n := by + dsimp [k,index] + nlinarith + exact_mod_cast hh + have hgk := hn ⟨k,by rwa [traceGridCard_eq]⟩ + rw [traceGridTime_eq,traceHeight_eq] at hgk + change radialLength κ b s ((traceRatio N)^n) < _ at hgk + have hR : radialLength κ b s ((traceRatio N)^n) ≤ + ENNReal.ofReal (((traceRatio N)^(traceBeta κ))^n) := by + have he : ((traceRatio N)^n)^(traceBeta κ) = + ((traceRatio N)^(traceBeta κ))^n := by + rw [← Real.rpow_natCast_mul hr.le,mul_comm (n:ℝ) (traceBeta κ), + Real.rpow_mul_natCast hr.le] + rw [he] at hgk + exact hgk.le + have hbnd := hn₀ n hn0 s t hs hst htH hclose + change |driverValue b t-driverValue b s| ≤ + brownianModulusConst (4*N+2)*(modulusRate (4*N+2))^n at hbnd + have hp := radial_interpolation hκ hs hst htH (pow_pos hr _) hvy hyz + (pow_le_one₀ hr.le hr1.le) (hclose.trans hmesh) b hbnd hR (by positivity) + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hc : 0 ≤ 2*(2+a κ+2*a κ*H)/(traceRatio N)^(n+1) := by positivity + have hstep : a κ*(t-s)/(traceRatio N)^(n+1) ≤ + a κ*(1/(traceMeshBase N:ℝ)^n)/(traceRatio N)^(n+1) := by + gcongr + have hp' : ‖radialValue κ b t y-radialValue κ b t ((traceRatio N)^n)‖ ≤ + 2*(2*(2+a κ+2*a κ*H)/(traceRatio N)^(n+1)* + (brownianModulusConst (4*N+2)*(modulusRate (4*N+2))^n+ + a κ*(1/(traceMeshBase N:ℝ)^n)/(traceRatio N)^(n+1)))+ + ((traceRatio N)^(traceBeta κ))^n := by + apply hp.trans + gcongr + apply hp'.trans_eq + dsimp [traceError] + rw [show 2*(2*(2+a κ+2*a κ*H)/(traceRatio N)^(n+1)* + (brownianModulusConst (4*N+2)*(modulusRate (4*N+2))^n+ + a κ*(1/(traceMeshBase N:ℝ)^n)/(traceRatio N)^(n+1))) = + 4*(2+a κ+2*a κ*H)* + (brownianModulusConst (4*N+2)* + ((modulusRate (4*N+2))^n/(traceRatio N)^(n+1))+ + a κ*((1/(traceMeshBase N:ℝ)^n)/((traceRatio N)^(n+1))^2)) by ring] + rw [traceRate_div,traceMesh_div] + ring +end SLEExactGauge.LiteralTrace + + + +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.TraceChaining + +lemma radial_limit_of_bands {E : Type*} [MetricSpace E] [CompleteSpace E] + (f : ℝ → E) {r : ℝ} (hr : 0 < r) (hr1 : r < 1) + {e : ℕ → ℝ} (he : Summable e) + (hb : ∀ᶠ n : ℕ in atTop, ∀ y : ℝ, r^(n+1) ≤ y → y ≤ r^n → + dist (f y) (f (r^n)) ≤ e n) : + ∃ z : E, Tendsto f (𝓝[>] 0) (𝓝 z) := by + obtain ⟨n₀,hn₀⟩ := eventually_atTop.mp hb + have hs (n : ℕ) : dist (f (r^(n+n₀))) (f (r^((n+1)+n₀))) ≤ e (n+n₀) := by + rw [dist_comm] + exact hn₀ (n+n₀) (by omega) _ (by simp [Nat.add_assoc,Nat.add_comm]) + (by simpa only [show n+1+n₀ = (n+n₀)+1 by omega] using + pow_le_pow_of_le_one hr.le hr1.le (Nat.le_succ (n+n₀))) + obtain ⟨z,hz⟩ := cauchySeq_tendsto_of_complete + (cauchySeq_of_dist_le_of_summable (fun n => e (n+n₀)) hs + ((summable_nat_add_iff n₀).mpr he)) + have hz' : Tendsto (fun n : ℕ => f (r^n)) atTop (𝓝 z) := + (tendsto_add_atTop_iff_nat n₀).mp hz + refine ⟨z,Metric.tendsto_nhds.mpr ?_⟩ + intro ε hε + have hε2 : 0 < ε/2 := by linarith + have hsmall := (he.tendsto_atTop_zero.eventually (Iio_mem_nhds hε2)) + have hnear := (Metric.tendsto_atTop.mp hz') (ε/2) hε2 + obtain ⟨n₁,hn₁⟩ := eventually_atTop.mp hsmall + obtain ⟨n₂,hn₂⟩ := hnear + let n₃ := max n₀ (max n₁ n₂) + have hv : 0 < r^(n₃+1) := pow_pos hr _ + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ y : ℝ in 𝓝[>] 0, y < r^(n₃+1) from + nhdsWithin_le_nhds (Iio_mem_nhds hv))] with y hy hyv + have hy1 : y ≤ 1 := hyv.le.trans (pow_le_one₀ hr.le hr1.le) + obtain ⟨n,hnlow,hnup⟩ := exists_nat_pow_near_of_lt_one hy hy1 hr hr1 + have hn3 : n₃ ≤ n := by + by_contra hh + have hnlt : n+1 ≤ n₃+1 := by omega + have hlo := pow_le_pow_of_le_one hr.le hr1.le hnlt + linarith + have hband := hn₀ n (le_trans (le_max_left _ _) hn3) y hnlow.le hnup + have hen := hn₁ n (le_trans (le_trans (le_max_left _ _) (le_max_right _ _)) hn3) + have hzn := hn₂ n (le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hn3) + exact (dist_triangle _ _ _).trans_lt (by linarith) +end SLEExactGauge.TraceChaining +namespace SLEExactGauge.TraceChaining + +lemma radial_uniform_limit_of_bands {X E : Type*} [MetricSpace E] [CompleteSpace E] + (f : X → ℝ → E) (g : X → E) (S : Set X) + {r : ℝ} (hr : 0 < r) (hr1 : r < 1) {e : ℕ → ℝ} (he : Summable e) + (hb : ∀ᶠ n : ℕ in atTop, ∀ t ∈ S, ∀ y : ℝ, r^(n+1) ≤ y → y ≤ r^n → + dist (f t y) (f t (r^n)) ≤ e n) + (hg : ∀ t ∈ S, Tendsto (f t) (𝓝[>] 0) (𝓝 (g t))) : + TendstoUniformlyOn (fun n t => f t (r^n)) g atTop S := by + obtain ⟨n₀,hn₀⟩ := eventually_atTop.mp hb + have hgeom : Tendsto (fun n : ℕ => r^n) atTop (𝓝[>] 0) := by + apply tendsto_nhdsWithin_iff.mpr + exact ⟨tendsto_pow_atTop_nhds_zero_of_lt_one hr.le hr1, + Eventually.of_forall (fun n => pow_pos hr n)⟩ + have hd (n : ℕ) (hn : n₀ ≤ n) (t : X) (ht : t ∈ S) : + dist (f t (r^n)) (g t) ≤ ∑' j : ℕ, e (j+n) := by + have hstep (j : ℕ) : dist (f t (r^(j+n))) (f t (r^((j+1)+n))) ≤ e (j+n) := by + rw [dist_comm] + apply hn₀ (j+n) (by omega) t ht + · simp [Nat.add_assoc,Nat.add_comm] + · simpa only [show j+1+n = (j+n)+1 by omega] using + pow_le_pow_of_le_one hr.le hr1.le (Nat.le_succ (j+n)) + have hh := dist_le_tsum_of_dist_le_of_tendsto₀ (fun j => e (j+n)) hstep + ((summable_nat_add_iff n).mpr he) + (((hg t ht).comp hgeom).comp (tendsto_add_atTop_nat n)) + simpa only [Nat.zero_add] using hh + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + have hh := (tendsto_sum_nat_add e).eventually (Iio_mem_nhds hε) + filter_upwards [hh,eventually_ge_atTop n₀] with n hn hn0 + intro t ht + rw [dist_comm] + exact (hd n hn0 t ht).trans_lt hn +end SLEExactGauge.TraceChaining +namespace SLEExactGauge.LiteralTrace +open TraceChaining + + + +theorem trace_limit_all_positive {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, ∀ t : ℝ, 0 < t → + Tendsto (fun y : ℝ => inverseFlow κ b (κ*t) + (driverValue b (κ*t)+y*Complex.I)) (𝓝[>] 0) (𝓝 (trace κ b t)) := by + obtain ⟨N,hN,hb⟩ := radial_uniform_bands hκ hκ8 hW + filter_upwards [hb] with b hb + intro t ht + have hT : 0 < κ*t := mul_pos hκ ht + obtain ⟨m,hm⟩ := exists_nat_gt (1/(κ*t)) + have hδ : 1/((m:ℝ)+1) ≤ κ*t := by + have hmp : 0 < (m:ℝ)+1 := by positivity + apply (div_le_iff₀ hmp).mpr + have hh := (div_lt_iff₀ hT).mp hm + nlinarith + obtain ⟨H,hH⟩ := exists_nat_gt (κ*t) + obtain ⟨z,hz⟩ := radial_limit_of_bands (radialValue κ b (κ*t)) + (traceRatio_pos N) (traceRatio_lt_one hN) (traceError_summable hκ hκ8 hN H) + (by + filter_upwards [hb m H] with n hn + intro y hy hy' + simpa only [dist_eq_norm] using hn (κ*t) hδ hH.le y hy hy') + have he : trace κ b t = z := hz.limUnder_eq + rwa [he] +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace + +lemma radial_time_modulus_symmetric {κ T y s t : ℝ} (hκ : 0 < κ) + (hy : 0 < y) (hy1 : y ≤ 1) (hs : s ∈ Icc 0 T) (ht : t ∈ Icc 0 T) + (hclose : |t-s| ≤ y^2) (b : Driver) : + ‖radialValue κ b t y-radialValue κ b s y‖ ≤ + 2*(2+a κ+2*a κ*T)/y*(|driverValue b t-driverValue b s|+a κ*|t-s|/y) := by + by_cases hst : s ≤ t + · rw [abs_of_nonneg (sub_nonneg.mpr hst)] at hclose ⊢ + exact inverseFlow_time_modulus hκ hs.1 hst ht.2 hy hy1 hclose b + · have hts : t ≤ s := (lt_of_not_ge hst).le + rw [abs_sub_comm t s,abs_of_nonneg (sub_nonneg.mpr hts)] at hclose ⊢ + rw [norm_sub_rev,abs_sub_comm] + exact inverseFlow_time_modulus hκ ht.1 hts hs.2 hy hy1 hclose b + + + +lemma radialValue_continuousOn {κ y T : ℝ} (hκ : 0 < κ) (hy : 0 < y) + (hy1 : y ≤ 1) (b : Driver) : + ContinuousOn (fun t => radialValue κ b t y) (Icc 0 T) := by + intro t ht + apply tendsto_iff_norm_sub_tendsto_zero.mpr + have hB : Continuous (driverValue b) := + (map_continuous b).comp continuous_real_toNNReal + have h1 : Tendsto (fun s : ℝ => |driverValue b s-driverValue b t|) + (𝓝[Icc 0 T] t) (𝓝 0) := by + have hh : Tendsto (driverValue b) (𝓝[Icc 0 T] t) (𝓝 (driverValue b t)) := + (hB.tendsto t).mono_left nhdsWithin_le_nhds + simpa using (hh.sub_const (driverValue b t)).abs + have h2 : Tendsto (fun s : ℝ => |s-t|) (𝓝[Icc 0 T] t) (𝓝 0) := by + have hh : Tendsto (fun s : ℝ => s) (𝓝[Icc 0 T] t) (𝓝 t) := + tendsto_id'.mpr nhdsWithin_le_nhds + simpa using (hh.sub_const t).abs + have hb := (h1.add ((h2.const_mul (a κ)).div_const y)).const_mul + (2*(2+a κ+2*a κ*T)/y) + have hb' : Tendsto (fun s : ℝ => 2*(2+a κ+2*a κ*T)/y* + (|driverValue b s-driverValue b t|+a κ*|s-t|/y)) + (𝓝[Icc 0 T] t) (𝓝 0) := by simpa using hb + apply squeeze_zero' (Eventually.of_forall (fun _ => norm_nonneg _)) _ hb' + filter_upwards [self_mem_nhdsWithin,h2.eventually (Iio_mem_nhds (sq_pos_of_pos hy))] with s hs hclose + exact radial_time_modulus_symmetric hκ hy hy1 ht hs hclose.le b +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open TraceChaining + + + +theorem trace_continuous_positive {κ : ℝ} (hκ : 0 < κ) (hκ8 : κ < 8) + {W : WienerLaw} (hW : IsWiener W) : + ∀ᵐ b ∂W, ContinuousOn (trace κ b) (Ioi 0) := by + obtain ⟨N,hN,hb⟩ := radial_uniform_bands hκ hκ8 hW + filter_upwards [hb,trace_limit_all_positive hκ hκ8 hW] with b hb hlim + let g : ℝ → ℂ := fun T => limUnder (𝓝[>] (0:ℝ)) (radialValue κ b T) + have hg (T : ℝ) (hT : 0 < T) : Tendsto (radialValue κ b T) (𝓝[>] 0) (𝓝 (g T)) := by + have hh := hlim (T/κ) (div_pos hT hκ) + have he : κ*(T/κ) = T := by field_simp + rw [he] at hh + have he' : g T = trace κ b (T/κ) := hh.limUnder_eq + rwa [he'] + have hc (m H : ℕ) : ContinuousOn g (Icc (1/((m:ℝ)+1)) H) := by + have hu := radial_uniform_limit_of_bands (fun T => radialValue κ b T) g + (Icc (1/((m:ℝ)+1)) H) (traceRatio_pos N) (traceRatio_lt_one hN) + (traceError_summable hκ hκ8 hN H) + (by + filter_upwards [hb m H] with n hn + intro T hT y hy hy' + simpa only [dist_eq_norm] using hn T hT.1 hT.2 y hy hy') + (fun T hT => hg T ((by positivity : 0 < 1/((m:ℝ)+1)).trans_le hT.1)) + apply hu.continuousOn + apply Eventually.frequently + apply Eventually.of_forall + intro n + exact (radialValue_continuousOn hκ (pow_pos (traceRatio_pos N) n) + (pow_le_one₀ (traceRatio_pos N).le (traceRatio_lt_one hN).le) b).mono + (Icc_subset_Icc (by positivity) le_rfl) + have hc' : ContinuousOn g (Ioi 0) := by + apply continuousOn_of_forall_continuousAt + intro T hT + obtain ⟨m,hm⟩ := exists_nat_gt (1/T) + obtain ⟨H,hH⟩ := exists_nat_gt T + have hδ : 1/((m:ℝ)+1) < T := by + apply (div_lt_iff₀ (by positivity : 0 < (m:ℝ)+1)).mpr + have hh := (div_lt_iff₀ hT).mp hm + nlinarith + exact (hc m H).continuousAt (Icc_mem_nhds hδ hH) + have he : (fun t => g (κ*t)) = trace κ b := by + funext t + rfl + rw [← he] + exact hc'.comp (continuous_const.mul continuous_id).continuousOn + (fun t ht => mul_pos hκ ht) +end SLEExactGauge.LiteralTrace +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.TraceChaining + + + +lemma initial_le_of_outward_deriv {f f' : ℝ → ℝ} {T R : ℝ} (hT : 0 ≤ T) + (hf : ContinuousOn f (Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, HasDerivWithinAt f (f' t) (Icc 0 T) t) + (hR : f T ≤ R) (hout : ∀ t ∈ Icc 0 T, R < f t → 0 < f' t) : + f 0 ≤ R := by + have hm : MapsTo (fun t : ℝ => T-t) (Icc 0 T) (Icc 0 T) := by + intro t ht + constructor <;> linarith [ht.1,ht.2] + have hc : ContinuousOn (fun t => f (T-t)) (Icc 0 T) := + hf.comp (continuous_const.sub continuous_id).continuousOn hm + have hh (t : ℝ) (ht : t ∈ Ico 0 T) : + HasDerivWithinAt (fun t => f (T-t)) (-f' (T-t)) (Ici t) t := by + have h := (hd (T-t) (hm ⟨ht.1,ht.2.le⟩)).comp t + ((hasDerivAt_id t).const_sub T).hasDerivWithinAt hm + have he : Icc (0:ℝ) T ∈ 𝓝[Ici t] t := by + filter_upwards [self_mem_nhdsWithin, + (show ∀ᶠ u : ℝ in 𝓝[Ici t] t, u < T from + nhdsWithin_le_nhds (Iio_mem_nhds ht.2))] with u hu huT + exact ⟨ht.1.trans hu,huT.le⟩ + convert! h.mono_of_mem_nhdsWithin he using 1; simp only [mul_neg,mul_one] + apply le_of_forall_pos_le_add + intro ε hε + have hfence := image_le_of_deriv_right_lt_deriv_boundary hc hh + (B := fun _ => R+ε) (B' := fun _ => 0) + (by simpa using hR.trans (by linarith : R ≤ R+ε)) + (fun _ => hasDerivAt_const _ _) + (by + intro t ht he + have hp := hout (T-t) (hm ⟨ht.1,ht.2.le⟩) (by linarith) + linarith) + simpa using hfence (right_mem_Icc.mpr hT) +end SLEExactGauge.TraceChaining +namespace SLEExactGauge.LiteralTrace +open TraceChaining + +lemma PositiveSolution.re_hasDeriv {κ : ℝ} {b : Driver} {z : ℂ} {T : ℝ} {f : ℝ → ℂ} + (hf : PositiveSolution κ b z T f) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun u => (f u).re) + (a κ*((f t).re-driverValue b t)/‖f t-driverValue b t‖^2) (Icc 0 T) t := by + have hi := Complex.reCLM.hasFDerivAt.comp_hasDerivWithinAt t (hf.2.2.2.2 t ht) + convert! hi using 1; first | rfl | + (simp only [Complex.reCLM_apply,Complex.div_re,Complex.ofReal_im,Complex.ofReal_re, + Complex.sub_re,Complex.normSq_eq_norm_sq,zero_mul]; ring) + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TraceContinuity.lean b/lean/OAI/Probability/SLEGauge/TraceContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f24cf65065753952e83f1bcfed1500f5610f6fc4 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TraceContinuity.lean @@ -0,0 +1,486 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.RadialMoments + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +noncomputable section +open MeasureTheory Set Filter Metric +open scoped NNReal ENNReal Topology +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +open scoped ContDiff Manifold +noncomputable section +open Filter Topology +noncomputable section +open Complex Real Set Filter +open scoped Topology +noncomputable section +open scoped Topology +open MeasureTheory +noncomputable section +open Set Filter Real +open scoped Topology +open Set MeasureTheory ProbabilityTheory Topology Function Filter +open scoped NNReal ENNReal ContinuousMapZero +noncomputable section +namespace SLEExactGauge.LiteralTrace +theorem inverseFlow_time_modulus {κ s t T y : ℝ} (hκ : 0 < κ) (hs : 0 ≤ s) + (hst : s ≤ t) (htT : t ≤ T) (hy : 0 < y) (hy1 : y ≤ 1) + (hΔ : t-s ≤ y^2) (b : Driver) : + ‖inverseFlow κ b t (driverValue b t+y*Complex.I)- + inverseFlow κ b s (driverValue b s+y*Complex.I)‖ ≤ + (2*(2+a κ+2*a κ*T)/y)*(|driverValue b t-driverValue b s|+a κ*(t-s)/y) := by + let z := inverseFlow κ b t (driverValue b t+y*Complex.I) + have ht : 0 ≤ t := hs.trans hst + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hw : 0 < ((driverValue b t:ℂ)+y*Complex.I).im := by simpa using hy + have hf := surviving_flow_positiveSolution ht (inverseFlow_surviving hκ b ht hw) + change PositiveSolution κ b z t (flow κ b z) at hf + let v := flow κ b z s + have hfT : flow κ b z t = (driverValue b t:ℂ)+y*Complex.I := flow_inverseFlow hκ b ht hw + have his : s ∈ Icc 0 t := ⟨hs,hst⟩ + have hit : t ∈ Icc 0 t := ⟨ht,le_rfl⟩ + have hvis : y ≤ v.im := by simpa only [hfT,v,Complex.add_im,Complex.ofReal_im,Complex.ofReal_re, + Complex.mul_im,Complex.I_im,Complex.I_re,mul_one,mul_zero,zero_add,add_zero] using hf.im_antitone hκ his hit hst + have hdist : ‖v-((driverValue b t:ℂ)+y*Complex.I)‖ ≤ a κ*(t-s)/y := by + have hh := hf.displacement_le hκ his hit hst + rw [hfT] at hh + simpa only [v,norm_sub_rev,Complex.add_im,Complex.ofReal_im,Complex.ofReal_re,Complex.mul_im, + Complex.I_im,Complex.I_re,mul_one,mul_zero,zero_add,add_zero,div_mul_eq_mul_div] using hh + have hsmall : a κ*(t-s)/y ≤ a κ*y := by + apply (div_le_iff₀ hy).mpr + nlinarith [mul_le_mul_of_nonneg_left hΔ ha.le] + have hiv : v.im ≤ 1+a κ := by + have hh := Complex.im_le_norm (v-((driverValue b t:ℂ)+y*Complex.I)) + simp only [Complex.sub_im,Complex.add_im,Complex.ofReal_im,Complex.ofReal_re,Complex.mul_im, + Complex.I_im,Complex.I_re,mul_one,mul_zero,zero_add,add_zero] at hh + nlinarith [mul_le_mul_of_nonneg_left hy1 ha.le] + have hvmap : inverseFlow κ b s v = z := inverseFlow_flow hs (hf.restrict hs hst).surviving + have hh := inverseFlow_lipschitz_strip hκ hs (hst.trans htT) hy b + (v := v) (w := (driverValue b s:ℂ)+y*Complex.I) ⟨hvis,hiv⟩ + (by simp only [Complex.add_im,Complex.ofReal_im,Complex.ofReal_re,Complex.mul_im,Complex.I_im, + Complex.I_re,mul_one,mul_zero,zero_add,add_zero]; exact ⟨le_rfl,by linarith⟩) + have hinput : ‖v-((driverValue b s:ℂ)+y*Complex.I)‖ ≤ + |driverValue b t-driverValue b s|+a κ*(t-s)/y := by + calc + _ ≤ ‖v-((driverValue b t:ℂ)+y*Complex.I)‖+ + ‖((driverValue b t:ℂ)+y*Complex.I)-((driverValue b s:ℂ)+y*Complex.I)‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ _ := by + rw [add_sub_add_right_eq_sub,← Complex.ofReal_sub,Complex.norm_real,Real.norm_eq_abs] + linarith + rw [hvmap] at hh + have hT0 : 0 ≤ T := ht.trans htT + calc + _ ≤ (2*(1+a κ+2*a κ*T+1)/y)*‖v-((driverValue b s:ℂ)+y*Complex.I)‖ := hh + _ ≤ (2*(1+a κ+2*a κ*T+1)/y)*(|driverValue b t-driverValue b s|+a κ*(t-s)/y) := + mul_le_mul_of_nonneg_left hinput (by positivity) + _ = _ := by ring +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.BrownianCalculus + +def gaussianMoment (n : ℕ) : ℝ := ∫ x : ℝ, |x|^n ∂gaussianReal 0 1 + +lemma gaussianMoment_nonneg (n : ℕ) : 0 ≤ gaussianMoment n := + integral_nonneg (fun _ => by positivity) + +lemma gaussian_abs_pow_integrable (v : ℝ≥0) (n : ℕ) : + Integrable (fun x : ℝ => |x|^n) (gaussianReal 0 v) := by + simpa only [id_eq,Real.norm_eq_abs] using + (memLp_id_gaussianReal' (μ := 0) (v := v) (n:ℝ≥0∞) (by simp)).integrable_norm_pow' + +lemma gaussian_abs_pow_scaled (σ : ℝ≥0) (n : ℕ) : + (∫ x : ℝ, |x|^n ∂gaussianReal 0 (σ^2)) = (σ:ℝ)^n*gaussianMoment n := by + have he : (gaussianReal 0 1).map (fun x : ℝ => (σ:ℝ)*x) = + gaussianReal 0 (σ^2) := by + convert gaussianReal_map_const_mul (μ := 0) (v := 1) (σ:ℝ) using 1; simp + congr 1 + rw [← he,integral_map (by fun_prop) (by fun_prop)] + simp_rw [abs_mul,abs_of_nonneg σ.coe_nonneg,mul_pow] + exact integral_const_mul _ _ + +lemma increment_abs_pow_scaled {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s σ : ℝ≥0) (n : ℕ) : + (∫ b, |increment s (σ^2) b|^n ∂W) = (σ:ℝ)^n*gaussianMoment n := by + exact ((increment_law hW s (σ^2)).integral_comp (by fun_prop)).trans + (gaussian_abs_pow_scaled σ n) + +lemma increment_abs_pow_integrable {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s h : ℝ≥0) (n : ℕ) : Integrable (fun b => |increment s h b|^n) W := by + let := hW.isGaussianProcess.isProbabilityMeasure + have hm := (increment_law hW s h).hasGaussianLaw.memLp (p := (n : ℝ≥0∞)) (by simp) + simpa only [Real.norm_eq_abs] using hm.integrable_norm_pow' + +lemma increment_scaled_tail {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (s σ : ℝ≥0) (hσ : 0 < σ) {r : ℝ} (hr : 0 < r) (n : ℕ) : + W {b : Driver | (σ:ℝ)*r ≤ |increment s (σ^2) b|} ≤ + ENNReal.ofReal (gaussianMoment n/r^n) := by + have hsr : 0 < ((σ:ℝ)*r)^n := pow_pos (mul_pos (by exact_mod_cast hσ) hr) _ + calc + _ ≤ W {b : Driver | ENNReal.ofReal (((σ:ℝ)*r)^n) ≤ + ENNReal.ofReal (|increment s (σ^2) b|^n)} := by + apply measure_mono + intro b hb + exact ENNReal.ofReal_le_ofReal (pow_le_pow_left₀ (by positivity) hb _) + _ ≤ (∫⁻ b : Driver, ENNReal.ofReal (|increment s (σ^2) b|^n) ∂W)/ + ENNReal.ofReal (((σ:ℝ)*r)^n) := + meas_ge_le_lintegral_div (((measurable_increment s (σ^2)).abs.pow_const n).ennreal_ofReal.aemeasurable) (ne_of_gt (ENNReal.ofReal_pos.mpr hsr)) ENNReal.ofReal_ne_top + _ = ENNReal.ofReal (((σ:ℝ)^n*gaussianMoment n)/(((σ:ℝ)*r)^n)) := by + rw [← ofReal_integral_eq_lintegral_ofReal (increment_abs_pow_integrable hW s (σ^2) n) + (ae_of_all _ (fun _ => by positivity)),increment_abs_pow_scaled hW, + ← ENNReal.ofReal_div_of_pos hsr] + _ = _ := by + congr 1 + rw [mul_pow] + field_simp +end SLEExactGauge.BrownianCalculus +namespace SLEExactGauge.BrownianCalculus + +def modulusBase (K : ℕ) : ℕ := 2^(2*K) +def modulusStd (K n : ℕ) : ℝ≥0 := ((1/2:ℝ≥0)^K)^n +def modulusRate (K : ℕ) : ℝ := 2*(1/2:ℝ)^K + +def modulusGridBad (K M n : ℕ) : Set Driver := + ⋃ k : Fin (M*(modulusBase K)^n), {b : Driver | + (modulusRate K)^n ≤ |increment ((k:ℝ≥0)*(modulusStd K n)^2) ((modulusStd K n)^2) b|} + +lemma modulus_grid_measure {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (K M n : ℕ) : W (modulusGridBad K M n) ≤ + ENNReal.ofReal (((M:ℝ)*gaussianMoment (2*K+1))*(1/2:ℝ)^n) := by + have hs : 0 < modulusStd K n := by unfold modulusStd; positivity + have he : (modulusRate K)^n = (modulusStd K n:ℝ)*(2:ℝ)^n := by + simp only [modulusRate,modulusStd,NNReal.coe_pow,NNReal.coe_div,NNReal.coe_one,NNReal.coe_ofNat,mul_pow] + ring + calc + _ ≤ ∑ k : Fin (M*(modulusBase K)^n), W {b : Driver | + (modulusRate K)^n ≤ |increment ((k:ℝ≥0)*(modulusStd K n)^2) ((modulusStd K n)^2) b|} := + measure_iUnion_fintype_le _ _ + _ ≤ ∑ _k : Fin (M*(modulusBase K)^n), ENNReal.ofReal (gaussianMoment (2*K+1)/((2:ℝ)^n)^(2*K+1)) := by + apply Finset.sum_le_sum + intro k _ + rw [he] + exact increment_scaled_tail hW _ _ hs (by positivity) _ + _ = ENNReal.ofReal (((M*(modulusBase K)^n:ℕ):ℝ)* + (gaussianMoment (2*K+1)/((2:ℝ)^n)^(2*K+1))) := by + rw [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ← ENNReal.ofReal_natCast,← ENNReal.ofReal_mul (Nat.cast_nonneg _)] + _ = _ := by + congr 1 + simp only [modulusBase,Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat] + rw [← pow_mul,← pow_mul,show n*(2*K+1) = (2*K)*n+n by ring,pow_add] + field_simp + rw [mul_assoc,← mul_pow] + norm_num + +lemma modulus_grid_eventually {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) + (K M : ℕ) : + ∀ᵐ b ∂W, ∀ᶠ n : ℕ in atTop, ∀ k : Fin (M*(modulusBase K)^n), + |increment ((k:ℝ≥0)*(modulusStd K n)^2) ((modulusStd K n)^2) b| < (modulusRate K)^n := by + have hs : (∑' n : ℕ, W (modulusGridBad K M n)) ≠ (∞:ℝ≥0∞) := by + apply ne_top_of_le_ne_top + (((summable_geometric_of_abs_lt_one (by norm_num : |(1/2:ℝ)| < 1)).mul_left + ((M:ℝ)*gaussianMoment (2*K+1))).tsum_ofReal_ne_top) + exact ENNReal.tsum_le_tsum (modulus_grid_measure hW K M) + filter_upwards [ae_eventually_notMem hs] with b hb + filter_upwards [hb] with n hn + intro k + exact lt_of_not_ge (fun h => hn (mem_iUnion.mpr ⟨k,h⟩)) + +lemma modulus_std_square (K n : ℕ) : + ((modulusStd K n:ℝ≥0):ℝ)^2 = 1/(modulusBase K:ℝ)^n := by + simp only [modulusStd,modulusBase,NNReal.coe_pow,NNReal.coe_div,NNReal.coe_one, + NNReal.coe_ofNat,Nat.cast_pow,Nat.cast_ofNat,div_pow,one_pow] + rw [← pow_mul,← pow_mul,← pow_mul] + congr 2 + ring + +lemma modulus_rate_pos (K : ℕ) : 0 < modulusRate K := by + unfold modulusRate; positivity + +lemma modulus_rate_lt_one {K : ℕ} (hK : 2 ≤ K) : modulusRate K < 1 := by + have hh : (1/2:ℝ)^K ≤ (1/2:ℝ)^2 := + pow_le_pow_of_le_one (by norm_num) (by norm_num) hK + dsimp [modulusRate] + linarith + +end SLEExactGauge.BrownianCalculus + + + +noncomputable section +open MeasureTheory Set Filter Metric +open scoped Topology +namespace SLEExactGauge.TraceChaining + +def grid (q n k : ℕ) : ℝ := (k:ℝ)/(q:ℝ)^n + +def index (q n : ℕ) (t : ℝ) : ℕ := ⌊(q:ℝ)^n*t⌋₊ + +def approx (q n : ℕ) (t : ℝ) : ℝ := grid q n (index q n t) + +lemma approx_bounds {q : ℕ} (hq : 0 < q) (n : ℕ) {t : ℝ} (ht : 0 ≤ t) : + 0 ≤ approx q n t ∧ approx q n t ≤ t ∧ t < approx q n t+1/(q:ℝ)^n := by + have hp : 0 < (q:ℝ)^n := pow_pos (by exact_mod_cast hq) _ + refine ⟨by unfold approx grid; positivity,?_,?_⟩ + · exact (div_le_iff₀ hp).mpr (by + simpa only [index,mul_comm] using Nat.floor_le (mul_nonneg hp.le ht)) + · have hh := Nat.lt_floor_add_one ((q:ℝ)^n*t) + dsimp [approx,grid,index] + rw [← add_div] + exact (lt_div_iff₀ hp).mpr (by simpa only [mul_comm] using hh) + +lemma approx_tendsto {q : ℕ} (hq : 1 < q) {t : ℝ} (ht : 0 ≤ t) : + Tendsto (fun n => approx q n t) atTop (𝓝 t) := by + have hqp : 0 < q := by omega + have hqR : 1 < (q:ℝ) := by exact_mod_cast hq + have hz : Tendsto (fun n : ℕ => 1/(q:ℝ)^n) atTop (𝓝 0) := by + simpa only [one_div,inv_pow] using tendsto_pow_atTop_nhds_zero_of_lt_one + (by positivity : 0 ≤ (q:ℝ)⁻¹) ((inv_lt_one₀ (by positivity)).mpr hqR) + apply tendsto_of_tendsto_of_tendsto_of_le_of_le + (g := fun n => t-1/(q:ℝ)^n) (h := fun _ => t) + (by simpa using tendsto_const_nhds.sub hz) tendsto_const_nhds + (fun n => by linarith [(approx_bounds hqp n ht).2.2]) + (fun n => (approx_bounds hqp n ht).2.1) + +lemma index_le {q M n : ℕ} (_hq : 0 < q) {t : ℝ} (ht : t ≤ M) : + index q n t ≤ M*q^n := by + apply Nat.floor_le_of_le + simp only [Nat.cast_mul,Nat.cast_pow] + nlinarith [pow_nonneg (Nat.cast_nonneg q : (0:ℝ) ≤ q) n] + +lemma index_refine {q n : ℕ} (hq : 0 < q) (t : ℝ) : + index q (n+1) t / q = index q n t := by + unfold index + rw [pow_succ,mul_right_comm _ _ t,Nat.mul_cast_floor_div_cancel (by omega)] + +lemma grid_refine {q : ℕ} (hq : 0 < q) (n k : ℕ) : + grid q (n+1) (q*k) = grid q n k := by + unfold grid + push_cast + rw [pow_succ] + field_simp + +lemma grid_distance_le {E : Type*} [PseudoMetricSpace E] (f : ℝ → E) + (q n L : ℕ) {c : ℝ} (_hc : 0 ≤ c) + (hb : ∀ k < L, dist (f (grid q n k)) (f (grid q n (k+1))) ≤ c) + {i j : ℕ} (hij : i ≤ j) (hj : j ≤ L) : + dist (f (grid q n i)) (f (grid q n j)) ≤ (j-i:ℕ)*c := by + calc + _ ≤ ∑ k ∈ Finset.Ico i j, c := dist_le_Ico_sum_of_dist_le (f := fun k => f (grid q n k)) hij + (fun {k} _hk hk => hb k (hk.trans_le hj)) + _ = _ := by simp + +lemma approx_step {E : Type*} [PseudoMetricSpace E] (f : ℝ → E) + {q : ℕ} (hq : 0 < q) (M n : ℕ) {t : ℝ} (ht : t ≤ M) + {c : ℝ} (hc : 0 ≤ c) + (hb : ∀ k < M*q^(n+1), dist (f (grid q (n+1) k)) + (f (grid q (n+1) (k+1))) ≤ c) : + dist (f (approx q n t)) (f (approx q (n+1) t)) ≤ (q:ℝ)*c := by + have hi := index_refine (n := n) hq t + have hlow : q*index q n t ≤ index q (n+1) t := by + rw [← hi,mul_comm] + exact Nat.div_mul_le_self _ _ + have hupp : index q (n+1) t - q*index q n t ≤ q := by + have he := Nat.mod_add_div (index q (n+1) t) q + have hm := Nat.mod_lt (index q (n+1) t) hq + rw [hi] at he + omega + have h := grid_distance_le f q (n+1) (M*q^(n+1)) hc hb hlow (index_le hq ht) + rw [grid_refine hq] at h + exact h.trans (mul_le_mul_of_nonneg_right (by exact_mod_cast hupp) hc) + +lemma approx_distance {E : Type*} [PseudoMetricSpace E] (f : ℝ → E) + (hf : Continuous f) {q : ℕ} (hq : 1 < q) (M n₀ : ℕ) + {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1) + (hb : ∀ n, n₀ ≤ n → ∀ k < M*q^n, + dist (f (grid q n k)) (f (grid q n (k+1))) ≤ ρ^n) + {t : ℝ} (ht0 : 0 ≤ t) (htM : t ≤ M) {n : ℕ} (hn : n₀ ≤ n) : + dist (f (approx q n t)) (f t) ≤ (q:ℝ)*ρ^(n+1)/(1-ρ) := by + have hl := (hf.tendsto t).comp ((approx_tendsto hq ht0).comp (tendsto_add_atTop_nat n)) + have hs (j : ℕ) : dist (f (approx q (j+n) t)) (f (approx q (j+1+n) t)) ≤ + ((q:ℝ)*ρ^(n+1))*ρ^j := by + have hh := approx_step f (by omega : 0 < q) M (j+n) htM + (pow_nonneg hρ0 (j+n+1)) (hb (j+n+1) (by omega)) + rw [show j+1+n = j+n+1 by omega] + simpa only [show j+n+1 = (n+1)+j by omega,pow_add,mul_assoc] using hh + have hh := dist_le_of_le_geometric_of_tendsto₀ ρ ((q:ℝ)*ρ^(n+1)) hρ1 hs hl + simpa only [Nat.zero_add] using hh + + + +lemma grid_modulus {E : Type*} [PseudoMetricSpace E] (f : ℝ → E) + (hf : Continuous f) {q : ℕ} (hq : 1 < q) (M n₀ : ℕ) + {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1) + (hb : ∀ n, n₀ ≤ n → ∀ k < M*q^n, + dist (f (grid q n k)) (f (grid q n (k+1))) ≤ ρ^n) + {s t : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) (ht : t ≤ M) {n : ℕ} (hn : n₀ ≤ n) + (hclose : t-s ≤ 1/(q:ℝ)^n) : + dist (f s) (f t) ≤ (2+2*(q:ℝ)*ρ/(1-ρ))*ρ^n := by + have hqp : 0 < q := by omega + have hp : 0 < (q:ℝ)^n := pow_pos (by exact_mod_cast hqp) _ + have hi : index q n s ≤ index q n t := + Nat.floor_mono (mul_le_mul_of_nonneg_left hst hp.le) + have hj : index q n t - index q n s ≤ 2 := by + have h1 := Nat.floor_le (mul_nonneg hp.le (hs.trans hst)) + have h2 := Nat.lt_floor_add_one ((q:ℝ)^n*s) + have h3 := (le_div_iff₀ hp).mp hclose + have h4 : (index q n t:ℝ) < (index q n s:ℝ)+2 := by + dsimp [index] + nlinarith + have h5 : index q n t < index q n s+2 := by exact_mod_cast h4 + omega + have hg := grid_distance_le f q n (M*q^n) (pow_nonneg hρ0 n) + (hb n hn) hi (index_le hqp ht) + have hg' : dist (f (approx q n s)) (f (approx q n t)) ≤ 2*ρ^n := + hg.trans (mul_le_mul_of_nonneg_right (by exact_mod_cast hj) (pow_nonneg hρ0 n)) + have hs' := approx_distance f hf hq M n₀ hρ0 hρ1 hb hs (hst.trans ht) hn + have ht' := approx_distance f hf hq M n₀ hρ0 hρ1 hb (hs.trans hst) ht hn + calc + _ ≤ dist (f s) (f (approx q n s)) + dist (f (approx q n s)) (f (approx q n t)) + + dist (f (approx q n t)) (f t) := dist_triangle4 _ _ _ _ + _ ≤ (q:ℝ)*ρ^(n+1)/(1-ρ)+2*ρ^n+(q:ℝ)*ρ^(n+1)/(1-ρ) := by + rw [dist_comm (f s)] + gcongr + _ = _ := by rw [pow_succ]; ring +end SLEExactGauge.TraceChaining +namespace SLEExactGauge.BrownianCalculus +open SLEExactGauge.TraceChaining + +lemma increment_grid_eq (K n k : ℕ) (b : Driver) : + increment ((k:ℝ≥0)*(modulusStd K n)^2) ((modulusStd K n)^2) b = + b ((grid (modulusBase K) n (k+1)).toNNReal)- + b ((grid (modulusBase K) n k).toNNReal) := by + have he (j : ℕ) : (grid (modulusBase K) n j).toNNReal = + (j:ℝ≥0)*(modulusStd K n)^2 := by + apply NNReal.coe_injective + rw [Real.coe_toNNReal _ (by unfold grid; positivity)] + simp only [NNReal.coe_mul,NNReal.coe_natCast,NNReal.coe_pow,modulus_std_square,grid] + ring + rw [increment,he,he] + congr 2 + push_cast + ring + + + +theorem brownian_uniform_modulus {W : Measure Driver} + (hW : IsBrownianReal (fun (t : ℝ≥0) (b : Driver) => b t) W) : + ∀ᵐ b ∂W, ∀ K M : ℕ, 2 ≤ K → ∃ n₀ : ℕ, ∀ n ≥ n₀, + ∀ s t : ℝ, 0 ≤ s → s ≤ t → t ≤ M → t-s ≤ 1/(modulusBase K:ℝ)^n → + |b t.toNNReal-b s.toNNReal| ≤ + (2+2*(modulusBase K:ℝ)*modulusRate K/(1-modulusRate K))*(modulusRate K)^n := by + have hh := ae_all_iff.mpr (fun K => ae_all_iff.mpr (fun M => modulus_grid_eventually hW K M)) + filter_upwards [hh] with b hb + intro K M hK + obtain ⟨n₀,hn₀⟩ := eventually_atTop.mp (hb K M) + refine ⟨n₀,?_⟩ + intro n hn s t hs hst ht hclose + have hg (m : ℕ) (hm : n₀ ≤ m) (k : ℕ) (hk : k < M*(modulusBase K)^m) : + dist (b ((grid (modulusBase K) m k).toNNReal)) + (b ((grid (modulusBase K) m (k+1)).toNNReal)) ≤ (modulusRate K)^m := by + have hi := (hn₀ m hm ⟨k,hk⟩).le + rw [increment_grid_eq] at hi + simpa only [Real.dist_eq,abs_sub_comm] using hi + have hq : 1 < modulusBase K := by + dsimp [modulusBase] + exact one_lt_pow₀ (by norm_num) (by omega) + have hu := grid_modulus (fun t : ℝ => b t.toNNReal) + ((map_continuous b).comp continuous_real_toNNReal) hq M n₀ + (modulus_rate_pos K).le (modulus_rate_lt_one hK) hg hs hst ht hn hclose + simpa only [Real.dist_eq,abs_sub_comm] using hu +end SLEExactGauge.BrownianCalculus +namespace SLEExactGauge.LiteralTrace + +abbrev radialValue (κ : ℝ) (b : Driver) (t y : ℝ) : ℂ := + inverseFlow κ b t (driverValue b t+y*Complex.I) + +lemma radial_increment_real {κ s y z R : ℝ} (hκ : 0 < κ) (hs : 0 ≤ s) + (hz : 0 < z) (hzy : z ≤ y) (b : Driver) + (hR : radialLength κ b s y ≤ ENNReal.ofReal R) (hR0 : 0 ≤ R) : + ‖radialValue κ b s y-radialValue κ b s z‖ ≤ R := by + exact (ENNReal.ofReal_le_ofReal_iff hR0).mp ((radial_increment_le hκ hs hz hzy b).trans hR) + +lemma time_bound_below {κ s t T y v D : ℝ} (hκ : 0 < κ) (hs : 0 ≤ s) + (hst : s ≤ t) (htT : t ≤ T) (hv : 0 < v) (hvy : v ≤ y) (hy1 : y ≤ 1) + (hΔ : t-s ≤ v^2) (b : Driver) (hD : |driverValue b t-driverValue b s| ≤ D) : + ‖radialValue κ b t y-radialValue κ b s y‖ ≤ + (2*(2+a κ+2*a κ*T)/v)*(D+a κ*(t-s)/v) := by + have ha : 0 < a κ := div_pos (by norm_num) hκ + have hy := hv.trans_le hvy + have hT : 0 ≤ T := hs.trans (hst.trans htT) + have ht : 0 ≤ t-s := sub_nonneg.mpr hst + have hc : 0 ≤ 2*(2+a κ+2*a κ*T) := by positivity + apply (inverseFlow_time_modulus hκ hs hst htT hy hy1 + (hΔ.trans (pow_le_pow_left₀ hv.le hvy 2)) b).trans + apply mul_le_mul + · exact div_le_div_of_nonneg_left hc hv hvy + · exact add_le_add hD (div_le_div_of_nonneg_left (mul_nonneg ha.le ht) hv hvy) + · positivity + · positivity + + + +lemma radial_interpolation {κ s t T v y z D R : ℝ} (hκ : 0 < κ) (hs : 0 ≤ s) + (hst : s ≤ t) (htT : t ≤ T) (hv : 0 < v) (hvy : v ≤ y) (hyz : y ≤ z) (hz1 : z ≤ 1) + (hΔ : t-s ≤ v^2) (b : Driver) (hD : |driverValue b t-driverValue b s| ≤ D) + (hR : radialLength κ b s z ≤ ENNReal.ofReal R) (hR0 : 0 ≤ R) : + ‖radialValue κ b t y-radialValue κ b t z‖ ≤ + 2*((2*(2+a κ+2*a κ*T)/v)*(D+a κ*(t-s)/v))+R := by + have h1 := time_bound_below hκ hs hst htT hv hvy (hyz.trans hz1) hΔ b hD + have h2 := time_bound_below hκ hs hst htT hv (hvy.trans hyz) hz1 hΔ b hD + have h3 := radial_increment_real hκ hs (hv.trans_le hvy) hyz b hR hR0 + have hh := dist_triangle4 (radialValue κ b t y) (radialValue κ b s y) + (radialValue κ b s z) (radialValue κ b t z) + simp only [dist_eq_norm] at hh + rw [norm_sub_rev] at h2 h3 + linarith +end SLEExactGauge.LiteralTrace +namespace SLEExactGauge.LiteralTrace +open BrownianCalculus + +def traceRatio (N : ℕ) : ℝ := (1/2:ℝ)^(4*N) +def traceMeshBase (N : ℕ) : ℕ := modulusBase (4*N+2) +def brownianModulusConst (K : ℕ) : ℝ := + 2+2*(modulusBase K:ℝ)*modulusRate K/(1-modulusRate K) + +def traceError (κ : ℝ) (N H n : ℕ) : ℝ := + 4*(2+a κ+2*a κ*H)* + (brownianModulusConst (4*N+2)/traceRatio N*(1/2:ℝ)^n+ + a κ/(traceRatio N)^2*(1/16:ℝ)^n)+((traceRatio N)^(traceBeta κ))^n + +end SLEExactGauge.LiteralTrace +end +end +end +end +end +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TraceMassEndpoint.lean b/lean/OAI/Probability/SLEGauge/TraceMassEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d0ce9e7d80c1bb2846df6afa618f53e89ef2282 --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TraceMassEndpoint.lean @@ -0,0 +1,521 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.OptionalGreen +import OAI.Probability.SLEGauge.TerminalExhaustion +import OAI.Probability.SLEGauge.TraceRestriction + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal symmDiff +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen +open TraceMassIntegration TraceRestriction TraceLevelLocalization MassVersions +open GermPositivity + + + +theorem actual_raw_mass_trace (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (W : Measure TDriver) (hW : Target.IsWiener W) + (t : ℕ→ℝ≥0∞) (hD : Dense {u : ℝ≥0 | ∃i,t i=u}) + (idx : ℕ→ℕ) (hidx : ∀n : ℕ,t (idx n)=(n:ℝ≥0)) + (is : ℕ→ℕ) (his : ∀n : ℕ,t (is n)=(smallTime n:ℝ≥0∞)) + (j : ℕ) (hj : t j=∞) : + ∃ (s : ℕ → Finset ℕ) (c : ℕ → ℕ → ℝ) + (hc : ∀ k j, j∈s k → 0≤c k j), + (∀ k j, j∈s k → k≤j) ∧ (∀ k, ∑ j∈s k, c k j=1) ∧ + let μ := recoveredMass (Target.a κ) (a_gt_quarter hκ hκ8) s c hc + (∀ v b, IsFiniteMeasureOnCompacts (μ v b) ∧ (μ v b).Regular) ∧ + (∀ b, μ 0 b=0) ∧ + (∀ v, Measurable (μ v)) ∧ + IsProgressive rawFiltration (fun v : ℝ≥0 => μ v) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)) (m : ℕ), + MemLp (fun b => ∫z,f z∂μ (t i) b) (m : ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀ i (K : Set UpperPlane), IsCompact K → ∀ m : ℕ, + MemLp (fun b => (μ (t i) b K).toReal) (m : ℝ≥0∞) (W.map driverHomeomorph)) ∧ + (∀ i (f : C_c(UpperPlane,ℝ)), + Tendsto (fun k => eLpNorm (fun b => + (∑ j∈s k, c k j * ∫z,f z∂actualUpperMass (Target.a κ) (Real.exp (-2*(Target.a κ)*(j+1))) (t i) b) + - ∫z,f z∂μ (t i) b) 1 (W.map driverHomeomorph)) atTop (𝓝 0)) ∧ + (∀ i, t i=∞ → μ (t i) ∘ₘ (W.map driverHomeomorph)=initialGreenMeasure (Target.a κ)) ∧ + (∀ i j (v : ℝ≥0), t i=v → t j=∞ → + ∀ H : ExactSLEGenerator.Driver × UpperPlane → ℝ≥0∞, + Measurable[(rawFiltration v).prod (inferInstance : MeasurableSpace UpperPlane)] H → + (∫⁻b, ∫⁻z, H (b,z) ∂μ (t j) b ∂(W.map driverHomeomorph)) = (∫⁻b, ∫⁻z, H (b,z) ∂μ (t i) b ∂(W.map driverHomeomorph)) + + ∫⁻b, ∫⁻z, H (b,z) * ENNReal.ofReal (survivingGreen (Target.a κ) v b z.1) ∂upperArea ∂(W.map driverHomeomorph)) ∧ + ∀ᵐ b ∂W, + ContinuousOn (Target.trace κ b) (Ici 0) ∧ + NullSingletonClass (μ ∞ (driverHomeomorph b)) ∧ + (∀v : ℝ≥0, μ v (driverHomeomorph b)= + (μ ∞ (driverHomeomorph b)).restrict + (visited (fun z : UpperPlane => z.1) (internalTrace κ b) v)) ∧ + (∀v : ℝ≥0∞, ∀f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) v (driverHomeomorph b)) + atTop (𝓝 (∫z,f z∂μ v (driverHomeomorph b)))) ∧ + (∀A : Set UpperPlane, MeasurableSet A → Tendsto + (fun n : ℕ => μ (n:ℝ≥0) (driverHomeomorph b) A) + atTop (𝓝 (μ ∞ (driverHomeomorph b) A))) ∧ + (∀K : Set UpperPlane, IsCompact K → Tendsto + (fun n : ℕ => (μ ∞ (driverHomeomorph b)-μ (n:ℝ≥0) (driverHomeomorph b)) K) + atTop (𝓝 0)) ∧ + (∀v : ℝ≥0∞, 0 z.1) (internalTrace κ b) u) := by + have hle : μ u (driverHomeomorph b)≤μ ∞ (driverHomeomorph b) := by + simpa only [hi,hj] using horder i j (by rw [hj]; exact le_top) + apply restriction_of_complementary_support _ _ hle _ + (measurableSet_visited _ measurable_subtype_coe _ hγ u) + · rw [visited_internalTrace hκ] + exact actual_limit_past_trace_support κ hκ hκ8 q hq s c hc hs b hbr hcont K hba u + (μ u (driverHomeomorph b)) (by + intro f + simpa only [hi] using hvague i f) + · rw [visited_internalTrace hκ] + have hf := hfuture i j (hi ▸ ENNReal.coe_ne_top) hj + simp only [hi,hj,ENNReal.toNNReal_coe] at hf + have hp := past_trace_subset_dead hκ b hbt.1 (t := (u:ℝ)/κ) (by positivity) + have hu : (κ*((u:ℝ)/κ)).toNNReal=u := by + rw [mul_div_cancel₀ _ hκ.ne',Real.toNNReal_coe] + rw [hu] at hp + exact measure_mono_null (fun z hz => hp hz) hf + have hdc (u : ℝ≥0) (hu : u∈{u : ℝ≥0 | ∃i,t i=u}) (f : C_c(UpperPlane,ℝ)) : + Tendsto (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) u (driverHomeomorph b)) + atTop (𝓝 (∫z in visited (fun z : UpperPlane => z.1) (internalTrace κ b) u, + f z∂μ ∞ (driverHomeomorph b))) := by + obtain ⟨i,hi⟩ := hu + have hv := hvague i f + change Tendsto _ atTop (𝓝 (∫z,f z∂μ (t i) (driverHomeomorph b))) at hv + rw [hi,hrestrict i u hi] at hv + exact hv + have hall := recoveredMass_all_times κ hκ (a_gt_quarter hκ hκ8) s c hc b hcont + (μ ∞ (driverHomeomorph b)) _ hD h0D hdc + have hvall := actualMass_tendsto_all_times κ hκ (a_gt_quarter hκ hκ8) s c hc b hcont + (μ ∞ (driverHomeomorph b)) _ hD h0D hdc + change ∀v : ℝ≥0, μ v (driverHomeomorph b)= + (μ ∞ (driverHomeomorph b)).restrict + (visited (fun z : UpperPlane => z.1) (internalTrace κ b) v) at hall + have hmono : Monotone (fun u : ℝ≥0∞ => μ u (driverHomeomorph b)) := by + intro u v huv + change μ u (driverHomeomorph b)≤μ v (driverHomeomorph b) + induction v using ENNReal.recTopCoe with + | top => + induction u using ENNReal.recTopCoe with + | top => exact le_rfl + | coe u => rw [hall u]; exact Measure.restrict_le_self + | coe v => + have hu : u≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top huv + rw [←ENNReal.coe_toNNReal hu,hall,hall] + exact Measure.restrict_mono (visited_mono _ _ (by + apply ENNReal.coe_le_coe.mp + simpa only [ENNReal.coe_toNNReal hu] using huv)) le_rfl + have hp (u : ℝ≥0∞) (hu : 0 (smallTime n:ℝ≥0∞)) atTop (𝓝 0) := + ENNReal.continuous_coe.tendsto 0 |>.comp tendsto_smallTime + obtain ⟨n,hn⟩ := (hlim.eventually (gt_mem_nhds hu)).exists + have hnpos : 0<μ (smallTime n) (driverHomeomorph b) univ := by + simpa only [his] using hpos (is n) (by rw [his]; exact_mod_cast smallTime_pos n) + exact hnpos.trans_le (Measure.le_iff'.mp (hmono hn.le) univ) + refine ⟨hcont,inferInstance,hall,?_,hx,hk,hp,?_⟩ + · intro u + induction u using ENNReal.recTopCoe with + | top => intro f; simpa only [hj] using hvague j f + | coe u => + intro f + change Tendsto _ atTop (𝓝 (∫z,f z∂μ u (driverHomeomorph b))) + rw [hall u] + exact hvall u f + · intro u hu + obtain ⟨A,-,hA,hpA⟩ := isOpen_univ.exists_lt_isCompact (hp u hu) + exact ⟨A,hA,hpA,hA.measure_lt_top⟩ + +end SLEExactGauge.TraceMassContinuity +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + +lemma stoppedSurvivingGreen_spatial_measurable (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (b : ExactSLEGenerator.Driver) : + Measurable (fun z : UpperPlane => stoppedSurvivingGreen a (S b) b z.1) := + (stoppedSurvivingGreen_joint_measurable a ha S hS).comp + (measurable_const.prodMk measurable_id) + + +def stoppedSurvivingKernel (a : ℝ) (_ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (_hS : IsStoppingTime rawFiltration S) : + Kernel ExactSLEGenerator.Driver UpperPlane := + (Kernel.const ExactSLEGenerator.Driver upperArea).withDensity + (fun b z => ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)) + +instance stoppedSurvivingKernel_sfinite (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + IsSFiniteKernel (stoppedSurvivingKernel a ha S hS) := + Kernel.IsSFiniteKernel.withDensity _ (fun _ _ => ENNReal.ofReal_ne_top) + +lemma stoppedSurvivingKernel_apply (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (b : ExactSLEGenerator.Driver) : + stoppedSurvivingKernel a ha S hS b = upperArea.withDensity + (fun z => ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1)) := + Kernel.withDensity_apply _ (stoppedSurvivingGreen_joint_measurable a ha S hS).ennreal_ofReal b + +lemma stoppedSurvivingKernel_raw_measurable (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + Measurable[hS.measurableSpace] (stoppedSurvivingKernel a ha S hS) := by + let : MeasurableSpace ExactSLEGenerator.Driver := hS.measurableSpace + apply Measure.measurable_of_measurable_coe + intro A hA + simp_rw [stoppedSurvivingKernel_apply, withDensity_apply _ hA] + exact (stoppedSurvivingGreen_raw_joint a ha S hS).ennreal_ofReal.lintegral_prod_right' + +lemma stoppedSurvivingGreen_lintegral_le_initial (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (z : UpperPlane) : + (∫⁻b, ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂W) ≤ + ENNReal.ofReal (initialGreen a z) := by + obtain ⟨hi,hb⟩ := survivingGreen_optional_bound a ha W hW z S hS + rw [← ofReal_integral_eq_lintegral_ofReal hi + (Eventually.of_forall (fun b => stoppedSurvivingGreen_nonneg a (S b) b z.1))] + exact ENNReal.ofReal_le_ofReal hb + + + +theorem stoppedSurvivingKernel_average_le_initial (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + stoppedSurvivingKernel a ha S hS ∘ₘ W ≤ initialGreenMeasure a := by + apply Measure.le_iff.mpr + intro A hA + rw [Measure.bind_apply hA (Kernel.aemeasurable _)] + simp_rw [stoppedSurvivingKernel_apply, withDensity_apply _ hA] + rw [lintegral_lintegral_swap + (stoppedSurvivingGreen_joint_measurable a ha S hS).ennreal_ofReal.aemeasurable] + change (∫⁻z in A, ∫⁻b, ENNReal.ofReal (stoppedSurvivingGreen a (S b) b z.1) ∂W ∂upperArea) ≤ + (initialGreenMeasure a) A + rw [initialGreenMeasure,withDensity_apply _ hA] + exact lintegral_mono (stoppedSurvivingGreen_lintegral_le_initial a ha W hW S hS) + +lemma stoppedSurvivingKernel_average_finiteOnCompacts (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) : + IsFiniteMeasureOnCompacts (stoppedSurvivingKernel a ha S hS ∘ₘ W) := by + constructor + intro K hK + exact ((stoppedSurvivingKernel_average_le_initial a ha W hW S hS) K).trans_lt + hK.measure_lt_top + +lemma stoppedSurvivingKernel_compact_eval (a : ℝ) (ha : 1/4 < a) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (b : ExactSLEGenerator.Driver) (f : C_c(UpperPlane,ℝ)) : + (∫z, f z ∂stoppedSurvivingKernel a ha S hS b) = + ∫z, f z * stoppedSurvivingGreen a (S b) b z.1 ∂upperArea := by + rw [stoppedSurvivingKernel_apply, integral_withDensity_eq_integral_toReal_smul] + · simp only [ENNReal.toReal_ofReal (stoppedSurvivingGreen_nonneg _ _ _ _), smul_eq_mul, mul_comm] + · exact (stoppedSurvivingGreen_spatial_measurable a ha S hS b).ennreal_ofReal + · exact Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top) + +lemma stoppedSurvivingKernel_compact_ae_integrable (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (f : C_c(UpperPlane,ℝ)) : + ∀ᵐ b ∂W, Integrable f (stoppedSurvivingKernel a ha S hS b) := by + have := stoppedSurvivingKernel_average_finiteOnCompacts a ha W hW S hS + have hf : Integrable f (stoppedSurvivingKernel a ha S hS ∘ₘ W) := f.integrable + exact (Measure.integrable_comp_iff f.continuous.measurable.aestronglyMeasurable).mp hf |>.1 + +lemma stoppedSurvivingKernel_compact_mean_integrable (a : ℝ) (ha : 1/4 < a) + (W : Measure ExactSLEGenerator.Driver) [IsProbabilityMeasure W] + (hW : IsBrownianReal (fun t (b : ExactSLEGenerator.Driver) => b.1 t) W) + (S : ExactSLEGenerator.Driver → ℝ≥0∞) (hS : IsStoppingTime rawFiltration S) + (f : C_c(UpperPlane,ℝ)) : + Integrable (fun b => ∫z, f z ∂stoppedSurvivingKernel a ha S hS b) W := by + have := stoppedSurvivingKernel_average_finiteOnCompacts a ha W hW S hS + have hf : Integrable f (stoppedSurvivingKernel a ha S hS ∘ₘ W) := f.integrable + rw [Measure.comp_eq_comp_const_apply] at hf + exact hf.integral_comp + +end ExactSLEGreen +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped Classical NNReal ENNReal + +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain SLEExactGauge.MassVersions + + +def unhitMassDensity (a q : ℝ) (t : ℝ≥0∞) (b : ExactSLEGenerator.Driver) + (z : UpperPlane) : ℝ := + Real.exp (-alpha a*Real.log 2) * + (if t < radialTime a b.1 z.1 (z.1.im*q) + then radialWeight a b.1 z.1 (z.1.im*q) else 0) + +lemma unhitMassDensity_nonneg (a : ℝ) (ha : 1/4 positivity + +lemma timeMassDensity_add_unhit (a q : ℝ) (t : ℝ≥0∞) + (b : ExactSLEGenerator.Driver) (z : UpperPlane) : + timeMassDensity a q ∞ b z.1 = timeMassDensity a q t b z.1 + + ENNReal.ofReal (unhitMassDensity a q t b z) := by + have he : 2*z.1.im*q/2=z.1.im*q := by ring + by_cases hh : radialTime a b.1 z.1 (z.1.im*q)≤t + · simp only [timeMassDensity, le_top, ite_true, ite_eq_left hh, unhitMassDensity, + ite_eq_right (not_lt.mpr hh), mul_zero, ENNReal.ofReal_zero, add_zero] + · simp only [timeMassDensity, le_top, ite_true, ite_eq_right hh, unhitMassDensity, + ite_eq_left (lt_of_not_ge hh), massDensity, ite_eq_left z.2, fullRadialDensity, he, zero_add] + +lemma unhitMassDensity_joint_measurable (a : ℝ) (ha : 1/4 + unhitMassDensity a q (S p.1) p.1 p.2) := by + have hmS : Measurable (fun p : ExactSLEGenerator.Driver × UpperPlane => S p.1) := + hS.measurable'.comp measurable_fst + have hmT := joint_radialTime_measurable a ha q hq hq1 + have hmW := joint_radialWeight_measurable a ha q hq hq1 + exact (hmW.ite (measurableSet_lt hmS hmT) measurable_const).const_mul _ + +lemma unhitMassDensity_integrable (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 unhitMassDensity a q (S b) b z) W := + (stoppedRadialTerminal_integrable a ha W hW z _ (mul_pos z.2 hq) + (mul_le_of_le_one_right z.2.le hq1) S hS).const_mul _ + +lemma unhitMassDensity_conditional (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 b.1 t) W) + (q : ℝ) (hq : 0 unhitMassDensity_nonneg a ha q hq hq1 (S b) b z)), + ← ofReal_integral_eq_lintegral_ofReal + (stoppedRemainingDensity_mean_bound a ha W hW z q hq hq1 S hS).1.restrict + (Eventually.of_forall (fun b => stoppedRemainingDensity_nonneg a q (S b) b z.1)), + unhitMassDensity_conditional a ha W hW q hq hq1 S hS z U hU] + +def unhitMassKernel (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + Kernel ExactSLEGenerator.Driver UpperPlane := + (Kernel.const ExactSLEGenerator.Driver upperArea).withDensity + (fun b z => ENNReal.ofReal (unhitMassDensity a q (S b) b z)) + +def stoppedRemainingKernel (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + Kernel ExactSLEGenerator.Driver UpperPlane := + (Kernel.const ExactSLEGenerator.Driver upperArea).withDensity + (fun b z => ENNReal.ofReal (stoppedRemainingDensity a q (S b) b z.1)) + +instance unhitMassKernel_sfinite (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + IsSFiniteKernel (unhitMassKernel a q S) := + Kernel.IsSFiniteKernel.withDensity _ (fun _ _ => ENNReal.ofReal_ne_top) + +instance stoppedRemainingKernel_sfinite (a q : ℝ) (S : ExactSLEGenerator.Driver → ℝ≥0∞) : + IsSFiniteKernel (stoppedRemainingKernel a q S) := + Kernel.IsSFiniteKernel.withDensity _ (fun _ _ => ENNReal.ofReal_ne_top) + +lemma unhitMassKernel_apply (a : ℝ) (ha : 1/4 ENNReal.ofReal (unhitMassDensity a q (S b) b z)) := + Kernel.withDensity_apply _ (unhitMassDensity_joint_measurable a ha q hq hq1 S hS).ennreal_ofReal b + +lemma stoppedRemainingKernel_apply (a : ℝ) (ha : 1/4 ENNReal.ofReal (stoppedRemainingDensity a q (S b) b z.1)) := + Kernel.withDensity_apply _ (stoppedRemainingDensity_joint_measurable a ha q hq hq1 S hS).ennreal_ofReal b + +lemma stoppedRemainingKernel_raw_measurable (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 + unhitMassDensity_lintegral_conditional a ha W hW q hq hq1 S hS z U hU) + _ = _ := (lintegral_lintegral_swap + (stoppedRemainingDensity_joint_measurable a ha q hq hq1 S hS).ennreal_ofReal.aemeasurable).symm + +lemma stoppedRemainingKernel_le_surviving (a : ℝ) (ha : 1/4 ENNReal.ofReal_le_ofReal + (stoppedRemainingDensity_le_surviving a q (S b) b z.1 z.2)) + +lemma stoppedRemainingKernel_average_le_surviving (a : ℝ) (ha : 1/4 (stoppedRemainingKernel_le_surviving a ha q hq hq1 S hS b) A) + +lemma stoppedRemainingKernel_average_finiteOnCompacts (a : ℝ) (ha : 1/4 b.1 t) W) + (q : ℝ) (hq : 0 b.1 t) W) + (q : ℝ) (hq : 0 b.1 t) W) + (q : ℝ) (hq : 0 z.1.im) K := + (Complex.continuous_im.comp continuous_subtype_val).continuousOn + obtain ⟨zlo,hzlo,hmin⟩ := hK.exists_isMinOn hne hc + obtain ⟨zhi,hzhi,hmax⟩ := hK.exists_isMaxOn hne hc + have htr : IsCompact ((Target.trace κ b) '' Icc 0 ((T:ℝ)/κ)) := + isCompact_Icc.image_of_continuousOn (hcont.mono (fun _ hx => hx.1)) + have hdis : Disjoint ((fun z : UpperPlane => z.1) '' K) + ((Target.trace κ b) '' Icc 0 ((T:ℝ)/κ)) := by + rw [Set.disjoint_left] + rintro _ ⟨z,hz,rfl⟩ htrz + exact haway z hz htrz + obtain ⟨ε,hε,hsep⟩ := Metric.exists_pos_forall_lt_edist + (hK.image continuous_subtype_val) htr.isClosed hdis + filter_upwards [level_near_trace κ hκ b hb T zlo.1.im zhi.1.im C ε + zlo.2 zhi.2 hC (by exact_mod_cast hε)] with j hj + intro z hz τ hτ v + by_contra! hangle + have hd := hj z (hmin hz) (hmax hz) hτ hangle + have hτf : τ≠∞ := ne_top_of_le_ne_top ENNReal.coe_ne_top hτ + have htT : τ.toNNReal≤T := ENNReal.coe_le_coe.mp (by + simpa only [ENNReal.coe_toNNReal hτf] using hτ) + have httr : Target.trace κ b ((τ.toNNReal:ℝ)/κ)∈ + (Target.trace κ b) '' Icc 0 ((T:ℝ)/κ) := + ⟨_,⟨by positivity,div_le_div_of_nonneg_right (show (τ.toNNReal:ℝ)≤T from htT) hκ.le⟩,rfl⟩ + have hh := hsep z.1 ⟨z,hz,rfl⟩ _ httr + rw [edist_nndist,ENNReal.coe_lt_coe] at hh + exact (not_lt_of_ge (le_of_lt (show (ε:ℝ) False.elim (hne ⟨z,hz⟩)) + +lemma angleLift_ge_cot_rpow (q C : ℝ) (hq : 0≤q) (hC : 0≤C) (v : State) + (hv : C≤|X v/Y v|) : C^q≤angleLift (sinePower (-q)) v := by + have hp := Real.sin_pos_of_pos_of_lt_pi (physicalTheta_mem v).1 (physicalTheta_mem v).2 + have habs : |X v/Y v|≤(Real.sin (physicalTheta v))⁻¹ := by + rw [←physicalTheta_cot,Real.cot_eq_cos_div_sin,abs_div,abs_of_pos hp] + simpa only [one_div] using div_le_div_of_nonneg_right + (Real.abs_cos_le_one (physicalTheta v)) hp.le + calc + C^q ≤ ((Real.sin (physicalTheta v))⁻¹)^q := Real.rpow_le_rpow hC (hv.trans habs) hq + _ = angleLift (sinePower (-q)) v := by + simp only [angleLift,sinePower,Real.rpow_neg_eq_inv_rpow] + + +lemma timeMassDensity_le_angular (κ q C : ℝ) (hq : 0≤q) (hC : 0 first | rfl | (dsimp only [v,τ]; ring) + · simp only [timeMassDensity,show ¬radialTime (Target.a κ) (driverHomeomorph b).1 z.1 + (z.1.im*Real.exp (-2*Target.a κ*(j+1)))≤(T:ℝ≥0∞) from hτ,ite_false,zero_le] + +lemma actualUpperMass_ofReal_integral (a r : ℝ) (ha : 1/4 timeMassDensity a r T b z.1) := + (timeMassDensity_measurable a ha r hr hr1 T).comp + (measurable_const.prodMk measurable_subtype_coe) + rw [ofReal_integral_eq_lintegral_ofReal f.integrable (Eventually.of_forall hf), + actualUpperMass,lintegral_withDensity_eq_lintegral_mul upperArea hm + (g := fun z => ENNReal.ofReal (f z)) f.continuous.measurable.ennreal_ofReal] + rfl + +lemma angularCompactMass_const_mul (a q : ℝ) (ha : 1/4 C*angularDensity a q j b z) z∂upperArea := by + have hm : Measurable (fun z : UpperPlane => angularDensity a q j b z) := + (angularDensity_measurable a q ha j).comp (measurable_const.prodMk measurable_id) + rw [angularCompactMass,lintegral_indicator hK,lintegral_const_mul C hm] + + + +lemma actualUpperMass_integral_le_angular (κ q C B : ℝ) (ha : 1/4 ∑ j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) T (driverHomeomorph b)) atTop (𝓝 (∫z,f z∂μ))) + (hangular : liminf (fun k => convexAngularMass (Target.a κ) q (s k) (c k) K + (driverHomeomorph b)) atTop<∞) : (∫z,f z∂μ)=0 := by + obtain ⟨B,hB⟩ := f.hasCompactSupport.bddAbove_image f.continuous.continuousOn + let D : ℝ := max 0 B + have hD : 0≤D := le_max_left _ _ + have hDf : ∀ z∈tsupport f,f z≤D := fun z hz => (hB ⟨z,hz,rfl⟩).trans (le_max_right _ _) + obtain ⟨L,hL,_⟩ := ENNReal.lt_iff_exists_nnreal_btwn.mp hangular + have hfreq := Filter.frequently_lt_of_liminf_lt (h := hL) + have hbound (C : ℝ) (hC : 0 mul_nonneg (hc k j hj) (integral_nonneg hf)), + convexAngularMass,Finset.mul_sum] + apply Finset.sum_le_sum + intro j hj + rw [ENNReal.ofReal_mul (hc k j hj)] + have hbj := actualUpperMass_integral_le_angular κ q C D + (TraceMassIntegration.a_gt_quarter hκ hκ8) hq.le hC hD b T j K hK f hf hfK hDf + (fun z hz hτ => (hN j (hk.trans (hs k j hj)) z hz hτ).le) + exact (mul_le_mul' le_rfl hbj).trans_eq (by ac_rfl) + apply le_of_tendsto_of_frequently (ENNReal.tendsto_ofReal hlim) + exact (hfreq.and_eventually hev).mono (fun k hk => hk.2.trans (mul_le_mul' le_rfl hk.1.le)) + have hdecay : Tendsto (fun C : ℝ => ENNReal.ofReal ((D*C^(-q))*(L:ℝ))) atTop (𝓝 0) := by + simpa only [mul_zero,zero_mul,ENNReal.ofReal_zero] using + ENNReal.tendsto_ofReal (((tendsto_rpow_neg_atTop hq).const_mul D).mul_const (L:ℝ)) + have hz : ENNReal.ofReal (∫z,f z∂μ)≤0 := by + apply ge_of_tendsto hdecay + filter_upwards [eventually_gt_atTop (0:ℝ)] with C hC + rw [ENNReal.ofReal_mul (mul_nonneg hD (Real.rpow_pos_of_pos hC _).le),ENNReal.ofReal_coe_nnreal] + exact hbound C hC + exact le_antisymm (ENNReal.ofReal_eq_zero.mp (le_antisymm hz bot_le)) (integral_nonneg hf) + +end SLEExactGauge.TraceLevelLocalization + +namespace SLEExactGauge.MassVersions + + + +lemma open_null_of_nonneg_compact_tests {X : Type*} [TopologicalSpace X] [T2Space X] + [LocallyCompactSpace X] [MeasurableSpace X] [BorelSpace X] + (μ : Measure X) [μ.Regular] + (U : Set X) (hU : IsOpen U) + (htest : ∀ f : C_c(X,ℝ), (∀x,0≤f x) → tsupport f⊆U → (∫x,f x∂μ)=0) + (_hfinite : IsFiniteMeasureOnCompacts μ := by infer_instance) : μ U=0 := by + rw [hU.measure_eq_iSup_isCompact] + simp only [ENNReal.iSup_eq_zero] + intro K hKU hK + obtain ⟨f,hfK,hfc,hfU,hf01⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen hK hU hKU + let g : C_c(X,ℝ) := ⟨f,hfc⟩ + have hz : (fun x => f x)=ᵐ[μ] 0 := (integral_eq_zero_iff_of_nonneg + (fun x => (hf01 x).1) (f.continuous.integrable_of_hasCompactSupport hfc)).mp + (htest g (fun x => (hf01 x).1) hfU) + rw [measure_eq_zero_iff_ae_notMem] + filter_upwards [hz] with x hx hKx + have he := hfK hKx + change f x=0 at hx + change f x=1 at he + linarith + +end SLEExactGauge.MassVersions + +namespace SLEExactGauge.TraceLevelLocalization +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen + + + +theorem actual_limit_past_trace_support (κ : ℝ) (hκ : 0<κ) (hκ8 : κ<8) + (q : ℝ) (hq : 0 convexAngularMass (Target.a κ) q (s k) (c k) (K n) + (driverHomeomorph b)) atTop<∞) + (T : ℝ≥0) (μ : Measure UpperPlane) [μ.Regular] + (hlim : ∀ f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) T (driverHomeomorph b)) atTop (𝓝 (∫z,f z∂μ))) + (_hfinite : IsFiniteMeasureOnCompacts μ := by infer_instance) : + μ {z : UpperPlane | z.1∉(Target.trace κ b) '' Icc 0 ((T:ℝ)/κ)}=0 := by + have htr : IsCompact ((Target.trace κ b) '' Icc 0 ((T:ℝ)/κ)) := + isCompact_Icc.image_of_continuousOn (hcont.mono (fun _ hx => hx.1)) + apply MassVersions.open_null_of_nonneg_compact_tests μ _ + (htr.isClosed.isOpen_compl.preimage continuous_subtype_val) + intro f hf hfU + obtain ⟨n,hn⟩ := K.exists_superset_of_isCompact f.hasCompactSupport + exact actual_limit_integral_zero_away_trace κ hκ hκ8 q hq s c hc hs b hb hcont T + (K n) (K.isCompact n).measurableSet f hf hn hfU μ (hlim f) (hangular n) + +end SLEExactGauge.TraceLevelLocalization +end +end + + + +section + +noncomputable section +open MeasureTheory Set Filter Topology +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerScaling +open ExactSLEGreen + + +def upperDilation (c : ℝ≥0) (hc : 0 ((c:ℝ):ℂ)*z + have hf : Measurable f := (continuous_const.mul continuous_id).measurable + have hpre : f ⁻¹' {z : ℂ | 0 f (e x))).map e=(μ.map e).withDensity f := by + ext A hA + rw [Measure.map_apply e.measurable hA,withDensity_apply _ (e.measurable hA), + withDensity_apply _ hA,Measure.restrict_map e.measurable hA, + lintegral_map hf e.measurable] + +end SLEExactGauge.LoewnerScaling +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter Topology CompactlySupported +open scoped NNReal ENNReal +namespace SLEExactGauge.LoewnerScaling +open ExactSLEMain ExactSLEGreen + +lemma scaling_factor (a : ℝ) {c : ℝ≥0} (hc : 0 timeMassDensity a q ((c:ℝ≥0∞)^2*t) b z.1 + have hf : Measurable f := (timeMassDensity_measurable a ha q hq hq1 _).comp + (measurable_const.prodMk measurable_subtype_coe) + have he : (fun z : UpperPlane => timeMassDensity a q t (scaleDriver c b) z.1) = + fun z => ENNReal.ofReal ((c:ℝ)^(alpha a))*f (e z) := by + funext z + exact timeMassDensity_scaled_upper a (by linarith) hc q hq hq1 t b z.1 z.2 + simp only [actualUpperMass,he] + rw [show (fun z => ENNReal.ofReal ((c:ℝ)^(alpha a))*f (e z)) = + ENNReal.ofReal ((c:ℝ)^(alpha a)) • (fun z => f (e z)) from rfl, + withDensity_smul' _ _ ENNReal.ofReal_ne_top, + Measure.map_smul _ (upperDilation c hc).measurable.aemeasurable] + have hmf : (upperArea.withDensity (fun z => f (e z))).map e = + (upperArea.map e).withDensity f := map_withDensity_comp e.toMeasurableEquiv upperArea f hf + rw [hmf,map_upperArea c hc,withDensity_smul_measure,smul_smul,scaling_factor a hc] + +lemma map_actualConvexMass_scaled (a : ℝ) (ha : 1/4 μ ((upperDilation c hc) '' A)) + (map_recoveredMass_scaled a ha hc s v hv t b) + simpa only [(upperDilation c hc).measurableEmbedding.map_apply, + Set.preimage_image_eq _ (upperDilation c hc).injective,Measure.smul_apply,smul_eq_mul] using h + +lemma recoveredMass_scaled_univ_pos_iff (a : ℝ) (ha : 1/4 b.1 t) W) + (u t : ℝ≥0) (hu : 0 W A) + apply Set.ext + intro b + change (0 hxt ⟨u,⟨hu.1,hut⟩,he⟩) + exact ⟨u,⟨(min_le_right s t).trans htu.le,hu.2.trans (le_max_left s t)⟩,he⟩ + · rcases hxt with ⟨u,hu,he⟩ + have hsu : s hxs ⟨u,⟨hu.1,hus⟩,he⟩) + exact ⟨u,⟨(min_le_left s t).trans hsu.le,hu.2.trans (le_max_right s t)⟩,he⟩ + +lemma nnreal_dist_right_le {s t u : ℝ≥0} (hu : u∈uIcc s t) : + dist u t≤dist s t := by + apply Real.dist_right_le_of_mem_uIcc + change min (s : ℝ) (t : ℝ)≤(u : ℝ) ∧ (u : ℝ) ≤ max (s : ℝ) (t : ℝ) + exact ⟨hu.1,hu.2⟩ + + + +omit [MeasurableSpace X] [MeasurableSpace Y] [BorelSpace Y] in +lemma eventually_not_mem_visited_symmDiff (ι : X → Y) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) (t : ℝ≥0) (x : X) + (hx : ι x≠γ t) : ∀ᶠ s in 𝓝 t, x∉visited ι γ s ∆ visited ι γ t := by + have hr : 0 h ⟨x,hx⟩ + rw [he,measure_empty] + + + +lemma tendsto_measure_visited_symmDiff (ν : Measure X) + (ι : X → Y) (hι : Measurable ι) (γ : ℝ≥0 → Y) (hγ : Continuous γ) + (t : ℝ≥0) (hpoint : ν (ι ⁻¹' {γ t})=0) + (K : Set X) (_hK : MeasurableSet K) (hfin : ν K≠∞) : + Tendsto (fun s => ν (K∩(visited ι γ s ∆ visited ι γ t))) (𝓝 t) (𝓝 0) := by + let μ := ν.restrict K + have : IsFiniteMeasure μ := ⟨by simpa only [μ,Measure.restrict_apply_univ] using hfin.lt_top⟩ + let F : ℝ≥0 → X → ℝ≥0∞ := fun s => (visited ι γ s ∆ visited ι γ t).indicator 1 + have hF (s : ℝ≥0) : Measurable (F s) := + measurable_const.indicator + ((measurableSet_visited ι hι γ hγ s).symmDiff (measurableSet_visited ι hι γ hγ t)) + have hbound (s : ℝ≥0) : ∀ᵐ x ∂μ, F s x≤1 := Eventually.of_forall (fun x => by + by_cases hx : x∈visited ι γ s ∆ visited ι γ t <;> simp [F,hx]) + have hzero : μ (ι ⁻¹' {γ t})=0 := by + change (ν.restrict K) (ι ⁻¹' {γ t})=0 + rw [Measure.restrict_apply ((measurableSet_singleton (γ t)).preimage hι)] + exact measure_mono_null inter_subset_left hpoint + have hlim : ∀ᵐ x ∂μ, Tendsto (fun s => F s x) (𝓝 t) (𝓝 0) := by + filter_upwards [measure_eq_zero_iff_ae_notMem.mp hzero] with x hx + have hxt : ι x≠γ t := hx + apply tendsto_const_nhds.congr' + filter_upwards [eventually_not_mem_visited_symmDiff ι γ hγ t x hxt] with s hs + simp only [F,indicator_of_notMem hs] + have ht := tendsto_lintegral_filter_of_dominated_convergence (μ := μ) (fun _ => (1 : ℝ≥0∞)) + (Eventually.of_forall hF) (Eventually.of_forall hbound) + (by simp : (∫⁻ x, (1 : ℝ≥0∞) ∂μ)≠∞) hlim + have he (s : ℝ≥0) : (∫⁻x, F s x ∂μ)=ν (K∩(visited ι γ s ∆ visited ι γ t)) := by + have hs := (measurableSet_visited ι hι γ hγ s).symmDiff (measurableSet_visited ι hι γ hγ t) + change (∫⁻x, (visited ι γ s ∆ visited ι γ t).indicator 1 x ∂(ν.restrict K))=_ + rw [lintegral_indicator_one hs,Measure.restrict_apply hs,inter_comm] + simpa only [he,lintegral_zero] using ht + + +lemma continuous_integral_visited (ν : Measure X) [NullSingletonClass ν] + (ι : X → Y) (hι : Measurable ι) (hinj : Function.Injective ι) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) (f : X → ℝ) (hf : Integrable f ν) : + Continuous (fun t => ∫x in visited ι γ t, f x ∂ν) := by + rw [continuous_iff_continuousAt] + intro t + simp_rw [← integral_indicator (measurableSet_visited ι hι γ hγ _)] + apply continuousAt_of_dominated (bound := fun x => ‖f x‖) + · exact Eventually.of_forall (fun s => hf.aestronglyMeasurable.indicator + (measurableSet_visited ι hι γ hγ s)) + · exact Eventually.of_forall (fun s => Eventually.of_forall (fun x => norm_indicator_le_norm_self _ _)) + · exact hf.norm + · filter_upwards [measure_eq_zero_iff_ae_notMem.mp + (preimage_singleton_null_of_injective ν ι hinj (γ t))] with x hx + have hxt : ι x≠γ t := hx + apply tendsto_const_nhds.congr' + filter_upwards [eventually_visited_iff ι γ hγ t x hxt] with s hs + by_cases ht : x∈visited ι γ t + · simp only [indicator_of_mem ht,indicator_of_mem (hs.mpr ht)] + · simp only [indicator_of_notMem ht,indicator_of_notMem (mt hs.mp ht)] + + + +def firstVisit (ι : X → Y) (γ : ℝ≥0 → Y) (x : X) : ℝ≥0∞ := + if _h : ({u : ℝ≥0 | γ u=ι x}).Nonempty then + (sInf {u : ℝ≥0 | γ u=ι x} : ℝ≥0) else ∞ + +omit [MeasurableSpace X] [MeasurableSpace Y] [BorelSpace Y] in +lemma firstVisit_le_iff (ι : X → Y) (γ : ℝ≥0 → Y) (hγ : Continuous γ) + (x : X) (t : ℝ≥0) : firstVisit ι γ x≤(t : ℝ≥0∞) ↔ x∈visited ι γ t := by + classical + by_cases h : ({u : ℝ≥0 | γ u=ι x}).Nonempty + · have hclosed : IsClosed {u : ℝ≥0 | γ u=ι x} := isClosed_eq hγ continuous_const + have hmem := hclosed.csInf_mem h ⟨0,fun _ _ => bot_le⟩ + simp only [firstVisit,dite_eq_left h,ENNReal.coe_le_coe] + constructor + · intro ht + exact ⟨_,⟨bot_le,ht⟩,hmem⟩ + · rintro ⟨u,hu,he⟩ + exact (csInf_le (s := {u : ℝ≥0 | γ u=ι x}) ⟨0,fun _ _ => bot_le⟩ he).trans hu.2 + · simp only [firstVisit,dite_eq_right h,top_le_iff,ENNReal.coe_ne_top,false_iff] + rintro ⟨u,hu,he⟩ + exact h ⟨u,he⟩ + +omit [MeasurableSpace X] [MetricSpace Y] [MeasurableSpace Y] [BorelSpace Y] in +lemma firstVisit_lt_top_iff (ι : X → Y) (γ : ℝ≥0 → Y) (x : X) : + firstVisit ι γ x<∞ ↔ ι x∈range γ := by + classical + by_cases h : ({u : ℝ≥0 | γ u=ι x}).Nonempty + · simp only [firstVisit,dite_eq_left h,ENNReal.coe_lt_top,true_iff] + exact h + · simp only [firstVisit,dite_eq_right h,lt_self_iff_false,false_iff] + exact h + +lemma measurable_firstVisit (ι : X → Y) (hι : Measurable ι) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) : Measurable (firstVisit ι γ) := by + apply measurable_of_Iic + intro t + induction t using ENNReal.recTopCoe with + | top => simp only [Iic_top,preimage_univ,MeasurableSet.univ] + | coe t => + have he : (firstVisit ι γ) ⁻¹' Iic (t : ℝ≥0∞)=visited ι γ t := by + ext x + exact firstVisit_le_iff ι γ hγ x t + rw [he] + exact measurableSet_visited ι hι γ hγ t + + + +omit [MeasurableSpace X] [MetricSpace Y] [MeasurableSpace Y] [BorelSpace Y] in +lemma iUnion_visited_nat (ι : X → Y) (γ : ℝ≥0 → Y) : + (⋃ n : ℕ, visited ι γ n)=ι ⁻¹' range γ := by + ext x + constructor + · rintro ⟨_,⟨n,rfl⟩,u,hu,he⟩ + exact ⟨u,he⟩ + · rintro ⟨u,he⟩ + obtain ⟨n,hn⟩ := exists_nat_ge u + exact mem_iUnion.mpr ⟨n,u,⟨bot_le,hn⟩,he⟩ + + + +lemma restrict_sub_restrict (ν : Measure X) (S T : Set X) (hS : MeasurableSet S) : + ν.restrict T-ν.restrict S=ν.restrict (T\S) := by + have hp : (ν.restrict T-ν.restrict S).restrict S=0 := by + rw [Measure.restrict_sub_eq_restrict_sub_restrict hS, + Measure.restrict_restrict hS,Measure.restrict_restrict hS,inter_self] + exact Measure.sub_eq_zero_of_le (Measure.restrict_mono inter_subset_left le_rfl) + have hf : (ν.restrict T-ν.restrict S).restrict Sᶜ=ν.restrict (T\S) := by + rw [Measure.restrict_sub_eq_restrict_sub_restrict hS.compl, + Measure.restrict_restrict hS.compl,Measure.restrict_restrict hS.compl, + compl_inter_self,Measure.restrict_empty,Measure.sub_zero] + rw [sdiff_eq,inter_comm] + have hi := Measure.restrict_add_restrict_compl (μ := ν.restrict T-ν.restrict S) hS + rw [hp,hf,zero_add] at hi + exact hi.symm + +omit [MeasurableSpace X] [MetricSpace Y] [MeasurableSpace Y] [BorelSpace Y] in +lemma visited_diff_subset (ι : X → Y) (γ : ℝ≥0 → Y) {s t : ℝ≥0} (_hst : s≤t) : + visited ι γ t\visited ι γ s⊆ι ⁻¹' (γ '' Icc s t) := by + rintro x ⟨⟨u,hu,he⟩,hn⟩ + have hsu : s hn ⟨u,⟨hu.1,hus⟩,he⟩) + exact ⟨u,⟨hsu.le,hu.2⟩,he⟩ + + + +lemma increment_carried_by_segment (ν : Measure X) (ι : X → Y) (hι : Measurable ι) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) {s t : ℝ≥0} (hst : s≤t) : + (ν.restrict (visited ι γ t)-ν.restrict (visited ι γ s)) + (ι ⁻¹' (γ '' Icc s t))ᶜ=0 := by + rw [restrict_sub_restrict ν _ _ (measurableSet_visited ι hι γ hγ s), + Measure.restrict_apply (((isCompact_Icc.image hγ).isClosed.measurableSet).preimage hι).compl] + have he : (ι ⁻¹' (γ '' Icc s t))ᶜ∩(visited ι γ t\visited ι γ s)=∅ := by + apply eq_empty_iff_forall_notMem.mpr + rintro x ⟨hn,hx⟩ + exact hn (visited_diff_subset ι γ hst hx) + rw [he,measure_empty] + +end SLEExactGauge.TraceRestriction +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace SLEExactGauge.DenseTimeSqueeze + + + +lemma tendsto_of_dense {I : Type*} {l : Filter I} + (f : I → ℝ≥0 → ℝ) (F : ℝ≥0 → ℝ) (D : Set ℝ≥0) + (hD : Dense D) (h0 : 0 ∈ D) (hmono : ∀ i, Monotone (f i)) + (hF : Continuous F) + (hc : ∀ q ∈ D, Tendsto (fun i => f i q) l (𝓝 (F q))) + (t : ℝ≥0) : Tendsto (fun i => f i t) l (𝓝 (F t)) := by + by_cases ht : t = 0 + · subst t + exact hc 0 h0 + rw [tendsto_order] + constructor + · intro a ha + have he : ∀ᶠ q in 𝓝 t, a < F q := hF.continuousAt.tendsto.eventually (lt_mem_nhds ha) + obtain ⟨u, hut, hu⟩ := exists_Ioc_subset_of_mem_nhds he (⟨0, bot_lt_iff_ne_bot.mpr ht⟩) + obtain ⟨q, hq, huq, hqt⟩ := hD.exists_between hut + have haq : a < F q := hu ⟨huq, hqt.le⟩ + filter_upwards [(hc q hq).eventually (lt_mem_nhds haq)] with i hi + exact hi.trans_le (hmono i hqt.le) + · intro a ha + have he : ∀ᶠ q in 𝓝 t, F q < a := hF.continuousAt.tendsto.eventually (gt_mem_nhds ha) + obtain ⟨u, htu, hu⟩ := exists_Ico_subset_of_mem_nhds he (exists_gt t) + obtain ⟨q, hq, htq, hqu⟩ := hD.exists_between htu + have hqa : F q < a := hu ⟨htq.le, hqu⟩ + filter_upwards [(hc q hq).eventually (gt_mem_nhds hqa)] with i hi + exact (hmono i htq.le).trans_lt hi + +end SLEExactGauge.DenseTimeSqueeze + +namespace SLEExactGauge.DenseTimeSqueeze + +variable {X : Type*} [TopologicalSpace X] [T2Space X] + [MeasurableSpace X] [BorelSpace X] + + + +omit [T2Space X] in +lemma tendsto_integral_of_dense {I : Type*} {l : Filter I} + (μ : I → ℝ≥0 → Measure X) (ν : ℝ≥0 → Measure X) + [∀ i t, IsFiniteMeasureOnCompacts (μ i t)] + [∀ t, IsFiniteMeasureOnCompacts (ν t)] + (D : Set ℝ≥0) (hD : Dense D) (h0 : 0 ∈ D) + (hmono : ∀ i, Monotone (μ i)) + (hν : ∀ f : C_c(X, ℝ), Continuous (fun t => ∫ x, f x ∂ν t)) + (hc : ∀ q ∈ D, ∀ f : C_c(X, ℝ), + Tendsto (fun i => ∫ x, f x ∂μ i q) l (𝓝 (∫ x, f x ∂ν q))) + (t : ℝ≥0) (f : C_c(X, ℝ)) : + Tendsto (fun i => ∫ x, f x ∂μ i t) l (𝓝 (∫ x, f x ∂ν t)) := by + have hp (g : C_c(X, ℝ)) (hg : 0 ≤ g) : + Tendsto (fun i => ∫ x, g x ∂μ i t) l (𝓝 (∫ x, g x ∂ν t)) := by + apply tendsto_of_dense (fun i q => ∫ x, g x ∂μ i q) + (fun q => ∫ x, g x ∂ν q) D hD h0 _ _ _ t + · intro i s t hst + exact integral_mono_measure (hmono i hst) (Eventually.of_forall hg) g.integrable + · exact hν g + · exact fun q hq => hc q hq g + have hplus := hp (f ⊔ 0) le_sup_right + have hminus := hp ((-f) ⊔ 0) le_sup_right + have he : ∀ x, f x = (f ⊔ 0) x - ((-f) ⊔ 0) x := by + intro x + change f x = max (f x) 0 - max (-f x) 0 + rcases le_total (f x) 0 with h | h + · rw [max_eq_right h, max_eq_left (neg_nonneg.mpr h)] + ring + · rw [max_eq_left h, max_eq_right (neg_nonpos.mpr h)] + ring + have hi (ρ : Measure X) [IsFiniteMeasureOnCompacts ρ] : + (∫ x, f x ∂ρ) = (∫ x, (f ⊔ 0) x ∂ρ) - ∫ x, ((-f) ⊔ 0) x ∂ρ := by + simp_rw [he] + exact integral_sub (f ⊔ 0).integrable ((-f) ⊔ 0).integrable + simpa only [hi] using hplus.sub hminus + +end SLEExactGauge.DenseTimeSqueeze +end +end + + + +section + + +noncomputable section +open MeasureTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal + +namespace SLEExactGauge.FirstVisitReconstruction +open TraceRestriction DenseTimeSqueeze MassVersions + +variable {X Y : Type*} [TopologicalSpace X] [T2Space X] + [LocallyCompactSpace X] [SecondCountableTopology X] + [MeasurableSpace X] [BorelSpace X] + [MetricSpace Y] [MeasurableSpace Y] [BorelSpace Y] + +omit [T2Space X] [LocallyCompactSpace X] [SecondCountableTopology X] in +lemma tendsto_all_times (μ : ℕ → ℝ≥0 → Measure X) + [∀ n t, IsFiniteMeasureOnCompacts (μ n t)] + (ν : Measure X) [IsFiniteMeasureOnCompacts ν] [NullSingletonClass ν] + (ι : X → Y) (hι : Measurable ι) (hinj : Function.Injective ι) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) + (D : Set ℝ≥0) (hD : Dense D) (h0 : 0 ∈ D) + (hmono : ∀ n, Monotone (μ n)) + (hc : ∀ q ∈ D, ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n q) + atTop (𝓝 (∫ x in visited ι γ q, f x ∂ν))) : + ∀ t : ℝ≥0, ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n t) + atTop (𝓝 (∫ x in visited ι γ t, f x ∂ν)) := by + apply tendsto_integral_of_dense μ (fun t => ν.restrict (visited ι γ t)) D hD h0 hmono + · intro f + exact continuous_integral_visited ν ι hι hinj γ hγ f f.integrable + · exact hc + + + +lemma radonLimit_all_times (μ : ℕ → ℝ≥0 → Measure X) + [∀ n t, IsFiniteMeasureOnCompacts (μ n t)] + (ν : Measure X) [IsFiniteMeasureOnCompacts ν] [NullSingletonClass ν] + (ι : X → Y) (hι : Measurable ι) (hinj : Function.Injective ι) + (γ : ℝ≥0 → Y) (hγ : Continuous γ) + (D : Set ℝ≥0) (hD : Dense D) (h0 : 0 ∈ D) + (hmono : ∀ n, Monotone (μ n)) + (hc : ∀ q ∈ D, ∀ f : C_c(X, ℝ), Tendsto (fun n => ∫ x, f x ∂μ n q) + atTop (𝓝 (∫ x in visited ι γ q, f x ∂ν))) : + ∀ t : ℝ≥0, + radonLimit (fun n => CompactlySupportedContinuousMap.integralPositiveLinearMap (μ n t)) = + ν.restrict (visited ι γ t) := by + intro t + apply radonLimit_eq + exact tendsto_all_times μ ν ι hι hinj γ hγ D hD h0 hmono hc t + +end SLEExactGauge.FirstVisitReconstruction +end +end + + + +section + + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set Topology CompactlySupported +open scoped NNReal ENNReal symmDiff +namespace ExactSLEGreen +open ExactSLEGenerator ExactSLEMain + +lemma actualConvexMass_mono_time (a : ℝ) (s : Finset ℕ) (c : ℕ→ℝ) + (b : ExactSLEGenerator.Driver) : Monotone (fun t => actualConvexMass a s c t b) := by + intro u v huv + apply Measure.le_iff'.mpr + intro A + simp only [actualConvexMass,Measure.finsetSum_apply,Measure.smul_apply,smul_eq_mul] + exact Finset.sum_le_sum (fun j _ => mul_le_mul' le_rfl + (Measure.le_iff'.mp (actualUpperMass_mono_time a _ b huv) A)) + +end ExactSLEGreen + +namespace SLEExactGauge.TraceMassContinuity +open FlowIdentification ExactSLEMain ExactSLEGenerator ExactSLEGreen +open TraceRestriction MassVersions + + +def internalTrace (κ : ℝ) (b : TDriver) (u : ℝ≥0) : ℂ := + Target.trace κ b ((u:ℝ)/κ) + +lemma continuous_internalTrace {κ : ℝ} (hκ : 0<κ) (b : TDriver) + (hb : ContinuousOn (Target.trace κ b) (Ici 0)) : Continuous (internalTrace κ b) := + hb.comp_continuous (continuous_subtype_val.div_const κ) (fun u => div_nonneg u.2 hκ.le) + +lemma internalTrace_image {κ : ℝ} (hκ : 0<κ) (b : TDriver) (u v : ℝ≥0) : + internalTrace κ b '' Icc u v = Target.trace κ b '' Icc ((u:ℝ)/κ) ((v:ℝ)/κ) := by + ext z + constructor + · rintro ⟨t,ht,rfl⟩ + exact ⟨_,⟨div_le_div_of_nonneg_right ht.1 hκ.le, + div_le_div_of_nonneg_right ht.2 hκ.le⟩,rfl⟩ + · rintro ⟨t,ht,rfl⟩ + have ht0 : 0≤t := (div_nonneg u.2 hκ.le).trans ht.1 + refine ⟨⟨κ*t,mul_nonneg hκ.le ht0⟩,⟨?_,?_⟩,?_⟩ + · change (u:ℝ)≤κ*t + nlinarith [(div_le_iff₀ hκ).mp ht.1] + · change κ*t≤v + nlinarith [(le_div_iff₀ hκ).mp ht.2] + · change Target.trace κ b ((κ*t)/κ)=Target.trace κ b t + rw [mul_div_cancel_left₀ _ hκ.ne'] + +lemma visited_internalTrace {κ : ℝ} (hκ : 0<κ) (b : TDriver) (t : ℝ≥0) : + visited (fun z : UpperPlane => z.1) (internalTrace κ b) t = + {z : UpperPlane | z.1∈Target.trace κ b '' Icc 0 ((t:ℝ)/κ)} := by + simp only [visited,internalTrace_image hκ,NNReal.coe_zero,zero_div] + rfl + + +lemma actualMass_tendsto_all_times (κ : ℝ) (hκ : 0<κ) (ha : 1/4 ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) q (driverHomeomorph b)) + atTop (𝓝 (∫z in visited (fun z : UpperPlane => z.1) (internalTrace κ b) q,f z∂ν))) : + ∀t : ℝ≥0, ∀ f : C_c(UpperPlane,ℝ), Tendsto + (fun k => ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) t (driverHomeomorph b)) + atTop (𝓝 (∫z in visited (fun z : UpperPlane => z.1) (internalTrace κ b) t,f z∂ν)) := by + let M (k : ℕ) (t : ℝ≥0) := + actualConvexMass (Target.a κ) (s k) (c k) t (driverHomeomorph b) + let (k : ℕ) (t : ℝ≥0) : IsFiniteMeasureOnCompacts (M k t) := + actualConvexMass_finiteOnCompacts (Target.a κ) ha (s k) (c k) t (driverHomeomorph b) + have hv := FirstVisitReconstruction.tendsto_all_times M ν + (fun z : UpperPlane => z.1) measurable_subtype_coe Subtype.val_injective + (internalTrace κ b) (continuous_internalTrace hκ b hcont) D hD h0 + (fun k u v huv => actualConvexMass_mono_time (Target.a κ) (s k) (c k) + (driverHomeomorph b) (ENNReal.coe_le_coe.mpr huv)) + (by + intro q hq f + simpa only [M,actualConvexMass_integral (Target.a κ) ha _ _ (hc _)] using hconv q hq f) + intro t f + simpa only [M,actualConvexMass_integral (Target.a κ) ha _ _ (hc _)] using hv t f + + + +lemma recoveredMass_all_times (κ : ℝ) (hκ : 0<κ) (ha : 1/4 ∑j∈s k,c k j*∫z,f z∂actualUpperMass (Target.a κ) + (Real.exp (-2*(Target.a κ)*(j+1))) q (driverHomeomorph b)) + atTop (𝓝 (∫z in visited (fun z : UpperPlane => z.1) (internalTrace κ b) q,f z∂ν))) : + ∀t : ℝ≥0, + recoveredMass (Target.a κ) ha s c hc t (driverHomeomorph b)= + ν.restrict (visited (fun z : UpperPlane => z.1) (internalTrace κ b) t) := by + intro t + apply radonLimit_eq + intro f + simpa only [actualMassFunctionals_apply] using + actualMass_tendsto_all_times κ hκ ha s c hc b hcont ν D hD h0 hconv t f + + + +lemma local_variation_visited (ν : Measure UpperPlane) [NullSingletonClass ν] + {κ : ℝ} (hκ : 0<κ) (b : TDriver) + (hcont : ContinuousOn (Target.trace κ b) (Ici 0)) + (K : Set UpperPlane) (hK : MeasurableSet K) (hfin : ν K≠∞) (t : ℝ≥0) : + Tendsto (fun u : ℝ≥0 => + ((ν.restrict (visited (fun z : UpperPlane => z.1) (internalTrace κ b) u)- + ν.restrict (visited (fun z : UpperPlane => z.1) (internalTrace κ b) t))+ + (ν.restrict (visited (fun z : UpperPlane => z.1) (internalTrace κ b) t)- + ν.restrict (visited (fun z : UpperPlane => z.1) (internalTrace κ b) u))) K) + (𝓝 t) (𝓝 0) := by + let V := visited (fun z : UpperPlane => z.1) (internalTrace κ b) + have hV (u : ℝ≥0) : MeasurableSet (V u) := + measurableSet_visited _ measurable_subtype_coe _ (continuous_internalTrace hκ b hcont) u + have he (u : ℝ≥0) : + ((ν.restrict (V u)-ν.restrict (V t))+(ν.restrict (V t)-ν.restrict (V u))) K= + ν (K∩(V u ∆ V t)) := by + rw [restrict_sub_restrict ν _ _ (hV t),restrict_sub_restrict ν _ _ (hV u), + ←Measure.restrict_union (disjoint_sdiff_sdiff (x := V u) (y := V t)) ((hV t).diff (hV u)), + Measure.restrict_apply hK] + rfl + change Tendsto (fun u : ℝ≥0 => + ((ν.restrict (V u)-ν.restrict (V t))+(ν.restrict (V t)-ν.restrict (V u))) K) (𝓝 t) (𝓝 0) + simp_rw [he] + exact tendsto_measure_visited_symmDiff ν _ measurable_subtype_coe _ + (continuous_internalTrace hκ b hcont) t + (preimage_singleton_null_of_injective ν _ Subtype.val_injective _) K hK hfin + +end SLEExactGauge.TraceMassContinuity +end +end + +end OAI diff --git a/lean/OAI/Probability/SLEGauge/TwoPointGrowth.lean b/lean/OAI/Probability/SLEGauge/TwoPointGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a741c020c16d7d1762266e3887d99b61aa35d0f --- /dev/null +++ b/lean/OAI/Probability/SLEGauge/TwoPointGrowth.lean @@ -0,0 +1,454 @@ +import Mathlib +import OAI.Probability.SLE.MomentGauge +import OAI.Probability.SLEGauge.StateBounds + +namespace OAI + +/-! Hausdorff gauges, Loewner evolution and trace measures. -/ + +section +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +open scoped Topology +open Set +open MeasureTheory Filter +open scoped NNReal Topology +open MeasureTheory Filter Set Metric Function ODE +open MeasureTheory ProbabilityTheory Filter Set +open Filter +open Filter Set +namespace ExactSLEMain +open Set +theorem loewner_two_point_growth {A : ℝ} (hA : 0 < A) + {b : ℝ≥0 → ℝ} (hb : Continuous b) {T : ℝ≥0} {z w : ℂ} + (hz : alive A b T z) (hw : alive A b T w) (hzw : z ≠ w) : + ‖z-w‖ ≤ (2 * (loewnerMap A b T z).im / ‖deriv (loewnerMap A b T) z‖) * + (‖loewnerMap A b T z-loewnerMap A b T w‖ / + ‖loewnerMap A b T z-star (loewnerMap A b T w)‖) / + (1-‖loewnerMap A b T z-loewnerMap A b T w‖ / + ‖loewnerMap A b T z-star (loewnerMap A b T w)‖)^2 := by + obtain ⟨f,hf⟩ := hz + obtain ⟨g,hg⟩ := hw + have hz : alive A b T z := ⟨f,hf⟩ + have hw : alive A b T w := ⟨g,hg⟩ + have hyz : 0 < z.im := by simpa only [hf.1] using (hf.2 0 (by simp)).1 + have hyw : 0 < w.im := by simpa only [hg.1] using (hg.2 0 (by simp)).1 + let V : ℝ → ℝ := fun u => (f u).im/Complex.normSq (f u-(b u.toNNReal : ℂ)) + let W : ℝ → ℝ := fun u => (g u).im/Complex.normSq (g u-(b u.toNNReal : ℂ)) + have hVc : ContinuousOn V (Icc (0 : ℝ) T) := + (Complex.continuous_im.comp_continuousOn (odeUntil_continuousOn hf)).div + (Complex.continuous_normSq.comp_continuousOn (odeUntil_center_continuousOn hb hf)) + (fun u hu => (Complex.normSq_pos.mpr (odeUntil_center_ne_zero hf hu)).ne') + let v : ℝ → ℝ := fun u => V (projIcc (0 : ℝ) T T.coe_nonneg u) + have hv : Continuous v := hVc.domRestrict.comp continuous_projIcc + have hve (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : v u = V u := by + dsimp [v]; rw [projIcc_of_mem _ hu] + let R : ℝ → ℝ := fun u => 2*z.im*Real.exp (-2*A*(∫ s in (0 : ℝ)..u, v s^2)) + let r : ℝ → ℝ := fun u => ‖f u-g u‖/‖f u-star (g u)‖ + have hR (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt R (-2*A*(V u)^2*R u) (Icc (0 : ℝ) T) u := by + have hi := intervalIntegral.integral_hasDerivAt_right ((hv.pow 2).intervalIntegrable 0 u) + (hv.pow 2).aestronglyMeasurable.stronglyMeasurableAtFilter (hv.pow 2).continuousAt + have hh := (((hi.const_mul (-2*A)).exp).const_mul (2*z.im)).hasDerivWithinAt (s := Icc (0 : ℝ) T) + convert hh using 1 + try rfl + dsimp only [R,Pi.pow_apply] + rw [hve u hu] + ring + have hr (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt r (2*A*V u*W u*r u) (Icc (0 : ℝ) T) u := + odeUntil_pair_ratio_deriv hb hf hg hzw hu + have hl (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : r u < 1 := by + have hlt := upper_pair_norm_lt (hf.2 u hu).1 (hg.2 u hu).1 + exact (div_lt_one ((norm_nonneg _).trans_lt hlt)).mpr hlt + have hH (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + V u*(1-r u) ≤ W u*(1+r u) := by + have hh := upper_velocity_harnack + (z := f u-(b u.toNNReal : ℂ)) (w := g u-(b u.toNNReal : ℂ)) + (by simpa using (hf.2 u hu).1) (by simpa using (hg.2 u hu).1) + have he : f u-(b u.toNNReal : ℂ)-(g u-(b u.toNNReal : ℂ)) = f u-g u := by ring + have he' : f u-(b u.toNNReal : ℂ)-star (g u-(b u.toNNReal : ℂ)) = f u-star (g u) := by simp + simp only [he,he',Complex.sub_im,Complex.ofReal_im,sub_zero] at hh + have hD := (norm_nonneg _).trans_lt (upper_pair_norm_lt (hf.2 u hu).1 (hg.2 u hu).1) + have hdiv := (div_le_div_iff_of_pos_right hD).mpr hh + change V u*(‖f u-star (g u)‖-‖f u-g u‖)/‖f u-star (g u)‖ ≤ + W u*(‖f u-star (g u)‖+‖f u-g u‖)/‖f u-star (g u)‖ at hdiv + calc + V u*(1-r u) = V u*(‖f u-star (g u)‖-‖f u-g u‖)/‖f u-star (g u)‖ := by + change _*(1-‖f u-g u‖/‖f u-star (g u)‖) = _ + simp only [mul_sub,sub_div,mul_div_assoc,div_self hD.ne',mul_one] + _ ≤ _ := hdiv + _ = W u*(1+r u) := by + change _ = W u*(1+‖f u-g u‖/‖f u-star (g u)‖) + simp only [mul_add,add_div,mul_div_assoc,div_self hD.ne',mul_one] + let K : ℝ → ℝ := fun u => R u*r u/(1-r u)^2 + let K' : ℝ → ℝ := fun u => 2*A*R u*r u*V u/(1-r u)^3 * + (W u*(1+r u)-V u*(1-r u)) + have hK (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : + HasDerivWithinAt K (K' u) (Icc (0 : ℝ) T) u := + growth_factor_deriv (hR u hu) (hr u hu) (ne_of_lt (hl u hu)) + have hpos (u : ℝ) (hu : u ∈ Icc (0 : ℝ) T) : 0 ≤ K' u := by + have hRp : 0 < R u := by dsimp [R]; positivity + have hrp : 0 ≤ r u := div_nonneg (norm_nonneg _) (norm_nonneg _) + have hVp : 0 < V u := div_pos (hf.2 u hu).1 + (Complex.normSq_pos.mpr (odeUntil_center_ne_zero hf hu)) + have hlp : 0 < 1-r u := sub_pos.mpr (hl u hu) + have hHp : 0 ≤ W u*(1+r u)-V u*(1-r u) := sub_nonneg.mpr (hH u hu) + dsimp [K']; positivity + have hmono : MonotoneOn K (Icc (0 : ℝ) T) := + monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) (HasDerivWithinAt.continuousOn hK) + (fun u hu => (hK u (interior_subset hu)).mono interior_subset) + (fun u hu => hpos u (interior_subset hu)) + have hstart : ‖z-w‖ ≤ K 0 := by + simpa [K,R,r,hf.1,hg.1] using upper_initial_growth hyz hyw + have hstop := hstart.trans (hmono (by simp) (by simp) T.coe_nonneg) + have heR : R T = 2*(loewnerMap A b T z).im/‖deriv (loewnerMap A b T) z‖ := by + have hi : (∫ u in (0 : ℝ)..(T : ℝ), v u^2) = ∫ u in (0 : ℝ)..(T : ℝ), + ((loewnerMap A b u.toNNReal z-(b u.toNNReal : ℂ)).im/ + Complex.normSq (loewnerMap A b u.toNNReal z-(b u.toNNReal : ℂ)))^2 := by + apply intervalIntegral.integral_congr + intro u hu + have hu' : u ∈ Icc (0 : ℝ) T := by simpa only [uIcc_of_le T.coe_nonneg] using hu + dsimp only + rw [hve u hu',loewnerMap_eq_solution_time hf hu'] + simp [V] + dsimp only [R] + rw [hi] + have hh := loewner_radius_ratio hb hz + rw [show 2*(loewnerMap A b T z).im/‖deriv (loewnerMap A b T) z‖ = + 2*((loewnerMap A b T z).im/‖deriv (loewnerMap A b T) z‖) by ring,hh] + ring + dsimp only [K,r] at hstop + rw [heR,← loewnerMap_eq hf,← loewnerMap_eq hg] at hstop + exact hstop + +end ExactSLEMain +open MeasureTheory Set +namespace ExactSLEMain + +lemma interaction_integral_strong {a c S T : ℝ} + (ha : 0 < a) (hc : 0 ≤ c) (hac : 2*c < a) (hST : S ≤ T) + {L s V W : ℝ → ℝ} + (hV : ContinuousOn V (Icc S T)) (hW : ContinuousOn W (Icc S T)) + (hL : ∀ t ∈ Icc S T, HasDerivWithinAt L (-2*a*V t*W t) (Icc S T) t) + (hs : ∀ t ∈ Icc S T, HasDerivWithinAt s ((V t)^2+(W t)^2) (Icc S T) t) + (hs0 : ∀ t ∈ Icc S T, 0 ≤ s t) + (hL0 : ∀ t ∈ Icc S T, 0 ≤ L t) + (hdecay : ∀ t ∈ Icc S T, L t ≤ Real.exp (-a*s t/2)) : + (∫ t in S..T, Real.exp (c*s t)*V t*W t) ≤ 1/(2*(a-2*c)) := by + let k := a/2-c + have hk : 0 < k := by dsimp [k]; linarith + have hsc := HasDerivWithinAt.continuousOn hs + let q : ℝ → ℝ := fun t => Real.exp (c*s t)*V t*W t + have hq : ContinuousOn q (Icc S T) := + ((Real.continuous_exp.comp_continuousOn (hsc.const_mul c)).mul hV).mul hW + let q₀ : ℝ → ℝ := fun t => q (projIcc S T hST t) + have hq₀ : Continuous q₀ := hq.domRestrict.comp continuous_projIcc + have hqe (t : ℝ) (ht : t ∈ Icc S T) : q₀ t = q t := by + dsimp [q₀]; rw [projIcc_of_mem _ ht] + let F : ℝ → ℝ := fun t => Real.exp (c*s t)*L t + c/k*Real.exp (-k*s t) + + 2*a*(∫ v in S..t, q₀ v) + let F' : ℝ → ℝ := fun t => c*((V t)^2+(W t)^2)* + (Real.exp (c*s t)*L t-Real.exp (-k*s t)) + have hd (t : ℝ) (ht : t ∈ Icc S T) : + HasDerivWithinAt F (F' t) (Icc S T) t := by + have hi := intervalIntegral.integral_hasDerivAt_right (hq₀.intervalIntegrable S t) + hq₀.aestronglyMeasurable.stronglyMeasurableAtFilter hq₀.continuousAt + have hh := ((((hs t ht).const_mul c).exp.mul (hL t ht)).add + ((((hs t ht).const_mul (-k)).exp).const_mul (c/k))).add + (hi.const_mul (2*a)).hasDerivWithinAt + convert hh using 1 + try rfl + dsimp only [F',q] + rw [hqe t ht] + dsimp only [q] + field_simp + ring + have hbound (t : ℝ) (ht : t ∈ Icc S T) : + Real.exp (c*s t)*L t ≤ Real.exp (-k*s t) := by + calc + _ ≤ Real.exp (c*s t)*Real.exp (-a*s t/2) := + mul_le_mul_of_nonneg_left (hdecay t ht) (Real.exp_pos _).le + _ = Real.exp (-k*s t) := by rw [←Real.exp_add]; congr 1; dsimp [k]; ring + have hn (t : ℝ) (ht : t ∈ Icc S T) : F' t ≤ 0 := by + exact mul_nonpos_of_nonneg_of_nonpos (mul_nonneg hc (add_nonneg (sq_nonneg _) (sq_nonneg _))) + (sub_nonpos.mpr (hbound t ht)) + have hanti : AntitoneOn F (Icc S T) := + antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc _ _) (HasDerivWithinAt.continuousOn hd) + (fun t ht => (hd t (interior_subset ht)).mono interior_subset) + (fun t ht => hn t (interior_subset ht)) + have htS : S ∈ Icc S T := ⟨le_rfl,hST⟩ + have htT : T ∈ Icc S T := ⟨hST,le_rfl⟩ + have hS : F S ≤ 1+c/k := by + have hex : Real.exp (-k*s S) ≤ 1 := + Real.exp_le_one_iff.mpr (mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hk.le) (hs0 S htS)) + have hb := hbound S htS + have hc' := mul_le_mul_of_nonneg_left hex (div_nonneg hc hk.le) + dsimp only [F] + simp only [intervalIntegral.integral_same,mul_zero,add_zero] + linarith + have hT : 2*a*(∫ v in S..T, q₀ v) ≤ F T := by + have h1 := mul_nonneg (Real.exp_pos (c*s T)).le (hL0 T htT) + have h2 := mul_nonneg (div_nonneg hc hk.le) (Real.exp_pos (-k*s T)).le + dsimp only [F]; linarith + have hall := hT.trans ((hanti htS htT hST).trans hS) + have hie : (∫ v in S..T, q₀ v) = ∫ v in S..T, Real.exp (c*s v)*V v*W v := by + apply intervalIntegral.integral_congr + intro t ht + exact hqe t (by simpa only [uIcc_of_le hST] using ht) + rw [hie] at hall + have hdiv : (∫ v in S..T, Real.exp (c*s v)*V v*W v) ≤ (1+c/k)/(2*a) := + (le_div_iff₀ (show 0 < 2*a by positivity)).mpr (by convert hall using 1; ring) + have he : (1+c/k)/(2*a) = 1/(2*(a-2*c)) := by + have hh : a-2*c = 2*k := by dsimp [k]; ring + rw [hh] + field_simp + dsimp [k] + ring + rwa [he] at hdiv + +lemma interaction_constant_comparison {a c : ℝ} (ha : 0 < a) (hc : 0 ≤ c) + (hac : 2*c < a) : + 1/(2*(a-2*c)) ≤ Real.exp (2*c)/(2*a*(1-Real.exp (2*c-a))) := by + have hδ : 0 < a-2*c := sub_pos.mpr hac + have he : 0 < 1-Real.exp (2*c-a) := sub_pos.mpr + (Real.exp_lt_one_iff.mpr (sub_neg.mpr hac)) + have hp := Real.exp_pos (2*c-a) + have h1 := Real.add_one_le_exp (2*c-a) + have h2 := Real.add_one_le_exp (2*c) + have h3 : (a-2*c)*(1-Real.exp (2*c-a)) ≤ a-2*c := by + nlinarith [mul_pos hδ hp] + have h4 : 2*c*(1-Real.exp (2*c-a)) ≤ 2*c*(a-2*c) := by + exact mul_le_mul_of_nonneg_left (by linarith) (by positivity) + have h5 := mul_le_mul_of_nonneg_left h2 hδ.le + apply (div_le_div_iff₀ (by positivity) (by positivity)).mpr + nlinarith + +theorem weighted_interaction_integral {a c S T : ℝ} + (ha : 0 < a) (hc : 0 ≤ c) (hac : 2*c < a) (hST : S ≤ T) + {L s V W : ℝ → ℝ} + (hV : ContinuousOn V (Icc S T)) (hW : ContinuousOn W (Icc S T)) + (hL : ∀ t ∈ Icc S T, HasDerivWithinAt L (-2*a*V t*W t) (Icc S T) t) + (hs : ∀ t ∈ Icc S T, HasDerivWithinAt s ((V t)^2+(W t)^2) (Icc S T) t) + (hs0 : ∀ t ∈ Icc S T, 0 ≤ s t) + (hL0 : ∀ t ∈ Icc S T, 0 ≤ L t) + (hdecay : ∀ t ∈ Icc S T, L t ≤ Real.exp (-a*s t/2)) : + (∫ t in S..T, Real.exp (c*s t)*V t*W t) ≤ + Real.exp (2*c)/(2*a*(1-Real.exp (2*c-a))) := + (interaction_integral_strong ha hc hac hST hV hW hL hs hs0 hL0 hdecay).trans + (interaction_constant_comparison ha hc hac) + +end ExactSLEMain + +namespace ExactSLEMain + + +noncomputable def fullLoewnerRadius (A : ℝ) (b : ℝ≥0 → ℝ) (z : ℂ) (t : ℝ≥0) : ℝ := + 2*(loewnerMap A b t z).im/‖deriv (loewnerMap A b t) z‖ + + +noncomputable def odeSpeed (b : ℝ≥0 → ℝ) (T : ℝ≥0) (f : ℝ → ℂ) (t : ℝ) : ℝ := + let u : ℝ := projIcc (0:ℝ) T T.coe_nonneg t + (f u).im/Complex.normSq (f u-(b u.toNNReal : ℂ)) +noncomputable def activeODEClock (b : ℝ≥0 → ℝ) (T σ : ℝ≥0) (f : ℝ → ℂ) (t : ℝ) : ℝ := + ∫ u in (σ:ℝ)..t, odeSpeed b T f u^2 +end ExactSLEMain +namespace ExactSLEMain +lemma odeSpeed_eq {b : ℝ≥0 → ℝ} {T : ℝ≥0} (f : ℝ → ℂ) {t : ℝ} + (ht : t∈Icc (0:ℝ) T) : + odeSpeed b T f t=(f t).im/Complex.normSq (f t-(b t.toNNReal : ℂ)) := by + simp only [odeSpeed,projIcc_of_mem _ ht] +lemma odeSpeed_continuous {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil a b z T f) : + Continuous (odeSpeed b T f) := by + have hv : ContinuousOn (fun t => (f t).im/Complex.normSq (f t-(b t.toNNReal : ℂ))) (Icc (0:ℝ) T) := + (Complex.continuous_im.comp_continuousOn (odeUntil_continuousOn hf)).div + (Complex.continuous_normSq.comp_continuousOn (odeUntil_center_continuousOn hb hf)) + (fun t ht => (Complex.normSq_pos.mpr (odeUntil_center_ne_zero hf ht)).ne') + exact hv.domRestrict.comp continuous_projIcc +lemma fullRadius_primitive {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil a b z T f) + {t : ℝ≥0} (ht : t≤T) : + fullLoewnerRadius a b z t=2*z.im*Real.exp + (-2*a*(∫ u in (0:ℝ)..(t:ℝ), odeSpeed b T f u^2)) := by + have hz : alive a b t z := ⟨f,odeUntil_mono hf ht⟩ + have he : (∫ u in (0:ℝ)..(t:ℝ), odeSpeed b T f u^2) = + ∫ u in (0:ℝ)..(t:ℝ), + ((loewnerMap a b u.toNNReal z-(b u.toNNReal : ℂ)).im/ + Complex.normSq (loewnerMap a b u.toNNReal z-(b u.toNNReal : ℂ)))^2 := by + apply intervalIntegral.integral_congr + intro u hu + have hu0 : u∈Icc (0:ℝ) t := by simpa only [uIcc_of_le t.coe_nonneg] using hu + have hu' : u∈Icc (0:ℝ) T := ⟨hu0.1,hu0.2.trans (by exact_mod_cast ht)⟩ + dsimp only + rw [odeSpeed_eq f hu',loewnerMap_eq_solution_time hf hu'] + simp + unfold fullLoewnerRadius + rw [show 2*(loewnerMap a b t z).im/‖deriv (loewnerMap a b t) z‖= + 2*((loewnerMap a b t z).im/‖deriv (loewnerMap a b t) z‖) by ring, + loewner_radius_ratio hb hz,he] + ring +lemma fullRadius_pos {a : ℝ} {b : ℝ≥0 → ℝ} (hb : Continuous b) + {z : ℂ} {T : ℝ≥0} {f : ℝ → ℂ} (hf : odeUntil a b z T f) + {t : ℝ≥0} (ht : t≤T) : 0 sq_nonneg _) +end ExactSLEMain +namespace ExactSLEMain +lemma neg_log_le_sqrt_ratio {r : ℝ} (hr : 0 -Real.log (‖f u-g u‖/‖f u-star (g u)‖)) + (-2*a*odeSpeed b T f t*odeSpeed b T g t) (Icc (0:ℝ) T) t := by + have hp := (ode_pair_ratio_pos_lt_one hb hf hg hzw ht).1 + have hd := ((odeUntil_pair_ratio_deriv hb hf hg hzw ht).log hp.ne').neg + rw [mul_div_cancel_right₀ _ hp.ne'] at hd + convert hd using 1 + try rfl + rw [odeSpeed_eq f ht,odeSpeed_eq g ht] + ring +end ExactSLEMain +namespace ExactSLEMain + + +theorem actual_pair_interaction {a c : ℝ} (ha : 0 -Real.log (‖f t-g t‖/‖f t-star (g t)‖) + let u := activeODEClock b T σ f + let v := activeODEClock b T τ g + have hST' : (S:ℝ)≤T := by exact_mod_cast hST + have hsub : Icc (S:ℝ) T ⊆ Icc (0:ℝ) T := Icc_subset_Icc_left S.coe_nonneg + have hnon (t : ℝ) (ht : t∈Icc (S:ℝ) T) : 0≤L t := by + have hr := ode_pair_ratio_pos_lt_one hb hf hg hzw (hsub ht) + exact neg_nonneg.mpr (Real.log_nonpos hr.1.le hr.2.le) + have hdecay (t : ℝ) (ht : t∈Icc (S:ℝ) T) : + L t≤Real.exp (-a*(u t+v t)/2) := by + have ht0 : 0≤t := (hsub ht).1 + have htT : t.toNNReal≤T := by + exact_mod_cast (show (t.toNNReal:ℝ)≤T by simpa only [Real.coe_toNNReal _ ht0] using ht.2) + have hz := actual_pair_clock_decay ha hb (hσ.trans hST) htT hf hg hzw hcapz + have hcapw' : fullLoewnerRadius a b w τ≤‖w-z‖ := by simpa only [norm_sub_rev] using hcapw + have hw := actual_pair_clock_decay ha hb (hτ.trans hST) htT hg hf hzw.symm hcapw' + rw [Real.coe_toNNReal _ ht0] at hz hw + have hnorm : ‖g t-star (f t)‖=‖f t-star (g t)‖ := by + calc + _ = ‖star (g t-star (f t))‖ := (norm_star _).symm + _ = ‖star (g t)-f t‖ := by rw [star_sub,star_star] + _ = _ := norm_sub_rev _ _ + rw [hnorm,norm_sub_rev (g t) (f t)] at hw + change L t≤Real.exp (-a*u t) at hz + change L t≤Real.exp (-a*v t) at hw + rcases le_total (u t) (v t) with h|h + · exact hw.trans (Real.exp_le_exp.mpr (by nlinarith)) + · exact hz.trans (Real.exp_le_exp.mpr (by nlinarith)) + exact weighted_interaction_integral ha hc hac hST' + (L:=L) (s:=fun t => u t+v t) (V:=odeSpeed b T f) (W:=odeSpeed b T g) + (odeSpeed_continuous hb hf).continuousOn (odeSpeed_continuous hb hg).continuousOn + (fun t ht => (ode_pair_log_deriv hb hf hg hzw (hsub ht)).mono hsub) + (fun t _ => ((activeODEClock_deriv hb hf σ t).add + (activeODEClock_deriv hb hg τ t)).hasDerivWithinAt) + (fun t ht => add_nonneg (activeODEClock_nonneg ((by exact_mod_cast hσ : (σ:ℝ)≤S).trans ht.1)) + (activeODEClock_nonneg ((by exact_mod_cast hτ : (τ:ℝ)≤S).trans ht.1))) hnon hdecay +end ExactSLEMain +namespace ExactSLEGreen +open ExactSLEMain ExactSLEGenerator ExactSLEFiniteTilt +end ExactSLEGreen +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/AngularClock.lean b/lean/OAI/Probability/SLELocalization/AngularClock.lean new file mode 100644 index 0000000000000000000000000000000000000000..80b37bf890addb654dbe538b608960834d313ece --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/AngularClock.lean @@ -0,0 +1,982 @@ +import Mathlib +import OAI.Probability.SLELocalization.AngularMoments +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Gamma Field estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerField LoewnerExit AngularBarrier +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +lemma field_nonneg {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) : + 0 ≤ field hε hT l b η ρ sdev U z t x := + AngularBarrier.value_nonneg hl hb (remaining_pos hε hT hη ρ U z t) + (squaredSine_pos _).le + +lemma field_initial {z : ℂ} (hy : ε ≤ z.im) {u : ℝ} (hu : 0 ≤ u) + (l b η sdev : ℝ) (U : C(I, ℝ)) : + field hε hT l b η ((2*z.im)*Real.exp (-u)) sdev U z 0 0 = profile l b (η+u) (z.re/z.im) := by + have hz : 0 < z.im := hε.trans_le hy + simp only [field, remaining, rawRemaining, angleRatio, height, position_initial, + logDerivative_initial, mul_zero, sub_zero, max_eq_right hy] + rw [Real.log_mul (by positivity) (Real.exp_pos _).ne', Real.log_exp] + have he : η + Real.log (2*z.im) - (Real.log (2*z.im) + -u) = η+u := by ring + rw [he, max_eq_right (by linarith)] + +lemma measurable_stop (hTp : 0 < T) (z : ℂ) (ρ δ : ℝ) : + @Measurable C(I, ℝ) ℝ (borel _) _ (fun U => stop hε hT U z ρ δ) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + apply measurable_of_Ioi + intro a + by_cases ha : a < 0 + · have he : (fun U => stop hε hT U z ρ δ) ⁻¹' Ioi a = univ := by + ext U; simp only [mem_preimage, mem_Ioi, mem_univ, iff_true] + exact ha.trans_le (stop_bounds hε hT U z ρ δ).1 + rw [he]; exact MeasurableSet.univ + · by_cases hat : a < T + · have he : (fun U => stop hε hT U z ρ δ) ⁻¹' Ioi a = + {U | ∀ s ∈ Icc 0 a, 0 < deficit hε hT U z ρ δ s} := by + ext U; exact lt_stop_iff hε hT hTp U z ρ δ ⟨not_lt.1 ha,hat⟩ + rw [he]; exact (isOpen_positive_on hε hT z ρ δ a).measurableSet + · have he : (fun U => stop hε hT U z ρ δ) ⁻¹' Ioi a = ∅ := by + ext U; simp only [mem_preimage, mem_Ioi, mem_empty_iff_false, iff_false] + exact not_lt_of_ge ((stop_bounds hε hT U z ρ δ).2.trans (not_lt.1 hat)) + rw [he]; exact MeasurableSet.empty + +lemma integral_drift_nonpos {κ η ρ : ℝ} (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (_hρ : 0 < ρ) + (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (δ : ℝ) (B : ℝ → ℝ) (hB : Continuous B) + (hU : ∀ s ∈ Icc 0 T, extendDriver T U s = Real.sqrt κ*B s) : + (∫ t in (0:ℝ)..(stop hε hT U z ρ δ), drift hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t (B t)) + + (1/2:ℝ)*∫ t in (0:ℝ)..(stop hε hT U z ρ δ), + iteratedDeriv 2 (field hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t) (B t) ≤ 0 := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have htau := (stop_bounds hε hT U z ρ δ).1 + have hm : Continuous (fun t : ℝ => ((U,t),B t)) := + (continuous_const.prodMk continuous_id).prodMk hB + have hv := ((continuous_drift hε hT hl hb hη ρ (Real.sqrt κ) z).comp hm).continuousOn (s := Icc 0 (stop hε hT U z ρ δ)) + have hc := ((continuous_derivative hε hT hl hb hη ρ (Real.sqrt κ) z 2).comp hm).continuousOn (s := Icc 0 (stop hε hT U z ρ δ)) + have hiV := hv.intervalIntegrable_of_Icc (μ:=volume) htau + have hiC := hc.intervalIntegrable_of_Icc (μ:=volume) htau + dsimp only [Function.comp_def] at hiV hiC + rw [← intervalIntegral.integral_const_mul, ← intervalIntegral.integral_add hiV (hiC.const_mul (1/2:ℝ))] + rw [intervalIntegral.integral_of_le htau] + apply integral_nonpos_of_ae + have hne : ∀ᵐ t : ℝ ∂volume, t ≠ stop hε hT U z ρ δ := by simp [ae_iff] + filter_upwards [ae_restrict_mem measurableSet_Ioc, + ae_restrict_of_ae hne] with t ht he + have hlt : t < stop hε hT U z ρ δ := lt_of_le_of_ne ht.2 he + have hh := (deficit_pos_iff hε hT U z ρ δ t).1 + (positive_before hε hT hTp U z ρ δ ht.1.le hlt) + exact drift_nonpos hε hT hκ hη ρ U z t (B t) hh.2.1.le + (hU t ⟨ht.1.le,ht.2.trans (stop_bounds hε hT U z ρ δ).2⟩) + +end SLEExactGauge.GammaField + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerExit LoewnerField LoewnerLocalized GammaField AngularBarrier +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable (hz : z ∈ halfPlane) (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma remaining_upper (η : ℝ) {t : ℝ} (ht : t ∈ Icc 0 (C.stopTime κ B sample)) : + remaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-u)) (C.paths κ B sample) z t ≤ η+u := by + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hh := ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle t).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 ht)).2.1 + have hrad := radius_eq_source C.height_pos C.horizon_pos h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) _ z _ C.angle + (C.path_eq κ B sample hc) h0 ht + have ha := (h.log_radius_strictAnti (C.bounds κ B sample).1 + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.source_live κ B sample h hz hu hc hb0)).antitoneOn + (show (0:ℝ) ∈ Icc 0 (C.stopTime κ B sample) from ⟨le_rfl,(C.bounds κ B sample).1⟩) ht ht.1 + rw [h.radius_initial hz] at ha + unfold remaining + apply max_le (by linarith) + rw [rawRemaining_eq C.height_pos C.horizon.coe_nonneg η _ _ z t hh, hrad, + Real.log_mul (by have hy : 0 < z.im := hz; positivity) (Real.exp_pos _).ne', Real.log_exp] + linarith + +omit h in +lemma ratio_upper {t : ℝ} (ht : t ∈ Icc 0 (C.stopTime κ B sample)) : + |angleRatio C.height_pos C.horizon.coe_nonneg (Real.sqrt κ) (C.paths κ B sample) z t (B t.toNNReal sample)| ≤ 1/C.angle := by + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hh := (deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle t).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 ht) + exact ratio_bound C.height_pos C.horizon.coe_nonneg C.angle_pos _ _ z t _ hh.2.1 hh.2.2 + (C.path_eq κ B sample hc ⟨ht.1,ht.2.trans (C.bounds κ B sample).2⟩) + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerExit AngularBarrier + +def pathTerminal {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) + (l b η ρ δ sdev : ℝ) (z : ℂ) (U : C(I, ℝ)) : ℝ := + let tau := stop hε T.coe_nonneg U z ρ δ + field hε T.coe_nonneg l b η ρ sdev U z tau (extendDriver T U tau/sdev) + +lemma continuous_actualField {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) + {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (ρ sdev : ℝ) (z : ℂ) : + Continuous (fun v : C(I, ℝ) × ℝ => + field hε T.coe_nonneg l b η ρ sdev v.1 z v.2 (extendDriver T v.1 v.2/sdev)) := by + have hp : Continuous (fun v : C(I, ℝ) × ℝ => (v,extendDriver T v.1 v.2/sdev)) := + continuous_id.prodMk ((continuous_joint_extendDriver T).div_const sdev) + have hh := Continuous.comp (g := fun v : (C(I, ℝ) × ℝ) × ℝ => + field hε T.coe_nonneg l b η ρ sdev v.1.1 z v.1.2 v.2) + (f := fun v : C(I, ℝ) × ℝ => (v,extendDriver T v.1 v.2/sdev)) + (continuous_field hε T.coe_nonneg hl hb hη ρ sdev z) hp + dsimp only [Function.comp_def] at hh + exact hh + +lemma pathTerminal_measurable {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) + {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (ρ δ sdev : ℝ) (z : ℂ) : + @Measurable C(I, ℝ) ℝ (borel _) _ (pathTerminal hε T l b η ρ δ sdev z) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hτ : Measurable (fun U : C(I, ℝ) => stop hε T.coe_nonneg U z ρ δ) := + measurable_stop hε T.coe_nonneg hT z ρ δ + have hm : Measurable (fun U : C(I, ℝ) => (U,stop hε T.coe_nonneg U z ρ δ)) := + measurable_id.prodMk hτ + have hh := (continuous_actualField hε T hl hb hη ρ sdev z).measurable.comp hm + dsimp only [Function.comp_def] at hh + exact hh + +lemma pathTerminal_eq {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) + (l b η ρ δ sdev : ℝ) (hsdev : sdev ≠ 0) (z : ℂ) : + let U := BrownianDriver.path B sdev T sample + let tau := stop hε T.coe_nonneg U z ρ δ + pathTerminal hε T l b η ρ δ sdev z U = + field hε T.coe_nonneg l b η ρ sdev U z tau (B tau.toNNReal sample) := by + dsimp only [pathTerminal] + congr 1 + rw [BrownianDriver.extend_eq B sdev T sample hc (stop_bounds hε T.coe_nonneg _ z ρ δ), + mul_div_cancel_left₀ _ hsdev] + +lemma terminal_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) + {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (ρ δ sdev : ℝ) (hsdev : sdev ≠ 0) (z : ℂ) : + let U := BrownianDriver.path B sdev T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + AEMeasurable (fun sample => field hε T.coe_nonneg l b η ρ sdev (U sample) z (τ sample) + (B (τ sample).toNNReal sample)) P := by + let : MeasurableSpace C(I, ℝ) := borel _ + have hm := (pathTerminal_measurable hε T hT hl hb hη ρ δ sdev z).comp_aemeasurable + (BrownianDriver.path_aemeasurable hB sdev T) + apply hm.congr + filter_upwards [hB.cont] with sample hc + exact pathTerminal_eq B sample hc hε T l b η ρ δ sdev hsdev z + +end SLEExactGauge.GammaField + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open GammaField +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +def barrier {Ω : Type*} (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ := + field C.height_pos C.horizon.coe_nonneg (κ/2) ((8/κ-1)/2) η ((2*z.im)*Real.exp (-u)) (Real.sqrt κ) + (C.paths κ B sample) z (C.stopTime κ B sample) (B (C.stopTime κ B sample).toNNReal sample) + +lemma barrier_nonneg {Ω : Type*} (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) : 0 ≤ C.barrier η κ B sample := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + exact field_nonneg C.height_pos C.horizon.coe_nonneg hl hb hη _ _ _ z _ _ + +lemma barrier_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) : AEMeasurable (C.barrier η κ B) P := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + exact terminal_aemeasurable hB C.height_pos C.horizon C.horizon_pos hl hb hη _ _ _ + (Real.sqrt_pos.2 hκ.1).ne' z + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open GammaField GammaPredictable BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +lemma barrier_expectation {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (hz : z ∈ halfPlane) (hu : 0 < u) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) : + Integrable (C.barrier η κ B) P ∧ + (∫ sample, C.barrier η κ B sample ∂P) ≤ AngularBarrier.profile (κ/2) ((8/κ-1)/2) (η+u) (z.re/z.im) := by + let l := κ/2 + let b := (8/κ-1)/2 + let ρ := (2*z.im)*Real.exp (-u) + have hl : 0 < l := div_pos hκ.1 (by norm_num) + have hb : 0 < b := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + dsimp [b]; linarith + have hρ : 0 < ρ := by have hy : 0 < z.im := hz; dsimp [ρ]; positivity + let U := C.paths κ B + let τ := C.stopTime κ B + let F := fun sample => field C.height_pos C.horizon.coe_nonneg l b η ρ (Real.sqrt κ) (U sample) z + let V := fun sample => drift C.height_pos C.horizon.coe_nonneg l b η ρ (Real.sqrt κ) (U sample) z + let G := AngularBarrier.profile l b (η+u) (z.re/z.im) + have hreg : ∀ᵐ sample ∂P, BrownianLocal.LocalRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact regular C.height_pos C.horizon.coe_nonneg hl hb hη hρ C.horizon_pos + (Real.sqrt κ) (U sample) z C.angle _ (hc.comp continuous_real_toNNReal) + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ C.horizon := + Filter.Eventually.of_forall (fun sample => C.bounds κ B sample) + obtain ⟨K₁,hK₁,hb₁⟩ := coefficient_bound C.height_pos C.horizon.coe_nonneg hl hb hη + ρ (Real.sqrt κ) (η+u) (1/C.angle) z 1 + obtain ⟨K₂,hK₂,hb₂⟩ := coefficient_bound C.height_pos C.horizon.coe_nonneg hl hb hη + ρ (Real.sqrt κ) (η+u) (1/C.angle) z 2 + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t x : ℝ), remaining C.height_pos C.horizon.coe_nonneg η ρ W z t ≤ η+u → + |angleRatio C.height_pos C.horizon.coe_nonneg (Real.sqrt κ) W z t x| ≤ 1/C.angle → + |iteratedDeriv k (field C.height_pos C.horizon.coe_nonneg l b η ρ (Real.sqrt κ) W z t) x| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B C.horizon τ F n i sample| ≤ K := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hmaps] with sample hc hb0 hm + unfold stoppedCoeff + split_ifs with hh + · have ht : mesh C.horizon n i ∈ Icc 0 (C.stopTime κ B sample) := + ⟨by unfold mesh; positivity,hh.le⟩ + exact hb (U sample) _ _ (C.remaining_upper κ B sample hm hz hu hc hb0 η ht) + (by simpa only [mesh_toNNReal] using C.ratio_upper κ B sample hz hu hc hb0 ht) + · simpa only [abs_zero] using hK + let A := fun n i => rawCoeff C.height_pos 1 B C.horizon (dyadicTime C.horizon n i) l b η (Real.sqrt κ) z ρ C.angle + let D := fun n i => rawCoeff C.height_pos 2 B C.horizon (dyadicTime C.horizon n i) l b η (Real.sqrt κ) z ρ C.angle + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B C.horizon τ F n i := + rawCoeff_stoppedCoeff_ae C.height_pos hB 1 C.horizon C.horizon_pos l b η (Real.sqrt κ) z ρ C.angle n i + have hDe (n i : ℕ) : D n i =ᵐ[P] stoppedCoeff 2 B C.horizon τ F n i := + rawCoeff_stoppedCoeff_ae C.height_pos hB 2 C.horizon C.horizon_pos l b η (Real.sqrt κ) z ρ C.angle n i + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (A n i) := + rawCoeff_measurable_past C.height_pos 1 (Or.inl rfl) B C.horizon _ l b η (Real.sqrt κ) hl hb hη z ρ C.angle + have hDm (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (D n i) := + rawCoeff_measurable_past C.height_pos 2 (Or.inr rfl) B C.horizon _ l b η (Real.sqrt κ) hl hb hη z ρ C.angle + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable C.height_pos hB 1 (Or.inl rfl) C.horizon _ l b η (Real.sqrt κ) hl hb hη z ρ C.angle).aestronglyMeasurable K₁ + filter_upwards [hAe n i,hsbound 1 K₁ hK₁ hb₁ n i] with sample he hh + change |A n i sample| ≤ K₁ + rw [he] + exact hh + have hD2 (n i : ℕ) : MemLp (D n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable C.height_pos hB 2 (Or.inr rfl) C.horizon _ l b η (Real.sqrt κ) hl hb hη z ρ C.angle).aestronglyMeasurable K₂ + filter_upwards [hDe n i,hsbound 2 K₂ hK₂ hb₂ n i] with sample he hh + change |D n i sample| ≤ K₂ + rw [he] + exact hh + have hi := BrownianLocal.stopped_field_ito_centered_ae hB C.horizon τ F V htau hreg + A D hAe hDe hDm hD2 K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) hAm hA2 K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + let Y := fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample) + change Integrable Y P ∧ (∫ sample, Y sample ∂P) = 0 at hi + have hmaj : ∀ᵐ sample ∂P, C.barrier η κ B sample ≤ Y sample+G := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb0 + have hd := integral_drift_nonpos C.height_pos C.horizon.coe_nonneg hκ hη hρ C.horizon_pos + (U sample) z C.angle (fun t => B t.toNNReal sample) (hc.comp continuous_real_toNNReal) + (C.path_eq κ B sample hc) + have hin : F sample 0 (B 0 sample) = G := by + rw [hb0] + exact field_initial C.height_pos C.horizon.coe_nonneg (C.height_initial hz hu.le).le hu.le l b η (Real.sqrt κ) (U sample) + change _ ≤ Y sample+G + dsimp only [Y] + rw [hin] + change C.barrier η κ B sample ≤ C.barrier η κ B sample - G - _ - _ + G + change (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) + + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample) ≤ 0 at hd + linarith only [hd] + have hInt : Integrable (fun sample => Y sample+G) P := hi.1.add (integrable_const G) + have hI : Integrable (C.barrier η κ B) P := by + apply hInt.mono' (C.barrier_aemeasurable hB η κ hκ hη).aestronglyMeasurable + filter_upwards [hmaj] with sample hh + simpa only [Real.norm_eq_abs, abs_of_nonneg (C.barrier_nonneg η κ B sample hκ hη)] using hh + refine ⟨hI, ?_⟩ + calc + (∫ sample, C.barrier η κ B sample ∂P) ≤ ∫ sample, Y sample+G ∂P := integral_mono_ae hI hInt hmaj + _ = G := by rw [integral_add hi.1 (integrable_const G), hi.2]; simp + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerExit LoewnerField LoewnerLocalized GammaField AngularBarrier +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable (hz : z ∈ halfPlane) (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma barrier_at_radius (η : ℝ) {t : ℝ≥0} (ht : C.stopTime κ B sample = t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + C.barrier η κ B sample = profile (κ/2) ((8/κ-1)/2) η + (((g t z).re-Real.sqrt κ*B t sample)/(g t z).im) := by + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hs := source_until_stop C.height_pos C.horizon_pos h _ z _ C.angle + (C.path_eq κ B sample hc) h0 + have hh := ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 + ⟨(C.bounds κ B sample).1,le_rfl⟩)).2.1 + have hpos := hs.2 ⟨(C.bounds κ B sample).1,le_rfl⟩ + have hr := C.source_radius κ B sample h hz hu hc hb0 + rw [ht,hrt] at hr + unfold barrier GammaField.field remaining + rw [rawRemaining_eq C.height_pos C.horizon.coe_nonneg η _ _ z _ hh, ht, hr] + simp only [add_sub_cancel_right, max_self] + unfold angleRatio LoewnerField.height + rw [← ht, max_eq_right hh, ← hpos, ht, Real.toNNReal_coe] + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt +open AngularBarrier +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma eventually_stop_at_radius {t : ℝ≥0} (hzt : z ∈ localizationDomain γ t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + ∀ᶠ n : ℕ in atTop, (cutoffs hz u hu.le n).stopTime κ B sample = t := by + obtain ⟨η,hη,hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + have hδ : ∀ᶠ n : ℕ in atTop, shrinkingAngle z n < η := + (shrinkingAngle_tendsto z).eventually (gt_mem_nhds hη) + filter_upwards [hδ] with n hn + let C := cutoffs hz u hu.le n + have hh : loewnerRadius g (C.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact hr + · have htm := hm (C.stopTime κ B sample) + ⟨(C.bounds κ B sample).1,C.stopTime_le_radius κ B sample h hz hu hc hb0 t.coe_nonneg hzt hrt⟩ + rw [hs] at htm + exact False.elim ((not_lt_of_ge htm) hn) + exact h.live_radius_injective + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.bounds κ B sample).1 t.coe_nonneg (C.source_live κ B sample h hz hu hc hb0) hzt + (hh.trans hrt.symm) + +omit h hz hu hc hb0 in +def timeShift (n : ℕ) : ℝ := 1/((n:ℝ)+1) + +omit h hz hu hc hb0 in +lemma timeShift_pos (n : ℕ) : 0 < timeShift n := by unfold timeShift; positivity + +omit h hz hu hc hb0 in +lemma timeShift_tendsto : Tendsto timeShift atTop (𝓝[>] (0:ℝ)) := by + apply tendsto_nhdsWithin_iff.2 + constructor + · change Tendsto (fun n : ℕ => (1:ℝ)/((n:ℝ)+1)) atTop (𝓝 0) + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_one] using + (tendsto_const_div_atTop_nhds_zero_nat (1:ℝ)).comp (tendsto_add_atTop_nat 1) + · exact Filter.Eventually.of_forall timeShift_pos + +lemma barrier_tendsto_on_hit (hκ : 0 < κ ∧ κ < 8) + (hhit : firstLiveRadiusStop γ g z u ≠ (⊤ : ℝ≥0∞)) : + Tendsto (fun n : ℕ => ENNReal.ofReal ((cutoffs hz u hu.le n).barrier (timeShift n) κ B sample)) atTop (𝓝 1) := by + have hex : ∃ t : ℝ≥0, z ∈ localizationDomain γ t ∧ loewnerRadius g t z = (2*z.im)*Real.exp (-u) := by + by_contra hn + have he : {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ loewnerRadius g t z = (2*z.im)*Real.exp (-u)} = ∅ := by + exact Set.eq_empty_iff_forall_notMem.2 (fun t ht => hn ⟨t,ht⟩) + exact hhit (by simp only [firstLiveRadiusStop, he, Set.image_empty, sInf_empty]) + obtain ⟨t,hzt,hrt⟩ := hex + have he : (fun n : ℕ => (cutoffs hz u hu.le n).barrier (timeShift n) κ B sample) =ᶠ[atTop] + (fun n => profile (κ/2) ((8/κ-1)/2) (timeShift n) + (((g t z).re-Real.sqrt κ*B t sample)/(g t z).im)) := by + filter_upwards [eventually_stop_at_radius κ B sample h hz hu hc hb0 hzt hrt] with n hn + exact (cutoffs hz u hu.le n).barrier_at_radius κ B sample h hz hu hc hb0 (timeShift n) hn hrt + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have ht := (value_tendsto_zero_time hl hb (squaredSine_pos + (((g t z).re-Real.sqrt κ*B t sample)/(g t z).im))).comp timeShift_tendsto + have ht' := ht.congr' he.symm + simpa only [ENNReal.ofReal_one, Function.comp_def] using + ENNReal.continuous_ofReal.continuousAt.tendsto.comp ht' + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteTilt AngularBarrier + +lemma radiusApproachProfile {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 < u) : + P {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (profile (κ/2) ((8/κ-1)/2) u (z.re/z.im)) := by + let C := cutoffs hz u hu.le + let F := fun n sample => ENNReal.ofReal ((C n).barrier (timeShift n) κ B sample) + let Y := fun sample => liminf (fun n => F n sample) atTop + have hFm (n : ℕ) : AEMeasurable (F n) P := + ENNReal.measurable_ofReal.comp_aemeasurable + ((C n).barrier_aemeasurable hB (timeShift n) κ hκ (timeShift_pos n)) + have hYm : AEMeasurable Y P := by + dsimp only [Y] + simp_rw [liminf_eq_iSup_iInf_of_nat] + exact AEMeasurable.iSup (fun n => AEMeasurable.iInf (fun i => AEMeasurable.iInf (fun (_ : n ≤ i) => hFm i))) + have hsub : {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} ≤ᵐ[P] + {sample | (1:ℝ≥0∞) ≤ Y sample} := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb0 hhit + have hh := barrier_tendsto_on_hit κ B sample hm hz hu hc hb0 hκ hhit + have he : Y sample = 1 := hh.liminf_eq + exact he.ge + have hexp (n : ℕ) : (∫⁻ sample, F n sample ∂P) ≤ + ENNReal.ofReal (profile (κ/2) ((8/κ-1)/2) (timeShift n+u) (z.re/z.im)) := by + have hi := (C n).barrier_expectation hB (timeShift n) κ hκ (timeShift_pos n) hz hu γ g f hmaps + rw [← ofReal_integral_eq_lintegral_ofReal hi.1 (Filter.Eventually.of_forall + (fun sample => (C n).barrier_nonneg (timeShift n) κ B sample hκ (timeShift_pos n)))] + exact ENNReal.ofReal_le_ofReal hi.2 + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have ht : Tendsto (fun n : ℕ => ENNReal.ofReal + (profile (κ/2) ((8/κ-1)/2) (timeShift n+u) (z.re/z.im))) atTop + (𝓝 (ENNReal.ofReal (profile (κ/2) ((8/κ-1)/2) u (z.re/z.im)))) := by + have hs : Tendsto (fun n => (timeShift n+u,z.re/z.im)) atTop (𝓝 (u,z.re/z.im)) := by + have ht0 : Tendsto timeShift atTop (𝓝 (0:ℝ)) := timeShift_tendsto.mono_right nhdsWithin_le_nhds + simpa only [zero_add] using (ht0.add_const u).prodMk_nhds tendsto_const_nhds + exact ENNReal.continuous_ofReal.continuousAt.tendsto.comp + ((contDiffAt_profile (v := (u,z.re/z.im)) hl hb 0 hu).continuousAt.tendsto.comp hs) + calc + P {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} ≤ + P {sample | (1:ℝ≥0∞) ≤ Y sample} := measure_mono_ae hsub + _ ≤ ∫⁻ sample, Y sample ∂P := by + simpa only [div_one] using meas_ge_le_lintegral_div hYm (by norm_num : (1:ℝ≥0∞) ≠ 0) (by norm_num : (1:ℝ≥0∞) ≠ ⊤) + _ ≤ liminf (fun n => ∫⁻ sample, F n sample ∂P) atTop := lintegral_liminf_le' hFm + _ ≤ liminf (fun n => ENNReal.ofReal (profile (κ/2) ((8/κ-1)/2) (timeShift n+u) (z.re/z.im))) atTop := + liminf_le_liminf (Filter.Eventually.of_forall hexp) + _ = _ := ht.liminf_eq + +lemma squaredSine_initial {z : ℂ} (hz : z ∈ halfPlane) : + squaredSine (z.re/z.im) = (z.im/‖z‖)^2 := by + have hy : 0 < z.im := hz + have hn : 0 < ‖z‖ := lt_of_lt_of_le hy (le_trans (le_abs_self _) (Complex.abs_im_le_norm z)) + have he : ‖z‖^2 = z.re^2+z.im^2 := by + rw [← Complex.normSq_eq_norm_sq, Complex.normSq_apply] + ring + unfold squaredSine + field_simp + nlinarith + +theorem radiusApproachBound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C : ℝ, 0 < C ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (u : ℝ) (_hu : 1 ≤ u), + P {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (C * Real.exp (-codimension κ * u) * + (z.im / ‖z‖) ^ (8 / κ - 1)) := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + obtain ⟨C,hC,hdec⟩ := value_decay hl hb + refine ⟨C,hC,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz u hu + have hu0 : 0 < u := by linarith + apply (radiusApproachProfile κ hκ B hB γ g f hmaps z hz u hu0).trans + apply ENNReal.ofReal_le_ofReal + have hp : (κ/2)*((8/κ-1)/2)/2 = codimension κ := by + unfold codimension dimension + field_simp [hκ.1.ne'] + ring + have hq : (squaredSine (z.re/z.im))^((8/κ-1)/2) = (z.im/‖z‖)^(8/κ-1) := by + rw [squaredSine_initial hz, ← Real.rpow_natCast (z.im/‖z‖) 2, + ← Real.rpow_mul (initial_sine_pos hz).le] + congr 1 + ring + have hh := hdec u (squaredSine (z.re/z.im)) hu (squaredSine_pos _).le + simpa only [profile,hp,hq] using hh + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.UnivalentDistance + +lemma derivative_variation {f : ℂ → ℂ} {a : ℂ} {r A : ℝ} + (hr : 0 < r) (hd : DifferentiableOn ℂ f (ball a (2*r))) + (hb : ∀ z ∈ closedBall a r, ‖deriv f z‖ ≤ 2*A) + {z : ℂ} (hz : z ∈ closedBall a (r/2)) : + ‖deriv f z - deriv f a‖ ≤ (4*A/r)*‖z-a‖ := by + have hd' := hd.deriv isOpen_ball + have hsub : closedBall a (r/2) ⊆ ball a (2*r) := closedBall_subset_ball (by linarith) + have hbound (w : ℂ) (hw : w ∈ closedBall a (r/2)) : + ‖deriv (deriv f) w‖ ≤ 4*A/r := by + have hs : closedBall w (r/2) ⊆ closedBall a r := by + apply closedBall_subset_closedBall' + have hh := mem_closedBall.1 hw + linarith + have hsc : closure (ball w (r/2)) ⊆ ball a (2*r) := by + rw [closure_ball _ (by linarith : r/2 ≠ 0)] + exact hs.trans (closedBall_subset_ball (by linarith)) + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le + (f := deriv f) (by linarith : 0 < r/2) (hd'.mono hsc).diffContOnCl + (fun v hv => hb v (hs (sphere_subset_closedBall hv))) + convert hh using 1; field_simp; ring + exact (convex_closedBall a (r/2)).norm_image_sub_le_of_norm_deriv_le + (fun w hw => hd'.differentiableAt (isOpen_ball.mem_nhds (hsub hw))) hbound + (mem_closedBall_self (by linarith)) hz + +lemma local_image_disk {f : ℂ → ℂ} {a : ℂ} {r : ℝ} + (hr : 0 < r) (hd : DifferentiableOn ℂ f (ball a (2*r))) + (ha : deriv f a ≠ 0) + (hb : ∀ z ∈ closedBall a r, ‖deriv f z‖ ≤ 2*‖deriv f a‖) : + closedBall (f a) (‖deriv f a‖*r/32) ⊆ f '' closedBall a (r/16) := by + let F : ℂ → ℂ := fun z => (f z-f a)/deriv f a + have hA : 0 < ‖deriv f a‖ := norm_pos_iff.2 ha + have hs : closedBall a (r/16) ⊆ ball a (2*r) := closedBall_subset_ball (by linarith) + have hdF (z : ℂ) (hz : z ∈ closedBall a (r/16)) : + HasDerivAt F (deriv f z/deriv f a) z := + ((hd.differentiableAt (isOpen_ball.mem_nhds (hs hz))).hasDerivAt.sub_const _).div_const _ + have hbound (z : ℂ) (hz : z ∈ closedBall a (r/16)) : + ‖deriv f z/deriv f a-1‖ ≤ (1/2:ℝ) := by + have hv := derivative_variation hr hd hb + (closedBall_subset_closedBall (by linarith : r/16 ≤ r/2) hz) + have he : deriv f z/deriv f a-1 = (deriv f z-deriv f a)/deriv f a := by + field_simp + rw [he,norm_div,div_le_iff₀ hA] + have hn := mem_closedBall_iff_norm.1 hz + have hn' : (4*‖deriv f a‖/r)*‖z-a‖ ≤ (4*‖deriv f a‖/r)*(r/16) := + mul_le_mul_of_nonneg_left hn (by positivity) + have he' : (4*‖deriv f a‖/r)*(r/16) = ‖deriv f a‖/4 := by field_simp; ring + rw [he'] at hn' + linarith + have happ : ApproximatesLinearOn F (ContinuousLinearMap.id ℂ ℂ) + (closedBall a (r/16)) (1/2:ℝ≥0) := by + intro x hx y hy + have hh := (convex_closedBall a (r/16)).norm_image_sub_le_of_norm_hasDerivWithin_le + (fun z hz => ((hdF z hz).sub (hasDerivAt_id z)).hasDerivWithinAt) hbound hy hx + change ‖(F x-x)-(F y-y)‖ ≤ (1/2:ℝ)*‖x-y‖ at hh + have he : (F x-x)-(F y-y) = F x-F y-(x-y) := by ring + rw [he] at hh + exact hh + have hsurj := happ.surjOn_closedBall_of_nonlinearRightInverse + (ContinuousLinearEquiv.refl ℂ ℂ).toNonlinearRightInverse (by linarith : 0 ≤ r/16) Subset.rfl + have hsurj' : closedBall 0 (r/32) ⊆ F '' closedBall a (r/16) := by + change closedBall (F a) (((↑(ContinuousLinearEquiv.refl ℂ ℂ).toNonlinearRightInverse.nnnorm : ℝ)⁻¹ - (1/2)) * (r/16)) ⊆ _ at hsurj + have hn : (↑(ContinuousLinearEquiv.refl ℂ ℂ).toNonlinearRightInverse.nnnorm : ℝ) = 1 := by + simp [ContinuousLinearEquiv.toNonlinearRightInverse] + rw [hn,show ((1:ℝ)⁻¹-(1/2))*(r/16) = r/32 by norm_num; ring] at hsurj + simpa only [F,sub_self,zero_div] using hsurj + intro w hw + have hw' : (w-f a)/deriv f a ∈ closedBall (0:ℂ) (r/32) := by + rw [mem_closedBall_iff_norm,sub_zero,norm_div,div_le_iff₀ hA] + have hh := mem_closedBall_iff_norm.1 hw + nlinarith + obtain ⟨v,hv,he⟩ := hsurj' hw' + refine ⟨v,hv,?_⟩ + dsimp only [F] at he + have he' : f v-f a = w-f a := (div_left_inj' ha).mp he + exact sub_left_injective he' + +lemma image_disk {f : ℂ → ℂ} (hd : DifferentiableOn ℂ f (ball 0 1)) + (h0 : deriv f 0 ≠ 0) : + ∃ b : ℂ, closedBall b (‖deriv f 0‖/128) ⊆ f '' ball 0 1 := by + have hs : closedBall (0:ℂ) (1/2:ℝ) ⊆ ball 0 1 := closedBall_subset_ball (by norm_num) + have hc : ContinuousOn (fun z : ℂ => (1/2-‖z‖)*‖deriv f z‖) + (closedBall 0 (1/2:ℝ)) := + (continuous_const.sub continuous_norm).continuousOn.mul + ((hd.deriv isOpen_ball).continuousOn.mono hs).norm + obtain ⟨a,ha,hm⟩ := (isCompact_closedBall (0:ℂ) (1/2:ℝ)).exists_isMaxOn + (nonempty_closedBall.mpr (by norm_num)) hc + have ham : ‖a‖ ≤ (1/2:ℝ) := by simpa using ha + have hmax0 := hm (mem_closedBall_self (by norm_num : (0:ℝ) ≤ 1/2)) + change (1/2-‖(0:ℂ)‖)*‖deriv f 0‖ ≤ (1/2-‖a‖)*‖deriv f a‖ at hmax0 + simp only [norm_zero,sub_zero] at hmax0 + have h0p := norm_pos_iff.mpr h0 + have hAp : 0 < ‖deriv f a‖ := by + by_contra hh + have he : ‖deriv f a‖ = 0 := le_antisymm (le_of_not_gt hh) (norm_nonneg _) + rw [he,mul_zero] at hmax0 + linarith + have halt : ‖a‖ < (1/2:ℝ) := by nlinarith + let r : ℝ := (1/2-‖a‖)/2 + have hr : 0 < r := by dsimp [r]; linarith + have he : 2*r = 1/2-‖a‖ := by dsimp [r]; ring + have hsub : ball a (2*r) ⊆ ball (0:ℂ) 1 := by + apply ball_subset_ball' + rw [dist_zero_right,he] + linarith + have hb (z : ℂ) (hz : z ∈ closedBall a r) : ‖deriv f z‖ ≤ 2*‖deriv f a‖ := by + have hzn : ‖z‖ ≤ ‖a‖+r := by + have hh := norm_le_norm_add_norm_sub a z + rw [norm_sub_rev a z] at hh + have hz' := mem_closedBall_iff_norm.1 hz + linarith + have hz0 : z ∈ closedBall (0:ℂ) (1/2:ℝ) := by + simp only [mem_closedBall_iff_norm,sub_zero] + linarith + have hmz := hm hz0 + change (1/2-‖z‖)*‖deriv f z‖ ≤ (1/2-‖a‖)*‖deriv f a‖ at hmz + have hwel : r ≤ 1/2-‖z‖ := by linarith + have hh := mul_le_mul_of_nonneg_right hwel (norm_nonneg (deriv f z)) + nlinarith + refine ⟨f a,?_⟩ + have hrad : ‖deriv f 0‖/128 ≤ ‖deriv f a‖*r/32 := by nlinarith + apply (closedBall_subset_closedBall hrad).trans + apply (local_image_disk hr (hd.mono hsub) (norm_pos_iff.mp hAp) hb).trans + apply image_mono + apply closedBall_subset_ball' + rw [dist_zero_right] + linarith + +lemma exp_injective_derivative_bound {h : ℂ → ℂ} + (hd : DifferentiableOn ℂ h (ball 0 1)) (hi : InjOn (Complex.exp ∘ h) (ball 0 1)) : + ‖deriv h 0‖ ≤ 256*Real.pi := by + by_contra hb + have hp := Real.pi_pos + have hn : 0 < ‖deriv h 0‖ := by linarith + obtain ⟨b,hbim⟩ := image_disk hd (norm_pos_iff.mp hn) + have hb0 : b ∈ closedBall b (‖deriv h 0‖/128) := mem_closedBall_self (by positivity) + have hb1 : b+2*Real.pi*Complex.I ∈ closedBall b (‖deriv h 0‖/128) := by + rw [mem_closedBall_iff_norm,add_sub_cancel_left] + norm_num [norm_mul,Complex.norm_real,abs_of_pos hp] + linarith + obtain ⟨z0,hz0,hz0'⟩ := hbim hb0 + obtain ⟨z1,hz1,hz1'⟩ := hbim hb1 + have he : z1 = z0 := hi hz1 hz0 (by + simp only [Function.comp_apply,hz0',hz1'] + exact Complex.exp_periodic b) + have he' : (2:ℂ)*Real.pi*Complex.I = 0 := by + rw [he,hz0'] at hz1' + linear_combination -hz1' + have hh : (Real.pi:ℂ) = 0 := (mul_eq_zero.mp he').resolve_right Complex.I_ne_zero |> + (fun h => (mul_eq_zero.mp h).resolve_left (by norm_num)) + exact Real.pi_ne_zero (Complex.ofReal_eq_zero.mp hh) + +lemma omitted_value_bound {f : ℂ → ℂ} (hd : DifferentiableOn ℂ f (ball 0 1)) + (hi : InjOn f (ball 0 1)) {w : ℂ} (hw : w ∉ f '' ball 0 1) : + ‖deriv f 0‖ ≤ (256*Real.pi)*‖f 0-w‖ := by + have hzero : (0:ℂ) ∈ ball 0 1 := mem_ball_self zero_lt_one + have hn (z : ℂ) (hz : z ∈ ball (0:ℂ) 1) : f z-w ≠ 0 := by + intro he + exact hw ⟨z,hz,sub_eq_zero.mp he⟩ + have hc : IsSimplyConnected (ball (0:ℂ) 1) := by + let := (convex_ball (0:ℂ) (1:ℝ)).contractibleSpace (nonempty_ball.mpr zero_lt_one) + change SimplyConnectedSpace (ball (0:ℂ) 1) + infer_instance + obtain ⟨h,hhc,hhe⟩ := Complex.exists_continuousOn_eqOn_exp_comp hc isOpen_ball + (hd.continuousOn.sub continuousOn_const) (by + rintro ⟨z,hz,he⟩ + exact hn z hz he) + have hhd (z : ℂ) (hz : z ∈ ball (0:ℂ) 1) : + HasDerivAt h (deriv f z/(f z-w)) z := by + have hh := HasDerivAt.of_comp_left + (hhc.continuousAt (isOpen_ball.mem_nhds hz)) + (Complex.hasDerivAt_exp (h z)) + ((hd.differentiableAt (isOpen_ball.mem_nhds hz)).hasDerivAt.sub_const w) + (Complex.exp_ne_zero _) (hhe.eventuallyEq_of_mem (isOpen_ball.mem_nhds hz)) + have he : Complex.exp (h z) = f z-w := hhe hz + simpa only [he] using hh + have hhd' : DifferentiableOn ℂ h (ball 0 1) := fun z hz => (hhd z hz).differentiableAt.differentiableWithinAt + have hhi : InjOn (Complex.exp ∘ h) (ball 0 1) := by + intro z hz v hv he + apply hi hz hv + rw [hhe hz,hhe hv] at he + exact sub_left_injective he + have hh := exp_injective_derivative_bound hhd' hhi + rw [(hhd 0 hzero).deriv,norm_div,div_le_iff₀ (norm_pos_iff.mpr (hn 0 hzero))] at hh + exact hh + +end SLEExactGauge.UnivalentDistance + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma radius_le_complement_distance (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) + {w : ℂ} (hw : w ∉ localizationDomain γ t) : + loewnerRadius g t z ≤ (512*Real.pi)*dist z w := by + have hpos := h.im_pos ht hz + have hdn := h.deriv_ne_zero ht hz + rcases h with ⟨hγ,hzero,him,htrans,hinit,hg,hf,hgmap,hfmap,hfg,hgf,hc,hd,htip⟩ + let φ : ℂ → ℂ := fun q => g t z + ((g t z).im:ℂ)*q + let F : ℂ → ℂ := fun q => f t (φ q) + have hφ0 : φ 0 = g t z := by simp [φ] + have hφ (q : ℂ) (hq : q ∈ ball (0:ℂ) 1) : φ q ∈ halfPlane := by + have hqn : ‖q‖ < 1 := by simpa using hq + have hqi := Complex.abs_im_le_norm q + have hql := neg_abs_le q.im + change 0 < (φ q).im + simp only [φ,Complex.add_im,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,add_zero] + nlinarith + have hdφ (q : ℂ) : HasDerivAt φ ((g t z).im:ℂ) q := by + simpa only [mul_one,id_eq] using! ((hasDerivAt_id q).const_mul ((g t z).im:ℂ)).const_add (g t z) + have hdF (q : ℂ) (hq : q ∈ ball (0:ℂ) 1) : DifferentiableAt ℂ F q := + (hf t ht _ (hφ q hq)).differentiableAt.comp q (hdφ q).differentiableAt + have hiF : InjOn F (ball 0 1) := by + intro q hq v hv he + have hh := congrArg (g t) he + change g t (f t (φ q)) = g t (f t (φ v)) at hh + rw [hgf t ht _ (hφ q hq),hgf t ht _ (hφ v hv)] at hh + dsimp only [φ] at hh + exact mul_left_cancel₀ (Complex.ofReal_ne_zero.mpr hpos.ne') (add_left_cancel hh) + have hFw : w ∉ F '' ball 0 1 := by + rintro ⟨q,hq,he⟩ + exact hw (he ▸ hfmap t ht (hφ q hq)) + have hgd := (hg t ht z hz).differentiableAt.hasDerivAt + have hfd := (hf t ht _ (hgmap t ht hz)).differentiableAt.hasDerivAt + have heq : (fun v => f t (g t v)) =ᶠ[𝓝 z] id := by + filter_upwards [(survivingDomain_open hγ ht).mem_nhds hz] with v hv + exact hfg t ht v hv + have he := ((hfd.comp z hgd).congr_of_eventuallyEq heq.symm).unique (hasDerivAt_id z) + have hen : ‖deriv (f t) (g t z)‖*‖deriv (g t) z‖ = 1 := by + simpa only [norm_mul,norm_one] using congrArg norm he + have hFd : deriv F 0 = deriv (f t) (g t z)*((g t z).im:ℂ) := by + have hfd' : HasDerivAt (f t) (deriv (f t) (g t z)) (φ 0) := hφ0.symm ▸ hfd + exact (hfd'.comp 0 (hdφ 0)).deriv + have hF0 : F 0 = z := by simp only [F,hφ0,hfg t ht z hz] + have hR : loewnerRadius g t z = 2*‖deriv F 0‖ := by + rw [loewnerRadius,hFd,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hpos, + div_eq_iff (norm_ne_zero_iff.mpr hdn)] + nlinarith + have hh := UnivalentDistance.omitted_value_bound + (fun q hq => (hdF q hq).differentiableWithinAt) hiF hFw + rw [hF0] at hh + rw [hR,dist_eq_norm] + nlinarith + +lemma radius_le_boundary_distance (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + loewnerRadius g t z ≤ (512*Real.pi)*infDist z (localizationDomain γ t)ᶜ := by + have hp : 0 < 512*Real.pi := by positivity + have hn : ((localizationDomain γ t)ᶜ).Nonempty := by + refine ⟨0,?_⟩ + intro h0 + exact (lt_irrefl (0:ℝ)) (by simpa [halfPlane] using h0.1.1) + rw [mul_comm (512*Real.pi),← div_le_iff₀ hp] + apply (le_infDist hn).2 + intro w hw + rw [div_le_iff₀ hp] + exact (h.radius_le_complement_distance ht hz hw).trans_eq (mul_comm _ _) + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +def liveDistanceApproach (γ : ℝ → ℂ) (z : ℂ) (ε : ℝ) : Prop := + ∃ t : ℝ≥0, z ∈ localizationDomain γ t ∧ infDist z (localizationDomain γ t)ᶜ < ε + +lemma liveDistanceApproach_radius_hit {driver : ℝ → ℝ} {γ : ℝ → ℂ} + {g f : ℝ → ℂ → ℂ} (h : IsLoewnerTraceUsing driver γ g f) + (hd : ContinuousOn driver (Ici 0)) {z : ℂ} (hz : z ∈ halfPlane) + {ε u : ℝ} (hr : (2*z.im)*Real.exp (-u) = (512*Real.pi)*ε) + (hsmall : (512*Real.pi)*ε ≤ 2*z.im) + (hhit : liveDistanceApproach γ z ε) : + firstLiveRadiusStop γ g z u ≠ (⊤ : ℝ≥0∞) := by + obtain ⟨t,hzt,hclose⟩ := hhit + have hrt : loewnerRadius g t z < (2*z.im)*Real.exp (-u) := by + rw [hr] + exact (h.radius_le_boundary_distance t.coe_nonneg hzt).trans_lt + (mul_lt_mul_of_pos_left hclose (by positivity)) + obtain ⟨s,hs,hseq⟩ := intermediate_value_Icc' t.coe_nonneg + (h.continuous_radius t.coe_nonneg (hd.mono Icc_subset_Ici_self) hzt) + ⟨hrt.le,by rw [h.radius_initial hz,hr]; exact hsmall⟩ + apply ne_top_of_le_ne_top (ENNReal.coe_ne_top (r := ⟨s,hs.1⟩)) + apply sInf_le + exact ⟨⟨s,hs.1⟩,⟨survivingDomain_mono hs.2 hzt,hseq⟩,rfl⟩ + +theorem euclideanApproachBound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ c < 1 ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (ε : ℝ) (_hε : 0 < ε) (_hsmall : ε < c*z.im), + P {sample | liveDistanceApproach (γ sample) z ε} ≤ + ENNReal.ofReal (C * ((2*z.im)^(-codimension κ) * + (z.im/‖z‖)^(8/κ-1)) * ε^(codimension κ)) := by + obtain ⟨C,hC,hbound⟩ := radiusApproachBound κ hκ + let K : ℝ := 512*Real.pi + have hK : 0 < K := by dsimp [K]; positivity + have hK1 : 1 < K := by dsimp [K]; nlinarith [Real.pi_gt_three] + have he : 1 ≤ Real.exp 1 := Real.one_le_exp (by norm_num) + have heK : 1 < K*Real.exp 1 := by nlinarith + refine ⟨C*K^(codimension κ),1/(K*Real.exp 1),mul_pos hC (Real.rpow_pos_of_pos hK _), + by positivity,(div_lt_one (by positivity)).2 heK,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz ε hε hsmall + have hy : 0 < z.im := hz + have hsmall' : ε*(K*Real.exp 1) < z.im := by + rw [one_div_mul_eq_div] at hsmall + exact (lt_div_iff₀ (by positivity)).mp hsmall + have hKε : 0 < K*ε := mul_pos hK hε + let u : ℝ := Real.log ((2*z.im)/(K*ε)) + have hu : 1 ≤ u := by + have hh : Real.exp 1 ≤ (2*z.im)/(K*ε) := by + rw [le_div_iff₀ hKε] + nlinarith + simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos 1) hh + have hr : (2*z.im)*Real.exp (-u) = K*ε := by + rw [Real.exp_neg,Real.exp_log (by positivity : 0 < (2*z.im)/(K*ε))] + field_simp + have hstart : K*ε ≤ 2*z.im := by + have hh : K*ε ≤ ε*(K*Real.exp 1) := by nlinarith + linarith + have hsub : {sample | liveDistanceApproach (γ sample) z ε} ≤ᵐ[P] + {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} := by + filter_upwards [hmaps,hB.cont] with sample hm hc hhit + exact liveDistanceApproach_radius_hit hm + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + hz hr hstart hhit + apply (measure_mono_ae hsub).trans + apply (hbound P B hB γ g f hγ hmaps z hz u hu).trans + apply ENNReal.ofReal_le_ofReal + have hexp : Real.exp (-codimension κ*u) = + (K*ε)^(codimension κ)*(2*z.im)^(-codimension κ) := by + rw [Real.rpow_def_of_pos hKε,Real.rpow_def_of_pos (by positivity : 0 < 2*z.im), + ← Real.exp_add] + congr 1 + dsimp [u] + rw [Real.log_div (by positivity : 2*z.im ≠ 0) hKε.ne'] + ring + rw [hexp,Real.mul_rpow hK.le hε.le] + exact le_of_eq (by ring) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma future_tip_mem_closure (h : IsLoewnerTraceUsing driver γ g f) + {s t : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) : γ t ∈ closure (localizationDomain γ s) := by + rcases h with ⟨hγ,hzero,him,htrans,hinit,hg,hf,hgmap,hfmap,hfg,hgf,hc,hd,htip⟩ + apply isClosed_closure.mem_of_tendsto (htip t (hs.trans hst)) + filter_upwards [self_mem_nhdsWithin] with y hy + have hh : (driver t : ℂ) + (y:ℂ)*Complex.I ∈ halfPlane := by + simpa only [halfPlane,mem_ofPred_eq,mem_Ioi,Complex.add_im,Complex.ofReal_im,Complex.mul_im, + Complex.ofReal_re,Complex.I_im,Complex.I_re,mul_one,mul_zero,zero_mul,add_zero,zero_add] using hy + exact subset_closure (survivingDomain_mono hst (hfmap t (hs.trans hst) hh)) + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/AngularMoments.lean b/lean/OAI/Probability/SLELocalization/AngularMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f5d84ce890c01e799789430e93378f49a87130c --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/AngularMoments.lean @@ -0,0 +1,941 @@ +import Mathlib +import OAI.Probability.SLELocalization.ReverseFlow +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Angular Barrier estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.AngularBarrier + +lemma value_decay {l b : ℝ} (hl : 0 < l) (hb : 0 < b) : + ∃ K : ℝ, 0 < K ∧ ∀ t q : ℝ, 1 ≤ t → 0 ≤ q → + value l b t q ≤ K*Real.exp (-(l*b/2)*t)*q^b := by + let c := (1-Real.exp (-l))/(2*(b+1)) + have hc : 0 < c := div_pos (sub_pos.2 (Real.exp_lt_one_iff.2 (by linarith))) (by positivity) + have hg : 0 < Real.Gamma b := Real.Gamma_pos_of_pos hb + refine ⟨1/(b*Real.Gamma b*c^b), by positivity, ?_⟩ + intro t q ht hq + have ht0 : 0 < t := by linarith + have ha := scale_pos hl hb ht0 + have hlower : c*Real.exp (l*t) ≤ scale l b t := by + have hh : 1 ≤ Real.exp (l*t)*Real.exp (-l) := by + rw [← Real.exp_add] + exact Real.one_le_exp_iff.2 (by nlinarith) + dsimp only [c,scale] + apply (le_div_iff₀ (by positivity : 0 < 2*(b+1))).2 + have heq : ((1-Real.exp (-l))/(2*(b+1))*Real.exp (l*t))*(2*(b+1)) = + (1-Real.exp (-l))*Real.exp (l*t) := by field_simp + rw [heq] + nlinarith + have hratio : q/scale l b t ≤ q/(c*Real.exp (l*t)) := + div_le_div_of_nonneg_left hq (mul_pos hc (Real.exp_pos _)) hlower + have hpow := Real.rpow_le_rpow (div_nonneg hq ha.le) hratio hb.le + have hbound := (cdf_le_power hb (div_nonneg hq ha.le)).trans + (div_le_div_of_nonneg_right hpow (mul_pos hb hg).le) + have he : Real.exp (l*b/2*t)*(q/(c*Real.exp (l*t)))^b/(b*Real.Gamma b) = + 1/(b*Real.Gamma b*c^b)*Real.exp (-(l*b/2)*t)*q^b := by + rw [Real.div_rpow hq (mul_pos hc (Real.exp_pos _)).le, + Real.mul_rpow hc.le (Real.exp_pos _).le, ← Real.exp_mul] + have hratioexp : Real.exp (l*b/2*t)/Real.exp (l*t*b) = Real.exp (-(l*b/2)*t) := by + rw [← Real.exp_sub]; congr 1; ring + calc + _ = (Real.exp (l*b/2*t)/Real.exp (l*t*b))*q^b/(b*Real.Gamma b*c^b) := by ring + _ = _ := by rw [hratioexp]; ring + calc + _ ≤ Real.exp (l*b/2*t)*((q/(c*Real.exp (l*t)))^b/(b*Real.Gamma b)) := + mul_le_mul_of_nonneg_left hbound (Real.exp_pos _).le + _ = _ := by rw [← mul_div_assoc, he] + +def squaredSine (w : ℝ) := 1/(1+w^2) + +def profile (l b t w : ℝ) := value l b t (squaredSine w) + +def profileT (l b t w : ℝ) := valueT l b t (squaredSine w) + +def profileW (l b t w : ℝ) := (-2*w/(1+w^2)^2)*valueQ l b t (squaredSine w) + +def profileWW (l b t w : ℝ) := (6*w^2-2)/(1+w^2)^3*valueQ l b t (squaredSine w) + + 4*w^2/(1+w^2)^4*valueQQ l b t (squaredSine w) + +lemma squaredSine_pos (w : ℝ) : 0 < squaredSine w := by unfold squaredSine; positivity + +lemma squaredSine_le_one (w : ℝ) : squaredSine w ≤ 1 := by + unfold squaredSine; exact (div_le_one (by positivity)).2 (by nlinarith [sq_nonneg w]) + +lemma hasDerivAt_squaredSine (w : ℝ) : + HasDerivAt squaredSine (-2*w/(1+w^2)^2) w := by + apply ((hasDerivAt_const w 1).div (((hasDerivAt_id w).pow 2).const_add 1) (by simp only [Pi.pow_apply, id_eq]; positivity)).congr_deriv + simp only [Pi.pow_apply, id_eq]; ring + +lemma contDiff_squaredSine (n : WithTop ℕ∞) : ContDiff ℝ n squaredSine := by + unfold squaredSine + exact contDiff_const.div (contDiff_const.add (contDiff_id.pow 2)) (fun w => by positivity) + +lemma contDiffAt_profile {l b : ℝ} (hl : 0 < l) (hb : 0 < b) (n : ℕ) + {v : ℝ × ℝ} (ht : 0 < v.1) : + ContDiffAt ℝ n (fun v : ℝ × ℝ => profile l b v.1 v.2) v := by + have hq := (contDiff_squaredSine n).contDiffAt.comp v contDiffAt_snd + have hm : ContDiffAt ℝ n (fun v : ℝ × ℝ => (v.1,squaredSine v.2)) v := + contDiffAt_fst.prodMk hq + have hh := (contDiffAt_value (v:=(v.1,squaredSine v.2)) hl hb n ht (squaredSine_pos v.2)).comp v hm + dsimp only [Function.comp_def] at hh + exact hh + +lemma hasDerivAt_profile_w {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) (w : ℝ) : + HasDerivAt (profile l b t) (profileW l b t w) w := by + have hh := (hasDerivAt_value_q hl hb ht (squaredSine_pos w)).comp w (hasDerivAt_squaredSine w) + apply hh.congr_deriv + dsimp only [profileW]; ring + +lemma hasDerivAt_profile_t {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) (w : ℝ) : + HasDerivAt (fun s => profile l b s w) (profileT l b t w) t := + hasDerivAt_value_t hl hb ht (squaredSine_pos w) + +lemma deriv_squaredSine_hasDerivAt (w : ℝ) : + HasDerivAt (fun w : ℝ => -2*w/(1+w^2)^2) ((6*w^2-2)/(1+w^2)^3) w := by + have hd := ((hasDerivAt_id w).const_mul (-2)).div + ((((hasDerivAt_id w).pow 2).const_add 1).pow 2) (by simp only [Pi.pow_apply, id_eq]; positivity) + apply hd.congr_deriv + simp only [Pi.pow_apply, id_eq] + field_simp + ring + +lemma hasDerivAt_profileW {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) (w : ℝ) : + HasDerivAt (profileW l b t) (profileWW l b t w) w := by + have hh := (deriv_squaredSine_hasDerivAt w).mul + ((hasDerivAt_valueQ_q hl hb ht (squaredSine_pos w)).comp w (hasDerivAt_squaredSine w)) + apply hh.congr_deriv + dsimp only [profileWW, Function.comp_def] + field_simp + ring + +lemma deriv_profile {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) : + deriv (profile l b t) = profileW l b t := funext fun w => (hasDerivAt_profile_w hl hb ht w).deriv + +lemma second_profile {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) : + iteratedDeriv 2 (profile l b t) = profileWW l b t := by + simp only [iteratedDeriv_succ, iteratedDeriv_zero, deriv_profile hl hb ht] + exact funext fun w => (hasDerivAt_profileW hl hb ht w).deriv + +lemma parameter_deriv_smooth (f : ℝ → ℝ → ℝ) (n : ℕ) {v : ℝ × ℝ} + (hf : ContDiffAt ℝ (n+1) (Function.uncurry f) v) : + ContDiffAt ℝ n (fun v : ℝ × ℝ => deriv (f v.1) v.2) v := by + let g : (ℝ × ℝ) → ℝ → ℝ := fun v w => f v.1 w + have hh : ContDiffAt ℝ (n+1) (Function.uncurry g) (v,v.2) := by + have hm : ContDiffAt ℝ (n+1) (fun r : (ℝ × ℝ) × ℝ => (r.1.1,r.2)) (v,v.2) := by fun_prop + exact hf.comp (v,v.2) hm + have hd := hh.fderiv (m:=n) contDiffAt_snd (by simp) + exact hd.clm_apply contDiffAt_const + +lemma parameter_iteratedDeriv_smooth (f : ℝ → ℝ → ℝ) + (hf : ∀ n : ℕ, ∀ v : ℝ × ℝ, 0 < v.1 → ContDiffAt ℝ n (Function.uncurry f) v) + (k n : ℕ) (v : ℝ × ℝ) (hv : 0 < v.1) : + ContDiffAt ℝ n (fun v : ℝ × ℝ => iteratedDeriv k (f v.1) v.2) v := by + induction k generalizing n with + | zero => exact hf n v hv + | succ k ih => + simpa only [iteratedDeriv_succ] using parameter_deriv_smooth (fun t => iteratedDeriv k (f t)) n (ih (n+1)) + +lemma profile_derivative_continuousAt {l b : ℝ} (hl : 0 < l) (hb : 0 < b) + (k : ℕ) {v : ℝ × ℝ} (hv : 0 < v.1) : + ContinuousAt (fun v : ℝ × ℝ => iteratedDeriv k (profile l b v.1) v.2) v := + (parameter_iteratedDeriv_smooth (profile l b) (fun n _v hv => contDiffAt_profile hl hb n hv) + k 0 v hv).continuousAt + +lemma profile_super {κ t : ℝ} (hκ : 0 < κ ∧ κ < 8) (ht : 0 < t) (w : ℝ) : + w*(1+w^2)*profileW (κ/2) ((8/κ-1)/2) t w + + κ/8*(1+w^2)^2*profileWW (κ/2) ((8/κ-1)/2) t w ≤ + profileT (κ/2) ((8/κ-1)/2) t w := by + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have hi := supersolution (l:=κ/2) (b:=(8/κ-1)/2) (t:=t) (q:=squaredSine w) (div_pos hκ.1 (by norm_num)) hb ht (squaredSine_pos w) (squaredSine_le_one w) + change _ ≤ valueT (κ/2) ((8/κ-1)/2) t (squaredSine w) + convert hi using 1 + dsimp only [profileW, profileWW, squaredSine] + field_simp [hκ.1.ne'] + ring + +lemma hasDerivAt_value_path {l b : ℝ} (hl : 0 < l) (hb : 0 < b) + {T Q : ℝ → ℝ} {s T' Q' : ℝ} (hT : HasDerivAt T T' s) (hQ : HasDerivAt Q Q' s) + (ht : 0 < T s) (hq : 0 < Q s) : + HasDerivAt (fun v => value l b (T v) (Q v)) + (valueT l b (T s) (Q s)*T' + valueQ l b (T s) (Q s)*Q') s := by + have ha := (hasDerivAt_scale l b (T s)).comp s hT + have hs := scale_pos hl hb ht + have hh := ((hT.const_mul (l*b/2)).exp).mul + ((hasDerivAt_cdf hb (div_pos hq hs)).comp s (hQ.div ha hs.ne')) + apply hh.congr_deriv + simp only [Function.comp_def, Pi.div_apply] + dsimp only [valueT, valueQ, value] + have he : Real.exp (l*T s) = 2*(b+1)*scale l b (T s)+1 := by unfold scale; field_simp; ring + rw [he] + field_simp + ring + +lemma hasDerivAt_profile_path {l b : ℝ} (hl : 0 < l) (hb : 0 < b) + {T W : ℝ → ℝ} {s T' W' : ℝ} (hT : HasDerivAt T T' s) (hW : HasDerivAt W W' s) + (ht : 0 < T s) : + HasDerivAt (fun v => profile l b (T v) (W v)) + (profileT l b (T s) (W s)*T' + profileW l b (T s) (W s)*W') s := by + have hq := (hasDerivAt_squaredSine (W s)).comp s hW + have hh := hasDerivAt_value_path hl hb hT hq ht (squaredSine_pos (W s)) + apply hh.congr_deriv + simp only [profileT,profileW,Function.comp_def] + ring + +lemma profile_smooth {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) (n : ℕ) : + ContDiff ℝ n (profile l b t) := by + apply contDiff_iff_contDiffAt.2 + intro w + have hh := (contDiffAt_profile (v:=(t,w)) hl hb n ht).comp w (contDiffAt_const.prodMk contDiffAt_id) + dsimp only [Function.comp_def] at hh + exact hh + +lemma iteratedDeriv_affine (f : ℝ → ℝ) (hf : ∀ n : ℕ, ContDiff ℝ n f) (k : ℕ) (a c x : ℝ) : + iteratedDeriv k (fun x => f (a*x+c)) x = a^k*iteratedDeriv k f (a*x+c) := by + induction k generalizing x with + | zero => simp + | succ k ih => + have he : iteratedDeriv k (fun x => f (a*x+c)) = fun x => a^k*iteratedDeriv k f (a*x+c) := funext ih + rw [iteratedDeriv_succ, he] + have hd : Differentiable ℝ (iteratedDeriv k f) := + ContDiff.differentiable_iteratedDeriv k (hf (k+1)) (by exact_mod_cast Nat.lt_succ_self k) + have hh := ((hd (a*x+c)).hasDerivAt.comp x + (((hasDerivAt_id x).const_mul a).add_const c)).const_mul (a^k) + dsimp only [Function.comp_def, id_eq] at hh + rw [hh.deriv] + simp only [iteratedDeriv_succ,pow_succ,mul_one] + ring + +end SLEExactGauge.AngularBarrier + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianLocal +open BrownianPredictable PredictableLimit BrownianIto TaylorMeshes TimeField +open BrownianField BrownianStopped PartitionMeshes StoppedMeshes + +structure LocalRegular (F V : ℝ → ℝ → ℝ) (b : ℝ → ℝ) (T : ℝ) : Prop where + smooth : ∀ t, ContDiff ℝ 3 (F t) + third_cont : ContinuousOn (fun p : ℝ × ℝ => iteratedDeriv 3 (F p.1) p.2) ((Icc 0 T) ×ˢ univ) + time_cont : ∀ x, ContinuousOn (fun t => F t x) (Icc 0 T) + time_deriv : ∀ t ∈ Ioo 0 T, ∀ x, HasDerivAt (fun u => F u x) (V t x) t + drift_cont : ContinuousOn (fun p : ℝ × ℝ => V p.1 (b p.2)) ((Icc 0 T) ×ˢ (Icc 0 T)) + second_cont : ContinuousOn (fun t => iteratedDeriv 2 (F t) (b t)) (Icc 0 T) + +lemma family_remainder_tendsto_of_eventually_bounded {T : ℝ} (p : PartitionSequence T) + {f : ℕ → ℕ → ℝ → ℝ} {b : ℝ → ℝ} + (hf : ∀ n i, ContDiff ℝ 3 (f n i)) {V K : ℝ} + (hb : ContinuousOn b (Icc 0 T)) (hV : 0 ≤ V) (hK : 0 ≤ K) + (h3 : ∀ n i, i < p.count n → ∀ x ∈ uIcc (b (p.time n i)) (b (p.time n (i+1))), + |iteratedDeriv 3 (f n i) x| ≤ K) + (hQ : ∀ᶠ n in atTop, (∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2) ≤ V) : + Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + remainder₂ (f n i) (b (p.time n i)) (b (p.time n (i+1)))) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.2 + intro ε hε + let δ := ε / ((K+1)*(V+1)) + have hδ : 0 < δ := div_pos hε (mul_pos (by linarith) (by linarith)) + have hs := p.increments_small hb hδ + obtain ⟨N, hN⟩ := eventually_atTop.1 (hs.and hQ) + refine ⟨N, fun n hn => ?_⟩ + rcases hN n hn with ⟨hs, hq⟩ + have hr := sum_family_remainder₂_bound (hf n) (fun i => b (p.time n i)) + (p.count n) K δ hK hδ.le (fun i hi z hz => h3 n i hi z hz) (fun i hi => (hs i hi).le) + simp only [Real.dist_eq, sub_zero] + calc + _ ≤ K * δ / 6 * ∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2 := hr + _ ≤ K * δ / 6 * (V+1) := + mul_le_mul_of_nonneg_left (hq.trans (by linarith)) (by positivity) + _ < ε := by + dsimp [δ] + have hden : 0 < (K+1)*(V+1) := mul_pos (by linarith) (by linarith) + have hid : K * (ε / ((K+1)*(V+1))) / 6 * (V+1) = ε * (K / (6*(K+1))) := by + field_simp + rw [hid] + have hk : K / (6*(K+1)) < 1 := (div_lt_one (by positivity)).2 (by linarith) + simpa using mul_lt_mul_of_pos_left hk hε + +lemma stopped_field_taylor_limit {T τ : ℝ} (hT : 0 ≤ T) (hτ : 0 ≤ τ) (hτT : τ ≤ T) + {F V : ℝ → ℝ → ℝ} {b : ℝ → ℝ} + (hb : ContinuousOn b (Icc 0 T)) (hreg : LocalRegular F V b τ) + (hQ : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1)) - b (mesh T n i))^2) atTop (𝓝 T)) + {K₁ K₂ : ℝ} (hK₁ : 0 ≤ K₁) (hK₂ : 0 ≤ K₂) + (hA : ∀ n i, mesh T n i < τ → + |deriv (F (mesh T n i)) (b (mesh T n i))| ≤ K₁) + (hC : ∀ n i, mesh T n i < τ → + |iteratedDeriv 2 (F (mesh T n i)) (b (mesh T n i))| ≤ K₂) + (hE : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + iteratedDeriv 2 (F (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1)) - b (mesh T n i))^2 - T/(2 : ℝ)^n) else 0) atTop (𝓝 0)) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + deriv (F (mesh T n i)) (b (mesh T n i)) * + (b (mesh T n (i+1)) - b (mesh T n i)) else 0) atTop + (𝓝 (F τ (b τ) - F 0 (b 0) - (∫ t in (0 : ℝ)..τ, V t (b t)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..τ, iteratedDeriv 2 (F t) (b t))) := by + let p := clippedDyadic T τ hT hτ hτT + let C : ℝ → ℝ := fun t => iteratedDeriv 2 (F t) (b t) + let A : ℝ → ℝ := fun t => deriv (F t) (b t) + have hbτ := hb.mono (Icc_subset_Icc le_rfl hτT) + have hQc := clipped_quadratic_eventually_bounded hT hτ hτT hb hQ + obtain ⟨R,hR⟩ := isCompact_Icc.exists_bound_of_continuousOn hbτ + have hc := hreg.third_cont.mono (Set.prod_mono Subset.rfl (subset_univ (Icc (-R) R))) + obtain ⟨K,hK⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hc + have hr := family_remainder_tendsto_of_eventually_bounded p + (f := fun n i => F (p.time n i)) (fun _ _ => hreg.smooth _) + hbτ (show 0 ≤ T+2 by linarith) (le_max_left 0 K) (fun n i hi x hx => by + have hleft : b (p.time n i) ∈ Icc (-R) R := abs_le.1 (by simpa only [Real.norm_eq_abs] using hR _ (p.mem n i hi.le)) + have hright : b (p.time n (i+1)) ∈ Icc (-R) R := abs_le.1 (by simpa only [Real.norm_eq_abs] using hR _ (p.mem n (i+1) hi)) + have hkx := hK (p.time n i,x) ⟨p.mem n i hi.le, uIcc_subset_Icc hleft hright hx⟩ + rw [Real.norm_eq_abs] at hkx + exact hkx.trans (le_max_right 0 K)) hQc + have htime := p.time_increment_tendsto hreg.time_cont hreg.time_deriv hreg.drift_cont + have hriem := prestop_riemann_tendsto hT hτ hτT hreg.second_cont + let Qpred : ℕ → ℝ := fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + C (mesh T n i) * (b (mesh T n (i+1)) - b (mesh T n i))^2 else 0 + have hQpred : Tendsto Qpred atTop (𝓝 (∫ t in (0 : ℝ)..τ, C t)) := by + have heq (n : ℕ) : Qpred n = + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + C (mesh T n i) * ((b (mesh T n (i+1))-b (mesh T n i))^2-T/(2 : ℝ)^n) else 0) + + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then C (mesh T n i)*(T/(2 : ℝ)^n) else 0) := by + unfold Qpred + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + split_ifs <;> ring + dsimp only [C] at heq + simpa only [← heq, zero_add] using hE.add hriem + have hQdiff := clipped_quadraticSum_difference_tendsto hT hτ hτT hb + (fun n i => C (p.time n i)) + (K := max K₂ |C τ|) (hK₂.trans (le_max_left _ _)) + (coefficient_clipped_bound C hC) + have hQeq (n i : ℕ) : + (if mesh T n i < τ then C (p.time n i) * + (b (mesh T n (i+1))-b (mesh T n i))^2 else 0) = + (if mesh T n i < τ then C (mesh T n i) * + (b (mesh T n (i+1))-b (mesh T n i))^2 else 0) := by + split_ifs with h + · simp only [p, clippedDyadic, min_eq_left h.le] + · rfl + simp only [hQeq] at hQdiff + have hQweighted : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + C (p.time n i) * (b (p.time n (i+1)) - b (p.time n i))^2) atTop + (𝓝 (∫ t in (0 : ℝ)..τ, C t)) := by + simpa only [Qpred, sub_add_cancel, zero_add, p, clippedDyadic] using hQdiff.add hQpred + have hTel (n : ℕ) : ∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n i))) = F τ (b τ) - F 0 (b 0) := by + rw [Finset.sum_range_sub (fun i => F (p.time n i) (b (p.time n i))), p.start, p.finish] + have hIdentity (n : ℕ) : (∑ i ∈ Finset.range (p.count n), + A (p.time n i)*(b (p.time n (i+1))-b (p.time n i))) = + F τ (b τ) - F 0 (b 0) - + (∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))))) - (1/2 : ℝ)* + (∑ i ∈ Finset.range (p.count n), + C (p.time n i)*(b (p.time n (i+1))-b (p.time n i))^2) - + (∑ i ∈ Finset.range (p.count n), remainder₂ (F (p.time n i)) + (b (p.time n i)) (b (p.time n (i+1)))) := by + rw [← hTel n] + simp only [Finset.mul_sum, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + simp only [A, C, remainder₂, iteratedDeriv_succ, iteratedDeriv_zero] + ring + have hAclip : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + A (p.time n i)*(b (p.time n (i+1))-b (p.time n i))) atTop + (𝓝 (F τ (b τ) - F 0 (b 0) - (∫ t in (0 : ℝ)..τ, V t (b t)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..τ, C t)) := by + have hh := (((tendsto_const_nhds (x := F τ (b τ) - F 0 (b 0))).sub + htime).sub (hQweighted.const_mul (1/2 : ℝ))).sub hr + simpa only [← hIdentity, sub_zero] using hh + have hAdiff := clipped_linearSum_difference_tendsto hT hτ hτT hb + (fun n i => A (p.time n i)) + (K := max K₁ |A τ|) (hK₁.trans (le_max_left _ _)) + (coefficient_clipped_bound A hA) + have hAeq (n i : ℕ) : + (if mesh T n i < τ then A (p.time n i) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0) = + (if mesh T n i < τ then A (mesh T n i) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0) := by + split_ifs with h + · simp only [p, clippedDyadic, min_eq_left h.le] + · rfl + simp only [hAeq] at hAdiff + have hh := hAclip.sub hAdiff + simpa only [p, clippedDyadic, A, C, sub_sub_cancel, sub_zero] using hh + +theorem stopped_fieldSum_tendsto_ae {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T) + (hreg : ∀ᵐ sample ∂P, LocalRegular (F sample) (V sample) (fun t => B t.toNNReal sample) (τ sample)) + (C : ℕ → ℕ → Ω → ℝ) + (hCeq : ∀ n i, C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (C n i)) + (hC2 : ∀ n i, MemLp (C n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ sample ∂P, |stoppedCoeff 2 B T τ F n i sample| ≤ K₂) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ sample ∂P, |stoppedCoeff 1 B T τ F n i sample| ≤ K₁) : + ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n sample) atTop + (𝓝 (F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0 : ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ sample), + iteratedDeriv 2 (F sample t) (B t.toNNReal sample))) := by + have he := brownian_dyadic_weighted_quadraticError_tendsto hB T + C hC hC2 K₂ hK₂ (fun n i => by + filter_upwards [hCeq n i, hbound n i] with sample he hb + simpa only [he] using hb) + have hCeq_all : ∀ᵐ sample ∂P, ∀ n i, C n i sample = stoppedCoeff 2 B T τ F n i sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (hCeq n)) + have hC_all : ∀ᵐ sample ∂P, ∀ n i, |stoppedCoeff 2 B T τ F n i sample| ≤ K₂ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hbound n)) + have hA_all : ∀ᵐ sample ∂P, ∀ n i, |stoppedCoeff 1 B T τ F n i sample| ≤ K₁ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAbound n)) + filter_upwards [hB.cont, quadraticSum_tendsto hB T, he, hreg, hτ, hC_all, hA_all, hCeq_all] + with sample hb hQ hE hr hτsample hCsample hAsample hCeqsample + have hEs : Tendsto (fun n => dyadicQuadraticError B T (stoppedCoeff 2 B T τ F) n sample) atTop (𝓝 0) := by + convert hE using 1 + funext n + unfold dyadicQuadraticError + simp only [hCeqsample] + let b : ℝ → ℝ := fun t => B t.toNNReal sample + have hbc : Continuous b := hb.comp continuous_real_toNNReal + have hQ' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1))-b (mesh T n i))^2) atTop (𝓝 (T : ℝ)) := by + simpa only [quadraticSum, b, mesh_toNNReal] using hQ + have hE' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ sample then + iteratedDeriv 2 (F sample (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0) + atTop (𝓝 0) := by + have heq (n : ℕ) : dyadicQuadraticError B T (stoppedCoeff 2 B T τ F) n sample = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ sample then + iteratedDeriv 2 (F sample (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0 := by + unfold dyadicQuadraticError + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal] + split_ifs <;> simp + simpa only [heq] using hEs + have hA' (n i : ℕ) (hi : mesh T n i < τ sample) : + |deriv (F sample (mesh T n i)) (b (mesh T n i))| ≤ K₁ := by + simpa only [stoppedCoeff, ite_eq_left hi, iteratedDeriv_succ, iteratedDeriv_zero, + b, mesh_toNNReal] using hAsample n i + have hC' (n i : ℕ) (hi : mesh T n i < τ sample) : + |iteratedDeriv 2 (F sample (mesh T n i)) (b (mesh T n i))| ≤ K₂ := by + simpa only [stoppedCoeff, ite_eq_left hi, b, mesh_toNNReal] using hCsample n i + have ht := stopped_field_taylor_limit T.coe_nonneg hτsample.1 hτsample.2 hbc.continuousOn + hr hQ' hK₁ hK₂ hA' hC' hE' + have heq (n : ℕ) : dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n sample = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ sample then + deriv (F sample (mesh T n i)) (b (mesh T n i)) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0 := by + unfold dyadicDriverSum + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal, iteratedDeriv_succ, iteratedDeriv_zero] + split_ifs <;> simp + simpa only [← heq, b, Real.toNNReal_zero] using ht + +theorem stopped_field_ito_centered_ae {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T) + (hreg : ∀ᵐ sample ∂P, LocalRegular (F sample) (V sample) (fun t => B t.toNNReal sample) (τ sample)) + (A C : ℕ → ℕ → Ω → ℝ) + (hAeq : ∀ n i, A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i) + (hCeq : ∀ n i, C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (C n i)) + (hC2 : ∀ n i, MemLp (C n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ sample ∂P, |stoppedCoeff 2 B T τ F n i sample| ≤ K₂) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hA2 : ∀ n i, MemLp (A n i) 2 P) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ sample ∂P, |stoppedCoeff 1 B T τ F n i sample| ≤ K₁) : + let Y := fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0 : ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample) + Integrable Y P ∧ (∫ sample, Y sample ∂P) = 0 := by + have ht := stopped_fieldSum_tendsto_ae hB T τ F V hτ hreg C hCeq hC hC2 + K₂ hK₂ hbound K₁ hK₁ hAbound + have hAeq_all : ∀ᵐ sample ∂P, ∀ n i, A n i sample = stoppedCoeff 1 B T τ F n i sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAeq n)) + apply limit_centered hB T A hA hA2 K₁ hK₁ ?_ _ ?_ + · intro n i + filter_upwards [hAeq n i, hAbound n i] with sample he hb + simpa only [he] using hb + · filter_upwards [ht, hAeq_all] with sample hsample he + convert hsample using 1 + funext n + unfold dyadicDriverSum + simp only [he] + +end SLEExactGauge.BrownianLocal + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.AngularBarrier + +lemma profileT_continuousAt {l b : ℝ} (hl : 0 < l) (hb : 0 < b) + {v : ℝ × ℝ} (hv : 0 < v.1) : + ContinuousAt (fun v : ℝ × ℝ => profileT l b v.1 v.2) v := by + have hs : ContinuousAt (fun v : ℝ × ℝ => scale l b v.1) v := by + unfold scale; fun_prop + have hq := (contDiff_squaredSine 0).continuous.continuousAt.comp (continuousAt_snd : ContinuousAt (fun v : ℝ × ℝ => v.2) v) + have hz : ContinuousAt (fun v : ℝ × ℝ => squaredSine v.2 / scale l b v.1) v := hq.div hs (scale_pos hl hb hv).ne' + have hp : ContinuousAt (fun v : ℝ × ℝ => pdf b (squaredSine v.2 / scale l b v.1)) v := (hasDerivAt_pdf hb (div_pos (squaredSine_pos v.2) (scale_pos hl hb hv))).continuousAt.comp_of_eq hz rfl + have hf := (contDiffAt_profile hl hb 0 hv).continuousAt + have he : ContinuousAt (fun v : ℝ × ℝ => Real.exp (l*b/2*v.1)) v := by fun_prop + have hc : ContinuousAt (fun v : ℝ × ℝ => l+l/(2*(b+1)*scale l b v.1)) v := + continuousAt_const.add (continuousAt_const.div (continuousAt_const.mul hs) + (mul_ne_zero (by positivity) (scale_pos hl hb hv).ne')) + exact (continuousAt_const.mul hf).sub (((he.mul hp).mul hz).mul hc) + +end SLEExactGauge.AngularBarrier + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerField LoewnerExit AngularBarrier +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +def rawRemaining (η ρ : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + η + Real.log (2*height hε hT U z t) - logDerivative hε hT U z t - Real.log ρ + +def remaining (η ρ : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + max η (rawRemaining hε hT η ρ U z t) + +def angleRatio (sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) : ℝ := + ((position hε hT U z t).re-sdev*x)/height hε hT U z t + +def field (l b η ρ sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) : ℝ := + profile l b (remaining hε hT η ρ U z t) (angleRatio hε hT sdev U z t x) + +def drift (l b η ρ sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) : ℝ := + let y := height hε hT U z t + let w := angleRatio hε hT sdev U z t x + let v := velocity ε (extendDriver T U t) (position hε hT U z t) + profileT l b (remaining hε hT η ρ U z t) w * + (v.im/y - variation hε hT U z t) + + profileW l b (remaining hε hT η ρ U z t) w * (v.re/y-w*v.im/y) + +lemma remaining_pos {η : ℝ} (hη : 0 < η) (ρ : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + 0 < remaining hε hT η ρ U z t := hη.trans_le (le_max_left _ _) + +lemma continuous_height (z : ℂ) : + Continuous (fun v : C(I, ℝ) × ℝ => height hε hT v.1 z v.2) := + continuous_const.max (Complex.continuous_im.comp (continuous_position hε hT z)) + +lemma continuous_rawRemaining (η ρ : ℝ) (z : ℂ) : + Continuous (fun v : C(I, ℝ) × ℝ => rawRemaining hε hT η ρ v.1 z v.2) := by + exact ((continuous_const.add ((continuous_const.mul (continuous_height hε hT z)).log + (fun v => (mul_pos (by norm_num) (height_pos hε hT v.1 z v.2)).ne'))).sub + (continuous_logDerivative hε hT z)).sub continuous_const + +lemma continuous_remaining (η ρ : ℝ) (z : ℂ) : + Continuous (fun v : C(I, ℝ) × ℝ => remaining hε hT η ρ v.1 z v.2) := + continuous_const.max (continuous_rawRemaining hε hT η ρ z) + +lemma continuous_angleRatio (sdev : ℝ) (z : ℂ) : + Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => angleRatio hε hT sdev v.1.1 z v.1.2 v.2) := by + have hp := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1)) + have hy := (continuous_height hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1)) + exact ((Complex.continuous_re.comp hp).sub (continuous_const.mul continuous_snd)).div hy + (fun v => (height_pos hε hT v.1.1 z v.1.2).ne') + +lemma smooth {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) (n : ℕ) : + ContDiff ℝ n (field hε hT l b η ρ sdev U z t) := by + apply (profile_smooth hl hb (remaining_pos hε hT hη ρ U z t) n).comp + unfold angleRatio + fun_prop + +lemma iteratedDeriv_eq {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) (k : ℕ) : + iteratedDeriv k (field hε hT l b η ρ sdev U z t) x = + (-sdev/height hε hT U z t)^k * + iteratedDeriv k (profile l b (remaining hε hT η ρ U z t)) (angleRatio hε hT sdev U z t x) := by + have he : field hε hT l b η ρ sdev U z t = fun x => + profile l b (remaining hε hT η ρ U z t) + ((-sdev/height hε hT U z t)*x+(position hε hT U z t).re/height hε hT U z t) := by + funext x; unfold field angleRatio; congr 1; ring + rw [he, iteratedDeriv_affine _ (profile_smooth hl hb (remaining_pos hε hT hη ρ U z t))] + congr 2 + unfold angleRatio; ring + +lemma continuous_derivative {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (z : ℂ) (k : ℕ) : + Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => iteratedDeriv k (field hε hT l b η ρ sdev v.1.1 z v.1.2) v.2) := by + simp only [iteratedDeriv_eq hε hT hl hb hη] + apply continuous_iff_continuousAt.2 + intro v + have ht := ((continuous_remaining hε hT η ρ z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1))).continuousAt (x := v) + have hw := (continuous_angleRatio hε hT sdev z).continuousAt (x := v) + have hh := (profile_derivative_continuousAt hl hb k (remaining_pos hε hT hη ρ v.1.1 z v.1.2)).comp (ht.prodMk hw) + exact ((continuousAt_const.div ((continuous_height hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1))).continuousAt + (height_pos hε hT v.1.1 z v.1.2).ne').pow k).mul hh + +lemma continuous_field {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (z : ℂ) : + Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => field hε hT l b η ρ sdev v.1.1 z v.1.2 v.2) := by + simpa using continuous_derivative hε hT hl hb hη ρ sdev z 0 + +lemma continuous_drift {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev : ℝ) (z : ℂ) : + Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => drift hε hT l b η ρ sdev v.1.1 z v.1.2 v.2) := by + apply continuous_iff_continuousAt.2 + intro v + have hR := ((continuous_remaining hε hT η ρ z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1))).continuousAt (x := v) + have hW := (continuous_angleRatio hε hT sdev z).continuousAt (x := v) + have htime := (profileT_continuousAt hl hb (remaining_pos hε hT hη ρ v.1.1 z v.1.2)).comp (hR.prodMk hW) + have hspace := (profile_derivative_continuousAt hl hb 1 (remaining_pos hε hT hη ρ v.1.1 z v.1.2)).comp (hR.prodMk hW) + have hspace' : ContinuousAt (fun v : (C(I, ℝ) × ℝ) × ℝ => profileW l b + (remaining hε hT η ρ v.1.1 z v.1.2) (angleRatio hε hT sdev v.1.1 z v.1.2 v.2)) v := by + simpa only [Function.comp_def, iteratedDeriv_succ, iteratedDeriv_zero, + deriv_profile hl hb (remaining_pos hε hT hη ρ _ _ _)] using hspace + have hp := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1)) + have hd := (continuous_joint_extendDriver T).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1)) + have hv := ((continuous_velocity hε).comp (hd.prodMk hp)).continuousAt (x := v) + have hy := ((continuous_height hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1))).continuousAt (x := v) + have hn := (height_pos hε hT v.1.1 z v.1.2).ne' + exact (htime.mul (((Complex.continuous_im.continuousAt.comp hv).div hy hn).sub + ((continuous_variation hε hT z).comp (continuous_fst : Continuous (fun v : (C(I, ℝ) × ℝ) × ℝ => v.1))).continuousAt (x := v))).add + (hspace'.mul (((Complex.continuous_re.continuousAt.comp hv).div hy hn).sub + ((hW.mul (Complex.continuous_im.continuousAt.comp hv)).div hy hn))) + +lemma rawRemaining_eq (η ρ : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) + (hy : ε ≤ (position hε hT U z t).im) : + rawRemaining hε hT η ρ U z t = η + Real.log (radius hε hT U z t) - Real.log ρ := by + have hz := hε.trans_le hy + unfold rawRemaining radius height + rw [max_eq_right hy, Real.log_div (by positivity) (Real.exp_pos _).ne', Real.log_exp] + ring + +lemma rawRemaining_gt (η : ℝ) {ρ : ℝ} (hρ : 0 < ρ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) + (hy : ε ≤ (position hε hT U z t).im) (hr : ρ < radius hε hT U z t) : + η < rawRemaining hε hT η ρ U z t := by + rw [rawRemaining_eq hε hT η ρ U z t hy] + have hh := Real.strictMonoOn_log hρ (hρ.trans hr) hr + linarith + +lemma time_deriv {l b η ρ : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (hρ : 0 < ρ) + (sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) {t : ℝ} + (ht : t ∈ Ioo 0 T) (hy : ε < (position hε hT U z t).im) + (hr : ρ < radius hε hT U z t) (x : ℝ) : + HasDerivAt (fun s => field hε hT l b η ρ sdev U z s x) (drift hε hT l b η ρ sdev U z t x) t := by + have hH := position_deriv hε hT U z ht + have hL := hasDerivAt_logDerivative hε hT U z ht + have hIm := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t hH + have hRe := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hH + dsimp only [Function.comp_def, Complex.imCLM_apply, Complex.reCLM_apply] at hIm hRe + have hY : HasDerivAt (height hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)).im t := by + apply hIm.congr_of_eventuallyEq + filter_upwards [hIm.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hy)] with s hs + exact max_eq_right hs.le + have hraw : HasDerivAt (rawRemaining hε hT η ρ U z) + ((velocity ε (extendDriver T U t) (position hε hT U z t)).im / height hε hT U z t - + variation hε hT U z t) t := by + have hh := (((hY.const_mul 2).log (by have := height_pos hε hT U z t; positivity)).const_add η).sub hL + apply (hh.sub_const (Real.log ρ)).congr_deriv + ring + have hR : HasDerivAt (remaining hε hT η ρ U z) + ((velocity ε (extendDriver T U t) (position hε hT U z t)).im / height hε hT U z t - + variation hε hT U z t) t := by + apply hraw.congr_of_eventuallyEq + have hh := rawRemaining_gt hε hT η hρ U z t hy.le hr + filter_upwards [hraw.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hh)] with s hs + exact max_eq_right hs.le + have hW : HasDerivAt (fun s => angleRatio hε hT sdev U z s x) + ((velocity ε (extendDriver T U t) (position hε hT U z t)).re / height hε hT U z t - + angleRatio hε hT sdev U z t x * (velocity ε (extendDriver T U t) (position hε hT U z t)).im / height hε hT U z t) t := by + apply ((hRe.sub_const (sdev*x)).div hY (height_pos hε hT U z t).ne').congr_deriv + dsimp only [angleRatio] + field_simp + exact hasDerivAt_profile_path hl hb hR hW (remaining_pos hε hT hη ρ U z t) + +lemma field_prefix_eq {ε S T : ℝ} (hε : 0 < ε) (hS : 0 ≤ S) (hT : 0 ≤ T) + (hST : S ≤ T) (U V : C(I, ℝ)) (z : ℂ) (l b η ρ sdev : ℝ) + (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) + {t : ℝ} (ht : t ∈ Icc 0 S) : + field hε hS l b η ρ sdev U z t = field hε hT l b η ρ sdev V z t := by + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V z hUV ht + have hL := logDerivative_prefix_eq hε hS hT hS le_rfl hST U V z hUV ht + funext x + simp only [field, remaining, rawRemaining, angleRatio, height, hH, hL] + +lemma regular {l b η ρ : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (hρ : 0 < ρ) + (hTp : 0 < T) (sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (δ : ℝ) + (B : ℝ → ℝ) (hB : Continuous B) : + BrownianLocal.LocalRegular (field hε hT l b η ρ sdev U z) + (drift hε hT l b η ρ sdev U z) B (stop hε hT U z ρ δ) := by + constructor + · intro t; exact smooth hε hT hl hb hη ρ sdev U z t 3 + · have hm : Continuous (fun v : ℝ × ℝ => ((U,v.1),v.2)) := + (continuous_const.prodMk continuous_fst).prodMk continuous_snd + exact ((continuous_derivative hε hT hl hb hη ρ sdev z 3).comp hm).continuousOn + · intro x + have hm : Continuous (fun t : ℝ => ((U,t),x)) := + (continuous_const.prodMk continuous_id).prodMk continuous_const + exact ((continuous_field hε hT hl hb hη ρ sdev z).comp hm).continuousOn + · intro t ht x + have htT : t ∈ Ioo 0 T := ⟨ht.1,ht.2.trans_le (stop_bounds hε hT U z ρ δ).2⟩ + have hh := (deficit_pos_iff hε hT U z ρ δ t).1 + (positive_before hε hT hTp U z ρ δ ht.1.le ht.2) + exact time_deriv hε hT hl hb hη hρ sdev U z htT hh.2.1 hh.1 x + · have hm : Continuous (fun v : ℝ × ℝ => ((U,v.1),B v.2)) := + (continuous_const.prodMk continuous_fst).prodMk (hB.comp continuous_snd) + exact ((continuous_drift hε hT hl hb hη ρ sdev z).comp hm).continuousOn + · have hm : Continuous (fun t : ℝ => ((U,t),B t)) := + (continuous_const.prodMk continuous_id).prodMk hB + exact ((continuous_derivative hε hT hl hb hη ρ sdev z 2).comp hm).continuousOn + +lemma coefficient_bound {l b η : ℝ} (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) + (ρ sdev M D : ℝ) (z : ℂ) (k : ℕ) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ (U : C(I, ℝ)) (t x : ℝ), + remaining hε hT η ρ U z t ≤ M → |angleRatio hε hT sdev U z t x| ≤ D → + |iteratedDeriv k (field hε hT l b η ρ sdev U z t) x| ≤ K := by + have hc : ContinuousOn (fun v : ℝ × ℝ => iteratedDeriv k (profile l b v.1) v.2) + ((Icc η M) ×ˢ (Icc (-D) D)) := by + intro v hv + exact (profile_derivative_continuousAt hl hb k (hη.trans_le hv.1.1)).continuousWithinAt + obtain ⟨K,hK⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hc + refine ⟨(|sdev|/ε)^k * max 0 K, by positivity, ?_⟩ + intro U t x ht hw + rw [iteratedDeriv_eq hε hT hl hb hη, abs_mul, abs_pow, abs_div, abs_neg, + abs_of_pos (height_pos hε hT U z t)] + apply mul_le_mul + · exact pow_le_pow_left₀ (by positivity) + (div_le_div_of_nonneg_left (abs_nonneg _) hε (le_max_left _ _)) k + · apply le_trans _ (le_max_right 0 K) + simpa only [Real.norm_eq_abs] using hK + (remaining hε hT η ρ U z t, angleRatio hε hT sdev U z t x) + ⟨⟨le_max_left _ _,ht⟩,abs_le.1 hw⟩ + · exact abs_nonneg _ + · positivity + +lemma physical_algebra (κ x y A B C : ℝ) (hy : 0 < y) : + A*((-2*y/(x^2+y^2))/y - (-2*(x^2-y^2)/(x^2+y^2)^2)) + + B*((2*x/(x^2+y^2))/y - (x/y)*(-2*y/(x^2+y^2))/y) + + (1/2:ℝ)*(κ/y^2*C) = + (4*y^2/(x^2+y^2)^2)*(-A+(x/y)*(1+(x/y)^2)*B+κ/8*(1+(x/y)^2)^2*C) := by + have hn : x^2+y^2 ≠ 0 := by positivity + field_simp + ring + +lemma drift_nonpos {κ η : ℝ} (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) + (ρ : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) + (hy : ε ≤ (position hε hT U z t).im) + (hU : extendDriver T U t = Real.sqrt κ*x) : + drift hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t x + + (1/2:ℝ)*iteratedDeriv 2 (field hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t) x ≤ 0 := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have ht := remaining_pos hε hT hη ρ U z t + have hh : height hε hT U z t = (position hε hT U z t).im := max_eq_right hy + rw [iteratedDeriv_eq hε hT hl hb hη, second_profile hl hb ht] + dsimp only [drift] + rw [variation_of_unclipped hε hT U z t hy, velocity_eq hy, hh, hU] + simp only [Complex.div_re, Complex.div_im, Complex.re_ofNat, Complex.im_ofNat, + Complex.sub_re, Complex.ofReal_re, Complex.sub_im, Complex.ofReal_im, + sub_zero, zero_mul, Complex.normSq_apply] + simp only [neg_div, neg_sq, div_pow, Real.sq_sqrt hκ.1.le] + have he := physical_algebra κ ((position hε hT U z t).re-Real.sqrt κ*x) + (position hε hT U z t).im + (profileT (κ/2) ((8/κ-1)/2) (remaining hε hT η ρ U z t) (angleRatio hε hT (Real.sqrt κ) U z t x)) + (profileW (κ/2) ((8/κ-1)/2) (remaining hε hT η ρ U z t) (angleRatio hε hT (Real.sqrt κ) U z t x)) + (profileWW (κ/2) ((8/κ-1)/2) (remaining hε hT η ρ U z t) (angleRatio hε hT (Real.sqrt κ) U z t x)) (hε.trans_le hy) + have ha : angleRatio hε hT (Real.sqrt κ) U z t x = + ((position hε hT U z t).re-Real.sqrt κ*x)/(position hε hT U z t).im := by + unfold angleRatio; rw [hh] + rw [← ha] at he + convert (he.trans_le (mul_nonpos_of_nonneg_of_nonpos (by positivity) (by + have hs := profile_super hκ ht (angleRatio hε hT (Real.sqrt κ) U z t x) + linarith))) using 1; ring + +end SLEExactGauge.GammaField + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.GammaPredictable +open LoewnerCutoff LoewnerExit GammaField BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +open scoped unitInterval +variable {ε : ℝ} (hε : 0 < ε) + +def coeffAt (k : ℕ) (s : ℝ≥0) (l b η sdev : ℝ) (z : ℂ) (ρ δ : ℝ) + (q : C(I, ℝ) × ℝ) : ℝ := by + classical + exact if ∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg q.1 z ρ δ t then + iteratedDeriv k (field hε s.coe_nonneg l b η ρ sdev q.1 z s) q.2 else 0 + +lemma coeffAt_measurable (k : ℕ) (_hk : k = 1 ∨ k = 2) (s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (ρ δ : ℝ) : + @Measurable (C(I, ℝ) × ℝ) ℝ (@Prod.instMeasurableSpace _ _ (borel _) inferInstance) _ (coeffAt hε k s l b η sdev z ρ δ) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hc : Continuous (fun q : C(I, ℝ) × ℝ => + iteratedDeriv k (field hε s.coe_nonneg l b η ρ sdev q.1 z s) q.2) := by + have hp : Continuous (fun q : C(I, ℝ) × ℝ => ((q.1,(s:ℝ)),q.2)) := + (continuous_fst.prodMk continuous_const).prodMk continuous_snd + have hc := (continuous_derivative hε s.coe_nonneg hl hb hη ρ sdev z k).comp hp + dsimp only [Function.comp_def] at hc + exact hc + apply hc.measurable.ite _ measurable_const + exact ((isOpen_positive_on hε s.coe_nonneg z ρ δ s).preimage continuous_fst).measurableSet + +def rawCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (l b η sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) : ℝ := + if s < T then coeffAt hε k s l b η sdev z ρ δ (BrownianDriver.path B sdev s sample, B s sample) else 0 + +lemma rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k = 1 ∨ k = 2) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (ρ δ : ℝ) : + Measurable[pastSigma B s] (rawCoeff hε k B T s l b η sdev z ρ δ) := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s l b η sdev hl hb hη z ρ δ).comp + ((BrownianDriver.path_measurable_past B sdev s).prodMk (past_measurable_eval B (s := s) le_rfl)) + · exact measurable_const + +lemma rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k = 1 ∨ k = 2) (T s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (ρ δ : ℝ) : + AEMeasurable (rawCoeff hε k B T s l b η sdev z ρ δ) P := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s l b η sdev hl hb hη z ρ δ).comp_aemeasurable + ((BrownianDriver.path_aemeasurable hB sdev s).prodMk (hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable) + · exact aemeasurable_const + +lemma rawCoeff_eq {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (hT : 0 < (T:ℝ)) (l b η sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + rawCoeff hε k B T s l b η sdev z ρ δ sample = + if (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ then + iteratedDeriv k (field hε T.coe_nonneg l b η ρ sdev (BrownianDriver.path B sdev T sample) z s) (B s sample) else 0 := by + classical + by_cases hsT : s < T + · have he := BrownianDriver.prefix_eq B sdev s T sample hc hsT.le + have hf := field_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z l b η ρ sdev he + ⟨s.coe_nonneg, le_rfl⟩ + have hd := deficit_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z ρ δ he + have hi : (∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg (BrownianDriver.path B sdev s sample) z ρ δ t) ↔ + (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := by + rw [lt_stop_iff hε T.coe_nonneg hT _ z ρ δ ⟨s.coe_nonneg,hsT⟩] + exact forall₂_congr (fun t ht => by rw [hd ht]) + simp only [rawCoeff, ite_eq_left hsT, coeffAt, hi, hf] + · have hstop : ¬ (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := + not_lt_of_ge ((stop_bounds hε T.coe_nonneg _ z ρ δ).2.trans (not_lt.1 hsT)) + simp only [rawCoeff, ite_eq_right hsT, ite_eq_right hstop] + +lemma rawCoeff_stoppedCoeff_ae {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (T : ℝ≥0) + (hT : 0 < (T:ℝ)) (l b η sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (n i : ℕ) : + rawCoeff hε k B T (dyadicTime T n i) l b η sdev z ρ δ =ᵐ[P] + stoppedCoeff k B T + (fun sample => stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ) + (fun sample => field hε T.coe_nonneg l b η ρ sdev (BrownianDriver.path B sdev T sample) z) n i := by + filter_upwards [hB.cont] with sample hc + rw [rawCoeff_eq hε k B T _ hT l b η sdev z ρ δ sample hc] + simp only [stoppedCoeff, coe_dyadicTime] + +end SLEExactGauge.GammaPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerField LoewnerExit AngularBarrier +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +lemma ratio_bound {δ : ℝ} (hδ : 0 < δ) (sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t x : ℝ) + (hy : ε ≤ (position hε hT U z t).im) (hs : δ ≤ sine hε hT U z t) + (hU : extendDriver T U t = sdev*x) : + |angleRatio hε hT sdev U z t x| ≤ 1/δ := by + have hyp := hε.trans_le hy + have hn : 0 < ‖position hε hT U z t - (extendDriver T U t : ℂ)‖ := by + apply norm_pos_iff.2 + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im, Complex.ofReal_im, sub_zero, Complex.zero_im] at hi + linarith + have hh : δ * ‖position hε hT U z t - (extendDriver T U t : ℂ)‖ ≤ (position hε hT U z t).im := by + apply (le_div_iff₀ hn).1 + unfold sine at hs + rw [clampIm_eq (show ε ≤ (position hε hT U z t - (extendDriver T U t : ℂ)).im by simpa using hy)] at hs + exact hs + have hx := mul_le_mul_of_nonneg_left (Complex.abs_re_le_norm + (position hε hT U z t - (extendDriver T U t : ℂ))) hδ.le + have hxx := hx.trans hh + simp only [Complex.sub_re, Complex.ofReal_re, hU] at hxx + rw [angleRatio, height, max_eq_right hy, abs_div, abs_of_pos hyp] + apply (div_le_iff₀ hyp).2 + rw [div_mul_eq_mul_div, one_mul] + apply (le_div_iff₀ hδ).2 + nlinarith [hxx] + +end SLEExactGauge.GammaField + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/BoundaryDiffusion.lean b/lean/OAI/Probability/SLELocalization/BoundaryDiffusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e6f7fbaac03c381b1ae1312328c9613fd49fe3d --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/BoundaryDiffusion.lean @@ -0,0 +1,1028 @@ +import Mathlib +import OAI.Probability.SLELocalization.SwallowingLaws +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Boundary Green estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing GreenPhysical + +lemma deterministic_budget {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (κ β a : ℝ) (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (U : C(I, ℝ)) (x L : ℝ) (b : ℝ → ℝ) (hb : Continuous b) + (hb0 : b 0=0) (hU : EqOn (extendDriver T U) (fun t => Real.sqrt κ*b t) (Icc 0 T)) : + let τ := stop hε hT.le U x β a L + let F := field hε hT.le β a (Real.sqrt κ) U x + let V := drift hε hT.le β a (Real.sqrt κ) U x + F τ (b τ) ≤ + (F τ (b τ)-F 0 (b 0)-(∫ t in (0:ℝ)..τ,V t (b t))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ,iteratedDeriv 2 (F t) (b t))+radial (-β) x ε := by + dsimp only + let τ := stop hε hT.le U x β a L + let F := field hε hT.le β a (Real.sqrt κ) U x + let V := drift hε hT.le β a (Real.sqrt κ) U x + have htau := stop_bounds hε hT.le U x β a L + have hmap : Continuous (fun t => ((U,t),b t)) := (continuous_const.prodMk continuous_id).prodMk hb + have hV : Continuous (fun t => V t (b t)) := by + have hh := (continuous_drift hε hT.le β a (Real.sqrt κ) x).comp hmap + dsimp only [Function.comp_def] at hh + exact hh + have hQ : Continuous (fun t => iteratedDeriv 2 (F t) (b t)) := by + have hh := (continuous_coeff hε hT.le β a (Real.sqrt κ) x 2 (Or.inr rfl)).comp hmap + dsimp only [Function.comp_def] at hh + exact hh + have hneg : (∫ t in (0:ℝ)..τ, V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t)) ≤ 0 := by + have hh : (∫ t in (0:ℝ)..τ, V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t)) ≤ + ∫ _t in (0:ℝ)..τ, (0:ℝ) := by + apply intervalIntegral.integral_mono_on_of_le_Ioo htau.1 + ((hV.add (continuous_const.mul hQ)).intervalIntegrable _ _) + (intervalIntegrable_const) + intro t ht + have hh := (deficit_pos_iff hε hT.le U x β a L t).1 + (positive_before hε hT.le hT U x β a L ht.1.le ht.2) + change V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t) ≤ 0 + have he := generator_field hε hT.le κ β a hκ U x t (b t) hh.1.le + (hU ⟨ht.1.le,ht.2.le.trans htau.2⟩) + change V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t) = _ at he + rw [he] + exact mul_nonpos_of_nonneg_of_nonpos (factor_pos hε hT.le β a U x t).le + (generator_nonpos hκ hβ ha hba (hε.trans hh.1) hε) + simpa using hh + have hhalf : IntervalIntegrable (fun t => (1/2:ℝ)*iteratedDeriv 2 (F t) (b t)) volume 0 τ := + (hQ.intervalIntegrable _ _).const_mul _ + rw [intervalIntegral.integral_add (hV.intervalIntegrable _ _) hhalf, + intervalIntegral.integral_const_mul] at hneg + have hini : F 0 (b 0) = radial (-β) x ε := by rw [hb0]; exact field_initial hε hT.le β a _ U x + change F τ (b τ) ≤ (F τ (b τ)-F 0 (b 0)-(∫ t in (0:ℝ)..τ,V t (b t))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ,iteratedDeriv 2 (F t) (b t))+radial (-β) x ε + rw [hini] + linarith + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.Swallowing +open LoewnerCutoff LoewnerExit BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +variable {ε : ℝ} (hε : 0 < ε) + +def coeffAt (k : ℕ) (s : ℝ≥0) (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) + (q : C(I, ℝ) × ℝ) : ℝ := by + classical + exact if ∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg q.1 z ρ δ t then + iteratedDeriv k (field hε s.coe_nonneg β C sdev q.1 z s) q.2 else 0 + +lemma coeffAt_measurable (k : ℕ) (hk : k = 1 ∨ k = 2) (s : ℝ≥0) + (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + @Measurable (C(I, ℝ) × ℝ) ℝ (@Prod.instMeasurableSpace _ _ (borel _) inferInstance) _ (coeffAt hε k s β C sdev z ρ δ) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hc : Continuous (fun q : C(I, ℝ) × ℝ => + iteratedDeriv k (field hε s.coe_nonneg β C sdev q.1 z s) q.2) := by + have hp : Continuous (fun q : C(I, ℝ) × ℝ => ((q.1,(s:ℝ)),q.2)) := + (continuous_fst.prodMk continuous_const).prodMk continuous_snd + have hh := (continuous_coeff hε s.coe_nonneg β C sdev z k hk).comp hp + dsimp only [Function.comp_def] at hh + exact hh + apply hc.measurable.ite _ measurable_const + exact ((isOpen_positive_on hε s.coe_nonneg z ρ δ s).preimage continuous_fst).measurableSet + +def rawCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) : ℝ := + if s < T then coeffAt hε k s β C sdev z ρ δ (BrownianDriver.path B sdev s sample, B s sample) else 0 + +lemma rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k = 1 ∨ k = 2) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + Measurable[pastSigma B s] (rawCoeff hε k B T s β C sdev z ρ δ) := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s β C sdev z ρ δ).comp + ((BrownianDriver.path_measurable_past B sdev s).prodMk (past_measurable_eval B (s := s) le_rfl)) + · exact measurable_const + +lemma rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k = 1 ∨ k = 2) (T s : ℝ≥0) + (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + AEMeasurable (rawCoeff hε k B T s β C sdev z ρ δ) P := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s β C sdev z ρ δ).comp_aemeasurable + ((BrownianDriver.path_aemeasurable hB sdev s).prodMk (hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable) + · exact aemeasurable_const + +lemma rawCoeff_eq {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (hT : 0 < (T:ℝ)) (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + rawCoeff hε k B T s β C sdev z ρ δ sample = + if (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ then + iteratedDeriv k (field hε T.coe_nonneg β C sdev (BrownianDriver.path B sdev T sample) z s) (B s sample) else 0 := by + classical + by_cases hsT : s < T + · have he := BrownianDriver.prefix_eq B sdev s T sample hc hsT.le + have hf := field_prefix_eq hε T.coe_nonneg s.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z β C sdev he + ⟨s.coe_nonneg, le_rfl⟩ + have hd := deficit_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z ρ δ he + have hi : (∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg (BrownianDriver.path B sdev s sample) z ρ δ t) ↔ + (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := by + rw [lt_stop_iff hε T.coe_nonneg hT _ z ρ δ ⟨s.coe_nonneg,hsT⟩] + exact forall₂_congr (fun t ht => by rw [hd ht]) + simp only [rawCoeff, ite_eq_left hsT, coeffAt, hi, hf] + · have hstop : ¬ (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := + not_lt_of_ge ((stop_bounds hε T.coe_nonneg _ z ρ δ).2.trans (not_lt.1 hsT)) + simp only [rawCoeff, ite_eq_right hsT, ite_eq_right hstop] + +lemma rawCoeff_stoppedCoeff_ae {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (T : ℝ≥0) + (hT : 0 < (T:ℝ)) (β C sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (n i : ℕ) : + rawCoeff hε k B T (dyadicTime T n i) β C sdev z ρ δ =ᵐ[P] + stoppedCoeff k B T + (fun sample => stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ) + (fun sample => field hε T.coe_nonneg β C sdev (BrownianDriver.path B sdev T sample) z) n i := by + filter_upwards [hB.cont] with sample hc + rw [rawCoeff_eq hε k B T _ hT β C sdev z ρ δ sample hc] + simp only [stoppedCoeff, coe_dyadicTime] + +theorem localized_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (β C sdev : ℝ) (hβ : β ≤ 1) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (ρ δ : ℝ) : + let U := BrownianDriver.path B sdev T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg β C sdev (U sample) z + let V := fun sample => drift hε T.coe_nonneg β C sdev (U sample) z + let Y := fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample) + Integrable Y P ∧ (∫ sample, Y sample ∂P) = 0 := by + dsimp only + let U := BrownianDriver.path B sdev T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg β C sdev (U sample) z + let V := fun sample => drift hε T.coe_nonneg β C sdev (U sample) z + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact regular hε T.coe_nonneg hT β C sdev hβ (U sample) z ρ δ _ + (hc.comp continuous_real_toNNReal) + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => stop_bounds hε T.coe_nonneg (U sample) z ρ δ) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg β C sdev hβ z 1 (Or.inl rfl) + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg β C sdev hβ z 2 (Or.inr (Or.inl rfl)) + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg β C sdev W z t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => rawCoeff hε 1 B T (dyadicTime T n i) β C sdev z ρ δ + let Q := fun n i => rawCoeff hε 2 B T (dyadicTime T n i) β C sdev z ρ δ + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 1 T hT β C sdev z ρ δ n i + have hCe (n i : ℕ) : Q n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 2 T hT β C sdev z ρ δ n i + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + rawCoeff_measurable_past hε 1 (Or.inl rfl) B T _ _ _ _ z ρ δ + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := + rawCoeff_measurable_past hε 2 (Or.inr rfl) B T _ _ _ _ z ρ δ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 1 (Or.inl rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (Q n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 2 (Or.inr rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |Q n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_field_ito_centered_ae hB T τ F V htau hreg A Q hAe hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) hAm hA2 K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + exact hi + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.Swallowing +open GreenPhysical LoewnerCutoff LoewnerExit + +abbrev correction {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β C : ℝ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (z : ℂ) (ω : Ω) : ℝ := + let U := BrownianDriver.path B (Real.sqrt κ) T ω + let τ := stop hε T.coe_nonneg U z 0 0 + let F := field hε T.coe_nonneg β C (Real.sqrt κ) U z + let V := drift hε T.coe_nonneg β C (Real.sqrt κ) U z + F τ (B τ.toNNReal ω)-F 0 (B 0 ω)- + (∫ t in (0:ℝ)..τ, V t (B t.toNNReal ω))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ, iteratedDeriv 2 (F t) (B t.toNNReal ω) + +def budget {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β C : ℝ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (z : ℂ) (ω : Ω) : ℝ := + if T=0 then lyapunov β C z.re z.im else + max (correction B κ β C hε T z ω+lyapunov β C z.re z.im) 0 + +lemma field_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (hy : ε ≤ z.im) : + field hε hT β C s U z 0 0 = lyapunov β C z.re z.im := by + simp only [field,LoewnerField.height,position_initial,mul_zero,sub_zero,max_eq_right hy] + +lemma generator_field {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (κ β C : ℝ) (hκ : 0 ≤ κ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) + (hy : ε ≤ (position hε hT U z t).im) + (hU : extendDriver T U t = Real.sqrt κ*b) : + drift hε hT β C (Real.sqrt κ) U z t b+ + (1/2:ℝ)*iteratedDeriv 2 (field hε hT β C (Real.sqrt κ) U z t) b = + generator κ β C ((position hε hT U z t).re-Real.sqrt κ*b) (LoewnerField.height hε hT U z t) := by + have hh : LoewnerField.height hε hT U z t = (position hε hT U z t).im := max_eq_right hy + rw [second_eq,Real.sq_sqrt hκ] + dsimp only [drift] + rw [velocity_eq hy,hh,hU] + simp only [generator,Complex.div_re,Complex.div_im,Complex.re_ofNat,Complex.im_ofNat, + Complex.sub_re,Complex.ofReal_re,Complex.sub_im,Complex.ofReal_im,sub_zero,zero_mul, + Complex.normSq_apply] + ring + +lemma deterministic_budget {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (κ β : ℝ) (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (U : C(I, ℝ)) (z : ℂ) (hz : ε ≤ z.im) (b : ℝ → ℝ) (hb : Continuous b) + (hb0 : b 0=0) (hU : EqOn (extendDriver T U) (fun t => Real.sqrt κ*b t) (Icc 0 T)) : + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + let τ := stop hε hT.le U z 0 0 + let F := field hε hT.le β C (Real.sqrt κ) U z + let V := drift hε hT.le β C (Real.sqrt κ) U z + let E := ∫ t in (0:ℝ)..τ, + (((position hε hT.le U z t).re-Real.sqrt κ*b t)^2+(LoewnerField.height hε hT.le U z t)^2)^(β/2-1) + 0 ≤ E ∧ + F τ (b τ)+d*E ≤ + (F τ (b τ)-F 0 (b 0)- (∫ t in (0:ℝ)..τ,V t (b t))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ, iteratedDeriv 2 (F t) (b t))+lyapunov β C z.re z.im := by + dsimp only + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + let τ := stop hε hT.le U z 0 0 + let F := field hε hT.le β C (Real.sqrt κ) U z + let V := drift hε hT.le β C (Real.sqrt κ) U z + let H := fun t => (((position hε hT.le U z t).re-Real.sqrt κ*b t)^2+ + (LoewnerField.height hε hT.le U z t)^2)^(β/2-1) + have htau := stop_bounds hε hT.le U z 0 0 + have hmap : Continuous (fun t => ((U,t),b t)) := (continuous_const.prodMk continuous_id).prodMk hb + have hV : Continuous (fun t => V t (b t)) := by + have hh := (continuous_drift hε hT.le β C (Real.sqrt κ) z).comp hmap + dsimp only [Function.comp_def] at hh + exact hh + have hQ : Continuous (fun t => iteratedDeriv 2 (F t) (b t)) := by + have hh := (continuous_coeff hε hT.le β C (Real.sqrt κ) z 2 (Or.inr rfl)).comp hmap + dsimp only [Function.comp_def] at hh + exact hh + have hHc : Continuous H := by + have hP := (continuous_position hε hT.le z).comp (continuous_const.prodMk continuous_id : Continuous (fun t : ℝ => (U,t))) + have hx := (Complex.continuous_re.comp hP).sub (continuous_const.mul hb : Continuous (fun t => Real.sqrt κ*b t)) + have hy : Continuous (LoewnerField.height hε hT.le U z) := continuous_const.max (Complex.continuous_im.comp hP) + exact ((hx.pow 2).add (hy.pow 2)).rpow_const (fun t => Or.inl (q_pos _ (LoewnerField.height_pos hε hT.le U z t)).ne') + have hH0 : 0 ≤ ∫ t in (0:ℝ)..τ,H t := by + apply intervalIntegral.integral_nonneg htau.1 + intro t ht + exact Real.rpow_nonneg (by positivity) _ + refine ⟨hH0,?_⟩ + have hpoint : ∀ t ∈ Ioo 0 τ, V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t) ≤ -d*H t := by + intro t ht + have hh := (deficit_pos_iff hε hT.le U z 0 0 t).1 + (positive_before hε hT.le hT U z 0 0 ht.1.le ht.2) + have he := generator_field hε hT.le κ β C (by linarith) U z t (b t) hh.2.1.le + (hU ⟨ht.1.le,ht.2.le.trans htau.2⟩) + change V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t) = _ at he + rw [he] + exact (generator_negative hκ hβ hβκ _ (LoewnerField.height_pos hε hT.le U z t)).2.2 + have hm : (∫ t in (0:ℝ)..τ, V t (b t)+(1/2:ℝ)*iteratedDeriv 2 (F t) (b t)) ≤ + ∫ t in (0:ℝ)..τ, -d*H t := by + exact intervalIntegral.integral_mono_on_of_le_Ioo htau.1 + ((hV.add (continuous_const.mul hQ)).intervalIntegrable _ _) + ((continuous_const.mul hHc).intervalIntegrable _ _) hpoint + have hhalf : IntervalIntegrable (fun t => (1/2:ℝ)*iteratedDeriv 2 (F t) (b t)) volume 0 τ := + (hQ.intervalIntegrable _ _).const_mul _ + rw [intervalIntegral.integral_add (hV.intervalIntegrable _ _) hhalf, + intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul] at hm + have hinit : F 0 (b 0) = lyapunov β C z.re z.im := by rw [hb0]; exact field_initial hε hT.le β C _ U z hz + change F τ (b τ)+d*(∫ t in (0:ℝ)..τ,H t) ≤ + (F τ (b τ)-F 0 (b 0)-(∫ t in (0:ℝ)..τ,V t (b t))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ,iteratedDeriv 2 (F t) (b t))+lyapunov β C z.re z.im + rw [hinit] + linarith + +lemma budget_mean {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (κ β : ℝ) (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (z : ℂ) (hz : ε ≤ z.im) : + let C := (2*κ-8-κ*β)/4 + Integrable (budget B κ β C hε T z) P ∧ + (∫ ω,budget B κ β C hε T z ω ∂P) = lyapunov β C z.re z.im ∧ + ∀ ω, 0 ≤ budget B κ β C hε T z ω := by + dsimp only + let C := (2*κ-8-κ*β)/4 + have hgen := generator_negative hκ hβ hβκ z.re (hε.trans_le hz) + have hC : 0 ≤ C := hgen.1.le + have hφ : 0 ≤ lyapunov β C z.re z.im := lyapunov_nonneg hC _ (hε.trans_le hz) + by_cases hT0 : T=0 + · subst T + have he0 : budget B κ β ((2*κ-8-κ*β)/4) hε 0 z = + fun _ : Ω => lyapunov β C z.re z.im := by + funext ω + exact ite_eq_left rfl + rw [he0] + exact ⟨integrable_const _,by simp [C],fun _ => hφ⟩ + have hT : 0 < (T:ℝ) := NNReal.coe_pos.2 (pos_iff_ne_zero.2 hT0) + have hb1 : β ≤ 1 := by have hh := div_pos (by norm_num : (0:ℝ)<4) (by linarith : 0<κ); linarith + have hcenter := localized_centered hB β C (Real.sqrt κ) hb1 hε T hT z 0 0 + change Integrable (correction B κ β C hε T z) P ∧ (∫ ω,correction B κ β C hε T z ω ∂P)=0 at hcenter + have he : budget B κ β C hε T z =ᵐ[P] + (fun ω => correction B κ β C hε T z ω+lyapunov β C z.re z.im) := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hc hb0 + have hh := deterministic_budget hε hT κ β hκ hβ hβκ (BrownianDriver.path B (Real.sqrt κ) T ω) z hz + (fun t => B t.toNNReal ω) (hc.comp continuous_real_toNNReal) (by simpa using hb0) + (fun t ht => BrownianDriver.extend_eq B _ T ω hc ht) + dsimp only at hh + have hn := lyapunov_nonneg (β := β) hC + ((position hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) z + (stop hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) z 0 0)).re- + Real.sqrt κ*B (stop hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) z 0 0).toNNReal ω) + (LoewnerField.height_pos hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) z + (stop hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) z 0 0)) + have hh2 := hh.2 + simp only [Real.toNNReal_zero] at hh2 + have hpos : 0 ≤ correction B κ β C hε T z ω+lyapunov β C z.re z.im := + (add_nonneg hn (mul_nonneg hgen.2.1.le hh.1)).trans hh2 + simp only [budget,ite_eq_right hT0,max_eq_left hpos] + have hi := hcenter.1.add (integrable_const (lyapunov β C z.re z.im)) + refine ⟨hi.congr he.symm,?_,fun ω => ?_⟩ + · rw [integral_congr_ae he,integral_add hcenter.1 (integrable_const _),hcenter.2,zero_add] + simp [C] + · simp only [budget,ite_eq_right hT0] + exact le_max_right _ _ + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing + +lemma measure_eventually_budget {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (W : ℕ → Ω → ℝ) (M a : ℝ) (ha : 0 < a) + (hi : ∀ n, Integrable (W n) P) (hn : ∀ n ω, 0 ≤ W n ω) + (hmean : ∀ n, (∫ ω,W n ω ∂P)=M) (E : Set Ω) + (hE : ∀ᵐ ω ∂P, ω∈E → ∀ᶠ n in atTop, a ≤ W n ω) : + P E ≤ ENNReal.ofReal (M/a) := by + let L := fun ω => liminf (fun n => ENNReal.ofReal (W n ω)) atTop + have hm (n : ℕ) : AEMeasurable (fun ω => ENNReal.ofReal (W n ω)) P := + ENNReal.measurable_ofReal.comp_aemeasurable (hi n).aemeasurable + have hLm : AEMeasurable L P := by + simp only [L,liminf_eq_iSup_iInf_of_nat] + exact AEMeasurable.iSup (fun n => AEMeasurable.iInf (fun i => AEMeasurable.iInf (fun _ => hm i))) + have hLi : (∫⁻ ω,L ω ∂P) ≤ ENNReal.ofReal M := by + have hf := lintegral_liminf_le' (u := (atTop : Filter ℕ)) hm + have he (n : ℕ) : (∫⁻ ω, ENNReal.ofReal (W n ω) ∂P)=ENNReal.ofReal M := by + rw [← ofReal_integral_eq_lintegral_ofReal (hi n) (Filter.Eventually.of_forall (hn n)),hmean n] + simpa only [he,liminf_const] using hf + have hsub : E ≤ᵐ[P] {ω | ENNReal.ofReal a ≤ L ω} := by + filter_upwards [hE] with ω hω + intro hωE + apply le_liminf_of_le (by isBoundedDefault) + exact (hω hωE).mono (fun n hh => ENNReal.ofReal_le_ofReal hh) + calc + P E ≤ P {ω | ENNReal.ofReal a ≤ L ω} := measure_mono_ae hsub + _ ≤ (∫⁻ ω,L ω ∂P)/ENNReal.ofReal a := + meas_ge_le_lintegral_div hLm (ENNReal.ofReal_ne_zero_iff.2 ha) ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal M/ENNReal.ofReal a := by gcongr + _ = ENNReal.ofReal (M/a) := (ENNReal.ofReal_div_of_pos ha).symm + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing + +abbrev correction {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a : ℝ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (x L : ℝ) (ω : Ω) : ℝ := + let U := BrownianDriver.path B (Real.sqrt κ) T ω + let τ := stop hε T.coe_nonneg U x β a L + let F := field hε T.coe_nonneg β a (Real.sqrt κ) U x + let V := drift hε T.coe_nonneg β a (Real.sqrt κ) U x + F τ (B τ.toNNReal ω)-F 0 (B 0 ω)- + (∫ t in (0:ℝ)..τ,V t (B t.toNNReal ω))- + (1/2:ℝ)*∫ t in (0:ℝ)..τ,iteratedDeriv 2 (F t) (B t.toNNReal ω) + +def budget {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a : ℝ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (x L : ℝ) (ω : Ω) : ℝ := + max (correction B κ β a hε T x L ω+radial (-β) x ε) 0 + +lemma budget_nonneg {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a : ℝ) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (x L : ℝ) (ω : Ω) : + 0 ≤ budget B κ β a hε T x L ω := le_max_right _ _ + +lemma budget_mean {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (x L : ℝ) : + Integrable (budget B κ β a hε T x L) P ∧ + (∫ ω,budget B κ β a hε T x L ω ∂P) = radial (-β) x ε := by + have hc := localized_centered hB β a (Real.sqrt κ) hβ hε T hT x L + change Integrable (correction B κ β a hε T x L) P ∧ + (∫ ω,correction B κ β a hε T x L ω ∂P)=0 at hc + have he : budget B κ β a hε T x L =ᵐ[P] fun ω => correction B κ β a hε T x L ω+radial (-β) x ε := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hcont hb0 + have hh := deterministic_budget hε hT κ β a hκ hβ ha hba + (BrownianDriver.path B (Real.sqrt κ) T ω) x L (fun t => B t.toNNReal ω) + (hcont.comp continuous_real_toNNReal) (by simpa using hb0) + (fun t ht => BrownianDriver.extend_eq B _ T ω hcont ht) + dsimp only at hh + simp only [Real.toNNReal_zero] at hh + have hn := (field_pos hε T.coe_nonneg β a (Real.sqrt κ) + (BrownianDriver.path B (Real.sqrt κ) T ω) x + (stop hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) x β a L) + (B (stop hε T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T ω) x β a L).toNNReal ω)).le + exact max_eq_left (hn.trans hh) + have hi := hc.1.add (integrable_const (radial (-β) x ε)) + refine ⟨hi.congr he.symm,?_⟩ + rw [integral_congr_ae he,integral_add hc.1 (integrable_const _),hc.2,zero_add] + simp + +def reach (U : C(I, ℝ)) {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (x β a L : ℝ) : Prop := + ∃ t ∈ Icc 0 T, (∀ s ∈ Icc 0 t, ε < gap hε hT U x s) ∧ L ≤ weight hε hT U x β a t + +lemma reached_terminal {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) (U : C(I, ℝ)) + (x β a L : ℝ) (hreach : reach U hε hT.le x β a L) : + L ≤ weight hε hT.le U x β a (stop hε hT.le U x β a L) := by + obtain ⟨t,ht,hgap,hweight⟩ := hreach + have hst : stop hε hT.le U x β a L ≤ t := by + by_contra hn + have hp := (deficit_pos_iff hε hT.le U x β a L t).1 + (positive_before hε hT.le hT U x β a L ht.1 (lt_of_not_ge hn)) + exact (not_lt_of_ge hweight) hp.2 + have hb := stop_bounds hε hT.le U x β a L + by_cases hend : stop hε hT.le U x β a L < T + · have hh := nonpos_at_of_lt hε hT.le hT U x β a L hend + have hg := hgap _ ⟨hb.1,hst⟩ + simp only [deficit,min_le_iff,sub_nonpos] at hh + rcases hh with hh | hh + · exact (not_le_of_gt hg hh).elim + · exact hh + · have he : stop hε hT.le U x β a L=t := le_antisymm hst (ht.2.trans (not_lt.1 hend)) + rw [he] + exact hweight + +lemma budget_dominates_reach {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (x L : ℝ) (ω : Ω) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + (hr : reach (BrownianDriver.path B (Real.sqrt κ) T ω) hε T.coe_nonneg x β a L) : + L ≤ budget B κ β a hε T x L ω := by + let U := BrownianDriver.path B (Real.sqrt κ) T ω + let τ := stop hε T.coe_nonneg U x β a L + have htau := stop_bounds hε T.coe_nonneg U x β a L + have hh := deterministic_budget hε hT κ β a hκ hβ ha hba U x L + (fun t => B t.toNNReal ω) (hc.comp continuous_real_toNNReal) (by simpa using hb0) + (fun t ht => BrownianDriver.extend_eq B _ T ω hc ht) + have hw := reached_terminal hε hT U x β a L hr + have he : field hε T.coe_nonneg β a (Real.sqrt κ) U x τ (B τ.toNNReal ω) = + weight hε T.coe_nonneg U x β a τ := by + have hU : extendDriver T U τ = Real.sqrt κ*B τ.toNNReal ω := + BrownianDriver.extend_eq B _ T ω hc htau + simp only [field,weight,gap,hU] + dsimp only at hh + simp only [Real.toNNReal_zero] at hh + change field hε T.coe_nonneg β a (Real.sqrt κ) U x τ (B τ.toNNReal ω) ≤ + correction B κ β a hε T x L ω+radial (-β) x ε at hh + rw [he] at hh + exact (hw.trans hh).trans (le_max_left _ _) + +theorem maximal_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (x L : ℝ) (hL : 0 < L) : + P {ω | reach (BrownianDriver.path B (Real.sqrt κ) T ω) hε T.coe_nonneg x β a L} ≤ + ENNReal.ofReal (radial (-β) x ε/L) := by + have hm := budget_mean hB κ β a hκ hβ ha hba hε T hT x L + apply measure_eventually_budget (fun _ : ℕ => budget B κ β a hε T x L) _ L hL + (fun _ => hm.1) (fun _ => budget_nonneg B κ β a hε T x L) (fun _ => hm.2) + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hc hb0 + intro hr + exact Filter.Eventually.of_forall (fun _ => budget_dominates_reach B κ β a hκ hβ ha hba hε T hT x L ω hc hb0 hr) + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryFunctional + +lemma continuous_position_time {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : Continuous (position hε hT U z) := by + have hp : Continuous (fun t : ℝ => (U, t)) := continuous_const.prodMk continuous_id + have hh := (continuous_position hε hT z).comp hp + change Continuous (position hε hT U z) at hh + exact hh + +lemma continuous_logDerivative_time {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : Continuous (logDerivative hε hT U z) := by + have hp : Continuous (fun t : ℝ => (U, t)) := continuous_const.prodMk continuous_id + have hh := (continuous_logDerivative hε hT z).comp hp + change Continuous (logDerivative hε hT U z) at hh + exact hh + +end SLEExactGauge.BoundaryFunctional + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen + +lemma continuous_gap_time {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (x : ℝ) : Continuous (gap hε hT U x) := by + have hp : Continuous (fun t : ℝ => (U,t)) := continuous_const.prodMk continuous_id + have hh := (continuous_gap hε hT x).comp hp + change Continuous (gap hε hT U x) at hh + exact hh + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing + +lemma norm_sum_lower {X δ : ℝ} {D : ℂ} (hX : 0 < X) (hδ : δ ≤ 1/2) + (hD : ‖D‖ ≤ δ*X) : X/2 ≤ ‖(X:ℂ)+D‖ := by + have hh := norm_sub_le ((X:ℂ)+D) D + rw [add_sub_cancel_right,Complex.norm_real,Real.norm_of_nonneg hX.le] at hh + have hm := mul_le_mul_of_nonneg_right hδ hX.le + linarith + +lemma ratio_real_lower {X δ a : ℝ} {D : ℂ} (hX : 0 < X) (hδ0 : 0 ≤ δ) (hδ : δ ≤ 1/2) + (hD : ‖D‖ ≤ δ*X) (haδ : a ≤ 2-4*δ) : + a ≤ 2*((X:ℂ)/((X:ℂ)+D)).re := by + have hlo := norm_sum_lower hX hδ hD + have hn : (X:ℂ)+D ≠ 0 := norm_pos_iff.mp (lt_of_lt_of_le (by positivity) hlo) + have hquot : ‖D/((X:ℂ)+D)‖ ≤ 2*δ := by + rw [norm_div] + apply (div_le_iff₀ (norm_pos_iff.mpr hn)).2 + calc + ‖D‖ ≤ δ*X := hD + _ ≤ (2*δ)*‖(X:ℂ)+D‖ := by nlinarith + have he : (X:ℂ)/((X:ℂ)+D) = 1-D/((X:ℂ)+D) := by field_simp; ring + rw [he,Complex.sub_re,Complex.one_re] + have hre := (Complex.re_le_norm (D/((X:ℂ)+D))).trans hquot + linarith + +lemma normSq_slope (X : ℝ) (D : ℂ) (hX : X ≠ 0) (hD : (X:ℂ)+D ≠ 0) : + 2*D.re*(2/((X:ℂ)+D)-2/(X:ℂ)).re + + 2*D.im*(2/((X:ℂ)+D)-2/(X:ℂ)).im = + -4*Complex.normSq D / X^2 * ((X:ℂ)/((X:ℂ)+D)).re := by + have hQ : (X+D.re)^2+D.im^2 ≠ 0 := by + have hh := (Complex.normSq_pos.mpr hD).ne' + simpa only [Complex.normSq_apply,Complex.add_re,Complex.ofReal_re,Complex.add_im, + Complex.ofReal_im,zero_add,pow_two] using hh + simp only [Complex.sub_re,Complex.sub_im,Complex.div_re,Complex.div_im,Complex.re_ofNat, + Complex.im_ofNat,Complex.add_re,Complex.add_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.normSq_apply,zero_add,zero_mul,mul_zero,add_zero] + simp only [← pow_two] + field_simp + ring + +lemma energy_deriv {D : ℝ → ℂ} {l : ℝ → ℝ} {t X a : ℝ} + (hX : X ≠ 0) (hD : (X:ℂ)+D t ≠ 0) + (hd : HasDerivAt D (2/((X:ℂ)+D t)-2/(X:ℂ)) t) + (hl : HasDerivAt l (-2/X^2) t) : + HasDerivAt (fun s => Complex.normSq (D s)*Real.exp (-a*l s)) + (Real.exp (-a*l t)*(-4*Complex.normSq (D t)/X^2*((X:ℂ)/((X:ℂ)+D t)).re+ + 2*a/X^2*Complex.normSq (D t))) t := by + have hre := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hd + have him := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t hd + dsimp only [Function.comp_def,Complex.reCLM_apply,Complex.imCLM_apply] at hre him + have hq := (hre.pow 2).add (him.pow 2) + have hq' : HasDerivAt (fun s => Complex.normSq (D s)) + (2*(D t).re*(2/((X:ℂ)+D t)-2/(X:ℂ)).re+2*(D t).im*(2/((X:ℂ)+D t)-2/(X:ℂ)).im) t := by + convert hq using 1 <;> (try simp only [Complex.normSq_apply,pow_two]) <;> first | rfl | ring + rw [normSq_slope _ _ hX hD] at hq' + apply (hq'.mul ((hl.const_mul (-a)).exp)).congr_deriv + ring + +lemma energy_antitone {S δ a : ℝ} (hδ0 : 0 ≤ δ) (hδ : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (D : ℝ → ℂ) (l X : ℝ → ℝ) (hDc : ContinuousOn D (Icc 0 S)) (hlc : Continuous l) + (hX : ∀ t ∈ Ioo 0 S, 0 < X t) + (hDd : ∀ t ∈ Ioo 0 S, HasDerivAt D (2/((X t:ℂ)+D t)-2/(X t:ℂ)) t) + (hld : ∀ t ∈ Ioo 0 S, HasDerivAt l (-2/(X t)^2) t) + (hratio : ∀ t ∈ Ioo 0 S, ‖D t‖ ≤ δ*X t) : + AntitoneOn (fun t => Complex.normSq (D t)*Real.exp (-a*l t)) (Icc 0 S) := by + have hEc : ContinuousOn (fun t => Complex.normSq (D t)*Real.exp (-a*l t)) (Icc 0 S) := + (Complex.continuous_normSq.comp_continuousOn hDc).mul + ((Real.continuous_exp.comp (continuous_const.mul hlc)).continuousOn) + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 S) hEc + (f' := fun t => Real.exp (-a*l t)*(-4*Complex.normSq (D t)/(X t)^2* + ((X t:ℂ)/((X t:ℂ)+D t)).re+2*a/(X t)^2*Complex.normSq (D t))) + · intro t ht + rw [interior_Icc] at ht + have hn : (X t:ℂ)+D t ≠ 0 := norm_pos_iff.mp + (lt_of_lt_of_le (half_pos (hX t ht)) (norm_sum_lower (hX t ht) hδ (hratio t ht))) + exact (energy_deriv (hX t ht).ne' hn (hDd t ht) (hld t ht)).hasDerivWithinAt + · intro t ht + rw [interior_Icc] at ht + have hr := ratio_real_lower (hX t ht) hδ0 hδ (hratio t ht) haδ + apply mul_nonpos_of_nonneg_of_nonpos (Real.exp_pos _).le + have hq := Complex.normSq_nonneg (D t) + have hh := mul_le_mul_of_nonneg_left hr (show 0 ≤ 2*Complex.normSq (D t)/(X t)^2 by positivity) + convert sub_nonpos.mpr hh using 1 + ring + +lemma gap_coefficients {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (x t : ℝ) (hx : ε ≤ gap hε hT U x t) : + velocity ε (extendDriver T U t) (position hε hT U (x:ℂ) t) = 2/(gap hε hT U x t:ℂ) ∧ + variation hε hT U (x:ℂ) t = -2/(gap hε hT U x t)^2 := by + have hz : position hε hT U (x:ℂ) t = ((position hε hT U (x:ℂ) t).re:ℂ) := by + apply Complex.ext <;> simp [position_im_zero] + have hc : clampRe ε (position hε hT U (x:ℂ) t-(extendDriver T U t:ℂ)) = + (gap hε hT U x t:ℂ) := by + change BoundaryCutoff.clamp 1 ε _ = _ + rw [BoundaryCutoff.clamp_eq (by norm_num : |(1:ℝ)|=1) (by simpa [gap] using hx),hz] + simp only [gap,Complex.ofReal_sub] + constructor + · change 2/clampRe ε _ = _; rw [hc] + · unfold variation + rw [hc] + norm_cast + +lemma gap_difference_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (x : ℝ) {t : ℝ} (ht : t ∈ Ioo 0 T) + (hx : ε ≤ gap hε hT U x t) (G : ℝ → ℂ) + (hG : HasDerivAt G (2/(G t-(extendDriver T U t:ℂ))) t) : + HasDerivAt (fun s => G s-position hε hT U (x:ℂ) s) + (2/((gap hε hT U x t:ℂ)+(G t-position hε hT U (x:ℂ) t))- + 2/(gap hε hT U x t:ℂ)) t := by + have hh := hG.sub (position_deriv hε hT U (x:ℂ) ht) + rw [(gap_coefficients hε hT U x t hx).1] at hh + have hz : position hε hT U (x:ℂ) t = ((position hε hT U (x:ℂ) t).re:ℂ) := by + apply Complex.ext <;> simp [position_im_zero] + have hg : G t-(extendDriver T U t:ℂ) = (gap hε hT U x t:ℂ)+(G t-position hε hT U (x:ℂ) t) := by + unfold gap + rw [Complex.ofReal_sub,← hz] + ring + rw [hg] at hh + exact hh + +lemma ratio_energy {ε T S : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (hS : 0 ≤ S) (hST : S ≤ T) + (U : C(I, ℝ)) (x a δ : ℝ) (hδ0 : 0 ≤ δ) (hδ : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (G : ℝ → ℂ) (hGc : ContinuousOn G (Icc 0 S)) + (hGd : ∀ t ∈ Ioo 0 S, HasDerivAt G (2/(G t-(extendDriver T U t:ℂ))) t) + (hgap : ∀ t ∈ Icc 0 S, ε ≤ gap hε hT U x t) + (hratio : ∀ t ∈ Icc 0 S, ‖G t-position hε hT U (x:ℂ) t‖ ≤ δ*gap hε hT U x t) : + Complex.normSq (G S-position hε hT U (x:ℂ) S) * + Real.exp (-a*logDerivative hε hT U (x:ℂ) S) ≤ Complex.normSq (G 0-(x:ℂ)) := by + let D : ℝ → ℂ := fun t => G t-position hε hT U (x:ℂ) t + let l : ℝ → ℝ := logDerivative hε hT U (x:ℂ) + let X : ℝ → ℝ := gap hε hT U x + have hHc : Continuous (fun t => position hε hT U (x:ℂ) t) := + continuous_position_time hε hT U (x:ℂ) + have hDc : ContinuousOn D (Icc 0 S) := hGc.sub hHc.continuousOn + have hlc : Continuous l := + continuous_logDerivative_time hε hT U (x:ℂ) + have hXd (t : ℝ) (ht : t ∈ Ioo 0 S) : 0 < X t := hε.trans_le (hgap t ⟨ht.1.le,ht.2.le⟩) + have hDd (t : ℝ) (ht : t ∈ Ioo 0 S) : HasDerivAt D (2/((X t:ℂ)+D t)-2/(X t:ℂ)) t := + gap_difference_deriv hε hT U x ⟨ht.1,ht.2.trans_le hST⟩ (hgap t ⟨ht.1.le,ht.2.le⟩) G (hGd t ht) + have hld (t : ℝ) (ht : t ∈ Ioo 0 S) : HasDerivAt l (-2/(X t)^2) t := by + have hh := hasDerivAt_logDerivative hε hT U (x:ℂ) ⟨ht.1,ht.2.trans_le hST⟩ + rw [(gap_coefficients hε hT U x t (hgap t ⟨ht.1.le,ht.2.le⟩)).2] at hh + exact hh + have ha := energy_antitone hδ0 hδ haδ D l X hDc hlc hXd hDd hld + (fun t ht => hratio t ⟨ht.1.le,ht.2.le⟩) + have hh := ha ⟨le_rfl,hS⟩ ⟨hS,le_rfl⟩ hS + change Complex.normSq (D S)*Real.exp (-a*l S) ≤ Complex.normSq (G 0-(x:ℂ)) + have he : Complex.normSq (D 0)*Real.exp (-a*l 0) = Complex.normSq (G 0-(x:ℂ)) := by + dsimp only [D,l] + rw [position_initial,logDerivative_initial,mul_zero,Real.exp_zero,mul_one] + exact hh.trans_eq he + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open Swallowing + +lemma energy_weight_bound {β a l d δ X ε N : ℝ} (hβ : 0 < β) (hd : 0 < d) + (hδ : 0 ≤ δ) (hX : 0 < X) (hε0 : 0 ≤ ε) (hε : ε ≤ X) (_hN : 0 ≤ N) + (henergy : N^2*Real.exp (-a*l) ≤ d^2) + (hweight : Real.exp ((a*β/2)*l)*radial (-β) X ε ≤ (δ/(4*d))^β) : + N ≤ (δ/2)*X := by + let E := Real.exp ((a/2)*l) + let Q := Real.sqrt (X^2+ε^2) + have hE : 0 < E := Real.exp_pos _ + have hQ2 : 0 < X^2+ε^2 := by positivity + have hQ : 0 < Q := Real.sqrt_pos.2 hQ2 + have hQsq : Q^2=X^2+ε^2 := Real.sq_sqrt hQ2.le + have hQbound : Q ≤ 2*X := by nlinarith [sq_nonneg (X-ε)] + have hep : Real.exp (-a*l)*E^2 = 1 := by + dsimp only [E] + rw [sq,← Real.exp_add,← Real.exp_add] + convert Real.exp_zero using 1 + congr 1 + ring + have hNEsq : N^2 ≤ (d*E)^2 := by + have hh := mul_le_mul_of_nonneg_right henergy (sq_nonneg E) + rw [mul_assoc,hep,mul_one] at hh + nlinarith only [hh] + have hNE : N ≤ d*E := by nlinarith [mul_pos hd hE] + have hEp : E^β=Real.exp ((a*β/2)*l) := by + dsimp only [E] + rw [← Real.exp_mul] + congr 1 + ring + have hQp : Q^β=(X^2+ε^2)^(β/2) := by + dsimp only [Q] + rw [Real.sqrt_eq_rpow,← Real.rpow_mul hQ2.le] + congr 1 + ring + have hwp : Real.exp ((a*β/2)*l)*radial (-β) X ε = (E/Q)^β := by + rw [Real.div_rpow hE.le hQ.le,hEp,hQp] + unfold radial + rw [show (-β)/2 = -(β/2) by ring,Real.rpow_neg hQ2.le] + rfl + rw [hwp] at hweight + have hR : 0 ≤ δ/(4*d) := by positivity + have hER : E/Q ≤ δ/(4*d) := (Real.rpow_le_rpow_iff (div_nonneg hE.le hQ.le) hR hβ).1 hweight + have heQ : E ≤ (δ/(4*d))*Q := (div_le_iff₀ hQ).1 hER + calc + N ≤ d*E := hNE + _ ≤ d*((δ/(4*d))*Q) := mul_le_mul_of_nonneg_left heQ hd.le + _ ≤ d*((δ/(4*d))*(2*X)) := by gcongr + _ = (δ/2)*X := by field_simp; ring + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge.BoundaryGreen + +lemma first_zero_of_nonpos {F : ℝ → ℝ} {S : ℝ} (hS : 0 ≤ S) + (hF : Continuous F) (h0 : 0 < F 0) (hSval : F S ≤ 0) : + ∃ σ ∈ Ioc 0 S, F σ = 0 ∧ ∀ s ∈ Icc 0 σ, 0 ≤ F s := by + let K : Set ℝ := Icc 0 S ∩ {s | F s ≤ 0} + have hK : IsCompact K := isCompact_Icc.inter_right (isClosed_le hF continuous_const) + have hne : K.Nonempty := ⟨S,⟨hS,le_rfl⟩,hSval⟩ + let σ := sInf K + have hmem : σ ∈ K := hK.sInf_mem hne + have hσ : 0 < σ := by + apply lt_of_le_of_ne hmem.1.1 + intro heq + have hh := hmem.2 + rw [← heq] at hh + exact (not_le_of_gt h0) hh + have hbefore : ∀ s ∈ Ico 0 σ, 0 < F s := by + intro s hs + by_contra hn + have hm : s ∈ K := ⟨⟨hs.1,hs.2.le.trans hmem.1.2⟩,not_lt.1 hn⟩ + exact (not_le_of_gt hs.2) (csInf_le hK.bddBelow hm) + have hσval : 0 ≤ F σ := by + apply ge_of_tendsto (hF.continuousAt.tendsto.mono_left nhdsWithin_le_nhds : + Tendsto F (𝓝[<] σ) (𝓝 (F σ))) + filter_upwards [Ioo_mem_nhdsLT hσ] with s hs + exact (hbefore s ⟨hs.1.le,hs.2⟩).le + refine ⟨σ,⟨hσ,hmem.1.2⟩,le_antisymm hmem.2 hσval,?_⟩ + intro s hs + rcases lt_or_eq_of_le hs.2 with hlt | rfl + · exact (hbefore s ⟨hs.1,hlt⟩).le + · exact hσval + +lemma first_zero_of_nonpos_on {F : ℝ → ℝ} {S : ℝ} (hS : 0 ≤ S) + (hF : ContinuousOn F (Icc 0 S)) (h0 : 0 < F 0) (hSval : F S ≤ 0) : + ∃ σ ∈ Ioc 0 S, F σ = 0 ∧ ∀ s ∈ Icc 0 σ, 0 ≤ F s := by + let Fc : ℝ → ℝ := fun s => F (projIcc 0 S hS s) + have hc : Continuous Fc := hF.comp_continuous + (continuous_subtype_val.comp (continuous_projIcc (h := hS))) (fun s => (projIcc 0 S hS s).property) + have he (s : ℝ) (hs : s ∈ Icc 0 S) : Fc s=F s := by + simp only [Fc,projIcc,max_eq_right hs.1,min_eq_right hs.2] + obtain ⟨σ,hσ,hz,hpre⟩ := first_zero_of_nonpos hS hc (by rwa [he 0 ⟨le_rfl,hS⟩]) + (by rwa [he S ⟨hS,le_rfl⟩]) + refine ⟨σ,hσ,?_,?_⟩ + · rwa [he σ ⟨hσ.1.le,hσ.2⟩] at hz + · intro s hs + have hh := hpre s hs + rwa [he s ⟨hs.1,hs.2.trans hσ.2⟩] at hh + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing + +lemma tip_forces_reach {ε T S : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (hS : 0 ≤ S) (hST : S ≤ T) + (U : C(I, ℝ)) (hu0 : extendDriver T U 0=0) + (x a β δ d y : ℝ) (hβ : 0 < β) (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) + (haδ : a ≤ 2-4*δ) (hd : 0 < d) (hdx : d < δ*x) (hεx : 2*ε < x) (hy : δ*ε < y) + (G : ℝ → ℂ) (hGc : ContinuousOn G (Icc 0 S)) + (hGd : ∀ t ∈ Ioo 0 S, HasDerivAt G (2/(G t-(extendDriver T U t:ℂ))) t) + (hG0 : ‖G 0-(x:ℂ)‖ ≤ d) (hheight : ∀ t ∈ Icc 0 S, y ≤ (G t).im) + (hGend : (G S).re=extendDriver T U S) : + reach U hε hT x β a ((δ/(4*d))^β) := by + let H : ℝ → ℂ := position hε hT U (x:ℂ) + let X : ℝ → ℝ := gap hε hT U x + let D : ℝ → ℂ := fun t => G t-H t + let F : ℝ → ℝ := fun t => min (X t-2*ε) (δ*X t-‖D t‖) + have hXc : Continuous X := continuous_gap_time hε hT U x + have hDc : ContinuousOn D (Icc 0 S) := + hGc.sub (continuous_position_time hε hT U (x:ℂ)).continuousOn + have hFc : ContinuousOn F (Icc 0 S) := continuous_min.comp_continuousOn + ((hXc.continuousOn.sub continuousOn_const).prodMk + ((continuousOn_const.mul hXc.continuousOn).sub hDc.norm)) + have hX0 : X 0=x := by simp only [X,gap,position_initial,Complex.ofReal_re,hu0,sub_zero] + have hF0 : 0 < F 0 := by + change 0 < min (X 0-2*ε) (δ*X 0-‖G 0-H 0‖) + rw [hX0,show H 0=(x:ℂ) from position_initial hε hT U (x:ℂ)] + exact lt_min (sub_pos.mpr hεx) (sub_pos.mpr (hG0.trans_lt hdx)) + have hRe : (D S).re = -X S := by + change (G S-position hε hT U (x:ℂ) S).re = -gap hε hT U x S + simp only [Complex.sub_re,gap,hGend] + ring + have hnorm : X S ≤ ‖D S‖ := by + have hh := Complex.abs_re_le_norm (D S) + rw [hRe,abs_neg] at hh + exact (le_abs_self _).trans hh + have hFS : F S ≤ 0 := by + by_contra hn + have hh := lt_min_iff.mp (lt_of_not_ge hn) + have hXp : 0 < X S := by linarith [hh.1] + have hm := mul_le_mul_of_nonneg_right hδhalf hXp.le + linarith [hh.2] + obtain ⟨q,hq,hzero,hpre⟩ := first_zero_of_nonpos_on hS hFc hF0 hFS + have hgap : ∀ t ∈ Icc 0 q, 2*ε ≤ X t := by + intro t ht + exact sub_nonneg.mp (le_min_iff.mp (hpre t ht)).1 + have hratio : ∀ t ∈ Icc 0 q, ‖D t‖ ≤ δ*X t := by + intro t ht + exact sub_nonneg.mp (le_min_iff.mp (hpre t ht)).2 + have hXp : 0 < X q := hε.trans_le (by linarith [hgap q ⟨hq.1.le,le_rfl⟩]) + have hqT : q ≤ T := hq.2.trans hST + have henergy := ratio_energy hε hT hq.1.le hqT U x a δ hδ.le hδhalf haδ G + (hGc.mono (Icc_subset_Icc_right hq.2)) (fun t ht => hGd t ⟨ht.1,ht.2.trans_le hq.2⟩) + (fun t ht => by change ε ≤ X t; linarith [hgap t ht]) hratio + have hEn : ‖D q‖^2*Real.exp (-a*logDerivative hε hT U (x:ℂ) q) ≤ d^2 := by + rw [Complex.normSq_eq_norm_sq,Complex.normSq_eq_norm_sq] at henergy + exact henergy.trans (sq_le_sq₀ (norm_nonneg _) hd.le |>.2 hG0) + by_contra hreach + have hweight : weight hε hT U x β a q ≤ (δ/(4*d))^β := by + apply (not_le.mp ?_).le + intro hh + exact hreach ⟨q,⟨hq.1.le,hqT⟩,(fun t ht => by change ε < X t; linarith [hgap t ht]),hh⟩ + have hW : Real.exp ((a*β/2)*logDerivative hε hT U (x:ℂ) q)*radial (-β) (X q) ε ≤ (δ/(4*d))^β := hweight + have hsmall := energy_weight_bound hβ hd hδ.le hXp hε.le + (show ε ≤ X q by linarith [hgap q ⟨hq.1.le,le_rfl⟩]) (norm_nonneg (D q)) hEn hW + have hym : y ≤ ‖D q‖ := by + have hh := hheight q ⟨hq.1.le,hq.2⟩ + have him : (D q).im=(G q).im := by simp [D,H,position_im_zero] + rw [← him] at hh + exact hh.trans (Complex.im_le_norm _) + have hgt : 2*ε < X q := by nlinarith + have hrat : ‖D q‖ < δ*X q := by nlinarith [mul_pos hδ hXp] + have hpos : 0 < F q := lt_min (sub_pos.mpr hgt) (sub_pos.mpr hrat) + exact (ne_of_gt hpos) hzero + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal unitInterval +namespace SLEExactGauge.BoundaryGreen + +lemma inverse_tip_point {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {t : ℝ} (ht : 0 ≤ t) + {x : ℂ} {d : ℝ} (hclose : dist (γ t) x < d) : + ∃ (w : ℂ) (y : ℝ), 0 < y ∧ dist w x < d ∧ + w ∈ localizationDomain γ t ∧ g t w=(driver t:ℂ)+(y:ℂ)*Complex.I := by + have htip := h.2.2.2.2.2.2.2.2.2.2.2.2.2 t ht + have he : ∀ᶠ y : ℝ in 𝓝[>] (0:ℝ), dist (f t ((driver t:ℂ)+(y:ℂ)*Complex.I)) x < d := + htip.eventually (isOpen_ball.mem_nhds hclose) + have hp : ∀ᶠ y : ℝ in 𝓝[>] (0:ℝ), 0 < y := self_mem_nhdsWithin + obtain ⟨y,hy,hball⟩ := (hp.and he).exists + have hz : (driver t:ℂ)+(y:ℂ)*Complex.I ∈ halfPlane := by + change 0 < ((driver t:ℂ)+(y:ℂ)*Complex.I).im + simpa using hy + refine ⟨f t ((driver t:ℂ)+(y:ℂ)*Complex.I),y,hy,hball,?_,?_⟩ + · exact h.2.2.2.2.2.2.2.2.1 t ht hz + · exact h.2.2.2.2.2.2.2.2.2.2.1 t ht _ hz + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ReverseLoewner +open LoewnerCutoff + +def velocity (ε u : ℝ) (w : ℂ) : ℂ := -LoewnerCutoff.velocity ε u w + +lemma velocity_lipschitz {ε : ℝ} (hε : 0 < ε) (u : ℝ) : + LipschitzWith ⟨4 / ε^2, by positivity⟩ (velocity ε u) := + (LoewnerCutoff.velocity_lipschitz hε u).neg + +end SLEExactGauge.ReverseLoewner + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/BrownianSupport.lean b/lean/OAI/Probability/SLELocalization/BrownianSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..e892a7d59a678e7df6ab523a1b9d8d412c34c4cb --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/BrownianSupport.lean @@ -0,0 +1,731 @@ +import Mathlib +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Brownian Support estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianSupport +open BrownianPredictable + +lemma preBrownian_past_square_le {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsPreBrownianReal B P) (hBm : ∀ t, Measurable (B t)) + {s t : ℝ≥0} (hst : s ≤ t) {A : Set Ω} (hA : MeasurableSet[pastSigma B s] A) : + (∫ sample in A, (B s sample)^2 ∂P) ≤ ∫ sample in A, (B t sample)^2 ∂P := by + have hraw : pastSigma B s ≤ ‹MeasurableSpace Ω› := + (Measurable.of_eval (fun time : Set.Iic s => hBm time)).comap_le + have hAm : MeasurableSet A := hraw _ hA + have hs := (hB.isGaussianProcess.hasGaussianLaw_eval s).memLp_two + have ht := (hB.isGaussianProcess.hasGaussianLaw_eval t).memLp_two + have hi : IndepFun (A.indicator (B s)) (fun sample => B t sample-B s sample) P := by + have hall := (hB.indepFun_shift s).symm + have hX : Measurable[pastSigma B s] (A.indicator (B s)) := + (past_measurable_eval B le_rfl).indicator hA + have hf := hall.comp measurable_id (measurable_pi_apply (t-s)) + simp only [Function.comp_def,id_eq,add_tsub_cancel_of_le hst] at hf + exact indep_of_indep_of_le_left hf hX.comap_le + have hz : (∫ sample in A, B s sample*(B t sample-B s sample) ∂P) = 0 := by + have he := hi.integral_fun_mul_eq_mul_integral + ((hBm s).indicator hAm).aestronglyMeasurable ((hBm t).sub (hBm s)).aestronglyMeasurable + have hind : (fun sample => A.indicator (B s) sample*(B t sample-B s sample)) = + A.indicator (fun sample => B s sample*(B t sample-B s sample)) := by + funext sample + by_cases ha : sample ∈ A <;> simp [ha] + rw [hind,integral_indicator hAm,integral_sub (hB.integrable_eval t) (hB.integrable_eval s), + hB.integral_eval t,hB.integral_eval s,sub_self,mul_zero] at he + exact he + have hcross : Integrable (fun sample => B s sample*(B t sample-B s sample)) P := + hs.integrable_mul (ht.sub hs) + have his : Integrable (fun sample => (B s sample)^2) P := hs.integrable_sq + have hid : Integrable (fun sample => (B t sample-B s sample)^2) P := (ht.sub hs).integrable_sq + have he : (∫ sample in A, (B t sample)^2 ∂P) = + (∫ sample in A, (B s sample)^2 ∂P) + ∫ sample in A, (B t sample-B s sample)^2 ∂P := by + calc + _ = ∫ sample in A, ((B s sample)^2+2*(B s sample*(B t sample-B s sample)))+ + (B t sample-B s sample)^2 ∂P := integral_congr_ae (Eventually.of_forall (fun _ => by ring)) + _ = (∫ sample in A, (B s sample)^2+2*(B s sample*(B t sample-B s sample)) ∂P) + + ∫ sample in A, (B t sample-B s sample)^2 ∂P := + integral_add ((his.restrict (s := A)).add ((hcross.restrict (s := A)).const_mul 2)) (hid.restrict (s := A)) + _ = ((∫ sample in A, (B s sample)^2 ∂P) + + 2*(∫ sample in A, B s sample*(B t sample-B s sample) ∂P)) + + ∫ sample in A, (B t sample-B s sample)^2 ∂P := by + congr 1 + calc + _ = (∫ sample in A, (B s sample)^2 ∂P) + + ∫ sample in A, 2*(B s sample*(B t sample-B s sample)) ∂P := + integral_add (his.restrict (s := A)) ((hcross.restrict (s := A)).const_mul 2) + _ = _ := by rw [integral_const_mul] + _ = _ := by rw [hz,mul_zero,add_zero] + rw [he] + exact le_add_of_nonneg_right (integral_nonneg (fun _ => sq_nonneg _)) + +lemma preBrownian_square_submartingale {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsPreBrownianReal B P) (hBm : ∀ t, Measurable (B t)) + (t : ℕ → ℝ≥0) (ht : Monotone t) : + let F : Filtration ℕ ‹MeasurableSpace Ω› := + ⟨fun n => pastSigma B (t n),fun _ _ hij => pastSigma_mono B (ht hij), + fun n => (Measurable.of_eval (fun time : Set.Iic (t n) => hBm time)).comap_le⟩ + Submartingale (fun n sample => (B (t n) sample)^2) F P := by + intro F + apply submartingale_of_setIntegral_le + · intro n + exact ((past_measurable_eval B le_rfl).pow_const 2).stronglyMeasurable + · intro n + exact (hB.isGaussianProcess.hasGaussianLaw_eval (t n)).memLp_two.integrable_sq + · intro i j hij A hA + exact preBrownian_past_square_le hB hBm (ht hij) hA + +lemma preBrownian_finite_max_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsPreBrownianReal B P) (hBm : ∀ t, Measurable (B t)) + (t : ℕ → ℝ≥0) (ht : Monotone t) (n : ℕ) {a : ℝ} (ha : 0 < a) : + P {sample | ∃ i ≤ n, a ≤ |B (t i) sample|} ≤ ENNReal.ofReal ((t n:ℝ)/a^2) := by + let f : ℕ → Ω → ℝ := fun n sample => (B (t n) sample)^2 + have hm := maximal_ineq (preBrownian_square_submartingale hB hBm t ht) + (show 0 ≤ f from fun _ _ => sq_nonneg _) (ε := (a^2).toNNReal) n + simp only [Real.coe_toNNReal _ (sq_nonneg a)] at hm + have he : {sample | (a^2) ≤ (Finset.range (n+1)).sup' Finset.nonempty_range_add_one (fun k => f k sample)} = + {sample | ∃ i ≤ n, a ≤ |B (t i) sample|} := by + ext sample + simp only [mem_ofPred_eq,Finset.le_sup'_iff,Finset.mem_range,Nat.lt_succ_iff,f] + constructor + · rintro ⟨i,hi,hv⟩ + exact ⟨i,hi,(sq_le_sq₀ ha.le (abs_nonneg _)).1 (by simpa using hv)⟩ + · rintro ⟨i,hi,hv⟩ + exact ⟨i,hi,by simpa using (sq_le_sq₀ ha.le (abs_nonneg _)).2 hv⟩ + change ENNReal.ofReal (a^2) * P _ ≤ _ at hm + rw [he] at hm + have hi : (∫ sample in {sample | ∃ i ≤ n, a ≤ |B (t i) sample|}, (B (t n) sample)^2 ∂P) ≤ (t n:ℝ) := by + calc + _ ≤ ∫ sample, (B (t n) sample)^2 ∂P := integral_mono_measure Measure.restrict_le_self + (Eventually.of_forall (fun _ => sq_nonneg _)) + (hB.isGaussianProcess.hasGaussianLaw_eval (t n)).memLp_two.integrable_sq + _ = _ := ((hB.hasLaw_eval (t n)).integral_comp + (show AEStronglyMeasurable (fun x : ℝ => x^2) _ from by fun_prop)).trans + (BrownianPredictable.gaussian_second_moment _) + have hh := hm.trans (ENNReal.ofReal_le_ofReal hi) + rw [ENNReal.ofReal_div_of_pos (sq_pos_of_pos ha)] + exact (ENNReal.le_div_iff_mul_le (Or.inl (ne_of_gt (ENNReal.ofReal_pos.2 (sq_pos_of_pos ha)))) (Or.inl ENNReal.ofReal_ne_top)).2 (by simpa [mul_comm] using hh) + +end SLEExactGauge.BrownianSupport + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable + +def restartIndex {Ω : Type*} (τ : Ω → ℝ≥0) (n : ℕ) (sample : Ω) : ℕ := + Nat.ceil (τ sample*((n:ℝ≥0)+1)) + +def restartGrid (n k : ℕ) : ℝ≥0 := (k:ℝ≥0)/((n:ℝ≥0)+1) + +def restartTime {Ω : Type*} (τ : Ω → ℝ≥0) (n : ℕ) (sample : Ω) : ℝ≥0 := + restartGrid n (restartIndex τ n sample) + +lemma restartIndex_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {τ : Ω → ℝ≥0} (hτ : AEMeasurable τ P) (n : ℕ) : AEMeasurable (restartIndex τ n) P := + Nat.measurable_ceil.comp_aemeasurable (hτ.mul_const _) + +lemma restartTime_bounds {Ω : Type*} (τ : Ω → ℝ≥0) (n : ℕ) (sample : Ω) : + τ sample ≤ restartTime τ n sample ∧ + restartTime τ n sample ≤ τ sample+1/((n:ℝ≥0)+1) := by + have ha : 0 < (n:ℝ≥0)+1 := by positivity + constructor + · exact (le_div_iff₀ ha).2 (Nat.le_ceil _) + · change (Nat.ceil (τ sample*((n:ℝ≥0)+1)):ℝ≥0)/((n:ℝ≥0)+1) ≤ _ + apply le_of_lt + calc + _ < (τ sample*((n:ℝ≥0)+1)+1)/((n:ℝ≥0)+1) := + (div_lt_div_iff_of_pos_right ha).2 (Nat.ceil_lt_add_one (by positivity)) + _ = _ := by rw [add_div,mul_div_cancel_right₀ _ ha.ne'] + +lemma restartTime_tendsto {Ω : Type*} (τ : Ω → ℝ≥0) (sample : Ω) : + Tendsto (fun n => restartTime τ n sample) atTop (𝓝 (τ sample)) := by + have hh : Tendsto (fun n : ℕ => τ sample+1/((n:ℝ≥0)+1)) atTop (𝓝 (τ sample)) := by + simpa only [add_zero] using tendsto_const_nhds.add + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ≥0)) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hh + (fun n => (restartTime_bounds τ n sample).1) (fun n => (restartTime_bounds τ n sample).2) + +lemma restartIndex_past {Ω : Type*} [MeasurableSpace Ω] (B : ℝ≥0 → Ω → ℝ) + (τ : Ω → ℝ≥0) (A : Set Ω) + (hstop : ∀ t : ℝ≥0, MeasurableSet[pastSigma B t] (A ∩ {sample | τ sample ≤ t})) + (n k : ℕ) : MeasurableSet[pastSigma B (restartGrid n k)] + (A ∩ {sample | restartIndex τ n sample = k}) := by + have ha : 0 < (n:ℝ≥0)+1 := by positivity + by_cases hk : k=0 + · subst k + have he : A ∩ {sample | restartIndex τ n sample = 0} = A ∩ {sample | τ sample ≤ 0} := by + ext sample + simp only [mem_inter_iff,mem_ofPred_eq,restartIndex,Nat.ceil_eq_zero] + constructor + · rintro ⟨hA,ht⟩ + exact ⟨hA,(mul_le_mul_iff_left₀ ha).1 (by simpa using ht)⟩ + · rintro ⟨hA,ht⟩ + exact ⟨hA,mul_nonpos_of_nonpos_of_nonneg ht ha.le⟩ + rw [he] + have hz : restartGrid n 0 = 0 := by simp [restartGrid] + rw [hz] + exact hstop 0 + · have hle : restartGrid n (k-1) ≤ restartGrid n k := by + apply div_le_div_of_nonneg_right _ ha.le + exact_mod_cast Nat.sub_le k 1 + have hprev : MeasurableSet[pastSigma B (restartGrid n k)] + (A ∩ {sample | τ sample ≤ restartGrid n (k-1)}) := + (pastSigma_mono B hle) _ (hstop _) + have he : A ∩ {sample | restartIndex τ n sample = k} = + (A ∩ {sample | τ sample ≤ restartGrid n k}) \ + (A ∩ {sample | τ sample ≤ restartGrid n (k-1)}) := by + ext sample + simp only [mem_inter_iff,mem_ofPred_eq,Set.mem_sdiff,restartIndex,Nat.ceil_eq_iff hk, + restartGrid,le_div_iff₀ ha,not_and,not_le] + constructor + · rintro ⟨hA,hl,hu⟩ + exact ⟨⟨hA,hu⟩,fun _ => hl⟩ + · rintro ⟨⟨hA,hu⟩,hl⟩ + exact ⟨hA,hl hA,hu⟩ + rw [he] + exact (hstop _).diff hprev + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianSupport +open BrownianPredictable + +lemma brownian_finite_max_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsPreBrownianReal B P) + (t : ℕ → ℝ≥0) (ht : Monotone t) (n : ℕ) {a : ℝ} (ha : 0 < a) : + P {sample | ∃ i ≤ n, a ≤ |B (t i) sample|} ≤ ENNReal.ofReal ((t n:ℝ)/a^2) := by + let C : ℝ≥0 → Ω → ℝ := fun t => (hB.aemeasurable t).mk (B t) + have hm (t : ℝ≥0) : Measurable (C t) := (hB.aemeasurable t).measurable_mk + have he (t : ℝ≥0) : B t =ᵐ[P] C t := (hB.aemeasurable t).ae_eq_mk + have hC : IsPreBrownianReal C P := hB.congr he + have hmeasure : P {sample | ∃ i ≤ n, a ≤ |B (t i) sample|} = + P {sample | ∃ i ≤ n, a ≤ |C (t i) sample|} := by + apply measure_congr + filter_upwards [ae_all_iff.2 (fun i : ℕ => he (t i))] with sample hh + apply propext + simp only [hh] + rw [hmeasure] + exact preBrownian_finite_max_bound hC hm t ht n ha + +lemma brownian_oscillation_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) {a : ℝ} (ha : 0 < a) : + P {sample | ∃ t ∈ Icc 0 T, a < |B t sample|} ≤ ENNReal.ofReal ((T:ℝ)/a^2) := by + let grid (n i : ℕ) : ℝ≥0 := min T (restartGrid n i) + let N (n : ℕ) := Nat.ceil (T*((n:ℝ≥0)+1)) + let E (n : ℕ) : Set Ω := {sample | ∃ i ≤ N n, a ≤ |B (grid n i) sample|} + have hgrid (n : ℕ) : Monotone (grid n) := by + intro i j hij + apply min_le_min le_rfl + exact div_le_div_of_nonneg_right (by exact_mod_cast hij) (by positivity) + have hend (n : ℕ) : grid n (N n) = T := by + apply min_eq_left + exact (restartTime_bounds (fun _ : Unit => T) n ()).1 + have hE (n : ℕ) : P (E n) ≤ ENNReal.ofReal ((T:ℝ)/a^2) := by + have hh := brownian_finite_max_bound hB.toIsPreBrownianReal (grid n) (hgrid n) (N n) ha + simpa only [hend] using hh + let F (k : ℕ) : Set Ω := ⋂ n ≥ k, E n + have hd : Monotone F := by + intro k l hkl sample hs + simp only [F,mem_iInter] at hs ⊢ + exact fun n hn => hs n (hkl.trans hn) + have hsub : {sample | ∃ t ∈ Icc 0 T, a < |B t sample|} ≤ᵐ[P] ⋃ k, F k := by + filter_upwards [hB.cont] with sample hc hs + rcases hs with ⟨t,ht,haB⟩ + have htend : Tendsto (fun n => min T (restartTime (fun _ : Unit => t) n ())) atTop (𝓝 t) := by + have hh := (tendsto_const_nhds (x := T)).min (restartTime_tendsto (fun _ : Unit => t) ()) + simpa only [min_eq_right ht.2] using hh + have hev := ((hc.continuousAt.tendsto.comp htend).abs).eventually (lt_mem_nhds haB) + obtain ⟨k,hk⟩ := eventually_atTop.1 hev + apply mem_iUnion.2 + refine ⟨k,?_⟩ + simp only [F,mem_iInter] + intro n hn + refine ⟨restartIndex (fun _ : Unit => t) n (),?_,(hk n hn).le⟩ + apply Nat.ceil_mono + exact mul_le_mul_of_nonneg_right ht.2 (by positivity) + calc + _ ≤ P (⋃ k, F k) := measure_mono_ae hsub + _ = ⨆ k, P (F k) := hd.directed_le.measure_iUnion + _ ≤ _ := iSup_le (fun k => (measure_mono (by + intro sample hs + exact mem_iInter.1 (mem_iInter.1 hs k) le_rfl)).trans (hE k)) + +end SLEExactGauge.BrownianSupport + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianSupport + +private def densityFloor : ℝ := (Real.sqrt (2*Real.pi))⁻¹ * Real.exp (-(1/2:ℝ)) + +private lemma densityFloor_pos : 0 < densityFloor := by + dsimp [densityFloor] + positivity + +private lemma gaussian_pdf_lower {v : ℝ≥0} (hv : 0 < v) {x : ℝ} (hx : |x| ≤ Real.sqrt v) : + densityFloor / Real.sqrt v ≤ gaussianPDFReal 0 v x := by + have hvR : 0 < (v:ℝ) := hv + have hs : 0 < Real.sqrt (v:ℝ) := Real.sqrt_pos.2 hvR + have hx2 : x^2 ≤ (v:ℝ) := by + have hh := (sq_le_sq₀ (abs_nonneg x) hs.le).2 hx + simpa only [sq_abs,Real.sq_sqrt hvR.le] using hh + have he : -(1/2:ℝ) ≤ -x^2/(2*(v:ℝ)) := by + apply (le_div_iff₀ (by positivity)).2 + nlinarith + calc + _ = (Real.sqrt (2*Real.pi*(v:ℝ)))⁻¹ * Real.exp (-(1/2:ℝ)) := by + rw [Real.sqrt_mul (by positivity)] + dsimp [densityFloor] + field_simp + _ ≤ _ := by + change _ ≤ (Real.sqrt (2*Real.pi*(v:ℝ)))⁻¹ * Real.exp (-(x-0)^2/(2*(v:ℝ))) + simp only [sub_zero] + exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.2 he) (by positivity) + +lemma gaussian_short_interval_lower {v : ℝ≥0} (hv : 0 < v) {c α L : ℝ} + (hα : 0 < α) (hc : |c| ≤ L*(v:ℝ)) + (hsmall : (L+α)*(v:ℝ) ≤ Real.sqrt v) : + ENNReal.ofReal (2*densityFloor*α*Real.sqrt v) ≤ + gaussianReal 0 v {x : ℝ | |x-c| < α*(v:ℝ)} := by + have hvR : 0 < (v:ℝ) := hv + have hs : 0 < Real.sqrt (v:ℝ) := Real.sqrt_pos.2 hvR + let A : Set ℝ := Ioo (c-α*(v:ℝ)) (c+α*(v:ℝ)) + have hA : {x : ℝ | |x-c| < α*(v:ℝ)} = A := by + ext x + simp only [mem_ofPred_eq,A,mem_Ioo,abs_lt] + constructor <;> intro hh <;> constructor <;> linarith [hh.1,hh.2] + rw [hA,gaussianReal_apply_eq_integral 0 hv.ne'] + apply ENNReal.ofReal_le_ofReal + calc + _ = ∫ x in A, densityFloor/Real.sqrt v := by + rw [setIntegral_const] + simp only [smul_eq_mul,A,Real.volume_real_Ioo] + rw [max_eq_left (by nlinarith [mul_pos hα hvR] : 0 ≤ c+α*(v:ℝ)-(c-α*(v:ℝ)))] + field_simp + rw [Real.sq_sqrt hvR.le] + ring + _ ≤ _ := by + apply setIntegral_mono_on (integrable_const _) (integrable_gaussianPDFReal 0 v).integrableOn measurableSet_Ioo + intro x hx + apply gaussian_pdf_lower hv + have hxc : |x-c| < α*(v:ℝ) := by + have hh : x ∈ {x : ℝ | |x-c| < α*(v:ℝ)} := hA.symm ▸ hx + exact hh + calc + |x| ≤ |x-c|+|c| := by simpa using abs_add_le (x-c) c + _ ≤ (L+α)*(v:ℝ) := by nlinarith + _ ≤ _ := hsmall + +lemma short_endpoint_dominates {L α b : ℝ} (hL : 0 ≤ L) (hα : 0 < α) (hb : 0 < b) : + ∃ δ : ℝ, 0 < δ ∧ ∀ (v : ℝ≥0), 0 < v → (v:ℝ) ≤ δ → ∀ c : ℝ, + |c| ≤ L*(v:ℝ) → ENNReal.ofReal ((v:ℝ)/b^2) < + gaussianReal 0 v {x : ℝ | |x-c| < α*(v:ℝ)} := by + let r : ℝ := min (1/(L+α+1)) (densityFloor*α*b^2) + have hr : 0 < r := lt_min (by positivity) (by positivity [densityFloor_pos]) + refine ⟨r^2,by positivity,fun v hv hvr c hc => ?_⟩ + have hvR : 0 < (v:ℝ) := hv + have hs : 0 < Real.sqrt (v:ℝ) := Real.sqrt_pos.2 hvR + have hsr : Real.sqrt (v:ℝ) ≤ r := (Real.sqrt_le_iff).2 ⟨hr.le,hvr⟩ + have hsmall : (L+α)*(v:ℝ) ≤ Real.sqrt v := by + have hr1 : r ≤ 1/(L+α+1) := min_le_left _ _ + have hh : (L+α+1)*Real.sqrt (v:ℝ) ≤ 1 := by + have hc' := (le_div_iff₀ (by positivity : 0 < L+α+1)).1 (hsr.trans hr1) + nlinarith + nlinarith [Real.sq_sqrt hvR.le] + apply lt_of_lt_of_le _ (gaussian_short_interval_lower hv hα hc hsmall) + apply (ENNReal.ofReal_lt_ofReal_iff (by positivity [densityFloor_pos])).2 + apply (div_lt_iff₀ (sq_pos_of_pos hb)).2 + have hr2 : r ≤ densityFloor*α*b^2 := min_le_right _ _ + have hh := hsr.trans hr2 + have hmul := mul_le_mul_of_nonneg_left hh hs.le + nlinarith [Real.sq_sqrt hvR.le,densityFloor_pos] + +end SLEExactGauge.BrownianSupport + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory TopologicalSpace +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BrownianSupport +open BrownianPredictable + +def probeTime (T : ℝ≥0) (q : I) : ℝ≥0 := T * ⟨q,q.property.1⟩ + +lemma probeTime_le (T : ℝ≥0) (q : I) : probeTime T q ≤ T := by + change (T:ℝ)*(q:ℝ) ≤ T + simpa using mul_le_mul_of_nonneg_left q.property.2 T.coe_nonneg + +lemma continuous_probeTime (T : ℝ≥0) : Continuous (probeTime T) := by + apply Continuous.const_mul + exact continuous_subtype_val.subtype_mk (fun q => q.property.1) + +def stepSet (h : ℝ≥0) (c α b : ℝ) : Set (ℝ≥0 → ℝ) := + {f | |f h-c| < α*(h:ℝ) ∧ ∀ n : ℕ, |f (probeTime h (denseSeq I n))| ≤ b} + +lemma measurableSet_stepSet (h : ℝ≥0) (c α b : ℝ) : MeasurableSet (stepSet h c α b) := by + change MeasurableSet ({f : ℝ≥0 → ℝ | |f h-c| < α*(h:ℝ)} ∩ + {f : ℝ≥0 → ℝ | ∀ n : ℕ, |f (probeTime h (denseSeq I n))| ≤ b}) + apply MeasurableSet.inter + · exact measurableSet_lt (((measurable_pi_apply h : Measurable (fun f : ℝ≥0 → ℝ => f h))).sub_const c).abs measurable_const + · simp only [ofPred_forall] + exact MeasurableSet.iInter fun n => measurableSet_le (measurable_pi_apply _).abs measurable_const + +lemma probe_bound_all {f : ℝ≥0 → ℝ} (hf : Continuous f) (T : ℝ≥0) {b : ℝ} + (hb : ∀ n : ℕ, |f (probeTime T (denseSeq I n))| ≤ b) : + ∀ t ≤ T, |f t| ≤ b := by + have hall (q : I) : |f (probeTime T q)| ≤ b := + (denseRange_denseSeq I).induction_on q + (isClosed_le ((hf.comp (continuous_probeTime T)).abs) continuous_const) hb + intro t ht + by_cases hT : T=0 + · have ht0 : t=0 := le_antisymm (ht.trans hT.le) (bot_le) + have hz : probeTime T (0:I) = 0 := by + apply NNReal.coe_injective + change (T:ℝ)*(0:ℝ) = (0:ℝ) + exact mul_zero _ + simpa only [ht0,hz] using hall (0:I) + · have hTp : 0 < (T:ℝ) := by exact_mod_cast lt_of_le_of_ne (bot_le : 0 ≤ T) (Ne.symm hT) + let q : I := ⟨(t:ℝ)/(T:ℝ),⟨div_nonneg t.coe_nonneg T.coe_nonneg,(div_le_one hTp).2 ht⟩⟩ + have he : probeTime T q = t := by + apply NNReal.coe_injective + change (T:ℝ)*((t:ℝ)/(T:ℝ)) = t + field_simp + simpa only [he] using hall q + +def stepEvent {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (t h : ℝ≥0) (c α b : ℝ) : Set Ω := + (fun sample s => B (t+s) sample-B t sample) ⁻¹' stepSet h c α b + +lemma stepEvent_past {Ω : Type*} [MeasurableSpace Ω] (B : ℝ≥0 → Ω → ℝ) + (t h : ℝ≥0) (c α b : ℝ) : MeasurableSet[pastSigma B (t+h)] (stepEvent B t h c α b) := by + let : MeasurableSpace Ω := pastSigma B (t+h) + change MeasurableSet[pastSigma B (t+h)] + ({sample | |B (t+h) sample-B t sample-c| < α*(h:ℝ)} ∩ + {sample | ∀ n : ℕ, |B (t+probeTime h (denseSeq I n)) sample-B t sample| ≤ b}) + apply MeasurableSet.inter + · apply measurableSet_lt _ measurable_const + exact (((past_measurable_eval B (s:=t+h) (t:=t+h) le_rfl).sub + (past_measurable_eval B (s:=t) (t:=t+h) (le_add_right le_rfl))).sub_const c).abs + · simp only [ofPred_forall] + apply MeasurableSet.iInter + intro n + apply measurableSet_le _ measurable_const + exact ((past_measurable_eval B (s:=t+probeTime h _) (t:=t+h) (by gcongr; exact probeTime_le h _)).sub + (past_measurable_eval B (s:=t) (t:=t+h) (le_add_right le_rfl))).abs + +lemma small_step_pos {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) {L α b : ℝ} (hL : 0 ≤ L) (hα : 0 < α) (hb : 0 < b) : + ∃ δ : ℝ, 0 < δ ∧ ∀ (h : ℝ≥0), 0 < h → (h:ℝ) ≤ δ → ∀ c : ℝ, + |c| ≤ L*(h:ℝ) → ∀ t : ℝ≥0, 0 < P (stepEvent B t h c α b) := by + obtain ⟨δ,hδ,hdom⟩ := short_endpoint_dominates hL hα hb + refine ⟨δ,hδ,fun h hh hhδ c hc t => ?_⟩ + let C : ℝ≥0 → Ω → ℝ := fun s sample => B (t+s) sample-B t sample + have hC : IsBrownianReal C P := hB.shift t + let E : Set Ω := {sample | |C h sample-c| < α*(h:ℝ)} + let Bad : Set Ω := {sample | ∃ s ∈ Icc 0 h, b < |C s sample|} + have hE : P E = gaussianReal 0 h {x : ℝ | |x-c| < α*(h:ℝ)} := + (hC.toIsPreBrownianReal.hasLaw_eval h).measure_eq + (p := fun x : ℝ => |x-c| < α*(h:ℝ)) + (measurableSet_lt (measurable_id.sub_const c).abs measurable_const) + have hbad : P Bad < P E := by + rw [hE] + exact (brownian_oscillation_bound hC h hb).trans_lt (hdom h hh hhδ c hc) + have hsub : E ⊆ stepEvent B t h c α b ∪ Bad := by + intro sample hs + by_cases hbad : sample ∈ Bad + · exact Or.inr hbad + · apply Or.inl + refine ⟨hs,fun n => ?_⟩ + apply le_of_not_gt + intro hn + exact hbad ⟨probeTime h (denseSeq I n),⟨bot_le,probeTime_le h _⟩,hn⟩ + apply pos_iff_ne_zero.2 + intro hz + have hm := (measure_mono (μ:=P) hsub).trans (measure_union_le _ _) + rw [hz,zero_add] at hm + exact (not_le_of_gt hbad) hm + +lemma past_inter_step {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (t h : ℝ≥0) (c α b : ℝ) (A : Set Ω) (hA : MeasurableSet[pastSigma B t] A) : + P (A ∩ stepEvent B t h c α b) = P A * P (stepEvent B t h c α b) := by + have hi := (hB.toIsPreBrownianReal.indepFun_shift t).symm + apply hi.meas_inter hA + exact (measurableSet_stepSet h c α b).preimage (comap_measurable _) + +def stepsEvent {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (h : ℝ≥0) (c : ℕ → ℝ) + (α b : ℝ) (n : ℕ) : Set Ω := + {sample | ∀ i < n, sample ∈ stepEvent B ((i:ℝ≥0)*h) h (c i) α b} + +lemma stepsEvent_zero {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (h : ℝ≥0) (c : ℕ → ℝ) + (α b : ℝ) : stepsEvent B h c α b 0 = univ := by + ext sample + simp [stepsEvent] + +lemma stepsEvent_succ {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (h : ℝ≥0) (c : ℕ → ℝ) + (α b : ℝ) (n : ℕ) : stepsEvent B h c α b (n+1) = + stepsEvent B h c α b n ∩ stepEvent B ((n:ℝ≥0)*h) h (c n) α b := by + ext sample + simp only [stepsEvent,mem_ofPred_eq,mem_inter_iff,Nat.lt_succ_iff] + exact ⟨fun hh => ⟨fun i hi => hh i (Nat.le_of_lt hi),hh n le_rfl⟩, + fun hh i hi => (lt_or_eq_of_le hi).elim (hh.1 i) (fun he => he ▸ hh.2)⟩ + +lemma stepsEvent_past {Ω : Type*} [MeasurableSpace Ω] (B : ℝ≥0 → Ω → ℝ) + (h : ℝ≥0) (c : ℕ → ℝ) (α b : ℝ) (n : ℕ) : + MeasurableSet[pastSigma B ((n:ℝ≥0)*h)] (stepsEvent B h c α b n) := by + induction n with + | zero => rw [stepsEvent_zero]; exact .univ + | succ n ih => + rw [stepsEvent_succ] + have he : ((n+1:ℕ):ℝ≥0)*h = (n:ℝ≥0)*h+h := by push_cast; ring + rw [he] + exact ((pastSigma_mono B (s := (n:ℝ≥0)*h) (t := (n:ℝ≥0)*h+h) (le_add_right le_rfl)) _ ih).inter + (stepEvent_past B _ _ _ _ _) + +lemma stepsEvent_pos {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (h : ℝ≥0) (c : ℕ → ℝ) (α b : ℝ) (n : ℕ) + (hpos : ∀ i < n, 0 < P (stepEvent B ((i:ℝ≥0)*h) h (c i) α b)) : + 0 < P (stepsEvent B h c α b n) := by + induction n with + | zero => rw [stepsEvent_zero,measure_univ]; exact zero_lt_one + | succ n ih => + rw [stepsEvent_succ,past_inter_step hB _ _ _ _ _ _ (stepsEvent_past B h c α b n)] + exact ENNReal.mul_pos (ih (fun i hi => hpos i (Nat.lt_succ_of_lt hi))).ne' (hpos n (Nat.lt_succ_self n)).ne' + +lemma exists_grid_interval (h : ℝ≥0) {n : ℕ} (hn : 0 < n) {t : ℝ≥0} + (ht : t ≤ (n:ℝ≥0)*h) : + ∃ i < n, (i:ℝ≥0)*h ≤ t ∧ t ≤ ((i+1:ℕ):ℝ≥0)*h := by + induction n with + | zero => omega + | succ n ih => + by_cases hn0 : n=0 + · subst n + exact ⟨0,by omega,by simp,by simpa using ht⟩ + · by_cases hh : t ≤ (n:ℝ≥0)*h + · obtain ⟨i,hi,hi1,hi2⟩ := ih (Nat.pos_of_ne_zero hn0) hh + exact ⟨i,Nat.lt_succ_of_lt hi,hi1,hi2⟩ + · exact ⟨n,Nat.lt_succ_self n,(lt_of_not_ge hh).le,ht⟩ + +lemma endpoint_error_bound (f u : ℝ≥0 → ℝ) (h : ℝ≥0) (α : ℝ) (n : ℕ) + (hz : f 0 = u 0) + (herr : ∀ i < n, |f ((i:ℝ≥0)*h+h)-f ((i:ℝ≥0)*h)- + (u ((i:ℝ≥0)*h+h)-u ((i:ℝ≥0)*h))| ≤ α*(h:ℝ)) : + ∀ i ≤ n, |f ((i:ℝ≥0)*h)-u ((i:ℝ≥0)*h)| ≤ (i:ℝ)*α*(h:ℝ) := by + intro i hi + induction i with + | zero => simp [hz] + | succ i ih => + have hei : ((i+1:ℕ):ℝ≥0)*h = (i:ℝ≥0)*h+h := by push_cast; ring + rw [hei] + have hh := herr i (by omega) + have hh2 := ih (by omega) + calc + _ = |(f ((i:ℝ≥0)*h+h)-f ((i:ℝ≥0)*h)- + (u ((i:ℝ≥0)*h+h)-u ((i:ℝ≥0)*h)))+ + (f ((i:ℝ≥0)*h)-u ((i:ℝ≥0)*h))| := by congr 1; ring + _ ≤ _ := abs_add_le _ _ + _ ≤ _ := add_le_add hh hh2 + _ = _ := by push_cast; ring + +lemma tube_of_steps (f u : ℝ≥0 → ℝ) (hf : Continuous f) (h : ℝ≥0) (n : ℕ) + (hn : 0 < n) {α b L : ℝ} (hα : 0 ≤ α) (hL : 0 ≤ L) (hz : f 0=u 0) + (hu : ∀ s ∈ Icc 0 ((n:ℝ≥0)*h), ∀ t ∈ Icc 0 ((n:ℝ≥0)*h), + |u s-u t| ≤ L*|((s:ℝ)-(t:ℝ))|) + (hs : ∀ i < n, (fun s => f ((i:ℝ≥0)*h+s)-f ((i:ℝ≥0)*h)) ∈ + stepSet h (u ((i:ℝ≥0)*h+h)-u ((i:ℝ≥0)*h)) α b) : + ∀ t ∈ Icc 0 ((n:ℝ≥0)*h), |f t-u t| ≤ b+(n:ℝ)*α*(h:ℝ)+L*(h:ℝ) := by + have he := endpoint_error_bound f u h α n hz (fun i hi => (hs i hi).1.le) + intro t ht + obtain ⟨i,hi,hit,hti⟩ := exists_grid_interval h hn ht.2 + have hiadd : ((i+1:ℕ):ℝ≥0)*h = (i:ℝ≥0)*h+h := by push_cast; ring + have hsub : t-(i:ℝ≥0)*h ≤ h := by + rw [tsub_le_iff_right] + rw [hiadd] at hti + simpa only [add_comm] using hti + have hosc : |f t-f ((i:ℝ≥0)*h)| ≤ b := by + have hc : Continuous (fun s => f ((i:ℝ≥0)*h+s)-f ((i:ℝ≥0)*h)) := + (hf.comp (continuous_const.add continuous_id)).sub continuous_const + have hh := probe_bound_all hc h (hs i hi).2 (t-(i:ℝ≥0)*h) hsub + simpa only [add_tsub_cancel_of_le hit] using hh + have hig : (i:ℝ≥0)*h ≤ (n:ℝ≥0)*h := by gcongr + have hul : |u ((i:ℝ≥0)*h)-u t| ≤ L*(h:ℝ) := by + apply (hu _ ⟨bot_le,hig⟩ _ ht).trans + have habs : |((i:ℝ≥0)*h:ℝ)-(t:ℝ)| ≤ (h:ℝ) := by + simp only [NNReal.coe_natCast] + rw [abs_of_nonpos (sub_nonpos.2 (show (i:ℝ)*(h:ℝ) ≤ (t:ℝ) by exact_mod_cast hit))] + have htR : (t:ℝ) ≤ (i:ℝ)*(h:ℝ)+(h:ℝ) := by exact_mod_cast (hiadd ▸ hti) + linarith + exact mul_le_mul_of_nonneg_left habs hL + calc + _ = |(f t-f ((i:ℝ≥0)*h))+(f ((i:ℝ≥0)*h)-u ((i:ℝ≥0)*h))+ + (u ((i:ℝ≥0)*h)-u t)| := by congr 1; ring + _ ≤ (|f t-f ((i:ℝ≥0)*h)|+|f ((i:ℝ≥0)*h)-u ((i:ℝ≥0)*h)|)+ + |u ((i:ℝ≥0)*h)-u t| := + (abs_add_le _ _).trans (add_le_add (abs_add_le _ _) le_rfl) + _ ≤ b+(i:ℝ)*α*(h:ℝ)+L*(h:ℝ) := add_le_add (add_le_add hosc (he i hi.le)) hul + _ ≤ _ := by gcongr + +end SLEExactGauge.BrownianSupport + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianSupport + +lemma lipschitzTube_pos {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) (u : ℝ≥0 → ℝ) + (hu0 : u 0=0) {L : ℝ} (hL : 0 ≤ L) + (hu : ∀ s ∈ Icc 0 T, ∀ t ∈ Icc 0 T, |u s-u t| ≤ L*|(s:ℝ)-(t:ℝ)|) + {ε : ℝ} (hε : 0 < ε) : + 0 < P {sample | ∀ t ∈ Icc 0 T, |B t sample-u t| < ε} := by + by_cases hT : T=0 + · have hsub : (univ : Set Ω) ≤ᵐ[P] {sample | ∀ t ∈ Icc 0 T, |B t sample-u t| < ε} := by + filter_upwards [hB.eval_zero_ae_eq_zero] with sample hs _ + intro t ht + have ht0 : t=0 := le_antisymm (ht.2.trans hT.le) bot_le + simpa [ht0,hs,hu0] using hε + have hm := measure_mono_ae hsub + rw [measure_univ] at hm + exact zero_lt_one.trans_le hm + have hTp : 0 < T := lt_of_le_of_ne bot_le (Ne.symm hT) + have hTR : 0 < (T:ℝ) := hTp + let α : ℝ := ε/(4*((T:ℝ)+1)) + let b : ℝ := ε/4 + have hα : 0 < α := by dsimp [α]; positivity + have hb : 0 < b := by dsimp [b]; positivity + obtain ⟨δ,hδ,hd⟩ := small_step_pos hB hL hα hb + let H : ℝ := min δ ((ε/4)/(L+1)) + have hH : 0 < H := lt_min hδ (div_pos (by positivity) (by linarith)) + obtain ⟨n,hn⟩ := exists_nat_gt (max 1 ((T:ℝ)/H)) + have hnR : 0 < (n:ℝ) := lt_trans (by norm_num) (lt_of_le_of_lt (le_max_left _ _) hn) + have hnN : 0 < n := by exact_mod_cast hnR + have hnNN : 0 < (n:ℝ≥0) := by exact_mod_cast hnN + let h : ℝ≥0 := T/(n:ℝ≥0) + have hh : 0 < h := div_pos hTp hnNN + have hhH : (h:ℝ) ≤ H := by + change (T:ℝ)/(n:ℝ) ≤ H + apply (div_le_iff₀ hnR).2 + have hx := (div_lt_iff₀ hH).1 (lt_of_le_of_lt (le_max_right _ _) hn) + linarith + have hhδ : (h:ℝ) ≤ δ := hhH.trans (min_le_left _ _) + have hLtune : L*(h:ℝ) ≤ ε/4 := by + have h1 := (le_div_iff₀ (by linarith : 0 < L+1)).1 (hhH.trans (min_le_right _ _)) + nlinarith [h.coe_nonneg] + have hαtune : α*(T:ℝ) ≤ ε/4 := by + have heq : α*((T:ℝ)+1) = ε/4 := by dsimp [α]; field_simp + nlinarith + have hend : (n:ℝ≥0)*h = T := by dsimp [h]; field_simp + have hendR : (n:ℝ)*(h:ℝ) = T := by exact_mod_cast hend + let c (i : ℕ) : ℝ := u ((i:ℝ≥0)*h+h)-u ((i:ℝ≥0)*h) + have hgrid (i : ℕ) (hi : i hd h hh hhδ (c i) (hc i hi) _) + have hsub : stepsEvent B h c α b n ≤ᵐ[P] + {sample | ∀ t ∈ Icc 0 T, |B t sample-u t| < ε} := by + filter_upwards [hB.cont,hB.eval_zero_ae_eq_zero] with sample hcont hzero hs + have hhbound := tube_of_steps (fun t => B t sample) u hcont h n hnN hα.le hL + (hzero.trans hu0.symm) (by simpa only [hend] using hu) hs + intro t ht + have hbt := hhbound t (by simpa only [hend] using ht) + have hcst : b+(n:ℝ)*α*(h:ℝ)+L*(h:ℝ) < ε := by + have heq : (n:ℝ)*α*(h:ℝ) = α*(T:ℝ) := by rw [← hendR]; ring + rw [heq] + dsimp [b] + linarith + exact hbt.trans_lt hcst + exact hp.trans_le (measure_mono_ae hsub) + +theorem uniformTube_pos {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) (u : ℝ≥0 → ℝ) + (hu : ContinuousOn u (Icc 0 T)) (hu0 : u 0 = 0) {ε : ℝ} (hε : 0 < ε) : + 0 < P {sample | ∀ t ∈ Icc 0 T, |B t sample-u t| < ε} := by + let v : ℝ → ℝ := fun x => u x.toNNReal + have hv : ContinuousOn v (Icc 0 (T:ℝ)) := + hu.comp continuous_real_toNNReal.continuousOn + (fun x hx => ⟨bot_le,Real.toNNReal_le_iff_le_coe.2 hx.2⟩) + obtain ⟨p,hp⟩ := exists_polynomial_near_of_continuousOn 0 (T:ℝ) v hv (ε/8) (by positivity) + let w : ℝ≥0 → ℝ := fun t => p.eval (t:ℝ)-p.eval 0 + have hw0 : w 0=0 := by simp [w] + have hp0 : |p.eval 0| < ε/8 := by + have hh := hp 0 ⟨le_rfl,T.coe_nonneg⟩ + simpa [v,hu0] using hh + have hwu (t : ℝ≥0) (ht : t ∈ Icc 0 T) : |w t-u t| < ε/4 := by + have hpt : |p.eval (t:ℝ)-u t| < ε/8 := by + simpa [v] using hp (t:ℝ) ⟨t.coe_nonneg,ht.2⟩ + calc + _ = |(p.eval (t:ℝ)-u t)-p.eval 0| := by dsimp [w]; congr 1; ring + _ ≤ |p.eval (t:ℝ)-u t|+|p.eval 0| := by + simpa only [sub_eq_add_neg,abs_neg] using abs_add_le (p.eval (t:ℝ)-u t) (-p.eval 0) + _ < ε/4 := by linarith + have hpc : ContDiff ℝ 1 (fun x : ℝ => p.eval x) := by + simpa using p.contDiff_aeval (𝕜:=ℝ) 1 + obtain ⟨L,hL⟩ := hpc.contDiffOn.exists_lipschitzOnWith (by norm_num) (convex_Icc 0 (T:ℝ)) isCompact_Icc + have hw : ∀ s ∈ Icc 0 T, ∀ t ∈ Icc 0 T, |w s-w t| ≤ (L:ℝ)*|(s:ℝ)-(t:ℝ)| := by + intro s hs t ht + have hh := hL.dist_le_mul (s:ℝ) ⟨s.coe_nonneg,hs.2⟩ (t:ℝ) ⟨t.coe_nonneg,ht.2⟩ + simpa [w,Real.dist_eq] using hh + have hpw := lipschitzTube_pos hB T w hw0 L.coe_nonneg hw (show 0 < ε/2 by positivity) + apply hpw.trans_le + apply measure_mono + intro sample hs t ht + calc + _ = |(B t sample-w t)+(w t-u t)| := by congr 1; ring + _ ≤ |B t sample-w t|+|w t-u t| := abs_add_le _ _ + _ < ε := by linarith [hs t ht,hwu t ht] + +end SLEExactGauge.BrownianSupport + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/Charge.lean b/lean/OAI/Probability/SLELocalization/Charge.lean new file mode 100644 index 0000000000000000000000000000000000000000..4998d50215421945758f91ac4102d8e289bed067 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/Charge.lean @@ -0,0 +1,874 @@ +import Mathlib +import OAI.Probability.SLELocalization.AngularClock +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Charge estimates. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric TopologicalSpace +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +def sausage (γ : ℝ → ℂ) (v : ℝ) : Set ℂ := + {w | ∃ t : ℝ, 0 ≤ t ∧ dist w (γ t) < v} + +def sausageCharge (κ : ℝ) (γ : ℝ → ℂ) (v : ℝ) (A : Set ℂ) : ℝ≥0∞ := + ENNReal.ofReal (v^(-codimension κ)) * volume (A ∩ sausage γ v) + +lemma sausage_open (γ : ℝ → ℂ) (v : ℝ) : IsOpen (sausage γ v) := by + have he : sausage γ v = ⋃ t : ℝ, ⋃ (_ : 0 ≤ t), ball (γ t) v := by + ext w + simp [sausage,mem_ball] + rw [he] + exact isOpen_iUnion (fun t => isOpen_iUnion (fun _ => isOpen_ball)) + +lemma sausage_eq_dense {γ : ℝ → ℂ} (hγ : ContinuousOn γ (Ici 0)) (v : ℝ) : + sausage γ v = ⋃ n : ℕ, ball (γ (denseSeq ℝ≥0 n)) v := by + ext w + simp only [sausage,mem_ofPred_eq,mem_iUnion,mem_ball] + constructor + · rintro ⟨t,ht,hvisit⟩ + by_contra hn + push Not at hn + have hc : Continuous (fun q : ℝ≥0 => dist w (γ q)) := + continuous_const.dist (hγ.comp_continuous continuous_subtype_val (fun q => q.coe_nonneg)) + have hh : v ≤ dist w (γ t) := (denseRange_denseSeq ℝ≥0).induction_on (p := fun q : ℝ≥0 => v ≤ dist w (γ q)) (⟨t,ht⟩ : ℝ≥0) + (isClosed_le continuous_const hc) hn + exact (not_lt_of_ge hh) hvisit + · rintro ⟨n,hn⟩ + exact ⟨denseSeq ℝ≥0 n,(denseSeq ℝ≥0 n).coe_nonneg,hn⟩ + +lemma measurable_sausage_representative {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (γ : Ω → ℝ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hc : ∀ᵐ sample ∂P, ContinuousOn (γ sample) (Ici 0)) (v : ℝ) : + ∃ E : Set (Ω × ℂ), MeasurableSet E ∧ + ∀ᵐ sample ∂P, ∀ w : ℂ, (sample,w) ∈ E ↔ w ∈ sausage (γ sample) v := by + let Y (n : ℕ) := (hγ (denseSeq ℝ≥0 n) (denseSeq ℝ≥0 n).coe_nonneg).mk (fun sample => γ sample (denseSeq ℝ≥0 n)) + have hY (n : ℕ) : Measurable (Y n) := (hγ _ (denseSeq ℝ≥0 n).coe_nonneg).measurable_mk + have he : ∀ᵐ sample ∂P, ∀ n : ℕ, γ sample (denseSeq ℝ≥0 n) = Y n sample := + ae_all_iff.2 (fun n => (hγ _ (denseSeq ℝ≥0 n).coe_nonneg).ae_eq_mk) + let E : Set (Ω × ℂ) := ⋃ n : ℕ, {x | dist x.2 (Y n x.1) < v} + refine ⟨E,MeasurableSet.iUnion (fun n => measurableSet_lt + (measurable_snd.dist ((hY n).comp measurable_fst)) measurable_const),?_⟩ + filter_upwards [hc,he] with sample hcont heq + intro w + rw [sausage_eq_dense hcont v] + simp only [E,mem_iUnion,mem_ofPred_eq,mem_ball,heq] + +lemma expected_sausage_area {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [SFinite P] + (γ : Ω → ℝ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hc : ∀ᵐ sample ∂P, ContinuousOn (γ sample) (Ici 0)) (v : ℝ) + (A : Set ℂ) (_hA : MeasurableSet A) : + (∫⁻ sample, volume (A ∩ sausage (γ sample) v) ∂P) = + ∫⁻ w in A, P {sample | w ∈ sausage (γ sample) v} := by + classical + obtain ⟨E,hE,he⟩ := measurable_sausage_representative γ hγ hc v + let F : Ω → ℂ → ℝ≥0∞ := fun sample w => E.indicator (fun _ => 1) (sample,w) + have hFm : Measurable (Function.uncurry F) := measurable_const.indicator hE + have hleft : (fun sample => volume (A ∩ sausage (γ sample) v)) =ᵐ[P] + (fun sample => ∫⁻ w in A, F sample w) := by + filter_upwards [he] with sample heq + have hf : F sample = (sausage (γ sample) v).indicator (fun _ => (1:ℝ≥0∞)) := by + funext w + simp only [F,indicator_apply,heq] + rw [hf,lintegral_indicator_fun_one (sausage_open (γ sample) v).measurableSet, + Measure.restrict_apply (sausage_open (γ sample) v).measurableSet,inter_comm] + rw [lintegral_congr_ae hleft,lintegral_lintegral_swap hFm.aemeasurable] + apply lintegral_congr + intro w + have hset : MeasurableSet {sample | (sample,w) ∈ E} := hE.preimage (measurable_id.prodMk measurable_const) + have hFe : (fun sample => F sample w) = ({sample | (sample,w) ∈ E}).indicator (fun _ => (1:ℝ≥0∞)) := rfl + rw [hFe,lintegral_indicator_fun_one hset] + apply measure_congr + filter_upwards [he] with sample heq + exact propext (heq w) + +end SLEExactGauge + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric TopologicalSpace +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +lemma IsChordalSLE.maps {Ω : Type*} [MeasurableSpace Ω] {κ : ℝ} {P : Measure Ω} + {γ : Ω → ℝ → ℂ} (h : IsChordalSLE κ P γ) : + ∃ B : ℝ≥0 → Ω → ℝ, ∃ g f : Ω → ℝ → ℂ → ℂ, + IsBrownianReal B P ∧ ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample) := by + classical + obtain ⟨hm,B,hB,htrace⟩ := h + have hex (sample : Ω) : ∃ g f : ℝ → ℂ → ℂ, + IsLoewnerTrace (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) → + IsLoewnerTraceUsing (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) g f := by + by_cases hh : IsLoewnerTrace (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) + · obtain ⟨hc,hz,hi,ht,g,f,hr⟩ := hh + exact ⟨g,f,fun _ => ⟨hc,hz,hi,ht,hr⟩⟩ + · exact ⟨0,0,fun hh' => (hh hh').elim⟩ + choose g f hgf using hex + exact ⟨B,g,f,hB,htrace.mono (fun sample hs => hgf sample hs)⟩ + +lemma IsChordalSLE.continuous {Ω : Type*} [MeasurableSpace Ω] {κ : ℝ} {P : Measure Ω} + {γ : Ω → ℝ → ℂ} (h : IsChordalSLE κ P γ) : + ∀ᵐ sample ∂P, ContinuousOn (γ sample) (Ici 0) := by + obtain ⟨B,hB,ht⟩ := h.2 + exact ht.mono (fun _ hh => hh.1) + +lemma IsChordalSLE.no_sausage_below {Ω : Type*} [MeasurableSpace Ω] {κ : ℝ} {P : Measure Ω} + {γ : Ω → ℝ → ℂ} (h : IsChordalSLE κ P γ) {z : ℂ} {v : ℝ} (hz : z.im ≤ -v) : + P {sample | z ∈ sausage (γ sample) v} = 0 := by + obtain ⟨B,hB,ht⟩ := h.2 + apply measure_mono_null (t := {sample | ¬ IsLoewnerTrace + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample)}) + · intro sample hs hh + obtain ⟨t,ht0,hv⟩ := hs + have hi := hh.2.2.1 t ht0 + have hab := Complex.abs_im_le_norm (z-γ sample t) + have hn := neg_abs_le (z-γ sample t).im + rw [dist_eq_norm] at hv + simp only [Complex.sub_im] at hab hn + linarith + · exact ae_iff.1 ht + +theorem sausage_point_bound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ A K : ℝ, 1 < A ∧ 0 < K ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (γ : Ω → ℝ → ℂ) (_hγ : IsChordalSLE κ P γ) (z : ℂ) (v : ℝ) + (_hv : 0 < v) (_hhigh : A*v < z.im), + P {sample | z ∈ sausage (γ sample) v} ≤ + ENNReal.ofReal (K*v^(codimension κ)*z.im^(-codimension κ)) := by + obtain ⟨C,c,hC,hc,hc1,hbound⟩ := euclideanApproachBound κ hκ + let p := codimension κ + refine ⟨6/c,C*3^p*2^(-p),by rw [lt_div_iff₀ hc]; linarith, + by positivity,?_⟩ + intro Ω _ P _ γ hγ z v hv hhigh + obtain ⟨B,g,f,hB,hmaps⟩ := hγ.maps + have hy : 0 < z.im := lt_trans (by positivity : 0 < (6/c)*v) hhigh + have hcy : 6*v < c*z.im := by + have hx := mul_lt_mul_of_pos_left hhigh hc + field_simp at hx + nlinarith + have hsmall : 2*v < z.im := by nlinarith + have hsub : {sample | z ∈ sausage (γ sample) v} ≤ᵐ[P] + {sample | liveDistanceApproach (γ sample) z (3*v)} := by + filter_upwards [hmaps] with sample hm hs + obtain ⟨visitTime,hvisitTime,hvisit⟩ := hs + let visitNonneg : ℝ≥0 := ⟨visitTime,hvisitTime⟩ + have hcont : Continuous (fun time : ℝ≥0 => dist z (γ sample time)) := + continuous_const.dist (hm.1.comp_continuous continuous_subtype_val + (fun time => time.coe_nonneg)) + let approachTimes : Set ℝ≥0 := Icc 0 visitNonneg ∩ + {time | dist z (γ sample time) ≤ 2*v} + have hcompact : IsCompact approachTimes := + isCompact_Icc.inter_right (isClosed_le hcont continuous_const) + obtain ⟨firstTime,hfirst,hmin⟩ := hcompact.exists_isLeast + ⟨visitNonneg,⟨⟨zero_le,le_rfl⟩,by change dist z (γ sample visitTime) ≤ 2*v; linarith⟩⟩ + have hfirstTime : (firstTime:ℝ) ≤ visitTime := hfirst.1.2 + have hstrict (time : ℝ≥0) (htime : time < firstTime) : + 2*v < dist z (γ sample time) := by + by_contra hn + exact (not_le_of_gt htime) + (hmin ⟨⟨zero_le,htime.le.trans hfirst.1.2⟩,not_lt.1 hn⟩) + have hinit : 2*v < dist z (γ sample 0) := by + rw [hm.2.1,dist_zero_right] + exact hsmall.trans_le (Complex.im_le_norm z) + have hdist : dist z (γ sample firstTime) = 2*v := by + apply le_antisymm hfirst.2 + by_contra hn + have hlt : dist z (γ sample firstTime) < 2*v := not_le.1 hn + have hcc : ContinuousOn (fun time : ℝ => dist z (γ sample time)) + (Icc 0 (firstTime:ℝ)) := + (continuous_const.dist continuous_id).comp_continuousOn + (hm.1.mono Icc_subset_Ici_self) + obtain ⟨time,htime,heq⟩ := intermediate_value_Icc' firstTime.coe_nonneg hcc + ⟨hlt.le,hinit.le⟩ + have htimeFirst : time < (firstTime:ℝ) := + lt_of_le_of_ne htime.2 (by intro heq; subst time; linarith) + have hh := hstrict ⟨time,htime.1⟩ htimeFirst + change 2*v < dist z (γ sample time) at hh + exact (not_lt_of_ge heq.le) hh + have hbefore (time : ℝ) (htime : time ∈ Icc 0 (firstTime:ℝ)) : + 2*v ≤ dist z (γ sample time) := by + rcases lt_or_eq_of_le htime.2 with hlt | heq + · exact (hstrict ⟨time,htime.1⟩ hlt).le + · rw [heq,hdist] + have hfree : ball z (2*v) ⊆ halfPlane \ localizationSegment (γ sample) 0 firstTime := by + intro point hpoint + have hnorm : ‖point-z‖ < 2*v := by + simpa only [mem_ball,dist_eq_norm] using hpoint + constructor + · have hh := Complex.abs_im_le_norm (point-z) + have hn := neg_abs_le (point-z).im + change 0 < point.im + simp only [Complex.sub_im] at hh hn + linarith + · rintro ⟨time,htime,rfl⟩ + have hh := hbefore time htime + have hh' := mem_ball.1 hpoint + rw [dist_comm] at hh' + linarith + have hclosure := hm.future_tip_mem_closure firstTime.coe_nonneg hfirstTime + have hball : γ sample visitTime ∈ ball z (2*v) := by + rw [mem_ball,dist_comm] + linarith + obtain ⟨point,hpointBall,hpointDomain⟩ := + mem_closure_iff.1 hclosure (ball z (2*v)) isOpen_ball hball + have hcomponent := + (convex_ball z (2*v)).isPreconnected.subset_connectedComponentIn hpointBall hfree + have hzball : z ∈ ball z (2*v) := mem_ball_self (by positivity) + have hzlive : z ∈ localizationDomain (γ sample) firstTime := by + refine ⟨hfree hzball,?_⟩ + rw [← connectedComponentIn_eq (hcomponent hzball)] + exact hpointDomain.2 + refine ⟨firstTime,hzlive,?_⟩ + have hnot : γ sample firstTime ∈ (localizationDomain (γ sample) firstTime)ᶜ := by + intro hh + exact hh.1.2 ⟨firstTime,⟨firstTime.coe_nonneg,le_rfl⟩,rfl⟩ + have hh := infDist_le_dist_of_mem (x := z) hnot + rw [hdist] at hh + linarith + apply (measure_mono_ae hsub).trans + apply (hbound P B hB γ g f hγ.1 hmaps z hy (3*v) (by positivity) (by linarith)).trans + apply ENNReal.ofReal_le_ofReal + have hn : 0 < ‖z‖ := lt_of_lt_of_le hy (Complex.im_le_norm z) + have ha : 0 ≤ 8/κ-1 := by rw [sub_nonneg,le_div_iff₀ hκ.1]; linarith [hκ.2] + have hs : (z.im/‖z‖)^(8/κ-1) ≤ 1 := + Real.rpow_le_one (by positivity) ((div_le_one hn).2 (Complex.im_le_norm z)) ha + have hnon : 0 ≤ C*(2*z.im)^(-p)*(3*v)^p := by positivity + calc + C*((2*z.im)^(-p)*(z.im/‖z‖)^(8/κ-1))*(3*v)^p + = (C*(2*z.im)^(-p)*(3*v)^p)*((z.im/‖z‖)^(8/κ-1)) := by ring + _ ≤ (C*(2*z.im)^(-p)*(3*v)^p)*1 := mul_le_mul_of_nonneg_left hs hnon + _ = (C*3^p*2^(-p))*v^p*z.im^(-p) := by + rw [Real.mul_rpow (by norm_num : (0:ℝ) ≤ 2) hy.le, + Real.mul_rpow (by norm_num : (0:ℝ) ≤ 3) hv.le] + ring + +end SLEExactGauge + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric TopologicalSpace +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +def regionBand (R a b : ℝ) : Set ℂ := + {w | w.re ∈ Icc (-R) R ∧ w.im ∈ Icc a b} + +lemma regionBand_measurable (R a b : ℝ) : MeasurableSet (regionBand R a b) := + (Complex.measurable_re measurableSet_Icc).inter (Complex.measurable_im measurableSet_Icc) + +lemma lintegral_regionBand (R a b : ℝ) (F : ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ w in regionBand R a b, F w.im) = + ENNReal.ofReal (2*R) * ∫⁻ y in Icc a b, F y := by + have he := Complex.volume_preserving_equiv_real_prod.setLIntegral_comp_preimage_emb + Complex.measurableEquivRealProd.measurableEmbedding (fun x : ℝ × ℝ => F x.2) + (Icc (-R) R ×ˢ Icc a b) + change (∫⁻ w in regionBand R a b, F w.im) = _ at he + rw [he,Measure.volume_eq_prod,← Measure.prod_restrict, + lintegral_prod (fun x : ℝ × ℝ => F x.2) (hF.comp measurable_snd).aemeasurable] + simp only [lintegral_const,Measure.restrict_apply_univ,Real.volume_Icc,sub_neg_eq_add, + ← two_mul R,mul_comm] + +lemma volume_regionBand (R a b : ℝ) : + volume (regionBand R a b) = ENNReal.ofReal (2*R)*ENNReal.ofReal (b-a) := by + simpa only [lintegral_one,Measure.restrict_apply_univ,Real.volume_Icc] using + lintegral_regionBand R a b (fun _ => 1) measurable_const + +lemma height_kernel_finite (R p : ℝ) (hR : 0 ≤ R) (hp : p < 1) : + (∫⁻ w in regionBand R 0 R, ENNReal.ofReal (w.im^(-p))) < ⊤ := by + rw [lintegral_regionBand R 0 R (fun y : ℝ => ENNReal.ofReal (y^(-p))) (measurable_id.pow_const (-p)).ennreal_ofReal] + apply ENNReal.mul_lt_top ENNReal.ofReal_lt_top + have hi : IntegrableOn (fun y : ℝ => y^(-p)) (Icc 0 R) := + (intervalIntegrable_iff_integrableOn_Icc_of_le hR).1 (intervalIntegral.intervalIntegrable_rpow' (by linarith)) + rw [← ofReal_integral_eq_lintegral_ofReal hi] + · exact ENNReal.ofReal_lt_top + · filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy + exact Real.rpow_nonneg hy.1 _ + +end SLEExactGauge + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric TopologicalSpace +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +universe u + +lemma expected_sausage_area_bound + {κ R A K : ℝ} (_hR : 0 < R) (hA : 1 < A) (hK : 0 < K) + (hb : ∀ {Ω : Type u} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (γ : Ω → ℝ → ℂ) (_hγ : IsChordalSLE κ P γ) (z : ℂ) (v : ℝ) + (_hv : 0 < v) (_hhigh : A*v < z.im), + P {sample | z ∈ sausage (γ sample) v} ≤ + ENNReal.ofReal (K*v^(codimension κ)*z.im^(-codimension κ))) + {Ω : Type u} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (γ : Ω → ℝ → ℂ) (hγ : IsChordalSLE κ P γ) (v : ℝ) (hv : 0 < v) : + (∫⁻ sample, volume (ball 0 R ∩ sausage (γ sample) v) ∂P) ≤ + ENNReal.ofReal (2*R)*ENNReal.ofReal ((A+1)*v) + + ENNReal.ofReal (K*v^(codimension κ)) * + ∫⁻ w in regionBand R 0 R, ENNReal.ofReal (w.im^(-codimension κ)) := by + rw [expected_sausage_area γ hγ.1 hγ.continuous v (ball 0 R) measurableSet_ball] + let F := (regionBand R (-v) (A*v)).indicator (fun _ => (1 : ℝ≥0∞)) + let G := (regionBand R 0 R).indicator (fun w => ENNReal.ofReal (w.im^(-codimension κ))) + have hFm : Measurable F := measurable_const.indicator (regionBand_measurable _ _ _) + have hGm : Measurable G := + (Complex.measurable_im.pow_const _).ennreal_ofReal.indicator (regionBand_measurable _ _ _) + have hmono : (∫⁻ w in ball 0 R, P {sample | w ∈ sausage (γ sample) v}) ≤ + ∫⁻ w in ball 0 R, F w + ENNReal.ofReal (K*v^(codimension κ))*G w := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem measurableSet_ball] with w hw + have hnorm : ‖w‖ < R := by simpa only [mem_ball,dist_zero_right] using hw + have hre : w.re ∈ Icc (-R) R := by + have hh := Complex.abs_re_le_norm w + exact ⟨by linarith [neg_abs_le w.re],by linarith [le_abs_self w.re]⟩ + by_cases hhigh : A*v < w.im + · have hwG : w ∈ regionBand R 0 R := ⟨hre,by constructor; nlinarith; exact (Complex.im_le_norm w).trans hnorm.le⟩ + have hh := hb P γ hγ w v hv hhigh + have hmul : ENNReal.ofReal (K*v^(codimension κ)*w.im^(-codimension κ)) = + ENNReal.ofReal (K*v^(codimension κ))*G w := by + rw [show G w = ENNReal.ofReal (w.im^(-codimension κ)) from indicator_of_mem hwG _] + exact ENNReal.ofReal_mul (by positivity) + rw [hmul] at hh + exact hh.trans (le_add_left le_rfl) + · by_cases hlow : w.im ≤ -v + · rw [hγ.no_sausage_below hlow] + exact zero_le + · have hwF : w ∈ regionBand R (-v) (A*v) := ⟨hre,le_of_lt (not_le.1 hlow),not_lt.1 hhigh⟩ + have hh : P {sample | w ∈ sausage (γ sample) v} ≤ 1 := prob_le_one + rw [show F w = 1 from indicator_of_mem hwF _] + exact hh.trans (le_add_right le_rfl) + apply hmono.trans + apply (setLIntegral_le_lintegral (ball 0 R) (fun w => F w + ENNReal.ofReal (K*v^(codimension κ))*G w)).trans + rw [lintegral_add_left hFm,lintegral_const_mul _ hGm] + rw [show (∫⁻ w, F w) = volume (regionBand R (-v) (A*v)) from + lintegral_indicator_fun_one (regionBand_measurable _ _ _), + show (∫⁻ w, G w) = ∫⁻ w in regionBand R 0 R, ENNReal.ofReal (w.im^(-codimension κ)) from + lintegral_indicator (regionBand_measurable _ _ _) _,volume_regionBand] + have he : A*v-(-v) = (A+1)*v := by ring + rw [he] + +theorem uniformBoundedRegionCharge (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (R : ℝ) (hR : 0 < R) : + ∃ C : ℝ≥0, ∀ {Ω : Type u} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (γ : Ω → ℝ → ℂ) + (_hγ : IsChordalSLE κ P γ) (v : ℝ) (_hv : 0 < v) (_hv1 : v ≤ 1), + (∫⁻ sample, sausageCharge κ (γ sample) v (ball 0 R) ∂P) ≤ C := by + obtain ⟨A,K,hA,hK,hbound⟩ := sausage_point_bound κ hκ + let p := codimension κ + have hp : p < 1 := by dsimp [p,codimension,dimension]; linarith [hκ.1] + let D := ∫⁻ w in regionBand R 0 R, ENNReal.ofReal (w.im^(-p)) + have hD : D < ⊤ := height_kernel_finite R p hR.le hp + let Z := ENNReal.ofReal (2*R*(A+1))+ENNReal.ofReal K*D + have hZ : Z ≠ ⊤ := (ENNReal.add_lt_top.2 + ⟨ENNReal.ofReal_lt_top,ENNReal.mul_lt_top ENNReal.ofReal_lt_top hD⟩).ne + refine ⟨Z.toNNReal,?_⟩ + intro Ω _ P _ γ hγ v hv hv1 + rw [ENNReal.coe_toNNReal hZ] + change (∫⁻ sample, ENNReal.ofReal (v^(-p))*volume (ball 0 R ∩ sausage (γ sample) v) ∂P) ≤ Z + rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply (mul_le_mul_right (expected_sausage_area_bound hR hA hK hbound P γ hγ v hv) _).trans + change ENNReal.ofReal (v^(-p)) * + (ENNReal.ofReal (2*R)*ENNReal.ofReal ((A+1)*v)+ENNReal.ofReal (K*v^p)*D) ≤ Z + rw [mul_add] + apply add_le_add + · rw [← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*R),← ENNReal.ofReal_mul (Real.rpow_nonneg hv.le _)] + apply ENNReal.ofReal_le_ofReal + have hh : v^(-p)*v ≤ 1 := by + have he : v^(-p)*v = v^(-p+1) := by + simpa only [Real.rpow_one] using (Real.rpow_add hv (-p) 1).symm + rw [he] + exact Real.rpow_le_one hv.le hv1 (by linarith) + calc + v^(-p)*(2*R*((A+1)*v)) = (2*R*(A+1))*(v^(-p)*v) := by ring + _ ≤ (2*R*(A+1))*1 := mul_le_mul_of_nonneg_left hh (by positivity) + _ = 2*R*(A+1) := mul_one _ + · have he : v^(-p)*(K*v^p) = K := by + calc + v^(-p)*(K*v^p) = K*(v^(-p)*v^p) := by ring + _ = K := by rw [← Real.rpow_add hv,neg_add_cancel,Real.rpow_zero,mul_one] + rw [← mul_assoc,← ENNReal.ofReal_mul (Real.rpow_nonneg hv.le _),he] + +end SLEExactGauge + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/CircleMeans.lean b/lean/OAI/Probability/SLELocalization/CircleMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e5e81f2711837e3d4cf469ee3e3c1f1a1f55be1 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/CircleMeans.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +open Layer + +lemma circle_derivative_square {u : ℂ → ℝ} (hu : ContDiffOn ℝ 2 u (ball 0 1)) + {r : ℝ} (hr : |r| < 1) : + (circleDMean u r)^2 ≤ (2*Real.pi)*(∫ θ in -Real.pi..Real.pi, + ‖fderiv ℝ u (r • circleMap 0 1 θ)‖^2) := by + let D := fun θ : ℝ => fderiv ℝ u (r • circleMap 0 1 θ) (circleMap 0 1 θ) + have hdu : ContDiffOn ℝ 1 (fderiv ℝ u) (ball 0 1) := + hu.fderiv_of_isOpen isOpen_ball (by norm_num) + have hgrad : Continuous (fun θ : ℝ => fderiv ℝ u (r • circleMap 0 1 θ)) := by + apply continuousOn_univ.1 + exact hdu.continuousOn.comp ((continuous_circleMap 0 1).const_smul r).continuousOn + (fun θ _ => radial_mem hr θ) + have hD : Continuous D := hgrad.clm_apply (continuous_circleMap 0 1) + have hp : -Real.pi ≤ Real.pi := by linarith [Real.pi_pos] + have hc := integral_mul_square_le (continuousOn_memLp_two_Ioc hp hD.continuousOn) + (continuousOn_memLp_two_Ioc hp (continuous_const (y := (1:ℝ))).continuousOn) + have heD : (∫ θ in Ioc (-Real.pi) Real.pi, D θ*1) = circleDMean u r := by + simp only [mul_one,circleDMean,intervalIntegral.integral_of_le hp,D] + have he1 : (∫ θ in Ioc (-Real.pi) Real.pi, (1:ℝ)^2) = 2*Real.pi := by + rw [← intervalIntegral.integral_of_le hp] + simp + ring + rw [heD,he1] at hc + have hle : (∫ θ in Ioc (-Real.pi) Real.pi, D θ^2) ≤ + ∫ θ in -Real.pi..Real.pi, ‖fderiv ℝ u (r • circleMap 0 1 θ)‖^2 := by + rw [intervalIntegral.integral_of_le hp] + apply integral_mono_ae ((hD.pow 2).intervalIntegrable _ _).1 + ((hgrad.norm.pow 2).intervalIntegrable _ _).1 + filter_upwards with θ + have hb := (fderiv ℝ u (r • circleMap 0 1 θ)).le_opNorm (circleMap 0 1 θ) + norm_num only [norm_circleMap_zero,abs_one,mul_one] at hb + have hh := pow_le_pow_left₀ (norm_nonneg _) hb 2 + simpa only [Real.norm_eq_abs,sq_abs,D,Pi.pow_apply] using hh + exact hc.trans (by nlinarith [Real.pi_pos]) + +theorem critical_circle_means {u : ℂ → ℝ} (hu : ContDiffOn ℝ 2 u (ball 0 1)) + {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) (hb : b < 1) : + (circleMean u b-circleMean u a)^2 ≤ 2*Real.pi*Real.log (b/a)* + (∫ s in a..b, s*(∫ θ in -Real.pi..Real.pi, ‖fderiv ℝ u (s • circleMap 0 1 θ)‖^2)) := by + have hs (s : ℝ) (hs : s ∈ Icc a b) : |s| < 1 := + abs_lt.2 ⟨by linarith [hs.1],hs.2.trans_lt hb⟩ + have hD : ContinuousOn (circleDMean u) (Icc a b) := by + intro s hs' + exact ((circle_means_derivatives hu (hs s hs')).2.continuousAt).continuousWithinAt + have ht := weighted_interval_energy ha hab hD + (fun s hs' => (circle_means_derivatives hu (hs s hs')).1) + let E := fun s : ℝ => ∫ θ in -Real.pi..Real.pi, ‖fderiv ℝ u (s • circleMap 0 1 θ)‖^2 + let h := (b+1)/2 + have hh : h < 1 := by dsimp [h]; linarith + have hbh : b < h := by dsimp [h]; linarith + have hdu : ContDiffOn ℝ 1 (fderiv ℝ u) (ball 0 1) := + hu.fderiv_of_isOpen isOpen_ball (by norm_num) + have henergy : ContinuousOn (fun p : ℝ × ℝ => ‖fderiv ℝ u (p.1 • circleMap 0 1 p.2)‖^2) + (Icc 0 h ×ˢ Icc (-Real.pi) Real.pi) := + (hdu.continuousOn.comp radial_continuous.continuousOn + (radial_interval_maps (by norm_num) hh)).norm.pow 2 + have hE : ContinuousOn E (Icc a b) := by + intro s hs' + exact (compact_parameter_continuousAt (F := fun s θ => ‖fderiv ℝ u (s • circleMap 0 1 θ)‖^2) + (by linarith [Real.pi_pos]) + (ha.trans_le hs'.1) (hs'.2.trans_lt hbh) henergy).continuousWithinAt + have hle : (∫ s in a..b, s*(circleDMean u s)^2) ≤ + ∫ s in a..b, (2*Real.pi)*(s*E s) := by + apply intervalIntegral.integral_mono_on hab + ((continuousOn_id.mul (hD.pow 2)).intervalIntegrable_of_Icc hab) + ((continuousOn_const.mul (continuousOn_id.mul hE)).intervalIntegrable_of_Icc hab) + intro s hs' + have hc := mul_le_mul_of_nonneg_left (circle_derivative_square hu (hs s hs')) + (ha.trans_le hs'.1).le + dsimp only [E] + exact hc.trans_eq (by simp only [Pi.mul_apply,id_eq]; ring) + have hl : 0 ≤ Real.log (b/a) := Real.log_nonneg ((one_le_div ha).2 hab) + have hh' := mul_le_mul_of_nonneg_left hle hl + rw [intervalIntegral.integral_const_mul] at hh' + apply ht.trans + convert hh' using 1 + ring + +end SLEExactGauge.RectangleEnergy + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/CommonClocks.lean b/lean/OAI/Probability/SLELocalization/CommonClocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d586d5ad4d53bdddaa02afc3b6f86160c80069a --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/CommonClocks.lean @@ -0,0 +1,1084 @@ +import Mathlib +import OAI.Probability.SLELocalization.Charge +import OAI.Probability.SLELocalization.PhysicalPast +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Finite Tilt estimates. -/ + +section +noncomputable section +open Set Filter +open scoped Topology NNReal +namespace SLEExactGauge.FiniteTilt + +structure CommonCutoff (A : Set ℂ) (u : ℂ → ℝ) where + angle : ℝ + angle_pos : 0 < angle + height : ℝ + height_pos : 0 < height + horizon : ℝ≥0 + horizon_pos : 0 < (horizon:ℝ) + angle_initial : ∀ z ∈ A, angle < z.im/‖z‖ + height_small : ∀ z ∈ A, height < z.im*Real.exp (-u z/(2*angle^2)) + time_large : ∀ z ∈ A, u z*z.im^2/(4*angle^4) < horizon + +def CommonCutoff.at {A : Set ℂ} {u : ℂ → ℝ} (C : CommonCutoff A u) + (z : ℂ) (hz : z ∈ A) : Cutoff z (u z) where + angle := C.angle + angle_pos := C.angle_pos + angle_initial := C.angle_initial z hz + height := C.height + height_pos := C.height_pos + horizon := C.horizon + horizon_pos := C.horizon_pos + height_small := C.height_small z hz + time_large := C.time_large z hz + +lemma commonCutoffs {A : Set ℂ} {u : ℂ → ℝ} {H U α : ℝ} + (hH : 1 ≤ H) (hU : 0 ≤ U) (hα : 0 < α) + (hy : ∀ z ∈ A, 1 ≤ z.im ∧ z.im ≤ H) + (hu : ∀ z ∈ A, 0 ≤ u z ∧ u z ≤ U) + (hs : ∀ z ∈ A, α ≤ z.im/‖z‖) : + ∃ Cs : ℕ → CommonCutoff A u, Tendsto (fun n => (Cs n).angle) atTop (𝓝 0) := by + let δ : ℕ → ℝ := fun n => (α/2)/((n:ℝ)+1) + have hδ (n : ℕ) : 0 < δ n := by dsimp [δ]; positivity + have hδα (n : ℕ) : δ n < α := by + have hh : 1 ≤ (n:ℝ)+1 := by linarith [Nat.cast_nonneg (α := ℝ) n] + have he := div_le_self (by positivity : 0 ≤ α/2) hh + exact he.trans_lt (by linarith) + let ε : ℕ → ℝ := fun n => Real.exp (-U/(2*(δ n)^2))/2 + let T : ℕ → ℝ≥0 := fun n => ⟨U*H^2/(4*(δ n)^4)+1,by positivity⟩ + let Cs : ℕ → CommonCutoff A u := fun n => { + angle := δ n + angle_pos := hδ n + height := ε n + height_pos := by dsimp [ε]; positivity + horizon := T n + horizon_pos := by + have hn : 0 ≤ U*H^2/(4*(δ n)^4) := by positivity + change 0 < U*H^2/(4*(δ n)^4)+1 + linarith + angle_initial := fun z hz => (hδα n).trans_le (hs z hz) + height_small := by + intro z hz + have hu' := (hu z hz).2 + have he : Real.exp (-U/(2*(δ n)^2)) ≤ Real.exp (-u z/(2*(δ n)^2)) := by + apply Real.exp_le_exp.2 + exact div_le_div_of_nonneg_right (neg_le_neg hu') (by positivity) + have hz' := (hy z hz).1 + dsimp only [ε] + have hp := Real.exp_pos (-U/(2*(δ n)^2)) + nlinarith [Real.exp_pos (-u z/(2*(δ n)^2))] + time_large := by + intro z hz + have hz0 : 0 ≤ z.im := (by norm_num : (0:ℝ) ≤ 1).trans (hy z hz).1 + have hz2 : z.im^2 ≤ H^2 := pow_le_pow_left₀ hz0 (hy z hz).2 2 + have hm := mul_le_mul (hu z hz).2 hz2 (sq_nonneg _) hU + have hd := div_le_div_of_nonneg_right hm (by positivity : 0 ≤ 4*(δ n)^4) + change u z*z.im^2/(4*(δ n)^4) < U*H^2/(4*(δ n)^4)+1 + linarith } + refine ⟨Cs,?_⟩ + have ht : Tendsto (fun n : ℕ => (n:ℝ)+1) atTop atTop := + tendsto_atTop_add_const_right _ 1 tendsto_natCast_atTop_atTop + have hh := (tendsto_const_nhds (x := α/2) (f := atTop)).div_atTop ht + simpa only [Cs,δ] using hh + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerCutoff + +lemma solution_mark_dist_le {ε T D δ : ℝ} (hε : 0 < ε) + (hD : 0 ≤ D) (hδ : 0 ≤ δ) {U V : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (V t) (G t)) (Icc 0 T) t) + (h0 : dist (H 0) (G 0) ≤ δ) (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ D) + {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (H t) (G t) ≤ (δ+D)*Real.exp ((4/ε^2)*T) := by + let K : ℝ≥0 := ⟨4/ε^2,by positivity⟩ + have hK : (0:ℝ) < K := by change 0 < 4/ε^2; positivity + have hb (s : ℝ) (hs : s ∈ Ico 0 T) : + dist (velocity ε (V s) (G s)) (velocity ε (U s) (G s)) ≤ (K:ℝ)*D := by + rw [dist_eq_norm] + calc + _ ≤ (4/ε^2)*|V s-U s| := norm_velocity_driver_sub_le hε _ _ _ + _ ≤ (K:ℝ)*D := by + rw [abs_sub_comm] + exact mul_le_mul_of_nonneg_left (hUV s ⟨hs.1,hs.2.le⟩) hK.le + have hh := dist_le_of_approx_trajectories_ODE + (fun t => velocity_lipschitz hε (U t)) + (HasDerivWithinAt.continuousOn hH) (fun _ hs => derivWithin_right hH hs) + (fun t _ => le_of_eq (dist_self (velocity ε (U t) (H t)))) + (HasDerivWithinAt.continuousOn hG) (fun _ hs => derivWithin_right hG hs) + hb h0 t ht + have he : gronwallBound δ K (0+(K:ℝ)*D) (t-0) = + δ*Real.exp ((K:ℝ)*t)+D*(Real.exp ((K:ℝ)*t)-1) := by + simp only [gronwallBound,zero_add,sub_zero,ite_eq_right (ne_of_gt hK)] + field_simp + rw [he] at hh + have hexp : Real.exp ((K:ℝ)*t) ≤ Real.exp ((K:ℝ)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left ht.2 hK.le) + apply hh.trans + change δ*Real.exp ((K:ℝ)*t)+D*(Real.exp ((K:ℝ)*t)-1) ≤ (δ+D)*Real.exp ((K:ℝ)*T) + have h1 := mul_le_mul_of_nonneg_left hexp hδ + have h2 := mul_le_mul_of_nonneg_left hexp hD + nlinarith + +lemma solutionPath_joint_lipschitz {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + LipschitzWith ⟨2*Real.exp ((4/ε^2)*T),by positivity⟩ + (fun p : C(I, ℝ) × ℂ => solutionPath hε hT p.1 p.2) := by + apply LipschitzWith.of_dist_le_mul + rintro ⟨U,z⟩ ⟨V,w⟩ + apply (ContinuousMap.dist_le (show 0 ≤ (2*Real.exp ((4/ε^2)*T))*dist (U,z) (V,w) by positivity)).2 + intro t + have hh := solution_mark_dist_le hε (D := dist U V) (δ := dist z w) + dist_nonneg dist_nonneg (solution_deriv hε hT U z) (solution_deriv hε hT V w) + (by rw [solution_initial,solution_initial]) + (fun s _ => ContinuousMap.dist_apply_le_dist (f := U) (g := V) (projIcc 0 1 zero_le_one (s/T))) t.property + apply hh.trans + change (dist z w+dist U V)*Real.exp ((4/ε^2)*T) ≤ + (2*Real.exp ((4/ε^2)*T))*max (dist U V) (dist z w) + have hsum : dist z w+dist U V ≤ 2*max (dist U V) (dist z w) := by + linarith [le_max_left (dist U V) (dist z w),le_max_right (dist U V) (dist z w)] + nlinarith [mul_le_mul_of_nonneg_right hsum (Real.exp_pos ((4/ε^2)*T)).le] + +lemma continuous_mark_position {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + Continuous (fun p : (C(I,ℝ) × ℂ) × ℝ => position hε hT p.1.1 p.1.2 p.2) := by + exact continuous_eval.comp (((solutionPath_joint_lipschitz hε hT).continuous.comp continuous_fst).prodMk + ((continuous_projIcc (h := hT)).comp continuous_snd)) + +lemma continuous_mark_variation {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + Continuous (fun p : (C(I,ℝ) × ℂ) × ℝ => variation hε hT p.1.1 p.1.2 p.2) := by + have hd : Continuous (fun p : (C(I,ℝ) × ℂ) × ℝ => extendDriver T p.1.1 p.2) := + (continuous_joint_extendDriver T).comp ((continuous_fst.fst).prodMk continuous_snd) + have hw := (continuous_mark_position hε hT).sub (Complex.continuous_ofReal.comp hd) + exact Complex.continuous_re.comp (continuous_const.div + (((continuous_clampIm ε).comp hw).pow 2) (fun _ => pow_ne_zero 2 (clampIm_ne_zero hε _))) + +lemma continuous_mark_logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + Continuous (fun p : (C(I,ℝ) × ℂ) × ℝ => logDerivative hε hT p.1.1 p.1.2 p.2) := by + have hc := intervalIntegral.continuous_parametric_primitive_of_continuous + (μ := volume) (a₀ := 0) (f := fun p : C(I,ℝ) × ℂ => variation hε hT p.1 p.2) + (continuous_mark_variation hε hT) + exact hc.comp (continuous_fst.prodMk + (continuous_subtype_val.comp ((continuous_projIcc (h := hT)).comp continuous_snd))) + +lemma continuous_mark_green {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (p a : ℝ) : + Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => + LoewnerField.field hε hT p a 1 q.1.1 q.1.2 q.2 (extendDriver T q.1.1 q.2)) := by + have hH := continuous_mark_position hε hT + have hD : Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => extendDriver T q.1.1 q.2) := + (continuous_joint_extendDriver T).comp (continuous_fst.fst.prodMk continuous_snd) + apply GreenPhysical.continuous_green_comp p a + · exact (Complex.continuous_re.comp hH).sub (continuous_const.mul hD) + · exact continuous_const.max (Complex.continuous_im.comp hH) + · exact continuous_mark_logDerivative hε hT + · intro q + exact LoewnerField.height_pos hε hT q.1.1 q.1.2 q.2 + +end SLEExactGauge.LoewnerCutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerCutoff +open LoewnerField LoewnerExit +local instance commonClocksMarkRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance commonClocksMarkRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ + +lemma continuous_mark_field {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (p a sdev : ℝ) : + Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => + field hε hT p a sdev q.1.1.1 q.1.1.2 q.1.2 q.2) := by + have hH := (continuous_mark_position hε hT).comp + (continuous_fst : Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => q.1)) + apply GreenPhysical.continuous_green_comp p a + · exact (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd) + · exact continuous_const.max (Complex.continuous_im.comp hH) + · exact (continuous_mark_logDerivative hε hT).comp continuous_fst + · intro q + exact height_pos hε hT q.1.1.1 q.1.1.2 q.1.2 + +lemma continuous_mark_first {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (p a sdev : ℝ) : + Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => + iteratedDeriv 1 (field hε hT p a sdev q.1.1.1 q.1.1.2 q.1.2) q.2) := by + simp only [first_eq] + have hH := (continuous_mark_position hε hT).comp + (continuous_fst : Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => sdev*q.2)) + have hy : Continuous (fun q : ((C(I,ℝ) × ℂ) × ℝ) × ℝ => height hε hT q.1.1.1 q.1.1.2 q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + exact ((continuous_const.mul hx).div ((hx.pow 2).add (hy.pow 2)) + (fun q => (GreenPhysical.q_pos _ (height_pos hε hT q.1.1.1 q.1.1.2 q.1.2)).ne')).mul + (continuous_mark_field hε hT p a sdev) + +lemma continuous_mark_deficit {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ : ℝ) : + Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => deficit hε hT q.1.1 q.1.2 ρ δ q.2) := by + have hH := continuous_mark_position hε hT + have hD : Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => extendDriver T q.1.1 q.2) := + (continuous_joint_extendDriver T).comp (continuous_fst.fst.prodMk continuous_snd) + have hr : Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => radius hε hT q.1.1 q.1.2 q.2) := + (continuous_const.mul (Complex.continuous_im.comp hH)).div + (Real.continuous_exp.comp (continuous_mark_logDerivative hε hT)) (fun _ => Real.exp_ne_zero _) + have hs : Continuous (fun q : (C(I,ℝ) × ℂ) × ℝ => sine hε hT q.1.1 q.1.2 q.2) := + (Complex.continuous_im.comp hH).div + (((continuous_clampIm ε).comp (hH.sub (Complex.continuous_ofReal.comp hD))).norm) + (fun _ => norm_ne_zero_iff.2 (clampIm_ne_zero hε _)) + exact (hr.sub continuous_const).min + (((Complex.continuous_im.comp hH).sub continuous_const).min (hs.sub continuous_const)) + +lemma continuous_mark_exitPath {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ : ℝ) : + Continuous (fun q : C(I,ℝ) × ℂ => exitPath hε hT q.1 q.2 ρ δ) := by + apply ContinuousMap.continuous_of_continuous_uncurry _ + exact (continuous_mark_deficit hε hT ρ δ).comp + (continuous_fst.prodMk (continuous_const.mul (continuous_subtype_val.comp continuous_snd))) + +lemma measurable_mark_stop {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ : ℝ) : + Measurable (fun q : C(I,ℝ) × ℂ => stop hε hT q.1 q.2 ρ δ) := + measurable_const.mul (ContinuousExit.measurable_time.comp (continuous_mark_exitPath hε hT ρ δ).measurable) + +lemma isOpen_mark_positive_on {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ t : ℝ) : + IsOpen {q : C(I,ℝ) × ℂ | ∀ s ∈ Icc 0 t, 0 < deficit hε hT q.1 q.2 ρ δ s} := by + let S : Set ((C(I,ℝ) × ℂ) × Icc 0 t) := {q | deficit hε hT q.1.1 q.1.2 ρ δ q.2 ≤ 0} + have hc : IsClosed S := isClosed_le ((continuous_mark_deficit hε hT ρ δ).comp + (continuous_fst.prodMk (continuous_subtype_val.comp continuous_snd))) continuous_const + have hh := isClosedMap_fst_of_compactSpace S hc + have he : {q : C(I,ℝ) × ℂ | ∀ s ∈ Icc 0 t, 0 < deficit hε hT q.1 q.2 ρ δ s} = (Prod.fst '' S)ᶜ := by + ext q + simp only [mem_ofPred_eq,mem_compl_iff,mem_image,S,not_exists,not_and] + constructor + · intro hp v hv hvq + subst q + exact (not_lt_of_ge hv) (hp v.2 v.2.property) + · intro hp s hs + by_contra hn + exact hp (q,⟨s,hs⟩) (not_lt.1 hn) rfl + rw [he] + exact hh.isOpen_compl + +lemma measurable_mark_coeffAt {ε : ℝ} (hε : 0 < ε) (s : ℝ≥0) (p a sdev ρ δ : ℝ) : + Measurable (fun q : (C(I,ℝ) × ℝ) × ℂ => + LoewnerLocalized.coeffAt hε 1 s p a sdev q.2 ρ δ q.1) := by + have hp : Continuous (fun q : (C(I,ℝ) × ℝ) × ℂ => (((q.1.1,q.2),(s:ℝ)),q.1.2)) := + ((continuous_fst.fst.prodMk continuous_snd).prodMk continuous_const).prodMk continuous_fst.snd + have hc := (continuous_mark_first hε s.coe_nonneg p a sdev).comp hp + dsimp only [Function.comp_def] at hc + exact hc.measurable.ite (((isOpen_mark_positive_on hε s.coe_nonneg ρ δ s).preimage + (continuous_fst.fst.prodMk continuous_snd)).measurableSet) measurable_const + +end SLEExactGauge.LoewnerCutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.PhysicalPast + +lemma joint_avoids_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (ε : ℝ) (T : ℝ≥0) : + @MeasurableSet (Ω × ℂ) (Prod.instMeasurableSpace (α := Ω) (β := ℂ) + (m₁ := BrownianPredictable.pastSigma B T) (m₂ := inferInstance)) + {q | q.1 ∈ avoids κ B q.2 ε T} := by + let : MeasurableSpace Ω := BrownianPredictable.pastSigma B T + change MeasurableSet {q : Ω × ℂ | ∃ m : ℕ, ∀ n : ℕ, ε + CanonicalTrace.height m ≤ + dist q.2 (CanonicalTrace.value κ B (sampleTime T (TopologicalSpace.denseSeq I n)) q.1)} + simp only [ofPred_exists,ofPred_forall] + apply MeasurableSet.iUnion + intro m + apply MeasurableSet.iInter + intro n + exact measurableSet_le measurable_const (measurable_snd.dist + (((CanonicalTrace.measurable_past κ B _).mono + (BrownianPredictable.pastSigma_mono B (sampleTime_le T (TopologicalSpace.denseSeq I n))) le_rfl).comp measurable_fst)) + +end SLEExactGauge.PhysicalPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerLocalized +open BrownianPredictable +local instance commonClocksPastRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance commonClocksPastRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ + +lemma joint_rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + {ε : ℝ} (hε : 0 < ε) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) (p a sdev ρ δ : ℝ) : + @Measurable (Ω × ℂ) ℝ (Prod.instMeasurableSpace (α := Ω) (β := ℂ) + (m₁ := pastSigma B s) (m₂ := inferInstance)) _ + (fun q => rawCoeff hε 1 B T s p a sdev q.2 ρ δ q.1) := by + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · have hp : Measurable (fun q : Ω × ℂ => + ((BrownianDriver.path B sdev s q.1,B s q.1),q.2)) := + (((BrownianDriver.path_measurable_past B sdev s).comp measurable_fst).prodMk + ((past_measurable_eval B (s := s) le_rfl).comp measurable_fst)).prodMk measurable_snd + have hh := (LoewnerCutoff.measurable_mark_coeffAt hε s p a sdev ρ δ).comp hp + dsimp only [Function.comp_def] at hh + exact hh + · exact measurable_const + +end SLEExactGauge.LoewnerLocalized + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.PhysicalPast + +lemma joint_avoids_nullMeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (ν : Measure ℂ) [SFinite ν] (κ ε : ℝ) (T : ℝ≥0) : + NullMeasurableSet {q : Ω × ℂ | q.1 ∈ avoids κ B q.2 ε T} (P.prod ν) := by + change NullMeasurableSet {q : Ω × ℂ | ∃ m : ℕ, ∀ n : ℕ, ε + CanonicalTrace.height m ≤ + dist q.2 (CanonicalTrace.value κ B (sampleTime T (TopologicalSpace.denseSeq I n)) q.1)} (P.prod ν) + simp only [ofPred_exists,ofPred_forall] + apply NullMeasurableSet.iUnion + intro m + apply NullMeasurableSet.iInter + intro n + exact nullMeasurableSet_le aemeasurable_const + (measurable_snd.aemeasurable.dist ((CanonicalTrace.aemeasurable κ hB _).comp_fst)) + +end SLEExactGauge.PhysicalPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerLocalized +local instance commonClocksJointRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance commonClocksJointRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ + +lemma joint_rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (ν : Measure ℂ) [SFinite ν] {ε : ℝ} (hε : 0 < ε) + (T s : ℝ≥0) (p a sdev ρ δ : ℝ) : + AEMeasurable (fun q : Ω × ℂ => rawCoeff hε 1 B T s p a sdev q.2 ρ δ q.1) (P.prod ν) := by + unfold rawCoeff + split_ifs + · have hp : AEMeasurable (fun q : Ω × ℂ => + ((BrownianDriver.path B sdev s q.1,B s q.1),q.2)) (P.prod ν) := + (((BrownianDriver.path_aemeasurable hB sdev s).comp_fst).prodMk + ((hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable.comp_fst)).prodMk measurable_snd.aemeasurable + have hh := (LoewnerCutoff.measurable_mark_coeffAt hε s p a sdev ρ δ).comp_aemeasurable hp + dsimp only [Function.comp_def] at hh + exact hh + · exact aemeasurable_const + +end SLEExactGauge.LoewnerLocalized + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerLocalized BrownianPredictable + +def coeff {Ω : Type*} {ε : ℝ} (hε : 0 < ε) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (T s : ℝ≥0) (ρ δ e : ℝ) (q : Ω × ℂ) : ℝ := + if q.1 ∈ PhysicalPast.avoids κ B q.2 e s then + rawCoeff hε 1 B T s (1-κ/8) (8/κ-1) (Real.sqrt κ) q.2 ρ δ q.1 else 0 + +lemma coeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + {ε : ℝ} (hε : 0 < ε) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) (ρ δ e : ℝ) : + @Measurable (Ω × ℂ) ℝ (Prod.instMeasurableSpace (m₁ := pastSigma B s) (m₂ := inferInstance)) _ + (coeff hε κ B T s ρ δ e) := by + exact (joint_rawCoeff_measurable_past hε B T s _ _ _ ρ δ).ite + (PhysicalPast.joint_avoids_measurable_past κ B e s) measurable_const + +lemma coeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (ν : Measure ℂ) [SFinite ν] {ε : ℝ} (hε : 0 < ε) + (κ : ℝ) (T s : ℝ≥0) (ρ δ e : ℝ) : + AEMeasurable (coeff hε κ B T s ρ δ e) (P.prod ν) := by + exact (joint_rawCoeff_aemeasurable hB ν hε T s _ _ _ ρ δ).indicator₀ + (PhysicalPast.joint_avoids_nullMeasurable hB ν κ e s) + +lemma coeff_uniform_bound {Ω : Type*} {ε : ℝ} (hε : 0 < ε) + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) (ρ δ : ℝ) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ e s q, |coeff hε κ B T s ρ δ e q| ≤ K := by + let p := 1-κ/8 + let a := 8/κ-1 + have hp : 0 ≤ p := by dsimp [p]; linarith [hκ.2] + have ha : 0 ≤ a := by dsimp [a]; have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by linarith [hκ.2]); linarith + let K := max 0 (|Real.sqrt κ| *((2*ε/Real.exp ((2/ε^2)*T))^(-p)*a/ε)) + refine ⟨K,le_max_left _ _,?_⟩ + intro e s q + unfold coeff rawCoeff coeffAt + split_ifs with h1 h2 h3 + · have hh := first_bound hε s.coe_nonneg p a (Real.sqrt κ) hp ha + (BrownianDriver.path B (Real.sqrt κ) s q.1) q.2 s (B s q.1) + apply hh.trans + have hs : (s:ℝ) ≤ T := h2.le + have he : Real.exp ((2/ε^2)*s) ≤ Real.exp ((2/ε^2)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left hs (by positivity)) + have hb : (2*ε/Real.exp ((2/ε^2)*T)) ≤ (2*ε/Real.exp ((2/ε^2)*s)) := + div_le_div_of_nonneg_left (by positivity) (Real.exp_pos _) he + have hr := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < 2*ε/Real.exp ((2/ε^2)*T)) hb (neg_nonpos.2 hp) + apply le_trans _ (le_max_right _ _) + gcongr + all_goals simpa only [abs_zero] using (le_max_left 0 (|Real.sqrt κ| *((2*ε/Real.exp ((2/ε^2)*T))^(-p)*a/ε))) + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.CompactHit +local instance commonClocksHitComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance commonClocksHitComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def hits (e : ℝ) (p : C(I,ℂ) × ℂ) : Prop := ∃ q : I, dist p.2 (p.1 q) ≤ e + +def time (e : ℝ) (p : C(I,ℂ) × ℂ) : I := sInf {q : I | dist p.2 (p.1 q) ≤ e} + +lemma hits_closed (e : ℝ) : IsClosed {p : C(I,ℂ) × ℂ | hits e p} := by + have hc : IsClosed {q : (C(I,ℂ) × ℂ) × I | dist q.1.2 (q.1.1 q.2) ≤ e} := + isClosed_le (continuous_fst.snd.dist (continuous_eval.comp (continuous_fst.fst.prodMk continuous_snd))) continuous_const + have he : {p : C(I,ℂ) × ℂ | hits e p} = Prod.fst '' + {q : (C(I,ℂ) × ℂ) × I | dist q.1.2 (q.1.1 q.2) ≤ e} := by + ext p + simp [hits] + rw [he] + exact isClosedMap_fst_of_compactSpace _ hc + +lemma time_mem {e : ℝ} {p : C(I,ℂ) × ℂ} (hp : hits e p) : + dist p.2 (p.1 (time e p)) ≤ e := by + exact (isClosed_le (continuous_const.dist p.1.continuous) continuous_const).isCompact.sInf_mem hp + +lemma time_le {e : ℝ} {p : C(I,ℂ) × ℂ} {q : I} (hq : dist p.2 (p.1 q) ≤ e) : + time e p ≤ q := sInf_le hq + +lemma before {e : ℝ} {p : C(I,ℂ) × ℂ} {q : I} (hq : q < time e p) : + e < dist p.2 (p.1 q) := by + by_contra hm + exact not_le_of_gt hq (time_le (not_lt.1 hm)) + +lemma time_eq_one_of_not_hits {e : ℝ} {p : C(I,ℂ) × ℂ} (hp : ¬ hits e p) : time e p = 1 := by + have he : {q : I | dist p.2 (p.1 q) ≤ e} = ∅ := by + ext q + simp only [mem_ofPred_eq,mem_empty_iff_false,iff_false] + exact fun hq => hp ⟨q,hq⟩ + simp only [time,he,sInf_empty] + rfl + +lemma time_le_iff {e : ℝ} {p : C(I,ℂ) × ℂ} {q : I} (hq : q < 1) : + time e p ≤ q ↔ ∃ r : I, r ≤ q ∧ dist p.2 (p.1 r) ≤ e := by + constructor + · intro ht + have hp : hits e p := by + by_contra hn + rw [time_eq_one_of_not_hits hn] at ht + exact not_le_of_gt hq ht + exact ⟨time e p,ht,time_mem hp⟩ + · rintro ⟨r,hr,hmem⟩ + exact (time_le hmem).trans hr + +lemma measurable_time (e : ℝ) : Measurable (time e) := by + apply measurable_of_Iic + intro q + by_cases hq : q = 1 + · have he : time e ⁻¹' Iic q = univ := by + subst q + ext p + simp only [mem_preimage,mem_Iic,mem_univ,iff_true] + exact (time e p).property.2 + rw [he] + exact MeasurableSet.univ + · have hq1 : q < 1 := lt_of_le_of_ne q.property.2 hq + have hc : IsClosed {r : (C(I,ℂ) × ℂ) × I | r.2 ≤ q ∧ dist r.1.2 (r.1.1 r.2) ≤ e} := + (isClosed_le continuous_snd continuous_const).inter + (isClosed_le (continuous_fst.snd.dist (continuous_eval.comp (continuous_fst.fst.prodMk continuous_snd))) continuous_const) + have he : time e ⁻¹' Iic q = Prod.fst '' + {r : (C(I,ℂ) × ℂ) × I | r.2 ≤ q ∧ dist r.1.2 (r.1.1 r.2) ≤ e} := by + ext p + change (time e p ≤ q) ↔ ∃ r, r ∈ {r : (C(I,ℂ) × ℂ) × I | r.2 ≤ q ∧ dist r.1.2 (r.1.1 r.2) ≤ e} ∧ r.1 = p + rw [time_le_iff hq1] + constructor + · rintro ⟨r,hr,hd⟩ + exact ⟨(p,r),⟨hr,hd⟩,rfl⟩ + · rintro ⟨⟨p',r⟩,⟨hr,hd⟩,he⟩ + change p' = p at he + subst p' + exact ⟨r,hr,hd⟩ + rw [he] + exact (isClosedMap_fst_of_compactSpace _ hc).measurableSet + +end SLEExactGauge.CompactHit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.CompactHit + +def realTime (T e : ℝ) (V : C(I,ℂ)) (z : ℂ) : ℝ := T*time e (V,z) + +lemma realTime_bounds {T : ℝ} (hT : 0 ≤ T) (e : ℝ) (V : C(I,ℂ)) (z : ℂ) : + realTime T e V z ∈ Icc 0 T := + ⟨mul_nonneg hT (time e (V,z)).property.1,by + simpa only [realTime,mul_one] using mul_le_mul_of_nonneg_left (time e (V,z)).property.2 hT⟩ + +lemma realTime_le {T e : ℝ} (hT : 0 < T) (V : C(I,ℂ)) (γ : ℝ → ℂ) (z : ℂ) + (hV : ∀ q : I, V q = γ (T*q)) {t : ℝ} (ht : t ∈ Icc 0 T) + (hd : dist z (γ t) ≤ e) : realTime T e V z ≤ t := by + let q : I := ⟨t/T,⟨div_nonneg ht.1 hT.le,(div_le_one hT).2 ht.2⟩⟩ + have he : T*(q:ℝ) = t := mul_div_cancel₀ _ hT.ne' + have hq : dist z (V q) ≤ e := by rw [hV,he]; exact hd + have hm : (time e (V,z):ℝ) ≤ (q:ℝ) := time_le hq + have hx := mul_le_mul_of_nonneg_left hm hT.le + rwa [he] at hx + +lemma realTime_hits {T e : ℝ} (hT : 0 < T) (V : C(I,ℂ)) (γ : ℝ → ℂ) (z : ℂ) + (hV : ∀ q : I, V q = γ (T*q)) {t : ℝ} (ht : t ∈ Icc 0 T) + (hd : dist z (γ t) ≤ e) : hits e (V,z) := by + let q : I := ⟨t/T,⟨div_nonneg ht.1 hT.le,(div_le_one hT).2 ht.2⟩⟩ + refine ⟨q,?_⟩ + change dist z (V q) ≤ e + rw [hV,mul_div_cancel₀ _ hT.ne'] + exact hd + +lemma realTime_stop {T e : ℝ} (hT : 0 < T) (V : C(I,ℂ)) (γ : ℝ → ℂ) (z : ℂ) + (hV : ∀ q : I, V q = γ (T*q)) (hh : hits e (V,z)) + (hl : z ∈ localizationDomain γ (realTime T e V z)) : + firstLiveDistanceStop γ z e = ENNReal.ofReal (realTime T e V z) := by + have hb := realTime_bounds hT.le e V z + have hd : dist z (γ (realTime T e V z)) ≤ e := by + simpa only [hV,realTime] using time_mem hh + let t₀ : ℝ≥0 := ⟨realTime T e V z,hb.1⟩ + have hle : firstLiveDistanceStop γ z e ≤ (t₀ : ℝ≥0∞) := PhysicalStop.le_of_hit hl hd + have hc : (t₀ : ℝ≥0∞) = ENNReal.ofReal (realTime T e V z) := + ENNReal.ofReal_coe_nnreal.symm + rw [hc] at hle + apply le_antisymm hle + apply le_sInf + rintro r ⟨s,⟨hsl,hsd⟩,rfl⟩ + have ht : realTime T e V z ≤ s := by + by_cases hsT : (s:ℝ) ≤ T + · exact realTime_le hT V γ z hV ⟨s.coe_nonneg,hsT⟩ hsd + · exact hb.2.trans (not_le.1 hsT).le + exact (ENNReal.ofReal_le_ofReal ht).trans_eq (ENNReal.ofReal_coe_nnreal (p := s)) + +lemma live_byTime_iff {T e : ℝ} (hT : 0 < T) (V : C(I,ℂ)) (γ : ℝ → ℂ) (z : ℂ) + (hc : ContinuousOn γ (Ici 0)) (hV : ∀ q : I, V q = γ (T*q)) : + firstLiveDistanceStop γ z e ≤ ENNReal.ofReal T ↔ + hits e (V,z) ∧ z ∈ localizationDomain γ (realTime T e V z) := by + constructor + · intro hh + obtain ⟨t,he,hl,hd,hmin⟩ := PhysicalStop.finite_spec hc + (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hh) + have ht : (t:ℝ) ≤ T := by + rw [he,← ENNReal.ofReal_coe_nnreal (p := t)] at hh + exact (ENNReal.ofReal_le_ofReal_iff hT.le).1 hh + exact ⟨realTime_hits hT V γ z hV ⟨t.coe_nonneg,ht⟩ hd, + survivingDomain_mono (realTime_le hT V γ z hV ⟨t.coe_nonneg,ht⟩ hd) hl⟩ + · rintro ⟨hh,hl⟩ + rw [realTime_stop hT V γ z hV hh hl] + exact ENNReal.ofReal_le_ofReal (realTime_bounds hT.le e V z).2 + +lemma cap_eq_realTime {T e τ : ℝ} (hT : 0 < T) (hτ : τ ∈ Icc 0 T) + (V : C(I,ℂ)) (γ : ℝ → ℂ) (z : ℂ) (hγ : ContinuousOn γ (Ici 0)) + (hV : ∀ q : I, V q = γ (T*q)) (hl : z ∈ localizationDomain γ τ) : + PhysicalStop.cap (firstLiveDistanceStop γ z e) τ = min (realTime T e V z) τ := by + let r := realTime T e V z + have hr := realTime_bounds hT.le e V z + have hsmall (hrt : r < τ) : firstLiveDistanceStop γ z e = ENNReal.ofReal r := by + have hh : hits e (V,z) := by + by_contra hn + have he : r = T := by simp only [r,realTime,time_eq_one_of_not_hits hn]; simp + linarith [hτ.2] + exact realTime_stop hT V γ z hV hh (survivingDomain_mono hrt.le hl) + by_cases hfin : firstLiveDistanceStop γ z e = ⊤ + · rw [PhysicalStop.cap,ite_eq_left hfin] + apply (min_eq_right _).symm + by_contra hn + have he := hsmall (lt_of_not_ge hn) + rw [hfin] at he + exact ENNReal.ofReal_ne_top he.symm + · obtain ⟨s,hs,hsl,hsd,hmin⟩ := PhysicalStop.finite_spec hγ hfin + rw [PhysicalStop.cap,ite_eq_right hfin,hs,ENNReal.coe_toReal] + apply le_antisymm + · apply le_min _ (min_le_right _ _) + by_cases hrt : r < τ + · have he := hsmall hrt + rw [hs,← ENNReal.ofReal_coe_nnreal (p := s)] at he + have hsre : (s:ℝ) = r := (ENNReal.ofReal_eq_ofReal_iff s.coe_nonneg (show 0 ≤ r from hr.1)).1 he + rw [hsre] + exact min_le_left _ _ + · exact (min_le_right _ _).trans (not_lt.1 hrt) + · apply le_min _ (min_le_right _ _) + by_cases hsT : (s:ℝ) ≤ T + · exact (min_le_left _ _).trans (realTime_le hT V γ z hV ⟨s.coe_nonneg,hsT⟩ hsd) + · exact (min_le_right _ _).trans (hτ.2.trans (not_le.1 hsT).le) + +lemma realTime_antitone (T : ℝ) (hT : 0 ≤ T) (V : C(I,ℂ)) (z : ℂ) {e e' : ℝ} (he : e ≤ e') : + realTime T e' V z ≤ realTime T e V z := by + apply mul_le_mul_of_nonneg_left _ hT + by_cases hh : hits e (V,z) + · exact time_le ((time_mem hh).trans he) + · rw [time_eq_one_of_not_hits hh] + exact (time e' (V,z)).property.2 + +end SLEExactGauge.CompactHit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized +local instance commonClocksObservedRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance commonClocksObservedRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance commonClocksObservedComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance commonClocksObservedComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def observedTime {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ e : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) : ℝ := + min (CompactHit.realTime T e q.1.2 q.2) (stop hε hT q.1.1 q.2 ρ δ) + +lemma measurable_observedTime {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ e : ℝ) : + Measurable (observedTime hε hT ρ δ e) := by + have hv : Measurable (fun q : (C(I,ℝ) × C(I,ℂ)) × ℂ => (q.1.2,q.2)) := + measurable_fst.snd.prodMk measurable_snd + have hv' := (measurable_subtype_coe.comp ((CompactHit.measurable_time e).comp hv)).const_mul T + have hu : Measurable (fun q : (C(I,ℝ) × C(I,ℂ)) × ℂ => (q.1.1,q.2)) := + measurable_fst.fst.prodMk measurable_snd + have hs := (measurable_mark_stop hε hT ρ δ).comp hu + have hh := hv'.min hs + exact hh + +def observedValue {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ e p a : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) : ℝ := + let t := observedTime hε hT ρ δ e q + field hε hT p a 1 q.1.1 q.2 t (extendDriver T q.1.1 t) + +lemma measurable_observedValue {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ e p a : ℝ) : + Measurable (observedValue hε hT ρ δ e p a) := by + have ht := measurable_observedTime hε hT ρ δ e + have hx : Measurable (fun q : (C(I,ℝ) × C(I,ℂ)) × ℂ => + (((q.1.1,q.2),observedTime hε hT ρ δ e q),extendDriver T q.1.1 (observedTime hε hT ρ δ e q))) := + ((measurable_fst.fst.prodMk measurable_snd).prodMk ht).prodMk + ((continuous_joint_extendDriver T).measurable.comp (measurable_fst.fst.prodMk ht)) + have hh := (continuous_mark_field hε hT p a 1).measurable.comp hx + exact hh + +lemma coeff_common {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (z : ℂ) (hz : z ∈ A) {ρ : ℝ} (hr : (2*z.im)*Real.exp (-u z) = ρ) (e : ℝ) (s : ℝ≥0) (ω : Ω) : + (C.at z hz).physicalCoeff 1 κ B e s ω = + coeff C.height_pos κ B C.horizon s ρ C.angle e (ω,z) := by + simp only [FiniteTilt.Cutoff.physicalCoeff,FiniteTilt.CommonCutoff.at,coeff,hr] + +lemma observedValue_eq {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (z : ℂ) (hz : z ∈ A) (hhalf : z ∈ halfPlane) (hu : 0 < u z) + {ρ : ℝ} (hr : (2*z.im)*Real.exp (-u z) = ρ) + (V : C(I,ℂ)) (hV : ∀ q : I, V q = γ ω ((C.horizon:ℝ)*q)) (e : ℝ) : + observedValue C.height_pos C.horizon.coe_nonneg ρ C.angle e (1-κ/8) (8/κ-1) + ((BrownianDriver.path B (Real.sqrt κ) C.horizon ω,V),z) = + (C.at z hz).physicalValue κ B γ e ω := by + let Cz := C.at z hz + have hs := Cz.source_live κ B ω hm hhalf hu hc hb0 + have hb := Cz.bounds κ B ω + have ht := CompactHit.cap_eq_realTime (e := e) C.horizon_pos hb V (γ ω) z hm.1 hV hs + have he : observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle e + ((BrownianDriver.path B (Real.sqrt κ) C.horizon ω,V),z) = Cz.physicalTime κ B γ e ω := by + rw [FiniteTilt.Cutoff.physicalTime,ht] + simp only [observedTime,FiniteTilt.Cutoff.stopTime,FiniteTilt.Cutoff.paths,Cz,FiniteTilt.CommonCutoff.at,hr] + have hb' := Cz.physicalTime_bounds κ B γ e ω + have hU := Cz.path_eq κ B ω hc ⟨hb'.1,hb'.2.trans hb.2⟩ + dsimp only [observedValue] + rw [he] + change field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) 1 _ z _ _ = + field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) _ z _ _ + dsimp only [field] + rw [one_mul] + change extendDriver (C.horizon:ℝ) (BrownianDriver.path B (Real.sqrt κ) C.horizon ω) + (Cz.physicalTime κ B γ e ω) = _ at hU + rw [hU] + rfl + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Mesh +open TaylorMeshes + +def slab (D : ℝ → ℝ) (a b t : ℝ) : ℝ := + (if t < b then D t else 0) - (if t < a then D t else 0) + +lemma prestop_product (D E : ℝ → ℝ) (a b t : ℝ) : + (if t < a then D t else 0)*(if t < b then E t else 0) = + (if t < min a b then D t*E t else 0) := by + simp only [lt_min_iff] + split_ifs <;> simp_all + +lemma slab_product (D E : ℝ → ℝ) (a b c d t : ℝ) : + slab D a b t * slab E c d t = + (if t < min b d then D t*E t else 0) - + (if t < min b c then D t*E t else 0) - + (if t < min a d then D t*E t else 0) + + (if t < min a c then D t*E t else 0) := by + unfold slab + rw [sub_mul,mul_sub,mul_sub] + simp only [prestop_product] + ring + +lemma slab_riemann_tendsto {T a b c d : ℝ} (hT : 0 ≤ T) + (ha : a ∈ Icc 0 T) (hb : b ∈ Icc 0 T) + (hc : c ∈ Icc 0 T) (hd : d ∈ Icc 0 T) + {D E : ℝ → ℝ} (hD : ContinuousOn D (Icc 0 T)) + (hE : ContinuousOn E (Icc 0 T)) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (slab D a b (mesh T n i)*slab E c d (mesh T n i))*(T/(2:ℝ)^n)) + atTop (𝓝 ((∫ t in 0..min b d, D t*E t) - (∫ t in 0..min b c, D t*E t) - + (∫ t in 0..min a d, D t*E t) + (∫ t in 0..min a c, D t*E t))) := by + have hDE : ContinuousOn (fun t => D t*E t) (Icc 0 T) := hD.mul hE + have hlim (s t : ℝ) (hs : s ∈ Icc 0 T) (ht : t ∈ Icc 0 T) := + StoppedMeshes.prestop_riemann_tendsto hT (le_min hs.1 ht.1) + ((min_le_left s t).trans hs.2) (hDE.mono (Icc_subset_Icc_right ((min_le_left s t).trans hs.2))) + have hh := ((hlim b d hb hd).sub (hlim b c hb hc)).sub (hlim a d ha hd) |>.add (hlim a c ha hc) + convert hh using 1 + funext n + simp [slab_product,sub_mul,add_mul,Finset.sum_sub_distrib,Finset.sum_add_distrib,ite_mul] + +lemma integral_prestop {T a : ℝ} (ha : a ∈ Icc 0 T) (D : ℝ → ℝ) : + (∫ t in (0:ℝ)..T, if t < a then D t else 0) = ∫ t in (0:ℝ)..a, D t := by + calc + _ = ∫ t in (0:ℝ)..T, Set.indicator {t : ℝ | t ≤ a} D t := by + apply intervalIntegral.integral_congr_ae + filter_upwards [show ∀ᵐ t : ℝ ∂volume, t ≠ a from by rw [ae_iff]; simp] with t ht htI + simp only [Set.indicator_apply,mem_ofPred_eq] + congr 1 + exact propext (lt_iff_le_and_ne.trans (and_iff_left ht)) + _ = _ := intervalIntegral.integral_indicator ha + +lemma prestop_intervalIntegrable {T a : ℝ} (hT : 0 ≤ T) + {D : ℝ → ℝ} (hD : ContinuousOn D (Icc 0 T)) : + IntervalIntegrable (fun t => if t < a then D t else 0) volume 0 T := by + have hh : IntegrableOn D (Ioc 0 T) volume := + (hD.integrableOn_Icc).mono_set Ioc_subset_Icc_self + rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hT] + exact hh.indicator measurableSet_Iio + +lemma slab_product_integral {T a b c d : ℝ} (hT : 0 ≤ T) + (ha : a ∈ Icc 0 T) (hb : b ∈ Icc 0 T) + (hc : c ∈ Icc 0 T) (hd : d ∈ Icc 0 T) + {D E : ℝ → ℝ} (hD : ContinuousOn D (Icc 0 T)) + (hE : ContinuousOn E (Icc 0 T)) : + (∫ t in (0:ℝ)..T, slab D a b t*slab E c d t) = + (∫ t in 0..min b d, D t*E t) - (∫ t in 0..min b c, D t*E t) - + (∫ t in 0..min a d, D t*E t) + (∫ t in 0..min a c, D t*E t) := by + simp_rw [slab_product] + have hDE : ContinuousOn (fun t => D t*E t) (Icc 0 T) := hD.mul hE + have hi (s : ℝ) := prestop_intervalIntegrable (a := s) hT hDE + rw [intervalIntegral.integral_add ((hi _ |>.sub (hi _)).sub (hi _)) (hi _), + intervalIntegral.integral_sub (hi _ |>.sub (hi _)) (hi _), + intervalIntegral.integral_sub (hi _) (hi _)] + rw [integral_prestop ⟨le_min hb.1 hd.1,(min_le_left _ _).trans hb.2⟩, + integral_prestop ⟨le_min hb.1 hc.1,(min_le_left _ _).trans hb.2⟩, + integral_prestop ⟨le_min ha.1 hd.1,(min_le_left _ _).trans ha.2⟩, + integral_prestop ⟨le_min ha.1 hc.1,(min_le_left _ _).trans ha.2⟩] + +lemma slab_riemann_tendsto_integral {T a b c d : ℝ} (hT : 0 ≤ T) + (ha : a ∈ Icc 0 T) (hb : b ∈ Icc 0 T) + (hc : c ∈ Icc 0 T) (hd : d ∈ Icc 0 T) + {D E : ℝ → ℝ} (hD : ContinuousOn D (Icc 0 T)) + (hE : ContinuousOn E (Icc 0 T)) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (slab D a b (mesh T n i)*slab E c d (mesh T n i))*(T/(2:ℝ)^n)) + atTop (𝓝 (∫ t in (0:ℝ)..T, slab D a b t*slab E c d t)) := by + rw [slab_product_integral hT ha hb hc hd hD hE] + exact slab_riemann_tendsto hT ha hb hc hd hD hE + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal +namespace SLEExactGauge.Mesh + +lemma slab_eq_zero_of_not_mem {D : ℝ → ℝ} {a b t : ℝ} (hab : a ≤ b) (ht : t ∉ Icc a b) : + slab D a b t = 0 := by + unfold slab + by_cases hta : t < a + · simp [hta,hta.trans_le hab] + · have htb : ¬t < b := by intro h; exact ht ⟨not_lt.1 hta,h.le⟩ + simp [hta,htb] + +lemma slab_abs_le {D : ℝ → ℝ} {a b t M : ℝ} (hab : a ≤ b) (hM : 0 ≤ M) (h : |D t| ≤ M) : + |slab D a b t| ≤ M := by + unfold slab + by_cases hta : t < a + · simpa [hta,hta.trans_le hab] using hM + · by_cases htb : t < b + · simpa [hta,htb] using h + · simpa [hta,htb] using hM + +lemma measurable_slab {Z : Type*} [MeasurableSpace Z] {D : Z → ℝ → ℝ} {a b : Z → ℝ} + (hD : Measurable (fun q : ℝ × Z => D q.2 q.1)) (ha : Measurable a) (hb : Measurable b) : + Measurable (fun q : ℝ × Z => slab (D q.2) (a q.2) (b q.2) q.1) := by + exact (hD.ite (measurableSet_lt measurable_fst (hb.comp measurable_snd)) measurable_const).sub + (hD.ite (measurableSet_lt measurable_fst (ha.comp measurable_snd)) measurable_const) + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit +local instance commonClocksBoundsRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance commonClocksBoundsRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance commonClocksBoundsComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance commonClocksBoundsComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +lemma observedTime_bounds {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ e : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) : observedTime hε hT ρ δ e q ∈ Icc 0 T := by + have hr := CompactHit.realTime_bounds hT e q.1.2 q.2 + have hs := stop_bounds hε hT q.1.1 q.2 ρ δ + exact ⟨le_min hr.1 hs.1,(min_le_left _ _).trans hr.2⟩ + +lemma observedTime_antitone {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (ρ δ : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) {e r : ℝ} (her : e ≤ r) : + observedTime hε hT ρ δ r q ≤ observedTime hε hT ρ δ e q := + min_le_min_right _ (CompactHit.realTime_antitone T hT q.1.2 q.2 her) + +lemma observedTime_eq {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (z : ℂ) (hz : z ∈ A) (hhalf : z ∈ halfPlane) (hu : 0 < u z) + {ρ : ℝ} (hr : (2*z.im)*Real.exp (-u z) = ρ) + (V : C(I,ℂ)) (hV : ∀ q : I, V q = γ ω ((C.horizon:ℝ)*q)) (e : ℝ) : + observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle e + ((BrownianDriver.path B (Real.sqrt κ) C.horizon ω,V),z) = + (C.at z hz).physicalTime κ B γ e ω := by + let Cz := C.at z hz + have hs := Cz.source_live κ B ω hm hhalf hu hc hb0 + have hb := Cz.bounds κ B ω + have ht := CompactHit.cap_eq_realTime (e := e) C.horizon_pos hb V (γ ω) z hm.1 hV hs + rw [FiniteTilt.Cutoff.physicalTime,ht] + simp only [observedTime,FiniteTilt.Cutoff.stopTime,FiniteTilt.Cutoff.paths,Cz,FiniteTilt.CommonCutoff.at,hr] + +lemma observedTime_approach {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) (ρ δ e r : ℝ) + (U : C(I,ℝ)) (V : C(I,ℂ)) (γ : ℝ → ℂ) (hV : ∀ q : I, V q = γ (T*q)) (z : ℂ) + (hstrict : observedTime hε hT.le ρ δ r ((U,V),z) < observedTime hε hT.le ρ δ e ((U,V),z)) : + dist z (γ (observedTime hε hT.le ρ δ r ((U,V),z))) ≤ r := by + have hr : CompactHit.realTime T r V z < stop hε hT.le U z ρ δ := by + have hh : min (CompactHit.realTime T r V z) (stop hε hT.le U z ρ δ) < + stop hε hT.le U z ρ δ := hstrict.trans_le (min_le_right _ _) + exact (min_lt_iff.1 hh).resolve_right (lt_irrefl _) + have ht := (stop_bounds hε hT.le U z ρ δ).2 + have hh : CompactHit.hits r (V,z) := by + by_contra hn + have he : CompactHit.realTime T r V z = T := by + simp only [CompactHit.realTime,CompactHit.time_eq_one_of_not_hits hn]; simp + rw [he] at hr + exact (not_lt_of_ge ht) hr + rw [observedTime,min_eq_left hr.le] + simpa only [hV,CompactHit.realTime] using CompactHit.time_mem hh + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge.Mesh + +lemma coefficient_le_poisson {z : ℂ} (hy : 0 < z.im) + {a p s R R₀ : ℝ} (ha : 1 ≤ a) (hp : 0 ≤ p) (hs : 0 ≤ s) + (hR₀ : 0 < R₀) (hR : R₀ ≤ R) : + |s*a*z.re/‖z‖^2 * (R^(-p)*(z.im/‖z‖)^a)| ≤ + (s*a*R₀^(-p)) * (z.im/‖z‖^2) := by + have hz : 0 < ‖z‖ := norm_pos_iff.2 (by intro h; simp [h] at hy) + have hsin : 0 ≤ z.im/‖z‖ := by positivity + have hsinle : z.im/‖z‖ ≤ 1 := (div_le_one hz).2 (Complex.im_le_norm z) + have hpower := Real.rpow_le_self_of_le_one hsin hsinle ha + have hr := Real.rpow_le_rpow_of_nonpos hR₀ hR (neg_nonpos.2 hp) + have ha0 : 0 ≤ a := le_trans zero_le_one ha + have hpwr : 0 ≤ R^(-p) := Real.rpow_nonneg (hR₀.le.trans hR) _ + simp only [abs_mul,abs_div,abs_of_nonneg hs,abs_of_nonneg ha0,abs_pow,abs_norm, + abs_of_nonneg hpwr,abs_of_nonneg (Real.rpow_nonneg hsin a)] + calc + s*a*|z.re|/‖z‖^2*(R^(-p)*(z.im/‖z‖)^a) + ≤ s*a*‖z‖/‖z‖^2*(R₀^(-p)*(z.im/‖z‖)) := by + gcongr + exact Complex.abs_re_le_norm z + _ = (s*a*R₀^(-p))*(z.im/‖z‖^2) := by field_simp + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology +namespace SLEExactGauge.Layer + +lemma hessian_scalar_comp {u : ℂ → ℝ} {φ : ℝ → ℝ} {z v : ℂ} + (hu : ContDiffAt ℝ 2 u z) (hφ : ContDiffAt ℝ 2 φ (u z)) : + fderiv ℝ (fderiv ℝ (φ ∘ u)) z v v = + deriv (deriv φ) (u z)*(fderiv ℝ u z v)^2 + + deriv φ (u z)*fderiv ℝ (fderiv ℝ u) z v v := by + have hdu : ContDiffAt ℝ 1 (fderiv ℝ u) z := hu.fderiv_right (by norm_num) + have hdφ : ContDiffAt ℝ 1 (deriv φ) (u z) := hφ.derivWithin (by norm_num) + have h₁ := ((hdφ.differentiableAt (by norm_num)).hasDerivAt.comp_hasFDerivAt z + (hu.differentiableAt (by norm_num)).hasFDerivAt) + have h₂ := (hdu.differentiableAt (by norm_num)).hasFDerivAt + have hh := h₁.smul h₂ + have he : fderiv ℝ (φ ∘ u) =ᶠ[𝓝 z] fun y => deriv φ (u y) • fderiv ℝ u y := by + have heu : ∀ᶠ y in 𝓝 z, ContDiffAt ℝ 2 u y := hu.eventually (by norm_num) + have heφ : ∀ᶠ y in 𝓝 z, ContDiffAt ℝ 2 φ (u y) := + hu.continuousAt.tendsto.eventually (hφ.eventually (by norm_num)) + filter_upwards [heu,heφ] with y hy hyφ + exact ((hyφ.differentiableAt (by norm_num)).hasDerivAt.comp_hasFDerivAt y + (hy.differentiableAt (by norm_num)).hasFDerivAt).fderiv + have hh' := (hh.congr_of_eventuallyEq he).fderiv + rw [hh'] + simp only [add_apply,ContinuousLinearMap.smulRight_apply, + smul_apply,smul_eq_mul,Function.comp_apply] + ring + +lemma laplacian_scalar_comp {u : ℂ → ℝ} {φ : ℝ → ℝ} {z : ℂ} + (hu : ContDiffAt ℝ 2 u z) (hφ : ContDiffAt ℝ 2 φ (u z)) : + Laplacian.laplacian (φ ∘ u) z = + deriv (deriv φ) (u z)*((fderiv ℝ u z 1)^2+(fderiv ℝ u z Complex.I)^2) + + deriv φ (u z)*Laplacian.laplacian u z := by + rw [laplacian_eq_hessian,hessian_scalar_comp hu hφ,hessian_scalar_comp hu hφ, + laplacian_eq_hessian] + ring + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology RealInnerProductSpace +namespace SLEExactGauge.Layer + +def diskFactor (z : ℂ) : ℝ := 1-‖z‖^2 + +lemma diskFactor_pos {z : ℂ} (hz : ‖z‖ < 1) : 0 < diskFactor z := by + dsimp [diskFactor] + nlinarith [norm_nonneg z] + +lemma diskFactor_smooth : ContDiff ℝ 2 diskFactor := + contDiff_const.sub (contDiff_norm_sq ℝ) + +lemma diskFactor_fderiv (z : ℂ) : fderiv ℝ diskFactor z = -((2:ℝ) • innerSL ℝ z) := by + simpa only [two_smul, diskFactor] using! + ((hasStrictFDerivAt_norm_sq z).hasFDerivAt.const_sub (1:ℝ)).fderiv + +lemma diskFactor_hessian (z : ℂ) : + fderiv ℝ (fderiv ℝ diskFactor) z = -((2:ℝ) • innerSL ℝ (E := ℂ)) := by + have he : fderiv ℝ diskFactor = fun z => -((2:ℝ) • innerSL ℝ z) := funext diskFactor_fderiv + rw [he] + convert! ((innerSL ℝ (E := ℂ)).hasFDerivAt (x := z) |>.const_smul (2:ℝ)).neg.fderiv using 1 + +lemma diskFactor_gradient (z : ℂ) : + fderiv ℝ diskFactor z 1 = -2*z.re ∧ + fderiv ℝ diskFactor z Complex.I = -2*z.im := by + rw [diskFactor_fderiv] + simp [Complex.inner,innerSL_apply_apply] + +lemma diskFactor_laplacian (z : ℂ) : Laplacian.laplacian diskFactor z = -4 := by + rw [laplacian_eq_hessian,diskFactor_hessian] + simp only [neg_apply,smul_apply,smul_eq_mul] + norm_num [innerSL,innerₛₗ,Complex.inner] + +lemma logFactor_smooth {z : ℂ} (hz : ‖z‖ < 1) : + ContDiffAt ℝ 2 (fun z => Real.log (diskFactor z)) z := + diskFactor_smooth.contDiffAt.log (ne_of_gt (diskFactor_pos hz)) + +end SLEExactGauge.Layer + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/ConditionalAngles.lean b/lean/OAI/Probability/SLELocalization/ConditionalAngles.lean new file mode 100644 index 0000000000000000000000000000000000000000..652a2587e14a3916593292211a13df78c06718c4 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/ConditionalAngles.lean @@ -0,0 +1,657 @@ +import Mathlib +import OAI.Probability.SLELocalization.ConditionalTilts +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Finite Tilt estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized BrownianPredictable + BrownianStopped BrownianIto TaylorMeshes PredictableLimit + +lemma target_setIntegral_le {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (η κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) + {z : ℂ} (hz : z ∈ halfPlane) {u v : ℝ} (hu : 0 ≤ u) (huv1 : u+1 ≤ v) + (C : Cutoff z v) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hsle : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (E : Set Ω) (hE : NullMeasurableSet E P) + (hstop : ∀ t : ℝ≥0, ∃ S : Set Ω, MeasurableSet[pastSigma B t] S ∧ + S =ᵐ[P] (E ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≤ (t : ℝ≥0∞)} : Set Ω)) : + (∫ sample in E, C.barrier η κ B sample ∂P) ≤ + ∫ sample in E, C.targetValue hz (by linarith : u ≤ v) η κ B sample ∂P := by + have huv : u ≤ v := by linarith + have hv : 0 < v := by linarith + let D := C.retarget hz huv + let Q := C.targetCoeff 1 η κ B + have hQe (w : ℝ) (hwv : w ≤ v) (n i : ℕ) := C.targetCoeff_eq hB 1 η κ hz w hwv n i + obtain ⟨K,hK,hQb⟩ := C.targetCoeff_bound hB 1 η κ hκ hη hz hv γ g f hsle + have hQm (w : ℝ) (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (Q w n i) := + C.targetCoeff_measurable B 1 (Or.inl rfl) η κ hκ hη w n i + have hQ2 (w : ℝ) (hwv : w ≤ v) (n i : ℕ) : MemLp (Q w n i) 2 P := by + apply MemLp.of_bound (C.targetCoeff_aemeasurable hB 1 (Or.inl rfl) η κ hκ hη w n i).aestronglyMeasurable K + simpa only [Real.norm_eq_abs] using hQb w hwv n i + have hsupport (n i : ℕ) : ∀ᵐ sample ∂P, + (dyadicTime C.horizon n i : ℝ≥0∞) < firstLiveRadiusStop (γ sample) (g sample) z u → + Q v n i sample = Q u n i sample := by + filter_upwards [hQe v le_rfl n i,hQe u huv n i,hsle,hB.cont, + hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hev heu hs hc hb0 + intro ht + rcases eq_or_lt_of_le hu with rfl | hu' + · rw [firstLiveRadiusStop_zero hs hz] at ht + exact False.elim (not_lt_of_ge bot_le ht) + dsimp only [Q] + rw [hev,heu] + change (if mesh C.horizon n i < C.stopTime κ B sample then _ else 0) = + (if mesh C.horizon n i < D.stopTime κ B sample then _ else 0) + have hle := C.retarget_stop_le hz huv κ B sample + by_cases hD : mesh C.horizon n i < D.stopTime κ B sample + · rw [ite_eq_left hD,ite_eq_left (hD.trans_le hle)] + · by_cases hC : mesh C.horizon n i < C.stopTime κ B sample + · have hh := C.retarget_has_hit_of_lt hz hu' huv κ B sample hs hc hb0 + ((le_of_not_gt hD).trans_lt hC) + have hbad : firstLiveRadiusStop (γ sample) (g sample) z u ≤ + (dyadicTime C.horizon n i : ℝ≥0∞) := by + rw [hh,← ENNReal.ofReal_coe_nnreal,coe_dyadicTime] + exact ENNReal.ofReal_le_ofReal (le_of_not_gt hD) + exact False.elim ((not_lt_of_ge hbad) ht) + · rw [ite_eq_right hC,ite_eq_right hD] + have hlv := C.target_sum_tendsto hB η κ hκ hη hz hv γ g f hsle v le_rfl + have hlu := C.target_sum_tendsto hB η κ hκ hη hz hv γ g f hsle u huv + have hcenter := indicator_difference_centered hB C.horizon (Q v) (Q u) + (hQm v) (hQm u) (hQ2 v le_rfl) (hQ2 u huv) K hK (hQb v le_rfl) (hQb u huv) + (fun sample => firstLiveRadiusStop (γ sample) (g sample) z u) hsupport E hE hstop + (C.targetRemainder η κ B (C.stopTime κ B)) + (C.targetRemainder η κ B (D.stopTime κ B)) hlv hlu + have hdiff : (∫ sample in E, C.targetRemainder η κ B (C.stopTime κ B) sample - + C.targetRemainder η κ B (D.stopTime κ B) sample ∂P) = 0 := by + simpa only [integral_indicator₀ hE] using hcenter.2 + have hdiffint : IntegrableOn (fun sample => C.targetRemainder η κ B (C.stopTime κ B) sample - + C.targetRemainder η κ B (D.stopTime κ B) sample) E P := + hcenter.1.integrableOn.congr (by + filter_upwards [ae_restrict_mem₀ hE] with sample hs + exact Set.indicator_of_mem hs _) + have hbi := (C.barrier_expectation hB η κ hκ hη hz hv γ g f hsle).1 + obtain ⟨L,hL,hLb⟩ := targetValue_bound κ hκ + have hint : Integrable (C.targetValue hz huv η κ B) P := by + apply ((D.expectation hB κ hκ hz hu).1.const_mul + (L*((2*z.im)*Real.exp (-v))^(codimension κ))).mono' + (C.targetValue_aemeasurable hB hz huv η κ hκ hη).aestronglyMeasurable + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb0 + rw [Real.norm_eq_abs,abs_of_nonneg (C.targetValue_nonneg hz huv η κ hκ hη B sample)] + exact hLb hz hu huv1 C B sample η hη hc hb0 + have hle : (∫ sample in E, C.barrier η κ B sample-C.targetValue hz huv η κ B sample ∂P) ≤ 0 := by + rw [← hdiff] + apply integral_mono_ae (hbi.integrableOn.sub hint.integrableOn) hdiffint + filter_upwards [ae_restrict_of_ae hB.cont] with sample hc + exact C.target_difference_le_remainder hz huv η κ hκ hη B sample hc + rw [integral_sub hbi.integrableOn hint.integrableOn] at hle + exact sub_nonpos.mp hle + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit BrownianPredictable BrownianStopped BrownianIto TaylorMeshes PredictableLimit + +theorem localized_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (ρ δ : ℝ) : + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T + (fun n i => rawCoeff hε 1 B T (dyadicTime T n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ) + n sample) atTop + (𝓝 (F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample))) := by + dsimp only + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + let V := fun sample => drift hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact regular hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha (U sample) z ρ δ _ + (hc.comp continuous_real_toNNReal) + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => stop_bounds hε T.coe_nonneg (U sample) z ρ δ) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg 2 (Or.inr rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) W z t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => rawCoeff hε 1 B T (dyadicTime T n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ + let C := fun n i => rawCoeff hε 2 B T (dyadicTime T n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 1 T hT (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ n i + have hCe (n i : ℕ) : C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 2 T hT (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ n i + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + rawCoeff_measurable_past hε 1 (Or.inl rfl) B T _ _ _ _ z ρ δ + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (C n i) := + rawCoeff_measurable_past hε 2 (Or.inr rfl) B T _ _ _ _ z ρ δ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 1 (Or.inl rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (C n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 2 (Or.inr rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |C n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_fieldSum_tendsto_ae hB T τ F V htau hreg C hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + have he : (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample)) =ᵐ[P] + (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample)) := by + filter_upwards [hB.cont] with sample hc + have hcanc := integral_drift_cancel hε hT κ hκ.1 (U sample) z ρ δ + (fun t => B t.toNNReal sample) (fun t ht => BrownianDriver.extend_eq B _ T sample hc ht) + dsimp only [F,V,τ] + linarith + have hAeall : ∀ᵐ sample ∂P, ∀ n i, A n i sample = stoppedCoeff 1 B T τ F n i sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAe n)) + filter_upwards [hi,he,hAeall] with sample hi he ha + rw [he] at hi + convert hi using 1 + funext n + unfold dyadicDriverSum + simp only [← ha] + rfl + +end SLEExactGauge.LoewnerLocalized + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized BrownianPredictable + BrownianStopped BrownianIto TaylorMeshes PredictableLimit + +lemma retarget_setIntegral {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {z : ℂ} (hz : z ∈ halfPlane) {u v : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) + (C : Cutoff z v) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hsle : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (E : Set Ω) (hE : NullMeasurableSet E P) + (hstop : ∀ t : ℝ≥0, ∃ S : Set Ω, MeasurableSet[pastSigma B t] S ∧ + S =ᵐ[P] (E ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≤ (t : ℝ≥0∞)} : Set Ω)) : + (∫ sample in E, C.value κ B sample ∂P) = + ∫ sample in E, (C.retarget hz huv).value κ B sample ∂P := by + let D := C.retarget hz huv + let F := fun sample => field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) + (Real.sqrt κ) (C.paths κ B sample) z + let Q := fun w n i => rawCoeff C.height_pos 1 B C.horizon (dyadicTime C.horizon n i) + (1-κ/8) (8/κ-1) (Real.sqrt κ) z ((2*z.im)*Real.exp (-w)) C.angle + have hQe (w : ℝ) (n i : ℕ) : Q w n i =ᵐ[P] + stoppedCoeff 1 B C.horizon + (fun sample => stop C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z + ((2*z.im)*Real.exp (-w)) C.angle) F n i := + rawCoeff_stoppedCoeff_ae C.height_pos hB 1 C.horizon C.horizon_pos + (1-κ/8) (8/κ-1) (Real.sqrt κ) z ((2*z.im)*Real.exp (-w)) C.angle n i + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := sub_nonneg.2 ((le_div_iff₀ hκ.1).2 (by linarith [hκ.2])) + obtain ⟨K,hK,hKb⟩ := coeff_uniform_bound C.height_pos C.horizon.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hQb (w : ℝ) (n i : ℕ) : ∀ᵐ sample ∂P, |Q w n i sample| ≤ K := by + filter_upwards [hQe w n i] with sample he + rw [he] + unfold stoppedCoeff + split_ifs + · exact hKb _ _ _ + · simpa only [abs_zero] using hK + have hQm (w : ℝ) (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (Q w n i) := + rawCoeff_measurable_past C.height_pos 1 (Or.inl rfl) B C.horizon _ _ _ _ z _ C.angle + have hQ2 (w : ℝ) (n i : ℕ) : MemLp (Q w n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable C.height_pos hB 1 (Or.inl rfl) C.horizon + (dyadicTime C.horizon n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z _ C.angle).aestronglyMeasurable K + simpa only [Real.norm_eq_abs] using hQb w n i + have hsupport (n i : ℕ) : ∀ᵐ sample ∂P, + (dyadicTime C.horizon n i : ℝ≥0∞) < firstLiveRadiusStop (γ sample) (g sample) z u → + Q v n i sample = Q u n i sample := by + filter_upwards [hQe v n i,hQe u n i,hsle,hB.cont, + hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hev heu hs hc hb0 + intro ht + rcases eq_or_lt_of_le hu with rfl | hu' + · rw [firstLiveRadiusStop_zero hs hz] at ht + exact False.elim (not_lt_of_ge bot_le ht) + rw [hev,heu] + change (if mesh C.horizon n i < C.stopTime κ B sample then _ else 0) = + (if mesh C.horizon n i < D.stopTime κ B sample then _ else 0) + have hle := C.retarget_stop_le hz huv κ B sample + by_cases hD : mesh C.horizon n i < D.stopTime κ B sample + · rw [ite_eq_left hD,ite_eq_left (hD.trans_le hle)] + · by_cases hC : mesh C.horizon n i < C.stopTime κ B sample + · have hh := C.retarget_has_hit_of_lt hz hu' huv κ B sample hs hc hb0 + ((le_of_not_gt hD).trans_lt hC) + have hbad : firstLiveRadiusStop (γ sample) (g sample) z u ≤ + (dyadicTime C.horizon n i : ℝ≥0∞) := by + rw [hh,← ENNReal.ofReal_coe_nnreal,coe_dyadicTime] + exact ENNReal.ofReal_le_ofReal (le_of_not_gt hD) + exact False.elim ((not_lt_of_ge hbad) ht) + · rw [ite_eq_right hC,ite_eq_right hD] + have hlv := localized_sum_tendsto hB κ hκ C.height_pos C.horizon C.horizon_pos z + ((2*z.im)*Real.exp (-v)) C.angle + have hlu := localized_sum_tendsto hB κ hκ C.height_pos C.horizon C.horizon_pos z + ((2*z.im)*Real.exp (-u)) C.angle + have hcenter := indicator_difference_centered hB C.horizon (Q v) (Q u) + (hQm v) (hQm u) (hQ2 v) (hQ2 u) K hK (hQb v) (hQb u) + (fun sample => firstLiveRadiusStop (γ sample) (g sample) z u) hsupport E hE hstop + (fun sample => C.value κ B sample-F sample 0 (B 0 sample)) + (fun sample => D.value κ B sample-F sample 0 (B 0 sample)) hlv hlu + have hdiff : (∫ sample in E, C.value κ B sample-D.value κ B sample ∂P) = 0 := by + simpa only [sub_sub_sub_cancel_right,integral_indicator₀ hE] using hcenter.2 + have hv : Integrable (C.value κ B) P := (C.expectation hB κ hκ hz (hu.trans huv)).1 + have hu' : Integrable (D.value κ B) P := (D.expectation hB κ hκ hz hu).1 + rw [integral_sub hv.integrableOn hu'.integrableOn] at hdiff + exact sub_eq_zero.mp hdiff + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.FiniteTilt +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +variable (C : ℕ → Cutoff z u) (hC : Tendsto (fun n => (C n).angle) atTop (𝓝 0)) +include h hz hu hc hb0 hC + +lemma eventually_value_at_radius_general {t : ℝ≥0} (hzt : z ∈ localizationDomain γ t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + ∀ᶠ n : ℕ in atTop, ENNReal.ofReal ((C n).value κ B sample) = + finiteStoppedDensity κ (fun t => B t sample) γ g z u := by + obtain ⟨η, hη, hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + have hδ : ∀ᶠ n : ℕ in atTop, (C n).angle < η := + hC.eventually (gt_mem_nhds hη) + filter_upwards [hδ] with n hn + let D := C n + have hh : loewnerRadius g (D.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) := by + rcases D.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact hr + · have htm := hm (D.stopTime κ B sample) + ⟨(D.bounds κ B sample).1,D.stopTime_le_radius κ B sample h hz hu hc hb0 t.coe_nonneg hzt hrt⟩ + rw [hs] at htm + exact False.elim ((not_lt_of_ge htm) hn) + have he : D.stopTime κ B sample = t := h.live_radius_injective + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (D.bounds κ B sample).1 t.coe_nonneg (D.source_live κ B sample h hz hu hc hb0) hzt + (hh.trans hrt.symm) + have htau := h.firstLiveRadiusStop_eq + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) hzt hrt + have hp : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + rw [finiteStoppedDensity, htau, ite_eq_right (ENNReal.coe_ne_top), ENNReal.coe_toReal, hp, + ← he, ← D.value_eq_source κ B sample h hz hu hc hb0] + +lemma tendsto_value_killed_general (hκ : 0 < κ ∧ κ < 8) : + Tendsto (fun n : ℕ => ENNReal.ofReal ((C n).value κ B sample)) atTop + (𝓝 (finiteStoppedDensity κ (fun t => B t sample) γ g z u)) := by + by_cases he : ∃ t : ℝ≥0, z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u) + · obtain ⟨t, hzt, hrt⟩ := he + have hh : (fun n : ℕ => ENNReal.ofReal ((C n).value κ B sample)) =ᶠ[atTop] + (fun _ => finiteStoppedDensity κ (fun t => B t sample) γ g z u) := + eventually_value_at_radius_general κ B sample h hz hu hc hb0 C hC hzt hrt + exact tendsto_const_nhds.congr' hh.symm + · have hset : {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u)} = ∅ := by + apply Set.eq_empty_iff_forall_notMem.2 + intro t ht + exact he ⟨t,ht⟩ + have htau : firstLiveRadiusStop γ g z u = (⊤ : ℝ≥0∞) := by + simp only [firstLiveRadiusStop, hset, Set.image_empty, sInf_empty] + rw [finiteStoppedDensity, htau, ite_eq_left rfl] + have ha : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + have hlim := hC.rpow_const_nhds_zero ha + have hlim' : Tendsto (fun n : ℕ => ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) * + ((C n).angle)^(8/κ-1)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul hlim + have hl : Tendsto (fun n : ℕ => (C n).value κ B sample) atTop (𝓝 0) := by + apply squeeze_zero (fun n => (C n).value_nonneg κ B sample) _ hlim' + intro n + let D := C n + have hs : loewnerAngleSine κ (fun t => B t sample) g (D.stopTime κ B sample) z = D.angle := by + rcases D.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact False.elim (he ⟨⟨D.stopTime κ B sample,(D.bounds κ B sample).1⟩, + D.source_live κ B sample h hz hu hc hb0, hr⟩) + · exact hs + exact D.angle_exit_bound κ B sample h hz hu hc hb0 hκ hs + simpa only [ENNReal.ofReal_zero, Function.comp_def] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hl + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.FiniteTilt + +lemma tendsto_setLIntegral_value {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 ≤ u) + (C : ℕ → Cutoff z u) (hC : Tendsto (fun n => (C n).angle) atTop (𝓝 0)) (E : Set Ω) : + Tendsto (fun n => ∫⁻ sample in E, ENNReal.ofReal ((C n).value κ B sample) ∂P) atTop + (𝓝 (∫⁻ sample in E, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u ∂P)) := by + rcases eq_or_lt_of_le hu with rfl | hu + · have he (n : ℕ) : (∫⁻ sample in E, ENNReal.ofReal ((C n).value κ B sample) ∂P) = + ∫⁻ sample in E, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z 0 ∂P := by + apply lintegral_congr_ae + apply ae_restrict_of_ae + filter_upwards [hmaps,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hb0 + rw [(C n).value_zero hz κ B sample hb0,finiteStoppedDensity_zero (κ := κ) (B := fun t => B t sample) hm hb0 hz] + simp only [he] + exact tendsto_const_nhds + · let F := fun n sample => ENNReal.ofReal ((C n).value κ B sample) + have hFm (n : ℕ) : AEMeasurable (F n) (P.restrict E) := + (ENNReal.measurable_ofReal.comp_aemeasurable + ((C n).expectation hB κ hκ hz hu.le).1.aemeasurable).mono_measure Measure.restrict_le_self + have hFb (n : ℕ) : ∀ᵐ sample ∂P.restrict E, + F n sample ≤ ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) := by + apply ae_restrict_of_ae + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb0 + exact ENNReal.ofReal_le_ofReal ((C n).value_bound κ hκ B sample hz hu hc hb0) + have hFl : ∀ᵐ sample ∂P.restrict E, Tendsto (fun n => F n sample) atTop + (𝓝 (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u)) := by + apply ae_restrict_of_ae + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb0 + exact tendsto_value_killed_general κ B sample hm hz hu hc hb0 C hC hκ + have hfin : (∫⁻ _ : Ω in E, ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) ∂P) ≠ ⊤ := by + rw [lintegral_const] + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (measure_ne_top _ _) + exact tendsto_lintegral_of_dominated_convergence' + (fun _ : Ω => ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8)))) hFm hFb hfin hFl + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteTilt BrownianPredictable + +theorem finiteStoppedDensity_consistent {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u v : ℝ) (hu : 0 ≤ u) (huv : u ≤ v) + (A : Set Ω) (hA : NullMeasurableSet A P) + (hstop : ∀ t : ℝ≥0, ∃ E : Set Ω, MeasurableSet[pastSigma B t] E ∧ + E =ᵐ[P] (A ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≤ (t : ℝ≥0∞)} : Set Ω)) : + (∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z v ∂P) = + ∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P := by + let C := cutoffs hz v (hu.trans huv) + let D := fun n => (C n).retarget hz huv + have hv := tendsto_setLIntegral_value hB κ hκ γ g f hmaps hz (hu.trans huv) C + (shrinkingAngle_tendsto z) A + have hu' := tendsto_setLIntegral_value hB κ hκ γ g f hmaps hz hu D + (shrinkingAngle_tendsto z) A + have he (n : ℕ) : (∫⁻ sample in A, ENNReal.ofReal ((C n).value κ B sample) ∂P) = + ∫⁻ sample in A, ENNReal.ofReal ((D n).value κ B sample) ∂P := by + rw [← ofReal_integral_eq_lintegral_ofReal ((C n).expectation hB κ hκ hz (hu.trans huv)).1.integrableOn + (Filter.Eventually.of_forall (fun sample => (C n).value_nonneg κ B sample)), + ← ofReal_integral_eq_lintegral_ofReal ((D n).expectation hB κ hκ hz hu).1.integrableOn + (Filter.Eventually.of_forall (fun sample => (D n).value_nonneg κ B sample))] + congr 1 + exact (C n).retarget_setIntegral hB κ hκ hz hu huv γ g f hmaps A hA hstop + exact tendsto_nhds_unique (hv.congr' (Filter.Eventually.of_forall he)) hu' + +theorem conditionalRadiusApproachBound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C : ℝ, 0 < C ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (u v : ℝ) (_hu : 0 ≤ u) (_huv : u+1 ≤ v) + (A : Set Ω) (_hA : NullMeasurableSet A P) + (_hstop : ∀ t : ℝ≥0, ∃ E : Set Ω, + MeasurableSet[pastSigma B t] E ∧ + E =ᵐ[P] (A ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≤ (t : ℝ≥0∞)} : Set Ω)), + P (A ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z v ≠ (⊤ : ℝ≥0∞)}) ≤ + ENNReal.ofReal (C * ((2*z.im)*Real.exp (-v))^(codimension κ)) * + ∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P := by + obtain ⟨K,hK,hKb⟩ := Cutoff.targetValue_bound κ hκ + refine ⟨K,hK,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz u v hu huv A hA hstop + have hz0 : 0 < z.im := hz + have hv : 0 < v := by linarith + have huv' : u ≤ v := by linarith + let C := cutoffs hz v hv.le + let D := fun n => (C n).retarget hz huv' + let F := fun n => A.indicator (fun sample => ENNReal.ofReal ((C n).barrier (timeShift n) κ B sample)) + let Y := fun sample => liminf (fun n => F n sample) atTop + have hFm (n : ℕ) : AEMeasurable (F n) P := + (ENNReal.measurable_ofReal.comp_aemeasurable + ((C n).barrier_aemeasurable hB (timeShift n) κ hκ (timeShift_pos n))).indicator₀ hA + have hYm : AEMeasurable Y P := by + dsimp only [Y] + simp_rw [liminf_eq_iSup_iInf_of_nat] + exact AEMeasurable.iSup (fun n => AEMeasurable.iInf (fun i => AEMeasurable.iInf (fun (_ : n ≤ i) => hFm i))) + have hsub : (A ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z v ≠ (⊤ : ℝ≥0∞)} : Set Ω) ≤ᵐ[P] + {sample | (1:ℝ≥0∞) ≤ Y sample} := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb0 hs + have hh := barrier_tendsto_on_hit κ B sample hm hz hv hc hb0 hκ hs.2 + have he : Y sample = 1 := by + dsimp only [Y,F] + simp only [Set.indicator_of_mem hs.1] + exact hh.liminf_eq + exact he.ge + have hexp (n : ℕ) : (∫⁻ sample, F n sample ∂P) ≤ + ENNReal.ofReal (K*((2*z.im)*Real.exp (-v))^(codimension κ)) * + ∫⁻ sample in A, ENNReal.ofReal ((D n).value κ B sample) ∂P := by + have hbi := ((C n).barrier_expectation hB (timeShift n) κ hκ (timeShift_pos n) hz hv γ g f hmaps).1 + have hti : Integrable ((C n).targetValue hz huv' (timeShift n) κ B) P := by + apply (((D n).expectation hB κ hκ hz hu).1.const_mul + (K*((2*z.im)*Real.exp (-v))^(codimension κ))).mono' + ((C n).targetValue_aemeasurable hB hz huv' (timeShift n) κ hκ (timeShift_pos n)).aestronglyMeasurable + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb0 + rw [Real.norm_eq_abs,abs_of_nonneg ((C n).targetValue_nonneg hz huv' (timeShift n) κ hκ (timeShift_pos n) B sample)] + exact hKb hz hu huv (C n) B sample (timeShift n) (timeShift_pos n) hc hb0 + have hle := (C n).target_setIntegral_le hB (timeShift n) κ hκ (timeShift_pos n) hz hu huv + γ g f hmaps A hA hstop + rw [lintegral_indicator₀ hA] + calc + _ = ENNReal.ofReal (∫ sample in A, (C n).barrier (timeShift n) κ B sample ∂P) := by + symm + exact ofReal_integral_eq_lintegral_ofReal hbi.integrableOn (Eventually.of_forall + (fun sample => (C n).barrier_nonneg (timeShift n) κ B sample hκ (timeShift_pos n))) + _ ≤ ENNReal.ofReal (∫ sample in A, (C n).targetValue hz huv' (timeShift n) κ B sample ∂P) := + ENNReal.ofReal_le_ofReal hle + _ = ∫⁻ sample in A, ENNReal.ofReal ((C n).targetValue hz huv' (timeShift n) κ B sample) ∂P := + ofReal_integral_eq_lintegral_ofReal hti.integrableOn (Eventually.of_forall + (fun sample => (C n).targetValue_nonneg hz huv' (timeShift n) κ hκ (timeShift_pos n) B sample)) + _ ≤ ∫⁻ sample in A, ENNReal.ofReal (K*((2*z.im)*Real.exp (-v))^(codimension κ)) * + ENNReal.ofReal ((D n).value κ B sample) ∂P := by + apply lintegral_mono_ae + apply ae_restrict_of_ae + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb0 + rw [← ENNReal.ofReal_mul (by positivity : 0 ≤ K*((2*z.im)*Real.exp (-v))^(codimension κ))] + exact ENNReal.ofReal_le_ofReal (hKb hz hu huv (C n) B sample (timeShift n) (timeShift_pos n) hc hb0) + _ = _ := lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + have ht := tendsto_setLIntegral_value hB κ hκ γ g f hmaps hz hu D (shrinkingAngle_tendsto z) A + have ht' := ENNReal.Tendsto.const_mul ht (Or.inr (ENNReal.ofReal_ne_top (r := K*((2*z.im)*Real.exp (-v))^(codimension κ)))) + calc + _ ≤ P {sample | (1:ℝ≥0∞) ≤ Y sample} := measure_mono_ae hsub + _ ≤ ∫⁻ sample, Y sample ∂P := by + simpa only [div_one] using meas_ge_le_lintegral_div hYm (by norm_num : (1:ℝ≥0∞) ≠ 0) (by norm_num : (1:ℝ≥0∞) ≠ ⊤) + _ ≤ liminf (fun n => ∫⁻ sample, F n sample ∂P) atTop := lintegral_liminf_le' hFm + _ ≤ _ := (liminf_le_liminf (Eventually.of_forall hexp)).trans_eq ht'.liminf_eq + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open BrownianPredictable FiniteTilt + +theorem conditionalCenteredInverseAngleBound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C : ℝ, 0 < C ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (u v : ℝ) (_hu : 0 ≤ u) (_huv : u+1 ≤ v) + (A : Set Ω) (_hA : NullMeasurableSet A P) + (_hstop : ∀ t : ℝ≥0, ∃ E : Set Ω, + MeasurableSet[pastSigma B t] E ∧ + E =ᵐ[P] (A ∩ {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≤ (t : ℝ≥0∞)} : Set Ω)), + (∫⁻ sample in A, radiusStoppedInverseAngle κ B γ g z v sample + ∂finiteCenteredMeasure κ P B γ g z v) ≤ + ENNReal.ofReal C * (finiteCenteredMeasure κ P B γ g z u) A := by + obtain ⟨C,hC,hbound⟩ := conditionalRadiusApproachBound κ hκ + refine ⟨C,hC,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz u v hu huv A hA hstop + have hv : 0 < v := by linarith + have hz0 : 0 < z.im := hz + let M₀ := ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) + let K := ENNReal.ofReal (((2*z.im)*Real.exp (-v))^(-codimension κ)) / M₀ + let H : Set Ω := {sample | firstLiveRadiusStop (γ sample) (g sample) z v ≠ (⊤ : ℝ≥0∞)} + have hmpos := localizationInitialGreen_pos κ hz + have hm0 : M₀ ≠ 0 := (ENNReal.ofReal_pos.2 hmpos).ne' + have hd := finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz v hv + have hdm : AEMeasurable (fun sample => finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z v / M₀) P := hd.div_const M₀ + have hdf : ∀ᵐ sample ∂P, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z v / M₀ < (⊤ : ℝ≥0∞) := Filter.Eventually.of_forall + (fun sample => ENNReal.div_lt_top (finiteStoppedDensity_lt_top κ _ _ _ z v).ne hm0) + have he : (fun sample => (finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z v / M₀) * radiusStoppedInverseAngle κ B γ g z v sample) =ᵐ[P] + H.indicator (fun _ => K) := by + filter_upwards [hmaps,hB.cont] with sample hm hc + have hh := finiteStoppedDensity_mul_inverseAngle κ B γ g f z hz v sample hm hc + rw [show (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z v / M₀) * + radiusStoppedInverseAngle κ B γ g z v sample = (finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z v * radiusStoppedInverseAngle κ B γ g z v sample) / M₀ by + simp only [div_eq_mul_inv]; ac_rfl, hh] + classical + by_cases hhit : sample ∈ H + · simp only [H] at hhit + simp only [H, Set.indicator_of_mem hhit, K] + · simp only [H] at hhit + simp only [H, Set.indicator_of_notMem hhit, ENNReal.zero_div] + have heleft : (∫⁻ sample in A, radiusStoppedInverseAngle κ B γ g z v sample + ∂finiteCenteredMeasure κ P B γ g z v) ≤ K*P (A∩H) := by + change (∫⁻ sample in A, _ ∂P.withDensity _) ≤ _ + rw [setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable₀' P A hdm.restrict _ + (ae_restrict_of_ae hdf)] + simp only [Pi.mul_apply] + rw [lintegral_congr_ae (ae_restrict_of_ae he)] + calc + _ ≤ K*(P.restrict A) H := lintegral_indicator_const_le H K + _ = _ := by rw [Measure.restrict_apply₀' hA,inter_comm] + have hemeasure : (finiteCenteredMeasure κ P B γ g z u) A = + M₀⁻¹ * ∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u ∂P := by + rw [finiteCenteredMeasure,withDensity_apply₀ _ hA] + simp_rw [ENNReal.div_eq_inv_mul] + exact lintegral_const_mul' _ _ (ENNReal.inv_ne_top.2 hm0) + have hcancel : ENNReal.ofReal (((2*z.im)*Real.exp (-v))^(-codimension κ)) * + ENNReal.ofReal (C*((2*z.im)*Real.exp (-v))^(codimension κ)) = ENNReal.ofReal C := by + rw [← ENNReal.ofReal_mul (Real.rpow_nonneg (by positivity) _)] + congr 1 + calc + _ = C*(((2*z.im)*Real.exp (-v))^(-codimension κ)*((2*z.im)*Real.exp (-v))^(codimension κ)) := by ring + _ = C := by rw [← Real.rpow_add (by positivity),neg_add_cancel,Real.rpow_zero,mul_one] + calc + _ ≤ K*P (A∩H) := heleft + _ ≤ K*(ENNReal.ofReal (C*((2*z.im)*Real.exp (-v))^(codimension κ)) * + ∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P) := + mul_le_mul' le_rfl (hbound P B hB γ g f hγ hmaps z hz u v hu huv A hA hstop) + _ = _ := by + rw [hemeasure] + dsimp only [K] + rw [div_eq_mul_inv] + calc + _ = (ENNReal.ofReal (((2*z.im)*Real.exp (-v))^(-codimension κ)) * + ENNReal.ofReal (C*((2*z.im)*Real.exp (-v))^(codimension κ))) * + (M₀⁻¹ * ∫⁻ sample in A, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P) := by ac_rfl + _ = _ := by rw [hcancel] + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/ConditionalTilts.lean b/lean/OAI/Probability/SLELocalization/ConditionalTilts.lean new file mode 100644 index 0000000000000000000000000000000000000000..91f7079f938315f617a41bced05a87bf46c0b8f6 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/ConditionalTilts.lean @@ -0,0 +1,977 @@ +import Mathlib +import OAI.Probability.SLELocalization.AngularClock +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Brownian Predictable estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable +open PredictableLimit + +lemma indicator_difference_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) + (A D : ℕ → ℕ → Ω → ℝ) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hD : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (D n i)) + (hA2 : ∀ n i, MemLp (A n i) 2 P) (hD2 : ∀ n i, MemLp (D n i) 2 P) + (K : ℝ) (hK : 0 ≤ K) + (hbA : ∀ n i, ∀ᵐ sample ∂P, |A n i sample| ≤ K) + (hbD : ∀ n i, ∀ᵐ sample ∂P, |D n i sample| ≤ K) + (θ : Ω → ℝ≥0∞) + (hsupport : ∀ n i, ∀ᵐ sample ∂P, + (dyadicTime T n i : ℝ≥0∞) < θ sample → A n i sample = D n i sample) + (E : Set Ω) (hE : NullMeasurableSet E P) + (hstop : ∀ t : ℝ≥0, ∃ S : Set Ω, MeasurableSet[pastSigma B t] S ∧ + S =ᵐ[P] (E ∩ {sample | θ sample ≤ (t : ℝ≥0∞)} : Set Ω)) + (YA YD : Ω → ℝ) + (hlA : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T A n sample) atTop (𝓝 (YA sample))) + (hlD : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T D n sample) atTop (𝓝 (YD sample))) : + Integrable (E.indicator (fun sample => YA sample-YD sample)) P ∧ + (∫ sample, E.indicator (fun sample => YA sample-YD sample) sample ∂P) = 0 := by + classical + choose S hSm hSeq using hstop + let Q := fun n i => (S (dyadicTime T n i)).indicator (fun sample => A n i sample-D n i sample) + have hQm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := + ((hA n i).sub (hD n i)).indicator (hSm _) + have heq (n i : ℕ) : Q n i =ᵐ[P] E.indicator (fun sample => A n i sample-D n i sample) := by + filter_upwards [hSeq (dyadicTime T n i), hsupport n i] with sample he hs + have he : sample ∈ S (dyadicTime T n i) ↔ sample ∈ E ∧ θ sample ≤ (dyadicTime T n i : ℝ≥0∞) := Iff.of_eq he + by_cases hz : θ sample ≤ (dyadicTime T n i : ℝ≥0∞) + · simp only [Q,Set.indicator_apply,he,hz,and_true] + · have hh := hs (lt_of_not_ge hz) + simp only [Q,Set.indicator_apply,hh,sub_self,ite_self] + have hQ2 (n i : ℕ) : MemLp (Q n i) 2 P := by + have hd := (hA2 n i).sub (hD2 n i) + have hm : MemLp (E.indicator (fun sample => A n i sample-D n i sample)) 2 P := + hd.of_le (hd.aestronglyMeasurable.indicator₀ hE) + (Filter.Eventually.of_forall (fun sample => norm_indicator_le_norm_self _ sample)) + exact hm.ae_eq (heq n i).symm + have hQb (n i : ℕ) : ∀ᵐ sample ∂P, |Q n i sample| ≤ 2*K := by + filter_upwards [hbA n i,hbD n i] with sample ha hd + dsimp only [Q] + rw [Set.indicator_apply] + split_ifs + · exact (abs_sub _ _).trans (by linarith) + · simpa only [abs_zero] using (show 0 ≤ 2*K by positivity) + have heall : ∀ᵐ sample ∂P, ∀ n i, Q n i sample = E.indicator (fun sample => A n i sample-D n i sample) sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (heq n)) + apply limit_centered hB T Q hQm hQ2 (2*K) (by positivity) hQb _ + filter_upwards [heall,hlA,hlD] with sample he ha hd + have heqsum (n : ℕ) : dyadicDriverSum B T Q n sample = + E.indicator (fun sample => dyadicDriverSum B T A n sample-dyadicDriverSum B T D n sample) sample := by + unfold dyadicDriverSum + simp only [he,Set.indicator_apply] + split_ifs <;> simp [sub_mul,Finset.sum_sub_distrib] + simp only [heqsum,Set.indicator_apply] + split_ifs + · exact ha.sub hd + · exact tendsto_const_nhds + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.GammaTwoRadius +open LoewnerCutoff LoewnerExit GammaField BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +open scoped unitInterval +variable {ε : ℝ} (hε : 0 < ε) + +def coeffAt (k : ℕ) (s : ℝ≥0) (l b η sdev : ℝ) (z : ℂ) (r ρ δ : ℝ) + (q : C(I, ℝ) × ℝ) : ℝ := by + classical + exact if ∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg q.1 z ρ δ t then + iteratedDeriv k (field hε s.coe_nonneg l b η r sdev q.1 z s) q.2 else 0 + +lemma coeffAt_measurable (k : ℕ) (_hk : k = 1 ∨ k = 2) (s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (r ρ δ : ℝ) : + @Measurable (C(I, ℝ) × ℝ) ℝ (@Prod.instMeasurableSpace _ _ (borel _) inferInstance) _ (coeffAt hε k s l b η sdev z r ρ δ) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hc : Continuous (fun q : C(I, ℝ) × ℝ => + iteratedDeriv k (field hε s.coe_nonneg l b η r sdev q.1 z s) q.2) := by + have hp : Continuous (fun q : C(I, ℝ) × ℝ => ((q.1,(s:ℝ)),q.2)) := + (continuous_fst.prodMk continuous_const).prodMk continuous_snd + have hc := (continuous_derivative hε s.coe_nonneg hl hb hη r sdev z k).comp hp + dsimp only [Function.comp_def] at hc + exact hc + apply hc.measurable.ite _ measurable_const + exact ((isOpen_positive_on hε s.coe_nonneg z ρ δ s).preimage continuous_fst).measurableSet + +def rawCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (l b η sdev : ℝ) (z : ℂ) (r ρ δ : ℝ) (sample : Ω) : ℝ := + if s < T then coeffAt hε k s l b η sdev z r ρ δ (BrownianDriver.path B sdev s sample, B s sample) else 0 + +lemma rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k = 1 ∨ k = 2) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (r ρ δ : ℝ) : + Measurable[pastSigma B s] (rawCoeff hε k B T s l b η sdev z r ρ δ) := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s l b η sdev hl hb hη z r ρ δ).comp + ((BrownianDriver.path_measurable_past B sdev s).prodMk (past_measurable_eval B (s := s) le_rfl)) + · exact measurable_const + +lemma rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k = 1 ∨ k = 2) (T s : ℝ≥0) + (l b η sdev : ℝ) (hl : 0 < l) (hb : 0 < b) (hη : 0 < η) (z : ℂ) (r ρ δ : ℝ) : + AEMeasurable (rawCoeff hε k B T s l b η sdev z r ρ δ) P := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s l b η sdev hl hb hη z r ρ δ).comp_aemeasurable + ((BrownianDriver.path_aemeasurable hB sdev s).prodMk (hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable) + · exact aemeasurable_const + +lemma rawCoeff_eq {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (hT : 0 < (T:ℝ)) (l b η sdev : ℝ) (z : ℂ) (r ρ δ : ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + rawCoeff hε k B T s l b η sdev z r ρ δ sample = + if (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ then + iteratedDeriv k (field hε T.coe_nonneg l b η r sdev (BrownianDriver.path B sdev T sample) z s) (B s sample) else 0 := by + classical + by_cases hsT : s < T + · have he := BrownianDriver.prefix_eq B sdev s T sample hc hsT.le + have hf := field_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z l b η r sdev he + ⟨s.coe_nonneg, le_rfl⟩ + have hd := deficit_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z ρ δ he + have hi : (∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg (BrownianDriver.path B sdev s sample) z ρ δ t) ↔ + (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := by + rw [lt_stop_iff hε T.coe_nonneg hT _ z ρ δ ⟨s.coe_nonneg,hsT⟩] + exact forall₂_congr (fun t ht => by rw [hd ht]) + simp only [rawCoeff, ite_eq_left hsT, coeffAt, hi, hf] + · have hstop : ¬ (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := + not_lt_of_ge ((stop_bounds hε T.coe_nonneg _ z ρ δ).2.trans (not_lt.1 hsT)) + simp only [rawCoeff, ite_eq_right hsT, ite_eq_right hstop] + +lemma rawCoeff_stoppedCoeff_ae {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (T : ℝ≥0) + (hT : 0 < (T:ℝ)) (l b η sdev : ℝ) (z : ℂ) (r ρ δ : ℝ) (n i : ℕ) : + rawCoeff hε k B T (dyadicTime T n i) l b η sdev z r ρ δ =ᵐ[P] + stoppedCoeff k B T + (fun sample => stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ) + (fun sample => field hε T.coe_nonneg l b η r sdev (BrownianDriver.path B sdev T sample) z) n i := by + filter_upwards [hB.cont] with sample hc + rw [rawCoeff_eq hε k B T _ hT l b η sdev z r ρ δ sample hc] + simp only [stoppedCoeff, coe_dyadicTime] + +end SLEExactGauge.GammaTwoRadius + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerExit +open LoewnerCutoff + +lemma stop_antitone_radius {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (U : C(I, ℝ)) (z : ℂ) (ρ ρ₂ δ : ℝ) (hρρ₂ : ρ ≤ ρ₂) : + stop hε hT.le U z ρ₂ δ ≤ stop hε hT.le U z ρ δ := by + by_contra hn + have hlt : stop hε hT.le U z ρ δ < stop hε hT.le U z ρ₂ δ := lt_of_not_ge hn + have hp := (deficit_pos_iff hε hT.le U z ρ₂ δ _).1 + (positive_before hε hT.le hT U z ρ₂ δ (stop_bounds hε hT.le U z ρ δ).1 hlt) + have hpos : 0 < deficit hε hT.le U z ρ δ (stop hε hT.le U z ρ δ) := + (deficit_pos_iff hε hT.le U z ρ δ _).2 ⟨hρρ₂.trans_lt hp.1,hp.2⟩ + exact (not_lt_of_ge (nonpos_at_of_lt hε hT.le hT U z ρ δ + (hlt.trans_le (stop_bounds hε hT.le U z ρ₂ δ).2))) hpos + +end SLEExactGauge.LoewnerExit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized +variable {z : ℂ} {u v : ℝ} + +def retarget (C : Cutoff z v) (hz : z ∈ halfPlane) (huv : u ≤ v) : Cutoff z u where + angle := C.angle + angle_pos := C.angle_pos + angle_initial := C.angle_initial + height := C.height + height_pos := C.height_pos + horizon := C.horizon + horizon_pos := C.horizon_pos + height_small := C.height_small.trans_le (by + apply mul_le_mul_of_nonneg_left _ hz.le + apply Real.exp_le_exp.mpr + exact div_le_div_of_nonneg_right (neg_le_neg huv) (by positivity)) + time_large := lt_of_le_of_lt (by + apply div_le_div_of_nonneg_right _ (by positivity) + exact mul_le_mul_of_nonneg_right huv (sq_nonneg _)) C.time_large + +lemma retarget_stop_le (C : Cutoff z v) (hz : z ∈ halfPlane) (huv : u ≤ v) + {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : + (C.retarget hz huv).stopTime κ B sample ≤ C.stopTime κ B sample := by + apply stop_antitone_radius C.height_pos C.horizon_pos + exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (neg_le_neg huv)) (by exact mul_nonneg (by norm_num) hz.le) + +lemma retarget_has_hit_of_lt (C : Cutoff z v) (hz : z ∈ halfPlane) + (hu : 0 < u) (huv : u ≤ v) {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) + (hlt : (C.retarget hz huv).stopTime κ B sample < C.stopTime κ B sample) : + firstLiveRadiusStop γ g z u = ENNReal.ofReal ((C.retarget hz huv).stopTime κ B sample) := by + let D := C.retarget hz huv + have hd := D.initial_deficit_brownian κ B sample hz hu hc hb0 + have ht := D.bounds κ B sample + have hR : loewnerRadius g (D.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) := by + rcases D.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact hr + · have hp := (deficit_pos_iff C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) + z ((2*z.im)*Real.exp (-v)) C.angle (D.stopTime κ B sample)).1 + (positive_before C.height_pos C.horizon.coe_nonneg C.horizon_pos (C.paths κ B sample) + z ((2*z.im)*Real.exp (-v)) C.angle ht.1 hlt) + have he := D.source_sine κ B sample h hz hu hc hb0 + have hi : C.angle < loewnerAngleSine κ (fun t => B t sample) g (D.stopTime κ B sample) z := by + rw [← he] + exact hp.2.2 + exact False.elim ((ne_of_gt hi) hs) + have hh := h.firstLiveRadiusStop_eq + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (t := ⟨D.stopTime κ B sample,ht.1⟩) (D.source_live κ B sample h hz hu hc hb0) hR + rw [ENNReal.ofReal_eq_coe_nnreal ht.1] + exact hh + +lemma stopTime_zero (C : Cutoff z 0) {Ω : Type*} (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : C.stopTime κ B sample = 0 := by + apply le_antisymm _ (C.bounds κ B sample).1 + by_contra hn + have hp := (deficit_pos_iff C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) + z ((2*z.im)*Real.exp (-0)) C.angle 0).1 + (positive_before C.height_pos C.horizon.coe_nonneg C.horizon_pos (C.paths κ B sample) + z ((2*z.im)*Real.exp (-0)) C.angle le_rfl (lt_of_not_ge hn)) + simpa only [LoewnerExit.radius,position_initial,logDerivative_initial,neg_zero, + Real.exp_zero,mul_one,div_one,lt_self_iff_false] using hp.1 + +lemma value_zero (C : Cutoff z 0) (hz : z ∈ halfPlane) {Ω : Type*} (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (sample : Ω) (hb0 : B 0 sample = 0) : + ENNReal.ofReal (C.value κ B sample) = + ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) := by + unfold value + rw [C.stopTime_zero,Real.toNNReal_zero,hb0,field_initial C.height_pos C.horizon.coe_nonneg + (1-κ/8) (8/κ-1) (Real.sqrt κ) (C.paths κ B sample) z (C.height_initial hz le_rfl).le, + green_initial κ hz] + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BrownianLocal.LocalRegular + +lemma mono {F V : ℝ → ℝ → ℝ} {b : ℝ → ℝ} {S T : ℝ} + (h : BrownianLocal.LocalRegular F V b T) (hST : S ≤ T) : + BrownianLocal.LocalRegular F V b S where + smooth := h.smooth + third_cont := h.third_cont.mono (Set.prod_mono (Icc_subset_Icc_right hST) Subset.rfl) + time_cont := fun x => (h.time_cont x).mono (Icc_subset_Icc_right hST) + time_deriv := fun t ht => h.time_deriv t ⟨ht.1,ht.2.trans_le hST⟩ + drift_cont := h.drift_cont.mono (Set.prod_mono (Icc_subset_Icc_right hST) (Icc_subset_Icc_right hST)) + second_cont := h.second_cont.mono (Icc_subset_Icc_right hST) + +end SLEExactGauge.BrownianLocal.LocalRegular + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open GammaField GammaTwoRadius BrownianPredictable BrownianStopped BrownianIto TaylorMeshes PredictableLimit +variable {z : ℂ} {v : ℝ} (C : Cutoff z v) + +def targetField {Ω : Type*} (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ → ℝ → ℝ := + GammaField.field C.height_pos C.horizon.coe_nonneg (κ/2) ((8/κ-1)/2) η + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) (C.paths κ B sample) z + +def targetDrift {Ω : Type*} (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ → ℝ → ℝ := + GammaField.drift C.height_pos C.horizon.coe_nonneg (κ/2) ((8/κ-1)/2) η + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) (C.paths κ B sample) z + +def targetCoeff {Ω : Type*} (k : ℕ) (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (w : ℝ) (n i : ℕ) : Ω → ℝ := + GammaTwoRadius.rawCoeff C.height_pos k B C.horizon (dyadicTime C.horizon n i) + (κ/2) ((8/κ-1)/2) η (Real.sqrt κ) z ((2*z.im)*Real.exp (-v)) ((2*z.im)*Real.exp (-w)) C.angle + +def targetRemainder {Ω : Type*} (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (t : Ω → ℝ) (sample : Ω) : ℝ := + C.targetField η κ B sample (t sample) (B (t sample).toNNReal sample) - + C.targetField η κ B sample 0 (B 0 sample) - + (∫ s in (0:ℝ)..(t sample), C.targetDrift η κ B sample s (B s.toNNReal sample)) - + (1/2:ℝ)*∫ s in (0:ℝ)..(t sample), + iteratedDeriv 2 (C.targetField η κ B sample s) (B s.toNNReal sample) + +lemma targetCoeff_eq {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (η κ : ℝ) + (hz : z ∈ halfPlane) (w : ℝ) (hwv : w ≤ v) (n i : ℕ) : + C.targetCoeff k η κ B w n i =ᵐ[P] + stoppedCoeff k B C.horizon ((C.retarget hz hwv).stopTime κ B) (C.targetField η κ B) n i := + rawCoeff_stoppedCoeff_ae C.height_pos hB k C.horizon C.horizon_pos (κ/2) ((8/κ-1)/2) + η (Real.sqrt κ) z _ _ C.angle n i + +lemma targetCoeff_measurable {Ω : Type*} [MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (k : ℕ) (hk : k = 1 ∨ k = 2) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (w : ℝ) (n i : ℕ) : + Measurable[pastSigma B (dyadicTime C.horizon n i)] (C.targetCoeff k η κ B w n i) := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + exact rawCoeff_measurable_past C.height_pos k hk B C.horizon _ _ _ _ _ hl hb hη z _ _ C.angle + +lemma targetCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (hk : k = 1 ∨ k = 2) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (w : ℝ) (n i : ℕ) : + AEMeasurable (C.targetCoeff k η κ B w n i) P := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + exact rawCoeff_aemeasurable C.height_pos hB k hk C.horizon _ _ _ _ _ hl hb hη z _ _ C.angle + +lemma targetCoeff_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (hz : z ∈ halfPlane) (hv : 0 < v) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ w, w ≤ v → ∀ n i, + ∀ᵐ sample ∂P, |C.targetCoeff k η κ B w n i sample| ≤ K := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + obtain ⟨K,hK,hKb⟩ := coefficient_bound C.height_pos C.horizon.coe_nonneg hl hb hη + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) (η+v) (1/C.angle) z k + refine ⟨K,hK,?_⟩ + intro w hwv n i + filter_upwards [C.targetCoeff_eq hB k η κ hz w hwv n i,hmaps,hB.cont, + hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample he hm hc hb0 + rw [he] + unfold stoppedCoeff + split_ifs with hh + · have ht : mesh C.horizon n i ∈ Icc 0 (C.stopTime κ B sample) := + ⟨by unfold mesh; positivity,hh.le.trans (C.retarget_stop_le hz hwv κ B sample)⟩ + exact hKb (C.paths κ B sample) _ _ (C.remaining_upper κ B sample hm hz hv hc hb0 η ht) + (by simpa only [mesh_toNNReal] using C.ratio_upper κ B sample hz hv hc hb0 ht) + · simpa only [abs_zero] using hK + +lemma target_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (η κ : ℝ) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (hz : z ∈ halfPlane) (hv : 0 < v) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (w : ℝ) (hwv : w ≤ v) : + ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B C.horizon (C.targetCoeff 1 η κ B w) n sample) + atTop (𝓝 (C.targetRemainder η κ B ((C.retarget hz hwv).stopTime κ B) sample)) := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + let D := C.retarget hz hwv + have hreg : ∀ᵐ sample ∂P, BrownianLocal.LocalRegular (C.targetField η κ B sample) + (C.targetDrift η κ B sample) (fun t => B t.toNNReal sample) (D.stopTime κ B sample) := by + filter_upwards [hB.cont] with sample hc + have hρ : 0 < (2*z.im)*Real.exp (-v) := by have hy : 0 < z.im := hz; positivity + exact (regular C.height_pos C.horizon.coe_nonneg hl hb hη hρ C.horizon_pos + (Real.sqrt κ) (C.paths κ B sample) z C.angle _ (hc.comp continuous_real_toNNReal)).mono + (C.retarget_stop_le hz hwv κ B sample) + obtain ⟨K₁,hK₁,hb₁⟩ := C.targetCoeff_bound hB 1 η κ hκ hη hz hv γ g f hmaps + obtain ⟨K₂,hK₂,hb₂⟩ := C.targetCoeff_bound hB 2 η κ hκ hη hz hv γ g f hmaps + have hMem : ∀ n i, MemLp (C.targetCoeff 2 η κ B w n i) 2 P := by + intro n i + apply MemLp.of_bound (C.targetCoeff_aemeasurable hB 2 (Or.inr rfl) η κ hκ hη w n i).aestronglyMeasurable K₂ + simpa only [Real.norm_eq_abs] using hb₂ w hwv n i + have hi := BrownianLocal.stopped_fieldSum_tendsto_ae hB C.horizon (D.stopTime κ B) + (C.targetField η κ B) (C.targetDrift η κ B) + (Filter.Eventually.of_forall (fun sample => D.bounds κ B sample)) hreg + (C.targetCoeff 2 η κ B w) (C.targetCoeff_eq hB 2 η κ hz w hwv) + (C.targetCoeff_measurable B 2 (Or.inr rfl) η κ hκ hη w) hMem + K₂ hK₂ (fun n i => by + filter_upwards [C.targetCoeff_eq hB 2 η κ hz w hwv n i,hb₂ w hwv n i] with sample he hh + rwa [← he]) + K₁ hK₁ (fun n i => by + filter_upwards [C.targetCoeff_eq hB 1 η κ hz w hwv n i,hb₁ w hwv n i] with sample he hh + rwa [← he]) + have heall : ∀ᵐ sample ∂P, ∀ n i, C.targetCoeff 1 η κ B w n i sample = + stoppedCoeff 1 B C.horizon (D.stopTime κ B) (C.targetField η κ B) n i sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (C.targetCoeff_eq hB 1 η κ hz w hwv n)) + filter_upwards [hi,heall] with sample hi he + simpa only [targetRemainder,dyadicDriverSum,he] using hi + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerExit + +lemma integral_drift_nonpos_from {ε T κ η : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (ρ : ℝ) + (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (δ : ℝ) (B : ℝ → ℝ) (hB : Continuous B) + (hU : ∀ s ∈ Icc 0 T, extendDriver T U s = Real.sqrt κ*B s) + {a : ℝ} (ha : 0 ≤ a) (haτ : a ≤ stop hε hT U z ρ δ) : + (∫ t in a..(stop hε hT U z ρ δ), drift hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t (B t)) + + (1/2:ℝ)*∫ t in a..(stop hε hT U z ρ δ), + iteratedDeriv 2 (field hε hT (κ/2) ((8/κ-1)/2) η ρ (Real.sqrt κ) U z t) (B t) ≤ 0 := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have hm : Continuous (fun t : ℝ => ((U,t),B t)) := + (continuous_const.prodMk continuous_id).prodMk hB + have hv := (continuous_drift hε hT hl hb hη ρ (Real.sqrt κ) z).comp hm + have hc := (continuous_derivative hε hT hl hb hη ρ (Real.sqrt κ) z 2).comp hm + have hiV := hv.intervalIntegrable (μ := volume) a (stop hε hT U z ρ δ) + have hiC := hc.intervalIntegrable (μ := volume) a (stop hε hT U z ρ δ) + dsimp only [Function.comp_def] at hiV hiC + rw [← intervalIntegral.integral_const_mul, ← intervalIntegral.integral_add hiV (hiC.const_mul (1/2:ℝ))] + rw [intervalIntegral.integral_of_le haτ] + apply integral_nonpos_of_ae + have hne : ∀ᵐ t : ℝ ∂volume, t ≠ stop hε hT U z ρ δ := by simp [ae_iff] + filter_upwards [ae_restrict_mem measurableSet_Ioc,ae_restrict_of_ae hne] with t ht he + have hlt : t < stop hε hT U z ρ δ := lt_of_le_of_ne ht.2 he + have hh := (deficit_pos_iff hε hT U z ρ δ t).1 + (positive_before hε hT hTp U z ρ δ (ha.trans ht.1.le) hlt) + exact drift_nonpos hε hT hκ hη ρ U z t (B t) hh.2.1.le + (hU t ⟨ha.trans ht.1.le,ht.2.trans (stop_bounds hε hT U z ρ δ).2⟩) + +end SLEExactGauge.GammaField + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open GammaField LoewnerCutoff LoewnerExit +variable {z : ℂ} {v : ℝ} (C : Cutoff z v) + +def targetValue {Ω : Type*} (hz : z ∈ halfPlane) {w : ℝ} (hwv : w ≤ v) + (η κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ := + C.targetField η κ B sample ((C.retarget hz hwv).stopTime κ B sample) + (B ((C.retarget hz hwv).stopTime κ B sample).toNNReal sample) + +lemma targetValue_nonneg {Ω : Type*} (hz : z ∈ halfPlane) {w : ℝ} (hwv : w ≤ v) + (η κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : + 0 ≤ C.targetValue hz hwv η κ B sample := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + exact field_nonneg C.height_pos C.horizon.coe_nonneg hl hb hη _ _ _ _ _ _ + +lemma targetValue_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (hz : z ∈ halfPlane) {w : ℝ} (hwv : w ≤ v) + (η κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) : + AEMeasurable (C.targetValue hz hwv η κ B) P := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + let τ := fun U : C(I, ℝ) => stop C.height_pos C.horizon.coe_nonneg U z ((2*z.im)*Real.exp (-w)) C.angle + have hτ : Measurable τ := measurable_stop C.height_pos C.horizon.coe_nonneg C.horizon_pos z _ C.angle + have hm := ((continuous_actualField C.height_pos C.horizon hl hb hη + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) z).measurable.comp (measurable_id.prodMk hτ)).comp_aemeasurable + (BrownianDriver.path_aemeasurable hB (Real.sqrt κ) C.horizon) + apply hm.congr + filter_upwards [hB.cont] with sample hc + change GammaField.field C.height_pos C.horizon.coe_nonneg (κ/2) ((8/κ-1)/2) η + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) (C.paths κ B sample) z + ((C.retarget hz hwv).stopTime κ B sample) + (LoewnerCutoff.extendDriver C.horizon (C.paths κ B sample) + ((C.retarget hz hwv).stopTime κ B sample) / Real.sqrt κ) = _ + rw [C.path_eq κ B sample hc ((C.retarget hz hwv).bounds κ B sample),mul_div_cancel_left₀ _ (Real.sqrt_pos.2 hκ.1).ne'] + rfl + +lemma target_difference_le_remainder {Ω : Type*} (hz : z ∈ halfPlane) {w : ℝ} (hwv : w ≤ v) + (η κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (hη : 0 < η) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + C.barrier η κ B sample-C.targetValue hz hwv η κ B sample ≤ + C.targetRemainder η κ B (C.stopTime κ B) sample - + C.targetRemainder η κ B ((C.retarget hz hwv).stopTime κ B) sample := by + let D := C.retarget hz hwv + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + have hm : Continuous (fun t : ℝ => ((C.paths κ B sample,t),B t.toNNReal sample)) := + (continuous_const.prodMk continuous_id).prodMk (hc.comp continuous_real_toNNReal) + have hd := (continuous_drift C.height_pos C.horizon.coe_nonneg hl hb hη + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) z).comp hm + have h2 := (continuous_derivative C.height_pos C.horizon.coe_nonneg hl hb hη + ((2*z.im)*Real.exp (-v)) (Real.sqrt κ) z 2).comp hm + have hid := intervalIntegral.integral_add_adjacent_intervals + (hd.intervalIntegrable (μ := volume) 0 (D.stopTime κ B sample)) + (hd.intervalIntegrable (μ := volume) (D.stopTime κ B sample) (C.stopTime κ B sample)) + have hi2 := intervalIntegral.integral_add_adjacent_intervals + (h2.intervalIntegrable (μ := volume) 0 (D.stopTime κ B sample)) + (h2.intervalIntegrable (μ := volume) (D.stopTime κ B sample) (C.stopTime κ B sample)) + have hn := integral_drift_nonpos_from C.height_pos C.horizon.coe_nonneg hκ hη + ((2*z.im)*Real.exp (-v)) C.horizon_pos (C.paths κ B sample) z C.angle + (fun t => B t.toNNReal sample) (hc.comp continuous_real_toNNReal) + (C.path_eq κ B sample hc) (D.bounds κ B sample).1 (C.retarget_stop_le hz hwv κ B sample) + dsimp only [Function.comp_def] at hid hi2 + unfold targetRemainder targetValue targetField targetDrift barrier + dsimp only [D, stopTime] at hid hi2 hn ⊢ + linarith only [hn,hid,hi2] + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.AngularBarrier + +lemma value_decay_from {l b t₀ : ℝ} (hl : 0 < l) (hb : 0 < b) (ht₀ : 0 < t₀) : + ∃ K : ℝ, 0 < K ∧ ∀ t q : ℝ, t₀ ≤ t → 0 ≤ q → + value l b t q ≤ K*Real.exp (-(l*b/2)*t)*q^b := by + let c := (1-Real.exp (-l*t₀))/(2*(b+1)) + have hc : 0 < c := div_pos (sub_pos.2 (Real.exp_lt_one_iff.2 (by nlinarith))) (by positivity) + have hg : 0 < Real.Gamma b := Real.Gamma_pos_of_pos hb + refine ⟨1/(b*Real.Gamma b*c^b), by positivity, ?_⟩ + intro t q ht hq + have ht0 : 0 < t := ht₀.trans_le ht + have ha := scale_pos hl hb ht0 + have hlower : c*Real.exp (l*t) ≤ scale l b t := by + have hh : 1 ≤ Real.exp (l*t)*Real.exp (-l*t₀) := by + rw [← Real.exp_add] + exact Real.one_le_exp_iff.2 (by nlinarith) + dsimp only [c,scale] + apply (le_div_iff₀ (by positivity : 0 < 2*(b+1))).2 + have heq : ((1-Real.exp (-l*t₀))/(2*(b+1))*Real.exp (l*t))*(2*(b+1)) = + (1-Real.exp (-l*t₀))*Real.exp (l*t) := by field_simp + rw [heq] + nlinarith + have hratio : q/scale l b t ≤ q/(c*Real.exp (l*t)) := + div_le_div_of_nonneg_left hq (mul_pos hc (Real.exp_pos _)) hlower + have hpow := Real.rpow_le_rpow (div_nonneg hq ha.le) hratio hb.le + have hbound := (cdf_le_power hb (div_nonneg hq ha.le)).trans + (div_le_div_of_nonneg_right hpow (mul_pos hb hg).le) + have he : Real.exp (l*b/2*t)*(q/(c*Real.exp (l*t)))^b/(b*Real.Gamma b) = + 1/(b*Real.Gamma b*c^b)*Real.exp (-(l*b/2)*t)*q^b := by + rw [Real.div_rpow hq (mul_pos hc (Real.exp_pos _)).le, + Real.mul_rpow hc.le (Real.exp_pos _).le, ← Real.exp_mul] + have hratioexp : Real.exp (l*b/2*t)/Real.exp (l*t*b) = Real.exp (-(l*b/2)*t) := by + rw [← Real.exp_sub]; congr 1; ring + calc + _ = (Real.exp (l*b/2*t)/Real.exp (l*t*b))*q^b/(b*Real.Gamma b*c^b) := by ring + _ = _ := by rw [hratioexp]; ring + calc + _ ≤ Real.exp (l*b/2*t)*((q/(c*Real.exp (l*t)))^b/(b*Real.Gamma b)) := + mul_le_mul_of_nonneg_left hbound (Real.exp_pos _).le + _ = _ := by rw [← mul_div_assoc, he] + +end SLEExactGauge.AngularBarrier + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteTilt AngularBarrier + +theorem radiusApproachBoundFrom (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (u₀ : ℝ) (hu₀ : 0 < u₀) : + ∃ C : ℝ, 0 < C ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (u : ℝ) (_hu : u₀ ≤ u), + P {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (C * Real.exp (-codimension κ * u) * + (z.im / ‖z‖) ^ (8 / κ - 1)) := by + have hl : 0 < κ/2 := div_pos hκ.1 (by norm_num) + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + obtain ⟨C,hC,hdec⟩ := value_decay_from hl hb hu₀ + refine ⟨C,hC,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz u hu + have hu0 : 0 < u := hu₀.trans_le hu + apply (radiusApproachProfile κ hκ B hB γ g f hmaps z hz u hu0).trans + apply ENNReal.ofReal_le_ofReal + have hp : (κ/2)*((8/κ-1)/2)/2 = codimension κ := by + unfold codimension dimension + field_simp [hκ.1.ne'] + ring + have hq : (squaredSine (z.re/z.im))^((8/κ-1)/2) = (z.im/‖z‖)^(8/κ-1) := by + rw [squaredSine_initial hz, ← Real.rpow_natCast (z.im/‖z‖) 2, + ← Real.rpow_mul (initial_sine_pos hz).le] + congr 1 + ring + have hh := hdec u (squaredSine (z.re/z.im)) hu (squaredSine_pos _).le + simpa only [profile,hp,hq] using hh + +def finiteCenteredMeasure {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (P : Measure Ω) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) : Measure Ω := + P.withDensity (fun sample => + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u / + ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))) + +def radiusStoppedInverseAngle {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) (sample : Ω) : ℝ≥0∞ := + let τ := firstLiveRadiusStop (γ sample) (g sample) z u + if τ = (⊤ : ℝ≥0∞) then 1 else ENNReal.ofReal + ((loewnerAngleSine κ (fun t => B t sample) (g sample) τ.toReal z)^(-(8/κ-1))) + +lemma finiteStoppedDensity_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 < u) : + AEMeasurable (fun sample => finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u) P := by + let C := cutoffs hz u hu.le + let F := fun n sample => ENNReal.ofReal ((C n).value κ B sample) + have hexp (n : ℕ) := (C n).expectation hB κ hκ hz hu.le + have hFm (n : ℕ) : AEMeasurable (F n) P := + ENNReal.measurable_ofReal.comp_aemeasurable (hexp n).1.aemeasurable + have hFl : ∀ᵐ sample ∂P, Tendsto (fun n => F n sample) atTop + (𝓝 (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u)) := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb + exact tendsto_value_killed κ B sample hm hz hu hc hb hκ + exact aemeasurable_of_tendsto_metrizable_ae' hFm hFl + +lemma finiteStoppedDensity_lt_top (κ : ℝ) (B : ℝ≥0 → ℝ) (γ : ℝ → ℂ) + (g : ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) : finiteStoppedDensity κ B γ g z u < (⊤ : ℝ≥0∞) := by + dsimp only [finiteStoppedDensity] + split_ifs <;> simp + +lemma localizationInitialGreen_pos (κ : ℝ) {z : ℂ} (hz : z ∈ halfPlane) : + 0 < (2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1) := by + have hy : 0 < z.im := hz + exact mul_pos (Real.rpow_pos_of_pos (by positivity) _) (Real.rpow_pos_of_pos (initial_sine_pos hz) _) + +lemma finiteCenteredMeasure_probability {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 < u) : + IsProbabilityMeasure (finiteCenteredMeasure κ P B γ g z u) := by + have hm0 : ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) ≠ 0 := + (ENNReal.ofReal_pos.2 (localizationInitialGreen_pos κ hz)).ne' + constructor + rw [finiteCenteredMeasure, withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] + simp_rw [ENNReal.div_eq_inv_mul] + rw [lintegral_const_mul' _ _ (ENNReal.inv_ne_top.2 hm0), + finiteStoppedCenteredLaw κ hκ B hB γ g f hγ hmaps z hz u hu.le, + ENNReal.inv_mul_cancel hm0 ENNReal.ofReal_ne_top] + +lemma finiteStoppedDensity_mul_inverseAngle {Ω : Type*} (κ : ℝ) + (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (sample : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) + (γ sample) (g sample) (f sample)) + (hc : Continuous (fun t => B t sample)) : + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u * + radiusStoppedInverseAngle κ B γ g z u sample = + {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)}.indicator + (fun _ => ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-codimension κ))) sample := by + classical + by_cases hhit : firstLiveRadiusStop (γ sample) (g sample) z u = (⊤ : ℝ≥0∞) + · simp [finiteStoppedDensity,radiusStoppedInverseAngle,hhit] + have hex : ∃ t : ℝ≥0, z ∈ localizationDomain (γ sample) t ∧ + loewnerRadius (g sample) t z = (2*z.im)*Real.exp (-u) := by + by_contra hn + have he : {t : ℝ≥0 | z ∈ localizationDomain (γ sample) t ∧ + loewnerRadius (g sample) t z = (2*z.im)*Real.exp (-u)} = ∅ := + Set.eq_empty_iff_forall_notMem.2 (fun t ht => hn ⟨t,ht⟩) + exact hhit (by simp only [firstLiveRadiusStop,he,Set.image_empty,sInf_empty]) + obtain ⟨t,hzt,hrt⟩ := hex + have htau := hm.firstLiveRadiusStop_eq ((continuous_const.mul + (hc.comp continuous_real_toNNReal)).continuousOn) hzt hrt + have hs : 0 < loewnerAngleSine κ (fun t => B t sample) (g sample) t z := by + have hh := div_pos (hm.im_pos t.coe_nonneg hzt) (norm_pos_iff.2 (hm.centered_ne_zero t.coe_nonneg hzt)) + simpa only [loewnerAngleSine, Complex.ofReal_mul] using hh + have hr : 0 < ((2*z.im)*Real.exp (-u))^(-codimension κ) := by + apply Real.rpow_pos_of_pos + have hy : 0 < z.im := hz + positivity + simp only [finiteStoppedDensity,radiusStoppedInverseAngle,htau,ENNReal.coe_ne_top, + ite_false,ENNReal.coe_toReal,hrt,Set.mem_ofPred_eq,Ne,not_false_eq_true, + Set.indicator_of_mem] + rw [← ENNReal.ofReal_mul (mul_pos hr (Real.rpow_pos_of_pos hs _)).le, + mul_assoc, ← Real.rpow_add hs, add_neg_cancel, Real.rpow_zero,mul_one] + +lemma radius_green_cancel (κ u : ℝ) {z : ℂ} (hz : z ∈ halfPlane) : + (((2*z.im)*Real.exp (-u))^(-codimension κ) / + ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))) * + (Real.exp (-codimension κ*u)*(z.im/‖z‖)^(8/κ-1)) = 1 := by + have hy : 0 < 2*z.im := by have : 0 < z.im := hz; positivity + have hs := Real.rpow_pos_of_pos (initial_sine_pos hz) (8/κ-1) + have hp := Real.rpow_pos_of_pos hy (-codimension κ) + rw [Real.mul_rpow hy.le (Real.exp_pos _).le, ← Real.exp_mul] + have he : Real.exp (-u * -codimension κ) * Real.exp (-codimension κ*u) = 1 := by + rw [← Real.exp_add, show -u * -codimension κ + -codimension κ*u = 0 by ring, Real.exp_zero] + field_simp + convert he using 1 + congr 2 <;> ring + +theorem finiteCenteredInverseAngleBound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (u₀ : ℝ) (hu₀ : 0 < u₀) : + ∃ C : ℝ, 0 < C ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (_hz : z ∈ halfPlane) (u : ℝ) (_hu : u₀ ≤ u), + IsProbabilityMeasure (finiteCenteredMeasure κ P B γ g z u) ∧ + (∫⁻ sample, radiusStoppedInverseAngle κ B γ g z u sample + ∂finiteCenteredMeasure κ P B γ g z u) ≤ ENNReal.ofReal C := by + obtain ⟨C,hC,hbound⟩ := radiusApproachBoundFrom κ hκ u₀ hu₀ + refine ⟨C,hC,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz u hu + have hu0 : 0 < u := hu₀.trans_le hu + refine ⟨finiteCenteredMeasure_probability κ hκ P B hB γ g f hγ hmaps z hz u hu0, ?_⟩ + let M₀ := ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) + let K := ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-codimension κ)) / M₀ + let H : Set Ω := {sample | firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞)} + have hmpos := localizationInitialGreen_pos κ hz + have hm0 : M₀ ≠ 0 := (ENNReal.ofReal_pos.2 hmpos).ne' + have hd := finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz u hu0 + have hdm : AEMeasurable (fun sample => finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u / M₀) P := hd.div_const M₀ + have hdf : ∀ᵐ sample ∂P, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u / M₀ < (⊤ : ℝ≥0∞) := Filter.Eventually.of_forall + (fun sample => ENNReal.div_lt_top (finiteStoppedDensity_lt_top κ _ _ _ z u).ne hm0) + have he : (fun sample => (finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u / M₀) * radiusStoppedInverseAngle κ B γ g z u sample) =ᵐ[P] + H.indicator (fun _ => K) := by + filter_upwards [hmaps,hB.cont] with sample hm hc + have hh := finiteStoppedDensity_mul_inverseAngle κ B γ g f z hz u sample hm hc + rw [show (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u / M₀) * + radiusStoppedInverseAngle κ B γ g z u sample = (finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u * radiusStoppedInverseAngle κ B γ g z u sample) / M₀ by + simp only [div_eq_mul_inv]; ac_rfl, hh] + classical + by_cases hhit : sample ∈ H + · simp only [H] at hhit + simp only [H, Set.indicator_of_mem hhit, K] + · simp only [H] at hhit + simp only [H, Set.indicator_of_notMem hhit, ENNReal.zero_div] + change (∫⁻ sample, radiusStoppedInverseAngle κ B γ g z u sample ∂P.withDensity + (fun sample => finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u / M₀)) ≤ _ + rw [lintegral_withDensity_eq_lintegral_mul_non_measurable₀ P hdm hdf] + simp only [Pi.mul_apply] + rw [lintegral_congr_ae he] + calc + (∫⁻ sample, H.indicator (fun _ => K) sample ∂P) ≤ K*P H := lintegral_indicator_const_le H K + _ ≤ K * ENNReal.ofReal (C * Real.exp (-codimension κ*u)*(z.im/‖z‖)^(8/κ-1)) := + mul_le_mul' le_rfl (hbound P B hB γ g f hγ hmaps z hz u hu) + _ = ENNReal.ofReal C := by + dsimp only [K,M₀] + have hy : 0 < z.im := hz + have hratio : 0 ≤ ((2*z.im)*Real.exp (-u))^(-codimension κ) / + ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) := + div_nonneg (Real.rpow_nonneg (by positivity) _) hmpos.le + rw [← ENNReal.ofReal_div_of_pos hmpos, ← ENNReal.ofReal_mul hratio] + congr 1 + calc + _ = C * (((2*z.im)*Real.exp (-u))^(-codimension κ) / + ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) * + (Real.exp (-codimension κ*u)*(z.im/‖z‖)^(8/κ-1))) := by ring + _ = C := by rw [radius_green_cancel κ u hz,mul_one] + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.GammaField +open LoewnerCutoff LoewnerField LoewnerExit AngularBarrier GreenPhysical + +lemma profile_green_bound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ K : ℝ, 0 < K ∧ ∀ x y l t ρ : ℝ, 0 < y → 0 < ρ → 1 ≤ t → + Real.log (2*y)-l-Real.log ρ ≤ t → + profile (κ/2) ((8/κ-1)/2) t (x/y) ≤ + K*ρ^(codimension κ)*green (1-κ/8) (8/κ-1) x y l := by + have hl : 0 < κ/2 := by linarith [hκ.1] + have hb : 0 < (8/κ-1)/2 := by + have hh : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by simpa using hκ.2) + linarith + obtain ⟨K,hK,hdec⟩ := value_decay_from hl hb (by norm_num : (0:ℝ)<1) + refine ⟨K,hK,?_⟩ + intro x y l t ρ hy hρ ht hr + have hp : (κ/2)*((8/κ-1)/2)/2 = codimension κ := by + unfold codimension dimension + field_simp [hκ.1.ne'] + ring + have hp' : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + have hp0 : 0 ≤ codimension κ := by rw [hp']; linarith [hκ.2] + have hs : 0 < Real.sqrt (x^2+y^2) := Real.sqrt_pos.2 (by positivity) + have hq0 : squaredSine (x/y) = (y/Real.sqrt (x^2+y^2))^2 := by + have hsq := Real.sq_sqrt (by positivity : 0 ≤ x^2+y^2) + unfold squaredSine + field_simp + nlinarith + have hq : (squaredSine (x/y))^((8/κ-1)/2) = (y/Real.sqrt (x^2+y^2))^(8/κ-1) := by + rw [hq0, ← Real.rpow_natCast (y/Real.sqrt (x^2+y^2)) 2, + ← Real.rpow_mul (div_pos hy hs).le] + congr 1 + ring + have he : Real.exp (-(codimension κ)*t) ≤ + ρ^(codimension κ)*(2*y/Real.exp l)^(-(1-κ/8)) := by + rw [Real.rpow_def_of_pos hρ,Real.rpow_def_of_pos (div_pos (by positivity) (Real.exp_pos _)), + ← Real.exp_add] + apply Real.exp_le_exp.2 + rw [Real.log_div (by positivity) (Real.exp_ne_zero _),Real.log_exp,← hp'] + nlinarith [mul_le_mul_of_nonneg_left hr hp0] + have hh := hdec t (squaredSine (x/y)) ht (squaredSine_pos _).le + rw [hp,hq] at hh + calc + _ ≤ K*Real.exp (-(codimension κ)*t)*(y/Real.sqrt (x^2+y^2))^(8/κ-1) := hh + _ ≤ K*(ρ^(codimension κ)*(2*y/Real.exp l)^(-(1-κ/8)))*(y/Real.sqrt (x^2+y^2))^(8/κ-1) := + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left he hK.le) (Real.rpow_nonneg (div_pos hy hs).le _) + _ = _ := by rw [green_eq_source _ _ _ _ _ hy]; ring + +end SLEExactGauge.GammaField + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit GammaField + +lemma height_radius_at_stop {z : ℂ} {u : ℝ} (C : Cutoff z u) (hz : z ∈ halfPlane) + (hu : 0 ≤ u) {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) : + C.height ≤ (position C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z (C.stopTime κ B sample)).im ∧ + (2*z.im)*Real.exp (-u) ≤ radius C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z (C.stopTime κ B sample) := by + rcases eq_or_lt_of_le hu with rfl | hu' + · rw [C.stopTime_zero,position_initial] + constructor + · exact (C.height_initial hz le_rfl).le + · simp only [radius,position_initial,logDerivative_initial,neg_zero,Real.exp_zero,mul_one,div_one,le_refl] + · have hd := (deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle + (C.initial_deficit_brownian κ B sample hz hu' hc hb0) ⟨(C.bounds κ B sample).1,le_rfl⟩) + exact ⟨hd.2.1,hd.1⟩ + +lemma targetValue_bound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ K : ℝ, 0 < K ∧ ∀ {z : ℂ} (hz : z ∈ halfPlane) {u v : ℝ} + (_hu : 0 ≤ u) (huv : u+1 ≤ v) (C : Cutoff z v) {Ω : Type*} + (B : ℝ≥0 → Ω → ℝ) (sample : Ω) (η : ℝ), 0 < η → + Continuous (fun t => B t sample) → B 0 sample = 0 → + C.targetValue hz (by linarith : u ≤ v) η κ B sample ≤ + K*((2*z.im)*Real.exp (-v))^(codimension κ) * + (C.retarget hz (by linarith : u ≤ v)).value κ B sample := by + obtain ⟨K,hK,hbound⟩ := profile_green_bound κ hκ + refine ⟨K,hK,?_⟩ + intro z hz u v hu huv C Ω B sample η hη hc hb0 + let D := C.retarget hz (by linarith : u ≤ v) + let τ := D.stopTime κ B sample + let U := C.paths κ B sample + have hd := D.height_radius_at_stop hz hu κ B sample hc hb0 + have hy : C.height ≤ (position C.height_pos C.horizon.coe_nonneg U z τ).im := hd.1 + have hR : (2*z.im)*Real.exp (-u) ≤ radius C.height_pos C.horizon.coe_nonneg U z τ := hd.2 + have hz0 : 0 < z.im := hz + have hρu : 0 < (2*z.im)*Real.exp (-u) := by positivity + have hρv : 0 < (2*z.im)*Real.exp (-v) := by positivity + have hlog := Real.log_le_log hρu hR + have hlρ (w : ℝ) : Real.log ((2*z.im)*Real.exp (-w)) = Real.log (2*z.im)-w := by + rw [Real.log_mul (by positivity) (Real.exp_ne_zero _),Real.log_exp]; ring + have hr0 := le_max_right η (rawRemaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-v)) U z τ) + change rawRemaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-v)) U z τ ≤ + remaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-v)) U z τ at hr0 + have hr1 : 1 ≤ remaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-v)) U z τ := by + rw [rawRemaining_eq C.height_pos C.horizon.coe_nonneg _ _ _ _ _ hy,hlρ] at hr0 + rw [hlρ] at hlog + exact le_trans (by linarith : 1 ≤ η+Real.log (radius C.height_pos C.horizon.coe_nonneg U z τ)-(Real.log (2*z.im)-v)) hr0 + have hr2 : Real.log (2*LoewnerField.height C.height_pos C.horizon.coe_nonneg U z τ)- + logDerivative C.height_pos C.horizon.coe_nonneg U z τ-Real.log ((2*z.im)*Real.exp (-v)) ≤ + remaining C.height_pos C.horizon.coe_nonneg η ((2*z.im)*Real.exp (-v)) U z τ := by + unfold rawRemaining at hr0 + linarith + exact hbound _ _ _ _ _ (LoewnerField.height_pos _ _ _ _ _) hρv hr1 hr2 + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/ConformalKernels.lean b/lean/OAI/Probability/SLELocalization/ConformalKernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca3650d3fcbd4f2a2a5c0d776fcbd018beb2277f --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/ConformalKernels.lean @@ -0,0 +1,973 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Layer estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology RealInnerProductSpace +namespace SLEExactGauge.Layer + +lemma logFactor_laplacian {z : ℂ} (hz : ‖z‖ < 1) : + Laplacian.laplacian (fun z => Real.log (diskFactor z)) z = -4/(diskFactor z)^2 := by + have ha := diskFactor_pos hz + have hl : ContDiffAt ℝ 2 Real.log (diskFactor z) := Real.contDiffAt_log.mpr (ne_of_gt ha) + have hh := laplacian_scalar_comp diskFactor_smooth.contDiffAt hl + have hlogd : deriv Real.log = fun t => t⁻¹ := funext Real.deriv_log + rw [diskFactor_laplacian,(diskFactor_gradient z).1,(diskFactor_gradient z).2, + hlogd] at hh + have he : deriv (fun t : ℝ => t⁻¹) (diskFactor z) = -((diskFactor z)^2)⁻¹ := by + simp + rw [he] at hh + change Laplacian.laplacian (fun z => Real.log (diskFactor z)) z = _ at hh + rw [hh] + have hn : ‖z‖^2 = z.re^2+z.im^2 := by rw [Complex.sq_norm,Complex.normSq_apply]; ring + dsimp [diskFactor] at ha ⊢ + rw [hn] at ha ⊢ + field_simp [ne_of_gt ha] + ring + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology RealInnerProductSpace +namespace SLEExactGauge.Layer + +lemma logNorm_fderiv {H : ℂ → ℂ} {z D : ℂ} (hd : HasDerivAt H D z) + (hn : H z ≠ 0) (v : ℂ) : + fderiv ℝ (fun w => Real.log ‖H w‖) z v = (D*v/H z).re := by + have hn2 : ‖H z‖^2 ≠ 0 := pow_ne_zero 2 (norm_ne_zero_iff.2 hn) + have hh := ((hd.hasFDerivAt.restrictScalars ℝ).norm_sq.log hn2).const_smul (1/2:ℝ) + have he : (fun w => (1/2:ℝ) • Real.log (‖H w‖^2)) = (fun w => Real.log ‖H w‖) := by + funext w + rw [Real.log_pow] + simp only [smul_eq_mul] + ring + change HasFDerivAt (fun w => (1/2:ℝ) • Real.log (‖H w‖^2)) _ z at hh + rw [he] at hh + rw [hh.fderiv] + simp only [smul_apply,smul_eq_mul,two_smul] + change 1/2*((‖H z‖^2)⁻¹*(inner ℝ (H z) (v*D)+inner ℝ (H z) (v*D))) = (D*v/H z).re + rw [Complex.inner,Complex.div_re] + have heq : Complex.normSq (H z) = ‖H z‖^2 := (Complex.sq_norm _).symm + rw [heq] + simp only [Complex.mul_re,Complex.mul_im,Complex.conj_re,Complex.conj_im] + field_simp + ring + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric Function +open scoped Topology +namespace SLEExactGauge.Layer + +structure DiskPair (U : Set ℂ) (F G : ℂ → ℂ) : Prop where + isOpen : IsOpen U + toDomain : MapsTo F (ball 0 1) U + toDisk : MapsTo G U (ball 0 1) + left_inv : ∀ z ∈ ball (0:ℂ) 1, G (F z) = z + right_inv : ∀ z ∈ U, F (G z) = z + forward : DifferentiableOn ℂ F (ball 0 1) + inverse : DifferentiableOn ℂ G U + +lemma DiskPair.injOn {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) : + InjOn F (ball 0 1) := by + intro z hz w hw he + simpa only [h.left_inv z hz,h.left_inv w hw] using congrArg G he + +lemma DiskPair.inverse_derivative {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) + {z : ℂ} (hz : z ∈ ball (0:ℂ) 1) : deriv G (F z)*deriv F z = 1 := by + have he : (G ∘ F) =ᶠ[𝓝 z] id := by + filter_upwards [isOpen_ball.mem_nhds hz] with w hw + exact h.left_inv w hw + exact (((h.inverse.differentiableAt (h.isOpen.mem_nhds (h.toDomain hz))).hasDerivAt.comp z + (h.forward.differentiableAt (isOpen_ball.mem_nhds hz)).hasDerivAt).congr_of_eventuallyEq he.symm).unique + (hasDerivAt_id z) + +lemma DiskPair.deriv_ne_zero {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) + {z : ℂ} (hz : z ∈ ball (0:ℂ) 1) : deriv F z ≠ 0 := by + intro he + simpa [he] using h.inverse_derivative hz + +lemma DiskPair.second_derivative_zero {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) : + ‖deriv (deriv F) 0‖ ≤ (2*(512*Real.pi)^2)*‖deriv F 0‖ := by + have hzero : (0:ℂ) ∈ ball 0 1 := mem_ball_self zero_lt_one + have hA : 0 < ‖deriv F 0‖ := norm_pos_iff.2 (h.deriv_ne_zero hzero) + let R : ℝ := ‖deriv F 0‖/(512*Real.pi) + have hR : 0 < R := div_pos hA (by positivity) + have hsub : closedBall (F 0) R ⊆ U := by + intro w hw + by_contra hwu + have hwi : w ∉ F '' ball 0 1 := by + rintro ⟨z,hz,rfl⟩ + exact hwu (h.toDomain hz) + have hh := UnivalentDistance.omitted_value_bound h.forward h.injOn hwi + have hnorm : ‖F 0-w‖ ≤ R := by + rw [norm_sub_rev,← dist_eq_norm] + exact mem_closedBall.1 hw + have hbound := hh.trans (mul_le_mul_of_nonneg_left hnorm (by positivity : 0 ≤ 256*Real.pi)) + have he : (256*Real.pi)*R = ‖deriv F 0‖/2 := by + dsimp [R]; field_simp; ring + rw [he] at hbound + linarith + have hb : ‖deriv (deriv G) (F 0)‖ ≤ 2/R^2 := by + have hh := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le 2 hR + ((h.inverse.mono hsub).diffContOnCl_ball Subset.rfl) + (fun z hz => (mem_ball_zero_iff.1 (h.toDisk (hsub (sphere_subset_closedBall hz)))).le) + simpa [iteratedDeriv_succ,iteratedDeriv_zero] using hh + have hFd := h.forward.differentiableAt (isOpen_ball.mem_nhds hzero) + have hFdd := (h.forward.deriv isOpen_ball).differentiableAt (isOpen_ball.mem_nhds hzero) + have hGdd := (h.inverse.deriv h.isOpen).differentiableAt (h.isOpen.mem_nhds (h.toDomain hzero)) + have he : (fun z => deriv G (F z)*deriv F z) =ᶠ[𝓝 (0:ℂ)] fun _ => 1 := by + filter_upwards [isOpen_ball.mem_nhds hzero] with z hz + exact h.inverse_derivative hz + have hh := (((hGdd.hasDerivAt.comp 0 hFd.hasDerivAt).mul hFdd.hasDerivAt).congr_of_eventuallyEq + he.symm).unique (hasDerivAt_const (0:ℂ) (1:ℂ)) + simp only [Function.comp_apply] at hh + have hh0 := h.inverse_derivative hzero + have hrel : deriv (deriv F) 0 = -deriv (deriv G) (F 0)*(deriv F 0)^3 := by + linear_combination (deriv F 0)*hh - (deriv (deriv F) 0)*hh0 + rw [hrel,norm_mul,norm_neg,norm_pow] + calc + _ ≤ (2/R^2)*‖deriv F 0‖^3 := mul_le_mul_of_nonneg_right hb (by positivity) + _ = (2*(512*Real.pi)^2)*‖deriv F 0‖ := by + dsimp [R] + field_simp + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.SlitMaps + +def diskAuto (c z : ℂ) : ℂ := (z-c)/(1-starRingEnd ℂ c*z) + +lemma diskAuto_den_ne {c z : ℂ} (hc : ‖c‖ < 1) (hz : ‖z‖ < 1) : + 1-starRingEnd ℂ c*z ≠ 0 := by + have hn : ‖starRingEnd ℂ c*z‖ < 1 := by + rw [norm_mul, Complex.norm_conj] + calc + ‖c‖*‖z‖ ≤ ‖c‖*1 := mul_le_mul_of_nonneg_left hz.le (norm_nonneg _) + _ < 1 := by simpa using hc + intro he + have hh : starRingEnd ℂ c*z = 1 := (sub_eq_zero.1 he).symm + simp [hh] at hn + +lemma disk_norm_identity (c z : ℂ) : + ‖1-starRingEnd ℂ c*z‖^2-‖z-c‖^2 = (1-‖c‖^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 + +lemma diskAuto_mapsTo {c : ℂ} (hc : ‖c‖ < 1) : MapsTo (diskAuto c) (ball 0 1) (ball 0 1) := by + intro z hz + rw [mem_ball_zero_iff] at hz ⊢ + have hn := diskAuto_den_ne hc hz + rw [diskAuto,norm_div,div_lt_one₀ (norm_pos_iff.2 hn)] + have hp : 0 < (1-‖c‖^2)*(1-‖z‖^2) := mul_pos (by nlinarith [norm_nonneg c]) (by nlinarith [norm_nonneg z]) + have he := disk_norm_identity c z + nlinarith [norm_nonneg (z-c), norm_nonneg (1-starRingEnd ℂ c*z)] + +lemma diskAuto_hasDerivAt {c z : ℂ} (hc : ‖c‖ < 1) (hz : ‖z‖ < 1) : + HasDerivAt (diskAuto c) ((1-starRingEnd ℂ c*c)/(1-starRingEnd ℂ c*z)^2) z := by + have hd := ((hasDerivAt_id z).sub_const c).div + ((hasDerivAt_const z (1:ℂ)).sub ((hasDerivAt_id z).const_mul (starRingEnd ℂ c))) + (diskAuto_den_ne hc hz) + change HasDerivAt (diskAuto c) + ((1*(1-starRingEnd ℂ c*z)-(z-c)*(0-starRingEnd ℂ c*1))/(1-starRingEnd ℂ c*z)^2) z at hd + have he : 1*(1-starRingEnd ℂ c*z)-(z-c)*(0-starRingEnd ℂ c*1) = 1-starRingEnd ℂ c*c := by ring + rwa [he] at hd + +lemma diskAuto_deriv {c z : ℂ} (hc : ‖c‖ < 1) (hz : ‖z‖ < 1) : + deriv (diskAuto c) z = (1-starRingEnd ℂ c*c)/(1-starRingEnd ℂ c*z)^2 := + (diskAuto_hasDerivAt hc hz).deriv + +lemma diskAuto_deriv_ne {c z : ℂ} (hc : ‖c‖ < 1) (hz : ‖z‖ < 1) : + deriv (diskAuto c) z ≠ 0 := by + rw [diskAuto_deriv hc hz] + exact div_ne_zero (diskAuto_den_ne hc hc) (pow_ne_zero _ (diskAuto_den_ne hc hz)) + +lemma diskAuto_injOn {c : ℂ} (hc : ‖c‖ < 1) : InjOn (diskAuto c) (ball 0 1) := by + intro z hz w hw he + have hzn := diskAuto_den_ne hc (mem_ball_zero_iff.1 hz) + have hwn := diskAuto_den_ne hc (mem_ball_zero_iff.1 hw) + have he' := (div_eq_div_iff hzn hwn).1 he + have hn := diskAuto_den_ne hc hc + have hh : (z-w)*(1-starRingEnd ℂ c*c) = 0 := by linear_combination he' + exact sub_eq_zero.1 ((mul_eq_zero.1 hh).resolve_right hn) + +@[simp] lemma diskAuto_self (c : ℂ) : diskAuto c c = 0 := by simp [diskAuto] + +@[simp] lemma diskAuto_zero (c : ℂ) : diskAuto c 0 = -c := by simp [diskAuto] + +lemma diskAuto_norm_deriv_zero {c : ℂ} (hc : ‖c‖ < 1) : + ‖deriv (diskAuto c) 0‖ = 1-‖c‖^2 := by + rw [diskAuto_deriv hc (by simp)] + simp only [mul_zero,sub_zero,one_pow,div_one] + rw [mul_comm (starRingEnd ℂ c),Complex.mul_conj'] + have he : (1:ℂ)-(‖c‖:ℂ)^2 = ((1-‖c‖^2:ℝ):ℂ) := by push_cast; rfl + rw [he,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (by nlinarith [norm_nonneg c])] + +lemma diskAuto_norm_deriv_self {c : ℂ} (hc : ‖c‖ < 1) : + ‖deriv (diskAuto c) c‖ = 1/(1-‖c‖^2) := by + have hh : (1-starRingEnd ℂ c*c)/(1-starRingEnd ℂ c*c)^2 = (1-starRingEnd ℂ c*c)⁻¹ := by + field_simp [diskAuto_den_ne hc hc] + rw [diskAuto_deriv hc hc,hh] + rw [norm_inv] + have he : ‖1-starRingEnd ℂ c*c‖ = 1-‖c‖^2 := by + have hh := diskAuto_norm_deriv_zero hc + rw [diskAuto_deriv hc (by simp)] at hh + simpa using hh + simp [he,one_div] + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Set Filter Metric Function +open scoped Topology +namespace SLEExactGauge.Layer +open SlitMaps + +lemma diskAuto_neg_inverse {c z : ℂ} (hc : ‖c‖ < 1) (hz : ‖z‖ < 1) : + diskAuto c (diskAuto (-c) z) = z := by + have hnc : ‖-c‖ < 1 := by simpa using hc + have hφ := diskAuto_mapsTo hnc (mem_ball_zero_iff.2 hz) + have hd1 := diskAuto_den_ne hnc hz + have hd2 := diskAuto_den_ne hc (mem_ball_zero_iff.1 hφ) + have ha := diskAuto_den_ne hc hc + dsimp [diskAuto] at hd1 hd2 ⊢ + simp only [map_neg,neg_mul,sub_neg_eq_add] at hd1 hd2 ⊢ + apply (div_eq_iff hd2).2 + have he := div_mul_cancel₀ (z+c) hd1 + linear_combination he + +lemma DiskPair.recenter {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) + {c : ℂ} (hc : ‖c‖ < 1) : + DiskPair U (F ∘ diskAuto (-c)) (diskAuto c ∘ G) := by + have hnc : ‖-c‖ < 1 := by simpa using hc + refine ⟨h.isOpen,h.toDomain.comp (diskAuto_mapsTo hnc),(diskAuto_mapsTo hc).comp h.toDisk,?_,?_,?_,?_⟩ + · intro z hz + dsimp only [Function.comp_apply] + rw [h.left_inv _ (diskAuto_mapsTo hnc hz)] + exact diskAuto_neg_inverse hc (mem_ball_zero_iff.1 hz) + · intro z hz + dsimp only [Function.comp_apply] + have he := diskAuto_neg_inverse hnc (mem_ball_zero_iff.1 (h.toDisk hz)) + simp only [neg_neg] at he + rw [he,h.right_inv z hz] + · exact h.forward.comp (fun z hz => (diskAuto_hasDerivAt hnc (mem_ball_zero_iff.1 hz)).differentiableAt.differentiableWithinAt) + (diskAuto_mapsTo hnc) + · have ha : DifferentiableOn ℂ (diskAuto c) (ball 0 1) := fun z hz => + (diskAuto_hasDerivAt hc (mem_ball_zero_iff.1 hz)).differentiableAt.differentiableWithinAt + exact ha.comp h.inverse h.toDisk + +lemma diskAuto_deriv_zero_exact {c : ℂ} (hc : ‖c‖ < 1) : + deriv (diskAuto (-c)) 0 = 1-(starRingEnd ℂ c)*c := by + rw [diskAuto_deriv (by simpa using hc) (by simp)] + simp + +lemma diskAuto_second_zero {c : ℂ} (hc : ‖c‖ < 1) : + deriv (deriv (diskAuto (-c))) 0 = -2*(starRingEnd ℂ c)*(1-(starRingEnd ℂ c)*c) := by + have hnc : ‖-c‖ < 1 := by simpa using hc + have he : deriv (diskAuto (-c)) =ᶠ[𝓝 (0:ℂ)] + fun z => (1-(starRingEnd ℂ c)*c)/(1+(starRingEnd ℂ c)*z)^2 := by + filter_upwards [Metric.ball_mem_nhds (0:ℂ) zero_lt_one] with z hz + rw [diskAuto_deriv hnc (mem_ball_zero_iff.1 hz)] + simp + rw [he.deriv_eq] + have hd := (hasDerivAt_const (0:ℂ) (1-(starRingEnd ℂ c)*c)).div + ((((hasDerivAt_id (0:ℂ)).const_mul (starRingEnd ℂ c)).const_add 1).pow 2) (by simp) + have hh := hd.deriv + dsimp only [Pi.div_apply,Pi.pow_apply,id_eq] at hh + change deriv ((fun x : ℂ => 1-(starRingEnd ℂ c)*c) / (fun x : ℂ => 1+(starRingEnd ℂ c)*x)^2) 0 = _ + rw [hh] + simp only [mul_zero,add_zero,one_pow,zero_sub,div_one,mul_one] + norm_num + ring + +lemma DiskPair.preSchwarzian {U : Set ℂ} {F G : ℂ → ℂ} (h : DiskPair U F G) + {c : ℂ} (hc : ‖c‖ < 1) : + ‖((1-‖c‖^2:ℝ):ℂ)*deriv (deriv F) c - 2*(starRingEnd ℂ c)*deriv F c‖ ≤ + (2*(512*Real.pi)^2)*‖deriv F c‖ := by + let φ := diskAuto (-c) + let A : ℂ := 1-(starRingEnd ℂ c)*c + have hnc : ‖-c‖ < 1 := by simpa using hc + have hcD : c ∈ ball (0:ℂ) 1 := mem_ball_zero_iff.2 hc + have hφ0 : φ 0 = c := by simp [φ] + have hdφ : deriv φ 0 = A := diskAuto_deriv_zero_exact hc + have hddφ : deriv (deriv φ) 0 = -2*(starRingEnd ℂ c)*A := diskAuto_second_zero hc + have hφd : DifferentiableOn ℂ φ (ball 0 1) := fun z hz => + (diskAuto_hasDerivAt hnc (mem_ball_zero_iff.1 hz)).differentiableAt.differentiableWithinAt + have hFd := h.forward.differentiableAt (isOpen_ball.mem_nhds hcD) + have hFdd := (h.forward.deriv isOpen_ball).differentiableAt (isOpen_ball.mem_nhds hcD) + have hφd0 := hφd.differentiableAt (isOpen_ball.mem_nhds (mem_ball_self zero_lt_one)) + have hφdd0 := (hφd.deriv isOpen_ball).differentiableAt (isOpen_ball.mem_nhds (mem_ball_self zero_lt_one)) + have hd : deriv (F ∘ φ) 0 = deriv F c*A := by + have hFd' : HasDerivAt F (deriv F c) (φ 0) := hφ0.symm ▸ hFd.hasDerivAt + have hh := hFd'.comp (0:ℂ) hφd0.hasDerivAt + simpa only [hdφ] using hh.deriv + have he : deriv (F ∘ φ) =ᶠ[𝓝 (0:ℂ)] fun z => deriv F (φ z)*deriv φ z := by + filter_upwards [Metric.ball_mem_nhds (0:ℂ) zero_lt_one] with z hz + exact ((h.forward.differentiableAt (isOpen_ball.mem_nhds (diskAuto_mapsTo hnc hz))).hasDerivAt.comp z + (hφd.differentiableAt (isOpen_ball.mem_nhds hz)).hasDerivAt).deriv + have hdd : deriv (deriv (F ∘ φ)) 0 = A*(A*deriv (deriv F) c-2*(starRingEnd ℂ c)*deriv F c) := by + rw [he.deriv_eq] + have hFdd' : HasDerivAt (deriv F) (deriv (deriv F) c) (φ 0) := hφ0.symm ▸ hFdd.hasDerivAt + have hh := ((hFdd'.comp 0 hφd0.hasDerivAt).mul hφdd0.hasDerivAt).deriv + dsimp only [Pi.mul_apply,Function.comp_apply] at hh + simp only [hφ0,hdφ,hddφ] at hh + change deriv ((deriv F ∘ φ)*deriv φ) 0 = _ + rw [hh] + ring + have hAeq : A = ((1-‖c‖^2:ℝ):ℂ) := by + dsimp only [A] + rw [mul_comm (starRingEnd ℂ c),Complex.mul_conj'] + push_cast + rfl + have hAp : 0 < ‖A‖ := by + rw [hAeq,Complex.norm_real,Real.norm_eq_abs] + exact abs_pos.2 (by nlinarith [norm_nonneg c] : 1-‖c‖^2 ≠ 0) + have hb := (h.recenter hc).second_derivative_zero + change ‖deriv (deriv (F ∘ φ)) 0‖ ≤ (2*(512*Real.pi)^2)*‖deriv (F ∘ φ) 0‖ at hb + rw [hdd,hd,norm_mul,norm_mul] at hb + have hh : ‖A*deriv (deriv F) c-2*(starRingEnd ℂ c)*deriv F c‖ ≤ (2*(512*Real.pi)^2)*‖deriv F c‖ := by + nlinarith + rwa [hAeq] at hh + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.Layer + +def logRadius (F : ℂ → ℂ) (z : ℂ) : ℝ := + Real.log (diskFactor z) + Real.log ‖deriv F z‖ + +lemma DiskPair.logRadius_smooth {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) : + ContDiffAt ℝ 2 (logRadius F) z := by + have hh := ((h.forward.deriv isOpen_ball).analyticOnNhd isOpen_ball z + (mem_ball_zero_iff.2 hz)).harmonicAt_log_norm (h.deriv_ne_zero (mem_ball_zero_iff.2 hz)) + exact (logFactor_smooth hz).add hh.1 + +lemma DiskPair.logRadius_laplacian {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) : + Laplacian.laplacian (logRadius F) z = -4/(diskFactor z)^2 := by + have hh := ((h.forward.deriv isOpen_ball).analyticOnNhd isOpen_ball z + (mem_ball_zero_iff.2 hz)).harmonicAt_log_norm (h.deriv_ne_zero (mem_ball_zero_iff.2 hz)) + have he := (logFactor_smooth hz).laplacian_add hh.1 + change Laplacian.laplacian (logRadius F) z = _ at he + rw [he,logFactor_laplacian hz,hh.2.eq_of_nhds] + simp + +lemma DiskPair.logRadius_gradient {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) : + fderiv ℝ (logRadius F) z 1 = (deriv (deriv F) z/deriv F z).re - 2*z.re/diskFactor z ∧ + fderiv ℝ (logRadius F) z Complex.I = -(deriv (deriv F) z/deriv F z).im - 2*z.im/diskFactor z := by + have ha := diskFactor_pos hz + have hdz := (h.forward.deriv isOpen_ball).differentiableAt + (isOpen_ball.mem_nhds (mem_ball_zero_iff.2 hz)) + have hn := h.deriv_ne_zero (mem_ball_zero_iff.2 hz) + have hl := (diskFactor_smooth.differentiable (by norm_num) z).hasFDerivAt.log (ne_of_gt ha) + have hd : DifferentiableAt ℝ (fun z => Real.log ‖deriv F z‖) z := + (((h.forward.deriv isOpen_ball).analyticOnNhd isOpen_ball z + (mem_ball_zero_iff.2 hz)).harmonicAt_log_norm hn).1.differentiableAt (by norm_num) + have he := (hl.add hd.hasFDerivAt).fderiv + change fderiv ℝ (logRadius F) z = _ at he + rw [he] + simp only [add_apply,smul_apply,smul_eq_mul, + (diskFactor_gradient z).1,(diskFactor_gradient z).2, + logNorm_fderiv hdz.hasDerivAt hn,mul_one] + constructor + · ring + · rw [mul_div_right_comm,Complex.mul_re] + simp + ring + +lemma DiskPair.logRadius_gradient_sq {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) : + (fderiv ℝ (logRadius F) z 1)^2 + (fderiv ℝ (logRadius F) z Complex.I)^2 ≤ + (2*(512*Real.pi)^2)^2/(diskFactor z)^2 := by + let a := diskFactor z + let c := deriv (deriv F) z/deriv F z + let b : ℂ := (a:ℂ)*c - 2*(starRingEnd ℂ z) + have ha : 0 < a := diskFactor_pos hz + have hn := h.deriv_ne_zero (mem_ball_zero_iff.2 hz) + have he : b = ((a:ℂ)*deriv (deriv F) z - 2*(starRingEnd ℂ z)*deriv F z)/deriv F z := by + dsimp [b,c] + field_simp + have hb : ‖b‖ ≤ 2*(512*Real.pi)^2 := by + rw [he,norm_div] + apply (div_le_iff₀ (norm_pos_iff.2 hn)).2 + exact h.preSchwarzian hz + have hi : ((fderiv ℝ (logRadius F) z 1)^2 + + (fderiv ℝ (logRadius F) z Complex.I)^2)*a^2 = ‖b‖^2 := by + rw [(h.logRadius_gradient hz).1,(h.logRadius_gradient hz).2, + Complex.sq_norm,Complex.normSq_apply] + change ((c.re-2*z.re/a)^2+(-c.im-2*z.im/a)^2)*a^2 = _ + dsimp [b] + simp only [Complex.mul_re,Complex.mul_im, + Complex.ofReal_re,Complex.ofReal_im, + Complex.conj_re,Complex.conj_im,zero_mul,sub_zero,add_zero] + norm_num + field_simp + ring + apply (le_div_iff₀ (pow_pos ha 2)).2 + rw [hi] + exact pow_le_pow_left₀ (norm_nonneg b) hb 2 + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge.Layer + +def layerProfile (α t : ℝ) : ℝ := Real.exp (α*t)/(1+Real.exp (α*t)) + +def layerProfileD (α t : ℝ) : ℝ := α*Real.exp (α*t)/(1+Real.exp (α*t))^2 + +def layerProfileDD (α t : ℝ) : ℝ := + α^2*Real.exp (α*t)*(1-Real.exp (α*t))/(1+Real.exp (α*t))^3 + +lemma profile_smooth (α : ℝ) : ContDiff ℝ 2 (layerProfile α) := by + unfold layerProfile + apply ContDiff.div (by fun_prop) (by fun_prop) + intro x + positivity + +lemma profile_derivative (α t : ℝ) : HasDerivAt (layerProfile α) (layerProfileD α t) t := by + have he := ((hasDerivAt_id t).const_mul α).exp + have hh := he.div (he.const_add 1) (by positivity : 1+Real.exp (α*t) ≠ 0) + convert! hh using 1 + dsimp [layerProfile,layerProfileD] + ring + +lemma profile_second (α t : ℝ) : HasDerivAt (layerProfileD α) (layerProfileDD α t) t := by + have he := ((hasDerivAt_id t).const_mul α).exp + have hh := (he.const_mul α).div ((he.const_add 1).pow 2) + (by positivity : (1+Real.exp (α*t))^2 ≠ 0) + convert! hh using 1 + dsimp [layerProfileD,layerProfileDD] + field_simp + ring + +lemma profile_bounds (α t : ℝ) : 0 ≤ layerProfile α t ∧ layerProfile α t ≤ 1 := by + have he := Real.exp_pos (α*t) + dsimp [layerProfile] + exact ⟨by positivity,(div_le_one (by positivity)).2 (by linarith)⟩ + +lemma profileD_nonneg {α : ℝ} (hα : 0 ≤ α) (t : ℝ) : 0 ≤ layerProfileD α t := by + dsimp [layerProfileD] + positivity + +lemma profileDD_le {α : ℝ} (_hα : 0 ≤ α) (t : ℝ) : + layerProfileDD α t ≤ α*layerProfileD α t := by + have he := Real.exp_pos (α*t) + have hd : 0 < 1+Real.exp (α*t) := by positivity + rw [layerProfileDD,layerProfileD,div_le_iff₀ (pow_pos hd 3)] + have hi : α*(α*Real.exp (α*t)/(1+Real.exp (α*t))^2)*(1+Real.exp (α*t))^3 = + α^2*Real.exp (α*t)*(1+Real.exp (α*t)) := by field_simp + rw [hi] + exact mul_le_mul_of_nonneg_left (by linarith : 1-Real.exp (α*t) ≤ 1+Real.exp (α*t)) (by positivity) + +lemma profileD_lower {α t : ℝ} (hα : 0 ≤ α) (hα₂ : α ≤ 2) (ht : t ≤ 0) : + α*Real.exp (2*t)/4 ≤ layerProfileD α t := by + have he := Real.exp_pos (α*t) + have he1 : Real.exp (α*t) ≤ 1 := Real.exp_le_one_iff.2 (mul_nonpos_of_nonneg_of_nonpos hα ht) + have he2 : Real.exp (2*t) ≤ Real.exp (α*t) := Real.exp_le_exp.2 (mul_le_mul_of_nonpos_right hα₂ ht) + have hden : (1+Real.exp (α*t))^2 ≤ 4 := by nlinarith + calc + _ ≤ α*Real.exp (α*t)/4 := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left he2 hα) (by norm_num) + _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (by positivity) hden + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.Layer + +def layerExponent : ℝ := 1/(1+(2*(512*Real.pi)^2)^2) + +lemma layerExponent_bounds : 0 < layerExponent ∧ layerExponent ≤ 2 ∧ + layerExponent*(2*(512*Real.pi)^2)^2 ≤ 2 := by + have hL : 0 ≤ (2*(512*Real.pi)^2)^2 := sq_nonneg _ + have hd : 0 < 1+(2*(512*Real.pi)^2)^2 := by positivity + dsimp [layerExponent] + refine ⟨by positivity,?_,?_⟩ + · apply (div_le_iff₀ hd).2 + nlinarith + · rw [div_mul_eq_mul_div,mul_comm (1:ℝ),mul_one] + apply (div_le_iff₀ hd).2 + linarith + +def shiftedRadius (F : ℂ → ℂ) (R : ℝ) (z : ℂ) : ℝ := logRadius F z - Real.log R + +def layerBarrier (F : ℂ → ℂ) (R : ℝ) (z : ℂ) : ℝ := + R^2 * layerProfile layerExponent (shiftedRadius F R z) + +lemma DiskPair.shifted_smooth {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) (R : ℝ) : + ContDiffAt ℝ 2 (shiftedRadius F R) z := (h.logRadius_smooth hz).sub contDiffAt_const + +lemma DiskPair.shifted_laplacian {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) (R : ℝ) : + Laplacian.laplacian (shiftedRadius F R) z = -4/(diskFactor z)^2 := by + have hh := (h.logRadius_smooth hz).laplacian_sub (contDiffAt_const (c := Real.log R)) + change Laplacian.laplacian (shiftedRadius F R) z = _ at hh + rw [hh,h.logRadius_laplacian hz] + simp + +lemma shifted_fderiv (F : ℂ → ℂ) (R : ℝ) (z : ℂ) : + fderiv ℝ (shiftedRadius F R) z = fderiv ℝ (logRadius F) z := fderiv_sub_const _ + +lemma DiskPair.barrier_smooth {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) (R : ℝ) : ContDiffOn ℝ 2 (layerBarrier F R) (ball 0 1) := by + intro z hz + exact (((profile_smooth layerExponent).contDiffAt.comp z + (h.shifted_smooth (mem_ball_zero_iff.1 hz) R)).const_smul (R^2)).contDiffWithinAt + +lemma barrier_bounds (F : ℂ → ℂ) (R : ℝ) (z : ℂ) : + 0 ≤ layerBarrier F R z ∧ layerBarrier F R z ≤ R^2 := by + have hh := profile_bounds layerExponent (shiftedRadius F R z) + dsimp [layerBarrier] + exact ⟨mul_nonneg (sq_nonneg _) hh.1,by simpa using mul_le_mul_of_nonneg_left hh.2 (sq_nonneg R)⟩ + +lemma profile_laplacian_estimate {u : ℂ → ℝ} {z : ℂ} {a α L : ℝ} + (hu : ContDiffAt ℝ 2 u z) (_ha : 0 < a) (hα : 0 ≤ α) (hαL : α*L ≤ 2) + (hΔ : Laplacian.laplacian u z = -4/a^2) + (hgrad : (fderiv ℝ u z 1)^2+(fderiv ℝ u z Complex.I)^2 ≤ L/a^2) : + Laplacian.laplacian (layerProfile α ∘ u) z ≤ -2*layerProfileD α (u z)/a^2 := by + rw [laplacian_scalar_comp hu (profile_smooth α).contDiffAt] + have hd : deriv (layerProfile α) = layerProfileD α := funext (fun t => (profile_derivative α t).deriv) + rw [hd,(profile_second α (u z)).deriv,hΔ] + have hD := profileD_nonneg hα (u z) + have hDD := profileDD_le hα (u z) + calc + _ ≤ (α*layerProfileD α (u z))*(L/a^2) + layerProfileD α (u z)*(-4/a^2) := by + apply add_le_add_left + exact (mul_le_mul_of_nonneg_right hDD (add_nonneg (sq_nonneg _) (sq_nonneg _))).trans + (mul_le_mul_of_nonneg_left hgrad (mul_nonneg hα hD)) + _ = layerProfileD α (u z)*(α*L-4)/a^2 := by ring + _ ≤ _ := by + apply div_le_div_of_nonneg_right _ (sq_nonneg a) + nlinarith [mul_le_mul_of_nonneg_left hαL hD] + +lemma DiskPair.barrier_drop {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) (R : ℝ) : + Laplacian.laplacian (layerBarrier F R) z ≤ + -2*R^2*layerProfileD layerExponent (shiftedRadius F R z)/(diskFactor z)^2 := by + have hs := h.shifted_smooth hz R + have hc := (profile_smooth layerExponent).contDiffAt.comp z hs + have hh := InnerProductSpace.laplacian_smul (R^2) hc + change Laplacian.laplacian (layerBarrier F R) z = R^2*Laplacian.laplacian (layerProfile layerExponent ∘ shiftedRadius F R) z at hh + rw [hh] + have hb := profile_laplacian_estimate hs (diskFactor_pos hz) + layerExponent_bounds.1.le layerExponent_bounds.2.2 (h.shifted_laplacian hz R) + (by rw [shifted_fderiv]; exact h.logRadius_gradient_sq hz) + convert! mul_le_mul_of_nonneg_left hb (sq_nonneg R) using 1 + ring + +lemma DiskPair.barrier_superharmonic {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) (R : ℝ) : + Laplacian.laplacian (layerBarrier F R) z ≤ 0 := by + apply (h.barrier_drop hz R).trans + apply div_nonpos_of_nonpos_of_nonneg _ (sq_nonneg _) + have hh := profileD_nonneg layerExponent_bounds.1.le (shiftedRadius F R z) + nlinarith [sq_nonneg R] + +lemma DiskPair.shifted_exp {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) {R : ℝ} (hR : 0 < R) : + Real.exp (shiftedRadius F R z) = diskFactor z * ‖deriv F z‖/R := by + have ha := diskFactor_pos hz + have hn := norm_pos_iff.2 (h.deriv_ne_zero (mem_ball_zero_iff.2 hz)) + dsimp [shiftedRadius,logRadius] + rw [Real.exp_sub,Real.exp_add,Real.exp_log ha,Real.exp_log hn,Real.exp_log hR] + +lemma DiskPair.barrier_layer {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z : ℂ} (hz : ‖z‖ < 1) {R : ℝ} (hR : 0 < R) + (hl : diskFactor z * ‖deriv F z‖ ≤ R) : + layerExponent/2*‖deriv F z‖^2 ≤ -Laplacian.laplacian (layerBarrier F R) z := by + have ha := diskFactor_pos hz + have ht : shiftedRadius F R z ≤ 0 := by + apply Real.exp_le_one_iff.1 + rw [h.shifted_exp hz hR] + exact (div_le_one hR).2 hl + have he : Real.exp (2*shiftedRadius F R z) = (diskFactor z * ‖deriv F z‖/R)^2 := by + rw [two_mul,Real.exp_add,h.shifted_exp hz hR,pow_two] + have hp := profileD_lower layerExponent_bounds.1.le layerExponent_bounds.2.1 ht + rw [he] at hp + have hm := mul_le_mul_of_nonneg_left hp (show 0 ≤ 2*R^2/(diskFactor z)^2 by positivity) + have hid : (2*R^2/(diskFactor z)^2)*(layerExponent*(diskFactor z*‖deriv F z‖/R)^2/4) = + layerExponent/2*‖deriv F z‖^2 := by + field_simp + ring + rw [hid] at hm + have hb := h.barrier_drop hz R + nlinarith [show (2*R^2/(diskFactor z)^2)*layerProfileD layerExponent (shiftedRadius F R z) = + -(-2*R^2*layerProfileD layerExponent (shiftedRadius F R z)/(diskFactor z)^2) by ring] + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology +namespace SLEExactGauge.Layer + +lemma radial_green_annulus {m d L : ℝ → ℝ} {M e R : ℝ} + (he : 0 < e) (heR : e ≤ R) (hR : R < 1) + (hd : ∀ r ∈ Ico (0:ℝ) 1, HasDerivAt m (d r) r) + (hc : ContinuousOn d (Ico (0:ℝ) 1)) + (hA : ∀ r ∈ Ioo (0:ℝ) 1, HasDerivAt (fun r => r*d r) (r*L r) r) + (hLc : ContinuousOn L (Ioo (0:ℝ) 1)) + (hL : ∀ r ∈ Ioo (0:ℝ) 1, L r ≤ 0) + (hm : ∀ r ∈ Ico (0:ℝ) 1, 0 ≤ m r ∧ m r ≤ M) : + (∫ r in e..R, Real.log (R/r)*(-r*L r)) ≤ M := by + have hR0 : 0 < R := he.trans_le heR + have hsub : Icc (0:ℝ) R ⊆ Ico (0:ℝ) 1 := fun r hr => ⟨hr.1,hr.2.trans_lt hR⟩ + have hant : AntitoneOn (fun r => r*d r) (Icc (0:ℝ) R) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc _ _) + (continuousOn_id.mul (hc.mono hsub)) + · intro r hr + rw [interior_Icc] at hr + exact (hA r ⟨hr.1,hr.2.trans hR⟩).hasDerivWithinAt + · intro r hr + rw [interior_Icc] at hr + exact mul_nonpos_of_nonneg_of_nonpos hr.1.le (hL r ⟨hr.1,hr.2.trans hR⟩) + have hAe : e*d e ≤ 0 := by + simpa using hant ⟨le_rfl,hR0.le⟩ ⟨he.le,heR⟩ he.le + have hue : uIcc e R = Icc e R := uIcc_of_le heR + have hs (r : ℝ) (hr : r ∈ uIcc e R) : r ∈ Ioo (0:ℝ) 1 := by + rw [hue] at hr + exact ⟨he.trans_le hr.1,hr.2.trans_lt hR⟩ + have hlog (r : ℝ) (hr : r ∈ uIcc e R) : + HasDerivAt (fun r => Real.log (R/r)) (-r⁻¹) r := by + have hh := (Real.hasDerivAt_log (ne_of_gt (hs r hr).1)).const_sub (Real.log R) + convert hh.congr_of_eventuallyEq ?_ using 1 + filter_upwards [Ioi_mem_nhds (hs r hr).1] with t ht + exact Real.log_div (ne_of_gt hR0) (ne_of_gt ht) + have hprim (r : ℝ) (hr : r ∈ uIcc e R) : + HasDerivAt (fun r => -Real.log (R/r)*(r*d r)-m r) + (Real.log (R/r)*(-r*L r)) r := by + have hh := ((hlog r hr).neg.mul (hA r (hs r hr))).sub (hd r ⟨(hs r hr).1.le,(hs r hr).2⟩) + convert! hh using 1 + simp only [Pi.neg_apply,neg_neg] + field_simp [ne_of_gt (hs r hr).1] + ring + have hi : IntervalIntegrable (fun r => Real.log (R/r)*(-r*L r)) volume e R := by + apply ContinuousOn.intervalIntegrable + apply ContinuousOn.mul + · exact fun r hr => (hlog r hr).continuousAt.continuousWithinAt + · exact (continuousOn_id.neg.mul (hLc.mono (fun r hr => hs r hr))) + have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt hprim hi + have hRR : Real.log (R/R) = 0 := by simp [ne_of_gt hR0] + rw [hRR,neg_zero,zero_mul,zero_sub] at hftc + rw [hftc] + have hlg : 0 ≤ Real.log (R/e) := Real.log_nonneg ((one_le_div he).2 heR) + have hmul := mul_nonpos_of_nonneg_of_nonpos hlg hAe + have hme := hm e ⟨he.le,heR.trans_lt hR⟩ + have hmR := hm R ⟨hR0.le,hR⟩ + nlinarith + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal +namespace SLEExactGauge.Layer + +lemma radial_green_integral {m d L : ℝ → ℝ} {M : ℝ} + (hd : ∀ r ∈ Ico (0:ℝ) 1, HasDerivAt m (d r) r) + (hc : ContinuousOn d (Ico (0:ℝ) 1)) + (hA : ∀ r ∈ Ioo (0:ℝ) 1, HasDerivAt (fun r => r*d r) (r*L r) r) + (hLc : ContinuousOn L (Ioo (0:ℝ) 1)) + (hL : ∀ r ∈ Ioo (0:ℝ) 1, L r ≤ 0) + (hm : ∀ r ∈ Ico (0:ℝ) 1, 0 ≤ m r ∧ m r ≤ M) : + (∫⁻ r in Ioo (0:ℝ) 1, ENNReal.ofReal (Real.log (1/r)*(-r*L r))) ≤ ENNReal.ofReal M := by + let e : ℕ → ℝ := fun n => (1/((n:ℝ)+1))/2 + let R : ℕ → ℝ := fun n => 1-e n + have he (n : ℕ) : 0 < e n := by dsimp [e]; positivity + have hehalf (n : ℕ) : e n ≤ 1/2 := by + dsimp [e] + apply div_le_div_of_nonneg_right _ (by norm_num) + exact (div_le_one (by positivity)).2 (by have hn := Nat.cast_nonneg (α := ℝ) n; linarith) + have heR (n : ℕ) : e n ≤ R n := by dsimp [R]; linarith [hehalf n] + have hR (n : ℕ) : R n < 1 := by dsimp [R]; linarith [he n] + have hR0 (n : ℕ) : 0 < R n := (he n).trans_le (heR n) + have hsub (n : ℕ) : Icc (e n) (R n) ⊆ Ioo (0:ℝ) 1 := + fun r hr => ⟨(he n).trans_le hr.1,hr.2.trans_lt (hR n)⟩ + let f : ℕ → ℝ → ℝ≥0∞ := fun n => (Icc (e n) (R n)).indicator + (fun r => ENNReal.ofReal (Real.log (R n/r)*(-r*L r))) + let μ := volume.restrict (Ioo (0:ℝ) 1) + have hfm (n : ℕ) : AEMeasurable (f n) μ := by + apply AEMeasurable.indicator _ measurableSet_Icc + apply AEMeasurable.ennreal_ofReal + exact ((measurable_const.div measurable_id).log.aemeasurable).mul + (measurable_id.neg.aemeasurable.mul (hLc.aemeasurable measurableSet_Ioo)) + have hbound (n : ℕ) : (∫⁻ r, f n r ∂μ) ≤ ENNReal.ofReal M := by + let q : ℝ → ℝ := fun r => Real.log (R n/r)*(-r*L r) + have hqc : ContinuousOn q (Icc (e n) (R n)) := by + apply ContinuousOn.mul + · exact (continuousOn_const.div continuousOn_id (fun r hr => ne_of_gt (hsub n hr).1)).log + (fun r hr => ne_of_gt (div_pos (hR0 n) (hsub n hr).1)) + · exact continuousOn_id.neg.mul (hLc.mono (hsub n)) + have hqi : IntegrableOn q (Icc (e n) (R n)) := hqc.integrableOn_Icc + have hqnn : 0 ≤ᵐ[volume.restrict (Icc (e n) (R n))] q := by + filter_upwards [ae_restrict_mem measurableSet_Icc] with r hr + exact mul_nonneg (Real.log_nonneg ((one_le_div (hsub n hr).1).2 hr.2)) + (mul_nonneg_of_nonpos_of_nonpos (neg_nonpos.2 (hsub n hr).1.le) (hL r (hsub n hr))) + change (∫⁻ r, (Icc (e n) (R n)).indicator (fun r => ENNReal.ofReal (q r)) r ∂μ) ≤ _ + rw [lintegral_indicator measurableSet_Icc] + change (∫⁻ r, ENNReal.ofReal (q r) ∂(volume.restrict (Ioo (0:ℝ) 1)).restrict (Icc (e n) (R n))) ≤ _ + rw [Measure.restrict_restrict measurableSet_Icc,inter_eq_left.2 (hsub n),← ofReal_integral_eq_lintegral_ofReal hqi hqnn] + apply ENNReal.ofReal_le_ofReal + rw [integral_Icc_eq_integral_Ioc,← intervalIntegral.integral_of_le (heR n)] + exact radial_green_annulus (he n) (heR n) (hR n) hd hc hA hLc hL hm + have helim : Tendsto e atTop (𝓝 0) := by + simpa only [zero_div,e] using (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).div_const 2 + have hRlim : Tendsto R atTop (𝓝 1) := by + simpa only [sub_zero,R] using tendsto_const_nhds.sub helim + have hlim (r : ℝ) (hr : r ∈ Ioo (0:ℝ) 1) : + Tendsto (fun n => f n r) atTop (𝓝 (ENNReal.ofReal (Real.log (1/r)*(-r*L r)))) := by + have hevent : ∀ᶠ n in atTop, r ∈ Icc (e n) (R n) := by + filter_upwards [helim.eventually_lt_const hr.1,hRlim.eventually_const_lt hr.2] with n hn hn' + exact ⟨hn.le,hn'.le⟩ + have ht := ENNReal.tendsto_ofReal (((hRlim.div_const r).log (div_ne_zero one_ne_zero (ne_of_gt hr.1))).mul_const (-r*L r)) + apply ht.congr' + filter_upwards [hevent] with n hn + exact (indicator_of_mem hn (fun r => ENNReal.ofReal (Real.log (R n/r)*(-r*L r)))).symm + calc + _ = ∫⁻ r, liminf (fun n => f n r) atTop ∂μ := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_mem measurableSet_Ioo] with r hr + exact (hlim r hr).liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ r, f n r ∂μ) atTop := lintegral_liminf_le' hfm + _ ≤ _ := liminf_le_of_frequently_le (Eventually.frequently (Eventually.of_forall hbound)) + +lemma superharmonic_radial_green {u : ℂ → ℝ} {M : ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) + (hb : ∀ z ∈ ball (0:ℂ) 1, 0 ≤ u z ∧ u z ≤ M) + (hΔ : ∀ z ∈ ball (0:ℂ) 1, Laplacian.laplacian u z ≤ 0) : + (∫⁻ r in Ioo (0:ℝ) 1, ENNReal.ofReal (Real.log (1/r)*(-r*circleLMean u r))) ≤ + ENNReal.ofReal (2*Real.pi*M) := by + have hrad (r : ℝ) (hr : r ∈ Ico (0:ℝ) 1) : |r| < 1 := by rw [abs_of_nonneg hr.1]; exact hr.2 + have hθc (r : ℝ) (hr : r ∈ Ico (0:ℝ) 1) : Continuous (fun θ => u (r • circleMap 0 1 θ)) := + continuousOn_univ.1 (hu.continuousOn.comp ((continuous_circleMap 0 1).const_smul r).continuousOn + (fun θ _ => radial_mem (hrad r hr) θ)) + apply radial_green_integral (m := circleMean u) (d := circleDMean u) + · intro r hr + exact (circle_means_derivatives hu (hrad r hr)).1 + · intro r hr + exact (circle_means_derivatives hu (hrad r hr)).2.continuousAt.continuousWithinAt + · intro r hr + exact weighted_circle_derivative hu hr.1 hr.2 + · exact (circle_lmean_continuous hu).mono (fun r hr => ⟨by linarith [hr.1],hr.2⟩) + · intro r hr + have hh := intervalIntegral.integral_nonneg (μ := volume) (neg_le_self Real.pi_pos.le) + (f := fun θ => -Laplacian.laplacian u (r • circleMap 0 1 θ)) + (fun θ _ => neg_nonneg.2 (hΔ _ (radial_mem (by rw [abs_of_pos hr.1]; exact hr.2) θ))) + rw [intervalIntegral.integral_neg] at hh + exact neg_nonneg.1 hh + · intro r hr + constructor + · apply intervalIntegral.integral_nonneg (neg_le_self Real.pi_pos.le) + intro θ _ + exact (hb _ (radial_mem (hrad r hr) θ)).1 + · have hi := intervalIntegral.integral_mono_on (μ := volume) (neg_le_self Real.pi_pos.le) + ((hθc r hr).intervalIntegrable _ _) (intervalIntegrable_const (c := M)) + (fun θ _ => (hb _ (radial_mem (hrad r hr) θ)).2) + change circleMean u r ≤ _ at hi + exact hi.trans_eq (by simp only [intervalIntegral.integral_const,smul_eq_mul]; ring) + +theorem superharmonic_disk_green {u : ℂ → ℝ} {M : ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) + (hb : ∀ z ∈ ball (0:ℂ) 1, 0 ≤ u z ∧ u z ≤ M) + (hΔ : ∀ z ∈ ball (0:ℂ) 1, Laplacian.laplacian u z ≤ 0) : + (∫⁻ z in ball (0:ℂ) 1, ENNReal.ofReal (Real.log (1/‖z‖)*(-Laplacian.laplacian u z))) ≤ + ENNReal.ofReal (2*Real.pi*M) := by + apply (polar_disk_lintegral_le _).trans + have he : (∫⁻ r in Ioo (0:ℝ) 1, ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal r * ENNReal.ofReal (Real.log (1/‖r • circleMap 0 1 θ‖)* + (-Laplacian.laplacian u (r • circleMap 0 1 θ)))) = + ∫⁻ r in Ioo (0:ℝ) 1, ENNReal.ofReal (Real.log (1/r)*(-r*circleLMean u r)) := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_mem measurableSet_Ioo] with r hr + have hrabs : |r| < 1 := by rw [abs_of_pos hr.1]; exact hr.2 + let q : ℝ → ℝ := fun θ => Real.log (1/r)*(-r*Laplacian.laplacian u (r • circleMap 0 1 θ)) + have hq : Continuous q := ((circle_laplacian_continuous hu hrabs).const_mul (-r)).const_mul _ + have hqi : IntegrableOn q (Ioc (-Real.pi) Real.pi) := (hq.intervalIntegrable _ _).1 + have hq0 : 0 ≤ᵐ[volume.restrict (Ioc (-Real.pi) Real.pi)] q := by + filter_upwards with θ + apply mul_nonneg + · exact Real.log_nonneg ((one_le_div hr.1).2 hr.2.le) + · exact mul_nonneg_of_nonpos_of_nonpos (neg_nonpos.2 hr.1.le) (hΔ _ (radial_mem hrabs θ)) + have hqint : (∫ θ in -Real.pi..Real.pi, q θ) = Real.log (1/r)*(-r*circleLMean u r) := by + dsimp only [q,circleLMean] + rw [intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul] + calc + _ = ∫⁻ θ in Ioo (-Real.pi) Real.pi, ENNReal.ofReal (q θ) := by + apply lintegral_congr + intro θ + rw [radial_norm,abs_of_pos hr.1,← ENNReal.ofReal_mul hr.1.le] + congr 1 + dsimp only [q] + ring + _ = ENNReal.ofReal (∫ θ in -Real.pi..Real.pi, q θ) := by + rw [restrict_Ioo_eq_restrict_Ioc,intervalIntegral.integral_of_le (neg_le_self Real.pi_pos.le)] + exact (ofReal_integral_eq_lintegral_ofReal hqi hq0).symm + _ = _ := congrArg ENNReal.ofReal hqint + rw [he] + exact superharmonic_radial_green hu hb hΔ + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric Function +open scoped Topology +namespace SLEExactGauge.Layer + +lemma univalent_not_locally_constant {F : ℂ → ℂ} (hi : InjOn F (ball 0 1)) + {c : ℂ} (hc : c ∈ ball (0:ℂ) 1) : ¬ ∀ᶠ z in 𝓝 c, F z = F c := by + intro hh + have he : ∀ᶠ z in 𝓝 c, z = c := by + filter_upwards [hh,isOpen_ball.mem_nhds hc] with z hz hzD + exact hi hzD hc hz + have hb : ∀ᶠ z in 𝓝[≠] c, False := by + filter_upwards [he.filter_mono nhdsWithin_le_nhds,self_mem_nhdsWithin] with z hz hne + exact hne hz + obtain ⟨z,hz⟩ := hb.exists + exact hz + +lemma univalent_punctured_derivative {F : ℂ → ℂ} + (hf : DifferentiableOn ℂ F (ball 0 1)) (hi : InjOn F (ball 0 1)) + {c : ℂ} (hc : c ∈ ball (0:ℂ) 1) : ∀ᶠ z in 𝓝[≠] c, deriv F z ≠ 0 := by + have ha := hf.analyticOnNhd isOpen_ball c hc + apply ha.deriv.eventually_eq_zero_or_eventually_ne_zero.resolve_left + intro hz + obtain ⟨r,hr,hsub⟩ := Metric.mem_nhds_iff.1 (hz.and (isOpen_ball.mem_nhds hc)) + have hbd : ball c r ⊆ ball (0:ℂ) 1 := fun z hz => (hsub hz).2 + have hconst : ∀ᶠ z in 𝓝 c, F z = F c := by + filter_upwards [ball_mem_nhds c hr] with z hz + exact isOpen_ball.is_const_of_deriv_eq_zero (convex_ball c r).isPreconnected + (hf.mono hbd) (fun z hz => (hsub hz).1) hz (mem_ball_self hr) + exact univalent_not_locally_constant hi hc hconst + +theorem univalent_diskPair {F : ℂ → ℂ} + (hf : DifferentiableOn ℂ F (ball 0 1)) (hi : InjOn F (ball 0 1)) : + ∃ G : ℂ → ℂ, DiskPair (F '' ball 0 1) F G := by + let U := F '' ball (0:ℂ) 1 + let G := invFunOn F (ball (0:ℂ) 1) + have hl : ∀ z ∈ ball (0:ℂ) 1, G (F z) = z := hi.leftInvOn_invFunOn + have hr : ∀ w ∈ U, F (G w) = w := (surjOn_image F (ball (0:ℂ) 1)).rightInvOn_invFunOn + have hgmap : MapsTo G U (ball (0:ℂ) 1) := (surjOn_image F (ball (0:ℂ) 1)).mapsTo_invFunOn + have hopen (c : ℂ) (hc : c ∈ ball (0:ℂ) 1) : 𝓝 (F c) ≤ map F (𝓝 c) := + ((hf.analyticOnNhd isOpen_ball c hc).eventually_constant_or_nhds_le_map_nhds).resolve_left + (univalent_not_locally_constant hi hc) + have hU : IsOpen U := by + apply isOpen_iff_mem_nhds.2 + rintro w ⟨c,hc,rfl⟩ + apply hopen c hc + change ∀ᶠ z in 𝓝 c, F z ∈ U + filter_upwards [isOpen_ball.mem_nhds hc] with z hz + exact mem_image_of_mem F hz + have hGc (w : ℂ) (hw : w ∈ U) : ContinuousAt G w := by + rcases hw with ⟨c,hc,rfl⟩ + rw [ContinuousAt,hl c hc] + calc + map G (𝓝 (F c)) ≤ map G (map F (𝓝 c)) := map_mono (hopen c hc) + _ = map id (𝓝 c) := by + rw [map_map] + apply Filter.map_congr + filter_upwards [isOpen_ball.mem_nhds hc] with z hz + exact hl z hz + _ = 𝓝 c := map_id + have hgood (w : ℂ) (hw : w ∈ U) (hn : deriv F (G w) ≠ 0) : DifferentiableAt ℂ G w := by + apply HasDerivAt.differentiableAt (f' := (deriv F (G w))⁻¹) + apply HasDerivAt.of_local_left_inverse (hGc w hw) + (hf.differentiableAt (isOpen_ball.mem_nhds (hgmap hw))).hasDerivAt hn + filter_upwards [hU.mem_nhds hw] with y hy + exact hr y hy + have hGd (w : ℂ) (hw : w ∈ U) : DifferentiableAt ℂ G w := by + have hc := hgmap hw + have htn : Tendsto G (𝓝[≠] w) (𝓝[≠] G w) := by + apply tendsto_nhdsWithin_iff.2 + refine ⟨(hGc w hw).tendsto.mono_left nhdsWithin_le_nhds,?_⟩ + filter_upwards [(show ∀ᶠ y in 𝓝 w, y ∈ U from hU.mem_nhds hw).filter_mono nhdsWithin_le_nhds,self_mem_nhdsWithin] with y hy hne + change G y ≠ G w + intro hgy + apply hne + change y = w + rw [← hr y hy,hgy,hr w hw] + have hne := htn.eventually (univalent_punctured_derivative hf hi hc) + apply (Complex.analyticAt_of_differentiable_on_punctured_nhds_of_continuousAt ?_ (hGc w hw)).differentiableAt + filter_upwards [hne,(show ∀ᶠ y in 𝓝 w, y ∈ U from hU.mem_nhds hw).filter_mono nhdsWithin_le_nhds] with y hn hy + exact hgood y hy hn + exact ⟨G,hU,(fun z hz => mem_image_of_mem F hz),hgmap,hl,hr,hf,fun w hw => (hGd w hw).differentiableWithinAt⟩ + +end SLEExactGauge.Layer + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/ConformalLocalization.lean b/lean/OAI/Probability/SLELocalization/ConformalLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..8422afae57664f2fdd416ce5feaba2694aa9a9a0 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/ConformalLocalization.lean @@ -0,0 +1,375 @@ +import Mathlib +import OAI.Probability.SLELocalization.EuclideanApproach + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +theorem strip_slab_half_mean {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) (hη0 : η 0 = 0) + (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + (hlarge : 32*Real.pi*localizationMeanConstant ≤ H) + (j : ℤ) (hj : (j:ℝ) ≤ localizationStripWidth*H) : + stripMean H q r Fbar (unitSlab j) ≤ H/2 := by + let K := localizationMeanConstant + let E := totalStripEnergy H q r Fbar + have hK : 0 < K := localizationMeanConstant_pos + have hE : 0 ≤ E := totalStripEnergy_nonneg _ _ _ _ + have hEt := totalStripEnergy_bound hF hinj hext hH hr q + change E ≤ 2*Real.pi*H at hEt + have hKc : slabMeanCoefficient ≤ K := by dsimp [K,localizationMeanConstant]; linarith [Real.pi_pos] + have hKπ : Real.pi ≤ K := by dsimp [K,localizationMeanConstant]; linarith [slabMeanCoefficient_pos] + have hm : (stripMean H q r Fbar (unitSlab j))^2 ≤ K*(max (j:ℝ) 0+2)*E := by + by_cases hj0 : 0 ≤ j + · have hjr : (0:ℝ) ≤ j := by exact_mod_cast hj0 + rw [max_eq_left hjr] + exact (positive_unitSlab_mean hF hinj hext hcont hH hr q hη hη0 hη1 hηH haccess j hjr).trans + (by gcongr) + · have hjr : (j:ℝ) ≤ -1 := by exact_mod_cast (show j ≤ -1 by omega) + rw [max_eq_right (by linarith : (j:ℝ) ≤ 0),zero_add] + exact (negative_unitSlab_mean hF hinj hext hcont hH hr q hη hη0 hη1 hηH haccess j hjr).trans + (mul_le_mul_of_nonneg_right (by linarith) hE) + have hmax : max (j:ℝ) 0 ≤ localizationStripWidth*H := + max_le hj (mul_nonneg localizationStripWidth_pos.le hH.le) + have hbpos := localizationStripWidth_pos + have hfinal : K*(max (j:ℝ) 0+2)*E ≤ (H/2)^2 := by + calc + _ ≤ K*(localizationStripWidth*H+2)*(2*Real.pi*H) := by gcongr + _ = H^2/16+4*Real.pi*K*H := by + unfold localizationStripWidth + change K*((1/(32*Real.pi*K))*H+2)*(2*Real.pi*H) = _ + field_simp + ring + _ ≤ (H/2)^2 := by + have ht := mul_le_mul_of_nonneg_right hlarge hH.le + change (32*Real.pi*K)*H ≤ H*H at ht + nlinarith + have hh := hm.trans hfinal + nlinarith [sq_nonneg (stripMean H q r Fbar (unitSlab j)+H/2)] + +lemma unitSlab_cells_disjoint : Pairwise (fun j k : ℤ => Disjoint (unitSlab j).cells (unitSlab k).cells) := by + intro j k hjk + have hdis (j k : ℤ) (hjk : j < k) : Disjoint (unitSlab j).cells (unitSlab k).cells := by + apply disjoint_left.mpr + intro x hx hy + change x.1 ∈ Ioc (j:ℝ) (j+1) ∧ _ at hx + change x.1 ∈ Ioc (k:ℝ) (k+1) ∧ _ at hy + have hjk' : (j:ℝ)+1 ≤ k := by exact_mod_cast (show j+1 ≤ k by omega) + linarith [hx.1.2,hy.1.1] + rcases lt_or_gt_of_ne hjk with h | h + · exact hdis j k h + · exact (hdis k j h).symm + +lemma DRect.measure_eq_restrict (Q : DRect) : Q.measure = volume.restrict Q.cells := by + rw [DRect.measure,DRect.cells,Measure.volume_eq_prod] + change _ = (volume.prod volume).restrict ((Ioc Q.a Q.b) ×ˢ (Ioc Q.c Q.d)) + rw [← Measure.prod_restrict] + +theorem strip_slab_energy_sum {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + (∑' j : ℤ, ENNReal.ofReal (stripEnergy H q r Fbar (unitSlab j))) ≤ + ENNReal.ofReal (2*Real.pi*H) := by + let G := fun p : ℝ × ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + let ν := (volume : Measure (ℝ × ℝ)).withDensity (fun p => ENNReal.ofReal (G p)) + let S := (univ : Set ℝ).prod (Ioc (0:ℝ) Real.pi) + have hmeas (Q : DRect) : MeasurableSet Q.cells := measurableSet_Ioc.prod measurableSet_Ioc + have he (j : ℤ) : ENNReal.ofReal (stripEnergy H q r Fbar (unitSlab j)) = ν (unitSlab j).cells := by + rw [withDensity_apply _ (hmeas _)] + have hi := (strip_gradient_rect_memLp hF hinj hext hH hr q (j:ℝ) (j+1) le_rfl le_rfl).integrable_sq + change Integrable G (unitSlab j).measure at hi + rw [DRect.measure_eq_restrict] at hi + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun p => sq_nonneg _))] + congr 1 + exact congrArg (fun μ => ∫ p, G p ∂μ) (DRect.measure_eq_restrict _) + have hS : ν S = ENNReal.ofReal (totalStripEnergy H q r Fbar) := by + change ((volume : Measure (ℝ × ℝ)).withDensity (fun p => ENNReal.ofReal (G p))) + ((univ : Set ℝ) ×ˢ Ioc (0:ℝ) Real.pi) = _ + rw [withDensity_apply _ (MeasurableSet.univ.prod measurableSet_Ioc)] + change (∫⁻ p, ENNReal.ofReal (G p) ∂(volume.prod volume).restrict ((univ : Set ℝ) ×ˢ Ioc (0:ℝ) Real.pi)) = _ + rw [← Measure.prod_restrict,Measure.restrict_univ] + have hi := strip_energy_integrable_prod hF hinj hext hH hr q + rw [restrict_Ioo_eq_restrict_Ioc] at hi + exact (ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun p => sq_nonneg _))).symm + rw [tsum_congr he,← measure_iUnion unitSlab_cells_disjoint (fun j => hmeas (unitSlab j))] + calc + _ ≤ ν S := measure_mono (by + intro p hp + obtain ⟨j,hj⟩ := mem_iUnion.mp hp + exact ⟨mem_univ _,hj.2⟩) + _ = ENNReal.ofReal (totalStripEnergy H q r Fbar) := hS + _ ≤ _ := ENNReal.ofReal_le_ofReal (totalStripEnergy_bound hF hinj hext hH hr q) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma energy_exp_linearize {A a H E : ℝ} (hA : 0 ≤ A) (ha : 0 ≤ a) + (hH : 0 < H) (hE : 0 ≤ E) (hEt : E ≤ 2*Real.pi*H) : + A*(E/H^2)*Real.exp (-a*H^2/E) ≤ + ((A/H^2)*Real.exp (-(a/(2*Real.pi))*H))*E := by + by_cases h0 : E = 0 + · simp [h0] + have hEp : 0 < E := lt_of_le_of_ne hE (Ne.symm h0) + have hexp : -a*H^2/E ≤ -(a/(2*Real.pi))*H := by + rw [div_le_iff₀ hEp] + have hmul := mul_le_mul_of_nonneg_left hEt + (by positivity : 0 ≤ a*H/(2*Real.pi)) + have hh : (a*H/(2*Real.pi))*(2*Real.pi*H) = a*H^2 := by + field_simp + rw [hh] at hmul + convert neg_le_neg hmul using 1 <;> ring + calc + _ ≤ A*(E/H^2)*Real.exp (-(a/(2*Real.pi))*H) := by gcongr + _ = _ := by ring + +theorem energy_event_union {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + (P : Measure Ω) (events : ι → Set Ω) (E : ι → ℝ) + {A a H : ℝ} (hA : 0 ≤ A) (ha : 0 ≤ a) (hH : 1 ≤ H) + (hE : ∀ j, 0 ≤ E j) (hEt : ∀ j, E j ≤ 2*Real.pi*H) + (hsum : (∑' j, ENNReal.ofReal (E j)) ≤ ENNReal.ofReal (2*Real.pi*H)) + (hhit : ∀ j, P (events j) ≤ ENNReal.ofReal (A*(E j/H^2)*Real.exp (-a*H^2/E j))) : + P (⋃ j, events j) ≤ ENNReal.ofReal ((2*Real.pi*A)*Real.exp (-(a/(2*Real.pi))*H)) := by + have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH + let k := (A/H^2)*Real.exp (-(a/(2*Real.pi))*H) + have hk : 0 ≤ k := by dsimp [k]; positivity + calc + _ ≤ ∑' j, P (events j) := measure_iUnion_le _ + _ ≤ ∑' j, ENNReal.ofReal (k*E j) := ENNReal.tsum_le_tsum (fun j => + (hhit j).trans (ENNReal.ofReal_le_ofReal (energy_exp_linearize hA ha hHp (hE j) (hEt j)))) + _ = ENNReal.ofReal k*(∑' j, ENNReal.ofReal (E j)) := by + simp_rw [ENNReal.ofReal_mul hk] + exact ENNReal.tsum_mul_left + _ ≤ ENNReal.ofReal k*ENNReal.ofReal (2*Real.pi*H) := by gcongr + _ = ENNReal.ofReal (k*(2*Real.pi*H)) := (ENNReal.ofReal_mul hk).symm + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + have hid : k*(2*Real.pi*H) = (2*Real.pi*A/H)*Real.exp (-(a/(2*Real.pi))*H) := by + dsimp [k] + field_simp + rw [hid] + apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le + exact div_le_self (by positivity) hH) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def logEnergyExit {Ω : Type*} (γ : Ω → ℝ → ℂ) (Fbar : ℂ → OnePoint ℂ) + (H : ℝ) (q : ℂ) (r : ℝ) (ω : Ω) : Prop := + ∃ x ∈ logTrace γ ω, x.1 ≤ localizationStripWidth*H ∧ 0 ≤ x.2 ∧ x.2 ≤ Real.pi ∧ + stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I) = H + +lemma rectCoefficient_unitSlab (j : ℝ) : + rectCoefficient (unitSlab j) = rectCoefficient (unitSlab 0) := by + unfold rectCoefficient unitSlab + dsimp only + rw [show j+1-j=1 by ring] + norm_num + +theorem logTrace_localization (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ c C H₀ : ℝ, 0 < c ∧ 0 < C ∧ 0 < H₀ ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (F : ℂ → ℂ) (_hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (_hinj : InjOn F {z : ℂ | 0 < z.im}) (Fbar : ℂ → OnePoint ℂ) + (_hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (_hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (q : ℂ) (r : ℝ) (_hr : 0 < r) + (η : ℝ → ℂ) (_hη : ContinuousOn η (Icc 0 1)) (_hη0 : η 0 = 0) + (_hη1 : ‖η 1‖ = 1) (_hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (_haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + (H : ℝ), H₀ ≤ H → P {ω | logEnergyExit γ Fbar H q r ω} ≤ + ENNReal.ofReal (C*Real.exp (-c*H)) := by + obtain ⟨C₀,ρ,hC₀,hρ,hρ1,hhit⟩ := logTrace_dyadic_hitting κ hκ + let D := rectCoefficient (unitSlab 0) + let T := ∑' j : ℕ, (((j:ℝ)+1)*((j:ℝ)+2))^2*ρ^j + let A := 64*D*(C₀+1)*(T+1)/ρ + let a := (-Real.log ρ)/(48*D) + let H₀ := max 1 (32*Real.pi*localizationMeanConstant) + have hD : 0 < D := rectCoefficient_pos _ + have hT : 0 ≤ T := tsum_nonneg (fun j => mul_nonneg (sq_nonneg _) (pow_nonneg hρ.le j)) + have hA : 0 < A := by dsimp [A]; positivity + have ha : 0 < a := div_pos (neg_pos.2 (Real.log_neg hρ hρ1)) (by positivity) + have hH₀ : 0 < H₀ := lt_of_lt_of_le zero_lt_one (le_max_left _ _) + refine ⟨a/(2*Real.pi),2*Real.pi*A,H₀,by positivity,by positivity,hH₀,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps F hF hinj Fbar hext hcont q r hr η hη hη0 hη1 hηH haccess H hlarge + have hH1 : 1 ≤ H := (le_max_left _ _).trans hlarge + have hH : 0 < H := lt_of_lt_of_le zero_lt_one hH1 + have hHH : 32*Real.pi*localizationMeanConstant ≤ H := (le_max_right _ _).trans hlarge + let E := fun j : ℤ => stripEnergy H q r Fbar (unitSlab j) + let events := fun j : ℤ => {ω | (j:ℝ) ≤ localizationStripWidth*H ∧ + ∃ x ∈ logTrace γ ω, x ∈ (unitSlab j).closed ∧ + stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I) = H} + have hsub : {ω | logEnergyExit γ Fbar H q r ω} ⊆ ⋃ j, events j := by + rintro ω ⟨x,hx,hxv,hx0,hxπ,hxH⟩ + apply mem_iUnion.mpr + refine ⟨Int.floor x.1,?_,x,hx,?_,hxH⟩ + · exact (Int.floor_le x.1).trans hxv + · exact ⟨⟨Int.floor_le x.1,(Int.lt_floor_add_one x.1).le⟩,hx0,hxπ⟩ + have hE : ∀ j, 0 ≤ E j := fun j => integral_nonneg (fun _ => sq_nonneg _) + have hEt : ∀ j, E j ≤ 2*Real.pi*H := fun j => + (stripEnergy_le_total hF hinj hext hH hr q (unitSlab j) le_rfl le_rfl).trans + (totalStripEnergy_bound hF hinj hext hH hr q) + have hsum := strip_slab_energy_sum hF hinj hext hH hr q + have hev (j : ℤ) : P (events j) ≤ ENNReal.ofReal (A*(E j/H^2)*Real.exp (-a*H^2/E j)) := by + by_cases hj : (j:ℝ) ≤ localizationStripWidth*H + · have hm := strip_slab_half_mean hF hinj hext hcont hH hr q hη hη0 hη1 hηH haccess hHH j hj + have hb := strip_rectangle_hitting hF hinj hext hcont hH hr q (unitSlab j) le_rfl le_rfl hm + P (logTrace γ) hC₀.le hρ hρ1 (hhit P B hB γ g f hγ hmaps j) + dsimp only at hb + rw [rectCoefficient_unitSlab] at hb + change P _ ≤ ENNReal.ofReal (A*(E j/H^2)*Real.exp (-a*H^2/E j)) at hb + exact (measure_mono (fun ω hω => hω.2)).trans hb + · have he : events j = ∅ := by ext ω; simp [events,hj] + rw [he,measure_empty] + exact bot_le + exact (measure_mono hsub).trans (energy_event_union P events E hA.le ha.le hH1 hE hEt hsum hev) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology ENNReal NNReal OnePoint +namespace SLEExactGauge +open RectangleEnergy + +def conformalExit (Fbar : ℂ → OnePoint ℂ) (γ : ℝ → ℂ) + (q : ℂ) (radius A : ℝ) : Prop := + ∃ t : ℝ, 0 ≤ t ∧ (∀ s : ℝ, 0 ≤ s → s < t → ‖γ s‖ < A) ∧ + Fbar (γ t) ∉ (fun w : ℂ => (w : OnePoint ℂ)) '' Metric.ball q radius + +lemma norm_le_of_pre_modulus {γ : ℝ → ℂ} (hc : ContinuousOn γ (Ici 0)) + (h0 : γ 0 = 0) {t A : ℝ} (ht : 0 ≤ t) (hA : 0 < A) + (hpre : ∀ s : ℝ, 0 ≤ s → s < t → ‖γ s‖ < A) : ‖γ t‖ ≤ A := by + by_contra hn + have hgt : A < ‖γ t‖ := lt_of_not_ge hn + have hm : A ∈ Icc ‖γ 0‖ ‖γ t‖ := by simpa [h0] using And.intro hA.le hgt.le + obtain ⟨s,hs,he⟩ := intermediate_value_Icc ht (hc.mono Icc_subset_Ici_self).norm hm + have hst : s < t := lt_of_le_of_ne hs.2 (by intro heq; subst s; linarith) + exact (ne_of_lt (hpre s hs.1 hst)) he + +lemma conformalExit_logEnergyExit {Ω : Type*} {γ : Ω → ℝ → ℂ} + {ω : Ω} {Fbar : ℂ → OnePoint ℂ} {q : ℂ} {r L : ℝ} + (hr : 0 < r) (hL : 1 < L) (hc : ContinuousOn (γ ω) (Ici 0)) + (h0 : γ ω 0 = 0) (hhalf : ∀ t, 0 ≤ t → 0 ≤ (γ ω t).im) + (hstart : Fbar 0 ∈ (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + (hexit : conformalExit Fbar (γ ω) q (L*r) (L^localizationStripWidth)) : + logEnergyExit γ Fbar (Real.log L) q r ω := by + obtain ⟨t,ht,hpre,hout⟩ := hexit + have hLp : 0 < L := zero_lt_one.trans hL + have hz : γ ω t ≠ 0 := by + intro he + apply hout + rw [he] + obtain ⟨w,hw,heq⟩ := hstart + refine ⟨w,?_,heq⟩ + exact mem_ball.2 (lt_of_le_of_lt (mem_closedBall.1 hw) (by nlinarith)) + have hn := norm_le_of_pre_modulus hc h0 ht (Real.rpow_pos_of_pos hLp _) hpre + let x : ℝ × ℝ := (Real.log ‖γ ω t‖, Complex.arg (γ ω t)) + have hexp : Complex.exp ((x.1:ℂ)+(x.2:ℂ)*Complex.I) = γ ω t := by + change Complex.exp (Complex.log (γ ω t)) = γ ω t + exact Complex.exp_log hz + refine ⟨x,⟨t,ht,hexp.symm⟩,?_,Complex.arg_nonneg_iff.2 (hhalf t ht),Complex.arg_le_pi _,?_⟩ + · have hb := Real.log_le_log (norm_pos_iff.2 hz) hn + rw [Real.log_rpow hLp] at hb + exact hb + · unfold stripPotential + rw [hexp] + apply sphereTruncation_top_of_outside (Real.log_pos hL).le hr q + simpa [Real.exp_log hLp] using hout + +theorem uniform_conformal_localization (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ b c C L₀ : ℝ, 0 < b ∧ 0 < c ∧ 0 < C ∧ 1 < L₀ ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (F : ℂ → ℂ) (Fbar : ℂ → OnePoint ℂ) + (_hF : AnalyticOnNhd ℂ F halfPlane) (_hinj : Set.InjOn F halfPlane) + (_hext : ∀ z ∈ halfPlane, Fbar z = (F z : OnePoint ℂ)) + (_hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (η : ℝ → ℂ) (_hη : ContinuousOn η (Icc 0 1)) (_hη0 : η 0 = 0) + (_hη1 : ‖η 1‖ = 1) (_hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (q : ℂ) (r : ℝ) (_hr : 0 < r) + (_haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' Metric.closedBall q r) + (L : ℝ), L₀ ≤ L → + P {sample | conformalExit Fbar (γ sample) q (L*r) (L^b)} ≤ + ENNReal.ofReal (C*L^(-c)) := by + obtain ⟨c,C,H₀,hc,hC,hH₀,hlog⟩ := logTrace_localization κ hκ + refine ⟨localizationStripWidth,c,C,Real.exp (H₀+1),localizationStripWidth_pos,hc,hC,?_,?_⟩ + · exact Real.one_lt_exp_iff.2 (by linarith) + intro Ω _ P _ B hB γ g f hγ hmaps F Fbar hF hinj hext hcont η hη hη0 hη1 hηH q r hr haccess L hlarge + have hL : 1 < L := (Real.one_lt_exp_iff.2 (by linarith : 0 < H₀+1)).trans_le hlarge + have hLp : 0 < L := zero_lt_one.trans hL + have hH : H₀ ≤ Real.log L := by + have hh := Real.log_le_log (Real.exp_pos (H₀+1)) hlarge + rw [Real.log_exp] at hh + linarith + have hstart : Fbar 0 ∈ (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r := by + simpa [hη0] using haccess 0 (by norm_num : (0:ℝ) ∈ Icc 0 1) + have hm : P {ω | conformalExit Fbar (γ ω) q (L*r) (L^localizationStripWidth)} ≤ + P {ω | logEnergyExit γ Fbar (Real.log L) q r ω} := by + apply measure_mono_ae + filter_upwards [hmaps] with ω hw + intro hexit + exact conformalExit_logEnergyExit hr hL hw.1 hw.2.1 hw.2.2.1 hstart hexit + have hb := hlog P B hB γ g f hγ hmaps F hF hinj Fbar hext hcont q r hr η hη hη0 hη1 hηH haccess (Real.log L) hH + have he : Real.exp (-c*Real.log L) = L^(-c) := by + rw [Real.rpow_def_of_pos hLp] + congr 1 + ring + rw [he] at hb + exact hm.trans hb + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/DriverStability.lean b/lean/OAI/Probability/SLELocalization/DriverStability.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf2ef2bc7dad37bd01382a8652514f8cb5aa2740 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/DriverStability.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Driver Stability estimates. -/ + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal unitInterval +namespace SLEExactGauge.DriverStability +open LoewnerCutoff + +def timePath {T : ℝ} (hT : 0 ≤ T) (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) : C(I,ℝ) := + ⟨fun q => U (T*(q:ℝ)), hU.comp_continuous (continuous_const.mul continuous_subtype_val) + (fun q => ⟨mul_nonneg hT q.property.1,by nlinarith [q.property.2]⟩)⟩ + +lemma extend_timePath {T : ℝ} (hT : 0 < T) (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) : + EqOn (extendDriver T (timePath hT.le U hU)) U (Icc 0 T) := by + intro t ht + have hq : t/T ∈ Icc (0:ℝ) 1 := ⟨div_nonneg ht.1 hT.le,(div_le_one hT).2 ht.2⟩ + change U (T*(projIcc 0 1 zero_le_one (t/T):ℝ)) = U t + rw [projIcc_of_mem _ hq] + congr 1 + field_simp + +lemma timePath_dist_le {T η : ℝ} (hT : 0 ≤ T) (hη : 0 ≤ η) + (U V : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) (hV : ContinuousOn V (Icc 0 T)) + (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ η) : + dist (timePath hT U hU) (timePath hT V hV) ≤ η := by + apply (ContinuousMap.dist_le hη).2 + intro q + exact hUV _ ⟨mul_nonneg hT q.property.1,by nlinarith [q.property.2]⟩ + +lemma radius_of_positive_path + {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T ε : ℝ} (hT : 0 ≤ T) (hε : 0 < ε) + (hU : ContinuousOn U (Icc 0 T)) (V : C(I,ℝ)) (z : ℂ) + (hVU : EqOn (extendDriver T V) U (Icc 0 T)) + (hheight : ∀ t ∈ Icc 0 T, ε ≤ (position hε hT V z t).im) : + z ∈ localizationDomain γ T ∧ LoewnerExit.radius hε hT V z T = loewnerRadius g T z := by + have hh := h.cutoff_solution_live hε hT + (H:=position hε hT V z) + (fun t ht => by rw [← hVU ht]; exact position_derivWithin hε hT V z ht) hheight + rw [position_initial] at hh + have hl : logDerivative hε hT V z T = Real.log ‖deriv (g T) z‖ := by + rw [logDerivative_eq_integral hε hT V z ⟨hT,le_rfl⟩, + h.log_deriv_norm_eq hT hU hh.1] + have hi := (h.continuous_spatialCoefficient hT hU hh.1).intervalIntegrable_of_Icc (μ:=MeasureTheory.volume) hT + rw [← Complex.reCLM_apply,← Complex.reCLM.intervalIntegral_comp_comm hi] + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le hT] at hs + unfold variation + rw [clampIm_eq (by simpa using hheight s hs)] + simp only [← hh.2 hs,hVU hs,Complex.reCLM_apply] + refine ⟨hh.1,?_⟩ + rw [LoewnerExit.radius,hl,Real.exp_log (norm_pos_iff.2 (h.deriv_ne_zero hT hh.1)),← hh.2 ⟨hT,le_rfl⟩] + rfl + +lemma live_radius_stable + {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T ρ : ℝ} (hT : 0 < T) + (hU : ContinuousOn U (Icc 0 T)) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hρ : loewnerRadius g T z < ρ) : + ∃ η : ℝ, 0 < η ∧ ∀ (V : ℝ → ℝ) (ξ : ℝ → ℂ) (G F : ℝ → ℂ → ℂ), + IsLoewnerTraceUsing V ξ G F → ContinuousOn V (Icc 0 T) → + (∀ t ∈ Icc 0 T, |V t-U t| < η) → + z ∈ localizationDomain ξ T ∧ loewnerRadius G T z < ρ := by + let ε : ℝ := (g T z).im/4 + have hε : 0 < ε := div_pos (h.im_pos hT.le hz) (by norm_num) + let u : C(I,ℝ) := timePath hT.le U hU + have heu : EqOn (extendDriver T u) U (Icc 0 T) := extend_timePath hT U hU + have hbase : EqOn (fun t => g t z) (position hε hT.le u z) (Icc 0 T) := + h.eq_cutoff_solution hT.le hε hU hz (by dsimp [ε]; linarith [h.im_pos hT.le hz]) + (position_initial hε hT.le u z) + (fun t ht => by rw [← heu ht]; exact position_derivWithin hε hT.le u z ht) + have hbaseheight (t : ℝ) (ht : t ∈ Icc 0 T) : 4*ε ≤ (position hε hT.le u z t).im := by + rw [← hbase ht] + have hh := h.height_antitone hT.le hz ht ⟨hT.le,le_rfl⟩ ht.2 + dsimp [ε] + linarith + have hver : LoewnerExit.radius hε hT.le u z T = loewnerRadius g T z := + (radius_of_positive_path h hT.le hε hU u z heu (fun t ht => by linarith [hbaseheight t ht])).2 + have hp : ContinuousAt (fun v : C(I,ℝ) => solutionPath hε hT.le v z) u := + (solutionPath_lipschitz hε hT.le z).continuous.continuousAt + have hr : ContinuousAt (fun v : C(I,ℝ) => LoewnerExit.radius hε hT.le v z T) u := + ((LoewnerExit.continuous_radius hε hT.le z).comp (continuous_id.prodMk continuous_const)).continuousAt + have hn1 : ∀ᶠ v in 𝓝 u, dist (solutionPath hε hT.le v z) (solutionPath hε hT.le u z) < ε := + hp.eventually (ball_mem_nhds _ hε) + have hn2 : ∀ᶠ v in 𝓝 u, LoewnerExit.radius hε hT.le v z T < ρ := + hr.eventually (gt_mem_nhds (by change LoewnerExit.radius hε hT.le u z T < ρ; rw [hver]; exact hρ)) + obtain ⟨δ,hδ,hd⟩ := Metric.eventually_nhds_iff.1 (hn1.and hn2) + refine ⟨δ/2,by positivity,fun V ξ G F hξ hV hclose => ?_⟩ + let v : C(I,ℝ) := timePath hT.le V hV + have hev : EqOn (extendDriver T v) V (Icc 0 T) := extend_timePath hT V hV + have hdist : dist v u < δ := + (timePath_dist_le hT.le (by positivity) V U hV hU (fun t ht => (hclose t ht).le)).trans_lt (by linarith) + have hdv := hd hdist + have hh (t : ℝ) (ht : t ∈ Icc 0 T) : ε ≤ (position hε hT.le v z t).im := by + have hdiff : dist (position hε hT.le v z t) (position hε hT.le u z t) < ε := by + rw [position_eq hε hT.le v z ht,position_eq hε hT.le u z ht] + exact (ContinuousMap.dist_apply_le_dist (f:=solutionPath hε hT.le v z) + (g:=solutionPath hε hT.le u z) (⟨t,ht⟩:Icc 0 T)).trans_lt hdv.1 + have him := Complex.abs_im_le_norm (position hε hT.le v z t-position hε hT.le u z t) + rw [dist_eq_norm] at hdiff + simp only [Complex.sub_im] at him + have hlo := neg_abs_le ((position hε hT.le v z t).im-(position hε hT.le u z t).im) + linarith [hbaseheight t ht] + have hs := radius_of_positive_path hξ hT.le hε hV v z hev hh + exact ⟨hs.1,hs.2 ▸ hdv.2⟩ + +end SLEExactGauge.DriverStability + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge + +theorem uniformDriver_forces_tipVisit + {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T r : ℝ} (hT : 0 < T) + (hU : ContinuousOn U (Icc 0 T)) (hqr : 0 < (γ T).im) (hr : 0 < r) : + ∃ η : ℝ, 0 < η ∧ ∀ (V : ℝ → ℝ) (ξ : ℝ → ℂ) (G F : ℝ → ℂ → ℂ), + IsLoewnerTraceUsing V ξ G F → ContinuousOn V (Icc 0 T) → + (∀ t ∈ Icc 0 T, |V t-U t| < η) → + ∃ t ∈ Icc 0 T, ξ t ∈ Metric.ball (γ T) r := by + let q : ℂ := γ T + let a : ℝ := min (r/4) (q.im/4) + have ha : 0 < a := lt_min (by positivity) (by dsimp [q]; positivity) + have har : a ≤ r/4 := min_le_left _ _ + have haq : a ≤ q.im/4 := min_le_right _ _ + let C : ℝ := 512*Real.pi + have hC : 0 < C := by dsimp [C]; positivity + let δ : ℝ := min (a/2) (a/(4*C)) + have hδ : 0 < δ := lt_min (by positivity) (by positivity) + have htip := h.2.2.2.2.2.2.2.2.2.2.2.2.2 T hT.le + have hev : ∀ᶠ (y : ℝ) in 𝓝[>] (0:ℝ), dist (f T ((U T:ℂ)+(y:ℂ)*Complex.I)) q < δ := + htip.eventually (ball_mem_nhds _ hδ) + obtain ⟨y,hy,hyδ⟩ := (Filter.Eventually.and (self_mem_nhdsWithin : ∀ᶠ y : ℝ in 𝓝[>] (0:ℝ), 0 < y) hev).exists + have hypos : 0 < y := hy + let x : ℂ := f T ((U T:ℂ)+(y:ℂ)*Complex.I) + have hx : x ∈ localizationDomain γ T := + h.2.2.2.2.2.2.2.2.1 T hT.le (by simpa [halfPlane] using hypos) + have hxq : dist x q < δ := hyδ + have hxsmall : dist x q < a/2 := hxq.trans_le (min_le_left _ _) + have hnq : q ∉ localizationDomain γ T := by + intro hq + exact hq.1.2 ⟨T,⟨hT.le,le_rfl⟩,rfl⟩ + have hR : loewnerRadius g T x < a/2 := by + calc + _ ≤ C*dist x q := h.radius_le_complement_distance hT.le hx hnq + _ < C*(a/(4*C)) := mul_lt_mul_of_pos_left (hxq.trans_le (min_le_right _ _)) hC + _ = a/4 := by field_simp + _ < a/2 := by linarith + obtain ⟨η,hη,hstable⟩ := DriverStability.live_radius_stable h hT hU hx hR + refine ⟨η,hη,fun V ξ G F hξ hV hclose => ?_⟩ + have hs := hstable V ξ G F hξ hV hclose + by_contra hn + push Not at hn + have hfree : closedBall x a ⊆ halfPlane \ localizationSegment ξ 0 T := by + intro w hw + have hwx : dist w x ≤ a := hw + have hwq : dist w q ≤ dist w x+dist x q := dist_triangle _ _ _ + have hwr : dist w q < r := by linarith + have hwi : dist w q < q.im := by linarith + have him := Complex.abs_im_le_norm (w-q) + have hlo := neg_abs_le (w.im-q.im) + rw [← dist_eq_norm] at him + simp only [Complex.sub_im] at him + refine ⟨by change 0 < w.im; linarith,?_⟩ + rintro ⟨t,ht,he⟩ + apply hn t ht + change dist (ξ t) q < r + simpa only [he] using hwr + have hball := closedBall_subset_survivingDomain ha.le hs.1 hfree + have hl := hξ.radius_ge_half_free_ball hT.le ha hs.1 hball + exact (not_le_of_gt hs.2) hl + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/DyadicKernels.lean b/lean/OAI/Probability/SLELocalization/DyadicKernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..479f8c68a9298bccc26c1c254e7ec5f18ebb8814 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/DyadicKernels.lean @@ -0,0 +1,898 @@ +import Mathlib +import OAI.Probability.SLELocalization.WeightedEnergy + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +open Layer + +lemma annular_invSquare_integral {r R : ℝ} (hr : 0 < r) (hR : r < R) : + (∫⁻ z in {z : ℂ | r < ‖z‖ ∧ ‖z‖ < R}, ENNReal.ofReal (1/‖z‖^2)) ≤ + ENNReal.ofReal (2*Real.pi*Real.log (R/r)) := by + apply (polar_annulus_lintegral_le _ hr).trans + have he : (∫⁻ s in Ioo r R, ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal s*ENNReal.ofReal (1/‖s • circleMap 0 1 θ‖^2)) = + ENNReal.ofReal (2*Real.pi)*(∫⁻ s in Ioo r R, ENNReal.ofReal s⁻¹) := by + calc + _ = ∫⁻ s in Ioo r R, ENNReal.ofReal (2*Real.pi)*ENNReal.ofReal s⁻¹ := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_mem measurableSet_Ioo] with s hs + have hs0 := hr.trans hs.1 + simp only [radial_norm,abs_of_pos hs0] + have hmul : ENNReal.ofReal s*ENNReal.ofReal (1/s^2) = ENNReal.ofReal s⁻¹ := by + rw [← ENNReal.ofReal_mul hs0.le] + congr 1 + field_simp + simp only [hmul,lintegral_const,Measure.restrict_apply_univ,Real.volume_Ioo, + show Real.pi - -Real.pi = 2*Real.pi by ring] + exact mul_comm _ _ + _ = _ := by rw [lintegral_const_mul']; exact ENNReal.ofReal_ne_top + rw [he] + have hc : ContinuousOn (fun s : ℝ => s⁻¹) (Icc r R) := + continuousOn_id.inv₀ (fun s hs => (hr.trans_le hs.1).ne') + have hi : IntegrableOn (fun s : ℝ => s⁻¹) (Ioc r R) := + (hc.intervalIntegrable_of_Icc hR.le).1 + have hnon : 0 ≤ᵐ[volume.restrict (Ioc r R)] (fun s : ℝ => s⁻¹) := by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs + exact inv_nonneg.2 (hr.trans hs.1).le + have hint : (∫ s in r..R, s⁻¹) = Real.log (R/r) := by + apply integral_inv + rw [uIcc_of_le hR.le] + intro hz + exact (not_le_of_gt hr) hz.1 + have heq : (∫⁻ s in Ioo r R, ENNReal.ofReal s⁻¹) = ENNReal.ofReal (Real.log (R/r)) := by + rw [restrict_Ioo_eq_restrict_Ioc,← ofReal_integral_eq_lintegral_ofReal hi hnon, + ← intervalIntegral.integral_of_le hR.le,hint] + rw [heq,← ENNReal.ofReal_mul (by positivity)] + +def annularKernel (r R : ℝ) (z : ℂ) : ℝ≥0∞ := + if r < ‖z‖ ∧ ‖z‖ < R then ENNReal.ofReal (1/‖z‖^2) else 0 + +lemma annularKernel_integral {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + (∫⁻ z : ℂ, annularKernel r (Real.exp H*r) (z-q)) ≤ ENNReal.ofReal (2*Real.pi*H) := by + rw [lintegral_sub_right_eq_self] + have he : annularKernel r (Real.exp H*r) = + {z : ℂ | r < ‖z‖ ∧ ‖z‖ < Real.exp H*r}.indicator (fun z => ENNReal.ofReal (1/‖z‖^2)) := by + ext z + simp [annularKernel,Set.indicator] + have hA : MeasurableSet {z : ℂ | r < ‖z‖ ∧ ‖z‖ < Real.exp H*r} := + (measurableSet_lt measurable_const measurable_norm).inter + (measurableSet_lt measurable_norm measurable_const) + rw [he,lintegral_indicator hA] + have hR : r < Real.exp H*r := (lt_mul_iff_one_lt_left hr).2 (Real.one_lt_exp_iff.2 hH) + have hh := annular_invSquare_integral hr hR + have hlog : Real.log (Real.exp H*r/r) = H := by + rw [mul_div_cancel_right₀ _ hr.ne',Real.log_exp] + simpa only [hlog] using hh + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma complex_real_jacobian (c : ℂ) : + ((ContinuousLinearMap.toSpanSingleton ℂ c).restrictScalars ℝ).det = ‖c‖^2 := by + simp [ContinuousLinearMap.det,LinearMap.det_restrictScalars, + Algebra.norm_complex_eq,Complex.normSq_eq_norm_sq] + +theorem conformal_truncation_energy {U : Set ℂ} (hU : IsOpen U) + {F : ℂ → ℂ} (hF : DifferentiableOn ℂ F U) (hinj : InjOn F U) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + (∫⁻ z in U, ENNReal.ofReal (‖fderiv ℝ (radialTruncation H q r ∘ F) z‖^2)) ≤ + ENNReal.ofReal (2*Real.pi*H) := by + have hchange := lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hU.measurableSet + (fun z hz => ((hF.differentiableAt (hU.mem_nhds hz)).hasDerivAt.hasFDerivAt.restrictScalars ℝ).hasFDerivWithinAt) + hinj (fun w => annularKernel r (Real.exp H*r) (w-q)) + calc + _ ≤ ∫⁻ z in U, ENNReal.ofReal (‖deriv F z‖^2)*annularKernel r (Real.exp H*r) (F z-q) := by + apply setLIntegral_mono' hU.measurableSet + intro z hz + have hb := radialTruncation_fderiv_bound hH.le hr (q := q) + (hF.differentiableAt (hU.mem_nhds hz)) + apply (ENNReal.ofReal_le_ofReal hb).trans + by_cases hh : r < ‖F z-q‖ ∧ ‖F z-q‖ < Real.exp H*r + · rw [ite_eq_left hh,annularKernel,ite_eq_left hh,← ENNReal.ofReal_mul (sq_nonneg _)] + apply le_of_eq + congr 1 + ring + · simp only [ite_eq_right hh,annularKernel,ENNReal.ofReal_zero,mul_zero,le_refl] + _ = ∫⁻ w in F '' U, annularKernel r (Real.exp H*r) (w-q) := by + rw [hchange] + apply setLIntegral_congr_fun hU.measurableSet + intro z hz + dsimp only + rw [complex_real_jacobian,abs_of_nonneg (sq_nonneg _)] + _ ≤ ∫⁻ w : ℂ, annularKernel r (Real.exp H*r) (w-q) := lintegral_mono_set (subset_univ _) |> fun h => by simpa using h + _ ≤ _ := annularKernel_integral hH hr q + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal OnePoint +namespace SLEExactGauge.RectangleEnergy + +def sphereTruncation (H : ℝ) (q : ℂ) (r : ℝ) : OnePoint ℂ → ℝ := + OnePoint.rec H (radialTruncation H q r) + +@[simp] lemma sphereTruncation_coe (H : ℝ) (q : ℂ) (r : ℝ) (z : ℂ) : + sphereTruncation H q r (z : OnePoint ℂ) = radialTruncation H q r z := rfl + +@[simp] lemma sphereTruncation_infty (H : ℝ) (q : ℂ) (r : ℝ) : + sphereTruncation H q r ∞ = H := rfl + +lemma sphereTruncation_continuous {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) : + Continuous (sphereTruncation H q r) := by + rw [continuous_iff_continuousAt] + intro z + induction z using OnePoint.rec with + | infty => + apply OnePoint.continuousAt_infty.2 + intro s hs + refine ⟨closedBall q (Real.exp H*r),isClosed_closedBall,isCompact_closedBall _ _,?_⟩ + intro w hw + have hd : Real.exp H*r ≤ ‖w-q‖ := by + have hn : Real.exp H*r < dist w q := lt_of_not_ge hw + exact (show Real.exp H*r < ‖w-q‖ by simpa [dist_eq_norm] using hn).le + change radialTruncation H q r w ∈ s + rw [radialTruncation_top hH hr hd] + exact mem_of_mem_nhds hs + | coe w => + exact OnePoint.continuousAt_coe.2 (radialTruncation_continuous hr H q).continuousAt + +lemma sphereTruncation_bounds {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + (z : OnePoint ℂ) : 0 ≤ sphereTruncation H q r z ∧ sphereTruncation H q r z ≤ H := by + induction z using OnePoint.rec with + | infty => exact ⟨hH,le_rfl⟩ + | coe w => exact radialTruncation_bounds hH hr q w + +lemma sphereTruncation_top_of_outside {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + {z : OnePoint ℂ} (hz : z ∉ (fun w : ℂ => (w : OnePoint ℂ)) '' ball q (Real.exp H*r)) : + sphereTruncation H q r z = H := by + induction z using OnePoint.rec with + | infty => rfl + | coe w => + apply radialTruncation_top hH hr + have hn : w ∉ ball q (Real.exp H*r) := fun hw => hz ⟨w,hw,rfl⟩ + simpa [mem_ball,dist_eq_norm] using (le_of_not_gt hn : Real.exp H*r ≤ dist w q) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def openStrip : Set ℂ := {z | 0 < z.im ∧ z.im < Real.pi} + +def closedStrip : Set ℂ := {z | 0 ≤ z.im ∧ z.im ≤ Real.pi} + +def stripPotential (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) (z : ℂ) : ℝ := + sphereTruncation H q r (Fbar (Complex.exp z)) + +lemma openStrip_isOpen : IsOpen openStrip := + (isOpen_lt continuous_const Complex.continuous_im).inter + (isOpen_lt Complex.continuous_im continuous_const) + +lemma exp_mem_halfPlane {z : ℂ} (hz : z ∈ openStrip) : 0 < (Complex.exp z).im := by + rw [Complex.exp_im] + exact mul_pos (Real.exp_pos _) (Real.sin_pos_of_pos_of_lt_pi hz.1 hz.2) + +lemma exp_mem_closedHalfPlane {z : ℂ} (hz : z ∈ closedStrip) : 0 ≤ (Complex.exp z).im := by + rw [Complex.exp_im] + exact mul_nonneg (Real.exp_pos _).le (Real.sin_nonneg_of_mem_Icc hz) + +lemma exp_injOn_strip : InjOn Complex.exp openStrip := by + intro z hz w hw hzw + exact Complex.exp_inj_of_neg_pi_lt_of_le_pi + ((neg_lt_zero.2 Real.pi_pos).trans hz.1) hz.2.le + ((neg_lt_zero.2 Real.pi_pos).trans hw.1) hw.2.le hzw + +lemma stripPotential_continuous {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + {Fbar : ℂ → OnePoint ℂ} (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) : + ContinuousOn (stripPotential H q r Fbar) closedStrip := + (sphereTruncation_continuous hH hr q).continuousOn.comp + (hcont.comp Complex.continuous_exp.continuousOn (fun z hz => exp_mem_closedHalfPlane (z := z) hz)) + (fun _ _ => mem_univ _) + +theorem strip_potential_energy {F : ℂ → ℂ} (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + (∫⁻ z in openStrip, ENNReal.ofReal (‖fderiv ℝ (stripPotential H q r Fbar) z‖^2)) ≤ + ENNReal.ofReal (2*Real.pi*H) := by + have hdiff : DifferentiableOn ℂ (F ∘ Complex.exp) openStrip := by + intro z hz + exact ((hF _ (exp_mem_halfPlane hz)).differentiableAt.comp z + (Complex.differentiable_exp z)).differentiableWithinAt + have hi : InjOn (F ∘ Complex.exp) openStrip := + hinj.comp exp_injOn_strip (fun z hz => exp_mem_halfPlane hz) + have hb := conformal_truncation_energy openStrip_isOpen hdiff hi hH hr q + have he : (∫⁻ z in openStrip, ENNReal.ofReal (‖fderiv ℝ (stripPotential H q r Fbar) z‖^2)) = + ∫⁻ z in openStrip, ENNReal.ofReal (‖fderiv ℝ (radialTruncation H q r ∘ (F ∘ Complex.exp)) z‖^2) := by + apply setLIntegral_congr_fun openStrip_isOpen.measurableSet + intro z hz + have heq : stripPotential H q r Fbar =ᶠ[𝓝 z] + (radialTruncation H q r ∘ (F ∘ Complex.exp)) := by + filter_upwards [openStrip_isOpen.mem_nhds hz] with w hw + simp only [stripPotential,hext _ (exp_mem_halfPlane hw),sphereTruncation_coe,Function.comp_apply] + dsimp only + rw [heq.fderiv_eq] + rw [he] + exact hb + +theorem access_section_zero {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + {Fbar : ℂ → OnePoint ℂ} {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) + (hη0 : η 0 = 0) (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + {v : ℝ} (hv : v < 0) : ∃ φ ∈ Icc (0:ℝ) Real.pi, + stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I) = 0 := by + have hm : Real.exp v ∈ Icc ‖η 0‖ ‖η 1‖ := by + rw [hη0,hη1,norm_zero] + exact ⟨(Real.exp_pos _).le,(Real.exp_lt_one_iff.2 hv).le⟩ + obtain ⟨t,ht,he⟩ := intermediate_value_Icc (by norm_num : (0:ℝ) ≤ 1) hη.norm hm + dsimp only at he + have henz : η t ≠ 0 := norm_ne_zero_iff.1 (by rw [he]; exact (Real.exp_pos _).ne') + have hlogRe : (Complex.log (η t)).re = v := by rw [Complex.log_re,he,Real.log_exp] + have hlog : (v:ℂ)+(Complex.arg (η t):ℂ)*Complex.I = Complex.log (η t) := by + rw [← hlogRe,← Complex.log_im] + exact Complex.re_add_im _ + refine ⟨Complex.arg (η t),⟨Complex.arg_nonneg_iff.2 (hηH t ht),Complex.arg_le_pi _⟩,?_⟩ + obtain ⟨w,hw,hew⟩ := haccess t ht + simp only [stripPotential,hlog,Complex.exp_log henz,← hew,sphereTruncation_coe] + apply radialTruncation_zero hH hr + simpa only [mem_closedBall,dist_eq_norm] using hw + +lemma stripPotential_interior_eq {F : ℂ → ℂ} {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (H r : ℝ) (q : ℂ) {z : ℂ} (hz : z ∈ openStrip) : + stripPotential H q r Fbar =ᶠ[𝓝 z] radialTruncation H q r ∘ (F ∘ Complex.exp) := by + filter_upwards [openStrip_isOpen.mem_nhds hz] with w hw + simp only [stripPotential,hext _ (exp_mem_halfPlane hw),sphereTruncation_coe,Function.comp_apply] + +lemma stripPotential_vertical_AC_interior {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hr : 0 < r) (q : ℂ) (v : ℝ) {a b : ℝ} + (ha : a ∈ Ioo (0:ℝ) Real.pi) (hb : b ∈ Ioo (0:ℝ) Real.pi) : + AbsolutelyContinuousOnInterval + (fun φ : ℝ => stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I)) a b := by + let c := fun φ : ℝ => (v:ℂ)+(φ:ℂ)*Complex.I + have hc : ContDiff ℝ 1 c := contDiff_const.add (Complex.ofRealCLM.contDiff.mul contDiff_const) + have hmap : MapsTo c (uIcc a b) openStrip := by + intro φ hφ + have hlo : 0 < φ := lt_of_lt_of_le (lt_min ha.1 hb.1) hφ.1 + have hhi : φ < Real.pi := lt_of_le_of_lt hφ.2 (max_lt ha.2 hb.2) + simpa [c,openStrip] using And.intro hlo hhi + have hdiff : DifferentiableOn ℂ (F ∘ Complex.exp) openStrip := by + intro z hz + exact ((hF _ (exp_mem_halfPlane hz)).differentiableAt.comp z + (Complex.differentiable_exp z)).differentiableWithinAt + have hG : ContDiffOn ℝ 1 ((F ∘ Complex.exp) ∘ c) (uIcc a b) := + ((hdiff.contDiffOn openStrip_isOpen).restrict_scalars ℝ).comp hc.contDiffOn hmap + apply acl_congr (radialTruncation_along_C1_AC hr H q hG) + intro φ hφ + exact ((stripPotential_interior_eq hext H r q (hmap hφ)).self_of_nhds).symm + +lemma stripPotential_vertical_deriv {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) (v : ℝ) {φ : ℝ} + (hφ : φ ∈ Ioo (0:ℝ) Real.pi) : + deriv (fun ψ : ℝ => stripPotential H q r Fbar ((v:ℂ)+(ψ:ℂ)*Complex.I)) φ = + fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(φ:ℂ)*Complex.I) Complex.I := by + let c := fun ψ : ℝ => (v:ℂ)+(ψ:ℂ)*Complex.I + have hmem : c φ ∈ openStrip := by simpa [c,openStrip] using hφ + have he := stripPotential_interior_eq hext H r q hmem + have hc : HasDerivAt c Complex.I φ := by + simpa [c,Complex.ofRealCLM] using ((Complex.ofRealCLM.hasDerivAt).mul_const Complex.I).const_add (v:ℂ) + have hd := radialTruncation_directional_deriv hH hr q (c := c) (t := φ) (d := Complex.I) + ((hF _ (exp_mem_halfPlane hmem)).differentiableAt.comp _ (Complex.differentiable_exp _)) hc + rw [← he.fderiv_eq] at hd + refine (he.comp_tendsto hc.continuousAt).deriv_eq.trans hd + +theorem stripPotential_vertical_zero_energy {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) (v : ℝ) + (hE : MemLp (fun φ : ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) + ((v:ℂ)+(φ:ℂ)*Complex.I)‖) 2 (volume.restrict (Ioc (0:ℝ) Real.pi))) + {z : ℝ} (hz : z ∈ Icc (0:ℝ) Real.pi) + (hzero : stripPotential H q r Fbar ((v:ℂ)+(z:ℂ)*Complex.I) = 0) + {φ : ℝ} (hφ : φ ∈ Icc (0:ℝ) Real.pi) : + (stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I))^2 ≤ + Real.pi*(∫ ψ in (0:ℝ)..Real.pi, ‖fderiv ℝ (stripPotential H q r Fbar) + ((v:ℂ)+(ψ:ℂ)*Complex.I)‖^2) := by + let f := fun φ : ℝ => stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I) + let e := fun φ : ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(φ:ℂ)*Complex.I)‖ + have hb : ∀ᵐ ψ ∂volume.restrict (Ioc (0:ℝ) Real.pi), ‖deriv f ψ‖ ≤ e ψ := by + rw [← restrict_Ioo_eq_restrict_Ioc] + filter_upwards [ae_restrict_mem measurableSet_Ioo] with ψ hψ + rw [stripPotential_vertical_deriv hF hext hH hr q v hψ] + simpa only [e,Complex.norm_I,mul_one] using + (fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(ψ:ℂ)*Complex.I)).le_opNorm Complex.I + have hD := hE.mono' (aestronglyMeasurable_deriv f _) hb + have hc : ContinuousOn f (Icc 0 Real.pi) := + (stripPotential_continuous hH hr q hcont).comp + (continuous_const.add (Complex.continuous_ofReal.mul_const _)).continuousOn + (by intro ψ hψ; simpa [closedStrip] using hψ) + have ht := boundary_zero_energy Real.pi_pos hc hD + (fun a ha b hb => stripPotential_vertical_AC_interior hF hext hr q v ha hb) hz hzero hφ + have hm : (∫ ψ in (0:ℝ)..Real.pi, (deriv f ψ)^2) ≤ + ∫ ψ in (0:ℝ)..Real.pi, (e ψ)^2 := by + simp only [intervalIntegral.integral_of_le Real.pi_pos.le] + apply integral_mono_ae hD.integrable_sq hE.integrable_sq + filter_upwards [hb] with ψ hψ + simpa only [Real.norm_eq_abs,sq_abs] using pow_le_pow_left₀ (norm_nonneg _) hψ 2 + simp only [sub_zero] at ht + exact ht.trans (mul_le_mul_of_nonneg_left hm Real.pi_pos.le) + +lemma strip_energy_integrable {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + IntegrableOn (fun z => ‖fderiv ℝ (stripPotential H q r Fbar) z‖^2) openStrip := by + refine ⟨((measurable_fderiv ℝ _).norm.pow_const 2).aestronglyMeasurable,?_⟩ + rw [hasFiniteIntegral_iff_ofReal (ae_of_all _ (fun z => sq_nonneg _))] + exact (strip_potential_energy hF hinj hext hH hr q).trans_lt (ENNReal.ofReal_lt_top) + +lemma strip_energy_integrable_prod {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + Integrable (fun p : ℝ × ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2) + (volume.prod (volume.restrict (Ioo (0:ℝ) Real.pi))) := by + have hi := (Complex.volume_preserving_equiv_real_prod.symm _).integrableOn_comp_preimage + Complex.measurableEquivRealProd.symm.measurableEmbedding |>.2 + (strip_energy_integrable hF hinj hext hH hr q) + have hs : Complex.measurableEquivRealProd.symm ⁻¹' openStrip = + (univ : Set ℝ).prod (Ioo (0:ℝ) Real.pi) := by + ext p + change (0 < p.2 ∧ p.2 < Real.pi) ↔ True ∧ (0 < p.2 ∧ p.2 < Real.pi) + simp + rw [hs] at hi + change Integrable _ ((volume.prod volume).restrict ((univ : Set ℝ) ×ˢ Ioo (0:ℝ) Real.pi)) at hi + rw [← Measure.prod_restrict,Measure.restrict_univ] at hi + convert hi using 1 + funext p + have hp : (p.1:ℂ)+(p.2:ℂ)*Complex.I = Complex.measurableEquivRealProd.symm p := by + apply Complex.ext <;> simp + rw [hp] + rfl + +theorem strip_vertical_memLp_ae {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + ∀ᵐ v : ℝ, MemLp (fun φ : ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) + ((v:ℂ)+(φ:ℂ)*Complex.I)‖) 2 (volume.restrict (Ioc (0:ℝ) Real.pi)) := by + have hi := (strip_energy_integrable_prod hF hinj hext hH hr q).prod_right_ae + filter_upwards [hi] with v hv + rw [← restrict_Ioo_eq_restrict_Ioc] + apply (memLp_two_iff_integrable_sq ?_).2 hv + exact ((measurable_fderiv ℝ _).comp + ((measurable_const.add (Complex.measurable_ofReal.mul_const _)))).norm.aestronglyMeasurable + +theorem strip_negative_section_energy {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) (hη0 : η 0 = 0) + (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) : + ∀ᵐ v : ℝ, v < 0 → ∀ φ ∈ Icc (0:ℝ) Real.pi, + (stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I))^2 ≤ + Real.pi*(∫ ψ in (0:ℝ)..Real.pi, ‖fderiv ℝ (stripPotential H q r Fbar) + ((v:ℂ)+(ψ:ℂ)*Complex.I)‖^2) := by + filter_upwards [strip_vertical_memLp_ae hF hinj hext hH hr q] with v hv + intro hv0 φ hφ + obtain ⟨z,hz,hzero⟩ := access_section_zero hH.le hr q hη hη0 hη1 hηH haccess hv0 + exact stripPotential_vertical_zero_energy hF hext hcont hH.le hr q v hv hz hzero hφ + +lemma mean_difference_abs_le {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + {μ : Measure α} {ν : Measure β} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {u : α → ℝ} {v : β → ℝ} (hu : Integrable u μ) (hv : Integrable v ν) : + |(∫ x, u x ∂μ)-(∫ y, v y ∂ν)| ≤ ∫ x, ∫ y, |u x-v y| ∂ν ∂μ := by + have hD : Integrable (fun p : α × β => u p.1-v p.2) (μ.prod ν) := + (hu.comp_fst ν).sub (hv.comp_snd μ) + have he : (∫ p : α × β, u p.1-v p.2 ∂μ.prod ν) = + (∫ x, u x ∂μ)-(∫ y, v y ∂ν) := by + rw [integral_prod _ hD] + simp_rw [integral_sub (integrable_const _) hv] + simp only [integral_const,probReal_univ,one_smul] + rw [integral_sub hu (integrable_const _)] + simp + have hh := norm_integral_le_integral_norm (μ := μ.prod ν) (fun p : α × β => u p.1-v p.2) + rw [he,integral_prod _ hD.norm] at hh + simpa only [Real.norm_eq_abs] using hh + +theorem rectangle_mean_L1_bound {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ μ' : Measure X} {ν ν' : Measure Y} + [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] + [IsProbabilityMeasure ν] [IsProbabilityMeasure ν'] + {u : X × Y → ℝ} (hu : Integrable u (μ.prod ν)) (hu' : Integrable u (μ'.prod ν')) + {R : Y → ℝ} {C : X → ℝ} (hR : Integrable R ν') (hC : Integrable C μ) + (hbound : ∀ᵐ p ∂μ'.prod ν', ∀ᵐ q ∂μ.prod ν, |u p-u q| ≤ R p.2+C q.1) : + |(∫ p, u p ∂μ'.prod ν')-(∫ p, u p ∂μ.prod ν)| ≤ + (∫ y, R y ∂ν')+(∫ x, C x ∂μ) := by + let A := μ'.prod ν' + let B := μ.prod ν + have hD : Integrable (fun p : (X × Y) × (X × Y) => |u p.1-u p.2|) (A.prod B) := + ((hu'.comp_fst B).sub (hu.comp_snd A)).abs + have hRi : Integrable (fun p : X × Y => R p.2) A := hR.comp_snd μ' + have hCi : Integrable (fun p : X × Y => C p.1) B := hC.comp_fst ν + have heC : (∫ p : X × Y, C p.1 ∂B) = ∫ x, C x ∂μ := by + rw [integral_prod _ hCi] + simp only [integral_const,probReal_univ,one_smul] + have heR : (∫ p : X × Y, R p.2 ∂A) = ∫ y, R y ∂ν' := by + rw [integral_prod _ hRi] + simp only [integral_const,probReal_univ,one_smul] + calc + _ ≤ ∫ p, ∫ q, |u p-u q| ∂B ∂A := mean_difference_abs_le hu' hu + _ ≤ ∫ p, R p.2+(∫ q, C q.1 ∂B) ∂A := by + apply integral_mono_ae hD.integral_prod_left (hRi.add (integrable_const _)) + filter_upwards [hD.prod_right_ae,hbound] with p hp hb + calc + _ ≤ ∫ q, R p.2+C q.1 ∂B := integral_mono_ae hp ((integrable_const _).add hCi) hb + _ = _ := by rw [integral_add (integrable_const _) hCi]; simp + _ = _ := by + rw [integral_add hRi (integrable_const _),heC,heR] + simp + +def intervalProb (a b : ℝ) : Measure ℝ := + (ENNReal.ofReal (b-a))⁻¹ • volume.restrict (Ioc a b) + +lemma intervalProb_isProbability {a b : ℝ} (hab : a < b) : IsProbabilityMeasure (intervalProb a b) := by + constructor + simp only [intervalProb,Measure.smul_apply,Measure.restrict_apply_univ,smul_eq_mul,Real.volume_Ioc] + exact ENNReal.inv_mul_cancel (ENNReal.ofReal_ne_zero_iff.2 (sub_pos.2 hab)) ENNReal.ofReal_ne_top + +lemma integral_intervalProb {a b : ℝ} (hab : a ≤ b) (f : ℝ → ℝ) : + (∫ x, f x ∂intervalProb a b) = (b-a)⁻¹*(∫ x in a..b, f x) := by + rw [intervalProb,integral_smul_measure,ENNReal.toReal_inv,ENNReal.toReal_ofReal (sub_nonneg.2 hab), + smul_eq_mul,intervalIntegral.integral_of_le hab] + +lemma intervalProb_ae {a b : ℝ} {p : ℝ → Prop} : + (∀ᵐ x ∂intervalProb a b, p x) ↔ ∀ᵐ x ∂volume.restrict (Ioc a b), p x := by + exact Measure.ae_ennreal_smul_measure_iff (ENNReal.inv_ne_zero.2 ENNReal.ofReal_ne_top) + +lemma integrable_intervalProb {a b : ℝ} (hab : a < b) {f : ℝ → ℝ} + (hf : IntegrableOn f (Ioc a b)) : Integrable f (intervalProb a b) := by + exact hf.smul_measure (ENNReal.inv_ne_top.2 (ENNReal.ofReal_ne_zero_iff.2 (sub_pos.2 hab))) + +lemma intervalProb_integral_subinterval {a b c d K : ℝ} (hab : a < b) (hcd : c < d) + (hac : a ≤ c) (hdb : d ≤ b) (hK : 0 ≤ K) (hlen : b-a ≤ K*(d-c)) + {f : ℝ → ℝ} (hf : IntegrableOn f (Ioc a b)) + (hf0 : ∀ᵐ x ∂volume.restrict (Ioc a b), 0 ≤ f x) : + (∫ x, f x ∂intervalProb c d) ≤ K*(∫ x, f x ∂intervalProb a b) := by + have hsub : Ioc c d ⊆ Ioc a b := fun x hx => ⟨hac.trans_lt hx.1,hx.2.trans hdb⟩ + have him : (∫ x in c..d, f x) ≤ ∫ x in a..b, f x := by + rw [intervalIntegral.integral_of_le hcd.le,intervalIntegral.integral_of_le hab.le] + exact setIntegral_mono_set hf hf0 (ae_of_all _ (fun x hx => hsub hx)) + have hnon : 0 ≤ ∫ x in a..b, f x := by + rw [intervalIntegral.integral_of_le hab.le] + exact integral_nonneg_of_ae hf0 + have hcoef : (d-c)⁻¹ ≤ K*(b-a)⁻¹ := by + rw [← one_div,← div_eq_mul_inv] + exact (div_le_div_iff₀ (sub_pos.2 hcd) (sub_pos.2 hab)).2 (by simpa using hlen) + rw [integral_intervalProb hcd.le,integral_intervalProb hab.le] + calc + _ ≤ (d-c)⁻¹*(∫ x in a..b, f x) := mul_le_mul_of_nonneg_left him (inv_nonneg.2 (sub_nonneg.2 hcd.le)) + _ ≤ (K*(b-a)⁻¹)*(∫ x in a..b, f x) := + mul_le_mul hcoef le_rfl hnon (mul_nonneg hK (inv_nonneg.2 (sub_nonneg.2 hab.le))) + _ = _ := by ring + +lemma acl_line_L1 {a b : ℝ} {f g : ℝ → ℝ} + (hf : AbsolutelyContinuousOnInterval f a b) + (hg : IntegrableOn g (Ioc a b)) + (hbound : ∀ᵐ s ∂volume.restrict (Ioc a b), ‖deriv f s‖ ≤ g s) + {x y : ℝ} (hx : x ∈ Icc a b) (hy : y ∈ Icc a b) : + |f y-f x| ≤ ∫ s in a..b, g s := by + have hab := hx.1.trans hx.2 + have hD : IntegrableOn (deriv f) (Ioc a b) := + hg.mono' (aestronglyMeasurable_deriv f _) hbound + suffices ∀ x ∈ Icc a b, ∀ y ∈ Icc a b, x ≤ y → + |f y-f x| ≤ ∫ s in a..b, g s by + rcases le_total x y with h | h + · exact this x hx y hy h + · simpa only [abs_sub_comm] using this y hy x hx h + intro x hx y hy hxy + have hsub : Ioc x y ⊆ Ioc a b := fun s hs => ⟨hx.1.trans_lt hs.1,hs.2.trans hy.2⟩ + have hfac : AbsolutelyContinuousOnInterval f x y := hf.mono + (by simpa only [uIcc_of_le hab,uIcc_of_le hxy] using Icc_subset_Icc hx.1 hy.2) + calc + _ = ‖∫ s in x..y, deriv f s‖ := by rw [hfac.integral_deriv_eq_sub,Real.norm_eq_abs] + _ ≤ ∫ s in x..y, ‖deriv f s‖ := intervalIntegral.norm_integral_le_integral_norm hxy + _ ≤ ∫ s in a..b, ‖deriv f s‖ := by + rw [intervalIntegral.integral_of_le hxy,intervalIntegral.integral_of_le hab] + exact setIntegral_mono_set hD.norm (ae_of_all _ (fun s => norm_nonneg _)) + (ae_of_all _ (fun s hs => hsub hs)) + _ ≤ ∫ s in a..b, g s := by + rw [intervalIntegral.integral_of_le hab,intervalIntegral.integral_of_le hab] + exact integral_mono_ae hD.norm hg hbound + +theorem rectangle_poincare_L1 {a b c d a' b' c' d' K : ℝ} + (hab : a < b) (hcd : c < d) (hab' : a' < b') (hcd' : c' < d') + (haa : a ≤ a') (hbb : b' ≤ b) (hcc : c ≤ c') (hdd : d' ≤ d) + (hK : 0 ≤ K) (hlen : d-c ≤ K*(d'-c')) + {u g : ℝ × ℝ → ℝ} + (hu : Integrable u ((intervalProb a b).prod (intervalProb c d))) + (hu' : Integrable u ((intervalProb a' b').prod (intervalProb c' d'))) + (hg : Integrable g ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d)))) + (hg0 : ∀ p, 0 ≤ g p) + (hhor : ∀ᵐ y ∂volume.restrict (Ioc c d), + AbsolutelyContinuousOnInterval (fun x => u (x,y)) a b ∧ + ∀ᵐ x ∂volume.restrict (Ioc a b), ‖deriv (fun s => u (s,y)) x‖ ≤ g (x,y)) + (hver : ∀ᵐ x ∂volume.restrict (Ioc a b), + AbsolutelyContinuousOnInterval (fun y => u (x,y)) c d ∧ + ∀ᵐ y ∂volume.restrict (Ioc c d), ‖deriv (fun s => u (x,s)) y‖ ≤ g (x,y)) : + |(∫ p, u p ∂(intervalProb a' b').prod (intervalProb c' d'))- + (∫ p, u p ∂(intervalProb a b).prod (intervalProb c d))| ≤ + (K/(d-c)+1/(b-a))*(∫ p, g p ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + let := intervalProb_isProbability hab + let := intervalProb_isProbability hcd + let := intervalProb_isProbability hab' + let := intervalProb_isProbability hcd' + let R := fun y => ∫ x in a..b, g (x,y) + let C := fun x => ∫ y in c..d, g (x,y) + have hRi : IntegrableOn R (Ioc c d) := by + simpa only [IntegrableOn,R,intervalIntegral.integral_of_le hab.le] using hg.integral_prod_right + have hCi : IntegrableOn C (Ioc a b) := by + simpa only [IntegrableOn,C,intervalIntegral.integral_of_le hcd.le] using hg.integral_prod_left + have subX : Ioc a' b' ⊆ Ioc a b := fun x hx => ⟨haa.trans_lt hx.1,hx.2.trans hbb⟩ + have subY : Ioc c' d' ⊆ Ioc c d := fun y hy => ⟨hcc.trans_lt hy.1,hy.2.trans hdd⟩ + have hH : ∀ᵐ y ∂intervalProb c' d', ∀ x₁ ∈ Icc a b, ∀ x₂ ∈ Icc a b, + |u (x₁,y)-u (x₂,y)| ≤ R y := by + apply intervalProb_ae.2 + apply (ae_mono (Measure.restrict_mono_set volume subY)) + filter_upwards [hhor,hg.prod_left_ae] with y hy hgy + intro x₁ hx₁ x₂ hx₂ + exact acl_line_L1 hy.1 hgy hy.2 hx₂ hx₁ + have hV : ∀ᵐ x ∂intervalProb a b, ∀ y₁ ∈ Icc c d, ∀ y₂ ∈ Icc c d, + |u (x,y₁)-u (x,y₂)| ≤ C x := by + apply intervalProb_ae.2 + filter_upwards [hver,hg.prod_right_ae] with x hx hgx + intro y₁ hy₁ y₂ hy₂ + exact acl_line_L1 hx.1 hgx hx.2 hy₂ hy₁ + have hmem {l r : ℝ} : ∀ᵐ x ∂intervalProb l r, x ∈ Icc l r := + intervalProb_ae.2 ((ae_restrict_mem measurableSet_Ioc).mono (fun x hx => Ioc_subset_Icc_self hx)) + have hb : ∀ᵐ p ∂(intervalProb a' b').prod (intervalProb c' d'), + ∀ᵐ q ∂(intervalProb a b).prod (intervalProb c d), |u p-u q| ≤ R p.2+C q.1 := by + have hpX := (Measure.quasiMeasurePreserving_fst (μ := intervalProb a' b') (ν := intervalProb c' d')).tendsto_ae.eventually (hmem (l := a') (r := b')) + have hpY := (Measure.quasiMeasurePreserving_snd (μ := intervalProb a' b') (ν := intervalProb c' d')).tendsto_ae.eventually (hmem (l := c') (r := d')) + have hpH := (Measure.quasiMeasurePreserving_snd (μ := intervalProb a' b') (ν := intervalProb c' d')).tendsto_ae.eventually hH + have hqX := (Measure.quasiMeasurePreserving_fst (μ := intervalProb a b) (ν := intervalProb c d)).tendsto_ae.eventually (hmem (l := a) (r := b)) + have hqY := (Measure.quasiMeasurePreserving_snd (μ := intervalProb a b) (ν := intervalProb c d)).tendsto_ae.eventually (hmem (l := c) (r := d)) + have hqV := (Measure.quasiMeasurePreserving_fst (μ := intervalProb a b) (ν := intervalProb c d)).tendsto_ae.eventually hV + filter_upwards [hpX,hpY,hpH] with p hpx hpy hph + filter_upwards [hqX,hqY,hqV] with q hqx hqy hqv + have hpx' : p.1 ∈ Icc a b := ⟨haa.trans hpx.1,hpx.2.trans hbb⟩ + have hpy' : p.2 ∈ Icc c d := ⟨hcc.trans hpy.1,hpy.2.trans hdd⟩ + exact (abs_sub_le (u p) (u (q.1,p.2)) (u q)).trans + (add_le_add (hph p.1 hpx' q.1 hqx) (hqv p.2 hpy' q.2 hqy)) + have hmain := rectangle_mean_L1_bound hu hu' + (integrable_intervalProb hcd' (hRi.mono_set subY)) (integrable_intervalProb hab hCi) hb + have hR0 : ∀ y, 0 ≤ R y := fun y => intervalIntegral.integral_nonneg hab.le (fun x hx => hg0 (x,y)) + have hRbound := intervalProb_integral_subinterval hcd hcd' hcc hdd hK hlen hRi (ae_of_all _ hR0) + have hRE : (∫ y, R y ∂intervalProb c d) = + (d-c)⁻¹*(∫ p, g p ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + rw [integral_intervalProb hcd.le] + congr 1 + rw [intervalIntegral.integral_of_le hcd.le,integral_prod_symm _ hg] + simp only [R,intervalIntegral.integral_of_le hab.le] + have hCE : (∫ x, C x ∂intervalProb a b) = + (b-a)⁻¹*(∫ p, g p ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + rw [integral_intervalProb hab.le] + congr 1 + rw [intervalIntegral.integral_of_le hab.le,integral_prod _ hg] + simp only [C,intervalIntegral.integral_of_le hcd.le] + calc + _ ≤ (∫ y, R y ∂intervalProb c' d')+(∫ x, C x ∂intervalProb a b) := hmain + _ ≤ K*(∫ y, R y ∂intervalProb c d)+(∫ x, C x ∂intervalProb a b) := add_le_add hRbound le_rfl + _ = _ := by rw [hRE,hCE]; ring + +lemma stripPotential_horizontal_AC {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hr : 0 < r) (q : ℂ) {φ : ℝ} + (hφ : φ ∈ Ioo (0:ℝ) Real.pi) (a b : ℝ) : + AbsolutelyContinuousOnInterval + (fun v : ℝ => stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I)) a b := by + let c := fun v : ℝ => (v:ℂ)+(φ:ℂ)*Complex.I + have hc : ContDiff ℝ 1 c := Complex.ofRealCLM.contDiff.add contDiff_const + have hmap : MapsTo c (uIcc a b) openStrip := by + intro v hv + simpa [c,openStrip] using hφ + have hdiff : DifferentiableOn ℂ (F ∘ Complex.exp) openStrip := by + intro z hz + exact ((hF _ (exp_mem_halfPlane hz)).differentiableAt.comp z + (Complex.differentiable_exp z)).differentiableWithinAt + have hG : ContDiffOn ℝ 1 ((F ∘ Complex.exp) ∘ c) (uIcc a b) := + ((hdiff.contDiffOn openStrip_isOpen).restrict_scalars ℝ).comp hc.contDiffOn hmap + apply acl_congr (radialTruncation_along_C1_AC hr H q hG) + intro v hv + exact ((stripPotential_interior_eq hext H r q (hmap hv)).self_of_nhds).symm + +lemma stripPotential_horizontal_deriv {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) (v : ℝ) {φ : ℝ} + (hφ : φ ∈ Ioo (0:ℝ) Real.pi) : + deriv (fun s : ℝ => stripPotential H q r Fbar ((s:ℂ)+(φ:ℂ)*Complex.I)) v = + fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(φ:ℂ)*Complex.I) 1 := by + let c := fun s : ℝ => (s:ℂ)+(φ:ℂ)*Complex.I + have hmem : c v ∈ openStrip := by simpa [c,openStrip] using hφ + have he := stripPotential_interior_eq hext H r q hmem + have hc : HasDerivAt c 1 v := by + simpa [c,Complex.ofRealCLM] using Complex.ofRealCLM.hasDerivAt.add_const ((φ:ℂ)*Complex.I) + have hd := radialTruncation_directional_deriv hH hr q (c := c) (t := v) (d := 1) + ((hF _ (exp_mem_halfPlane hmem)).differentiableAt.comp _ (Complex.differentiable_exp _)) hc + rw [← he.fderiv_eq] at hd + exact (he.comp_tendsto hc.continuousAt).deriv_eq.trans hd + +lemma stripPotential_vertical_AC {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) (v : ℝ) + (hE : MemLp (fun φ : ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) + ((v:ℂ)+(φ:ℂ)*Complex.I)‖) 2 (volume.restrict (Ioc (0:ℝ) Real.pi))) : + AbsolutelyContinuousOnInterval + (fun φ : ℝ => stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I)) 0 Real.pi := by + let f := fun φ : ℝ => stripPotential H q r Fbar ((v:ℂ)+(φ:ℂ)*Complex.I) + have hb : ∀ᵐ ψ ∂volume.restrict (Ioc (0:ℝ) Real.pi), ‖deriv f ψ‖ ≤ + ‖fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(ψ:ℂ)*Complex.I)‖ := by + rw [← restrict_Ioo_eq_restrict_Ioc] + filter_upwards [ae_restrict_mem measurableSet_Ioo] with ψ hψ + rw [stripPotential_vertical_deriv hF hext hH hr q v hψ] + simpa only [Complex.norm_I,mul_one] using + (fderiv ℝ (stripPotential H q r Fbar) ((v:ℂ)+(ψ:ℂ)*Complex.I)).le_opNorm Complex.I + have hD := hE.mono' (aestronglyMeasurable_deriv f _) hb + have hc : ContinuousOn f (Icc 0 Real.pi) := + (stripPotential_continuous hH hr q hcont).comp + (continuous_const.add (Complex.continuous_ofReal.mul_const _)).continuousOn + (by intro ψ hψ; simpa [closedStrip] using hψ) + exact acl_of_interior Real.pi_pos hc + ((intervalIntegrable_iff_integrableOn_Ioc_of_le Real.pi_pos.le).2 (hD.integrable (by norm_num))) + (fun a ha b hb => stripPotential_vertical_AC_interior hF hext hr q v ha hb) + +theorem strip_coordinate_ACL {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {a b c d : ℝ} (hcd : c < d) (hc : 0 ≤ c) (hd : d ≤ Real.pi) : + (∀ᵐ y : ℝ ∂volume.restrict (Ioc c d), + AbsolutelyContinuousOnInterval + (fun x : ℝ => stripPotential H q r Fbar ((x:ℂ)+(y:ℂ)*Complex.I)) a b ∧ + ∀ᵐ x : ℝ ∂volume.restrict (Ioc a b), + ‖deriv (fun s : ℝ => stripPotential H q r Fbar ((s:ℂ)+(y:ℂ)*Complex.I)) x‖ ≤ + ‖fderiv ℝ (stripPotential H q r Fbar) ((x:ℂ)+(y:ℂ)*Complex.I)‖) ∧ + (∀ᵐ x : ℝ ∂volume.restrict (Ioc a b), + AbsolutelyContinuousOnInterval + (fun y : ℝ => stripPotential H q r Fbar ((x:ℂ)+(y:ℂ)*Complex.I)) c d ∧ + ∀ᵐ y : ℝ ∂volume.restrict (Ioc c d), + ‖deriv (fun s : ℝ => stripPotential H q r Fbar ((x:ℂ)+(s:ℂ)*Complex.I)) y‖ ≤ + ‖fderiv ℝ (stripPotential H q r Fbar) ((x:ℂ)+(y:ℂ)*Complex.I)‖) := by + have hy : ∀ᵐ y : ℝ ∂volume.restrict (Ioc c d), y ∈ Ioo (0:ℝ) Real.pi := by + rw [← restrict_Ioo_eq_restrict_Ioc] + filter_upwards [ae_restrict_mem measurableSet_Ioo] with y hy + exact ⟨hc.trans_lt hy.1,hy.2.trans_le hd⟩ + constructor + · filter_upwards [hy] with y hy + refine ⟨stripPotential_horizontal_AC hF hext hr q hy a b,ae_of_all _ (fun x => ?_)⟩ + rw [stripPotential_horizontal_deriv hF hext hH.le hr q x hy] + simpa only [norm_one,mul_one] using + (fderiv ℝ (stripPotential H q r Fbar) ((x:ℂ)+(y:ℂ)*Complex.I)).le_opNorm 1 + · filter_upwards [(strip_vertical_memLp_ae hF hinj hext hH hr q).filter_mono + (ae_mono Measure.restrict_le_self)] with x hx + refine ⟨(stripPotential_vertical_AC hF hext hcont hH.le hr q x hx).mono ?_,?_⟩ + · rw [uIcc_of_le hcd.le,uIcc_of_le Real.pi_pos.le] + exact fun y hy => ⟨hc.trans hy.1,hy.2.trans hd⟩ + · filter_upwards [hy] with y hy + rw [stripPotential_vertical_deriv hF hext hH.le hr q x hy] + simpa only [Complex.norm_I,mul_one] using + (fderiv ℝ (stripPotential H q r Fbar) ((x:ℂ)+(y:ℂ)*Complex.I)).le_opNorm Complex.I + +lemma strip_gradient_rect_memLp {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + (a b : ℝ) {c d : ℝ} (hc : 0 ≤ c) (hd : d ≤ Real.pi) : + MemLp (fun p : ℝ × ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖) 2 + ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + have hi := strip_energy_integrable_prod hF hinj hext hH hr q + rw [restrict_Ioo_eq_restrict_Ioc] at hi + have hm : (volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d)) ≤ + volume.prod (volume.restrict (Ioc (0:ℝ) Real.pi)) := + Measure.prod_mono Measure.restrict_le_self (Measure.restrict_mono_set _ + (fun y hy => ⟨hc.trans_lt hy.1,hy.2.trans hd⟩)) + apply (memLp_two_iff_integrable_sq ?_).2 (hi.mono_measure hm) + exact ((measurable_fderiv ℝ _).comp + ((Complex.measurable_ofReal.comp measurable_fst).add + ((Complex.measurable_ofReal.comp measurable_snd).mul_const _))).norm.aestronglyMeasurable + +lemma strip_potential_rect_integrable {Fbar : ℂ → OnePoint ℂ} + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + (a b : ℝ) {c d : ℝ} (hc : 0 ≤ c) (hd : d ≤ Real.pi) : + Integrable (fun p : ℝ × ℝ => stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I)) + ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + have hh : ContinuousOn (fun p : ℝ × ℝ => stripPotential H q r Fbar + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)) ((Icc a b).prod (Icc c d)) := + (stripPotential_continuous hH hr q hcont).comp + ((Complex.continuous_ofReal.comp continuous_fst).add + ((Complex.continuous_ofReal.comp continuous_snd).mul_const _)).continuousOn + (by intro p hp; simpa [closedStrip] using And.intro (hc.trans hp.2.1) (hp.2.2.trans hd)) + have hi := hh.integrableOn_compact (μ := volume) (isCompact_Icc.prod isCompact_Icc) + have hj := hi.mono_set (prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) + rw [IntegrableOn,Measure.volume_eq_prod,← Measure.prod_restrict] at hj + exact hj + +lemma strip_potential_mean_integrable {Fbar : ℂ → OnePoint ℂ} + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + {a b c d : ℝ} (hab : a < b) (hcd : c < d) (hc : 0 ≤ c) (hd : d ≤ Real.pi) : + Integrable (fun p : ℝ × ℝ => stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I)) + ((intervalProb a b).prod (intervalProb c d)) := by + rw [intervalProb,intervalProb,Measure.prod_smul_left,Measure.prod_smul_right] + exact ((strip_potential_rect_integrable hcont hH hr q a b hc hd).smul_measure + (ENNReal.inv_ne_top.2 (ENNReal.ofReal_ne_zero_iff.2 (sub_pos.2 hcd)))).smul_measure + (ENNReal.inv_ne_top.2 (ENNReal.ofReal_ne_zero_iff.2 (sub_pos.2 hab))) + +theorem strip_rectangle_poincare {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {a b c d a' b' c' d' K : ℝ} + (hab : a < b) (hcd : c < d) (hab' : a' < b') (hcd' : c' < d') + (hlo : 0 ≤ c) (hhi : d ≤ Real.pi) + (haa : a ≤ a') (hbb : b' ≤ b) (hcc : c ≤ c') (hdd : d' ≤ d) + (hK : 0 ≤ K) (hlen : d-c ≤ K*(d'-c')) : + |(∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a' b').prod (intervalProb c' d'))- + (∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a b).prod (intervalProb c d))| ≤ + (K/(d-c)+1/(b-a))*(∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖ + ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + have hh := strip_coordinate_ACL hF hinj hext hcont hH hr q (a := a) (b := b) hcd hlo hhi + exact rectangle_poincare_L1 hab hcd hab' hcd' haa hbb hcc hdd hK hlen + (strip_potential_mean_integrable hcont hH.le hr q hab hcd hlo hhi) + (strip_potential_mean_integrable hcont hH.le hr q hab' hcd' (hlo.trans hcc) (hdd.trans hhi)) + ((strip_gradient_rect_memLp hF hinj hext hH hr q a b hlo hhi).integrable (by norm_num)) + (fun _ => norm_nonneg _) hh.1 hh.2 + +lemma dyadic_subsum_le {a : ℕ → ℝ} (ha : ∀ j, a j = 0 ∨ a j = (2:ℝ)^j) (n : ℕ) : + ∑ j ∈ Finset.range n, a j ≤ (2:ℝ)^n-1 := by + induction n with + | zero => simp + | succ n ih => + rw [Finset.sum_range_succ,pow_succ] + rcases ha n with h | h + · rw [h,add_zero] + linarith [pow_pos (by norm_num : (0:ℝ) < 2) n] + · rw [h] + linarith + +lemma dyadic_subsum_square {a : ℕ → ℝ} (ha : ∀ j, a j = 0 ∨ a j = (2:ℝ)^j) (n : ℕ) : + (∑ j ∈ Finset.range n, a j)^2 ≤ 3*∑ j ∈ Finset.range n, (a j)^2 := by + induction n with + | zero => simp + | succ n ih => + rw [Finset.sum_range_succ,Finset.sum_range_succ] + rcases ha n with h | h + · simpa only [h,add_zero,zero_pow (by norm_num : (2:ℕ) ≠ 0)] using ih + · rw [h] + have hb := dyadic_subsum_le ha n + have hp : 0 ≤ (2:ℝ)^n := by positivity + have hm := mul_nonneg hp (show 0 ≤ (2:ℝ)^n-∑ j ∈ Finset.range n, a j by linarith) + nlinarith + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +section Measure +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] + +def dyadicKernel (Q : ℕ → Set α) (n : ℕ) (x : α) : ℝ := + ∑ j ∈ Finset.range n, (Q j).indicator (fun _ => (2:ℝ)^j) x + +lemma dyadicKernel_memLp {Q : ℕ → Set α} (hQ : ∀ j, MeasurableSet (Q j)) (n : ℕ) : + MemLp (dyadicKernel Q n) 2 μ := by + have hh := memLp_finsetSum' (μ := μ) (p := (2:ℝ≥0∞)) (Finset.range n) + (fun j hj => (memLp_const ((2:ℝ)^j)).indicator (hQ j)) + have he : dyadicKernel Q n = ∑ j ∈ Finset.range n, (Q j).indicator (fun _ => (2:ℝ)^j) := by + funext x + simp only [dyadicKernel,Finset.sum_apply] + rw [he] + exact hh + +lemma dyadicKernel_square_energy {Q : ℕ → Set α} (hQ : ∀ j, MeasurableSet (Q j)) + {V : ℝ} (n : ℕ) (harea : ∀ j < n, ((2:ℝ)^j)^2*μ.real (Q j) ≤ V) : + (∫ x, (dyadicKernel Q n x)^2 ∂μ) ≤ 3*(n:ℝ)*V := by + have hpoint (x : α) : (dyadicKernel Q n x)^2 ≤ + 3*∑ j ∈ Finset.range n, ((Q j).indicator (fun _ => (2:ℝ)^j) x)^2 := by + apply dyadic_subsum_square + intro j + by_cases hx : x ∈ Q j + · right; exact indicator_of_mem hx _ + · left; exact indicator_of_notMem hx _ + have hi (j : ℕ) : Integrable (fun x => ((Q j).indicator (fun _ => (2:ℝ)^j) x)^2) μ := + ((memLp_const ((2:ℝ)^j) : MemLp _ 2 μ).indicator (hQ j)).integrable_sq + calc + _ ≤ ∫ x, 3*∑ j ∈ Finset.range n, ((Q j).indicator (fun _ => (2:ℝ)^j) x)^2 ∂μ := + integral_mono (dyadicKernel_memLp hQ n).integrable_sq + ((integrable_finsetSum _ (fun j hj => hi j)).const_mul 3) hpoint + _ = 3*∑ j ∈ Finset.range n, ((2:ℝ)^j)^2*μ.real (Q j) := by + rw [integral_const_mul,integral_finsetSum _ (fun j hj => hi j)] + congr 1 + apply Finset.sum_congr rfl + intro j hj + have he : (fun x => ((Q j).indicator (fun _ => (2:ℝ)^j) x)^2) = + (Q j).indicator (fun _ => ((2:ℝ)^j)^2) := by + funext x + by_cases hx : x ∈ Q j <;> simp [hx] + rw [he,integral_indicator (hQ j),integral_const] + simp [Measure.real,smul_eq_mul,mul_comm] + _ ≤ 3*(n:ℝ)*V := by + have hh := Finset.sum_le_sum (s := Finset.range n) + (fun j hj => harea j (Finset.mem_range.1 hj)) + simpa only [Finset.sum_const,Finset.card_range,nsmul_eq_mul,mul_assoc] using + mul_le_mul_of_nonneg_left hh (by norm_num : (0:ℝ) ≤ 3) + +end Measure + +end SLEExactGauge.RectangleEnergy + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/EuclideanApproach.lean b/lean/OAI/Probability/SLELocalization/EuclideanApproach.lean new file mode 100644 index 0000000000000000000000000000000000000000..37b2ecbdd729e946a402bb2eebb8e567e492622d --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/EuclideanApproach.lean @@ -0,0 +1,991 @@ +import Mathlib +import OAI.Probability.SLELocalization.AngularClock +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Is Loewner Trace Using estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma visit_liveDistanceApproach (h : IsLoewnerTraceUsing driver γ g f) + {z : ℂ} {v : ℝ} (hv : 0 < v) (hsmall : 2*v < z.im) + (hvisit : ∃ T : ℝ, 0 ≤ T ∧ dist z (γ T) < v) : + liveDistanceApproach γ z (3*v) := by + obtain ⟨T,hT,hvisit⟩ := hvisit + let TN : ℝ≥0 := ⟨T,hT⟩ + have hc : Continuous (fun t : ℝ≥0 => dist z (γ t)) := + continuous_const.dist (h.1.comp_continuous continuous_subtype_val (fun t => t.coe_nonneg)) + let A : Set ℝ≥0 := Icc 0 TN ∩ {t | dist z (γ t) ≤ 2*v} + have hA : IsCompact A := isCompact_Icc.inter_right (isClosed_le hc continuous_const) + obtain ⟨s,hs,hmin⟩ := hA.exists_isLeast ⟨TN,⟨⟨zero_le,le_rfl⟩,by change dist z (γ T) ≤ 2*v; linarith⟩⟩ + have hsT : (s:ℝ) ≤ T := hs.1.2 + have hstrict (q : ℝ≥0) (hqs : q < s) : 2*v < dist z (γ q) := by + by_contra hn + exact (not_le_of_gt hqs) (hmin ⟨⟨zero_le,hqs.le.trans hs.1.2⟩,not_lt.1 hn⟩) + have hinit : 2*v < dist z (γ 0) := by + rw [h.2.1,dist_zero_right] + exact hsmall.trans_le (Complex.im_le_norm z) + have hdist : dist z (γ s) = 2*v := by + apply le_antisymm hs.2 + by_contra hn + have hl : dist z (γ s) < 2*v := not_le.1 hn + have hcc : ContinuousOn (fun q : ℝ => dist z (γ q)) (Icc 0 (s:ℝ)) := + (continuous_const.dist continuous_id).comp_continuousOn (h.1.mono Icc_subset_Ici_self) + obtain ⟨q,hq,he⟩ := intermediate_value_Icc' s.coe_nonneg hcc ⟨hl.le,hinit.le⟩ + have hqs : q < (s:ℝ) := lt_of_le_of_ne hq.2 (by intro heq; subst q; linarith) + have hh := hstrict ⟨q,hq.1⟩ hqs + change 2*v < dist z (γ q) at hh + exact (not_lt_of_ge he.le) hh + have hbefore (q : ℝ) (hq : q ∈ Icc 0 (s:ℝ)) : 2*v ≤ dist z (γ q) := by + rcases lt_or_eq_of_le hq.2 with hh | hh + · exact (hstrict ⟨q,hq.1⟩ hh).le + · rw [hh,hdist] + have hfree : ball z (2*v) ⊆ halfPlane \ localizationSegment γ 0 s := by + intro w hw + have hnorm : ‖w-z‖ < 2*v := by simpa only [mem_ball,dist_eq_norm] using hw + constructor + · have hh := Complex.abs_im_le_norm (w-z) + have hn := neg_abs_le (w-z).im + change 0 < w.im + simp only [Complex.sub_im] at hh hn + linarith + · rintro ⟨q,hq,rfl⟩ + have hh := hbefore q hq + have hh' := mem_ball.1 hw + rw [dist_comm] at hh' + linarith + have hcl := h.future_tip_mem_closure s.coe_nonneg hsT + have hb : γ T ∈ ball z (2*v) := by rw [mem_ball,dist_comm]; linarith + obtain ⟨w,hwb,hwD⟩ := mem_closure_iff.1 hcl (ball z (2*v)) isOpen_ball hb + have hcomp := (convex_ball z (2*v)).isPreconnected.subset_connectedComponentIn hwb hfree + have hzball : z ∈ ball z (2*v) := mem_ball_self (by positivity) + have hzlive : z ∈ localizationDomain γ s := by + refine ⟨hfree hzball,?_⟩ + rw [← connectedComponentIn_eq (hcomp hzball)] + exact hwD.2 + refine ⟨s,hzlive,?_⟩ + have hnot : γ s ∈ (localizationDomain γ s)ᶜ := by + intro hh + exact hh.1.2 ⟨s,⟨s.coe_nonneg,le_rfl⟩,rfl⟩ + have hh := infDist_le_dist_of_mem (x := z) hnot + rw [hdist] at hh + linarith + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SmallTarget + +lemma sqrt_rpow {ε : ℝ} (hε : 0 ≤ ε) (β : ℝ) : (Real.sqrt ε)^β=ε^(β/2) := by + rw [Real.sqrt_eq_rpow,← Real.rpow_mul hε] + congr 1 + ring + +lemma interior_weight {p b ε : ℝ} {z : ℂ} (hp : 0 ≤ p) (hb : 0 ≤ b) + (hε : 0 < ε) (hy : Real.sqrt ε ≤ z.im) : + (2*z.im)^(-p)*(z.im/‖z‖)^b ≤ ε^(-(p/2)) := by + have hyr : 0 < z.im := (Real.sqrt_pos.2 hε).trans_le hy + have hn : 0 < ‖z‖ := hyr.trans_le (Complex.im_le_norm z) + have hsin0 : 0 ≤ z.im/‖z‖ := div_nonneg hyr.le hn.le + have hsin1 : z.im/‖z‖ ≤ 1 := (div_le_one hn).2 (Complex.im_le_norm z) + have hsin := Real.rpow_le_one hsin0 hsin1 hb + have hrad : (2*z.im)^(-p) ≤ (Real.sqrt ε)^(-p) := + Real.rpow_le_rpow_of_nonpos (Real.sqrt_pos.2 hε) (by linarith) (neg_nonpos.mpr hp) + calc + _ ≤ (2*z.im)^(-p)*1 := mul_le_mul_of_nonneg_left hsin (Real.rpow_nonneg (by positivity) _) + _ ≤ (Real.sqrt ε)^(-p) := by simpa using hrad + _ = ε^(-(p/2)) := by rw [sqrt_rpow hε.le]; congr 1; ring + +lemma interior_power_product {ε C p : ℝ} (hε : 0 < ε) : + C*ε^(-(p/2))*(3*ε)^p = C*3^p*ε^(p/2) := by + rw [Real.mul_rpow (by norm_num : (0:ℝ)≤3) hε.le] + calc + _ = C*3^p*(ε^(-(p/2))*ε^p) := by ring + _ = _ := by rw [← Real.rpow_add hε]; congr 2; ring + +lemma radius_power {A ε β : ℝ} (hA : 0 ≤ A) (hε : 0 ≤ ε) : + (A*Real.sqrt ε)^β=A^β*ε^(β/2) := by + rw [Real.mul_rpow hA (Real.sqrt_nonneg _),sqrt_rpow hε] + +theorem interior_trace_bound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ c < 1 ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (ε : ℝ) (_hε : 0 < ε) (_hy : Real.sqrt ε ≤ z.im) + (_hsmall : 3*ε < c*z.im), + P {sample | ∃ t : ℝ, 0 ≤ t ∧ dist z (γ sample t) < ε} ≤ + ENNReal.ofReal (C*ε^(codimension κ/2)) := by + obtain ⟨C,c,hC,hc,hc1,hbound⟩ := euclideanApproachBound κ hκ + have hp : 0 < codimension κ := by unfold codimension dimension; linarith [hκ.2] + have hb : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + refine ⟨C*3^(codimension κ),c,mul_pos hC (Real.rpow_pos_of_pos (by norm_num) _),hc,hc1,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z ε hε hy hsmall + have hz : z ∈ halfPlane := (Real.sqrt_pos.2 hε).trans_le hy + have hsm : 2*ε < z.im := by + have hh := mul_lt_mul_of_pos_right hc1 (show 0 < z.im from hz) + linarith + have hsub : {sample | ∃ t : ℝ, 0 ≤ t ∧ dist z (γ sample t) < ε} ≤ᵐ[P] + {sample | liveDistanceApproach (γ sample) z (3*ε)} := by + filter_upwards [hmaps] with sample hm hh + exact hm.visit_liveDistanceApproach hε hsm hh + refine (measure_mono_ae hsub).trans ((hbound P B hB γ g f hγ hmaps z hz (3*ε) (by positivity) hsmall).trans + (ENNReal.ofReal_le_ofReal ?_)) + have hm := interior_weight hp.le hb.le hε hy + have hpε : 0 ≤ (3*ε)^(codimension κ) := Real.rpow_nonneg (by positivity) _ + calc + C*((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))*(3*ε)^(codimension κ) ≤ + C*ε^(-(codimension κ/2))*(3*ε)^(codimension κ) := by gcongr + _ = C*3^(codimension κ)*ε^(codimension κ/2) := interior_power_product hε + +end SLEExactGauge.SmallTarget + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.SmallTarget + +lemma epsilon_le_sqrt {ε : ℝ} (hε : 0 ≤ ε) (hε1 : ε ≤ 1) : ε ≤ Real.sqrt ε := by + have hs := Real.sq_sqrt hε + have hp := Real.sqrt_nonneg ε + nlinarith [mul_nonneg hε (sub_nonneg.mpr hε1)] + +lemma near_real_geometry {v : ℂ} {ε K : ℝ} (hv : 0 ≤ v.im) (hn : 1/2 ≤ ‖v‖) + (hε : 0 < ε) (hε1 : ε ≤ 1) (_hK : 0 ≤ K) + (hy : v.im ≤ K*Real.sqrt ε) (hsmall : (K+1)*Real.sqrt ε < 1/4) : + 1/4 ≤ |v.re| ∧ ∀ w : ℂ, dist v w < ε → dist w (v.re:ℂ) < (K+1)*Real.sqrt ε := by + have hs := Real.sqrt_nonneg ε + have hy4 : v.im < 1/4 := by nlinarith + have hab := Complex.norm_le_abs_re_add_abs_im v + rw [abs_of_nonneg hv] at hab + refine ⟨by linarith,?_⟩ + intro w hw + have hvx : dist v (v.re:ℂ) ≤ v.im := by + rw [dist_eq_norm] + have hh := Complex.norm_le_abs_re_add_abs_im (v-(v.re:ℂ)) + simpa only [Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im, + sub_self,sub_zero,abs_zero,zero_add,abs_of_nonneg hv] using hh + have he := epsilon_le_sqrt hε.le hε1 + calc + dist w (v.re:ℂ) ≤ dist w v+dist v (v.re:ℂ) := dist_triangle _ _ _ + _ < ε+v.im := add_lt_add_of_lt_of_le (by simpa only [dist_comm] using hw) hvx + _ ≤ (K+1)*Real.sqrt ε := by nlinarith + +lemma cutoff_sqrt_small {A ε : ℝ} (hA : 0 < A) (hε : 0 < ε) + (hsmall : ε < 1/(16*A^2)) : A*Real.sqrt ε < 1/4 := by + have hh := (lt_div_iff₀ (show 0 < 16*A^2 by positivity)).mp hsmall + have hs := Real.sq_sqrt hε.le + have hp : 0 ≤ A*Real.sqrt ε := by positivity + nlinarith [sq_nonneg (A*Real.sqrt ε-1/4)] + +end SLEExactGauge.SmallTarget + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open SmallTarget BoundaryGreen + +theorem uniform_small_target (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (v : ℂ), 0 ≤ v.im → 1/2 ≤ ‖v‖ → ‖v‖ ≤ 2 → + ∀ ε : ℝ, 0 < ε → ε < 1/16 → + P {sample | ∃ t : ℝ, 0 ≤ t ∧ dist v (γ sample t) < ε} ≤ + ENNReal.ofReal (C*ε^c) := by + let β := (8/κ-1)/2 + let a := 1+κ/8 + obtain ⟨hβ,ha,ha2,hba⟩ := exponent_choice hκ.1 hκ.2 + change 0 < β at hβ + change 0 < a at ha + change a < 2 at ha2 + change κ*(β+1) < 4+2*a at hba + let δ := (2-a)/8 + have hδ : 0 < δ := by dsimp [δ]; linarith + have hδhalf : δ ≤ 1/2 := by dsimp [δ]; linarith + have haδ : a ≤ 2-4*δ := by dsimp [δ]; linarith + obtain ⟨Ci,e,hi,he,he1,hinter⟩ := interior_trace_bound κ hκ + let K := max 1 (3/e) + have hK1 : 1 ≤ K := le_max_left _ _ + have hKe : 3/e ≤ K := le_max_right _ _ + have hK : 0 < K := lt_of_lt_of_le zero_lt_one hK1 + let A := K+1 + have hA : 0 < A := by dsimp [A]; positivity + let ρ := 1/(16*A^2) + have hρ : 0 < ρ := by dsimp [ρ]; positivity + let c := min (β/2) (codimension κ/2) + have hp : 0 < codimension κ := by unfold codimension dimension; linarith [hκ.2] + have hc : 0 < c := lt_min (half_pos hβ) (half_pos hp) + let Cb := (16/δ)^β*A^β + have hCb : 0 < Cb := mul_pos (Real.rpow_pos_of_pos (by positivity) _) (Real.rpow_pos_of_pos hA _) + let C := Cb+Ci+ρ^(-c) + have hR : 0 < ρ^(-c) := Real.rpow_pos_of_pos hρ _ + have hC : 0 < C := by dsimp only [C]; positivity + have hbC : Cb ≤ C := by dsimp only [C]; linarith + have hiC : Ci ≤ C := by dsimp only [C]; linarith + have hrC : ρ^(-c) ≤ C := by dsimp only [C]; linarith + refine ⟨C,c,hC,hc,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps v hv hn hlo ε hε hε16 + have hε1 : ε ≤ 1 := by linarith + have hs : 0 < Real.sqrt ε := Real.sqrt_pos.2 hε + have heps := epsilon_le_sqrt hε.le hε1 + by_cases hsmall : ε < ρ + · by_cases hnear : v.im ≤ K*Real.sqrt ε + · have hgeom := near_real_geometry hv hn hε hε1 hK.le hnear (cutoff_sqrt_small hA hε hsmall) + have hsub : {sample | ∃ t : ℝ, 0 ≤ t ∧ dist v (γ sample t) < ε} ⊆ + {sample | ∃ t : ℝ, 0 ≤ t ∧ dist (γ sample t) (v.re:ℂ) < A*Real.sqrt ε} := by + rintro sample ⟨t,ht,hclose⟩ + exact ⟨t,ht,hgeom.2 _ hclose⟩ + have hh := annulus_real_bound hB κ β a δ hκ.1.le hβ ha.le hba.le hδ hδhalf haδ + γ g f hmaps hgeom.1 (mul_pos hA hs) + refine (measure_mono hsub).trans (hh.trans (ENNReal.ofReal_le_ofReal ?_)) + rw [radius_power hA.le hε.le] + have hepow : ε^(β/2) ≤ ε^c := Real.rpow_le_rpow_of_exponent_ge hε hε1 (min_le_left _ _) + calc + (16/δ)^β*(A^β*ε^(β/2)) = Cb*ε^(β/2) := by dsimp only [Cb]; ring + _ ≤ Cb*ε^c := mul_le_mul_of_nonneg_left hepow hCb.le + _ ≤ C*ε^c := mul_le_mul_of_nonneg_right hbC (Real.rpow_nonneg hε.le _) + · have hy : Real.sqrt ε ≤ v.im := by + have hh := mul_le_mul_of_nonneg_right hK1 hs.le + linarith [not_le.mp hnear] + have hm : 3*ε < e*v.im := by + have hh := (div_le_iff₀ he).mp hKe + have hm := mul_le_mul_of_nonneg_right hh hs.le + have hlt := mul_lt_mul_of_pos_left (not_le.mp hnear) he + nlinarith + refine (hinter P B hB γ g f hγ hmaps v ε hε hy hm).trans (ENNReal.ofReal_le_ofReal ?_) + have hepow : ε^(codimension κ/2) ≤ ε^c := Real.rpow_le_rpow_of_exponent_ge hε hε1 (min_le_right _ _) + exact (mul_le_mul_of_nonneg_left hepow hi.le).trans + (mul_le_mul_of_nonneg_right hiC (Real.rpow_nonneg hε.le _)) + · have hrε := Real.rpow_le_rpow hρ.le (not_lt.1 hsmall) hc.le + have hprod : ρ^(-c)*ρ^c = 1 := by + rw [Real.rpow_neg hρ.le,inv_mul_cancel₀ (Real.rpow_pos_of_pos hρ _).ne'] + have h1 : 1 ≤ C*ε^c := by + calc + 1 = ρ^(-c)*ρ^c := hprod.symm + _ ≤ ρ^(-c)*ε^c := mul_le_mul_of_nonneg_left hrε hR.le + _ ≤ C*ε^c := mul_le_mul_of_nonneg_right hrC (Real.rpow_nonneg hε.le _) + exact prob_le_one.trans (by simpa using ENNReal.ofReal_le_ofReal h1) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SmallTarget + +lemma scaled_near_real_geometry {v : ℂ} {R ε K : ℝ} (hR : 0 < R) + (hv : 0 ≤ v.im) (hn : R/2 ≤ ‖v‖) (hε : 0 < ε) (hε1 : ε ≤ 1) (_hK : 0 ≤ K) + (hy : v.im ≤ R*(K*Real.sqrt ε)) (hsmall : (K+1)*Real.sqrt ε < 1/4) : + R/4 ≤ |v.re| ∧ ∀ w : ℂ, dist v w < R*ε → + dist w (v.re:ℂ) < R*((K+1)*Real.sqrt ε) := by + have hs := Real.sqrt_nonneg ε + have hmul := mul_lt_mul_of_pos_left hsmall hR + have hy4 : v.im < R/4 := by nlinarith [mul_nonneg hR.le hs] + have hab := Complex.norm_le_abs_re_add_abs_im v + rw [abs_of_nonneg hv] at hab + refine ⟨by linarith,?_⟩ + intro w hw + have hvx : dist v (v.re:ℂ) ≤ v.im := by + rw [dist_eq_norm] + have hh := Complex.norm_le_abs_re_add_abs_im (v-(v.re:ℂ)) + simpa only [Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im, + sub_self,sub_zero,abs_zero,zero_add,abs_of_nonneg hv] using hh + have he := mul_le_mul_of_nonneg_left (epsilon_le_sqrt hε.le hε1) hR.le + calc + dist w (v.re:ℂ) ≤ dist w v+dist v (v.re:ℂ) := dist_triangle _ _ _ + _ < R*ε+v.im := add_lt_add_of_lt_of_le (by simpa only [dist_comm] using hw) hvx + _ ≤ R*((K+1)*Real.sqrt ε) := by nlinarith + +lemma scaled_interior_power {R ε p : ℝ} (hR : 0 < R) (hε : 0 < ε) : + (R*Real.sqrt ε)^(-p)*(3*(R*ε))^p = 3^p*ε^(p/2) := by + rw [Real.mul_rpow hR.le (Real.sqrt_nonneg _),sqrt_rpow hε.le, + Real.mul_rpow (by norm_num : (0:ℝ)≤3) (mul_nonneg hR.le hε.le),Real.mul_rpow hR.le hε.le] + calc + _ = 3^p*(R^(-p)*R^p)*(ε^(-p/2)*ε^p) := by ring + _ = _ := by rw [← Real.rpow_add hR,← Real.rpow_add hε,neg_add_cancel,Real.rpow_zero,mul_one,show -p/2+p=p/2 by ring] + + theorem interior_trace_scaled_bound (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ c < 1 ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (R ε : ℝ) (_hR : 0 < R) (_hε : 0 < ε) (_hy : R*Real.sqrt ε ≤ z.im) + (_hsmall : 3*(R*ε) < c*z.im), + P {sample | ∃ t : ℝ, 0 ≤ t ∧ dist z (γ sample t) < R*ε} ≤ + ENNReal.ofReal (C*ε^(codimension κ/2)) := by + obtain ⟨C,c,hC,hc,hc1,hbound⟩ := euclideanApproachBound κ hκ + have hp : 0 < codimension κ := by unfold codimension dimension; linarith [hκ.2] + have hb : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + refine ⟨C*3^(codimension κ),c,mul_pos hC (Real.rpow_pos_of_pos (by norm_num) _),hc,hc1,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z R ε hR hε hy hsmall + have hs := Real.sqrt_pos.2 hε + have hz : z ∈ halfPlane := (mul_pos hR hs).trans_le hy + have hzim : 0 < z.im := hz + have hsm : 2*(R*ε) < z.im := by + have hh := mul_lt_mul_of_pos_right hc1 (show 0 < z.im from hz) + linarith [mul_pos hR hε] + have hsub : {sample | ∃ t : ℝ, 0 ≤ t ∧ dist z (γ sample t) < R*ε} ≤ᵐ[P] + {sample | liveDistanceApproach (γ sample) z (3*(R*ε))} := by + filter_upwards [hmaps] with sample hm hh + exact hm.visit_liveDistanceApproach (mul_pos hR hε) hsm hh + refine (measure_mono_ae hsub).trans ((hbound P B hB γ g f hγ hmaps z hz _ (by positivity) hsmall).trans + (ENNReal.ofReal_le_ofReal ?_)) + have hn : 0 < ‖z‖ := hz.trans_le (Complex.im_le_norm z) + have hsin := Real.rpow_le_one (div_nonneg hz.le hn.le) + ((div_le_one hn).2 (Complex.im_le_norm z)) hb.le + have hrad : (2*z.im)^(-codimension κ) ≤ (R*Real.sqrt ε)^(-codimension κ) := + Real.rpow_le_rpow_of_nonpos (mul_pos hR hs) (by linarith [hzim]) (by linarith) + calc + _ ≤ C*((2*z.im)^(-codimension κ)*1)*(3*(R*ε))^(codimension κ) := by + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left hsin (Real.rpow_nonneg (by positivity) _)) hC.le) + (Real.rpow_nonneg (by positivity) _) + _ ≤ C*((R*Real.sqrt ε)^(-codimension κ))*(3*(R*ε))^(codimension κ) := by + simp only [mul_one]; gcongr + _ = C*3^(codimension κ)*ε^(codimension κ/2) := by + rw [mul_assoc,scaled_interior_power hR hε]; ring + +end SLEExactGauge.SmallTarget + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open SmallTarget BoundaryGreen + +lemma scaled_annulus_real_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a δ : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 < β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {x R d : ℝ} (hR : 0 < R) (hx : R/4 ≤ |x|) (hd : 0 < d) : + P {ω | ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < R*d} ≤ ENNReal.ofReal ((16/δ)^β*d^β) := by + have hxp : 0 < |x| := (by positivity : 0 < R/4).trans_le hx + refine (real_bound hB κ β a δ hκ hβ ha hba hδ hδhalf haδ γ g f hmaps hxp (mul_pos hR hd)).trans + (ENNReal.ofReal_le_ofReal ?_) + have hr : 4*(R*d)/(δ*|x|) ≤ (16/δ)*d := by + rw [div_le_iff₀ (mul_pos hδ hxp)] + have hh := mul_le_mul_of_nonneg_left hx (show 0 ≤ 16*d by positivity) + field_simp + nlinarith + have hh := Real.rpow_le_rpow (by positivity : 0 ≤ 4*(R*d)/(δ*|x|)) hr hβ.le + rwa [Real.mul_rpow (by positivity : 0 ≤ 16/δ) hd.le] at hh + +theorem uniform_small_target_scaled (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (v : ℂ) (R : ℝ), 0 < R → 0 ≤ v.im → R/2 ≤ ‖v‖ → + ∀ ε : ℝ, 0 < ε → ε < 1/16 → + P {sample | ∃ t : ℝ, 0 ≤ t ∧ dist v (γ sample t) < R*ε} ≤ + ENNReal.ofReal (C*ε^c) := by + let β := (8/κ-1)/2 + let a := 1+κ/8 + obtain ⟨hβ,ha,ha2,hba⟩ := exponent_choice hκ.1 hκ.2 + change 0 < β at hβ + change 0 < a at ha + change a < 2 at ha2 + change κ*(β+1) < 4+2*a at hba + let δ := (2-a)/8 + have hδ : 0 < δ := by dsimp [δ]; linarith + have hδhalf : δ ≤ 1/2 := by dsimp [δ]; linarith + have haδ : a ≤ 2-4*δ := by dsimp [δ]; linarith + obtain ⟨Ci,e,hi,he,he1,hinter⟩ := interior_trace_scaled_bound κ hκ + let K := max 1 (3/e) + have hK1 : 1 ≤ K := le_max_left _ _ + have hKe : 3/e ≤ K := le_max_right _ _ + have hK : 0 < K := lt_of_lt_of_le zero_lt_one hK1 + let A := K+1 + have hA : 0 < A := by dsimp [A]; positivity + let ρ := 1/(16*A^2) + have hρ : 0 < ρ := by dsimp [ρ]; positivity + let c := min (β/2) (codimension κ/2) + have hp : 0 < codimension κ := by unfold codimension dimension; linarith [hκ.2] + have hc : 0 < c := lt_min (half_pos hβ) (half_pos hp) + let Cb := (16/δ)^β*A^β + have hCb : 0 < Cb := mul_pos (Real.rpow_pos_of_pos (by positivity) _) (Real.rpow_pos_of_pos hA _) + let C := Cb+Ci+ρ^(-c) + have hρpow : 0 < ρ^(-c) := Real.rpow_pos_of_pos hρ _ + have hC : 0 < C := by dsimp only [C]; positivity + have hbC : Cb ≤ C := by dsimp only [C]; linarith + have hiC : Ci ≤ C := by dsimp only [C]; linarith + have hrC : ρ^(-c) ≤ C := by dsimp only [C]; linarith + refine ⟨C,c,hC,hc,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps v R hR hv hn ε hε hε16 + have hε1 : ε ≤ 1 := by linarith + have hs : 0 < Real.sqrt ε := Real.sqrt_pos.2 hε + have heps := epsilon_le_sqrt hε.le hε1 + by_cases hsmall : ε < ρ + · by_cases hnear : v.im ≤ R*(K*Real.sqrt ε) + · have hgeom := scaled_near_real_geometry hR hv hn hε hε1 hK.le hnear (cutoff_sqrt_small hA hε hsmall) + have hsub : {sample | ∃ t : ℝ, 0 ≤ t ∧ dist v (γ sample t) < R*ε} ⊆ + {sample | ∃ t : ℝ, 0 ≤ t ∧ dist (γ sample t) (v.re:ℂ) < R*(A*Real.sqrt ε)} := by + rintro sample ⟨t,ht,hclose⟩ + exact ⟨t,ht,hgeom.2 _ hclose⟩ + have hh := scaled_annulus_real_bound hB κ β a δ hκ.1.le hβ ha.le hba.le hδ hδhalf haδ + γ g f hmaps hR hgeom.1 (mul_pos hA hs) + refine (measure_mono hsub).trans (hh.trans (ENNReal.ofReal_le_ofReal ?_)) + rw [radius_power hA.le hε.le] + have hepow : ε^(β/2) ≤ ε^c := Real.rpow_le_rpow_of_exponent_ge hε hε1 (min_le_left _ _) + calc + (16/δ)^β*(A^β*ε^(β/2)) = Cb*ε^(β/2) := by dsimp only [Cb]; ring + _ ≤ Cb*ε^c := mul_le_mul_of_nonneg_left hepow hCb.le + _ ≤ C*ε^c := mul_le_mul_of_nonneg_right hbC (Real.rpow_nonneg hε.le _) + · have hy : R*Real.sqrt ε ≤ v.im := by + have hh := mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right hK1 hs.le) hR.le + nlinarith [not_le.mp hnear] + have hm : 3*(R*ε) < e*v.im := by + have hh := (div_le_iff₀ he).mp hKe + calc + 3*(R*ε) ≤ 3*(R*Real.sqrt ε) := by gcongr + _ ≤ e*(R*(K*Real.sqrt ε)) := by + have hm := mul_le_mul_of_nonneg_right hh (mul_nonneg hR.le hs.le) + nlinarith + _ < e*v.im := mul_lt_mul_of_pos_left (not_le.mp hnear) he + refine (hinter P B hB γ g f hγ hmaps v R ε hR hε hy hm).trans (ENNReal.ofReal_le_ofReal ?_) + have hepow : ε^(codimension κ/2) ≤ ε^c := Real.rpow_le_rpow_of_exponent_ge hε hε1 (min_le_right _ _) + exact (mul_le_mul_of_nonneg_left hepow hi.le).trans + (mul_le_mul_of_nonneg_right hiC (Real.rpow_nonneg hε.le _)) + · have hrε := Real.rpow_le_rpow hρ.le (not_lt.1 hsmall) hc.le + have hprod : ρ^(-c)*ρ^c = 1 := by + rw [Real.rpow_neg hρ.le,inv_mul_cancel₀ (Real.rpow_pos_of_pos hρ _).ne'] + have h1 : 1 ≤ C*ε^c := by + calc + 1 = ρ^(-c)*ρ^c := hprod.symm + _ ≤ ρ^(-c)*ε^c := mul_le_mul_of_nonneg_left hrε hρpow.le + _ ≤ C*ε^c := mul_le_mul_of_nonneg_right hrC (Real.rpow_nonneg hε.le _) + exact prob_le_one.trans (by simpa using ENNReal.ofReal_le_ofReal h1) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def logTrace {Ω : Type*} (γ : Ω → ℝ → ℂ) (ω : Ω) : Set (ℝ × ℝ) := + {x | ∃ t : ℝ, 0 ≤ t ∧ γ ω t = Complex.exp ((x.1:ℂ)+(x.2:ℂ)*Complex.I)} + +lemma dyadic_radius_power (K c : ℝ) (hK : 0 ≤ K) (n : ℕ) : + (K/(2:ℝ)^n)^c = K^c*((1/2:ℝ)^c)^n := by + rw [div_eq_mul_inv,Real.mul_rpow hK (by positivity),← inv_pow, + ← Real.rpow_pow_comm (by norm_num : (0:ℝ) ≤ 2⁻¹)] + simp only [one_div] + +theorem logTrace_dyadic_hitting (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) : + ∃ C₀ ρ : ℝ, 0 < C₀ ∧ 0 < ρ ∧ ρ < 1 ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (j : ℝ) (n : ℕ) (i : DIndex n), + P {ω | ∃ x ∈ logTrace γ ω, x ∈ (dyadicRect (unitSlab j) n i).closed} ≤ + ENNReal.ofReal (C₀*ρ^n) := by + obtain ⟨C,c,hC,hc,hsmall⟩ := uniform_small_target_scaled κ hκ + let K := expCellScale + let ρ := (1/2:ℝ)^c + let C₀ := (C+16^c)*K^c + have hK : 0 < K := expCellScale_pos + have hρ : 0 < ρ := Real.rpow_pos_of_pos (by norm_num) _ + have hρ1 : ρ < 1 := Real.rpow_lt_one (by norm_num) (by norm_num) hc + have h16 : 0 < (16:ℝ)^c := Real.rpow_pos_of_pos (by norm_num) _ + have hC₀ : 0 < C₀ := mul_pos (add_pos hC h16) (Real.rpow_pos_of_pos hK _) + refine ⟨C₀,ρ,hC₀,hρ,hρ1,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps j n i + let ε := K/(2:ℝ)^n + have hε : 0 < ε := by dsimp [ε]; positivity + have heq : ε^c = K^c*ρ^n := dyadic_radius_power K c hK.le n + by_cases hεsmall : ε < 1/16 + · let Q := dyadicRect (unitSlab j) n i + let v := Complex.exp ((Q.a:ℂ)+(Q.c:ℂ)*Complex.I) + have hg := dyadicCell_exp_geometry j n i hεsmall + have hb := hsmall P B hB γ g f hγ hmaps v (Real.exp j) (Real.exp_pos _) hg.1 hg.2.1 ε hε hεsmall + have hs : {ω | ∃ x ∈ logTrace γ ω, x ∈ Q.closed} ⊆ + {ω | ∃ t : ℝ, 0 ≤ t ∧ dist v (γ ω t) < Real.exp j*ε} := by + rintro ω ⟨x,⟨t,ht,he⟩,hx⟩ + refine ⟨t,ht,?_⟩ + rw [he] + exact hg.2.2 x hx + refine (measure_mono hs).trans (hb.trans (ENNReal.ofReal_le_ofReal ?_)) + rw [heq] + change C*(K^c*ρ^n) ≤ ((C+16^c)*K^c)*ρ^n + nlinarith [mul_nonneg h16.le (mul_nonneg (Real.rpow_nonneg hK.le c) (pow_nonneg hρ.le n))] + · have hbase : 1 ≤ 16*ε := by linarith [not_lt.mp hεsmall] + have hp := Real.one_le_rpow hbase hc.le + rw [Real.mul_rpow (by norm_num : (0:ℝ)≤16) hε.le,heq] at hp + have h1 : 1 ≤ C₀*ρ^n := hp.trans (by + change 16^c*(K^c*ρ^n) ≤ ((C+16^c)*K^c)*ρ^n + nlinarith [mul_nonneg hC.le (mul_nonneg (Real.rpow_nonneg hK.le c) (pow_nonneg hρ.le n))]) + exact prob_le_one.trans (by simpa using ENNReal.ofReal_le_ofReal h1) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +namespace DRect + +instance (Q : DRect) : IsFiniteMeasure Q.measure := by unfold measure; infer_instance + +lemma measure_subset {Q R : DRect} (ha : Q.a ≤ R.a) (hb : R.b ≤ Q.b) + (hc : Q.c ≤ R.c) (hd : R.d ≤ Q.d) : R.measure ≤ Q.measure := + Measure.prod_mono (Measure.restrict_mono_set _ (fun _x hx => ⟨ha.trans_lt hx.1,hx.2.trans hb⟩)) + (Measure.restrict_mono_set _ (fun _y hy => ⟨hc.trans_lt hy.1,hy.2.trans hd⟩)) + +lemma child_measure_le (Q : DRect) (s : Bool × Bool) : (Q.child s).measure ≤ Q.measure := by + obtain ⟨ha,hb,hc,hd⟩ := Q.child_bounds s + exact measure_subset ha hb hc hd + +lemma measure_interval_split {l r : ℝ} (h : l < r) : + volume.restrict (Ioc l r) = volume.restrict (Ioc l ((l+r)/2))+ + volume.restrict (Ioc ((l+r)/2) r) := by + rw [← Ioc_union_Ioc_eq_Ioc (show l ≤ (l+r)/2 by linarith) (show (l+r)/2 ≤ r by linarith)] + apply Measure.restrict_union _ measurableSet_Ioc + exact disjoint_left.2 (fun x hx hy => (not_lt_of_ge hx.2) hy.1) + +lemma measure_child_sum (Q : DRect) : Q.measure = ∑ s : Bool × Bool, (Q.child s).measure := by + simp only [Fintype.sum_prod_type,Fintype.sum_bool,measure,child,halfLo,halfHi,↓reduceIte] + rw [measure_interval_split Q.hab,measure_interval_split Q.hcd,Measure.add_prod, + Measure.prod_add,Measure.prod_add] + ac_rfl + +end DRect + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma dyadicRect_measure_le (Q : DRect) (n : ℕ) (i : DIndex n) : + (dyadicRect Q n i).measure ≤ Q.measure := by + obtain ⟨ha,hb,hc,hd⟩ := dyadicRect_bounds Q n i + exact DRect.measure_subset ha hb hc hd + +lemma dyadic_measure_sum (Q : DRect) (n : ℕ) : + Q.measure = ∑ i : DIndex n, (dyadicRect Q n i).measure := by + induction n with + | zero => + let : Unique (DIndex 0) := inferInstanceAs (Unique Unit) + rw [Fintype.sum_unique] + rfl + | succ n ih => + change Q.measure = ∑ i : DIndex n × (Bool × Bool), ((dyadicRect Q n i.1).child i.2).measure + rw [Fintype.sum_prod_type] + simp_rw [← DRect.measure_child_sum] + exact ih + +lemma dyadic_integral_sum (Q : DRect) {g : ℝ × ℝ → ℝ} (hg : Integrable g Q.measure) (n : ℕ) : + ∑ i : DIndex n, (∫ p, g p ∂(dyadicRect Q n i).measure) = ∫ p, g p ∂Q.measure := by + conv_rhs => rw [dyadic_measure_sum Q n] + symm + exact integral_finsetSum_measure (fun i hi => hg.mono_measure (dyadicRect_measure_le Q n i)) + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def jumpSize (H : ℝ) (j : ℕ) : ℝ := H/(8*((j:ℝ)+1)*((j:ℝ)+2)) + +lemma jumpSize_pos {H : ℝ} (hH : 0 < H) (j : ℕ) : 0 < jumpSize H j := by + unfold jumpSize + positivity + +lemma jumpSize_telescope (H : ℝ) (j : ℕ) : + H/8*(1-1/((j:ℝ)+1)) + jumpSize H j = H/8*(1-1/((j:ℝ)+2)) := by + unfold jumpSize + have h1 : (j:ℝ)+1 ≠ 0 := by positivity + have h2 : (j:ℝ)+2 ≠ 0 := by positivity + field_simp + ring + +lemma exists_large_increment {H : ℝ} (hH : 0 < H) {v : ℕ → ℝ} + (hstart : v 0 ≤ 3*H/4) (hlim : Tendsto v atTop (𝓝 H)) : + ∃ j : ℕ, jumpSize H j < |v (j+1)-v j| := by + by_contra hn + push Not at hn + have hb (n : ℕ) : v n ≤ v 0 + H/8*(1-1/((n:ℝ)+1)) := by + induction n with + | zero => simp + | succ n ih => + have hd := le_trans (le_abs_self (v (n+1)-v n)) (hn n) + have hh := jumpSize_telescope H n + have hc : ((n+1:ℕ):ℝ)+1 = (n:ℝ)+2 := by norm_num; ring + rw [hc] + linarith + have hb' (n : ℕ) : v n ≤ 7*H/8 := by + have hinv : 0 ≤ 1/((n:ℝ)+1) := by positivity + have hp : 0 ≤ H/8 := by positivity + have hm := mul_nonneg hp hinv + linarith [hb n] + have hh := le_of_tendsto hlim (Filter.Eventually.of_forall hb') + linarith + +lemma geometric_moment_summable {q : ℝ} (hq : 0 ≤ q) (hq1 : q < 1) : + Summable (fun j : ℕ => (((j:ℝ)+1)*((j:ℝ)+2))^2*q^j) := by + have hn : ‖q‖ < 1 := by simpa [Real.norm_eq_abs,abs_of_nonneg hq] using hq1 + have h0 := summable_pow_mul_geometric_of_norm_lt_one 0 hn + have h1 := summable_pow_mul_geometric_of_norm_lt_one 1 hn + have h2 := summable_pow_mul_geometric_of_norm_lt_one 2 hn + have h3 := summable_pow_mul_geometric_of_norm_lt_one 3 hn + have h4 := summable_pow_mul_geometric_of_norm_lt_one 4 hn + have hh := (((h4.add (h3.mul_left 6)).add (h2.mul_left 13)).add + (h1.mul_left 12)).add (h0.mul_left 4) + apply hh.congr + intro j + ring + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +section Tree +variable {X : Type} {I : ℕ → Type} [finiteIndex : ∀ n, Fintype (I n)] + (parent : ∀ n, I (n+1) → I n) (branch : X → ∀ n, I n) + (means energy : ∀ n, I n → ℝ) (value : X → ℝ) + +omit finiteIndex in +lemma branch_bad_parent [∀ level, Fintype (I level)] {H D : ℝ} (hH : 0 < H) (N : ℕ) + (hbranch : ∀ x n, parent n (branch x (n+1)) = branch x n) + (hroot : ∀ i, means N i ≤ 3*H/4) + (hstep : ∀ n i, |means (n+1) i - means n (parent n i)|^2 ≤ D*energy n (parent n i)) + (hlim : ∀ x, Tendsto (fun n => means n (branch x n)) atTop (𝓝 (value x))) + {x : X} (hx : value x = H) : + ∃ j : ℕ, (jumpSize H j)^2 < D*energy (N+j) (branch x (N+j)) := by + have hl : Tendsto (fun n => means (N+n) (branch x (N+n))) atTop (𝓝 H) := by + have ht : Tendsto (fun n : ℕ => N+n) atTop atTop := by + simpa only [Nat.add_comm] using tendsto_add_atTop_nat N + simpa only [Function.comp_def,hx] using (hlim x).comp ht + obtain ⟨j,hj⟩ := exists_large_increment hH (by simpa using hroot (branch x N)) hl + refine ⟨j,?_⟩ + have hs := hstep (N+j) (branch x ((N+j)+1)) + rw [hbranch] at hs + have hj' : jumpSize H j < |means ((N+j)+1) (branch x ((N+j)+1)) - means (N+j) (branch x (N+j))| := by + have he : N+(j+1) = (N+j)+1 := (Nat.add_assoc N j 1).symm + rw [he] at hj + exact hj + exact ((sq_lt_sq₀ (jumpSize_pos hH j).le (abs_nonneg _)).2 hj').trans_le hs + +end Tree + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma jump_energy_scale {H : ℝ} (hH : H ≠ 0) (D E C q : ℝ) (N j : ℕ) : + D*E/(jumpSize H j)^2*(C*q^(N+j)) = + (64*D*C*E/H^2*q^N)*((((j:ℝ)+1)*((j:ℝ)+2))^2*q^j) := by + unfold jumpSize + rw [pow_add] + field_simp + ring + +theorem dyadic_energy_hitting + {X : Type} {I : ℕ → Type} [∀ n, Fintype (I n)] + (parent : ∀ n, I (n+1) → I n) (branch : X → ∀ n, I n) + (means energy : ∀ n, I n → ℝ) (value : X → ℝ) + {H D E C₀ q : ℝ} (hH : 0 < H) (hD : 0 ≤ D) (hE : 0 ≤ E) + (hC : 0 ≤ C₀) (hq : 0 ≤ q) (hq1 : q < 1) (N : ℕ) + (hbranch : ∀ x n, parent n (branch x (n+1)) = branch x n) + (hroot : ∀ i, means N i ≤ 3*H/4) + (hstep : ∀ n i, |means (n+1) i - means n (parent n i)|^2 ≤ D*energy n (parent n i)) + (hlim : ∀ x, Tendsto (fun n => means n (branch x n)) atTop (𝓝 (value x))) + (hnon : ∀ n i, 0 ≤ energy n i) (hsum : ∀ n, ∑ i, energy n i ≤ E) + {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) (Ξ : Ω → Set X) + (hhit : ∀ n i, P {ω | ∃ x ∈ Ξ ω, branch x n = i} ≤ ENNReal.ofReal (C₀*q^n)) : + P {ω | ∃ x ∈ Ξ ω, value x = H} ≤ + ENNReal.ofReal ((64*D*C₀*E/H^2*q^N)* + ∑' j : ℕ, (((j:ℝ)+1)*((j:ℝ)+2))^2*q^j) := by + classical + let event (j : ℕ) (i : I (N+j)) : Set Ω := + {ω | (jumpSize H j)^2 < D*energy (N+j) i ∧ ∃ x ∈ Ξ ω, branch x (N+j) = i} + have hcover : {ω | ∃ x ∈ Ξ ω, value x = H} ⊆ ⋃ j : ℕ, ⋃ i : I (N+j), event j i := by + rintro ω ⟨x,hx,hv⟩ + obtain ⟨j,hj⟩ := branch_bad_parent parent branch means energy value hH N hbranch hroot hstep hlim hv + exact mem_iUnion.2 ⟨j,mem_iUnion.2 ⟨branch x (N+j),hj,x,hx,rfl⟩⟩ + have hb (j : ℕ) (i : I (N+j)) : + P (event j i) ≤ ENNReal.ofReal (D*energy (N+j) i/(jumpSize H j)^2*(C₀*q^(N+j))) := by + by_cases hh : (jumpSize H j)^2 < D*energy (N+j) i + · have hs : event j i ⊆ {ω | ∃ x ∈ Ξ ω, branch x (N+j) = i} := fun _ h => h.2 + refine (measure_mono hs).trans ((hhit _ _).trans (ENNReal.ofReal_le_ofReal ?_)) + have hratio : 1 ≤ D*energy (N+j) i/(jumpSize H j)^2 := + (le_div_iff₀ (sq_pos_of_pos (jumpSize_pos hH j))).2 (by simpa using hh.le) + exact le_mul_of_one_le_left (mul_nonneg hC (pow_nonneg hq _)) hratio + · have he : event j i = ∅ := by ext ω; simp [event,hh] + rw [he,measure_empty] + exact bot_le + have hlevel (j : ℕ) : P (⋃ i : I (N+j), event j i) ≤ + ENNReal.ofReal (D*E/(jumpSize H j)^2*(C₀*q^(N+j))) := by + calc + _ ≤ ∑ i : I (N+j), P (event j i) := measure_iUnion_fintype_le _ _ + _ ≤ ∑ i : I (N+j), ENNReal.ofReal (D*energy (N+j) i/(jumpSize H j)^2*(C₀*q^(N+j))) := + Finset.sum_le_sum (fun i _ => hb j i) + _ = ENNReal.ofReal (∑ i : I (N+j), D*energy (N+j) i/(jumpSize H j)^2*(C₀*q^(N+j))) := by + symm + apply ENNReal.ofReal_sum_of_nonneg + intro i hi + exact mul_nonneg (div_nonneg (mul_nonneg hD (hnon _ _)) (sq_nonneg _)) + (mul_nonneg hC (pow_nonneg hq _)) + _ ≤ _ := by + apply ENNReal.ofReal_le_ofReal + simp only [← Finset.sum_mul,← Finset.sum_div,← Finset.mul_sum] + exact mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (hsum _) hD) (sq_nonneg _)) + (mul_nonneg hC (pow_nonneg hq _)) + let K := 64*D*C₀*E/H^2*q^N + have hK : 0 ≤ K := by dsimp [K]; positivity + have hs := (geometric_moment_summable hq hq1).mul_left K + calc + _ ≤ P (⋃ j : ℕ, ⋃ i : I (N+j), event j i) := measure_mono hcover + _ ≤ ∑' j : ℕ, P (⋃ i : I (N+j), event j i) := measure_iUnion_le _ + _ ≤ ∑' j : ℕ, ENNReal.ofReal (D*E/(jumpSize H j)^2*(C₀*q^(N+j))) := ENNReal.tsum_le_tsum hlevel + _ = ∑' j : ℕ, ENNReal.ofReal (K*((((j:ℝ)+1)*((j:ℝ)+2))^2*q^j)) := by + apply tsum_congr + intro j + rw [jump_energy_scale hH.ne'] + _ = ENNReal.ofReal (∑' j : ℕ, K*((((j:ℝ)+1)*((j:ℝ)+2))^2*q^j)) := by + symm + exact ENNReal.ofReal_tsum_of_nonneg (fun j => by positivity) hs + _ = _ := by rw [tsum_mul_left] + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +theorem strip_rectangle_hitting_discrete {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) + (hmean : stripMean H q r Fbar Q ≤ H/2) (N : ℕ) + (hN : 3*rectCoefficient Q*(N:ℝ)*stripEnergy H q r Fbar Q ≤ (H/4)^2) + {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) (Ξ : Ω → Set (ℝ × ℝ)) + {C₀ ρ : ℝ} (hC : 0 ≤ C₀) (hρ : 0 ≤ ρ) (hρ1 : ρ < 1) + (hhit : ∀ n i, P {ω | ∃ x ∈ Ξ ω, x ∈ (dyadicRect Q n i).closed} ≤ + ENNReal.ofReal (C₀*ρ^n)) : + P {ω | ∃ x ∈ Ξ ω, x ∈ Q.closed ∧ + stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I) = H} ≤ + ENNReal.ofReal ((64*rectCoefficient Q*C₀*stripEnergy H q r Fbar Q/H^2*ρ^N)* + ∑' j : ℕ, (((j:ℝ)+1)*((j:ℝ)+2))^2*ρ^j) := by + let means := fun n i => stripMean H q r Fbar (dyadicRect Q n i) + let energy := fun n i => stripEnergy H q r Fbar (dyadicRect Q n i) + let value := fun x : Q.closed => stripPotential H q r Fbar ((x.val.1:ℂ)+(x.val.2:ℂ)*Complex.I) + let branch := fun x : Q.closed => dPointBranch Q x.val + let Ξ' := fun ω => {x : Q.closed | x.val ∈ Ξ ω} + have hroot (i : DIndex N) : means N i ≤ 3*H/4 := by + have hb := (strip_dyadic_mean_critical hF hinj hext hcont hH hr Q hlo hhi N i).trans hN + have hd := le_of_sq_le_sq hb (show 0 ≤ H/4 by positivity) + dsimp only [means] + linarith + have hstep (n : ℕ) (i : DIndex (n+1)) : + |means (n+1) i-means n (dParent n i)|^2 ≤ rectCoefficient Q*energy n (dParent n i) := by + rw [sq_abs] + exact strip_dyadic_mean_step hF hinj hext hcont hH hr Q hlo hhi n i + have hlim (x : Q.closed) : Tendsto (fun n => means n (branch x n)) atTop (𝓝 (value x)) := + strip_dyadic_mean_limit hcont hH.le hr Q hlo hhi x.property + have hnon (n : ℕ) (i : DIndex n) : 0 ≤ energy n i := integral_nonneg (fun _ => sq_nonneg _) + have hE : 0 ≤ stripEnergy H q r Fbar Q := integral_nonneg (fun _ => sq_nonneg _) + have hsum (n : ℕ) : ∑ i, energy n i ≤ stripEnergy H q r Fbar Q := by + apply le_of_eq + exact dyadic_integral_sum Q (strip_gradient_rect_memLp hF hinj hext hH hr q Q.a Q.b hlo hhi).integrable_sq n + have hh (n : ℕ) (i : DIndex n) : P {ω | ∃ x ∈ Ξ' ω, branch x n = i} ≤ ENNReal.ofReal (C₀*ρ^n) := by + refine (measure_mono ?_).trans (hhit n i) + rintro ω ⟨x,hx,hi⟩ + have hxmem := dPointBranch_mem x.property n + change x.val ∈ (dyadicRect Q n (branch x n)).closed at hxmem + rw [hi] at hxmem + exact ⟨x.val,hx,hxmem⟩ + have ht := dyadic_energy_hitting dParent branch means energy value hH (rectCoefficient_pos Q).le hE + hC hρ hρ1 N (fun x n => dPointBranch_parent Q x.val n) hroot hstep hlim hnon hsum P Ξ' hh + refine (measure_mono ?_).trans ht + rintro ω ⟨x,hx,hxQ,hvalue⟩ + exact ⟨⟨x,hxQ⟩,hx,hvalue⟩ + +lemma geometric_floor_bound {ρ : ℝ} (hρ : 0 < ρ) (hρ1 : ρ < 1) (x : ℝ) : + ρ^Nat.floor x ≤ Real.exp (Real.log ρ*x)/ρ := by + have hh := Real.rpow_le_rpow_of_exponent_ge hρ hρ1.le (Nat.sub_one_lt_floor x).le + rw [Real.rpow_natCast] at hh + refine hh.trans_eq ?_ + rw [Real.rpow_sub hρ,Real.rpow_one,Real.rpow_def_of_pos hρ] + +lemma critical_floor {D E H : ℝ} (hD : 0 < D) (hE : 0 < E) : + 3*D*(Nat.floor (H^2/(48*D*E)):ℝ)*E ≤ (H/4)^2 := by + have hf := Nat.floor_le (show 0 ≤ H^2/(48*D*E) by positivity) + calc + _ ≤ 3*D*(H^2/(48*D*E))*E := by gcongr + _ = _ := by field_simp; ring + +theorem strip_rectangle_hitting {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) + (hmean : stripMean H q r Fbar Q ≤ H/2) + {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) (Ξ : Ω → Set (ℝ × ℝ)) + {C₀ ρ : ℝ} (hC : 0 ≤ C₀) (hρ : 0 < ρ) (hρ1 : ρ < 1) + (hhit : ∀ n i, P {ω | ∃ x ∈ Ξ ω, x ∈ (dyadicRect Q n i).closed} ≤ + ENNReal.ofReal (C₀*ρ^n)) : + let D := rectCoefficient Q + let E := stripEnergy H q r Fbar Q + let T := ∑' j : ℕ, (((j:ℝ)+1)*((j:ℝ)+2))^2*ρ^j + P {ω | ∃ x ∈ Ξ ω, x ∈ Q.closed ∧ + stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I) = H} ≤ + ENNReal.ofReal ((64*D*(C₀+1)*(T+1)/ρ)*(E/H^2)* + Real.exp (-((-Real.log ρ)/(48*D))*H^2/E)) := by + dsimp only + let D := rectCoefficient Q + let E := stripEnergy H q r Fbar Q + let T := ∑' j : ℕ, (((j:ℝ)+1)*((j:ℝ)+2))^2*ρ^j + have hD : 0 < D := rectCoefficient_pos Q + have hE0 : 0 ≤ E := integral_nonneg (fun _ => sq_nonneg _) + have hT : 0 ≤ T := tsum_nonneg (fun j => mul_nonneg (sq_nonneg _) (pow_nonneg hρ.le _)) + by_cases hE : E = 0 + · have ht := strip_rectangle_hitting_discrete hF hinj hext hcont hH hr q Q hlo hhi hmean 0 + (by simp; positivity) P Ξ hC hρ.le hρ1 hhit + change P _ ≤ ENNReal.ofReal ((64*D*C₀*E/H^2*ρ^0)*T) at ht + change P _ ≤ ENNReal.ofReal ((64*D*(C₀+1)*(T+1)/ρ)*(E/H^2)*_) + simpa only [hE,mul_zero,zero_div,zero_mul,ENNReal.ofReal_zero] using ht + · have hEpos : 0 < E := lt_of_le_of_ne hE0 (Ne.symm hE) + let x := H^2/(48*D*E) + have ht := strip_rectangle_hitting_discrete hF hinj hext hcont hH hr q Q hlo hhi hmean (Nat.floor x) + (critical_floor hD hEpos) P Ξ hC hρ.le hρ1 hhit + refine ht.trans (ENNReal.ofReal_le_ofReal ?_) + change (64*D*C₀*E/H^2*ρ^Nat.floor x)*T ≤ + (64*D*(C₀+1)*(T+1)/ρ)*(E/H^2)*Real.exp (-((-Real.log ρ)/(48*D))*H^2/E) + have hexp : Real.log ρ*x = -((-Real.log ρ)/(48*D))*H^2/E := by dsimp [x]; ring + have hg := geometric_floor_bound hρ hρ1 x + rw [hexp] at hg + have hcoef : C₀*T ≤ (C₀+1)*(T+1) := by nlinarith + calc + _ ≤ (64*D*C₀*E/H^2*(Real.exp (-((-Real.log ρ)/(48*D))*H^2/E)/ρ))*T := by gcongr + _ = (64*D/ρ)*(E/H^2)*Real.exp (-((-Real.log ρ)/(48*D))*H^2/E)*(C₀*T) := by ring + _ ≤ (64*D/ρ)*(E/H^2)*Real.exp (-((-Real.log ρ)/(48*D))*H^2/E)*((C₀+1)*(T+1)) := by + exact mul_le_mul_of_nonneg_left hcoef (by positivity) + _ = _ := by ring + +def localizationMeanConstant : ℝ := slabMeanCoefficient+Real.pi+1 + +lemma localizationMeanConstant_pos : 0 < localizationMeanConstant := by + unfold localizationMeanConstant + linarith [slabMeanCoefficient_pos,Real.pi_pos] + +def localizationStripWidth : ℝ := 1/(32*Real.pi*localizationMeanConstant) + +lemma localizationStripWidth_pos : 0 < localizationStripWidth := by + unfold localizationStripWidth + have hk := localizationMeanConstant_pos + positivity + +end SLEExactGauge.RectangleEnergy + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/FilledObstacle.lean b/lean/OAI/Probability/SLELocalization/FilledObstacle.lean new file mode 100644 index 0000000000000000000000000000000000000000..64352d34ed9d532a570e64170e17ae39de27768a --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/FilledObstacle.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks +import OAI.Probability.SLELocalization.PastObstacle + +namespace OAI + + +/-! Conformal localization and Filled Obstacle estimates. -/ + +noncomputable section +open Set Filter Topology +open scoped Topology +namespace SLEExactGauge + +lemma nearest_segment_subset_filling {A K : Set ℂ} (hAK : A ⊆ K) + (hfill : ∀ x ∈ K, connectedComponentIn Aᶜ x ⊆ K) + {x a : ℂ} (hx : x ∈ K) (ha : a ∈ A) + (hnear : ∀ b ∈ A, dist x a ≤ dist x b) : + _root_.segment ℝ x a ⊆ K := by + by_cases he : x = a + · subst a + simpa using singleton_subset_iff.mpr hx + have hd : 0 < dist x a := dist_pos.mpr he + let L : ℝ → ℂ := AffineMap.lineMap x a + have hc : Continuous L := (lipschitzWith_lineMap x a).continuous + have hLA : L '' Ico 0 1 ⊆ Aᶜ := by + rintro _ ⟨t,ht,rfl⟩ hb + have hh := hnear _ hb + rw [dist_left_lineMap,Real.norm_eq_abs,abs_of_nonneg ht.1] at hh + have ht1 := ht.2 + nlinarith + have hxL : x ∈ L '' Ico 0 1 := ⟨0,by norm_num,by simp [L]⟩ + have hLK : L '' Ico 0 1 ⊆ K := (isPreconnected_Ico.image _ hc.continuousOn + |>.subset_connectedComponentIn hxL hLA).trans (hfill x hx) + rw [segment_eq_image_lineMap] + rintro _ ⟨t,ht,rfl⟩ + rcases lt_or_eq_of_le ht.2 with ht1 | rfl + · exact hLK ⟨t,⟨ht.1,ht1⟩,rfl⟩ + · simpa using hAK ha + +lemma past_obstacle_subset_filled {γ : ℝ → ℂ} {T : ℝ} : + halfPlaneᶜ ∪ localizationSegment γ 0 T ⊆ (localizationDomain γ T)ᶜ := by + intro z hz hd + rcases hz with h | h + · exact h hd.1.1 + · exact hd.1.2 h + +lemma past_filled_component_closed {γ : ℝ → ℂ} {T : ℝ} : + ∀ x ∈ (localizationDomain γ T)ᶜ, + connectedComponentIn (halfPlaneᶜ ∪ localizationSegment γ 0 T)ᶜ x ⊆ + (localizationDomain γ T)ᶜ := by + intro x hx y hy hys + have he : (halfPlaneᶜ ∪ localizationSegment γ 0 T)ᶜ = halfPlane \ localizationSegment γ 0 T := by + ext z; simp + rw [he] at hy + have hxx : x ∈ halfPlane \ localizationSegment γ 0 T := + (connectedComponentIn_nonempty_iff).mp ⟨y,hy⟩ + apply hx + refine ⟨hxx,?_⟩ + simpa only [connectedComponentIn_eq hy] using hys.2 + +lemma locallyConnected_of_component_balls {K : Set ℂ} + (h : ∀ x ∈ K, ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + ∀ y ∈ K, dist y x < δ → y ∈ connectedComponentIn (K ∩ Metric.ball x ε) x) : + LocallyConnectedSpace K := by + rw [locallyConnectedSpace_iff_connected_subsets] + intro x U hU + obtain ⟨ε,hε,hεU⟩ := Metric.mem_nhds_iff.mp hU + obtain ⟨δ,hδ,hh⟩ := h x x.property ε hε + let C := connectedComponentIn (K ∩ Metric.ball (x:ℂ) ε) (x:ℂ) + have hCK : C ⊆ K := (connectedComponentIn_subset _ _).trans inter_subset_left + refine ⟨Subtype.val ⁻¹' C,?_,?_,?_⟩ + · apply Metric.mem_nhds_iff.mpr + exact ⟨δ,hδ,fun y hy => hh y y.property hy⟩ + · apply IsInducing.subtypeVal.isPreconnected_image.mp + simpa only [Subtype.image_preimage_coe,inter_eq_right.mpr hCK] using + (isPreconnected_connectedComponentIn : IsPreconnected C) + · intro y hy + exact hεU ((connectedComponentIn_subset _ _ hy).2) + +lemma locallyConnected_filling {A K : Set ℂ} (hA : IsClosed A) + [LocallyConnectedSpace A] (hAK : A ⊆ K) + (hfill : ∀ x ∈ K, connectedComponentIn Aᶜ x ⊆ K) : + LocallyConnectedSpace K := by + apply locallyConnected_of_component_balls + intro x hx ε hε + by_cases hxA : x ∈ A + · let xA : A := ⟨x,hxA⟩ + obtain ⟨V,hV,hVc,hVε⟩ := locallyConnectedSpace_iff_connected_subsets.1 + (inferInstance : LocallyConnectedSpace A) xA (Metric.ball xA ε) + (Metric.ball_mem_nhds _ hε) + obtain ⟨r,hr,hrV⟩ := Metric.mem_nhds_iff.mp hV + let C : Set ℂ := Subtype.val '' V + have hCA : C ⊆ A := Subtype.coe_image_subset _ _ + have hCε : C ⊆ Metric.ball x ε := by + rintro _ ⟨v,hv,rfl⟩ + exact hVε hv + have hxC : x ∈ C := ⟨xA,mem_of_mem_nhds hV,rfl⟩ + have hCc : IsPreconnected C := hVc.image _ continuous_subtype_val.continuousOn + refine ⟨min r ε / 4,by positivity,?_⟩ + intro y hy hyx + obtain ⟨a,ha,hea⟩ := hA.exists_infDist_eq_dist ⟨x,hxA⟩ y + have hnear : ∀ b ∈ A, dist y a ≤ dist y b := by + intro b hb + rw [← hea] + exact Metric.infDist_le_dist_of_mem hb + have hya : dist y a ≤ dist y x := hnear x hxA + have hax : dist a x < r := by + have hh := dist_triangle a y x + rw [dist_comm a y] at hh + have hm := min_le_left r ε + linarith + have haC : a ∈ C := ⟨⟨a,ha⟩,hrV hax,rfl⟩ + have hyε : y ∈ Metric.ball x ε := by + have hm := min_le_right r ε + change dist y x < ε + linarith + let S := _root_.segment ℝ y a + have hSK : S ⊆ K := nearest_segment_subset_filling hAK hfill hy ha hnear + have hSε : S ⊆ Metric.ball x ε := (convex_ball x ε).segment_subset hyε (hCε haC) + have hUc : IsPreconnected (C ∪ S) := hCc.union a haC (right_mem_segment ℝ y a) (convex_segment y a).isPreconnected + exact hUc.subset_connectedComponentIn (F := K ∩ Metric.ball x ε) (Or.inl hxC) + (union_subset (fun _ hz => ⟨hAK (hCA hz),hCε hz⟩) + (fun _ hz => ⟨hSK hz,hSε hz⟩)) (Or.inr (left_mem_segment ℝ y a)) + · obtain ⟨r,hr,hrA⟩ := Metric.isOpen_iff.mp hA.isOpen_compl x hxA + refine ⟨min r ε,lt_min hr hε,?_⟩ + intro y hy hyx + let B := Metric.ball x (min r ε) + have hxB : x ∈ B := Metric.mem_ball_self (lt_min hr hε) + have hBA : B ⊆ Aᶜ := (Metric.ball_subset_ball (min_le_left _ _)).trans hrA + have hBK : B ⊆ K := ((convex_ball x (min r ε)).isPreconnected.subset_connectedComponentIn + hxB hBA).trans (hfill x hx) + exact (convex_ball x (min r ε)).isPreconnected.subset_connectedComponentIn + (F := K ∩ Metric.ball x ε) hxB + (fun _ hz => ⟨hBK hz,(Metric.ball_subset_ball (min_le_right _ _)) hz⟩) hyx + +theorem past_filled_locallyConnected {γ : ℝ → ℂ} {T : ℝ} (hT : 0 ≤ T) + (hc : ContinuousOn γ (Icc 0 T)) : + LocallyConnectedSpace (↑((localizationDomain γ T)ᶜ) : Type) := by + have := past_obstacle_locallyConnected hT hc + exact locallyConnected_filling + (halfPlane_open.isClosed_compl.union (past_trace_continuum hT hc).1.isClosed) + past_obstacle_subset_filled past_filled_component_closed + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/FiniteClock.lean b/lean/OAI/Probability/SLELocalization/FiniteClock.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bee8f499ce822b5b13b87d406856bbb46516eab --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/FiniteClock.lean @@ -0,0 +1,254 @@ +import Mathlib +import OAI.Probability.SLELocalization.LoewnerExit +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Finite Clock estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.FiniteClock + +lemma live_density_below {κ : ℝ} (hκ : 0 < κ ∧ κ < 8) + {B : ℝ≥0 → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal) γ g f) + (hc : Continuous B) {z : ℂ} {s u δ : ℝ} + (hs : 0 ≤ s) (hz : z ∈ localizationDomain γ s) + (hclock : Real.log (2*z.im)-Real.log (loewnerRadius g s z) = u) + (hangle : loewnerAngleSine κ B g s z < angleFloor δ u) : + finiteStoppedDensity κ B γ g z u ∈ Ioo 0 (threshold κ z δ u) := by + have hU : ContinuousOn (fun t : ℝ => Real.sqrt κ*B t.toNNReal) (Ici 0) := (continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn + have hy : 0 < z.im := hz.1.1 + have hr := hm.radius_pos hs hz + have hrad : loewnerRadius g s z = (2*z.im)*Real.exp (-u) := by + have he : Real.log (loewnerRadius g s z) = Real.log (2*z.im)+(-u) := by linarith + have hh := congrArg Real.exp he + simpa only [Real.exp_log hr,Real.exp_add,Real.exp_log (show 0<2*z.im by positivity)] using hh + have hstop := hm.firstLiveRadiusStop_eq hU (t := ⟨s,hs⟩) hz hrad + have hsin : 0 < loewnerAngleSine κ B g s z := by + apply div_pos (hm.im_pos hs hz) + simpa only [Complex.ofReal_mul] using (norm_pos_iff.2 (hm.centered_ne_zero hs hz)) + have hRp := Real.rpow_pos_of_pos hr (-codimension κ) + have hval : 0 < (loewnerRadius g s z)^(-codimension κ)*(loewnerAngleSine κ B g s z)^(8/κ-1) := + mul_pos hRp (Real.rpow_pos_of_pos hsin _) + have hlt : (loewnerRadius g s z)^(-codimension κ)*(loewnerAngleSine κ B g s z)^(8/κ-1) < + ((2*z.im)*Real.exp (-u))^(-codimension κ)*(angleFloor δ u)^(8/κ-1) := by + rw [← hrad] + exact mul_lt_mul_of_pos_left (Real.rpow_lt_rpow hsin.le hangle (exponent_pos hκ)) hRp + simp only [finiteStoppedDensity,hstop] + exact ⟨ENNReal.ofReal_pos.2 hval,ENNReal.ofReal_lt_ofReal_iff (hval.trans hlt) |>.2 hlt⟩ + +lemma exponential_clock_bound {T δ Y₀ : ℝ} {Y C Q : ℝ → ℝ} + (hT : 0 ≤ T) (hδ : 0 < δ) (hY₀ : 0 < Y₀) + (hYinit : Y 0 = Y₀) (hCinit : C 0 = 0) + (hY : ContinuousOn Y (Icc 0 T)) (hC : ContinuousOn C (Icc 0 T)) + (_hYpos : ∀ t ∈ Icc 0 T, 0 < Y t) + (hQpos : ∀ t ∈ Ioo 0 T, 0 < Q t) + (hYQ : ∀ t ∈ Ioo 0 T, (Y t)^2 ≤ Q t) + (hangle : ∀ t ∈ Ioo 0 T, (angleFloor δ (C t))^2 * Q t ≤ (Y t)^2) + (hdY : ∀ t ∈ Ioo 0 T, HasDerivAt Y (-2*Y t/Q t) t) + (hdC : ∀ t ∈ Ioo 0 T, HasDerivAt C (4*(Y t)^2/(Q t)^2) t) : + T ≤ Y₀^2/(2*δ^4) := by + have hh : AntitoneOn (fun t => (Y t)^2 * Real.exp (C t)) (Icc 0 T) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 T) + ((hY.pow 2).mul (Real.continuous_exp.comp_continuousOn hC)) + (f' := fun t => (2*Y t*(-2*Y t/Q t))*Real.exp (C t) + + (Y t)^2*(Real.exp (C t)*(4*(Y t)^2/(Q t)^2))) + · intro t ht + rw [interior_Icc] at ht + convert (((hdY t ht).pow 2).mul (hdC t ht).exp).hasDerivWithinAt + (s := interior (Icc 0 T)) using 1 <;> first | rfl | (simp only [Pi.pow_apply]; ring) + · intro t ht + rw [interior_Icc] at ht + have hq := hQpos t ht + apply (mul_le_mul_iff_of_pos_right (sq_pos_of_pos hq)).1 + have hd := hYQ t ht + have hb := mul_nonpos_of_nonneg_of_nonpos + (show 0 ≤ 4*(Y t)^2*Real.exp (C t) by positivity) (sub_nonpos.2 hd) + field_simp + nlinarith [hb] + have height (t : ℝ) (ht : t ∈ Icc 0 T) : + (Y t)^2 ≤ Y₀^2*(Real.exp (-C t/2))^2 := by + have hh' := hh ⟨le_rfl,hT⟩ ht ht.1 + simp only [hYinit,hCinit,Real.exp_zero,mul_one] at hh' + have he : Real.exp (C t)*(Real.exp (-C t/2))^2 = 1 := by + rw [pow_two,← Real.exp_add,← Real.exp_add] + convert Real.exp_zero using 1; congr 1; ring + have hb := mul_le_mul_of_nonneg_right hh' (sq_nonneg (Real.exp (-C t/2))) + rwa [mul_assoc,he,mul_one] at hb + have rate (t : ℝ) (ht : t ∈ Ioo 0 T) : + 2*δ^4/Y₀^2 ≤ (4*(Y t)^2/(Q t)^2)/2*Real.exp (-C t/2) := by + have hq := hQpos t ht + have hD := Real.exp_pos (-C t/2) + have ha := pow_le_pow_left₀ + (mul_nonneg (sq_nonneg _) hq.le) (hangle t ht) 2 + have hE : (Real.exp (-C t/8))^4 = Real.exp (-C t/2) := by + rw [← Real.exp_nat_mul] + congr 1 + ring + have ha' : δ^4*Real.exp (-C t/2)*(Q t)^2 ≤ (Y t)^4 := by + simpa only [angleFloor,mul_pow,← pow_mul,show 2*2=4 by norm_num,hE] using ha + have hb := mul_le_mul_of_nonneg_right (height t ⟨ht.1.le,ht.2.le⟩) (sq_nonneg (Y t)) + have hc : δ^4*(Q t)^2 ≤ Y₀^2*Real.exp (-C t/2)*(Y t)^2 := by + apply (mul_le_mul_iff_of_pos_left hD).1 + nlinarith [ha',hb] + apply (div_le_iff₀ (sq_pos_of_pos hY₀)).2 + apply (mul_le_mul_iff_of_pos_right (sq_pos_of_pos hq)).1 + field_simp + simp only [neg_div] at hc + nlinarith [hc] + have hK : 0 < 2*δ^4/Y₀^2 := by positivity + have hm : AntitoneOn (fun t => Real.exp (-C t/2)+(2*δ^4/Y₀^2)*t) (Icc 0 T) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 T) + ((Real.continuous_exp.comp_continuousOn (hC.neg.div_const 2)).add (continuousOn_id.const_mul _)) + (f' := fun t => Real.exp (-C t/2)*(-(4*(Y t)^2/(Q t)^2)/2)+2*δ^4/Y₀^2) + · intro t ht + rw [interior_Icc] at ht + convert (((hdC t ht).neg.div_const 2).exp.add + ((hasDerivAt_id t).const_mul (2*δ^4/Y₀^2))).hasDerivWithinAt + (s := interior (Icc 0 T)) using 1 <;> first | rfl | (simp only [Pi.neg_apply]; ring) + · intro t ht + rw [interior_Icc] at ht + nlinarith [rate t ht] + have hb := hm ⟨le_rfl,hT⟩ ⟨hT,le_rfl⟩ hT + simp only [hCinit,neg_zero,zero_div,Real.exp_zero,mul_zero,add_zero] at hb + have ht : T ≤ 1/(2*δ^4/Y₀^2) := (le_div_iff₀ hK).2 (by nlinarith [Real.exp_pos (-C T/2)]) + convert ht using 1; field_simp + +lemma good_physical_clock {κ : ℝ} (hκ : 0 < κ ∧ κ < 8) + {B : ℝ≥0 → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal) γ g f) + (hc : Continuous B) {z : ℂ} (hz : z ∈ halfPlane) {δ v : ℝ} + (hδ : 0 < δ) (hv : 0 < v) + (hhit : firstLiveRadiusStop γ g z v ≠ (⊤ : ℝ≥0∞)) + (hgood : ∀ q : ℚ, 0 < (q:ℝ) → (q:ℝ) ≤ v → + finiteStoppedDensity κ B γ g z q ∉ Ioo 0 (threshold κ z δ q)) : + firstLiveRadiusStop γ g z v ≤ ENNReal.ofReal (z.im^2/(2*δ^4)) := by + have hUc : Continuous (fun t : ℝ => Real.sqrt κ*B t.toNNReal) := + continuous_const.mul (hc.comp continuous_real_toNNReal) + have hU := hUc.continuousOn (s := Ici 0) + obtain ⟨T,hstop,hzT,hrT⟩ := RadiusPast.live_radius_witness hm hU hhit + have hT : 0 < (T:ℝ) := by + have hp := hm.firstLiveRadiusStop_pos hU hz hv + rw [hstop] at hp + exact ENNReal.coe_pos.1 hp + let C := fun t => Real.log (2*z.im)-Real.log (loewnerRadius g t z) + have hC : ContinuousOn C (Icc 0 T) := + continuousOn_const.sub (hm.continuous_log_radius T.coe_nonneg (hU.mono Icc_subset_Ici_self) hzT) + have hCs : StrictMonoOn C (Icc 0 T) := by + intro a ha b hb hab + have hh := hm.log_radius_strictAnti T.coe_nonneg (hU.mono Icc_subset_Ici_self) hzT ha hb hab + dsimp [C] + linarith + have hC0 : C 0 = 0 := by simp only [C,hm.radius_initial hz,sub_self] + have hCT : C T = v := by + have hy : 0 < 2*z.im := by have : 0 loewnerAngleSine κ B g t z) (Icc 0 T) := by + have hh := (Complex.continuous_im.comp_continuousOn hg).div + (hg.sub (Complex.continuous_ofReal.comp hUc).continuousOn).norm + (fun t ht => norm_ne_zero_iff.2 (hm.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hzT))) + convert hh using 1; first | rfl | (funext t; simp only [loewnerAngleSine,Complex.ofReal_mul,Function.comp_def,Pi.div_apply,Pi.sub_apply]) + have hangle : ∀ t : ℝ, t ∈ Ioo 0 (T:ℝ) → angleFloor δ (C t) ≤ loewnerAngleSine κ B g t z := by + have hF : ContinuousOn (fun t => loewnerAngleSine κ B g t z-angleFloor δ (C t)) (Icc 0 T) := + hsine.sub (continuousOn_const.mul (Real.continuous_exp.comp_continuousOn (hC.neg.div_const 8))) + have hn := rational_clock_nonneg hT hC hCs hC0 hCT hF ?_ + · intro t ht + exact sub_nonneg.1 (hn t ht) + · intro q hq hqv s hs hseq + apply sub_nonneg.2 + by_contra hn + exact hgood q hq hqv (live_density_below hκ hm hc hs.1 + (survivingDomain_mono hs.2 hzT) hseq (by rw [← hseq]; exact lt_of_not_ge hn)) + have hbound : (T:ℝ) ≤ z.im^2/(2*δ^4) := by + apply exponential_clock_bound (Y := fun t => (g t z).im) (C := C) + (Q := fun t => Complex.normSq (g t z-((Real.sqrt κ*B t.toNNReal : ℝ) : ℂ))) + T.coe_nonneg hδ (show 0.symm ▸ rfl) hC0 + (Complex.continuous_im.comp_continuousOn hg) hC + · intro t ht + exact hm.im_pos ht.1 (survivingDomain_mono ht.2 hzT) + · intro t ht + exact Complex.normSq_pos.2 (hm.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hzT)) + · intro t ht + simp only [Complex.normSq_apply,Complex.sub_im,Complex.ofReal_im,sub_zero] + nlinarith [sq_nonneg ((g t z-((Real.sqrt κ*B t.toNNReal : ℝ) : ℂ)).re)] + · intro t ht + have hp := norm_pos_iff.2 (hm.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hzT)) + have hs := hangle t ht + simp only [loewnerAngleSine,← Complex.ofReal_mul] at hs + have ha := (le_div_iff₀ hp).1 hs + have hb := pow_le_pow_left₀ (mul_nonneg (angleFloor_pos hδ _).le hp.le) ha 2 + simpa only [mul_pow,Complex.normSq_eq_norm_sq] using hb + · intro t ht + exact hm.hasDerivAt_height ht.1 (survivingDomain_mono ht.2.le hzT) + · intro t ht + apply ((hm.hasDerivAt_log_radius T.coe_nonneg (hU.mono Icc_subset_Ici_self) hzT ht).const_sub + (Real.log (2*z.im))).congr_deriv + ring + rw [hstop] + simpa only [ENNReal.ofReal_coe_nnreal] using (ENNReal.ofReal_le_ofReal hbound) + +end SLEExactGauge.FiniteClock + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteClock + +theorem finiteCenteredPhysicalTime_tight {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (ε : ℝ) (hε : 0 < ε) : + ∃ T : ℝ, 0 < T ∧ ∀ u : ℝ, 1 ≤ u → + (finiteCenteredMeasure κ P B γ g z u) + {sample | ENNReal.ofReal T < firstLiveRadiusStop (γ sample) (g sample) z u} + < ENNReal.ofReal ε := by + obtain ⟨D,hD,hbound⟩ := bad_bound κ hκ B hB γ g f hγ hmaps z hz + obtain ⟨δ,hδ,hsmall⟩ := exists_small_floor (exponent_pos hκ) hD hε + refine ⟨z.im^2/(2*δ^4),by have hy : 0 hn (by simp only [finiteStoppedDensity,ht,ite_true,ENNReal.zero_div])) + have hsub : {sample | ENNReal.ofReal (z.im^2/(2*δ^4)) < + firstLiveRadiusStop (γ sample) (g sample) z u} ≤ᵐ[Q] bad κ B γ g z δ u := by + filter_upwards [hQP.ae_le hmaps,hQP.ae_le hB.cont,hhit] with sample hm hc hh hx + by_contra hn + have hg : ∀ q : ℚ, 0 < (q:ℝ) → (q:ℝ) ≤ u → + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z q ∉ Ioo 0 (threshold κ z δ q) := by + intro q hq hqu hbad + exact hn (mem_bad_of_rational κ B γ g z δ u q hq hqu hbad) + exact not_lt_of_ge (good_physical_clock (κ := κ) (B := fun t => B t sample) (γ := γ sample) + (g := g sample) (f := f sample) hκ hm hc hz hδ hu0 hh hg) hx + exact (measure_mono_ae hsub).trans_lt + ((hbound δ hδ u).trans_lt (ENNReal.ofReal_lt_ofReal_iff hε |>.2 hsmall)) + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/FiniteTimeMass.lean b/lean/OAI/Probability/SLELocalization/FiniteTimeMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..78161d6abebaa952c38606609ce5bad2c50562eb --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/FiniteTimeMass.lean @@ -0,0 +1,362 @@ +import Mathlib +import OAI.Probability.SLELocalization.FiniteClock +import OAI.Probability.SLELocalization.PhysicalPast +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Finite Time Mass estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteTilt GreenPhysical + +theorem physicalDistanceStoppedDensity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (ε : ℝ) (hε : 0 < ε) (hsmall : ε < z.im) : + (∫⁻ sample, physicalStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z ε ∂P) = + ENNReal.ofReal ((2*z.im)^(-codimension κ) * (z.im/‖z‖)^(8/κ-1)) := by + obtain ⟨u,hu,hρ⟩ : ∃ u : ℝ, 0 < u ∧ (2*z.im)*Real.exp (-u) < ε/4 := by + have hl : Tendsto (fun u : ℝ => (2*z.im)*Real.exp (-u)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul Real.tendsto_exp_neg_atTop_nhds_zero + exact ((eventually_gt_atTop 0).and (hl.eventually (gt_mem_nhds (by linarith : 0 < ε/4)))).exists + let C := cutoffs hz u hu.le + let F := fun n sample => ENNReal.ofReal ((C n).physicalValue κ B γ ε sample) + have hexp (n : ℕ) := (C n).physical_expectation hB κ hκ γ g f hmaps hz hu ε + have hFm (n : ℕ) : AEMeasurable (F n) P := + ENNReal.measurable_ofReal.comp_aemeasurable (hexp n).1.aemeasurable + have hFb (n : ℕ) : ∀ᵐ sample ∂P, F n sample ≤ ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb + exact ENNReal.ofReal_le_ofReal ((C n).physicalValue_bound κ hκ B γ ε sample hz hu hc hb) + have hFl : ∀ᵐ sample ∂P, Tendsto (fun n => F n sample) atTop + (𝓝 (physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z ε)) := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb + exact tendsto_physicalValue_killed κ B γ g f sample hm hz hu hc hb hε hsmall hρ hκ + have hfin : (∫⁻ _ : Ω, ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) ∂P) ≠ (⊤ : ℝ≥0∞) := by + rw [lintegral_const, measure_univ, mul_one] + exact ENNReal.ofReal_ne_top + have hdct := tendsto_lintegral_of_dominated_convergence' + (fun _ : Ω => ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8)))) hFm hFb hfin hFl + have hint (n : ℕ) : (∫⁻ sample, F n sample ∂P) = ENNReal.ofReal (green (1-κ/8) (8/κ-1) z.re z.im 0) := by + rw [← ofReal_integral_eq_lintegral_ofReal (hexp n).1 + (Filter.Eventually.of_forall (fun sample => (C n).physicalValue_nonneg κ B γ ε sample)), (hexp n).2] + simp only [hint] at hdct + have he := tendsto_nhds_unique hdct tendsto_const_nhds + rw [green_initial κ hz] at he + exact he + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.FiniteTilt + +lemma physicalValue_aemeasurable_tendsto {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + {e : ℝ} (he : 0 < e) (hes : e < z.im) (hr : (2*z.im)*Real.exp (-u) < e/4) : + (∀ n : ℕ, AEMeasurable (fun sample => ENNReal.ofReal + ((cutoffs hz u hu.le n).physicalValue κ B γ e sample)) P) ∧ + ∀ᵐ sample ∂P, Tendsto (fun n => ENNReal.ofReal + ((cutoffs hz u hu.le n).physicalValue κ B γ e sample)) atTop + (𝓝 (physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e)) := by + constructor + · intro n + exact ENNReal.measurable_ofReal.comp_aemeasurable + ((cutoffs hz u hu.le n).physical_expectation hB κ hκ γ g f hmaps hz hu e).1.aemeasurable + · filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb + exact tendsto_physicalValue_killed κ B γ g f sample hm hz hu hc hb he hes hr hκ + +lemma tendsto_setLIntegral_physicalValue {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + {e : ℝ} (he : 0 < e) (hes : e < z.im) (hr : (2*z.im)*Real.exp (-u) < e/4) (E : Set Ω) : + Tendsto (fun n => ∫⁻ sample in E, ENNReal.ofReal + ((cutoffs hz u hu.le n).physicalValue κ B γ e sample) ∂P) atTop + (𝓝 (∫⁻ sample in E, physicalStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z e ∂P)) := by + let C := cutoffs hz u hu.le + let F := fun n sample => ENNReal.ofReal ((C n).physicalValue κ B γ e sample) + obtain ⟨hFm,hFl⟩ := physicalValue_aemeasurable_tendsto hB κ hκ γ g f hmaps hz hu he hes hr + have hFb (n : ℕ) : ∀ᵐ sample ∂P.restrict E, + F n sample ≤ ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) := by + apply ae_restrict_of_ae + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb + exact ENNReal.ofReal_le_ofReal ((C n).physicalValue_bound κ hκ B γ e sample hz hu hc hb) + have hfin : (∫⁻ _ : Ω in E, ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) ∂P) ≠ ⊤ := by + rw [lintegral_const] + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (measure_ne_top _ _) + exact tendsto_lintegral_of_dominated_convergence' _ + (fun n => (hFm n).mono_measure Measure.restrict_le_self) hFb hfin (ae_restrict_of_ae hFl) + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteTilt + +lemma physical_radial_avoidance_identity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 < u) + (e : ℝ) (he : 0 < e) (hes : e < z.im) (hr : (2*z.im)*Real.exp (-u) < e/4) (S : ℝ≥0) : + (∫⁻ sample in PhysicalPast.avoids κ B z e S, + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e ∂P) = + ∫⁻ sample in PhysicalPast.avoids κ B z e S, + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P := by + let C := cutoffs hz u hu.le + let E := PhysicalPast.avoids κ B z e S + have hp := tendsto_setLIntegral_physicalValue hB κ hκ γ g f hmaps hz hu he hes hr E + have hr := tendsto_setLIntegral_value hB κ hκ γ g f hmaps hz hu.le C + (shrinkingAngle_tendsto z) E + have hh (n : ℕ) : (∫⁻ sample in E, ENNReal.ofReal ((C n).physicalValue κ B γ e sample) ∂P) = + ∫⁻ sample in E, ENNReal.ofReal ((C n).value κ B sample) ∂P := by + rw [← ofReal_integral_eq_lintegral_ofReal + ((C n).physical_expectation hB κ hκ γ g f hmaps hz hu e).1.integrableOn + (Filter.Eventually.of_forall (fun sample => (C n).physicalValue_nonneg κ B γ e sample)), + ← ofReal_integral_eq_lintegral_ofReal ((C n).expectation hB κ hκ hz hu.le).1.integrableOn + (Filter.Eventually.of_forall (fun sample => (C n).value_nonneg κ B sample))] + exact congrArg ENNReal.ofReal ((C n).physical_avoidance_setIntegral hB κ hκ hz hu γ g f hmaps e S).symm + exact tendsto_nhds_unique (hp.congr' (Filter.Eventually.of_forall hh)) hr + +lemma physicalStoppedDensity_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (e : ℝ) (he : 0 < e) (hes : e < z.im) : + AEMeasurable (fun sample => physicalStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z e) P := by + obtain ⟨u,hu,hr⟩ : ∃ u : ℝ, 0 < u ∧ (2*z.im)*Real.exp (-u) < e/4 := by + have hl : Tendsto (fun u : ℝ => (2*z.im)*Real.exp (-u)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul Real.tendsto_exp_neg_atTop_nhds_zero + exact ((eventually_gt_atTop 0).and (hl.eventually (gt_mem_nhds (by linarith : 0 < e/4)))).exists + obtain ⟨hFm,hFl⟩ := physicalValue_aemeasurable_tendsto hB κ hκ γ g f hmaps hz hu he hes hr + exact aemeasurable_of_tendsto_metrizable_ae' hFm hFl + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +lemma physicalStoppedDensity_pos_iff {κ : ℝ} {B : ℝ≥0 → ℝ} + {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal) γ g f) + (z : ℂ) (e : ℝ) : + 0 < physicalStoppedDensity κ B γ g z e ↔ firstLiveDistanceStop γ z e ≠ (⊤ : ℝ≥0∞) := by + by_cases hh : firstLiveDistanceStop γ z e = (⊤ : ℝ≥0∞) + · simp only [physicalStoppedDensity,hh,ite_true,lt_self_iff_false,ne_eq,not_true_eq_false] + · rw [physicalStoppedDensity,ite_eq_right hh] + constructor + · exact fun _ => hh + · intro _ + obtain ⟨t,ht,hlive,_,_⟩ := PhysicalStop.finite_spec hm.1 hh + rw [ht,ENNReal.coe_toReal] + apply ENNReal.ofReal_pos.2 + have hs : 0 < loewnerAngleSine κ B g t z := by + apply div_pos (hm.im_pos t.coe_nonneg hlive) + apply norm_pos_iff.2 + simpa only [Complex.ofReal_mul] using (hm.centered_ne_zero t.coe_nonneg hlive) + exact mul_pos (Real.rpow_pos_of_pos (hm.radius_pos t.coe_nonneg hlive) _) + (Real.rpow_pos_of_pos hs _) + +lemma physical_avoidance_at_finite_hit {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) + (hc : Continuous (fun t => B t sample)) + (z : ℂ) (e : ℝ) (S : ℝ≥0) (hh : firstLiveDistanceStop γ z e ≠ (⊤ : ℝ≥0∞)) : + sample ∈ PhysicalPast.avoids κ B z e S ↔ (S:ℝ≥0∞) < firstLiveDistanceStop γ z e := by + rw [PhysicalPast.avoids_eq_source κ B sample hm hc z e S] + obtain ⟨t,ht,hlive,hd,hmin⟩ := PhysicalStop.finite_spec hm.1 hh + rw [ht,ENNReal.coe_lt_coe] + constructor + · intro h + by_contra hn + exact (not_lt_of_ge hd) (h t (not_lt.1 hn)) + · intro h s hs + exact hmin s (hs.trans_lt h) + +lemma physical_before_deep_radius {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing U γ g f) (hU : ContinuousOn U (Ici 0)) + {z : ℂ} {e u : ℝ} (he : 0 < e) (hes : e < z.im) + (hr : (2*z.im)*Real.exp (-u) < e/4) + (hh : firstLiveRadiusStop γ g z u ≠ (⊤ : ℝ≥0∞)) : + firstLiveDistanceStop γ z e < firstLiveRadiusStop γ g z u := by + obtain ⟨t,ht,hlive,hradius⟩ := RadiusPast.live_radius_witness hm hU hh + rw [ht] + by_contra hn + have hb := hm.radius_ge_before_distance_stop he hes (not_lt.1 hn) hlive + rw [hradius] at hb + exact (not_lt_of_ge hb) hr + +lemma physical_early_nullMeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (e : ℝ) (he : 0 < e) (hes : e < z.im) (S : ℝ≥0) : + NullMeasurableSet {sample | firstLiveDistanceStop (γ sample) z e ≤ (S:ℝ≥0∞)} P := by + have hd := physicalStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz e he hes + have hA := (nullMeasurableSet_lt (aemeasurable_const (b := (0 : ℝ≥0∞))) hd).inter + (PhysicalPast.avoids_nullMeasurable κ hB z e S).compl + apply hA.congr + filter_upwards [hmaps,hB.cont] with sample hm hc + change (0 < physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e ∧ + sample ∉ PhysicalPast.avoids κ B z e S) = (firstLiveDistanceStop (γ sample) z e ≤ (S:ℝ≥0∞)) + apply propext + rw [physicalStoppedDensity_pos_iff (κ := κ) (B := fun t => B t sample) hm] + constructor + · rintro ⟨hh,hno⟩ + exact not_lt.1 (hno ∘ (physical_avoidance_at_finite_hit κ B sample hm hc z e S hh).2) + · intro hle + have hh := ne_top_of_le_ne_top ENNReal.coe_ne_top hle + exact ⟨hh,fun hs => not_lt_of_ge hle ((physical_avoidance_at_finite_hit κ B sample hm hc z e S hh).1 hs)⟩ + +theorem finiteTimePhysicalDensity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) : + ∃ T : ℝ, 0 < T ∧ ∀ e : ℝ, 0 < e → e < z.im → + ENNReal.ofReal (((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))/2) ≤ + ∫⁻ sample in {sample | firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T}, + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e ∂P := by + classical + let m := (2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1) + let M := ENNReal.ofReal m + have hm : 0 < m := localizationInitialGreen_pos κ hz + have hM0 : M ≠ 0 := (ENNReal.ofReal_pos.2 hm).ne' + have hMtop : M ≠ ⊤ := ENNReal.ofReal_ne_top + obtain ⟨T,hT,hclock⟩ := finiteCenteredPhysicalTime_tight κ hκ B hB γ g f hγ hmaps z hz + (1/2) (by norm_num) + refine ⟨T,hT,?_⟩ + intro e he hes + let S : ℝ≥0 := ⟨T,hT.le⟩ + have hS : (S : ℝ≥0∞) = ENNReal.ofReal T := by + change (S : ℝ≥0∞) = ENNReal.ofReal (S : ℝ) + exact ENNReal.ofReal_coe_nnreal.symm + let E := PhysicalPast.avoids κ B z e S + let A := {sample | firstLiveDistanceStop (γ sample) z e ≤ (S:ℝ≥0∞)} + let D := fun sample => physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e + have hE : NullMeasurableSet E P := PhysicalPast.avoids_nullMeasurable κ hB z e S + have hA : NullMeasurableSet A P := physical_early_nullMeasurable κ hκ B hB γ g f hmaps z hz e he hes S + have hD : AEMeasurable D P := physicalStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz e he hes + obtain ⟨u,hu,hr⟩ : ∃ u : ℝ, 1 < u ∧ (2*z.im)*Real.exp (-u) < e/4 := by + have hl : Tendsto (fun u : ℝ => (2*z.im)*Real.exp (-u)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul Real.tendsto_exp_neg_atTop_nhds_zero + exact ((eventually_gt_atTop 1).and (hl.eventually (gt_mem_nhds (by linarith : 0 < e/4)))).exists + have hu0 : 0 < u := by linarith + let Q := finiteCenteredMeasure κ P B γ g z u + have hQP : Q ≪ P := withDensity_absolutelyContinuous _ _ + have hhit : ∀ᵐ sample ∂Q, firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞) := by + change ∀ᵐ sample ∂P.withDensity _,_ + rw [ae_withDensity_iff' ((finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz u hu0).div_const _)] + exact Filter.Eventually.of_forall (fun sample hn ht => hn (by simp only [finiteStoppedDensity,ht,ite_true,ENNReal.zero_div])) + have hsub : E ≤ᵐ[Q] {sample | (S:ℝ≥0∞) < firstLiveRadiusStop (γ sample) (g sample) z u} := by + filter_upwards [hQP.ae_le hmaps,hQP.ae_le hB.cont,hhit] with sample hmaps hc hhit hmem + have hpr := physical_before_deep_radius hmaps + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) he hes hr hhit + have hfp : firstLiveDistanceStop (γ sample) z e ≠ (⊤ : ℝ≥0∞) := ne_top_of_lt hpr + exact ((physical_avoidance_at_finite_hit κ B sample hmaps hc z e S hfp).1 hmem).trans hpr + have hQE : Q E ≤ ENNReal.ofReal (1/2) := by + apply (measure_mono_ae hsub).trans + simpa only [hS] using (hclock u hu.le).le + have hid : (∫⁻ sample in E, D sample ∂P) = M*Q E := by + rw [physical_radial_avoidance_identity κ hκ B hB γ g f hmaps z hz u hu0 e he hes hr S] + rw [show Q E = ∫⁻ sample in E, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u / M ∂P from withDensity_apply₀ _ hE] + simp_rw [ENNReal.div_eq_inv_mul] + rw [lintegral_const_mul' _ _ (ENNReal.inv_ne_top.2 hM0),← mul_assoc,ENNReal.mul_inv_cancel hM0 hMtop,one_mul] + have hhalf : M*ENNReal.ofReal (1/2) = ENNReal.ofReal (m/2) := by + rw [← ENNReal.ofReal_mul hm.le] + congr 1 + ring + have htail : (∫⁻ sample in E, D sample ∂P) ≤ ENNReal.ofReal (m/2) := by + rw [hid,← hhalf] + exact mul_le_mul' le_rfl hQE + have hi : Eᶜ.indicator D =ᵐ[P] A.indicator D := by + filter_upwards [hmaps,hB.cont] with sample hm hc + by_cases hh : firstLiveDistanceStop (γ sample) z e = (⊤ : ℝ≥0∞) + · have hd : D sample = 0 := by simp only [D,physicalStoppedDensity,hh,ite_true] + simp only [Set.indicator_apply,hd,ite_self] + · have hv := physical_avoidance_at_finite_hit κ B sample hm hc z e S hh + have hae : sample ∈ Eᶜ ↔ sample ∈ A := by + simpa only [E,A,mem_compl_iff,mem_ofPred_eq,not_lt] using hv.not + simp only [Set.indicator_apply,hae] + have hall : (∫⁻ sample in E, D sample ∂P)+(∫⁻ sample in A, D sample ∂P) = M := by + rw [← lintegral_indicator₀ hA,← lintegral_congr_ae hi,← lintegral_indicator₀ hE, + ← lintegral_add_left' (hD.indicator₀ hE)] + have hp : (fun sample => E.indicator D sample+Eᶜ.indicator D sample) = D := by + funext sample + by_cases hs : sample∈E <;> simp [hs] + rw [hp] + exact physicalDistanceStoppedDensity κ hκ B hB γ g f hγ hmaps z hz e he hes + have hdouble : M = ENNReal.ofReal (m/2)+ENNReal.ofReal (m/2) := by + change ENNReal.ofReal m = _ + rw [← ENNReal.ofReal_add (by positivity : 0 ≤ m/2) (by positivity : 0 ≤ m/2)] + congr 1 + ring + have hlow : ENNReal.ofReal (m/2) ≤ ∫⁻ sample in A, D sample ∂P := by + apply ENNReal.le_of_add_le_add_left ENNReal.ofReal_ne_top + rw [← hdouble,← hall] + exact add_le_add htail le_rfl + simpa only [A,D,m,hS] using hlow + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/FirstDisk.lean b/lean/OAI/Probability/SLELocalization/FirstDisk.lean new file mode 100644 index 0000000000000000000000000000000000000000..4166f4f6b921797f008650c5b2344f5eedf8a9a2 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/FirstDisk.lean @@ -0,0 +1,577 @@ +import Mathlib +import OAI.Probability.SLELocalization.LoewnerExit +import OAI.Probability.SLELocalization.PhysicalPast + +namespace OAI + + +/-! Conformal localization and Is Loewner Trace Using estimates. -/ + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge +namespace IsLoewnerTraceUsing +variable {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma hasDerivAt_real (h : IsLoewnerTraceUsing U γ g f) + {t : ℝ} (ht : 0 < t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + HasDerivAt (fun s => (g s z).re) + (2 * ((g t z).re-U t) / Complex.normSq (g t z-(U t:ℂ))) t := by + have hh := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t (h.hasDerivAt_eval ht hz) + simpa [Complex.div_re,Function.comp_def] using hh + +lemma initial_real_le (h : IsLoewnerTraceUsing U γ g f) + {T M : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc 0 T, U t ≤ M) (hend : (g T z).re ≤ M) : z.re ≤ M := by + let R : ℝ → ℝ := fun s => (g (T-s) z).re + have hc : ContinuousOn R (Icc 0 T) := + (Complex.continuous_re.comp_continuousOn (h.continuous_eval hT hz)).comp + (continuous_const.sub continuous_id).continuousOn (fun s hs => by constructor <;> linarith [hs.1,hs.2]) + have hd (s : ℝ) (hs : s ∈ Ico 0 T) : HasDerivAt R + (-2*((g (T-s) z).re-U (T-s))/Complex.normSq (g (T-s) z-(U (T-s):ℂ))) s := by + have he := (h.hasDerivAt_real (sub_pos.2 hs.2) + (survivingDomain_mono (by linarith [hs.1]) hz)).comp s + ((hasDerivAt_id s).const_sub T) + simpa [R,neg_div,Function.comp_def] using he + apply le_of_forall_pos_le_add + intro ε hε + have hb := image_le_of_deriv_right_lt_deriv_boundary hc + (fun s hs => (hd s hs).hasDerivWithinAt) + (B:=fun _ => M+ε) (B':=fun _ => 0) + (by dsimp [R]; simpa using hend.trans (by linarith : M ≤ M+ε)) + (fun _ => hasDerivAt_const _ _) (fun s hs he => ?_) (x:=T) ⟨hT,le_rfl⟩ + · simpa [R,h.initial z hz.1.1] using hb + · have hden := Complex.normSq_pos.2 + (h.centered_ne_zero (t:=T-s) (z:=z) (by linarith [hs.2]) (survivingDomain_mono (by linarith [hs.1]) hz)) + have hh := hU (T-s) (by constructor <;> linarith [hs.1,hs.2]) + dsimp [R] at he + exact div_neg_of_neg_of_pos (by nlinarith) hden + +lemma initial_real_ge (h : IsLoewnerTraceUsing U γ g f) + {T m : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc 0 T, m ≤ U t) (hend : m ≤ (g T z).re) : m ≤ z.re := by + let R : ℝ → ℝ := fun s => -(g (T-s) z).re + have hc : ContinuousOn R (Icc 0 T) := + (Complex.continuous_re.comp_continuousOn (h.continuous_eval hT hz)).neg.comp + (continuous_const.sub continuous_id).continuousOn (fun s hs => by constructor <;> linarith [hs.1,hs.2]) + have hd (s : ℝ) (hs : s ∈ Ico 0 T) : HasDerivAt R + (2*((g (T-s) z).re-U (T-s))/Complex.normSq (g (T-s) z-(U (T-s):ℂ))) s := by + have he := ((h.hasDerivAt_real (sub_pos.2 hs.2) + (survivingDomain_mono (by linarith [hs.1]) hz)).comp s + ((hasDerivAt_id s).const_sub T)).neg + convert he using 1 + all_goals first | rfl | norm_num + have hn : -z.re ≤ -m := by + apply le_of_forall_pos_le_add + intro ε hε + have hb := image_le_of_deriv_right_lt_deriv_boundary hc + (fun s hs => (hd s hs).hasDerivWithinAt) + (B:=fun _ => -m+ε) (B':=fun _ => 0) + (by dsimp [R]; simpa using (show -(g T z).re ≤ -m+ε by linarith)) + (fun _ => hasDerivAt_const _ _) (fun s hs he => ?_) (x:=T) ⟨hT,le_rfl⟩ + · simpa [R,h.initial z hz.1.1] using hb + · have hden := Complex.normSq_pos.2 + (h.centered_ne_zero (t:=T-s) (z:=z) (by linarith [hs.2]) (survivingDomain_mono (by linarith [hs.1]) hz)) + have hh := hU (T-s) (by constructor <;> linarith [hs.1,hs.2]) + dsimp [R] at he + exact div_neg_of_neg_of_pos (by nlinarith) hden + linarith + +lemma initial_height_sq_le (h : IsLoewnerTraceUsing U γ g f) + {T : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + z.im^2 ≤ (g T z).im^2+4*T := by + have hm : MonotoneOn (fun s => (g s z).im^2+4*s) (Icc 0 T) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 T) + (((Complex.continuous_im.comp_continuousOn (h.continuous_eval hT hz)).pow 2).add + (continuous_const.mul continuous_id).continuousOn) + (f':=fun t => -4*(g t z).im^2/Complex.normSq (g t z-(U t:ℂ))+4) + · intro t ht + rw [interior_Icc] at ht + convert (((h.hasDerivAt_height ht.1 (survivingDomain_mono ht.2.le hz)).pow 2).add + ((hasDerivAt_id t).const_mul 4)).hasDerivWithinAt using 1 + all_goals first | rfl | (norm_num; ring) + · intro t ht + rw [interior_Icc] at ht + have hd := Complex.normSq_pos.2 (h.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hz)) + have he : (g t z).im^2 ≤ Complex.normSq (g t z-(U t:ℂ)) := by + simp only [Complex.normSq_apply,Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,sub_zero] + nlinarith [sq_nonneg ((g t z).re-U t)] + have hb : -4*(g t z).im^2/Complex.normSq (g t z-(U t:ℂ)) ≥ -4 := by + exact (le_div_iff₀ hd).2 (by nlinarith) + linarith + simpa [h.initial z hz.1.1] using hm ⟨le_rfl,hT⟩ ⟨hT,le_rfl⟩ hT + +end IsLoewnerTraceUsing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge + +theorem trace_driver_rectangle + {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T m M : ℝ} (_hT : 0 ≤ T) + (_hU : ContinuousOn U (Icc 0 T)) + (hb : ∀ t ∈ Icc 0 T, m ≤ U t ∧ U t ≤ M) : + ∀ t ∈ Icc 0 T, m ≤ (γ t).re ∧ (γ t).re ≤ M ∧ (γ t).im ^ 2 ≤ 4*t := by + intro t ht + let w : ℝ → ℂ := fun y => (U t:ℂ)+(y:ℂ)*Complex.I + let z : ℝ → ℂ := fun y => f t (w y) + have hw (y : ℝ) (hy : 0 < y) : w y ∈ halfPlane := by simpa [w,halfPlane] using hy + have hz (y : ℝ) (hy : 0 < y) : z y ∈ localizationDomain γ t := + h.2.2.2.2.2.2.2.2.1 t ht.1 (hw y hy) + have he (y : ℝ) (hy : 0 < y) : g t (z y) = w y := + h.2.2.2.2.2.2.2.2.2.2.1 t ht.1 _ (hw y hy) + have hlim : Tendsto z (𝓝[>] (0:ℝ)) (𝓝 (γ t)) := + h.2.2.2.2.2.2.2.2.2.2.2.2.2 t ht.1 + have hleft (y : ℝ) (hy : 0 < y) : m ≤ (z y).re := + h.initial_real_ge ht.1 (hz y hy) + (fun s hs => (hb s ⟨hs.1,hs.2.trans ht.2⟩).1) + (by simpa [he y hy,w] using (hb t ht).1) + have hright (y : ℝ) (hy : 0 < y) : (z y).re ≤ M := + h.initial_real_le ht.1 (hz y hy) + (fun s hs => (hb s ⟨hs.1,hs.2.trans ht.2⟩).2) + (by simpa [he y hy,w] using (hb t ht).2) + have hheight (y : ℝ) (hy : 0 < y) : (z y).im^2 ≤ y^2+4*t := by + simpa [he y hy,w] using h.initial_height_sq_le ht.1 (hz y hy) + refine ⟨ge_of_tendsto (Complex.continuous_re.continuousAt.tendsto.comp hlim) ?_, + le_of_tendsto (Complex.continuous_re.continuousAt.tendsto.comp hlim) ?_,?_⟩ + · filter_upwards [self_mem_nhdsWithin] with y hy using hleft y hy + · filter_upwards [self_mem_nhdsWithin] with y hy using hright y hy + · have hr : Tendsto (fun y : ℝ => y^2+4*t) (𝓝[>] (0:ℝ)) (𝓝 (4*t)) := by + simpa using (show ContinuousAt (fun y : ℝ => y^2+4*t) 0 by fun_prop).tendsto.mono_left nhdsWithin_le_nhds + apply le_of_tendsto_of_tendsto ((Complex.continuous_im.continuousAt.tendsto.comp hlim).pow 2) hr + filter_upwards [self_mem_nhdsWithin] with y hy using hheight y hy + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge +namespace IsLoewnerTraceUsing +variable {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma earlier_real_le (h : IsLoewnerTraceUsing U γ g f) + {S T M : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc S T, U t ≤ M) (hend : (g T z).re ≤ M) : (g S z).re ≤ M := by + have hT : 0 ≤ T := hS.trans hST + let R : ℝ → ℝ := fun s => (g (T-s) z).re + have hc : ContinuousOn R (Icc 0 (T-S)) := + (Complex.continuous_re.comp_continuousOn (h.continuous_eval hT hz)).comp + (continuous_const.sub continuous_id).continuousOn (fun s hs => by constructor <;> linarith [hs.1,hs.2]) + have hd (s : ℝ) (hs : s ∈ Ico 0 (T-S)) : HasDerivAt R + (-2*((g (T-s) z).re-U (T-s))/Complex.normSq (g (T-s) z-(U (T-s):ℂ))) s := by + have he := (h.hasDerivAt_real (by linarith [hs.2] : 0 < T-s) + (survivingDomain_mono (by linarith [hs.1]) hz)).comp s + ((hasDerivAt_id s).const_sub T) + simpa [R,neg_div,Function.comp_def] using he + apply le_of_forall_pos_le_add + intro ε hε + have hb := image_le_of_deriv_right_lt_deriv_boundary hc + (fun s hs => (hd s hs).hasDerivWithinAt) + (B:=fun _ => M+ε) (B':=fun _ => 0) + (by dsimp [R]; simpa using hend.trans (by linarith : M ≤ M+ε)) + (fun _ => hasDerivAt_const _ _) (fun s hs he => ?_) (x:=T-S) ⟨sub_nonneg.2 hST,le_rfl⟩ + · simpa [R,sub_sub_cancel] using hb + · have hden := Complex.normSq_pos.2 + (h.centered_ne_zero (t:=T-s) (z:=z) (by linarith [hs.2]) (survivingDomain_mono (by linarith [hs.1]) hz)) + have hh := hU (T-s) (by constructor <;> linarith [hs.1,hs.2]) + dsimp [R] at he + exact div_neg_of_neg_of_pos (by nlinarith) hden + +lemma earlier_real_ge (h : IsLoewnerTraceUsing U γ g f) + {S T m : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc S T, m ≤ U t) (hend : m ≤ (g T z).re) : m ≤ (g S z).re := by + have hT : 0 ≤ T := hS.trans hST + let R : ℝ → ℝ := fun s => -(g (T-s) z).re + have hc : ContinuousOn R (Icc 0 (T-S)) := + (Complex.continuous_re.comp_continuousOn (h.continuous_eval hT hz)).neg.comp + (continuous_const.sub continuous_id).continuousOn (fun s hs => by constructor <;> linarith [hs.1,hs.2]) + have hd (s : ℝ) (hs : s ∈ Ico 0 (T-S)) : HasDerivAt R + (2*((g (T-s) z).re-U (T-s))/Complex.normSq (g (T-s) z-(U (T-s):ℂ))) s := by + have he := ((h.hasDerivAt_real (by linarith [hs.2] : 0 < T-s) + (survivingDomain_mono (by linarith [hs.1]) hz)).comp s + ((hasDerivAt_id s).const_sub T)).neg + convert he using 1 + all_goals first | rfl | norm_num + have hn : -(g S z).re ≤ -m := by + apply le_of_forall_pos_le_add + intro ε hε + have hb := image_le_of_deriv_right_lt_deriv_boundary hc + (fun s hs => (hd s hs).hasDerivWithinAt) + (B:=fun _ => -m+ε) (B':=fun _ => 0) + (by dsimp [R]; simpa using (show -(g T z).re ≤ -m+ε by linarith)) + (fun _ => hasDerivAt_const _ _) (fun s hs he => ?_) (x:=T-S) ⟨sub_nonneg.2 hST,le_rfl⟩ + · simpa [R,sub_sub_cancel] using hb + · have hden := Complex.normSq_pos.2 + (h.centered_ne_zero (t:=T-s) (z:=z) (by linarith [hs.2]) (survivingDomain_mono (by linarith [hs.1]) hz)) + have hh := hU (T-s) (by constructor <;> linarith [hs.1,hs.2]) + dsimp [R] at he + exact div_neg_of_neg_of_pos (by nlinarith) hden + linarith + +lemma earlier_height_sq_le (h : IsLoewnerTraceUsing U γ g f) + {S T : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + (g S z).im^2 ≤ (g T z).im^2+4*(T-S) := by + have hT : 0 ≤ T := hS.trans hST + have hcont := (h.continuous_eval hT hz).mono (Icc_subset_Icc hS le_rfl) + have hm : MonotoneOn (fun s => (g s z).im^2+4*s) (Icc S T) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc S T) + (((Complex.continuous_im.comp_continuousOn hcont).pow 2).add + (continuous_const.mul continuous_id).continuousOn) + (f':=fun t => -4*(g t z).im^2/Complex.normSq (g t z-(U t:ℂ))+4) + · intro t ht + rw [interior_Icc] at ht + convert (((h.hasDerivAt_height (hS.trans_lt ht.1) (survivingDomain_mono ht.2.le hz)).pow 2).add + ((hasDerivAt_id t).const_mul 4)).hasDerivWithinAt using 1 + all_goals first | rfl | (norm_num; ring) + · intro t ht + rw [interior_Icc] at ht + have hd := Complex.normSq_pos.2 (h.centered_ne_zero (hS.trans ht.1.le) (survivingDomain_mono ht.2.le hz)) + have he : (g t z).im^2 ≤ Complex.normSq (g t z-(U t:ℂ)) := by + simp only [Complex.normSq_apply,Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,sub_zero] + nlinarith [sq_nonneg ((g t z).re-U t)] + have hb : -4*(g t z).im^2/Complex.normSq (g t z-(U t:ℂ)) ≥ -4 := by + exact (le_div_iff₀ hd).2 (by nlinarith) + linarith + have hh := hm ⟨le_rfl,hST⟩ ⟨hST,le_rfl⟩ hST + linarith + +lemma later_real_le (h : IsLoewnerTraceUsing U γ g f) + {S T M ε : ℝ} (hS : 0 < S) (hST : S ≤ T) (hε : 0 < ε) + {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc S T, U t ≤ M) (hstart : (g S z).re ≤ M) : + (g T z).re ≤ M+ε+(2/ε)*(T-S) := by + have hc := Complex.continuous_re.comp_continuousOn + ((h.continuous_eval (hS.le.trans hST) hz).mono (Icc_subset_Icc hS.le le_rfl)) + have hd (t : ℝ) (ht : t ∈ Ico S T) := + h.hasDerivAt_real (hS.trans_le ht.1) (survivingDomain_mono ht.2.le hz) + apply image_le_of_deriv_right_lt_deriv_boundary hc + (fun t ht => (hd t ht).hasDerivWithinAt) + (B:=fun t => M+ε+(2/ε)*(t-S)) (B':=fun _ => 2/ε) + (by simpa using hstart.trans (show M ≤ M+ε by linarith)) + (fun t => by simpa using (((hasDerivAt_id t).sub_const S).const_mul (2/ε)).const_add (M+ε)) + (fun t ht he => ?_) ⟨hST,le_rfl⟩ + have hden := Complex.normSq_pos.2 (h.centered_ne_zero (hS.le.trans ht.1) (survivingDomain_mono ht.2.le hz)) + have hu := hU t ⟨ht.1,ht.2.le⟩ + have hx : ε ≤ (g t z).re-U t := by + have hh : 0 ≤ (2/ε)*(t-S) := mul_nonneg (by positivity) (sub_nonneg.2 ht.1) + dsimp only [Function.comp_apply] at he + linarith + have hy := h.im_pos (hS.le.trans ht.1) (survivingDomain_mono ht.2.le hz) + rw [div_lt_div_iff₀ hden hε] + simp only [Complex.normSq_apply,Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,sub_zero] + nlinarith [sq_pos_of_pos hy, mul_nonneg (sub_nonneg.2 hx) (show 0 ≤ (g t z).re-U t by linarith)] + +lemma later_real_ge (h : IsLoewnerTraceUsing U γ g f) + {S T m ε : ℝ} (hS : 0 < S) (hST : S ≤ T) (hε : 0 < ε) + {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hU : ∀ t ∈ Icc S T, m ≤ U t) (hstart : m ≤ (g S z).re) : + m-ε-(2/ε)*(T-S) ≤ (g T z).re := by + have hc := (Complex.continuous_re.comp_continuousOn + ((h.continuous_eval (hS.le.trans hST) hz).mono (Icc_subset_Icc hS.le le_rfl))).neg + have hd (t : ℝ) (ht : t ∈ Ico S T) := + (h.hasDerivAt_real (hS.trans_le ht.1) (survivingDomain_mono ht.2.le hz)).neg + have hh := image_le_of_deriv_right_lt_deriv_boundary hc + (fun t ht => (hd t ht).hasDerivWithinAt) + (B:=fun t => -m+ε+(2/ε)*(t-S)) (B':=fun _ => 2/ε) + (by simpa using (show -(g S z).re ≤ -m+ε by linarith)) + (fun t => by simpa using (((hasDerivAt_id t).sub_const S).const_mul (2/ε)).const_add (-m+ε)) + (fun t ht he => ?_) (x:=T) ⟨hST,le_rfl⟩ + · dsimp only [Function.comp_apply, Pi.neg_apply] at hh + linarith + · have hden := Complex.normSq_pos.2 (h.centered_ne_zero (hS.le.trans ht.1) (survivingDomain_mono ht.2.le hz)) + have hu := hU t ⟨ht.1,ht.2.le⟩ + have hx : ε ≤ U t-(g t z).re := by + have hh : 0 ≤ (2/ε)*(t-S) := mul_nonneg (by positivity) (sub_nonneg.2 ht.1) + dsimp only [Function.comp_apply, Pi.neg_apply] at he + linarith + have hy := h.im_pos (hS.le.trans ht.1) (survivingDomain_mono ht.2.le hz) + rw [← neg_div,div_lt_div_iff₀ hden hε] + simp only [Complex.normSq_apply,Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,sub_zero] + nlinarith [sq_pos_of_pos hy, mul_nonneg (sub_nonneg.2 hx) (show 0 ≤ U t-(g t z).re by linarith)] + +theorem earlier_tip_rectangle (h : IsLoewnerTraceUsing U γ g f) + {S T m M : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) + (hlive : γ T ∈ localizationDomain γ S) + (hb : ∀ t ∈ Icc S T, m ≤ U t ∧ U t ≤ M) : + m ≤ (g S (γ T)).re ∧ (g S (γ T)).re ≤ M ∧ (g S (γ T)).im ^ 2 ≤ 4*(T-S) := by + have hT : 0 ≤ T := hS.trans hST + let w : ℝ → ℂ := fun y => (U T:ℂ)+(y:ℂ)*Complex.I + let z : ℝ → ℂ := fun y => f T (w y) + have hw (y : ℝ) (hy : 0 < y) : w y ∈ halfPlane := by simpa [w,halfPlane] using hy + have hz (y : ℝ) (hy : 0 < y) : z y ∈ localizationDomain γ T := + h.2.2.2.2.2.2.2.2.1 T hT (hw y hy) + have he (y : ℝ) (hy : 0 < y) : g T (z y) = w y := + h.2.2.2.2.2.2.2.2.2.2.1 T hT _ (hw y hy) + have hlim : Tendsto z (𝓝[>] (0:ℝ)) (𝓝 (γ T)) := + h.2.2.2.2.2.2.2.2.2.2.2.2.2 T hT + have hlim' : Tendsto (fun y => g S (z y)) (𝓝[>] (0:ℝ)) (𝓝 (g S (γ T))) := + (h.analytic_eval hS hlive).continuousAt.tendsto.comp hlim + have hleft (y : ℝ) (hy : 0 < y) : m ≤ (g S (z y)).re := + h.earlier_real_ge hS hST (hz y hy) (fun s hs => (hb s hs).1) + (by simpa [he y hy,w] using (hb T ⟨hST,le_rfl⟩).1) + have hright (y : ℝ) (hy : 0 < y) : (g S (z y)).re ≤ M := + h.earlier_real_le hS hST (hz y hy) (fun s hs => (hb s hs).2) + (by simpa [he y hy,w] using (hb T ⟨hST,le_rfl⟩).2) + have hheight (y : ℝ) (hy : 0 < y) : (g S (z y)).im^2 ≤ y^2+4*(T-S) := by + simpa [he y hy,w] using h.earlier_height_sq_le hS hST (hz y hy) + refine ⟨ge_of_tendsto (Complex.continuous_re.continuousAt.tendsto.comp hlim') ?_, + le_of_tendsto (Complex.continuous_re.continuousAt.tendsto.comp hlim') ?_,?_⟩ + · filter_upwards [self_mem_nhdsWithin] with y hy using hleft y hy + · filter_upwards [self_mem_nhdsWithin] with y hy using hright y hy + · have hr : Tendsto (fun y : ℝ => y^2+4*(T-S)) (𝓝[>] (0:ℝ)) (𝓝 (4*(T-S))) := by + simpa using (show ContinuousAt (fun y : ℝ => y^2+4*(T-S)) 0 by fun_prop).tendsto.mono_left nhdsWithin_le_nhds + apply le_of_tendsto_of_tendsto ((Complex.continuous_im.continuousAt.tendsto.comp hlim').pow 2) hr + filter_upwards [self_mem_nhdsWithin] with y hy using hheight y hy + +end IsLoewnerTraceUsing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge + +lemma ball_subset_localizationDomain {γ : ℝ → ℂ} {t : ℝ} {z : ℂ} {r : ℝ} + (hr : 0 < r) (hz : z ∈ localizationDomain γ t) + (hfree : ball z r ⊆ halfPlane \ localizationSegment γ 0 t) : + ball z r ⊆ localizationDomain γ t := by + have hc := (convex_ball z r).isPreconnected.subset_connectedComponentIn + (mem_ball_self hr) hfree + intro w hw + refine ⟨hfree hw,?_⟩ + rw [← connectedComponentIn_eq (hc hw)] + exact hz.2 + +lemma first_disk_hit_free {γ : ℝ → ℂ} {T r : ℝ} {z : ℂ} + (hr : 0 < r) (hball : closedBall z r ⊆ halfPlane) + (hlive : z ∈ localizationDomain γ T) (hhit : dist (γ T) z = r) + (hpre : ∀ t ∈ Ico 0 T, r < dist (γ t) z) : + ball z r ⊆ localizationDomain γ T ∧ ∀ s ∈ Ico 0 T, + closedBall z r ⊆ localizationDomain γ s := by + constructor + · apply ball_subset_localizationDomain hr hlive + intro w hw + refine ⟨hball (ball_subset_closedBall hw),?_⟩ + rintro ⟨t,ht,he⟩ + subst w + rcases lt_or_eq_of_le ht.2 with hlt | rfl + · exact (not_le_of_gt (hpre t ⟨ht.1,hlt⟩)) (mem_ball.1 hw).le + · exact (ne_of_lt (mem_ball.1 hw)) hhit + · intro s hs + apply closedBall_subset_survivingDomain hr.le (survivingDomain_mono hs.2.le hlive) + intro w hw + refine ⟨hball hw,?_⟩ + rintro ⟨t,ht,he⟩ + subst w + exact (not_le_of_gt (hpre t ⟨ht.1,ht.2.trans_lt hs.2⟩)) (mem_closedBall.1 hw) + +lemma first_disk_hit_live_before {γ : ℝ → ℂ} {T r : ℝ} {z : ℂ} + (hr : 0 < r) (hball : closedBall z r ⊆ halfPlane) + (hlive : z ∈ localizationDomain γ T) (hhit : dist (γ T) z = r) + (hpre : ∀ t ∈ Ico 0 T, r < dist (γ t) z) : + ∀ s ∈ Ico 0 T, γ T ∈ localizationDomain γ s := by + intro s hs + exact (first_disk_hit_free hr hball hlive hhit hpre).2 s hs (mem_closedBall.2 hhit.le) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge +namespace IsLoewnerTraceUsing +variable {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +theorem fresh_tip_access (h : IsLoewnerTraceUsing U γ g f) {T : ℝ} + (hT : 0 < T) (hU : ContinuousOn U (Icc 0 T)) + (hlive : ∀ s ∈ Ico 0 T, γ T ∈ localizationDomain γ s) : + Tendsto (g T) (𝓝[localizationDomain γ T] (γ T)) (𝓝 (U T : ℂ)) := by + apply Metric.tendsto_nhds.2 + intro ε hε + let e := ε/10 + have he : 0 < e := by dsimp [e]; positivity + obtain ⟨η,hη,hηU⟩ := Metric.continuousWithinAt_iff.1 + (hU.continuousWithinAt ⟨hT.le,le_rfl⟩) e he + let δ := min η (e^2/8) + have hδ : 0 < δ := lt_min hη (by positivity) + obtain ⟨S,hSlo,hST⟩ := exists_between (max_lt hT (sub_lt_self T hδ)) + have hS : 0 < S := (le_max_left _ _).trans_lt hSlo + have hSδ : T-δ < S := (le_max_right _ _).trans_lt hSlo + have htimeη : T-S < η := (by linarith : T-S < δ).trans_le (min_le_left _ _) + have htimee : T-S < e^2/8 := (by linarith : T-S < δ).trans_le (min_le_right _ _) + have hUb (s : ℝ) (hs : s ∈ Icc S T) : U T-e ≤ U s ∧ U s ≤ U T+e := by + have hh := hηU ⟨hS.le.trans hs.1,hs.2⟩ (show dist s T < η by + rw [Real.dist_eq,abs_of_nonpos (sub_nonpos.2 hs.2)] + linarith [hs.1]) + rw [Real.dist_eq] at hh + have ha := abs_lt.1 hh + constructor <;> linarith [ha.1,ha.2] + have htip := h.earlier_tip_rectangle hS.le hST.le (hlive S ⟨hS.le,hST⟩) hUb + have htipim : (g S (γ T)).im < e := by + have hy := h.im_pos hS.le (hlive S ⟨hS.le,hST⟩) + nlinarith [htip.2.2] + have hevent : ∀ᶠ w in 𝓝[localizationDomain γ T] (γ T), + dist (g S w) (g S (γ T)) < e := + (Metric.tendsto_nhds.1 (h.analytic_eval hS.le (hlive S ⟨hS.le,hST⟩)).continuousAt.tendsto e he).filter_mono nhdsWithin_le_nhds + filter_upwards [hevent,self_mem_nhdsWithin] with w hnear hw + rw [dist_eq_norm] at hnear + have hrnear : |(g S w).re-(g S (γ T)).re| < e := by + simpa only [Complex.sub_re] using (Complex.abs_re_le_norm (g S w-g S (γ T))).trans_lt hnear + have hinear : |(g S w).im-(g S (γ T)).im| < e := by + simpa only [Complex.sub_im] using (Complex.abs_im_le_norm (g S w-g S (γ T))).trans_lt hnear + have hstartlo : U T-2*e ≤ (g S w).re := by nlinarith [(abs_lt.1 hrnear).1,htip.1] + have hstarthi : (g S w).re ≤ U T+2*e := by nlinarith [(abs_lt.1 hrnear).2,htip.2.1] + have hlo := h.later_real_ge hS hST.le he hw + (fun s hs => (show U T-2*e ≤ U T-e by linarith).trans (hUb s hs).1) hstartlo + have hhi := h.later_real_le hS hST.le he hw + (fun s hs => (hUb s hs).2.trans (show U T+e ≤ U T+2*e by linarith)) hstarthi + have hdt : (2/e)*(T-S) < e := by + calc + _ = 2*(T-S)/e := by ring + _ < e := (div_lt_iff₀ he).2 (by nlinarith) + have hre : |(g T w).re-U T| < 4*e := by + rw [abs_lt] + constructor <;> linarith + have him : (g T w).im < 2*e := by + have hm := h.height_antitone hT.le hw ⟨hS.le,hST.le⟩ ⟨hT.le,le_rfl⟩ hST.le + linarith [(abs_lt.1 hinear).2] + have himabs : |(g T w).im| < 2*e := by rw [abs_of_pos (h.im_pos hT.le hw)]; exact him + rw [dist_eq_norm] + calc + _ ≤ |(g T w).re-U T|+|(g T w).im| := by + simpa only [Complex.sub_re,Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,sub_zero] using + Complex.norm_le_abs_re_add_abs_im (g T w-(U T:ℂ)) + _ < 6*e := by linarith + _ < ε := by dsimp [e]; linarith + +end IsLoewnerTraceUsing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge + +theorem first_disk_hit_access {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T r : ℝ} {z : ℂ} + (hT : 0 < T) (hr : 0 < r) (hU : ContinuousOn U (Icc 0 T)) + (hball : Metric.closedBall z r ⊆ halfPlane) + (hlive : z ∈ localizationDomain γ T) + (hhit : dist (γ T) z = r) + (hpre : ∀ t ∈ Ico 0 T, r < dist (γ t) z) : + Tendsto (g T) (𝓝[localizationDomain γ T] (γ T)) (𝓝 (U T : ℂ)) := + h.fresh_tip_access hT hU (first_disk_hit_live_before hr hball hlive hhit hpre) + +theorem first_disk_hit_access_path {U : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing U γ g f) {T r : ℝ} {z : ℂ} + (hT : 0 < T) (hr : 0 < r) (hU : ContinuousOn U (Icc 0 T)) + (hball : closedBall z r ⊆ halfPlane) (hlive : z ∈ localizationDomain γ T) + (hhit : dist (γ T) z = r) (hpre : ∀ t ∈ Ico 0 T, r < dist (γ t) z) : + ∃ η : ℝ → ℂ, ContinuousOn η (Icc 0 1) ∧ η 0 = 0 ∧ ‖η 1‖ = 1 ∧ + (∀ u ∈ Ioc 0 1, 0 < (η u).im ∧ + f T ((U T:ℂ)+(‖g T z-(U T:ℂ)‖:ℂ)*η u) = + z+((1-u:ℝ):ℂ)*(γ T-z)) := by + classical + let R : ℝ → ℂ := fun u => z+((1-u:ℝ):ℂ)*(γ T-z) + let N := ‖g T z-(U T:ℂ)‖ + let H : ℝ → ℂ := fun u => ((N⁻¹:ℝ):ℂ)*(g T (R u)-(U T:ℂ)) + let η := Function.update H 0 0 + have hN : 0 < N := norm_pos_iff.2 (h.centered_ne_zero hT.le hlive) + have hNc : (N:ℂ) ≠ 0 := by exact_mod_cast hN.ne' + have hR0 : R 0 = γ T := by simp [R] + have hR1 : R 1 = z := by simp [R] + have hRc : Continuous R := by dsimp [R]; fun_prop + have hRball (u : ℝ) (hu : u ∈ Ioc 0 1) : R u ∈ ball z r := by + have hdist : dist (R u) z = (1-u)*r := by + rw [dist_eq_norm] + dsimp [R] + rw [add_sub_cancel_left,norm_mul,Complex.norm_real,Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.2 hu.2)] + rw [← dist_eq_norm,hhit] + rw [mem_ball,hdist] + nlinarith [mul_pos hu.1 hr] + have hRl (u : ℝ) (hu : u ∈ Ioc 0 1) : R u ∈ localizationDomain γ T := + (first_disk_hit_free hr hball hlive hhit hpre).1 (hRball u hu) + have hlimR : Tendsto R (𝓝[Icc (0:ℝ) 1 \ {0}] 0) (𝓝[localizationDomain γ T] (γ T)) := by + apply tendsto_nhdsWithin_iff.2 + refine ⟨?_,?_⟩ + · have hh : Tendsto R (𝓝[Icc (0:ℝ) 1 \ {0}] 0) (𝓝 (R 0)) := hRc.continuousAt.tendsto.mono_left nhdsWithin_le_nhds + rw [hR0] at hh + exact hh + · filter_upwards [self_mem_nhdsWithin] with u hu + exact hRl u ⟨lt_of_le_of_ne hu.1.1 (Ne.symm hu.2),hu.1.2⟩ + have hlimG := (first_disk_hit_access h hT hr hU hball hlive hhit hpre).comp hlimR + have hηcont : ContinuousOn η (Icc 0 1) := by + intro u hu + by_cases hu0 : u = 0 + · subst u + rw [show η = Function.update H 0 0 from rfl,continuousWithinAt_update_same] + simpa only [H,Function.comp_def,sub_self,mul_zero] using (hlimG.sub (tendsto_const_nhds (x := (U T:ℂ)))).const_mul ((N⁻¹:ℝ):ℂ) + · have hcH : ContinuousAt H u := by + exact continuousAt_const.mul (((h.analytic_eval hT.le (hRl u ⟨lt_of_le_of_ne hu.1 (Ne.symm hu0),hu.2⟩)).continuousAt.comp hRc.continuousAt).sub continuousAt_const) + apply hcH.continuousWithinAt.congr_of_eventuallyEq_of_mem _ hu + have hne : ∀ᶠ v in 𝓝 u, v ≠ (0:ℝ) := isOpen_ne.mem_nhds hu0 + filter_upwards [hne.filter_mono nhdsWithin_le_nhds] with v hv + exact Function.update_of_ne hv _ _ + refine ⟨η,hηcont,by simp [η],?_,?_⟩ + · rw [show η 1 = H 1 by simp [η]] + dsimp [H] + rw [hR1,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (inv_pos.2 hN)] + exact inv_mul_cancel₀ hN.ne' + · intro u hu + have hη : η u = H u := Function.update_of_ne (ne_of_gt hu.1) _ _ + rw [hη] + constructor + · have hy := h.im_pos hT.le (hRl u hu) + dsimp [H] + simpa only [Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,zero_mul,mul_zero, + add_zero,Complex.sub_im,sub_zero] using mul_pos (inv_pos.2 hN) hy + · have heq : (U T:ℂ)+(N:ℂ)*H u = g T (R u) := by + dsimp [H] + rw [Complex.ofReal_inv,← mul_assoc,mul_inv_cancel₀ hNc,one_mul] + ring + change f T ((U T:ℂ)+(N:ℂ)*H u) = R u + rw [heq] + exact h.2.2.2.2.2.2.2.2.2.1 T hT.le _ (hRl u hu) + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/GreenTilts.lean b/lean/OAI/Probability/SLELocalization/GreenTilts.lean new file mode 100644 index 0000000000000000000000000000000000000000..696caa6dbd5dbe6980b529029406feb11feea31a --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/GreenTilts.lean @@ -0,0 +1,1336 @@ +import Mathlib +import OAI.Probability.SLELocalization.LoewnerFlow +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Loewner Localized estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerExit LoewnerField +open scoped unitInterval +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + +lemma source_until_stop (h : IsLoewnerTraceUsing driver γ g f) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ρ δ 0) : + z ∈ localizationDomain γ (stop hε hT.le U z ρ δ) ∧ + EqOn (fun s => g s z) (position hε hT.le U z) (Icc 0 (stop hε hT.le U z ρ δ)) := by + have hb := stop_bounds hε hT.le U z ρ δ + have hh := h.cutoff_solution_live hε hb.1 (H := position hε hT.le U z) ?_ ?_ + · simpa only [position_initial] using hh + · intro t ht + rw [← hU ⟨ht.1,ht.2.trans hb.2⟩] + exact (position_derivWithin hε hT.le U z ⟨ht.1,ht.2.trans hb.2⟩).mono + (Icc_subset_Icc le_rfl hb.2) + · intro t ht + exact ((deficit_nonneg_iff hε hT.le U z ρ δ t).1 + (nonneg_until hε hT.le hT U z ρ δ h0 ht)).2.1 + +lemma logDerivative_eq_source (h : IsLoewnerTraceUsing driver γ g f) + (hcont : ContinuousOn driver (Icc 0 T)) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ρ δ 0) {t : ℝ} + (ht : t ∈ Icc 0 (stop hε hT.le U z ρ δ)) : + logDerivative hε hT.le U z t = Real.log ‖deriv (g t) z‖ := by + have hb := stop_bounds hε hT.le U z ρ δ + have hs := source_until_stop hε hT h U z ρ δ hU h0 + have hz := survivingDomain_mono ht.2 hs.1 + have hu := hcont.mono (Icc_subset_Icc le_rfl (ht.2.trans hb.2)) + rw [logDerivative_eq_integral hε hT.le U z ⟨ht.1,ht.2.trans hb.2⟩, + h.log_deriv_norm_eq ht.1 hu hz] + have hi := (h.continuous_spatialCoefficient ht.1 hu hz).intervalIntegrable_of_Icc (μ := volume) ht.1 + rw [← Complex.reCLM_apply, ← Complex.reCLM.intervalIntegral_comp_comm hi] + apply intervalIntegral.integral_congr + intro s hst + rw [uIcc_of_le ht.1] at hst + have hss : s ∈ Icc 0 (stop hε hT.le U z ρ δ) := ⟨hst.1,hst.2.trans ht.2⟩ + have hh := ((deficit_nonneg_iff hε hT.le U z ρ δ s).1 + (nonneg_until hε hT.le hT U z ρ δ h0 hss)).2.1 + unfold variation + rw [clampIm_eq (by simpa using hh)] + simp only [← hs.2 hss, hU ⟨hst.1,hss.2.trans hb.2⟩, Complex.reCLM_apply] + +lemma radius_eq_source (h : IsLoewnerTraceUsing driver γ g f) + (hcont : ContinuousOn driver (Icc 0 T)) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ρ δ 0) {t : ℝ} + (ht : t ∈ Icc 0 (stop hε hT.le U z ρ δ)) : + radius hε hT.le U z t = loewnerRadius g t z := by + have hs := source_until_stop hε hT h U z ρ δ hU h0 + rw [radius, logDerivative_eq_source hε hT h hcont U z ρ δ hU h0 ht, + Real.exp_log (norm_pos_iff.2 (h.deriv_ne_zero ht.1 (survivingDomain_mono ht.2 hs.1))), + ← hs.2 ht] + rfl + +lemma sine_eq_source (h : IsLoewnerTraceUsing driver γ g f) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ρ δ 0) {t : ℝ} + (ht : t ∈ Icc 0 (stop hε hT.le U z ρ δ)) : + sine hε hT.le U z t = (g t z).im / ‖g t z - (driver t : ℂ)‖ := by + have hs := source_until_stop hε hT h U z ρ δ hU h0 + have hh := ((deficit_nonneg_iff hε hT.le U z ρ δ t).1 + (nonneg_until hε hT.le hT U z ρ δ h0 ht)).2.1 + rw [sine, clampIm_eq (by simpa using hh), ← hs.2 ht, + hU ⟨ht.1,ht.2.trans (stop_bounds hε hT.le U z ρ δ).2⟩] + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerExit LoewnerField GreenPhysical +open scoped unitInterval +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + +lemma field_eq_radius_sine (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) + (hy : ε ≤ (position hε hT.le U z t).im) + (hU : extendDriver T U t = sdev*b) : + field hε hT.le p a sdev U z t b = + (radius hε hT.le U z t)^(-p) * (sine hε hT.le U z t)^a := by + rw [field, green_eq_source _ _ _ _ _ (height_pos hε hT.le U z t)] + have hh : height hε hT.le U z t = (position hε hT.le U z t).im := max_eq_right hy + rw [hh, radius, sine, clampIm_eq (by simpa using hy), hU] + simp only [Complex.norm_def, Complex.normSq_apply, Complex.sub_re, Complex.ofReal_re, + Complex.sub_im, Complex.ofReal_im, sub_zero, pow_two] + +lemma clock_bounds_stop (h : IsLoewnerTraceUsing driver γ g f) + (hcont : ContinuousOn driver (Icc 0 T)) + (U : C(I, ℝ)) (z : ℂ) (u δ : ℝ) (hδ : 0 < δ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ((2*z.im)*Real.exp (-u)) δ 0) : + z.im*Real.exp (-u/(2*δ^2)) ≤ (position hε hT.le U z + (stop hε hT.le U z ((2*z.im)*Real.exp (-u)) δ)).im ∧ + stop hε hT.le U z ((2*z.im)*Real.exp (-u)) δ ≤ u*z.im^2/(4*δ^4) := by + let ρ := (2*z.im)*Real.exp (-u) + let τ := stop hε hT.le U z ρ δ + have hb : τ ∈ Icc 0 T := stop_bounds hε hT.le U z ρ δ + have hs := source_until_stop hε hT h U z ρ δ hU h0 + have ha (t : ℝ) (ht : t ∈ Icc 0 τ) : δ ≤ (g t z).im / ‖g t z - (driver t : ℂ)‖ := by + rw [← sine_eq_source hε hT h U z ρ δ hU h0 ht] + exact ((deficit_nonneg_iff hε hT.le U z ρ δ t).1 + (nonneg_until hε hT.le hT U z ρ δ h0 ht)).2.2 + have hc := h.finite_clock_bounds (u := u) hb.1 hδ (hcont.mono (Icc_subset_Icc le_rfl hb.2)) hs.1 ?_ ?_ + · have heq : g τ z = position hε hT.le U z τ := hs.2 ⟨hb.1,le_rfl⟩ + rw [heq] at hc + exact hc + · intro t ht + have hz := survivingDomain_mono ht.2.le hs.1 + have hnorm : 0 < ‖g t z - (driver t : ℂ)‖ := norm_pos_iff.2 (h.centered_ne_zero ht.1.le hz) + have hq : δ * ‖g t z - (driver t : ℂ)‖ ≤ (g t z).im := + (le_div_iff₀ hnorm).1 (ha t ⟨ht.1.le,ht.2.le⟩) + simpa only [mul_pow, Complex.normSq_eq_norm_sq] using + pow_le_pow_left₀ (mul_nonneg hδ.le hnorm.le) hq 2 + · rw [← radius_eq_source hε hT h hcont U z ρ δ hU h0 ⟨hb.1,le_rfl⟩] + exact ((deficit_nonneg_iff hε hT.le U z ρ δ τ).1 + (nonneg_until hε hT.le hT U z ρ δ h0 ⟨hb.1,le_rfl⟩)).1 + +lemma terminal_cases (h : IsLoewnerTraceUsing driver γ g f) + (hcont : ContinuousOn driver (Icc 0 T)) + (U : C(I, ℝ)) (z : ℂ) (u δ : ℝ) (hδ : 0 < δ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (h0 : 0 < deficit hε hT.le U z ((2*z.im)*Real.exp (-u)) δ 0) + (hsmall : ε < z.im*Real.exp (-u/(2*δ^2))) + (hlarge : u*z.im^2/(4*δ^4) < T) : + let ρ := (2*z.im)*Real.exp (-u) + let τ := stop hε hT.le U z ρ δ + radius hε hT.le U z τ = ρ ∨ sine hε hT.le U z τ = δ := by + dsimp only + let ρ := (2*z.im)*Real.exp (-u) + let τ := stop hε hT.le U z ρ δ + have hb : τ ∈ Icc 0 T := stop_bounds hε hT.le U z ρ δ + have hc := clock_bounds_stop hε hT h hcont U z u δ hδ hU h0 + have hn := nonpos_at_of_lt hε hT.le hT U z ρ δ (hc.2.trans_lt hlarge) + have hp := (deficit_nonneg_iff hε hT.le U z ρ δ τ).1 + (nonneg_until hε hT.le hT U z ρ δ h0 ⟨hb.1,le_rfl⟩) + by_contra he + push Not at he + have hh : 0 < deficit hε hT.le U z ρ δ τ := + (deficit_pos_iff hε hT.le U z ρ δ τ).2 + ⟨lt_of_le_of_ne hp.1 (Ne.symm he.1),hsmall.trans_le hc.1, + lt_of_le_of_ne hp.2.2 (Ne.symm he.2)⟩ + exact (not_lt_of_ge hn) hh + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.FiniteTilt +open LoewnerCutoff LoewnerExit LoewnerField LoewnerLocalized GreenPhysical +open scoped unitInterval + +structure Cutoff (z : ℂ) (u : ℝ) where + angle : ℝ + angle_pos : 0 < angle + angle_initial : angle < z.im / ‖z‖ + height : ℝ + height_pos : 0 < height + horizon : ℝ≥0 + horizon_pos : 0 < (horizon:ℝ) + height_small : height < z.im * Real.exp (-u/(2*angle^2)) + time_large : u*z.im^2/(4*angle^4) < horizon + +end SLEExactGauge.FiniteTilt + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.FiniteTilt +open LoewnerCutoff LoewnerExit LoewnerField LoewnerLocalized GreenPhysical +open scoped unitInterval +namespace Cutoff +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +lemma height_initial (hz : z ∈ halfPlane) (hu : 0 ≤ u) : C.height < z.im := by + have he : Real.exp (-u/(2*C.angle^2)) ≤ 1 := Real.exp_le_one_iff.2 + (div_nonpos_of_nonpos_of_nonneg (neg_nonpos.2 hu) (by positivity)) + exact C.height_small.trans_le (by simpa only [mul_one] using mul_le_mul_of_nonneg_left he hz.le) + +lemma initial_deficit (hz : z ∈ halfPlane) (hu : 0 < u) (V : C(I, ℝ)) + (hV0 : extendDriver C.horizon V 0 = 0) : + 0 < deficit C.height_pos C.horizon.coe_nonneg V z ((2*z.im)*Real.exp (-u)) C.angle 0 := by + apply (deficit_pos_iff _ _ _ _ _ _ _).2 + have hy0 : 0 < z.im := hz + have hy := C.height_initial hz hu.le + have hr : (2*z.im)*Real.exp (-u) < 2*z.im := by + simpa only [mul_one] using mul_lt_mul_of_pos_left + (Real.exp_lt_one_iff.2 (neg_neg_of_pos hu)) (show 0 < 2*z.im by positivity) + refine ⟨?_, ?_, ?_⟩ + · simpa only [LoewnerExit.radius, position_initial, logDerivative_initial, Real.exp_zero, div_one] using hr + · simpa only [position_initial] using hy + · simpa only [LoewnerExit.sine, position_initial, hV0, Complex.ofReal_zero, sub_zero, + clampIm_eq hy.le] using C.angle_initial + +def paths {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) : Ω → C(I, ℝ) := + BrownianDriver.path B (Real.sqrt κ) C.horizon + +def stopTime {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ := + stop C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z ((2*z.im)*Real.exp (-u)) C.angle + +def value {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : ℝ := + field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (C.paths κ B sample) z + (C.stopTime κ B sample) (B (C.stopTime κ B sample).toNNReal sample) + +lemma path_eq {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + EqOn (extendDriver C.horizon (C.paths κ B sample)) (fun t => Real.sqrt κ*B t.toNNReal sample) + (Icc 0 (C.horizon:ℝ)) := by + intro t ht + exact BrownianDriver.extend_eq B (Real.sqrt κ) C.horizon sample hc ht + +lemma initial_deficit_brownian {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + (hz : z ∈ halfPlane) (hu : 0 < u) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) : + 0 < deficit C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z + ((2*z.im)*Real.exp (-u)) C.angle 0 := by + apply C.initial_deficit hz hu + simpa only [Real.toNNReal_zero, hb0, mul_zero] using + C.path_eq κ B sample hc ⟨le_rfl,C.horizon.coe_nonneg⟩ + +lemma bounds {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : + C.stopTime κ B sample ∈ Icc 0 (C.horizon:ℝ) := + stop_bounds C.height_pos C.horizon.coe_nonneg _ z _ C.angle + +lemma value_nonneg {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) : + 0 ≤ C.value κ B sample := (green_pos _ _ _ _ _).le + +lemma value_bound {Ω : Type*} (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (sample : Ω) (hz : z ∈ halfPlane) (hu : 0 < u) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) : + C.value κ B sample ≤ ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) := by + have hy0 : 0 < z.im := hz + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := sub_nonneg.2 ((le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le)) + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hd := (deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 + ⟨(C.bounds κ B sample).1,le_rfl⟩) + apply green_le_fixed_radius _ _ _ _ _ _ (LoewnerField.height_pos _ _ _ _ _) ha hp (by positivity) + simpa only [LoewnerExit.radius, LoewnerField.height, max_eq_right hd.2.1] using hd.1 + +lemma expectation {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (hz : z ∈ halfPlane) (hu : 0 ≤ u) : + Integrable (C.value κ B) P ∧ (∫ sample, C.value κ B sample ∂P) = + green (1-κ/8) (8/κ-1) z.re z.im 0 := + localized_expectation hB κ hκ C.height_pos C.horizon C.horizon_pos z (C.height_initial hz hu).le _ C.angle + +end Cutoff + +end SLEExactGauge.FiniteTilt + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.FiniteTilt +open scoped unitInterval + +lemma initial_sine_pos {z : ℂ} (hz : z ∈ halfPlane) : 0 < z.im/‖z‖ := by + have hy : 0 < z.im := hz + have hne : z ≠ 0 := by + intro he + simp only [he, Complex.zero_im, lt_self_iff_false] at hy + exact div_pos hy (norm_pos_iff.2 hne) + +def shrinkingAngle (z : ℂ) (n : ℕ) : ℝ := (z.im/‖z‖)/((n:ℝ)+2) + +lemma shrinkingAngle_pos {z : ℂ} (hz : z ∈ halfPlane) (n : ℕ) : + 0 < shrinkingAngle z n := div_pos (initial_sine_pos hz) (by positivity) + +lemma shrinkingAngle_initial {z : ℂ} (hz : z ∈ halfPlane) (n : ℕ) : + shrinkingAngle z n < z.im/‖z‖ := by + apply div_lt_self (initial_sine_pos hz) + have hn : (0:ℝ) ≤ n := Nat.cast_nonneg n + linarith + +lemma shrinkingAngle_tendsto (z : ℂ) : Tendsto (shrinkingAngle z) atTop (𝓝 0) := by + have ht := (tendsto_const_div_atTop_nhds_zero_nat (z.im/‖z‖)).comp (tendsto_add_atTop_nat 2) + change Tendsto (fun n : ℕ => (z.im/‖z‖)/((n:ℝ)+2)) atTop (𝓝 0) + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_ofNat] using ht + +def cutoffs {z : ℂ} (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) (n : ℕ) : Cutoff z u where + angle := shrinkingAngle z n + angle_pos := shrinkingAngle_pos hz n + angle_initial := shrinkingAngle_initial hz n + height := z.im*Real.exp (-u/(2*(shrinkingAngle z n)^2))/2 + height_pos := by have hy : 0 < z.im := hz; positivity + horizon := ⟨u*z.im^2/(4*(shrinkingAngle z n)^4)+1, by positivity⟩ + horizon_pos := by change 0 < u*z.im^2/(4*(shrinkingAngle z n)^4)+1; positivity + height_small := by + have he := mul_pos (show 0 < z.im from hz) (Real.exp_pos (-u/(2*(shrinkingAngle z n)^2))) + linarith + time_large := by + change u*z.im^2/(4*(shrinkingAngle z n)^4) < u*z.im^2/(4*(shrinkingAngle z n)^4)+1 + linarith + +end SLEExactGauge.FiniteTilt + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerExit LoewnerField LoewnerLocalized GreenPhysical +open scoped unitInterval +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable (hz : z ∈ halfPlane) (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma source_live : z ∈ localizationDomain γ (C.stopTime κ B sample) := by + exact (source_until_stop C.height_pos C.horizon_pos h _ z _ C.angle + (C.path_eq κ B sample hc) (C.initial_deficit_brownian κ B sample hz hu hc hb0)).1 + +lemma source_radius : radius C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z + (C.stopTime κ B sample) = loewnerRadius g (C.stopTime κ B sample) z := by + exact radius_eq_source C.height_pos C.horizon_pos h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) _ z _ C.angle + (C.path_eq κ B sample hc) (C.initial_deficit_brownian κ B sample hz hu hc hb0) + ⟨(C.bounds κ B sample).1,le_rfl⟩ + +lemma source_sine : sine C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z + (C.stopTime κ B sample) = loewnerAngleSine κ (fun t => B t sample) g + (C.stopTime κ B sample) z := by + unfold loewnerAngleSine + simpa only [Complex.ofReal_mul] using sine_eq_source C.height_pos C.horizon_pos h _ z _ C.angle + (C.path_eq κ B sample hc) (C.initial_deficit_brownian κ B sample hz hu hc hb0) + ⟨(C.bounds κ B sample).1,le_rfl⟩ + +lemma radius_lower : (2*z.im)*Real.exp (-u) ≤ loewnerRadius g (C.stopTime κ B sample) z := by + rw [← C.source_radius κ B sample h hz hu hc hb0] + exact ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle + (C.initial_deficit_brownian κ B sample hz hu hc hb0) ⟨(C.bounds κ B sample).1,le_rfl⟩)).1 + +lemma value_eq_source : C.value κ B sample = + (loewnerRadius g (C.stopTime κ B sample) z)^(-(1-κ/8)) * + (loewnerAngleSine κ (fun t => B t sample) g (C.stopTime κ B sample) z)^(8/κ-1) := by + have hh := ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle + (C.initial_deficit_brownian κ B sample hz hu hc hb0) ⟨(C.bounds κ B sample).1,le_rfl⟩)).2.1 + rw [Cutoff.value, field_eq_radius_sine C.height_pos C.horizon_pos _ _ _ _ z _ _ hh + (C.path_eq κ B sample hc (C.bounds κ B sample)), + C.source_radius κ B sample h hz hu hc hb0, C.source_sine κ B sample h hz hu hc hb0] + +lemma source_terminal : loewnerRadius g (C.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) ∨ + loewnerAngleSine κ (fun t => B t sample) g (C.stopTime κ B sample) z = C.angle := by + have hh := terminal_cases C.height_pos C.horizon_pos h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.paths κ B sample) z u C.angle C.angle_pos (C.path_eq κ B sample hc) + (C.initial_deficit_brownian κ B sample hz hu hc hb0) C.height_small C.time_large + change radius _ _ _ _ (C.stopTime κ B sample) = _ ∨ + sine _ _ _ _ (C.stopTime κ B sample) = _ at hh + rwa [C.source_radius κ B sample h hz hu hc hb0, C.source_sine κ B sample h hz hu hc hb0] at hh + +lemma stopTime_le_radius {t : ℝ} (ht : 0 ≤ t) (_hzt : z ∈ localizationDomain γ t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : C.stopTime κ B sample ≤ t := by + by_contra hn + have hlt : t < C.stopTime κ B sample := lt_of_not_ge hn + have ha := h.radius_strictAnti (C.bounds κ B sample).1 + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.source_live κ B sample h hz hu hc hb0) ⟨ht,hlt.le⟩ ⟨(C.bounds κ B sample).1,le_rfl⟩ hlt + dsimp only at ha + rw [hrt] at ha + exact (not_lt_of_ge (C.radius_lower κ B sample h hz hu hc hb0)) ha + +lemma angle_exit_bound (hκ : 0 < κ ∧ κ < 8) + (he : loewnerAngleSine κ (fun t => B t sample) g (C.stopTime κ B sample) z = C.angle) : + C.value κ B sample ≤ ((2*z.im)*Real.exp (-u))^(-(1-κ/8))*C.angle^(8/κ-1) := by + rw [C.value_eq_source κ B sample h hz hu hc hb0, he] + apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg C.angle_pos.le _) + exact Real.rpow_le_rpow_of_nonpos (by have hy : 0 < z.im := hz; positivity) + (C.radius_lower κ B sample h hz hu hc hb0) (by linarith [hκ.2]) + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {κ : ℝ} {B : ℝ≥0 → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma sine_positive_minimum (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ * B t.toNNReal) γ g f) + (hc : Continuous B) {T : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ∃ η : ℝ, 0 < η ∧ ∀ t ∈ Icc 0 T, η ≤ loewnerAngleSine κ B g t z := by + have hgc := h.continuous_eval hT hz + have hdc : Continuous (fun t : ℝ => ((Real.sqrt κ * B t.toNNReal : ℝ) : ℂ)) := + Complex.continuous_ofReal.comp (continuous_const.mul (hc.comp continuous_real_toNNReal)) + have hnum := Complex.continuous_im.comp_continuousOn hgc + have hden := (hgc.sub hdc.continuousOn).norm + have hn (t : ℝ) (ht : t ∈ Icc 0 T) : + ‖g t z - ((Real.sqrt κ * B t.toNNReal : ℝ) : ℂ)‖ ≠ 0 := + norm_ne_zero_iff.2 (h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hz)) + have hx := hnum.div hden hn + have hct : ContinuousOn (fun t => loewnerAngleSine κ B g t z) (Icc 0 T) := by + apply hx.congr + intro t ht + simp only [loewnerAngleSine, Function.comp_def, Complex.ofReal_mul, Pi.div_apply, Pi.sub_apply] + obtain ⟨t, ht, hm⟩ := isCompact_Icc.exists_isMinOn (nonempty_Icc.2 hT) hct + refine ⟨loewnerAngleSine κ B g t z, ?_, hm⟩ + have hh := div_pos (h.im_pos ht.1 (survivingDomain_mono ht.2 hz)) + (norm_pos_iff.2 (h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hz))) + simpa only [loewnerAngleSine, Complex.ofReal_mul] using hh + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.FiniteTilt +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma eventually_value_at_radius {t : ℝ≥0} (hzt : z ∈ localizationDomain γ t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + ∀ᶠ n : ℕ in atTop, ENNReal.ofReal ((cutoffs hz u hu.le n).value κ B sample) = + finiteStoppedDensity κ (fun t => B t sample) γ g z u := by + obtain ⟨η, hη, hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + have hδ : ∀ᶠ n : ℕ in atTop, shrinkingAngle z n < η := + (shrinkingAngle_tendsto z).eventually (gt_mem_nhds hη) + filter_upwards [hδ] with n hn + let C := cutoffs hz u hu.le n + have hh : loewnerRadius g (C.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact hr + · have htm := hm (C.stopTime κ B sample) + ⟨(C.bounds κ B sample).1,C.stopTime_le_radius κ B sample h hz hu hc hb0 t.coe_nonneg hzt hrt⟩ + rw [hs] at htm + exact False.elim ((not_lt_of_ge htm) hn) + have he : C.stopTime κ B sample = t := h.live_radius_injective + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.bounds κ B sample).1 t.coe_nonneg (C.source_live κ B sample h hz hu hc hb0) hzt + (hh.trans hrt.symm) + have htau := h.firstLiveRadiusStop_eq + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) hzt hrt + have hp : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + rw [finiteStoppedDensity, htau, ite_eq_right (ENNReal.coe_ne_top), ENNReal.coe_toReal, hp, + ← he, ← C.value_eq_source κ B sample h hz hu hc hb0] + +lemma tendsto_value_killed (hκ : 0 < κ ∧ κ < 8) : + Tendsto (fun n : ℕ => ENNReal.ofReal ((cutoffs hz u hu.le n).value κ B sample)) atTop + (𝓝 (finiteStoppedDensity κ (fun t => B t sample) γ g z u)) := by + by_cases he : ∃ t : ℝ≥0, z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u) + · obtain ⟨t, hzt, hrt⟩ := he + have hh : (fun n : ℕ => ENNReal.ofReal ((cutoffs hz u hu.le n).value κ B sample)) =ᶠ[atTop] + (fun _ => finiteStoppedDensity κ (fun t => B t sample) γ g z u) := + eventually_value_at_radius κ B sample h hz hu hc hb0 hzt hrt + exact tendsto_const_nhds.congr' hh.symm + · have hset : {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u)} = ∅ := by + apply Set.eq_empty_iff_forall_notMem.2 + intro t ht + exact he ⟨t,ht⟩ + have htau : firstLiveRadiusStop γ g z u = (⊤ : ℝ≥0∞) := by + simp only [firstLiveRadiusStop, hset, Set.image_empty, sInf_empty] + rw [finiteStoppedDensity, htau, ite_eq_left rfl] + have ha : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + have hlim := (shrinkingAngle_tendsto z).rpow_const_nhds_zero ha + have hlim' : Tendsto (fun n : ℕ => ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) * + (shrinkingAngle z n)^(8/κ-1)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul hlim + have hl : Tendsto (fun n : ℕ => (cutoffs hz u hu.le n).value κ B sample) atTop (𝓝 0) := by + apply squeeze_zero (fun n => (cutoffs hz u hu.le n).value_nonneg κ B sample) _ hlim' + intro n + let C := cutoffs hz u hu.le n + have hs : loewnerAngleSine κ (fun t => B t sample) g (C.stopTime κ B sample) z = C.angle := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact False.elim (he ⟨⟨C.stopTime κ B sample,(C.bounds κ B sample).1⟩, + C.source_live κ B sample h hz hu hc hb0, hr⟩) + · exact hs + exact C.angle_exit_bound κ B sample h hz hu hc hb0 hκ hs + simpa only [ENNReal.ofReal_zero, Function.comp_def] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hl + +end SLEExactGauge.FiniteTilt + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge +open FiniteTilt GreenPhysical + +lemma finiteStoppedDensity_zero {κ : ℝ} {B : ℝ≥0 → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal) γ g f) + (hb0 : B 0 = 0) {z : ℂ} (hz : z ∈ halfPlane) : + finiteStoppedDensity κ B γ g z 0 = + ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) := by + rw [finiteStoppedDensity, firstLiveRadiusStop_zero h hz, ite_eq_right ENNReal.zero_ne_top, + ENNReal.toReal_zero, h.radius_initial hz] + simp only [loewnerAngleSine, h.initial z hz, Real.toNNReal_zero, hb0, mul_zero, + Complex.ofReal_zero, sub_zero] + +lemma green_initial (κ : ℝ) {z : ℂ} (hz : z ∈ halfPlane) : + green (1-κ/8) (8/κ-1) z.re z.im 0 = + (2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1) := by + have hp : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + rw [green_eq_source _ _ _ _ _ hz, Real.exp_zero, div_one, hp] + congr 3 + rw [Complex.norm_eq_sqrt_sq_add_sq] + +theorem finiteStoppedCenteredLaw {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) : + (∫⁻ sample, finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∂P) = + ENNReal.ofReal ((2 * z.im) ^ (-codimension κ) * + (z.im / ‖z‖) ^ (8 / κ - 1)) := by + rcases eq_or_lt_of_le hu with rfl | hu + · have he : (fun sample => finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z 0) =ᵐ[P] + (fun _ => ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))) := by + filter_upwards [hmaps,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hb + exact finiteStoppedDensity_zero (κ := κ) (B := fun t => B t sample) hm hb hz + rw [lintegral_congr_ae he, lintegral_const, measure_univ, mul_one] + · let C := cutoffs hz u hu.le + let F := fun n sample => ENNReal.ofReal ((C n).value κ B sample) + have hexp (n : ℕ) := (C n).expectation hB κ hκ hz hu.le + have hFm (n : ℕ) : AEMeasurable (F n) P := + ENNReal.measurable_ofReal.comp_aemeasurable (hexp n).1.aemeasurable + have hFb (n : ℕ) : ∀ᵐ sample ∂P, F n sample ≤ ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hc hb + exact ENNReal.ofReal_le_ofReal ((C n).value_bound κ hκ B sample hz hu hc hb) + have hFl : ∀ᵐ sample ∂P, Tendsto (fun n => F n sample) atTop + (𝓝 (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u)) := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb + exact tendsto_value_killed κ B sample hm hz hu hc hb hκ + have hfin : (∫⁻ _ : Ω, ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8))) ∂P) ≠ (⊤ : ℝ≥0∞) := by + rw [lintegral_const, measure_univ, mul_one] + exact ENNReal.ofReal_ne_top + have hdct := tendsto_lintegral_of_dominated_convergence' + (fun _ : Ω => ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-(1-κ/8)))) hFm hFb hfin hFl + have hint (n : ℕ) : (∫⁻ sample, F n sample ∂P) = ENNReal.ofReal (green (1-κ/8) (8/κ-1) z.re z.im 0) := by + rw [← ofReal_integral_eq_lintegral_ofReal (hexp n).1 + (Filter.Eventually.of_forall (fun sample => (C n).value_nonneg κ B sample)), (hexp n).2] + simp only [hint] at hdct + have he := tendsto_nhds_unique hdct tendsto_const_nhds + rw [green_initial κ hz] at he + exact he + +end SLEExactGauge + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BoundaryFunctional + +def clampRe (ε : ℝ) (w : ℂ) : ℂ := BoundaryCutoff.clamp 1 ε w + +def velocity (ε u : ℝ) (w : ℂ) : ℂ := BoundaryCutoff.velocity 1 ε u w + +lemma clampRe_ne_zero {ε : ℝ} (hε : 0 < ε) (w : ℂ) : clampRe ε w ≠ 0 := + BoundaryCutoff.clamp_ne_zero (by norm_num) hε w + +lemma clampRe_norm {ε : ℝ} (hε : 0 < ε) (w : ℂ) : ε ≤ ‖clampRe ε w‖ := + BoundaryCutoff.clamp_norm (by norm_num) hε w + +lemma clampRe_norm_sub (ε : ℝ) (z w : ℂ) : ‖clampRe ε z-clampRe ε w‖ ≤ 2*‖z-w‖ := + BoundaryCutoff.clamp_norm_sub (by norm_num) z w + +lemma velocity_lipschitz {ε : ℝ} (hε : 0 < ε) (u : ℝ) : + LipschitzWith ⟨4/ε^2,by positivity⟩ (velocity ε u) := + BoundaryCutoff.velocity_lipschitz (by norm_num) hε u + +lemma norm_velocity_sub_le {ε : ℝ} (hε : 0 < ε) (u : ℝ) (z w : ℂ) : + ‖velocity ε u z-velocity ε u w‖ ≤ (4/ε^2)*‖z-w‖ := + BoundaryCutoff.norm_velocity_sub_le (by norm_num) hε u z w + +lemma continuous_velocity {ε : ℝ} (hε : 0 < ε) : + Continuous (fun p : ℝ × ℂ => velocity ε p.1 p.2) := + BoundaryCutoff.continuous_velocity (by norm_num) hε + +lemma exists_solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) (z : ℂ) : + ∃ H : ℝ → ℂ, H 0=z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t := + BoundaryCutoff.exists_solution (by norm_num) hε hT U hU z + +lemma norm_velocity_driver_sub_le {ε : ℝ} (hε : 0 < ε) (u v : ℝ) (z : ℂ) : + ‖velocity ε u z - velocity ε v z‖ ≤ (4 / ε^2) * |u-v| := by + have he (a : ℝ) : velocity ε 0 (z - (a : ℂ)) = velocity ε a z := by + simp [velocity,BoundaryCutoff.velocity] + have hh := norm_velocity_sub_le hε 0 (z-(u:ℂ)) (z-(v:ℂ)) + rw [he, he] at hh + convert hh using 1 + rw [sub_sub_sub_cancel_left, ← Complex.ofReal_sub, Complex.norm_real, abs_sub_comm] + simp [Real.norm_eq_abs] + +lemma derivWithin_right {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ico 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Ici t) t := + (hH t ⟨ht.1, ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem ht) + +lemma derivWithin_left {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ioc 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Iic t) t := + (hH t ⟨ht.1.le, ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsLE_of_mem ht) + +lemma solution_eq {ε T : ℝ} (hε : 0 < ε) {U : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (U t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) : EqOn H G (Icc 0 T) := by + apply ODE_solution_unique_of_mem_Icc_right + (s := fun _ => univ) (fun t _ => (velocity_lipschitz hε (U t)).lipschitzOnWith) + (HasDerivWithinAt.continuousOn hH) (fun _ ht => derivWithin_right hH ht) + (fun _ _ => mem_univ _) (HasDerivWithinAt.continuousOn hG) + (fun _ ht => derivWithin_right hG ht) (fun _ _ => mem_univ _) h0 + +lemma solution_dist_le {ε T D : ℝ} (hε : 0 < ε) (hD : 0 ≤ D) + {U V : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (V t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ D) + {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (H t) (G t) ≤ D * Real.exp ((4 / ε^2) * T) := by + let K : ℝ≥0 := ⟨4 / ε^2, by positivity⟩ + have hK : (0 : ℝ) < K := by change 0 < 4 / ε^2; positivity + have hb (s : ℝ) (hs : s ∈ Ico 0 T) : + dist (velocity ε (V s) (G s)) (velocity ε (U s) (G s)) ≤ (K : ℝ) * D := by + rw [dist_eq_norm] + calc + _ ≤ (4 / ε^2) * |V s-U s| := norm_velocity_driver_sub_le hε _ _ _ + _ ≤ (K : ℝ) * D := by + rw [abs_sub_comm] + exact mul_le_mul_of_nonneg_left (hUV s ⟨hs.1, hs.2.le⟩) hK.le + have hh := dist_le_of_approx_trajectories_ODE + (fun t => velocity_lipschitz hε (U t)) + (HasDerivWithinAt.continuousOn hH) (fun _ hs => derivWithin_right hH hs) + (fun t _ => le_of_eq (dist_self (velocity ε (U t) (H t)))) + (HasDerivWithinAt.continuousOn hG) (fun _ hs => derivWithin_right hG hs) + hb (le_of_eq (dist_eq_zero.2 h0)) t ht + have he : gronwallBound 0 K (0 + (K : ℝ)*D) (t-0) = + D * (Real.exp ((K : ℝ)*t)-1) := by + simp only [gronwallBound, zero_add, sub_zero, ite_eq_right (ne_of_gt hK)] + field_simp + ring + rw [he] at hh + have hexp : Real.exp ((K : ℝ)*t) ≤ Real.exp ((K : ℝ)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left ht.2 hK.le) + apply hh.trans + change D * (Real.exp ((4 / ε^2)*t)-1) ≤ D * Real.exp ((4 / ε^2)*T) + change Real.exp ((4 / ε^2)*t) ≤ Real.exp ((4 / ε^2)*T) at hexp + exact mul_le_mul_of_nonneg_left (by linarith) hD + +end SLEExactGauge.BoundaryFunctional + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BoundaryFunctional +open scoped unitInterval + +def extendDriver (T : ℝ) (U : C(I, ℝ)) (t : ℝ) : ℝ := + U (projIcc 0 1 zero_le_one (t / T)) + +lemma continuous_extendDriver (T : ℝ) (U : C(I, ℝ)) : Continuous (extendDriver T U) := + U.continuous.comp (continuous_projIcc.comp (continuous_id.div_const T)) + +def solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : ℝ → ℂ := + (exists_solution hε hT (extendDriver T U) (continuous_extendDriver T U).continuousOn z).choose + +lemma solution_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + solution hε hT U z 0 = z := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.1 + +lemma solution_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + ∀ t ∈ Icc 0 T, HasDerivWithinAt (solution hε hT U z) + (velocity ε (extendDriver T U t) (solution hε hT U z t)) (Icc 0 T) t := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.2 + +def solutionPath {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + C(Icc 0 T, ℂ) := + ⟨fun t => solution hε hT U z t, + continuousOn_iff_continuous_domRestrict.1 (HasDerivWithinAt.continuousOn (solution_deriv hε hT U z))⟩ + +lemma solutionPath_lipschitz {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + LipschitzWith ⟨Real.exp ((4 / ε^2) * T), (Real.exp_pos _).le⟩ + (fun U : C(I, ℝ) => solutionPath hε hT U z) := by + apply LipschitzWith.of_dist_le_mul + intro U V + apply (ContinuousMap.dist_le (mul_nonneg (Real.exp_pos _).le dist_nonneg)).2 + intro t + have hUV (s : ℝ) (_hs : s ∈ Icc 0 T) : + |extendDriver T U s-extendDriver T V s| ≤ dist U V := by + exact (ContinuousMap.dist_apply_le_dist (f := U) (g := V) + (projIcc 0 1 zero_le_one (s/T))) + have hh := solution_dist_le hε dist_nonneg (solution_deriv hε hT U z) + (solution_deriv hε hT V z) + ((solution_initial hε hT U z).trans (solution_initial hε hT V z).symm) + hUV t.property + change dist (solution hε hT U z t) (solution hε hT V z t) ≤ + Real.exp ((4 / ε^2)*T) * dist U V + simpa only [mul_comm] using hh + +def position {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℂ := + solutionPath hε hT U z (projIcc 0 T hT t) + +lemma position_eq {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + position hε hT U z t = solution hε hT U z t := by + simp only [position, solutionPath, projIcc, max_eq_right ht.1, + min_eq_right ht.2] + rfl + +lemma continuous_position {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => position hε hT p.1 z p.2) := by + exact continuous_eval.comp (((solutionPath_lipschitz hε hT z).continuous.comp continuous_fst).prodMk + ((continuous_projIcc (h := hT)).comp continuous_snd)) + +lemma continuous_joint_extendDriver (T : ℝ) : + Continuous (fun p : C(I, ℝ) × ℝ => extendDriver T p.1 p.2) := by + exact continuous_eval.comp (continuous_fst.prodMk + ((continuous_projIcc (h := zero_le_one)).comp (continuous_snd.div_const T))) + +def variation {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + (-2 / (clampRe ε (position hε hT U z t - (extendDriver T U t : ℂ)))^2).re + +lemma continuous_clampRe (ε : ℝ) : Continuous (clampRe ε) := by + change Continuous (fun w : ℂ => Complex.equivRealProdCLM.symm (1*max (1*w.re) ε,w.im)) + apply Complex.equivRealProdCLM.symm.continuous.comp + apply Continuous.prodMk <;> fun_prop + +lemma continuous_variation {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => variation hε hT p.1 z p.2) := by + have hw := (continuous_position hε hT z).sub + (Complex.continuous_ofReal.comp (continuous_joint_extendDriver T)) + exact Complex.continuous_re.comp (continuous_const.div + (((continuous_clampRe ε).comp hw).pow 2) + (fun p => pow_ne_zero 2 (clampRe_ne_zero hε _))) + +def logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + ∫ s in (0 : ℝ)..(projIcc 0 T hT t : ℝ), variation hε hT U z s + +lemma continuous_logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => logDerivative hε hT p.1 z p.2) := by + have hc := intervalIntegral.continuous_parametric_primitive_of_continuous + (μ := volume) (a₀ := 0) (f := fun U t => variation hε hT U z t) + (continuous_variation hε hT z) + exact hc.comp (continuous_fst.prodMk + (continuous_subtype_val.comp ((continuous_projIcc (h := hT)).comp continuous_snd))) + +lemma abs_variation_le {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + |variation hε hT U z t| ≤ 2/ε^2 := by + apply (Complex.abs_re_le_norm _).trans + rw [norm_div, norm_neg, Complex.norm_ofNat, norm_pow] + apply div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hε) + exact pow_le_pow_left₀ hε.le (clampRe_norm hε _) 2 + +lemma logDerivative_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : logDerivative hε hT U z 0 = 0 := by + simp only [logDerivative, projIcc_of_mem hT (left_mem_Icc.mpr hT), intervalIntegral.integral_same] + +lemma abs_logDerivative_le {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + |logDerivative hε hT U z t| ≤ (2/ε^2)*T := by + have hb := (projIcc 0 T hT t).property + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0:ℝ)) (b := (projIcc 0 T hT t : ℝ)) + (fun s (_hs : s ∈ uIoc 0 (projIcc 0 T hT t : ℝ)) => + show ‖variation hε hT U z s‖ ≤ 2/ε^2 from abs_variation_le hε hT U z s) + change |logDerivative hε hT U z t| ≤ _ + apply hi.trans + rw [sub_zero, abs_of_nonneg hb.1] + exact mul_le_mul_of_nonneg_left hb.2 (by positivity) + +lemma position_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : position hε hT U z 0 = z := by + rw [position_eq hε hT U z ⟨le_rfl,hT⟩, solution_initial] + +lemma position_derivWithin {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (position hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)) (Icc 0 T) t := by + rw [position_eq hε hT U z ht] + exact (solution_deriv hε hT U z t ht).congr + (fun s hs => position_eq hε hT U z hs) (position_eq hε hT U z ht) + +lemma position_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (position hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)) t := + (position_derivWithin hε hT U z ⟨ht.1.le,ht.2.le⟩).hasDerivAt (Icc_mem_nhds ht.1 ht.2) + +lemma logDerivative_eq_integral {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + logDerivative hε hT U z t = ∫ s in (0:ℝ)..t, variation hε hT U z s := by + simp only [logDerivative, projIcc_of_mem hT ht] + +lemma hasDerivAt_logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (logDerivative hε hT U z) (variation hε hT U z t) t := by + have hp : Continuous (fun t : ℝ => (U,t)) := continuous_const.prodMk continuous_id + have hc := (continuous_variation hε hT z).comp hp + dsimp only [Function.comp_def] at hc + have hd : HasDerivAt (fun v : ℝ => ∫ s in (0:ℝ)..v, variation hε hT U z s) + (variation hε hT U z t) t := + intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + apply hd.congr_of_eventuallyEq + filter_upwards [Icc_mem_nhds ht.1 ht.2] with s hs + exact logDerivative_eq_integral hε hT U z hs + +lemma position_prefix_eq {ε T₁ T₂ S : ℝ} (hε : 0 < ε) + (hT₁ : 0 ≤ T₁) (hT₂ : 0 ≤ T₂) (_hS : 0 ≤ S) (hS₁ : S ≤ T₁) (hS₂ : S ≤ T₂) + (U V : C(I, ℝ)) (z : ℂ) + (hUV : EqOn (extendDriver T₁ U) (extendDriver T₂ V) (Icc 0 S)) : + EqOn (position hε hT₁ U z) (position hε hT₂ V z) (Icc 0 S) := by + apply solution_eq hε (U := extendDriver T₁ U) ?_ ?_ ((position_initial hε hT₁ U z).trans (position_initial hε hT₂ V z).symm) + · intro t ht + exact (position_derivWithin hε hT₁ U z ⟨ht.1,ht.2.trans hS₁⟩).mono + (Icc_subset_Icc le_rfl hS₁) + · intro t ht + rw [hUV ht] + exact (position_derivWithin hε hT₂ V z ⟨ht.1,ht.2.trans hS₂⟩).mono + (Icc_subset_Icc le_rfl hS₂) + +lemma logDerivative_prefix_eq {ε T₁ T₂ S : ℝ} (hε : 0 < ε) + (hT₁ : 0 ≤ T₁) (hT₂ : 0 ≤ T₂) (hS : 0 ≤ S) (hS₁ : S ≤ T₁) (hS₂ : S ≤ T₂) + (U V : C(I, ℝ)) (z : ℂ) + (hUV : EqOn (extendDriver T₁ U) (extendDriver T₂ V) (Icc 0 S)) : + EqOn (logDerivative hε hT₁ U z) (logDerivative hε hT₂ V z) (Icc 0 S) := by + have hH := position_prefix_eq hε hT₁ hT₂ hS hS₁ hS₂ U V z hUV + intro t ht + rw [logDerivative_eq_integral hε hT₁ U z ⟨ht.1,ht.2.trans hS₁⟩, + logDerivative_eq_integral hε hT₂ V z ⟨ht.1,ht.2.trans hS₂⟩] + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le ht.1] at hs + have hsS : s ∈ Icc 0 S := ⟨hs.1,hs.2.trans ht.2⟩ + simp only [variation, hH hsS, hUV hsS] + +lemma position_im_zero {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (x t : ℝ) : (position hε hT U (x:ℂ) t).im = 0 := by + have hc := BoundaryCutoff.conjugate_deriv (solution_deriv hε hT U (x:ℂ)) + have he := solution_eq hε (solution_deriv hε hT U (x:ℂ)) hc (by + rw [solution_initial]; simp) + let v := projIcc 0 T hT t + have hv := he v.property + change solution hε hT U (x:ℂ) v = star (solution hε hT U (x:ℂ) v) at hv + have hh := congrArg Complex.im hv + change (solution hε hT U (x:ℂ) v).im = 0 + change (solution hε hT U (x:ℂ) v).im = -(solution hε hT U (x:ℂ) v).im at hh + linarith + +end SLEExactGauge.BoundaryFunctional + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing +open GreenPhysical + +def radial (β x y : ℝ) : ℝ := (x^2+y^2)^(β/2) + +def lyapunov (β C x y : ℝ) : ℝ := radial β x y+C*y^β + +def radialX (β x y : ℝ) : ℝ := β*x*(x^2+y^2)^(β/2-1) + +def radialXX (β x y : ℝ) : ℝ := + β*(x^2+y^2)^(β/2-1)+β*(β-2)*x^2*(x^2+y^2)^(β/2-2) + +def radialXXX (β x y : ℝ) : ℝ := + 3*β*(β-2)*x*(x^2+y^2)^(β/2-2)+ + β*(β-2)*(β-4)*x^3*(x^2+y^2)^(β/2-3) + +lemma radial_pos (β x : ℝ) {y : ℝ} (hy : 0 < y) : 0 < radial β x y := + Real.rpow_pos_of_pos (q_pos x hy) _ + +lemma hasDerivAt_radial_path (β : ℝ) {X Y : ℝ → ℝ} {t X' Y' : ℝ} + (hX : HasDerivAt X X' t) (hY : HasDerivAt Y Y' t) (hy : 0 < Y t) : + HasDerivAt (fun t => radial β (X t) (Y t)) + (β*(X t*X'+Y t*Y')*(X t^2+Y t^2)^(β/2-1)) t := by + have h := (((hX.pow 2).add (hY.pow 2)).rpow_const (p := β/2) (Or.inl (q_pos (X t) hy).ne')) + simp only [Pi.add_apply,Pi.pow_apply] at h + apply h.congr_deriv + ring + +lemma hasDerivAt_radial_x (β x y : ℝ) (hy : 0 < y) : + HasDerivAt (radial β · y) (radialX β x y) x := by + convert hasDerivAt_radial_path β (hasDerivAt_id x) (hasDerivAt_const x y) hy using 1 <;> + simp [radialX] + +lemma hasDerivAt_radialX_x (β x y : ℝ) (hy : 0 < y) : + HasDerivAt (radialX β · y) (radialXX β x y) x := by + have hq := ((hasDerivAt_id x).pow 2).add_const (y^2) + have h := ((hasDerivAt_id x).const_mul β).mul + (hq.rpow_const (p := β/2-1) (Or.inl (q_pos x hy).ne')) + apply h.congr_deriv + dsimp only [id_eq,Pi.pow_apply,radialXX] + convert_to β*(x^2+y^2)^(β/2-1)+β*x*((2*x)*((β/2-1)*(x^2+y^2)^(β/2-1-1))) = _ using 1 + · ring + rw [show β/2-1-1 = β/2-2 by ring] + ring + +lemma hasDerivAt_radialXX_x (β x y : ℝ) (hy : 0 < y) : + HasDerivAt (radialXX β · y) (radialXXX β x y) x := by + have hq := ((hasDerivAt_id x).pow 2).add_const (y^2) + have h1 := (hq.rpow_const (p := β/2-1) (Or.inl (q_pos x hy).ne')).const_mul β + have h2 := (((hasDerivAt_id x).pow 2).const_mul (β*(β-2))).mul + (hq.rpow_const (p := β/2-2) (Or.inl (q_pos x hy).ne')) + apply (h1.add h2).congr_deriv + dsimp only [id_eq,Pi.pow_apply,radialXXX] + rw [show β/2-1-1 = β/2-2 by ring,show β/2-2-1 = β/2-3 by ring] + ring + +lemma contDiff_radial_driver (β c y s : ℝ) (hy : 0 < y) : + ContDiff ℝ ⊤ (fun b => radial β (c-s*b) y) := by + unfold radial + apply ContDiff.rpow_const_of_ne + · fun_prop + · intro x; exact (q_pos _ hy).ne' + +lemma lyapunov_nonneg {β C : ℝ} (hC : 0 ≤ C) (x : ℝ) {y : ℝ} (hy : 0 < y) : + 0 ≤ lyapunov β C x y := by + exact add_nonneg (radial_pos β x hy).le (mul_nonneg hC (Real.rpow_nonneg hy.le _)) + +def generator (κ β C x y : ℝ) : ℝ := + β*(x*(2*x/(x^2+y^2))+y*(-2*y/(x^2+y^2)))*(x^2+y^2)^(β/2-1) + + C*(β*y^(β-1)*(-2*y/(x^2+y^2))) + κ/2*radialXX β x y + +end SLEExactGauge.Swallowing + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/IntegratedMeshSimple.lean b/lean/OAI/Probability/SLELocalization/IntegratedMeshSimple.lean new file mode 100644 index 0000000000000000000000000000000000000000..26de42d72e1af77ea34f3c185ee046f731df69f6 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/IntegratedMeshSimple.lean @@ -0,0 +1,908 @@ +import Mathlib +import OAI.Probability.SLELocalization.ConformalKernels + +namespace OAI + + +/-! Conformal localization and Integrated Mesh Simple estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal +namespace SLEExactGauge +open Layer + +lemma layer_set_measurable {F : ℂ → ℂ} (hf : DifferentiableOn ℂ F (ball 0 1)) (R : ℝ) : + MeasurableSet {w : ℂ | ‖w‖ < 1 ∧ (1-‖w‖^2)*‖deriv F w‖ ≤ R} := by + classical + let f : ℂ → ℝ := fun w => diskFactor w*‖deriv F w‖ + have hc : ContinuousOn f (ball 0 1) := + diskFactor_smooth.continuous.continuousOn.mul (hf.deriv isOpen_ball).continuousOn.norm + have hm : Measurable ((ball (0:ℂ) 1).piecewise f (fun _ => 0)) := + hc.measurable_piecewise continuousOn_const measurableSet_ball + have he : {w : ℂ | ‖w‖ < 1 ∧ (1-‖w‖^2)*‖deriv F w‖ ≤ R} = + ball (0:ℂ) 1 ∩ {w | (ball (0:ℂ) 1).piecewise f (fun _ => 0) w ≤ R} := by + ext w + by_cases hw : w ∈ ball (0:ℂ) 1 + · have hw1 := mem_ball_zero_iff.1 hw + simp [hw,hw1,f,diskFactor] + · have hn : ¬‖w‖ < 1 := by simpa only [mem_ball_zero_iff] using hw + simp [hn,hw] + rw [he] + exact measurableSet_ball.inter (measurableSet_le hm measurable_const) + +theorem conformalRadiusLayer : + ∃ C : ℝ, 0 < C ∧ ∀ F : ℂ → ℂ, + DifferentiableOn ℂ F (Metric.ball 0 1) → Set.InjOn F (Metric.ball 0 1) → + ∀ R : ℝ, 0 < R → + (∫⁻ w in {w : ℂ | ‖w‖ < 1 ∧ (1-‖w‖^2)*‖deriv F w‖ ≤ R}, + ENNReal.ofReal (Real.log (1/‖w‖)*‖deriv F w‖^2) ∂volume) ≤ + ENNReal.ofReal (C*R^2) := by + refine ⟨4*Real.pi/Layer.layerExponent,div_pos (by positivity) layerExponent_bounds.1,?_⟩ + intro F hf hi R hR + obtain ⟨G,h⟩ := univalent_diskPair hf hi + let S := {w : ℂ | ‖w‖ < 1 ∧ (1-‖w‖^2)*‖deriv F w‖ ≤ R} + let u := layerBarrier F R + have hα := layerExponent_bounds.1 + have hC : 0 ≤ 2/Layer.layerExponent := by positivity + have hpoint (w : ℂ) (hw : w ∈ S) : + ENNReal.ofReal (Real.log (1/‖w‖)*‖deriv F w‖^2) ≤ + ENNReal.ofReal (2/Layer.layerExponent) * ENNReal.ofReal + (Real.log (1/‖w‖)*(-Laplacian.laplacian u w)) := by + have hb := h.barrier_layer hw.1 hR hw.2 + have hlog : 0 ≤ Real.log (1/‖w‖) := by + by_cases hz : w = 0 + · simp [hz] + · exact Real.log_nonneg ((one_le_div (norm_pos_iff.2 hz)).2 hw.1.le) + rw [← ENNReal.ofReal_mul hC] + apply ENNReal.ofReal_le_ofReal + have hb' : ‖deriv F w‖^2 ≤ (2/Layer.layerExponent)*(-Laplacian.laplacian u w) := by + have hm := mul_le_mul_of_nonneg_left hb hC + have he : (2/Layer.layerExponent)*(Layer.layerExponent/2*‖deriv F w‖^2) = ‖deriv F w‖^2 := by + field_simp + rw [he] at hm + exact hm + nlinarith [mul_le_mul_of_nonneg_left hb' hlog] + have hS : MeasurableSet S := layer_set_measurable hf R + have hsub : S ⊆ ball (0:ℂ) 1 := fun w hw => mem_ball_zero_iff.2 hw.1 + have hb := superharmonic_disk_green (h.barrier_smooth R) + (fun z _ => barrier_bounds F R z) + (fun z hz => h.barrier_superharmonic (mem_ball_zero_iff.1 hz) R) + calc + _ ≤ ∫⁻ w in S, ENNReal.ofReal (2/Layer.layerExponent) * + ENNReal.ofReal (Real.log (1/‖w‖)*(-Laplacian.laplacian u w)) := + setLIntegral_mono' hS hpoint + _ ≤ ∫⁻ w in ball (0:ℂ) 1, ENNReal.ofReal (2/Layer.layerExponent) * + ENNReal.ofReal (Real.log (1/‖w‖)*(-Laplacian.laplacian u w)) := lintegral_mono_set hsub + _ = ENNReal.ofReal (2/Layer.layerExponent) * (∫⁻ w in ball (0:ℂ) 1, + ENNReal.ofReal (Real.log (1/‖w‖)*(-Laplacian.laplacian u w))) := by + rw [lintegral_const_mul'] + exact ENNReal.ofReal_ne_top + _ ≤ ENNReal.ofReal (2/Layer.layerExponent) * ENNReal.ofReal (2*Real.pi*R^2) := + mul_le_mul_right hb _ + _ = _ := by + rw [← ENNReal.ofReal_mul hC] + congr 1 + ring + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal +namespace SLEExactGauge.Layer +open SlitMaps + +lemma DiskPair.radius_le_omitted {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) {z w : ℂ} (hz : ‖z‖ < 1) (hw : w ∉ U) : + diskFactor z*‖deriv F z‖ ≤ (256*Real.pi)*dist (F z) w := by + have hr := h.recenter hz + have homit : w ∉ (F ∘ diskAuto (-z)) '' ball (0:ℂ) 1 := by + rintro ⟨q,hq,rfl⟩ + exact hw (hr.toDomain hq) + have hb := UnivalentDistance.omitted_value_bound hr.forward hr.injOn homit + have hF := h.forward.differentiableAt (isOpen_ball.mem_nhds (mem_ball_zero_iff.2 hz)) + have hφ := diskAuto_hasDerivAt (show ‖-z‖ < 1 by simpa using hz) (z := (0:ℂ)) (by simp) + have hφ0 : diskAuto (-z) 0 = z := by simp + have he := (hφ0.symm ▸ hF.hasDerivAt).comp (0:ℂ) hφ + have hd : deriv (F ∘ diskAuto (-z)) 0 = deriv F z*((diskFactor z:ℝ):ℂ) := by + have hdφ := diskAuto_deriv_zero_exact hz + have ha : (1-(starRingEnd ℂ z)*z) = ((diskFactor z:ℝ):ℂ) := by + rw [mul_comm (starRingEnd ℂ z),Complex.mul_conj'] + simp only [diskFactor,Complex.ofReal_sub,Complex.ofReal_one,Complex.ofReal_pow] + rw [ha] at hdφ + simpa only [hφ0,map_neg,neg_mul_neg,mul_zero,sub_zero,one_pow,div_one,ha] using he.deriv + rw [hd,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (diskFactor_pos hz)] at hb + simpa only [Function.comp_apply,hφ0,dist_eq_norm,mul_comm (diskFactor z)] using hb + +lemma DiskPair.radius_le_infDist {U : Set ℂ} {F G : ℂ → ℂ} + (h : DiskPair U F G) (hne : Uᶜ.Nonempty) {z : ℂ} (hz : ‖z‖ < 1) : + diskFactor z*‖deriv F z‖ ≤ (256*Real.pi)*infDist (F z) Uᶜ := by + have hp : 0 < 256*Real.pi := by positivity + rw [mul_comm (256*Real.pi),← div_le_iff₀ hp] + apply (le_infDist hne).2 + intro w hw + rw [div_le_iff₀ hp] + exact (h.radius_le_omitted hz hw).trans_eq (mul_comm _ _) + +lemma complexJacobian (c : ℂ) : + ((ContinuousLinearMap.toSpanSingleton ℂ c).restrictScalars ℝ).det = ‖c‖^2 := by + simp [ContinuousLinearMap.det,LinearMap.det_restrictScalars, + Algebra.norm_complex_eq,Complex.normSq_eq_norm_sq] + +theorem physical_boundary_layer : + ∃ C : ℝ, 0 < C ∧ ∀ (U : Set ℂ) (F G : ℂ → ℂ), DiskPair U F G → Uᶜ.Nonempty → + ∀ R : ℝ, 0 < R → + (∫⁻ w in {w : ℂ | w ∈ U ∧ infDist w Uᶜ ≤ R}, + ENNReal.ofReal (Real.log (1/‖G w‖))) ≤ ENNReal.ofReal (C*R^2) := by + obtain ⟨C,hC,hbound⟩ := conformalRadiusLayer + refine ⟨C*(256*Real.pi)^2,by positivity,?_⟩ + intro U F G h hne R hR + let S := {z : ℂ | ‖z‖ < 1 ∧ (1-‖z‖^2)*‖deriv F z‖ ≤ (256*Real.pi)*R} + have hS : MeasurableSet S := layer_set_measurable h.forward _ + have hsub : S ⊆ ball (0:ℂ) 1 := fun z hz => mem_ball_zero_iff.2 hz.1 + have himage : {w : ℂ | w ∈ U ∧ infDist w Uᶜ ≤ R} ⊆ F '' S := by + intro w hw + refine ⟨G w,⟨mem_ball_zero_iff.1 (h.toDisk hw.1),?_⟩,h.right_inv w hw.1⟩ + have hh := h.radius_le_infDist hne (mem_ball_zero_iff.1 (h.toDisk hw.1)) + rw [h.right_inv w hw.1] at hh + exact hh.trans (mul_le_mul_of_nonneg_left hw.2 (by positivity)) + have hchange := lintegral_image_eq_lintegral_abs_det_fderiv_mul volume hS + (fun z hz => ((h.forward.differentiableAt (isOpen_ball.mem_nhds (hsub hz))).hasDerivAt.hasFDerivAt.restrictScalars ℝ).hasFDerivWithinAt) + (h.injOn.mono hsub) (fun w => ENNReal.ofReal (Real.log (1/‖G w‖))) + calc + _ ≤ ∫⁻ w in F '' S, ENNReal.ofReal (Real.log (1/‖G w‖)) := lintegral_mono_set himage + _ = ∫⁻ z in S, ENNReal.ofReal (Real.log (1/‖z‖)*‖deriv F z‖^2) := by + rw [hchange] + apply setLIntegral_congr_fun hS + intro z hz + dsimp only + rw [complexJacobian,abs_of_nonneg (sq_nonneg _),h.left_inv z (hsub hz), + ← ENNReal.ofReal_mul (sq_nonneg _)] + congr 1 + ring + _ ≤ ENNReal.ofReal (C*((256*Real.pi)*R)^2) := hbound F h.forward h.injOn _ (by positivity) + _ = _ := by congr 1; ring + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.Mesh + +def halfPlaneGreen (z w : ℂ) : ℝ := Real.log ‖(z-(starRingEnd ℂ w))/(z-w)‖ + +lemma hasDerivAt_log_norm {f : ℝ → ℂ} {D : ℂ} {t : ℝ} + (hd : HasDerivAt f D t) (hn : f t ≠ 0) : + HasDerivAt (fun u => Real.log ‖f u‖) (D/f t).re t := by + have hh : ContDiffAt ℝ 2 (fun z : ℂ => Real.log ‖z‖) (f t) := + (analyticAt_id.harmonicAt_log_norm hn).1 + have hc := (hh.differentiableAt (by norm_num)).hasFDerivAt.comp_hasDerivAt t hd + have he := Layer.logNorm_fderiv (hasDerivAt_id (f t)) hn D + apply hc.congr_deriv + simpa only [id_eq,one_mul] using he + +lemma green_eq_difference {z w : ℂ} (hn : z ≠ w) (hp : z ≠ starRingEnd ℂ w) : + halfPlaneGreen z w = Real.log ‖z-(starRingEnd ℂ w)‖ - Real.log ‖z-w‖ := by + rw [halfPlaneGreen,norm_div,Real.log_div (norm_ne_zero_iff.2 (sub_ne_zero.2 hp)) + (norm_ne_zero_iff.2 (sub_ne_zero.2 hn))] + +lemma difference_velocity {z w : ℂ} (hz : z ≠ 0) (hw : w ≠ 0) (hd : z ≠ w) : + (2/z-2/w)/(z-w) = -2/(z*w) := by + field_simp + ring + +lemma green_velocity {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + (-2/(z*(starRingEnd ℂ w))).re - (-2/(z*w)).re = + -4*z.im/(‖z‖^2) * (w.im/(‖w‖^2)) := by + have hzn : Complex.normSq z ≠ 0 := by + rw [← Complex.sq_norm] + exact pow_ne_zero 2 (norm_ne_zero_iff.2 (by intro he; simp [he] at hz)) + have hwn : Complex.normSq w ≠ 0 := by + rw [← Complex.sq_norm] + exact pow_ne_zero 2 (norm_ne_zero_iff.2 (by intro he; simp [he] at hw)) + rw [Complex.div_re,Complex.div_re,Complex.normSq_mul,Complex.normSq_mul,Complex.normSq_conj, + Complex.sq_norm,Complex.sq_norm] + simp only [Complex.mul_re,Complex.conj_re,Complex.conj_im,Complex.neg_re,Complex.neg_im] + norm_num + field_simp + ring + +theorem green_decrease {g h : ℝ → ℂ} {t u : ℝ} + (hz : 0 < (g t).im) (hw : 0 < (h t).im) (hne : g t ≠ h t) + (hg : HasDerivAt g (2/(g t-(u:ℂ))) t) + (hh : HasDerivAt h (2/(h t-(u:ℂ))) t) : + HasDerivAt (fun s => halfPlaneGreen (g s) (h s)) + (-4*(g t).im/‖g t-(u:ℂ)‖^2 * ((h t).im/‖h t-(u:ℂ)‖^2)) t := by + have hp : g t ≠ starRingEnd ℂ (h t) := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.conj_im] at hi + linarith + have hc := hg.sub hh + have hcc := hg.sub (Complex.conjCLE.hasFDerivAt.comp_hasDerivAt t hh) + have h₁ := hasDerivAt_log_norm hcc (sub_ne_zero.2 hp) + have h₂ := hasDerivAt_log_norm hc (sub_ne_zero.2 hne) + have he : (fun s => halfPlaneGreen (g s) (h s)) =ᶠ[𝓝 t] + (fun s => Real.log ‖g s-starRingEnd ℂ (h s)‖-Real.log ‖g s-h s‖) := by + filter_upwards [(hg.continuousAt.sub hh.continuousAt).eventually_ne (sub_ne_zero.2 hne), + hcc.continuousAt.eventually_ne (sub_ne_zero.2 hp)] with s hs hs' + exact green_eq_difference (sub_ne_zero.1 hs) (sub_ne_zero.1 hs') + apply ((h₁.sub h₂).congr_of_eventuallyEq he).congr_deriv + let z := g t-(u:ℂ) + let w := h t-(u:ℂ) + have hzi : 0 < z.im := by simpa [z] using hz + have hwi : 0 < w.im := by simpa [w] using hw + have hzn : z ≠ 0 := by intro he; simp [he] at hzi + have hwn : w ≠ 0 := by intro he; simp [he] at hwi + have hzw : z ≠ w := by simpa [z,w] using hne + have hzwc : z ≠ starRingEnd ℂ w := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.conj_im] at hi + linarith + have hdiff : g t-h t = z-w := by dsimp [z,w]; ring + have hdiffc : g t-starRingEnd ℂ (h t) = z-starRingEnd ℂ w := by + simp only [z,w,map_sub,Complex.conj_ofReal] + ring + have hconj : starRingEnd ℂ (2/(h t-(u:ℂ))) = 2/(starRingEnd ℂ w) := by simp [w,Complex.conj_ofNat] + change ((2/z-starRingEnd ℂ (2/w))/(g t-starRingEnd ℂ (h t))).re - + ((2/z-2/w)/(g t-h t)).re = _ + rw [hdiff,hdiffc] + have hconj2 : starRingEnd ℂ (2/w) = 2/(starRingEnd ℂ w) := by + simpa only [Complex.conj_ofNat] using (map_div₀ (starRingEnd ℂ) (2:ℂ) w) + rw [hconj2,difference_velocity hzn (by simpa using hwn) hzwc, + difference_velocity hzn hwn hzw,green_velocity hzi hwi] + simp [z,w] + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter Metric Function MeasureTheory +open scoped Topology ENNReal +namespace SLEExactGauge.Layer + +def halfToDisk (a w : ℂ) : ℂ := (w-a)/(w-starRingEnd ℂ a) + +def diskToHalf (a v : ℂ) : ℂ := (a-starRingEnd ℂ a*v)/(1-v) + +lemma half_den_ne {a w : ℂ} (ha : 0 < a.im) (hw : 0 < w.im) : + w-starRingEnd ℂ a ≠ 0 := by + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.conj_im,Complex.zero_im] at hi + linarith + +lemma disk_den_ne {v : ℂ} (hv : ‖v‖ < 1) : (1:ℂ)-v ≠ 0 := by + intro he + have he' : v = 1 := (sub_eq_zero.1 he).symm + simp [he'] at hv + +lemma halfToDisk_maps {a w : ℂ} (ha : 0 < a.im) (hw : 0 < w.im) : + ‖halfToDisk a w‖ < 1 := by + have hd := half_den_ne ha hw + have he : ‖w-starRingEnd ℂ a‖^2 - ‖w-a‖^2 = 4*w.im*a.im := by + simp only [Complex.sq_norm,Complex.normSq_apply,Complex.sub_re,Complex.sub_im, + Complex.conj_re,Complex.conj_im] + ring + rw [halfToDisk,norm_div,div_lt_one (norm_pos_iff.2 hd)] + nlinarith [norm_nonneg (w-a),norm_nonneg (w-starRingEnd ℂ a),mul_pos hw ha] + +lemma diskToHalf_im (a v : ℂ) : + (diskToHalf a v).im = a.im*(1-‖v‖^2)/‖1-v‖^2 := by + simp only [diskToHalf,Complex.div_im,Complex.sq_norm,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 + +lemma diskToHalf_maps {a v : ℂ} (ha : 0 < a.im) (hv : ‖v‖ < 1) : + 0 < (diskToHalf a v).im := by + rw [diskToHalf_im] + apply div_pos (mul_pos ha _) (sq_pos_of_ne_zero (norm_ne_zero_iff.2 (disk_den_ne hv))) + nlinarith [norm_nonneg v] + +lemma disk_half_inverse {a v : ℂ} (ha : 0 < a.im) (hv : ‖v‖ < 1) : + halfToDisk a (diskToHalf a v) = v := by + have h₁ := disk_den_ne hv + have h₂ := half_den_ne ha (diskToHalf_maps ha hv) + dsimp [halfToDisk,diskToHalf] at h₂ ⊢ + apply (div_eq_iff h₂).2 + field_simp + ring + +lemma half_disk_inverse {a w : ℂ} (ha : 0 < a.im) (hw : 0 < w.im) : + diskToHalf a (halfToDisk a w) = w := by + have h₁ := half_den_ne ha hw + have h₂ := disk_den_ne (halfToDisk_maps ha hw) + dsimp [halfToDisk,diskToHalf] at h₂ ⊢ + apply (div_eq_iff h₂).2 + field_simp + ring + +lemma halfToDisk_differentiable {a w : ℂ} (ha : 0 < a.im) (hw : 0 < w.im) : + DifferentiableAt ℂ (halfToDisk a) w := by + exact (differentiableAt_id.sub_const a).div (differentiableAt_id.sub_const _) (half_den_ne ha hw) + +lemma diskToHalf_differentiable {a v : ℂ} (_ha : 0 < a.im) (hv : ‖v‖ < 1) : + DifferentiableAt ℂ (diskToHalf a) v := by + exact ((differentiableAt_id.const_mul _).const_sub a).div + (differentiableAt_id.const_sub 1) (disk_den_ne hv) + +lemma green_disk_eq (a w : ℂ) : + Real.log (1/‖halfToDisk a w‖) = Mesh.halfPlaneGreen a w := by + have hn : ‖w-starRingEnd ℂ a‖ = ‖a-starRingEnd ℂ w‖ := by + rw [← norm_neg (w-starRingEnd ℂ a),neg_sub] + rw [← Complex.norm_conj (starRingEnd ℂ a-w)] + simp only [map_sub,starRingEnd_self_apply] + rw [halfToDisk,norm_div,one_div_div,hn,norm_sub_rev w,Mesh.halfPlaneGreen,norm_div] + +theorem halfPlane_boundary_layer : + ∃ C : ℝ, 0 < C ∧ ∀ (U : Set ℂ) (g f : ℂ → ℂ), + IsOpen U → Uᶜ.Nonempty → + MapsTo g U {z : ℂ | 0 < z.im} → MapsTo f {z : ℂ | 0 < z.im} U → + (∀ z ∈ U, f (g z) = z) → (∀ z : ℂ, 0 < z.im → g (f z) = z) → + DifferentiableOn ℂ g U → DifferentiableOn ℂ f {z : ℂ | 0 < z.im} → + ∀ a : ℂ, 0 < a.im → ∀ R : ℝ, 0 < R → + (∫⁻ w in {w : ℂ | w ∈ U ∧ infDist w Uᶜ ≤ R}, + ENNReal.ofReal (Mesh.halfPlaneGreen a (g w))) ≤ ENNReal.ofReal (C*R^2) := by + obtain ⟨C,hC,hbound⟩ := physical_boundary_layer + refine ⟨C,hC,?_⟩ + intro U g f hU hne hg hf hfg hgf hgd hfd a ha R hR + have hH : IsOpen {z : ℂ | 0 < z.im} := isOpen_lt continuous_const Complex.continuous_im + have hpair : DiskPair U (f ∘ diskToHalf a) (halfToDisk a ∘ g) := by + refine ⟨hU,?_,?_,?_,?_,?_,?_⟩ + · intro v hv + exact hf (diskToHalf_maps ha (mem_ball_zero_iff.1 hv)) + · intro w hw + exact mem_ball_zero_iff.2 (halfToDisk_maps ha (hg hw)) + · intro v hv + dsimp only [Function.comp_apply] + rw [hgf _ (diskToHalf_maps ha (mem_ball_zero_iff.1 hv))] + exact disk_half_inverse ha (mem_ball_zero_iff.1 hv) + · intro w hw + dsimp only [Function.comp_apply] + rw [half_disk_inverse ha (hg hw),hfg w hw] + · intro v hv + exact ((hfd.differentiableAt (hH.mem_nhds (diskToHalf_maps ha (mem_ball_zero_iff.1 hv)))).comp v + (diskToHalf_differentiable ha (mem_ball_zero_iff.1 hv))).differentiableWithinAt + · intro w hw + exact ((halfToDisk_differentiable ha (hg hw)).comp w + (hgd.differentiableAt (hU.mem_nhds hw))).differentiableWithinAt + have hh := hbound U _ _ hpair hne R hR + simpa only [Function.comp_apply,green_disk_eq] using hh + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology ENNReal +namespace SLEExactGauge.Mesh + +lemma green_nonneg {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) : + 0 ≤ halfPlaneGreen z w := by + by_cases he : z = w + · subst w + simp [halfPlaneGreen] + have hn : 0 < ‖z-w‖ := norm_pos_iff.2 (sub_ne_zero.2 he) + have hd : ‖z-starRingEnd ℂ w‖^2 - ‖z-w‖^2 = 4*z.im*w.im := by + simp only [Complex.sq_norm,Complex.normSq_apply,Complex.sub_re,Complex.sub_im, + Complex.conj_re,Complex.conj_im] + ring + apply Real.log_nonneg + rw [norm_div,le_div_iff₀ hn,one_mul] + nlinarith [norm_nonneg (z-starRingEnd ℂ w),mul_pos hz hw] + +lemma green_continuousAt {z w : ℂ} (hz : 0 < z.im) (hw : 0 < w.im) (hne : z ≠ w) : + ContinuousAt (fun q : ℂ × ℂ => halfPlaneGreen q.1 q.2) (z,w) := by + apply ContinuousAt.log + · exact (((continuous_fst.sub (Complex.continuous_conj.comp continuous_snd)).continuousAt).div + (continuous_fst.sub continuous_snd).continuousAt (sub_ne_zero.2 hne)).norm + · exact norm_ne_zero_iff.2 (div_ne_zero (Layer.half_den_ne hw hz) (sub_ne_zero.2 hne)) + +def poissonFactor (driver : ℝ → ℝ) (g : ℝ → ℂ → ℂ) (t : ℝ) (z : ℂ) : ℝ := + (g t z).im/‖g t z-(driver t:ℂ)‖^2 + +lemma poissonFactor_continuousOn {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {T : ℝ} (hT : 0 ≤ T) + (hU : ContinuousOn driver (Icc 0 T)) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => poissonFactor driver g t z) (Icc 0 T) := by + apply (Complex.continuous_im.comp_continuousOn (h.continuous_eval hT hz)).div + (((h.continuous_eval hT hz).sub (Complex.continuous_ofReal.comp_continuousOn hU)).norm.pow 2) + intro t ht + exact pow_ne_zero 2 (norm_ne_zero_iff.2 (h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hz))) + +lemma uniformization_injective {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {t : ℝ} (ht : 0 ≤ t) : + InjOn (g t) (localizationDomain γ t) := by + rcases h with ⟨_,_,_,_,_,_,_,_,_,hfg,_,_,_,_⟩ + intro z hz w hw he + simpa only [hfg t ht z hz,hfg t ht w hw] using congrArg (f t) he + +lemma pair_integral {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {s t : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) + (hU : ContinuousOn driver (Icc 0 t)) {z w : ℂ} + (hz : z ∈ localizationDomain γ t) (hw : w ∈ localizationDomain γ t) (hne : z ≠ w) : + (∫ u in s..t, 4*poissonFactor driver g u z*poissonFactor driver g u w) = + halfPlaneGreen (g s z) (g s w)-halfPlaneGreen (g t z) (g t w) := by + have ht : 0 ≤ t := hs.trans hst + have hsub : Icc s t ⊆ Icc 0 t := Icc_subset_Icc hs le_rfl + have hgcont : ContinuousOn (fun u => halfPlaneGreen (g u z) (g u w)) (Icc s t) := by + intro u hu + have hc := (green_continuousAt (h.im_pos (hs.trans hu.1) (survivingDomain_mono hu.2 hz)) + (h.im_pos (hs.trans hu.1) (survivingDomain_mono hu.2 hw)) + (fun he => hne (uniformization_injective h (hs.trans hu.1) + (survivingDomain_mono hu.2 hz) (survivingDomain_mono hu.2 hw) he))) + have hp := (((h.continuous_eval ht hz).mono hsub) u hu).prodMk + (((h.continuous_eval ht hw).mono hsub) u hu) + exact ContinuousAt.comp_continuousWithinAt (f := fun v => (g v z,g v w)) hc hp + have hi : IntervalIntegrable + (fun u => -4*poissonFactor driver g u z*poissonFactor driver g u w) volume s t := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le hst] + exact ((((poissonFactor_continuousOn h ht hU hz).const_mul (-4)).mul + (poissonFactor_continuousOn h ht hU hw)).mono hsub) + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hst hgcont + (f' := fun u => -4*poissonFactor driver g u z*poissonFactor driver g u w) + (fun u hu => by + have hu0 := hs.trans_lt hu.1 + have hz' := survivingDomain_mono hu.2.le hz + have hw' := survivingDomain_mono hu.2.le hw + have hd := green_decrease (h.im_pos hu0.le hz') (h.im_pos hu0.le hw') + (fun he => hne (uniformization_injective h hu0.le hz' hw' he)) + (h.hasDerivAt_eval hu0 hz') (h.hasDerivAt_eval hu0 hw') + exact hd.congr_deriv (by dsimp [poissonFactor]; ring)) hi + have he' : (fun u => -4*poissonFactor driver g u z*poissonFactor driver g u w) = + (fun u => -(4*poissonFactor driver g u z*poissonFactor driver g u w)) := by funext u; ring + rw [he',intervalIntegral.integral_neg] at he + linarith + +lemma pair_integral_le {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {s t : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) + (hU : ContinuousOn driver (Icc 0 t)) {z w : ℂ} + (hz : z ∈ localizationDomain γ t) (hw : w ∈ localizationDomain γ t) (hne : z ≠ w) : + (∫ u in s..t, 4*poissonFactor driver g u z*poissonFactor driver g u w) ≤ + halfPlaneGreen (g s z) (g s w) := by + rw [pair_integral h hs hst hU hz hw hne] + exact sub_le_self _ (green_nonneg (h.im_pos (hs.trans hst) hz) (h.im_pos (hs.trans hst) hw)) + +theorem loewner_boundary_layer : + ∃ C : ℝ, 0 < C ∧ ∀ (driver : ℝ → ℝ) (γ : ℝ → ℂ) (g f : ℝ → ℂ → ℂ), + IsLoewnerTraceUsing driver γ g f → ∀ t : ℝ, 0 ≤ t → + ∀ z ∈ localizationDomain γ t, ∀ R : ℝ, 0 < R → + (∫⁻ w in {w : ℂ | w ∈ localizationDomain γ t ∧ infDist w (localizationDomain γ t)ᶜ ≤ R}, + ENNReal.ofReal (halfPlaneGreen (g t z) (g t w))) ≤ ENNReal.ofReal (C*R^2) := by + obtain ⟨C,hC,hbound⟩ := Layer.halfPlane_boundary_layer + refine ⟨C,hC,?_⟩ + intro driver γ g f h t ht z hz R hR + rcases h with ⟨hγ,_,_,_,_,hg,hf,hgm,hfm,hfg,hgf,_,_,_⟩ + apply hbound _ (g t) (f t) (survivingDomain_open hγ ht) _ (hgm t ht) (hfm t ht) + (hfg t ht) (hgf t ht) (hg t ht).differentiableOn (hf t ht).differentiableOn + (g t z) (hgm t ht hz) R hR + refine ⟨0,?_⟩ + intro hzero + exact (lt_irrefl (0:ℝ)) (by simpa [halfPlane] using hzero.1.1) + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.PhysicalStop + +lemma ofReal_cap_le (s : ℝ≥0∞) (a : ℝ) : ENNReal.ofReal (cap s a) ≤ s := by + by_cases hs : s = ⊤ + · simp [hs] + · rw [cap,ite_eq_right hs] + exact (ENNReal.ofReal_le_ofReal (min_le_left _ _)).trans_eq (ENNReal.ofReal_toReal hs) + +end SLEExactGauge.PhysicalStop + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +lemma first_eq_source {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (hz : z ∈ halfPlane) (hu : 0 < u) {t : ℝ} (ht : t ∈ Icc 0 (C.stopTime κ B ω)) : + iteratedDeriv 1 (field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) + (Real.sqrt κ) (C.paths κ B ω) z t) (B t.toNNReal ω) = + Real.sqrt κ*(8/κ-1)*(g ω t z-(Real.sqrt κ*B t.toNNReal ω:ℂ)).re / + ‖g ω t z-(Real.sqrt κ*B t.toNNReal ω:ℂ)‖^2 * + ((loewnerRadius (g ω) t z)^(-(1-κ/8)) * + (loewnerAngleSine κ (fun s => B s ω) (g ω) t z)^(8/κ-1)) := by + have hU := C.path_eq κ B ω hc + have h0 := C.initial_deficit_brownian κ B ω hz hu hc hb0 + have hs := source_until_stop C.height_pos C.horizon_pos hm _ z _ C.angle hU h0 + have hhi := ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle t).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 ht)).2.1 + have hts := ht.2.trans (C.bounds κ B ω).2 + rw [first_eq,field_eq_radius_sine C.height_pos C.horizon_pos _ _ _ _ z t _ hhi (hU ⟨ht.1,hts⟩), + radius_eq_source C.height_pos C.horizon_pos hm + (continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn _ z _ C.angle hU h0 ht, + sine_eq_source C.height_pos C.horizon_pos hm _ z _ C.angle hU h0 ht] + rw [LoewnerField.height,max_eq_right hhi,← hs.2 ht] + simp only [loewnerAngleSine,Complex.sub_re,Complex.sq_norm,Complex.normSq_apply, + Complex.sub_im,Complex.ofReal_mul] + simp only [Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,mul_zero,zero_mul,sub_zero,add_zero,pow_two] + +lemma first_le_poisson {Ω : Type*} (κ : ℝ) (hκ : 0 < κ ∧ κ ≤ 4) + (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (hz : z ∈ halfPlane) (hu : 0 < u) {e t : ℝ} (he : 0 < e) (hes : e < z.im) + (ht : t ∈ Icc 0 (C.physicalTime κ B γ e ω)) : + |iteratedDeriv 1 (field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) + (Real.sqrt κ) (C.paths κ B ω) z t) (B t.toNNReal ω)| ≤ + (Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8))) * + Mesh.poissonFactor (fun t => Real.sqrt κ*B t.toNNReal ω) (g ω) t z := by + have hstop := ht.2.trans (C.physicalTime_bounds κ B γ e ω).2 + have hl := survivingDomain_mono hstop (C.source_live κ B ω hm hz hu hc hb0) + let tn : ℝ≥0 := ⟨t,ht.1⟩ + have hh : (tn:ℝ≥0∞) ≤ firstLiveDistanceStop (γ ω) z e := by + rw [← ENNReal.ofReal_coe_nnreal (p := tn)] + exact (ENNReal.ofReal_le_ofReal ht.2).trans (PhysicalStop.ofReal_cap_le _ _) + have hR : e/4 ≤ loewnerRadius (g ω) t z := hm.radius_ge_before_distance_stop he hes hh hl + have ha : 1 ≤ 8/κ-1 := by + have hh : 2 ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by linarith [hκ.2]) + linarith + rw [C.first_eq_source κ B γ g f ω hm hc hb0 hz hu ⟨ht.1,hstop⟩] + have hz' : 0 < (g ω t z-(Real.sqrt κ*B t.toNNReal ω:ℂ)).im := by + simpa only [Complex.sub_im,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,mul_zero,zero_mul,add_zero,sub_zero] using hm.im_pos ht.1 hl + have hb := Mesh.coefficient_le_poisson hz' ha (show 0 ≤ 1-κ/8 by linarith [hκ.2]) + (Real.sqrt_nonneg κ) (show 0 < e/4 by positivity) hR + simpa only [Mesh.poissonFactor,loewnerAngleSine,Complex.sub_im,Complex.mul_im,Complex.ofReal_im, + mul_zero,zero_mul,add_zero,sub_zero,Complex.ofReal_mul,tn,NNReal.coe_mk] using hb + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology ENNReal +namespace SLEExactGauge.Mesh + +lemma poissonFactor_pos {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {t : ℝ} (ht : 0 ≤ t) + {z : ℂ} (hz : z ∈ localizationDomain γ t) : 0 < poissonFactor driver g t z := by + apply div_pos (h.im_pos ht hz) + apply sq_pos_of_pos + apply norm_pos_iff.2 + intro he + have hi := congrArg Complex.im he + simp only [Complex.sub_im,Complex.ofReal_im,sub_zero,Complex.zero_im] at hi + exact (h.im_pos ht hz).ne' hi + +lemma overlap_lintegral_bound {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {s t : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) + (hU : ContinuousOn driver (Icc 0 t)) {z w : ℂ} + (hz : z ∈ localizationDomain γ t) (hw : w ∈ localizationDomain γ t) (hne : z ≠ w) + (b c : ℝ → ℝ) {K : ℝ} (hK : 0 ≤ K) + (hb : ∀ v ∈ Icc s t, |b v| ≤ K*poissonFactor driver g v z) + (hc : ∀ v ∈ Icc s t, |c v| ≤ K*poissonFactor driver g v w) : + (∫⁻ v in Icc s t, ENNReal.ofReal |b v*c v|) ≤ + ENNReal.ofReal (K^2 * halfPlaneGreen (g s z) (g s w)) := by + let F : ℝ → ℝ := fun v => 4*poissonFactor driver g v z*poissonFactor driver g v w + have hF : ContinuousOn F (Icc s t) := + (((poissonFactor_continuousOn h (hs.trans hst) hU hz).const_mul 4).mul + (poissonFactor_continuousOn h (hs.trans hst) hU hw)).mono + (Icc_subset_Icc hs le_rfl) + have hFp (v : ℝ) (hv : v ∈ Icc s t) : 0 ≤ F v := by + dsimp [F] + exact mul_nonneg (mul_nonneg (by norm_num) + (poissonFactor_pos h (hs.trans hv.1) (survivingDomain_mono hv.2 hz)).le) + (poissonFactor_pos h (hs.trans hv.1) (survivingDomain_mono hv.2 hw)).le + calc + _ ≤ ∫⁻ v in Icc s t, ENNReal.ofReal (K^2*F v) := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv + apply ENNReal.ofReal_le_ofReal + rw [abs_mul] + have hp := mul_nonneg + (poissonFactor_pos h (hs.trans hv.1) (survivingDomain_mono hv.2 hz)).le + (poissonFactor_pos h (hs.trans hv.1) (survivingDomain_mono hv.2 hw)).le + calc + _ ≤ (K*poissonFactor driver g v z)*(K*poissonFactor driver g v w) := + mul_le_mul (hb v hv) (hc v hv) (abs_nonneg _) (mul_nonneg hK + (poissonFactor_pos h (hs.trans hv.1) (survivingDomain_mono hv.2 hz)).le) + _ ≤ K^2*F v := by dsimp [F]; nlinarith [mul_nonneg (sq_nonneg K) hp] + _ = ENNReal.ofReal (∫ v in Icc s t, K^2*F v) := by + symm + apply ofReal_integral_eq_lintegral_ofReal + ((hF.const_mul (K^2)).integrableOn_compact isCompact_Icc) + filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv + exact mul_nonneg (sq_nonneg K) (hFp v hv) + _ = ENNReal.ofReal (K^2*(∫ v in s..t, F v)) := by + rw [integral_const_mul,integral_Icc_eq_integral_Ioc,← intervalIntegral.integral_of_le hst] + _ ≤ _ := ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left + (pair_integral_le h hs hst hU hz hw hne) (sq_nonneg K)) + +lemma approached_in_boundary_layer {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (_h : IsLoewnerTraceUsing driver γ g f) {s t R : ℝ} (hs : 0 ≤ s) (hst : s ≤ t) + {w : ℂ} (hd : dist w (γ s) ≤ R) : + infDist w (localizationDomain γ t)ᶜ ≤ R := by + apply (infDist_le_dist_of_mem ?_).trans hd + intro hm + exact hm.1.2 ⟨s,⟨hs,hst⟩,rfl⟩ + +lemma green_symm (z w : ℂ) : halfPlaneGreen z w = halfPlaneGreen w z := by + have hn : ‖z-starRingEnd ℂ w‖ = ‖w-starRingEnd ℂ z‖ := by + calc + _ = ‖starRingEnd ℂ (z-starRingEnd ℂ w)‖ := (Complex.norm_conj _).symm + _ = ‖starRingEnd ℂ z-w‖ := by simp only [map_sub,starRingEnd_self_apply] + _ = _ := norm_sub_rev _ _ + simp only [halfPlaneGreen,norm_div,hn,norm_sub_rev z w] + +def laterGreen (g : ℝ → ℂ → ℂ) (a b : ℂ → ℝ) (z w : ℂ) : ℝ≥0∞ := + if a w ≤ a z ∧ a z ≤ b w then + ENNReal.ofReal (halfPlaneGreen (g (a z) z) (g (a z) w)) else 0 + +lemma laterGreen_row {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {A : Set ℂ} (hA : MeasurableSet A) + {a b : ℂ → ℝ} {R C : ℝ} (_hR : 0 < R) + (hstart : ∀ z ∈ A, 0 ≤ a z) (hab : ∀ z ∈ A, a z ≤ b z) + (hlive : ∀ z ∈ A, z ∈ localizationDomain γ (b z)) + (happroach : ∀ z ∈ A, dist z (γ (a z)) ≤ R) + (hlayer : ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain γ t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain γ t ∧ infDist w (localizationDomain γ t)ᶜ ≤ R}, + ENNReal.ofReal (halfPlaneGreen (g t z) (g t w))) ≤ ENNReal.ofReal (C*R^2)) + {z : ℂ} (hz : z ∈ A) : + (∫⁻ w in A, laterGreen g a b z w) ≤ ENNReal.ofReal (C*R^2) := by + let L : Set ℂ := {w | w ∈ localizationDomain γ (a z) ∧ + infDist w (localizationDomain γ (a z))ᶜ ≤ R} + have hLm : MeasurableSet L := (survivingDomain_open h.1 (hstart z hz)).measurableSet.inter + (isClosed_le (continuous_infDist_pt _) continuous_const).measurableSet + calc + _ ≤ ∫⁻ w in A, L.indicator + (fun w => ENNReal.ofReal (halfPlaneGreen (g (a z) z) (g (a z) w))) w := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA] with w hw + unfold laterGreen + split_ifs with horder + · have hwL : w ∈ L := ⟨survivingDomain_mono horder.2 (hlive w hw), + approached_in_boundary_layer h (hstart w hw) horder.1 (happroach w hw)⟩ + rw [indicator_of_mem hwL] + · exact zero_le + _ ≤ ∫⁻ w, L.indicator + (fun w => ENNReal.ofReal (halfPlaneGreen (g (a z) z) (g (a z) w))) w := + lintegral_mono' Measure.restrict_le_self le_rfl + _ = ∫⁻ w in L, ENNReal.ofReal (halfPlaneGreen (g (a z) z) (g (a z) w)) := + lintegral_indicator hLm _ + _ ≤ _ := hlayer (a z) (hstart z hz) z (survivingDomain_mono (hab z hz) (hlive z hz)) + +lemma supported_pair_lintegral {a b : ℂ → ℝ} {B : ℝ → ℂ → ℝ} {z w : ℂ} + (hz : ∀ t, t ∉ Icc (a z) (b z) → B t z = 0) + (hw : ∀ t, t ∉ Icc (a w) (b w) → B t w = 0) : + (∫⁻ t, ENNReal.ofReal |B t z*B t w|) = + ∫⁻ t in Icc (max (a z) (a w)) (min (b z) (b w)), ENNReal.ofReal |B t z*B t w| := by + rw [← lintegral_indicator measurableSet_Icc] + apply lintegral_congr + intro t + by_cases ht : t ∈ Icc (max (a z) (a w)) (min (b z) (b w)) + · rw [indicator_of_mem ht] + · rw [indicator_of_notMem ht] + have hh : t ∉ Icc (a z) (b z) ∨ t ∉ Icc (a w) (b w) := by + by_contra hn + push Not at hn + exact ht ⟨max_le hn.1.1 hn.2.1,le_min hn.1.2 hn.2.2⟩ + rcases hh with hh | hh <;> simp [hz t,hw t,hh] + +lemma asynchronous_pair_bound {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hU : Continuous driver) + {a b : ℂ → ℝ} {B : ℝ → ℂ → ℝ} {z w : ℂ} (hne : z ≠ w) + (hz0 : 0 ≤ a z) (_hw0 : 0 ≤ a w) (_hzab : a z ≤ b z) (_hwab : a w ≤ b w) + (hzlive : z ∈ localizationDomain γ (b z)) (hwlive : w ∈ localizationDomain γ (b w)) + (hzsup : ∀ t, t ∉ Icc (a z) (b z) → B t z = 0) + (hwsup : ∀ t, t ∉ Icc (a w) (b w) → B t w = 0) + {K : ℝ} (hK : 0 ≤ K) + (hzb : ∀ t ∈ Icc (a z) (b z), |B t z| ≤ K*poissonFactor driver g t z) + (hwb : ∀ t ∈ Icc (a w) (b w), |B t w| ≤ K*poissonFactor driver g t w) : + (∫⁻ t, ENNReal.ofReal |B t z*B t w|) ≤ + ENNReal.ofReal (K^2) * (laterGreen g a b z w+laterGreen g a b w z) := by + rw [supported_pair_lintegral hzsup hwsup] + by_cases hover : max (a z) (a w) ≤ min (b z) (b w) + · have hi := overlap_lintegral_bound h (hz0.trans (le_max_left _ _)) hover hU.continuousOn + (survivingDomain_mono (min_le_left _ _) hzlive) + (survivingDomain_mono (min_le_right _ _) hwlive) hne (fun t => B t z) (fun t => B t w) hK + (fun t ht => hzb t ⟨(le_max_left _ _).trans ht.1,ht.2.trans (min_le_left _ _)⟩) + (fun t ht => hwb t ⟨(le_max_right _ _).trans ht.1,ht.2.trans (min_le_right _ _)⟩) + rw [ENNReal.ofReal_mul (sq_nonneg K)] at hi + apply hi.trans + apply mul_le_mul_right + by_cases horder : a w ≤ a z + · rw [max_eq_left horder] + have hzw : a z ≤ b w := (le_max_left _ _).trans (hover.trans (min_le_right _ _)) + rw [laterGreen,ite_eq_left ⟨horder,hzw⟩] + exact le_add_right le_rfl + · have hwz : a z ≤ a w := (lt_of_not_ge horder).le + rw [max_eq_right hwz] + have hwzb : a w ≤ b z := (le_max_right _ _).trans (hover.trans (min_le_left _ _)) + have hk : halfPlaneGreen (g (a w) z) (g (a w) w) = + halfPlaneGreen (g (a w) w) (g (a w) z) := green_symm _ _ + rw [hk] + have hright : laterGreen g a b w z = ENNReal.ofReal (halfPlaneGreen (g (a w) w) (g (a w) z)) := by + rw [laterGreen,ite_eq_left ⟨hwz,hwzb⟩] + rw [← hright] + exact le_add_left le_rfl + · rw [Icc_eq_empty hover,Measure.restrict_empty,lintegral_zero_measure] + exact zero_le + +lemma norm_integral_sq_le_pairs {E : Type*} [MeasurableSpace E] {μ : Measure E} + (v : E → ℝ) (hv : Measurable v) : + ENNReal.ofReal (|∫ z, v z ∂μ|^2) ≤ + ∫⁻ z, ∫⁻ w, ENNReal.ofReal |v z*v w| ∂μ ∂μ := by + have hn : ENNReal.ofReal |∫ z, v z ∂μ| ≤ ∫⁻ z, ENNReal.ofReal |v z| ∂μ := by + simpa only [← ofReal_norm,Real.norm_eq_abs] using + (enorm_integral_le_lintegral_enorm (μ := μ) v) + rw [ENNReal.ofReal_pow (abs_nonneg _)] + calc + _ ≤ (∫⁻ z, ENNReal.ofReal |v z| ∂μ)^2 := pow_le_pow_left₀ zero_le hn 2 + _ = ∫⁻ z, ∫⁻ w, ENNReal.ofReal |v z*v w| ∂μ ∂μ := by + simp_rw [abs_mul,ENNReal.ofReal_mul (abs_nonneg _)] + rw [pow_two,lintegral_lintegral_mul hv.abs.ennreal_ofReal.aemeasurable hv.abs.ennreal_ofReal.aemeasurable] + +lemma bracket_le_pair_integral {A : Set ℂ} (B : ℝ → ℂ → ℝ) + (hB : Measurable (Function.uncurry B)) : + (∫⁻ t, ENNReal.ofReal (|∫ z in A, B t z|^2)) ≤ + ∫⁻ z in A, ∫⁻ w in A, ∫⁻ t, ENNReal.ofReal |B t z*B t w| := by + have hb (t : ℝ) : Measurable (B t) := hB.comp (measurable_const.prodMk measurable_id) + have hF : Measurable (fun q : (ℝ × ℂ) × ℂ => ENNReal.ofReal |B q.1.1 q.1.2*B q.1.1 q.2|) := by + exact ((hB.comp measurable_fst).mul + (hB.comp (measurable_fst.fst.prodMk measurable_snd))).abs.ennreal_ofReal + calc + _ ≤ ∫⁻ t, ∫⁻ z in A, ∫⁻ w in A, ENNReal.ofReal |B t z*B t w| := + lintegral_mono (fun t => norm_integral_sq_le_pairs (B t) (hb t)) + _ = ∫⁻ z in A, ∫⁻ t, ∫⁻ w in A, ENNReal.ofReal |B t z*B t w| := + lintegral_lintegral_swap hF.lintegral_prod_right.aemeasurable + _ = _ := by + apply lintegral_congr + intro z + apply lintegral_lintegral_swap + exact (((hB.comp (measurable_fst.prodMk measurable_const)).mul hB).abs.ennreal_ofReal).aemeasurable + +lemma symmetric_kernel_integral {A : Set ℂ} (L : ℂ → ℂ → ℝ≥0∞) + (hL : Measurable (Function.uncurry L)) {D : ℝ≥0∞} + (hrow : ∀ z ∈ A, (∫⁻ w in A, L z w) ≤ D) (hA : MeasurableSet A) : + (∫⁻ z in A, ∫⁻ w in A, L z w+L w z) ≤ 2*D*volume A := by + have hswap := lintegral_lintegral_swap (μ := volume.restrict A) (ν := volume.restrict A) hL.aemeasurable + have hr : (∫⁻ z in A, ∫⁻ w in A, L z w) ≤ D*volume A := by + calc + _ ≤ ∫⁻ z in A, D := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA] with z hz + exact hrow z hz + _ = _ := by simp + have he (z : ℂ) : (∫⁻ w in A, L z w+L w z) = + (∫⁻ w in A, L z w)+(∫⁻ w in A, L w z) := + lintegral_add_left (hL.comp (measurable_const.prodMk measurable_id)) _ + simp_rw [he] + rw [lintegral_add_left hL.lintegral_prod_right,← hswap] + calc + _ ≤ D*volume A+D*volume A := add_le_add hr hr + _ = _ := by ring + +theorem asynchronous_bracket_bound {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hU : Continuous driver) + {A : Set ℂ} (hA : MeasurableSet A) {a b : ℂ → ℝ} {B : ℝ → ℂ → ℝ} + (hB : Measurable (Function.uncurry B)) + (hL : Measurable (Function.uncurry (laterGreen g a b))) + {K R C : ℝ} (hK : 0 ≤ K) (hR : 0 < R) + (hstart : ∀ z ∈ A, 0 ≤ a z) (hab : ∀ z ∈ A, a z ≤ b z) + (hlive : ∀ z ∈ A, z ∈ localizationDomain γ (b z)) + (happroach : ∀ z ∈ A, dist z (γ (a z)) ≤ R) + (hsup : ∀ z ∈ A, ∀ t, t ∉ Icc (a z) (b z) → B t z = 0) + (hcoeff : ∀ z ∈ A, ∀ t ∈ Icc (a z) (b z), |B t z| ≤ K*poissonFactor driver g t z) + (hlayer : ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain γ t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain γ t ∧ infDist w (localizationDomain γ t)ᶜ ≤ R}, + ENNReal.ofReal (halfPlaneGreen (g t z) (g t w))) ≤ ENNReal.ofReal (C*R^2)) : + (∫⁻ t, ENNReal.ofReal (|∫ z in A, B t z|^2)) ≤ + 2*ENNReal.ofReal (K^2)*ENNReal.ofReal (C*R^2)*volume A := by + apply (bracket_le_pair_integral B hB).trans + calc + _ ≤ ∫⁻ z in A, ∫⁻ w in A, + ENNReal.ofReal (K^2)*(laterGreen g a b z w+laterGreen g a b w z) := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA] with z hz + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA,ae_restrict_of_ae (show ∀ᵐ w : ℂ ∂volume, w ≠ z from by rw [ae_iff]; simp)] with w hw hne + exact asynchronous_pair_bound h hU hne.symm (hstart z hz) (hstart w hw) + (hab z hz) (hab w hw) (hlive z hz) (hlive w hw) (hsup z hz) (hsup w hw) hK + (hcoeff z hz) (hcoeff w hw) + _ = ENNReal.ofReal (K^2)*(∫⁻ z in A, ∫⁻ w in A, laterGreen g a b z w+laterGreen g a b w z) := by + simp only [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + _ ≤ ENNReal.ofReal (K^2)*(2*ENNReal.ofReal (C*R^2)*volume A) := by + apply mul_le_mul_right + exact symmetric_kernel_integral _ hL + (fun z hz => laterGreen_row h hA hR hstart hab hlive happroach hlayer hz) hA + _ = _ := by ring + +theorem asynchronous_bracket_bound_with_kernel {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hU : Continuous driver) + {A : Set ℂ} (hA : MeasurableSet A) {a b : ℂ → ℝ} {B : ℝ → ℂ → ℝ} + (hB : Measurable (Function.uncurry B)) + (L : ℂ → ℂ → ℝ≥0∞) (hL : Measurable (Function.uncurry L)) + (hLeq : ∀ z ∈ A, ∀ w ∈ A, L z w = laterGreen g a b z w) + {K R C : ℝ} (hK : 0 ≤ K) (hR : 0 < R) + (hstart : ∀ z ∈ A, 0 ≤ a z) (hab : ∀ z ∈ A, a z ≤ b z) + (hlive : ∀ z ∈ A, z ∈ localizationDomain γ (b z)) + (happroach : ∀ z ∈ A, dist z (γ (a z)) ≤ R) + (hsup : ∀ z ∈ A, ∀ t, t ∉ Icc (a z) (b z) → B t z = 0) + (hcoeff : ∀ z ∈ A, ∀ t ∈ Icc (a z) (b z), |B t z| ≤ K*poissonFactor driver g t z) + (hlayer : ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain γ t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain γ t ∧ infDist w (localizationDomain γ t)ᶜ ≤ R}, + ENNReal.ofReal (halfPlaneGreen (g t z) (g t w))) ≤ ENNReal.ofReal (C*R^2)) : + (∫⁻ t, ENNReal.ofReal (|∫ z in A, B t z|^2)) ≤ + 2*ENNReal.ofReal (K^2)*ENNReal.ofReal (C*R^2)*volume A := by + apply (bracket_le_pair_integral B hB).trans + calc + _ ≤ ∫⁻ z in A, ∫⁻ w in A, + ENNReal.ofReal (K^2)*(L z w+L w z) := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA] with z hz + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem hA,ae_restrict_of_ae (show ∀ᵐ w : ℂ ∂volume, w ≠ z from by rw [ae_iff]; simp)] with w hw hne + rw [hLeq z hz w hw,hLeq w hw z hz] + exact asynchronous_pair_bound h hU hne.symm (hstart z hz) (hstart w hw) + (hab z hz) (hab w hw) (hlive z hz) (hlive w hw) (hsup z hz) (hsup w hw) hK + (hcoeff z hz) (hcoeff w hw) + _ = ENNReal.ofReal (K^2)*(∫⁻ z in A, ∫⁻ w in A, L z w+L w z) := by + simp only [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + _ ≤ ENNReal.ofReal (K^2)*(2*ENNReal.ofReal (C*R^2)*volume A) := by + apply mul_le_mul_right + exact symmetric_kernel_integral _ hL + (fun z hz => by + have he : (∫⁻ w in A, L z w) = ∫⁻ w in A, laterGreen g a b z w := by + apply lintegral_congr_ae + filter_upwards [ae_restrict_mem hA] with w hw + exact hLeq z hz w hw + rw [he] + exact laterGreen_row h hA hR hstart hab hlive happroach hlayer hz) hA + _ = _ := by ring + +end SLEExactGauge.Mesh + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/LoewnerCocycle.lean b/lean/OAI/Probability/SLELocalization/LoewnerCocycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..11dc04dc99917d9bd0bec35a89778711f91c39d3 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/LoewnerCocycle.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Loewner Cocycle estimates. -/ + +section +noncomputable section +open Set Filter +open scoped Topology +namespace SLEExactGauge +open LoewnerCutoff + +theorem loewner_inverse_cocycle {U : ℝ → ℝ} {γ η : ℝ → ℂ} + {g f G F : ℝ → ℂ → ℂ} (h : IsLoewnerTraceUsing U γ g f) + {T : ℝ} (hT : 0 ≤ T) + (hnew : IsLoewnerTraceUsing (fun t => U (T+t)-U T) η G F) + {s : ℝ} (hs : 0 ≤ s) {w : ℂ} (hw : w ∈ halfPlane) : + f (T+s) (w+(U T:ℂ)) = f T (F s w+(U T:ℂ)) := by + let x := f (T+s) (w+(U T:ℂ)) + let y := F s w + have hsum : 0 ≤ T+s := add_nonneg hT hs + have hw' : w+(U T:ℂ) ∈ halfPlane := by simpa [halfPlane] using hw + have hx : x ∈ localizationDomain γ (T+s) := h.2.2.2.2.2.2.2.2.1 (T+s) hsum hw' + have hy : y ∈ localizationDomain η s := hnew.2.2.2.2.2.2.2.2.1 s hs hw + have hfin : g (T+s) x = w+(U T:ℂ) := h.2.2.2.2.2.2.2.2.2.2.1 (T+s) hsum _ hw' + have hnewfin : G s y = w := hnew.2.2.2.2.2.2.2.2.2.2.1 s hs _ hw + have hxl (t : ℝ) (ht : t ∈ Icc 0 s) : w.im ≤ (g (T+t) x).im := by + have HH := h.height_antitone hsum hx + ⟨add_nonneg hT ht.1,by linarith [ht.2]⟩ ⟨hsum,le_rfl⟩ + (by linarith [ht.2]) + simpa only [hfin,Complex.add_im,Complex.ofReal_im,add_zero] using HH + have hyl (t : ℝ) (ht : t ∈ Icc 0 s) : w.im ≤ (G t y).im := by + simpa only [hnewfin] using hnew.height_antitone hs hy ht ⟨hs,le_rfl⟩ ht.2 + have hc : ContinuousOn (fun t => g (T+t) x-(U T:ℂ)) (Icc 0 s) := + ((h.continuous_eval hsum hx).comp (continuous_const.add continuous_id).continuousOn + (fun t ht => ⟨add_nonneg hT ht.1,by change T+t ≤ T+s; linarith [ht.2]⟩)).sub continuousOn_const + have hd (t : ℝ) (ht : t ∈ Ioc 0 s) : + HasDerivWithinAt (fun t => g (T+t) x-(U T:ℂ)) + (velocity w.im (U (T+t)-U T) (g (T+t) x-(U T:ℂ))) (Iic t) t := by + rw [velocity_eq (by simpa only [Complex.sub_im,Complex.ofReal_im,sub_zero] using hxl t ⟨ht.1.le,ht.2⟩)] + have HH := ((h.2.2.2.2.2.2.2.2.2.2.2.2.1 (T+t) (by linarith [ht.1]) x + (survivingDomain_mono (by linarith [ht.2]) hx)).scomp t + ((hasDerivAt_id t).const_add T)).sub_const (U T:ℂ) + have heq : g (T+t) x-(U T:ℂ)-((U (T+t)-U T:ℝ):ℂ) = + g (T+t) x-(U (T+t):ℂ) := by rw [Complex.ofReal_sub]; ring + rw [heq] + simpa only [one_smul,Function.comp_def,id_eq] using HH.hasDerivWithinAt + have hdnew (t : ℝ) (ht : t ∈ Ioc 0 s) : + HasDerivWithinAt (fun t => G t y) + (velocity w.im (U (T+t)-U T) (G t y)) (Iic t) t := by + rw [velocity_eq (hyl t ⟨ht.1.le,ht.2⟩)] + exact (hnew.2.2.2.2.2.2.2.2.2.2.2.2.1 t ht.1 y + (survivingDomain_mono ht.2 hy)).hasDerivWithinAt + have he : EqOn (fun t => g (T+t) x-(U T:ℂ)) (fun t => G t y) (Icc 0 s) := + ODE_solution_unique_of_mem_Icc_left (s := fun _ => univ) + (fun t _ => (velocity_lipschitz hw (U (T+t)-U T)).lipschitzOnWith) + hc hd (fun _ _ => mem_univ _) + (hnew.continuous_eval hs hy) hdnew (fun _ _ => mem_univ _) + (by simp only [hfin,hnewfin,add_sub_cancel_right]) + have he0 := he ⟨le_rfl,hs⟩ + dsimp only at he0 + rw [add_zero,hnew.initial y hy.1.1] at he0 + have hearg : g T x = y+(U T:ℂ) := by rw [← he0]; ring + change x = f T (y+(U T:ℂ)) + rw [← hearg] + exact (h.2.2.2.2.2.2.2.2.2.1 T hT x + (survivingDomain_mono (le_add_of_nonneg_right hs) hx)).symm + +end SLEExactGauge + +end + +end + +/-! Conformal localization and Loewner Trace Composition estimates. -/ + +noncomputable section +open Set Filter +open scoped Topology OnePoint +namespace SLEExactGauge + +theorem loewner_trace_composition_of_extension {U : ℝ → ℝ} {γ η : ℝ → ℂ} + {g f G F : ℝ → ℂ → ℂ} (h : IsLoewnerTraceUsing U γ g f) + {T : ℝ} (hT : 0 ≤ T) + (hnew : IsLoewnerTraceUsing (fun t => U (T+t)-U T) η G F) + (Fbar : ℂ → OnePoint ℂ) + (hext : ∀ w ∈ halfPlane, Fbar w = (f T w : OnePoint ℂ)) + (hc : ContinuousOn Fbar {w : ℂ | 0 ≤ w.im}) + {s : ℝ} (hs : 0 ≤ s) : + Fbar (η s+(U T:ℂ)) = (γ (T+s) : OnePoint ℂ) := by + let V := U (T+s)-U T + let a : ℝ → ℂ := fun y => (V:ℂ)+(y:ℂ)*Complex.I + have ha (y : ℝ) (hy : 0 < y) : a y ∈ halfPlane := by + simpa [a,halfPlane] using hy + have hfa (y : ℝ) (hy : 0 < y) : F s (a y)+(U T:ℂ) ∈ halfPlane := by + have hh := (hnew.2.2.2.2.2.2.2.2.1 s hs (ha y hy)).1.1 + simpa only [halfPlane,mem_ofPred_eq,Complex.add_im,Complex.ofReal_im,add_zero] using hh + have hlim : Tendsto (fun y => F s (a y)+(U T:ℂ)) (𝓝[>] (0:ℝ)) + (𝓝[{w : ℂ | 0 ≤ w.im}] (η s+(U T:ℂ))) := by + apply tendsto_nhdsWithin_iff.2 + refine ⟨?_,?_⟩ + · exact (hnew.2.2.2.2.2.2.2.2.2.2.2.2.2 s hs).add_const (U T:ℂ) + · filter_upwards [self_mem_nhdsWithin] with y hy + exact (hfa y hy).le + have hp : 0 ≤ (η s+(U T:ℂ)).im := by + simpa only [Complex.add_im,Complex.ofReal_im,add_zero] using hnew.2.2.1 s hs + have hleft := ((hc _ hp).tendsto).comp hlim + have hright : Tendsto (fun y : ℝ => (f (T+s) + ((U (T+s):ℂ)+(y:ℂ)*Complex.I) : OnePoint ℂ)) (𝓝[>] (0:ℝ)) + (𝓝 (γ (T+s) : OnePoint ℂ)) := + OnePoint.continuous_coe.continuousAt.tendsto.comp + (h.2.2.2.2.2.2.2.2.2.2.2.2.2 (T+s) (add_nonneg hT hs)) + have heq : (fun y : ℝ => Fbar (F s (a y)+(U T:ℂ))) =ᶠ[𝓝[>] (0:ℝ)] + (fun y : ℝ => (f (T+s) ((U (T+s):ℂ)+(y:ℂ)*Complex.I) : OnePoint ℂ)) := by + filter_upwards [self_mem_nhdsWithin] with y hy + rw [hext _ (hfa y hy),← loewner_inverse_cocycle h hT hnew hs (ha y hy)] + congr 2 + dsimp [a,V] + rw [Complex.ofReal_sub] + ring + exact tendsto_nhds_unique hleft (hright.congr' heq.symm) + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/LoewnerExit.lean b/lean/OAI/Probability/SLELocalization/LoewnerExit.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd7535562828af7c87488b0d160bc0983c1b354b --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/LoewnerExit.lean @@ -0,0 +1,1093 @@ +import Mathlib +import OAI.Probability.SLELocalization.ConditionalAngles +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Loewner Exit estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerExit +open LoewnerCutoff + +lemma stop_le_of_nonpos {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (U : C(I,ℝ)) (z : ℂ) (ρ δ : ℝ) {t : ℝ} (ht : t ∈ Icc 0 T) + (hn : deficit hε hT.le U z ρ δ t ≤ 0) : + stop hε hT.le U z ρ δ ≤ t := by + have hq : t/T ∈ Icc (0:ℝ) 1 := ⟨div_nonneg ht.1 hT.le,(div_le_one hT).2 ht.2⟩ + have hh := ContinuousExit.time_le_of_nonpos hq + (show ContinuousExit.extend (exitPath hε hT.le U z ρ δ) (t/T) ≤ 0 by + rw [exitPath_extend_div hε hT.le hT U z ρ δ ht]; exact hn) + change T*ContinuousExit.time (exitPath hε hT.le U z ρ δ) ≤ t + exact (mul_le_mul_of_nonneg_left hh hT.le).trans_eq (mul_div_cancel₀ _ hT.ne') + +lemma stop_prefix_min {ε S T : ℝ} (hε : 0 < ε) (hS : 0 < S) (hT : 0 < T) + (hST : S ≤ T) (U V : C(I,ℝ)) (z : ℂ) (ρ δ : ℝ) + (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) : + stop hε hS.le U z ρ δ = min S (stop hε hT.le V z ρ δ) := by + let a := stop hε hS.le U z ρ δ + let b := stop hε hT.le V z ρ δ + have ha : 0 ≤ a ∧ a ≤ S := stop_bounds hε hS.le U z ρ δ + have hb : 0 ≤ b ∧ b ≤ T := stop_bounds hε hT.le V z ρ δ + have hd := deficit_prefix_eq hε hS.le hT.le hST U V z ρ δ hUV + apply le_antisymm + · apply le_min ha.2 + by_contra hn + have hba : b < a := lt_of_not_ge hn + have hbs : b < S := hba.trans_le ha.2 + have hbT : b < T := hbs.trans_le hST + have hn := nonpos_at_of_lt hε hT.le hT V z ρ δ hbT + have hp := positive_before hε hS.le hS U z ρ δ hb.1 hba + have he := hd ⟨hb.1,hbs.le⟩ + change deficit hε hS.le U z ρ δ b = deficit hε hT.le V z ρ δ b at he + rw [he] at hp + exact (not_lt_of_ge hn) hp + · by_contra hn + have haa : a < min S b := lt_of_not_ge hn + have haS : a < S := (lt_min_iff.1 haa).1 + have hab : a < b := (lt_min_iff.1 haa).2 + have hn := nonpos_at_of_lt hε hS.le hS U z ρ δ haS + have hp := positive_before hε hT.le hT V z ρ δ ha.1 hab + have he := hd ⟨ha.1,haS.le⟩ + change deficit hε hS.le U z ρ δ a = deficit hε hT.le V z ρ δ a at he + rw [← he] at hp + exact (not_lt_of_ge hn) hp + +end SLEExactGauge.LoewnerExit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff + +def withHorizon {z : ℂ} {u : ℝ} (C : Cutoff z u) (T : ℝ≥0) : Cutoff z u where + angle := C.angle + angle_pos := C.angle_pos + angle_initial := C.angle_initial + height := C.height + height_pos := C.height_pos + horizon := max C.horizon (T+1) + horizon_pos := C.horizon_pos.trans_le (le_max_left _ _) + height_small := C.height_small + time_large := C.time_large.trans_le (le_max_left _ _) + +lemma withHorizon_gt {z : ℂ} {u : ℝ} (C : Cutoff z u) (T : ℝ≥0) : + (T:ℝ) < (C.withHorizon T).horizon := by + change (T:ℝ) < max (C.horizon:ℝ) (T+1) + exact (lt_add_one _).trans_le (le_max_right _ _) + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.RadiusPast +open LoewnerCutoff LoewnerExit LoewnerLocalized FiniteTilt + +def hitData {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (κ : ℝ) (U : C(I,ℝ)) (z : ℂ) (ρ δ : ℝ) : ℝ × ℝ := + let τ := stop hε hT U z ρ δ + (τ, if radius hε hT U z τ ≤ ρ then + (radius hε hT U z τ)^(-codimension κ)*(sine hε hT U z τ)^(8/κ-1) else 0) + +lemma measurable_hitData {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (κ : ℝ) (z : ℂ) (ρ δ : ℝ) : + @Measurable C(I,ℝ) (ℝ × ℝ) (borel _) _ (fun U => hitData hε hT.le κ U z ρ δ) := by + let : MeasurableSpace C(I,ℝ) := borel _ + let : BorelSpace C(I,ℝ) := ⟨rfl⟩ + have ht := GammaField.measurable_stop hε hT.le hT z ρ δ + have hr := (continuous_radius hε hT.le z).measurable.comp (measurable_id.prodMk ht) + have hs := (continuous_sine hε hT.le z).measurable.comp (measurable_id.prodMk ht) + exact ht.prodMk (Measurable.ite (measurableSet_le hr measurable_const) + ((hr.pow_const _).mul (hs.pow_const _)) measurable_const) + +end SLEExactGauge.RadiusPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.RadiusPast +open LoewnerCutoff LoewnerExit LoewnerLocalized FiniteTilt +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) +variable {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) γ g f) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +variable (C : Cutoff z u) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (hTC : T ≤ C.horizon) + +include h hz hu hc hb0 hT hTC in +lemma raw_data_source : + let U := BrownianDriver.path B (Real.sqrt κ) T sample + let τ := stop C.height_pos T.coe_nonneg U z ((2*z.im)*Real.exp (-u)) C.angle + τ = min (T:ℝ) (C.stopTime κ B sample) ∧ z ∈ localizationDomain γ τ ∧ + hitData C.height_pos T.coe_nonneg κ U z ((2*z.im)*Real.exp (-u)) C.angle = + (τ, if loewnerRadius g τ z = (2*z.im)*Real.exp (-u) then + (loewnerRadius g τ z)^(-codimension κ) * + (loewnerAngleSine κ (fun t => B t sample) g τ z)^(8/κ-1) else 0) := by + classical + dsimp only + let U := BrownianDriver.path B (Real.sqrt κ) T sample + let ρ := (2*z.im)*Real.exp (-u) + let τ := stop C.height_pos T.coe_nonneg U z ρ C.angle + have hUV := BrownianDriver.prefix_eq B (Real.sqrt κ) T C.horizon sample hc hTC + have h0 : 0 < deficit C.height_pos T.coe_nonneg U z ρ C.angle 0 := by + rw [deficit_prefix_eq C.height_pos T.coe_nonneg C.horizon.coe_nonneg hTC + U (C.paths κ B sample) z ρ C.angle hUV ⟨le_rfl,T.coe_nonneg⟩] + exact C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hU : EqOn (extendDriver T U) (fun t => Real.sqrt κ*B t.toNNReal sample) (Icc 0 (T:ℝ)) := + fun t ht => BrownianDriver.extend_eq B (Real.sqrt κ) T sample hc ht + have hsrc := source_until_stop C.height_pos hT h U z ρ C.angle hU h0 + have hb := stop_bounds C.height_pos T.coe_nonneg U z ρ C.angle + have ht : τ ∈ Icc 0 τ := ⟨hb.1,le_rfl⟩ + have hr := radius_eq_source C.height_pos hT h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) U z ρ C.angle hU h0 ht + have hs : sine C.height_pos T.coe_nonneg U z τ = + loewnerAngleSine κ (fun t => B t sample) g τ z := by + simpa only [loewnerAngleSine,Complex.ofReal_mul] using + sine_eq_source C.height_pos hT h U z ρ C.angle hU h0 ht + have hlo : ρ ≤ radius C.height_pos T.coe_nonneg U z τ := + ((deficit_nonneg_iff C.height_pos T.coe_nonneg U z ρ C.angle τ).1 + (nonneg_until C.height_pos T.coe_nonneg hT U z ρ C.angle h0 ht)).1 + refine ⟨stop_prefix_min C.height_pos hT C.horizon_pos hTC U (C.paths κ B sample) z ρ C.angle hUV,hsrc.1,?_⟩ + change (τ, if radius C.height_pos T.coe_nonneg U z τ ≤ ρ then + (radius C.height_pos T.coe_nonneg U z τ)^(-codimension κ) * + (sine C.height_pos T.coe_nonneg U z τ)^(8/κ-1) else 0) = + (τ, if loewnerRadius g τ z = ρ then (loewnerRadius g τ z)^(-codimension κ) * + (loewnerAngleSine κ (fun t => B t sample) g τ z)^(8/κ-1) else 0) + by_cases he : loewnerRadius g τ z = ρ + · have hle : radius C.height_pos T.coe_nonneg U z τ ≤ ρ := by rw [hr,he] + simp only [hr,hs,he,le_refl,ite_true] + · have hn : ¬ radius C.height_pos T.coe_nonneg U z τ ≤ ρ := by + intro hl + exact he (hr.symm.trans (le_antisymm hl hlo)) + simp only [hn,he,ite_false] + +include h hz hu hc hb0 in +lemma eventually_stop_general (D : ℕ → Cutoff z u) + (hD : Tendsto (fun n => (D n).angle) atTop (𝓝 0)) + {t : ℝ≥0} (hzt : z ∈ localizationDomain γ t) + (hrt : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + ∀ᶠ n : ℕ in atTop, (D n).stopTime κ B sample = t := by + obtain ⟨η,hη,hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + filter_upwards [hD.eventually (gt_mem_nhds hη)] with n hn + let C := D n + have hh : loewnerRadius g (C.stopTime κ B sample) z = (2*z.im)*Real.exp (-u) := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · exact hr + · have htm := hm (C.stopTime κ B sample) + ⟨(C.bounds κ B sample).1,C.stopTime_le_radius κ B sample h hz hu hc hb0 t.coe_nonneg hzt hrt⟩ + rw [hs] at htm + exact False.elim ((not_lt_of_ge htm) hn) + exact h.live_radius_injective + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (C.bounds κ B sample).1 t.coe_nonneg (C.source_live κ B sample h hz hu hc hb0) hzt + (hh.trans hrt.symm) + +end SLEExactGauge.RadiusPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.RadiusPast +open LoewnerCutoff LoewnerExit LoewnerLocalized FiniteTilt + +lemma live_radius_witness {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hU : ContinuousOn driver (Ici 0)) + {z : ℂ} {u : ℝ} (hh : firstLiveRadiusStop γ g z u ≠ (⊤ : ℝ≥0∞)) : + ∃ t : ℝ≥0, firstLiveRadiusStop γ g z u = (t : ℝ≥0∞) ∧ + z ∈ localizationDomain γ t ∧ loewnerRadius g t z = (2*z.im)*Real.exp (-u) := by + have he : ∃ t : ℝ≥0, z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u) := by + by_contra hn + have he : {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2*z.im)*Real.exp (-u)} = ∅ := + Set.eq_empty_iff_forall_notMem.2 (fun t ht => hn ⟨t,ht⟩) + exact hh (by simp only [firstLiveRadiusStop,he,Set.image_empty,sInf_empty]) + obtain ⟨t,hzt,hrt⟩ := he + exact ⟨t,h.firstLiveRadiusStop_eq hU hzt hrt,hzt,hrt⟩ + +def byTime {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) (T : ℝ≥0) (sample : Ω) : ℝ≥0∞ := + if firstLiveRadiusStop (γ sample) (g sample) z u ≤ (T : ℝ≥0∞) then + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u else 0 + +def approx {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + {z : ℂ} (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) (T : ℝ≥0) (n : ℕ) (sample : Ω) : ℝ≥0∞ := + let C := (cutoffs hz u hu n).withHorizon T + ENNReal.ofReal (hitData C.height_pos T.coe_nonneg κ + (BrownianDriver.path B (Real.sqrt κ) T sample) z ((2*z.im)*Real.exp (-u)) C.angle).2 + +lemma eventually_approx {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) + (T : ℝ≥0) (hT : 0 < (T:ℝ)) : + ∀ᶠ n : ℕ in atTop, approx κ B hz u hu.le T n sample = byTime κ B γ g z u T sample := by + classical + let D := fun n => (cutoffs hz u hu.le n).withHorizon T + have hU : ContinuousOn (fun t : ℝ => Real.sqrt κ*B t.toNNReal sample) (Ici 0) := (continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn + by_cases hh : firstLiveRadiusStop (γ sample) (g sample) z u ≤ (T : ℝ≥0∞) + · obtain ⟨t,htau,hzt,hrt⟩ := live_radius_witness h hU + (ne_top_of_le_ne_top ENNReal.coe_ne_top hh) + have htT : t ≤ T := by simpa only [htau,ENNReal.coe_le_coe] using hh + have hD : Tendsto (fun n => (D n).angle) atTop (𝓝 0) := shrinkingAngle_tendsto z + filter_upwards [eventually_stop_general κ B sample h hz hu hc hb0 D hD hzt hrt] with n hn + have hs := raw_data_source κ B sample h hz hu hc hb0 (D n) T hT + ((cutoffs hz u hu.le n).withHorizon_gt T).le + dsimp only at hs + rw [hn,min_eq_right (show (t:ℝ) ≤ T from htT)] at hs + dsimp only [approx] + unfold byTime + rw [ite_eq_left hh, hs.2.2, Prod.snd, hs.1, ite_eq_left hrt, + finiteStoppedDensity,htau,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal] + · apply Filter.Eventually.of_forall + intro n + have hs := raw_data_source κ B sample h hz hu hc hb0 (D n) T hT + ((cutoffs hz u hu.le n).withHorizon_gt T).le + dsimp only at hs + let U := BrownianDriver.path B (Real.sqrt κ) T sample + let τ := stop (D n).height_pos T.coe_nonneg U z ((2*z.im)*Real.exp (-u)) (D n).angle + have hn : loewnerRadius (g sample) τ z ≠ (2*z.im)*Real.exp (-u) := by + intro he + have ht := stop_bounds (D n).height_pos T.coe_nonneg U z ((2*z.im)*Real.exp (-u)) (D n).angle + have heq := h.firstLiveRadiusStop_eq hU (t := ⟨τ,ht.1⟩) hs.2.1 he + apply hh + rw [heq] + exact ENNReal.coe_le_coe.2 (show (⟨τ,ht.1⟩ : ℝ≥0) ≤ T from ht.2) + dsimp only [approx] + unfold byTime + rw [ite_eq_right hh,hs.2.2,Prod.snd,ite_eq_right hn,ENNReal.ofReal_zero] + +end SLEExactGauge.RadiusPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.RadiusPast +open FiniteTilt BrownianPredictable +local instance : MeasurableSpace C(I, ℝ) := borel _ +local instance : BorelSpace C(I, ℝ) := ⟨rfl⟩ + +def observed {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + {z : ℂ} (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) (T : ℝ≥0) (sample : Ω) : ℝ≥0∞ := + ENNReal.ofReal (ContinuousDriver.selectedLimit 0 (fun n => (approx κ B hz u hu T n sample).toReal)) + +lemma measurable_observed {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + {z : ℂ} (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) (T : ℝ≥0) (hT : 0 < (T:ℝ)) : + Measurable[pastSigma B T] (observed κ B hz u hu T) := by + let : MeasurableSpace Ω := pastSigma B T + apply ENNReal.measurable_ofReal.comp + apply ContinuousDriver.measurable_selectedLimit + intro n + let C := (cutoffs hz u hu n).withHorizon T + exact ENNReal.measurable_toReal.comp (ENNReal.measurable_ofReal.comp + (((measurable_hitData C.height_pos hT κ z ((2*z.im)*Real.exp (-u)) C.angle).snd).comp + (BrownianDriver.path_measurable_past B (Real.sqrt κ) T))) + +lemma aemeasurable_observed {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (κ : ℝ) {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + {z : ℂ} (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 ≤ u) (T : ℝ≥0) (hT : 0 < (T:ℝ)) : + AEMeasurable (observed κ B hz u hu T) P := by + apply ENNReal.measurable_ofReal.comp_aemeasurable + apply ContinuousDriver.aemeasurable_selectedLimit + intro n + let C := (cutoffs hz u hu n).withHorizon T + exact ENNReal.measurable_toReal.comp_aemeasurable (ENNReal.measurable_ofReal.comp_aemeasurable + (((measurable_hitData C.height_pos hT κ z ((2*z.im)*Real.exp (-u)) C.angle).snd).comp_aemeasurable + (BrownianDriver.path_aemeasurable hB (Real.sqrt κ) T))) + +lemma observed_eq {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) + (T : ℝ≥0) (hT : 0 < (T:ℝ)) : + observed κ B hz u hu.le T sample = byTime κ B γ g z u T sample := by + have hf : byTime κ B γ g z u T sample ≠ ⊤ := by + simp only [byTime,finiteStoppedDensity] + split_ifs <;> simp + unfold observed + rw [ContinuousDriver.selectedLimit_eq (y := (byTime κ B γ g z u T sample).toReal) 0 (by + apply tendsto_const_nhds.congr' + filter_upwards [eventually_approx κ B γ g f sample h hz hu hc hb0 T hT] with n hn + exact congrArg ENNReal.toReal hn.symm), ENNReal.ofReal_toReal hf] + +lemma byTime_pos_iff {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + {z : ℂ} (_hz : z ∈ halfPlane) (u : ℝ) + (hc : Continuous (fun t => B t sample)) (T : ℝ≥0) : + 0 < byTime κ B γ g z u T sample ↔ firstLiveRadiusStop (γ sample) (g sample) z u ≤ (T : ℝ≥0∞) := by + unfold byTime + split_ifs with hh + · obtain ⟨t,htau,hzt,hrt⟩ := live_radius_witness h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (ne_top_of_le_ne_top ENNReal.coe_ne_top hh) + have hs : 0 < loewnerAngleSine κ (fun t => B t sample) (g sample) t z := by + simpa only [loewnerAngleSine,Complex.ofReal_mul] using + div_pos (h.im_pos t.coe_nonneg hzt) (norm_pos_iff.2 (h.centered_ne_zero t.coe_nonneg hzt)) + have hr : 0 < loewnerRadius (g sample) t z := h.radius_pos t.coe_nonneg hzt + simp only [finiteStoppedDensity,htau,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal] + exact iff_of_true (ENNReal.ofReal_pos.2 + (mul_pos (Real.rpow_pos_of_pos hr _) (Real.rpow_pos_of_pos hs _))) (htau ▸ hh) + · exact iff_of_false (lt_irrefl _) hh + +end SLEExactGauge.RadiusPast + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} +variable (h : IsLoewnerTraceUsing driver γ g f) (hU : ContinuousOn driver (Ici 0)) + +include h hU in +lemma firstLiveRadiusStop_mono {z : ℂ} (hz : z ∈ halfPlane) {u v : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) : + firstLiveRadiusStop γ g z u ≤ firstLiveRadiusStop γ g z v := by + by_cases hv : firstLiveRadiusStop γ g z v = (⊤ : ℝ≥0∞) + · simp only [hv,le_top] + obtain ⟨t,htau,hzt,hrt⟩ := RadiusPast.live_radius_witness h hU hv + have hρ : (2*z.im)*Real.exp (-v) ≤ (2*z.im)*Real.exp (-u) := + mul_le_mul_of_nonneg_left (Real.exp_le_exp.2 (neg_le_neg huv)) (by have hy : 0 < z.im := hz; positivity) + have hρ0 : (2*z.im)*Real.exp (-u) ≤ loewnerRadius g 0 z := by + rw [h.radius_initial hz] + exact mul_le_of_le_one_right (by have hy : 0 < z.im := hz; positivity) + (Real.exp_le_one_iff.2 (neg_nonpos.2 hu)) + obtain ⟨s,hs,hseq⟩ := intermediate_value_Icc' t.coe_nonneg + (h.continuous_radius t.coe_nonneg (hU.mono Icc_subset_Ici_self) hzt) ⟨hrt ▸ hρ,hρ0⟩ + have hstop := h.firstLiveRadiusStop_eq hU (t := ⟨s,hs.1⟩) (survivingDomain_mono hs.2 hzt) hseq + rw [hstop,htau] + exact ENNReal.coe_le_coe.2 (show (⟨s,hs.1⟩ : ℝ≥0) ≤ t from hs.2) + +include h hU in +lemma firstLiveRadiusStop_pos {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) : + 0 < firstLiveRadiusStop γ g z u := by + by_cases hv : firstLiveRadiusStop γ g z u = (⊤ : ℝ≥0∞) + · simp only [hv,ENNReal.zero_lt_top] + obtain ⟨t,htau,hzt,hrt⟩ := RadiusPast.live_radius_witness h hU hv + have ht : 0 < t := by + by_contra hn + have he : t = 0 := le_antisymm (not_lt.1 hn) zero_le + rw [he,NNReal.coe_zero,h.radius_initial hz] at hrt + have hr : (2*z.im)*Real.exp (-u) < 2*z.im := + mul_lt_of_lt_one_right (by have hy : 0 < z.im := hz; positivity) + (Real.exp_lt_one_iff.2 (neg_neg_of_pos hu)) + exact (ne_of_lt hr) hrt.symm + rw [htau] + exact ENNReal.coe_pos.2 ht + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open BrownianPredictable + +def CompletedStoppedPast {Ω : Type*} [MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (P : Measure Ω) (τ : Ω → ℝ≥0∞) (A : Set Ω) : Prop := + NullMeasurableSet A P ∧ ∀ t : ℝ≥0, ∃ E : Set Ω, MeasurableSet[pastSigma B t] E ∧ + E =ᵐ[P] (A ∩ {sample | τ sample ≤ (t : ℝ≥0∞)} : Set Ω) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open BrownianPredictable +namespace CompletedStoppedPast +variable {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} {P : Measure Ω} +variable {τ σ : Ω → ℝ≥0∞} {A C : Set Ω} + +lemma empty : CompletedStoppedPast B P τ ∅ := by + refine ⟨nullMeasurableSet_empty,fun t => ⟨∅,@MeasurableSet.empty Ω (pastSigma B t),?_⟩⟩ + simp only [empty_inter] + exact Filter.EventuallyEq.rfl + +lemma union (hA : CompletedStoppedPast B P τ A) (hC : CompletedStoppedPast B P τ C) : + CompletedStoppedPast B P τ (A ∪ C) := by + refine ⟨hA.1.union hC.1,?_⟩ + intro t + obtain ⟨E,hE,he⟩ := hA.2 t + obtain ⟨F,hF,hf⟩ := hC.2 t + refine ⟨E ∪ F,hE.union hF,?_⟩ + filter_upwards [he,hf] with x he hf + change (x∈E ∨ x∈F) = ((x∈A ∨ x∈C) ∧ τ x ≤ (t:ℝ≥0∞)) + change (x∈E) = (x∈A ∧ τ x ≤ (t:ℝ≥0∞)) at he + change (x∈F) = (x∈C ∧ τ x ≤ (t:ℝ≥0∞)) at hf + rw [he,hf] + exact propext (by tauto) + +lemma diff (hA : CompletedStoppedPast B P τ A) (hC : CompletedStoppedPast B P τ C) : + CompletedStoppedPast B P τ (A \ C) := by + refine ⟨hA.1.diff hC.1,?_⟩ + intro t + obtain ⟨E,hE,he⟩ := hA.2 t + obtain ⟨F,hF,hf⟩ := hC.2 t + refine ⟨E \ F,hE.diff hF,?_⟩ + filter_upwards [he,hf] with x he hf + change (x∈E ∧ x∉F) = ((x∈A ∧ x∉C) ∧ τ x ≤ (t:ℝ≥0∞)) + change (x∈E) = (x∈A ∧ τ x ≤ (t:ℝ≥0∞)) at he + change (x∈F) = (x∈C ∧ τ x ≤ (t:ℝ≥0∞)) at hf + rw [he,hf] + exact propext (by tauto) + +lemma mono (hA : CompletedStoppedPast B P τ A) + (hu : CompletedStoppedPast B P σ univ) (hτσ : ∀ᵐ x ∂P, τ x ≤ σ x) : + CompletedStoppedPast B P σ A := by + refine ⟨hA.1,?_⟩ + intro t + obtain ⟨E,hE,he⟩ := hA.2 t + obtain ⟨F,hF,hf⟩ := hu.2 t + refine ⟨E ∩ F,hE.inter hF,?_⟩ + filter_upwards [he,hf,hτσ] with x he hf hle + change (x∈E ∧ x∈F) = (x∈A ∧ σ x ≤ (t:ℝ≥0∞)) + change (x∈E) = (x∈A ∧ τ x ≤ (t:ℝ≥0∞)) at he + change (x∈F) = (True ∧ σ x ≤ (t:ℝ≥0∞)) at hf + rw [he,hf] + apply propext + constructor + · exact fun hh => ⟨hh.1.1,hh.2.2⟩ + · exact fun hh => ⟨⟨hh.1,hle.trans hh.2⟩,⟨trivial,hh.2⟩⟩ + +end CompletedStoppedPast + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open BrownianPredictable + +lemma finiteStoppedDensity_stoppedPast {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u : ℝ) (hu : 0 < u) + (S : Set ℝ≥0∞) (hS : MeasurableSet S) : + CompletedStoppedPast B P (fun sample => firstLiveRadiusStop (γ sample) (g sample) z u) + {sample | finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∈ S} := by + refine ⟨?_,?_⟩ + · exact (finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz u hu).nullMeasurableSet_preimage hS + intro T + by_cases ht : T = 0 + · refine ⟨∅,@MeasurableSet.empty Ω (pastSigma B T),?_⟩ + filter_upwards [hmaps,hB.cont] with sample hm hc + have hp := hm.firstLiveRadiusStop_pos + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) hz hu + apply propext + simp only [mem_empty_iff_false,mem_inter_iff,mem_ofPred_eq,ht,ENNReal.coe_zero] + constructor + · exact False.elim + · exact fun hh => (not_le_of_gt hp) hh.2 + have hTp : 0 < (T:ℝ) := by exact_mod_cast pos_iff_ne_zero.2 ht + let F := RadiusPast.observed κ B hz u hu.le T + have hFm := RadiusPast.measurable_observed κ B hz u hu.le T hTp + refine ⟨{sample | 0 < F sample} ∩ F ⁻¹' S, + (measurableSet_lt measurable_const hFm).inter (hS.preimage hFm),?_⟩ + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hm hc hb0 + have he := RadiusPast.observed_eq κ B γ g f sample hm hz hu hc hb0 T hTp + have hp := RadiusPast.byTime_pos_iff κ B γ g f sample hm hz u hc T + apply propext + change (0 < F sample ∧ F sample ∈ S) ↔ + (finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∈ S ∧ + firstLiveRadiusStop (γ sample) (g sample) z u ≤ (T:ℝ≥0∞)) + change F sample = _ at he + rw [he,hp] + by_cases hh : firstLiveRadiusStop (γ sample) (g sample) z u ≤ (T:ℝ≥0∞) + · simp only [RadiusPast.byTime,hh,ite_true,true_and,and_true] + · simp only [hh,false_and,and_false] + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +namespace CompletedStoppedPast +variable {Ω : Type*} [MeasurableSpace Ω] {B : ℝ≥0 → Ω → ℝ} {P : Measure Ω} +variable {τ : Ω → ℝ≥0∞} + +lemma finsetUnion {ι : Type*} (s : Finset ι) (A : ι → Set Ω) + (hA : ∀ i ∈ s, CompletedStoppedPast B P τ (A i)) : + CompletedStoppedPast B P τ (⋃ i ∈ s, A i) := by + classical + induction s using Finset.induction_on with + | empty => simpa only [Finset.notMem_empty, iUnion_of_empty, iUnion_empty] using (empty (B:=B) (P:=P) (τ:=τ)) + | @insert a s ha ih => + simpa only [Finset.set_biUnion_insert] using + (hA a (Finset.mem_insert_self _ _)).union (ih (fun i hi => hA i (Finset.mem_insert_of_mem hi))) + +end CompletedStoppedPast + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +namespace FiniteFirstEvents +variable {Ω ι : Type*} [LinearOrder ι] + +def first (s : Finset ι) (A : ι → Set Ω) (i : ι) : Set Ω := + A i \ ⋃ j ∈ s.filter (fun j => j < i), A j + +lemma first_subset (s : Finset ι) (A : ι → Set Ω) (i : ι) : first s A i ⊆ A i := + sdiff_subset + +lemma first_disjoint (s : Finset ι) (A : ι → Set Ω) {i j : ι} + (hi : i ∈ s) (hj : j ∈ s) (hij : i ≠ j) : Disjoint (first s A i) (first s A j) := by + classical + apply Set.disjoint_left.2 + intro x hxi hxj + rcases lt_or_gt_of_ne hij with hij | hji + · exact hxj.2 (mem_iUnion.2 ⟨i,mem_iUnion.2 ⟨Finset.mem_filter.2 ⟨hi,hij⟩,hxi.1⟩⟩) + · exact hxi.2 (mem_iUnion.2 ⟨j,mem_iUnion.2 ⟨Finset.mem_filter.2 ⟨hj,hji⟩,hxj.1⟩⟩) + +lemma union_first (s : Finset ι) (A : ι → Set Ω) : + (⋃ i ∈ s, first s A i) = ⋃ i ∈ s, A i := by + classical + apply Subset.antisymm + · exact iUnion₂_mono (fun i _ => first_subset s A i) + · intro x hx + obtain ⟨i,hi,hxi⟩ := mem_iUnion₂.1 hx + let t := s.filter (fun i => x ∈ A i) + have ht : t.Nonempty := ⟨i,Finset.mem_filter.2 ⟨hi,hxi⟩⟩ + let j := t.min' ht + have hj := Finset.mem_filter.1 (Finset.min'_mem t ht) + apply mem_iUnion₂.2 ⟨j,hj.1,?_⟩ + refine ⟨hj.2,?_⟩ + intro hbad + obtain ⟨k,hk,hxk⟩ := mem_iUnion₂.1 hbad + have hkj := (Finset.mem_filter.1 hk).2 + have hjk := Finset.min'_le t k (Finset.mem_filter.2 ⟨(Finset.mem_filter.1 hk).1,hxk⟩) + exact (not_lt_of_ge hjk) hkj + +lemma first_stoppedPast [MeasurableSpace Ω] + {B : ℝ≥0 → Ω → ℝ} {P : Measure Ω} {τ : Ω → ℝ≥0∞} + (s : Finset ι) (A : ι → Set Ω) (i : ι) + (hi : CompletedStoppedPast B P τ (A i)) + (hj : ∀ j ∈ s, j < i → CompletedStoppedPast B P τ (A j)) : + CompletedStoppedPast B P τ (first s A i) := by + classical + exact hi.diff (CompletedStoppedPast.finsetUnion (s.filter (fun j => j < i)) A + (fun j hj' => hj j (Finset.mem_filter.1 hj').1 (Finset.mem_filter.1 hj').2)) + +end FiniteFirstEvents + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open BrownianPredictable + +lemma finiteCenteredMeasure_event_le {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (u v : ℝ) (hu : 0 ≤ u) (huv : u ≤ v) + (A : Set Ω) + (hA : CompletedStoppedPast B P (fun sample => firstLiveRadiusStop (γ sample) (g sample) z u) A) + (K : ℝ≥0∞) + (hb : ∀ᵐ sample ∂P.restrict A, + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ≤ K) : + finiteCenteredMeasure κ P B γ g z v A ≤ + (ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)))⁻¹ * K * P A := by + have he := finiteStoppedDensity_consistent κ hκ B hB γ g f hγ hmaps z hz u v hu huv A hA.1 hA.2 + have hm0 : ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)) ≠ 0 := + (ENNReal.ofReal_pos.2 (localizationInitialGreen_pos κ hz)).ne' + rw [finiteCenteredMeasure,withDensity_apply₀ _ hA.1] + simp_rw [ENNReal.div_eq_inv_mul] + rw [lintegral_const_mul' _ _ (ENNReal.inv_ne_top.2 hm0),he,mul_assoc] + apply mul_le_mul' le_rfl + exact (lintegral_mono_ae hb).trans_eq (by rw [lintegral_const,Measure.restrict_apply_univ]) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteFirstEvents + +def densityBelow {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) (K : ℝ≥0∞) : Set Ω := + {sample | finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z u ∈ Ioo 0 K} + +lemma finiteCentered_grid_le {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (v : ℝ) (s : Finset ℚ) + (hs : ∀ q ∈ s, 0 < (q:ℝ) ∧ (q:ℝ) ≤ v) + (a : ℚ → ℝ≥0∞) (K : ℝ≥0∞) (ha : ∀ q ∈ s, a q ≤ K) : + finiteCenteredMeasure κ P B γ g z v (⋃ q ∈ s, densityBelow κ B γ g z q (a q)) ≤ + (ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)))⁻¹ * K * + P (⋃ q ∈ s, densityBelow κ B γ g z q (a q)) := by + classical + let A := fun q : ℚ => densityBelow κ B γ g z q (a q) + let Q := finiteCenteredMeasure κ P B γ g z v + let k := (ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)))⁻¹ * K + have hpast (q : ℚ) (hq : q ∈ s) : CompletedStoppedPast B P + (fun sample => firstLiveRadiusStop (γ sample) (g sample) z q) (A q) := + finiteStoppedDensity_stoppedPast κ hκ B hB γ g f hmaps z hz q (hs q hq).1 (Ioo 0 (a q)) measurableSet_Ioo + have huniv (q : ℚ) (hq : q ∈ s) : CompletedStoppedPast B P + (fun sample => firstLiveRadiusStop (γ sample) (g sample) z q) univ := by + simpa only [mem_univ,ofPred_true] using + finiteStoppedDensity_stoppedPast κ hκ B hB γ g f hmaps z hz q (hs q hq).1 univ MeasurableSet.univ + have hfirst (q : ℚ) (hq : q∈s) : CompletedStoppedPast B P + (fun sample => firstLiveRadiusStop (γ sample) (g sample) z q) (first s A q) := by + apply first_stoppedPast s A q (hpast q hq) + intro j hj hjq + apply (hpast j hj).mono (huniv q hq) + filter_upwards [hmaps,hB.cont] with sample hm hc + exact hm.firstLiveRadiusStop_mono + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) hz (hs j hj).1.le + (by exact_mod_cast hjq.le) + have hle (q : ℚ) (hq : q∈s) : Q (first s A q) ≤ k * P (first s A q) := by + apply finiteCenteredMeasure_event_le κ hκ B hB γ g f hγ hmaps z hz q v + (hs q hq).1.le (hs q hq).2 (first s A q) (hfirst q hq) K + filter_upwards [ae_restrict_mem₀ (hfirst q hq).1] with sample hx + exact hx.1.2.le.trans (ha q hq) + have hdis : PairwiseDisjoint (↑s : Set ℚ) (first s A) := + fun i hi j hj hij => first_disjoint s A hi hj hij + have hPQ : Q ≪ P := withDensity_absolutelyContinuous _ _ + have hsumQ : Q (⋃ q∈s,first s A q) = ∑ q∈s,Q (first s A q) := + measure_biUnion_finset₀ hdis.aedisjoint (fun q hq => (hfirst q hq).1.mono_ac hPQ) + have hsumP : P (⋃ q∈s,first s A q) = ∑ q∈s,P (first s A q) := + measure_biUnion_finset₀ hdis.aedisjoint (fun q hq => (hfirst q hq).1) + change Q (⋃ q∈s,A q) ≤ k * P (⋃ q∈s,A q) + rw [← union_first s A,hsumQ,hsumP] + calc + _ ≤ ∑ q∈s,k*P (first s A q) := Finset.sum_le_sum hle + _ = _ := by rw [Finset.mul_sum] + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +lemma finiteCentered_countableGrid_le {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (v : ℝ) (J : Set ℚ) + (hJ : ∀ q ∈ J, 0 < (q:ℝ) ∧ (q:ℝ) ≤ v) + (a : ℚ → ℝ≥0∞) (K : ℝ≥0∞) (ha : ∀ q ∈ J, a q ≤ K) : + finiteCenteredMeasure κ P B γ g z v (⋃ q ∈ J, densityBelow κ B γ g z q (a q)) ≤ + (ENNReal.ofReal ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1)))⁻¹ * K * + P (⋃ q ∈ J, densityBelow κ B γ g z q (a q)) := by + classical + let A := fun q : ℚ => densityBelow κ B γ g z q (a q) + let F := fun s : Finset ℚ => ⋃ q ∈ s.filter (fun q => q∈J), A q + have hm : Monotone F := by + intro s t hst + exact iUnion₂_mono' (fun q hq => ⟨q, Finset.mem_filter.2 + ⟨hst (Finset.mem_filter.1 hq).1,(Finset.mem_filter.1 hq).2⟩,Subset.rfl⟩) + have he : (⋃ s, F s) = ⋃ q ∈ J, A q := by + ext sample + simp only [F,mem_iUnion,Finset.mem_filter] + constructor + · rintro ⟨s,q,⟨hq,hJq⟩,hx⟩ + exact ⟨q,hJq,hx⟩ + · rintro ⟨q,hq,hx⟩ + exact ⟨{q},q,⟨Finset.mem_singleton_self q,hq⟩,hx⟩ + have hsub (s : Finset ℚ) : F s ⊆ ⋃ q ∈ J,A q := by + rw [← he] + exact subset_iUnion F s + change finiteCenteredMeasure κ P B γ g z v (⋃ q∈J,A q) ≤ _ + rw [← he,hm.measure_iUnion] + apply iSup_le + intro s + apply (finiteCentered_grid_le κ hκ B hB γ g f hγ hmaps z hz v + (s.filter (fun q => q∈J)) + (fun q hq => hJ q (Finset.mem_filter.1 hq).2) a K + (fun q hq => ha q (Finset.mem_filter.1 hq).2)).trans + exact mul_le_mul' le_rfl (measure_mono (he ▸ hsub s)) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +namespace FiniteClock + +def angleFloor (δ u : ℝ) : ℝ := δ * Real.exp (-u/8) + +def threshold (κ : ℝ) (z : ℂ) (δ u : ℝ) : ℝ≥0∞ := + ENNReal.ofReal (((2*z.im)*Real.exp (-u))^(-codimension κ) * (angleFloor δ u)^(8/κ-1)) + +def blockThreshold (κ : ℝ) (z : ℂ) (δ n : ℝ) : ℝ := + (2*z.im)^(-codimension κ) * Real.exp (codimension κ*(n+1)) * + δ^(8/κ-1) * Real.exp (-(8/κ-1)*n/8) + +lemma exponent_pos {κ : ℝ} (hκ : 0 < κ ∧ κ < 8) : 0 < 8/κ-1 := by + have h : 1 < 8/κ := (lt_div_iff₀ hκ.1).2 (by linarith) + linarith + +lemma codimension_pos {κ : ℝ} (hκ : 0 < κ ∧ κ < 8) : 0 < codimension κ := by + unfold codimension dimension + linarith + +lemma angleFloor_pos {δ : ℝ} (hδ : 0 < δ) (u : ℝ) : 0 < angleFloor δ u := by + unfold angleFloor + positivity + +lemma threshold_formula (κ : ℝ) {z : ℂ} (hz : z ∈ halfPlane) {δ : ℝ} (hδ : 0 < δ) (u : ℝ) : + threshold κ z δ u = ENNReal.ofReal + ((2*z.im)^(-codimension κ) * Real.exp (codimension κ*u) * + δ^(8/κ-1) * Real.exp (-(8/κ-1)*u/8)) := by + have hy : 0 < 2*z.im := by have : 0 < z.im := hz; positivity + unfold threshold angleFloor + rw [Real.mul_rpow hy.le (Real.exp_pos _).le,Real.mul_rpow hδ.le (Real.exp_pos _).le, + ← Real.exp_mul, ← Real.exp_mul] + congr 1 + rw [show -u * -codimension κ = codimension κ*u by ring, + show (-u/8)*(8/κ-1) = -(8/κ-1)*u/8 by ring] + ring + +lemma threshold_le_block (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {z : ℂ} (hz : z ∈ halfPlane) {δ : ℝ} (hδ : 0 < δ) + {n u : ℝ} (hnu : n ≤ u) (hun : u ≤ n+1) : + threshold κ z δ u ≤ ENNReal.ofReal (blockThreshold κ z δ n) := by + rw [threshold_formula κ hz hδ] + apply ENNReal.ofReal_le_ofReal + unfold blockThreshold + have hy : 0 < 2*z.im := by have : 0 < z.im := hz; positivity + have hp := codimension_pos hκ + have ha := exponent_pos hκ + apply mul_le_mul + · apply mul_le_mul_of_nonneg_right _ (Real.rpow_pos_of_pos hδ _).le + exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left hun hp.le)) + (Real.rpow_pos_of_pos hy _).le + · apply Real.exp_le_exp.2 + nlinarith + · positivity + · positivity + +lemma block_cancel (κ C δ n : ℝ) {z : ℂ} (hz : z ∈ halfPlane) : + ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))⁻¹ * + blockThreshold κ z δ n * + (C*Real.exp (-codimension κ*n)*(z.im/‖z‖)^(8/κ-1)) = + C * Real.exp (codimension κ) * δ^(8/κ-1) * Real.exp (-(8/κ-1)*n/8) := by + have hy : 0 < 2*z.im := by have : 0 < z.im := hz; positivity + have hs := Real.rpow_pos_of_pos (FiniteTilt.initial_sine_pos hz) (8/κ-1) + have hp := Real.rpow_pos_of_pos hy (-codimension κ) + have he : Real.exp (codimension κ*(n+1))*Real.exp (-codimension κ*n) = Real.exp (codimension κ) := by + rw [← Real.exp_add] + congr 1 + ring + unfold blockThreshold + field_simp + simp only [neg_mul] at he + linear_combination δ^(8/κ-1)*C * he + +def blockIndex (v : ℝ) (n : ℕ) : Set ℚ := + {q | 0 < (q:ℝ) ∧ (q:ℝ) ≤ v ∧ (n:ℝ) ≤ (q:ℝ) ∧ (q:ℝ) ≤ (n:ℝ)+1} + +def blockBad {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (δ v : ℝ) (n : ℕ) : Set Ω := + ⋃ q ∈ blockIndex v n, densityBelow κ B γ g z q (threshold κ z δ q) + +lemma blockBad_subset_hit {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (δ v : ℝ) (n : ℕ) : + blockBad κ B γ g z δ v n ≤ᵐ[P] + {sample | firstLiveRadiusStop (γ sample) (g sample) z n ≠ (⊤ : ℝ≥0∞)} := by + filter_upwards [hmaps,hB.cont] with sample hm hc hx + rcases mem_iUnion.1 hx with ⟨q,hq⟩ + rcases mem_iUnion.1 hq with ⟨hq,hx⟩ + have hhit : firstLiveRadiusStop (γ sample) (g sample) z q ≠ (⊤ : ℝ≥0∞) := by + intro he + have hh := hx.1 + simp only [finiteStoppedDensity,he,ite_true,lt_self_iff_false] at hh + have hh := hm.firstLiveRadiusStop_mono + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) hz + (Nat.cast_nonneg n) hq.2.2.1 + exact ne_top_of_le_ne_top hhit hh + +lemma ordinary_natural_radius_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) : + ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, + P {sample | firstLiveRadiusStop (γ sample) (g sample) z n ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (C*Real.exp (-codimension κ*n)*(z.im/‖z‖)^(8/κ-1)) := by + obtain ⟨C,hC,hbound⟩ := radiusApproachBound κ hκ + let S := (z.im/‖z‖)^(8/κ-1) + have hS : 0 < S := Real.rpow_pos_of_pos (FiniteTilt.initial_sine_pos hz) _ + refine ⟨C+S⁻¹,by positivity,?_⟩ + intro n + cases n with + | zero => + simp only [Nat.cast_zero,mul_zero,Real.exp_zero,mul_one] + apply (prob_le_one).trans + apply ENNReal.one_le_ofReal.2 + change 1 ≤ (C+S⁻¹)*S + rw [add_mul,inv_mul_cancel₀ hS.ne'] + linarith [mul_pos hC hS] + | succ n => + simp only [Nat.cast_add,Nat.cast_one] + apply (hbound P B hB γ g f hγ hmaps z hz (n+1) + (by norm_num)).trans + apply ENNReal.ofReal_le_ofReal + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (inv_nonneg.2 hS.le)) + (Real.exp_pos _).le) hS.le + +lemma block_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) (C : ℝ) (_hC : 0 < C) + (hbound : ∀ n : ℕ, + P {sample | firstLiveRadiusStop (γ sample) (g sample) z n ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (C*Real.exp (-codimension κ*n)*(z.im/‖z‖)^(8/κ-1))) + (δ : ℝ) (hδ : 0 < δ) (v : ℝ) (n : ℕ) : + finiteCenteredMeasure κ P B γ g z v (blockBad κ B γ g z δ v n) ≤ + ENNReal.ofReal (C * Real.exp (codimension κ) * δ^(8/κ-1) * + Real.exp (-(8/κ-1)*n/8)) := by + have hm0 := localizationInitialGreen_pos κ hz + have hy : 0 < 2*z.im := by have : 0 < z.im := hz; positivity + have hK : 0 < blockThreshold κ z δ n := by + unfold blockThreshold + positivity + have hp := (measure_mono_ae (blockBad_subset_hit κ B hB γ g f hmaps z hz δ v n)).trans (hbound n) + have hg := finiteCentered_countableGrid_le κ hκ B hB γ g f hγ hmaps z hz v + (blockIndex v n) (fun q hq => ⟨hq.1,hq.2.1⟩) + (fun q => threshold κ z δ q) (ENNReal.ofReal (blockThreshold κ z δ n)) + (fun q hq => threshold_le_block κ hκ hz hδ hq.2.2.1 hq.2.2.2) + apply hg.trans + apply (mul_le_mul' le_rfl hp).trans_eq + rw [← ENNReal.ofReal_inv_of_pos hm0, ← ENNReal.ofReal_mul (inv_nonneg.2 hm0.le), + ← ENNReal.ofReal_mul (mul_nonneg (inv_nonneg.2 hm0.le) hK.le)] + rw [block_cancel κ C δ n hz] + +end FiniteClock + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.FiniteClock + +def bad {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (δ v : ℝ) : Set Ω := + ⋃ n : ℕ, blockBad κ B γ g z δ v n + +lemma mem_bad_of_rational {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (δ v : ℝ) + (q : ℚ) (hq : 0 < (q:ℝ)) (hqv : (q:ℝ) ≤ v) {sample : Ω} + (hx : sample ∈ densityBelow κ B γ g z q (threshold κ z δ q)) : + sample ∈ bad κ B γ g z δ v := by + apply mem_iUnion.2 ⟨⌊(q:ℝ)⌋₊,?_⟩ + apply mem_iUnion.2 ⟨q,?_⟩ + apply mem_iUnion.2 ⟨⟨hq,hqv,Nat.floor_le hq.le,(Nat.lt_floor_add_one (q:ℝ)).le⟩,hx⟩ + +lemma geometric_blocks (κ C δ : ℝ) (hκ : 0 < κ ∧ κ < 8) (hC : 0 < C) (hδ : 0 < δ) : + (∑' n : ℕ, ENNReal.ofReal (C*Real.exp (codimension κ)*δ^(8/κ-1)*Real.exp (-(8/κ-1)*n/8))) = + ENNReal.ofReal ((C*Real.exp (codimension κ)/(1-Real.exp (-(8/κ-1)/8)))*δ^(8/κ-1)) := by + have ha := exponent_pos hκ + have hr : Real.exp (-(8/κ-1)/8) < 1 := Real.exp_lt_one_iff.2 (by linarith) + have he (n : ℕ) : Real.exp (-(8/κ-1)*n/8) = (Real.exp (-(8/κ-1)/8))^n := by + rw [← Real.exp_nat_mul] + congr 1 + ring + simp_rw [he,ENNReal.ofReal_mul (show 0≤C*Real.exp (codimension κ)*δ^(8/κ-1) by positivity), + ENNReal.ofReal_pow (Real.exp_pos _).le] + rw [ENNReal.tsum_mul_left,ENNReal.tsum_geometric,← ENNReal.ofReal_one, + ← ENNReal.ofReal_sub 1 (Real.exp_pos _).le,← ENNReal.ofReal_inv_of_pos (sub_pos.2 hr), + ← ENNReal.ofReal_mul (show 0≤C*Real.exp (codimension κ)*δ^(8/κ-1) by positivity)] + congr 1 + ring + +lemma bad_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ) (hz : z ∈ halfPlane) : + ∃ D : ℝ, 0 < D ∧ ∀ δ : ℝ, 0 < δ → ∀ v : ℝ, + finiteCenteredMeasure κ P B γ g z v (bad κ B γ g z δ v) ≤ ENNReal.ofReal (D*δ^(8/κ-1)) := by + obtain ⟨C,hC,hbound⟩ := ordinary_natural_radius_bound κ hκ B hB γ g f hγ hmaps z hz + have hr : Real.exp (-(8/κ-1)/8) < 1 := Real.exp_lt_one_iff.2 (by have := exponent_pos hκ; linarith) + refine ⟨C*Real.exp (codimension κ)/(1-Real.exp (-(8/κ-1)/8)),by positivity,?_⟩ + intro δ hδ v + apply (measure_iUnion_le _).trans + apply (ENNReal.tsum_le_tsum (fun n => block_bound κ hκ B hB γ g f hγ hmaps z hz C hC hbound δ hδ v n)).trans_eq + exact geometric_blocks κ C δ hκ hC hδ + +lemma exists_small_floor {a D ε : ℝ} (ha : 0 < a) (hD : 0 < D) (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ D*δ^a < ε := by + have hp : 0 < ε/(2*D) := by positivity + refine ⟨(ε/(2*D))^(1/a),Real.rpow_pos_of_pos hp _,?_⟩ + rw [← Real.rpow_mul hp.le,one_div_mul_cancel ha.ne',Real.rpow_one] + have he : D*(ε/(2*D)) = ε/2 := by field_simp + rw [he] + linarith + +lemma rational_clock_nonneg {T v : ℝ} {C F : ℝ → ℝ} + (hT : 0 < T) (hC : ContinuousOn C (Icc 0 T)) (hCs : StrictMonoOn C (Icc 0 T)) + (hC0 : C 0 = 0) (hCT : C T = v) (hF : ContinuousOn F (Icc 0 T)) + (hrat : ∀ q : ℚ, 0 < (q:ℝ) → (q:ℝ) ≤ v → + ∀ s ∈ Icc 0 T, C s = (q:ℝ) → 0 ≤ F s) : + ∀ t ∈ Ioo 0 T, 0 ≤ F t := by + intro t ht + by_contra hn + have hneg : F t < 0 := lt_of_not_ge hn + have hFc : ContinuousAt F t := (hF t ⟨ht.1.le,ht.2.le⟩).continuousAt (Icc_mem_nhds ht.1 ht.2) + have he : ∀ᶠ s in 𝓝 t, F s < 0 := hFc.tendsto.eventually (gt_mem_nhds hneg) + obtain ⟨e,he0,he⟩ := Metric.eventually_nhds_iff.1 he + have hlow : max 0 (t-e) < t := max_lt ht.1 (by linarith) + obtain ⟨a,ha,hat⟩ := exists_between hlow + have ha0 : 0 < a := (le_max_left 0 (t-e)).trans_lt ha + have hae : t-e < a := (le_max_right 0 (t-e)).trans_lt ha + have haq : a ∈ Icc 0 T := ⟨ha0.le,(hat.trans ht.2).le⟩ + obtain ⟨q,hqa,hqt⟩ := exists_rat_btwn (hCs haq ⟨ht.1.le,ht.2.le⟩ hat) + have hq0 : 0 < (q:ℝ) := by + have hc := hCs ⟨le_rfl,hT.le⟩ haq ha0 + rw [hC0] at hc + exact hc.trans hqa + have hqv : (q:ℝ) ≤ v := by + have hc := hCs.monotoneOn ⟨ht.1.le,ht.2.le⟩ ⟨hT.le,le_rfl⟩ ht.2.le + rw [hCT] at hc + exact hqt.le.trans hc + obtain ⟨s,hs,hsq⟩ := intermediate_value_Icc hat.le + (hC.mono (Icc_subset_Icc haq.1 ht.2.le)) ⟨hqa.le,hqt.le⟩ + have hst : s ∈ Icc 0 T := ⟨ha0.le.trans hs.1,hs.2.trans ht.2.le⟩ + have hsn : F s < 0 := he (by + rw [Real.dist_eq,abs_of_nonpos (sub_nonpos.2 hs.2)] + linarith [hs.1]) + exact (not_lt_of_ge (hrat q hq0 hqv s hst hsq)) hsn + +end SLEExactGauge.FiniteClock + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/LoewnerFlow.lean b/lean/OAI/Probability/SLELocalization/LoewnerFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d11f9a718bf97c96f45df84daa6e99c10ff6a5f --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/LoewnerFlow.lean @@ -0,0 +1,1440 @@ +import Mathlib +import OAI.Probability.SLELocalization.StoppedIto +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Loewner Field estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +namespace SLEExactGauge.LoewnerField +open LoewnerCutoff GreenPhysical +open scoped unitInterval +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +lemma height_pos (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : 0 < height hε hT U z t := + hε.trans_le (le_max_left _ _) + +lemma smooth (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + ContDiff ℝ 3 (field hε hT p a sdev U z t) := + contDiff_green_driver p a _ _ _ sdev (height_pos hε hT U z t) + +lemma continuous_field (p a sdev : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => field hε hT p a sdev q.1.1 z q.1.2 q.2) := by + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hL := (continuous_logDerivative hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + apply continuous_green_comp p a + · exact (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd) + · exact continuous_const.max (Complex.continuous_im.comp hH) + · exact hL + · intro q + exact height_pos hε hT q.1.1 z q.1.2 + +lemma continuous_drift (p a sdev : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => drift hε hT p a sdev q.1.1 z q.1.2 q.2) := by + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hD := (continuous_joint_extendDriver T).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hV := (continuous_velocity hε).comp (hD.prodMk hH) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => sdev*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + have hv := (continuous_variation hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + unfold drift + apply (continuous_field hε hT p a sdev z).mul + apply Continuous.sub + · exact (continuous_const.mul hv).add + ((continuous_const.mul (Complex.continuous_im.comp hV)).div hy + (fun q => (height_pos hε hT q.1.1 z q.1.2).ne')) + · exact (continuous_const.mul ((hx.mul (Complex.continuous_re.comp hV)).add + (hy.mul (Complex.continuous_im.comp hV)))).div ((hx.pow 2).add (hy.pow 2)) + (fun q => (q_pos _ (height_pos hε hT q.1.1 z q.1.2)).ne') + +lemma field_upper (p a sdev : ℝ) (hp : 0 ≤ p) (ha : 0 ≤ a) + (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + field hε hT p a sdev U z t b ≤ (2*ε/Real.exp ((2/ε^2)*T))^(-p) := by + apply green_le_fixed_radius p a _ _ _ _ (height_pos hε hT U z t) ha hp (by positivity) + have hL : Real.exp (logDerivative hε hT U z t) ≤ Real.exp ((2/ε^2)*T) := + Real.exp_le_exp.mpr ((le_abs_self _).trans (abs_logDerivative_le hε hT U z t)) + calc + 2*ε / Real.exp ((2/ε^2)*T) ≤ 2*ε / Real.exp (logDerivative hε hT U z t) := + div_le_div_of_nonneg_left (by positivity) (Real.exp_pos _) hL + _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (le_max_left _ _) (by norm_num)) + (Real.exp_pos _).le + +lemma field_third_bound (p a sdev : ℝ) (hp : 0 ≤ p) (ha : 0 ≤ a) + (U : C(I, ℝ)) (z : ℂ) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ t b, |iteratedDeriv 3 (field hε hT p a sdev U z t) b| ≤ K := by + let M := (2*ε/Real.exp ((2/ε^2)*T))^(-p) + refine ⟨|sdev|^3 * (M*(a*(a+2)*(a+4))/ε^3), by positivity, ?_⟩ + intro t b + change |iteratedDeriv 3 (fun b => green p a ((position hε hT U z t).re-sdev*b) + (height hε hT U z t) (logDerivative hε hT U z t)) b| ≤ _ + rw [iteratedDeriv_green_driver p a _ _ _ sdev (height_pos hε hT U z t) 3 b, + abs_mul, abs_pow, abs_neg] + apply mul_le_mul_of_nonneg_left _ (by positivity) + exact third_green_bound hε (le_max_left _ _) ha (field_upper hε hT p a sdev hp ha U z t b) + +lemma time_deriv (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) {t : ℝ} + (ht : t ∈ Ioo 0 T) (hy : ε < (position hε hT U z t).im) (b : ℝ) : + HasDerivAt (fun s => field hε hT p a sdev U z s b) (drift hε hT p a sdev U z t b) t := by + have hH := position_deriv hε hT U z ht + have hL := hasDerivAt_logDerivative hε hT U z ht + have hIm := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t hH + have hRe := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hH + dsimp only [Function.comp_def, Complex.imCLM_apply, Complex.reCLM_apply] at hIm hRe + have hY : HasDerivAt (height hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)).im t := by + apply hIm.congr_of_eventuallyEq + have hc := hIm.continuousAt + filter_upwards [hc.preimage_mem_nhds (Ioi_mem_nhds hy)] with s hs + exact max_eq_right hs.le + exact hasDerivAt_green_path p a (hRe.sub_const (sdev*b)) hY hL (height_pos hε hT U z t) + +lemma second_eq (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + iteratedDeriv 2 (field hε hT p a sdev U z t) b = + sdev^2 * (field hε hT p a sdev U z t b * + (a*(a+1)*((position hε hT U z t).re-sdev*b)^2 - a*(height hε hT U z t)^2) / + (((position hε hT U z t).re-sdev*b)^2+(height hε hT U z t)^2)^2) := by + simp only [iteratedDeriv_succ, iteratedDeriv_zero, field] + exact deriv_deriv_green_driver p a _ _ _ sdev b (height_pos hε hT U z t) + +lemma continuous_second (p a sdev : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => iteratedDeriv 2 (field hε hT p a sdev q.1.1 z q.1.2) q.2) := by + simp only [second_eq] + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => sdev*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + apply continuous_const.mul + apply Continuous.div + · exact (continuous_field hε hT p a sdev z).mul + ((continuous_const.mul (hx.pow 2)).sub (continuous_const.mul (hy.pow 2))) + · exact ((hx.pow 2).add (hy.pow 2)).pow 2 + · exact fun q => pow_ne_zero 2 (q_pos _ (height_pos hε hT q.1.1 z q.1.2)).ne' + +lemma first_eq (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + iteratedDeriv 1 (field hε hT p a sdev U z t) b = + sdev*a*((position hε hT U z t).re-sdev*b) / + (((position hε hT U z t).re-sdev*b)^2+(height hε hT U z t)^2) * + field hε hT p a sdev U z t b := by + simp only [iteratedDeriv_succ, iteratedDeriv_zero, field] + exact deriv_green_driver p a _ _ _ sdev b (height_pos hε hT U z t) + +lemma continuous_first (p a sdev : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => iteratedDeriv 1 (field hε hT p a sdev q.1.1 z q.1.2) q.2) := by + simp only [first_eq] + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => sdev*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + exact ((continuous_const.mul hx).div ((hx.pow 2).add (hy.pow 2)) + (fun q => (q_pos _ (height_pos hε hT q.1.1 z q.1.2)).ne')).mul + (continuous_field hε hT p a sdev z) + +lemma first_bound (p a sdev : ℝ) (hp : 0 ≤ p) (ha : 0 ≤ a) + (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + |iteratedDeriv 1 (field hε hT p a sdev U z t) b| ≤ + |sdev| * ((2*ε/Real.exp ((2/ε^2)*T))^(-p)*a/ε) := by + change |iteratedDeriv 1 (fun b => green p a ((position hε hT U z t).re-sdev*b) + (height hε hT U z t) (logDerivative hε hT U z t)) b| ≤ _ + rw [iteratedDeriv_green_driver p a _ _ _ sdev (height_pos hε hT U z t) 1 b, + abs_mul, abs_pow, abs_neg, pow_one] + simp only [iteratedDeriv_succ, iteratedDeriv_zero] + exact mul_le_mul_of_nonneg_left + (first_green_bound hε (le_max_left _ _) ha (field_upper hε hT p a sdev hp ha U z t b)) + (abs_nonneg _) + +lemma second_bound (p a sdev : ℝ) (hp : 0 ≤ p) (ha : 0 ≤ a) + (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + |iteratedDeriv 2 (field hε hT p a sdev U z t) b| ≤ + |sdev|^2 * ((2*ε/Real.exp ((2/ε^2)*T))^(-p)*(a*(a+2))/ε^2) := by + change |iteratedDeriv 2 (fun b => green p a ((position hε hT U z t).re-sdev*b) + (height hε hT U z t) (logDerivative hε hT U z t)) b| ≤ _ + rw [iteratedDeriv_green_driver p a _ _ _ sdev (height_pos hε hT U z t) 2 b, + abs_mul, abs_pow, abs_neg] + exact mul_le_mul_of_nonneg_left + (second_green_bound hε (le_max_left _ _) ha (field_upper hε hT p a sdev hp ha U z t b)) + (by positivity) + +lemma variation_of_unclipped (U : C(I, ℝ)) (z : ℂ) (t : ℝ) + (hy : ε ≤ (position hε hT U z t).im) : + variation hε hT U z t = + -2 * (((position hε hT U z t).re - extendDriver T U t)^2 - (position hε hT U z t).im^2) / + (((position hε hT U z t).re - extendDriver T U t)^2 + (position hε hT U z t).im^2)^2 := by + unfold variation + rw [clampIm_eq (by simpa using hy)] + simp only [Complex.div_re, Complex.neg_re, Complex.re_ofNat, Complex.neg_im, + Complex.im_ofNat, neg_zero, zero_mul, map_pow] + simp only [pow_two, Complex.mul_re, Complex.sub_re, Complex.ofReal_re, + Complex.sub_im, Complex.ofReal_im, sub_zero, Complex.normSq_apply] + ring + +lemma drift_cancellation (κ : ℝ) (hκ : 0 < κ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) + (hy : ε ≤ (position hε hT U z t).im) + (hU : extendDriver T U t = Real.sqrt κ * b) : + drift hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t b + + (1/2 : ℝ) * iteratedDeriv 2 (field hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) b = 0 := by + have hypos := hε.trans_le hy + have hh : height hε hT U z t = (position hε hT U z t).im := max_eq_right hy + rw [second_eq, Real.sq_sqrt hκ.le] + dsimp only [drift] + rw [variation_of_unclipped hε hT U z t hy, velocity_eq hy, + hh, hU] + have hc := green_drift_cancellation κ + ((position hε hT U z t).re-Real.sqrt κ*b) (position hε hT U z t).im + (field hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t b) hκ.ne' hypos + dsimp only at hc + simp only [Complex.div_re, Complex.div_im, Complex.re_ofNat, Complex.im_ofNat, + Complex.sub_re, Complex.ofReal_re, Complex.sub_im, Complex.ofReal_im, + sub_zero, zero_mul, Complex.normSq_apply] at * + convert hc using 1 + ring + +end SLEExactGauge.LoewnerField + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +namespace SLEExactGauge.LoewnerField +open LoewnerCutoff +open scoped unitInterval + +lemma field_prefix_eq {ε S T : ℝ} (hε : 0 < ε) (hS : 0 ≤ S) (hT : 0 ≤ T) + (hST : S ≤ T) (U V : C(I, ℝ)) (z : ℂ) (p a sdev : ℝ) + (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) + {t : ℝ} (ht : t ∈ Icc 0 S) : + field hε hS p a sdev U z t = field hε hT p a sdev V z t := by + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V z hUV ht + have hL := logDerivative_prefix_eq hε hS hT hS le_rfl hST U V z hUV ht + funext b + simp only [field, height, hH, hL] + +end SLEExactGauge.LoewnerField + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.ContinuousExit + +def extend (p : C(I, ℝ)) (t : ℝ) : ℝ := p (projIcc 0 1 zero_le_one t) + +lemma continuous_extend (p : C(I, ℝ)) : Continuous (extend p) := + p.continuous.comp (continuous_projIcc (a := (0:ℝ)) (b := 1) (h := zero_le_one)) + +lemma extend_coe (p : C(I, ℝ)) (t : I) : extend p t = p t := by + simp only [extend, projIcc, max_eq_right t.property.1, min_eq_right t.property.2] + +def exitSet (p : C(I, ℝ)) : Set ℝ := insert 1 (Icc 0 1 ∩ {t | extend p t ≤ 0}) + +def time (p : C(I, ℝ)) : ℝ := sInf (exitSet p) + +lemma exitSet_nonempty (p : C(I, ℝ)) : (exitSet p).Nonempty := ⟨1, mem_insert _ _⟩ + +lemma exitSet_subset (p : C(I, ℝ)) : exitSet p ⊆ Icc 0 1 := by + rintro t (rfl | ht) + · exact ⟨zero_le_one,le_rfl⟩ + · exact ht.1 + +lemma compact_exitSet (p : C(I, ℝ)) : IsCompact (exitSet p) := by + exact (isCompact_Icc.inter_right (isClosed_le (continuous_extend p) continuous_const)).insert 1 + +lemma time_mem (p : C(I, ℝ)) : time p ∈ exitSet p := + (compact_exitSet p).sInf_mem (exitSet_nonempty p) + +lemma time_bounds (p : C(I, ℝ)) : time p ∈ Icc 0 1 := exitSet_subset p (time_mem p) + +lemma time_le_of_nonpos {p : C(I, ℝ)} {t : ℝ} (ht : t ∈ Icc 0 1) (hp : extend p t ≤ 0) : + time p ≤ t := csInf_le ((compact_exitSet p).bddBelow) (mem_insert_of_mem 1 ⟨ht,hp⟩) + +lemma positive_before {p : C(I, ℝ)} {t : ℝ} (ht : 0 ≤ t) (hτ : t < time p) : + 0 < extend p t := by + by_contra hn + exact (not_le_of_gt hτ) (time_le_of_nonpos ⟨ht,hτ.le.trans (time_bounds p).2⟩ (not_lt.1 hn)) + +lemma nonpos_at_of_lt_one {p : C(I, ℝ)} (hτ : time p < 1) : extend p (time p) ≤ 0 := by + rcases time_mem p with h | h + · exact (ne_of_lt hτ h).elim + · exact h.2 + +lemma lt_time_iff {p : C(I, ℝ)} {t : ℝ} (ht : t ∈ Ico 0 1) : + t < time p ↔ ∀ s ∈ Icc 0 t, 0 < extend p s := by + constructor + · intro h s hs + exact positive_before hs.1 (hs.2.trans_lt h) + · intro h + by_contra hn + have hτ : time p ≤ t := not_lt.1 hn + have hp := h (time p) ⟨(time_bounds p).1,hτ⟩ + exact (not_lt_of_ge (nonpos_at_of_lt_one (hτ.trans_lt ht.2))) hp + +lemma isOpen_positive_on (t : ℝ) : + IsOpen {p : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < extend p s} := by + let S : Set (C(I, ℝ) × Icc 0 t) := {q | extend q.1 q.2 ≤ 0} + have hc : IsClosed S := by + apply isClosed_le ?_ continuous_const + exact continuous_eval.comp (continuous_fst.prodMk + ((continuous_projIcc (a := (0:ℝ)) (b := 1) (h := zero_le_one)).comp (continuous_subtype_val.comp continuous_snd))) + have hh := isClosedMap_fst_of_compactSpace S hc + have he : {p : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < extend p s} = (Prod.fst '' S)ᶜ := by + ext p + simp only [mem_ofPred_eq, mem_compl_iff, mem_image, S, not_exists, not_and] + constructor + · intro hp q hq hqp + subst p + exact (not_lt_of_ge hq) (hp q.2 q.2.property) + · intro hp s hs + by_contra hn + exact hp (p,⟨s,hs⟩) (not_lt.1 hn) rfl + rw [he] + exact hh.isOpen_compl + +lemma measurable_time : @Measurable C(I, ℝ) ℝ (borel _) _ time := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + apply measurable_of_Ioi + intro t + by_cases h0 : t < 0 + · have he : time ⁻¹' Ioi t = univ := by + ext p + simp only [mem_preimage, mem_Ioi, mem_univ, iff_true] + exact h0.trans_le (time_bounds p).1 + rw [he] + exact MeasurableSet.univ + by_cases h1 : 1 ≤ t + · have he : time ⁻¹' Ioi t = ∅ := by + ext p + simp only [mem_preimage, mem_Ioi, mem_empty_iff_false, iff_false] + exact not_lt_of_ge ((time_bounds p).2.trans h1) + rw [he] + exact MeasurableSet.empty + have he : time ⁻¹' Ioi t = {p : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < extend p s} := by + ext p + exact lt_time_iff ⟨not_lt.1 h0,not_le.1 h1⟩ + rw [he] + exact (isOpen_positive_on t).measurableSet + +lemma time_pos {p : C(I, ℝ)} (h0 : 0 < extend p 0) : 0 < time p := by + apply (lt_time_iff (p := p) (t := 0) ⟨le_rfl, zero_lt_one⟩).2 + intro s hs + have hs0 : s = 0 := le_antisymm hs.2 hs.1 + simpa only [hs0] using h0 + +lemma nonneg_until {p : C(I, ℝ)} (h0 : 0 < extend p 0) {t : ℝ} + (ht : t ∈ Icc 0 (time p)) : 0 ≤ extend p t := by + rcases lt_or_eq_of_le ht.2 with hlt | rfl + · exact (positive_before ht.1 hlt).le + have htend : Tendsto (extend p) (𝓝[<] time p) (𝓝 (extend p (time p))) := + (continuous_extend p).continuousAt.tendsto.mono_left nhdsWithin_le_nhds + apply ge_of_tendsto htend + filter_upwards [Ioo_mem_nhdsLT (time_pos h0)] with s hs + exact (positive_before hs.1.le hs.2).le + +lemma eq_zero_at_of_lt_one {p : C(I, ℝ)} (h0 : 0 < extend p 0) + (hτ : time p < 1) : extend p (time p) = 0 := + le_antisymm (nonpos_at_of_lt_one hτ) (nonneg_until h0 ⟨(time_bounds p).1, le_rfl⟩) + +end SLEExactGauge.ContinuousExit + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerExit +open LoewnerCutoff +open scoped unitInterval +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +def radius (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + 2*(position hε hT U z t).im / Real.exp (logDerivative hε hT U z t) + +def sine (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + (position hε hT U z t).im / + ‖clampIm ε (position hε hT U z t - (extendDriver T U t : ℂ))‖ + +def deficit (U : C(I, ℝ)) (z : ℂ) (ρ δ t : ℝ) : ℝ := + min (radius hε hT U z t - ρ) + (min ((position hε hT U z t).im-ε) (sine hε hT U z t-δ)) + +lemma continuous_radius (z : ℂ) : + Continuous (fun q : C(I, ℝ) × ℝ => radius hε hT q.1 z q.2) := by + exact (continuous_const.mul (Complex.continuous_im.comp (continuous_position hε hT z))).div + (Real.continuous_exp.comp (continuous_logDerivative hε hT z)) (fun _ => Real.exp_ne_zero _) + +lemma continuous_sine (z : ℂ) : + Continuous (fun q : C(I, ℝ) × ℝ => sine hε hT q.1 z q.2) := by + exact (Complex.continuous_im.comp (continuous_position hε hT z)).div + (((continuous_clampIm ε).comp ((continuous_position hε hT z).sub + (Complex.continuous_ofReal.comp (continuous_joint_extendDriver T)))).norm) + (fun _ => norm_ne_zero_iff.2 (clampIm_ne_zero hε _)) + +lemma continuous_deficit (z : ℂ) (ρ δ : ℝ) : + Continuous (fun q : C(I, ℝ) × ℝ => deficit hε hT q.1 z ρ δ q.2) := + ((continuous_radius hε hT z).sub continuous_const).min + (((Complex.continuous_im.comp (continuous_position hε hT z)).sub continuous_const).min + ((continuous_sine hε hT z).sub continuous_const)) + +lemma deficit_pos_iff (U : C(I, ℝ)) (z : ℂ) (ρ δ t : ℝ) : + 0 < deficit hε hT U z ρ δ t ↔ + ρ < radius hε hT U z t ∧ ε < (position hε hT U z t).im ∧ δ < sine hε hT U z t := by + simp only [deficit, lt_min_iff, sub_pos] + +lemma deficit_nonneg_iff (U : C(I, ℝ)) (z : ℂ) (ρ δ t : ℝ) : + 0 ≤ deficit hε hT U z ρ δ t ↔ + ρ ≤ radius hε hT U z t ∧ ε ≤ (position hε hT U z t).im ∧ δ ≤ sine hε hT U z t := by + simp only [deficit, le_min_iff, sub_nonneg] + +def exitPath (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) : C(I, ℝ) := by + refine ⟨fun q => deficit hε hT U z ρ δ (T*q), ?_⟩ + have hp : Continuous (fun q : I => (U,T*q)) := + continuous_const.prodMk (continuous_const.mul continuous_subtype_val) + have hc := (continuous_deficit hε hT z ρ δ).comp hp + dsimp only [Function.comp_def] at hc + exact hc + +def stop (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) : ℝ := + T * ContinuousExit.time (exitPath hε hT U z ρ δ) + +lemma stop_bounds (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) : + stop hε hT U z ρ δ ∈ Icc 0 T := by + have hh := ContinuousExit.time_bounds (exitPath hε hT U z ρ δ) + exact ⟨mul_nonneg hT hh.1, by simpa only [stop, mul_one] using mul_le_mul_of_nonneg_left hh.2 hT⟩ + +lemma exitPath_extend (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) {t : ℝ} (ht : t ∈ Icc 0 1) : + ContinuousExit.extend (exitPath hε hT U z ρ δ) t = deficit hε hT U z ρ δ (T*t) := by + simpa only [exitPath, ContinuousMap.coe_mk] using ContinuousExit.extend_coe + (exitPath hε hT U z ρ δ) (⟨t,ht⟩ : I) + +lemma exitPath_extend_div (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + {t : ℝ} (ht : t ∈ Icc 0 T) : + ContinuousExit.extend (exitPath hε hT U z ρ δ) (t/T) = deficit hε hT U z ρ δ t := by + rw [exitPath_extend hε hT U z ρ δ + ⟨div_nonneg ht.1 hT, (div_le_one hTp).2 ht.2⟩, mul_div_cancel₀ _ hTp.ne'] + +lemma positive_before (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + {t : ℝ} (ht : 0 ≤ t) (htτ : t < stop hε hT U z ρ δ) : + 0 < deficit hε hT U z ρ δ t := by + rw [← exitPath_extend_div hε hT hTp U z ρ δ ⟨ht,htτ.le.trans (stop_bounds hε hT U z ρ δ).2⟩] + apply ContinuousExit.positive_before (div_nonneg ht hT) + exact (div_lt_iff₀ hTp).2 (by simpa only [stop, mul_comm] using htτ) + +lemma stop_pos (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (h0 : 0 < deficit hε hT U z ρ δ 0) : 0 < stop hε hT U z ρ δ := by + apply mul_pos hTp (ContinuousExit.time_pos _) + simpa only [exitPath_extend hε hT U z ρ δ ⟨le_rfl,zero_le_one⟩, mul_zero] using h0 + +lemma nonneg_until (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (h0 : 0 < deficit hε hT U z ρ δ 0) {t : ℝ} + (ht : t ∈ Icc 0 (stop hε hT U z ρ δ)) : 0 ≤ deficit hε hT U z ρ δ t := by + rw [← exitPath_extend_div hε hT hTp U z ρ δ ⟨ht.1,ht.2.trans (stop_bounds hε hT U z ρ δ).2⟩] + apply ContinuousExit.nonneg_until + · simpa only [exitPath_extend hε hT U z ρ δ ⟨le_rfl,zero_le_one⟩, mul_zero] using h0 + · exact ⟨div_nonneg ht.1 hT, (div_le_iff₀ hTp).2 (by simpa only [stop, mul_comm] using ht.2)⟩ + +lemma nonpos_at_of_lt (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hτ : stop hε hT U z ρ δ < T) : + deficit hε hT U z ρ δ (stop hε hT U z ρ δ) ≤ 0 := by + have hs : ContinuousExit.time (exitPath hε hT U z ρ δ) < 1 := by + apply (mul_lt_mul_iff_right₀ hTp).mp + simpa only [mul_one, stop] using hτ + exact (exitPath_extend hε hT U z ρ δ (ContinuousExit.time_bounds _)) ▸ + ContinuousExit.nonpos_at_of_lt_one hs + +lemma lt_stop_iff (hTp : 0 < T) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + {t : ℝ} (ht : t ∈ Ico 0 T) : + t < stop hε hT U z ρ δ ↔ ∀ s ∈ Icc 0 t, 0 < deficit hε hT U z ρ δ s := by + constructor + · intro hh s hs + exact positive_before hε hT hTp U z ρ δ hs.1 (hs.2.trans_lt hh) + · intro hh + change t < T * ContinuousExit.time (exitPath hε hT U z ρ δ) + rw [mul_comm] + apply (div_lt_iff₀ hTp).1 + apply (ContinuousExit.lt_time_iff (p := exitPath hε hT U z ρ δ) + ⟨div_nonneg ht.1 hT, (div_lt_one hTp).2 ht.2⟩).2 + intro s hs + rw [exitPath_extend hε hT U z ρ δ + ⟨hs.1, hs.2.trans ((div_le_one hTp).2 ht.2.le)⟩] + apply hh + exact ⟨mul_nonneg hT hs.1, (mul_le_mul_of_nonneg_left hs.2 hT).trans_eq + (mul_div_cancel₀ _ hTp.ne')⟩ + +lemma isOpen_positive_on (z : ℂ) (ρ δ t : ℝ) : + IsOpen {U : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < deficit hε hT U z ρ δ s} := by + let S : Set (C(I, ℝ) × Icc 0 t) := {q | deficit hε hT q.1 z ρ δ q.2 ≤ 0} + have hmap : Continuous (fun q : C(I, ℝ) × Icc 0 t => (q.1,(q.2:ℝ))) := + continuous_fst.prodMk (continuous_subtype_val.comp continuous_snd) + have hd := (continuous_deficit hε hT z ρ δ).comp hmap + dsimp only [Function.comp_def] at hd + have hc : IsClosed S := isClosed_le hd continuous_const + have hh := isClosedMap_fst_of_compactSpace S hc + have he : {U : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < deficit hε hT U z ρ δ s} = (Prod.fst '' S)ᶜ := by + ext U + simp only [mem_ofPred_eq, mem_compl_iff, mem_image, S, not_exists, not_and] + constructor + · intro hp q hq hqp + subst U + exact (not_lt_of_ge hq) (hp q.2 q.2.property) + · intro hp s hs + by_contra hn + exact hp (U,⟨s,hs⟩) (not_lt.1 hn) rfl + rw [he] + exact hh.isOpen_compl + +end SLEExactGauge.LoewnerExit + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerExit +open LoewnerCutoff +open scoped unitInterval + +lemma deficit_prefix_eq {ε S T : ℝ} (hε : 0 < ε) (hS : 0 ≤ S) (hT : 0 ≤ T) + (hST : S ≤ T) (U V : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) : + EqOn (deficit hε hS U z ρ δ) (deficit hε hT V z ρ δ) (Icc 0 S) := by + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V z hUV + have hL := logDerivative_prefix_eq hε hS hT hS le_rfl hST U V z hUV + intro t ht + simp only [deficit, radius, sine, hH ht, hL ht, hUV ht] + +end SLEExactGauge.LoewnerExit + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit BrownianField +open scoped unitInterval + +lemma regular {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) (p a sdev : ℝ) + (hp : 0 ≤ p) (ha : 0 ≤ a) (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) + (b : ℝ → ℝ) (hb : Continuous b) : + FieldRegular (field hε hT.le p a sdev U z) (drift hε hT.le p a sdev U z) b + (stop hε hT.le U z ρ δ) := by + constructor + · exact smooth hε hT.le p a sdev U z + · exact field_third_bound hε hT.le p a sdev hp ha U z + · intro x + have hm : Continuous (fun t : ℝ => ((U,t),x)) := + (continuous_const.prodMk continuous_id).prodMk continuous_const + have hc := (continuous_field hε hT.le p a sdev z).comp hm + exact hc.continuousOn + · intro t ht x + have htT : t ∈ Ioo 0 T := ⟨ht.1,ht.2.trans_le (stop_bounds hε hT.le U z ρ δ).2⟩ + have hh := (deficit_pos_iff hε hT.le U z ρ δ t).1 + (positive_before hε hT.le hT U z ρ δ ht.1.le ht.2) + exact time_deriv hε hT.le p a sdev U z htT hh.2.1 x + · have hm : Continuous (fun q : ℝ × ℝ => ((U,q.1),b q.2)) := + (continuous_const.prodMk continuous_fst).prodMk (hb.comp continuous_snd) + have hc := (continuous_drift hε hT.le p a sdev z).comp hm + exact hc.continuousOn + · have hm : Continuous (fun t : ℝ => ((U,t),b t)) := + (continuous_const.prodMk continuous_id).prodMk hb + have hc := (continuous_second hε hT.le p a sdev z).comp hm + exact hc.continuousOn + +lemma integral_drift_cancel {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) (κ : ℝ) (hκ : 0 < κ) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) (b : ℝ → ℝ) + (hU : ∀ s ∈ Icc 0 T, extendDriver T U s = Real.sqrt κ * b s) : + (∫ t in (0:ℝ)..(stop hε hT.le U z ρ δ), drift hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t (b t)) + + (1/2 : ℝ)*∫ t in (0:ℝ)..(stop hε hT.le U z ρ δ), + iteratedDeriv 2 (field hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (b t) = 0 := by + have he : (∫ t in (0:ℝ)..(stop hε hT.le U z ρ δ), drift hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t (b t)) = + ∫ t in (0:ℝ)..(stop hε hT.le U z ρ δ), + -(1/2 : ℝ)*iteratedDeriv 2 (field hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (b t) := by + apply intervalIntegral.integral_congr_Ioo_of_le (stop_bounds hε hT.le U z ρ δ).1 + intro t ht + have htT : t ∈ Icc 0 T := ⟨ht.1.le,ht.2.le.trans (stop_bounds hε hT.le U z ρ δ).2⟩ + have hh := (deficit_pos_iff hε hT.le U z ρ δ t).1 + (positive_before hε hT.le hT U z ρ δ ht.1.le ht.2) + have hc := drift_cancellation hε hT.le κ hκ U z t (b t) hh.2.1.le (hU t htT) + linarith + rw [he, intervalIntegral.integral_const_mul] + ring + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.ContinuousDriver + +lemma aemeasurable_selectedLimit {Ω Y : Type*} [MeasurableSpace Ω] + [MetricSpace Y] [CompleteSpace Y] [MeasurableSpace Y] [BorelSpace Y] + [SecondCountableTopology Y] {P : Measure Ω} + (y₀ : Y) (a : ℕ → Ω → Y) (ha : ∀ n, AEMeasurable (a n) P) : + AEMeasurable (fun sample => selectedLimit y₀ (fun n => a n sample)) P := by + have hm : Measurable (fun a : ℕ → Y => selectedLimit y₀ a) := + measurable_selectedLimit y₀ (fun (n : ℕ) (a : ℕ → Y) => a n) (fun n => measurable_pi_apply n) + exact hm.comp_aemeasurable (AEMeasurable.of_eval ha) + +lemma aemeasurable_path {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (x : Ω → I → ℝ) (hx : ∀ t, AEMeasurable (fun sample => x sample t) P) : + @AEMeasurable Ω C(I, ℝ) (borel C(I, ℝ)) _ (fun sample => path (x sample)) P := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + apply aemeasurable_selectedLimit + intro n + apply Finset.aemeasurable_fun_sum + intro k _ + exact (hx (bernstein.z k)).smul aemeasurable_const + +end SLEExactGauge.ContinuousDriver + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.BrownianDriver +open BrownianPredictable LoewnerCutoff +open scoped unitInterval + +def path {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (sdev : ℝ) (T : ℝ≥0) (sample : Ω) : C(I, ℝ) := + ContinuousDriver.path (fun q : I => sdev * B ((T:ℝ)*q).toNNReal sample) + +lemma path_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (sdev : ℝ) (T : ℝ≥0) : + @Measurable Ω C(I, ℝ) (pastSigma B T) (borel C(I, ℝ)) (path B sdev T) := by + let : MeasurableSpace Ω := pastSigma B T + apply ContinuousDriver.measurable_path + intro q + apply Measurable.const_mul + apply past_measurable_eval + have hh : (T:ℝ)*q ≤ T := by + simpa only [mul_one] using mul_le_mul_of_nonneg_left q.property.2 T.coe_nonneg + exact (Real.toNNReal_le_toNNReal hh).trans_eq Real.toNNReal_coe + +lemma path_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (sdev : ℝ) (T : ℝ≥0) : + @AEMeasurable Ω C(I, ℝ) (borel C(I, ℝ)) _ (path B sdev T) P := by + apply ContinuousDriver.aemeasurable_path + intro q + exact ((hB.toIsPreBrownianReal.hasLaw_eval _).aemeasurable).const_mul sdev + +lemma path_eval {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (sdev : ℝ) (T : ℝ≥0) (sample : Ω) + (hc : Continuous (fun t => B t sample)) (q : I) : + path B sdev T sample q = sdev * B ((T:ℝ)*q).toNNReal sample := by + apply ContinuousDriver.path_eval_of_continuous + exact continuous_const.mul (hc.comp (continuous_real_toNNReal.comp + (continuous_const.mul continuous_subtype_val))) + +lemma extend_eq {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (sdev : ℝ) (T : ℝ≥0) (sample : Ω) + (hc : Continuous (fun t => B t sample)) {t : ℝ} (ht : t ∈ Icc 0 (T:ℝ)) : + extendDriver T (path B sdev T sample) t = sdev * B t.toNNReal sample := by + rw [extendDriver, path_eval B sdev T sample hc] + by_cases hT : (T:ℝ) = 0 + · have ht0 : t = 0 := le_antisymm (hT ▸ ht.2) ht.1 + simp only [hT, ht0, zero_mul] + · have hTp : 0 < (T:ℝ) := lt_of_le_of_ne T.coe_nonneg (Ne.symm hT) + rw [projIcc_of_mem zero_le_one ⟨div_nonneg ht.1 T.coe_nonneg, (div_le_one hTp).2 ht.2⟩, + mul_div_cancel₀ _ hT] + +lemma prefix_eq {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (sdev : ℝ) (S T : ℝ≥0) (sample : Ω) + (hc : Continuous (fun t => B t sample)) (hST : S ≤ T) : + EqOn (extendDriver S (path B sdev S sample)) (extendDriver T (path B sdev T sample)) (Icc 0 (S:ℝ)) := by + intro t ht + rw [extend_eq B sdev S sample hc ht, extend_eq B sdev T sample hc ⟨ht.1,ht.2.trans hST⟩] + +end SLEExactGauge.BrownianDriver + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +open scoped unitInterval +variable {ε : ℝ} (hε : 0 < ε) + +def coeffAt (k : ℕ) (s : ℝ≥0) (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) + (q : C(I, ℝ) × ℝ) : ℝ := by + classical + exact if ∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg q.1 z ρ δ t then + iteratedDeriv k (field hε s.coe_nonneg p a sdev q.1 z s) q.2 else 0 + +lemma coeffAt_measurable (k : ℕ) (hk : k = 1 ∨ k = 2) (s : ℝ≥0) + (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + @Measurable (C(I, ℝ) × ℝ) ℝ (@Prod.instMeasurableSpace _ _ (borel _) inferInstance) _ (coeffAt hε k s p a sdev z ρ δ) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hc : Continuous (fun q : C(I, ℝ) × ℝ => + iteratedDeriv k (field hε s.coe_nonneg p a sdev q.1 z s) q.2) := by + have hp : Continuous (fun q : C(I, ℝ) × ℝ => ((q.1,(s:ℝ)),q.2)) := + (continuous_fst.prodMk continuous_const).prodMk continuous_snd + rcases hk with rfl | rfl + · have hc := (continuous_first hε s.coe_nonneg p a sdev z).comp hp + dsimp only [Function.comp_def] at hc + exact hc + · have hc := (continuous_second hε s.coe_nonneg p a sdev z).comp hp + dsimp only [Function.comp_def] at hc + exact hc + apply hc.measurable.ite _ measurable_const + exact ((isOpen_positive_on hε s.coe_nonneg z ρ δ s).preimage continuous_fst).measurableSet + +def rawCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) : ℝ := + if s < T then coeffAt hε k s p a sdev z ρ δ (BrownianDriver.path B sdev s sample, B s sample) else 0 + +lemma rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k = 1 ∨ k = 2) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + Measurable[pastSigma B s] (rawCoeff hε k B T s p a sdev z ρ δ) := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s p a sdev z ρ δ).comp + ((BrownianDriver.path_measurable_past B sdev s).prodMk (past_measurable_eval B (s := s) le_rfl)) + · exact measurable_const + +lemma rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k = 1 ∨ k = 2) (T s : ℝ≥0) + (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) : + AEMeasurable (rawCoeff hε k B T s p a sdev z ρ δ) P := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s p a sdev z ρ δ).comp_aemeasurable + ((BrownianDriver.path_aemeasurable hB sdev s).prodMk (hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable) + · exact aemeasurable_const + +lemma rawCoeff_eq {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (hT : 0 < (T:ℝ)) (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + rawCoeff hε k B T s p a sdev z ρ δ sample = + if (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ then + iteratedDeriv k (field hε T.coe_nonneg p a sdev (BrownianDriver.path B sdev T sample) z s) (B s sample) else 0 := by + classical + by_cases hsT : s < T + · have he := BrownianDriver.prefix_eq B sdev s T sample hc hsT.le + have hf := field_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z p a sdev he + ⟨s.coe_nonneg, le_rfl⟩ + have hd := deficit_prefix_eq hε s.coe_nonneg T.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) z ρ δ he + have hi : (∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg (BrownianDriver.path B sdev s sample) z ρ δ t) ↔ + (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := by + rw [lt_stop_iff hε T.coe_nonneg hT _ z ρ δ ⟨s.coe_nonneg,hsT⟩] + exact forall₂_congr (fun t ht => by rw [hd ht]) + simp only [rawCoeff, ite_eq_left hsT, coeffAt, hi, hf] + · have hstop : ¬ (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ := + not_lt_of_ge ((stop_bounds hε T.coe_nonneg _ z ρ δ).2.trans (not_lt.1 hsT)) + simp only [rawCoeff, ite_eq_right hsT, ite_eq_right hstop] + +lemma rawCoeff_stoppedCoeff_ae {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (T : ℝ≥0) + (hT : 0 < (T:ℝ)) (p a sdev : ℝ) (z : ℂ) (ρ δ : ℝ) (n i : ℕ) : + rawCoeff hε k B T (dyadicTime T n i) p a sdev z ρ δ =ᵐ[P] + stoppedCoeff k B T + (fun sample => stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) z ρ δ) + (fun sample => field hε T.coe_nonneg p a sdev (BrownianDriver.path B sdev T sample) z) n i := by + filter_upwards [hB.cont] with sample hc + rw [rawCoeff_eq hε k B T _ hT p a sdev z ρ δ sample hc] + simp only [stoppedCoeff, coe_dyadicTime] + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +open scoped unitInterval + +lemma coeff_uniform_bound {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (k : ℕ) (hk : k = 1 ∨ k = 2) (p a sdev : ℝ) (hp : 0 ≤ p) (ha : 0 ≤ a) + (z : ℂ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ (U : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε hT p a sdev U z t) b| ≤ K := by + rcases hk with rfl | rfl + · refine ⟨max 0 (|sdev| * ((2*ε/Real.exp ((2/ε^2)*T))^(-p)*a/ε)), le_max_left _ _, ?_⟩ + intro U t b + exact (first_bound hε hT p a sdev hp ha U z t b).trans (le_max_right _ _) + · refine ⟨max 0 (|sdev|^2 * ((2*ε/Real.exp ((2/ε^2)*T))^(-p)*(a*(a+2))/ε^2)), le_max_left _ _, ?_⟩ + intro U t b + exact (second_bound hε hT p a sdev hp ha U z t b).trans (le_max_right _ _) + +theorem localized_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (ρ δ : ℝ) : + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + Integrable (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample)) P ∧ + (∫ sample, F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) ∂P) = 0 := by + dsimp only + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + let V := fun sample => drift hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact regular hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha (U sample) z ρ δ _ + (hc.comp continuous_real_toNNReal) + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => stop_bounds hε T.coe_nonneg (U sample) z ρ δ) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg 2 (Or.inr rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) W z t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => rawCoeff hε 1 B T (dyadicTime T n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ + let C := fun n i => rawCoeff hε 2 B T (dyadicTime T n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 1 T hT (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ n i + have hCe (n i : ℕ) : C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 2 T hT (1-κ/8) (8/κ-1) (Real.sqrt κ) z ρ δ n i + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + rawCoeff_measurable_past hε 1 (Or.inl rfl) B T _ _ _ _ z ρ δ + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (C n i) := + rawCoeff_measurable_past hε 2 (Or.inr rfl) B T _ _ _ _ z ρ δ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 1 (Or.inl rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (C n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 2 (Or.inr rfl) T _ _ _ _ z ρ δ).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |C n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_field_ito_centered_ae hB T τ F V htau hreg A C hAe hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) hAm hA2 K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + have he : (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample)) =ᵐ[P] + (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample)) := by + filter_upwards [hB.cont] with sample hc + have hcanc := integral_drift_cancel hε hT κ hκ.1 (U sample) z ρ δ + (fun t => B t.toNNReal sample) (fun t ht => BrownianDriver.extend_eq B _ T sample hc ht) + dsimp only [F,V,τ] + linarith + exact ⟨hi.1.congr he, (integral_congr_ae he).symm.trans hi.2⟩ + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit GreenPhysical +open scoped unitInterval + +lemma field_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (hy : ε ≤ z.im) : + field hε hT p a sdev U z 0 0 = green p a z.re z.im 0 := by + simp only [field, height, position_initial, logDerivative_initial, mul_zero, sub_zero, + max_eq_right hy] + +theorem localized_expectation {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (hy : ε ≤ z.im) (ρ δ : ℝ) : + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let M := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + (τ sample) (B (τ sample).toNNReal sample) + Integrable M P ∧ (∫ sample, M sample ∂P) = green (1-κ/8) (8/κ-1) z.re z.im 0 := by + dsimp only + let U := BrownianDriver.path B (Real.sqrt κ) T + let τ := fun sample => stop hε T.coe_nonneg (U sample) z ρ δ + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + let M := fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) + let G := green (1-κ/8) (8/κ-1) z.re z.im 0 + have hi := localized_centered hB κ hκ hε T hT z ρ δ + have he : (fun sample => M sample - F sample 0 (B 0 sample)) =ᵐ[P] + (fun sample => M sample - G) := by + filter_upwards [hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hb + rw [hb] + congr 1 + exact field_initial hε T.coe_nonneg _ _ _ _ z hy + have hd : Integrable (fun sample => M sample-G) P := hi.1.congr he + have hv : (∫ sample, M sample-G ∂P) = 0 := (integral_congr_ae he).symm.trans hi.2 + have hm : Integrable M P := by + exact (hd.add (integrable_const G)).congr + (Filter.Eventually.of_forall (fun sample => sub_add_cancel (M sample) G)) + refine ⟨hm, ?_⟩ + have hh := integral_sub hm (integrable_const (μ := P) G) + simp only [integral_const, Measure.real, measure_univ, ENNReal.toReal_one, one_smul] at hh + rw [hh] at hv + change (∫ sample, M sample ∂P) = G + linarith + +end SLEExactGauge.LoewnerLocalized + +end + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +noncomputable section +open Set Filter MeasureTheory +open scoped Topology unitInterval +namespace SLEExactGauge.IsLoewnerTraceUsing +open LoewnerCutoff + +lemma cutoff_solution_live {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, + HasDerivWithinAt H (velocity ε (driver t) (H t)) (Icc 0 T) t) + (hheight : ∀ t ∈ Icc 0 T, ε ≤ (H t).im) : + H 0 ∈ localizationDomain γ T ∧ EqOn (fun t => g t (H 0)) H (Icc 0 T) := by + have hp : H T ∈ halfPlane := hε.trans_le (hheight T ⟨hT, le_rfl⟩) + let z' := f T (H T) + have hz' : z' ∈ localizationDomain γ T := h.2.2.2.2.2.2.2.2.1 T hT hp + have hfinal : g T z' = H T := h.2.2.2.2.2.2.2.2.2.2.1 T hT _ hp + have hht (t : ℝ) (ht : t ∈ Icc 0 T) : ε ≤ (g t z').im := by + have ha := h.height_antitone hT hz' ht ⟨hT, le_rfl⟩ ht.2 + dsimp only at ha + rw [hfinal] at ha + exact (hheight T ⟨hT, le_rfl⟩).trans ha + have hd (t : ℝ) (ht : t ∈ Ioc 0 T) : + HasDerivWithinAt (fun s => g s z') + (velocity ε (driver t) (g t z')) (Iic t) t := by + rw [velocity_eq (hht t ⟨ht.1.le, ht.2⟩)] + exact (h.2.2.2.2.2.2.2.2.2.2.2.2.1 t ht.1 z' + (survivingDomain_mono ht.2 hz')).hasDerivWithinAt + have he : EqOn (fun t => g t z') H (Icc 0 T) := + ODE_solution_unique_of_mem_Icc_left + (s := fun _ => univ) (fun t _ => (velocity_lipschitz hε (driver t)).lipschitzOnWith) + (h.continuous_eval hT hz') hd (fun _ _ => mem_univ _) + (HasDerivWithinAt.continuousOn hH) (fun _ ht => derivWithin_left hH ht) + (fun _ _ => mem_univ _) hfinal + have hz0 : z' = H 0 := by + rw [← h.initial z' hz'.1.1] + exact he ⟨le_rfl, hT⟩ + exact ⟨hz0 ▸ hz', hz0 ▸ he⟩ + +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma hasDerivWithinAt_eval (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (fun s => g s z) + (2 / (g t z - (driver t : ℂ))) (Icc 0 T) t := by + have hc := h.continuous_velocity hT hU hz + have hi : IntervalIntegrable (fun s => 2 / (g s z - (driver s : ℂ))) volume 0 t := + (hc.intervalIntegrable_of_Icc hT).mono_set (by + rw [uIcc_of_le ht.1, uIcc_of_le hT] + exact Icc_subset_Icc le_rfl ht.2) + have : Fact (t ∈ Icc 0 T) := ⟨ht⟩ + have hd := intervalIntegral.integral_hasDerivWithinAt_right (s := Icc 0 T) (t := Icc 0 T) + hi (hc.stronglyMeasurableAtFilter_nhdsWithin measurableSet_Icc t) (hc t ht) + have he : EqOn (fun s => g 0 z + ∫ v in (0 : ℝ)..s, 2 / (g v z - (driver v : ℂ))) + (fun s => g s z) (Icc 0 T) := by + intro s hs + dsimp only + rw [h.integral_velocity hT hU hz ⟨le_rfl, hT⟩ hs hs.1] + abel + exact (hd.const_add (g 0 z)).congr (fun s hs => (he hs).symm) (he ht).symm + +lemma eq_cutoff_solution (h : IsLoewnerTraceUsing driver γ g f) + {T ε : ℝ} (hT : 0 ≤ T) (hε : 0 < ε) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) (hheight : ε ≤ (g T z).im) + {H : ℝ → ℂ} (hH0 : H 0 = z) + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H + (velocity ε (driver t) (H t)) (Icc 0 T) t) : + EqOn (fun t => g t z) H (Icc 0 T) := by + apply solution_eq hε ?_ hH ((h.initial z hz.1.1).trans hH0.symm) + intro t ht + rw [velocity_eq (hheight.trans (h.height_antitone hT hz ht ⟨hT, le_rfl⟩ ht.2))] + exact h.hasDerivWithinAt_eval hT hU hz ht + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/MappedExit.lean b/lean/OAI/Probability/SLELocalization/MappedExit.lean new file mode 100644 index 0000000000000000000000000000000000000000..40fa2c35e76ac7cc441c62810c4cb87839aaf64f --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/MappedExit.lean @@ -0,0 +1,694 @@ +import Mathlib +import OAI.Probability.SLELocalization.BrownianSupport +import OAI.Probability.SLELocalization.CommonClocks +import OAI.Probability.SLELocalization.ConformalLocalization +import OAI.Probability.SLELocalization.FirstDisk +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry + +namespace OAI + + +/-! Conformal localization and Swallowing estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.Swallowing +open GreenPhysical LoewnerCutoff LoewnerExit + +lemma cutoff_eq_until {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (U : C(I,ℝ)) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (hc : ContinuousOn driver (Icc 0 T)) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hy : ε < (g T z).im) : + EqOn (position hε hT.le U z) (fun t => g t z) (Icc 0 T) ∧ + stop hε hT.le U z 0 0 = T := by + have he := h.eq_cutoff_solution hT.le hε hc hz hy.le (position_initial hε hT.le U z) (by + intro t ht + rw [← hU ht] + exact position_derivWithin hε hT.le U z ht) + have hpos (t : ℝ) (ht : t ∈ Icc 0 T) : ε < (position hε hT.le U z t).im := by + rw [← he ht] + exact hy.trans_le (h.height_antitone hT.le hz ht ⟨hT.le,le_rfl⟩ ht.2) + refine ⟨he.symm,?_⟩ + apply le_antisymm (stop_bounds hε hT.le U z 0 0).2 + by_contra hn + have hlt := lt_of_not_ge hn + have hn0 := nonpos_at_of_lt hε hT.le hT U z 0 0 hlt + have ht := stop_bounds hε hT.le U z 0 0 + have hh := hpos _ ht + have hp : 0 < deficit hε hT.le U z 0 0 (stop hε hT.le U z 0 0) := by + apply (deficit_pos_iff hε hT.le U z 0 0 _).2 + refine ⟨?_,hh,?_⟩ + · exact div_pos (mul_pos (by norm_num) (hε.trans hh)) (Real.exp_pos _) + · exact div_pos (hε.trans hh) (norm_pos_iff.2 (clampIm_ne_zero hε _)) + exact (not_lt_of_ge hn0) hp + +def physicalQ {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ : ℝ) + (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (ω : Ω) (t : ℝ) : ℝ := + ((g ω t z).re-Real.sqrt κ*B t.toNNReal ω)^2+(g ω t z).im^2 + +def physicalPhi {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β C : ℝ) + (g : Ω → ℝ → ℂ → ℂ) (z : ℂ) (ω : Ω) (t : ℝ) : ℝ := + lyapunov β C ((g ω t z).re-Real.sqrt κ*B t.toNNReal ω) (g ω t z).im + +lemma budget_dominates {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) + (hz : z ∈ localizationDomain (γ ω) T) (hy : ε < (g ω T z).im) : + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + physicalPhi B κ β C g z ω T+d*(∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1)) ≤ + budget B κ β C hε T z ω := by + dsimp only + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + let U := BrownianDriver.path B (Real.sqrt κ) T ω + have hU : EqOn (extendDriver T U) (fun t => Real.sqrt κ*B t.toNNReal ω) (Icc 0 (T:ℝ)) := + fun t ht => BrownianDriver.extend_eq B _ T ω hc ht + have hb := hc.comp continuous_real_toNNReal + have hd : Continuous (fun t : ℝ => Real.sqrt κ*B t.toNNReal ω) := continuous_const.mul hb + obtain ⟨he,hs⟩ := cutoff_eq_until h hε hT U hU hd.continuousOn hz hy + have hh0 := h.height_antitone T.coe_nonneg hz ⟨le_rfl,T.coe_nonneg⟩ ⟨T.coe_nonneg,le_rfl⟩ T.coe_nonneg + dsimp only at hh0 + rw [h.initial z hz.1.1] at hh0 + have hin := deterministic_budget hε hT κ β hκ hβ hβκ U z (hy.le.trans hh0) + (fun t => B t.toNNReal ω) hb (by simpa using hb0) hU + dsimp only at hin + have heheight (t : ℝ) (ht : t ∈ Icc 0 (T:ℝ)) : LoewnerField.height hε T.coe_nonneg U z t = (g ω t z).im := by + rw [LoewnerField.height,he ht,max_eq_right] + exact hy.le.trans (h.height_antitone T.coe_nonneg hz ht ⟨T.coe_nonneg,le_rfl⟩ ht.2) + have hE : (∫ t in (0:ℝ)..stop hε T.coe_nonneg U z 0 0, + (((position hε T.coe_nonneg U z t).re-Real.sqrt κ*B t.toNNReal ω)^2+ + (LoewnerField.height hε T.coe_nonneg U z t)^2)^(β/2-1)) = + ∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1) := by + rw [hs] + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le T.coe_nonneg] at ht + dsimp only + rw [he ht,heheight t ht] + rfl + have hF : field hε T.coe_nonneg β C (Real.sqrt κ) U z (stop hε T.coe_nonneg U z 0 0) + (B (stop hε T.coe_nonneg U z 0 0).toNNReal ω) = physicalPhi B κ β C g z ω T := by + rw [hs] + simp only [field,physicalPhi] + rw [he ⟨T.coe_nonneg,le_rfl⟩,heheight _ ⟨T.coe_nonneg,le_rfl⟩] + have hbound : physicalPhi B κ β C g z ω T+d*(∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1)) ≤ + correction B κ β C hε T z ω+lyapunov β C z.re z.im := by + have hh := hin.2 + simp only [Real.toNNReal_zero] at hh + change field hε T.coe_nonneg β C (Real.sqrt κ) U z (stop hε T.coe_nonneg U z 0 0) + (B (stop hε T.coe_nonneg U z 0 0).toNNReal ω) + d*_ ≤ + correction B κ β C hε T z ω+lyapunov β C z.re z.im at hh + rw [hF,hE] at hh + exact hh + exact hbound.trans (by + rw [budget,ite_eq_right (by exact ne_of_gt (show (0:ℝ≥0) (q t)^(α-1)) (Icc 0 T) := + hq.rpow_const (fun t ht => Or.inl (hp t ht).ne') + have hiφ := hφ.intervalIntegrable_of_Icc (μ := volume) hT.le + have hiH := hH.intervalIntegrable_of_Icc (μ := volume) hT.le + have hm : (∫ _ in (0:ℝ)..T,T^α) ≤ ∫ t in (0:ℝ)..T,φ t+T*(q t)^(α-1) := by + apply intervalIntegral.integral_mono_on hT.le (intervalIntegrable_const) (hiφ.add (hiH.const_mul T)) + intro t ht + exact (radial_occupation_point (hp t ht) hT hα hα1).trans (add_le_add (hφq t ht) le_rfl) + rw [intervalIntegral.integral_const,sub_zero,smul_eq_mul, + intervalIntegral.integral_add hiφ (hiH.const_mul T),intervalIntegral.integral_const_mul] at hm + have hm := (le_div_iff₀ hT).2 (by simpa only [mul_comm] using hm) + calc + T^α ≤ ((∫ t in (0:ℝ)..T,φ t)+T*(∫ t in (0:ℝ)..T,(q t)^(α-1)))/T := hm + _ = _ := by field_simp; ring + +lemma average_riemann_tendsto {φ : ℝ → ℝ} {T : ℝ} (hT : 0 < T) + (hφ : ContinuousOn φ (Icc 0 T)) : + Tendsto (fun n => (∑ i ∈ Finset.range (2^n),φ (TaylorMeshes.mesh T n i))/(2:ℝ)^n) + atTop (𝓝 ((∫ t in (0:ℝ)..T,φ t)/T)) := by + have hh := (TaylorMeshes.mesh_riemann_tendsto hT.le hφ).div_const T + convert hh using 1 + funext n + rw [← Finset.sum_mul] + field_simp + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing +open BrownianPredictable + +def heightCut (z : ℂ) (n : ℕ) : ℝ := z.im / ((n:ℝ)+1) + +lemma heightCut_pos {z : ℂ} (hz : z ∈ halfPlane) (n : ℕ) : 0 < heightCut z n := + div_pos hz (by positivity) + +lemma heightCut_le {z : ℂ} (hz : z ∈ halfPlane) (n : ℕ) : heightCut z n ≤ z.im := by + apply div_le_self hz.le + have hn : (0:ℝ) ≤ n := Nat.cast_nonneg n + linarith + +lemma heightCut_tendsto (z : ℂ) : Tendsto (heightCut z) atTop (𝓝 0) := by + change Tendsto (fun n : ℕ => z.im/((n:ℝ)+1)) atTop (𝓝 0) + simpa only [mul_one,mul_zero,div_eq_mul_inv,one_mul] using + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul z.im + +def averagedBudget {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β : ℝ) + (T : ℝ≥0) (z : ℂ) (hz : z∈halfPlane) (n : ℕ) (ω : Ω) : ℝ := + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + budget B κ β C (heightCut_pos hz n) T z ω/d+ + (∑ i ∈ Finset.range (2^n), budget B κ β C (heightCut_pos hz n) (dyadicTime T n i) z ω)/(2:ℝ)^n + +lemma averagedBudget_mean {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (T : ℝ≥0) (z : ℂ) (hz : z∈halfPlane) (n : ℕ) : + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + Integrable (averagedBudget B κ β T z hz n) P ∧ + (∫ ω,averagedBudget B κ β T z hz n ω ∂P) = + lyapunov β C z.re z.im/d+lyapunov β C z.re z.im ∧ + ∀ ω, 0 ≤ averagedBudget B κ β T z hz n ω := by + dsimp only + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + have hd : 0 < d := (generator_negative hκ hβ hβκ z.re hz).2.1 + have hb (S : ℝ≥0) := budget_mean hB κ β hκ hβ hβκ (heightCut_pos hz n) S z (heightCut_le hz n) + have hs : Integrable (fun ω => ∑ i ∈ Finset.range (2^n), budget B κ β C (heightCut_pos hz n) (dyadicTime T n i) z ω) P := + integrable_finsetSum _ (fun i hi => (hb _).1) + refine ⟨((hb T).1.div_const d).add (hs.div_const _),?_,?_⟩ + · change (∫ ω,budget B κ β C (heightCut_pos hz n) T z ω/d+ + (∑ i ∈ Finset.range (2^n), budget B κ β C (heightCut_pos hz n) (dyadicTime T n i) z ω)/(2:ℝ)^n ∂P)=_ + rw [integral_add ((hb T).1.div_const _) (hs.div_const _),integral_div,integral_div, + (hb T).2.1,integral_finsetSum _ (fun i hi => (hb _).1)] + simp only [(hb _).2.1,Finset.sum_const,Finset.card_range,nsmul_eq_mul,Nat.cast_pow,Nat.cast_ofNat] + change lyapunov β C z.re z.im/d+((2:ℝ)^n*lyapunov β C z.re z.im)/(2:ℝ)^n = + lyapunov β C z.re z.im/d+lyapunov β C z.re z.im + congr 1 + field_simp + · intro ω + apply add_nonneg + · exact div_nonneg ((hb T).2.2 ω) hd.le + · exact div_nonneg (Finset.sum_nonneg fun i hi => (hb _).2.2 ω) (by positivity) + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing +open BrownianPredictable BrownianField BrownianIto TaylorMeshes GreenPhysical + +lemma budget_terminal_bound {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (z : ℂ) + (hz : z ∈ localizationDomain (γ ω) T) (hy : ε < (g ω T z).im) : + let C := (2*κ-8-κ*β)/4 + physicalPhi B κ β C g z ω T ≤ budget B κ β C hε T z ω := by + dsimp only + by_cases ht : T=0 + · subst T + simp [physicalPhi,h.initial z hz.1.1,hb0,budget] + have hT : 0 < (T:ℝ) := NNReal.coe_pos.2 (pos_iff_ne_zero.2 ht) + have hh := budget_dominates B κ β hκ hβ hβκ γ g f ω h hc hb0 hε T hT z hz hy + have hd := (generator_negative hκ hβ hβκ z.re hz.1.1).2.1 + have hE : 0 ≤ ∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1) := by + apply intervalIntegral.integral_nonneg T.coe_nonneg + intro t ht + exact Real.rpow_nonneg (by dsimp [physicalQ]; positivity) _ + exact (le_add_of_nonneg_right (mul_nonneg hd.le hE)).trans hh + +lemma physical_continuous {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β C : ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) {T : ℝ} (hT : 0 ≤ T) (z : ℂ) + (hz : z ∈ localizationDomain (γ ω) T) : + ContinuousOn (physicalQ B κ g z ω) (Icc 0 T) ∧ + ContinuousOn (physicalPhi B κ β C g z ω) (Icc 0 T) ∧ + ∀ t ∈ Icc 0 T, 0 < physicalQ B κ g z ω t := by + have hg := h.continuous_eval hT hz + have hx := (Complex.continuous_re.comp_continuousOn hg).sub + ((continuous_const.mul (hc.comp continuous_real_toNNReal) : Continuous (fun t : ℝ => Real.sqrt κ*B t.toNNReal ω)).continuousOn) + have hy := Complex.continuous_im.comp_continuousOn hg + have hyp (t : ℝ) (ht : t∈Icc 0 T) := h.im_pos ht.1 (survivingDomain_mono ht.2 hz) + have hq : ContinuousOn (physicalQ B κ g z ω) (Icc 0 T) := (hx.pow 2).add (hy.pow 2) + have hqp (t : ℝ) (ht : t∈Icc 0 T) : 0 < physicalQ B κ g z ω t := q_pos _ (hyp t ht) + refine ⟨hq,?_,hqp⟩ + exact (hq.rpow_const (fun t ht => Or.inl (hqp t ht).ne')).add + (continuousOn_const.mul (hy.rpow_const (fun t ht => Or.inl (hyp t ht).ne'))) + +lemma averagedBudget_lower {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (hz : z ∈ halfPlane) + (halive : z ∈ localizationDomain (γ ω) T) (n : ℕ) (hy : heightCut z n < (g ω T z).im) : + let C := (2*κ-8-κ*β)/4 + (∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1))+ + (∑ i ∈ Finset.range (2^n),physicalPhi B κ β C g z ω (mesh T n i))/(2:ℝ)^n ≤ + averagedBudget B κ β T z hz n ω := by + dsimp only + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + have hgen := generator_negative hκ hβ hβκ z.re hz + have hd : 0 < d := hgen.2.1 + have hphi : 0 ≤ physicalPhi B κ β C g z ω T := + lyapunov_nonneg hgen.1.le _ (h.im_pos T.coe_nonneg halive) + have hh := budget_dominates B κ β hκ hβ hβκ γ g f ω h hc hb0 (heightCut_pos hz n) T hT z halive hy + have hEc : (∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1)) ≤ + budget B κ β C (heightCut_pos hz n) T z ω/d := by + apply (le_div_iff₀ hd).2 + change physicalPhi B κ β C g z ω T+d*(∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1)) ≤ + budget B κ β C (heightCut_pos hz n) T z ω at hh + nlinarith only [hh,hphi] + apply add_le_add hEc + apply div_le_div_of_nonneg_right _ (by positivity) + apply Finset.sum_le_sum + intro i hi + have hti : (dyadicTime T n i : ℝ) ∈ Icc 0 (T:ℝ) := by + rw [coe_dyadicTime] + exact mesh_mem T T.coe_nonneg n i (Finset.mem_range.1 hi).le + have hiY := hy.trans_le (h.height_antitone T.coe_nonneg halive hti ⟨T.coe_nonneg,le_rfl⟩ hti.2) + have hbound := budget_terminal_bound B κ β hκ hβ hβκ γ g f ω h hc hb0 (heightCut_pos hz n) + (dyadicTime T n i) z (survivingDomain_mono hti.2 halive) hiY + simpa only [coe_dyadicTime] using hbound + +lemma eventually_budget_large {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (hz : z ∈ halfPlane) + (halive : z ∈ localizationDomain (γ ω) T) : + ∀ᶠ n in atTop, (T:ℝ)^(β/2)/2 ≤ averagedBudget B κ β T z hz n ω := by + let C := (2*κ-8-κ*β)/4 + let E := ∫ t in (0:ℝ)..(T:ℝ), (physicalQ B κ g z ω t)^(β/2-1) + let φ := physicalPhi B κ β C g z ω + have hh := physical_continuous B κ β C γ g f ω h hc T.coe_nonneg z halive + have hg := generator_negative hκ hβ hβκ z.re hz + have hβ1 : β/2 ≤ 1 := by have h4 := div_pos (by norm_num : (0:ℝ)<4) (by linarith : 0<κ); linarith + have hφq (t : ℝ) (ht : t∈Icc 0 (T:ℝ)) : (physicalQ B κ g z ω t)^(β/2) ≤ φ t := by + apply le_add_of_nonneg_right + exact mul_nonneg hg.1.le (Real.rpow_nonneg (h.im_pos ht.1 (survivingDomain_mono ht.2 halive)).le _) + have hbound := occupation_lower hT (by positivity : (0:ℝ)≤β/2) hβ1 hh.1 hh.2.1 hh.2.2 hφq + have hlim := (average_riemann_tendsto hT hh.2.1).const_add E + have hlt : (T:ℝ)^(β/2)/2 < E+(∫ t in (0:ℝ)..(T:ℝ),φ t)/(T:ℝ) := by + have hp := Real.rpow_pos_of_pos hT (β/2) + linarith + have hlower := hlim.eventually (lt_mem_nhds hlt) + have hcut := (heightCut_tendsto z).eventually (gt_mem_nhds (h.im_pos T.coe_nonneg halive)) + filter_upwards [hcut,hlower] with n hcut hn + exact hn.le.trans (averagedBudget_lower B κ β hκ hβ hβκ γ g f ω h hc hb0 T hT z hz halive n hcut) + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing + +lemma initial_uniform {β C : ℝ} (hβ : 0 ≤ β) (hC : 0 ≤ C) {z : ℂ} + (hz : z ∈ halfPlane) (hn : ‖z‖=1) : lyapunov β C z.re z.im ≤ 1+C := by + have hq : z.re^2+z.im^2=1 := by + have hh : ‖z‖^2=1 := by rw [hn]; norm_num + rw [Complex.sq_norm] at hh + simpa only [Complex.normSq_apply,pow_two] using hh + have hy1 : z.im ≤ 1 := by simpa only [hn] using Complex.im_le_norm z + have hpow := Real.rpow_le_rpow hz.le hy1 hβ + simp only [Real.one_rpow] at hpow + simp only [lyapunov,radial,hq,Real.one_rpow] + exact add_le_add le_rfl (by simpa only [mul_one] using mul_le_mul_of_nonneg_left hpow hC) + +lemma survival_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β : ℝ) + (hκ : 4 < κ) (hβ : 0 < β) (hβκ : β < 1-4/κ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (T : ℝ≥0) (hT : 0 < (T:ℝ)) (z : ℂ) (hz : z∈halfPlane) (hn : ‖z‖=1) : + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + P {ω | z ∈ localizationDomain (γ ω) T} ≤ + ENNReal.ofReal (2*((1+C)/d+(1+C))*(T:ℝ)^(-(β/2))) := by + dsimp only + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + let M := lyapunov β C z.re z.im/d+lyapunov β C z.re z.im + have hgen := generator_negative hκ hβ hβκ z.re hz + have hd : 0 < d := hgen.2.1 + have hW (n : ℕ) := averagedBudget_mean hB κ β hκ hβ hβκ T z hz n + have he : ∀ᵐ ω ∂P, z ∈ localizationDomain (γ ω) T → + ∀ᶠ n in atTop, (T:ℝ)^(β/2)/2 ≤ averagedBudget B κ β T z hz n ω := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hm hc hb0 + intro halive + exact eventually_budget_large B κ β hκ hβ hβκ γ g f ω hm hc hb0 T hT z hz halive + have hbound := measure_eventually_budget (averagedBudget B κ β T z hz) M ((T:ℝ)^(β/2)/2) + (by positivity) (fun n => (hW n).1) (fun n ω => (hW n).2.2 ω) (fun n => (hW n).2.1) + {ω | z ∈ localizationDomain (γ ω) T} he + have hinit := initial_uniform hβ.le hgen.1.le hz hn + have hM : M ≤ (1+C)/d+(1+C) := add_le_add (div_le_div_of_nonneg_right hinit hd.le) hinit + have hp : 0 < (T:ℝ)^(β/2) := Real.rpow_pos_of_pos hT _ + refine hbound.trans (ENNReal.ofReal_le_ofReal ?_) + calc + M/((T:ℝ)^(β/2)/2) ≤ ((1+C)/d+(1+C))/((T:ℝ)^(β/2)/2) := div_le_div_of_nonneg_right hM (by positivity) + _ = _ := by + change ((1+C)/d+(1+C))/((T:ℝ)^(β/2)/2) = 2*((1+C)/d+(1+C))*(T:ℝ)^(-(β/2)) + rw [Real.rpow_neg hT.le] + field_simp + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open Swallowing + +theorem swallowingTime_tail (κ : ℝ) (hκ : 4 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ), z ∈ halfPlane → ‖z‖ = 1 → ∀ t : ℝ, 0 < t → + P {sample | z ∈ localizationDomain (γ sample) t} ≤ ENNReal.ofReal (C*t^(-c)) := by + let β := (1-4/κ)/2 + have hκ0 : 0 < κ := by linarith [hκ.1] + have ha : 0 < 1-4/κ := sub_pos.2 ((div_lt_one hκ0).2 hκ.1) + have hβ : 0 < β := half_pos ha + have hβκ : β < 1-4/κ := half_lt_self ha + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + have hgen := generator_negative hκ.1 hβ hβκ 0 (by norm_num : (0:ℝ)<1) + have hC : 0 < C := hgen.1 + have hd : 0 < d := hgen.2.1 + refine ⟨2*((1+C)/d+(1+C)),β/2,by positivity,by positivity,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz hn t ht + exact survival_bound hB κ β hκ.1 hβ hβκ γ g f hmaps ⟨t,ht.le⟩ ht z hz hn + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge + +def excursionBeforeSwallowing (γ : ℝ → ℂ) (z : ℂ) (A : ℝ) : Prop := + ∃ t : ℝ, 0 ≤ t ∧ A ≤ ‖γ t‖ ∧ + ∀ s ∈ Ico 0 t, z ∈ localizationDomain γ s + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge +namespace Swallowing + +lemma early_excursion_forces_driver {κ A : ℝ} (hκ : 0 < κ) (hA : 8 < A) + {B : ℝ≥0 → ℝ} (hB : Continuous B) {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ * B t.toNNReal) γ g f) + {t : ℝ} (ht : t ∈ Icc 0 A) (he : A ≤ ‖γ t‖) : + ∃ s ∈ Icc 0 (A.toNNReal), A/(2*Real.sqrt κ) < |B s| := by + by_contra! hmax + have hsqrt : 0 < Real.sqrt κ := Real.sqrt_pos.2 hκ + have hbound : ∀ s ∈ Icc 0 A, + -A/2 ≤ Real.sqrt κ * B s.toNNReal ∧ Real.sqrt κ * B s.toNNReal ≤ A/2 := by + intro s hs + have hb := hmax s.toNNReal ⟨by positivity, Real.toNNReal_le_toNNReal hs.2⟩ + have ha : |Real.sqrt κ * B s.toNNReal| ≤ A/2 := by + rw [abs_mul,abs_of_pos hsqrt] + calc + Real.sqrt κ * |B s.toNNReal| ≤ Real.sqrt κ*(A/(2*Real.sqrt κ)) := + mul_le_mul_of_nonneg_left hb hsqrt.le + _ = A/2 := by field_simp + exact ⟨by linarith [(abs_le.1 ha).1], (abs_le.1 ha).2⟩ + have hr := trace_driver_rectangle hm (by linarith : 0 ≤ A) + ((continuous_const.mul (hB.comp continuous_real_toNNReal)).continuousOn) hbound t ht + have hx : (γ t).re^2 ≤ A^2/4 := by nlinarith [sq_nonneg ((γ t).re+A/2),sq_nonneg ((γ t).re-A/2)] + have hn : A^2 ≤ (γ t).re^2+(γ t).im^2 := by + have hh := sq_le_sq₀ (by linarith : 0 ≤ A) (norm_nonneg (γ t)) |>.2 he + rw [Complex.sq_norm,Complex.normSq_apply] at hh + simpa only [pow_two] using hh + nlinarith [sq_nonneg (A-8),hr.2.2,ht.2] + +lemma excursion_split {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (κ : ℝ) (hκ : 0 < κ) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (z : ℂ) (A : ℝ) (hA : 8 < A) : + P {ω | excursionBeforeSwallowing (γ ω) z A} ≤ + P {ω | z ∈ localizationDomain (γ ω) A}+ ENNReal.ofReal (4*κ/A) := by + have hsub : ∀ᵐ ω ∂P, excursionBeforeSwallowing (γ ω) z A → + z ∈ localizationDomain (γ ω) A ∨ + ∃ s ∈ Icc 0 A.toNNReal, A/(2*Real.sqrt κ) < |B s ω| := by + filter_upwards [hmaps,hB.cont] with ω hm hc he + obtain ⟨t,ht,hn,hlive⟩ := he + by_cases hta : t ≤ A + · exact Or.inr (early_excursion_forces_driver hκ hA hc hm ⟨ht,hta⟩ hn) + · exact Or.inl (hlive A ⟨by linarith,lt_of_not_ge hta⟩) + have hb := BrownianSupport.brownian_oscillation_bound hB A.toNNReal + (a := A/(2*Real.sqrt κ)) (by positivity) + have hcalc : (A.toNNReal:ℝ)/(A/(2*Real.sqrt κ))^2 = 4*κ/A := by + rw [Real.coe_toNNReal A (by linarith)] + have ha0 : A ≠ 0 := by linarith + have hs0 : Real.sqrt κ ≠ 0 := ne_of_gt (Real.sqrt_pos.2 hκ) + field_simp + nlinarith [Real.sq_sqrt hκ.le] + rw [hcalc] at hb + have hm : P {ω | excursionBeforeSwallowing (γ ω) z A} ≤ + P ({ω | z ∈ localizationDomain (γ ω) A} ∪ + {ω | ∃ s ∈ Icc 0 A.toNNReal, A/(2*Real.sqrt κ) < |B s ω|}) := measure_mono_ae hsub + exact hm.trans ((measure_union_le _ _).trans (add_le_add le_rfl hb)) + +end Swallowing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge + +theorem swallowing_excursion_tail (κ : ℝ) (hκ : 4 < κ ∧ κ < 8) : + ∃ C c : ℝ, 0 < C ∧ 0 < c ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z : ℂ), z ∈ halfPlane → ‖z‖ = 1 → ∀ A : ℝ, 2 ≤ A → + P {sample | excursionBeforeSwallowing (γ sample) z A} ≤ + ENNReal.ofReal (C*A^(-c)) := by + obtain ⟨C₀,c₀,hC₀,hc₀,htail⟩ := swallowingTime_tail κ hκ + let c := min c₀ 1 + let C := C₀+4*κ+8 + have hκ0 : 0 < κ := by linarith [hκ.1] + have hc : 0 < c := lt_min hc₀ zero_lt_one + have hc1 : c ≤ 1 := min_le_right _ _ + have hcc : c ≤ c₀ := min_le_left _ _ + have hC8 : 8 ≤ C := by dsimp [C]; linarith + refine ⟨C,c,by linarith,hc,?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps z hz hn A hA + have hA0 : 0 < A := by linarith + have hA1 : 1 ≤ A := by linarith + have hp : 0 < A^(-c) := Real.rpow_pos_of_pos hA0 _ + by_cases hlarge : 8 < A + · have hsplit := Swallowing.excursion_split hB κ hκ0 γ g f hmaps z A hlarge + have htime := htail P B hB γ g f hγ hmaps z hz hn A hA0 + refine (hsplit.trans (add_le_add htime le_rfl)).trans ?_ + rw [← ENNReal.ofReal_add (by positivity) (by positivity)] + apply ENNReal.ofReal_le_ofReal + have hpow := Real.rpow_le_rpow_of_exponent_le hA1 (neg_le_neg hcc) + have hinv : (1:ℝ)/A ≤ A^(-c) := by + have hh := Real.rpow_le_rpow_of_exponent_le hA1 (neg_le_neg hc1) + simpa only [Real.rpow_neg_one,one_div] using hh + calc + C₀*A^(-c₀)+4*κ/A ≤ C₀*A^(-c)+4*κ*A^(-c) := + add_le_add (mul_le_mul_of_nonneg_left hpow hC₀.le) (by + simpa only [div_eq_mul_inv,mul_one,one_mul,mul_assoc] using + mul_le_mul_of_nonneg_left hinv (show 0 ≤ 4*κ by positivity)) + _ ≤ C*A^(-c) := by dsimp [C]; nlinarith + · have hsmall : A ≤ 8 := le_of_not_gt hlarge + have hac : A^c ≤ 8 := by + have hh := Real.rpow_le_rpow_of_exponent_le hA1 hc1 + have hh' : A^c ≤ A := by simpa only [Real.rpow_one] using hh + exact hh'.trans hsmall + have h8 : (1:ℝ) ≤ 8*A^(-c) := by + rw [Real.rpow_neg hA0.le,← div_eq_mul_inv] + exact (le_div_iff₀ (Real.rpow_pos_of_pos hA0 c)).2 (by simpa using hac) + have hone : (1:ℝ) ≤ C*A^(-c) := h8.trans (mul_le_mul_of_nonneg_right hC8 hp.le) + exact prob_le_one.trans (by simpa only [ENNReal.ofReal_one] using ENNReal.ofReal_le_ofReal hone) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology ENNReal NNReal OnePoint +namespace SLEExactGauge + +def mappedLiveExit (Fbar : ℂ → OnePoint ℂ) (γ : ℝ → ℂ) + (z q : ℂ) (radius : ℝ) : Prop := + ∃ t : ℝ, 0 ≤ t ∧ z ∈ localizationDomain γ t ∧ + Fbar (γ t) ∉ (fun w : ℂ => (w : OnePoint ℂ)) '' Metric.ball q radius + +lemma mappedLiveExit_split {Fbar : ℂ → OnePoint ℂ} {γ : ℝ → ℂ} + {z q : ℂ} {radius A : ℝ} (he : mappedLiveExit Fbar γ z q radius) : + conformalExit Fbar γ q radius A ∨ excursionBeforeSwallowing γ z A := by + obtain ⟨t,ht,hz,hout⟩ := he + by_cases hpre : ∀ s : ℝ, 0 ≤ s → s < t → ‖γ s‖ < A + · exact Or.inl ⟨t,ht,hpre,hout⟩ + · push Not at hpre + obtain ⟨s,hs,hst,hn⟩ := hpre + exact Or.inr ⟨s,hs,hn,fun u hu => survivingDomain_mono (hu.2.trans hst).le hz⟩ + +theorem mapped_live_exit_tail (κ : ℝ) (hκ : 4 < κ ∧ κ < 8) : + ∃ c C L₀ : ℝ, 0 < c ∧ 0 < C ∧ 1 < L₀ ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (F : ℂ → ℂ) (Fbar : ℂ → OnePoint ℂ) + (_hF : AnalyticOnNhd ℂ F halfPlane) (_hinj : Set.InjOn F halfPlane) + (_hext : ∀ z ∈ halfPlane, Fbar z = (F z : OnePoint ℂ)) + (_hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (η : ℝ → ℂ) (_hη : ContinuousOn η (Icc 0 1)) (_hη0 : η 0 = 0) + (_hη1 : ‖η 1‖ = 1) (_hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (z q : ℂ) (_hz : z ∈ halfPlane) (_hznorm : ‖z‖ = 1) (_hzq : F z = q) + (r : ℝ) (_hr : 0 < r) + (_haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' Metric.closedBall q r) + (L : ℝ), L₀ ≤ L → + P {sample | mappedLiveExit Fbar (γ sample) z q (L*r)} ≤ + ENNReal.ofReal (C*L^(-c)) := by + have hκ0 : 0 < κ := by linarith [hκ.1] + obtain ⟨b,c₁,C₁,L₁,hb,hc₁,hC₁,hL₁,hloc⟩ := uniform_conformal_localization κ ⟨hκ0,hκ.2⟩ + obtain ⟨C₂,c₂,hC₂,hc₂,hswallow⟩ := swallowing_excursion_tail κ hκ + let c := min c₁ (b*c₂) + let L₀ := max L₁ ((2:ℝ)^(1/b)) + have hc : 0 < c := lt_min hc₁ (mul_pos hb hc₂) + refine ⟨c,C₁+C₂,L₀,hc,add_pos hC₁ hC₂,hL₁.trans_le (le_max_left _ _),?_⟩ + intro Ω _ P _ B hB γ g f hγ hmaps F Fbar hF hinj hext hcont η hη hη0 hη1 hηH z q hz hznorm hzq r hr haccess L hlarge + have hLL : L₁ ≤ L := (le_max_left _ _).trans hlarge + have hL : 1 < L := hL₁.trans_le hLL + have hLp : 0 < L := zero_lt_one.trans hL + have hA : (2:ℝ) ≤ L^b := by + calc + 2 = ((2:ℝ)^(1/b))^b := by rw [← Real.rpow_mul (by norm_num : (0:ℝ) ≤ 2),one_div_mul_cancel hb.ne',Real.rpow_one] + _ ≤ L^b := Real.rpow_le_rpow (Real.rpow_nonneg (by norm_num) _) ((le_max_right _ _).trans hlarge) hb.le + have hp₁ := hloc P B hB γ g f hγ hmaps F Fbar hF hinj hext hcont η hη hη0 hη1 hηH q r hr haccess L hLL + have hp₂ := hswallow P B hB γ g f hγ hmaps z hz hznorm (L^b) hA + have hsub : {ω | mappedLiveExit Fbar (γ ω) z q (L*r)} ⊆ + {ω | conformalExit Fbar (γ ω) q (L*r) (L^b)} ∪ + {ω | excursionBeforeSwallowing (γ ω) z (L^b)} := fun ω he => mappedLiveExit_split he + have hpow₁ : L^(-c₁) ≤ L^(-c) := Real.rpow_le_rpow_of_exponent_le hL.le (neg_le_neg (min_le_left _ _)) + have hpow₂ : (L^b)^(-c₂) ≤ L^(-c) := by + rw [← Real.rpow_mul hLp.le] + apply Real.rpow_le_rpow_of_exponent_le hL.le + nlinarith [show c ≤ b*c₂ from min_le_right _ _] + calc + _ ≤ P ({ω | conformalExit Fbar (γ ω) q (L*r) (L^b)} ∪ + {ω | excursionBeforeSwallowing (γ ω) z (L^b)}) := measure_mono hsub + _ ≤ P {ω | conformalExit Fbar (γ ω) q (L*r) (L^b)}+ + P {ω | excursionBeforeSwallowing (γ ω) z (L^b)} := measure_union_le _ _ + _ ≤ ENNReal.ofReal (C₁*L^(-c₁))+ENNReal.ofReal (C₂*(L^b)^(-c₂)) := add_le_add hp₁ hp₂ + _ = ENNReal.ofReal (C₁*L^(-c₁)+C₂*(L^b)^(-c₂)) := (ENNReal.ofReal_add (by positivity) (by positivity)).symm + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + calc + _ ≤ C₁*L^(-c)+C₂*L^(-c) := add_le_add (mul_le_mul_of_nonneg_left hpow₁ hC₁.le) (mul_le_mul_of_nonneg_left hpow₂ hC₂.le) + _ = _ := by ring) + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/MeshExponents.lean b/lean/OAI/Probability/SLELocalization/MeshExponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..00287b2718ec5c3d28dabe0b68ab4cff67fad03f --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/MeshExponents.lean @@ -0,0 +1,1082 @@ +import Mathlib +import OAI.Probability.SLELocalization.SlabMoments +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Mesh estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Mesh + +lemma interval_square_bound {A : Set ℂ} (hA : volume A ≠ ⊤) (C : ℝ → ℂ → ℝ) + {T K J R : ℝ} (hT : 0 ≤ T) (hJ : 0 ≤ J) + (hb : (∫⁻ t, ENNReal.ofReal (|∫ z in A, C t z|^2)) ≤ + 2*ENNReal.ofReal (K^2)*ENNReal.ofReal (J*R^2)*volume A) : + (∫ t in (0:ℝ)..T, (∫ z in A, C t z)^2) ≤ 2*K^2*(J*R^2)*(volume A).toReal := by + rw [intervalIntegral.integral_of_le hT] + have hh : ENNReal.ofReal (∫ t in Ioc (0:ℝ) T, (∫ z in A, C t z)^2) ≤ + ∫⁻ t in Ioc (0:ℝ) T, ENNReal.ofReal ((∫ z in A, C t z)^2) := by + calc + _ ≤ ‖∫ t in Ioc (0:ℝ) T, (∫ z in A, C t z)^2‖ₑ := by + rw [← ofReal_norm] + exact ENNReal.ofReal_le_ofReal (le_abs_self _) + _ ≤ ∫⁻ t in Ioc (0:ℝ) T, ‖(∫ z in A, C t z)^2‖ₑ := + enorm_integral_le_lintegral_enorm _ + _ = _ := by + apply lintegral_congr + intro t + rw [← ofReal_norm,Real.norm_of_nonneg (sq_nonneg _)] + have hh' := hh.trans (lintegral_mono' (μ := volume.restrict (Ioc (0:ℝ) T)) + (ν := volume) Measure.restrict_le_self le_rfl) + simp only [sq_abs] at hb + have hrhs : 2*ENNReal.ofReal (K^2)*ENNReal.ofReal (J*R^2)*volume A = + ENNReal.ofReal (2*K^2*(J*R^2)*(volume A).toReal) := by + rw [ENNReal.ofReal_mul (mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg _)) (mul_nonneg hJ (sq_nonneg _))), + ENNReal.ofReal_toReal hA,ENNReal.ofReal_mul (mul_nonneg (by norm_num) (sq_nonneg _)), + ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 2)] + norm_num + apply (ENNReal.ofReal_le_ofReal_iff (by positivity : 0 ≤ 2*K^2*(J*R^2)*(volume A).toReal)).1 + exact (hh'.trans hb).trans_eq hrhs + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized Mesh +open BrownianPredictable BrownianIto TaylorMeshes PredictableLimit +local instance meshExponentsCommonRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsCommonRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsCommonComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsCommonComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +theorem common_slab_mgf {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {A : Set ℂ} {u : ℂ → ℝ} (C : FiniteTilt.CommonCutoff A u) + (hA : MeasurableSet A) [IsFiniteMeasure (volume.restrict A)] + (κ : ℝ) (hκ : 0 < κ ∧ κ ≤ 4) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hhalf : ∀ z ∈ A, z ∈ halfPlane) (hu : ∀ z ∈ A, 0 < u z) + {ρ : ℝ} (hr : ∀ z ∈ A, (2*z.im)*Real.exp (-u z) = ρ) + (V : Ω → C(I,ℂ)) (hVm : Measurable V) + (hV : ∀ᵐ ω ∂P, ∀ q : I, V ω q = γ ω ((C.horizon:ℝ)*q)) + (e r : ℝ) (he : 0 < e) (her : e ≤ r) (hes : ∀ z ∈ A, e < z.im) + (J : ℝ) (hJ : 0 ≤ J) + (hlayer : ∀ ω, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω) → + ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain (γ ω) t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain (γ ω) t ∧ infDist w (localizationDomain (γ ω) t)ᶜ ≤ r}, + ENNReal.ofReal (halfPlaneGreen (g ω t z) (g ω t w))) ≤ ENNReal.ofReal (J*r^2)) (θ : ℝ) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(∫ z in A, + observedDifference C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + ((BrownianDriver.path B (Real.sqrt κ) C.horizon ω,V ω),z)))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(2*(Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8)))^2* + (J*r^2)*(volume A).toReal)/2)) := by + have hκ' : 0 < κ ∧ κ < 8 := ⟨hκ.1,by linarith [hκ.2]⟩ + let ν := volume.restrict A + let X := fun n i => slabCoeff C.height_pos κ B C.horizon (dyadicTime C.horizon n i) ρ C.angle e r + let Y := fun q : Ω × ℂ => observedDifference C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + ((BrownianDriver.path B (Real.sqrt κ) C.horizon q.1,V q.1),q.2) + have hXm (n i : ℕ) : AEMeasurable (X n i) (P.prod ν) := + (coeff_aemeasurable hB ν C.height_pos κ _ _ ρ C.angle e).sub + (coeff_aemeasurable hB ν C.height_pos κ _ _ ρ C.angle r) + have hXp (n i : ℕ) : @Measurable (Ω × ℂ) ℝ + (Prod.instMeasurableSpace (m₁ := pastSigma B (dyadicTime C.horizon n i)) (m₂ := inferInstance)) _ (X n i) := + (coeff_measurable_past C.height_pos κ B _ _ ρ C.angle e).sub + (coeff_measurable_past C.height_pos κ B _ _ ρ C.angle r) + obtain ⟨K,hK,hbound⟩ := coeff_uniform_bound C.height_pos κ hκ' B C.horizon ρ C.angle + have hXbound (n i : ℕ) (q : Ω × ℂ) : |X n i q| ≤ 2*K := by + exact (abs_sub _ _).trans ((add_le_add (hbound e _ q) (hbound r _ q)).trans_eq (by ring)) + have hsum := SpatialLimit.bounded_sums ν hB C.horizon X hXp hXm (2*K) (by positivity) hXbound + have hY := observedDifference_aemeasurable hB ν C.height_pos κ ρ C.angle e r C.horizon V hVm + have hlim : ∀ᵐ q ∂P.prod ν, Tendsto + (fun n => dyadicDriverSum B C.horizon (fun n i ω => X n i (ω,q.2)) n q.1) atTop (𝓝 (Y q)) := by + apply SpatialLimit.ae_prod_tendsto_of_fibers + (fun n => SpatialLimit.sums_aemeasurable hB C.horizon X hXm n) hY + filter_upwards [ae_restrict_mem hA] with z hz + exact slab_sum_tendsto C κ hκ' B hB γ g f hmaps z hz (hhalf z hz) (hu z hz) (hr z hz) V hV e r + let Q := fun ω => ∫ t in (0:ℝ)..C.horizon, (∫ z in A, + pathSlab C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + (BrownianDriver.path B (Real.sqrt κ) C.horizon ω) (V ω) (fun t => B t ω) t z)^2 + have hQ : ∀ᵐ ω ∂P, Tendsto (fun n => dyadicVariance C.horizon + (fun n i ω => ∫ z, X n i (ω,z) ∂ν) n ω) atTop (𝓝 (Q ω)) := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hV] with ω hm hc hb0 hv + exact slabCoeff_variance_tendsto C hA κ hκ' B γ g f ω hm hc hb0 hhalf hu hr (V ω) hv e r her + let J' := 2*(Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8)))^2*(J*r^2)*(volume A).toReal + have hJ' : ∀ᵐ ω ∂P, Q ω ≤ J' := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hV] with ω hm hc hb0 hv + have hbr := observed_bracket C hA κ hκ B γ g f ω hm hc hb0 hhalf hu hr (V ω) hv e r he her hes J (hlayer ω hm) + have hAf : volume A ≠ ⊤ := by + simpa only [Measure.restrict_apply_univ] using measure_ne_top (volume.restrict A) univ + exact interval_square_bound hAf _ C.horizon.coe_nonneg hJ hbr + exact SpatialLimit.spatial_exponential_bound ν hB C.horizon X hsum.1 hXp Y + (fun n => (hsum.2 n).1) (∫ _ : ℂ, (2*K)^2*(C.horizon:ℝ) ∂ν) + (fun n => (hsum.2 n).2) hlim Q hQ J' θ hJ' + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) +variable (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +variable {ε : ℝ} (hε : 0 < ε) (hsmall : ε < z.im) +variable (hρ : (2*z.im)*Real.exp (-u) < ε/4) +variable (Cs : ℕ → Cutoff z u) (hCs : Tendsto (fun n => (Cs n).angle) atTop (𝓝 0)) +include h hz hu hc hb0 hε hsmall hρ hCs + +lemma eventually_physicalValue_at_hit_general (hfin : firstLiveDistanceStop (γ sample) z ε ≠ ⊤) : + ∀ᶠ n : ℕ in atTop, ENNReal.ofReal ((Cs n).physicalValue κ B γ ε sample) = + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z ε := by + obtain ⟨t,ht,hzt,hd,hmin⟩ := PhysicalStop.finite_spec h.1 hfin + obtain ⟨η,hη,hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + have hδ : ∀ᶠ n : ℕ in atTop, (Cs n).angle < η := + hCs.eventually (gt_mem_nhds hη) + filter_upwards [hδ] with n hn + let C := Cs n + have htc : (t:ℝ) ≤ C.stopTime κ B sample := by + by_contra hnot + have hlt : C.stopTime κ B sample < t := lt_of_not_ge hnot + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · have hh := h.radius_ge_before_distance_stop hε hsmall + (t := ⟨C.stopTime κ B sample,(C.bounds κ B sample).1⟩) + (by rw [ht]; exact ENNReal.coe_le_coe.2 hlt.le) + (C.source_live κ B sample h hz hu hc hb0) + change ε/4 ≤ loewnerRadius (g sample) (C.stopTime κ B sample) z at hh + rw [hr] at hh + exact (not_lt_of_ge hh) hρ + · have hh := hm (C.stopTime κ B sample) ⟨(C.bounds κ B sample).1,hlt.le⟩ + rw [hs] at hh + exact (not_lt_of_ge hh) hn + have he : C.physicalTime κ B γ ε sample = t := by + rw [Cutoff.physicalTime,ht,PhysicalStop.cap_coe htc] + have hp : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + rw [physicalStoppedDensity,ht,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal,hp, + C.physicalValue_eq_source κ B γ g f sample h hz hu hc hb0 ε,he] + +lemma tendsto_physicalValue_killed_general (hκ : 0 < κ ∧ κ < 8) : + Tendsto (fun n : ℕ => ENNReal.ofReal ((Cs n).physicalValue κ B γ ε sample)) atTop + (𝓝 (physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z ε)) := by + by_cases he : firstLiveDistanceStop (γ sample) z ε = ⊤ + · rw [physicalStoppedDensity,he,ite_eq_left rfl] + have ha : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + have hlim := hCs.rpow_const_nhds_zero ha + have hlim' : Tendsto (fun n : ℕ => ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) * + ((Cs n).angle)^(8/κ-1)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul hlim + have hl : Tendsto (fun n : ℕ => (Cs n).physicalValue κ B γ ε sample) atTop (𝓝 0) := by + apply squeeze_zero (fun n => (Cs n).physicalValue_nonneg κ B γ ε sample) _ hlim' + intro n + let C := Cs n + have ht : C.physicalTime κ B γ ε sample = C.stopTime κ B sample := by + simp only [Cutoff.physicalTime,PhysicalStop.cap,he,ite_true] + have hv : C.physicalValue κ B γ ε sample = C.value κ B sample := by + simp only [Cutoff.physicalValue,ht,Cutoff.value] + rw [hv] + have hs : loewnerAngleSine κ (fun t => B t sample) (g sample) (C.stopTime κ B sample) z = C.angle := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · have hh := h.radius_ge_before_distance_stop hε hsmall + (t := ⟨C.stopTime κ B sample,(C.bounds κ B sample).1⟩) + (by rw [he]; exact le_top) (C.source_live κ B sample h hz hu hc hb0) + change ε/4 ≤ loewnerRadius (g sample) (C.stopTime κ B sample) z at hh + rw [hr] at hh + exact False.elim ((not_lt_of_ge hh) hρ) + · exact hs + exact C.angle_exit_bound κ B sample h hz hu hc hb0 hκ hs + simpa only [ENNReal.ofReal_zero,Function.comp_def] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hl + · have hh := eventually_physicalValue_at_hit_general κ B γ g f sample h hz hu hc hb0 hε hsmall hρ Cs hCs he + exact tendsto_const_nhds.congr' (hh.mono (fun _ heq => heq.symm)) + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.JointStopped +open LoewnerCutoff + +def good {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I,ℝ)) (z : ℂ) (t : ℝ) : Prop := + t ∈ Icc 0 T ∧ ∀ q : I, ε ≤ (position hε hT U z (t*q)).im + +lemma good_height {ε T t : ℝ} {hε : 0 < ε} {hT : 0 ≤ T} + {U : C(I,ℝ)} {z : ℂ} (hg : good hε hT U z t) : + ∀ s ∈ Icc 0 t, ε ≤ (position hε hT U z s).im := by + intro s hs + by_cases ht : t = 0 + · have hz : s=0 := le_antisymm (ht ▸ hs.2) hs.1 + simpa only [ht,hz,zero_mul] using hg.2 (0:I) + · have htp : 0 < t := lt_of_le_of_ne hg.1.1 (Ne.symm ht) + let q : I := ⟨s/t,⟨div_nonneg hs.1 hg.1.1,(div_le_one htp).2 hs.2⟩⟩ + have he : t*(q:ℝ) = s := mul_div_cancel₀ _ ht + simpa only [he] using hg.2 q + +lemma good_closed {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + IsClosed {p : (C(I,ℝ) × ℂ) × ℝ | good hε hT p.1.1 p.1.2 p.2} := by + have ht : IsClosed {p : (C(I,ℝ) × ℂ) × ℝ | p.2 ∈ Icc 0 T} := isClosed_Icc.preimage continuous_snd + simp only [good,ofPred_and,ofPred_forall] + apply ht.inter + apply isClosed_iInter + intro q + apply isClosed_le continuous_const + exact Complex.continuous_im.comp ((continuous_mark_position hε hT).comp + (continuous_fst.prodMk (continuous_snd.mul continuous_const))) + +lemma good_live {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing driver γ g f) + {ε T t : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I,ℝ)) (z : ℂ) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (hg : good hε hT U z t) : + z ∈ localizationDomain γ t ∧ EqOn (fun s => g s z) (position hε hT U z) (Icc 0 t) := by + have hd (s : ℝ) (hs : s ∈ Icc 0 t) : + HasDerivWithinAt (position hε hT U z) + (velocity ε (driver s) (position hε hT U z s)) (Icc 0 t) s := by + have hsT : s ∈ Icc 0 T := ⟨hs.1,hs.2.trans hg.1.2⟩ + rw [← hU hsT] + exact (position_derivWithin hε hT U z hsT).mono (Icc_subset_Icc le_rfl hg.1.2) + have hh := hm.cutoff_solution_live hε hg.1.1 hd (good_height hg) + simpa only [position_initial] using hh + +lemma good_of_live {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {ε T t : ℝ} (hm : IsLoewnerTraceUsing driver γ g f) (hc : ContinuousOn driver (Icc 0 T)) + (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I,ℝ)) (z : ℂ) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (ht : t ∈ Icc 0 T) (hz : z ∈ localizationDomain γ t) (hheight : ε ≤ (g t z).im) : + good hε hT U z t := by + have hh (s : ℝ) (hs : s ∈ Icc 0 t) : ε ≤ (g s z).im := + hheight.trans (hm.height_antitone ht.1 hz hs ⟨ht.1,le_rfl⟩ hs.2) + have hpos (s : ℝ) (hs : s ∈ Icc 0 t) : + HasDerivWithinAt (position hε hT U z) + (velocity ε (extendDriver T U s) (position hε hT U z s)) (Icc 0 t) s := + (position_derivWithin hε hT U z ⟨hs.1,hs.2.trans ht.2⟩).mono (Icc_subset_Icc le_rfl ht.2) + have hsource (s : ℝ) (hs : s ∈ Icc 0 t) : + HasDerivWithinAt (fun r => g r z) (velocity ε (extendDriver T U s) (g s z)) (Icc 0 t) s := by + rw [velocity_eq (hh s hs),hU ⟨hs.1,hs.2.trans ht.2⟩] + exact hm.hasDerivWithinAt_eval ht.1 (hc.mono (Icc_subset_Icc le_rfl ht.2)) hz hs + have he := solution_eq hε hpos hsource (by rw [position_initial,hm.initial z hz.1.1]) + refine ⟨ht,fun q => ?_⟩ + have hs : t*(q:ℝ) ∈ Icc 0 t := ⟨mul_nonneg ht.1 q.property.1,by simpa only [mul_one] using mul_le_mul_of_nonneg_left q.property.2 ht.1⟩ + rw [he hs] + exact hh _ hs + +lemma log_of_good {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {ε T t : ℝ} (hm : IsLoewnerTraceUsing driver γ g f) (hc : ContinuousOn driver (Icc 0 T)) + (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I,ℝ)) (z : ℂ) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (hg : good hε hT U z t) : + logDerivative hε hT U z t = Real.log ‖deriv (g t) z‖ := by + have hl := good_live hm hε hT U z hU hg + have hct := hc.mono (Icc_subset_Icc le_rfl hg.1.2) + rw [logDerivative_eq_integral hε hT U z hg.1,hm.log_deriv_norm_eq hg.1.1 hct hl.1] + have hi := (hm.continuous_spatialCoefficient hg.1.1 hct hl.1).intervalIntegrable_of_Icc (μ := volume) hg.1.1 + rw [← Complex.reCLM_apply,← Complex.reCLM.intervalIntegral_comp_comm hi] + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le hg.1.1] at hs + unfold variation + rw [clampIm_eq (by simpa using good_height hg s hs),← hl.2 hs,hU ⟨hs.1,hs.2.trans hg.1.2⟩] + rfl + +end SLEExactGauge.JointStopped + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.JointStopped +open LoewnerCutoff +local instance meshExponentsGreenRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsGreenRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ + +lemma field_good {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {ε T t : ℝ} (hm : IsLoewnerTraceUsing driver γ g f) (hc : ContinuousOn driver (Icc 0 T)) + (hε : 0 < ε) (hT : 0 ≤ T) (p a : ℝ) + (U : C(I,ℝ)) (z : ℂ) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (hg : good hε hT U z t) : + LoewnerField.field hε hT p a 1 U z t (extendDriver T U t) = + (loewnerRadius g t z)^(-p)*((g t z).im/‖g t z-(driver t:ℂ)‖)^a := by + have hl := good_live hm hε hT U z hU hg + have hy : ε ≤ (position hε hT U z t).im := good_height hg t ⟨hg.1.1,le_rfl⟩ + rw [LoewnerField.field,GreenPhysical.green_eq_source _ _ _ _ _ (LoewnerField.height_pos hε hT U z t), + LoewnerField.height,max_eq_right hy,log_of_good hm hc hε hT U z hU hg, + Real.exp_log (norm_pos_iff.2 (hm.deriv_ne_zero hg.1.1 hl.1)),← hl.2 ⟨hg.1.1,le_rfl⟩, + hU hg.1,one_mul] + simp only [loewnerRadius,Complex.norm_def,Complex.normSq_apply,Complex.sub_re, + Complex.ofReal_re,Complex.sub_im,Complex.ofReal_im,sub_zero,pow_two] + +def killedGreen (driver : ℝ → ℝ) (γ : ℝ → ℂ) (g : ℝ → ℂ → ℂ) + (p a : ℝ) (z : ℂ) (t : ℝ) : ℝ := + if z ∈ localizationDomain γ t then + (loewnerRadius g t z)^(-p)*((g t z).im/‖g t z-(driver t:ℂ)‖)^a else 0 + +def greenApprox {T : ℝ} (hT : 0 ≤ T) (p a : ℝ) (n : ℕ) + (q : (C(I,ℝ) × ℂ) × ℝ) : ℝ := + if good (show 0 < 1/((n:ℝ)+1) by positivity) hT q.1.1 q.1.2 q.2 then + LoewnerField.field (show 0 < 1/((n:ℝ)+1) by positivity) hT p a 1 q.1.1 q.1.2 q.2 + (extendDriver T q.1.1 q.2) else 0 + +lemma measurable_greenApprox {T : ℝ} (hT : 0 ≤ T) (p a : ℝ) (n : ℕ) : + Measurable (greenApprox hT p a n) := by + unfold greenApprox + exact Measurable.ite (good_closed (show 0 < 1/((n:ℝ)+1) by positivity) hT).measurableSet + (continuous_mark_green (show 0 < 1/((n:ℝ)+1) by positivity) hT p a).measurable measurable_const + +lemma eventually_greenApprox {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {T t : ℝ} (hm : IsLoewnerTraceUsing driver γ g f) (hc : ContinuousOn driver (Icc 0 T)) + (hT : 0 ≤ T) (p a : ℝ) (U : C(I,ℝ)) (z : ℂ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) (ht : t ∈ Icc 0 T) : + ∀ᶠ n : ℕ in atTop, greenApprox hT p a n ((U,z),t) = killedGreen driver γ g p a z t := by + classical + by_cases hz : z ∈ localizationDomain γ t + · have hp := hm.im_pos ht.1 hz + have hlim : Tendsto (fun n : ℕ => 1/((n:ℝ)+1)) atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + filter_upwards [hlim.eventually (gt_mem_nhds hp)] with n hn + have hg := good_of_live hm hc (show 0 < 1/((n:ℝ)+1) by positivity) hT U z hU ht hz hn.le + rw [greenApprox,ite_eq_left hg,killedGreen,ite_eq_left hz] + exact field_good hm hc _ hT p a U z hU hg + · apply Filter.Eventually.of_forall + intro n + have hn : ¬ good (show 0 < 1/((n:ℝ)+1) by positivity) hT U z t := + fun hg => hz (good_live hm _ hT U z hU hg).1 + simp only [greenApprox,hn,ite_false,killedGreen,hz] + +def observedGreen {T : ℝ} (hT : 0 ≤ T) (p a : ℝ) (q : (C(I,ℝ) × ℂ) × ℝ) : ℝ := + ContinuousDriver.selectedLimit 0 (fun n => greenApprox hT p a n q) + +lemma measurable_observedGreen {T : ℝ} (hT : 0 ≤ T) (p a : ℝ) : + Measurable (observedGreen hT p a) := + ContinuousDriver.measurable_selectedLimit 0 _ (fun n => measurable_greenApprox hT p a n) + +lemma observedGreen_eq {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {T t : ℝ} (hm : IsLoewnerTraceUsing driver γ g f) (hc : ContinuousOn driver (Icc 0 T)) + (hT : 0 ≤ T) (p a : ℝ) (U : C(I,ℝ)) (z : ℂ) + (hU : EqOn (extendDriver T U) driver (Icc 0 T)) (ht : t ∈ Icc 0 T) : + observedGreen hT p a ((U,z),t) = killedGreen driver γ g p a z t := by + apply ContinuousDriver.selectedLimit_eq + apply tendsto_const_nhds.congr' + filter_upwards [eventually_greenApprox hm hc hT p a U z hU ht] with n hn + exact hn.symm + +end SLEExactGauge.JointStopped + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Classical +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.JointStopped +open LoewnerCutoff +local instance meshExponentsObservedRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsObservedRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsObservedComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsObservedComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def observedPhysical {T : ℝ} (hT : 0 ≤ T) (p a e : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) : ℝ≥0∞ := + if CompactHit.hits e (q.1.2,q.2) then + ENNReal.ofReal (observedGreen hT p a ((q.1.1,q.2),CompactHit.realTime T e q.1.2 q.2)) else 0 + +lemma measurable_observedPhysical {T : ℝ} (hT : 0 ≤ T) (p a e : ℝ) : + Measurable (observedPhysical hT p a e) := by + have hv : Measurable (fun q : (C(I,ℝ) × C(I,ℂ)) × ℂ => (q.1.2,q.2)) := + measurable_fst.snd.prodMk measurable_snd + have ht : Measurable (fun q : (C(I,ℝ) × C(I,ℂ)) × ℂ => CompactHit.realTime T e q.1.2 q.2) := + measurable_const.mul (measurable_subtype_coe.comp ((CompactHit.measurable_time e).comp hv)) + apply Measurable.ite ((CompactHit.hits_closed e).measurableSet.preimage hv) + · exact ENNReal.measurable_ofReal.comp ((measurable_observedGreen hT p a).comp + ((measurable_fst.fst.prodMk measurable_snd).prodMk ht)) + · exact measurable_const + +lemma observedPhysical_eq {κ : ℝ} {B : ℝ≥0 → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + {T : ℝ} (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal) γ g f) + (hc : ContinuousOn (fun t => Real.sqrt κ*B t.toNNReal) (Icc 0 T)) + (hT : 0 < T) (e : ℝ) (U : C(I,ℝ)) (V : C(I,ℂ)) (z : ℂ) + (hU : EqOn (extendDriver T U) (fun t => Real.sqrt κ*B t.toNNReal) (Icc 0 T)) + (hV : ∀ q : I, V q = γ (T*q)) : + observedPhysical hT.le (codimension κ) (8/κ-1) e ((U,V),z) = + if firstLiveDistanceStop γ z e ≤ ENNReal.ofReal T then + physicalStoppedDensity κ B γ g z e else 0 := by + classical + have heq := CompactHit.live_byTime_iff hT V γ z hm.1 hV (e := e) + have hg := observedGreen_eq hm hc hT.le (codimension κ) (8/κ-1) U z hU + (CompactHit.realTime_bounds hT.le e V z) + unfold observedPhysical + by_cases hh : CompactHit.hits e (V,z) + · rw [ite_eq_left hh,hg] + by_cases hl : z ∈ localizationDomain γ (CompactHit.realTime T e V z) + · have hstop := CompactHit.realTime_stop hT V γ z hV hh hl + rw [ite_eq_left (heq.2 ⟨hh,hl⟩),physicalStoppedDensity,hstop,ite_eq_right ENNReal.ofReal_ne_top, + ENNReal.toReal_ofReal (CompactHit.realTime_bounds hT.le e V z).1, + killedGreen,ite_eq_left hl] + simp only [loewnerAngleSine,Complex.ofReal_mul] + · rw [ite_eq_right (fun h => hl (heq.1 h).2),killedGreen,ite_eq_right hl,ENNReal.ofReal_zero] + · rw [ite_eq_right hh,ite_eq_right (fun h => hh (heq.1 h).1)] + +end SLEExactGauge.JointStopped + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ContinuousDriver +local instance meshExponentsDriverRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsDriverRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsDriverComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsDriverComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def complexParts (p : C(I,ℝ) × C(I,ℝ)) : C(I,ℂ) := + ⟨fun q => (p.1 q:ℂ)+(p.2 q:ℂ)*Complex.I, + (Complex.continuous_ofReal.comp p.1.continuous).add + ((Complex.continuous_ofReal.comp p.2.continuous).mul continuous_const)⟩ + +lemma continuous_complexParts : Continuous complexParts := by + apply ContinuousMap.continuous_of_continuous_uncurry + exact (Complex.continuous_ofReal.comp (continuous_eval.comp (continuous_fst.fst.prodMk continuous_snd))).add + ((Complex.continuous_ofReal.comp (continuous_eval.comp (continuous_fst.snd.prodMk continuous_snd))).mul continuous_const) + +def complexPath (x : I → ℂ) : C(I,ℂ) := + complexParts (path (fun q => (x q).re),path (fun q => (x q).im)) + +lemma complexPath_eval {x : I → ℂ} (hx : Continuous x) (q : I) : complexPath x q = x q := by + change (path (fun q => (x q).re) q:ℂ)+(path (fun q => (x q).im) q:ℂ)*Complex.I = x q + rw [path_eval_of_continuous (show Continuous (fun q => (x q).re) from Complex.continuous_re.comp hx), + path_eval_of_continuous (show Continuous (fun q => (x q).im) from Complex.continuous_im.comp hx)] + exact Complex.re_add_im _ + +lemma aemeasurable_complexPath {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (x : Ω → I → ℂ) (hx : ∀ q, AEMeasurable (fun sample => x sample q) P) : + AEMeasurable (fun sample => complexPath (x sample)) P := by + exact continuous_complexParts.measurable.comp_aemeasurable + ((aemeasurable_path (fun sample q => (x sample q).re) (fun q => Complex.measurable_re.comp_aemeasurable (hx q))).prodMk + (aemeasurable_path (fun sample q => (x sample q).im) (fun q => Complex.measurable_im.comp_aemeasurable (hx q)))) + +lemma exists_measurable_trace_path {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (γ : Ω → ℝ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hc : ∀ᵐ sample ∂P, ContinuousOn (γ sample) (Ici 0)) + (T : ℝ) (hT : 0 ≤ T) : + ∃ V : Ω → C(I,ℂ), Measurable V ∧ ∀ᵐ sample ∂P, ∀ q : I, V sample q = γ sample (T*q) := by + let V₀ := fun sample => complexPath (fun q : I => γ sample (T*q)) + have hV : AEMeasurable V₀ P := aemeasurable_complexPath _ (fun q => hγ _ (mul_nonneg hT q.property.1)) + refine ⟨hV.mk V₀,hV.measurable_mk,?_⟩ + filter_upwards [hV.ae_eq_mk,hc] with sample he hcont + intro q + rw [← he] + apply complexPath_eval + exact hcont.comp_continuous (continuous_const.mul continuous_subtype_val) (fun q => mul_nonneg hT q.property.1) + +end SLEExactGauge.ContinuousDriver + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge +local instance meshExponentsJointRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsJointRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsJointComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsJointComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +theorem jointFiniteTimePhysicalDensity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (_hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (T : ℝ) (hT : 0 < T) (e : ℝ) (_he : 0 < e) : + ∃ W : Ω × ℂ → ℝ≥0∞, Measurable W ∧ ∀ᵐ sample ∂P, ∀ z : ℂ, + W (sample,z) = if firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T + then physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e + else 0 := by + have hcont : ∀ᵐ sample ∂P, ContinuousOn (γ sample) (Ici 0) := hmaps.mono (fun _ hm => hm.1) + obtain ⟨V,hVm,hVe⟩ := ContinuousDriver.exists_measurable_trace_path γ hγ hcont T hT.le + let S : ℝ≥0 := ⟨T,hT.le⟩ + have hu := BrownianDriver.path_aemeasurable hB (Real.sqrt κ) S + let U := hu.mk (BrownianDriver.path B (Real.sqrt κ) S) + have hUm : Measurable U := hu.measurable_mk + let W := fun q : Ω × ℂ => JointStopped.observedPhysical hT.le (codimension κ) (8/κ-1) e + ((U q.1,V q.1),q.2) + refine ⟨W,?_,?_⟩ + · exact (JointStopped.measurable_observedPhysical hT.le (codimension κ) (8/κ-1) e).comp + (((hUm.comp measurable_fst).prodMk (hVm.comp measurable_fst)).prodMk measurable_snd) + · filter_upwards [hmaps,hB.cont,hu.ae_eq_mk,hVe] with sample hm hb huEq hvEq + change BrownianDriver.path B (Real.sqrt κ) S sample = U sample at huEq + intro z + apply JointStopped.observedPhysical_eq (κ := κ) (B := fun t => B t sample) hm + (continuous_const.mul (hb.comp continuous_real_toNNReal)).continuousOn hT e (U sample) (V sample) z _ hvEq + intro t ht + rw [← huEq] + exact BrownianDriver.extend_eq B (Real.sqrt κ) S sample hb ht + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +theorem jointPhysicalDensity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun ω => γ ω t) P) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (e : ℝ) (he : 0 < e) : + ∃ W : Ω × ℂ → ℝ≥0∞, Measurable W ∧ ∀ᵐ ω ∂P, ∀ z, + W (ω,z) = physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e := by + choose W hW hWe using (fun n : ℕ => jointFiniteTimePhysicalDensity κ hκ B hB γ g f hγ hmaps + ((n:ℝ)+1) (by positivity) e he) + refine ⟨fun q => ⨆ n, W n q,Measurable.iSup hW,?_⟩ + filter_upwards [ae_all_iff.2 hWe] with ω hω z + simp only [hω] + by_cases ht : firstLiveDistanceStop (γ ω) z e = ⊤ + · simp only [physicalStoppedDensity,ht,ite_true,ite_self,iSup_const] + · have hf := ENNReal.ofReal_toReal ht + obtain ⟨n,hn⟩ := exists_nat_gt (firstLiveDistanceStop (γ ω) z e).toReal + have hb : firstLiveDistanceStop (γ ω) z e ≤ ENNReal.ofReal ((n:ℝ)+1) := by + rw [← hf] + exact ENNReal.ofReal_le_ofReal (by linarith) + apply le_antisymm + · apply iSup_le + intro m + split_ifs + · exact le_rfl + · exact zero_le + · exact le_iSup_of_le n (by rw [ite_eq_left hb]) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open FiniteTilt +local instance meshExponentsDensityRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsDensityRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsDensityComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsDensityComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +lemma physicalStoppedDensity_ne_top (κ : ℝ) (B : ℝ≥0 → ℝ) (γ : ℝ → ℂ) + (g : ℝ → ℂ → ℂ) (z : ℂ) (e : ℝ) : physicalStoppedDensity κ B γ g z e ≠ ⊤ := by + simp only [physicalStoppedDensity] + split_ifs <;> simp + +lemma physicalValue_real_tendsto {Ω : Type*} + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) + (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + {e : ℝ} (he : 0 < e) (hes : e < z.im) + (hr : (2*z.im)*Real.exp (-u) < e/4) + (Cs : ℕ → Cutoff z u) (hCs : Tendsto (fun n => (Cs n).angle) atTop (𝓝 0)) : + Tendsto (fun n => (Cs n).physicalValue κ B γ e ω) atTop + (𝓝 (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal) := by + have hh := tendsto_physicalValue_killed_general κ B γ g f ω hm hz hu hc hb0 he hes hr Cs hCs hκ + have ht := (ENNReal.continuousAt_toReal (physicalStoppedDensity_ne_top κ (fun t => B t ω) + (γ ω) (g ω) z e)).tendsto.comp hh + simpa only [Function.comp_def,ENNReal.toReal_ofReal ((Cs _).physicalValue_nonneg κ B γ e ω)] using ht + +lemma exponential_bound_of_ae_tendsto {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (X : ℕ → Ω → ℝ) (Y : Ω → ℝ) + (hX : ∀ n, AEMeasurable (X n) P) + (hlim : ∀ᵐ ω ∂P, Tendsto (fun n => X n ω) atTop (𝓝 (Y ω))) + (K θ : ℝ) + (hb : ∀ n, (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*X n ω)) ∂P) ≤ ENNReal.ofReal (Real.exp K)) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*Y ω)) ∂P) ≤ ENNReal.ofReal (Real.exp K) := by + have hm (n : ℕ) := ((hX n).const_mul θ).exp.ennreal_ofReal + have hl : ∀ᵐ ω ∂P, Tendsto (fun n => ENNReal.ofReal (Real.exp (θ*X n ω))) atTop + (𝓝 (ENNReal.ofReal (Real.exp (θ*Y ω)))) := by + filter_upwards [hlim] with ω hω + exact ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (Real.continuous_exp.continuousAt.tendsto.comp (hω.const_mul θ)) + calc + _ = ∫⁻ ω, liminf (fun n => ENNReal.ofReal (Real.exp (θ*X n ω))) atTop ∂P := by + apply lintegral_congr_ae + filter_upwards [hl] with ω hω + exact hω.liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ ω, ENNReal.ofReal (Real.exp (θ*X n ω)) ∂P) atTop := lintegral_liminf_le' hm + _ ≤ _ := liminf_le_of_frequently_le (Filter.Eventually.frequently (Filter.Eventually.of_forall hb)) + +lemma common_slab_limit {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {A : Set ℂ} {u : ℂ → ℝ} (Cs : ℕ → CommonCutoff A u) + (hCs : Tendsto (fun n => (Cs n).angle) atTop (𝓝 0)) + (hA : MeasurableSet A) [IsFiniteMeasure (volume.restrict A)] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hhalf : ∀ z ∈ A, z ∈ halfPlane) (hu : ∀ z ∈ A, 0 < u z) + {ρ : ℝ} (hr : ∀ z ∈ A, (2*z.im)*Real.exp (-u z) = ρ) + (V : ℕ → Ω → C(I,ℂ)) (hVm : ∀ n, Measurable (V n)) + (hV : ∀ n, ∀ᵐ ω ∂P, ∀ q : I, V n ω q = γ ω (((Cs n).horizon:ℝ)*q)) + (e r : ℝ) (he : 0 < e) (her : e ≤ r) (hrs : ∀ z ∈ A, r < z.im) (hρ : ρ < e/4) : + ∀ᵐ ω ∂P, Tendsto (fun n => ∫ z in A, + observedDifference (Cs n).height_pos (Cs n).horizon.coe_nonneg κ ρ (Cs n).angle e r + ((BrownianDriver.path B (Real.sqrt κ) (Cs n).horizon ω,V n ω),z)) atTop + (𝓝 (∫ z in A, (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal - + (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z r).toReal)) := by + let F := fun n (q : Ω × ℂ) => observedDifference (Cs n).height_pos (Cs n).horizon.coe_nonneg κ ρ (Cs n).angle e r + ((BrownianDriver.path B (Real.sqrt κ) (Cs n).horizon q.1,V n q.1),q.2) + have hm (n : ℕ) : AEStronglyMeasurable (F n) (P.prod (volume.restrict A)) := + (observedDifference_aemeasurable hB _ (Cs n).height_pos κ ρ (Cs n).angle e r (Cs n).horizon (V n) (hVm n)).aestronglyMeasurable + have hf (n : ℕ) : ∀ᵐ ω ∂P, AEStronglyMeasurable (fun z => F n (ω,z)) (volume.restrict A) := (hm n).prodMk_left + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,ae_all_iff.2 hV,ae_all_iff.2 hf] + with ω hw hc hb0 hv hfω + have heq (n : ℕ) (z : ℂ) (hz : z ∈ A) : F n (ω,z) = + ((Cs n).at z hz).physicalValue κ B γ e ω - ((Cs n).at z hz).physicalValue κ B γ r ω := by + dsimp only [F,observedDifference] + rw [observedValue_eq (Cs n) κ B γ g f ω hw hc hb0 z hz (hhalf z hz) (hu z hz) (hr z hz) (V n ω) (hv n) e, + observedValue_eq (Cs n) κ B γ g f ω hw hc hb0 z hz (hhalf z hz) (hu z hz) (hr z hz) (V n ω) (hv n) r] + apply tendsto_integral_of_dominated_convergence (fun _ : ℂ => 2*ρ^(-(1-κ/8))) hfω (integrable_const _) + · intro n + filter_upwards [ae_restrict_mem hA] with z hz + rw [heq n z hz,Real.norm_eq_abs] + have hn (s : ℝ) := ((Cs n).at z hz).physicalValue_nonneg κ B γ s ω + have hb (s : ℝ) := ((Cs n).at z hz).physicalValue_bound κ hκ B γ s ω (hhalf z hz) (hu z hz) hc hb0 + rw [hr z hz] at hb + calc + _ ≤ |((Cs n).at z hz).physicalValue κ B γ e ω| + |((Cs n).at z hz).physicalValue κ B γ r ω| := abs_sub _ _ + _ ≤ 2*ρ^(-(1-κ/8)) := by rw [abs_of_nonneg (hn e),abs_of_nonneg (hn r)]; linarith [hb e,hb r] + · filter_upwards [ae_restrict_mem hA] with z hz + have hl (s : ℝ) (hs : 0 < s) (hse : s < z.im) (hρs : ρ < s/4) := physicalValue_real_tendsto κ hκ B γ g f ω hw + (hhalf z hz) (hu z hz) hc hb0 hs hse (by rw [hr z hz]; exact hρs) (fun n => (Cs n).at z hz) hCs + exact ((hl e he (her.trans_lt (hrs z hz)) hρ).sub (hl r (he.trans_le her) (hrs z hz) (by linarith))).congr + (fun n => (heq n z hz).symm) + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.FiniteTilt + +lemma compact_log_cutoffs {A : Set ℂ} (hA : IsCompact A) (hne : A.Nonempty) + (hy : ∀ z ∈ A, 1 ≤ z.im) {ρ : ℝ} (hρ : 0 < ρ) (hρs : ρ < 1) : + ∃ Cs : ℕ → CommonCutoff A (fun z => Real.log (2*z.im/ρ)), + Tendsto (fun n => (Cs n).angle) atTop (𝓝 0) := by + have hy0 (z : ℂ) (hz : z ∈ A) : 0 < z.im := lt_of_lt_of_le (by norm_num) (hy z hz) + have hR (z : ℂ) (hz : z ∈ A) : 1 < 2*z.im/ρ := (lt_div_iff₀ hρ).2 (by linarith [hy z hz]) + have hu (z : ℂ) (hz : z ∈ A) : 0 < Real.log (2*z.im/ρ) := Real.log_pos (hR z hz) + have huc : ContinuousOn (fun z : ℂ => Real.log (2*z.im/ρ)) A := + ((continuous_const.mul Complex.continuous_im).div_const ρ).continuousOn.log (fun z hz => (lt_trans zero_lt_one (hR z hz)).ne') + have hsc : ContinuousOn (fun z : ℂ => z.im/‖z‖) A := Complex.continuous_im.continuousOn.div + continuous_norm.continuousOn (fun z hz => norm_ne_zero_iff.2 (by intro he; simpa [he] using hy0 z hz)) + obtain ⟨zH,hzH,hH⟩ := hA.exists_isMaxOn hne Complex.continuous_im.continuousOn + obtain ⟨zU,hzU,hU⟩ := hA.exists_isMaxOn hne huc + obtain ⟨zS,hzS,hS⟩ := hA.exists_isMinOn hne hsc + exact commonCutoffs (hy zH hzH) (hu zU hzU).le (initial_sine_pos (hy0 zS hzS)) + (fun z hz => ⟨hy z hz,hH hz⟩) (fun z hz => ⟨(hu z hz).le,hU hz⟩) (fun z hz => hS hz) + +lemma logRadius_pos {z : ℂ} (hz : 1 ≤ z.im) {ρ : ℝ} (hρ : 0 < ρ) (hρs : ρ < 1) : + 0 < Real.log (2*z.im/ρ) := Real.log_pos ((lt_div_iff₀ hρ).2 (by linarith)) + +lemma logRadius_eq {z : ℂ} (hz : 0 < z.im) {ρ : ℝ} (hρ : 0 < ρ) : + (2*z.im)*Real.exp (-Real.log (2*z.im/ρ)) = ρ := by + rw [Real.exp_neg,Real.exp_log (by positivity)] + field_simp + +lemma collar_height {z₀ : ℂ} (hcollar : closedBall z₀ 2 ⊆ halfPlane) : + ∀ z ∈ closedBall z₀ 1, 1 ≤ z.im := by + have hbase : 2 < z₀.im := by + have hm : z₀-2*Complex.I ∈ closedBall z₀ 2 := by + rw [mem_closedBall,dist_eq_norm] + simp + have hh := hcollar hm + change 0 < (z₀-2*Complex.I).im at hh + norm_num at hh + linarith + intro z hz + have hd := mem_closedBall.1 hz + have hi := Complex.abs_im_le_norm (z-z₀) + rw [Complex.sub_im,← dist_eq_norm] at hi + have hlo := neg_le_abs (z.im-z₀.im) + linarith + +end SLEExactGauge.FiniteTilt + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open FiniteTilt +local instance meshExponentsMgfRealMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance meshExponentsMgfRealBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance meshExponentsMgfComplexMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance meshExponentsMgfComplexBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +theorem physical_slab_mgf : + ∃ J : ℝ, 0 < J ∧ ∀ {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {A : Set ℂ}, IsCompact A → A.Nonempty → (∀ z ∈ A, 1 ≤ z.im) → + ∀ (κ : ℝ), 0 < κ ∧ κ ≤ 4 → ∀ (B : ℝ≥0 → Ω → ℝ), IsBrownianReal B P → + ∀ (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ), + (∀ t, 0 ≤ t → AEMeasurable (fun ω => γ ω t) P) → + (∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) → + ∀ e r : ℝ, 0 < e → e ≤ r → r < 1 → ∀ θ : ℝ, + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(∫ z in A, + (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal - + (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z r).toReal))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(2*(Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8)))^2* + (J*r^2)*(volume A).toReal)/2)) := by + obtain ⟨J,hJ,hJb⟩ := Mesh.loewner_boundary_layer + refine ⟨J,hJ,?_⟩ + intro Ω m P hP A hA hne hy κ hκ B hB γ g f hγ hmaps e r he her hr θ + have hκ' : 0 < κ ∧ κ < 8 := ⟨hκ.1,by linarith [hκ.2]⟩ + let : IsFiniteMeasure (volume.restrict A) := isFiniteMeasure_restrict.2 hA.measure_lt_top.ne + let ρ := e/8 + have hρ : 0 < ρ := by dsimp [ρ]; positivity + have hρs : ρ < 1 := by dsimp [ρ]; linarith + obtain ⟨Cs,hCs⟩ := compact_log_cutoffs hA hne hy hρ hρs + have hcont : ∀ᵐ ω ∂P, ContinuousOn (γ ω) (Ici 0) := hmaps.mono (fun _ hw => hw.1) + choose V hVm hV using (fun n => ContinuousDriver.exists_measurable_trace_path γ hγ hcont + ((Cs n).horizon:ℝ) (Cs n).horizon.coe_nonneg) + have hh (z : ℂ) (hz : z ∈ A) : z ∈ halfPlane := lt_of_lt_of_le zero_lt_one (hy z hz) + have hu (z : ℂ) (hz : z ∈ A) : 0 < Real.log (2*z.im/ρ) := logRadius_pos (hy z hz) hρ hρs + have hrad (z : ℂ) (hz : z ∈ A) : (2*z.im)*Real.exp (-Real.log (2*z.im/ρ)) = ρ := logRadius_eq (hh z hz) hρ + let X := fun n ω => ∫ z in A, observedDifference (Cs n).height_pos (Cs n).horizon.coe_nonneg κ ρ (Cs n).angle e r + ((BrownianDriver.path B (Real.sqrt κ) (Cs n).horizon ω,V n ω),z) + have hXm (n : ℕ) : AEMeasurable (X n) P := + (observedDifference_aemeasurable hB (volume.restrict A) (Cs n).height_pos κ ρ (Cs n).angle e r + (Cs n).horizon (V n) (hVm n)).aestronglyMeasurable.integral_prod_right'.aemeasurable + have hlim := common_slab_limit Cs hCs hA.measurableSet κ hκ' B hB γ g f hmaps hh hu hrad + V hVm hV e r he her (fun z hz => hr.trans_le (hy z hz)) (by dsimp [ρ]; linarith) + apply exponential_bound_of_ae_tendsto P X _ hXm hlim _ θ + intro n + exact common_slab_mgf (Cs n) hA.measurableSet κ hκ B hB γ g f hmaps hh hu hrad (V n) (hVm n) (hV n) + e r he her (fun z hz => her.trans_lt (hr.trans_le (hy z hz))) J hJ.le + (fun ω hw t ht z hz => hJb _ _ _ _ hw t ht z hz r (he.trans_le her)) θ + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab + +lemma physicalDensity_bound {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (hm : IsLoewnerTraceUsing driver γ g f) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → ℝ) {z : ℂ} {e : ℝ} (he : 0 < e) (hes : e < z.im) : + (physicalStoppedDensity κ B γ g z e).toReal ≤ (e/4)^(-codimension κ) := by + by_cases hf : firstLiveDistanceStop γ z e = ⊤ + · simp only [physicalStoppedDensity,hf,ite_true,ENNReal.toReal_zero] + positivity + obtain ⟨t,ht,hzt,hd,hmin⟩ := PhysicalStop.finite_spec hm.1 hf + have hR := hm.radius_ge_before_distance_stop he hes (t := t) (by rw [ht]) hzt + have hp : 0 ≤ codimension κ := by unfold codimension dimension; linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le); linarith + have hy := hm.im_pos t.coe_nonneg hzt + let w := g t z - (Real.sqrt κ*B t : ℂ) + have hwi : w.im = (g t z).im := by simp [w] + have hwn : 0 < ‖w‖ := norm_pos_iff.2 (by intro hh; have hi := congrArg Complex.im hh; rw [hwi] at hi; simpa using hy.ne' hi) + have hs0 : 0 ≤ loewnerAngleSine κ B g t z := by unfold loewnerAngleSine; positivity + have hs1 : loewnerAngleSine κ B g t z ≤ 1 := by + simp only [loewnerAngleSine,Real.toNNReal_coe] + change (g t z).im / ‖w‖ ≤ 1 + apply (div_le_one hwn).2 + rw [← hwi] + exact Complex.im_le_norm w + have hs := Real.rpow_le_one hs0 hs1 ha + have hR0 : 0 < loewnerRadius g t z := (by positivity : 0 < e/4).trans_le hR + have hrpow := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < e/4) hR (neg_nonpos.2 hp) + have hv0 : 0 ≤ loewnerRadius g t z ^ (-codimension κ) * loewnerAngleSine κ B g t z ^ (8/κ-1) := by positivity + rw [physicalStoppedDensity,ht,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal,ENNReal.toReal_ofReal hv0] + exact (mul_le_of_le_one_right (Real.rpow_nonneg hR0.le _) hs).trans hrpow + +def physicalMass {Ω : Type*} (A : Set ℂ) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (e : ℝ) (ω : Ω) : ℝ := + ∫ z in A, (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal + +lemma physicalMass_nonneg {Ω : Type*} (A : Set ℂ) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g : Ω → ℝ → ℂ → ℂ) (e : ℝ) (ω : Ω) : + 0 ≤ physicalMass A κ B γ g e ω := integral_nonneg (fun _ => ENNReal.toReal_nonneg) + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable (A : Set ℂ) [sfiniteVolume : SFinite (volume.restrict A)] +variable (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) +variable (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) +variable (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun ω => γ ω t) P) +variable (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) +variable (e : ℝ) (he : 0 < e) +include hκ hB hγ hmaps he + +lemma physicalMass_aemeasurable : AEMeasurable (physicalMass A κ B γ g e) P := by + obtain ⟨W,hW,hWe⟩ := jointPhysicalDensity κ hκ B hB γ g f hγ hmaps e he + apply (hW.ennreal_toReal.stronglyMeasurable.integral_prod_right' (ν := volume.restrict A)).aemeasurable.congr + filter_upwards [hWe] with ω hw + exact integral_congr_ae (Filter.Eventually.of_forall (fun z => congrArg ENNReal.toReal (hw z))) + +omit sfiniteVolume in +lemma physicalDensity_integrable [SFinite (volume.restrict A)] [IsFiniteMeasure (volume.restrict A)] (hA : MeasurableSet A) + (hes : ∀ z ∈ A, e < z.im) : + ∀ᵐ ω ∂P, Integrable (fun z => (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal) (volume.restrict A) := by + obtain ⟨W,hW,hWe⟩ := jointPhysicalDensity κ hκ B hB γ g f hγ hmaps e he + filter_upwards [hWe,hmaps] with ω hw hm + have hwm : Measurable (fun z => (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal) := by + have hh : Measurable (fun z : ℂ => (W (ω,z)).toReal) := hW.ennreal_toReal.comp (measurable_const.prodMk measurable_id) + convert hh using 1 + funext z + rw [hw z] + apply Integrable.of_bound hwm.aestronglyMeasurable ((e/4)^(-codimension κ)) + filter_upwards [ae_restrict_mem hA] with z hz + rw [Real.norm_eq_abs,abs_of_nonneg ENNReal.toReal_nonneg] + exact physicalDensity_bound hm κ hκ (fun t => B t ω) he (hes z hz) + +lemma physicalMass_lintegral [IsFiniteMeasure (volume.restrict A)] (hA : MeasurableSet A) + (hes : ∀ z ∈ A, e < z.im) : + ∀ᵐ ω ∂P, ENNReal.ofReal (physicalMass A κ B γ g e ω) = + ∫⁻ z in A, physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e := by + filter_upwards [physicalDensity_integrable A κ hκ B hB γ g f hγ hmaps e he hA hes] with ω hi + rw [physicalMass,ofReal_integral_eq_lintegral_ofReal hi (Filter.Eventually.of_forall (fun _ => ENNReal.toReal_nonneg))] + apply lintegral_congr + intro z + exact ENNReal.ofReal_toReal (physicalStoppedDensity_ne_top _ _ _ _ _ _) + +lemma physicalMass_bound [IsFiniteMeasure (volume.restrict A)] (hA : MeasurableSet A) + (hes : ∀ z ∈ A, e < z.im) : + ∀ᵐ ω ∂P, physicalMass A κ B γ g e ω ≤ (volume A).toReal*(e/4)^(-codimension κ) := by + filter_upwards [physicalDensity_integrable A κ hκ B hB γ g f hγ hmaps e he hA hes,hmaps] with ω hi hm + have hh := integral_mono_ae hi (integrable_const ((e/4)^(-codimension κ))) (μ := volume.restrict A) (by + filter_upwards [ae_restrict_mem hA] with z hz + exact physicalDensity_bound hm κ hκ (fun t => B t ω) he (hes z hz)) + simpa only [integral_const,Measure.real,Measure.restrict_apply_univ,smul_eq_mul,physicalMass] using hh + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab + +lemma slab_radius_scale (p : ℝ) {r : ℝ} (hr : 0 < r) : + (r/8)^(-p)*r = (8:ℝ)^p*r^(1-p) := by + rw [Real.div_rpow hr.le (by norm_num),Real.rpow_neg (by norm_num : (0:ℝ) ≤ 8),div_inv_eq_mul, + show 1-p = 1+(-p) by ring,Real.rpow_add hr,Real.rpow_one] + ring + +theorem slab_mass_mgf (κ : ℝ) (hκ : 0 < κ ∧ κ ≤ 4) : + ∃ K : ℝ, 0 < K ∧ ∀ {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ), IsBrownianReal B P → + ∀ (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ), + (∀ t, 0 ≤ t → AEMeasurable (fun ω => γ ω t) P) → + (∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) → + ∀ (z₀ : ℂ), closedBall z₀ 2 ⊆ halfPlane → ∀ e r : ℝ, + 0 < e → e ≤ r → r/2 ≤ e → r < 1 → ∀ θ : ℝ, + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(physicalMass (closedBall z₀ 1) κ B γ g e ω - + physicalMass (closedBall z₀ 1) κ B γ g r ω))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(K*r^(1-codimension κ))^2/2)) := by + obtain ⟨J,hJ,hmgf⟩ := physical_slab_mgf + let L := Real.sqrt κ*(8/κ-1)*(8:ℝ)^(codimension κ) + have hp : 0 ≤ codimension κ := by unfold codimension dimension; linarith [hκ.2] + have ha : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by linarith [hκ.2])) + have hL : 0 < L := mul_pos (mul_pos (Real.sqrt_pos.2 hκ.1) ha) (Real.rpow_pos_of_pos (by norm_num) _) + let K := Real.sqrt (2*J*Real.pi)*L + have hJπ : 0 < 2*J*Real.pi := by positivity + refine ⟨K,mul_pos (Real.sqrt_pos.2 hJπ) hL,?_⟩ + intro Ω m P hP B hB γ g f hγ hmaps z₀ hcollar e r he her hel hr θ + let A := closedBall z₀ (1:ℝ) + have hAc : IsCompact A := isCompact_closedBall _ _ + have hAm : MeasurableSet A := hAc.measurableSet + have hy := FiniteTilt.collar_height hcollar + let : IsFiniteMeasure (volume.restrict A) := isFiniteMeasure_restrict.2 hAc.measure_lt_top.ne + have hκ' : 0 < κ ∧ κ < 8 := ⟨hκ.1,by linarith [hκ.2]⟩ + have hh := hmgf hAc (nonempty_closedBall.2 (by norm_num)) hy κ hκ B hB γ g f hγ hmaps e r he her hr θ + have hIe := physicalDensity_integrable A κ hκ' B hB γ g f hγ hmaps e he hAm + (fun z hz => her.trans_lt (hr.trans_le (hy z hz))) + have hIr := physicalDensity_integrable A κ hκ' B hB γ g f hγ hmaps r (he.trans_le her) hAm + (fun z hz => hr.trans_le (hy z hz)) + have heq : (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(physicalMass A κ B γ g e ω - physicalMass A κ B γ g r ω))) ∂P) = + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(∫ z in A, + (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z e).toReal - + (physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z r).toReal))) ∂P) := by + apply lintegral_congr_ae + filter_upwards [hIe,hIr] with ω hie hir + rw [integral_sub hie hir] + rfl + rw [heq] + apply hh.trans + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.2 + apply div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left _ (sq_nonneg θ)) (by norm_num) + have hr0 := he.trans_le her + have hrad := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < r/8) (by linarith : r/8 ≤ e/4) (neg_nonpos.2 hp) + have hmul : (Real.sqrt κ*(8/κ-1)*(e/4)^(-codimension κ))*r ≤ L*r^(1-codimension κ) := by + calc + _ ≤ (Real.sqrt κ*(8/κ-1)*(r/8)^(-codimension κ))*r := by gcongr + _ = _ := by rw [mul_assoc,slab_radius_scale _ hr0]; dsimp [L]; ring + have hleft : 0 ≤ (Real.sqrt κ*(8/κ-1)*(e/4)^(-codimension κ))*r := by positivity + have hsq := pow_le_pow_left₀ hleft hmul 2 + have hv : (volume A).toReal = Real.pi := by + dsimp [A] + rw [Complex.volume_closedBall] + norm_num [ENNReal.toReal_ofReal Real.pi_pos.le] + rw [hv] + have hcode : 1-κ/8 = codimension κ := by unfold codimension dimension; ring + rw [hcode] + have hmul' := mul_le_mul_of_nonneg_left hsq hJπ.le + dsimp [K] at * + have hsqrt := Real.sq_sqrt hJπ.le + nlinarith + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab + +lemma finite_mgf_sum {Ω ι : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + (t : Finset ι) (Y : ι → Ω → ℝ) (σ : ι → ℝ) + (hσ : ∀ i ∈ t, 0 < σ i) (hY : ∀ i ∈ t, AEMeasurable (Y i) P) + (hmgf : ∀ i ∈ t, ∀ θ : ℝ, (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*Y i ω)) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(σ i)^2/2))) (θ : ℝ) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(∑ i ∈ t, Y i ω))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(∑ i ∈ t, σ i)^2/2)) := by + classical + by_cases ht : t.Nonempty + · let S := ∑ i ∈ t, σ i + have hS : 0 < S := Finset.sum_pos (fun i hi => hσ i hi) ht + let w := fun i => σ i/S + have hw (i : ι) (hi : i ∈ t) : 0 ≤ w i := (div_pos (hσ i hi) hS).le + have hw1 : ∑ i ∈ t, w i = 1 := by simp only [w,← Finset.sum_div,S,div_self hS.ne'] + have hpoint (ω : Ω) : Real.exp (θ*(∑ i ∈ t, Y i ω)) ≤ + ∑ i ∈ t, w i * Real.exp ((θ*S/σ i)*Y i ω) := by + have hh := convexOn_exp.map_sum_le (t := t) (w := w) (p := fun i => (θ*S/σ i)*Y i ω) + hw hw1 (fun _ _ => mem_univ _) + have he : (∑ i ∈ t, w i • ((θ*S/σ i)*Y i ω)) = θ*(∑ i ∈ t, Y i ω) := by + conv_rhs => rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + dsimp [w] + field_simp [hS.ne', (hσ i hi).ne'] + rw [he] at hh + simpa only [smul_eq_mul] using hh + calc + _ ≤ ∫⁻ ω, ∑ i ∈ t, ENNReal.ofReal (w i) * ENNReal.ofReal (Real.exp ((θ*S/σ i)*Y i ω)) ∂P := by + apply lintegral_mono + intro ω + calc + _ ≤ ENNReal.ofReal (∑ i ∈ t, w i * Real.exp ((θ*S/σ i)*Y i ω)) := ENNReal.ofReal_le_ofReal (hpoint ω) + _ = _ := by + rw [ENNReal.ofReal_sum_of_nonneg (fun i hi => mul_nonneg (hw i hi) (Real.exp_pos _).le)] + apply Finset.sum_congr rfl + intro i hi + exact ENNReal.ofReal_mul (hw i hi) + _ = ∑ i ∈ t, ENNReal.ofReal (w i) * (∫⁻ ω, ENNReal.ofReal (Real.exp ((θ*S/σ i)*Y i ω)) ∂P) := by + rw [lintegral_finsetSum' _ (fun i hi => ((hY i hi).const_mul _).exp.ennreal_ofReal.const_mul _)] + apply Finset.sum_congr rfl + intro i hi + exact lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ ∑ i ∈ t, ENNReal.ofReal (w i) * ENNReal.ofReal (Real.exp (θ^2*S^2/2)) := by + apply Finset.sum_le_sum + intro i hi + have hh := hmgf i hi (θ*S/σ i) + have he : (θ*S/σ i)^2*(σ i)^2/2 = θ^2*S^2/2 := by field_simp [(hσ i hi).ne'] + rw [he] at hh + exact mul_le_mul_right hh _ + _ = _ := by + rw [← Finset.sum_mul,← ENNReal.ofReal_sum_of_nonneg hw,hw1,ENNReal.ofReal_one,one_mul] + · have he : t = ∅ := Finset.not_nonempty_iff_eq_empty.1 ht + simp [he] + +lemma geo_radius_power {δ : ℝ} (hδ : 0 < δ) (a : ℝ) (n : ℕ) : + (δ*(1/2:ℝ)^n)^a = δ^a*((1/2:ℝ)^a)^n := by + rw [Real.mul_rpow hδ.le (by positivity),← Real.rpow_natCast_mul (by norm_num : (0:ℝ) ≤ 1/2), + mul_comm (n:ℝ) a,Real.rpow_mul_natCast (by norm_num : (0:ℝ) ≤ 1/2)] + +end SLEExactGauge.MeshSlab + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/MeshSlab.lean b/lean/OAI/Probability/SLELocalization/MeshSlab.lean new file mode 100644 index 0000000000000000000000000000000000000000..0696f82fcbdbb3298083e22b0b168906d5dd60c6 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/MeshSlab.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.Probability.SLELocalization.MeshExponents +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Mesh Slab estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab + +lemma geometric_mesh_mgf {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + (X : ℝ → Ω → ℝ) {p K δ rf : ℝ} (hp : p < 1) (hK : 0 < K) + (hrf : 0 < rf) (hrδ : rf ≤ δ) + (hX : ∀ r, 0 < r → r ≤ δ → AEMeasurable (X r) P) + (hslab : ∀ e r, 0 < e → e ≤ r → r/2 ≤ e → r ≤ δ → ∀ θ : ℝ, + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(X e ω-X r ω))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(K*r^(1-p))^2/2))) (θ : ℝ) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(X rf ω-X δ ω))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(K*δ^(1-p)/(1-(1/2:ℝ)^(1-p)))^2/2)) := by + let q : ℝ := (1/2:ℝ)^(1-p) + have hq : 0 < q := Real.rpow_pos_of_pos (by norm_num) _ + have hq1 : q < 1 := Real.rpow_lt_one (by norm_num) (by norm_num) (by linarith) + have hδ : 0 < δ := hrf.trans_le hrδ + let R : ℕ → ℝ := fun n => max rf (δ*(1/2:ℝ)^n) + have hRpos (n : ℕ) : 0 < R n := hrf.trans_le (le_max_left _ _) + have hRle (n : ℕ) : R n ≤ δ := max_le hrδ (by + have hh : (1/2:ℝ)^n ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + simpa using mul_le_mul_of_nonneg_left hh hδ.le) + have hRm (n : ℕ) : R (n+1) ≤ R n := by + apply max_le_max le_rfl + rw [pow_succ] + nlinarith [pow_pos (by norm_num : (0:ℝ) < 1/2) n] + have hR0 : R 0 = δ := by dsimp [R]; simp only [pow_zero,mul_one,max_eq_right hrδ] + have ht : Tendsto (fun n : ℕ => δ*(1/2:ℝ)^n) atTop (𝓝 0) := by + 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 δ + obtain ⟨N,hN⟩ := (ht.eventually (gt_mem_nhds hrf)).exists + have hRN : R N = rf := max_eq_left hN.le + let Y := fun n ω => X (R (n+1)) ω-X (R n) ω + let σ := fun n => K*δ^(1-p)*q^n + have hσ (n : ℕ) : 0 < σ n := by dsimp [σ]; positivity + have hYm (n : ℕ) : AEMeasurable (Y n) P := + (hX _ (hRpos (n+1)) (hRle (n+1))).sub (hX _ (hRpos n) (hRle n)) + have hmgf (n : ℕ) (s : ℝ) : (∫⁻ ω, ENNReal.ofReal (Real.exp (s*Y n ω)) ∂P) ≤ + ENNReal.ofReal (Real.exp (s^2*(σ n)^2/2)) := by + by_cases hn : rf ≤ δ*(1/2:ℝ)^n + · have hRn : R n = δ*(1/2:ℝ)^n := max_eq_right hn + have hhalf : R n/2 ≤ R (n+1) := by + rw [hRn] + apply le_trans _ (le_max_right _ _) + rw [pow_succ] + ring_nf + exact le_rfl + have hh := hslab _ _ (hRpos (n+1)) (hRm n) hhalf (hRle n) s + have he : K*(R n)^(1-p) = σ n := by + rw [hRn,geo_radius_power hδ] + dsimp [σ,q] + ring + simpa only [Y,he] using hh + · have he : R n = rf := max_eq_left (le_of_not_ge hn) + have hne : R (n+1) = rf := le_antisymm (by rw [← he]; exact hRm n) (le_max_left _ _) + have hY0 : ∀ ω, Y n ω = 0 := fun ω => by dsimp [Y]; rw [he,hne]; ring + simp only [hY0,mul_zero,Real.exp_zero,ENNReal.ofReal_one,lintegral_const,measure_univ,mul_one] + have hn0 : 0 ≤ s^2*(σ n)^2/2 := by positivity + have he1 : 1 ≤ Real.exp (s^2*(σ n)^2/2) := Real.one_le_exp hn0 + simpa only [ENNReal.ofReal_one] using ENNReal.ofReal_le_ofReal he1 + have hsum := finite_mgf_sum (Finset.range N) Y σ (fun n _ => hσ n) (fun n _ => hYm n) + (fun n _ s => hmgf n s) θ + have htel (ω : Ω) : (∑ n ∈ Finset.range N, Y n ω) = X rf ω-X δ ω := by + rw [show (∑ n ∈ Finset.range N, Y n ω) = X (R N) ω-X (R 0) ω from Finset.sum_range_sub (fun n => X (R n) ω) N, + hRN,hR0] + simp only [htel] at hsum + apply hsum.trans + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.2 + apply div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left _ (sq_nonneg θ)) (by norm_num) + apply pow_le_pow_left₀ (Finset.sum_nonneg (fun n _ => (hσ n).le)) + rw [show (∑ n ∈ Finset.range N, σ n) = K*δ^(1-p)*(∑ n ∈ Finset.range N, q^n) by simp only [σ,Finset.mul_sum]] + have hg : (∑ n ∈ Finset.range N, q^n) ≤ 1/(1-q) := by + apply (le_div_iff₀ (sub_pos.2 hq1)).2 + rw [geom_sum_mul_neg] + exact sub_le_self _ (pow_nonneg hq.le N) + have hh := mul_le_mul_of_nonneg_left hg (show 0 ≤ K*δ^(1-p) by positivity) + simpa only [mul_one_div,q] using hh + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.MeshSlab + +lemma tail_scale (p : ℝ) {δ K : ℝ} (hδ : 0 < δ) (hK : 0 < K) : + (δ^(-p))^2/(2*(K*δ^(1-p))^2) = (1/(2*K^2))*δ^(-2:ℝ) := by + have hp : (δ^(-p))^2 = (δ^(1-p))^2*δ^(-2:ℝ) := by + rw [← Real.rpow_mul_natCast hδ.le,← Real.rpow_mul_natCast hδ.le,← Real.rpow_add hδ] + congr 1 + norm_num + ring + rw [hp,mul_pow] + field_simp [(Real.rpow_pos_of_pos hδ (1-p)).ne',hK.ne'] + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open MeshSlab + +theorem integratedMeshTail_halfPlane_simple (κ : ℝ) (hκ : 0 < κ ∧ κ ≤ 4) : + ∃ C c δ₀ : ℝ, 0 < C ∧ 0 < c ∧ 0 < δ₀ ∧ + ∀ {Ω : Type} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (B : ℝ≥0 → Ω → ℝ) (_hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (_hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (_hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (z₀ : ℂ) (_hcollar : Metric.closedBall z₀ 2 ⊆ halfPlane) + (r_f δ : ℝ), 0 < r_f → r_f ≤ δ → δ ≤ δ₀ → + P {sample | ENNReal.ofReal (C*δ^(-codimension κ)) < + ∫⁻ z in Metric.closedBall z₀ 1, + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z r_f ∂volume} ≤ + ENNReal.ofReal (C*Real.exp (-c*δ^(-2:ℝ))) := by + obtain ⟨K,hK,hslab⟩ := slab_mass_mgf κ hκ + let p := codimension κ + have hp : p < 1 := by dsimp [p,codimension,dimension]; linarith [hκ.1] + let q : ℝ := (1/2:ℝ)^(1-p) + have hq : q < 1 := Real.rpow_lt_one (by norm_num) (by norm_num) (by linarith) + let K' := K/(1-q) + have hK' : 0 < K' := div_pos hK (sub_pos.2 hq) + let C := max 1 (Real.pi*(4:ℝ)^p+1) + have hC1 : 1 ≤ C := le_max_left _ _ + have hCbase : Real.pi*(4:ℝ)^p+1 ≤ C := le_max_right _ _ + let c := 1/(2*K'^2) + have hc : 0 < c := by dsimp [c]; positivity + refine ⟨C,c,1/2,lt_of_lt_of_le zero_lt_one hC1,hc,by norm_num,?_⟩ + intro Ω m P hP B hB γ g f hγ hmaps z₀ hcollar rf δ hrf hrδ hδsmall + let A := closedBall z₀ (1:ℝ) + let X := physicalMass A κ B γ g + have hAc : IsCompact A := isCompact_closedBall _ _ + have hA : MeasurableSet A := hAc.measurableSet + let : IsFiniteMeasure (volume.restrict A) := isFiniteMeasure_restrict.2 hAc.measure_lt_top.ne + have hκ' : 0 < κ ∧ κ < 8 := ⟨hκ.1,by linarith [hκ.2]⟩ + have hδ : 0 < δ := hrf.trans_le hrδ + have hδ1 : δ < 1 := by linarith + have hy := FiniteTilt.collar_height hcollar + have hXm (r : ℝ) (hr : 0 < r) : AEMeasurable (X r) P := by + exact physicalMass_aemeasurable A κ hκ' B hB γ g f hγ hmaps r hr + have hmgf (θ : ℝ) : (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(X rf ω-X δ ω))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*(K'*δ^(1-p))^2/2)) := by + have hh := geometric_mesh_mgf X hp hK hrf hrδ (fun r hr _ => hXm r hr) + (fun e r he her hel hrδ θ => hslab B hB γ g f hγ hmaps z₀ hcollar e r he her hel (hrδ.trans_lt hδ1) θ) θ + convert hh using 1 + congr 3 + dsimp [K',q] + ring + have htail := BrownianPredictable.tail_of_exponential_bound (fun ω => X rf ω-X δ ω) + ((hXm rf hrf).sub (hXm δ hδ)) (sq_pos_of_pos (mul_pos hK' (Real.rpow_pos_of_pos hδ _))) + hmgf (Real.rpow_pos_of_pos hδ (-p)) + have hbound := physicalMass_bound A κ hκ' B hB γ g f hγ hmaps δ hδ hA + (fun z hz => hδ1.trans_le (hy z hz)) + have hlint := physicalMass_lintegral A κ hκ' B hB γ g f hγ hmaps rf hrf hA + (fun z hz => hrδ.trans_lt (hδ1.trans_le (hy z hz))) + have hv : (volume A).toReal = Real.pi := by dsimp [A]; rw [Complex.volume_closedBall]; norm_num + have hinit : (volume A).toReal*(δ/4)^(-codimension κ) = Real.pi*(4:ℝ)^p*δ^(-p) := by + rw [hv,Real.div_rpow hδ.le (by norm_num),Real.rpow_neg (by norm_num : (0:ℝ) ≤ 4),div_inv_eq_mul] + dsimp [p] + ring + have hsub : {ω | ENNReal.ofReal (C*δ^(-codimension κ)) < + ∫⁻ z in A, physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z rf} ≤ᵐ[P] + {ω | δ^(-p) < X rf ω-X δ ω} := by + filter_upwards [hbound,hlint] with ω hb hl hs + rw [hinit] at hb + change X δ ω ≤ Real.pi*(4:ℝ)^p*δ^(-p) at hb + change ENNReal.ofReal (C*δ^(-codimension κ)) < + (∫⁻ z in A, physicalStoppedDensity κ (fun t => B t ω) (γ ω) (g ω) z rf) at hs + rw [← hl] at hs + by_contra hn + have hd := le_of_not_gt hn + have hscale := mul_le_mul_of_nonneg_right hCbase (Real.rpow_nonneg hδ.le (-p)) + have he : X rf ω ≤ C*δ^(-codimension κ) := by change X rf ω ≤ C*δ^(-p); nlinarith + exact (not_lt_of_ge (ENNReal.ofReal_le_ofReal he)) hs + apply (measure_mono_ae hsub).trans + apply htail.trans + rw [neg_div,tail_scale p hδ hK'] + apply ENNReal.ofReal_le_ofReal + have he : -(1/(2*K'^2)*δ^(-2:ℝ)) = -c*δ^(-2:ℝ) := by dsimp [c]; ring + rw [he] + exact le_mul_of_one_le_left (Real.exp_pos _).le hC1 + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/PastObstacle.lean b/lean/OAI/Probability/SLELocalization/PastObstacle.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b6b93789dfa8a18d96a1987c696ab43bed3f5e7 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/PastObstacle.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Past Obstacle estimates. -/ + +noncomputable section +open Set Filter Topology +open scoped Topology +namespace SLEExactGauge + +lemma locallyConnected_sum {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + [LocallyConnectedSpace X] [LocallyConnectedSpace Y] : LocallyConnectedSpace (X ⊕ Y) := by + rw [locallyConnectedSpace_iff_subsets_isOpen_isConnected] + rintro (x | y) U hU + · have hp : Sum.inl ⁻¹' U ∈ 𝓝 x := continuous_inl.continuousAt.preimage_mem_nhds hU + obtain ⟨V,hVU,hVo,hxV,hVc⟩ := locallyConnectedSpace_iff_subsets_isOpen_isConnected.1 + (inferInstance : LocallyConnectedSpace X) x _ hp + refine ⟨Sum.inl '' V,?_,isOpenMap_inl _ hVo,mem_image_of_mem _ hxV, + hVc.image _ continuous_inl.continuousOn⟩ + rintro _ ⟨v,hv,rfl⟩ + exact hVU hv + · have hp : Sum.inr ⁻¹' U ∈ 𝓝 y := continuous_inr.continuousAt.preimage_mem_nhds hU + obtain ⟨V,hVU,hVo,hyV,hVc⟩ := locallyConnectedSpace_iff_subsets_isOpen_isConnected.1 + (inferInstance : LocallyConnectedSpace Y) y _ hp + refine ⟨Sum.inr '' V,?_,isOpenMap_inr _ hVo,mem_image_of_mem _ hyV, + hVc.image _ continuous_inr.continuousOn⟩ + rintro _ ⟨v,hv,rfl⟩ + exact hVU hv + +lemma locallyConnected_closed_union {X : Type*} [TopologicalSpace X] + {A B : Set X} (hA : IsClosed A) (hB : IsClosed B) + [LocallyConnectedSpace A] [LocallyConnectedSpace B] : + LocallyConnectedSpace (↑(A ∪ B) : Type _) := by + have := locallyConnected_sum (X := A) (Y := B) + let a : A → ↑(A ∪ B) := fun x => ⟨x,Or.inl x.property⟩ + let b : B → ↑(A ∪ B) := fun x => ⟨x,Or.inr x.property⟩ + have hca : Continuous a := continuous_subtype_val.subtype_mk _ + have hcb : Continuous b := continuous_subtype_val.subtype_mk _ + have hcla : IsClosedMap a := by + intro S hS + have he : a '' S = Subtype.val ⁻¹' (Subtype.val '' S) := by + ext x + constructor + · rintro ⟨y,hy,rfl⟩; exact ⟨y,hy,rfl⟩ + · rintro ⟨y,hy,he⟩; exact ⟨y,hy,Subtype.ext he⟩ + rw [he] + exact (hA.isClosedEmbedding_subtypeVal.isClosedMap S hS).preimage continuous_subtype_val + have hclb : IsClosedMap b := by + intro S hS + have he : b '' S = Subtype.val ⁻¹' (Subtype.val '' S) := by + ext x + constructor + · rintro ⟨y,hy,rfl⟩; exact ⟨y,hy,rfl⟩ + · rintro ⟨y,hy,he⟩; exact ⟨y,hy,Subtype.ext he⟩ + rw [he] + exact (hB.isClosedEmbedding_subtypeVal.isClosedMap S hS).preimage continuous_subtype_val + have hsurj : Function.Surjective (Sum.elim a b) := by + intro x + rcases x.property with ha | hb + · exact ⟨Sum.inl ⟨x,ha⟩,rfl⟩ + · exact ⟨Sum.inr ⟨x,hb⟩,rfl⟩ + exact ((hcla.sumElim hclb).isQuotientMap (hca.sumElim hcb) hsurj).isCoinducing.locallyConnectedSpace + +lemma lower_halfPlane_locallyConnected : LocallyConnectedSpace (↑(halfPlaneᶜ) : Type) := by + let π : ℂ → ↑(halfPlaneᶜ) := fun z => ⟨⟨z.re,min z.im 0⟩,by + change ¬ 0 < min z.im 0 + exact not_lt_of_ge (min_le_right _ _)⟩ + have hc : Continuous π := by + apply Continuous.subtype_mk + change Continuous (fun z : ℂ => Complex.mk z.re (min z.im 0)) + have hh : Continuous (fun z : ℂ => (z.re:ℂ)+((min z.im 0:ℝ):ℂ)*Complex.I) := by fun_prop + convert hh using 1 + funext z + apply Complex.ext <;> simp + have hr (z : ↑(halfPlaneᶜ)) : π z = z := by + have hz : z.val.im ≤ 0 := le_of_not_gt z.property + apply Subtype.ext + apply Complex.ext <;> simp [π,min_eq_left hz] + have hq : IsQuotientMap π := by + refine ⟨.of_isOpen_preimage_iff_isOpen (fun S => ?_),?_⟩ + · constructor + · intro hS + have hh := hS.preimage (continuous_subtype_val : Continuous (Subtype.val : ↑(halfPlaneᶜ) → ℂ)) + have he : Subtype.val ⁻¹' (π ⁻¹' S) = S := by ext z; simp only [mem_preimage,hr] + rwa [he] at hh + · intro hS + exact hS.preimage hc + · intro z + exact ⟨z,hr z⟩ + exact hq.isCoinducing.locallyConnectedSpace + +end SLEExactGauge + +end + +/-! Conformal localization and Past Trace Continuum estimates. -/ + +noncomputable section +open Set Filter Topology +open scoped Topology +namespace SLEExactGauge + +theorem past_trace_continuum {γ : ℝ → ℂ} {T : ℝ} (hT : 0 ≤ T) + (hc : ContinuousOn γ (Icc 0 T)) : + IsCompact (localizationSegment γ 0 T) ∧ IsConnected (localizationSegment γ 0 T) ∧ + LocallyConnectedSpace (localizationSegment γ 0 T) := by + have : LocallyConnectedSpace (Icc (0:ℝ) T) := + (isQuotientMap_projIcc (a := (0:ℝ)) (b := T) (h := hT)).isCoinducing.locallyConnectedSpace + let F : Icc (0:ℝ) T → localizationSegment γ 0 T := + fun t => ⟨γ t, ⟨t,t.property,rfl⟩⟩ + have hFc : Continuous F := + (continuousOn_iff_continuous_domRestrict.1 hc).subtype_mk _ + have hFs : Function.Surjective F := by + rintro ⟨z,t,ht,rfl⟩ + exact ⟨⟨t,ht⟩,rfl⟩ + refine ⟨isCompact_Icc.image_of_continuousOn hc, + (isConnected_Icc hT).image γ hc,?_⟩ + exact (IsQuotientMap.of_surjective_continuous hFs hFc).isCoinducing.locallyConnectedSpace + +theorem past_obstacle_locallyConnected {γ : ℝ → ℂ} {T : ℝ} (hT : 0 ≤ T) + (hc : ContinuousOn γ (Icc 0 T)) : + LocallyConnectedSpace (↑(halfPlaneᶜ ∪ localizationSegment γ 0 T) : Type) := by + have := lower_halfPlane_locallyConnected + have := (past_trace_continuum hT hc).2.2 + exact locallyConnected_closed_union halfPlane_open.isClosed_compl + (past_trace_continuum hT hc).1.isClosed + +end SLEExactGauge + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/PhysicalPast.lean b/lean/OAI/Probability/SLELocalization/PhysicalPast.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e059797176db4447f6fbefa1740f19d2c3d4997 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/PhysicalPast.lean @@ -0,0 +1,1070 @@ +import Mathlib +import OAI.Probability.SLELocalization.ConditionalAngles +import OAI.Probability.SLE.ClippedCoordinates +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Physical Past estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory TopologicalSpace +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.PhysicalPast + +def sampleTime (T : ℝ≥0) (q : I) : ℝ≥0 := T * ⟨q,q.property.1⟩ + +lemma sampleTime_le (T : ℝ≥0) (q : I) : sampleTime T q ≤ T := by + change (T:ℝ)*(q:ℝ) ≤ T + simpa using mul_le_mul_of_nonneg_left q.property.2 T.coe_nonneg + +lemma uniform_margin_iff {F : I → ℝ} (hF : Continuous F) (ε : ℝ) : + (∃ m : ℕ, ∀ n : ℕ, ε + CanonicalTrace.height m ≤ F (denseSeq I n)) ↔ + ∀ q : I, ε < F q := by + constructor + · rintro ⟨m,hm⟩ q + have hh : ε + CanonicalTrace.height m ≤ F q := + (denseRange_denseSeq I).induction_on q (isClosed_le continuous_const hF) hm + linarith [CanonicalTrace.height_pos m] + · intro hh + obtain ⟨q,hq,hmin⟩ := isCompact_univ.exists_isMinOn (univ_nonempty : (univ : Set I).Nonempty) hF.continuousOn + obtain ⟨m,hm⟩ := exists_nat_one_div_lt (sub_pos.2 (hh q)) + refine ⟨m,fun n => ?_⟩ + have hb := hmin (mem_univ (denseSeq I n)) + change F q ≤ F (denseSeq I n) at hb + dsimp [CanonicalTrace.height] + linarith + +def avoids {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (z : ℂ) (ε : ℝ) + (T : ℝ≥0) : Set Ω := + {sample | ∃ m : ℕ, ∀ n : ℕ, ε + CanonicalTrace.height m ≤ + dist z (CanonicalTrace.value κ B (sampleTime T (denseSeq I n)) sample)} + +lemma avoids_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (z : ℂ) (ε : ℝ) (T : ℝ≥0) : + @MeasurableSet Ω (BrownianPredictable.pastSigma B T) (avoids κ B z ε T) := by + let : MeasurableSpace Ω := BrownianPredictable.pastSigma B T + simp only [avoids,ofPred_exists,ofPred_forall] + apply MeasurableSet.iUnion + intro m + apply MeasurableSet.iInter + intro n + apply measurableSet_le measurable_const + exact measurable_const.dist ((CanonicalTrace.measurable_past κ B _).mono + (BrownianPredictable.pastSigma_mono B (sampleTime_le T (denseSeq I n))) le_rfl) + +lemma avoids_nullMeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (κ : ℝ) {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (z : ℂ) (ε : ℝ) (T : ℝ≥0) : NullMeasurableSet (avoids κ B z ε T) P := by + simp only [avoids,ofPred_exists,ofPred_forall] + apply NullMeasurableSet.iUnion + intro m + apply NullMeasurableSet.iInter + intro n + exact nullMeasurableSet_le aemeasurable_const + (aemeasurable_const.dist (CanonicalTrace.aemeasurable κ hB _)) + +lemma avoids_eq_source {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ * B t.toNNReal sample) γ g f) + (hc : Continuous (fun t => B t sample)) (z : ℂ) (ε : ℝ) (T : ℝ≥0) : + sample ∈ avoids κ B z ε T ↔ ∀ s : ℝ≥0, s ≤ T → ε < dist z (γ s) := by + have he : (sample ∈ avoids κ B z ε T) ↔ + ∃ m : ℕ, ∀ n : ℕ, ε + CanonicalTrace.height m ≤ dist z (γ (sampleTime T (denseSeq I n))) := by + simp only [avoids,mem_ofPred_eq,CanonicalTrace.eq_source κ B sample h hc] + rw [he] + have hcont : Continuous (fun q : I => dist z (γ (sampleTime T q))) := + continuous_const.dist (h.1.comp_continuous (continuous_const.mul continuous_subtype_val) + (fun q => mul_nonneg T.coe_nonneg q.property.1)) + rw [uniform_margin_iff hcont ε] + constructor + · intro hh s hs + by_cases hT : T = 0 + · have hs0 : s=0 := by simpa only [hT,le_zero_iff] using hs + have hzero : sampleTime T (0:I) = 0 := by + apply NNReal.coe_injective + change (T:ℝ) * (0:ℝ) = 0 + exact mul_zero _ + simpa only [hzero,hs0,NNReal.coe_zero] using hh (0:I) + · have hTp : 0 < (T:ℝ) := lt_of_le_of_ne T.coe_nonneg (by exact_mod_cast Ne.symm hT) + let q : I := ⟨(s:ℝ)/(T:ℝ),⟨div_nonneg s.coe_nonneg T.coe_nonneg, + (div_le_one hTp).2 hs⟩⟩ + have hsq : sampleTime T q = s := by + apply NNReal.coe_injective + change (T:ℝ)*((s:ℝ)/(T:ℝ)) = s + field_simp + simpa only [hsq] using hh q + · intro hh q + exact hh _ (sampleTime_le T q) + +end SLEExactGauge.PhysicalPast + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge + +lemma closedBall_subset_survivingDomain {γ : ℝ → ℂ} {t : ℝ} {z : ℂ} {r : ℝ} + (hr : 0 ≤ r) (hz : z ∈ localizationDomain γ t) + (hfree : closedBall z r ⊆ halfPlane \ localizationSegment γ 0 t) : + closedBall z r ⊆ localizationDomain γ t := by + have hc := (convex_closedBall z r).isPreconnected.subset_connectedComponentIn + (mem_closedBall_self hr) hfree + intro w hw + refine ⟨hfree hw,?_⟩ + rw [← connectedComponentIn_eq (hc hw)] + exact hz.2 + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge +namespace IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma radius_ge_half_free_ball (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} {r : ℝ} (hr : 0 < r) + (hz : z ∈ localizationDomain γ t) (hball : closedBall z r ⊆ localizationDomain γ t) : + r/2 ≤ loewnerRadius g t z := by + let y := (g t z).im + have hy : 0 < y := h.im_pos ht hz + let F : ℂ → ℂ := fun w => (g t w - (starRingEnd ℂ) (g t z))⁻¹ + have hden (w : ℂ) (hw : w ∈ localizationDomain γ t) : + y ≤ ‖g t w - (starRingEnd ℂ) (g t z)‖ := by + have hp := h.im_pos ht hw + have hh := Complex.im_le_norm (g t w - (starRingEnd ℂ) (g t z)) + simp only [Complex.sub_im,Complex.conj_im] at hh + dsimp [y] + linarith + have hn (w : ℂ) (hw : w ∈ localizationDomain γ t) : g t w-(starRingEnd ℂ) (g t z) ≠ 0 := + norm_pos_iff.1 (hy.trans_le (hden w hw)) + have hd (w : ℂ) (hw : w ∈ localizationDomain γ t) : DifferentiableAt ℂ F w := + ((h.analytic_eval ht hw).differentiableAt.sub_const _).inv (hn w hw) + have hF : DiffContOnCl ℂ F (ball z r) := by + apply DifferentiableOn.diffContOnCl + rw [closure_ball _ hr.ne'] + exact fun w hw => (hd w (hball hw)).differentiableWithinAt + have hb : ∀ w ∈ sphere z r, ‖F w‖ ≤ 1/y := by + intro w hw + change ‖(g t w - (starRingEnd ℂ) (g t z))⁻¹‖ ≤ 1/y + rw [norm_inv,one_div] + exact inv_anti₀ hy (hden w (hball (sphere_subset_closedBall hw))) + have hc := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le hr hF hb + have hdF : HasDerivAt F (-deriv (g t) z / (g t z-(starRingEnd ℂ) (g t z))^2) z := by + exact ((h.analytic_eval ht hz).differentiableAt.hasDerivAt.sub_const _).inv (hn z hz) + have hnorm : ‖g t z-(starRingEnd ℂ) (g t z)‖ = 2*y := by + rw [Complex.sub_conj,norm_mul,Complex.norm_real,Real.norm_eq_abs,Complex.norm_I,mul_one] + exact abs_of_pos (by dsimp [y] at hy ⊢; positivity) + rw [hdF.deriv,norm_div,norm_neg,norm_pow,hnorm] at hc + have hdn := norm_pos_iff.2 (h.deriv_ne_zero ht hz) + change r/2 ≤ 2*y/‖deriv (g t) z‖ + rw [le_div_iff₀ hdn] + have hh := (div_le_iff₀ (sq_pos_of_pos (by positivity : 0 < 2*y))).1 hc + have hh' : ‖deriv (g t) z‖ * r ≤ 4*y := by + have hrr := (mul_le_mul_of_nonneg_right hh hr.le) + field_simp at hrr + nlinarith + nlinarith + +end IsLoewnerTraceUsing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +def firstLiveDistanceStop (γ : ℝ → ℂ) (z : ℂ) (ε : ℝ) : ℝ≥0∞ := + sInf ((fun t : ℝ≥0 => (t : ℝ≥0∞)) '' + {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ dist z (γ t) ≤ ε}) + +def physicalStoppedDensity (κ : ℝ) (B : ℝ≥0 → ℝ) + (γ : ℝ → ℂ) (g : ℝ → ℂ → ℂ) (z : ℂ) (ε : ℝ) : ℝ≥0∞ := + let τ := firstLiveDistanceStop γ z ε + if τ = ⊤ then 0 else + ENNReal.ofReal ((loewnerRadius g τ.toReal z)^(-codimension κ) * + (loewnerAngleSine κ B g τ.toReal z)^(8/κ-1)) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +namespace PhysicalStop +variable {γ : ℝ → ℂ} {z : ℂ} {ε : ℝ} + +lemma le_of_hit {t : ℝ≥0} (hz : z ∈ localizationDomain γ t) (hd : dist z (γ t) ≤ ε) : + firstLiveDistanceStop γ z ε ≤ (t:ℝ≥0∞) := + sInf_le ⟨t,⟨hz,hd⟩,rfl⟩ + +lemma eq_top_iff : firstLiveDistanceStop γ z ε = ⊤ ↔ + ∀ t : ℝ≥0, z ∈ localizationDomain γ t → ε < dist z (γ t) := by + constructor + · intro he t hz + by_contra hn + have hh := le_of_hit hz (not_lt.1 hn) + rw [he] at hh + exact ENNReal.coe_ne_top (top_le_iff.1 hh) + · intro hn + have he : {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ dist z (γ t) ≤ ε} = ∅ := by + exact Set.eq_empty_iff_forall_notMem.2 (fun t ht => (not_lt_of_ge ht.2) (hn t ht.1)) + simp only [firstLiveDistanceStop,he,image_empty,sInf_empty] + +lemma finite_spec (hγ : ContinuousOn γ (Ici 0)) + (hfin : firstLiveDistanceStop γ z ε ≠ ⊤) : + ∃ t : ℝ≥0, firstLiveDistanceStop γ z ε = (t:ℝ≥0∞) ∧ + z ∈ localizationDomain γ t ∧ dist z (γ t) ≤ ε ∧ + ∀ s : ℝ≥0, s < t → ε < dist z (γ s) := by + have hex : ∃ T : ℝ≥0, z ∈ localizationDomain γ T ∧ dist z (γ T) ≤ ε := by + by_contra hn + push Not at hn + exact hfin (eq_top_iff.2 hn) + obtain ⟨T,hTlive,hTdist⟩ := hex + have hc : Continuous (fun s : ℝ≥0 => dist z (γ s)) := + continuous_const.dist (hγ.comp_continuous continuous_subtype_val (fun s => s.coe_nonneg)) + let A : Set ℝ≥0 := Icc 0 T ∩ {s | dist z (γ s) ≤ ε} + have hA : IsCompact A := isCompact_Icc.inter_right (isClosed_le hc continuous_const) + obtain ⟨t,ht,hmin⟩ := hA.exists_isLeast ⟨T,⟨⟨zero_le,le_rfl⟩,hTdist⟩⟩ + have htlive : z ∈ localizationDomain γ t := survivingDomain_mono ht.1.2 hTlive + have hleast (s : ℝ≥0) (hs : z ∈ localizationDomain γ s ∧ dist z (γ s) ≤ ε) : t ≤ s := by + by_cases hsT : s ≤ T + · exact hmin ⟨⟨zero_le,hsT⟩,hs.2⟩ + · exact ht.1.2.trans (le_of_not_ge hsT) + have he : firstLiveDistanceStop γ z ε = (t:ℝ≥0∞) := by + apply le_antisymm (le_of_hit htlive ht.2) + apply le_sInf + rintro _ ⟨s,hs,rfl⟩ + exact ENNReal.coe_le_coe.2 (hleast s hs) + refine ⟨t,he,htlive,ht.2,?_⟩ + intro s hs + by_contra hn + exact (not_le_of_gt hs) (hleast s ⟨survivingDomain_mono hs.le htlive,not_lt.1 hn⟩) + +lemma lt_stop_distance {t : ℝ≥0} (ht : (t:ℝ≥0∞) < firstLiveDistanceStop γ z ε) + (hlive : z ∈ localizationDomain γ t) : ε < dist z (γ t) := by + by_contra hn + exact (not_le_of_gt ht) (le_of_hit hlive (not_lt.1 hn)) + +lemma stopped_survival_iff (hγ : ContinuousOn γ (Ici 0)) {t : ℝ≥0} + (hlive : z ∈ localizationDomain γ t) : + (t:ℝ≥0∞) < firstLiveDistanceStop γ z ε ↔ + ∀ s : ℝ≥0, s ≤ t → ε < dist z (γ s) := by + constructor + · intro ht s hs + exact lt_stop_distance ((ENNReal.coe_le_coe.2 hs).trans_lt ht) (survivingDomain_mono hs hlive) + · intro hh + by_contra hn + have he : firstLiveDistanceStop γ z ε ≠ ⊤ := + ne_top_of_le_ne_top ENNReal.coe_ne_top (not_lt.1 hn) + obtain ⟨s,hs,hslive,hsdist,hmin⟩ := finite_spec hγ he + rw [hs] at hn + have hst : s ≤ t := ENNReal.coe_le_coe.1 (not_lt.1 hn) + exact (not_lt_of_ge hsdist) (hh s hst) + +lemma finite_dist_eq (hγ : ContinuousOn γ (Ici 0)) + (hinit : ε < dist z (γ 0)) (hfin : firstLiveDistanceStop γ z ε ≠ ⊤) : + dist z (γ (firstLiveDistanceStop γ z ε).toReal) = ε := by + obtain ⟨t,he,hlive,hdist,hmin⟩ := finite_spec hγ hfin + rw [he,ENNReal.coe_toReal] + apply le_antisymm hdist + by_contra hn + have hlt : dist z (γ t) < ε := not_le.1 hn + have hc : ContinuousOn (fun s : ℝ => dist z (γ s)) (Icc 0 (t:ℝ)) := + (continuous_const.dist continuous_id).comp_continuousOn (hγ.mono Icc_subset_Ici_self) + obtain ⟨s,hs,hseq⟩ := intermediate_value_Icc' t.coe_nonneg hc ⟨hlt.le,hinit.le⟩ + have hst : s < (t:ℝ) := lt_of_le_of_ne hs.2 (by intro hst; subst s; linarith) + have hh := hmin ⟨s,hs.1⟩ hst + exact (not_lt_of_ge hseq.le) hh + +lemma trace_distance_ge_before (hγ : ContinuousOn γ (Ici 0)) + (hinit : ε < dist z (γ 0)) {t : ℝ≥0} + (ht : (t:ℝ≥0∞) ≤ firstLiveDistanceStop γ z ε) + (hlive : z ∈ localizationDomain γ t) {s : ℝ} (hs : s ∈ Icc 0 (t:ℝ)) : + ε ≤ dist z (γ s) := by + rcases lt_or_eq_of_le ((ENNReal.coe_le_coe.2 (show (⟨s,hs.1⟩:ℝ≥0) ≤ t from hs.2)).trans ht) with hlt | he + · exact (lt_stop_distance hlt (survivingDomain_mono hs.2 hlive)).le + · have hfin : firstLiveDistanceStop γ z ε ≠ ⊤ := he ▸ ENNReal.coe_ne_top + have hh := finite_dist_eq hγ hinit hfin + rw [← he] at hh + change dist z (γ s) = ε at hh + exact hh.symm.le + +end PhysicalStop + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +open Set Metric +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma radius_ge_before_distance_stop (h : IsLoewnerTraceUsing driver γ g f) + {z : ℂ} {ε : ℝ} (hε : 0 < ε) (hsmall : ε < z.im) {t : ℝ≥0} + (ht : (t:ℝ≥0∞) ≤ firstLiveDistanceStop γ z ε) (hlive : z ∈ localizationDomain γ t) : + ε/4 ≤ loewnerRadius g t z := by + have hinit : ε < dist z (γ 0) := by + rw [h.2.1,dist_zero_right] + exact hsmall.trans_le (Complex.im_le_norm z) + have hdist (s : ℝ) (hs : s ∈ Icc 0 (t:ℝ)) : ε ≤ dist z (γ s) := + PhysicalStop.trace_distance_ge_before h.1 hinit ht hlive hs + have hfree : closedBall z (ε/2) ⊆ halfPlane \ localizationSegment γ 0 t := by + intro w hw + have hnorm : ‖w-z‖ ≤ ε/2 := by simpa only [mem_closedBall,dist_eq_norm] using hw + constructor + · have hh := Complex.abs_im_le_norm (w-z) + have hn := neg_abs_le (w-z).im + change 0 < w.im + simp only [Complex.sub_im] at hh hn + linarith + · rintro ⟨s,hs,rfl⟩ + have hh := hdist s hs + have hh' := mem_closedBall.1 hw + rw [dist_comm] at hh' + linarith + have hb := closedBall_subset_survivingDomain (by linarith : 0 ≤ ε/2) hlive hfree + have hh := h.radius_ge_half_free_ball t.coe_nonneg (by linarith : 0 < ε/2) hlive hb + convert hh using 1 + ring + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.PhysicalStop + +def cap (tauE : ℝ≥0∞) (a : ℝ) : ℝ := if tauE = ⊤ then a else min tauE.toReal a + +lemma cap_bounds (tauE : ℝ≥0∞) {a : ℝ} (ha : 0 ≤ a) : 0 ≤ cap tauE a ∧ cap tauE a ≤ a := by + unfold cap + split_ifs + · exact ⟨ha,le_rfl⟩ + · exact ⟨le_min ENNReal.toReal_nonneg ha,min_le_right _ _⟩ + +lemma lt_cap (tauE : ℝ≥0∞) (a : ℝ) (s : ℝ≥0) : + (s:ℝ) < cap tauE a ↔ (s:ℝ) < a ∧ (s:ℝ≥0∞) < tauE := by + by_cases htauE : tauE = ⊤ + · simp [cap,htauE] + · rw [cap,ite_eq_right htauE,lt_min_iff,and_comm] + apply and_congr_right + intro _ + simpa only [ENNReal.coe_toReal] using ENNReal.toReal_lt_toReal (a := (s:ℝ≥0∞)) ENNReal.coe_ne_top htauE + +lemma cap_coe {t : ℝ≥0} {a : ℝ} (hta : (t:ℝ) ≤ a) : cap (t:ℝ≥0∞) a = t := by + simp only [cap,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal,min_eq_left hta] + +end SLEExactGauge.PhysicalStop + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BrownianField.FieldRegular + +lemma restrict {F V : ℝ → ℝ → ℝ} {b : ℝ → ℝ} {s t : ℝ} + (h : FieldRegular F V b t) (hst : s ≤ t) : FieldRegular F V b s := by + refine ⟨h.smooth,h.third_bound,?_,?_,?_,?_⟩ + · exact fun x => (h.time_cont x).mono (Icc_subset_Icc le_rfl hst) + · exact fun r hr => h.time_deriv r ⟨hr.1,hr.2.trans_le hst⟩ + · exact h.drift_cont.mono (prod_mono (Icc_subset_Icc le_rfl hst) (Icc_subset_Icc le_rfl hst)) + · exact h.second_cont.mono (Icc_subset_Icc le_rfl hst) + +end SLEExactGauge.BrownianField.FieldRegular + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerLocalized +open LoewnerCutoff LoewnerField LoewnerExit + +lemma integral_drift_cancel_before {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) (κ : ℝ) (hκ : 0 < κ) + (U : C(I, ℝ)) (z : ℂ) (ρ δ : ℝ) (b : ℝ → ℝ) + (hU : ∀ s ∈ Icc 0 T, extendDriver T U s = Real.sqrt κ * b s) + {τ : ℝ} (hτ0 : 0 ≤ τ) (hτ : τ ≤ stop hε hT.le U z ρ δ) : + (∫ t in (0:ℝ)..τ, drift hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t (b t)) + + (1/2 : ℝ)*∫ t in (0:ℝ)..τ, + iteratedDeriv 2 (field hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (b t) = 0 := by + have he : (∫ t in (0:ℝ)..τ, drift hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t (b t)) = + ∫ t in (0:ℝ)..τ, + -(1/2 : ℝ)*iteratedDeriv 2 (field hε hT.le (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (b t) := by + apply intervalIntegral.integral_congr_Ioo_of_le hτ0 + intro t ht + have htT : t ∈ Icc 0 T := ⟨ht.1.le,ht.2.le.trans (hτ.trans (stop_bounds hε hT.le U z ρ δ).2)⟩ + have hh := (deficit_pos_iff hε hT.le U z ρ δ t).1 + (positive_before hε hT.le hT U z ρ δ ht.1.le (ht.2.trans_le hτ)) + have hc := drift_cancellation hε hT.le κ hκ U z t (b t) hh.2.1.le (hU t htT) + linarith + rw [he, intervalIntegral.integral_const_mul] + ring + +end SLEExactGauge.LoewnerLocalized + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized GreenPhysical +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +def physicalTime {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (ε : ℝ) (sample : Ω) : ℝ := + PhysicalStop.cap (firstLiveDistanceStop (γ sample) z ε) (C.stopTime κ B sample) + +def physicalValue {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (ε : ℝ) (sample : Ω) : ℝ := + field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (C.paths κ B sample) z + (C.physicalTime κ B γ ε sample) (B (C.physicalTime κ B γ ε sample).toNNReal sample) + +lemma physicalTime_bounds {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (ε : ℝ) (sample : Ω) : + 0 ≤ C.physicalTime κ B γ ε sample ∧ C.physicalTime κ B γ ε sample ≤ C.stopTime κ B sample := + PhysicalStop.cap_bounds _ (C.bounds κ B sample).1 + +lemma physicalValue_nonneg {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (ε : ℝ) (sample : Ω) : + 0 ≤ C.physicalValue κ B γ ε sample := (green_pos _ _ _ _ _).le + +lemma physicalValue_bound {Ω : Type*} (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) (ε : ℝ) (sample : Ω) (hz : z ∈ halfPlane) (hu : 0 < u) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) : + C.physicalValue κ B γ ε sample ≤ ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) := by + have hy0 : 0 < z.im := hz + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hd := (deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 + (C.physicalTime_bounds κ B γ ε sample)) + apply green_le_fixed_radius _ _ _ _ _ _ (LoewnerField.height_pos _ _ _ _ _) ha hp (by positivity) + simpa only [LoewnerExit.radius,LoewnerField.height,max_eq_right hd.2.1] using hd.1 + +def physicalCoeff {Ω : Type*} (k : ℕ) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (ε : ℝ) (s : ℝ≥0) (sample : Ω) : ℝ := + by + classical + exact if sample ∈ PhysicalPast.avoids κ B z ε s then + rawCoeff C.height_pos k B C.horizon s (1-κ/8) (8/κ-1) (Real.sqrt κ) z ((2*z.im)*Real.exp (-u)) C.angle sample + else 0 + +lemma physicalCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k=1 ∨ k=2) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (ε : ℝ) (s : ℝ≥0) : + Measurable[BrownianPredictable.pastSigma B s] (C.physicalCoeff k κ B ε s) := by + classical + exact (rawCoeff_measurable_past C.height_pos k hk B C.horizon s _ _ _ _ _ _).ite + (PhysicalPast.avoids_measurable_past κ B z ε s) measurable_const + +lemma physicalCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k=1 ∨ k=2) (κ : ℝ) (ε : ℝ) (s : ℝ≥0) : + AEMeasurable (C.physicalCoeff k κ B ε s) P := by + classical + exact (rawCoeff_aemeasurable C.height_pos hB k hk C.horizon s _ _ _ _ _ _).indicator₀ + (PhysicalPast.avoids_nullMeasurable κ hB z ε s) + +lemma physicalCoeff_eq {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) + (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) + (hz : z ∈ halfPlane) (hu : 0 < u) (ε : ℝ) (k : ℕ) (s : ℝ≥0) : + C.physicalCoeff k κ B ε s sample = + if (s:ℝ) < C.physicalTime κ B γ ε sample then + iteratedDeriv k (field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) + (C.paths κ B sample) z s) (B s sample) else 0 := by + classical + have he := rawCoeff_eq C.height_pos k B C.horizon s C.horizon_pos (1-κ/8) (8/κ-1) + (Real.sqrt κ) z ((2*z.im)*Real.exp (-u)) C.angle sample hc + change rawCoeff _ _ _ _ _ _ _ _ _ _ _ _ = + (if (s:ℝ) < C.stopTime κ B sample then _ else 0) at he + have ht := PhysicalStop.lt_cap (firstLiveDistanceStop (γ sample) z ε) (C.stopTime κ B sample) s + change ((s:ℝ) < C.physicalTime κ B γ ε sample) ↔ _ at ht + by_cases hs : (s:ℝ) < C.stopTime κ B sample + · have hlive := survivingDomain_mono hs.le (C.source_live κ B sample h hz hu hc hb0) + have hav := (PhysicalPast.avoids_eq_source κ B sample h hc z ε s).trans + (PhysicalStop.stopped_survival_iff h.1 hlive).symm + simp only [physicalCoeff,he,hav,ht,hs,ite_true,true_and,paths] + · have hcap : ¬ (s:ℝ) < C.physicalTime κ B γ ε sample := fun hh => hs (ht.1 hh).1 + simp only [physicalCoeff,he,ite_eq_right hs,ite_eq_right hcap,ite_self] + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized GreenPhysical +open BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +theorem physical_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (hz : z ∈ halfPlane) (hu : 0 < u) (ε : ℝ) : + let F := fun sample => field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (C.paths κ B sample) z + Integrable (fun sample => C.physicalValue κ B γ ε sample - F sample 0 (B 0 sample)) P ∧ + (∫ sample, C.physicalValue κ B γ ε sample - F sample 0 (B 0 sample) ∂P) = 0 := by + let T := C.horizon + let hT := C.horizon_pos + let hε := C.height_pos + let ρ := (2*z.im)*Real.exp (-u) + let δ := C.angle + let U := C.paths κ B + let τ := C.physicalTime κ B γ ε + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + let V := fun sample => drift hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact (regular hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha (U sample) z ρ δ _ + (hc.comp continuous_real_toNNReal)).restrict (C.physicalTime_bounds κ B γ ε sample).2 + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => ⟨(C.physicalTime_bounds κ B γ ε sample).1, + (C.physicalTime_bounds κ B γ ε sample).2.trans (C.bounds κ B sample).2⟩) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg 2 (Or.inr rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) W z t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => C.physicalCoeff 1 κ B ε (dyadicTime T n i) + let Q := fun n i => C.physicalCoeff 2 κ B ε (dyadicTime T n i) + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hmaps] with sample hc hb0 h + simpa only [A,stoppedCoeff,coe_dyadicTime] using + C.physicalCoeff_eq κ B γ g f sample h hc hb0 hz hu ε 1 (dyadicTime T n i) + have hCe (n i : ℕ) : Q n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hmaps] with sample hc hb0 h + simpa only [Q,stoppedCoeff,coe_dyadicTime] using + C.physicalCoeff_eq κ B γ g f sample h hc hb0 hz hu ε 2 (dyadicTime T n i) + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + C.physicalCoeff_measurable_past 1 (Or.inl rfl) κ B ε _ + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := + C.physicalCoeff_measurable_past 2 (Or.inr rfl) κ B ε _ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (C.physicalCoeff_aemeasurable hB 1 (Or.inl rfl) κ ε _).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (Q n i) 2 P := by + apply MemLp.of_bound (C.physicalCoeff_aemeasurable hB 2 (Or.inr rfl) κ ε _).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |Q n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_field_ito_centered_ae hB T τ F V htau hreg A Q hAe hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) hAm hA2 K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + have he : (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample)) =ᵐ[P] + (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample)) := by + filter_upwards [hB.cont] with sample hc + have hcanc := integral_drift_cancel_before hε hT κ hκ.1 (U sample) z ρ δ + (fun t => B t.toNNReal sample) (fun t ht => BrownianDriver.extend_eq B _ T sample hc ht) + (C.physicalTime_bounds κ B γ ε sample).1 (C.physicalTime_bounds κ B γ ε sample).2 + dsimp only [F,V,τ] + linarith + exact ⟨hi.1.congr he, (integral_congr_ae he).symm.trans hi.2⟩ + +theorem physical_expectation {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (hz : z ∈ halfPlane) (hu : 0 < u) (ε : ℝ) : + Integrable (C.physicalValue κ B γ ε) P ∧ + (∫ sample, C.physicalValue κ B γ ε sample ∂P) = green (1-κ/8) (8/κ-1) z.re z.im 0 := by + let F := fun sample => field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (C.paths κ B sample) z + let M := C.physicalValue κ B γ ε + let G := green (1-κ/8) (8/κ-1) z.re z.im 0 + have hi := C.physical_centered hB κ hκ γ g f hmaps hz hu ε + have he : (fun sample => M sample - F sample 0 (B 0 sample)) =ᵐ[P] + (fun sample => M sample - G) := by + filter_upwards [hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with sample hb + rw [hb] + congr 1 + exact field_initial C.height_pos C.horizon.coe_nonneg _ _ _ _ z (C.height_initial hz hu.le).le + have hd : Integrable (fun sample => M sample-G) P := hi.1.congr he + have hv : (∫ sample, M sample-G ∂P) = 0 := (integral_congr_ae he).symm.trans hi.2 + have hm : Integrable M P := by + exact (hd.add (integrable_const G)).congr + (Filter.Eventually.of_forall (fun sample => sub_add_cancel (M sample) G)) + refine ⟨hm, ?_⟩ + have hh := integral_sub hm (integrable_const (μ := P) G) + simp only [integral_const, Measure.real, measure_univ, ENNReal.toReal_one, one_smul] at hh + rw [hh] at hv + change (∫ sample, M sample ∂P) = G + linarith + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized GreenPhysical +open BrownianPredictable BrownianStopped BrownianIto TaylorMeshes PredictableLimit +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) + +theorem physical_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (hz : z ∈ halfPlane) (hu : 0 < u) (ε : ℝ) : + let F := fun sample => field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) + (Real.sqrt κ) (C.paths κ B sample) z + ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B C.horizon + (fun n i => C.physicalCoeff 1 κ B ε (dyadicTime C.horizon n i)) n sample) atTop + (𝓝 (C.physicalValue κ B γ ε sample-F sample 0 (B 0 sample))) := by + let T := C.horizon + let hT := C.horizon_pos + let hε := C.height_pos + let ρ := (2*z.im)*Real.exp (-u) + let δ := C.angle + let U := C.paths κ B + let τ := C.physicalTime κ B γ ε + let F := fun sample => field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + let V := fun sample => drift hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) (U sample) z + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : (1:ℝ) ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact (regular hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha (U sample) z ρ δ _ + (hc.comp continuous_real_toNNReal)).restrict (C.physicalTime_bounds κ B γ ε sample).2 + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => ⟨(C.physicalTime_bounds κ B γ ε sample).1, + (C.physicalTime_bounds κ B γ ε sample).2.trans (C.bounds κ B sample).2⟩) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg 2 (Or.inr rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) W z t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => C.physicalCoeff 1 κ B ε (dyadicTime T n i) + let Q := fun n i => C.physicalCoeff 2 κ B ε (dyadicTime T n i) + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hmaps] with sample hc hb0 h + simpa only [A,stoppedCoeff,coe_dyadicTime] using + C.physicalCoeff_eq κ B γ g f sample h hc hb0 hz hu ε 1 (dyadicTime T n i) + have hCe (n i : ℕ) : Q n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := by + filter_upwards [hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hmaps] with sample hc hb0 h + simpa only [Q,stoppedCoeff,coe_dyadicTime] using + C.physicalCoeff_eq κ B γ g f sample h hc hb0 hz hu ε 2 (dyadicTime T n i) + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + C.physicalCoeff_measurable_past 1 (Or.inl rfl) κ B ε _ + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := + C.physicalCoeff_measurable_past 2 (Or.inr rfl) κ B ε _ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (C.physicalCoeff_aemeasurable hB 1 (Or.inl rfl) κ ε _).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (Q n i) 2 P := by + apply MemLp.of_bound (C.physicalCoeff_aemeasurable hB 2 (Or.inr rfl) κ ε _).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |Q n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_fieldSum_tendsto_ae hB T τ F V htau hreg Q hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + have he : (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample)) =ᵐ[P] + (fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample)) := by + filter_upwards [hB.cont] with sample hc + have hcanc := integral_drift_cancel_before hε hT κ hκ.1 (U sample) z ρ δ + (fun t => B t.toNNReal sample) (fun t ht => BrownianDriver.extend_eq B _ T sample hc ht) + (C.physicalTime_bounds κ B γ ε sample).1 (C.physicalTime_bounds κ B γ ε sample).2 + dsimp only [F,V,τ] + linarith + have hAeall : ∀ᵐ sample ∂P, ∀ n i, A n i sample = stoppedCoeff 1 B T τ F n i sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAe n)) + filter_upwards [hi,he,hAeall] with sample hi he ha + rw [he] at hi + convert hi using 1 + · funext n + unfold dyadicDriverSum + simp only [← ha] + rfl + · rfl + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable +open PredictableLimit + +lemma delayed_indicator_difference_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T S : ℝ≥0) + (A D : ℕ → ℕ → Ω → ℝ) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hD : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (D n i)) + (hA2 : ∀ n i, MemLp (A n i) 2 P) (hD2 : ∀ n i, MemLp (D n i) 2 P) + (K : ℝ) (hK : 0 ≤ K) + (hbA : ∀ n i, ∀ᵐ sample ∂P, |A n i sample| ≤ K) + (hbD : ∀ n i, ∀ᵐ sample ∂P, |D n i sample| ≤ K) + (E : Set Ω) (hE : NullMeasurableSet E P) + (hEm : MeasurableSet[pastSigma B S] E) + (hsupport : ∀ n i, dyadicTime T n i < S → ∀ᵐ sample ∂P, + sample ∈ E → A n i sample = D n i sample) + (YA YD : Ω → ℝ) + (hlA : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T A n sample) atTop (𝓝 (YA sample))) + (hlD : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T D n sample) atTop (𝓝 (YD sample))) : + Integrable (E.indicator (fun sample => YA sample-YD sample)) P ∧ + (∫ sample, E.indicator (fun sample => YA sample-YD sample) sample ∂P) = 0 := by + classical + let Q := fun n i => if S ≤ dyadicTime T n i then + E.indicator (fun sample => A n i sample-D n i sample) else (fun _ => 0) + have hQm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := by + dsimp only [Q] + split_ifs with ht + · exact ((hA n i).sub (hD n i)).indicator (pastSigma_mono B ht _ hEm) + · exact measurable_const + have heq (n i : ℕ) : Q n i =ᵐ[P] E.indicator (fun sample => A n i sample-D n i sample) := by + by_cases ht : S ≤ dyadicTime T n i + · exact Filter.Eventually.of_forall (fun _ => by simp only [Q,ite_eq_left ht]) + · filter_upwards [hsupport n i (lt_of_not_ge ht)] with sample hs + simp only [Q,ite_eq_right ht,Set.indicator_apply] + split_ifs with hmem + · simp only [hs hmem,sub_self] + · rfl + have hQ2 (n i : ℕ) : MemLp (Q n i) 2 P := by + have hd := (hA2 n i).sub (hD2 n i) + have hm : MemLp (E.indicator (fun sample => A n i sample-D n i sample)) 2 P := + hd.of_le (hd.aestronglyMeasurable.indicator₀ hE) + (Filter.Eventually.of_forall (fun sample => norm_indicator_le_norm_self _ sample)) + exact hm.ae_eq (heq n i).symm + have hQb (n i : ℕ) : ∀ᵐ sample ∂P, |Q n i sample| ≤ 2*K := by + filter_upwards [hbA n i,hbD n i,heq n i] with sample ha hd he + rw [he,Set.indicator_apply] + split_ifs + · exact (abs_sub _ _).trans (by linarith) + · simpa only [abs_zero] using (show 0 ≤ 2*K by positivity) + have heall : ∀ᵐ sample ∂P, ∀ n i, Q n i sample = E.indicator (fun sample => A n i sample-D n i sample) sample := + ae_all_iff.2 (fun n => ae_all_iff.2 (heq n)) + apply limit_centered hB T Q hQm hQ2 (2*K) (by positivity) hQb _ + filter_upwards [heall,hlA,hlD] with sample he ha hd + have heqsum (n : ℕ) : dyadicDriverSum B T Q n sample = + E.indicator (fun sample => dyadicDriverSum B T A n sample-dyadicDriverSum B T D n sample) sample := by + unfold dyadicDriverSum + simp only [he,Set.indicator_apply] + split_ifs <;> simp [sub_mul,Finset.sum_sub_distrib] + simp only [heqsum,Set.indicator_apply] + split_ifs + · exact ha.sub hd + · exact tendsto_const_nhds + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized BrownianPredictable + BrownianStopped BrownianIto TaylorMeshes PredictableLimit + +lemma physical_avoidance_setIntegral {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) + (C : Cutoff z u) (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (e : ℝ) (S : ℝ≥0) : + (∫ sample in PhysicalPast.avoids κ B z e S, C.value κ B sample ∂P) = + ∫ sample in PhysicalPast.avoids κ B z e S, C.physicalValue κ B γ e sample ∂P := by + let F := fun sample => field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) + (Real.sqrt κ) (C.paths κ B sample) z + let A := fun n i => rawCoeff C.height_pos 1 B C.horizon (dyadicTime C.horizon n i) + (1-κ/8) (8/κ-1) (Real.sqrt κ) z ((2*z.im)*Real.exp (-u)) C.angle + let D := fun n i => C.physicalCoeff 1 κ B e (dyadicTime C.horizon n i) + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B C.horizon (C.stopTime κ B) F n i := + rawCoeff_stoppedCoeff_ae C.height_pos hB 1 C.horizon C.horizon_pos + (1-κ/8) (8/κ-1) (Real.sqrt κ) z ((2*z.im)*Real.exp (-u)) C.angle n i + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := sub_nonneg.2 ((le_div_iff₀ hκ.1).2 (by linarith [hκ.2])) + obtain ⟨K,hK,hKb⟩ := coeff_uniform_bound C.height_pos C.horizon.coe_nonneg 1 (Or.inl rfl) + (1-κ/8) (8/κ-1) (Real.sqrt κ) hp ha z + have hAb (n i : ℕ) : ∀ᵐ sample ∂P, |A n i sample| ≤ K := by + filter_upwards [hAe n i] with sample he + rw [he] + unfold stoppedCoeff + split_ifs + · exact hKb _ _ _ + · simpa only [abs_zero] using hK + have hDb (n i : ℕ) : ∀ᵐ sample ∂P, |D n i sample| ≤ K := by + filter_upwards [hAb n i] with sample ha + dsimp only [D,physicalCoeff] + split_ifs + · exact ha + · simpa only [abs_zero] using hK + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (A n i) := + rawCoeff_measurable_past C.height_pos 1 (Or.inl rfl) B C.horizon _ _ _ _ z _ C.angle + have hDm (n i : ℕ) : Measurable[pastSigma B (dyadicTime C.horizon n i)] (D n i) := + C.physicalCoeff_measurable_past 1 (Or.inl rfl) κ B e _ + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable C.height_pos hB 1 (Or.inl rfl) C.horizon + (dyadicTime C.horizon n i) (1-κ/8) (8/κ-1) (Real.sqrt κ) z _ C.angle).aestronglyMeasurable K + simpa only [Real.norm_eq_abs] using hAb n i + have hD2 (n i : ℕ) : MemLp (D n i) 2 P := by + apply MemLp.of_bound (C.physicalCoeff_aemeasurable hB 1 (Or.inl rfl) κ e _).aestronglyMeasurable K + simpa only [Real.norm_eq_abs] using hDb n i + have hsupport (n i : ℕ) (ht : dyadicTime C.horizon n i < S) : ∀ᵐ sample ∂P, + sample ∈ PhysicalPast.avoids κ B z e S → A n i sample = D n i sample := by + filter_upwards [hmaps,hB.cont] with sample hm hc he + have hh := (PhysicalPast.avoids_eq_source κ B sample hm hc z e S).1 he + have hs : sample ∈ PhysicalPast.avoids κ B z e (dyadicTime C.horizon n i) := + (PhysicalPast.avoids_eq_source κ B sample hm hc z e _).2 (fun s hs => hh s (hs.trans ht.le)) + simp only [D,physicalCoeff,ite_eq_left hs] + rfl + have hlA := localized_sum_tendsto hB κ hκ C.height_pos C.horizon C.horizon_pos z + ((2*z.im)*Real.exp (-u)) C.angle + have hlD := C.physical_sum_tendsto hB κ hκ γ g f hmaps hz hu e + have hE := PhysicalPast.avoids_nullMeasurable κ hB z e S + have hh := delayed_indicator_difference_centered hB C.horizon S A D hAm hDm hA2 hD2 K hK hAb hDb + (PhysicalPast.avoids κ B z e S) hE (PhysicalPast.avoids_measurable_past κ B z e S) hsupport + (fun sample => C.value κ B sample-F sample 0 (B 0 sample)) + (fun sample => C.physicalValue κ B γ e sample-F sample 0 (B 0 sample)) hlA hlD + have hdiff : (∫ sample in PhysicalPast.avoids κ B z e S, + C.value κ B sample-C.physicalValue κ B γ e sample ∂P) = 0 := by + simpa only [sub_sub_sub_cancel_right,integral_indicator₀ hE] using hh.2 + rw [integral_sub ((C.expectation hB κ hκ hz hu.le).1.integrableOn) + ((C.physical_expectation hB κ hκ γ g f hmaps hz hu e).1.integrableOn)] at hdiff + exact sub_eq_zero.1 hdiff + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt.Cutoff +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized GreenPhysical +variable {z : ℂ} {u : ℝ} (C : Cutoff z u) +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) +variable (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) +variable (hz : z ∈ halfPlane) (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +include h hz hu hc hb0 + +lemma physicalValue_eq_source (ε : ℝ) : C.physicalValue κ B γ ε sample = + (loewnerRadius (g sample) (C.physicalTime κ B γ ε sample) z)^(-(1-κ/8)) * + (loewnerAngleSine κ (fun t => B t sample) (g sample) (C.physicalTime κ B γ ε sample) z)^(8/κ-1) := by + have ht := C.physicalTime_bounds κ B γ ε sample + have h0 := C.initial_deficit_brownian κ B sample hz hu hc hb0 + have hh := ((deficit_nonneg_iff C.height_pos C.horizon.coe_nonneg _ z _ C.angle _).1 + (nonneg_until C.height_pos C.horizon.coe_nonneg C.horizon_pos _ z _ C.angle h0 ht)).2.1 + have hr := radius_eq_source C.height_pos C.horizon_pos h + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) _ z _ C.angle + (C.path_eq κ B sample hc) h0 ht + have hs := sine_eq_source C.height_pos C.horizon_pos h _ z _ C.angle + (C.path_eq κ B sample hc) h0 ht + change _ = loewnerRadius (g sample) (C.physicalTime κ B γ ε sample) z at hr + have hs' : sine C.height_pos C.horizon.coe_nonneg (C.paths κ B sample) z + (C.physicalTime κ B γ ε sample) = + loewnerAngleSine κ (fun t => B t sample) (g sample) (C.physicalTime κ B γ ε sample) z := by + simpa only [loewnerAngleSine,Complex.ofReal_mul] using hs + rw [physicalValue,field_eq_radius_sine C.height_pos C.horizon_pos _ _ _ _ z _ _ hh + (C.path_eq κ B sample hc ⟨ht.1,ht.2.trans (C.bounds κ B sample).2⟩),hr,hs'] + +end SLEExactGauge.FiniteTilt.Cutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.FiniteTilt +variable {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (γ : Ω → ℝ → ℂ) +variable (g f : Ω → ℝ → ℂ → ℂ) (sample : Ω) +variable (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) +variable {z : ℂ} (hz : z ∈ halfPlane) {u : ℝ} (hu : 0 < u) +variable (hc : Continuous (fun t => B t sample)) (hb0 : B 0 sample = 0) +variable {ε : ℝ} (hε : 0 < ε) (hsmall : ε < z.im) +variable (hρ : (2*z.im)*Real.exp (-u) < ε/4) +include h hz hu hc hb0 hε hsmall hρ + +lemma eventually_physicalValue_at_hit (hfin : firstLiveDistanceStop (γ sample) z ε ≠ ⊤) : + ∀ᶠ n : ℕ in atTop, ENNReal.ofReal ((cutoffs hz u hu.le n).physicalValue κ B γ ε sample) = + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z ε := by + obtain ⟨t,ht,hzt,hd,hmin⟩ := PhysicalStop.finite_spec h.1 hfin + obtain ⟨η,hη,hm⟩ := h.sine_positive_minimum (κ := κ) (B := fun t => B t sample) hc t.coe_nonneg hzt + have hδ : ∀ᶠ n : ℕ in atTop, shrinkingAngle z n < η := + (shrinkingAngle_tendsto z).eventually (gt_mem_nhds hη) + filter_upwards [hδ] with n hn + let C := cutoffs hz u hu.le n + have htc : (t:ℝ) ≤ C.stopTime κ B sample := by + by_contra hnot + have hlt : C.stopTime κ B sample < t := lt_of_not_ge hnot + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · have hh := h.radius_ge_before_distance_stop hε hsmall + (t := ⟨C.stopTime κ B sample,(C.bounds κ B sample).1⟩) + (by rw [ht]; exact ENNReal.coe_le_coe.2 hlt.le) + (C.source_live κ B sample h hz hu hc hb0) + change ε/4 ≤ loewnerRadius (g sample) (C.stopTime κ B sample) z at hh + rw [hr] at hh + exact (not_lt_of_ge hh) hρ + · have hh := hm (C.stopTime κ B sample) ⟨(C.bounds κ B sample).1,hlt.le⟩ + rw [hs] at hh + exact (not_lt_of_ge hh) hn + have he : C.physicalTime κ B γ ε sample = t := by + rw [Cutoff.physicalTime,ht,PhysicalStop.cap_coe htc] + have hp : codimension κ = 1-κ/8 := by unfold codimension dimension; ring + rw [physicalStoppedDensity,ht,ite_eq_right ENNReal.coe_ne_top,ENNReal.coe_toReal,hp, + C.physicalValue_eq_source κ B γ g f sample h hz hu hc hb0 ε,he] + +lemma tendsto_physicalValue_killed (hκ : 0 < κ ∧ κ < 8) : + Tendsto (fun n : ℕ => ENNReal.ofReal ((cutoffs hz u hu.le n).physicalValue κ B γ ε sample)) atTop + (𝓝 (physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z ε)) := by + by_cases he : firstLiveDistanceStop (γ sample) z ε = ⊤ + · rw [physicalStoppedDensity,he,ite_eq_left rfl] + have ha : 0 < 8/κ-1 := sub_pos.2 ((lt_div_iff₀ hκ.1).2 (by simpa using hκ.2)) + have hlim := (shrinkingAngle_tendsto z).rpow_const_nhds_zero ha + have hlim' : Tendsto (fun n : ℕ => ((2*z.im)*Real.exp (-u))^(-(1-κ/8)) * + (shrinkingAngle z n)^(8/κ-1)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul hlim + have hl : Tendsto (fun n : ℕ => (cutoffs hz u hu.le n).physicalValue κ B γ ε sample) atTop (𝓝 0) := by + apply squeeze_zero (fun n => (cutoffs hz u hu.le n).physicalValue_nonneg κ B γ ε sample) _ hlim' + intro n + let C := cutoffs hz u hu.le n + have ht : C.physicalTime κ B γ ε sample = C.stopTime κ B sample := by + simp only [Cutoff.physicalTime,PhysicalStop.cap,he,ite_true] + have hv : C.physicalValue κ B γ ε sample = C.value κ B sample := by + simp only [Cutoff.physicalValue,ht,Cutoff.value] + rw [hv] + have hs : loewnerAngleSine κ (fun t => B t sample) (g sample) (C.stopTime κ B sample) z = C.angle := by + rcases C.source_terminal κ B sample h hz hu hc hb0 with hr | hs + · have hh := h.radius_ge_before_distance_stop hε hsmall + (t := ⟨C.stopTime κ B sample,(C.bounds κ B sample).1⟩) + (by rw [he]; exact le_top) (C.source_live κ B sample h hz hu hc hb0) + change ε/4 ≤ loewnerRadius (g sample) (C.stopTime κ B sample) z at hh + rw [hr] at hh + exact False.elim ((not_lt_of_ge hh) hρ) + · exact hs + exact C.angle_exit_bound κ B sample h hz hu hc hb0 hκ hs + simpa only [ENNReal.ofReal_zero,Function.comp_def] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hl + · have hh := eventually_physicalValue_at_hit κ B γ g f sample h hz hu hc hb0 hε hsmall hρ he + exact tendsto_const_nhds.congr' (hh.mono (fun _ heq => heq.symm)) + +end SLEExactGauge.FiniteTilt + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/RetainedFirstMoment.lean b/lean/OAI/Probability/SLELocalization/RetainedFirstMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..16e076f40bef709e9b681e57cb981c840ff3e04e --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/RetainedFirstMoment.lean @@ -0,0 +1,289 @@ +import Mathlib +import OAI.Probability.SLELocalization.FiniteTimeMass +import OAI.Probability.SLELocalization.MeshExponents +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Retained First Moment estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge +open FiniteClock + +lemma finiteCenteredPhysicalTime_uniform {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (Y s ε : ℝ) (hY : 0 < Y) (hs : 0 < s) (hε : 0 < ε) : + ∃ T : ℝ, 0 < T ∧ ∀ z : ℂ, z ∈ halfPlane → z.im ≤ Y → + s ≤ (z.im/‖z‖)^(8/κ-1) → ∀ u : ℝ, 1 ≤ u → + finiteCenteredMeasure κ P B γ g z u + {sample | ENNReal.ofReal T < firstLiveRadiusStop (γ sample) (g sample) z u} < + ENNReal.ofReal ε := by + obtain ⟨C,hC,hbound⟩ := radiusApproachBound κ hκ + let C' := C+s⁻¹ + have hC' : 0 < C' := by dsimp only [C']; positivity + have hr : Real.exp (-(8/κ-1)/8) < 1 := Real.exp_lt_one_iff.2 (by have := exponent_pos hκ; linarith) + let D := C'*Real.exp (codimension κ)/(1-Real.exp (-(8/κ-1)/8)) + have hD : 0 < D := by dsimp only [D]; positivity + obtain ⟨δ,hδ,hsmall⟩ := exists_small_floor (exponent_pos hκ) hD hε + refine ⟨Y^2/(2*δ^4),by positivity,?_⟩ + intro z hz hzy hzs u hu + have hS : 0 < (z.im/‖z‖)^(8/κ-1) := hs.trans_le hzs + have hrad (n : ℕ) : P {sample | firstLiveRadiusStop (γ sample) (g sample) z n ≠ (⊤ : ℝ≥0∞)} ≤ + ENNReal.ofReal (C'*Real.exp (-codimension κ*n)*(z.im/‖z‖)^(8/κ-1)) := by + cases n with + | zero => + simp only [Nat.cast_zero,mul_zero,Real.exp_zero,mul_one] + apply (prob_le_one).trans + apply ENNReal.one_le_ofReal.2 + have hmul := mul_le_mul_of_nonneg_left hzs (inv_nonneg.2 hs.le) + rw [inv_mul_cancel₀ hs.ne'] at hmul + dsimp only [C'] + rw [add_mul] + linarith [mul_pos hC hS] + | succ n => + simp only [Nat.cast_add,Nat.cast_one] + apply (hbound P B hB γ g f hγ hmaps z hz (n+1) (by norm_num)).trans + apply ENNReal.ofReal_le_ofReal + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (inv_nonneg.2 hs.le)) + (Real.exp_pos _).le) hS.le + have hbad : finiteCenteredMeasure κ P B γ g z u (bad κ B γ g z δ u) ≤ + ENNReal.ofReal (D*δ^(8/κ-1)) := by + apply (measure_iUnion_le _).trans + apply (ENNReal.tsum_le_tsum (fun n => block_bound κ hκ B hB γ g f hγ hmaps z hz C' hC' hrad δ hδ u n)).trans_eq + exact geometric_blocks κ C' δ hκ hC' hδ + have hu0 : 0 < u := by linarith + let Q := finiteCenteredMeasure κ P B γ g z u + have hQP : Q ≪ P := withDensity_absolutelyContinuous _ _ + have hhit : ∀ᵐ sample ∂Q, firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞) := by + change ∀ᵐ sample ∂P.withDensity _,_ + rw [ae_withDensity_iff' ((finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz u hu0).div_const _)] + exact Filter.Eventually.of_forall (fun sample hn ht => hn (by simp only [finiteStoppedDensity,ht,ite_true,ENNReal.zero_div])) + have hsub : {sample | ENNReal.ofReal (Y^2/(2*δ^4)) < + firstLiveRadiusStop (γ sample) (g sample) z u} ≤ᵐ[Q] bad κ B γ g z δ u := by + filter_upwards [hQP.ae_le hmaps,hQP.ae_le hB.cont,hhit] with sample hm hc hh hx + by_contra hn + have hg : ∀ q : ℚ, 0 < (q:ℝ) → (q:ℝ) ≤ u → + finiteStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z q ∉ Ioo 0 (threshold κ z δ q) := by + intro q hq hqu hbad + exact hn (mem_bad_of_rational κ B γ g z δ u q hq hqu hbad) + have ht := good_physical_clock (κ := κ) (B := fun t => B t sample) (γ := γ sample) + (g := g sample) (f := f sample) hκ hm hc hz hδ hu0 hh hg + have hy : 0 < z.im := hz + have htY : z.im^2/(2*δ^4) ≤ Y^2/(2*δ^4) := + div_le_div_of_nonneg_right (sq_le_sq₀ hy.le hY.le |>.2 hzy) (by positivity) + exact not_lt_of_ge (ht.trans (ENNReal.ofReal_le_ofReal htY)) hx + exact (measure_mono_ae hsub).trans_lt + (hbad.trans_lt (ENNReal.ofReal_lt_ofReal_iff hε |>.2 hsmall)) + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge + +lemma uniformFiniteTimePhysicalDensity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (Y s : ℝ) (hY : 0 < Y) (hs : 0 < s) : + ∃ T : ℝ, 0 < T ∧ ∀ z : ℂ, z ∈ halfPlane → z.im ≤ Y → + s ≤ (z.im/‖z‖)^(8/κ-1) → ∀ e : ℝ, 0 < e → e < z.im → + ENNReal.ofReal (((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))/2) ≤ + ∫⁻ sample in {sample | firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T}, + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e ∂P := by + classical + obtain ⟨T,hT,hclock⟩ := finiteCenteredPhysicalTime_uniform κ hκ B hB γ g f hγ hmaps + Y s (1/2) hY hs (by norm_num) + refine ⟨T,hT,?_⟩ + intro z hz hzy hzs e he hes + let m := (2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1) + let M := ENNReal.ofReal m + have hm : 0 < m := localizationInitialGreen_pos κ hz + have hM0 : M ≠ 0 := (ENNReal.ofReal_pos.2 hm).ne' + have hMtop : M ≠ ⊤ := ENNReal.ofReal_ne_top + let S : ℝ≥0 := ⟨T,hT.le⟩ + have hS : (S : ℝ≥0∞) = ENNReal.ofReal T := by + change (S : ℝ≥0∞) = ENNReal.ofReal (S : ℝ) + exact ENNReal.ofReal_coe_nnreal.symm + let E := PhysicalPast.avoids κ B z e S + let A := {sample | firstLiveDistanceStop (γ sample) z e ≤ (S:ℝ≥0∞)} + let D := fun sample => physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e + have hE : NullMeasurableSet E P := PhysicalPast.avoids_nullMeasurable κ hB z e S + have hA : NullMeasurableSet A P := physical_early_nullMeasurable κ hκ B hB γ g f hmaps z hz e he hes S + have hD : AEMeasurable D P := physicalStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz e he hes + obtain ⟨u,hu,hr⟩ : ∃ u : ℝ, 1 < u ∧ (2*z.im)*Real.exp (-u) < e/4 := by + have hl : Tendsto (fun u : ℝ => (2*z.im)*Real.exp (-u)) atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_const_nhds.mul Real.tendsto_exp_neg_atTop_nhds_zero + exact ((eventually_gt_atTop 1).and (hl.eventually (gt_mem_nhds (by linarith : 0 < e/4)))).exists + have hu0 : 0 < u := by linarith + let Q := finiteCenteredMeasure κ P B γ g z u + have hQP : Q ≪ P := withDensity_absolutelyContinuous _ _ + have hhit : ∀ᵐ sample ∂Q, firstLiveRadiusStop (γ sample) (g sample) z u ≠ (⊤ : ℝ≥0∞) := by + change ∀ᵐ sample ∂P.withDensity _,_ + rw [ae_withDensity_iff' ((finiteStoppedDensity_aemeasurable κ hκ B hB γ g f hmaps z hz u hu0).div_const _)] + exact Filter.Eventually.of_forall (fun sample hn ht => hn (by simp only [finiteStoppedDensity,ht,ite_true,ENNReal.zero_div])) + have hsub : E ≤ᵐ[Q] {sample | (S:ℝ≥0∞) < firstLiveRadiusStop (γ sample) (g sample) z u} := by + filter_upwards [hQP.ae_le hmaps,hQP.ae_le hB.cont,hhit] with sample hmaps hc hhit hmem + have hpr := physical_before_deep_radius hmaps + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) he hes hr hhit + have hfp : firstLiveDistanceStop (γ sample) z e ≠ (⊤ : ℝ≥0∞) := ne_top_of_lt hpr + exact ((physical_avoidance_at_finite_hit κ B sample hmaps hc z e S hfp).1 hmem).trans hpr + have hQE : Q E ≤ ENNReal.ofReal (1/2) := by + apply (measure_mono_ae hsub).trans + simpa only [hS] using (hclock z hz hzy hzs u hu.le).le + have hid : (∫⁻ sample in E, D sample ∂P) = M*Q E := by + rw [physical_radial_avoidance_identity κ hκ B hB γ g f hmaps z hz u hu0 e he hes hr S] + rw [show Q E = ∫⁻ sample in E, finiteStoppedDensity κ (fun t => B t sample) + (γ sample) (g sample) z u / M ∂P from withDensity_apply₀ _ hE] + simp_rw [ENNReal.div_eq_inv_mul] + rw [lintegral_const_mul' _ _ (ENNReal.inv_ne_top.2 hM0),← mul_assoc,ENNReal.mul_inv_cancel hM0 hMtop,one_mul] + have hhalf : M*ENNReal.ofReal (1/2) = ENNReal.ofReal (m/2) := by + rw [← ENNReal.ofReal_mul hm.le] + congr 1 + ring + have htail : (∫⁻ sample in E, D sample ∂P) ≤ ENNReal.ofReal (m/2) := by + rw [hid,← hhalf] + exact mul_le_mul' le_rfl hQE + have hi : Eᶜ.indicator D =ᵐ[P] A.indicator D := by + filter_upwards [hmaps,hB.cont] with sample hm hc + by_cases hh : firstLiveDistanceStop (γ sample) z e = (⊤ : ℝ≥0∞) + · have hd : D sample = 0 := by simp only [D,physicalStoppedDensity,hh,ite_true] + simp only [Set.indicator_apply,hd,ite_self] + · have hv := physical_avoidance_at_finite_hit κ B sample hm hc z e S hh + have hae : sample ∈ Eᶜ ↔ sample ∈ A := by + simpa only [E,A,mem_compl_iff,mem_ofPred_eq,not_lt] using hv.not + simp only [Set.indicator_apply,hae] + have hall : (∫⁻ sample in E, D sample ∂P)+(∫⁻ sample in A, D sample ∂P) = M := by + rw [← lintegral_indicator₀ hA,← lintegral_congr_ae hi,← lintegral_indicator₀ hE, + ← lintegral_add_left' (hD.indicator₀ hE)] + have hp : (fun sample => E.indicator D sample+Eᶜ.indicator D sample) = D := by + funext sample + by_cases hs : sample∈E <;> simp [hs] + rw [hp] + exact physicalDistanceStoppedDensity κ hκ B hB γ g f hγ hmaps z hz e he hes + have hdouble : M = ENNReal.ofReal (m/2)+ENNReal.ofReal (m/2) := by + change ENNReal.ofReal m = _ + rw [← ENNReal.ofReal_add (by positivity : 0 ≤ m/2) (by positivity : 0 ≤ m/2)] + congr 1 + ring + have hlow : ENNReal.ofReal (m/2) ≤ ∫⁻ sample in A, D sample ∂P := by + apply ENNReal.le_of_add_le_add_left ENNReal.ofReal_ne_top + rw [← hdouble,← hall] + exact add_le_add htail le_rfl + simpa only [A,D,m,hS] using hlow + +lemma compact_initial_bounds (κ : ℝ) {K : Set ℂ} (hK : IsCompact K) (hne : K.Nonempty) + (hhalf : K ⊆ halfPlane) : + ∃ e₀ Y s m : ℝ, 0 < e₀ ∧ 0 < Y ∧ 0 < s ∧ 0 < m ∧ ∀ z ∈ K, + e₀ ≤ z.im ∧ z.im ≤ Y ∧ s ≤ (z.im/‖z‖)^(8/κ-1) ∧ + m ≤ ((2*z.im)^(-codimension κ)*(z.im/‖z‖)^(8/κ-1))/2 := by + have hy (z : ℂ) (hz : z ∈ K) : 0 < z.im := hhalf hz + have hn (z : ℂ) (hz : z ∈ K) : ‖z‖ ≠ 0 := norm_ne_zero_iff.2 (by + intro he + simpa only [he,Complex.zero_im,lt_self_iff_false] using hy z hz) + have hsin : ContinuousOn (fun z : ℂ => z.im/‖z‖) K := + Complex.continuous_im.continuousOn.div continuous_norm.continuousOn hn + have hsp := hsin.rpow_const (p := 8/κ-1) (fun z hz => Or.inl (FiniteTilt.initial_sine_pos (hhalf hz)).ne') + have hr : ContinuousOn (fun z : ℂ => (2*z.im)^(-codimension κ)) K := + (continuous_const.mul Complex.continuous_im).continuousOn.rpow_const + (fun z hz => Or.inl (mul_pos (by norm_num) (hy z hz)).ne') + have hm := (hr.mul hsp).div_const 2 + obtain ⟨z₀,hz₀,hmin⟩ := hK.exists_isMinOn hne Complex.continuous_im.continuousOn + obtain ⟨z₁,hz₁,hmax⟩ := hK.exists_isMaxOn hne Complex.continuous_im.continuousOn + obtain ⟨z₂,hz₂,hsmin⟩ := hK.exists_isMinOn hne hsp + obtain ⟨z₃,hz₃,hmmin⟩ := hK.exists_isMinOn hne hm + refine ⟨z₀.im,z₁.im,(z₂.im/‖z₂‖)^(8/κ-1), + ((2*z₃.im)^(-codimension κ)*(z₃.im/‖z₃‖)^(8/κ-1))/2, + hy z₀ hz₀,hy z₁ hz₁,Real.rpow_pos_of_pos (FiniteTilt.initial_sine_pos (hhalf hz₂)) _, + div_pos (localizationInitialGreen_pos κ (hhalf hz₃)) (by norm_num),?_⟩ + intro z hz + exact ⟨hmin hz,hmax hz,hsmin hz,hmmin hz⟩ + +theorem retainedPositiveFirstMoment {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hγ : ∀ t, 0 ≤ t → AEMeasurable (fun sample => γ sample t) P) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ*B t.toNNReal sample) (γ sample) (g sample) (f sample)) + (c : ℂ) (r : ℝ) (hr : 0 < r) (hK : Metric.closedBall c r ⊆ halfPlane) : + ∃ T e₀ m₀ : ℝ, 0 < T ∧ 0 < e₀ ∧ 0 < m₀ ∧ ∀ e : ℝ, 0 < e → e < e₀ → + ENNReal.ofReal m₀ ≤ ∫⁻ sample, ∫⁻ z in Metric.closedBall c r, + (if firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T then + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e else 0) + ∂volume ∂P := by + classical + let K := Metric.closedBall c r + have hKm : MeasurableSet K := Metric.isClosed_closedBall.measurableSet + obtain ⟨e₀,Y,s,m,he₀,hY,hs,hm,hbd⟩ := compact_initial_bounds κ + (isCompact_closedBall c r) ⟨c,Metric.mem_closedBall_self hr.le⟩ hK + obtain ⟨T,hT,hfirst⟩ := uniformFiniteTimePhysicalDensity κ hκ B hB γ g f hγ hmaps Y s hY hs + have hvol : 0 < (volume K).toReal := ENNReal.toReal_pos + (Metric.measure_closedBall_pos volume c hr).ne' measure_closedBall_lt_top.ne + refine ⟨T,e₀,m*(volume K).toReal,hT,he₀,mul_pos hm hvol,?_⟩ + intro e he hee + obtain ⟨W,hW,hWe⟩ := jointFiniteTimePhysicalDensity κ hκ B hB γ g f hγ hmaps T hT e he + have hwfirst (z : ℂ) (hz : z ∈ K) : ENNReal.ofReal m ≤ ∫⁻ sample, W (sample,z) ∂P := by + have hes : e < z.im := hee.trans_le (hbd z hz).1 + let S : ℝ≥0 := ⟨T,hT.le⟩ + have hS : (S : ℝ≥0∞) = ENNReal.ofReal T := ENNReal.ofReal_coe_nnreal.symm + have hA : NullMeasurableSet {sample | firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T} P := by + simpa only [hS] using + physical_early_nullMeasurable κ hκ B hB γ g f hmaps z (hK hz) e he hes S + have hideq : (∫⁻ sample, W (sample,z) ∂P) = + ∫⁻ sample in {sample | firstLiveDistanceStop (γ sample) z e ≤ ENNReal.ofReal T}, + physicalStoppedDensity κ (fun t => B t sample) (γ sample) (g sample) z e ∂P := by + rw [← lintegral_indicator₀ hA] + apply lintegral_congr_ae + filter_upwards [hWe] with sample hw + simpa only [Set.indicator_apply,Set.mem_ofPred_eq] using hw z + rw [hideq] + exact (ENNReal.ofReal_le_ofReal (hbd z hz).2.2.2).trans + (hfirst z (hK hz) (hbd z hz).2.1 (hbd z hz).2.2.1 e he hes) + have hmass : ENNReal.ofReal (m*(volume K).toReal) ≤ + ∫⁻ z in K, ∫⁻ sample, W (sample,z) ∂P ∂volume := by + calc + _ = ∫⁻ z in K, ENNReal.ofReal m ∂volume := by + rw [lintegral_const,Measure.restrict_apply_univ,ENNReal.ofReal_mul hm.le, + ENNReal.ofReal_toReal measure_closedBall_lt_top.ne] + _ ≤ _ := lintegral_mono_ae (ae_restrict_of_forall_mem hKm hwfirst) + have hswap : (∫⁻ z in K, ∫⁻ sample, W (sample,z) ∂P ∂volume) = + ∫⁻ sample, ∫⁻ z in K, W (sample,z) ∂volume ∂P := by + exact (lintegral_lintegral_swap (μ := P) (ν := volume.restrict K) + (f := fun sample z => W (sample,z)) hW.aemeasurable).symm + rw [hswap] at hmass + apply hmass.trans_eq + apply lintegral_congr_ae + filter_upwards [hWe] with sample hw + exact lintegral_congr hw + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/ReverseFlow.lean b/lean/OAI/Probability/SLELocalization/ReverseFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..260dec6a90ad642501bf2d1b1cc092ea134e0859 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/ReverseFlow.lean @@ -0,0 +1,1014 @@ +import Mathlib +import OAI.Probability.SLELocalization.BoundaryDiffusion +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Reverse Loewner estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ReverseLoewner +open LoewnerCutoff + +lemma continuous_velocity {ε : ℝ} (hε : 0 < ε) : + Continuous (fun p : ℝ × ℂ => velocity ε p.1 p.2) := + (LoewnerCutoff.continuous_velocity hε).neg + +lemma norm_velocity_le {ε : ℝ} (hε : 0 < ε) (u : ℝ) (w : ℂ) : + ‖velocity ε u w‖ ≤ 2 / ε := by + simpa only [velocity,norm_neg] using LoewnerCutoff.norm_velocity_le hε u w + +lemma exists_solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) (z : ℂ) : + ∃ H : ℝ → ℂ, H 0 = z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t := by + let L : ℝ≥0 := ⟨2 / ε, by positivity⟩ + let K : ℝ≥0 := ⟨4 / ε^2, by positivity⟩ + let a : ℝ≥0 := ⟨(2 / ε) * T, mul_nonneg (by positivity) hT⟩ + have hp : IsPicardLindelof (fun t => velocity ε (U t)) + ⟨0, ⟨le_rfl, hT⟩⟩ z a 0 L K := by + constructor + · exact fun t _ => (velocity_lipschitz hε (U t)).lipschitzOnWith + · intro w _ + have hc : ContinuousOn (fun t : ℝ => (U t, w)) (Icc 0 T) := + hU.prodMk continuousOn_const + simpa only [Function.comp_def] using + (continuous_velocity hε).comp_continuousOn hc + · exact fun t _ w _ => norm_velocity_le hε (U t) w + · dsimp [L, a] + simp only [sub_zero, sub_self, max_eq_left hT] + rfl + exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + +end SLEExactGauge.ReverseLoewner + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ReverseLoewner +open LoewnerCutoff + +lemma norm_velocity_driver_sub_le {ε : ℝ} (hε : 0 < ε) (u v : ℝ) (z : ℂ) : + ‖velocity ε u z - velocity ε v z‖ ≤ (4 / ε^2) * |u-v| := by + simpa only [velocity, neg_sub_neg, norm_sub_rev] using + LoewnerCutoff.norm_velocity_driver_sub_le hε u v z + +lemma derivWithin_right {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ico 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Ici t) t := + (hH t ⟨ht.1, ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem ht) + +lemma derivWithin_left {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ioc 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Iic t) t := + (hH t ⟨ht.1.le, ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsLE_of_mem ht) + +lemma solution_eq {ε T : ℝ} (hε : 0 < ε) {U : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (U t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) : EqOn H G (Icc 0 T) := by + apply ODE_solution_unique_of_mem_Icc_right + (s := fun _ => univ) (fun t _ => (velocity_lipschitz hε (U t)).lipschitzOnWith) + (HasDerivWithinAt.continuousOn hH) (fun _ ht => derivWithin_right hH ht) + (fun _ _ => mem_univ _) (HasDerivWithinAt.continuousOn hG) + (fun _ ht => derivWithin_right hG ht) (fun _ _ => mem_univ _) h0 + +lemma solution_dist_le {ε T D : ℝ} (hε : 0 < ε) (hD : 0 ≤ D) + {U V : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (V t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ D) + {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (H t) (G t) ≤ D * Real.exp ((4 / ε^2) * T) := by + let K : ℝ≥0 := ⟨4 / ε^2, by positivity⟩ + have hK : (0 : ℝ) < K := by change 0 < 4 / ε^2; positivity + have hb (s : ℝ) (hs : s ∈ Ico 0 T) : + dist (velocity ε (V s) (G s)) (velocity ε (U s) (G s)) ≤ (K : ℝ) * D := by + rw [dist_eq_norm] + calc + _ ≤ (4 / ε^2) * |V s-U s| := norm_velocity_driver_sub_le hε _ _ _ + _ ≤ (K : ℝ) * D := by + rw [abs_sub_comm] + exact mul_le_mul_of_nonneg_left (hUV s ⟨hs.1, hs.2.le⟩) hK.le + have hh := dist_le_of_approx_trajectories_ODE + (fun t => velocity_lipschitz hε (U t)) + (HasDerivWithinAt.continuousOn hH) (fun _ hs => derivWithin_right hH hs) + (fun t _ => le_of_eq (dist_self (velocity ε (U t) (H t)))) + (HasDerivWithinAt.continuousOn hG) (fun _ hs => derivWithin_right hG hs) + hb (le_of_eq (dist_eq_zero.2 h0)) t ht + have he : gronwallBound 0 K (0 + (K : ℝ)*D) (t-0) = + D * (Real.exp ((K : ℝ)*t)-1) := by + simp only [gronwallBound, zero_add, sub_zero, ite_eq_right (ne_of_gt hK)] + field_simp + ring + rw [he] at hh + have hexp : Real.exp ((K : ℝ)*t) ≤ Real.exp ((K : ℝ)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left ht.2 hK.le) + apply hh.trans + change D * (Real.exp ((4 / ε^2)*t)-1) ≤ D * Real.exp ((4 / ε^2)*T) + change Real.exp ((4 / ε^2)*t) ≤ Real.exp ((4 / ε^2)*T) at hexp + exact mul_le_mul_of_nonneg_left (by linarith) hD + +end SLEExactGauge.ReverseLoewner + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ReverseLoewner +open LoewnerCutoff +open scoped unitInterval + +def solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : ℝ → ℂ := + (exists_solution hε hT (extendDriver T U) (continuous_extendDriver T U).continuousOn z).choose + +lemma solution_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + solution hε hT U z 0 = z := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.1 + +lemma solution_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + ∀ t ∈ Icc 0 T, HasDerivWithinAt (solution hε hT U z) + (velocity ε (extendDriver T U t) (solution hε hT U z t)) (Icc 0 T) t := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.2 + +def solutionPath {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + C(Icc 0 T, ℂ) := + ⟨fun t => solution hε hT U z t, + continuousOn_iff_continuous_domRestrict.1 (HasDerivWithinAt.continuousOn (solution_deriv hε hT U z))⟩ + +lemma solutionPath_lipschitz {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + LipschitzWith ⟨Real.exp ((4 / ε^2) * T), (Real.exp_pos _).le⟩ + (fun U : C(I, ℝ) => solutionPath hε hT U z) := by + apply LipschitzWith.of_dist_le_mul + intro U V + apply (ContinuousMap.dist_le (mul_nonneg (Real.exp_pos _).le dist_nonneg)).2 + intro t + have hUV (s : ℝ) (_hs : s ∈ Icc 0 T) : + |extendDriver T U s-extendDriver T V s| ≤ dist U V := by + exact (ContinuousMap.dist_apply_le_dist (f := U) (g := V) + (projIcc 0 1 zero_le_one (s/T))) + have hh := solution_dist_le hε dist_nonneg (solution_deriv hε hT U z) + (solution_deriv hε hT V z) + ((solution_initial hε hT U z).trans (solution_initial hε hT V z).symm) + hUV t.property + change dist (solution hε hT U z t) (solution hε hT V z t) ≤ + Real.exp ((4 / ε^2)*T) * dist U V + simpa only [mul_comm] using hh + +end SLEExactGauge.ReverseLoewner + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ReverseLoewner +open LoewnerCutoff + +def reverseCentered (U : C(I, ℝ)) : C(I, ℝ) := + ⟨fun q => U (unitInterval.symm q) - U 1, + (U.continuous.comp unitInterval.continuous_symm).sub continuous_const⟩ + +lemma reverseCentered_lipschitz : LipschitzWith 2 reverseCentered := by + apply LipschitzWith.of_dist_le_mul + intro U V + apply (ContinuousMap.dist_le (by positivity)).2 + intro q + change dist (U (unitInterval.symm q)-U 1) (V (unitInterval.symm q)-V 1) ≤ (2:ℝ)*dist U V + calc + _ ≤ dist (U (unitInterval.symm q)) (V (unitInterval.symm q)) + dist (U 1) (V 1) := dist_sub_sub_le _ _ _ _ + _ ≤ dist U V + dist U V := add_le_add (ContinuousMap.dist_apply_le_dist _) (ContinuousMap.dist_apply_le_dist _) + _ = _ := by ring + +lemma extend_reverseCentered {T : ℝ} (hT : T ≠ 0) (U : C(I, ℝ)) (s : ℝ) : + extendDriver T (reverseCentered U) s = extendDriver T U (T-s) - U 1 := by + dsimp only [extendDriver,reverseCentered,ContinuousMap.coe_mk] + rw [unitInterval.symm_projIcc] + congr 2 + field_simp + +lemma extend_end {T : ℝ} (hT : T ≠ 0) (U : C(I, ℝ)) : extendDriver T U T = U 1 := by + simp only [extendDriver,div_self hT] + congr 1 + exact Subtype.ext (by simp [projIcc]) + +def tipApprox {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) : ℂ := + solution hε hT (reverseCentered U) ((ε:ℂ)*Complex.I) T + (U 1 : ℂ) + +lemma continuous_tipApprox {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) : + Continuous (tipApprox hε hT) := by + have hc : Continuous (fun U : C(I, ℝ) => + solutionPath hε hT (reverseCentered U) ((ε:ℂ)*Complex.I)) := + (solutionPath_lipschitz hε hT _).continuous.comp reverseCentered_lipschitz.continuous + have he := (continuous_eval_const (⟨T,⟨hT,le_rfl⟩⟩ : Icc 0 T)).comp hc + exact he.add (Complex.continuous_ofReal.comp (continuous_eval_const (1:I))) + +lemma tipApprox_eq_inverse {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {ε T : ℝ} (hε : 0 < ε) (hT : 0 < T) + (hU : ContinuousOn driver (Icc 0 T)) (U : C(I, ℝ)) + (he : EqOn (extendDriver T U) driver (Icc 0 T)) : + tipApprox hε hT.le U = f T ((driver T:ℂ)+(ε:ℂ)*Complex.I) := by + let w : ℂ := (driver T:ℂ)+(ε:ℂ)*Complex.I + have hw : w ∈ halfPlane := by simpa [w,halfPlane] using hε + let z := f T w + have hz : z ∈ localizationDomain γ T := h.2.2.2.2.2.2.2.2.1 T hT.le hw + have hfinal : g T z = w := h.2.2.2.2.2.2.2.2.2.2.1 T hT.le _ hw + have hend : (U 1:ℝ) = driver T := (extend_end hT.ne' U).symm.trans (he ⟨hT.le,le_rfl⟩) + let H : ℝ → ℂ := fun s => g (T-s) z - (driver T:ℂ) + have hH0 : H 0 = (ε:ℂ)*Complex.I := by simp [H,hfinal,w] + have hheight (s : ℝ) (hs : s ∈ Icc 0 T) : ε ≤ (H s).im := by + have hh := h.height_antitone hT.le hz (show T-s ∈ Icc 0 T by constructor <;> linarith [hs.1,hs.2]) + ⟨hT.le,le_rfl⟩ (by linarith [hs.1] : T-s ≤ T) + simp only [hfinal,w,Complex.add_im,Complex.ofReal_im,Complex.mul_I_im,Complex.ofReal_re,zero_add] at hh + simpa only [H,Complex.sub_im,Complex.ofReal_im,sub_zero] using hh + have hHd (s : ℝ) (hs : s ∈ Icc 0 T) : + HasDerivWithinAt H (velocity ε (extendDriver T (reverseCentered U) s) (H s)) (Icc 0 T) s := by + have hst : T-s ∈ Icc 0 T := by constructor <;> linarith [hs.1,hs.2] + have htder : HasDerivWithinAt (fun r : ℝ => T-r) (-1) (Icc 0 T) s := by + simpa only [id_eq] using ((hasDerivAt_id s).const_sub T).hasDerivWithinAt + have hd := (h.hasDerivWithinAt_eval hT.le hU hz hst).scomp s htder + (show MapsTo (fun r : ℝ => T-r) (Icc 0 T) (Icc 0 T) from fun r hr => by constructor <;> linarith [hr.1,hr.2]) + have hd' := hd.sub_const (driver T : ℂ) + apply hd'.congr_deriv + rw [velocity,LoewnerCutoff.velocity_eq (hheight s hs),extend_reverseCentered hT.ne' U s,he hst,hend] + dsimp only [H,Function.comp_def] + simp only [neg_smul,one_smul] + push_cast + ring + have hsol := solution_eq hε hHd (solution_deriv hε hT.le (reverseCentered U) ((ε:ℂ)*Complex.I)) + (hH0.trans (solution_initial hε hT.le (reverseCentered U) ((ε:ℂ)*Complex.I)).symm) + have hendpoint := hsol ⟨hT.le,le_rfl⟩ + simp only [H,sub_self,h.initial z hz.1.1] at hendpoint + dsimp only [tipApprox] + rw [← hendpoint,hend] + simp only [sub_add_cancel,z,w] + +end SLEExactGauge.ReverseLoewner + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.CanonicalTrace +open ReverseLoewner + +def height (n : ℕ) : ℝ := 1 / ((n:ℝ)+1) + +lemma height_pos (n : ℕ) : 0 < height n := by unfold height; positivity + +lemma height_tendsto : Tendsto height atTop (𝓝[>] (0:ℝ)) := by + apply tendsto_nhdsWithin_iff.2 + constructor + · change Tendsto (fun n : ℕ => (1:ℝ)/((n:ℝ)+1)) atTop (𝓝 0) + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_one] using + (tendsto_const_div_atTop_nhds_zero_nat (1:ℝ)).comp (tendsto_add_atTop_nat 1) + · exact Filter.Eventually.of_forall height_pos + +def value {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) (sample : Ω) : ℂ := + if T = 0 then 0 else ContinuousDriver.selectedLimit 0 + (fun n => tipApprox (height_pos n) T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T sample)) + +lemma measurable_past {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) : + @Measurable Ω ℂ (BrownianPredictable.pastSigma B T) (borel ℂ) (value κ B T) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := BrownianPredictable.pastSigma B T + change Measurable (fun sample => value κ B T sample) + by_cases hT : T = 0 + · simp only [value,ite_eq_left hT] + exact measurable_const + · simp only [value,ite_eq_right hT] + apply ContinuousDriver.measurable_selectedLimit + intro n + exact (continuous_tipApprox (height_pos n) T.coe_nonneg).measurable.comp + (BrownianDriver.path_measurable_past B (Real.sqrt κ) T) + +lemma aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (κ : ℝ) {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) : + AEMeasurable (value κ B T) P := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + change AEMeasurable (fun sample => value κ B T sample) P + by_cases hT : T = 0 + · simp only [value,ite_eq_left hT] + exact aemeasurable_const + · simp only [value,ite_eq_right hT] + apply ContinuousDriver.aemeasurable_selectedLimit + intro n + exact (continuous_tipApprox (height_pos n) T.coe_nonneg).measurable.comp_aemeasurable + (BrownianDriver.path_aemeasurable hB (Real.sqrt κ) T) + +lemma eq_source {Ω : Type*} (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) (sample : Ω) + {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ * B t.toNNReal sample) γ g f) + (hc : Continuous (fun t => B t sample)) (T : ℝ≥0) : value κ B T sample = γ T := by + by_cases hT : T = 0 + · simpa [value,hT] using h.2.1.symm + · simp only [value,ite_eq_right hT] + apply ContinuousDriver.selectedLimit_eq + have hTp : 0 < (T:ℝ) := lt_of_le_of_ne T.coe_nonneg (by exact_mod_cast Ne.symm hT) + have he (n : ℕ) : + tipApprox (height_pos n) T.coe_nonneg (BrownianDriver.path B (Real.sqrt κ) T sample) = + f T ((Real.sqrt κ * B T sample:ℝ) + (height n:ℂ)*Complex.I) := by + simpa only [Real.toNNReal_coe] using + tipApprox_eq_inverse h (height_pos n) hTp + ((continuous_const.mul (hc.comp continuous_real_toNNReal)).continuousOn) + (BrownianDriver.path B (Real.sqrt κ) T sample) + (fun _ ht => BrownianDriver.extend_eq B (Real.sqrt κ) T sample hc ht) + have ht := (h.2.2.2.2.2.2.2.2.2.2.2.2.2 T T.coe_nonneg).comp height_tendsto + simpa only [Function.comp_def,he,Real.toNNReal_coe] using ht + +end SLEExactGauge.CanonicalTrace + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge + +theorem canonicalTraceFromBrownianPast {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + (κ : ℝ) (_hκ : 0 < κ ∧ κ < 8) + (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ sample ∂P, IsLoewnerTraceUsing + (fun t => Real.sqrt κ * B t.toNNReal sample) (γ sample) (g sample) (f sample)) : + ∃ Γ : ℝ≥0 → Ω → ℂ, + (∀ t, @Measurable Ω ℂ (BrownianPredictable.pastSigma B t) (borel ℂ) (Γ t)) ∧ + (∀ t, AEMeasurable (Γ t) P) ∧ + ∀ᵐ sample ∂P, ∀ t : ℝ≥0, Γ t sample = γ sample t := by + refine ⟨CanonicalTrace.value κ B, CanonicalTrace.measurable_past κ B, + CanonicalTrace.aemeasurable κ hB, ?_⟩ + filter_upwards [hmaps,hB.cont] with sample hm hc + exact CanonicalTrace.eq_source κ B sample hm hc + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional + +lemma source_point_reach {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hzero : driver 0=0) + {ε T S : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (hS : 0 ≤ S) (hST : S ≤ T) + (U : C(I, ℝ)) (hU : EqOn (extendDriver T U) driver (Icc 0 T)) + (x a β δ d y : ℝ) (hβ : 0 < β) (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) + (haδ : a ≤ 2-4*δ) (hd : 0 < d) (hdx : d < δ*x) (hεx : 2*ε < x) (hy : δ*ε < y) + (w : ℂ) (hw : w ∈ localizationDomain γ S) (hclose : dist w (x:ℂ) < d) + (hwS : g S w=(driver S:ℂ)+(y:ℂ)*Complex.I) : + reach U hε hT x β a ((δ/(4*d))^β) := by + apply tip_forces_reach hε hT hS hST U (by rw [hU ⟨le_rfl,hT⟩,hzero]) x a β δ d y + hβ hδ hδhalf haδ hd hdx hεx hy (fun t => g t w) (h.continuous_eval hS hw) + · intro t ht + rw [hU ⟨ht.1.le,ht.2.le.trans hST⟩] + exact h.hasDerivAt_eval ht.1 (survivingDomain_mono ht.2.le hw) + · rw [h.initial w hw.1.1] + exact (dist_eq_norm w (x:ℂ) ▸ hclose).le + · intro t ht + have hh := h.height_antitone hS hw ht ⟨hS,le_rfl⟩ ht.2 + dsimp only at hh + rw [hwS] at hh + simpa using hh + · rw [hwS,hU ⟨hS,hST⟩] + simp + +lemma source_hit_eventually_reach {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ : ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + (x a β δ d : ℝ) (hx : 0 < x) (hβ : 0 < β) (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) + (haδ : a ≤ 2-4*δ) (hd : 0 < d) (hdx : d < δ*x) + (hhit : ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < d) : + ∀ᶠ n : ℕ in atTop, reach (BrownianDriver.path B (Real.sqrt κ) (n+1) ω) + (CanonicalTrace.height_pos n) (n+1 : ℝ≥0).coe_nonneg x β a ((δ/(4*d))^β) := by + obtain ⟨t,ht,hclose⟩ := hhit + obtain ⟨w,y,hy,hwd,hw,hwS⟩ := inverse_tip_point h ht hclose + have hsmall : ∀ᶠ n : ℕ in atTop, CanonicalTrace.height n < min (x/2) (y/δ) := + (CanonicalTrace.height_tendsto.mono_right nhdsWithin_le_nhds).eventually + (gt_mem_nhds (lt_min (half_pos hx) (div_pos hy hδ))) + have hlarge : ∀ᶠ n : ℕ in atTop, t ≤ ((n+1:ℝ≥0):ℝ) := by + have hh : Tendsto (fun n : ℕ => (n:ℝ)+1) atTop atTop := tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop + simpa only [NNReal.coe_add,NNReal.coe_natCast,NNReal.coe_one] using hh.eventually (eventually_ge_atTop t) + filter_upwards [hsmall,hlarge] with n hn htn + have hn' := lt_min_iff.mp hn + have hxcut : 2*CanonicalTrace.height n < x := by linarith [hn'.1] + have hycut : δ*CanonicalTrace.height n < y := by + have hh := (lt_div_iff₀ hδ).mp hn'.2 + simpa only [mul_comm] using hh + apply source_point_reach h (by simp [hb0]) (CanonicalTrace.height_pos n) + (n+1:ℝ≥0).coe_nonneg ht htn (BrownianDriver.path B (Real.sqrt κ) (n+1) ω) + (fun s hs => BrownianDriver.extend_eq B _ (n+1) ω hc hs) + x a β δ d y hβ hδ hδhalf haδ hd hdx hxcut hycut w hw hwd hwS + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing + +lemma initial_bound {β x ε : ℝ} (hβ : 0 ≤ β) (hx : 0 < x) : + radial (-β) x ε ≤ x^(-β) := by + have hh := Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos hx) + (le_add_of_nonneg_right (sq_nonneg ε)) (show (-β)/2 ≤ 0 by linarith) + change (x^2+ε^2)^((-β)/2) ≤ x^(-β) + calc + _ ≤ (x^2)^((-β)/2) := hh + _ = x^(-β) := by + rw [← Real.rpow_natCast_mul hx.le] + congr 1 + ring + +def uniformBudget {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a x L : ℝ) (n : ℕ) (ω : Ω) : ℝ := + budget B κ β a (CanonicalTrace.height_pos n) (n+1) x L ω + + (x^(-β)-radial (-β) x (CanonicalTrace.height n)) + +lemma uniformBudget_mean {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (x L : ℝ) (hx : 0 < x) (n : ℕ) : + Integrable (uniformBudget B κ β a x L n) P ∧ + (∫ ω,uniformBudget B κ β a x L n ω ∂P)=x^(-β) ∧ + ∀ ω, 0 ≤ uniformBudget B κ β a x L n ω := by + have hT : (0:ℝ)<((n+1:ℝ≥0):ℝ) := by positivity + have hh := budget_mean hB κ β a hκ hβ ha hba (CanonicalTrace.height_pos n) (n+1) hT x L + refine ⟨hh.1.add (integrable_const _),?_,?_⟩ + · change (∫ ω,budget B κ β a (CanonicalTrace.height_pos n) (n+1) x L ω+ + (x^(-β)-radial (-β) x (CanonicalTrace.height n)) ∂P)=_ + rw [integral_add hh.1 (integrable_const _),hh.2] + simp + · intro ω + exact add_nonneg (budget_nonneg B κ β a (CanonicalTrace.height_pos n) (n+1) x L ω) + (sub_nonneg.mpr (initial_bound hβ hx)) + +lemma uniformBudget_dominates {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ β a x L : ℝ) + (hβ : 0 ≤ β) (hx : 0 < x) (n : ℕ) (ω : Ω) : + budget B κ β a (CanonicalTrace.height_pos n) (n+1) x L ω ≤ uniformBudget B κ β a x L n ω := + le_add_of_nonneg_right (sub_nonneg.mpr (initial_bound hβ hx)) + +lemma ratio_power_eq {x d δ β : ℝ} (hx : 0 < x) (hd : 0 < d) (hδ : 0 < δ) : + x^(-β)/(δ/(4*d))^β = (4*d/(δ*x))^β := by + rw [Real.rpow_neg hx.le,← Real.inv_rpow hx.le,← Real.div_rpow (inv_nonneg.mpr hx.le) (by positivity)] + congr 1 + field_simp + +theorem positive_real_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a δ : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 < β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {x d : ℝ} (hx : 0 < x) (hd : 0 < d) : + P {ω | ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < d} ≤ ENNReal.ofReal ((4*d/(δ*x))^β) := by + by_cases hdx : d < δ*x + · let L : ℝ := (δ/(4*d))^β + have hL : 0 < L := Real.rpow_pos_of_pos (by positivity) _ + have hm (n : ℕ) := uniformBudget_mean hB κ β a hκ hβ.le ha hba x L hx n + have hE : ∀ᵐ ω ∂P, (∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < d) → + ∀ᶠ n : ℕ in atTop, L ≤ uniformBudget B κ β a x L n ω := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hh hc hb0 + intro hhit + filter_upwards [source_hit_eventually_reach B κ γ g f ω hh hc hb0 x a β δ d hx hβ hδ hδhalf haδ hd hdx hhit] with n hn + have hb := budget_dominates_reach B κ β a hκ hβ.le ha hba (CanonicalTrace.height_pos n) + (n+1) (by positivity) x L ω hc hb0 hn + exact hb.trans (uniformBudget_dominates B κ β a x L hβ.le hx n ω) + have hh := measure_eventually_budget (uniformBudget B κ β a x L) (x^(-β)) L hL + (fun n => (hm n).1) (fun n => (hm n).2.2) (fun n => (hm n).2.1) _ hE + rwa [ratio_power_eq hx hd hδ] at hh + · have hratio : 1 ≤ 4*d/(δ*x) := by + rw [le_div_iff₀ (mul_pos hδ hx)] + have hh : δ*x ≤ d := not_lt.1 hdx + linarith + have hp : 1 ≤ (4*d/(δ*x))^β := Real.one_le_rpow hratio hβ.le + exact (prob_le_one).trans (by simpa using ENNReal.ofReal_le_ofReal hp) + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory Metric +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional + +def mirror (z : ℂ) : ℂ := -(starRingEnd ℂ) z + +lemma mirror_im (z : ℂ) : (mirror z).im=z.im := by simp [mirror] + +lemma mirror_re (z : ℂ) : (mirror z).re= -z.re := by simp [mirror] + +lemma continuous_mirror : Continuous mirror := Complex.continuous_conj.neg + +lemma mirror_dist_real (w : ℂ) (x : ℝ) : ‖mirror w-(x:ℂ)‖ = dist w ((-x:ℝ):ℂ) := by + rw [dist_eq_norm] + have he : mirror w-(x:ℂ) = -(starRingEnd ℂ) (w-((-x:ℝ):ℂ)) := by simp [mirror]; ring + rw [he,norm_neg,Complex.norm_conj] + +lemma mirror_ode {G : ℝ → ℂ} {t u : ℝ} (hG : HasDerivAt G (2/(G t-(u:ℂ))) t) : + HasDerivAt (fun s => mirror (G s)) (2/(mirror (G t)-((-u:ℝ):ℂ))) t := by + have hh := (Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp_hasDerivAt t hG).neg + change HasDerivAt (fun s => -(starRingEnd ℂ) (G s)) (-(starRingEnd ℂ) (2/(G t-(u:ℂ)))) t at hh + apply hh.congr_deriv + simp only [map_div₀,map_ofNat,map_sub,Complex.conj_ofReal,Complex.ofReal_neg,mirror] + rw [show -(starRingEnd ℂ) (G t)- -(u:ℂ) = -((starRingEnd ℂ) (G t)-(u:ℂ)) by ring,div_neg] + +lemma negative_source_point_reach {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hzero : driver 0=0) + {ε T S : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (hS : 0 ≤ S) (hST : S ≤ T) + (U : C(I, ℝ)) (hU : EqOn (extendDriver T U) (fun s => -driver s) (Icc 0 T)) + (x a β δ d y : ℝ) (hβ : 0 < β) (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) + (haδ : a ≤ 2-4*δ) (hd : 0 < d) (hdx : d < δ*x) (hεx : 2*ε < x) (hy : δ*ε < y) + (w : ℂ) (hw : w ∈ localizationDomain γ S) (hclose : dist w ((-x:ℝ):ℂ) < d) + (hwS : g S w=(driver S:ℂ)+(y:ℂ)*Complex.I) : + reach U hε hT x β a ((δ/(4*d))^β) := by + apply tip_forces_reach hε hT hS hST U (by rw [hU ⟨le_rfl,hT⟩]; simp [hzero]) x a β δ d y + hβ hδ hδhalf haδ hd hdx hεx hy (fun t => mirror (g t w)) + (continuous_mirror.comp_continuousOn (h.continuous_eval hS hw)) + · intro t ht + rw [hU ⟨ht.1.le,ht.2.le.trans hST⟩] + exact mirror_ode (h.hasDerivAt_eval ht.1 (survivingDomain_mono ht.2.le hw)) + · rw [h.initial w hw.1.1,mirror_dist_real] + exact hclose.le + · intro t ht + rw [mirror_im] + have hh := h.height_antitone hS hw ht ⟨hS,le_rfl⟩ ht.2 + dsimp only at hh + rw [hwS] at hh + simpa using hh + · rw [mirror_re,hwS,hU ⟨hS,hST⟩] + simp + +lemma negative_source_hit_eventually_reach {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) (κ : ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (h : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω=0) + (x a β δ d : ℝ) (hx : 0 < x) (hβ : 0 < β) (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) + (haδ : a ≤ 2-4*δ) (hd : 0 < d) (hdx : d < δ*x) + (hhit : ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) ((-x:ℝ):ℂ) < d) : + ∀ᶠ n : ℕ in atTop, reach (BrownianDriver.path (-B) (Real.sqrt κ) (n+1) ω) + (CanonicalTrace.height_pos n) (n+1 : ℝ≥0).coe_nonneg x β a ((δ/(4*d))^β) := by + obtain ⟨t,ht,hclose⟩ := hhit + obtain ⟨w,y,hy,hwd,hw,hwS⟩ := inverse_tip_point h ht hclose + have hsmall : ∀ᶠ n : ℕ in atTop, CanonicalTrace.height n < min (x/2) (y/δ) := + (CanonicalTrace.height_tendsto.mono_right nhdsWithin_le_nhds).eventually + (gt_mem_nhds (lt_min (half_pos hx) (div_pos hy hδ))) + have hlarge : ∀ᶠ n : ℕ in atTop, t ≤ ((n+1:ℝ≥0):ℝ) := by + have hh : Tendsto (fun n : ℕ => (n:ℝ)+1) atTop atTop := + tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop + simpa only [NNReal.coe_add,NNReal.coe_natCast,NNReal.coe_one] using hh.eventually (eventually_ge_atTop t) + filter_upwards [hsmall,hlarge] with n hn htn + have hn' := lt_min_iff.mp hn + have hxcut : 2*CanonicalTrace.height n < x := by linarith [hn'.1] + have hycut : δ*CanonicalTrace.height n < y := by + have hh := (lt_div_iff₀ hδ).mp hn'.2 + simpa only [mul_comm] using hh + apply negative_source_point_reach h (by simp [hb0]) (CanonicalTrace.height_pos n) + (n+1:ℝ≥0).coe_nonneg ht htn (BrownianDriver.path (-B) (Real.sqrt κ) (n+1) ω) + (fun s hs => by + have he := BrownianDriver.extend_eq (-B) (Real.sqrt κ) (n+1) ω hc.neg hs + change extendDriver ((n+1:ℝ≥0):ℝ) (BrownianDriver.path (-B) (Real.sqrt κ) (n+1) ω) s = + Real.sqrt κ*(-B s.toNNReal ω) at he + simpa only [mul_neg] using he) + x a β δ d y hβ hδ hδhalf haδ hd hdx hxcut hycut w hw hwd hwS + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing + +theorem negative_real_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a δ : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 < β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {x d : ℝ} (hx : 0 < x) (hd : 0 < d) : + P {ω | ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) ((-x:ℝ):ℂ) < d} ≤ ENNReal.ofReal ((4*d/(δ*x))^β) := by + by_cases hdx : d < δ*x + · let L : ℝ := (δ/(4*d))^β + have hL : 0 < L := Real.rpow_pos_of_pos (by positivity) _ + have hm (n : ℕ) := uniformBudget_mean hB.neg κ β a hκ hβ.le ha hba x L hx n + have hE : ∀ᵐ ω ∂P, (∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) ((-x:ℝ):ℂ) < d) → + ∀ᶠ n : ℕ in atTop, L ≤ uniformBudget (-B) κ β a x L n ω := by + filter_upwards [hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero] with ω hh hc hb0 + intro hhit + filter_upwards [negative_source_hit_eventually_reach B κ γ g f ω hh hc hb0 x a β δ d hx hβ hδ hδhalf haδ hd hdx hhit] with n hn + have hb := budget_dominates_reach (-B) κ β a hκ hβ.le ha hba (CanonicalTrace.height_pos n) + (n+1) (by positivity) x L ω hc.neg (by simpa using congrArg Neg.neg hb0) hn + exact hb.trans (uniformBudget_dominates (-B) κ β a x L hβ.le hx n ω) + have hh := measure_eventually_budget (uniformBudget (-B) κ β a x L) (x^(-β)) L hL + (fun n => (hm n).1) (fun n => (hm n).2.2) (fun n => (hm n).2.1) _ hE + rwa [ratio_power_eq hx hd hδ] at hh + · have hratio : 1 ≤ 4*d/(δ*x) := by + rw [le_div_iff₀ (mul_pos hδ hx)] + have hh : δ*x ≤ d := not_lt.1 hdx + linarith + have hp : 1 ≤ (4*d/(δ*x))^β := Real.one_le_rpow hratio hβ.le + exact (prob_le_one).trans (by simpa using ENNReal.ofReal_le_ofReal hp) + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen + +theorem real_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a δ : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 < β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {x d : ℝ} (hx : 0 < |x|) (hd : 0 < d) : + P {ω | ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < d} ≤ ENNReal.ofReal ((4*d/(δ*|x|))^β) := by + rcases le_or_gt 0 x with hpos | hneg + · rw [abs_of_nonneg hpos] at hx ⊢ + exact positive_real_bound hB κ β a δ hκ hβ ha hba hδ hδhalf haδ γ g f hmaps hx hd + · have hh := negative_real_bound hB κ β a δ hκ hβ ha hba hδ hδhalf haδ γ g f hmaps (neg_pos.2 hneg) hd + simpa only [neg_neg,abs_of_neg hneg] using hh + +lemma annulus_real_bound {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (κ β a δ : ℝ) + (hκ : 0 ≤ κ) (hβ : 0 < β) (ha : 0 ≤ a) (hba : κ*(β+1) ≤ 4+2*a) + (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (haδ : a ≤ 2-4*δ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + {x d : ℝ} (hx : 1/4 ≤ |x|) (hd : 0 < d) : + P {ω | ∃ t : ℝ, 0 ≤ t ∧ dist (γ ω t) (x:ℂ) < d} ≤ ENNReal.ofReal ((16/δ)^β*d^β) := by + have hxp : 0 < |x| := lt_of_lt_of_le (by norm_num) hx + refine (real_bound hB κ β a δ hκ hβ ha hba hδ hδhalf haδ γ g f hmaps hxp hd).trans + (ENNReal.ofReal_le_ofReal ?_) + have hr : 4*d/(δ*|x|) ≤ (16/δ)*d := by + rw [div_le_iff₀ (mul_pos hδ hxp)] + have hh := mul_le_mul_of_nonneg_left hx (show 0 ≤ 16*d by positivity) + field_simp + nlinarith + have hh := Real.rpow_le_rpow (by positivity : 0 ≤ 4*d/(δ*|x|)) hr hβ.le + rwa [Real.mul_rpow (by positivity : 0 ≤ 16/δ) hd.le] at hh + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.AngularBarrier + +def lowerGamma (b s : ℝ) : ℝ := ∫ x in (0:ℝ)..s, Real.exp (-x)*x^(b-1) + +def cdf (b s : ℝ) : ℝ := lowerGamma b s / Real.Gamma b + +def pdf (b s : ℝ) : ℝ := Real.exp (-s)*s^(b-1)/Real.Gamma b + +lemma integrable_kernel {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 ≤ s) : + IntervalIntegrable (fun x : ℝ => Real.exp (-x)*x^(b-1)) volume 0 s := by + rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hs] + exact (Real.GammaIntegral_convergent hb).mono_set Ioc_subset_Ioi_self + +lemma kernel_continuousAt (b : ℝ) {s : ℝ} (hs : 0 < s) : + ContinuousAt (fun x : ℝ => Real.exp (-x)*x^(b-1)) s := + Real.continuous_exp.continuousAt.comp continuousAt_neg |>.mul + (continuousAt_id.rpow_const (Or.inl hs.ne')) + +lemma lowerGamma_nonneg {b : ℝ} (_hb : 0 < b) {s : ℝ} (hs : 0 ≤ s) : 0 ≤ lowerGamma b s := by + apply intervalIntegral.integral_nonneg hs + intro x hx + exact mul_nonneg (Real.exp_pos _).le (Real.rpow_nonneg hx.1 _) + +lemma cdf_nonneg {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 ≤ s) : 0 ≤ cdf b s := + div_nonneg (lowerGamma_nonneg hb hs) (Real.Gamma_pos_of_pos hb).le + +lemma pdf_pos {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 < s) : 0 < pdf b s := + div_pos (mul_pos (Real.exp_pos _) (Real.rpow_pos_of_pos hs _)) (Real.Gamma_pos_of_pos hb) + +lemma power_integral {b : ℝ} (hb : 0 < b) {s : ℝ} (_hs : 0 ≤ s) : + (∫ x in (0:ℝ)..s, x^(b-1)) = s^b/b := by + rw [integral_rpow (Or.inl (by linarith : -1 < b-1))] + rw [show b-1+1 = b by ring, Real.zero_rpow hb.ne', sub_zero] + +lemma cdf_le_power {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 ≤ s) : + cdf b s ≤ s^b/(b*Real.Gamma b) := by + have hmono : lowerGamma b s ≤ ∫ x in (0:ℝ)..s, x^(b-1) := by + apply intervalIntegral.integral_mono_on hs (integrable_kernel hb hs) + (intervalIntegral.intervalIntegrable_rpow' (by linarith : -1 < b-1)) + intro x hx + simpa only [one_mul] using mul_le_mul_of_nonneg_right + (Real.exp_le_one_iff.2 (neg_nonpos.2 hx.1)) (Real.rpow_nonneg hx.1 (b-1)) + rw [power_integral hb hs] at hmono + have hh := div_le_div_of_nonneg_right hmono (Real.Gamma_pos_of_pos hb).le + simpa only [cdf, div_div] using hh + +lemma hasDerivAt_lowerGamma {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 < s) : + HasDerivAt (lowerGamma b) (Real.exp (-s)*s^(b-1)) s := by + apply intervalIntegral.integral_hasDerivAt_right (integrable_kernel hb hs.le) + · exact (Real.measurable_exp.comp measurable_neg |>.mul + (measurable_id.pow_const (b-1))).aestronglyMeasurable.stronglyMeasurableAtFilter + · exact kernel_continuousAt b hs + +lemma hasDerivAt_cdf {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 < s) : + HasDerivAt (cdf b) (pdf b s) s := + (hasDerivAt_lowerGamma hb hs).div_const (Real.Gamma b) + +lemma deriv_cdf {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 < s) : + deriv (cdf b) s = pdf b s := (hasDerivAt_cdf hb hs).deriv + +lemma hasDerivAt_pdf {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : 0 < s) : + HasDerivAt (pdf b) (pdf b s*((b-1)/s-1)) s := by + have hd := (((hasDerivAt_neg s).exp).mul + ((hasDerivAt_id s).rpow_const (p:=b-1) (Or.inl hs.ne'))).div_const (Real.Gamma b) + apply hd.congr_deriv + unfold pdf + simp only [id_eq] + rw [Real.rpow_sub_one hs.ne' (b-1)] + field_simp + ring + +lemma lowerGamma_tendsto {b : ℝ} (hb : 0 < b) : + Tendsto (lowerGamma b) atTop (𝓝 (Real.Gamma b)) := by + rw [Real.Gamma_eq_integral hb] + exact intervalIntegral_tendsto_integral_Ioi 0 (Real.GammaIntegral_convergent hb) tendsto_id + +lemma cdf_tendsto {b : ℝ} (hb : 0 < b) : Tendsto (cdf b) atTop (𝓝 1) := by + change Tendsto (fun s => lowerGamma b s / Real.Gamma b) atTop (𝓝 1) + have hh := (lowerGamma_tendsto hb).div_const (Real.Gamma b) + convert hh using 1 + rw [div_self (Real.Gamma_pos_of_pos hb).ne'] + +lemma power_mul {b x : ℝ} (hb : 0 < b) (hx : 0 ≤ x) : + x^(b-1)*x = x^b := by + rcases eq_or_lt_of_le hx with h | h + · subst x; simp [Real.zero_rpow hb.ne'] + · rw [← Real.rpow_add_one h.ne', sub_add_cancel] + +lemma kernel_lower {b s x : ℝ} (hb : 0 < b) (hx : 0 ≤ x) : + Real.exp (-s)*((1+s)*x^(b-1)-x^b) ≤ Real.exp (-x)*x^(b-1) := by + have hh := Real.add_one_le_exp (s-x) + have he : Real.exp (-s)*Real.exp (s-x) = Real.exp (-x) := by + rw [← Real.exp_add]; congr 1; ring + have hi := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hh (Real.exp_pos (-s)).le) (Real.rpow_nonneg hx (b-1)) + rw [he] at hi + calc + _ = Real.exp (-s)*(s-x+1)*x^(b-1) := by rw [← power_mul hb hx]; ring + _ ≤ _ := hi + +lemma lowerGamma_lower {b s : ℝ} (hb : 0 < b) (hs : 0 ≤ s) : + Real.exp (-s)*((1+s)*s^b/b-s^(b+1)/(b+1)) ≤ lowerGamma b s := by + have hi₁ : IntervalIntegrable (fun x : ℝ => x^(b-1)) volume 0 s := + intervalIntegral.intervalIntegrable_rpow' (by linarith) + have hi₂ : IntervalIntegrable (fun x : ℝ => x^b) volume 0 s := + intervalIntegral.intervalIntegrable_rpow' (by linarith) + have hh := intervalIntegral.integral_mono_on hs + (((hi₁.const_mul (1+s)).sub hi₂).const_mul (Real.exp (-s))) + (integrable_kernel hb hs) (fun x hx => kernel_lower hb hx.1 (s:=s)) + rw [intervalIntegral.integral_const_mul, + intervalIntegral.integral_sub (hi₁.const_mul _) hi₂, + intervalIntegral.integral_const_mul, power_integral hb hs] at hh + have hi₂eq : (∫ x in (0:ℝ)..s, x^b) = s^(b+1)/(b+1) := by + simpa only [add_sub_cancel_right] using power_integral (by linarith : 0 < b+1) hs + rw [hi₂eq] at hh + simpa only [lowerGamma, mul_div_assoc] using hh + +lemma cdf_pdf_inequality {b s : ℝ} (hb : 0 < b) (hs : 0 < s) : + s^2*pdf b s/(b+1) ≤ b*cdf b s-s*pdf b s := by + have hl := lowerGamma_lower hb hs.le + have hg : 0 < Real.Gamma b := Real.Gamma_pos_of_pos hb + have hbp : 0 < b+1 := by linarith + rw [Real.rpow_add_one hs.ne' b] at hl + have heq : s^b = s^(b-1)*s := (power_mul hb hs.le).symm + rw [heq] at hl + unfold cdf pdf + apply (div_le_div_iff_of_pos_right hg).1 + have hh := mul_le_mul_of_nonneg_left hl hb.le + field_simp [hb.ne', hbp.ne'] at hh ⊢ + nlinarith + +lemma contDiffAt_pdf (n : WithTop ℕ∞) (b : ℝ) {s : ℝ} (hs : 0 < s) : + ContDiffAt ℝ n (pdf b) s := by + have he : ContDiffAt ℝ n (fun x : ℝ => Real.exp (-x)) s := + (contDiffAt_id.neg).exp + have hp : ContDiffAt ℝ n (fun x : ℝ => x^(b-1)) s := + contDiffAt_id.rpow contDiffAt_const hs.ne' + exact (he.mul hp).div_const _ + +lemma contDiffOn_cdf {b : ℝ} (hb : 0 < b) (n : ℕ) : + ContDiffOn ℝ (n+1) (cdf b) (Ioi 0) := by + rw [contDiffOn_succ_iff_deriv_of_isOpen isOpen_Ioi] + refine ⟨fun s hs => (hasDerivAt_cdf hb hs).differentiableAt.differentiableWithinAt, + ?_, ?_⟩ + · intro hn; simp at hn + · have hh : ContDiffOn ℝ n (pdf b) (Ioi 0) := + fun s hs => (contDiffAt_pdf n b hs).contDiffWithinAt + exact hh.congr (fun s hs => deriv_cdf hb hs) + +lemma contDiffAt_cdf {b : ℝ} (hb : 0 < b) (n : ℕ) {s : ℝ} (hs : 0 < s) : + ContDiffAt ℝ n (cdf b) s := by + have hh := (contDiffOn_cdf hb n).contDiffAt (isOpen_Ioi.mem_nhds hs) + exact hh.of_le (by exact_mod_cast Nat.le_succ n) + +def scale (l b t : ℝ) := (Real.exp (l*t)-1)/(2*(b+1)) + +def value (l b t q : ℝ) := Real.exp (l*b/2*t)*cdf b (q/scale l b t) + +def valueQ (l b t q : ℝ) := Real.exp (l*b/2*t)*pdf b (q/scale l b t)/scale l b t + +def valueQQ (l b t q : ℝ) := Real.exp (l*b/2*t)*pdf b (q/scale l b t)* + ((b-1)/(q/scale l b t)-1)/(scale l b t)^2 + +def valueT (l b t q : ℝ) := l*b/2*value l b t q - + Real.exp (l*b/2*t)*pdf b (q/scale l b t)*(q/scale l b t)* + (l+l/(2*(b+1)*scale l b t)) + +lemma scale_pos {l b t : ℝ} (hl : 0 < l) (hb : 0 < b) (ht : 0 < t) : + 0 < scale l b t := by + apply div_pos + · exact sub_pos.2 (Real.one_lt_exp_iff.2 (mul_pos hl ht)) + · positivity + +lemma hasDerivAt_scale (l b t : ℝ) : + HasDerivAt (scale l b) (l*Real.exp (l*t)/(2*(b+1))) t := by + apply (((((hasDerivAt_id t).const_mul l).exp).sub_const 1).div_const (2*(b+1))).congr_deriv + simp only [id_eq] + ring + +lemma hasDerivAt_value_q {l b t q : ℝ} (hl : 0 < l) (hb : 0 < b) + (ht : 0 < t) (hq : 0 < q) : HasDerivAt (value l b t) (valueQ l b t q) q := by + have hs := scale_pos hl hb ht + have hh := ((hasDerivAt_cdf hb (div_pos hq hs)).comp q + ((hasDerivAt_id q).div_const (scale l b t))).const_mul (Real.exp (l*b/2*t)) + apply hh.congr_deriv + dsimp only [valueQ] + ring + +lemma hasDerivAt_valueQ_q {l b t q : ℝ} (hl : 0 < l) (hb : 0 < b) + (ht : 0 < t) (hq : 0 < q) : HasDerivAt (valueQ l b t) (valueQQ l b t q) q := by + have hs := scale_pos hl hb ht + have hh := (((hasDerivAt_pdf hb (div_pos hq hs)).comp q + ((hasDerivAt_id q).div_const (scale l b t))).const_mul (Real.exp (l*b/2*t))).div_const (scale l b t) + apply hh.congr_deriv + dsimp only [valueQQ] + ring + +lemma hasDerivAt_value_t {l b t q : ℝ} (hl : 0 < l) (hb : 0 < b) + (ht : 0 < t) (hq : 0 < q) : + HasDerivAt (fun s => value l b s q) (valueT l b t q) t := by + have hs := scale_pos hl hb ht + have hbp : b+1 ≠ 0 := by positivity + have hh := ((((hasDerivAt_id t).const_mul (l*b/2)).exp).mul + ((hasDerivAt_cdf hb (div_pos hq hs)).comp t ((hasDerivAt_const t q).div (hasDerivAt_scale l b t) hs.ne'))) + apply hh.congr_deriv + simp only [id_eq, Function.comp_def, Pi.div_apply] + dsimp only [valueT, value] + have he : Real.exp (l*t) = 2*(b+1)*scale l b t+1 := by unfold scale; field_simp; ring + rw [he] + field_simp + ring + +theorem supersolution {l b t q : ℝ} (hl : 0 < l) (hb : 0 < b) + (ht : 0 < t) (hq : 0 < q) (hq1 : q ≤ 1) : + l*q*(1-q)*valueQQ l b t q + + l*((1-b)-(3/2-b)*q)*valueQ l b t q ≤ valueT l b t q := by + let α := scale l b t + let s := q/α + let W := pdf b s + let F := cdf b s + have hα : 0 < α := scale_pos hl hb ht + have hs : 0 < s := div_pos hq hα + have hW : 0 ≤ W := (pdf_pos hb hs).le + have hbp : 0 < b+1 := by linarith + have hi : s^2*W/(b+1) ≤ b*F-s*W := cdf_pdf_inequality hb hs + have hαs : α*s = q := by dsimp [s]; field_simp + have hA : 0 ≤ 1-1/(2*(b+1)) := by + rw [sub_nonneg, div_le_one (by positivity)] + linarith + have hrest : 0 ≤ l*(1-1/(2*(b+1)))*(1-q)*s*W/α := by + exact div_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (mul_nonneg hl.le hA) (sub_nonneg.2 hq1)) hs.le) hW) hα.le + have hmain : 0 ≤ l/2*(b*F-s*W-s^2*W/(b+1)) := mul_nonneg (by positivity) (sub_nonneg.2 hi) + have he : valueT l b t q - (l*q*(1-q)*valueQQ l b t q + + l*((1-b)-(3/2-b)*q)*valueQ l b t q) = + Real.exp (l*b/2*t) * + (l/2*(b*F-s*W-s^2*W/(b+1)) + l*(1-1/(2*(b+1)))*(1-q)*s*W/α) := by + dsimp only [valueT, value, valueQQ, valueQ] + change l*b/2*(Real.exp (l*b/2*t)*F) - Real.exp (l*b/2*t)*W*s* + (l+l/(2*(b+1)*α)) - (l*q*(1-q)*(Real.exp (l*b/2*t)*W*((b-1)/s-1)/α^2) + + l*((1-b)-(3/2-b)*q)*(Real.exp (l*b/2*t)*W/α)) = _ + dsimp only [s] + field_simp + ring + have hh : 0 ≤ valueT l b t q - (l*q*(1-q)*valueQQ l b t q + + l*((1-b)-(3/2-b)*q)*valueQ l b t q) := by + rw [he] + exact mul_nonneg (Real.exp_pos _).le (add_nonneg hmain hrest) + exact sub_nonneg.1 hh + +lemma value_nonneg {l b t q : ℝ} (hl : 0 < l) (hb : 0 < b) + (ht : 0 < t) (hq : 0 ≤ q) : 0 ≤ value l b t q := + mul_nonneg (Real.exp_pos _).le (cdf_nonneg hb (div_nonneg hq (scale_pos hl hb ht).le)) + +lemma contDiffAt_value {l b : ℝ} (hl : 0 < l) (hb : 0 < b) (n : ℕ) + {v : ℝ × ℝ} (ht : 0 < v.1) (hq : 0 < v.2) : + ContDiffAt ℝ n (fun v : ℝ × ℝ => value l b v.1 v.2) v := by + have he : ContDiffAt ℝ n (fun v : ℝ × ℝ => Real.exp (l*b/2*v.1)) v := by fun_prop + have ha : ContDiffAt ℝ n (fun v : ℝ × ℝ => scale l b v.1) v := by + unfold scale; fun_prop + have hs := scale_pos hl hb ht + have hqf : ContDiffAt ℝ n (fun v : ℝ × ℝ => v.2/scale l b v.1) v := + contDiffAt_snd.div ha hs.ne' + have hh := (contDiffAt_cdf hb n (div_pos hq hs)).comp v hqf + dsimp only [Function.comp_def] at hh + exact he.mul hh + +lemma continuousAt_value {l b : ℝ} (hl : 0 < l) (hb : 0 < b) + {v : ℝ × ℝ} (ht : 0 < v.1) (hq : 0 < v.2) : + ContinuousAt (fun v : ℝ × ℝ => value l b v.1 v.2) v := + (contDiffAt_value hl hb 0 ht hq).continuousAt + +lemma scale_tendsto {l b : ℝ} (hl : 0 < l) (hb : 0 < b) : + Tendsto (scale l b) (𝓝[>] (0:ℝ)) (𝓝[>] (0:ℝ)) := by + apply tendsto_nhdsWithin_iff.2 + constructor + · have hh : Continuous (scale l b) := by unfold scale; fun_prop + simpa [scale] using (hh.continuousAt (x:=0)).tendsto.mono_left nhdsWithin_le_nhds + · filter_upwards [self_mem_nhdsWithin] with t ht + exact scale_pos hl hb ht + +lemma value_tendsto_zero_time {l b q : ℝ} (hl : 0 < l) (hb : 0 < b) (hq : 0 < q) : + Tendsto (fun t => value l b t q) (𝓝[>] (0:ℝ)) (𝓝 1) := by + have hs : Tendsto (fun t => q/scale l b t) (𝓝[>] (0:ℝ)) atTop := by + simpa only [div_eq_mul_inv, Function.comp_def] using + (tendsto_inv_nhdsGT_zero.comp (scale_tendsto hl hb)).const_mul_atTop hq + have he : Tendsto (fun t : ℝ => Real.exp (l*b/2*t)) (𝓝[>] (0:ℝ)) (𝓝 1) := by + have hh : Continuous (fun t : ℝ => Real.exp (l*b/2*t)) := by fun_prop + simpa using (hh.continuousAt (x:=0)).tendsto.mono_left nhdsWithin_le_nhds + simpa only [value, one_mul, Function.comp_def] using he.mul ((cdf_tendsto hb).comp hs) + +end SLEExactGauge.AngularBarrier + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/SlabMoments.lean b/lean/OAI/Probability/SLELocalization/SlabMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f56fa9f81ec891d7e9d935f9fc10848814ebd1a --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/SlabMoments.lean @@ -0,0 +1,1013 @@ +import Mathlib +import OAI.Probability.SLELocalization.IntegratedMeshSimple +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Mesh estimates. -/ + +section +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology ENNReal +namespace SLEExactGauge.Mesh + +lemma asynchronous_bracket_bound_active {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) (hU : Continuous driver) + {A : Set ℂ} (hA : MeasurableSet A) {a b : ℂ → ℝ} {D : ℂ → ℝ → ℝ} + (ha : Measurable a) (hb : Measurable b) + (hB : Measurable (fun q : ℝ × ℂ => slab (D q.2) (a q.2) (b q.2) q.1)) + (L : ℂ → ℂ → ℝ≥0∞) (hL : Measurable (Function.uncurry L)) + (hLeq : ∀ z ∈ A, ∀ w ∈ A, L z w = laterGreen g a b z w) + {K R C : ℝ} (hK : 0 ≤ K) (hR : 0 < R) + (hstart : ∀ z ∈ A, 0 ≤ a z) (hab : ∀ z ∈ A, a z ≤ b z) + (hlive : ∀ z ∈ A, z ∈ localizationDomain γ (b z)) + (happroach : ∀ z ∈ A, a z < b z → dist z (γ (a z)) ≤ R) + (hcoeff : ∀ z ∈ A, ∀ t ∈ Icc (a z) (b z), + |slab (D z) (a z) (b z) t| ≤ K*poissonFactor driver g t z) + (hlayer : ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain γ t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain γ t ∧ infDist w (localizationDomain γ t)ᶜ ≤ R}, + ENNReal.ofReal (halfPlaneGreen (g t z) (g t w))) ≤ ENNReal.ofReal (C*R^2)) : + (∫⁻ t, ENNReal.ofReal (|∫ z in A, slab (D z) (a z) (b z) t|^2)) ≤ + 2*ENNReal.ofReal (K^2)*ENNReal.ofReal (C*R^2)*volume A := by + let A' := A ∩ {z | a z < b z} + have hA' : MeasurableSet A' := hA.inter (measurableSet_lt ha hb) + have hs : A' ⊆ A := inter_subset_left + have he (t : ℝ) : (∫ z in A, slab (D z) (a z) (b z) t) = + ∫ z in A', slab (D z) (a z) (b z) t := by + apply setIntegral_eq_of_subset_of_forall_sdiff_eq_zero hA hs + intro z hz + have hab' : a z = b z := le_antisymm (hab z hz.1) (not_lt.1 (fun hh => hz.2 ⟨hz.1,hh⟩)) + simp only [slab,hab',sub_self] + simp only [he] + apply (asynchronous_bracket_bound_with_kernel (B := fun t z => slab (D z) (a z) (b z) t) h hU hA' hB L hL + (fun z hz w hw => hLeq z hz.1 w hw.1) hK hR + (fun z hz => hstart z hz.1) (fun z hz => hab z hz.1) + (fun z hz => hlive z hz.1) (fun z hz => happroach z hz.1 hz.2) + (fun z hz t ht => slab_eq_zero_of_not_mem (hab z hz.1) ht) + (fun z hz t ht => hcoeff z hz.1 t ht) hlayer).trans + have hv : volume A' ≤ volume A := measure_mono hs + exact mul_le_mul_right hv _ + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter Metric MeasureTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized Mesh +local instance slabMomentsBracketRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance slabMomentsBracketRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance slabMomentsBracketComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance slabMomentsBracketComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +lemma measurable_halfPlaneGreen : Measurable (fun q : ℂ × ℂ => halfPlaneGreen q.1 q.2) := by + unfold halfPlaneGreen + fun_prop + +lemma observed_bracket {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (hA : MeasurableSet A) + (κ : ℝ) (hκ : 0 < κ ∧ κ ≤ 4) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (hhalf : ∀ z ∈ A, z ∈ halfPlane) (hu : ∀ z ∈ A, 0 < u z) + {ρ : ℝ} (hr : ∀ z ∈ A, (2*z.im)*Real.exp (-u z) = ρ) + (V : C(I,ℂ)) (hV : ∀ q : I, V q = γ ω ((C.horizon:ℝ)*q)) + (e r : ℝ) (he : 0 < e) (her : e ≤ r) (hes : ∀ z ∈ A, e < z.im) + (J : ℝ) (hlayer : ∀ t : ℝ, 0 ≤ t → ∀ z ∈ localizationDomain (γ ω) t, + (∫⁻ w in {w : ℂ | w ∈ localizationDomain (γ ω) t ∧ infDist w (localizationDomain (γ ω) t)ᶜ ≤ r}, + ENNReal.ofReal (halfPlaneGreen (g ω t z) (g ω t w))) ≤ ENNReal.ofReal (J*r^2)) : + let U := BrownianDriver.path B (Real.sqrt κ) C.horizon ω + let a := fun z => observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle r ((U,V),z) + let b := fun z => observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle e ((U,V),z) + let D := fun z t => iteratedDeriv 1 + (field C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (B t.toNNReal ω) + (∫⁻ t, ENNReal.ofReal (|∫ z in A, slab (D z) (a z) (b z) t|^2)) ≤ + 2*ENNReal.ofReal ((Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8)))^2)*ENNReal.ofReal (J*r^2)*volume A := by + intro U a b D + have ham : Measurable a := by + have hh := (measurable_observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle r).comp + (measurable_const.prodMk measurable_id : Measurable (fun z : ℂ => ((U,V),z))) + exact hh + have hbm : Measurable b := by + have hh := (measurable_observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle e).comp + (measurable_const.prodMk measurable_id : Measurable (fun z : ℂ => ((U,V),z))) + exact hh + have hDc : Continuous (fun q : ℝ × ℂ => D q.2 q.1) := by + have hp : Continuous (fun q : ℝ × ℂ => (((U,q.2),q.1),B q.1.toNNReal ω)) := + ((continuous_const.prodMk continuous_snd).prodMk continuous_fst).prodMk + ((hc.comp continuous_real_toNNReal).comp continuous_fst) + have hh := (continuous_mark_first C.height_pos C.horizon.coe_nonneg (1-κ/8) (8/κ-1) (Real.sqrt κ)).comp hp + exact hh + have hpos (z : ℂ) (hz : z ∈ A) (t : ℝ) (ht : t ∈ Icc 0 ((C.at z hz).stopTime κ B ω)) : + g ω t z = position C.height_pos C.horizon.coe_nonneg U z t := by + let Cz := C.at z hz + have h0 := Cz.initial_deficit_brownian κ B ω (hhalf z hz) (hu z hz) hc hb0 + have hs := source_until_stop Cz.height_pos Cz.horizon_pos hm _ z _ Cz.angle (Cz.path_eq κ B ω hc) h0 + exact hs.2 ht + have hat (z : ℂ) (hz : z ∈ A) : a z = (C.at z hz).physicalTime κ B γ r ω := + observedTime_eq C κ B γ g f ω hm hc hb0 z hz (hhalf z hz) (hu z hz) (hr z hz) V hV r + have hbt (z : ℂ) (hz : z ∈ A) : b z = (C.at z hz).physicalTime κ B γ e ω := + observedTime_eq C κ B γ g f ω hm hc hb0 z hz (hhalf z hz) (hu z hz) (hr z hz) V hV e + have hab (z : ℂ) : a z ≤ b z := observedTime_antitone C.height_pos C.horizon.coe_nonneg ρ C.angle ((U,V),z) her + have ha0 (z : ℂ) : 0 ≤ a z := (observedTime_bounds C.height_pos C.horizon.coe_nonneg ρ C.angle r ((U,V),z)).1 + have hbz (z : ℂ) (hz : z ∈ A) : b z ≤ (C.at z hz).stopTime κ B ω := by + rw [hbt z hz]; exact ((C.at z hz).physicalTime_bounds κ B γ e ω).2 + let L : ℂ → ℂ → ℝ≥0∞ := fun z w => + if a w ≤ a z ∧ a z ≤ b w then ENNReal.ofReal (halfPlaneGreen + (position C.height_pos C.horizon.coe_nonneg U z (a z)) + (position C.height_pos C.horizon.coe_nonneg U w (a z))) else 0 + have hL : Measurable (Function.uncurry L) := by + have h1 : Measurable (fun q : ℂ × ℂ => ((U,q.1),a q.1)) := + (measurable_const.prodMk measurable_fst).prodMk (ham.comp measurable_fst) + have h2 : Measurable (fun q : ℂ × ℂ => ((U,q.2),a q.1)) := + (measurable_const.prodMk measurable_snd).prodMk (ham.comp measurable_fst) + have hp1 := (continuous_mark_position C.height_pos C.horizon.coe_nonneg).measurable.comp h1 + have hp2 := (continuous_mark_position C.height_pos C.horizon.coe_nonneg).measurable.comp h2 + have hh := (measurable_halfPlaneGreen.comp (hp1.prodMk hp2)).ennreal_ofReal + exact hh.ite ((measurableSet_le (ham.comp measurable_snd) (ham.comp measurable_fst)).inter + (measurableSet_le (ham.comp measurable_fst) (hbm.comp measurable_snd))) measurable_const + have hLe (z : ℂ) (hz : z ∈ A) (w : ℂ) (hw : w ∈ A) : L z w = laterGreen (g ω) a b z w := by + dsimp only [L,laterGreen] + split_ifs with hh + · rw [← hpos z hz (a z) ⟨ha0 z,(hab z).trans (hbz z hz)⟩, + ← hpos w hw (a z) ⟨ha0 z,hh.2.trans (hbz w hw)⟩] + rfl + · rfl + have haexp : 0 ≤ 8/κ-1 := by + have hh : 1 ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by linarith [hκ.2]) + linarith + have hKn : 0 ≤ Real.sqrt κ*(8/κ-1)*(e/4)^(-(1-κ/8)) := by positivity + apply asynchronous_bracket_bound_active hm + (continuous_const.mul (hc.comp continuous_real_toNNReal)) hA ham hbm + (measurable_slab hDc.measurable ham hbm) L hL hLe hKn (he.trans_le her) + (fun z _ => ha0 z) (fun z _ => hab z) + · intro z hz + exact survivingDomain_mono (hbz z hz) ((C.at z hz).source_live κ B ω hm (hhalf z hz) (hu z hz) hc hb0) + · intro z hz hh + exact observedTime_approach C.height_pos C.horizon_pos ρ C.angle e r U V (γ ω) hV z hh + · intro z hz t ht + have hti : t ∈ Icc 0 ((C.at z hz).physicalTime κ B γ e ω) := by + rw [← hbt z hz]; exact ⟨(ha0 z).trans ht.1,ht.2⟩ + have hb := (C.at z hz).first_le_poisson κ hκ B γ g f ω hm hc hb0 (hhalf z hz) (hu z hz) he (hes z hz) hti + have hl := survivingDomain_mono (hti.2.trans ((C.at z hz).physicalTime_bounds κ B γ e ω).2) + ((C.at z hz).source_live κ B ω hm (hhalf z hz) (hu z hz) hc hb0) + have hn : 0 ≤ poissonFactor (fun t => Real.sqrt κ*B t.toNNReal ω) (g ω) t z := + div_nonneg (hm.im_pos hti.1 hl).le (sq_nonneg _) + exact slab_abs_le (hab z) (mul_nonneg hKn hn) hb + · exact hlayer + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable + +lemma gaussian_exp_compensated (v : ℝ≥0) (x a θ : ℝ) : + (∫⁻ y : ℝ, ENNReal.ofReal (Real.exp (x+θ*a*y-θ^2*a^2*(v:ℝ)/2)) + ∂gaussianReal 0 v) = ENNReal.ofReal (Real.exp x) := by + have he (y : ℝ) : Real.exp (x+θ*a*y-θ^2*a^2*(v:ℝ)/2) = + Real.exp (x-θ^2*a^2*(v:ℝ)/2)*Real.exp ((θ*a)*y) := by + rw [← Real.exp_add] + congr 1 + ring + simp_rw [he,ENNReal.ofReal_mul (Real.exp_pos _).le] + rw [lintegral_const_mul _ (by fun_prop),← ofReal_integral_eq_lintegral_ofReal + (integrable_exp_mul_gaussianReal (θ*a)) (Filter.Eventually.of_forall (fun y => (Real.exp_pos _).le))] + have hm := congrFun (mgf_fun_id_gaussianReal (μ := 0) (v := v)) (θ*a) + change (∫ y : ℝ, Real.exp ((θ*a)*y) ∂gaussianReal 0 v) = _ at hm + rw [hm,← ENNReal.ofReal_mul (Real.exp_pos _).le,← Real.exp_add] + congr 2 + ring + +lemma past_exp_step {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) {s t : ℝ≥0} (hst : s ≤ t) + (X A : Ω → ℝ) (hX : Measurable[pastSigma B s] X) + (hA : Measurable[pastSigma B s] A) (hXa : AEMeasurable X P) + (hAa : AEMeasurable A P) (θ : ℝ) : + (∫⁻ sample, ENNReal.ofReal (Real.exp (X sample+θ*A sample*(B t sample-B s sample)- + θ^2*(A sample)^2*((t-s:ℝ≥0):ℝ)/2)) ∂P) = + ∫⁻ sample, ENNReal.ofReal (Real.exp (X sample)) ∂P := by + let V : Ω → ℝ × ℝ := fun sample => (X sample,A sample) + have hVm : Measurable[pastSigma B s] V := hX.prodMk hA + have hVa : AEMeasurable V P := hXa.prodMk hAa + have hi := brownian_indep_of_past_measurable hB s (t-s) hVm + rw [add_tsub_cancel_of_le hst] at hi + have hl : HasLaw V (P.map V) P := ⟨hVa,rfl⟩ + have hprod := IndepFun.hasLaw_prod hl (increment_hasLaw hB hst) hi + let F : (ℝ × ℝ) × ℝ → ℝ≥0∞ := fun q => + ENNReal.ofReal (Real.exp (q.1.1+θ*q.1.2*q.2-θ^2*q.1.2^2*((t-s:ℝ≥0):ℝ)/2)) + have hFm : Measurable F := by fun_prop + have he := hprod.lintegral_comp hFm.aemeasurable + change (∫⁻ sample, F (V sample,B t sample-B s sample) ∂P) = _ at he + rw [he,lintegral_prod _ hFm.aemeasurable] + simp only [F,gaussian_exp_compensated] + have hmap := hl.lintegral_comp + (show AEMeasurable (fun q : ℝ × ℝ => ENNReal.ofReal (Real.exp q.1)) (P.map V) by fun_prop) + exact hmap.symm + +def exponentialLogSum {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) + (t : ℕ → ℝ≥0) (A : ℕ → Ω → ℝ) (θ : ℝ) (N : ℕ) (sample : Ω) : ℝ := + ∑ i ∈ Finset.range N, (θ*A i sample*(B (t (i+1)) sample-B (t i) sample)- + θ^2*(A i sample)^2*((t (i+1)-t i:ℝ≥0):ℝ)/2) + +lemma exponentialLogSum_past {Ω : Type*} [MeasurableSpace Ω] + (B : ℝ≥0 → Ω → ℝ) (t : ℕ → ℝ≥0) (ht : Monotone t) + (A : ℕ → Ω → ℝ) (hA : ∀ i, Measurable[pastSigma B (t i)] (A i)) + (θ : ℝ) (N : ℕ) : Measurable[pastSigma B (t N)] (exponentialLogSum B t A θ N) := by + apply Finset.measurable_fun_sum + intro i hi + have hAi := (hA i).mono (pastSigma_mono B (ht (Finset.mem_range.1 hi).le)) le_rfl + have hBi := past_measurable_eval B (ht (Finset.mem_range.1 hi).le) + have hBin := past_measurable_eval B (ht (Nat.succ_le_of_lt (Finset.mem_range.1 hi))) + exact (((hAi.const_mul θ).mul (hBin.sub hBi)).sub + (((hAi.pow_const 2).const_mul (θ^2)).mul_const _ |>.div_const 2)) + +lemma exponentialLogSum_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (t : ℕ → ℝ≥0) (A : ℕ → Ω → ℝ) (hA : ∀ i, AEMeasurable (A i) P) + (θ : ℝ) (N : ℕ) : AEMeasurable (exponentialLogSum B t A θ N) P := by + apply Finset.aemeasurable_fun_sum + intro i hi + have hBi := hB.toIsPreBrownianReal.aemeasurable (t i) + have hBin := hB.toIsPreBrownianReal.aemeasurable (t (i+1)) + fun_prop + +lemma exponentialLogSum_identity {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (t : ℕ → ℝ≥0) (ht : Monotone t) + (A : ℕ → Ω → ℝ) (hA : ∀ i, Measurable[pastSigma B (t i)] (A i)) + (hAa : ∀ i, AEMeasurable (A i) P) (θ : ℝ) (N : ℕ) : + (∫⁻ sample, ENNReal.ofReal (Real.exp (exponentialLogSum B t A θ N sample)) ∂P) = 1 := by + induction N with + | zero => simp [exponentialLogSum] + | succ N hN => + simp only [exponentialLogSum,Finset.sum_range_succ] + change (∫⁻ sample, ENNReal.ofReal (Real.exp (exponentialLogSum B t A θ N sample+ + (θ*A N sample*(B (t (N+1)) sample-B (t N) sample)- + θ^2*(A N sample)^2*((t (N+1)-t N:ℝ≥0):ℝ)/2))) ∂P) = 1 + simp_rw [← add_sub_assoc] + rw [past_exp_step hB (ht (Nat.le_succ N)) _ _ (exponentialLogSum_past B t ht A hA θ N) + (hA N) (exponentialLogSum_aemeasurable hB t A hAa θ N) (hAa N),hN] + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable +open PredictableLimit + +def dyadicVariance {Ω : Type*} (T : ℝ≥0) (A : ℕ → ℕ → Ω → ℝ) (n : ℕ) (sample : Ω) : ℝ := + ∑ i ∈ Finset.range (2^n), (A n i sample)^2 * + ((dyadicTime T n (i+1)-dyadicTime T n i:ℝ≥0):ℝ) + +lemma exponentialLogSum_dyadic {Ω : Type*} (B : ℝ≥0 → Ω → ℝ) + (T : ℝ≥0) (A : ℕ → ℕ → Ω → ℝ) (θ : ℝ) (n : ℕ) (sample : Ω) : + exponentialLogSum B (dyadicTime T n) (A n) θ (2^n) sample = + θ*dyadicDriverSum B T A n sample - θ^2*dyadicVariance T A n sample/2 := by + simp only [exponentialLogSum,dyadicDriverSum,dyadicVariance,Finset.mul_sum, + Finset.sum_div,← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + ring + +theorem limit_exponential_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) (A : ℕ → ℕ → Ω → ℝ) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hAa : ∀ n i, AEMeasurable (A n i) P) + (Y Q : Ω → ℝ) + (hY : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T A n sample) atTop (𝓝 (Y sample))) + (hQ : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicVariance T A n sample) atTop (𝓝 (Q sample))) + (K : ℝ) (hK : ∀ᵐ sample ∂P, Q sample ≤ K) (θ : ℝ) : + (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample)) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*K/2)) := by + let E : ℕ → Ω → ℝ≥0∞ := fun n sample => ENNReal.ofReal + (Real.exp (exponentialLogSum B (dyadicTime T n) (A n) θ (2^n) sample)) + have hEm (n : ℕ) : AEMeasurable (E n) P := + ((exponentialLogSum_aemeasurable hB _ _ (hAa n) θ (2^n)).exp).ennreal_ofReal + have hEi (n : ℕ) : (∫⁻ sample, E n sample ∂P) = 1 := + exponentialLogSum_identity hB _ (dyadicTime_mono T n) _ (hA n) (hAa n) θ (2^n) + have hElim : ∀ᵐ sample ∂P, Tendsto (fun n => E n sample) atTop + (𝓝 (ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)))) := by + filter_upwards [hY,hQ] with sample hy hq + have hh := ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (Real.continuous_exp.continuousAt.tendsto.comp + ((hy.const_mul θ).sub ((hq.const_mul (θ^2)).div_const 2))) + simpa only [E,exponentialLogSum_dyadic,Function.comp_def] using hh + have hFatou : (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P) ≤ 1 := by + calc + _ = ∫⁻ sample, liminf (fun n => E n sample) atTop ∂P := by + apply lintegral_congr_ae + filter_upwards [hElim] with sample hs + exact hs.liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ sample, E n sample ∂P) atTop := lintegral_liminf_le' hEm + _ = 1 := by simp only [hEi,liminf_const] + have hlimMeas : AEMeasurable (fun sample => ENNReal.ofReal + (Real.exp (θ*Y sample-θ^2*Q sample/2))) P := + aemeasurable_of_tendsto_metrizable_ae atTop hEm hElim + calc + _ ≤ ∫⁻ sample, ENNReal.ofReal (Real.exp (θ^2*K/2)) * + ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P := by + apply lintegral_mono_ae + filter_upwards [hK] with sample hk + rw [← ENNReal.ofReal_mul (Real.exp_pos _).le,← Real.exp_add] + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.2 + nlinarith [mul_le_mul_of_nonneg_left hk (sq_nonneg θ)] + _ = ENNReal.ofReal (Real.exp (θ^2*K/2)) * + (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P) := + lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ _ := by simpa only [mul_one] using mul_le_mul_right hFatou (ENNReal.ofReal (Real.exp (θ^2*K/2))) + +lemma tail_of_exponential_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} (Y : Ω → ℝ) (hY : AEMeasurable Y P) + {K : ℝ} (hK : 0 < K) + (hbound : ∀ θ : ℝ, (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample)) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*K/2))) {x : ℝ} (hx : 0 < x) : + P {sample | x < Y sample} ≤ ENNReal.ofReal (Real.exp (-x^2/(2*K))) := by + let θ := x/K + have hθ : 0 < θ := div_pos hx hK + have hYm : AEMeasurable (fun sample => ENNReal.ofReal (Real.exp (θ*Y sample))) P := + (hY.const_mul θ).exp.ennreal_ofReal + have he := meas_ge_le_lintegral_div hYm + (ENNReal.ofReal_ne_zero_iff.2 (Real.exp_pos (θ*x))) ENNReal.ofReal_ne_top + have he' : P {sample | x < Y sample} ≤ + (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample)) ∂P) / + ENNReal.ofReal (Real.exp (θ*x)) := by + apply (measure_mono _).trans he + intro sample hs + exact ENNReal.ofReal_le_ofReal (Real.exp_le_exp.2 + (mul_le_mul_of_nonneg_left hs.le hθ.le)) + refine he'.trans ((ENNReal.div_le_div_right (hbound θ) _).trans_eq ?_) + rw [← ENNReal.ofReal_div_of_pos (Real.exp_pos _),← Real.exp_sub] + congr 2 + dsimp [θ] + field_simp + ring + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Mesh +open TaylorMeshes BrownianPredictable BrownianIto + +lemma spatial_variance_tendsto {Z : Type*} [MeasurableSpace Z] + (ν : Measure Z) [IsFiniteMeasure ν] (T : ℝ≥0) + (C : ℝ → Z → ℝ) (hC : Measurable (Function.uncurry C)) + (a b : Z → ℝ) (ha : ∀ z, a z ∈ Icc 0 (T:ℝ)) (hb : ∀ z, b z ∈ Icc 0 (T:ℝ)) + (D : Z → ℝ → ℝ) (hD : ∀ z, ContinuousOn (D z) (Icc 0 (T:ℝ))) + (he : ∀ t z, C t z = slab (D z) (a z) (b z) t) + (K : ℝ) (hK : 0 ≤ K) (hbound : ∀ t ∈ Icc 0 (T:ℝ), ∀ z, |C t z| ≤ K) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (∫ z, C (mesh T n i) z ∂ν)^2 * ((T:ℝ)/(2:ℝ)^n)) atTop + (𝓝 (∫ t in (0:ℝ)..T, (∫ z, C t z ∂ν)^2)) := by + let F : ℕ → Z × Z → ℝ := fun n q => ∑ i ∈ Finset.range (2^n), + (C (mesh T n i) q.1*C (mesh T n i) q.2)*((T:ℝ)/(2:ℝ)^n) + let G : Z × Z → ℝ := fun q => ∫ t in (0:ℝ)..T, C t q.1*C t q.2 + have hsec (t : ℝ) : Measurable (C t) := hC.comp (measurable_const.prodMk measurable_id) + have hF (n : ℕ) : Measurable (F n) := by + apply Finset.measurable_fun_sum + intro i hi + exact (((hsec _).comp measurable_fst).mul ((hsec _).comp measurable_snd)).mul_const _ + have hFb (n : ℕ) (q : Z × Z) : ‖F n q‖ ≤ (T:ℝ)*K^2 := by + calc + _ ≤ ∑ i ∈ Finset.range (2^n), ‖(C (mesh T n i) q.1*C (mesh T n i) q.2)*((T:ℝ)/(2:ℝ)^n)‖ := norm_sum_le _ _ + _ ≤ ∑ _i ∈ Finset.range (2^n), K^2*((T:ℝ)/(2:ℝ)^n) := by + apply Finset.sum_le_sum + intro i hi + rw [Real.norm_eq_abs,abs_mul,abs_mul,abs_of_nonneg (by positivity : 0 ≤ (T:ℝ)/(2:ℝ)^n)] + rw [pow_two] + gcongr <;> exact hbound _ (mesh_mem _ T.coe_nonneg n i (Finset.mem_range.1 hi).le) _ + _ = _ := by simp; field_simp + have hlim (q : Z × Z) : Tendsto (fun n => F n q) atTop (𝓝 (G q)) := by + simp only [F,G,he] + exact slab_riemann_tendsto_integral T.coe_nonneg (ha q.1) (hb q.1) (ha q.2) (hb q.2) (hD q.1) (hD q.2) + have hl := tendsto_integral_of_dominated_convergence (μ := ν.prod ν) (fun _ : Z × Z => (T:ℝ)*K^2) + (fun n => (hF n).aestronglyMeasurable) (integrable_const _) (fun n => Filter.Eventually.of_forall (hFb n)) + (Filter.Eventually.of_forall hlim) + have hFi (n : ℕ) : Integrable (F n) (ν.prod ν) := + Integrable.of_bound (hF n).aestronglyMeasurable _ (Filter.Eventually.of_forall (hFb n)) + have hprod (t : ℝ) (ht : t ∈ Icc 0 (T:ℝ)) : Integrable (fun q : Z × Z => C t q.1*C t q.2) (ν.prod ν) := by + apply Integrable.of_bound (((hsec t).comp measurable_fst).mul ((hsec t).comp measurable_snd)).aestronglyMeasurable (K^2) + apply Filter.Eventually.of_forall + intro q + change |C t q.1*C t q.2| ≤ K^2 + simp only [abs_mul,pow_two] + exact mul_le_mul (hbound t ht q.1) (hbound t ht q.2) (abs_nonneg _) hK + have hFe (n : ℕ) : (∫ q, F n q ∂ν.prod ν) = ∑ i ∈ Finset.range (2^n), + (∫ z, C (mesh T n i) z ∂ν)^2 * ((T:ℝ)/(2:ℝ)^n) := by + rw [show F n = fun q => ∑ i ∈ Finset.range (2^n), (C (mesh T n i) q.1*C (mesh T n i) q.2)*((T:ℝ)/(2:ℝ)^n) from rfl, + integral_finsetSum] + · apply Finset.sum_congr rfl + intro i hi + rw [integral_mul_const,integral_prod_mul,pow_two] + · intro i hi + exact (hprod _ (mesh_mem _ T.coe_nonneg n i (Finset.mem_range.1 hi).le)).mul_const _ + let μ := volume.restrict (Ioc (0:ℝ) (T:ℝ)) + have hCt : Measurable (fun q : (Z × Z) × ℝ => C q.2 q.1.1*C q.2 q.1.2) := + ((hC.comp (measurable_snd.prodMk measurable_fst.fst)).mul + (hC.comp (measurable_snd.prodMk measurable_fst.snd))) + have hCti : Integrable (fun q : (Z × Z) × ℝ => C q.2 q.1.1*C q.2 q.1.2) ((ν.prod ν).prod μ) := by + apply Integrable.of_bound hCt.aestronglyMeasurable (K^2) + have hm : ∀ᵐ t ∂μ, t ∈ Ioc (0:ℝ) (T:ℝ) := ae_restrict_mem measurableSet_Ioc + filter_upwards [(Measure.ae_prod_iff_ae_ae (measurableSet_Ioc.preimage measurable_snd)).2 (Filter.Eventually.of_forall (fun q : Z × Z => hm))] with q hq + simp only [Real.norm_eq_abs,abs_mul,pow_two] + exact mul_le_mul (hbound q.2 ⟨hq.1.le,hq.2⟩ q.1.1) (hbound q.2 ⟨hq.1.le,hq.2⟩ q.1.2) (abs_nonneg _) hK + have hGe : (∫ q, G q ∂ν.prod ν) = ∫ t in (0:ℝ)..T, (∫ z, C t z ∂ν)^2 := by + simp only [G,intervalIntegral.integral_of_le T.coe_nonneg] + rw [integral_integral_swap hCti] + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun t => by + dsimp only + rw [integral_prod_mul,pow_two]) + simpa only [hFe,hGe] using hl + +lemma spatial_dyadicVariance_tendsto {Z Ω : Type*} [MeasurableSpace Z] + (ν : Measure Z) [IsFiniteMeasure ν] (T : ℝ≥0) + (A : ℕ → ℕ → Ω × Z → ℝ) (ω : Ω) + (C : ℝ → Z → ℝ) (hC : Measurable (Function.uncurry C)) + (a b : Z → ℝ) (ha : ∀ z, a z ∈ Icc 0 (T:ℝ)) (hb : ∀ z, b z ∈ Icc 0 (T:ℝ)) + (D : Z → ℝ → ℝ) (hD : ∀ z, ContinuousOn (D z) (Icc 0 (T:ℝ))) + (he : ∀ t z, C t z = slab (D z) (a z) (b z) t) + (hAe : ∀ n i, ∀ᵐ z ∂ν, A n i (ω,z) = C (mesh T n i) z) + (K : ℝ) (hK : 0 ≤ K) (hbound : ∀ t ∈ Icc 0 (T:ℝ), ∀ z, |C t z| ≤ K) : + Tendsto (fun n => dyadicVariance T (fun n i ω => ∫ z, A n i (ω,z) ∂ν) n ω) atTop + (𝓝 (∫ t in (0:ℝ)..T, (∫ z, C t z ∂ν)^2)) := by + have hl := spatial_variance_tendsto ν T C hC a b ha hb D hD he K hK hbound + convert hl using 1 + funext n + unfold dyadicVariance + apply Finset.sum_congr rfl + intro i hi + dsimp only + rw [integral_congr_ae (hAe n i)] + rw [NNReal.coe_sub (dyadicTime_mono T n (Nat.le_succ i)),dyadicTime_step] + +end SLEExactGauge.Mesh + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized Mesh +open BrownianPredictable BrownianIto TaylorMeshes PredictableLimit +local instance slabMomentsCoeffRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance slabMomentsCoeffRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance slabMomentsCoeffComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance slabMomentsCoeffComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def slabCoeff {Ω : Type*} {ε : ℝ} (hε : 0 < ε) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (T s : ℝ≥0) (ρ δ e r : ℝ) (q : Ω × ℂ) : ℝ := + coeff hε κ B T s ρ δ e q - coeff hε κ B T s ρ δ r q + +def pathFirst {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (κ : ℝ) + (U : C(I,ℝ)) (b : ℝ≥0 → ℝ) (z : ℂ) (t : ℝ) : ℝ := + iteratedDeriv 1 (field hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ) U z t) (b t.toNNReal) + +def pathSlab {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (κ ρ δ e r : ℝ) + (U : C(I,ℝ)) (V : C(I,ℂ)) (b : ℝ≥0 → ℝ) (t : ℝ) (z : ℂ) : ℝ := + slab (pathFirst hε hT κ U b z) + (observedTime hε hT ρ δ r ((U,V),z)) (observedTime hε hT ρ δ e ((U,V),z)) t + +lemma continuous_pathFirst {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (κ : ℝ) + (U : C(I,ℝ)) (b : ℝ≥0 → ℝ) (hb : Continuous b) : + Continuous (fun q : ℝ × ℂ => pathFirst hε hT κ U b q.2 q.1) := by + have hp : Continuous (fun q : ℝ × ℂ => (((U,q.2),q.1),b q.1.toNNReal)) := + ((continuous_const.prodMk continuous_snd).prodMk continuous_fst).prodMk + ((hb.comp continuous_real_toNNReal).comp continuous_fst) + have hh := (continuous_mark_first hε hT (1-κ/8) (8/κ-1) (Real.sqrt κ)).comp hp + exact hh + +lemma measurable_pathSlab {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (κ ρ δ e r : ℝ) + (U : C(I,ℝ)) (V : C(I,ℂ)) (b : ℝ≥0 → ℝ) (hb : Continuous b) : + Measurable (Function.uncurry (pathSlab hε hT κ ρ δ e r U V b)) := by + have hs (s : ℝ) := (measurable_observedTime hε hT ρ δ s).comp + (measurable_const.prodMk measurable_id : Measurable (fun z : ℂ => ((U,V),z))) + exact measurable_slab (continuous_pathFirst hε hT κ U b hb).measurable (hs r) (hs e) + +lemma pathSlab_uniform_bound {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (ρ δ e r : ℝ) (her : e ≤ r) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ (U : C(I,ℝ)) (V : C(I,ℂ)) (b : ℝ≥0 → ℝ) t z, + |pathSlab hε hT κ ρ δ e r U V b t z| ≤ K := by + have hp : 0 ≤ 1-κ/8 := by linarith [hκ.2] + have ha : 0 ≤ 8/κ-1 := by + have hh : 1 ≤ 8/κ := (le_div_iff₀ hκ.1).2 (by simpa using hκ.2.le) + linarith + let K := |Real.sqrt κ| *((2*ε/Real.exp ((2/ε^2)*T))^(-(1-κ/8))*(8/κ-1)/ε) + have hK : 0 ≤ K := by dsimp only [K]; positivity + refine ⟨K,hK,?_⟩ + intro U V b t z + exact slab_abs_le (observedTime_antitone hε hT ρ δ ((U,V),z) her) hK + (first_bound hε hT _ _ _ hp ha U z t (b t.toNNReal)) + +lemma slabCoeff_eq {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (κ : ℝ) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (z : ℂ) (hz : z ∈ A) (hhalf : z ∈ halfPlane) (hu : 0 < u z) + {ρ : ℝ} (hr : (2*z.im)*Real.exp (-u z) = ρ) + (V : C(I,ℂ)) (hV : ∀ q : I, V q = γ ω ((C.horizon:ℝ)*q)) (e r : ℝ) (s : ℝ≥0) : + slabCoeff C.height_pos κ B C.horizon s ρ C.angle e r (ω,z) = + pathSlab C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + (BrownianDriver.path B (Real.sqrt κ) C.horizon ω) V (fun t => B t ω) s z := by + unfold slabCoeff + rw [← coeff_common C κ B z hz hr e s ω,← coeff_common C κ B z hz hr r s ω, + (C.at z hz).physicalCoeff_eq κ B γ g f ω hm hc hb0 hhalf hu e 1 s, + (C.at z hz).physicalCoeff_eq κ B γ g f ω hm hc hb0 hhalf hu r 1 s] + dsimp only [pathSlab,slab,pathFirst] + rw [observedTime_eq C κ B γ g f ω hm hc hb0 z hz hhalf hu hr V hV r, + observedTime_eq C κ B γ g f ω hm hc hb0 z hz hhalf hu hr V hV e] + simp only [Real.toNNReal_coe] + rfl + +lemma slabCoeff_variance_tendsto {Ω : Type*} {A : Set ℂ} {u : ℂ → ℝ} + (C : FiniteTilt.CommonCutoff A u) (hA : MeasurableSet A) [IsFiniteMeasure (volume.restrict A)] + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) (ω : Ω) + (hm : IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (hc : Continuous (fun t => B t ω)) (hb0 : B 0 ω = 0) + (hhalf : ∀ z ∈ A, z ∈ halfPlane) (hu : ∀ z ∈ A, 0 < u z) + {ρ : ℝ} (hr : ∀ z ∈ A, (2*z.im)*Real.exp (-u z) = ρ) + (V : C(I,ℂ)) (hV : ∀ q : I, V q = γ ω ((C.horizon:ℝ)*q)) (e r : ℝ) (her : e ≤ r) : + Tendsto (fun n => dyadicVariance C.horizon + (fun n i ω => ∫ z in A, slabCoeff C.height_pos κ B C.horizon (dyadicTime C.horizon n i) ρ C.angle e r (ω,z)) n ω) + atTop (𝓝 (∫ t in (0:ℝ)..C.horizon, (∫ z in A, + pathSlab C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + (BrownianDriver.path B (Real.sqrt κ) C.horizon ω) V (fun t => B t ω) t z)^2)) := by + let U := BrownianDriver.path B (Real.sqrt κ) C.horizon ω + let a := fun z => observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle r ((U,V),z) + let b := fun z => observedTime C.height_pos C.horizon.coe_nonneg ρ C.angle e ((U,V),z) + let D := pathFirst C.height_pos C.horizon.coe_nonneg κ U (fun t => B t ω) + let S := pathSlab C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r U V (fun t => B t ω) + obtain ⟨K,hK,hbound⟩ := pathSlab_uniform_bound C.height_pos C.horizon.coe_nonneg κ hκ ρ C.angle e r her + apply spatial_dyadicVariance_tendsto (K := K) (volume.restrict A) C.horizon + (fun n i => slabCoeff C.height_pos κ B C.horizon (dyadicTime C.horizon n i) ρ C.angle e r) + ω S (measurable_pathSlab _ _ _ _ _ _ _ _ _ _ hc) a b + (fun z => observedTime_bounds _ _ _ _ _ _) (fun z => observedTime_bounds _ _ _ _ _ _) D + · intro z + have hh := (continuous_pathFirst C.height_pos C.horizon.coe_nonneg κ U (fun t => B t ω) hc).comp + (continuous_id.prodMk continuous_const : Continuous (fun t : ℝ => (t,z))) + exact hh.continuousOn + · intro t z; rfl + · intro n i + filter_upwards [ae_restrict_mem hA] with z hz + simpa only [coe_dyadicTime] using + slabCoeff_eq C κ B γ g f ω hm hc hb0 z hz (hhalf z hz) (hu z hz) (hr z hz) V hV e r (dyadicTime C.horizon n i) + · exact hK + · intro t ht z + exact hbound U V (fun t => B t ω) t z + +end SLEExactGauge.MeshSlab + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SpatialLimit +open L2Limit + +lemma uniformIntegrable_one_of_eLpNorm_two_bounded {Ω ι : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsFiniteMeasure P] {X : ι → Ω → ℝ} + (hXm : ∀ i, AEStronglyMeasurable (X i) P) (C : ℝ≥0) + (hC : ∀ i, eLpNorm (X i) 2 P ≤ C) : UniformIntegrable X 1 P := by + let D : ℝ≥0∞ := (C : ℝ≥0∞) * (P univ) ^ (1/2 : ℝ) + have hDt : D ≠ ∞ := by dsimp [D]; finiteness + refine ⟨?_, D.toNNReal, ?_⟩ + · apply unifIntegrable_iff.2 + intro ε hε + by_cases hεt : ε = ∞ + · subst ε + exact ⟨1, by norm_num, fun _ _ _ => le_top⟩ + have hεr : 0 < ε.toReal := ENNReal.toReal_pos hε.ne' hεt + let d : ℝ≥0 := ⟨ε.toReal / ((C : ℝ)+1), div_nonneg hεr.le (by positivity)⟩ + have hd : 0 < (d : ℝ) := div_pos hεr (by positivity) + refine ⟨ENNReal.ofReal ((d : ℝ)^2), ENNReal.ofReal_pos.2 (sq_pos_of_pos hd), + fun i s hμs => ?_⟩ + have hb := eLpNorm_le_eLpNorm_mul_rpow_measure_univ (μ := P.restrict s) + (by norm_num : (1 : ℝ≥0∞) ≤ 2) (hXm i).restrict + norm_num only [ENNReal.toReal_one, ENNReal.toReal_ofNat, div_one] at hb + rw [Measure.restrict_apply_univ] at hb + have hp : (P s) ^ (1/2 : ℝ) ≤ (d : ℝ≥0∞) := by + calc + _ ≤ (ENNReal.ofReal ((d : ℝ)^2)) ^ (1/2 : ℝ) := + ENNReal.rpow_le_rpow hμs (by norm_num) + _ = _ := by + rw [ENNReal.ofReal_pow d.coe_nonneg] + simp only [ENNReal.ofReal_coe_nnreal] + rw [← ENNReal.rpow_natCast, ← ENNReal.rpow_mul] + norm_num + calc + _ ≤ eLpNorm (X i) 2 (P.restrict s) * (P s) ^ (1/2 : ℝ) := hb + _ ≤ C * (d : ℝ≥0∞) := mul_le_mul + ((eLpNorm_mono_measure _ Measure.restrict_le_self).trans (hC i)) hp (by positivity) (by positivity) + _ ≤ ENNReal.ofReal ε.toReal := by + rw [← ENNReal.coe_mul, ← ENNReal.ofReal_coe_nnreal] + simp only [NNReal.coe_mul] + apply ENNReal.ofReal_le_ofReal + change (C : ℝ) * (ε.toReal / ((C : ℝ)+1)) ≤ ε.toReal + rw [← mul_div_assoc, div_le_iff₀ (by positivity)] + nlinarith + _ = ε := ENNReal.ofReal_toReal hεt + · intro i + have hb := eLpNorm_le_eLpNorm_mul_rpow_measure_univ (by norm_num : (1 : ℝ≥0∞) ≤ 2) (hXm i) + rw [ENNReal.coe_toNNReal hDt] + norm_num only [ENNReal.toReal_one, ENNReal.toReal_ofNat, div_one] at hb + exact hb.trans (mul_le_mul_left (hC i) ((P univ) ^ (1/2 : ℝ))) + +lemma L1_tendsto_of_square_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsFiniteMeasure P] {X : ℕ → Ω → ℝ} {Y : Ω → ℝ} + (hX : ∀ n, MemLp (X n) 2 P) (A : ℝ) + (hA : ∀ n, (∫ ω, X n ω ^ 2 ∂P) ≤ A) + (hXY : ∀ᵐ ω ∂P, Tendsto (fun n => X n ω) atTop (𝓝 (Y ω))) : + Integrable Y P ∧ Tendsto (fun n => eLpNorm (X n-Y) 1 P) atTop (𝓝 0) := by + let C : ℝ≥0∞ := (ENNReal.ofReal A) ^ (1/2 : ℝ) + have hCt : C ≠ ∞ := ENNReal.rpow_ne_top_of_nonneg (by norm_num) ENNReal.ofReal_ne_top + have hC (n : ℕ) : eLpNorm (X n) 2 P ≤ C.toNNReal := by + rw [ENNReal.coe_toNNReal hCt, eLpNorm_two_eq_integral_sq (hX n)] + exact ENNReal.rpow_le_rpow (ENNReal.ofReal_le_ofReal (hA n)) (by norm_num) + have hui := uniformIntegrable_one_of_eLpNorm_two_bounded + (fun n => (hX n).aestronglyMeasurable) C.toNNReal hC + have hY := hui.memLp_of_ae_tendsto hXY + exact ⟨memLp_one_iff_integrable.1 hY, + tendsto_Lp_finite_of_tendsto_ae (by norm_num : (1 : ℝ≥0∞) ≤ 1) + (by norm_num) (fun n => (hX n).aestronglyMeasurable) hY hui.unifIntegrable hXY⟩ + +lemma integrate_L1_le {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [SFinite P] [SFinite ν] + {X Y : Ω × Z → ℝ} (hX : Integrable X (P.prod ν)) (hY : Integrable Y (P.prod ν)) : + eLpNorm ((fun ω => ∫ z, X (ω,z) ∂ν)-(fun ω => ∫ z, Y (ω,z) ∂ν)) 1 P ≤ + eLpNorm (X-Y) 1 (P.prod ν) := by + rw [eLpNorm_one_eq_lintegral_enorm + (hX.aestronglyMeasurable.integral_prod_right'.sub + hY.aestronglyMeasurable.integral_prod_right'), + eLpNorm_one_eq_lintegral_enorm (hX.sub hY).aestronglyMeasurable] + rw [lintegral_prod _ (hX.sub hY).aestronglyMeasurable.enorm] + apply lintegral_mono_ae + filter_upwards [hX.prod_right_ae,hY.prod_right_ae] with ω hx hy + simp only [Pi.sub_apply] + rw [← integral_sub hx hy] + change ‖∫ z, X (ω,z)-Y (ω,z) ∂ν‖ₑ ≤ _ + exact enorm_integral_le_lintegral_enorm _ + +lemma spatial_L1_limit {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [IsFiniteMeasure P] [IsFiniteMeasure ν] + {X : ℕ → Ω × Z → ℝ} {Y : Ω × Z → ℝ} + (hX : ∀ n, MemLp (X n) 2 (P.prod ν)) (A : ℝ) + (hA : ∀ n, (∫ q, X n q ^ 2 ∂P.prod ν) ≤ A) + (hXY : ∀ᵐ q ∂P.prod ν, Tendsto (fun n => X n q) atTop (𝓝 (Y q))) : + Integrable Y (P.prod ν) ∧ + ∃ ns : ℕ → ℕ, StrictMono ns ∧ ∀ᵐ ω ∂P, + Tendsto (fun n => ∫ z, X (ns n) (ω,z) ∂ν) atTop (𝓝 (∫ z, Y (ω,z) ∂ν)) := by + obtain ⟨hY,hL⟩ := L1_tendsto_of_square_bound hX A hA hXY + have hi (n : ℕ) := (hX n).integrable (by norm_num : (1 : ℝ≥0∞) ≤ 2) + have hh : Tendsto (fun n => eLpNorm + ((fun ω => ∫ z, X n (ω,z) ∂ν)-(fun ω => ∫ z, Y (ω,z) ∂ν)) 1 P) atTop (𝓝 0) := + tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hL + (fun _ => bot_le) (fun n => integrate_L1_le (hi n) hY) + have hm := tendstoInMeasure_of_tendsto_eLpNorm (by norm_num : (1 : ℝ≥0∞) ≠ 0) + hh + exact ⟨hY,hm.exists_seq_tendsto_ae⟩ + +end SLEExactGauge.SpatialLimit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SpatialLimit + +lemma memLp_two_prod_of_fiber_bound {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [SFinite P] [IsFiniteMeasure ν] + {X : Ω × Z → ℝ} (hX : AEMeasurable X (P.prod ν)) + (hXi : ∀ᵐ z ∂ν, MemLp (fun ω => X (ω,z)) 2 P) (A : ℝ) + (hA : ∀ᵐ z ∂ν, (∫ ω, X (ω,z)^2 ∂P) ≤ A) : + MemLp X 2 (P.prod ν) ∧ (∫ q, X q ^ 2 ∂P.prod ν) ≤ ∫ _ : Z, A ∂ν := by + have hsq : AEStronglyMeasurable (fun q => X q^2) (P.prod ν) := (hX.pow_const 2).aestronglyMeasurable + have hmeas : AEStronglyMeasurable (fun z => ∫ ω, ‖X (ω,z)^2‖ ∂P) ν := + hsq.norm.prod_swap.integral_prod_right' + have he (z : Z) : (∫ ω, ‖X (ω,z)^2‖ ∂P) = ∫ ω, X (ω,z)^2 ∂P := by + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun ω => Real.norm_of_nonneg (sq_nonneg _)) + have hi : Integrable (fun q => X q^2) (P.prod ν) := by + apply (integrable_prod_iff' hsq).2 + refine ⟨hXi.mono (fun z hz => hz.integrable_sq),?_⟩ + apply (integrable_const A).mono' hmeas + filter_upwards [hA] with z hz + rw [he,Real.norm_of_nonneg (integral_nonneg (fun _ => sq_nonneg _))] + exact hz + refine ⟨(memLp_two_iff_integrable_sq hX.aestronglyMeasurable).2 hi,?_⟩ + rw [integral_prod_symm _ hi] + exact integral_mono_ae hi.integral_prod_right (integrable_const _) hA + +lemma ae_prod_tendsto_of_fibers {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [SFinite P] [SFinite ν] + {X : ℕ → Ω × Z → ℝ} {Y : Ω × Z → ℝ} + (hX : ∀ n, AEMeasurable (X n) (P.prod ν)) (hY : AEMeasurable Y (P.prod ν)) + (hh : ∀ᵐ z ∂ν, ∀ᵐ ω ∂P, Tendsto (fun n => X n (ω,z)) atTop (𝓝 (Y (ω,z)))) : + ∀ᵐ q ∂P.prod ν, Tendsto (fun n => X n q) atTop (𝓝 (Y q)) := by + let F : ℕ → Ω × Z → ℝ := fun n => (hX n).mk (X n) + let G := hY.mk Y + have hF (n : ℕ) : Measurable (F n) := (hX n).measurable_mk + have hG : Measurable G := hY.measurable_mk + have he : ∀ᵐ q ∂P.prod ν, (∀ n, X n q = F n q) ∧ Y q = G q := + (ae_all_iff.2 (fun n => (hX n).ae_eq_mk)).and hY.ae_eq_mk + have hes : ∀ᵐ q ∂ν.prod P, (∀ n, X n q.swap = F n q.swap) ∧ Y q.swap = G q.swap := + Measure.measurePreserving_swap.quasiMeasurePreserving.ae he + have hf : ∀ᵐ q ∂ν.prod P, Tendsto (fun n => F n q.swap) atTop (𝓝 (G q.swap)) := by + apply (Measure.ae_prod_iff_ae_ae (measurableSet_tendsto_fun + (fun n => (hF n).comp measurable_swap) (hG.comp measurable_swap))).2 + filter_upwards [hh,Measure.ae_ae_of_ae_prod hes] with z hz hez + filter_upwards [hz,hez] with ω hω heω + change (∀ n, X n (ω,z) = F n (ω,z)) ∧ Y (ω,z) = G (ω,z) at heω + change Tendsto (fun n => F n (ω,z)) atTop (𝓝 (G (ω,z))) + simpa only [heω.1,heω.2] using hω + have hf' := Measure.measurePreserving_swap.quasiMeasurePreserving.ae hf + filter_upwards [he,hf'] with q heq hq + simpa only [heq.1,heq.2,Prod.swap_swap] using hq + +end SLEExactGauge.SpatialLimit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable +open PredictableLimit + +theorem limit_exponential_bound_subseq {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (T : ℝ≥0) (A : ℕ → ℕ → Ω → ℝ) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hAa : ∀ n i, AEMeasurable (A n i) P) + (ns : ℕ → ℕ) (Y Q : Ω → ℝ) + (hY : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicDriverSum B T A (ns n) sample) atTop (𝓝 (Y sample))) + (hQ : ∀ᵐ sample ∂P, Tendsto (fun n => dyadicVariance T A (ns n) sample) atTop (𝓝 (Q sample))) + (K : ℝ) (hK : ∀ᵐ sample ∂P, Q sample ≤ K) (θ : ℝ) : + (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample)) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*K/2)) := by + let E : ℕ → Ω → ℝ≥0∞ := fun n sample => ENNReal.ofReal + (Real.exp (exponentialLogSum B (dyadicTime T (ns n)) (A (ns n)) θ (2^(ns n)) sample)) + have hEm (n : ℕ) : AEMeasurable (E n) P := + ((exponentialLogSum_aemeasurable hB _ _ (hAa (ns n)) θ (2^(ns n))).exp).ennreal_ofReal + have hEi (n : ℕ) : (∫⁻ sample, E n sample ∂P) = 1 := + exponentialLogSum_identity hB _ (dyadicTime_mono T (ns n)) _ (hA (ns n)) (hAa (ns n)) θ (2^(ns n)) + have hElim : ∀ᵐ sample ∂P, Tendsto (fun n => E n sample) atTop + (𝓝 (ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)))) := by + filter_upwards [hY,hQ] with sample hy hq + have hh := ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (Real.continuous_exp.continuousAt.tendsto.comp + ((hy.const_mul θ).sub ((hq.const_mul (θ^2)).div_const 2))) + simpa only [E,exponentialLogSum_dyadic,Function.comp_def] using hh + have hFatou : (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P) ≤ 1 := by + calc + _ = ∫⁻ sample, liminf (fun n => E n sample) atTop ∂P := by + apply lintegral_congr_ae + filter_upwards [hElim] with sample hs + exact hs.liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ sample, E n sample ∂P) atTop := lintegral_liminf_le' hEm + _ = 1 := by simp only [hEi,liminf_const] + have hlimMeas : AEMeasurable (fun sample => ENNReal.ofReal + (Real.exp (θ*Y sample-θ^2*Q sample/2))) P := + aemeasurable_of_tendsto_metrizable_ae atTop hEm hElim + calc + _ ≤ ∫⁻ sample, ENNReal.ofReal (Real.exp (θ^2*K/2)) * + ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P := by + apply lintegral_mono_ae + filter_upwards [hK] with sample hk + rw [← ENNReal.ofReal_mul (Real.exp_pos _).le,← Real.exp_add] + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.2 + nlinarith [mul_le_mul_of_nonneg_left hk (sq_nonneg θ)] + _ = ENNReal.ofReal (Real.exp (θ^2*K/2)) * + (∫⁻ sample, ENNReal.ofReal (Real.exp (θ*Y sample-θ^2*Q sample/2)) ∂P) := + lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + _ ≤ _ := by simpa only [mul_one] using mul_le_mul_right hFatou (ENNReal.ofReal (Real.exp (θ^2*K/2))) + +end SLEExactGauge.BrownianPredictable + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SpatialLimit +open BrownianPredictable PredictableLimit + +lemma dyadicDriverSum_integrate {Ω Z : Type*} [MeasurableSpace Z] + (ν : Measure Z) (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) + (A : ℕ → ℕ → Ω × Z → ℝ) (n : ℕ) (ω : Ω) + (hA : ∀ i, Integrable (fun z => A n i (ω,z)) ν) : + dyadicDriverSum B T (fun n i ω => ∫ z, A n i (ω,z) ∂ν) n ω = + ∫ z, dyadicDriverSum B T (fun n i ω => A n i (ω,z)) n ω ∂ν := by + unfold dyadicDriverSum + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i hi + rw [integral_mul_const] + · intro i hi + exact (hA i).mul_const _ + +theorem spatial_exponential_bound {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} [IsProbabilityMeasure P] (ν : Measure Z) [IsFiniteMeasure ν] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (A : ℕ → ℕ → Ω × Z → ℝ) + (hAi : ∀ n i, Integrable (A n i) (P.prod ν)) + (hA : ∀ n i, @Measurable (Ω × Z) ℝ + (Prod.instMeasurableSpace (m₁ := pastSigma B (dyadicTime T n i)) (m₂ := inferInstance)) _ (A n i)) + (Y : Ω × Z → ℝ) + (hX : ∀ n, MemLp (fun q => dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1) 2 (P.prod ν)) + (V : ℝ) (hV : ∀ n, (∫ q, (dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1)^2 ∂P.prod ν) ≤ V) + (hY : ∀ᵐ q ∂P.prod ν, Tendsto + (fun n => dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1) atTop (𝓝 (Y q))) + (Q : Ω → ℝ) + (hQ : ∀ᵐ ω ∂P, Tendsto (fun n => dyadicVariance T (fun n i ω => ∫ z, A n i (ω,z) ∂ν) n ω) + atTop (𝓝 (Q ω))) (K θ : ℝ) (hK : ∀ᵐ ω ∂P, Q ω ≤ K) : + (∫⁻ ω, ENNReal.ofReal (Real.exp (θ*(∫ z, Y (ω,z) ∂ν))) ∂P) ≤ + ENNReal.ofReal (Real.exp (θ^2*K/2)) := by + let C := fun n i ω => ∫ z, A n i (ω,z) ∂ν + have hCi (n i : ℕ) : AEMeasurable (C n i) P := + (hAi n i).aestronglyMeasurable.integral_prod_right'.aemeasurable + have hCp (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (C n i) := by + let : MeasurableSpace Ω := pastSigma B (dyadicTime T n i) + exact (hA n i).stronglyMeasurable.integral_prod_right'.measurable + obtain ⟨hYi,ns,hns,hlim⟩ := spatial_L1_limit hX V hV hY + have he : ∀ᵐ ω ∂P, ∀ n, dyadicDriverSum B T C n ω = + ∫ z, dyadicDriverSum B T (fun n i ω => A n i (ω,z)) n ω ∂ν := by + have hh : ∀ᵐ ω ∂P, ∀ n i, Integrable (fun z => A n i (ω,z)) ν := + ae_all_iff.2 (fun n => ae_all_iff.2 (fun i => (hAi n i).prod_right_ae)) + filter_upwards [hh] with ω hω n + exact dyadicDriverSum_integrate ν B T A n ω (hω n) + have hS : ∀ᵐ ω ∂P, Tendsto (fun n => dyadicDriverSum B T C (ns n) ω) atTop + (𝓝 (∫ z, Y (ω,z) ∂ν)) := by + filter_upwards [he,hlim] with ω heω hω + simpa only [heω] using hω + have hQV : ∀ᵐ ω ∂P, Tendsto (fun n => dyadicVariance T C (ns n) ω) atTop (𝓝 (Q ω)) := + hQ.mono (fun ω hω => hω.comp hns.tendsto_atTop) + exact limit_exponential_bound_subseq hB T C hCp hCi ns _ Q hS hQV K hK θ + +lemma sums_aemeasurable {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [SFinite P] [SFinite ν] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (A : ℕ → ℕ → Ω × Z → ℝ) + (hA : ∀ n i, AEMeasurable (A n i) (P.prod ν)) (n : ℕ) : + AEMeasurable (fun q => dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1) (P.prod ν) := by + apply Finset.aemeasurable_fun_sum + intro i hi + exact (hA n i).mul + (((hB.toIsPreBrownianReal.hasLaw_eval _).aemeasurable.comp_fst).sub + ((hB.toIsPreBrownianReal.hasLaw_eval _).aemeasurable.comp_fst)) + +lemma bounded_sums {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} [IsProbabilityMeasure P] (ν : Measure Z) [IsFiniteMeasure ν] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (A : ℕ → ℕ → Ω × Z → ℝ) + (hA : ∀ n i, @Measurable (Ω × Z) ℝ + (Prod.instMeasurableSpace (m₁ := pastSigma B (dyadicTime T n i)) (m₂ := inferInstance)) _ (A n i)) + (hAm : ∀ n i, AEMeasurable (A n i) (P.prod ν)) + (K : ℝ) (hK : 0 ≤ K) (hbound : ∀ n i q, |A n i q| ≤ K) : + (∀ n i, Integrable (A n i) (P.prod ν)) ∧ + ∀ n, MemLp (fun q => dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1) 2 (P.prod ν) ∧ + (∫ q, (dyadicDriverSum B T (fun n i ω => A n i (ω,q.2)) n q.1)^2 ∂P.prod ν) ≤ + ∫ _ : Z, K^2*(T:ℝ) ∂ν := by + have hi (n i : ℕ) : Integrable (A n i) (P.prod ν) := + Integrable.of_bound (hAm n i).aestronglyMeasurable K (Filter.Eventually.of_forall (hbound n i)) + refine ⟨hi,?_⟩ + intro n + have hsect : ∀ᵐ z ∂ν, ∀ n i, AEStronglyMeasurable (fun ω => A n i (ω,z)) P := + ae_all_iff.2 (fun n => ae_all_iff.2 (fun i => ((hi n i).prod_left_ae.mono (fun z hz => hz.aestronglyMeasurable)))) + have hcp (z : Z) (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (fun ω => A n i (ω,z)) := by + let : MeasurableSpace Ω := pastSigma B (dyadicTime T n i) + exact (hA n i).comp (measurable_id.prodMk measurable_const) + have hh : ∀ᵐ z ∂ν, + MemLp (fun ω => dyadicDriverSum B T (fun n i ω => A n i (ω,z)) n ω) 2 P ∧ + (∫ ω, (dyadicDriverSum B T (fun n i ω => A n i (ω,z)) n ω)^2 ∂P) ≤ K^2*(T:ℝ) := by + filter_upwards [hsect] with z hz + have h2 (n i : ℕ) : MemLp (fun ω => A n i (ω,z)) 2 P := + MemLp.of_bound (hz n i) K (Filter.Eventually.of_forall (fun ω => hbound n i (ω,z))) + exact ⟨dyadicDriverSum_memLp hB T _ (hcp z) h2 n, + dyadicDriverSum_second_moment_le hB T _ (hcp z) h2 K hK + (fun n i => Filter.Eventually.of_forall (fun ω => hbound n i (ω,z))) n⟩ + exact memLp_two_prod_of_fiber_bound (sums_aemeasurable hB T A hAm n) + (hh.mono (fun z hz => hz.1)) (K^2*(T:ℝ)) (hh.mono (fun z hz => hz.2)) + +end SLEExactGauge.SpatialLimit + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.MeshSlab +open LoewnerCutoff LoewnerField LoewnerExit LoewnerLocalized Mesh +open BrownianPredictable BrownianIto TaylorMeshes PredictableLimit +local instance slabMomentsDifferenceRealPathMeasurableSpace : MeasurableSpace C(I,ℝ) := borel _ +local instance slabMomentsDifferenceRealPathBorelSpace : BorelSpace C(I,ℝ) := ⟨rfl⟩ +local instance slabMomentsDifferenceComplexPathMeasurableSpace : MeasurableSpace C(I,ℂ) := borel _ +local instance slabMomentsDifferenceComplexPathBorelSpace : BorelSpace C(I,ℂ) := ⟨rfl⟩ + +def observedDifference {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (κ ρ δ e r : ℝ) + (q : (C(I,ℝ) × C(I,ℂ)) × ℂ) : ℝ := + observedValue hε hT ρ δ e (1-κ/8) (8/κ-1) q - + observedValue hε hT ρ δ r (1-κ/8) (8/κ-1) q + +lemma observedDifference_aemeasurable {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (ν : Measure ℂ) [SFinite ν] {ε : ℝ} (hε : 0 < ε) + (κ ρ δ e r : ℝ) (T : ℝ≥0) (V : Ω → C(I,ℂ)) (hV : Measurable V) : + AEMeasurable (fun q : Ω × ℂ => observedDifference hε T.coe_nonneg κ ρ δ e r + ((BrownianDriver.path B (Real.sqrt κ) T q.1,V q.1),q.2)) (P.prod ν) := by + have hc := (measurable_observedValue hε T.coe_nonneg ρ δ e (1-κ/8) (8/κ-1)).sub + (measurable_observedValue hε T.coe_nonneg ρ δ r (1-κ/8) (8/κ-1)) + have hp : AEMeasurable (fun q : Ω × ℂ => ((BrownianDriver.path B (Real.sqrt κ) T q.1,V q.1),q.2)) (P.prod ν) := + (((BrownianDriver.path_aemeasurable hB (Real.sqrt κ) T).comp_fst).prodMk + ((hV.comp measurable_fst).aemeasurable)).prodMk measurable_snd.aemeasurable + exact hc.comp_aemeasurable hp + +lemma slab_sum_tendsto {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] + {A : Set ℂ} {u : ℂ → ℝ} (C : FiniteTilt.CommonCutoff A u) + (κ : ℝ) (hκ : 0 < κ ∧ κ < 8) (B : ℝ≥0 → Ω → ℝ) (hB : IsBrownianReal B P) + (γ : Ω → ℝ → ℂ) (g f : Ω → ℝ → ℂ → ℂ) + (hmaps : ∀ᵐ ω ∂P, IsLoewnerTraceUsing (fun t => Real.sqrt κ*B t.toNNReal ω) (γ ω) (g ω) (f ω)) + (z : ℂ) (hz : z ∈ A) (hhalf : z ∈ halfPlane) (hu : 0 < u z) + {ρ : ℝ} (hr : (2*z.im)*Real.exp (-u z) = ρ) + (V : Ω → C(I,ℂ)) (hV : ∀ᵐ ω ∂P, ∀ q : I, V ω q = γ ω ((C.horizon:ℝ)*q)) (e r : ℝ) : + ∀ᵐ ω ∂P, Tendsto (fun n => dyadicDriverSum B C.horizon + (fun n i ω => slabCoeff C.height_pos κ B C.horizon (dyadicTime C.horizon n i) ρ C.angle e r (ω,z)) n ω) atTop + (𝓝 (observedDifference C.height_pos C.horizon.coe_nonneg κ ρ C.angle e r + ((BrownianDriver.path B (Real.sqrt κ) C.horizon ω,V ω),z))) := by + have he := (C.at z hz).physical_sum_tendsto hB κ hκ γ g f hmaps hhalf hu e + have hr' := (C.at z hz).physical_sum_tendsto hB κ hκ γ g f hmaps hhalf hu r + filter_upwards [he,hr',hmaps,hB.cont,hB.toIsPreBrownianReal.eval_zero_ae_eq_zero,hV] with ω heω hrω hm hc hb0 hVω + have hv (s : ℝ) := observedValue_eq C κ B γ g f ω hm hc hb0 z hz hhalf hu hr (V ω) hVω s + unfold observedDifference + rw [hv e,hv r] + have hl := heω.sub hrω + convert hl using 1 + · funext n + simp only [dyadicDriverSum,slabCoeff,← coeff_common C κ B z hz hr, + sub_mul,Finset.sum_sub_distrib] + rfl + · congr 1 + ring + +end SLEExactGauge.MeshSlab + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/SlitMaps.lean b/lean/OAI/Probability/SLELocalization/SlitMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9fb64ca8670a0631b45c2c0eb16d89504bbf1d2 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/SlitMaps.lean @@ -0,0 +1,655 @@ +/- +Portions of this file have been adapted from an external source. +The source copyright header and license information are preserved below. +-/ + +import Mathlib +import OAI.Probability.SLELocalization.ConformalKernels + +namespace OAI + + +/-! Conformal localization and Slit Maps estimates. -/ + +section +noncomputable section +open Set Filter Metric Topology +open scoped Topology +namespace SLEExactGauge.SlitMaps + +def liftMap {U : Set ℂ} (f : C(U,ℂ)) (z : ℂ) : ℂ := by + classical + exact if hz : z ∈ U then f ⟨z,hz⟩ else 0 + +@[simp] lemma liftMap_apply {U : Set ℂ} (f : C(U,ℂ)) (z : U) : + liftMap f z = f z := by simp [liftMap,z.property] + +lemma tendsto_liftMap {U : Set ℂ} (hU : IsOpen U) + {ι : Type*} {l : Filter ι} {F : ι → C(U,ℂ)} {f : C(U,ℂ)} + (hc : Tendsto F l (𝓝 f)) : + TendstoLocallyUniformlyOn (fun i => liftMap (F i)) (liftMap f) l U := by + rw [tendstoLocallyUniformlyOn_iff_forall_isCompact hU] + intro K hKU hK + let K' : Set U := Subtype.val ⁻¹' K + have he : Subtype.val '' K' = K := by + ext z + constructor + · rintro ⟨x,hx,rfl⟩ + exact hx + · intro hz + exact ⟨⟨z,hKU hz⟩,hz,rfl⟩ + have hK' : IsCompact K' := Topology.IsEmbedding.subtypeVal.isCompact_iff.2 (he.symm ▸ hK) + have hu := (ContinuousMap.tendsto_iff_forall_isCompact_tendstoUniformlyOn.1 hc) K' hK' + rw [Metric.tendstoUniformlyOn_iff] at hu ⊢ + intro ε hε + filter_upwards [hu ε hε] with i hi z hz + simpa only [liftMap, dite_eq_left (hKU hz)] using hi ⟨z,hKU hz⟩ hz + +def boundedHolomorphic (U : Set ℂ) : Set C(U,ℂ) := + {f | DifferentiableOn ℂ (liftMap f) U ∧ ∀ z : U, ‖f z‖ ≤ 1} + +lemma boundedHolomorphic_equicontinuous {U : Set ℂ} (hU : IsOpen U) : + Equicontinuous (fun (f : boundedHolomorphic U) (z : U) => f.val z) := by + intro z + rw [Metric.equicontinuousAt_iff] + intro ε hε + obtain ⟨r,hr,hrU⟩ := Metric.nhds_basis_closedBall.mem_iff.1 (hU.mem_nhds z.property) + let δ : ℝ := min (r/2) (ε*r/4) + have hδ : 0 < δ := lt_min (by positivity) (by positivity) + refine ⟨δ,hδ,fun w hw f => ?_⟩ + have hz : (z:ℂ) ∈ closedBall (z:ℂ) (r/2) := mem_closedBall_self (by positivity) + have hw' : (w:ℂ) ∈ closedBall (z:ℂ) (r/2) := by + exact (show dist (w:ℂ) (z:ℂ) < δ from hw).le.trans (min_le_left _ _) + have hsub : closedBall (z:ℂ) (r/2) ⊆ U := + (closedBall_subset_closedBall (by linarith : r/2 ≤ r)).trans hrU + have hd (x : ℂ) (hx : x ∈ closedBall (z:ℂ) (r/2)) : + DifferentiableAt ℂ (liftMap f.val) x := f.property.1.differentiableAt (hU.mem_nhds (hsub hx)) + have hdB (x : ℂ) (hx : x ∈ closedBall (z:ℂ) (r/2)) : + ‖deriv (liftMap f.val) x‖ ≤ 2/r := by + have hs : closedBall x (r/2) ⊆ U := by + have hh : closedBall x (r/2) ⊆ closedBall (z:ℂ) r := by + apply closedBall_subset_closedBall' + have hn := mem_closedBall.1 hx + linarith + exact hh.trans hrU + have hdc : DiffContOnCl ℂ (liftMap f.val) (ball x (r/2)) := + f.property.1.diffContOnCl_ball hs + have hb (y : ℂ) (hy : y ∈ sphere x (r/2)) : ‖liftMap f.val y‖ ≤ 1 := by + exact (liftMap_apply f.val ⟨y,hs (sphere_subset_closedBall hy)⟩) ▸ f.property.2 ⟨y,hs (sphere_subset_closedBall hy)⟩ + have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le (by positivity : 0 < r/2) hdc hb + convert hh using 1 + field_simp + have hb := (convex_closedBall (z:ℂ) (r/2)).norm_image_sub_le_of_norm_deriv_le hd hdB hz hw' + have he : ‖(w:ℂ)-(z:ℂ)‖ < ε*r/4 := by + rw [← dist_eq_norm] + exact (show dist (w:ℂ) (z:ℂ) < δ from hw).trans_le (min_le_right _ _) + have hrp : 0 < 2/r := by positivity + have hprod : (2/r)*‖(w:ℂ)-(z:ℂ)‖ < ε/2 := by + calc + _ < (2/r)*(ε*r/4) := mul_lt_mul_of_pos_left he hrp + _ = ε/2 := by field_simp; ring + rw [liftMap_apply,liftMap_apply] at hb + rw [dist_comm,dist_eq_norm] + exact hb.trans_lt (hprod.trans_le (by linarith)) + +lemma boundedHolomorphic_closed {U : Set ℂ} (hU : IsOpen U) : + IsClosed (boundedHolomorphic U) := by + apply isClosed_of_closure_subset + intro f hf + have : NeBot (𝓝[boundedHolomorphic U] f) := mem_closure_iff_nhdsWithin_neBot.1 hf + have hl : Tendsto (fun x : C(U,ℂ) => x) (𝓝[boundedHolomorphic U] f) (𝓝 f) := nhdsWithin_le_nhds + have hd : ∀ᶠ x in 𝓝[boundedHolomorphic U] f, DifferentiableOn ℂ (liftMap x) U := + by + filter_upwards [self_mem_nhdsWithin] with x hx + exact hx.1 + refine ⟨(tendsto_liftMap hU hl).differentiableOn hd hU,fun z => ?_⟩ + have ht : Tendsto (fun x : C(U,ℂ) => ‖x z‖) (𝓝[boundedHolomorphic U] f) (𝓝 ‖f z‖) := + ((ContinuousEvalConst.continuous_eval_const z).norm.continuousAt.tendsto).comp hl + apply le_of_tendsto ht + filter_upwards [self_mem_nhdsWithin] with x hx + exact hx.2 z + +lemma boundedHolomorphic_compact {U : Set ℂ} (hU : IsOpen U) : + IsCompact (boundedHolomorphic U) := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let : T2Space (UniformOnFun U ℂ {K : Set U | IsCompact K}) := + UniformOnFun.t2Space_of_covering (by + apply eq_univ_iff_forall.mpr + intro x + exact mem_sUnion_of_mem (mem_singleton x) isCompact_singleton) + have hc : IsCompact (closure (boundedHolomorphic U)) := by + apply ArzelaAscoli.isCompact_closure_of_isClosedEmbedding + (𝔖:={K : Set U | IsCompact K}) (F:=fun f : C(U,ℂ) => (f : U → ℂ)) + (fun K hK => hK) ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding + · intro K hK + exact (boundedHolomorphic_equicontinuous hU).equicontinuousOn K + · intro K hK z hz + refine ⟨closedBall (0:ℂ) 1,isCompact_closedBall _ _,fun f hf => ?_⟩ + simpa using hf.2 z + simpa [(boundedHolomorphic_closed hU).closure_eq] using hc + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology +namespace SLEExactGauge.SlitMaps + +lemma lower_norm_of_sphere {f : ℂ → ℂ} {z : ℂ} {r c : ℝ} + (hr : 0 < r) (hc : 0 < c) + (hd : DifferentiableOn ℂ f (closedBall z r)) + (hn : ∀ w ∈ closedBall z r, f w ≠ 0) + (hb : ∀ w ∈ sphere z r, c ≤ ‖f w‖) : c ≤ ‖f z‖ := by + have hi : DifferentiableOn ℂ (fun w => (f w)⁻¹) (closedBall z r) := hd.inv hn + have hi' : DiffContOnCl ℂ (fun w => (f w)⁻¹) (ball z r) := by + exact hi.diffContOnCl_ball Subset.rfl + have hm : ‖(f z)⁻¹‖ ≤ c⁻¹ := by + apply Complex.norm_le_of_forall_mem_frontier_norm_le isBounded_ball hi' + · intro w hw + rw [frontier_ball z hr.ne'] at hw + rw [norm_inv] + exact inv_anti₀ hc (hb w hw) + · rw [closure_ball z hr.ne'] + exact mem_closedBall_self hr.le + rw [norm_inv] at hm + exact (inv_le_inv₀ (norm_pos_iff.2 (hn z (mem_closedBall_self hr.le))) hc).1 hm + +theorem locallyUniform_nonvanishing {ι : Type*} {l : Filter ι} [l.NeBot] + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hconn : IsPreconnected U) + (hlim : TendstoLocallyUniformlyOn F f l U) + (hF : ∀ᶠ i in l, DifferentiableOn ℂ (F i) U) + (hn : ∀ᶠ i in l, ∀ z ∈ U, F i z ≠ 0) + {a : ℂ} (ha : a ∈ U) (hfa : f a ≠ 0) : ∀ z ∈ U, f z ≠ 0 := by + have hf := hlim.differentiableOn hF hU + have haf : AnalyticOnNhd ℂ f U := hf.analyticOnNhd hU + intro z hz hzero + have hnot : ¬∀ᶠ w in 𝓝 z, f w = 0 := by + intro he + exact hfa (haf.eqOn_zero_of_preconnected_of_eventuallyEq_zero hconn hz he ha) + have hiso := ((haf z hz).eventually_eq_or_eventually_ne (analyticAt_const (v:=0))).resolve_left hnot + have hmem : ∀ᶠ w in 𝓝 z, w ∈ U := hU.mem_nhds hz + have hevent : ∀ᶠ w in 𝓝 z, w ∈ U ∧ (w ≠ z → f w ≠ 0) := + hmem.and (eventually_nhdsWithin_iff.1 hiso) + obtain ⟨r,hr,hrU⟩ := Metric.nhds_basis_closedBall.mem_iff.1 hevent + have hrsub : closedBall z r ⊆ U := fun w hw => (hrU hw).1 + have hfnz : ∀ w ∈ sphere z r, f w ≠ 0 := fun w hw => + (hrU (sphere_subset_closedBall hw)).2 (ne_of_mem_sphere hw hr.ne') + have hsne : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le + have hcfn : ContinuousOn (fun w => ‖f w‖) (sphere z r) := + (haf.continuousOn.mono (sphere_subset_closedBall.trans hrsub)).norm + obtain ⟨w,hw,hmin⟩ := (isCompact_sphere z r).exists_isMinOn hsne hcfn + let c : ℝ := ‖f w‖ + have hc : 0 < c := norm_pos_iff.2 (hfnz w hw) + have huni : TendstoUniformlyOn F f l (sphere z r) := + (tendstoLocallyUniformlyOn_iff_forall_isCompact hU).1 hlim _ + (sphere_subset_closedBall.trans hrsub) (isCompact_sphere z r) + have hclose := Metric.tendstoUniformlyOn_iff.1 huni (c/2) (by positivity) + have hlow : ∀ᶠ i in l, c/2 ≤ ‖F i z‖ := by + filter_upwards [hF,hn,hclose] with i hdi hni hci + apply lower_norm_of_sphere hr (by positivity) (hdi.mono hrsub) + (fun v hv => hni v (hrsub hv)) + intro v hv + have hfv := hmin hv + have hdv := hci v hv + have htri : ‖f v‖ ≤ ‖f v-F i v‖+‖F i v‖ := norm_le_norm_sub_add _ _ + change c ≤ ‖f v‖ at hfv + rw [dist_eq_norm] at hdv + linarith + have hh := ge_of_tendsto ((hlim.tendsto_at hz).norm) hlow + rw [hzero,norm_zero] at hh + linarith + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Set Filter Metric Topology +open scoped Topology +namespace SLEExactGauge.SlitMaps + +lemma locallyUniform_deriv_nonvanishing {ι : Type*} {l : Filter ι} [l.NeBot] + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hc : IsPreconnected U) + (hlim : TendstoLocallyUniformlyOn F f l U) + (hF : ∀ᶠ i in l, DifferentiableOn ℂ (F i) U) + (hn : ∀ᶠ i in l, ∀ z ∈ U, deriv (F i) z ≠ 0) + {a : ℂ} (ha : a ∈ U) (hfa : deriv f a ≠ 0) : + ∀ z ∈ U, deriv f z ≠ 0 := by + apply locallyUniform_nonvanishing hU hc (hlim.deriv hF hU) _ hn ha hfa + filter_upwards [hF] with i hi + exact hi.deriv hU + +lemma locallyUniform_injective {ι : Type*} {l : Filter ι} [l.NeBot] + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} {U : Set ℂ} + (hU : IsOpen U) (hlim : TendstoLocallyUniformlyOn F f l U) + (hF : ∀ᶠ i in l, DifferentiableOn ℂ (F i) U) + (hi : ∀ᶠ i in l, InjOn (F i) U) + (hnd : ∀ z ∈ U, deriv f z ≠ 0) : InjOn f U := by + intro x hx y hy heq + by_contra hxy + have hmem : U \ {x} ∈ 𝓝 y := (hU.inter isClosed_singleton.isOpen_compl).mem_nhds ⟨hy,by simpa [eq_comm] using hxy⟩ + obtain ⟨r,hr,hrU⟩ := Metric.mem_nhds_iff.1 hmem + have hsub : ball y r ⊆ U := fun z hz => (hrU hz).1 + have hnox : ∀ z ∈ ball y r, z ≠ x := fun z hz => (hrU hz).2 + have hex : ∃ b ∈ ball y r, f b ≠ f x := by + by_contra! hn + have he : f =ᶠ[𝓝 y] fun _ => f x := by + filter_upwards [ball_mem_nhds y hr] with z hz + exact hn z hz + exact hnd y hy (he.deriv_eq.trans (deriv_const y (f x))) + obtain ⟨b,hb,hfb⟩ := hex + have hl : TendstoLocallyUniformlyOn (fun i z => F i z - F i x) + (fun z => f z - f x) l (ball y r) := + (hlim.mono hsub).sub ((hlim.tendsto_at hx).tendstoUniformlyOn_const _).tendstoLocallyUniformlyOn + have hd : ∀ᶠ i in l, DifferentiableOn ℂ (fun z => F i z - F i x) (ball y r) := by + filter_upwards [hF] with i hdi + exact (hdi.mono hsub).sub_const _ + have hne : ∀ᶠ i in l, ∀ z ∈ ball y r, F i z - F i x ≠ 0 := by + filter_upwards [hi] with i hii z hz + exact sub_ne_zero.2 (fun hh => hnox z hz (hii (hsub hz) hx hh)) + have hh := locallyUniform_nonvanishing isOpen_ball (convex_ball y r).isPreconnected + hl hd hne hb (sub_ne_zero.2 hfb) y (mem_ball_self hr) + exact hh (sub_eq_zero.2 heq.symm) + +def markedEmbeddings (U : Set ℂ) (a : U) (d₀ : ℝ) : Set C(U,ℂ) := + {f | f ∈ boundedHolomorphic U ∧ f a = 0 ∧ InjOn (liftMap f) U ∧ + (∀ z ∈ U, deriv (liftMap f) z ≠ 0) ∧ d₀ ≤ ‖deriv (liftMap f) a‖} + +lemma derivative_continuousOn {U : Set ℂ} (hU : IsOpen U) (a : U) : + ContinuousOn (fun f : C(U,ℂ) => deriv (liftMap f) a) (boundedHolomorphic U) := by + intro f hf + change Tendsto _ (𝓝[boundedHolomorphic U] f) _ + have hlim := tendsto_liftMap hU (show Tendsto (fun x : C(U,ℂ) => x) + (𝓝[boundedHolomorphic U] f) (𝓝 f) from nhdsWithin_le_nhds) + have hh : ∀ᶠ x in 𝓝[boundedHolomorphic U] f, DifferentiableOn ℂ (liftMap x) U := by + filter_upwards [self_mem_nhdsWithin] with x hx + exact hx.1 + exact (hlim.deriv hh hU).tendsto_at a.property + +lemma markedEmbeddings_closed {U : Set ℂ} (hU : IsOpen U) (hc : IsPreconnected U) + (a : U) {d₀ : ℝ} (hd₀ : 0 < d₀) : IsClosed (markedEmbeddings U a d₀) := by + apply isClosed_of_closure_subset + intro f hf + have : NeBot (𝓝[markedEmbeddings U a d₀] f) := mem_closure_iff_nhdsWithin_neBot.1 hf + have hl : Tendsto (fun x : C(U,ℂ) => x) (𝓝[markedEmbeddings U a d₀] f) (𝓝 f) := nhdsWithin_le_nhds + have hm : ∀ᶠ x in 𝓝[markedEmbeddings U a d₀] f, x ∈ markedEmbeddings U a d₀ := self_mem_nhdsWithin + have he : ∀ᶠ x in 𝓝[markedEmbeddings U a d₀] f, x ∈ boundedHolomorphic U := hm.mono (fun x hx => hx.1) + have hfb : f ∈ boundedHolomorphic U := (boundedHolomorphic_closed hU).mem_of_tendsto hl he + have hF := he.mono (fun x hx => hx.1) + have hd := (tendsto_liftMap hU hl).deriv hF hU + have ht := hd.tendsto_at a.property + have hbound : d₀ ≤ ‖deriv (liftMap f) a‖ := + ge_of_tendsto ht.norm (hm.mono (fun x hx => hx.2.2.2.2)) + have hnz : deriv (liftMap f) a ≠ 0 := norm_pos_iff.1 (hd₀.trans_le hbound) + have hn := locallyUniform_deriv_nonvanishing hU hc (tendsto_liftMap hU hl) hF + (hm.mono (fun x hx => hx.2.2.2.1)) a.property hnz + refine ⟨hfb,?_,locallyUniform_injective hU (tendsto_liftMap hU hl) hF + (hm.mono (fun x hx => hx.2.2.1)) hn,hn,hbound⟩ + apply tendsto_nhds_unique ((ContinuousEvalConst.continuous_eval_const a).continuousAt.tendsto.comp hl) + exact tendsto_const_nhds.congr' (hm.mono (fun x hx => hx.2.1.symm)) + +lemma markedEmbeddings_compact {U : Set ℂ} (hU : IsOpen U) (hc : IsPreconnected U) + (a : U) {d₀ : ℝ} (hd₀ : 0 < d₀) : IsCompact (markedEmbeddings U a d₀) := + (boundedHolomorphic_compact hU).of_isClosed_subset (markedEmbeddings_closed hU hc a hd₀) + (fun _ hx => hx.1) + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Function Filter Metric Set Complex +open scoped Pointwise Topology +namespace SLEExactGauge.SlitMaps + +/- +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] + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Set Filter Metric Topology +open scoped Topology +namespace SLEExactGauge.SlitMaps + +def IsDiskEmbedding (U : Set ℂ) (a : ℂ) (f : ℂ → ℂ) : Prop := + MapsTo f U (ball 0 1) ∧ f a = 0 ∧ InjOn f U ∧ ∀ z ∈ U, deriv f z ≠ 0 + +lemma IsDiskEmbedding.differentiableOn {U : Set ℂ} {a : ℂ} {f : ℂ → ℂ} + (hf : IsDiskEmbedding U a f) : DifferentiableOn ℂ f U := + fun z hz => (differentiableAt_of_deriv_ne_zero (hf.2.2.2 z hz)).differentiableWithinAt + +lemma exists_diskEmbedding {U : Set ℂ} (hUo : IsOpen U) (hUc : IsSimplyConnected U) + (hU : U ≠ univ) (a : U) : ∃ f, IsDiskEmbedding U a f := by + obtain ⟨f,hmap,hinj,hnd⟩ := exists_mapsTo_unitBall_injOn_deriv_ne_zero hUo hUc hU + have hc : ‖f a‖ < 1 := mem_ball_zero_iff.1 (hmap a.property) + refine ⟨diskAuto (f a) ∘ f,(diskAuto_mapsTo hc).comp hmap,?_, + (diskAuto_injOn hc).comp hinj hmap,?_⟩ + · simp + · intro z hz + have hdz := (diskAuto_hasDerivAt hc (mem_ball_zero_iff.1 (hmap hz))).comp z + (differentiableAt_of_deriv_ne_zero (hnd z hz)).hasDerivAt + rw [hdz.deriv] + exact mul_ne_zero (by + rw [← diskAuto_deriv hc (mem_ball_zero_iff.1 (hmap hz))] + exact diskAuto_deriv_ne hc (mem_ball_zero_iff.1 (hmap hz))) (hnd z hz) + +def continuousRestriction {U : Set ℂ} (f : ℂ → ℂ) (hf : ContinuousOn f U) : C(U,ℂ) := + ⟨fun z => f z,(continuousOn_iff_continuous_domRestrict.1 hf)⟩ + +@[simp] lemma continuousRestriction_apply {U : Set ℂ} {f : ℂ → ℂ} (hf : ContinuousOn f U) (z : U) : + continuousRestriction f hf z = f z := rfl + +lemma lift_restriction_eqOn {U : Set ℂ} {f : ℂ → ℂ} (hf : ContinuousOn f U) : + EqOn (liftMap (continuousRestriction f hf)) f U := by + intro z hz + exact liftMap_apply _ ⟨z,hz⟩ + +lemma deriv_lift_restriction {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} + (hf : ContinuousOn f U) {z : ℂ} (hz : z ∈ U) : + deriv (liftMap (continuousRestriction f hf)) z = deriv f z := by + apply Filter.EventuallyEq.deriv_eq + filter_upwards [hU.mem_nhds hz] with w hw + exact lift_restriction_eqOn hf hw + +lemma IsDiskEmbedding.restriction_mem {U : Set ℂ} (hU : IsOpen U) (a : U) + {f : ℂ → ℂ} (hf : IsDiskEmbedding U a f) {d₀ : ℝ} (hd : d₀ ≤ ‖deriv f a‖) : + continuousRestriction f hf.differentiableOn.continuousOn ∈ markedEmbeddings U a d₀ := by + let g := continuousRestriction f hf.differentiableOn.continuousOn + have he : EqOn (liftMap g) f U := lift_restriction_eqOn _ + refine ⟨⟨?_,fun z => (mem_ball_zero_iff.1 (hf.1 z.property)).le⟩,hf.2.1,?_,?_,?_⟩ + · exact hf.differentiableOn.congr he + · intro z hz w hw hh + exact hf.2.2.1 hz hw ((he hz).symm.trans (hh.trans (he hw))) + · intro z hz + rw [deriv_lift_restriction hU _ hz] + exact hf.2.2.2 z hz + · rwa [deriv_lift_restriction hU _ a.property] + +lemma markedEmbeddings_isDiskEmbedding {U : Set ℂ} (hU : IsOpen U) (hc : IsPreconnected U) + (a : U) {d₀ : ℝ} {f : C(U,ℂ)} (hf : f ∈ markedEmbeddings U a d₀) : + IsDiskEmbedding U a (liftMap f) := by + refine ⟨?_,by simpa using hf.2.1,hf.2.2.1,hf.2.2.2.1⟩ + intro z hz + rw [mem_ball_zero_iff] + have hle : ‖liftMap f z‖ ≤ 1 := (liftMap_apply f ⟨z,hz⟩) ▸ hf.1.2 ⟨z,hz⟩ + apply lt_of_le_of_ne hle + intro he + have hm : IsMaxOn (fun w => ‖liftMap f w‖) U z := by + intro w hw + change ‖liftMap f w‖ ≤ ‖liftMap f z‖ + rw [he] + exact (liftMap_apply f ⟨w,hw⟩) ▸ hf.1.2 ⟨w,hw⟩ + have hh := Complex.norm_eqOn_of_isPreconnected_of_isMaxOn hc hU hf.1.1 hz hm a.property + simp [liftMap_apply,hf.2.1,he] at hh + +theorem exists_extremal_diskEmbedding {U : Set ℂ} (hUo : IsOpen U) + (hUc : IsSimplyConnected U) (hU : U ≠ univ) (a : U) : + ∃ f, IsDiskEmbedding U a f ∧ ∀ g, IsDiskEmbedding U a g → ‖deriv g a‖ ≤ ‖deriv f a‖ := by + have hc : IsPreconnected U := hUc.isPathConnected.isConnected.isPreconnected + obtain ⟨f₀,hf₀⟩ := exists_diskEmbedding hUo hUc hU a + let d₀ := ‖deriv f₀ a‖ + have hd₀ : 0 < d₀ := norm_pos_iff.2 (hf₀.2.2.2 a a.property) + have hnon : (markedEmbeddings U a d₀).Nonempty := + ⟨continuousRestriction f₀ hf₀.differentiableOn.continuousOn,hf₀.restriction_mem hUo a le_rfl⟩ + obtain ⟨f,hf,hmax⟩ := (markedEmbeddings_compact hUo hc a hd₀).exists_isMaxOn hnon + ((derivative_continuousOn hUo a).norm.mono (fun _ hx => hx.1)) + refine ⟨liftMap f,markedEmbeddings_isDiskEmbedding hUo hc a hf,fun g hg => ?_⟩ + by_contra! hh + have hgd : d₀ ≤ ‖deriv g a‖ := hf.2.2.2.2.trans hh.le + have hgmem := hg.restriction_mem hUo a hgd + have he := hmax hgmem + change ‖deriv (liftMap (continuousRestriction g hg.differentiableOn.continuousOn)) a‖ ≤ ‖deriv (liftMap f) a‖ at he + rw [deriv_lift_restriction hUo _ a.property] at he + exact (not_le_of_gt hh) he + +lemma diskAuto_comp_deriv {c : ℂ} {f : ℂ → ℂ} {z : ℂ} + (hc : ‖c‖ < 1) (hf : DifferentiableAt ℂ f z) (hz : ‖f z‖ < 1) : + deriv (diskAuto c ∘ f) z = deriv (diskAuto c) (f z)*deriv f z := + ((diskAuto_hasDerivAt hc hz).differentiableAt.hasDerivAt.comp z hf.hasDerivAt).deriv + +lemma square_root_boost_real {x t : ℝ} (hx : 0 < x) (hx1 : x < 1) (ht : 0 < t) : + t < (1/(1-x^2))*(((1-(x^2)^2)*t)/(2*x)) := by + have hden : 0 < (1-x^2)*(2*x) := mul_pos (by nlinarith) (by positivity) + have he : (1/(1-x^2))*(((1-(x^2)^2)*t)/(2*x)) = + ((1-(x^2)^2)*t)/((1-x^2)*(2*x)) := by + field_simp + rw [he,lt_div_iff₀ hden] + have hpos : 0 < (1-x^2)*(1-x)^2*t := by + exact mul_pos (mul_pos (by nlinarith) (sq_pos_of_ne_zero (by linarith))) ht + nlinarith + +theorem exists_diskEmbedding_improved {U : Set ℂ} (hUo : IsOpen U) + (hUc : IsSimplyConnected U) (a : U) {f : ℂ → ℂ} + (hf : IsDiskEmbedding U a f) {b : ℂ} (hb : b ∈ ball 0 1) (homit : b ∉ f '' U) : + ∃ q, IsDiskEmbedding U a q ∧ ‖deriv f a‖ < ‖deriv q a‖ := by + have hbn : ‖b‖ < 1 := mem_ball_zero_iff.1 hb + let H := diskAuto b ∘ f + have hHmap : MapsTo H U (ball 0 1) := (diskAuto_mapsTo hbn).comp hf.1 + have hHinj : InjOn H U := (diskAuto_injOn hbn).comp hf.2.2.1 hf.1 + have hHder (z : ℂ) (hz : z ∈ U) : + deriv H z = deriv (diskAuto b) (f z)*deriv f z := + diskAuto_comp_deriv hbn (differentiableAt_of_deriv_ne_zero (hf.2.2.2 z hz)) + (mem_ball_zero_iff.1 (hf.1 hz)) + have hHnd (z : ℂ) (hz : z ∈ U) : deriv H z ≠ 0 := by + rw [hHder z hz] + exact mul_ne_zero (diskAuto_deriv_ne hbn (mem_ball_zero_iff.1 (hf.1 hz))) (hf.2.2.2 z hz) + have hHd : DifferentiableOn ℂ H U := fun z hz => + (differentiableAt_of_deriv_ne_zero (hHnd z hz)).differentiableWithinAt + have hHnz (z : ℂ) (hz : z ∈ U) : H z ≠ 0 := by + intro he + have hh : f z = b := (diskAuto_injOn hbn) (hf.1 hz) hb (he.trans (diskAuto_self b).symm) + exact homit ⟨z,hz,hh⟩ + have hnot : 0 ∉ H '' U := by + rintro ⟨z,hz,he⟩ + exact hHnz z hz he + obtain ⟨g,hgc,hgsq⟩ := Complex.exists_continuousOn_pow_eq hUc hUo hHd.continuousOn hnot two_ne_zero + have hgnz (z : ℂ) (hz : z ∈ U) : g z ≠ 0 := by + intro he + exact hHnz z hz (by simpa [he] using (hgsq z).symm) + have hgmap : MapsTo g U (ball 0 1) := by + intro z hz + rw [mem_ball_zero_iff] + have he := congrArg norm (hgsq z) + rw [norm_pow] at he + have hh := mem_ball_zero_iff.1 (hHmap hz) + nlinarith [norm_nonneg (g z)] + have hgder (z : ℂ) (hz : z ∈ U) : HasDerivAt g (deriv H z/(2*g z)) z := by + apply HasDerivAt.of_comp_left (hgc.continuousAt (hUo.mem_nhds hz)) + (show HasDerivAt (fun w : ℂ => w^2) (2*g z) (g z) by simpa using hasDerivAt_pow 2 (g z)) + (differentiableAt_of_deriv_ne_zero (hHnd z hz)).hasDerivAt + (mul_ne_zero two_ne_zero (hgnz z hz)) + exact .of_forall hgsq + have hgnd (z : ℂ) (hz : z ∈ U) : deriv g z ≠ 0 := by + rw [(hgder z hz).deriv] + exact div_ne_zero (hHnd z hz) (mul_ne_zero two_ne_zero (hgnz z hz)) + have hginj : InjOn g U := by + intro z hz w hw he + apply hHinj hz hw + rw [← hgsq z,← hgsq w,he] + let c := g a + have hcn : ‖c‖ < 1 := mem_ball_zero_iff.1 (hgmap a.property) + have hcp : 0 < ‖c‖ := norm_pos_iff.2 (hgnz a a.property) + let q := diskAuto c ∘ g + have hqder (z : ℂ) (hz : z ∈ U) : + deriv q z = deriv (diskAuto c) (g z)*deriv g z := + diskAuto_comp_deriv hcn (hgder z hz).differentiableAt (mem_ball_zero_iff.1 (hgmap hz)) + have hq : IsDiskEmbedding U a q := by + refine ⟨(diskAuto_mapsTo hcn).comp hgmap,?_,(diskAuto_injOn hcn).comp hginj hgmap,?_⟩ + · exact diskAuto_self c + · intro z hz + rw [hqder z hz] + exact mul_ne_zero (diskAuto_deriv_ne hcn (mem_ball_zero_iff.1 (hgmap hz))) (hgnd z hz) + refine ⟨q,hq,?_⟩ + have hcnorm : ‖c‖^2 = ‖b‖ := by + have he := congrArg norm (hgsq a) + simpa [H,Function.comp_def,hf.2.1,c] using he + have hHnorm : ‖deriv H a‖ = (1-‖b‖^2)*‖deriv f a‖ := by + rw [hHder a a.property,norm_mul,hf.2.1,diskAuto_norm_deriv_zero hbn] + have hgnorm : ‖deriv g a‖ = ((1-‖b‖^2)*‖deriv f a‖)/(2*‖c‖) := by + rw [(hgder a a.property).deriv,norm_div,norm_mul,hHnorm] + norm_num [c] + have hqnorm : ‖deriv q a‖ = (1/(1-‖c‖^2))*(((1-(‖c‖^2)^2)*‖deriv f a‖)/(2*‖c‖)) := by + rw [hqder a a.property,norm_mul] + change ‖deriv (diskAuto c) c‖*‖deriv g a‖ = _ + rw [diskAuto_norm_deriv_self hcn,hgnorm,← hcnorm] + rw [hqnorm] + exact square_root_boost_real hcp hcn (norm_pos_iff.2 (hf.2.2.2 a a.property)) + +end SLEExactGauge.SlitMaps + +end + +end + +section +noncomputable section +open Set Filter Metric Function +open scoped Topology +namespace SLEExactGauge.SlitMaps + +theorem exists_biholomorphic_unitDisk {U : Set ℂ} (hUo : IsOpen U) + (hUc : IsSimplyConnected U) (hU : U ≠ univ) : + ∃ f g : ℂ → ℂ, + MapsTo f U (ball 0 1) ∧ MapsTo g (ball 0 1) U ∧ + (∀ z ∈ U, g (f z) = z) ∧ (∀ z ∈ ball (0:ℂ) 1, f (g z) = z) ∧ + DifferentiableOn ℂ f U ∧ DifferentiableOn ℂ g (ball (0:ℂ) 1) := by + obtain ⟨a,ha⟩ := hUc.nonempty + obtain ⟨f,hf,hmax⟩ := exists_extremal_diskEmbedding hUo hUc hU ⟨a,ha⟩ + have hsurj : SurjOn f U (ball 0 1) := by + intro b hb + by_contra homit + obtain ⟨q,hq,hstrict⟩ := exists_diskEmbedding_improved hUo hUc ⟨a,ha⟩ hf hb homit + exact (not_le_of_gt hstrict) (hmax q hq) + let g := invFunOn f U + have hgmap : MapsTo g (ball 0 1) U := hsurj.mapsTo_invFunOn + have hleft : ∀ z ∈ U, g (f z) = z := hf.2.2.1.leftInvOn_invFunOn + have hright : ∀ z ∈ ball (0:ℂ) 1, f (g z) = z := hsurj.rightInvOn_invFunOn + refine ⟨f,g,hf.1,hgmap,hleft,hright,hf.differentiableOn,?_⟩ + intro z hz + have hgU := hgmap hz + have hd := (hf.differentiableOn.analyticOnNhd hUo (g z) hgU).hasStrictDerivAt + have he : ∀ᶠ w in 𝓝 (g z), g (f w) = w := by + filter_upwards [hUo.mem_nhds hgU] with w hw + exact hleft w hw + have hgd := hd.to_local_left_inverse (hf.2.2.2 (g z) hgU) he + rw [hright z hz] at hgd + exact hgd.hasDerivAt.differentiableAt.differentiableWithinAt + +end SLEExactGauge.SlitMaps + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/SobolevMeans.lean b/lean/OAI/Probability/SLELocalization/SobolevMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..2971fc3182bb4bc31d32cf529f76b3cad9535bc7 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/SobolevMeans.lean @@ -0,0 +1,940 @@ +import Mathlib +import OAI.Probability.SLELocalization.DyadicKernels + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +section Measure +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] + +theorem dyadic_weighted_energy {Q : ℕ → Set α} (hQ : ∀ j, MeasurableSet (Q j)) + {g : α → ℝ} (hg : MemLp g 2 μ) {V : ℝ} (n : ℕ) + (harea : ∀ j < n, ((2:ℝ)^j)^2*μ.real (Q j) ≤ V) : + (∫ x, dyadicKernel Q n x*g x ∂μ)^2 ≤ + 3*(n:ℝ)*V*(∫ x, (g x)^2 ∂μ) := by + exact (integral_mul_square_le (dyadicKernel_memLp hQ n) hg).trans + (mul_le_mul_of_nonneg_right (dyadicKernel_square_energy hQ n harea) + (integral_nonneg (fun x => sq_nonneg _))) + +omit [IsFiniteMeasure μ] in +lemma dyadicKernel_integral_mul {Q : ℕ → Set α} (hQ : ∀ j, MeasurableSet (Q j)) + {g : α → ℝ} (hg : Integrable g μ) (n : ℕ) : + (∫ x, dyadicKernel Q n x*g x ∂μ) = + ∑ j ∈ Finset.range n, (2:ℝ)^j*(∫ x in Q j, g x ∂μ) := by + have he : (fun x => dyadicKernel Q n x*g x) = + fun x => ∑ j ∈ Finset.range n, (Q j).indicator (fun x => (2:ℝ)^j*g x) x := by + funext x + rw [dyadicKernel,Finset.sum_mul] + apply Finset.sum_congr rfl + intro j hj + by_cases hx : x ∈ Q j <;> simp [hx] + rw [he,integral_finsetSum _ (fun j hj => (hg.const_mul _).indicator (hQ j))] + apply Finset.sum_congr rfl + intro j hj + rw [integral_indicator (hQ j),integral_const_mul] + +omit [IsFiniteMeasure μ] in +lemma dyadic_L1_telescoping {Q : ℕ → Set α} {g : α → ℝ} {v : ℕ → ℝ} + {C : ℝ} (hstep : ∀ j, |v (j+1)-v j| ≤ C*(2:ℝ)^j*(∫ x in Q j, g x ∂μ)) + (n : ℕ) : |v n-v 0| ≤ C*∑ j ∈ Finset.range n, (2:ℝ)^j*(∫ x in Q j, g x ∂μ) := by + induction n with + | zero => simp + | succ n ih => + calc + _ ≤ |v (n+1)-v n|+|v n-v 0| := abs_sub_le _ _ _ + _ ≤ C*(2:ℝ)^n*(∫ x in Q n, g x ∂μ)+ + C*∑ j ∈ Finset.range n, (2:ℝ)^j*(∫ x in Q j, g x ∂μ) := add_le_add (hstep n) ih + _ = _ := by rw [Finset.sum_range_succ]; ring + +theorem critical_means_from_L1 {Q : ℕ → Set α} (hQ : ∀ j, MeasurableSet (Q j)) + {g : α → ℝ} (hg : MemLp g 2 μ) (hg0 : ∀ᵐ x ∂μ, 0 ≤ g x) + {v : ℕ → ℝ} {C V : ℝ} (hC : 0 ≤ C) + (hstep : ∀ j, |v (j+1)-v j| ≤ C*(2:ℝ)^j*(∫ x in Q j, g x ∂μ)) + (n : ℕ) (harea : ∀ j < n, ((2:ℝ)^j)^2*μ.real (Q j) ≤ V) : + (v n-v 0)^2 ≤ 3*C^2*(n:ℝ)*V*(∫ x, (g x)^2 ∂μ) := by + have hi := hg.integrable (by norm_num : (1:ℝ≥0∞) ≤ 2) + have hb := dyadic_L1_telescoping hstep n + rw [← dyadicKernel_integral_mul hQ hi n] at hb + have hn : 0 ≤ ∫ x, dyadicKernel Q n x*g x ∂μ := by + apply integral_nonneg_of_ae + filter_upwards [hg0] with x hx + apply mul_nonneg _ hx + apply Finset.sum_nonneg + intro j hj + exact indicator_nonneg (fun x hx => by positivity) x + have hs := (sq_le_sq₀ (abs_nonneg _) (mul_nonneg hC hn)).2 hb + rw [sq_abs,mul_pow] at hs + calc + _ ≤ C^2*(∫ x, dyadicKernel Q n x*g x ∂μ)^2 := hs + _ ≤ C^2*(3*(n:ℝ)*V*(∫ x, (g x)^2 ∂μ)) := + mul_le_mul_of_nonneg_left (dyadic_weighted_energy hQ hg n harea) (sq_nonneg _) + _ = _ := by ring + +end Measure + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma rectangle_measure_restrict {a b c d a' b' c' d' : ℝ} + (haa : a ≤ a') (hbb : b' ≤ b) (hcc : c ≤ c') (hdd : d' ≤ d) : + ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))).restrict + ((Ioc a' b').prod (Ioc c' d')) = + (volume.restrict (Ioc a' b')).prod (volume.restrict (Ioc c' d')) := by + rw [Measure.prod_restrict,Measure.prod_restrict] + have hs : (Ioc a' b').prod (Ioc c' d') ⊆ (Ioc a b).prod (Ioc c d) := by + rintro p ⟨hx,hy⟩ + exact ⟨⟨haa.trans_lt hx.1,hx.2.trans hbb⟩,⟨hcc.trans_lt hy.1,hy.2.trans hdd⟩⟩ + exact Measure.restrict_restrict_of_subset hs + +lemma rectangle_measure_real {a b c d a' b' c' d' : ℝ} + (hab : a' ≤ b') (hcd : c' ≤ d') + (haa : a ≤ a') (hbb : b' ≤ b) (hcc : c ≤ c') (hdd : d' ≤ d) : + ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))).real + ((Ioc a' b').prod (Ioc c' d')) = (b'-a')*(d'-c') := by + rw [Measure.real] + have he := congrArg (fun μ : Measure (ℝ × ℝ) => μ univ) + (rectangle_measure_restrict haa hbb hcc hdd) + simp only [Measure.restrict_apply_univ] at he + rw [he,← univ_prod_univ,Measure.prod_prod] + simp only [Measure.restrict_apply_univ,Real.volume_Ioc,ENNReal.toReal_mul] + rw [ENNReal.toReal_ofReal (sub_nonneg.2 hab),ENNReal.toReal_ofReal (sub_nonneg.2 hcd)] + +theorem strip_nested_means {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + (a b c d : ℕ → ℝ) (hab : ∀ j, a j < b j) (hcd : ∀ j, c j < d j) + (hlo : 0 ≤ c 0) (hhi : d 0 ≤ Real.pi) + (haa : ∀ j, a j ≤ a (j+1)) (hbb : ∀ j, b (j+1) ≤ b j) + (hcc : ∀ j, c j ≤ c (j+1)) (hdd : ∀ j, d (j+1) ≤ d j) + (hw : ∀ j, b j-a j = (b 0-a 0)/(2:ℝ)^j) + (hh : ∀ j, d j-c j = (d 0-c 0)/(2:ℝ)^j) (n : ℕ) : + ((∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb (a n) (b n)).prod (intervalProb (c n) (d n)))- + (∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb (a 0) (b 0)).prod (intervalProb (c 0) (d 0))))^2 ≤ + 3*(2/(d 0-c 0)+1/(b 0-a 0))^2*(n:ℝ)*(b 0-a 0)*(d 0-c 0)* + (∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + ∂(volume.restrict (Ioc (a 0) (b 0))).prod (volume.restrict (Ioc (c 0) (d 0)))) := by + let μ := (volume.restrict (Ioc (a 0) (b 0))).prod (volume.restrict (Ioc (c 0) (d 0))) + let Q := fun j => (Ioc (a j) (b j)).prod (Ioc (c j) (d j)) + let g := fun p : ℝ × ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖ + let v := fun j => ∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb (a j) (b j)).prod (intervalProb (c j) (d j)) + let C := 2/(d 0-c 0)+1/(b 0-a 0) + have ha0 (j : ℕ) : a 0 ≤ a j := (monotone_nat_of_le_succ haa) (Nat.zero_le j) + have hb0 (j : ℕ) : b j ≤ b 0 := (antitone_nat_of_succ_le hbb) (Nat.zero_le j) + have hc0 (j : ℕ) : c 0 ≤ c j := (monotone_nat_of_le_succ hcc) (Nat.zero_le j) + have hd0 (j : ℕ) : d j ≤ d 0 := (antitone_nat_of_succ_le hdd) (Nat.zero_le j) + have hC : 0 ≤ C := by + have hw0 := sub_pos.2 (hab 0) + have hh0 := sub_pos.2 (hcd 0) + dsimp [C]; positivity + have hstep (j : ℕ) : |v (j+1)-v j| ≤ C*(2:ℝ)^j*(∫ p in Q j, g p ∂μ) := by + have hlen : d j-c j ≤ 2*(d (j+1)-c (j+1)) := by rw [hh j,hh (j+1),pow_succ]; exact le_of_eq (by ring) + have ht := strip_rectangle_poincare hF hinj hext hcont hH hr q + (hab j) (hcd j) (hab (j+1)) (hcd (j+1)) (hlo.trans (hc0 j)) ((hd0 j).trans hhi) + (haa j) (hbb j) (hcc j) (hdd j) (show (0:ℝ) ≤ 2 by norm_num) hlen + change |v (j+1)-v j| ≤ _ at ht + have he : 2/(d j-c j)+1/(b j-a j) = C*(2:ℝ)^j := by + rw [hw j,hh j] + dsimp [C] + field_simp + rw [he] at ht + simpa only [Q,μ,rectangle_measure_restrict (ha0 j) (hb0 j) (hc0 j) (hd0 j)] using ht + have harea (j : ℕ) (hj : j < n) : ((2:ℝ)^j)^2*μ.real (Q j) ≤ (b 0-a 0)*(d 0-c 0) := by + rw [rectangle_measure_real (hab j).le (hcd j).le (ha0 j) (hb0 j) (hc0 j) (hd0 j)] + rw [hw j,hh j] + exact le_of_eq (by field_simp) + have ht := critical_means_from_L1 (μ := μ) (Q := Q) + (fun j => measurableSet_Ioc.prod measurableSet_Ioc) + (strip_gradient_rect_memLp hF hinj hext hH hr q (a 0) (b 0) hlo hhi) + (ae_of_all _ (fun p => norm_nonneg _)) hC hstep n harea + dsimp only [v,C,g] at ht + convert ht using 1 + ring + +lemma rectangle_measure_total {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) : + ((volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))).real univ = + (b-a)*(d-c) := by + rw [Measure.real,← univ_prod_univ,Measure.prod_prod] + simp only [Measure.restrict_apply_univ,Real.volume_Ioc,ENNReal.toReal_mul] + rw [ENNReal.toReal_ofReal (sub_nonneg.2 hab),ENNReal.toReal_ofReal (sub_nonneg.2 hcd)] + +theorem strip_parent_energy {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {a b c d a' b' c' d' : ℝ} + (hab : a < b) (hcd : c < d) (hab' : a' < b') (hcd' : c' < d') + (hlo : 0 ≤ c) (hhi : d ≤ Real.pi) + (haa : a ≤ a') (hbb : b' ≤ b) (hcc : c ≤ c') (hdd : d' ≤ d) + (hlen : d-c ≤ 2*(d'-c')) : + ((∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a' b').prod (intervalProb c' d'))- + (∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a b).prod (intervalProb c d)))^2 ≤ + (2/(d-c)+1/(b-a))^2*(b-a)*(d-c)* + (∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + have hp := strip_rectangle_poincare hF hinj hext hcont hH hr q hab hcd hab' hcd' + hlo hhi haa hbb hcc hdd (show (0:ℝ) ≤ 2 by norm_num) hlen + have hcoef : 0 ≤ 2/(d-c)+1/(b-a) := by + have hb := sub_pos.2 hab + have hd := sub_pos.2 hcd + positivity + have hE := strip_gradient_rect_memLp hF hinj hext hH hr q a b hlo hhi + have hi : 0 ≤ ∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖ + ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d)) := integral_nonneg (fun _ => norm_nonneg _) + have hs := (sq_le_sq₀ (abs_nonneg _) (mul_nonneg hcoef hi)).2 hp + rw [sq_abs,mul_pow] at hs + have hc := integral_mul_square_le (memLp_const (1:ℝ)) hE + simp only [one_mul,one_pow,integral_const,smul_eq_mul,mul_one, + rectangle_measure_total hab.le hcd.le] at hc + exact hs.trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hc (sq_nonneg (2/(d-c)+1/(b-a)))) + +lemma rectangleProb_integral {a b c d : ℝ} (hab : a ≤ b) (hcd : c ≤ d) + (f : ℝ × ℝ → ℝ) : + (∫ p, f p ∂(intervalProb a b).prod (intervalProb c d)) = + ((b-a)*(d-c))⁻¹*(∫ p, f p ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc c d))) := by + rw [intervalProb,intervalProb,Measure.prod_smul_left,Measure.prod_smul_right, + integral_smul_measure,integral_smul_measure,ENNReal.toReal_inv,ENNReal.toReal_inv, + ENNReal.toReal_ofReal (sub_nonneg.2 hab),ENNReal.toReal_ofReal (sub_nonneg.2 hcd)] + simp only [smul_eq_mul,mul_inv_rev] + ring + +theorem strip_negative_mean {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) (hη0 : η 0 = 0) + (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + {a b : ℝ} (hab : a < b) (hb : b ≤ 0) : + (∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a b).prod (intervalProb 0 Real.pi))^2 ≤ + (Real.pi/(b-a))*(∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) + ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + ∂(volume.restrict (Ioc a b)).prod (volume.restrict (Ioc (0:ℝ) Real.pi))) := by + let u := fun p : ℝ × ℝ => stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + let G := fun p : ℝ × ℝ => ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + let μ := intervalProb a b + let ν := intervalProb 0 Real.pi + let : IsProbabilityMeasure μ := intervalProb_isProbability hab + let : IsProbabilityMeasure ν := intervalProb_isProbability Real.pi_pos + have hu := strip_potential_mean_integrable hcont hH.le hr q hab Real.pi_pos le_rfl le_rfl + have hu2 : MemLp u 2 (μ.prod ν) := MemLp.of_bound hu.aestronglyMeasurable H (ae_of_all _ (fun p => by + have hh := sphereTruncation_bounds hH.le hr q (Fbar (Complex.exp ((p.1:ℂ)+(p.2:ℂ)*Complex.I))) + change ‖stripPotential H q r Fbar _‖ ≤ H + rw [Real.norm_eq_abs,stripPotential,abs_of_nonneg hh.1] + exact hh.2)) + have hG := (strip_gradient_rect_memLp hF hinj hext hH hr q a b le_rfl le_rfl).integrable_sq + have hR := hG.integral_prod_left + have hRμ : Integrable (fun v => ∫ φ in Ioc (0:ℝ) Real.pi, G (v,φ)) μ := + integrable_intervalProb hab hR + have hbound : ∀ᵐ p ∂μ.prod ν, u p^2 ≤ + Real.pi*(∫ φ in Ioc (0:ℝ) Real.pi, G (p.1,φ)) := by + have hn := strip_negative_section_energy hF hinj hext hcont hH hr q hη hη0 hη1 hηH haccess + have hv : ∀ᵐ v ∂μ, ∀ φ ∈ Ioc (0:ℝ) Real.pi, u (v,φ)^2 ≤ + Real.pi*(∫ ψ in Ioc (0:ℝ) Real.pi, G (v,ψ)) := by + apply intervalProb_ae.mpr + filter_upwards [ae_restrict_of_ae hn, + ae_restrict_mem measurableSet_Ioc,show ∀ᵐ v ∂volume.restrict (Ioc a b), v ≠ (0:ℝ) from + ae_restrict_of_ae (volume.ae_ne 0)] with v hv hvab hv0 + intro φ hφ + have hvneg : v < 0 := lt_of_le_of_ne (hvab.2.trans hb) hv0 + have hh := hv hvneg φ ⟨hφ.1.le,hφ.2⟩ + rw [intervalIntegral.integral_of_le Real.pi_pos.le] at hh + exact hh + have hφ : ∀ᵐ φ ∂ν, φ ∈ Ioc (0:ℝ) Real.pi := intervalProb_ae.mpr (ae_restrict_mem measurableSet_Ioc) + filter_upwards [Measure.quasiMeasurePreserving_fst.ae hv, + Measure.quasiMeasurePreserving_snd.ae hφ] with p hp hpφ + exact hp p.2 hpφ + have hmono := integral_mono_ae hu2.integrable_sq ((hRμ.comp_fst ν).const_mul Real.pi) hbound + have hj := integral_mul_square_le (memLp_const (1:ℝ)) hu2 + simp only [one_mul,one_pow,integral_const,Measure.real,measure_univ,ENNReal.toReal_one, + smul_eq_mul,mul_one,one_mul] at hj + refine hj.trans (hmono.trans_eq ?_) + rw [integral_const_mul] + rw [integral_fun_fst (fun v => ∫ φ in Ioc (0:ℝ) Real.pi, G (v,φ))] + simp only [Measure.real,measure_univ,ENNReal.toReal_one,one_smul] + rw [integral_intervalProb hab.le,intervalIntegral.integral_of_le hab.le] + rw [← integral_prod _ hG] + simp only [div_eq_mul_inv,mul_assoc] + +structure DRect where + a : ℝ + b : ℝ + c : ℝ + d : ℝ + hab : a < b + hcd : c < d + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +namespace DRect + +def closed (Q : DRect) : Set (ℝ × ℝ) := (Icc Q.a Q.b).prod (Icc Q.c Q.d) + +def cells (Q : DRect) : Set (ℝ × ℝ) := (Ioc Q.a Q.b).prod (Ioc Q.c Q.d) + +def measure (Q : DRect) : Measure (ℝ × ℝ) := + (volume.restrict (Ioc Q.a Q.b)).prod (volume.restrict (Ioc Q.c Q.d)) + +def halfLo (l r : ℝ) (s : Bool) : ℝ := if s then (l+r)/2 else l + +def halfHi (l r : ℝ) (s : Bool) : ℝ := if s then r else (l+r)/2 + +lemma half_bounds {l r : ℝ} (h : l < r) (s : Bool) : + l ≤ halfLo l r s ∧ halfLo l r s < halfHi l r s ∧ halfHi l r s ≤ r := by + cases s + · change l ≤ l ∧ l < (l+r)/2 ∧ (l+r)/2 ≤ r + refine ⟨le_rfl,?_,?_⟩ <;> linarith + · change l ≤ (l+r)/2 ∧ (l+r)/2 < r ∧ r ≤ r + refine ⟨?_,?_,le_rfl⟩ <;> linarith + +lemma half_length (l r : ℝ) (s : Bool) : halfHi l r s-halfLo l r s = (r-l)/2 := by + cases s <;> simp [halfLo,halfHi] <;> ring + +def child (Q : DRect) (s : Bool × Bool) : DRect where + a := halfLo Q.a Q.b s.1 + b := halfHi Q.a Q.b s.1 + c := halfLo Q.c Q.d s.2 + d := halfHi Q.c Q.d s.2 + hab := (half_bounds Q.hab s.1).2.1 + hcd := (half_bounds Q.hcd s.2).2.1 + +lemma child_bounds (Q : DRect) (s : Bool × Bool) : + Q.a ≤ (Q.child s).a ∧ (Q.child s).b ≤ Q.b ∧ + Q.c ≤ (Q.child s).c ∧ (Q.child s).d ≤ Q.d := + ⟨(half_bounds Q.hab s.1).1,(half_bounds Q.hab s.1).2.2, + (half_bounds Q.hcd s.2).1,(half_bounds Q.hcd s.2).2.2⟩ + +lemma child_width (Q : DRect) (s : Bool × Bool) : (Q.child s).b-(Q.child s).a = (Q.b-Q.a)/2 := half_length _ _ _ + +lemma child_height (Q : DRect) (s : Bool × Bool) : (Q.child s).d-(Q.child s).c = (Q.d-Q.c)/2 := half_length _ _ _ + +lemma child_closed_subset (Q : DRect) (s : Bool × Bool) : (Q.child s).closed ⊆ Q.closed := by + rintro p ⟨hx,hy⟩ + obtain ⟨ha,hb,hc,hd⟩ := Q.child_bounds s + exact ⟨⟨ha.trans hx.1,hx.2.trans hb⟩,⟨hc.trans hy.1,hy.2.trans hd⟩⟩ + +def chooseSide (l r x : ℝ) : Bool := decide ((l+r)/2 < x) + +lemma mem_chosen_half {l r x : ℝ} (hx : x ∈ Icc l r) : + x ∈ Icc (halfLo l r (chooseSide l r x)) (halfHi l r (chooseSide l r x)) := by + by_cases h : (l+r)/2 < x + · simp [chooseSide,h,halfLo,halfHi,h.le,hx.2] + · have hm : x ≤ (l+r)/2 := le_of_not_gt h + simp [chooseSide,h,halfLo,halfHi,hx.1,hm] + +def chooseChild (Q : DRect) (x : ℝ × ℝ) : Bool × Bool := + (chooseSide Q.a Q.b x.1,chooseSide Q.c Q.d x.2) + +lemma mem_chosen_child {Q : DRect} {x : ℝ × ℝ} (hx : x ∈ Q.closed) : + x ∈ (Q.child (Q.chooseChild x)).closed := + ⟨mem_chosen_half hx.1,mem_chosen_half hx.2⟩ + +end DRect + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def DIndex : ℕ → Type + | 0 => Unit + | n+1 => DIndex n × (Bool × Bool) + +instance dIndex_fintype (n : ℕ) : Fintype (DIndex n) := by + induction n with + | zero => exact inferInstanceAs (Fintype Unit) + | succ n ih => exact inferInstanceAs (Fintype (DIndex n × (Bool × Bool))) + +def dyadicRect (Q : DRect) : (n : ℕ) → DIndex n → DRect + | 0, _ => Q + | n+1, i => (dyadicRect Q n i.1).child i.2 + +def dParent (n : ℕ) (i : DIndex (n+1)) : DIndex n := i.1 + +def dFromBits (β : ℕ → Bool × Bool) : (n : ℕ) → DIndex n + | 0 => () + | n+1 => (dFromBits β n,β n) + +lemma dFromBits_congr {β β' : ℕ → Bool × Bool} (n : ℕ) (h : ∀ k < n, β k = β' k) : + dFromBits β n = dFromBits β' n := by + induction n with + | zero => rfl + | succ n ih => + change (dFromBits β n,β n) = (dFromBits β' n,β' n) + rw [ih (fun k hk => h k (Nat.lt_succ_of_lt hk)),h n (Nat.lt_succ_self n)] + +def dExtendBits : (n : ℕ) → DIndex n → (ℕ → Bool × Bool) + | 0, _ => fun _ => (false,false) + | n+1, i => Function.update (dExtendBits n i.1) n i.2 + +lemma dFromBits_extend (n : ℕ) (i : DIndex n) : dFromBits (dExtendBits n i) n = i := by + induction n with + | zero => cases i; rfl + | succ n ih => + change (dFromBits (Function.update (dExtendBits n i.1) n i.2) n, + Function.update (dExtendBits n i.1) n i.2 n) = i + rw [Function.update_self] + have he := dFromBits_congr n (β := Function.update (dExtendBits n i.1) n i.2) + (β' := dExtendBits n i.1) (fun k hk => Function.update_of_ne (Nat.ne_of_lt hk) _ _) + rw [he,ih i.1] + rfl + +lemma dyadicRect_width (Q : DRect) (n : ℕ) (i : DIndex n) : + (dyadicRect Q n i).b-(dyadicRect Q n i).a = (Q.b-Q.a)/(2:ℝ)^n := by + induction n with + | zero => simp [dyadicRect] + | succ n ih => rw [dyadicRect,DRect.child_width,ih,pow_succ]; ring + +lemma dyadicRect_height (Q : DRect) (n : ℕ) (i : DIndex n) : + (dyadicRect Q n i).d-(dyadicRect Q n i).c = (Q.d-Q.c)/(2:ℝ)^n := by + induction n with + | zero => simp [dyadicRect] + | succ n ih => rw [dyadicRect,DRect.child_height,ih,pow_succ]; ring + +lemma dyadicRect_bounds (Q : DRect) (n : ℕ) (i : DIndex n) : + Q.a ≤ (dyadicRect Q n i).a ∧ (dyadicRect Q n i).b ≤ Q.b ∧ + Q.c ≤ (dyadicRect Q n i).c ∧ (dyadicRect Q n i).d ≤ Q.d := by + induction n with + | zero => exact ⟨le_rfl,le_rfl,le_rfl,le_rfl⟩ + | succ n ih => + obtain ⟨ha,hb,hc,hd⟩ := ih i.1 + obtain ⟨ha',hb',hc',hd'⟩ := (dyadicRect Q n i.1).child_bounds i.2 + exact ⟨ha.trans ha',hb'.trans hb,hc.trans hc',hd'.trans hd⟩ + +def dPointBranch (Q : DRect) (x : ℝ × ℝ) : (n : ℕ) → DIndex n + | 0 => () + | n+1 => (dPointBranch Q x n,(dyadicRect Q n (dPointBranch Q x n)).chooseChild x) + +lemma dPointBranch_parent (Q : DRect) (x : ℝ × ℝ) (n : ℕ) : + dParent n (dPointBranch Q x (n+1)) = dPointBranch Q x n := rfl + +lemma dPointBranch_mem {Q : DRect} {x : ℝ × ℝ} (hx : x ∈ Q.closed) (n : ℕ) : + x ∈ (dyadicRect Q n (dPointBranch Q x n)).closed := by + induction n with + | zero => exact hx + | succ n ih => exact DRect.mem_chosen_child ih + +lemma probability_means_tendsto {α : Type*} [PseudoMetricSpace α] [MeasurableSpace α] + {u : α → ℝ} {S : Set α} {x : α} (hc : ContinuousWithinAt u S x) + (ν : ℕ → Measure α) [∀ n, IsProbabilityMeasure (ν n)] + (hi : ∀ n, Integrable u (ν n)) {e : ℕ → ℝ} (he : Tendsto e atTop (𝓝 0)) + (hs : ∀ n, ∀ᵐ p ∂ν n, p ∈ S ∧ dist p x ≤ e n) : + Tendsto (fun n => ∫ p, u p ∂ν n) atTop (𝓝 (u x)) := by + apply Metric.tendsto_nhds.2 + intro ε hε + obtain ⟨δ,hδ,hδ'⟩ := Metric.continuousWithinAt_iff.1 hc (ε/2) (half_pos hε) + filter_upwards [he.eventually (gt_mem_nhds hδ)] with n hn + have hb : ∀ᵐ p ∂ν n, ‖u p-u x‖ ≤ ε/2 := by + filter_upwards [hs n] with p hp + simpa only [dist_eq_norm] using (hδ' hp.1 (hp.2.trans_lt hn)).le + have hm := norm_integral_le_of_norm_le_const hb + rw [integral_sub (hi n) (integrable_const _)] at hm + simp only [integral_const,Measure.real,measure_univ,ENNReal.toReal_one,one_smul,mul_one] at hm + have hh : dist (∫ p, u p ∂ν n) (u x) ≤ ε/2 := by simpa only [dist_eq_norm] using hm + exact hh.trans_lt (by linarith) + +lemma rectangle_point_dist {a b c d : ℝ} {p x : ℝ × ℝ} + (hp : p ∈ (Icc a b).prod (Icc c d)) (hx : x ∈ (Icc a b).prod (Icc c d)) : + dist p x ≤ max (b-a) (d-c) := by + rw [Prod.dist_eq] + apply max_le_max + · rw [Real.dist_eq,abs_le] + constructor <;> linarith [hp.1.1,hp.1.2,hx.1.1,hx.1.2] + · rw [Real.dist_eq,abs_le] + constructor <;> linarith [hp.2.1,hp.2.2,hx.2.1,hx.2.2] + +theorem strip_rectangle_means_tendsto {Fbar : ℂ → OnePoint ℂ} + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) + (a b c d : ℕ → ℝ) (hab : ∀ n, a n < b n) (hcd : ∀ n, c n < d n) + (hlo : ∀ n, 0 ≤ c n) (hhi : ∀ n, d n ≤ Real.pi) + {x : ℝ × ℝ} (hx : ∀ n, x ∈ (Icc (a n) (b n)).prod (Icc (c n) (d n))) + (he : Tendsto (fun n => max (b n-a n) (d n-c n)) atTop (𝓝 0)) : + Tendsto (fun n => ∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb (a n) (b n)).prod (intervalProb (c n) (d n))) atTop + (𝓝 (stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I))) := by + let ν := fun n => (intervalProb (a n) (b n)).prod (intervalProb (c n) (d n)) + have (n : ℕ) : IsProbabilityMeasure (intervalProb (a n) (b n)) := intervalProb_isProbability (hab n) + have (n : ℕ) : IsProbabilityMeasure (intervalProb (c n) (d n)) := intervalProb_isProbability (hcd n) + let S := {p : ℝ × ℝ | 0 ≤ p.2 ∧ p.2 ≤ Real.pi} + have hu : ContinuousOn (fun p : ℝ × ℝ => stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I)) S := + (stripPotential_continuous hH hr q hcont).comp + ((Complex.continuous_ofReal.comp continuous_fst).add + ((Complex.continuous_ofReal.comp continuous_snd).mul_const _)).continuousOn + (by intro p hp; simpa [closedStrip,S] using hp) + have hxs : x ∈ S := ⟨(hlo 0).trans (hx 0).2.1,(hx 0).2.2.trans (hhi 0)⟩ + apply probability_means_tendsto (hu x hxs) ν + (fun n => strip_potential_mean_integrable hcont hH hr q (hab n) (hcd n) (hlo n) (hhi n)) he + intro n + have hmem {l r : ℝ} : ∀ᵐ y : ℝ ∂intervalProb l r, y ∈ Icc l r := + intervalProb_ae.2 ((ae_restrict_mem measurableSet_Ioc).mono (fun y hy => Ioc_subset_Icc_self hy)) + have hX := (Measure.quasiMeasurePreserving_fst (μ := intervalProb (a n) (b n)) + (ν := intervalProb (c n) (d n))).tendsto_ae.eventually hmem + have hY := (Measure.quasiMeasurePreserving_snd (μ := intervalProb (a n) (b n)) + (ν := intervalProb (c n) (d n))).tendsto_ae.eventually hmem + filter_upwards [hX,hY] with p hpx hpy + exact ⟨⟨(hlo n).trans hpy.1,hpy.2.trans (hhi n)⟩,rectangle_point_dist ⟨hpx,hpy⟩ (hx n)⟩ + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +variable (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) + +def stripMean (Q : DRect) : ℝ := + ∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb Q.a Q.b).prod (intervalProb Q.c Q.d) + +def stripEnergy (Q : DRect) : ℝ := + ∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 ∂Q.measure + +def rectCoefficient (Q : DRect) : ℝ := (2/(Q.d-Q.c)+1/(Q.b-Q.a))^2*(Q.b-Q.a)*(Q.d-Q.c) + +lemma rectCoefficient_pos (Q : DRect) : 0 < rectCoefficient Q := by + have hw := sub_pos.2 Q.hab + have hh := sub_pos.2 Q.hcd + unfold rectCoefficient + positivity + +lemma dyadicRect_coefficient (Q : DRect) (n : ℕ) (i : DIndex n) : + rectCoefficient (dyadicRect Q n i) = rectCoefficient Q := by + unfold rectCoefficient + rw [dyadicRect_width,dyadicRect_height] + have h2 : (2:ℝ)^n ≠ 0 := pow_ne_zero _ (by norm_num) + have hw : Q.b-Q.a ≠ 0 := (sub_pos.2 Q.hab).ne' + have hh : Q.d-Q.c ≠ 0 := (sub_pos.2 Q.hcd).ne' + field_simp + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +variable (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) +variable {H q r Fbar} + +theorem strip_dyadic_mean_critical {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (hH : 0 < H) (hr : 0 < r) (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) + (n : ℕ) (i : DIndex n) : + (stripMean H q r Fbar (dyadicRect Q n i)-stripMean H q r Fbar Q)^2 ≤ + 3*rectCoefficient Q*(n:ℝ)*stripEnergy H q r Fbar Q := by + let β := dExtendBits n i + let R := fun j => dyadicRect Q j (dFromBits β j) + have hR0 : R 0 = Q := rfl + have hRn : R n = dyadicRect Q n i := by dsimp [R,β]; rw [dFromBits_extend] + have hRstep (j : ℕ) : R (j+1) = (R j).child (β j) := rfl + have hb (j : ℕ) := (R j).child_bounds (β j) + have ht := strip_nested_means hF hinj hext hcont hH hr q + (fun j => (R j).a) (fun j => (R j).b) (fun j => (R j).c) (fun j => (R j).d) + (fun j => (R j).hab) (fun j => (R j).hcd) hlo hhi + (fun j => (hb j).1) (fun j => (hb j).2.1) (fun j => (hb j).2.2.1) (fun j => (hb j).2.2.2) + (fun j => dyadicRect_width Q j (dFromBits β j)) + (fun j => dyadicRect_height Q j (dFromBits β j)) n + change (stripMean H q r Fbar (R n)-stripMean H q r Fbar (R 0))^2 ≤ _ at ht + rw [hR0,hRn] at ht + unfold stripEnergy rectCoefficient DRect.measure + convert ht using 1 + ring + +theorem strip_dyadic_mean_step {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (hH : 0 < H) (hr : 0 < r) (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) + (n : ℕ) (i : DIndex (n+1)) : + (stripMean H q r Fbar (dyadicRect Q (n+1) i)-stripMean H q r Fbar (dyadicRect Q n (dParent n i)))^2 ≤ + rectCoefficient Q*stripEnergy H q r Fbar (dyadicRect Q n (dParent n i)) := by + let R := dyadicRect Q n i.1 + obtain ⟨ha,hb,hc,hd⟩ := dyadicRect_bounds Q n i.1 + obtain ⟨ha',hb',hc',hd'⟩ := R.child_bounds i.2 + have hl : R.d-R.c ≤ 2*((R.child i.2).d-(R.child i.2).c) := by rw [DRect.child_height]; linarith + have ht := strip_parent_energy hF hinj hext hcont hH hr q R.hab R.hcd + (R.child i.2).hab (R.child i.2).hcd (hlo.trans hc) (hd.trans hhi) ha' hb' hc' hd' hl + change (stripMean H q r Fbar (R.child i.2)-stripMean H q r Fbar R)^2 ≤ + rectCoefficient R*stripEnergy H q r Fbar R at ht + rw [dyadicRect_coefficient] at ht + exact ht + +theorem strip_dyadic_mean_limit + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + (hH : 0 ≤ H) (hr : 0 < r) (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) + {x : ℝ × ℝ} (hx : x ∈ Q.closed) : + Tendsto (fun n => stripMean H q r Fbar (dyadicRect Q n (dPointBranch Q x n))) atTop + (𝓝 (stripPotential H q r Fbar ((x.1:ℂ)+(x.2:ℂ)*Complex.I))) := by + let R := fun n => dyadicRect Q n (dPointBranch Q x n) + have hb (n : ℕ) := dyadicRect_bounds Q n (dPointBranch Q x n) + apply strip_rectangle_means_tendsto hcont hH hr q + (fun n => (R n).a) (fun n => (R n).b) (fun n => (R n).c) (fun n => (R n).d) + (fun n => (R n).hab) (fun n => (R n).hcd) + (fun n => hlo.trans (hb n).2.2.1) (fun n => (hb n).2.2.2.trans hhi) + (fun n => dPointBranch_mem hx n) + have h2 := tendsto_inv_atTop_zero.comp (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1:ℝ) < 2)) + have hw : Tendsto (fun n => (R n).b-(R n).a) atTop (𝓝 0) := by + simpa only [R,dyadicRect_width,div_eq_mul_inv,mul_zero,Function.comp_def] using tendsto_const_nhds.mul h2 + have hh : Tendsto (fun n => (R n).d-(R n).c) atTop (𝓝 0) := by + simpa only [R,dyadicRect_height,div_eq_mul_inv,mul_zero,Function.comp_def] using tendsto_const_nhds.mul h2 + simpa only [max_self] using hw.max hh + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +def totalStripEnergy (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) : ℝ := + ∫ p : ℝ × ℝ, ‖fderiv ℝ (stripPotential H q r Fbar) ((p.1:ℂ)+(p.2:ℂ)*Complex.I)‖^2 + ∂volume.prod (volume.restrict (Ioc (0:ℝ) Real.pi)) + +lemma totalStripEnergy_nonneg (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) : + 0 ≤ totalStripEnergy H q r Fbar := integral_nonneg (fun _ => sq_nonneg _) + +lemma totalStripEnergy_eq (H : ℝ) (q : ℂ) (r : ℝ) (Fbar : ℂ → OnePoint ℂ) : + totalStripEnergy H q r Fbar = ∫ z in openStrip, ‖fderiv ℝ (stripPotential H q r Fbar) z‖^2 := by + have he := (Complex.volume_preserving_equiv_real_prod.symm _).setIntegral_preimage_emb + Complex.measurableEquivRealProd.symm.measurableEmbedding + (fun z => ‖fderiv ℝ (stripPotential H q r Fbar) z‖^2) openStrip + have hs : Complex.measurableEquivRealProd.symm ⁻¹' openStrip = + (univ : Set ℝ).prod (Ioo (0:ℝ) Real.pi) := by + ext p + change (0 < p.2 ∧ p.2 < Real.pi) ↔ True ∧ (0 < p.2 ∧ p.2 < Real.pi) + simp + rw [hs] at he + change (∫ p : ℝ × ℝ, _ ∂(volume.prod volume).restrict ((univ : Set ℝ) ×ˢ Ioo (0:ℝ) Real.pi)) = _ at he + rw [← Measure.prod_restrict,Measure.restrict_univ,restrict_Ioo_eq_restrict_Ioc] at he + refine Eq.trans ?_ he + unfold totalStripEnergy + apply integral_congr_ae + exact ae_of_all _ (fun p => by + have hp : (p.1:ℂ)+(p.2:ℂ)*Complex.I = Complex.measurableEquivRealProd.symm p := by + apply Complex.ext <;> simp + dsimp only + rw [hp]) + + theorem totalStripEnergy_bound {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) : + totalStripEnergy H q r Fbar ≤ 2*Real.pi*H := by + have hi := strip_energy_integrable hF hinj hext hH hr q + have hb := strip_potential_energy hF hinj hext hH hr q + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun z => sq_nonneg _))] at hb + rw [totalStripEnergy_eq] + exact (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hb + +lemma stripEnergy_le_total {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + (Q : DRect) (hlo : 0 ≤ Q.c) (hhi : Q.d ≤ Real.pi) : + stripEnergy H q r Fbar Q ≤ totalStripEnergy H q r Fbar := by + have hi := strip_energy_integrable_prod hF hinj hext hH hr q + rw [restrict_Ioo_eq_restrict_Ioc] at hi + apply integral_mono_measure _ (ae_of_all _ (fun _ => sq_nonneg _)) hi + exact Measure.prod_mono Measure.restrict_le_self (Measure.restrict_mono_set _ + (fun y hy => ⟨hlo.trans_lt hy.1,hy.2.trans hhi⟩)) + +def unitSlab (j : ℝ) : DRect := ⟨j,j+1,0,Real.pi,by linarith,Real.pi_pos⟩ + +def longSlab (j : ℝ) (hj : 0 ≤ j) : DRect := ⟨-1,j+1,0,Real.pi,by linarith,Real.pi_pos⟩ + +def slabMeanCoefficient : ℝ := 3*(2*(2/Real.pi+1)^2*Real.pi+Real.pi) + +lemma slabMeanCoefficient_pos : 0 < slabMeanCoefficient := by + unfold slabMeanCoefficient + positivity + +lemma longSlab_coefficient (j : ℝ) (hj : 0 ≤ j) : + rectCoefficient (longSlab j hj) ≤ (2/Real.pi+1)^2*Real.pi*(j+2) := by + have hw : 1 ≤ j+2 := by linarith + have hi : 1/(j+2) ≤ 1 := (div_le_one (by linarith)).2 hw + unfold rectCoefficient longSlab + dsimp only + rw [sub_zero,show j+1-(-1)=j+2 by ring] + calc + _ ≤ (2/Real.pi+1)^2*(j+2)*Real.pi := by gcongr + _ = _ := by ring + +theorem negative_unitSlab_mean {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) (hη0 : η 0 = 0) + (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + (j : ℝ) (hj : j ≤ -1) : + (stripMean H q r Fbar (unitSlab j))^2 ≤ Real.pi*totalStripEnergy H q r Fbar := by + have hh := strip_negative_mean hF hinj hext hcont hH hr q hη hη0 hη1 hηH haccess + (a := j) (b := j+1) (by linarith) (by linarith) + change (stripMean H q r Fbar (unitSlab j))^2 ≤ + (Real.pi/(j+1-j))*stripEnergy H q r Fbar (unitSlab j) at hh + rw [show j+1-j=1 by ring,div_one] at hh + exact hh.trans (mul_le_mul_of_nonneg_left + (stripEnergy_le_total hF hinj hext hH hr q (unitSlab j) le_rfl le_rfl) Real.pi_pos.le) + +theorem positive_unitSlab_mean {F : ℂ → ℂ} + (hF : AnalyticOnNhd ℂ F {z : ℂ | 0 < z.im}) + (hinj : InjOn F {z : ℂ | 0 < z.im}) {Fbar : ℂ → OnePoint ℂ} + (hext : ∀ z, 0 < z.im → Fbar z = (F z : OnePoint ℂ)) + (hcont : ContinuousOn Fbar {z : ℂ | 0 ≤ z.im}) + {H r : ℝ} (hH : 0 < H) (hr : 0 < r) (q : ℂ) + {η : ℝ → ℂ} (hη : ContinuousOn η (Icc 0 1)) (hη0 : η 0 = 0) + (hη1 : ‖η 1‖ = 1) (hηH : ∀ t ∈ Icc 0 1, 0 ≤ (η t).im) + (haccess : ∀ t ∈ Icc 0 1, Fbar (η t) ∈ + (fun w : ℂ => (w : OnePoint ℂ)) '' closedBall q r) + (j : ℝ) (hj : 0 ≤ j) : + (stripMean H q r Fbar (unitSlab j))^2 ≤ + slabMeanCoefficient*(j+2)*totalStripEnergy H q r Fbar := by + let A := stripMean H q r Fbar (unitSlab j) + let B := stripMean H q r Fbar (unitSlab (-1)) + let M := stripMean H q r Fbar (longSlab j hj) + let E := totalStripEnergy H q r Fbar + let K := (2/Real.pi+1)^2*Real.pi + have hE : 0 ≤ E := totalStripEnergy_nonneg _ _ _ _ + have hK : 0 ≤ K := by dsimp [K]; positivity + have hEB := stripEnergy_le_total hF hinj hext hH hr q (longSlab j hj) le_rfl le_rfl + have hp (a' b' : ℝ) (hab' : a' < b') (haa : -1 ≤ a') (hbb : b' ≤ j+1) : + ((∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb a' b').prod (intervalProb 0 Real.pi))-M)^2 ≤ K*(j+2)*E := by + have hh := strip_parent_energy hF hinj hext hcont hH hr q + (a := -1) (b := j+1) (c := 0) (d := Real.pi) (a' := a') (b' := b') (c' := 0) (d' := Real.pi) + (by linarith) Real.pi_pos hab' Real.pi_pos le_rfl le_rfl haa hbb le_rfl le_rfl + (by linarith [Real.pi_pos]) + change (_-M)^2 ≤ rectCoefficient (longSlab j hj)*stripEnergy H q r Fbar (longSlab j hj) at hh + exact hh.trans (mul_le_mul (longSlab_coefficient j hj) hEB + (integral_nonneg (fun _ => sq_nonneg _)) (by positivity)) + have hA : (A-M)^2 ≤ K*(j+2)*E := hp j (j+1) (by linarith) (by linarith) le_rfl + have hB : (M-B)^2 ≤ K*(j+2)*E := by + have hh := hp (-1) 0 (by norm_num) le_rfl (by linarith) + have heB : B = ∫ p : ℝ × ℝ, stripPotential H q r Fbar ((p.1:ℂ)+(p.2:ℂ)*Complex.I) + ∂(intervalProb (-1) 0).prod (intervalProb 0 Real.pi) := by simp [B,stripMean,unitSlab] + rw [← heB] at hh + nlinarith + have hb : B^2 ≤ Real.pi*E := negative_unitSlab_mean hF hinj hext hcont hH hr q + hη hη0 hη1 hηH haccess (-1) le_rfl + have hb' : B^2 ≤ Real.pi*(j+2)*E := hb.trans (by nlinarith [mul_nonneg hE (mul_nonneg Real.pi_pos.le (show 0 ≤ j+1 by linarith))]) + have hsum : A^2 ≤ 3*((A-M)^2+(M-B)^2+B^2) := by + nlinarith [sq_nonneg ((A-M)-(M-B)),sq_nonneg ((A-M)-B),sq_nonneg ((M-B)-B)] + change A^2 ≤ slabMeanCoefficient*(j+2)*E + calc + _ ≤ 3*((A-M)^2+(M-B)^2+B^2) := hsum + _ ≤ 3*(K*(j+2)*E+K*(j+2)*E+Real.pi*(j+2)*E) := by gcongr + _ = _ := by dsimp [K,slabMeanCoefficient]; ring + +lemma complex_rectangle_diff_norm (Q : DRect) {x : ℝ × ℝ} (hx : x ∈ Q.closed) : + ‖((x.1:ℂ)+(x.2:ℂ)*Complex.I)-((Q.a:ℂ)+(Q.c:ℂ)*Complex.I)‖ ≤ + (Q.b-Q.a)+(Q.d-Q.c) := by + have hh := Complex.norm_le_abs_re_add_abs_im + (((x.1:ℂ)+(x.2:ℂ)*Complex.I)-((Q.a:ℂ)+(Q.c:ℂ)*Complex.I)) + change x.1 ∈ Icc Q.a Q.b ∧ x.2 ∈ Icc Q.c Q.d at hx + simp only [Complex.sub_re,Complex.sub_im,Complex.add_re,Complex.add_im, + Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.I_re,Complex.I_im,mul_zero,mul_one,sub_zero,zero_add,add_zero] at hh + rw [abs_of_nonneg (sub_nonneg.2 hx.1.1),abs_of_nonneg (sub_nonneg.2 hx.2.1)] at hh + linarith [hx.1.2,hx.2.2] + +lemma exp_difference_small {z w : ℂ} (hzw : ‖z-w‖ ≤ 1) : + ‖Complex.exp z-Complex.exp w‖ ≤ 2*‖z-w‖*Real.exp w.re := by + have he : Complex.exp z-Complex.exp w = (Complex.exp (z-w)-1)*Complex.exp w := by + rw [sub_mul,one_mul,← Complex.exp_add,sub_add_cancel] + rw [he,norm_mul,Complex.norm_exp] + exact mul_le_mul_of_nonneg_right (Complex.norm_exp_sub_one_le hzw) (Real.exp_pos _).le + +def expCellScale : ℝ := 4*(1+Real.pi)*Real.exp 1 + +lemma expCellScale_pos : 0 < expCellScale := by unfold expCellScale; positivity + +lemma expCellScale_ge : 1+Real.pi ≤ expCellScale := by + have he : 1 ≤ Real.exp 1 := Real.one_le_exp_iff.2 (by norm_num) + unfold expCellScale + nlinarith [Real.pi_pos] + +lemma dyadicCell_exp_geometry (j : ℝ) (n : ℕ) (i : DIndex n) + (hsmall : expCellScale/(2:ℝ)^n < 1/16) : + let Q := dyadicRect (unitSlab j) n i + let v := Complex.exp ((Q.a:ℂ)+(Q.c:ℂ)*Complex.I) + 0 ≤ v.im ∧ Real.exp j/2 ≤ ‖v‖ ∧ + ∀ x ∈ Q.closed, dist v (Complex.exp ((x.1:ℂ)+(x.2:ℂ)*Complex.I)) < + Real.exp j*(expCellScale/(2:ℝ)^n) := by + let Q := dyadicRect (unitSlab j) n i + have hb := dyadicRect_bounds (unitSlab j) n i + change j ≤ Q.a ∧ Q.b ≤ j+1 ∧ 0 ≤ Q.c ∧ Q.d ≤ Real.pi at hb + have hl : (Q.b-Q.a)+(Q.d-Q.c) = (1+Real.pi)/(2:ℝ)^n := by + rw [dyadicRect_width,dyadicRect_height] + simp only [unitSlab] + ring + have hc : Q.c ≤ Real.pi := Q.hcd.le.trans hb.2.2.2 + have hre : (((Q.a:ℂ)+(Q.c:ℂ)*Complex.I):ℂ).re = Q.a := by simp + have him : (((Q.a:ℂ)+(Q.c:ℂ)*Complex.I):ℂ).im = Q.c := by simp + dsimp only + change 0 ≤ (Complex.exp ((Q.a:ℂ)+(Q.c:ℂ)*Complex.I)).im ∧ _ + refine ⟨?_,?_,?_⟩ + · rw [Complex.exp_im,hre,him] + exact mul_nonneg (Real.exp_pos _).le (Real.sin_nonneg_of_mem_Icc ⟨hb.2.2.1,hc⟩) + · rw [Complex.norm_exp,hre] + have hh := Real.exp_le_exp.mpr hb.1 + linarith [Real.exp_pos j] + · intro x hx + have hd := complex_rectangle_diff_norm Q hx + rw [hl] at hd + have hge : (1+Real.pi)/(2:ℝ)^n ≤ expCellScale/(2:ℝ)^n := by + exact div_le_div_of_nonneg_right expCellScale_ge (by positivity) + have hdn : ‖((x.1:ℂ)+(x.2:ℂ)*Complex.I)-((Q.a:ℂ)+(Q.c:ℂ)*Complex.I)‖ ≤ 1 := by + linarith [hd.trans hge] + rw [dist_comm,dist_eq_norm] + have he := exp_difference_small hdn + rw [hre] at he + have hea : Real.exp Q.a ≤ Real.exp (j+1) := Real.exp_le_exp.mpr (Q.hab.le.trans hb.2.1) + calc + _ ≤ 2*‖((x.1:ℂ)+(x.2:ℂ)*Complex.I)-((Q.a:ℂ)+(Q.c:ℂ)*Complex.I)‖*Real.exp Q.a := he + _ ≤ 2*((1+Real.pi)/(2:ℝ)^n)*Real.exp (j+1) := by gcongr + _ < Real.exp j*(expCellScale/(2:ℝ)^n) := by + rw [Real.exp_add,expCellScale] + have hp : 0 < (1+Real.pi)/(2:ℝ)^n*Real.exp j*Real.exp 1 := by positivity + convert (show 2*((1+Real.pi)/(2:ℝ)^n*Real.exp j*Real.exp 1) < + 4*((1+Real.pi)/(2:ℝ)^n*Real.exp j*Real.exp 1) by linarith) using 1 <;> ring + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.BoundaryCutoff + +def clamp (σ ε : ℝ) (w : ℂ) : ℂ := ⟨σ*max (σ*w.re) ε,w.im⟩ + +def velocity (σ ε u : ℝ) (w : ℂ) : ℂ := 2/clamp σ ε (w-(u:ℂ)) + +lemma side_sq {σ : ℝ} (hσ : |σ| = 1) : σ*σ = 1 := by + have hh := sq_abs σ + rw [hσ] at hh + nlinarith + +lemma clamp_eq {σ ε : ℝ} (hσ : |σ| = 1) {w : ℂ} (hw : ε ≤ σ*w.re) : + clamp σ ε w = w := by + apply Complex.ext + · change σ*max (σ*w.re) ε = w.re + rw [max_eq_left hw,← mul_assoc,side_sq hσ,one_mul] + · rfl + +lemma clamp_norm {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) (w : ℂ) : ε ≤ ‖clamp σ ε w‖ := by + have hh : ε ≤ |(clamp σ ε w).re| := by + change ε ≤ |σ*max (σ*w.re) ε| + rw [abs_mul,hσ,one_mul,abs_of_nonneg (hε.le.trans (le_max_right _ _))] + exact le_max_right _ _ + exact hh.trans (Complex.abs_re_le_norm _) + +lemma clamp_ne_zero {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) (w : ℂ) : clamp σ ε w ≠ 0 := + norm_pos_iff.1 (hε.trans_le (clamp_norm hσ hε w)) + +lemma clamp_norm_sub {σ ε : ℝ} (hσ : |σ| = 1) (z w : ℂ) : + ‖clamp σ ε z-clamp σ ε w‖ ≤ 2*‖z-w‖ := by + have hm : |max (σ*z.re) ε-max (σ*w.re) ε| ≤ |σ*z.re-σ*w.re| := by + simpa only [sub_self,abs_zero,max_eq_left (abs_nonneg (σ*z.re-σ*w.re))] using + abs_max_sub_max_le_max (σ*z.re) ε (σ*w.re) ε + have hr : |(clamp σ ε z-clamp σ ε w).re| ≤ ‖z-w‖ := by + change |σ*max (σ*z.re) ε-σ*max (σ*w.re) ε| ≤ ‖z-w‖ + rw [← mul_sub,abs_mul,hσ,one_mul] + have he : |σ*z.re-σ*w.re| = |z.re-w.re| := by rw [← mul_sub,abs_mul,hσ,one_mul] + rw [he] at hm + exact hm.trans (by simpa using Complex.abs_re_le_norm (z-w)) + have hi : |(clamp σ ε z-clamp σ ε w).im| ≤ ‖z-w‖ := by + simpa [clamp] using Complex.abs_im_le_norm (z-w) + exact (Complex.norm_le_abs_re_add_abs_im _).trans (by linarith) + +lemma velocity_eq {σ ε u : ℝ} (hσ : |σ| = 1) {w : ℂ} (hw : ε ≤ σ*(w.re-u)) : + velocity σ ε u w = 2/(w-(u:ℂ)) := by + unfold velocity + rw [clamp_eq hσ (by simpa using hw)] + +lemma norm_velocity_le {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) (u : ℝ) (w : ℂ) : + ‖velocity σ ε u w‖ ≤ 2/ε := by + rw [velocity,norm_div,Complex.norm_ofNat] + exact div_le_div_of_nonneg_left (by norm_num) hε (clamp_norm hσ hε _) + +end SLEExactGauge.BoundaryCutoff + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/SpatialLimit.lean b/lean/OAI/Probability/SLELocalization/SpatialLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..4dfc159d4465a3ffc09c56141648b420315a8a0d --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/SpatialLimit.lean @@ -0,0 +1,46 @@ +import Mathlib +import OAI.Probability.SLELocalization.SlabMoments + +namespace OAI + + +/-! Conformal localization and Spatial Limit estimates. -/ + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.SpatialLimit + +lemma canonical_fiber_limit {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] + {P : Measure Ω} {ν : Measure Z} [SFinite P] [SFinite ν] + (X : ℕ → Ω × Z → ℝ) (hX : ∀ n, AEMeasurable (X n) (P.prod ν)) + (Y : Ω × Z → ℝ) + (hlim : ∀ᵐ z ∂ν, ∀ᵐ ω ∂P, Tendsto (fun n => X n (ω,z)) atTop (𝓝 (Y (ω,z)))) : + ∃ G : Ω × Z → ℝ, Measurable G ∧ + (∀ᵐ q ∂P.prod ν, Tendsto (fun n => X n q) atTop (𝓝 (G q))) ∧ + (∀ᵐ z ∂ν, ∀ᵐ ω ∂P, Y (ω,z) = G (ω,z)) := by + let F : ℕ → Ω × Z → ℝ := fun n => (hX n).mk (X n) + have hF (n : ℕ) : Measurable (F n) := (hX n).measurable_mk + let G : Ω × Z → ℝ := fun q => limUnder atTop (fun n => F n q) + have hG : Measurable G := (StronglyMeasurable.limUnder (fun n => (hF n).stronglyMeasurable)).measurable + have he : ∀ᵐ q ∂P.prod ν, ∀ n, X n q = F n q := + ae_all_iff.2 (fun n => (hX n).ae_eq_mk) + have hes := Measure.ae_ae_of_ae_prod (Measure.measurePreserving_swap.quasiMeasurePreserving.ae he) + have hGe : ∀ᵐ z ∂ν, ∀ᵐ ω ∂P, Y (ω,z) = G (ω,z) := by + filter_upwards [hlim,hes] with z hz hez + filter_upwards [hz,hez] with ω hω heω + change ∀ n, X n (ω,z) = F n (ω,z) at heω + have hf : Tendsto (fun n => F n (ω,z)) atTop (𝓝 (Y (ω,z))) := by + simpa only [heω] using hω + exact hf.limUnder_eq.symm + refine ⟨G,hG,?_,hGe⟩ + apply ae_prod_tendsto_of_fibers hX hG.aemeasurable + filter_upwards [hlim,hGe] with z hz hgz + filter_upwards [hz,hgz] with ω hω heω + rwa [← heω] + +end SLEExactGauge.SpatialLimit + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/StoppedIto.lean b/lean/OAI/Probability/SLELocalization/StoppedIto.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8d74051d4ee324f25d2eef34a0d114540e37198 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/StoppedIto.lean @@ -0,0 +1,1187 @@ +import Mathlib +import OAI.Probability.SLELocalization.StoppedMeshes +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Brownian Stopped estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.BrownianStopped +open BrownianPredictable PredictableLimit BrownianIto TaylorMeshes BrownianField + +theorem stopped_fieldSum_tendsto_ae {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ ω ∂P, 0 ≤ τ ω ∧ τ ω ≤ T) + (hreg : ∀ᵐ ω ∂P, FieldRegular (F ω) (V ω) (fun t => B t.toNNReal ω) (τ ω)) + (C : ℕ → ℕ → Ω → ℝ) + (hCeq : ∀ n i, C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (C n i)) + (hC2 : ∀ n i, MemLp (C n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁) : + ∀ᵐ ω ∂P, Tendsto (fun n => dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n ω) atTop + (𝓝 (F ω (τ ω) (B (τ ω).toNNReal ω) - F ω 0 (B 0 ω) - + (∫ t in (0 : ℝ)..(τ ω), V ω t (B t.toNNReal ω)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ ω), + iteratedDeriv 2 (F ω t) (B t.toNNReal ω))) := by + have he := brownian_dyadic_weighted_quadraticError_tendsto hB T + C hC hC2 K₂ hK₂ (fun n i => by + filter_upwards [hCeq n i, hbound n i] with ω he hb + simpa only [he] using hb) + have hCeq_all : ∀ᵐ ω ∂P, ∀ n i, C n i ω = stoppedCoeff 2 B T τ F n i ω := + ae_all_iff.2 (fun n => ae_all_iff.2 (hCeq n)) + have hC_all : ∀ᵐ ω ∂P, ∀ n i, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hbound n)) + have hA_all : ∀ᵐ ω ∂P, ∀ n i, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAbound n)) + filter_upwards [hB.cont, quadraticSum_tendsto hB T, he, hreg, hτ, hC_all, hA_all, hCeq_all] + with ω hb hQ hE hr hτω hCω hAω hCeqω + have hEs : Tendsto (fun n => dyadicQuadraticError B T (stoppedCoeff 2 B T τ F) n ω) atTop (𝓝 0) := by + convert hE using 1 + funext n + unfold dyadicQuadraticError + simp only [hCeqω] + let b : ℝ → ℝ := fun t => B t.toNNReal ω + have hbc : Continuous b := hb.comp continuous_real_toNNReal + have hQ' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1))-b (mesh T n i))^2) atTop (𝓝 (T : ℝ)) := by + simpa only [quadraticSum, b, mesh_toNNReal] using hQ + have hE' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0) + atTop (𝓝 0) := by + have heq (n : ℕ) : dyadicQuadraticError B T (stoppedCoeff 2 B T τ F) n ω = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0 := by + unfold dyadicQuadraticError + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal] + split_ifs <;> simp + simpa only [heq] using hEs + have hA' (n i : ℕ) (hi : mesh T n i < τ ω) : + |deriv (F ω (mesh T n i)) (b (mesh T n i))| ≤ K₁ := by + simpa only [stoppedCoeff, ite_eq_left hi, iteratedDeriv_succ, iteratedDeriv_zero, + b, mesh_toNNReal] using hAω n i + have hC' (n i : ℕ) (hi : mesh T n i < τ ω) : + |iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i))| ≤ K₂ := by + simpa only [stoppedCoeff, ite_eq_left hi, b, mesh_toNNReal] using hCω n i + have ht := stopped_field_taylor_limit T.coe_nonneg hτω.1 hτω.2 hbc.continuousOn + hr hQ' hK₁ hK₂ hA' hC' hE' + have heq (n : ℕ) : dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n ω = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + deriv (F ω (mesh T n i)) (b (mesh T n i)) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0 := by + unfold dyadicDriverSum + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal, iteratedDeriv_succ, iteratedDeriv_zero] + split_ifs <;> simp + simpa only [← heq, b, Real.toNNReal_zero] using ht + +theorem stopped_field_ito_centered_ae {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ ω ∂P, 0 ≤ τ ω ∧ τ ω ≤ T) + (hreg : ∀ᵐ ω ∂P, FieldRegular (F ω) (V ω) (fun t => B t.toNNReal ω) (τ ω)) + (A C : ℕ → ℕ → Ω → ℝ) + (hAeq : ∀ n i, A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i) + (hCeq : ∀ n i, C n i =ᵐ[P] stoppedCoeff 2 B T τ F n i) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (C n i)) + (hC2 : ∀ n i, MemLp (C n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (A n i)) + (hA2 : ∀ n i, MemLp (A n i) 2 P) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁) : + let Y := fun ω => F ω (τ ω) (B (τ ω).toNNReal ω) - F ω 0 (B 0 ω) - + (∫ t in (0 : ℝ)..(τ ω), V ω t (B t.toNNReal ω)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ ω), iteratedDeriv 2 (F ω t) (B t.toNNReal ω) + Integrable Y P ∧ (∫ ω, Y ω ∂P) = 0 := by + have ht := stopped_fieldSum_tendsto_ae hB T τ F V hτ hreg C hCeq hC hC2 + K₂ hK₂ hbound K₁ hK₁ hAbound + have hAeq_all : ∀ᵐ ω ∂P, ∀ n i, A n i ω = stoppedCoeff 1 B T τ F n i ω := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAeq n)) + apply limit_centered hB T A hA hA2 K₁ hK₁ ?_ _ ?_ + · intro n i + filter_upwards [hAeq n i, hAbound n i] with ω he hb + simpa only [he] using hb + · filter_upwards [ht, hAeq_all] with ω hω he + convert hω using 1 + funext n + unfold dyadicDriverSum + simp only [he] + +end SLEExactGauge.BrownianStopped + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.LoewnerCutoff + +def clampIm (ε : ℝ) (w : ℂ) : ℂ := ⟨w.re, max w.im ε⟩ + +def velocity (ε u : ℝ) (w : ℂ) : ℂ := 2 / clampIm ε (w - (u : ℂ)) + +lemma clampIm_eq {ε : ℝ} {w : ℂ} (hw : ε ≤ w.im) : clampIm ε w = w := by + apply Complex.ext <;> simp [clampIm, max_eq_left hw] + +lemma clampIm_height (ε : ℝ) (w : ℂ) : ε ≤ (clampIm ε w).im := le_max_right _ _ + +lemma clampIm_norm {ε : ℝ} (_hε : 0 < ε) (w : ℂ) : ε ≤ ‖clampIm ε w‖ := + (clampIm_height ε w).trans (Complex.im_le_norm _) + +lemma clampIm_ne_zero {ε : ℝ} (hε : 0 < ε) (w : ℂ) : clampIm ε w ≠ 0 := + norm_pos_iff.1 (hε.trans_le (clampIm_norm hε w)) + +lemma clampIm_norm_sub (ε : ℝ) (z w : ℂ) : + ‖clampIm ε z - clampIm ε w‖ ≤ 2 * ‖z - w‖ := by + have hm : |max z.im ε - max w.im ε| ≤ |z.im - w.im| := by + simpa only [sub_self, abs_zero, max_eq_left (abs_nonneg (z.im - w.im))] using + abs_max_sub_max_le_max z.im ε w.im ε + calc + ‖clampIm ε z - clampIm ε w‖ ≤ |z.re-w.re| + |max z.im ε-max w.im ε| := + Complex.norm_le_abs_re_add_abs_im _ + _ ≤ |z.re-w.re| + |z.im-w.im| := add_le_add le_rfl hm + _ ≤ ‖z-w‖ + ‖z-w‖ := add_le_add (Complex.abs_re_le_norm (z-w)) + (Complex.abs_im_le_norm (z-w)) + _ = 2 * ‖z-w‖ := by ring + +lemma velocity_eq {ε u : ℝ} {w : ℂ} (hw : ε ≤ w.im) : + velocity ε u w = 2 / (w - (u : ℂ)) := by + unfold velocity + rw [clampIm_eq (by simpa using hw)] + +lemma norm_velocity_le {ε : ℝ} (hε : 0 < ε) (u : ℝ) (w : ℂ) : + ‖velocity ε u w‖ ≤ 2 / ε := by + rw [velocity, norm_div, Complex.norm_ofNat] + exact div_le_div_of_nonneg_left (by norm_num) hε (clampIm_norm hε _) + +lemma norm_velocity_sub_le {ε : ℝ} (hε : 0 < ε) (u : ℝ) (z w : ℂ) : + ‖velocity ε u z - velocity ε u w‖ ≤ (4 / ε^2) * ‖z-w‖ := by + let a := clampIm ε (z - (u : ℂ)) + let b := clampIm ε (w - (u : ℂ)) + have ha : a ≠ 0 := clampIm_ne_zero hε _ + have hb : b ≠ 0 := clampIm_ne_zero hε _ + have hna := clampIm_norm hε (z - (u : ℂ)) + have hnb := clampIm_norm hε (w - (u : ℂ)) + have hd : ε^2 ≤ ‖a*b‖ := by + rw [norm_mul, pow_two] + exact mul_le_mul hna hnb hε.le (norm_nonneg _) + have he : velocity ε u z - velocity ε u w = 2 * (b-a) / (a*b) := by + dsimp [velocity, a, b] + field_simp [clampIm_ne_zero hε] + rw [he, norm_div, norm_mul, Complex.norm_ofNat] + have hn : ‖b-a‖ ≤ 2 * ‖z-w‖ := by + simpa only [a, b, norm_sub_rev, sub_sub_sub_cancel_right] using + clampIm_norm_sub ε (z-(u:ℂ)) (w-(u:ℂ)) + calc + 2 * ‖b-a‖ / ‖a*b‖ ≤ (2 * (2 * ‖z-w‖)) / ε^2 := + div_le_div₀ (by positivity) (mul_le_mul_of_nonneg_left hn (by norm_num)) + (sq_pos_of_pos hε) hd + _ = (4 / ε^2) * ‖z-w‖ := by ring + +lemma velocity_lipschitz {ε : ℝ} (hε : 0 < ε) (u : ℝ) : + LipschitzWith ⟨4 / ε^2, by positivity⟩ (velocity ε u) := by + apply LipschitzWith.of_dist_le_mul + intro z w + simp only [dist_eq_norm] + exact norm_velocity_sub_le hε u z w + +lemma continuous_velocity {ε : ℝ} (hε : 0 < ε) : + Continuous (fun p : ℝ × ℂ => velocity ε p.1 p.2) := by + unfold velocity clampIm + refine continuous_const.div ?_ (fun p => clampIm_ne_zero hε _) + change Continuous (fun p : ℝ × ℂ => Complex.equivRealProdCLM.symm + ((p.2 - (p.1 : ℂ)).re, max (p.2 - (p.1 : ℂ)).im ε)) + apply Complex.equivRealProdCLM.symm.continuous.comp + apply Continuous.prodMk <;> fun_prop + +lemma exists_solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) (z : ℂ) : + ∃ H : ℝ → ℂ, H 0 = z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t := by + let L : ℝ≥0 := ⟨2 / ε, by positivity⟩ + let K : ℝ≥0 := ⟨4 / ε^2, by positivity⟩ + let a : ℝ≥0 := ⟨(2 / ε) * T, mul_nonneg (by positivity) hT⟩ + have hp : IsPicardLindelof (fun t => velocity ε (U t)) + ⟨0, ⟨le_rfl, hT⟩⟩ z a 0 L K := by + constructor + · exact fun t _ => (velocity_lipschitz hε (U t)).lipschitzOnWith + · intro w _ + have hc : ContinuousOn (fun t : ℝ => (U t, w)) (Icc 0 T) := + hU.prodMk continuousOn_const + simpa only [Function.comp_def] using + (continuous_velocity hε).comp_continuousOn hc + · exact fun t _ w _ => norm_velocity_le hε (U t) w + · dsimp [L, a] + simp only [sub_zero, sub_self, max_eq_left hT] + rfl + exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + +lemma norm_velocity_driver_sub_le {ε : ℝ} (hε : 0 < ε) (u v : ℝ) (z : ℂ) : + ‖velocity ε u z - velocity ε v z‖ ≤ (4 / ε^2) * |u-v| := by + have he (a : ℝ) : velocity ε 0 (z - (a : ℂ)) = velocity ε a z := by + simp [velocity] + have hh := norm_velocity_sub_le hε 0 (z-(u:ℂ)) (z-(v:ℂ)) + rw [he, he] at hh + convert hh using 1 + rw [sub_sub_sub_cancel_left, ← Complex.ofReal_sub, Complex.norm_real, abs_sub_comm] + simp [Real.norm_eq_abs] + +lemma derivWithin_right {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ico 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Ici t) t := + (hH t ⟨ht.1, ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem ht) + +lemma derivWithin_left {ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ioc 0 T) : + HasDerivWithinAt H (velocity ε (U t) (H t)) (Iic t) t := + (hH t ⟨ht.1.le, ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsLE_of_mem ht) + +lemma solution_eq {ε T : ℝ} (hε : 0 < ε) {U : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (U t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) : EqOn H G (Icc 0 T) := by + apply ODE_solution_unique_of_mem_Icc_right + (s := fun _ => univ) (fun t _ => (velocity_lipschitz hε (U t)).lipschitzOnWith) + (HasDerivWithinAt.continuousOn hH) (fun _ ht => derivWithin_right hH ht) + (fun _ _ => mem_univ _) (HasDerivWithinAt.continuousOn hG) + (fun _ ht => derivWithin_right hG ht) (fun _ _ => mem_univ _) h0 + +lemma solution_dist_le {ε T D : ℝ} (hε : 0 < ε) (hD : 0 ≤ D) + {U V : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity ε (V t) (G t)) (Icc 0 T) t) + (h0 : H 0 = G 0) (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ D) + {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (H t) (G t) ≤ D * Real.exp ((4 / ε^2) * T) := by + let K : ℝ≥0 := ⟨4 / ε^2, by positivity⟩ + have hK : (0 : ℝ) < K := by change 0 < 4 / ε^2; positivity + have hb (s : ℝ) (hs : s ∈ Ico 0 T) : + dist (velocity ε (V s) (G s)) (velocity ε (U s) (G s)) ≤ (K : ℝ) * D := by + rw [dist_eq_norm] + calc + _ ≤ (4 / ε^2) * |V s-U s| := norm_velocity_driver_sub_le hε _ _ _ + _ ≤ (K : ℝ) * D := by + rw [abs_sub_comm] + exact mul_le_mul_of_nonneg_left (hUV s ⟨hs.1, hs.2.le⟩) hK.le + have hh := dist_le_of_approx_trajectories_ODE + (fun t => velocity_lipschitz hε (U t)) + (HasDerivWithinAt.continuousOn hH) (fun _ hs => derivWithin_right hH hs) + (fun t _ => le_of_eq (dist_self (velocity ε (U t) (H t)))) + (HasDerivWithinAt.continuousOn hG) (fun _ hs => derivWithin_right hG hs) + hb (le_of_eq (dist_eq_zero.2 h0)) t ht + have he : gronwallBound 0 K (0 + (K : ℝ)*D) (t-0) = + D * (Real.exp ((K : ℝ)*t)-1) := by + simp only [gronwallBound, zero_add, sub_zero, ite_eq_right (ne_of_gt hK)] + field_simp + ring + rw [he] at hh + have hexp : Real.exp ((K : ℝ)*t) ≤ Real.exp ((K : ℝ)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left ht.2 hK.le) + apply hh.trans + change D * (Real.exp ((4 / ε^2)*t)-1) ≤ D * Real.exp ((4 / ε^2)*T) + change Real.exp ((4 / ε^2)*t) ≤ Real.exp ((4 / ε^2)*T) at hexp + exact mul_le_mul_of_nonneg_left (by linarith) hD + +end SLEExactGauge.LoewnerCutoff + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.LoewnerCutoff +open scoped unitInterval + +def extendDriver (T : ℝ) (U : C(I, ℝ)) (t : ℝ) : ℝ := + U (projIcc 0 1 zero_le_one (t / T)) + +lemma continuous_extendDriver (T : ℝ) (U : C(I, ℝ)) : Continuous (extendDriver T U) := + U.continuous.comp (continuous_projIcc.comp (continuous_id.div_const T)) + +def solution {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : ℝ → ℂ := + (exists_solution hε hT (extendDriver T U) (continuous_extendDriver T U).continuousOn z).choose + +lemma solution_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + solution hε hT U z 0 = z := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.1 + +lemma solution_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + ∀ t ∈ Icc 0 T, HasDerivWithinAt (solution hε hT U z) + (velocity ε (extendDriver T U t) (solution hε hT U z t)) (Icc 0 T) t := + (exists_solution hε hT (extendDriver T U) + (continuous_extendDriver T U).continuousOn z).choose_spec.2 + +def solutionPath {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (U : C(I, ℝ)) (z : ℂ) : + C(Icc 0 T, ℂ) := + ⟨fun t => solution hε hT U z t, + continuousOn_iff_continuous_domRestrict.1 (HasDerivWithinAt.continuousOn (solution_deriv hε hT U z))⟩ + +lemma solutionPath_lipschitz {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + LipschitzWith ⟨Real.exp ((4 / ε^2) * T), (Real.exp_pos _).le⟩ + (fun U : C(I, ℝ) => solutionPath hε hT U z) := by + apply LipschitzWith.of_dist_le_mul + intro U V + apply (ContinuousMap.dist_le (mul_nonneg (Real.exp_pos _).le dist_nonneg)).2 + intro t + have hUV (s : ℝ) (_hs : s ∈ Icc 0 T) : + |extendDriver T U s-extendDriver T V s| ≤ dist U V := by + exact (ContinuousMap.dist_apply_le_dist (f := U) (g := V) + (projIcc 0 1 zero_le_one (s/T))) + have hh := solution_dist_le hε dist_nonneg (solution_deriv hε hT U z) + (solution_deriv hε hT V z) + ((solution_initial hε hT U z).trans (solution_initial hε hT V z).symm) + hUV t.property + change dist (solution hε hT U z t) (solution hε hT V z t) ≤ + Real.exp ((4 / ε^2)*T) * dist U V + simpa only [mul_comm] using hh + +end SLEExactGauge.LoewnerCutoff + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ContinuousDriver +section Limit +variable {Ω Y : Type*} [MeasurableSpace Ω] [MetricSpace Y] [CompleteSpace Y] + +def selectedLimit (y₀ : Y) (a : ℕ → Y) : Y := by + classical + exact if h : CauchySeq a then (cauchySeq_tendsto_of_complete h).choose else y₀ + +lemma tendsto_selectedLimit (y₀ : Y) {a : ℕ → Y} (h : CauchySeq a) : + Tendsto a atTop (𝓝 (selectedLimit y₀ a)) := by + rw [selectedLimit, dite_eq_left h] + exact (cauchySeq_tendsto_of_complete h).choose_spec + +lemma selectedLimit_eq (y₀ : Y) {a : ℕ → Y} {y : Y} (h : Tendsto a atTop (𝓝 y)) : + selectedLimit y₀ a = y := + tendsto_nhds_unique (tendsto_selectedLimit y₀ h.cauchySeq) h + +end Limit + +end SLEExactGauge.ContinuousDriver + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ContinuousDriver +section Limit +variable {Ω Y : Type*} [MeasurableSpace Ω] [MetricSpace Y] [completeY : CompleteSpace Y] +variable [MeasurableSpace Y] [BorelSpace Y] [SecondCountableTopology Y] + +omit completeY in +lemma measurableSet_cauchy [CompleteSpace Y] (a : ℕ → Ω → Y) (ha : ∀ n, Measurable (a n)) : + MeasurableSet {ω | CauchySeq (fun n => a n ω)} := by + simp only [Metric.uniformity_basis_dist_inv_nat_succ.cauchySeq_iff, forall_const, + mem_ofPred_eq, ofPred_forall, ofPred_exists] + exact MeasurableSet.iInter fun (k : ℕ) => MeasurableSet.iUnion fun (N : ℕ) => + MeasurableSet.iInter fun (m : ℕ) => MeasurableSet.iInter fun (_ : N ≤ m) => + MeasurableSet.iInter fun (n : ℕ) => MeasurableSet.iInter fun (_ : N ≤ n) => + measurableSet_lt ((ha m).dist (ha n)) measurable_const + +lemma measurable_selectedLimit (y₀ : Y) (a : ℕ → Ω → Y) (ha : ∀ n, Measurable (a n)) : + Measurable (fun ω => selectedLimit y₀ (fun n => a n ω)) := by + classical + have hc := measurableSet_cauchy a ha + apply measurable_of_tendsto_metrizable + (f := fun n ω => if CauchySeq (fun m => a m ω) then a n ω else y₀) + (fun n => (ha n).ite hc measurable_const) + apply tendsto_pi_nhds.2 + intro ω + by_cases hω : CauchySeq (fun n => a n ω) + · simpa only [ite_eq_left hω] using tendsto_selectedLimit y₀ hω + · simp only [ite_eq_right hω, selectedLimit, dite_eq_right hω] + exact tendsto_const_nhds + +end Limit + +end SLEExactGauge.ContinuousDriver + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.ContinuousDriver + +def rawApprox (x : I → ℝ) (n : ℕ) : C(I, ℝ) := + ∑ k : Fin (n+1), (x (bernstein.z k)) • bernstein n k + +lemma rawApprox_eq (f : C(I, ℝ)) (n : ℕ) : rawApprox f n = bernsteinApproximation n f := by + apply ContinuousMap.ext + intro t + simp [rawApprox, bernsteinApproximation, smul_eq_mul, mul_comm] + +lemma measurable_rawApprox {Ω : Type*} [MeasurableSpace Ω] + (x : Ω → I → ℝ) (hx : ∀ t, Measurable (fun ω => x ω t)) (n : ℕ) : + @Measurable Ω C(I, ℝ) _ (borel C(I, ℝ)) (fun ω => rawApprox (x ω) n) := by + let : MeasurableSpace C(I, ℝ) := borel C(I, ℝ) + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + apply Finset.measurable_sum + intro k _ + exact (hx (bernstein.z k)).smul measurable_const + +def path (x : I → ℝ) : C(I, ℝ) := selectedLimit 0 (rawApprox x) + +lemma path_eq (f : C(I, ℝ)) : path f = f := by + apply selectedLimit_eq + have he : rawApprox f = fun n => bernsteinApproximation n f := + funext (rawApprox_eq f) + rw [he] + exact bernsteinApproximation_uniform f + +lemma path_eval_of_continuous {x : I → ℝ} (hx : Continuous x) (t : I) : path x t = x t := by + have hh := path_eq (⟨x, hx⟩ : C(I, ℝ)) + exact congrArg (fun f : C(I, ℝ) => f t) hh + +lemma measurable_path {Ω : Type*} [MeasurableSpace Ω] + (x : Ω → I → ℝ) (hx : ∀ t, Measurable (fun ω => x ω t)) : + @Measurable Ω C(I, ℝ) _ (borel C(I, ℝ)) (fun ω => path (x ω)) := by + let : MeasurableSpace C(I, ℝ) := borel C(I, ℝ) + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + exact measurable_selectedLimit 0 _ (measurable_rawApprox x hx) + +end SLEExactGauge.ContinuousDriver + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.LoewnerCutoff +open scoped unitInterval + +def position {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℂ := + solutionPath hε hT U z (projIcc 0 T hT t) + +lemma position_eq {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + position hε hT U z t = solution hε hT U z t := by + simp only [position, solutionPath, projIcc, max_eq_right ht.1, + min_eq_right ht.2] + rfl + +lemma continuous_position {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => position hε hT p.1 z p.2) := by + exact continuous_eval.comp (((solutionPath_lipschitz hε hT z).continuous.comp continuous_fst).prodMk + ((continuous_projIcc (h := hT)).comp continuous_snd)) + +lemma continuous_joint_extendDriver (T : ℝ) : + Continuous (fun p : C(I, ℝ) × ℝ => extendDriver T p.1 p.2) := by + exact continuous_eval.comp (continuous_fst.prodMk + ((continuous_projIcc (h := zero_le_one)).comp (continuous_snd.div_const T))) + +def variation {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + (-2 / (clampIm ε (position hε hT U z t - (extendDriver T U t : ℂ)))^2).re + +lemma continuous_clampIm (ε : ℝ) : Continuous (clampIm ε) := by + change Continuous (fun w : ℂ => Complex.equivRealProdCLM.symm (w.re,max w.im ε)) + apply Complex.equivRealProdCLM.symm.continuous.comp + apply Continuous.prodMk <;> fun_prop + +lemma continuous_variation {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => variation hε hT p.1 z p.2) := by + have hw := (continuous_position hε hT z).sub + (Complex.continuous_ofReal.comp (continuous_joint_extendDriver T)) + exact Complex.continuous_re.comp (continuous_const.div + (((continuous_clampIm ε).comp hw).pow 2) + (fun p => pow_ne_zero 2 (clampIm_ne_zero hε _))) + +def logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + ∫ s in (0 : ℝ)..(projIcc 0 T hT t : ℝ), variation hε hT U z s + +lemma continuous_logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) (z : ℂ) : + Continuous (fun p : C(I, ℝ) × ℝ => logDerivative hε hT p.1 z p.2) := by + have hc := intervalIntegral.continuous_parametric_primitive_of_continuous + (μ := volume) (a₀ := 0) (f := fun U t => variation hε hT U z t) + (continuous_variation hε hT z) + exact hc.comp (continuous_fst.prodMk + (continuous_subtype_val.comp ((continuous_projIcc (h := hT)).comp continuous_snd))) + +lemma abs_variation_le {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + |variation hε hT U z t| ≤ 2/ε^2 := by + apply (Complex.abs_re_le_norm _).trans + rw [norm_div, norm_neg, Complex.norm_ofNat, norm_pow] + apply div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hε) + exact pow_le_pow_left₀ hε.le (clampIm_norm hε _) 2 + +lemma logDerivative_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : logDerivative hε hT U z 0 = 0 := by + simp only [logDerivative, projIcc_of_mem hT (left_mem_Icc.mpr hT), intervalIntegral.integral_same] + +lemma abs_logDerivative_le {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + |logDerivative hε hT U z t| ≤ (2/ε^2)*T := by + have hb := (projIcc 0 T hT t).property + have hi := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0:ℝ)) (b := (projIcc 0 T hT t : ℝ)) + (fun s (_hs : s ∈ uIoc 0 (projIcc 0 T hT t : ℝ)) => + show ‖variation hε hT U z s‖ ≤ 2/ε^2 from abs_variation_le hε hT U z s) + change |logDerivative hε hT U z t| ≤ _ + apply hi.trans + rw [sub_zero, abs_of_nonneg hb.1] + exact mul_le_mul_of_nonneg_left hb.2 (by positivity) + +lemma position_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) : position hε hT U z 0 = z := by + rw [position_eq hε hT U z ⟨le_rfl,hT⟩, solution_initial] + +lemma position_derivWithin {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + HasDerivWithinAt (position hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)) (Icc 0 T) t := by + rw [position_eq hε hT U z ht] + exact (solution_deriv hε hT U z t ht).congr + (fun s hs => position_eq hε hT U z hs) (position_eq hε hT U z ht) + +lemma position_deriv {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (position hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)) t := + (position_derivWithin hε hT U z ⟨ht.1.le,ht.2.le⟩).hasDerivAt (Icc_mem_nhds ht.1 ht.2) + +lemma logDerivative_eq_integral {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Icc 0 T) : + logDerivative hε hT U z t = ∫ s in (0:ℝ)..t, variation hε hT U z s := by + simp only [logDerivative, projIcc_of_mem hT ht] + +lemma hasDerivAt_logDerivative {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (U : C(I, ℝ)) (z : ℂ) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (logDerivative hε hT U z) (variation hε hT U z t) t := by + have hp : Continuous (fun t : ℝ => (U,t)) := continuous_const.prodMk continuous_id + have hc := (continuous_variation hε hT z).comp hp + dsimp only [Function.comp_def] at hc + have hd : HasDerivAt (fun v : ℝ => ∫ s in (0:ℝ)..v, variation hε hT U z s) + (variation hε hT U z t) t := + intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 t) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + apply hd.congr_of_eventuallyEq + filter_upwards [Icc_mem_nhds ht.1 ht.2] with s hs + exact logDerivative_eq_integral hε hT U z hs + +lemma position_prefix_eq {ε T₁ T₂ S : ℝ} (hε : 0 < ε) + (hT₁ : 0 ≤ T₁) (hT₂ : 0 ≤ T₂) (_hS : 0 ≤ S) (hS₁ : S ≤ T₁) (hS₂ : S ≤ T₂) + (U V : C(I, ℝ)) (z : ℂ) + (hUV : EqOn (extendDriver T₁ U) (extendDriver T₂ V) (Icc 0 S)) : + EqOn (position hε hT₁ U z) (position hε hT₂ V z) (Icc 0 S) := by + apply solution_eq hε (U := extendDriver T₁ U) ?_ ?_ ((position_initial hε hT₁ U z).trans (position_initial hε hT₂ V z).symm) + · intro t ht + exact (position_derivWithin hε hT₁ U z ⟨ht.1,ht.2.trans hS₁⟩).mono + (Icc_subset_Icc le_rfl hS₁) + · intro t ht + rw [hUV ht] + exact (position_derivWithin hε hT₂ V z ⟨ht.1,ht.2.trans hS₂⟩).mono + (Icc_subset_Icc le_rfl hS₂) + +lemma logDerivative_prefix_eq {ε T₁ T₂ S : ℝ} (hε : 0 < ε) + (hT₁ : 0 ≤ T₁) (hT₂ : 0 ≤ T₂) (hS : 0 ≤ S) (hS₁ : S ≤ T₁) (hS₂ : S ≤ T₂) + (U V : C(I, ℝ)) (z : ℂ) + (hUV : EqOn (extendDriver T₁ U) (extendDriver T₂ V) (Icc 0 S)) : + EqOn (logDerivative hε hT₁ U z) (logDerivative hε hT₂ V z) (Icc 0 S) := by + have hH := position_prefix_eq hε hT₁ hT₂ hS hS₁ hS₂ U V z hUV + intro t ht + rw [logDerivative_eq_integral hε hT₁ U z ⟨ht.1,ht.2.trans hS₁⟩, + logDerivative_eq_integral hε hT₂ V z ⟨ht.1,ht.2.trans hS₂⟩] + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le ht.1] at hs + have hsS : s ∈ Icc 0 S := ⟨hs.1,hs.2.trans ht.2⟩ + simp only [variation, hH hsS, hUV hsS] + +end SLEExactGauge.LoewnerCutoff + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +namespace SLEExactGauge.GreenPhysical + +def green (p a x y l : ℝ) : ℝ := + Real.exp (p*l - p*Real.log 2 + (a-p)*Real.log y - a/2*Real.log (x^2+y^2)) + +lemma q_pos (x : ℝ) {y : ℝ} (hy : 0 < y) : 0 < x^2+y^2 := by positivity + +lemma green_eq_source (p a x y l : ℝ) (hy : 0 < y) : + green p a x y l = (2*y / Real.exp l)^(-p) * (y / Real.sqrt (x^2+y^2))^a := by + have hQ := q_pos x hy + have hR : 0 < 2*y / Real.exp l := div_pos (by positivity) (Real.exp_pos _) + have hS : 0 < y / Real.sqrt (x^2+y^2) := div_pos hy (Real.sqrt_pos.2 hQ) + rw [Real.rpow_def_of_pos hR, Real.rpow_def_of_pos hS, ← Real.exp_add] + dsimp [green] + congr 1 + rw [Real.log_div (by positivity : 2*y ≠ 0) (Real.exp_ne_zero _), + Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hy.ne', Real.log_exp, + Real.log_div hy.ne' (by positivity : Real.sqrt (x^2+y^2) ≠ 0), + Real.log_sqrt hQ.le] + ring + +lemma green_pos (p a x y l : ℝ) : 0 < green p a x y l := Real.exp_pos _ + +lemma hasDerivAt_green_path (p a : ℝ) {X Y L : ℝ → ℝ} {t X' Y' L' : ℝ} + (hX : HasDerivAt X X' t) (hY : HasDerivAt Y Y' t) (hL : HasDerivAt L L' t) + (hy : 0 < Y t) : + HasDerivAt (fun u => green p a (X u) (Y u) (L u)) + (green p a (X t) (Y t) (L t) * + (p*L' + (a-p)*Y'/Y t - a*(X t*X' + Y t*Y')/(X t^2+Y t^2))) t := by + have hlogY := hY.log hy.ne' + have hlogQ := ((hX.pow 2).add (hY.pow 2)).log (q_pos (X t) hy).ne' + have hd := ((((hL.const_mul p).sub_const (p*Real.log 2)).add + (hlogY.const_mul (a-p))).sub (hlogQ.const_mul (a/2))).exp + apply hd.congr_deriv + dsimp [green] + ring + +lemma hasDerivAt_green_x (p a x y l : ℝ) (hy : 0 < y) : + HasDerivAt (fun u => green p a u y l) (green p a x y l * (-a*x/(x^2+y^2))) x := by + convert hasDerivAt_green_path p a (hasDerivAt_id x) (hasDerivAt_const x y) + (hasDerivAt_const x l) hy using 1 <;> dsimp only [id_eq]; ring + +lemma deriv_green_x (p a x y l : ℝ) (hy : 0 < y) : + deriv (fun u => green p a u y l) x = green p a x y l * (-a*x/(x^2+y^2)) := + (hasDerivAt_green_x p a x y l hy).deriv + +lemma hasDerivAt_neg_ax_div_q (a x y : ℝ) (hy : 0 < y) : + HasDerivAt (fun u => -a*u/(u^2+y^2)) + (a*(x^2-y^2)/(x^2+y^2)^2) x := by + have hd := ((hasDerivAt_id x).const_mul (-a)).div + (((hasDerivAt_id x).pow 2).add_const (y^2)) (q_pos x hy).ne' + apply hd.congr_deriv + simp only [id_eq, Pi.pow_apply] + norm_num + ring + +lemma deriv_deriv_green_x (p a x y l : ℝ) (hy : 0 < y) : + deriv (deriv (fun u => green p a u y l)) x = + green p a x y l * (a*(a+1)*x^2-a*y^2)/(x^2+y^2)^2 := by + have heq : deriv (fun u => green p a u y l) = + (fun u => green p a u y l * (-a*u/(u^2+y^2))) := + funext (fun u => deriv_green_x p a u y l hy) + rw [heq] + have hd := (hasDerivAt_green_x p a x y l hy).mul (hasDerivAt_neg_ax_div_q a x y hy) + calc + _ = _ := hd.deriv + _ = _ := by + field_simp + ring + +lemma green_drift_cancellation (κ x y M : ℝ) (hκ : κ ≠ 0) (hy : 0 < y) : + let p := 1-κ/8 + let a := 8/κ-1 + M * (p * (-2*(x^2-y^2)/(x^2+y^2)^2) + + (a-p) * (-2*y/(x^2+y^2))/y - + a * (x*(2*x/(x^2+y^2)) + y*(-2*y/(x^2+y^2)))/(x^2+y^2)) + + κ/2 * (M*(a*(a+1)*x^2-a*y^2)/(x^2+y^2)^2) = 0 := by + dsimp only + field_simp + ring + +lemma loewner_green_drift {κ t : ℝ} (hκ : 0 < κ) {X Y L : ℝ → ℝ} + (hy : 0 < Y t) + (hX : HasDerivAt X (2*X t/(X t^2+Y t^2)) t) + (hY : HasDerivAt Y (-2*Y t/(X t^2+Y t^2)) t) + (hL : HasDerivAt L (-2*(X t^2-Y t^2)/(X t^2+Y t^2)^2) t) : + HasDerivAt (fun u => green (1-κ/8) (8/κ-1) (X u) (Y u) (L u)) + (-(κ/2) * deriv (deriv (fun x => green (1-κ/8) (8/κ-1) x (Y t) (L t))) (X t)) t := by + have hd := hasDerivAt_green_path (1-κ/8) (8/κ-1) hX hY hL hy + apply hd.congr_deriv + rw [deriv_deriv_green_x _ _ _ _ _ hy] + have hc := green_drift_cancellation κ (X t) (Y t) + (green (1-κ/8) (8/κ-1) (X t) (Y t) (L t)) hκ.ne' hy + dsimp only at hc + linarith + +lemma hasDerivAt_green_driver (p a c y l sdev b : ℝ) (hy : 0 < y) : + HasDerivAt (fun v => green p a (c-sdev*v) y l) + (sdev*a*(c-sdev*b)/((c-sdev*b)^2+y^2) * green p a (c-sdev*b) y l) b := by + have hd := (hasDerivAt_green_x p a (c-sdev*b) y l hy).comp b + (((hasDerivAt_id b).const_mul sdev).const_sub c) + apply hd.congr_deriv + ring + +lemma deriv_green_driver (p a c y l sdev b : ℝ) (hy : 0 < y) : + deriv (fun v => green p a (c-sdev*v) y l) b = + sdev*a*(c-sdev*b)/((c-sdev*b)^2+y^2) * green p a (c-sdev*b) y l := + (hasDerivAt_green_driver p a c y l sdev b hy).deriv + +lemma hasDerivAt_deriv_green_x (p a x y l : ℝ) (hy : 0 < y) : + HasDerivAt (deriv (fun u => green p a u y l)) + (green p a x y l * (a*(a+1)*x^2-a*y^2)/(x^2+y^2)^2) x := by + have heq : deriv (fun u => green p a u y l) = + (fun u => green p a u y l * (-a*u/(u^2+y^2))) := + funext (fun u => deriv_green_x p a u y l hy) + rw [heq] + apply ((hasDerivAt_green_x p a x y l hy).mul (hasDerivAt_neg_ax_div_q a x y hy)).congr_deriv + field_simp + ring + +lemma deriv_deriv_green_driver (p a c y l sdev b : ℝ) (hy : 0 < y) : + deriv (deriv (fun v => green p a (c-sdev*v) y l)) b = + sdev^2 * (green p a (c-sdev*b) y l * + (a*(a+1)*(c-sdev*b)^2-a*y^2)/((c-sdev*b)^2+y^2)^2) := by + have heq : deriv (fun v => green p a (c-sdev*v) y l) = + fun v => (-sdev) * deriv (fun u => green p a u y l) (c-sdev*v) := by + ext v + rw [deriv_green_driver _ _ _ _ _ _ _ hy, deriv_green_x _ _ _ _ _ hy] + ring + rw [heq] + have hd := ((hasDerivAt_deriv_green_x p a (c-sdev*b) y l hy).comp b + (((hasDerivAt_id b).const_mul sdev).const_sub c)).const_mul (-sdev) + calc + _ = _ := hd.deriv + _ = _ := by ring + +lemma green_le_radius (p a x y l : ℝ) (hy : 0 < y) (ha : 0 ≤ a) : + green p a x y l ≤ (2*y/Real.exp l)^(-p) := by + rw [green_eq_source _ _ _ _ _ hy] + have hQ := q_pos x hy + have hyS : y ≤ Real.sqrt (x^2+y^2) := by + rw [Real.le_sqrt hy.le (by positivity)] + nlinarith [sq_nonneg x] + have hr : 0 ≤ (2*y/Real.exp l)^(-p) := Real.rpow_nonneg (by positivity) _ + have hs : (y/Real.sqrt (x^2+y^2))^a ≤ 1 := + Real.rpow_le_one (by positivity) ((div_le_one (Real.sqrt_pos.2 hQ)).2 hyS) ha + simpa using mul_le_mul_of_nonneg_left hs hr + +lemma green_le_fixed_radius (p a x y l ρ : ℝ) (hy : 0 < y) (ha : 0 ≤ a) + (hp : 0 ≤ p) (hρ : 0 < ρ) (hR : ρ ≤ 2*y/Real.exp l) : + green p a x y l ≤ ρ^(-p) := by + exact (green_le_radius p a x y l hy ha).trans + (Real.rpow_le_rpow_of_nonpos hρ hR (neg_nonpos.2 hp)) + +lemma contDiff_green_x (p a y l : ℝ) (hy : 0 < y) {n : ℕ∞ω} : + ContDiff ℝ n (fun x => green p a x y l) := by + unfold green + apply ContDiff.exp + apply ContDiff.sub contDiff_const + exact contDiff_const.mul (((contDiff_id.pow 2).add contDiff_const).log + (fun x => (q_pos x hy).ne')) + +lemma contDiff_green_driver (p a c y l sdev : ℝ) (hy : 0 < y) {n : ℕ∞ω} : + ContDiff ℝ n (fun b => green p a (c-sdev*b) y l) := + (contDiff_green_x p a y l hy).comp (contDiff_const.sub (contDiff_const.mul contDiff_id)) + +lemma hasDerivAt_second_green_x (p a x y l : ℝ) (hy : 0 < y) : + HasDerivAt (deriv (deriv (fun v => green p a v y l))) + (green p a x y l * (a*(a+2)*x*(3*y^2-(a+1)*x^2))/(x^2+y^2)^3) x := by + have he : deriv (deriv (fun v => green p a v y l)) = + fun v => green p a v y l * (a*(a+1)*v^2-a*y^2)/(v^2+y^2)^2 := + funext (fun v => deriv_deriv_green_x p a v y l hy) + rw [he] + have hn := (hasDerivAt_green_x p a x y l hy).mul + ((((hasDerivAt_id x).pow 2).const_mul (a*(a+1))).sub_const (a*y^2)) + have hq := (((hasDerivAt_id x).pow 2).add_const (y^2)).pow 2 + apply (hn.div hq (pow_ne_zero 2 (q_pos x hy).ne')).congr_deriv + simp only [id_eq, Pi.pow_apply, Pi.mul_apply] + field_simp + ring + +lemma third_green_x (p a x y l : ℝ) (hy : 0 < y) : + iteratedDeriv 3 (fun v => green p a v y l) x = + green p a x y l * (a*(a+2)*x*(3*y^2-(a+1)*x^2))/(x^2+y^2)^3 := by + simpa only [iteratedDeriv_succ, iteratedDeriv_zero] using + (hasDerivAt_second_green_x p a x y l hy).deriv + +lemma iteratedDeriv_green_driver (p a c y l sdev : ℝ) (hy : 0 < y) (k : ℕ) (b : ℝ) : + iteratedDeriv k (fun v => green p a (c-sdev*v) y l) b = + (-sdev)^k * iteratedDeriv k (fun x => green p a x y l) (c-sdev*b) := by + induction k generalizing b with + | zero => simp + | succ k ih => + have he : iteratedDeriv k (fun v => green p a (c-sdev*v) y l) = + fun v => (-sdev)^k * iteratedDeriv k (fun x => green p a x y l) (c-sdev*v) := funext ih + rw [iteratedDeriv_succ, he] + have hd : Differentiable ℝ (iteratedDeriv k (fun x => green p a x y l)) := + ContDiff.differentiable_iteratedDeriv k (contDiff_green_x p a y l hy (n := ⊤)) (by simp) + have hh := ((hd (c-sdev*b)).hasDerivAt.comp b + (((hasDerivAt_id b).const_mul sdev).const_sub c)).const_mul ((-sdev)^k) + dsimp only [Function.comp_def, id_eq] at hh + rw [hh.deriv] + simp only [iteratedDeriv_succ, pow_succ, mul_one] + ring + +lemma abs_x_div_q_le {ε y : ℝ} (hε : 0 < ε) (hy : ε ≤ y) (x : ℝ) : + |x| / (x^2+y^2) ≤ 1/ε := by + have hq := q_pos x (hε.trans_le hy) + apply (div_le_div_iff₀ hq hε).2 + have hεy : ε^2 ≤ y^2 := pow_le_pow_left₀ hε.le hy 2 + nlinarith [sq_nonneg (|x|-ε), sq_abs x, sq_nonneg x] + +lemma inv_q_le {ε y : ℝ} (hε : 0 < ε) (hy : ε ≤ y) (x : ℝ) : + 1/(x^2+y^2) ≤ 1/ε^2 := by + apply div_le_div_of_nonneg_left zero_le_one (sq_pos_of_pos hε) + exact (pow_le_pow_left₀ hε.le hy 2).trans (le_add_of_nonneg_left (sq_nonneg x)) + +lemma third_green_bound {p a x y l ε M : ℝ} (hε : 0 < ε) (hy : ε ≤ y) + (ha : 0 ≤ a) (hM : green p a x y l ≤ M) : + |iteratedDeriv 3 (fun v => green p a v y l) x| ≤ + M * (a*(a+2)*(a+4)) / ε^3 := by + have hypos := hε.trans_le hy + have hq := q_pos x hypos + have hMp : 0 ≤ M := (green_pos p a x y l).le.trans hM + have hP : |3*y^2-(a+1)*x^2| ≤ (a+4)*(x^2+y^2) := by + calc + _ ≤ |3*y^2| + |(a+1)*x^2| := abs_sub _ _ + _ = 3*y^2+(a+1)*x^2 := by rw [abs_of_nonneg (by positivity), abs_of_nonneg (by positivity)] + _ ≤ _ := by nlinarith [mul_nonneg ha (sq_nonneg y), sq_nonneg x] + rw [third_green_x _ _ _ _ _ hypos] + simp only [abs_div, abs_mul, abs_pow, abs_of_pos hq, abs_of_pos (green_pos p a x y l), + abs_of_nonneg ha, abs_of_nonneg (show 0 ≤ a+2 by linarith)] + calc + _ ≤ M * (a*(a+2)* |x| *((a+4)*(x^2+y^2))) / (x^2+y^2)^3 := by + gcongr + _ = M*(a*(a+2)*(a+4)) * (|x|/(x^2+y^2)) * (1/(x^2+y^2)) := by + field_simp + _ ≤ M*(a*(a+2)*(a+4)) * (1/ε) * (1/ε^2) := by + exact mul_le_mul + (mul_le_mul_of_nonneg_left (abs_x_div_q_le hε hy x) (by positivity)) + (inv_q_le hε hy x) (by positivity) (by positivity) + _ = _ := by ring + +lemma continuous_green_comp {X : Type*} [TopologicalSpace X] + (p a : ℝ) {x y l : X → ℝ} (hx : Continuous x) (hy : Continuous y) + (hl : Continuous l) (hyp : ∀ t, 0 < y t) : + Continuous (fun t => green p a (x t) (y t) (l t)) := by + unfold green + apply Real.continuous_exp.comp + exact (((continuous_const.mul hl).sub continuous_const).add + (continuous_const.mul (hy.log (fun t => (hyp t).ne')))).sub + (continuous_const.mul (((hx.pow 2).add (hy.pow 2)).log + (fun t => (q_pos (x t) (hyp t)).ne'))) + +lemma first_green_bound {p a x y l ε M : ℝ} (hε : 0 < ε) (hy : ε ≤ y) + (ha : 0 ≤ a) (hM : green p a x y l ≤ M) : + |deriv (fun v => green p a v y l) x| ≤ M*a/ε := by + have hp := green_pos p a x y l + rw [deriv_green_x p a x y l (hε.trans_le hy)] + simp only [abs_mul, abs_div, abs_neg, abs_of_nonneg ha, + abs_of_pos (q_pos x (hε.trans_le hy)), abs_of_pos hp] + calc + _ = green p a x y l * a * (|x|/(x^2+y^2)) := by ring + _ ≤ M*a*(1/ε) := mul_le_mul + (mul_le_mul_of_nonneg_right hM ha) (abs_x_div_q_le hε hy x) + (by positivity) (mul_nonneg (hp.le.trans hM) ha) + _ = _ := by ring + +lemma second_green_bound {p a x y l ε M : ℝ} (hε : 0 < ε) (hy : ε ≤ y) + (ha : 0 ≤ a) (hM : green p a x y l ≤ M) : + |iteratedDeriv 2 (fun v => green p a v y l) x| ≤ M*(a*(a+2))/ε^2 := by + have hp := green_pos p a x y l + have hMp : 0 ≤ M := hp.le.trans hM + have hq := q_pos x (hε.trans_le hy) + have hP : |a*(a+1)*x^2-a*y^2| ≤ a*(a+2)*(x^2+y^2) := by + calc + _ ≤ |a*(a+1)*x^2|+|a*y^2| := abs_sub _ _ + _ = a*(a+1)*x^2+a*y^2 := by rw [abs_of_nonneg (by positivity), abs_of_nonneg (by positivity)] + _ ≤ _ := by nlinarith [mul_nonneg ha (sq_nonneg x), mul_nonneg (mul_nonneg ha (by positivity : 0 ≤ a+1)) (sq_nonneg y)] + simp only [iteratedDeriv_succ, iteratedDeriv_zero] + rw [deriv_deriv_green_x p a x y l (hε.trans_le hy)] + simp only [abs_div, abs_mul, abs_pow, abs_of_pos hq, abs_of_pos hp] + calc + _ ≤ M*(a*(a+2)*(x^2+y^2))/(x^2+y^2)^2 := by gcongr + _ = M*(a*(a+2))*(1/(x^2+y^2)) := by field_simp + _ ≤ M*(a*(a+2))*(1/ε^2) := mul_le_mul_of_nonneg_left (inv_q_le hε hy x) (by positivity) + _ = _ := by ring + +end SLEExactGauge.GreenPhysical + +end + +end + +end + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +noncomputable section +open Set Filter +open scoped Topology ContDiff +namespace SLEExactGauge.LoewnerField +open LoewnerCutoff GreenPhysical +open scoped unitInterval +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +def height (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : ℝ := + max ε (position hε hT U z t).im + +def field (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : ℝ := + green p a ((position hε hT U z t).re - sdev*b) (height hε hT U z t) + (logDerivative hε hT U z t) + +def drift (p a sdev : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : ℝ := + let x := (position hε hT U z t).re - sdev*b + let y := height hε hT U z t + let v := velocity ε (extendDriver T U t) (position hε hT U z t) + field hε hT p a sdev U z t b * + (p*variation hε hT U z t + (a-p)*v.im/y - a*(x*v.re+y*v.im)/(x^2+y^2)) + +end SLEExactGauge.LoewnerField + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/StoppedMeshes.lean b/lean/OAI/Probability/SLELocalization/StoppedMeshes.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbd6071b583144ee026b8f1f8676b5d963a4fe51 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/StoppedMeshes.lean @@ -0,0 +1,1069 @@ +import Mathlib +import OAI.Probability.SLELocalization.TraceModel +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Localization estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge + +lemma physical_clock_bounds {T δ Y₀ u : ℝ} {Y C Q : ℝ → ℝ} + (hT : 0 ≤ T) (hδ : 0 < δ) (hY₀ : 0 < Y₀) (hYinit : Y 0 = Y₀) (hCinit : C 0 = 0) + (hY : ContinuousOn Y (Icc 0 T)) (hC : ContinuousOn C (Icc 0 T)) + (hYpos : ∀ t ∈ Icc 0 T, 0 < Y t) + (hYle : ∀ t ∈ Icc 0 T, Y t ≤ Y₀) + (hQpos : ∀ t ∈ Ioo 0 T, 0 < Q t) + (hangle : ∀ t ∈ Ioo 0 T, δ^2 * Q t ≤ (Y t)^2) + (hdY : ∀ t ∈ Ioo 0 T, HasDerivAt (fun s => Real.log (Y s)) (-2 / Q t) t) + (hdC : ∀ t ∈ Ioo 0 T, HasDerivAt C (4*(Y t)^2 / (Q t)^2) t) + (hCu : C T ≤ u) : + Y₀ * Real.exp (-u/(2*δ^2)) ≤ Y T ∧ T ≤ u * Y₀^2 / (4*δ^4) := by + have hd2 : 0 < δ^2 := sq_pos_of_pos hδ + have hq2 (t : ℝ) (ht : t ∈ Ioo 0 T) : 0 < Q t ^ 2 := sq_pos_of_pos (hQpos t ht) + have hlogY := hY.log (fun t ht => (hYpos t ht).ne') + have hm : MonotoneOn (fun t => Real.log (Y t) + C t / (2*δ^2)) (Icc 0 T) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 T) + (hlogY.add (hC.div_const _)) + (f' := fun t => -2/Q t + (4*(Y t)^2/(Q t)^2)/(2*δ^2)) + · intro t ht + rw [interior_Icc] at ht + exact ((hdY t ht).add ((hdC t ht).div_const _)).hasDerivWithinAt + · intro t ht + rw [interior_Icc] at ht + have hq := hQpos t ht + have ha := hangle t ht + apply (mul_le_mul_iff_of_pos_right (mul_pos (hq2 t ht) (mul_pos (by norm_num : (0:ℝ)<2) hd2))).1 + field_simp + nlinarith + have hlogbound := hm ⟨le_rfl,hT⟩ ⟨hT,le_rfl⟩ hT + simp only [hYinit, hCinit, zero_div, add_zero] at hlogbound + have hL : Real.log Y₀ + (-u/(2*δ^2)) ≤ Real.log (Y T) := by + have hh : C T/(2*δ^2) ≤ u/(2*δ^2) := + div_le_div_of_nonneg_right hCu (mul_pos (by norm_num) hd2).le + simp only [neg_div] + linarith + have hheight : Y₀ * Real.exp (-u/(2*δ^2)) ≤ Y T := by + have hh := Real.exp_le_exp.mpr hL + simpa only [Real.exp_add, Real.exp_log hY₀, Real.exp_log (hYpos T ⟨hT,le_rfl⟩)] using hh + have hK : 0 < 4*δ^4/Y₀^2 := by positivity + have hderivbound (t : ℝ) (ht : t ∈ Ioo 0 T) : + 4*δ^4/Y₀^2 ≤ 4*(Y t)^2/(Q t)^2 := by + apply (div_le_div_iff₀ (sq_pos_of_pos hY₀) (hq2 t ht)).2 + have ha := hangle t ht + have hb : (δ^2*Q t)^2 ≤ ((Y t)^2)^2 := + pow_le_pow_left₀ (mul_nonneg hd2.le (hQpos t ht).le) ha 2 + have hc : (Y t)^2 ≤ Y₀^2 := + pow_le_pow_left₀ (hYpos t ⟨ht.1.le,ht.2.le⟩).le (hYle t ⟨ht.1.le,ht.2.le⟩) 2 + have he := mul_le_mul_of_nonneg_left hc (sq_nonneg (Y t)) + nlinarith + have hmC : MonotoneOn (fun t => C t - (4*δ^4/Y₀^2)*t) (Icc 0 T) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 T) + (hC.sub (continuousOn_id.const_mul _)) + (f' := fun t => 4*(Y t)^2/(Q t)^2 - (4*δ^4/Y₀^2)) + · intro t ht + rw [interior_Icc] at ht + simpa only [mul_one] using + ((hdC t ht).sub ((hasDerivAt_id t).const_mul (4*δ^4/Y₀^2))).hasDerivWithinAt + (s := interior (Icc 0 T)) + · intro t ht + rw [interior_Icc] at ht + exact sub_nonneg.2 (hderivbound t ht) + have htime := hmC ⟨le_rfl,hT⟩ ⟨hT,le_rfl⟩ hT + simp only [hCinit, mul_zero, sub_zero] at htime + refine ⟨hheight, ?_⟩ + have hh : T ≤ u / (4*δ^4/Y₀^2) := (le_div_iff₀ hK).2 (by linarith) + convert hh using 1 + field_simp + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma finite_clock_bounds (h : IsLoewnerTraceUsing driver γ g f) + {T δ u : ℝ} (hT : 0 ≤ T) (hδ : 0 < δ) + (hU : ContinuousOn driver (Icc 0 T)) {z : ℂ} (hz : z ∈ localizationDomain γ T) + (hangle : ∀ t ∈ Ioo 0 T, + δ^2 * Complex.normSq (g t z - (driver t : ℂ)) ≤ (g t z).im^2) + (hr : (2*z.im)*Real.exp (-u) ≤ loewnerRadius g T z) : + z.im * Real.exp (-u/(2*δ^2)) ≤ (g T z).im ∧ + T ≤ u*z.im^2/(4*δ^4) := by + have hz0 : z ∈ halfPlane := hz.1.1 + have hy0 : 0 < z.im := hz0 + let C : ℝ → ℝ := fun t => Real.log (2*z.im) - Real.log (loewnerRadius g t z) + apply physical_clock_bounds (Y := fun t => (g t z).im) (C := C) + (Q := fun t => Complex.normSq (g t z - (driver t : ℂ))) hT hδ hy0 + · rw [h.initial z hz0] + · simp only [C, h.radius_initial hz0, sub_self] + · exact Complex.continuous_im.comp_continuousOn (h.continuous_eval hT hz) + · exact continuousOn_const.sub (h.continuous_log_radius hT hU hz) + · intro t ht + exact h.im_pos ht.1 (survivingDomain_mono ht.2 hz) + · intro t ht + exact h.height_le_initial ht.1 (survivingDomain_mono ht.2 hz) + · intro t ht + exact Complex.normSq_pos.2 (h.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hz)) + · exact hangle + · intro t ht + have hi := h.im_pos ht.1.le (survivingDomain_mono ht.2.le hz) + apply ((h.hasDerivAt_height ht.1 (survivingDomain_mono ht.2.le hz)).log hi.ne').congr_deriv + field_simp + · intro t ht + change HasDerivAt (fun s => Real.log (2*z.im) - Real.log (loewnerRadius g s z)) _ t + apply ((h.hasDerivAt_log_radius hT hU hz ht).const_sub (Real.log (2*z.im))).congr_deriv + ring + · have hh := Real.log_le_log (mul_pos (mul_pos (by norm_num) hy0) (Real.exp_pos (-u))) hr + rw [Real.log_mul (mul_ne_zero (by norm_num) hy0.ne') (Real.exp_ne_zero _), Real.log_exp] at hh + dsimp [C] + linarith + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.PartitionMeshes +open TaylorMeshes TimeField + +structure PartitionSequence (T : ℝ) where + count : ℕ → ℕ + time : ℕ → ℕ → ℝ + step : ℕ → ℝ + start : ∀ n, time n 0 = 0 + finish : ∀ n, time n (count n) = T + mono : ∀ n, Monotone (time n) + step_le : ∀ n i, i < count n → time n (i+1)-time n i ≤ step n + step_zero : Tendsto step atTop (𝓝 0) + +end SLEExactGauge.PartitionMeshes + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.PartitionMeshes +open TaylorMeshes TimeField +namespace PartitionSequence +variable {T : ℝ} (p : PartitionSequence T) + +include p in +lemma nonneg : 0 ≤ T := by + simpa only [p.start, p.finish] using p.mono 0 (Nat.zero_le (p.count 0)) + +lemma mem (n i : ℕ) (hi : i ≤ p.count n) : p.time n i ∈ Icc 0 T := by + constructor + · simpa only [p.start] using p.mono n (Nat.zero_le i) + · simpa only [p.finish] using p.mono n hi + +lemma increments_small {b : ℝ → ℝ} (hb : ContinuousOn b (Icc 0 T)) + {δ : ℝ} (hδ : 0 < δ) : + ∀ᶠ n in atTop, ∀ i < p.count n, |b (p.time n (i+1))-b (p.time n i)| < δ := by + obtain ⟨ε, hε, hmod⟩ := Metric.uniformContinuousOn_iff.1 + (isCompact_Icc.uniformContinuousOn_of_continuous hb) δ hδ + filter_upwards [p.step_zero.eventually (gt_mem_nhds hε)] with n hn + intro i hi + apply hmod _ (p.mem n (i+1) hi) _ (p.mem n i hi.le) + rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.2 (p.mono n (Nat.le_succ i)))] + exact (p.step_le n i hi).trans_lt hn + +lemma riemann_tendsto {h : ℝ → ℝ} (hh : ContinuousOn h (Icc 0 T)) : + Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + h (p.time n i) * (p.time n (i+1)-p.time n i)) atTop + (𝓝 (∫ t in (0 : ℝ)..T, h t)) := by + have hT := p.nonneg + have hint (n i : ℕ) (hi : i < p.count n) : + IntervalIntegrable h volume (p.time n i) (p.time n (i+1)) := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le (p.mono n (Nat.le_succ i))] + exact hh.mono (Icc_subset_Icc (p.mem n i hi.le).1 (p.mem n (i+1) hi).2) + have hu := isCompact_Icc.uniformContinuousOn_of_continuous hh + apply Metric.tendsto_atTop.2 + intro ε hε + let ζ : ℝ := ε / (T+1) + have hζ : 0 < ζ := div_pos hε (by linarith) + obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff.1 hu ζ hζ + obtain ⟨N, hN⟩ := eventually_atTop.1 (p.step_zero.eventually (gt_mem_nhds hδ)) + refine ⟨N, fun n hn => ?_⟩ + have hnδ := hN n hn + have hsum := intervalIntegral.sum_integral_adjacent_intervals (fun i hi => hint n i hi) + rw [p.start, p.finish] at hsum + have heach (i : ℕ) (hi : i < p.count n) : + |h (p.time n i) * (p.time n (i+1)-p.time n i) - + ∫ t in p.time n i..p.time n (i+1), h t| ≤ + ζ * (p.time n (i+1)-p.time n i) := by + have heq : h (p.time n i) * (p.time n (i+1)-p.time n i) = + ∫ _ : ℝ in p.time n i..p.time n (i+1), h (p.time n i) := by + rw [intervalIntegral.integral_const, smul_eq_mul, mul_comm] + rw [heq, ← intervalIntegral.integral_sub intervalIntegrable_const (hint n i hi)] + have hbound : ∀ t ∈ uIoc (p.time n i) (p.time n (i+1)), + ‖h (p.time n i)-h t‖ ≤ ζ := by + intro t ht + rw [uIoc_of_le (p.mono n (Nat.le_succ i))] at ht + have htT : t ∈ Icc 0 T := ⟨(p.mem n i hi.le).1.trans ht.1.le, + ht.2.trans (p.mem n (i+1) hi).2⟩ + have hd : dist (p.time n i) t < δ := by + rw [Real.dist_eq, abs_of_nonpos (sub_nonpos.2 ht.1.le)] + have hs := p.step_le n i hi + have ht' := ht.2 + linarith + simpa only [Real.norm_eq_abs, Real.dist_eq] using + (hmod _ (p.mem n i hi.le) _ htT hd).le + simpa only [Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.2 (p.mono n (Nat.le_succ i)))] using + intervalIntegral.norm_integral_le_of_norm_le_const hbound + rw [Real.dist_eq, ← hsum, ← Finset.sum_sub_distrib] + calc + _ ≤ ∑ i ∈ Finset.range (p.count n), + |h (p.time n i) * (p.time n (i+1)-p.time n i) - + ∫ t in p.time n i..p.time n (i+1), h t| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i ∈ Finset.range (p.count n), ζ * (p.time n (i+1)-p.time n i) := + Finset.sum_le_sum (fun i hi => heach i (Finset.mem_range.1 hi)) + _ = ζ * T := by + rw [← Finset.mul_sum, Finset.sum_range_sub (p.time n), p.start, p.finish, sub_zero] + _ < ε := by + dsimp only [ζ] + rw [div_mul_eq_mul_div, div_lt_iff₀ (by linarith : 0 < T+1)] + nlinarith + +lemma family_remainder_tendsto {f : ℕ → ℕ → ℝ → ℝ} {b : ℝ → ℝ} + (hf : ∀ n i, ContDiff ℝ 3 (f n i)) + {V K : ℝ} (hb : ContinuousOn b (Icc 0 T)) (hK : 0 ≤ K) + (h3 : ∀ n i x, |iteratedDeriv 3 (f n i) x| ≤ K) + (hQ : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2) atTop (𝓝 V)) : + Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + remainder₂ (f n i) (b (p.time n i)) (b (p.time n (i+1)))) atTop (𝓝 0) := by + have hV : 0 ≤ V := ge_of_tendsto hQ + (Eventually.of_forall fun _ => Finset.sum_nonneg fun _ _ => sq_nonneg _) + apply Metric.tendsto_atTop.2 + intro ε hε + let δ := ε / ((K+1)*(V+1)) + have hδ : 0 < δ := div_pos hε (mul_pos (by linarith) (by linarith)) + have hs := p.increments_small hb hδ + have hq := hQ.eventually (gt_mem_nhds (show V < V+1 by linarith)) + obtain ⟨N, hN⟩ := eventually_atTop.1 (hs.and hq) + refine ⟨N, fun n hn => ?_⟩ + rcases hN n hn with ⟨hs, hq⟩ + have hr := sum_family_remainder₂_bound (hf n) (fun i => b (p.time n i)) + (p.count n) K δ hK hδ.le (fun i _ z _ => h3 n i z) (fun i hi => (hs i hi).le) + simp only [Real.dist_eq, sub_zero] + calc + _ ≤ K * δ / 6 * ∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2 := hr + _ ≤ K * δ / 6 * (V+1) := mul_le_mul_of_nonneg_left hq.le (by positivity) + _ < ε := by + dsimp [δ] + have hden : 0 < (K+1)*(V+1) := mul_pos (by linarith) (by linarith) + have hid : K * (ε / ((K+1)*(V+1))) / 6 * (V+1) = ε * (K / (6*(K+1))) := by + field_simp + rw [hid] + have hk : K / (6*(K+1)) < 1 := (div_lt_one (by positivity)).2 (by linarith) + simpa using mul_lt_mul_of_pos_left hk hε + +end PartitionSequence + +end SLEExactGauge.PartitionMeshes + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.PartitionMeshes +open TaylorMeshes TimeField + +def clippedDyadic (T τ : ℝ) (hT : 0 ≤ T) (hτ : 0 ≤ τ) (hτT : τ ≤ T) : + PartitionSequence τ where + count := fun n => 2^n + time := fun n i => min (mesh T n i) τ + step := fun n => T / (2 : ℝ)^n + start := fun n => by rw [mesh_zero, min_eq_left hτ] + finish := fun n => by rw [mesh_end, min_eq_right hτT] + mono := fun n i j hij => min_le_min_right τ (mesh_mono T hT n hij) + step_le := by + intro n i hi + have hm := mesh_mono T hT n (Nat.le_succ i) + have hs := mesh_step T n i + by_cases h₁ : mesh T n i ≤ τ + · rw [min_eq_left h₁] + have hb := min_le_left (mesh T n (i+1)) τ + linarith + · rw [min_eq_right (le_of_not_ge h₁), + min_eq_right ((le_of_not_ge h₁).trans hm)] + simp only [sub_self] + positivity + step_zero := mesh_step_tendsto T + +end SLEExactGauge.PartitionMeshes + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.PartitionMeshes.PartitionSequence +open SLEExactGauge.TaylorMeshes SLEExactGauge.TimeField + +lemma time_increment_tendsto {T : ℝ} (p : PartitionSequence T) + {F V : ℝ → ℝ → ℝ} {b : ℝ → ℝ} + (hF : ∀ x, ContinuousOn (fun t => F t x) (Icc 0 T)) + (hD : ∀ t ∈ Ioo 0 T, ∀ x, HasDerivAt (fun u => F u x) (V t x) t) + (hV : ContinuousOn (fun q : ℝ × ℝ => V q.1 (b q.2)) ((Icc 0 T) ×ˢ (Icc 0 T))) : + Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))))) atTop + (𝓝 (∫ t in (0 : ℝ)..T, V t (b t))) := by + have hT := p.nonneg + have hVc : ContinuousOn (fun t => V t (b t)) (Icc 0 T) := + hV.comp (continuousOn_id.prodMk continuousOn_id) (fun t ht => ⟨ht, ht⟩) + have hriem := p.riemann_tendsto hVc + have herror : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))) - + V (p.time n i) (b (p.time n i)) * (p.time n (i+1)-p.time n i))) + atTop (𝓝 0) := by + have hu := (isCompact_Icc.prod isCompact_Icc).uniformContinuousOn_of_continuous hV + apply Metric.tendsto_atTop.2 + intro ε hε + let ζ : ℝ := ε / (T+1) + have hζ : 0 < ζ := div_pos hε (by linarith) + obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff.1 hu ζ hζ + obtain ⟨N, hN⟩ := eventually_atTop.1 (p.step_zero.eventually (gt_mem_nhds hδ)) + refine ⟨N, fun n hn => ?_⟩ + have hnδ := hN n hn + have heach (i : ℕ) (hi : i < p.count n) : + |F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))) - + V (p.time n i) (b (p.time n i)) * (p.time n (i+1)-p.time n i)| ≤ + ζ * (p.time n (i+1)-p.time n i) := by + rcases (p.mono n (Nat.le_succ i)).eq_or_lt with heq | hstep_pos + · simp [heq] + have hleft := p.mem n i hi.le + have hright := p.mem n (i+1) hi + obtain ⟨c, hc, heq⟩ := exists_hasDerivAt_eq_slope + (fun t => F t (b (p.time n (i+1)))) (fun t => V t (b (p.time n (i+1)))) + hstep_pos ((hF _).mono (Icc_subset_Icc hleft.1 hright.2)) + (fun t ht => hD t ⟨hleft.1.trans_lt ht.1, ht.2.trans_le hright.2⟩ _) + have hcT : c ∈ Icc 0 T := ⟨hleft.1.trans hc.1.le, hc.2.le.trans hright.2⟩ + have hdist : dist (c, p.time n (i+1)) (p.time n i, p.time n i) < δ := by + rw [Prod.dist_eq, max_lt_iff] + constructor + · rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.2 hc.1.le)] + have hcs := hc.2 + have hstep := p.step_le n i hi + linarith + · rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.2 hstep_pos.le)] + exact (p.step_le n i hi).trans_lt hnδ + have hvmod := (hmod (c, p.time n (i+1)) ⟨hcT, hright⟩ + (p.time n i, p.time n i) ⟨hleft, hleft⟩ hdist).le + simp only [Real.dist_eq] at hvmod + have hid : F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))) = + V c (b (p.time n (i+1))) * (p.time n (i+1)-p.time n i) := + ((eq_div_iff (sub_pos.2 hstep_pos).ne').1 heq).symm + rw [hid, ← sub_mul, abs_mul, abs_of_nonneg (sub_nonneg.2 hstep_pos.le)] + exact mul_le_mul_of_nonneg_right hvmod (sub_nonneg.2 hstep_pos.le) + rw [Real.dist_eq, sub_zero] + calc + _ ≤ ∑ i ∈ Finset.range (p.count n), + |F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))) - + V (p.time n i) (b (p.time n i)) * (p.time n (i+1)-p.time n i)| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i ∈ Finset.range (p.count n), ζ * (p.time n (i+1)-p.time n i) := + Finset.sum_le_sum (fun i hi => heach i (Finset.mem_range.1 hi)) + _ = ζ * T := by + rw [← Finset.mul_sum, Finset.sum_range_sub (p.time n), p.start, p.finish, sub_zero] + _ < ε := by + dsimp [ζ] + rw [div_mul_eq_mul_div, div_lt_iff₀ (by linarith : 0 < T+1)] + nlinarith + have hadd := herror.add hriem + simp only [Finset.sum_sub_distrib, sub_add_cancel, zero_add] at hadd + simpa only [Finset.sum_sub_distrib] using hadd + +end SLEExactGauge.PartitionMeshes.PartitionSequence + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.StoppedMeshes +open TaylorMeshes PartitionMeshes + +lemma one_crossing_sum_bound {N : ℕ} {t : ℕ → ℝ} (ht : Monotone t) + {τ E : ℝ} (hE : 0 ≤ E) {f : ℕ → ℝ} + (hz : ∀ i < N, ¬ (t i < τ ∧ τ < t (i+1)) → f i = 0) + (hb : ∀ i < N, t i < τ ∧ τ < t (i+1) → |f i| ≤ E) : + |∑ i ∈ Finset.range N, f i| ≤ E := by + classical + by_cases he : ∃ i < N, t i < τ ∧ τ < t (i+1) + · obtain ⟨i, hi, hcross⟩ := he + rw [Finset.sum_eq_single i] + · exact hb i hi hcross + · intro j hj hji + apply hz j (Finset.mem_range.1 hj) + intro hcj + rcases lt_or_gt_of_ne hji with hji | hij + · have hm := ht (show j+1 ≤ i by omega) + linarith [hcj.2, hcross.1] + · have hm := ht (show i+1 ≤ j by omega) + linarith [hcross.2, hcj.1] + · intro hni + exact (hni (Finset.mem_range.2 hi)).elim + · have heq : ∑ i ∈ Finset.range N, f i = 0 := by + apply Finset.sum_eq_zero + intro i hi + apply hz i (Finset.mem_range.1 hi) + intro hc + exact he ⟨i, Finset.mem_range.1 hi, hc⟩ + simpa [heq] using hE + +lemma clipped_increment_eq {a c τ : ℝ} (hac : a ≤ c) (b : ℝ → ℝ) + (hn : ¬ (a < τ ∧ τ < c)) : + b (min c τ) - b (min a τ) = if a < τ then b c - b a else 0 := by + by_cases ha : a < τ + · rw [ite_eq_left ha, min_eq_left ha.le, min_eq_left (le_of_not_gt (fun hc => hn ⟨ha,hc⟩))] + · have hτa : τ ≤ a := le_of_not_gt ha + rw [ite_eq_right ha, min_eq_right hτa, min_eq_right (hτa.trans hac), sub_self] + +lemma clipped_timeSum_difference_tendsto {T τ : ℝ} (hT : 0 ≤ T) + (A : ℕ → ℕ → ℝ) {K : ℝ} (hK : 0 ≤ K) (hA : ∀ n i, |A n i| ≤ K) : + Tendsto (fun n => + (∑ i ∈ Finset.range (2^n), A n i * + (min (mesh T n (i+1)) τ - min (mesh T n i) τ)) - + (∑ i ∈ Finset.range (2^n), + if mesh T n i < τ then A n i * (T / (2 : ℝ)^n) else 0)) atTop (𝓝 0) := by + refine squeeze_zero_norm (a := fun n => K * (T / (2 : ℝ)^n)) (fun n => ?_) ?_ + · rw [Real.norm_eq_abs, ← Finset.sum_sub_distrib] + apply one_crossing_sum_bound (τ := τ) (mesh_mono T hT n) (mul_nonneg hK (by positivity)) + · intro i hi hn + have heq := clipped_increment_eq (mesh_mono T hT n (Nat.le_succ i)) id hn + dsimp only [id_eq] at heq + rw [heq] + split_ifs <;> simp [mesh_step] + · intro i hi hc + rw [min_eq_right hc.2.le, min_eq_left hc.1.le, ite_eq_left hc.1] + rw [← mul_sub, abs_mul] + apply le_trans (mul_le_mul_of_nonneg_right (hA n i) (abs_nonneg _)) + apply mul_le_mul_of_nonneg_left _ hK + have hs := mesh_step T n i + rw [abs_of_nonpos (by linarith)] + linarith [hc.1] + · simpa using (mesh_step_tendsto T).const_mul K + +lemma clipped_linearSum_difference_tendsto {T τ : ℝ} (hT : 0 ≤ T) + (hτ : 0 ≤ τ) (hτT : τ ≤ T) {b : ℝ → ℝ} + (hb : ContinuousOn b (Icc 0 T)) (A : ℕ → ℕ → ℝ) + {K : ℝ} (hK : 0 ≤ K) (hA : ∀ n i, |A n i| ≤ K) : + Tendsto (fun n => + (∑ i ∈ Finset.range (2^n), A n i * + (b (min (mesh T n (i+1)) τ) - b (min (mesh T n i) τ))) - + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + A n i * (b (mesh T n (i+1)) - b (mesh T n i)) else 0)) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.2 + intro ε hε + let η : ℝ := ε / (K+1) + have hη : 0 < η := div_pos hε (by linarith) + obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff.1 + (isCompact_Icc.uniformContinuousOn_of_continuous hb) η hη + obtain ⟨N, hN⟩ := eventually_atTop.1 ((mesh_step_tendsto T).eventually (gt_mem_nhds hδ)) + refine ⟨N, fun n hn => ?_⟩ + rw [Real.dist_eq, sub_zero, ← Finset.sum_sub_distrib] + have hbound : |∑ i ∈ Finset.range (2^n), + (A n i * (b (min (mesh T n (i+1)) τ) - b (min (mesh T n i) τ)) - + if mesh T n i < τ then A n i * (b (mesh T n (i+1)) - b (mesh T n i)) else 0)| ≤ K*η := by + apply one_crossing_sum_bound (τ := τ) (mesh_mono T hT n) (mul_nonneg hK hη.le) + · intro i hi hni + rw [clipped_increment_eq (mesh_mono T hT n (Nat.le_succ i)) b hni] + split_ifs <;> simp + · intro i hi hc + rw [min_eq_right hc.2.le, min_eq_left hc.1.le, ite_eq_left hc.1, + ← mul_sub, sub_sub_sub_cancel_right, abs_mul] + apply mul_le_mul (hA n i) _ (abs_nonneg _) hK + have hd : dist τ (mesh T n (i+1)) < δ := by + rw [Real.dist_eq, abs_of_nonpos (sub_nonpos.2 hc.2.le)] + have hs := mesh_step T n i + have hnδ := hN n hn + linarith [hc.1] + exact (hmod τ ⟨hτ, hτT⟩ _ (mesh_mem T hT n (i+1) hi) hd).le + apply hbound.trans_lt + dsimp [η] + rw [← mul_div_assoc, div_lt_iff₀ (by linarith : 0 < K+1)] + nlinarith + +lemma abs_sq_sub_sq_le {x y η : ℝ} (hx : |x| ≤ 1) (hy : |y| ≤ 1) + (hη : 0 ≤ η) (hxy : |x-y| ≤ η) : |x^2-y^2| ≤ 2*η := by + calc + _ = |x-y| * |x+y| := by rw [← abs_mul]; congr 1; ring + _ ≤ η * (|x|+|y|) := mul_le_mul hxy (abs_add_le _ _) (abs_nonneg _) hη + _ ≤ η*(1+1) := mul_le_mul_of_nonneg_left (add_le_add hx hy) hη + _ = _ := by ring + +lemma clipped_quadraticSum_difference_tendsto {T τ : ℝ} (hT : 0 ≤ T) + (_hτ : 0 ≤ τ) (_hτT : τ ≤ T) {b : ℝ → ℝ} + (hb : ContinuousOn b (Icc 0 T)) (A : ℕ → ℕ → ℝ) + {K : ℝ} (hK : 0 ≤ K) (hA : ∀ n i, |A n i| ≤ K) : + Tendsto (fun n => + (∑ i ∈ Finset.range (2^n), A n i * + (b (min (mesh T n (i+1)) τ) - b (min (mesh T n i) τ))^2) - + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + A n i * (b (mesh T n (i+1)) - b (mesh T n i))^2 else 0)) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.2 + intro ε hε + let η : ℝ := ε / (2*K+1) + have hη : 0 < η := div_pos hε (by linarith) + obtain ⟨δ, hδ, hmod⟩ := Metric.uniformContinuousOn_iff.1 + (isCompact_Icc.uniformContinuousOn_of_continuous hb) (min 1 η) (lt_min (by norm_num) hη) + obtain ⟨N, hN⟩ := eventually_atTop.1 ((mesh_step_tendsto T).eventually (gt_mem_nhds hδ)) + refine ⟨N, fun n hn => ?_⟩ + rw [Real.dist_eq, sub_zero, ← Finset.sum_sub_distrib] + have hbound : |∑ i ∈ Finset.range (2^n), + (A n i * (b (min (mesh T n (i+1)) τ) - b (min (mesh T n i) τ))^2 - + if mesh T n i < τ then A n i * (b (mesh T n (i+1)) - b (mesh T n i))^2 else 0)| ≤ K*(2*η) := by + apply one_crossing_sum_bound (τ := τ) (mesh_mono T hT n) (by positivity) + · intro i hi hni + rw [clipped_increment_eq (mesh_mono T hT n (Nat.le_succ i)) b hni] + split_ifs <;> simp + · intro i hi hc + have hdist (x y : ℝ) (hx : x ∈ Icc (mesh T n i) (mesh T n (i+1))) + (hy : y ∈ Icc (mesh T n i) (mesh T n (i+1))) : dist x y < δ := by + rw [Real.dist_eq, abs_lt] + have hs := mesh_step T n i + have hnδ := hN n hn + constructor <;> linarith [hx.1,hx.2,hy.1,hy.2] + have hmod' (x y : ℝ) (hx : x ∈ Icc (mesh T n i) (mesh T n (i+1))) + (hy : y ∈ Icc (mesh T n i) (mesh T n (i+1))) : + |b x-b y| ≤ min 1 η := by + have hsub := Icc_subset_Icc (mesh_mem T hT n i hi.le).1 (mesh_mem T hT n (i+1) hi).2 + exact (hmod x (hsub hx) y (hsub hy) (hdist x y hx hy)).le + have hcurr : mesh T n i ≤ mesh T n (i+1) := mesh_mono T hT n (Nat.le_succ i) + have hτmem : τ ∈ Icc (mesh T n i) (mesh T n (i+1)) := ⟨hc.1.le,hc.2.le⟩ + have hx := (hmod' τ _ hτmem (left_mem_Icc.2 hcurr)).trans (min_le_left _ _) + have hy := (hmod' _ _ (right_mem_Icc.2 hcurr) (left_mem_Icc.2 hcurr)).trans (min_le_left _ _) + have hxy := (hmod' τ _ hτmem (right_mem_Icc.2 hcurr)).trans (min_le_right _ _) + rw [min_eq_right hc.2.le, min_eq_left hc.1.le, ite_eq_left hc.1, ← mul_sub, abs_mul] + apply mul_le_mul (hA n i) _ (abs_nonneg _) hK + apply abs_sq_sub_sq_le hx hy hη.le + simpa only [sub_sub_sub_cancel_right] using hxy + apply hbound.trans_lt + dsimp [η] + rw [show K * (2 * (ε / (2*K+1))) = (2*K*ε)/(2*K+1) by ring, + div_lt_iff₀ (by linarith : 0 < 2*K+1)] + nlinarith + +lemma clipped_mem {T τ : ℝ} (hT : 0 ≤ T) (hτ : 0 ≤ τ) (n i : ℕ) : + min (mesh T n i) τ ∈ Icc 0 τ := by + constructor + · exact le_min (by unfold mesh; positivity) hτ + · exact min_le_right _ _ + +lemma prestop_riemann_tendsto {T τ : ℝ} (hT : 0 ≤ T) (hτ : 0 ≤ τ) (hτT : τ ≤ T) + {C : ℝ → ℝ} (hC : ContinuousOn C (Icc 0 τ)) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + if mesh T n i < τ then C (mesh T n i) * (T / (2 : ℝ)^n) else 0) atTop + (𝓝 (∫ t in (0 : ℝ)..τ, C t)) := by + let p := clippedDyadic T τ hT hτ hτT + have hriem := p.riemann_tendsto hC + obtain ⟨K, hK⟩ := isCompact_Icc.exists_bound_of_continuousOn hC + have hKn : 0 ≤ K := (norm_nonneg _).trans (hK 0 ⟨le_rfl,hτ⟩) + have hdiff := clipped_timeSum_difference_tendsto (τ := τ) hT + (fun n i => C (min (mesh T n i) τ)) hKn + (fun n i => hK _ (clipped_mem hT hτ n i)) + have heq (n i : ℕ) : + (if mesh T n i < τ then C (min (mesh T n i) τ) * (T / (2 : ℝ)^n) else 0) = + (if mesh T n i < τ then C (mesh T n i) * (T / (2 : ℝ)^n) else 0) := by + split_ifs with h + · rw [min_eq_left h.le] + · rfl + simp only [heq] at hdiff + have hh := hriem.sub hdiff + simpa only [p, clippedDyadic, sub_sub_cancel, sub_zero] using hh + +end SLEExactGauge.StoppedMeshes + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.PartitionMeshes.PartitionSequence +open SLEExactGauge.TaylorMeshes SLEExactGauge.TimeField + +lemma family_remainder_tendsto_of_eventually_bounded {T : ℝ} (p : PartitionSequence T) + {f : ℕ → ℕ → ℝ → ℝ} {b : ℝ → ℝ} + (hf : ∀ n i, ContDiff ℝ 3 (f n i)) {V K : ℝ} + (hb : ContinuousOn b (Icc 0 T)) (hV : 0 ≤ V) (hK : 0 ≤ K) + (h3 : ∀ n i x, |iteratedDeriv 3 (f n i) x| ≤ K) + (hQ : ∀ᶠ n in atTop, (∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2) ≤ V) : + Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + remainder₂ (f n i) (b (p.time n i)) (b (p.time n (i+1)))) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.2 + intro ε hε + let δ := ε / ((K+1)*(V+1)) + have hδ : 0 < δ := div_pos hε (mul_pos (by linarith) (by linarith)) + have hs := p.increments_small hb hδ + obtain ⟨N, hN⟩ := eventually_atTop.1 (hs.and hQ) + refine ⟨N, fun n hn => ?_⟩ + rcases hN n hn with ⟨hs, hq⟩ + have hr := sum_family_remainder₂_bound (hf n) (fun i => b (p.time n i)) + (p.count n) K δ hK hδ.le (fun i _ z _ => h3 n i z) (fun i hi => (hs i hi).le) + simp only [Real.dist_eq, sub_zero] + calc + _ ≤ K * δ / 6 * ∑ i ∈ Finset.range (p.count n), + (b (p.time n (i+1))-b (p.time n i))^2 := hr + _ ≤ K * δ / 6 * (V+1) := + mul_le_mul_of_nonneg_left (hq.trans (by linarith)) (by positivity) + _ < ε := by + dsimp [δ] + have hden : 0 < (K+1)*(V+1) := mul_pos (by linarith) (by linarith) + have hid : K * (ε / ((K+1)*(V+1))) / 6 * (V+1) = ε * (K / (6*(K+1))) := by + field_simp + rw [hid] + have hk : K / (6*(K+1)) < 1 := (div_lt_one (by positivity)).2 (by linarith) + simpa using mul_lt_mul_of_pos_left hk hε + +end SLEExactGauge.PartitionMeshes.PartitionSequence + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.StoppedMeshes +open TaylorMeshes PartitionMeshes + +lemma clipped_quadratic_eventually_bounded {T τ V : ℝ} (hT : 0 ≤ T) + (hτ : 0 ≤ τ) (hτT : τ ≤ T) {b : ℝ → ℝ} (hb : ContinuousOn b (Icc 0 T)) + (hQ : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1)) - b (mesh T n i))^2) atTop (𝓝 V)) : + ∀ᶠ n in atTop, (∑ i ∈ Finset.range (2^n), + (b (min (mesh T n (i+1)) τ) - b (min (mesh T n i) τ))^2) ≤ V+2 := by + have hd := clipped_quadraticSum_difference_tendsto hT hτ hτT hb + (fun _ _ => 1) (by norm_num : (0 : ℝ) ≤ 1) (fun _ _ => by norm_num) + simp only [one_mul] at hd + filter_upwards [hd.eventually (gt_mem_nhds (show (0 : ℝ) < 1 by norm_num)), + hQ.eventually (gt_mem_nhds (show V < V+1 by linarith))] with n hn hqn + have hle : (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + (b (mesh T n (i+1)) - b (mesh T n i))^2 else 0) ≤ + ∑ i ∈ Finset.range (2^n), (b (mesh T n (i+1)) - b (mesh T n i))^2 := by + apply Finset.sum_le_sum + intro i hi + split_ifs + · exact le_rfl + · exact sq_nonneg _ + linarith + +end SLEExactGauge.StoppedMeshes + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.BrownianStopped +open TaylorMeshes TimeField PartitionMeshes StoppedMeshes BrownianField + +lemma coefficient_clipped_bound {T τ K : ℝ} (C : ℝ → ℝ) + (hC : ∀ n i, mesh T n i < τ → |C (mesh T n i)| ≤ K) (n i : ℕ) : + |C (min (mesh T n i) τ)| ≤ max K |C τ| := by + by_cases h : mesh T n i < τ + · rw [min_eq_left h.le] + exact (hC n i h).trans (le_max_left _ _) + · rw [min_eq_right (le_of_not_gt h)] + exact le_max_right _ _ + +lemma stopped_field_taylor_limit {T τ : ℝ} (hT : 0 ≤ T) (hτ : 0 ≤ τ) (hτT : τ ≤ T) + {F V : ℝ → ℝ → ℝ} {b : ℝ → ℝ} + (hb : ContinuousOn b (Icc 0 T)) (hreg : FieldRegular F V b τ) + (hQ : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1)) - b (mesh T n i))^2) atTop (𝓝 T)) + {K₁ K₂ : ℝ} (hK₁ : 0 ≤ K₁) (hK₂ : 0 ≤ K₂) + (hA : ∀ n i, mesh T n i < τ → + |deriv (F (mesh T n i)) (b (mesh T n i))| ≤ K₁) + (hC : ∀ n i, mesh T n i < τ → + |iteratedDeriv 2 (F (mesh T n i)) (b (mesh T n i))| ≤ K₂) + (hE : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + iteratedDeriv 2 (F (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1)) - b (mesh T n i))^2 - T/(2 : ℝ)^n) else 0) atTop (𝓝 0)) : + Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + deriv (F (mesh T n i)) (b (mesh T n i)) * + (b (mesh T n (i+1)) - b (mesh T n i)) else 0) atTop + (𝓝 (F τ (b τ) - F 0 (b 0) - (∫ t in (0 : ℝ)..τ, V t (b t)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..τ, iteratedDeriv 2 (F t) (b t))) := by + let p := clippedDyadic T τ hT hτ hτT + let C : ℝ → ℝ := fun t => iteratedDeriv 2 (F t) (b t) + let A : ℝ → ℝ := fun t => deriv (F t) (b t) + have hbτ := hb.mono (Icc_subset_Icc le_rfl hτT) + have hQc := clipped_quadratic_eventually_bounded hT hτ hτT hb hQ + obtain ⟨K₃, hK₃, h₃⟩ := hreg.third_bound + have hr := p.family_remainder_tendsto_of_eventually_bounded + (f := fun n i => F (p.time n i)) (fun _ _ => hreg.smooth _) + hbτ (show 0 ≤ T+2 by linarith) hK₃ (fun _ _ x => h₃ _ x) hQc + have htime := p.time_increment_tendsto hreg.time_cont hreg.time_deriv hreg.drift_cont + have hriem := prestop_riemann_tendsto hT hτ hτT hreg.second_cont + let Qpred : ℕ → ℝ := fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + C (mesh T n i) * (b (mesh T n (i+1)) - b (mesh T n i))^2 else 0 + have hQpred : Tendsto Qpred atTop (𝓝 (∫ t in (0 : ℝ)..τ, C t)) := by + have heq (n : ℕ) : Qpred n = + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then + C (mesh T n i) * ((b (mesh T n (i+1))-b (mesh T n i))^2-T/(2 : ℝ)^n) else 0) + + (∑ i ∈ Finset.range (2^n), if mesh T n i < τ then C (mesh T n i)*(T/(2 : ℝ)^n) else 0) := by + unfold Qpred + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + split_ifs <;> ring + dsimp only [C] at heq + simpa only [← heq, zero_add] using hE.add hriem + have hQdiff := clipped_quadraticSum_difference_tendsto hT hτ hτT hb + (fun n i => C (p.time n i)) + (K := max K₂ |C τ|) (hK₂.trans (le_max_left _ _)) + (coefficient_clipped_bound C hC) + have hQeq (n i : ℕ) : + (if mesh T n i < τ then C (p.time n i) * + (b (mesh T n (i+1))-b (mesh T n i))^2 else 0) = + (if mesh T n i < τ then C (mesh T n i) * + (b (mesh T n (i+1))-b (mesh T n i))^2 else 0) := by + split_ifs with h + · simp only [p, clippedDyadic, min_eq_left h.le] + · rfl + simp only [hQeq] at hQdiff + have hQweighted : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + C (p.time n i) * (b (p.time n (i+1)) - b (p.time n i))^2) atTop + (𝓝 (∫ t in (0 : ℝ)..τ, C t)) := by + simpa only [Qpred, sub_add_cancel, zero_add, p, clippedDyadic] using hQdiff.add hQpred + have hTel (n : ℕ) : ∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n i))) = F τ (b τ) - F 0 (b 0) := by + rw [Finset.sum_range_sub (fun i => F (p.time n i) (b (p.time n i))), p.start, p.finish] + have hIdentity (n : ℕ) : (∑ i ∈ Finset.range (p.count n), + A (p.time n i)*(b (p.time n (i+1))-b (p.time n i))) = + F τ (b τ) - F 0 (b 0) - + (∑ i ∈ Finset.range (p.count n), + (F (p.time n (i+1)) (b (p.time n (i+1))) - + F (p.time n i) (b (p.time n (i+1))))) - (1/2 : ℝ)* + (∑ i ∈ Finset.range (p.count n), + C (p.time n i)*(b (p.time n (i+1))-b (p.time n i))^2) - + (∑ i ∈ Finset.range (p.count n), remainder₂ (F (p.time n i)) + (b (p.time n i)) (b (p.time n (i+1)))) := by + rw [← hTel n] + simp only [Finset.mul_sum, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i hi + simp only [A, C, remainder₂, iteratedDeriv_succ, iteratedDeriv_zero] + ring + have hAclip : Tendsto (fun n => ∑ i ∈ Finset.range (p.count n), + A (p.time n i)*(b (p.time n (i+1))-b (p.time n i))) atTop + (𝓝 (F τ (b τ) - F 0 (b 0) - (∫ t in (0 : ℝ)..τ, V t (b t)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..τ, C t)) := by + have hh := (((tendsto_const_nhds (x := F τ (b τ) - F 0 (b 0))).sub + htime).sub (hQweighted.const_mul (1/2 : ℝ))).sub hr + simpa only [← hIdentity, sub_zero] using hh + have hAdiff := clipped_linearSum_difference_tendsto hT hτ hτT hb + (fun n i => A (p.time n i)) + (K := max K₁ |A τ|) (hK₁.trans (le_max_left _ _)) + (coefficient_clipped_bound A hA) + have hAeq (n i : ℕ) : + (if mesh T n i < τ then A (p.time n i) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0) = + (if mesh T n i < τ then A (mesh T n i) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0) := by + split_ifs with h + · simp only [p, clippedDyadic, min_eq_left h.le] + · rfl + simp only [hAeq] at hAdiff + have hh := hAclip.sub hAdiff + simpa only [p, clippedDyadic, A, C, sub_sub_cancel, sub_zero] using hh + +end SLEExactGauge.BrownianStopped + +end + +end + +end + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +noncomputable section +open Set Filter MeasureTheory +open scoped Topology +namespace SLEExactGauge.BrownianStopped +open BrownianPredictable PredictableLimit BrownianIto TaylorMeshes BrownianField + +def stoppedCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T : ℝ≥0) + (τ : Ω → ℝ) (F : Ω → ℝ → ℝ → ℝ) (n i : ℕ) (ω : Ω) : ℝ := + if mesh T n i < τ ω then + iteratedDeriv k (F ω (mesh T n i)) (B (dyadicTime T n i) ω) else 0 + +theorem stopped_fieldSum_tendsto {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ ω ∂P, 0 ≤ τ ω ∧ τ ω ≤ T) + (hreg : ∀ᵐ ω ∂P, FieldRegular (F ω) (V ω) (fun t => B t.toNNReal ω) (τ ω)) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (stoppedCoeff 2 B T τ F n i)) + (hC2 : ∀ n i, MemLp (stoppedCoeff 2 B T τ F n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁) : + ∀ᵐ ω ∂P, Tendsto (fun n => dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n ω) atTop + (𝓝 (F ω (τ ω) (B (τ ω).toNNReal ω) - F ω 0 (B 0 ω) - + (∫ t in (0 : ℝ)..(τ ω), V ω t (B t.toNNReal ω)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ ω), + iteratedDeriv 2 (F ω t) (B t.toNNReal ω))) := by + have he := brownian_dyadic_weighted_quadraticError_tendsto hB T + (stoppedCoeff 2 B T τ F) hC hC2 K₂ hK₂ hbound + have hC_all : ∀ᵐ ω ∂P, ∀ n i, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hbound n)) + have hA_all : ∀ᵐ ω ∂P, ∀ n i, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁ := + ae_all_iff.2 (fun n => ae_all_iff.2 (hAbound n)) + filter_upwards [hB.cont, quadraticSum_tendsto hB T, he, hreg, hτ, hC_all, hA_all] + with ω hb hQ hE hr hτω hCω hAω + let b : ℝ → ℝ := fun t => B t.toNNReal ω + have hbc : Continuous b := hb.comp continuous_real_toNNReal + have hQ' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), + (b (mesh T n (i+1))-b (mesh T n i))^2) atTop (𝓝 (T : ℝ)) := by + simpa only [quadraticSum, b, mesh_toNNReal] using hQ + have hE' : Tendsto (fun n => ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0) + atTop (𝓝 0) := by + have heq (n : ℕ) : dyadicQuadraticError B T (stoppedCoeff 2 B T τ F) n ω = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i)) * + ((b (mesh T n (i+1))-b (mesh T n i))^2 - (T : ℝ)/(2 : ℝ)^n) else 0 := by + unfold dyadicQuadraticError + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal] + split_ifs <;> simp + simpa only [heq] using hE + have hA' (n i : ℕ) (hi : mesh T n i < τ ω) : + |deriv (F ω (mesh T n i)) (b (mesh T n i))| ≤ K₁ := by + simpa only [stoppedCoeff, ite_eq_left hi, iteratedDeriv_succ, iteratedDeriv_zero, + b, mesh_toNNReal] using hAω n i + have hC' (n i : ℕ) (hi : mesh T n i < τ ω) : + |iteratedDeriv 2 (F ω (mesh T n i)) (b (mesh T n i))| ≤ K₂ := by + simpa only [stoppedCoeff, ite_eq_left hi, b, mesh_toNNReal] using hCω n i + have ht := stopped_field_taylor_limit T.coe_nonneg hτω.1 hτω.2 hbc.continuousOn + hr hQ' hK₁ hK₂ hA' hC' hE' + have heq (n : ℕ) : dyadicDriverSum B T (stoppedCoeff 1 B T τ F) n ω = + ∑ i ∈ Finset.range (2^n), if mesh T n i < τ ω then + deriv (F ω (mesh T n i)) (b (mesh T n i)) * + (b (mesh T n (i+1))-b (mesh T n i)) else 0 := by + unfold dyadicDriverSum + apply Finset.sum_congr rfl + intro i hi + simp only [stoppedCoeff, b, mesh_toNNReal, iteratedDeriv_succ, iteratedDeriv_zero] + split_ifs <;> simp + simpa only [← heq, b, Real.toNNReal_zero] using ht + +theorem stopped_field_ito_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (T : ℝ≥0) + (τ : Ω → ℝ) (F V : Ω → ℝ → ℝ → ℝ) + (hτ : ∀ᵐ ω ∂P, 0 ≤ τ ω ∧ τ ω ≤ T) + (hreg : ∀ᵐ ω ∂P, FieldRegular (F ω) (V ω) (fun t => B t.toNNReal ω) (τ ω)) + (hC : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (stoppedCoeff 2 B T τ F n i)) + (hC2 : ∀ n i, MemLp (stoppedCoeff 2 B T τ F n i) 2 P) + (K₂ : ℝ) (hK₂ : 0 ≤ K₂) + (hbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 2 B T τ F n i ω| ≤ K₂) + (hA : ∀ n i, Measurable[pastSigma B (dyadicTime T n i)] (stoppedCoeff 1 B T τ F n i)) + (hA2 : ∀ n i, MemLp (stoppedCoeff 1 B T τ F n i) 2 P) + (K₁ : ℝ) (hK₁ : 0 ≤ K₁) + (hAbound : ∀ n i, ∀ᵐ ω ∂P, |stoppedCoeff 1 B T τ F n i ω| ≤ K₁) : + let Y := fun ω => F ω (τ ω) (B (τ ω).toNNReal ω) - F ω 0 (B 0 ω) - + (∫ t in (0 : ℝ)..(τ ω), V ω t (B t.toNNReal ω)) - + (1/2 : ℝ) * ∫ t in (0 : ℝ)..(τ ω), iteratedDeriv 2 (F ω t) (B t.toNNReal ω) + Integrable Y P ∧ (∫ ω, Y ω ∂P) = 0 := by + dsimp only + exact limit_centered hB T (stoppedCoeff 1 B T τ F) hA hA2 K₁ hK₁ hAbound _ + (stopped_fieldSum_tendsto hB T τ F V hτ hreg hC hC2 K₂ hK₂ hbound K₁ hK₁ hAbound) + +end SLEExactGauge.BrownianStopped + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/StrongRestart.lean b/lean/OAI/Probability/SLELocalization/StrongRestart.lean new file mode 100644 index 0000000000000000000000000000000000000000..63f9ded7031dcec958190a2a745158138f130cde --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/StrongRestart.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Probability.SLELocalization.BrownianSupport +import OAI.Probability.SLELocalization.CommonClocks +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Brownian Predictable estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BrownianPredictable + +lemma aemeasurable_select_nat {Ω E : Type*} [MeasurableSpace Ω] [MeasurableSpace E] + {P : Measure Ω} {Y : Ω → ℕ} (hY : AEMeasurable Y P) (F : ℕ → Ω → E) + (hF : ∀ k, AEMeasurable (F k) P) : AEMeasurable (fun sample => F (Y sample) sample) P := by + have hm : Measurable (fun x : ℕ × (ℕ → E) => x.2 x.1) := + measurable_from_prod_countable_right (fun k => measurable_pi_apply k) + exact hm.comp_aemeasurable (hY.prodMk (AEMeasurable.of_eval hF)) + +lemma measure_nat_partition {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {Y : Ω → ℕ} (hY : AEMeasurable Y P) (S : Set Ω) (hS : NullMeasurableSet S P) : + P S = ∑' k : ℕ, P (S ∩ {sample | Y sample = k}) := by + have hpieces (k : ℕ) : NullMeasurableSet (S ∩ {sample | Y sample = k}) P := + hS.inter (hY.nullMeasurableSet_preimage (measurableSet_singleton k)) + have hd : Pairwise (fun i j : ℕ => Disjoint (S ∩ {sample | Y sample = i}) + (S ∩ {sample | Y sample = j})) := by + intro i j hij + apply Set.disjoint_left.2 + intro sample hi hj + exact hij (hi.2.symm.trans hj.2) + have he : (⋃ k : ℕ, S ∩ {sample | Y sample = k}) = S := by + ext sample + simp + calc + P S = P (⋃ k : ℕ, S ∩ {sample | Y sample = k}) := congrArg P he.symm + _ = _ := measure_iUnion₀ (fun i j hij => (hd hij).aedisjoint) hpieces + +lemma countable_restart_law {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (Y : Ω → ℕ) (hY : AEMeasurable Y P) + (s : ℕ → ℝ≥0) (A : Set Ω) (hA : NullMeasurableSet A P) (hA0 : P A ≠ 0) + (hpieces : ∀ k, MeasurableSet[pastSigma B (s k)] (A ∩ {sample | Y sample = k})) + (I : Finset ℝ≥0) : + HasLaw (fun sample => I.restrict (fun t => B (s (Y sample)+t) sample-B (s (Y sample)) sample)) + (BrownianReal.projectiveFamily I) ((P A)⁻¹ • P.restrict A) := by + let F (k : ℕ) (sample : Ω) := I.restrict (fun t => B (s k+t) sample-B (s k) sample) + have hF (k : ℕ) : HasLaw (F k) (BrownianReal.projectiveFamily I) P := + (hB.shift (s k)).toIsPreBrownianReal.hasLaw I + let X := fun sample => F (Y sample) sample + have hX : AEMeasurable X P := aemeasurable_select_nat hY F (fun k => (hF k).aemeasurable) + refine ⟨hX.restrict.smul_measure _,?_⟩ + apply Measure.ext + intro E hE + rw [Measure.map_apply_of_aemeasurable (hX.restrict.smul_measure _) hE, + Measure.smul_apply,smul_eq_mul,Measure.restrict_apply₀ (hX.restrict.nullMeasurableSet_preimage hE),inter_comm] + have hind (k : ℕ) : P ((A ∩ {sample | Y sample = k}) ∩ (F k ⁻¹' E)) = + P (A ∩ {sample | Y sample = k}) * (BrownianReal.projectiveFamily I) E := by + have hi := (hB.toIsPreBrownianReal.indepFun_shift (s k)).symm.comp + measurable_id (show Measurable (fun f : ℝ≥0 → ℝ => I.restrict f) from + Measurable.of_eval (fun t => measurable_pi_apply (t : ℝ≥0))) + have hh := hi.meas_inter (hpieces k) (hE.preimage (comap_measurable (F k))) + have hll : P (F k ⁻¹' E) = (BrownianReal.projectiveFamily I) E := (hF k).measure_eq hE + rw [hll] at hh + exact hh + have he (k : ℕ) : (A ∩ X ⁻¹' E) ∩ {sample | Y sample = k} = + (A ∩ {sample | Y sample = k}) ∩ F k ⁻¹' E := by + ext sample + simp only [mem_inter_iff,mem_preimage,mem_ofPred_eq,X] + constructor + · rintro ⟨⟨ha,hf⟩,hy⟩ + exact ⟨⟨ha,hy⟩,hy ▸ hf⟩ + · rintro ⟨⟨ha,hy⟩,hf⟩ + exact ⟨⟨ha,hy ▸ hf⟩,hy⟩ + rw [measure_nat_partition hY (A ∩ X ⁻¹' E) (hA.inter (hX.nullMeasurableSet_preimage hE))] + simp_rw [he,hind] + rw [ENNReal.tsum_mul_right,← measure_nat_partition hY A hA,← mul_assoc, + ENNReal.inv_mul_cancel hA0 (measure_ne_top P A),one_mul] + +lemma hasLaw_of_ae_limit {Ω E : Type*} [MeasurableSpace Ω] [PseudoMetricSpace E] + [MeasurableSpace E] [BorelSpace E] {P : Measure Ω} [IsFiniteMeasure P] + {μ : Measure E} [IsFiniteMeasure μ] {X : ℕ → Ω → E} {Y : Ω → E} + (hX : ∀ n, HasLaw (X n) μ P) + (hlim : ∀ᵐ sample ∂P, Tendsto (fun n => X n sample) atTop (𝓝 (Y sample))) : HasLaw Y μ P := by + have hY : AEMeasurable Y P := aemeasurable_of_tendsto_metrizable_ae atTop + (fun n => (hX n).aemeasurable) hlim + refine ⟨hY,?_⟩ + apply ext_of_forall_integral_eq_of_IsFiniteMeasure + intro φ + rw [integral_map hY φ.continuous.measurable.aestronglyMeasurable] + have ht := tendsto_integral_of_dominated_convergence + (F := fun n sample => φ (X n sample)) (f := fun sample => φ (Y sample)) (fun _ : Ω => ‖φ‖) + (fun n => (φ.continuous.measurable.comp_aemeasurable (hX n).aemeasurable).aestronglyMeasurable) + (integrable_const ‖φ‖) (fun n => Filter.Eventually.of_forall (fun sample => φ.norm_coe_le_norm _)) + (hlim.mono (fun sample hh => φ.continuous.continuousAt.tendsto.comp hh)) + have he (n : ℕ) : (∫ sample, φ (X n sample) ∂P) = ∫ x, φ x ∂μ := + (hX n).integral_comp φ.continuous.measurable.aestronglyMeasurable + simp only [he] at ht + exact tendsto_nhds_unique ht tendsto_const_nhds + +theorem brownianStrongRestart {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (τ : Ω → ℝ≥0) (hτ : AEMeasurable τ P) + (A : Set Ω) (hA : NullMeasurableSet A P) (hA0 : P A ≠ 0) + (hstop : ∀ t : ℝ≥0, MeasurableSet[pastSigma B t] (A ∩ {sample | τ sample ≤ t})) : + IsBrownianReal (fun t sample => B (τ sample+t) sample-B (τ sample) sample) + ((P A)⁻¹ • P.restrict A) := by + let Q : Measure Ω := (P A)⁻¹ • P.restrict A + have hQP : Q ≪ P := Measure.smul_absolutelyContinuous.trans + Measure.restrict_le_self.absolutelyContinuous + have : IsProbabilityMeasure Q := ⟨by + simp only [Q,Measure.smul_apply,smul_eq_mul,Measure.restrict_apply_univ] + exact ENNReal.inv_mul_cancel hA0 (measure_ne_top P A)⟩ + have hc : ∀ᵐ sample ∂Q, Continuous (fun t => B t sample) := hQP.ae_le hB.cont + refine ⟨⟨fun I => ?_⟩,?_⟩ + · apply hasLaw_of_ae_limit (X := fun n sample => + I.restrict (fun t => B (restartTime τ n sample+t) sample-B (restartTime τ n sample) sample)) + · intro n + exact countable_restart_law hB (restartIndex τ n) (restartIndex_aemeasurable hτ n) + (restartGrid n) A hA hA0 (restartIndex_past B τ A hstop n) I + · filter_upwards [hc] with sample hh + apply tendsto_pi_nhds.2 + intro t + exact ((hh.continuousAt.tendsto.comp ((restartTime_tendsto τ sample).add tendsto_const_nhds)).sub + (hh.continuousAt.tendsto.comp (restartTime_tendsto τ sample))) + · filter_upwards [hc] with sample hh + exact (hh.comp (continuous_const.add continuous_id)).sub continuous_const + +end SLEExactGauge.BrownianPredictable + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/SwallowingLaws.lean b/lean/OAI/Probability/SLELocalization/SwallowingLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..2983acbe63043b48f2a3c4fea87b22ffd0457f86 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/SwallowingLaws.lean @@ -0,0 +1,945 @@ +import Mathlib +import OAI.Probability.SLELocalization.GreenTilts +import OAI.Probability.SLE.IntegralLimits +import OAI.Probability.SLE.ItoIsometry +import OAI.Probability.SLE.StochasticIntegrals + +namespace OAI + + +/-! Conformal localization and Swallowing estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.Swallowing +open GreenPhysical + +lemma generator_eq (κ β C x y : ℝ) (hy : 0 < y) : + generator κ β C x y = + (x^2+y^2)^(β/2-1) * + (β*(κ-4)/2 + β*(8-2*κ+κ*β)/2*(x^2/(x^2+y^2))) - + (2*C*β)*y^β/(x^2+y^2) := by + have hq := (q_pos x hy).ne' + have hp : (x^2+y^2)^(β/2-2) = (x^2+y^2)^(β/2-1)/(x^2+y^2) := by + rw [← Real.rpow_sub_one hq] + congr 1 + ring + have hyp : y^(β-1)*y = y^β := by + conv_lhs => rhs; rw [← Real.rpow_one y] + rw [← Real.rpow_add hy] + congr 1 + ring + unfold generator radialXX + rw [hp] + calc + _ = (x^2+y^2)^(β/2-1)* + (β*(κ-4)/2+β*(8-2*κ+κ*β)/2*(x^2/(x^2+y^2))) - + 2*C*β*(y^(β-1)*y)/(x^2+y^2) := by field_simp; ring + _ = _ := by rw [hyp] + +lemma radial_height_ineq {β : ℝ} (hβ : β ≤ 2) (x : ℝ) {y : ℝ} (hy : 0 < y) : + (x^2+y^2)^(β/2-1)*y^2 ≤ y^β := by + have hh := Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos hy) + (show y^2 ≤ x^2+y^2 by nlinarith [sq_nonneg x]) (show β/2-1 ≤ 0 by linarith) + calc + _ ≤ (y^2)^(β/2-1)*y^2 := mul_le_mul_of_nonneg_right hh (sq_nonneg y) + _ = y^β := by + rw [← Real.rpow_natCast_mul hy.le] + conv_lhs => rhs; rw [← Real.rpow_natCast] + rw [← Real.rpow_add hy] + norm_num + congr 1 + ring + +lemma generator_negative {κ β : ℝ} (hκ : 4 < κ) (hβ : 0 < β) + (hβκ : β < 1-4/κ) (x : ℝ) {y : ℝ} (hy : 0 < y) : + let C := (2*κ-8-κ*β)/4 + let d := β*(κ-4-κ*β)/2 + 0 < C ∧ 0 < d ∧ generator κ β C x y ≤ -d*(x^2+y^2)^(β/2-1) := by + have hk : 0 < κ := by linarith + have hbk : κ*β < κ-4 := by + have hh := (mul_lt_mul_of_pos_left hβκ hk) + field_simp at hh + linarith + have hb2 : β ≤ 2 := by + have h4 := div_pos (by norm_num : (0:ℝ)<4) hk + linarith + dsimp only + have hC : 0 < (2*κ-8-κ*β)/4 := by linarith + have hd : 0 < β*(κ-4-κ*β)/2 := by positivity + refine ⟨hC,hd,?_⟩ + have he := radial_height_ineq hb2 x hy + have hq := q_pos x hy + have hh := mul_le_mul_of_nonneg_left he (show 0 ≤ β*(2*κ-8-κ*β)/2 from div_nonneg (mul_nonneg hβ.le (by linarith)) (by norm_num)) + rw [generator_eq _ _ _ _ _ hy] + apply (mul_le_mul_iff_left₀ hq).1 + have heq : + ((x^2+y^2)^(β/2-1)*(β*(κ-4)/2+β*(8-2*κ+κ*β)/2*(x^2/(x^2+y^2))) - + (2*((2*κ-8-κ*β)/4)*β)*y^β/(x^2+y^2))*(x^2+y^2) = + -(β*(κ-4-κ*β)/2)*(x^2+y^2)^(β/2-1)*(x^2+y^2)+ + (β*(2*κ-8-κ*β)/2)*((x^2+y^2)^(β/2-1)*y^2-y^β) := by + field_simp + ring + rw [heq] + nlinarith + +lemma monomial_bound {ε : ℝ} (hε : 0 < ε) (x : ℝ) {y a : ℝ} (hy : ε ≤ y) + (n : ℕ) (ha : a+(n:ℝ)/2 ≤ 0) : + |x|^n*(x^2+y^2)^a ≤ (ε^2)^(a+(n:ℝ)/2) := by + have hq := q_pos x (hε.trans_le hy) + have hx : |x| ≤ Real.sqrt (x^2+y^2) := Real.abs_le_sqrt (by nlinarith [sq_nonneg y]) + have hl : ε^2 ≤ x^2+y^2 := by nlinarith [sq_nonneg x] + calc + _ ≤ (Real.sqrt (x^2+y^2))^n*(x^2+y^2)^a := by gcongr + _ = (x^2+y^2)^(a+(n:ℝ)/2) := by + rw [Real.sqrt_eq_rpow,← Real.rpow_mul_natCast hq.le,← Real.rpow_add hq] + congr 1 + ring + _ ≤ _ := Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos hε) hl ha + +lemma radialX_bound {ε β : ℝ} (hε : 0 < ε) (hβ : β ≤ 1) (x : ℝ) {y : ℝ} (hy : ε ≤ y) : + |radialX β x y| ≤ |β| *(ε^2)^(β/2-1/2) := by + have hh := monomial_bound (a := β/2-1) hε x hy 1 (by norm_num; linarith) + norm_num at hh + rw [radialX,abs_mul,abs_mul,abs_of_nonneg (Real.rpow_nonneg (q_pos x (hε.trans_le hy)).le _)] + have he : β/2-1+1/2 = β/2-1/2 := by ring + rw [he] at hh + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hh (abs_nonneg β) + +lemma radialXX_bound {ε β : ℝ} (hε : 0 < ε) (hβ : β ≤ 1) (x : ℝ) {y : ℝ} (hy : ε ≤ y) : + |radialXX β x y| ≤ (|β|+|β*(β-2)|)*(ε^2)^(β/2-1) := by + have h0 := monomial_bound (a := β/2-1) hε x hy 0 (by norm_num; linarith) + have h2 := monomial_bound (a := β/2-2) hε x hy 2 (by norm_num; linarith) + norm_num at h0 h2 + rw [show β/2-2+1 = β/2-1 by ring] at h2 + calc + _ ≤ |β| *(x^2+y^2)^(β/2-1)+|β*(β-2)| *(|x|^2*(x^2+y^2)^(β/2-2)) := by + unfold radialXX + exact (abs_add_le _ _).trans_eq (by simp [abs_mul,abs_pow,abs_of_nonneg (Real.rpow_nonneg (q_pos x (hε.trans_le hy)).le _)];ring) + _ ≤ |β| *(ε^2)^(β/2-1)+|β*(β-2)| *(ε^2)^(β/2-1) := by + gcongr + simpa only [sq_abs] using h2 + _ = _ := by ring + +lemma radialXXX_bound {ε β : ℝ} (hε : 0 < ε) (hβ : β ≤ 1) (x : ℝ) {y : ℝ} (hy : ε ≤ y) : + |radialXXX β x y| ≤ (|3*β*(β-2)|+|β*(β-2)*(β-4)|)*(ε^2)^(β/2-3/2) := by + have h1 := monomial_bound (a := β/2-2) hε x hy 1 (by norm_num; linarith) + have h3 := monomial_bound (a := β/2-3) hε x hy 3 (by norm_num; linarith) + norm_num at h1 h3 + rw [show β/2-2+1/2 = β/2-3/2 by ring] at h1 + rw [show β/2-3+3/2 = β/2-3/2 by ring] at h3 + calc + _ ≤ |3*β*(β-2)| *(|x| *(x^2+y^2)^(β/2-2))+ + |β*(β-2)*(β-4)| *(|x|^3*(x^2+y^2)^(β/2-3)) := by + unfold radialXXX + exact (abs_add_le _ _).trans_eq (by simp [abs_mul,abs_pow,abs_of_nonneg (Real.rpow_nonneg (q_pos x (hε.trans_le hy)).le _)];ring) + _ ≤ |3*β*(β-2)| *(ε^2)^(β/2-3/2)+|β*(β-2)*(β-4)| *(ε^2)^(β/2-3/2) := by gcongr + _ = _ := by ring + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.Swallowing +open GreenPhysical LoewnerCutoff LoewnerExit + +lemma deriv_lyapunov_driver (β C c y s b : ℝ) (hy : 0 < y) : + deriv (fun b => lyapunov β C (c-s*b) y) b = -s*radialX β (c-s*b) y := by + have hd := ((hasDerivAt_radial_x β (c-s*b) y hy).comp b + (((hasDerivAt_id b).const_mul s).const_sub c)).add_const (C*y^β) + convert hd.deriv using 1 <;> simp [lyapunov]; ring + +lemma second_lyapunov_driver (β C c y s b : ℝ) (hy : 0 < y) : + iteratedDeriv 2 (fun b => lyapunov β C (c-s*b) y) b = s^2*radialXX β (c-s*b) y := by + have he : deriv (fun b => lyapunov β C (c-s*b) y) = fun b => -s*radialX β (c-s*b) y := + funext (fun b => deriv_lyapunov_driver β C c y s b hy) + simp only [iteratedDeriv_succ,iteratedDeriv_zero] + rw [he] + have hd := ((hasDerivAt_radialX_x β (c-s*b) y hy).comp b + (((hasDerivAt_id b).const_mul s).const_sub c)).const_mul (-s) + simp only [Function.comp_def,id_eq] at hd + convert hd.deriv using 1 + ring + +lemma third_lyapunov_driver (β C c y s b : ℝ) (hy : 0 < y) : + iteratedDeriv 3 (fun b => lyapunov β C (c-s*b) y) b = -s^3*radialXXX β (c-s*b) y := by + have he : iteratedDeriv 2 (fun b => lyapunov β C (c-s*b) y) = fun b => s^2*radialXX β (c-s*b) y := + funext (fun b => second_lyapunov_driver β C c y s b hy) + rw [show (3:ℕ)=2+1 by rfl,iteratedDeriv_succ,he] + have hd := ((hasDerivAt_radialXX_x β (c-s*b) y hy).comp b + (((hasDerivAt_id b).const_mul s).const_sub c)).const_mul (s^2) + simp only [Function.comp_def,id_eq] at hd + convert hd.deriv using 1 + ring + +lemma continuous_radial_comp {α : Type*} [TopologicalSpace α] {X Y : α → ℝ} + (hX : Continuous X) (hY : Continuous Y) (hy : ∀ a, 0 < Y a) (β : ℝ) : + Continuous (fun a => radial β (X a) (Y a)) := by + exact ((hX.pow 2).add (hY.pow 2)).rpow_const (fun a => Or.inl (q_pos _ (hy a)).ne') + +lemma continuous_radialX_comp {α : Type*} [TopologicalSpace α] {X Y : α → ℝ} + (hX : Continuous X) (hY : Continuous Y) (hy : ∀ a, 0 < Y a) (β : ℝ) : + Continuous (fun a => radialX β (X a) (Y a)) := by + exact (continuous_const.mul hX).mul (((hX.pow 2).add (hY.pow 2)).rpow_const + (fun a => Or.inl (q_pos _ (hy a)).ne')) + +lemma continuous_radialXX_comp {α : Type*} [TopologicalSpace α] {X Y : α → ℝ} + (hX : Continuous X) (hY : Continuous Y) (hy : ∀ a, 0 < Y a) (β : ℝ) : + Continuous (fun a => radialXX β (X a) (Y a)) := by + have hp (e : ℝ) := ((hX.pow 2).add (hY.pow 2)).rpow_const (p := e) + (fun a => Or.inl (q_pos _ (hy a)).ne') + exact (continuous_const.mul (hp _)).add ((continuous_const.mul (hX.pow 2)).mul (hp _)) + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.Swallowing +open GreenPhysical LoewnerCutoff LoewnerExit +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +def field (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : ℝ := + lyapunov β C ((position hε hT U z t).re-s*b) (LoewnerField.height hε hT U z t) + +def drift (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : ℝ := + let x := (position hε hT U z t).re-s*b + let y := LoewnerField.height hε hT U z t + let v := velocity ε (extendDriver T U t) (position hε hT U z t) + β*(x*v.re+y*v.im)*(x^2+y^2)^(β/2-1)+C*(β*y^(β-1)*v.im) + +lemma first_eq (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + iteratedDeriv 1 (field hε hT β C s U z t) b = + -s*radialX β ((position hε hT U z t).re-s*b) (LoewnerField.height hε hT U z t) := by + simp only [iteratedDeriv_succ,iteratedDeriv_zero] + exact deriv_lyapunov_driver _ _ _ _ _ _ (LoewnerField.height_pos hε hT U z t) + +lemma second_eq (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + iteratedDeriv 2 (field hε hT β C s U z t) b = + s^2*radialXX β ((position hε hT U z t).re-s*b) (LoewnerField.height hε hT U z t) := + second_lyapunov_driver _ _ _ _ _ _ (LoewnerField.height_pos hε hT U z t) + +lemma third_eq (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t b : ℝ) : + iteratedDeriv 3 (field hε hT β C s U z t) b = + -s^3*radialXXX β ((position hε hT U z t).re-s*b) (LoewnerField.height hε hT U z t) := + third_lyapunov_driver _ _ _ _ _ _ (LoewnerField.height_pos hε hT U z t) + +lemma smooth (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) (t : ℝ) : + ContDiff ℝ 3 (field hε hT β C s U z t) := by + exact ((contDiff_radial_driver β _ _ s (LoewnerField.height_pos hε hT U z t)).of_le (by simp)).add contDiff_const + +lemma coeff_uniform_bound (β C s : ℝ) (hβ : β ≤ 1) (z : ℂ) (k : ℕ) + (hk : k=1 ∨ k=2 ∨ k=3) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ (U : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε hT β C s U z t) b| ≤ K := by + rcases hk with rfl|rfl|rfl + · refine ⟨|s| * (|β| * (ε^2)^(β/2-1/2)),by positivity,?_⟩ + intro U t b + rw [first_eq,abs_mul,abs_neg] + exact mul_le_mul_of_nonneg_left (radialX_bound hε hβ _ (le_max_left _ _)) (abs_nonneg _) + · refine ⟨|s|^2*((|β|+|β*(β-2)|)*(ε^2)^(β/2-1)),by positivity,?_⟩ + intro U t b + rw [second_eq,abs_mul,abs_pow] + exact mul_le_mul_of_nonneg_left (radialXX_bound hε hβ _ (le_max_left _ _)) (by positivity) + · refine ⟨|s|^3*((|3*β*(β-2)|+|β*(β-2)*(β-4)|)*(ε^2)^(β/2-3/2)),by positivity,?_⟩ + intro U t b + rw [third_eq,abs_mul,abs_neg,abs_pow] + exact mul_le_mul_of_nonneg_left (radialXXX_bound hε hβ _ (le_max_left _ _)) (by positivity) + +lemma continuous_field (β C s : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => field hε hT β C s q.1.1 z q.1.2 q.2) := by + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => LoewnerField.height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + exact (continuous_radial_comp hx hy (fun q => LoewnerField.height_pos hε hT q.1.1 z q.1.2) β).add + (continuous_const.mul (hy.rpow_const (fun q => Or.inl (LoewnerField.height_pos hε hT q.1.1 z q.1.2).ne'))) + +lemma continuous_coeff (β C s : ℝ) (z : ℂ) (k : ℕ) (hk : k=1 ∨ k=2) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => iteratedDeriv k (field hε hT β C s q.1.1 z q.1.2) q.2) := by + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => LoewnerField.height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + rcases hk with rfl|rfl + · simp only [first_eq] + exact continuous_const.mul (continuous_radialX_comp hx hy (fun q => LoewnerField.height_pos hε hT q.1.1 z q.1.2) β) + · simp only [second_eq] + exact continuous_const.mul (continuous_radialXX_comp hx hy (fun q => LoewnerField.height_pos hε hT q.1.1 z q.1.2) β) + +lemma continuous_drift (β C s : ℝ) (z : ℂ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => drift hε hT β C s q.1.1 z q.1.2 q.2) := by + have hH := (continuous_position hε hT z).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hD := (continuous_joint_extendDriver T).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hV := (continuous_velocity hε).comp (hD.prodMk hH) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + have hy : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => LoewnerField.height hε hT q.1.1 z q.1.2) := + continuous_const.max (Complex.continuous_im.comp hH) + have hp (e : ℝ) := ((hx.pow 2).add (hy.pow 2)).rpow_const (p := e) + (fun q => Or.inl (q_pos _ (LoewnerField.height_pos hε hT q.1.1 z q.1.2)).ne') + exact ((continuous_const.mul ((hx.mul (Complex.continuous_re.comp hV)).add + (hy.mul (Complex.continuous_im.comp hV)))).mul (hp _)).add + (continuous_const.mul ((continuous_const.mul (hy.rpow_const (fun q => + Or.inl (LoewnerField.height_pos hε hT q.1.1 z q.1.2).ne'))).mul (Complex.continuous_im.comp hV))) + +lemma time_deriv (β C s : ℝ) (U : C(I, ℝ)) (z : ℂ) {t : ℝ} + (ht : t ∈ Ioo 0 T) (hy : ε < (position hε hT U z t).im) (b : ℝ) : + HasDerivAt (fun v => field hε hT β C s U z v b) (drift hε hT β C s U z t b) t := by + have hH := position_deriv hε hT U z ht + have hIm := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t hH + have hRe := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hH + dsimp only [Function.comp_def,Complex.imCLM_apply,Complex.reCLM_apply] at hIm hRe + have hY : HasDerivAt (LoewnerField.height hε hT U z) + (velocity ε (extendDriver T U t) (position hε hT U z t)).im t := by + apply hIm.congr_of_eventuallyEq + filter_upwards [hIm.continuousAt.preimage_mem_nhds (Ioi_mem_nhds hy)] with s hs + exact max_eq_right hs.le + have hR := hasDerivAt_radial_path β (hRe.sub_const (s*b)) hY (LoewnerField.height_pos hε hT U z t) + have hP := hY.rpow_const (p := β) (Or.inl (LoewnerField.height_pos hε hT U z t).ne') + apply (hR.add (hP.const_mul C)).congr_deriv + dsimp only [drift] + ring + +lemma regular (hTp : 0 < T) (β C s : ℝ) (hβ : β ≤ 1) (U : C(I, ℝ)) (z : ℂ) + (ρ δ : ℝ) (b : ℝ → ℝ) (hb : Continuous b) : + BrownianField.FieldRegular (field hε hT β C s U z) (drift hε hT β C s U z) b + (stop hε hT U z ρ δ) := by + constructor + · exact smooth hε hT β C s U z + · obtain ⟨K,hK,hb⟩ := coeff_uniform_bound hε hT β C s hβ z 3 (Or.inr (Or.inr rfl)) + exact ⟨K,hK,hb U⟩ + · intro x + exact ((continuous_field hε hT β C s z).comp + ((continuous_const.prodMk continuous_id).prodMk continuous_const)).continuousOn + · intro t ht x + have htT : t ∈ Ioo 0 T := ⟨ht.1,ht.2.trans_le (stop_bounds hε hT U z ρ δ).2⟩ + have hh := (deficit_pos_iff hε hT U z ρ δ t).1 + (positive_before hε hT hTp U z ρ δ ht.1.le ht.2) + exact time_deriv hε hT β C s U z htT hh.2.1 x + · exact ((continuous_drift hε hT β C s z).comp + ((continuous_const.prodMk continuous_fst).prodMk (hb.comp continuous_snd))).continuousOn + · exact ((continuous_coeff hε hT β C s z 2 (Or.inr rfl)).comp + ((continuous_const.prodMk continuous_id).prodMk hb)).continuousOn + +lemma field_prefix_eq {S : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) (U V : C(I, ℝ)) + (z : ℂ) (β C s : ℝ) (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) + {t : ℝ} (ht : t ∈ Icc 0 S) : + field hε hS β C s U z t = field hε hT β C s V z t := by + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V z hUV ht + ext b + simp only [field,LoewnerField.height,hH] + +end SLEExactGauge.Swallowing + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing GreenPhysical +variable {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + +def factor (β a : ℝ) (U : C(I, ℝ)) (x t : ℝ) : ℝ := + Real.exp ((a*β/2)*logDerivative hε hT U (x:ℂ) t) + +def field (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : ℝ := + factor hε hT β a U x t * radial (-β) ((position hε hT U (x:ℂ) t).re-s*b) ε + +def drift (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : ℝ := + let X := (position hε hT U (x:ℂ) t).re-s*b + factor hε hT β a U x t * + ((a*β/2)*variation hε hT U (x:ℂ) t * radial (-β) X ε + + radialX (-β) X ε * (velocity ε (extendDriver T U t) (position hε hT U (x:ℂ) t)).re) + +lemma factor_pos (β a : ℝ) (U : C(I, ℝ)) (x t : ℝ) : + 0 < factor hε hT β a U x t := Real.exp_pos _ + +lemma field_pos (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : + 0 < field hε hT β a s U x t b := + mul_pos (factor_pos hε hT β a U x t) (radial_pos _ _ hε) + +lemma factor_bound (β a : ℝ) (U : C(I, ℝ)) (x t : ℝ) : + factor hε hT β a U x t ≤ Real.exp (|a*β/2| *((2/ε^2)*T)) := by + apply Real.exp_le_exp.mpr + exact (le_abs_self _).trans ((abs_mul _ _).le.trans + (mul_le_mul_of_nonneg_left (abs_logDerivative_le hε hT U (x:ℂ) t) (abs_nonneg _))) + +lemma first_eq (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : + iteratedDeriv 1 (field hε hT β a s U x t) b = + factor hε hT β a U x t * (-s*radialX (-β) ((position hε hT U (x:ℂ) t).re-s*b) ε) := by + simp only [iteratedDeriv_succ,iteratedDeriv_zero] + have hd := ((hasDerivAt_radial_x (-β) _ ε hε).comp b + (((hasDerivAt_id b).const_mul s).const_sub ((position hε hT U (x:ℂ) t).re))).const_mul (factor hε hT β a U x t) + simp only [Function.comp_def,id_eq] at hd + convert hd.deriv using 1 <;> first | rfl | ring + +lemma second_eq (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : + iteratedDeriv 2 (field hε hT β a s U x t) b = + factor hε hT β a U x t * (s^2*radialXX (-β) ((position hε hT U (x:ℂ) t).re-s*b) ε) := by + have he := funext (first_eq hε hT β a s U x t) + rw [show (2:ℕ)=1+1 by rfl,iteratedDeriv_succ,he] + have hd := (((hasDerivAt_radialX_x (-β) _ ε hε).comp b + (((hasDerivAt_id b).const_mul s).const_sub ((position hε hT U (x:ℂ) t).re))).const_mul (-s)).const_mul (factor hε hT β a U x t) + simp only [Function.comp_def,id_eq] at hd + convert hd.deriv using 1 + first | rfl | ring + +lemma third_eq (β a s : ℝ) (U : C(I, ℝ)) (x t b : ℝ) : + iteratedDeriv 3 (field hε hT β a s U x t) b = + factor hε hT β a U x t * (-s^3*radialXXX (-β) ((position hε hT U (x:ℂ) t).re-s*b) ε) := by + have he := funext (second_eq hε hT β a s U x t) + rw [show (3:ℕ)=2+1 by rfl,iteratedDeriv_succ,he] + have hd := (((hasDerivAt_radialXX_x (-β) _ ε hε).comp b + (((hasDerivAt_id b).const_mul s).const_sub ((position hε hT U (x:ℂ) t).re))).const_mul (s^2)).const_mul (factor hε hT β a U x t) + simp only [Function.comp_def,id_eq] at hd + convert hd.deriv using 1 + first | rfl | ring + +lemma smooth (β a s : ℝ) (U : C(I, ℝ)) (x t : ℝ) : + ContDiff ℝ 3 (field hε hT β a s U x t) := + contDiff_const.mul ((contDiff_radial_driver (-β) _ ε s hε).of_le (by simp)) + +lemma coeff_uniform_bound (β a s : ℝ) (hβ : 0 ≤ β) (x : ℝ) (k : ℕ) + (hk : k=1 ∨ k=2 ∨ k=3) : + ∃ K : ℝ, 0 ≤ K ∧ ∀ (U : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε hT β a s U x t) b| ≤ K := by + let E := Real.exp (|a*β/2| *((2/ε^2)*T)) + have hβ' : -β ≤ 1 := by linarith + have hf (U : C(I, ℝ)) (t : ℝ) : |factor hε hT β a U x t| ≤ E := by + rw [abs_of_pos (factor_pos hε hT β a U x t)] + exact factor_bound hε hT β a U x t + rcases hk with rfl|rfl|rfl + · refine ⟨E*(|s| *(|-β| *(ε^2)^((-β)/2-1/2))),by positivity,?_⟩ + intro U t b + rw [first_eq,abs_mul,abs_mul,abs_neg] + exact mul_le_mul (hf U t) (mul_le_mul_of_nonneg_left + (radialX_bound hε hβ' _ le_rfl) (abs_nonneg _)) (by positivity) (by positivity) + · refine ⟨E*(|s|^2*((|-β|+|(-β)*(-β-2)|)*(ε^2)^((-β)/2-1))),by positivity,?_⟩ + intro U t b + rw [second_eq,abs_mul,abs_mul,abs_pow] + exact mul_le_mul (hf U t) (mul_le_mul_of_nonneg_left + (radialXX_bound hε hβ' _ le_rfl) (by positivity)) (by positivity) (by positivity) + · refine ⟨E*(|s|^3*((|3*(-β)*(-β-2)|+|(-β)*(-β-2)*(-β-4)|)*(ε^2)^((-β)/2-3/2))),by positivity,?_⟩ + intro U t b + rw [third_eq,abs_mul,abs_mul,abs_neg,abs_pow] + exact mul_le_mul (hf U t) (mul_le_mul_of_nonneg_left + (radialXXX_bound hε hβ' _ le_rfl) (by positivity)) (by positivity) (by positivity) + +lemma continuous_factor (β a x : ℝ) : + Continuous (fun q : C(I, ℝ) × ℝ => factor hε hT β a q.1 x q.2) := + Real.continuous_exp.comp (continuous_const.mul (continuous_logDerivative hε hT (x:ℂ))) + +lemma continuous_field (β a s x : ℝ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => field hε hT β a s q.1.1 x q.1.2 q.2) := by + have hH := (continuous_position hε hT (x:ℂ)).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + exact ((continuous_factor hε hT β a x).comp continuous_fst).mul + (continuous_radial_comp hx continuous_const (fun _ => hε) (-β)) + +lemma continuous_coeff (β a s x : ℝ) (k : ℕ) (hk : k=1 ∨ k=2) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => iteratedDeriv k (field hε hT β a s q.1.1 x q.1.2) q.2) := by + have hH := (continuous_position hε hT (x:ℂ)).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + rcases hk with rfl|rfl + · simp only [first_eq] + exact ((continuous_factor hε hT β a x).comp continuous_fst).mul + (continuous_const.mul (continuous_radialX_comp hx continuous_const (fun _ => hε) (-β))) + · simp only [second_eq] + exact ((continuous_factor hε hT β a x).comp continuous_fst).mul + (continuous_const.mul (continuous_radialXX_comp hx continuous_const (fun _ => hε) (-β))) + +lemma continuous_drift (β a s x : ℝ) : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => drift hε hT β a s q.1.1 x q.1.2 q.2) := by + have hH := (continuous_position hε hT (x:ℂ)).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hD := (continuous_joint_extendDriver T).comp (continuous_fst : Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => q.1)) + have hV := (continuous_velocity hε).comp (hD.prodMk hH) + have hx := (Complex.continuous_re.comp hH).sub (continuous_const.mul continuous_snd : + Continuous (fun q : (C(I, ℝ) × ℝ) × ℝ => s*q.2)) + have hR := continuous_radial_comp hx continuous_const (fun _ => hε) (-β) + have hRX := continuous_radialX_comp hx continuous_const (fun _ => hε) (-β) + exact ((continuous_factor hε hT β a x).comp continuous_fst).mul + (((continuous_const.mul ((continuous_variation hε hT (x:ℂ)).comp continuous_fst)).mul hR).add + (hRX.mul (Complex.continuous_re.comp hV))) + +lemma time_deriv (β a s : ℝ) (U : C(I, ℝ)) (x : ℝ) {t : ℝ} + (ht : t ∈ Ioo 0 T) (b : ℝ) : + HasDerivAt (fun v => field hε hT β a s U x v b) (drift hε hT β a s U x t b) t := by + have hH := position_deriv hε hT U (x:ℂ) ht + have hRe := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hH + dsimp only [Function.comp_def,Complex.reCLM_apply] at hRe + have hR := (hasDerivAt_radial_x (-β) _ ε hε).comp t (hRe.sub_const (s*b)) + have hD := ((hasDerivAt_logDerivative hε hT U (x:ℂ) ht).const_mul (a*β/2)).exp + apply (hD.mul hR).congr_deriv + dsimp only [field,drift,factor,Function.comp_def] + ring + +lemma field_prefix_eq {S : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) (U V : C(I, ℝ)) + (x β a s : ℝ) (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) + {t : ℝ} (ht : t ∈ Icc 0 S) : + field hε hS β a s U x t = field hε hT β a s V x t := by + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V (x:ℂ) hUV ht + have hD := logDerivative_prefix_eq hε hS hT hS le_rfl hST U V (x:ℂ) hUV ht + ext b + simp only [field,factor,hH,hD] + +def gap (U : C(I, ℝ)) (x t : ℝ) : ℝ := + (position hε hT U (x:ℂ) t).re-extendDriver T U t + +def weight (U : C(I, ℝ)) (x β a t : ℝ) : ℝ := + factor hε hT β a U x t * radial (-β) (gap hε hT U x t) ε + +def deficit (U : C(I, ℝ)) (x β a L t : ℝ) : ℝ := + min (gap hε hT U x t-ε) (L-weight hε hT U x β a t) + +lemma continuous_gap (x : ℝ) : + Continuous (fun q : C(I, ℝ) × ℝ => gap hε hT q.1 x q.2) := + (Complex.continuous_re.comp (continuous_position hε hT (x:ℂ))).sub + (continuous_joint_extendDriver T) + +lemma continuous_weight (x β a : ℝ) : + Continuous (fun q : C(I, ℝ) × ℝ => weight hε hT q.1 x β a q.2) := + (continuous_factor hε hT β a x).mul + (continuous_radial_comp (continuous_gap hε hT x) continuous_const (fun _ => hε) (-β)) + +lemma continuous_deficit (x β a L : ℝ) : + Continuous (fun q : C(I, ℝ) × ℝ => deficit hε hT q.1 x β a L q.2) := + ((continuous_gap hε hT x).sub continuous_const).min + (continuous_const.sub (continuous_weight hε hT x β a)) + +lemma deficit_pos_iff (U : C(I, ℝ)) (x β a L t : ℝ) : + 0 < deficit hε hT U x β a L t ↔ + ε < gap hε hT U x t ∧ weight hε hT U x β a t < L := by + simp only [deficit,lt_min_iff,sub_pos] + +lemma deficit_nonneg_iff (U : C(I, ℝ)) (x β a L t : ℝ) : + 0 ≤ deficit hε hT U x β a L t ↔ + ε ≤ gap hε hT U x t ∧ weight hε hT U x β a t ≤ L := by + simp only [deficit,le_min_iff,sub_nonneg] + +def exitPath (U : C(I, ℝ)) (x β a L : ℝ) : C(I, ℝ) := by + refine ⟨fun q => deficit hε hT U x β a L (T*q), ?_⟩ + have hp : Continuous (fun q : I => (U,T*q)) := + continuous_const.prodMk (continuous_const.mul continuous_subtype_val) + have hc := (continuous_deficit hε hT x β a L).comp hp + dsimp only [Function.comp_def] at hc + exact hc + +def stop (U : C(I, ℝ)) (x β a L : ℝ) : ℝ := + T * ContinuousExit.time (exitPath hε hT U x β a L) + +lemma stop_bounds (U : C(I, ℝ)) (x β a L : ℝ) : + stop hε hT U x β a L ∈ Icc 0 T := by + have hh := ContinuousExit.time_bounds (exitPath hε hT U x β a L) + exact ⟨mul_nonneg hT hh.1, by simpa only [stop, mul_one] using mul_le_mul_of_nonneg_left hh.2 hT⟩ + +lemma exitPath_extend (U : C(I, ℝ)) (x β a L : ℝ) {t : ℝ} (ht : t ∈ Icc 0 1) : + ContinuousExit.extend (exitPath hε hT U x β a L) t = deficit hε hT U x β a L (T*t) := by + simpa only [exitPath, ContinuousMap.coe_mk] using ContinuousExit.extend_coe + (exitPath hε hT U x β a L) (⟨t,ht⟩ : I) + +lemma exitPath_extend_div (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + {t : ℝ} (ht : t ∈ Icc 0 T) : + ContinuousExit.extend (exitPath hε hT U x β a L) (t/T) = deficit hε hT U x β a L t := by + rw [exitPath_extend hε hT U x β a L + ⟨div_nonneg ht.1 hT, (div_le_one hTp).2 ht.2⟩, mul_div_cancel₀ _ hTp.ne'] + +lemma positive_before (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + {t : ℝ} (ht : 0 ≤ t) (htτ : t < stop hε hT U x β a L) : + 0 < deficit hε hT U x β a L t := by + rw [← exitPath_extend_div hε hT hTp U x β a L ⟨ht,htτ.le.trans (stop_bounds hε hT U x β a L).2⟩] + apply ContinuousExit.positive_before (div_nonneg ht hT) + exact (div_lt_iff₀ hTp).2 (by simpa only [stop, mul_comm] using htτ) + +lemma stop_pos (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + (h0 : 0 < deficit hε hT U x β a L 0) : 0 < stop hε hT U x β a L := by + apply mul_pos hTp (ContinuousExit.time_pos _) + simpa only [exitPath_extend hε hT U x β a L ⟨le_rfl,zero_le_one⟩, mul_zero] using h0 + +lemma nonneg_until (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + (h0 : 0 < deficit hε hT U x β a L 0) {t : ℝ} + (ht : t ∈ Icc 0 (stop hε hT U x β a L)) : 0 ≤ deficit hε hT U x β a L t := by + rw [← exitPath_extend_div hε hT hTp U x β a L ⟨ht.1,ht.2.trans (stop_bounds hε hT U x β a L).2⟩] + apply ContinuousExit.nonneg_until + · simpa only [exitPath_extend hε hT U x β a L ⟨le_rfl,zero_le_one⟩, mul_zero] using h0 + · exact ⟨div_nonneg ht.1 hT, (div_le_iff₀ hTp).2 (by simpa only [stop, mul_comm] using ht.2)⟩ + +lemma nonpos_at_of_lt (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + (hτ : stop hε hT U x β a L < T) : + deficit hε hT U x β a L (stop hε hT U x β a L) ≤ 0 := by + have hs : ContinuousExit.time (exitPath hε hT U x β a L) < 1 := by + apply (mul_lt_mul_iff_right₀ hTp).mp + simpa only [mul_one, stop] using hτ + exact (exitPath_extend hε hT U x β a L (ContinuousExit.time_bounds _)) ▸ + ContinuousExit.nonpos_at_of_lt_one hs + +lemma lt_stop_iff (hTp : 0 < T) (U : C(I, ℝ)) (x β a L : ℝ) + {t : ℝ} (ht : t ∈ Ico 0 T) : + t < stop hε hT U x β a L ↔ ∀ s ∈ Icc 0 t, 0 < deficit hε hT U x β a L s := by + constructor + · intro hh s hs + exact positive_before hε hT hTp U x β a L hs.1 (hs.2.trans_lt hh) + · intro hh + change t < T * ContinuousExit.time (exitPath hε hT U x β a L) + rw [mul_comm] + apply (div_lt_iff₀ hTp).1 + apply (ContinuousExit.lt_time_iff (p := exitPath hε hT U x β a L) + ⟨div_nonneg ht.1 hT, (div_lt_one hTp).2 ht.2⟩).2 + intro s hs + rw [exitPath_extend hε hT U x β a L + ⟨hs.1, hs.2.trans ((div_le_one hTp).2 ht.2.le)⟩] + apply hh + exact ⟨mul_nonneg hT hs.1, (mul_le_mul_of_nonneg_left hs.2 hT).trans_eq + (mul_div_cancel₀ _ hTp.ne')⟩ + +lemma isOpen_positive_on (x β a L t : ℝ) : + IsOpen {U : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < deficit hε hT U x β a L s} := by + let S : Set (C(I, ℝ) × Icc 0 t) := {q | deficit hε hT q.1 x β a L q.2 ≤ 0} + have hmap : Continuous (fun q : C(I, ℝ) × Icc 0 t => (q.1,(q.2:ℝ))) := + continuous_fst.prodMk (continuous_subtype_val.comp continuous_snd) + have hd := (continuous_deficit hε hT x β a L).comp hmap + dsimp only [Function.comp_def] at hd + have hc : IsClosed S := isClosed_le hd continuous_const + have hh := isClosedMap_fst_of_compactSpace S hc + have he : {U : C(I, ℝ) | ∀ s ∈ Icc 0 t, 0 < deficit hε hT U x β a L s} = (Prod.fst '' S)ᶜ := by + ext U + simp only [mem_ofPred_eq, mem_compl_iff, mem_image, S, not_exists, not_and] + constructor + · intro hp q hq hqp + subst U + exact (not_lt_of_ge hq) (hp q.2 q.2.property) + · intro hp s hs + by_contra hn + exact hp (U,⟨s,hs⟩) (not_lt.1 hn) rfl + rw [he] + exact hh.isOpen_compl + +lemma deficit_prefix_eq {S : ℝ} (hS : 0 ≤ S) (hST : S ≤ T) (U V : C(I, ℝ)) + (x β a L : ℝ) (hUV : EqOn (extendDriver S U) (extendDriver T V) (Icc 0 S)) : + EqOn (deficit hε hS U x β a L) (deficit hε hT V x β a L) (Icc 0 S) := by + intro t ht + have hH := position_prefix_eq hε hS hT hS le_rfl hST U V (x:ℂ) hUV ht + have hD := logDerivative_prefix_eq hε hS hT hS le_rfl hST U V (x:ℂ) hUV ht + simp only [deficit,weight,factor,gap,hH,hD,hUV ht] + +lemma regular (_hTp : 0 < T) (β a s : ℝ) (hβ : 0 ≤ β) (U : C(I, ℝ)) (x L : ℝ) + (b : ℝ → ℝ) (hb : Continuous b) : + BrownianField.FieldRegular (field hε hT β a s U x) (drift hε hT β a s U x) b + (stop hε hT U x β a L) := by + constructor + · exact smooth hε hT β a s U x + · obtain ⟨K,hK,hb⟩ := coeff_uniform_bound hε hT β a s hβ x 3 (Or.inr (Or.inr rfl)) + exact ⟨K,hK,hb U⟩ + · intro v + exact ((continuous_field hε hT β a s x).comp + ((continuous_const.prodMk continuous_id).prodMk continuous_const)).continuousOn + · intro t ht v + exact time_deriv hε hT β a s U x ⟨ht.1,ht.2.trans_le (stop_bounds hε hT U x β a L).2⟩ v + · exact ((continuous_drift hε hT β a s x).comp + ((continuous_const.prodMk continuous_fst).prodMk (hb.comp continuous_snd))).continuousOn + · exact ((continuous_coeff hε hT β a s x 2 (Or.inr rfl)).comp + ((continuous_const.prodMk continuous_id).prodMk hb)).continuousOn + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional BrownianPredictable BrownianStopped BrownianIto TaylorMeshes +variable {ε : ℝ} (hε : 0 < ε) + +def coeffAt (k : ℕ) (s : ℝ≥0) (β a sdev : ℝ) (x : ℝ) (L : ℝ) + (q : C(I, ℝ) × ℝ) : ℝ := by + classical + exact if ∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg q.1 x β a L t then + iteratedDeriv k (field hε s.coe_nonneg β a sdev q.1 x s) q.2 else 0 + +lemma coeffAt_measurable (k : ℕ) (hk : k = 1 ∨ k = 2) (s : ℝ≥0) + (β a sdev : ℝ) (x : ℝ) (L : ℝ) : + @Measurable (C(I, ℝ) × ℝ) ℝ (@Prod.instMeasurableSpace _ _ (borel _) inferInstance) _ (coeffAt hε k s β a sdev x L) := by + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + have hc : Continuous (fun q : C(I, ℝ) × ℝ => + iteratedDeriv k (field hε s.coe_nonneg β a sdev q.1 x s) q.2) := by + have hp : Continuous (fun q : C(I, ℝ) × ℝ => ((q.1,(s:ℝ)),q.2)) := + (continuous_fst.prodMk continuous_const).prodMk continuous_snd + have hh := (continuous_coeff hε s.coe_nonneg β a sdev x k hk).comp hp + dsimp only [Function.comp_def] at hh + exact hh + apply hc.measurable.ite _ measurable_const + exact ((isOpen_positive_on hε s.coe_nonneg x β a L s).preimage continuous_fst).measurableSet + +def rawCoeff {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (β a sdev : ℝ) (x : ℝ) (L : ℝ) (sample : Ω) : ℝ := + if s < T then coeffAt hε k s β a sdev x L (BrownianDriver.path B sdev s sample, B s sample) else 0 + +lemma rawCoeff_measurable_past {Ω : Type*} [MeasurableSpace Ω] + (k : ℕ) (hk : k = 1 ∨ k = 2) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (β a sdev : ℝ) (x : ℝ) (L : ℝ) : + Measurable[pastSigma B s] (rawCoeff hε k B T s β a sdev x L) := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + let : MeasurableSpace Ω := pastSigma B s + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s β a sdev x L).comp + ((BrownianDriver.path_measurable_past B sdev s).prodMk (past_measurable_eval B (s := s) le_rfl)) + · exact measurable_const + +lemma rawCoeff_aemeasurable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) + (k : ℕ) (hk : k = 1 ∨ k = 2) (T s : ℝ≥0) + (β a sdev : ℝ) (x : ℝ) (L : ℝ) : + AEMeasurable (rawCoeff hε k B T s β a sdev x L) P := by + classical + let : MeasurableSpace C(I, ℝ) := borel _ + let : BorelSpace C(I, ℝ) := ⟨rfl⟩ + unfold rawCoeff + split_ifs + · exact (coeffAt_measurable hε k hk s β a sdev x L).comp_aemeasurable + ((BrownianDriver.path_aemeasurable hB sdev s).prodMk (hB.toIsPreBrownianReal.hasLaw_eval s).aemeasurable) + · exact aemeasurable_const + +lemma rawCoeff_eq {Ω : Type*} (k : ℕ) (B : ℝ≥0 → Ω → ℝ) (T s : ℝ≥0) + (hT : 0 < (T:ℝ)) (β a sdev : ℝ) (x : ℝ) (L : ℝ) (sample : Ω) + (hc : Continuous (fun t => B t sample)) : + rawCoeff hε k B T s β a sdev x L sample = + if (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) x β a L then + iteratedDeriv k (field hε T.coe_nonneg β a sdev (BrownianDriver.path B sdev T sample) x s) (B s sample) else 0 := by + classical + by_cases hsT : s < T + · have he := BrownianDriver.prefix_eq B sdev s T sample hc hsT.le + have hf := field_prefix_eq hε T.coe_nonneg s.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) x β a sdev he + ⟨s.coe_nonneg, le_rfl⟩ + have hd := deficit_prefix_eq hε T.coe_nonneg s.coe_nonneg hsT.le + (BrownianDriver.path B sdev s sample) (BrownianDriver.path B sdev T sample) x β a L he + have hi : (∀ t ∈ Icc 0 (s:ℝ), 0 < deficit hε s.coe_nonneg (BrownianDriver.path B sdev s sample) x β a L t) ↔ + (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) x β a L := by + rw [lt_stop_iff hε T.coe_nonneg hT _ x β a L ⟨s.coe_nonneg,hsT⟩] + exact forall₂_congr (fun t ht => by rw [hd ht]) + simp only [rawCoeff, ite_eq_left hsT, coeffAt, hi, hf] + · have hstop : ¬ (s:ℝ) < stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) x β a L := + not_lt_of_ge ((stop_bounds hε T.coe_nonneg _ x β a L).2.trans (not_lt.1 hsT)) + simp only [rawCoeff, ite_eq_right hsT, ite_eq_right hstop] + +lemma rawCoeff_stoppedCoeff_ae {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) (k : ℕ) (T : ℝ≥0) + (hT : 0 < (T:ℝ)) (β a sdev : ℝ) (x : ℝ) (L : ℝ) (n i : ℕ) : + rawCoeff hε k B T (dyadicTime T n i) β a sdev x L =ᵐ[P] + stoppedCoeff k B T + (fun sample => stop hε T.coe_nonneg (BrownianDriver.path B sdev T sample) x β a L) + (fun sample => field hε T.coe_nonneg β a sdev (BrownianDriver.path B sdev T sample) x) n i := by + filter_upwards [hB.cont] with sample hc + rw [rawCoeff_eq hε k B T _ hT β a sdev x L sample hc] + simp only [stoppedCoeff, coe_dyadicTime] + +theorem localized_centered {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsProbabilityMeasure P] {B : ℝ≥0 → Ω → ℝ} + (hB : IsBrownianReal B P) (β a sdev : ℝ) (hβ : 0 ≤ β) + {ε : ℝ} (hε : 0 < ε) (T : ℝ≥0) (hT : 0 < (T:ℝ)) (x : ℝ) (L : ℝ) : + let U := BrownianDriver.path B sdev T + let τ := fun sample => stop hε T.coe_nonneg (U sample) x β a L + let F := fun sample => field hε T.coe_nonneg β a sdev (U sample) x + let V := fun sample => drift hε T.coe_nonneg β a sdev (U sample) x + let Y := fun sample => F sample (τ sample) (B (τ sample).toNNReal sample) - F sample 0 (B 0 sample) - + (∫ t in (0:ℝ)..(τ sample), V sample t (B t.toNNReal sample)) - + (1/2:ℝ)*∫ t in (0:ℝ)..(τ sample), iteratedDeriv 2 (F sample t) (B t.toNNReal sample) + Integrable Y P ∧ (∫ sample, Y sample ∂P) = 0 := by + dsimp only + let U := BrownianDriver.path B sdev T + let τ := fun sample => stop hε T.coe_nonneg (U sample) x β a L + let F := fun sample => field hε T.coe_nonneg β a sdev (U sample) x + let V := fun sample => drift hε T.coe_nonneg β a sdev (U sample) x + have hreg : ∀ᵐ sample ∂P, BrownianField.FieldRegular (F sample) (V sample) + (fun t => B t.toNNReal sample) (τ sample) := by + filter_upwards [hB.cont] with sample hc + exact regular hε T.coe_nonneg hT β a sdev hβ (U sample) x L _ + (hc.comp continuous_real_toNNReal) + have htau : ∀ᵐ sample ∂P, 0 ≤ τ sample ∧ τ sample ≤ T := + Filter.Eventually.of_forall (fun sample => stop_bounds hε T.coe_nonneg (U sample) x β a L) + obtain ⟨K₁,hK₁,hb₁⟩ := coeff_uniform_bound hε T.coe_nonneg β a sdev hβ x 1 (Or.inl rfl) + obtain ⟨K₂,hK₂,hb₂⟩ := coeff_uniform_bound hε T.coe_nonneg β a sdev hβ x 2 (Or.inr (Or.inl rfl)) + have hsbound (k : ℕ) (K : ℝ) (hK : 0 ≤ K) + (hb : ∀ (W : C(I, ℝ)) (t b : ℝ), + |iteratedDeriv k (field hε T.coe_nonneg β a sdev W x t) b| ≤ K) + (n i : ℕ) : ∀ᵐ sample ∂P, |stoppedCoeff k B T τ F n i sample| ≤ K := by + apply Filter.Eventually.of_forall + intro sample + unfold stoppedCoeff + split_ifs + · exact hb _ _ _ + · simpa only [abs_zero] using hK + let A := fun n i => rawCoeff hε 1 B T (dyadicTime T n i) β a sdev x L + let Q := fun n i => rawCoeff hε 2 B T (dyadicTime T n i) β a sdev x L + have hAe (n i : ℕ) : A n i =ᵐ[P] stoppedCoeff 1 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 1 T hT β a sdev x L n i + have hCe (n i : ℕ) : Q n i =ᵐ[P] stoppedCoeff 2 B T τ F n i := + rawCoeff_stoppedCoeff_ae hε hB 2 T hT β a sdev x L n i + have hAm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (A n i) := + rawCoeff_measurable_past hε 1 (Or.inl rfl) B T _ _ _ _ x L + have hCm (n i : ℕ) : Measurable[pastSigma B (dyadicTime T n i)] (Q n i) := + rawCoeff_measurable_past hε 2 (Or.inr rfl) B T _ _ _ _ x L + have hA2 (n i : ℕ) : MemLp (A n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 1 (Or.inl rfl) T _ _ _ _ x L).aestronglyMeasurable K₁ + filter_upwards [hAe n i, hsbound 1 K₁ hK₁ hb₁ n i] with sample he hb + rw [Real.norm_eq_abs] + change |A n i sample| ≤ K₁ + rw [he] + exact hb + have hC2 (n i : ℕ) : MemLp (Q n i) 2 P := by + apply MemLp.of_bound (rawCoeff_aemeasurable hε hB 2 (Or.inr rfl) T _ _ _ _ x L).aestronglyMeasurable K₂ + filter_upwards [hCe n i, hsbound 2 K₂ hK₂ hb₂ n i] with sample he hb + rw [Real.norm_eq_abs] + change |Q n i sample| ≤ K₂ + rw [he] + exact hb + have hi := stopped_field_ito_centered_ae hB T τ F V htau hreg A Q hAe hCe hCm hC2 + K₂ hK₂ (hsbound 2 K₂ hK₂ hb₂) hAm hA2 K₁ hK₁ (hsbound 1 K₁ hK₁ hb₁) + exact hi + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal +namespace SLEExactGauge.BoundaryGreen +open Swallowing GreenPhysical + +def generator (κ β a x ε : ℝ) : ℝ := + -(a*β/x^2)*radial (-β) x ε + radialX (-β) x ε*(2/x)+κ/2*radialXX (-β) x ε + +lemma generator_factor (κ β a x ε : ℝ) (hx : 0 < x) (hε : 0 < ε) : + generator κ β a x ε = β*(x^2+ε^2)^((-β)/2-2)/x^2 * + ((κ*(β+1)/2-2-a)*x^4-(2+κ/2+2*a)*x^2*ε^2-a*ε^4) := by + have hq := (q_pos x hε).ne' + have hp₁ : (x^2+ε^2)^((-β)/2-1) = (x^2+ε^2)^((-β)/2-2)*(x^2+ε^2) := by + conv_rhs => rhs; rw [← Real.rpow_one (x^2+ε^2)] + rw [← Real.rpow_add (q_pos x hε)] + congr 1 + ring + have hp₀ : (x^2+ε^2)^((-β)/2) = (x^2+ε^2)^((-β)/2-2)*(x^2+ε^2)^2 := by + conv_rhs => rhs; rw [← Real.rpow_natCast] + rw [← Real.rpow_add (q_pos x hε)] + congr 1 + norm_num + unfold generator radial radialX radialXX + rw [hp₀,hp₁] + field_simp + ring + +lemma generator_nonpos {κ β a x ε : ℝ} (hκ : 0 ≤ κ) (hβ : 0 ≤ β) (ha : 0 ≤ a) + (hba : κ*(β+1) ≤ 4+2*a) (hx : 0 < x) (hε : 0 < ε) : + generator κ β a x ε ≤ 0 := by + rw [generator_factor κ β a x ε hx hε] + apply mul_nonpos_of_nonneg_of_nonpos + · positivity + · have h₁ : (κ*(β+1)/2-2-a)*x^4 ≤ 0 := + mul_nonpos_of_nonpos_of_nonneg (by linarith) (by positivity) + have h₂ : 0 ≤ (2+κ/2+2*a)*x^2*ε^2 := by positivity + have h₃ : 0 ≤ a*ε^4 := by positivity + linarith + +lemma exponent_choice {κ : ℝ} (hκ : 0 < κ) (h8 : κ < 8) : + let β := (8/κ-1)/2 + let a := 1+κ/8 + 0 < β ∧ 0 < a ∧ a < 2 ∧ κ*(β+1) < 4+2*a := by + have hd : 1 < 8/κ := (lt_div_iff₀ hκ).2 (by simpa) + dsimp only + refine ⟨by linarith,by positivity,by linarith,?_⟩ + have he : κ*((8/κ-1)/2+1) = 4+κ/2 := by field_simp; ring + rw [he] + linarith + +end SLEExactGauge.BoundaryGreen + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology NNReal ENNReal unitInterval +namespace SLEExactGauge.BoundaryGreen +open BoundaryFunctional Swallowing GreenPhysical + +lemma field_initial {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (β a s : ℝ) (U : C(I, ℝ)) (x : ℝ) : + field hε hT β a s U x 0 0 = radial (-β) x ε := by + simp only [field,factor,logDerivative_initial,mul_zero,Real.exp_zero,position_initial, + Complex.ofReal_re,sub_zero,one_mul] + +lemma generator_field {ε T : ℝ} (hε : 0 < ε) (hT : 0 ≤ T) + (κ β a : ℝ) (hκ : 0 ≤ κ) (U : C(I, ℝ)) (x t b : ℝ) + (hx : ε ≤ gap hε hT U x t) (hU : extendDriver T U t = Real.sqrt κ*b) : + drift hε hT β a (Real.sqrt κ) U x t b+ + (1/2:ℝ)*iteratedDeriv 2 (field hε hT β a (Real.sqrt κ) U x t) b = + factor hε hT β a U x t * generator κ β a (gap hε hT U x t) ε := by + have hz : position hε hT U (x:ℂ) t = ((position hε hT U (x:ℂ) t).re:ℂ) := by + apply Complex.ext <;> simp [position_im_zero] + have hc : clampRe ε (position hε hT U (x:ℂ) t-(extendDriver T U t:ℂ)) = + (gap hε hT U x t:ℂ) := by + change BoundaryCutoff.clamp 1 ε _ = _ + rw [BoundaryCutoff.clamp_eq (by norm_num : |(1:ℝ)|=1) (by simpa [gap] using hx)] + rw [hz] + simp only [gap,Complex.ofReal_sub] + have hv : velocity ε (extendDriver T U t) (position hε hT U (x:ℂ) t) = + (2/(gap hε hT U x t):ℝ) := by + change 2/clampRe ε _ = _ + rw [hc] + push_cast + rfl + have hd : variation hε hT U (x:ℂ) t = -2/(gap hε hT U x t)^2 := by + unfold variation + rw [hc] + norm_cast + rw [second_eq,Real.sq_sqrt hκ] + dsimp only [drift] + rw [hv,hd,Complex.ofReal_re] + have he : (position hε hT U (x:ℂ) t).re-Real.sqrt κ*b = gap hε hT U x t := by + simp only [gap,hU] + rw [he] + unfold generator + ring + +end SLEExactGauge.BoundaryGreen + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/TraceAvoidance.lean b/lean/OAI/Probability/SLELocalization/TraceAvoidance.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f4c92795e86658a80ea33cb17dc80ff18b9ebe8 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/TraceAvoidance.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.Probability.SLELocalization.TraceModel + +namespace OAI + + +/-! Conformal localization and Is Loewner Trace Using estimates. -/ + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.IsLoewnerTraceUsing + +lemma positive_solution_live {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {T : ℝ} (hT : 0 ≤ T) + {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H + (2/(H t-(driver t:ℂ))) (Icc 0 T) t) + (hpos : ∀ t ∈ Icc 0 T, 0 < (H t).im) : + H 0 ∈ localizationDomain γ T ∧ EqOn (fun t => g t (H 0)) H (Icc 0 T) := by + have hc : ContinuousOn (fun t => (H t).im) (Icc 0 T) := + Complex.continuous_im.comp_continuousOn (HasDerivWithinAt.continuousOn hH) + obtain ⟨s,hs,hmin⟩ := isCompact_Icc.exists_isMinOn ⟨0,le_rfl,hT⟩ hc + have hpositive := hpos s hs + let lip : ℝ≥0 := ⟨2 / (H s).im^2, by positivity⟩ + have hlip (time : ℝ) : LipschitzOnWith lip + (fun point : ℂ => 2 / (point - (driver time : ℂ))) {point | (H s).im ≤ point.im} := by + have hnorm (point : ℂ) (hpoint : (H s).im ≤ point.im) : + (H s).im ≤ ‖point - (driver time : ℂ)‖ := by + simpa only [Complex.sub_im, Complex.ofReal_im, sub_zero] using + hpoint.trans (by simpa using Complex.im_le_norm (point - (driver time : ℂ))) + apply LipschitzOnWith.of_dist_le_mul + intro left hleft right hright + have hleftNorm := hnorm left hleft + have hrightNorm := hnorm right hright + have hleftNe : left - (driver time : ℂ) ≠ 0 := norm_pos_iff.mp (hpositive.trans_le hleftNorm) + have hrightNe : right - (driver time : ℂ) ≠ 0 := norm_pos_iff.mp (hpositive.trans_le hrightNorm) + have hden : (H s).im^2 ≤ ‖(left - (driver time : ℂ)) * (right - (driver time : ℂ))‖ := by + rw [norm_mul, pow_two] + exact mul_le_mul hleftNorm hrightNorm hpositive.le (norm_nonneg _) + have hdiff : 2 / (left - (driver time : ℂ)) - 2 / (right - (driver time : ℂ)) = + 2 * (right - left) / ((left - (driver time : ℂ)) * (right - (driver time : ℂ))) := by + field_simp + ring + simp only [dist_eq_norm, hdiff, norm_div, norm_mul, Complex.norm_ofNat] + change 2 * ‖right - left‖ / (‖left - (driver time : ℂ)‖ * ‖right - (driver time : ℂ)‖) ≤ + (2 / (H s).im^2) * ‖left - right‖ + calc + _ ≤ 2 * ‖right - left‖ / (H s).im^2 := by + apply div_le_div_of_nonneg_left (by positivity) (sq_pos_of_pos hpositive) + simpa only [norm_mul] using hden + _ = _ := by rw [norm_sub_rev]; ring + let start := f T (H T) + have hstart : start ∈ localizationDomain γ T := + h.2.2.2.2.2.2.2.2.1 T hT (hpos T ⟨hT, le_rfl⟩) + have hfinal : g T start = H T := + h.2.2.2.2.2.2.2.2.2.2.1 T hT _ (hpos T ⟨hT, le_rfl⟩) + have hheight (time : ℝ) (htime : time ∈ Icc 0 T) : + (H s).im ≤ (g time start).im := by + have hanti := h.height_antitone hT hstart htime ⟨hT, le_rfl⟩ htime.2 + dsimp only at hanti + rw [hfinal] at hanti + exact (hmin ⟨hT, le_rfl⟩).trans hanti + have hder (time : ℝ) (htime : time ∈ Ioc 0 T) : + HasDerivWithinAt (fun time => g time start) + (2 / (g time start - (driver time : ℂ))) (Iic time) time := by + exact (h.hasDerivAt_eval htime.1 (survivingDomain_mono htime.2 hstart)).hasDerivWithinAt + have heq : EqOn (fun time => g time start) H (Icc 0 T) := + ODE_solution_unique_of_mem_Icc_left + (s := fun _ => {point : ℂ | (H s).im ≤ point.im}) (fun time _ => hlip time) + (h.continuous_eval hT hstart) hder + (fun time htime => hheight time ⟨htime.1.le, htime.2⟩) + (HasDerivWithinAt.continuousOn hH) + (fun time htime => (hH time ⟨htime.1.le, htime.2⟩).mono_of_mem_nhdsWithin + (Icc_mem_nhdsLE_of_mem htime)) + (fun _ htime => hmin ⟨htime.1.le, htime.2⟩) hfinal + have hzero : start = H 0 := by + rw [← h.initial start hstart.1.1] + exact heq ⟨le_rfl, hT⟩ + exact ⟨hzero ▸ hstart, hzero ▸ heq⟩ + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.BoundaryCutoff + +lemma signed_difference_bound {σ : ℝ} (hσ : |σ| = 1) (z w : ℂ) (u v : ℝ) : + |σ*(z.re-u)-σ*(w.re-v)| ≤ dist z w+|u-v| := by + rw [← mul_sub,abs_mul,hσ,one_mul] + calc + |(z.re-u)-(w.re-v)| = |(z.re-w.re)-(u-v)| := by congr 1; ring + _ ≤ |z.re-w.re|+|u-v| := abs_sub _ _ + _ ≤ dist z w+|u-v| := by + have hh := Complex.abs_re_le_norm (z-w) + simp only [Complex.sub_re] at hh + rw [dist_eq_norm] + linarith + +lemma neighborhood_live {U : ℝ → ℝ} {H : ℝ → ℂ} {T ε σ : ℝ} + (hT : 0 < T) (hε : 0 < ε) (hσ : |σ| = 1) + (_hU : ContinuousOn U (Icc 0 T)) + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H + (2/(H t-(U t:ℂ))) (Icc 0 T) t) + (hgap : ∀ t ∈ Icc 0 T, ε ≤ σ*((H t).re-U t)) : + ∃ η : ℝ, 0 < η ∧ ∀ (V : ℝ → ℝ) (ξ : ℝ → ℂ) (G F : ℝ → ℂ → ℂ), + IsLoewnerTraceUsing V ξ G F → ContinuousOn V (Icc 0 T) → + (∀ t ∈ Icc 0 T, |V t-U t| < η) → + ∀ w : ℂ, 0 < w.im → dist w (H 0) < η → + w ∈ localizationDomain ξ T ∧ ∀ t ∈ Icc 0 T, ε/2 ≤ σ*((G t w).re-V t) := by + let C := Real.exp ((4/(ε/2)^2)*T) + have hC : 0 < C := Real.exp_pos _ + let η := ε/(8*(C+1)) + have hη : 0 < η := div_pos hε (by positivity) + have hsmall : 2*η*C+η ≤ ε/2 := by + have hden : 0 < 8*(C+1) := by positivity + have he : η*(8*(C+1)) = ε := div_mul_cancel₀ _ hden.ne' + nlinarith + have hhalf : 0 < ε/2 := by positivity + have hbase : ∀ t ∈ Icc 0 T, HasDerivWithinAt H + (velocity σ (ε/2) (U t) (H t)) (Icc 0 T) t := by + intro t ht + rw [velocity_eq hσ (by linarith [hgap t ht])] + exact hH t ht + refine ⟨η,hη,fun V ξ G F hξ hV hclose w hw hdist => ?_⟩ + obtain ⟨J,hJ0,hJ⟩ := exists_solution hσ hhalf hT.le V hV w + have hd (t : ℝ) (ht : t ∈ Icc 0 T) : dist (J t) (H t) ≤ 2*η*C := by + have hh := solution_dist_le hσ hhalf hη.le hη.le hJ hbase + (by rw [hJ0]; exact hdist.le) (fun t ht => (hclose t ht).le) ht + simpa only [← two_mul] using hh + have hg (t : ℝ) (ht : t ∈ Icc 0 T) : ε/2 ≤ σ*((J t).re-V t) := by + have hh := signed_difference_bound hσ (J t) (H t) (V t) (U t) + have hn := neg_abs_le (σ*((J t).re-V t)-σ*((H t).re-U t)) + have hs := hgap t ht + have hcl := hclose t ht + have hdt := hd t ht + linarith + have hder : ∀ t ∈ Icc 0 T, HasDerivWithinAt J + (2/(J t-(V t:ℂ))) (Icc 0 T) t := by + intro t ht + have hh := hJ t ht + rw [velocity_eq hσ (hg t ht)] at hh + exact hh + have hpos := positive_height hσ hhalf hJ (by rw [hJ0]; exact hw) + have hl := hξ.positive_solution_live hT.le hder hpos + rw [hJ0] at hl + refine ⟨hl.1,fun t ht => ?_⟩ + have he : G t w = J t := hl.2 ht + rw [he] + exact hg t ht + +end SLEExactGauge.BoundaryCutoff + +end + +end + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge + +theorem separated_forward_path_avoids_trace + {U : ℝ → ℝ} {H : ℝ → ℂ} {T ε σ : ℝ} + (hT : 0 < T) (hε : 0 < ε) (hσ : |σ| = 1) + (hU : ContinuousOn U (Icc 0 T)) + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H + (2/(H t-(U t:ℂ))) (Icc 0 T) t) + (hgap : ∀ t ∈ Icc 0 T, ε ≤ σ*((H t).re-U t)) : + ∃ η : ℝ, 0 < η ∧ ∀ (V : ℝ → ℝ) (ξ : ℝ → ℂ) (G F : ℝ → ℂ → ℂ), + IsLoewnerTraceUsing V ξ G F → ContinuousOn V (Icc 0 T) → + (∀ t ∈ Icc 0 T, |V t-U t| < η) → + ∀ t ∈ Icc 0 T, η ≤ dist (ξ t) (H 0) := by + obtain ⟨η,hη,hlive⟩ := BoundaryCutoff.neighborhood_live hT hε hσ hU hH hgap + refine ⟨η,hη,fun V ξ G F hξ hV hclose t ht => ?_⟩ + by_contra hn + have hlt : dist (ξ t) (H 0) < η := lt_of_not_ge hn + have htip := hξ.2.2.2.2.2.2.2.2.2.2.2.2.2 t ht.1 + have he : ∀ᶠ y : ℝ in 𝓝[>] (0:ℝ), dist (F t ((V t:ℂ)+(y:ℂ)*Complex.I)) (H 0) < η := + htip.eventually (isOpen_ball.mem_nhds (show ξ t ∈ ball (H 0) η from hlt)) + have hp : ∀ᶠ y : ℝ in 𝓝[>] (0:ℝ), 0 < y := self_mem_nhdsWithin + obtain ⟨y,hy,hball⟩ := (hp.and he).exists + have hz : (V t:ℂ)+(y:ℂ)*Complex.I ∈ halfPlane := by + change 0 < ((V t:ℂ)+(y:ℂ)*Complex.I).im + simpa using hy + have hfw := hξ.2.2.2.2.2.2.2.2.1 t ht.1 hz + have hl := hlive V ξ G F hξ hV hclose _ hfw.1.1 hball + have hg := hl.2 t ht + rw [hξ.2.2.2.2.2.2.2.2.2.2.1 t ht.1 _ hz] at hg + simp only [Complex.add_re,Complex.ofReal_re,Complex.mul_re,Complex.ofReal_im, + Complex.I_re,Complex.I_im,mul_zero,zero_mul,add_zero,sub_self] at hg + linarith + +end SLEExactGauge + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/TraceModel.lean b/lean/OAI/Probability/SLELocalization/TraceModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce8df1279bd3128a599c3ef91b16c8cd9d38b012 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/TraceModel.lean @@ -0,0 +1,848 @@ +import Mathlib +import OAI.Probability.SLELocalization.SobolevMeans +import OAI.Probability.SLE.ClippedCoordinates + +namespace OAI + + +/-! Conformal localization and Boundary Cutoff estimates. -/ + +section +noncomputable section +open Set Filter Metric +open scoped Topology NNReal +namespace SLEExactGauge.BoundaryCutoff + +lemma norm_velocity_sub_le {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) + (u : ℝ) (z w : ℂ) : ‖velocity σ ε u z-velocity σ ε u w‖ ≤ (4/ε^2)*‖z-w‖ := by + let a := clamp σ ε (z-(u:ℂ)) + let b := clamp σ ε (w-(u:ℂ)) + have ha : a ≠ 0 := clamp_ne_zero hσ hε _ + have hb : b ≠ 0 := clamp_ne_zero hσ hε _ + have hd : ε^2 ≤ ‖a*b‖ := by + rw [norm_mul,pow_two] + exact mul_le_mul (clamp_norm hσ hε _) (clamp_norm hσ hε _) hε.le (norm_nonneg _) + have he : velocity σ ε u z-velocity σ ε u w = 2*(b-a)/(a*b) := by + change 2/a-2/b=2*(b-a)/(a*b) + field_simp + rw [he,norm_div,norm_mul,Complex.norm_ofNat] + have hn : ‖b-a‖ ≤ 2*‖z-w‖ := by + simpa only [a,b,norm_sub_rev,sub_sub_sub_cancel_right] using + clamp_norm_sub (ε:=ε) hσ (z-(u:ℂ)) (w-(u:ℂ)) + calc + 2*‖b-a‖/‖a*b‖ ≤ (2*(2*‖z-w‖))/ε^2 := + div_le_div₀ (by positivity) (mul_le_mul_of_nonneg_left hn (by norm_num)) + (sq_pos_of_pos hε) hd + _ = (4/ε^2)*‖z-w‖ := by ring + +lemma velocity_lipschitz {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) (u : ℝ) : + LipschitzWith ⟨4/ε^2,by positivity⟩ (velocity σ ε u) := by + apply LipschitzWith.of_dist_le_mul + intro z w + simp only [dist_eq_norm] + exact norm_velocity_sub_le hσ hε u z w + +lemma continuous_velocity {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) : + Continuous (fun p : ℝ × ℂ => velocity σ ε p.1 p.2) := by + unfold velocity clamp + refine continuous_const.div ?_ (fun p => clamp_ne_zero hσ hε _) + change Continuous (fun p : ℝ × ℂ => Complex.equivRealProdCLM.symm + (σ*max (σ*(p.2-(p.1:ℂ)).re) ε,(p.2-(p.1:ℂ)).im)) + apply Complex.equivRealProdCLM.symm.continuous.comp + apply Continuous.prodMk <;> fun_prop + +lemma exists_solution {σ ε T : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) (hT : 0 ≤ T) + (U : ℝ → ℝ) (hU : ContinuousOn U (Icc 0 T)) (z : ℂ) : + ∃ H : ℝ → ℂ, H 0 = z ∧ ∀ t ∈ Icc 0 T, + HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t := by + let L : ℝ≥0 := ⟨2/ε,by positivity⟩ + let K : ℝ≥0 := ⟨4/ε^2,by positivity⟩ + let a : ℝ≥0 := ⟨(2/ε)*T,mul_nonneg (by positivity) hT⟩ + have hp : IsPicardLindelof (fun t => velocity σ ε (U t)) ⟨0,⟨le_rfl,hT⟩⟩ z a 0 L K := by + constructor + · exact fun t _ => (velocity_lipschitz hσ hε (U t)).lipschitzOnWith + · intro w _ + have hc : ContinuousOn (fun t : ℝ => (U t,w)) (Icc 0 T) := + hU.prodMk continuousOn_const + simpa only [Function.comp_def] using (continuous_velocity hσ hε).comp_continuousOn hc + · exact fun t _ w _ => norm_velocity_le hσ hε (U t) w + · dsimp [L,a] + simp only [sub_zero,sub_self,max_eq_left hT] + rfl + exact hp.exists_eq_forall_mem_Icc_hasDerivWithinAt₀ + +lemma norm_velocity_driver_sub_le {σ ε : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) + (u v : ℝ) (z : ℂ) : ‖velocity σ ε u z-velocity σ ε v z‖ ≤ (4/ε^2)*|u-v| := by + have he (a : ℝ) : velocity σ ε 0 (z-(a:ℂ)) = velocity σ ε a z := by simp [velocity] + have hh := norm_velocity_sub_le hσ hε 0 (z-(u:ℂ)) (z-(v:ℂ)) + rw [he,he] at hh + convert hh using 1 + rw [sub_sub_sub_cancel_left,← Complex.ofReal_sub,Complex.norm_real,abs_sub_comm] + simp [Real.norm_eq_abs] + +lemma derivWithin_right {σ ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ico 0 T) : + HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Ici t) t := + (hH t ⟨ht.1,ht.2.le⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsGE_of_mem ht) + +lemma derivWithin_left {σ ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t) + {t : ℝ} (ht : t ∈ Ioc 0 T) : + HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Iic t) t := + (hH t ⟨ht.1.le,ht.2⟩).mono_of_mem_nhdsWithin (Icc_mem_nhdsLE_of_mem ht) + +lemma clamp_conj (σ ε : ℝ) (w : ℂ) : + clamp σ ε (starRingEnd ℂ w) = starRingEnd ℂ (clamp σ ε w) := by + apply Complex.ext <;> simp [clamp] + +lemma velocity_conj (σ ε u : ℝ) (w : ℂ) : + velocity σ ε u (starRingEnd ℂ w) = starRingEnd ℂ (velocity σ ε u w) := by + unfold velocity + rw [map_div₀,map_ofNat,← clamp_conj, map_sub,Complex.conj_ofReal] + +lemma conjugate_deriv {σ ε T : ℝ} {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t) : + ∀ t ∈ Icc 0 T, HasDerivWithinAt (fun s => starRingEnd ℂ (H s)) + (velocity σ ε (U t) (starRingEnd ℂ (H t))) (Icc 0 T) t := by + intro t ht + have hh := Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp_hasDerivWithinAt t (hH t ht) + simpa only [Function.comp_def,Complex.conjCLE_apply,ContinuousLinearEquiv.coe_coe, + ← velocity_conj] using hh + +lemma positive_height {σ ε T : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) + {U : ℝ → ℝ} {H : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t) + (h0 : 0 < (H 0).im) : ∀ t ∈ Icc 0 T, 0 < (H t).im := by + intro t ht + have hn (s : ℝ) (hs : s ∈ Icc 0 T) : (H s).im ≠ 0 := by + intro hs0 + have hr : ∀ t ∈ Icc 0 s, HasDerivWithinAt H + (velocity σ ε (U t) (H t)) (Icc 0 s) t := fun t ht => + (hH t ⟨ht.1,ht.2.trans hs.2⟩).mono (Icc_subset_Icc le_rfl hs.2) + have hc := conjugate_deriv hr + have hf : H s = starRingEnd ℂ (H s) := by + apply Complex.ext <;> simp [hs0] + have he := ODE_solution_unique_of_mem_Icc_left + (s:=fun _ => univ) (fun t _ => (velocity_lipschitz hσ hε (U t)).lipschitzOnWith) + (HasDerivWithinAt.continuousOn hr) (fun _ ht => derivWithin_left hr ht) + (fun _ _ => mem_univ _) (HasDerivWithinAt.continuousOn hc) + (fun _ ht => derivWithin_left hc ht) (fun _ _ => mem_univ _) hf + have hh := congrArg Complex.im (he ⟨le_rfl,hs.1⟩) + simp only [Complex.conj_im] at hh + linarith + by_contra hneg + have hi := intermediate_value_Icc' ht.1 + ((Complex.continuous_im.comp_continuousOn (HasDerivWithinAt.continuousOn hH)).mono (Icc_subset_Icc le_rfl ht.2)) + obtain ⟨s,hs,hs0⟩ := hi (a:=0) ⟨le_of_not_gt hneg,h0.le⟩ + exact hn s ⟨hs.1,hs.2.trans ht.2⟩ hs0 + +lemma solution_dist_le {σ ε T D δ : ℝ} (hσ : |σ| = 1) (hε : 0 < ε) + (hD : 0 ≤ D) (hδ : 0 ≤ δ) {U V : ℝ → ℝ} {H G : ℝ → ℂ} + (hH : ∀ t ∈ Icc 0 T, HasDerivWithinAt H (velocity σ ε (U t) (H t)) (Icc 0 T) t) + (hG : ∀ t ∈ Icc 0 T, HasDerivWithinAt G (velocity σ ε (V t) (G t)) (Icc 0 T) t) + (h0 : dist (H 0) (G 0) ≤ δ) (hUV : ∀ t ∈ Icc 0 T, |U t-V t| ≤ D) + {t : ℝ} (ht : t ∈ Icc 0 T) : + dist (H t) (G t) ≤ (δ+D)*Real.exp ((4/ε^2)*T) := by + let K : ℝ≥0 := ⟨4/ε^2,by positivity⟩ + have hK : (0:ℝ) < K := by change 0 < 4/ε^2; positivity + have hb (s : ℝ) (hs : s ∈ Ico 0 T) : + dist (velocity σ ε (V s) (G s)) (velocity σ ε (U s) (G s)) ≤ (K:ℝ)*D := by + rw [dist_eq_norm] + calc + _ ≤ (4/ε^2)*|V s-U s| := norm_velocity_driver_sub_le hσ hε _ _ _ + _ ≤ (K:ℝ)*D := by + rw [abs_sub_comm] + exact mul_le_mul_of_nonneg_left (hUV s ⟨hs.1,hs.2.le⟩) hK.le + have hh := dist_le_of_approx_trajectories_ODE + (fun t => velocity_lipschitz hσ hε (U t)) + (HasDerivWithinAt.continuousOn hH) (fun _ hs => derivWithin_right hH hs) + (fun t _ => le_of_eq (dist_self (velocity σ ε (U t) (H t)))) + (HasDerivWithinAt.continuousOn hG) (fun _ hs => derivWithin_right hG hs) + hb h0 t ht + have he : gronwallBound δ K (0+(K:ℝ)*D) (t-0) = + δ*Real.exp ((K:ℝ)*t)+D*(Real.exp ((K:ℝ)*t)-1) := by + simp only [gronwallBound,zero_add,sub_zero,ite_eq_right (ne_of_gt hK)] + field_simp + rw [he] at hh + have hexp : Real.exp ((K:ℝ)*t) ≤ Real.exp ((K:ℝ)*T) := + Real.exp_le_exp.2 (mul_le_mul_of_nonneg_left ht.2 hK.le) + apply hh.trans + change δ*Real.exp ((K:ℝ)*t)+D*(Real.exp ((K:ℝ)*t)-1) ≤ (δ+D)*Real.exp ((K:ℝ)*T) + have h1 := mul_le_mul_of_nonneg_left hexp hδ + have h2 := mul_le_mul_of_nonneg_left hexp hD + nlinarith + +end SLEExactGauge.BoundaryCutoff + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge + +structure Gauge where + toFun : ℝ≥0 → ℝ≥0 + continuous : Continuous toFun + monotone : Monotone toFun + zero : toFun 0 = 0 + positive : ∀ r, 0 < r → 0 < toFun r + +instance : CoeFun Gauge (fun _ => ℝ≥0 → ℝ≥0) := ⟨Gauge.toFun⟩ + +def Gauge.extended (h : Gauge) (r : ℝ≥0∞) : ℝ≥0∞ := + if r = ∞ then ∞ else (h r.toNNReal : ℝ≥0∞) + +def Gauge.hausdorff (h : Gauge) : Measure ℂ := + Measure.mkMetric h.extended + +def IsExactGauge (κ : ℝ) (h : Gauge) : Prop := + ∃ r₀ : ℝ≥0, 0 < r₀ ∧ ∀ r : ℝ≥0, 0 < r → r < r₀ → + (h r : ℝ) = (r : ℝ) ^ dimension κ * + (Real.log (Real.log (1 / (r : ℝ)))) ^ (codimension κ / 2) + +def IsLargerGauge (κ : ℝ) (g : Gauge) : Prop := + ∃ r₀ : ℝ≥0, 0 < r₀ ∧ ∀ r : ℝ≥0, 0 < r → r < r₀ → + (g r : ℝ) = (r : ℝ) ^ dimension κ * Real.log (Real.log (1 / (r : ℝ))) + +def halfPlane : Set ℂ := {z | 0 < z.im} + +def localizationSegment (γ : ℝ → ℂ) (s t : ℝ) : Set ℂ := γ '' Icc s t + +def localizationWholeTrace (γ : ℝ → ℂ) : Set ℂ := γ '' Ici 0 + +def rectangle (m : ℕ) : Set ℂ := + {z | -(m : ℝ) ≤ z.re ∧ z.re ≤ m ∧ 0 ≤ z.im ∧ z.im ≤ m} + +def localizationDomain (γ : ℝ → ℂ) (t : ℝ) : Set ℂ := + {z | z ∈ halfPlane \ localizationSegment γ 0 t ∧ + ¬ Bornology.IsBounded (connectedComponentIn (halfPlane \ localizationSegment γ 0 t) z)} + +def IsLoewnerTrace (driver : ℝ → ℝ) (γ : ℝ → ℂ) : Prop := + ContinuousOn γ (Ici 0) ∧ γ 0 = 0 ∧ + (∀ t, 0 ≤ t → 0 ≤ (γ t).im) ∧ + Tendsto γ atTop (Bornology.cobounded ℂ) ∧ + ∃ g f : ℝ → ℂ → ℂ, + (∀ z ∈ halfPlane, g 0 z = z) ∧ + (∀ t, 0 ≤ t → AnalyticOnNhd ℂ (g t) (localizationDomain γ t)) ∧ + (∀ t, 0 ≤ t → AnalyticOnNhd ℂ (f t) halfPlane) ∧ + (∀ t, 0 ≤ t → MapsTo (g t) (localizationDomain γ t) halfPlane) ∧ + (∀ t, 0 ≤ t → MapsTo (f t) halfPlane (localizationDomain γ t)) ∧ + (∀ t, 0 ≤ t → ∀ z ∈ localizationDomain γ t, f t (g t z) = z) ∧ + (∀ t, 0 ≤ t → ∀ z ∈ halfPlane, g t (f t z) = z) ∧ + (∀ z ∈ halfPlane, + ContinuousOn (fun t => g t z) {t | 0 ≤ t ∧ z ∈ localizationDomain γ t}) ∧ + (∀ t, 0 < t → ∀ z ∈ localizationDomain γ t, + HasDerivAt (fun u => g u z) (2 / (g t z - (driver t : ℂ))) t) ∧ + (∀ t, 0 ≤ t → Tendsto + (fun y : ℝ => f t ((driver t : ℂ) + (y : ℂ) * Complex.I)) + (𝓝[>] 0) (𝓝 (γ t))) + +def IsChordalSLE {Ω : Type*} [MeasurableSpace Ω] + (κ : ℝ) (P : Measure Ω) (γ : Ω → ℝ → ℂ) : Prop := + (∀ t, 0 ≤ t → AEMeasurable (fun ω => γ ω t) P) ∧ + ∃ B : ℝ≥0 → Ω → ℝ, IsBrownianReal B P ∧ + ∀ᵐ ω ∂P, IsLoewnerTrace (fun t => Real.sqrt κ * B t.toNNReal ω) (γ ω) + +def LocalizationMainEvent (h : Gauge) (γ : ℝ → ℂ) : Prop := + (∀ s t : ℝ, 0 < s → s < t → + 0 < h.hausdorff (localizationSegment γ s t) ∧ h.hausdorff (localizationSegment γ s t) < ∞) ∧ + (∀ m : ℕ, 0 < m → h.hausdorff (localizationWholeTrace γ ∩ rectangle m) < ∞) + +def LocalizationMainConclusion {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (γ : Ω → ℝ → ℂ) (h : Gauge) : Prop := + (∀ᵐ ω ∂P, LocalizationMainEvent h (γ ω)) ∧ + (∀ R : ℝ, 0 < R → ∃ C : ℝ≥0, + (∫⁻ ω, h.hausdorff (localizationWholeTrace (γ ω) ∩ Metric.closedBall 0 R) ∂P) ≤ C) + +def LargerGaugeConclusion (g : Gauge) (γ : ℝ → ℂ) : Prop := + ∀ s t : ℝ, 0 < s → s < t → + ¬ SigmaFinite (g.hausdorff.restrict (localizationSegment γ s t)) ∧ + g.hausdorff (localizationSegment γ s t) = ∞ + +def IsLoewnerTraceUsing (driver : ℝ → ℝ) (γ : ℝ → ℂ) + (g f : ℝ → ℂ → ℂ) : Prop := + ContinuousOn γ (Ici 0) ∧ γ 0 = 0 ∧ + (∀ t, 0 ≤ t → 0 ≤ (γ t).im) ∧ + Tendsto γ atTop (Bornology.cobounded ℂ) ∧ + (∀ z ∈ halfPlane, g 0 z = z) ∧ + (∀ t, 0 ≤ t → AnalyticOnNhd ℂ (g t) (localizationDomain γ t)) ∧ + (∀ t, 0 ≤ t → AnalyticOnNhd ℂ (f t) halfPlane) ∧ + (∀ t, 0 ≤ t → MapsTo (g t) (localizationDomain γ t) halfPlane) ∧ + (∀ t, 0 ≤ t → MapsTo (f t) halfPlane (localizationDomain γ t)) ∧ + (∀ t, 0 ≤ t → ∀ z ∈ localizationDomain γ t, f t (g t z) = z) ∧ + (∀ t, 0 ≤ t → ∀ z ∈ halfPlane, g t (f t z) = z) ∧ + (∀ z ∈ halfPlane, + ContinuousOn (fun t => g t z) {t | 0 ≤ t ∧ z ∈ localizationDomain γ t}) ∧ + (∀ t, 0 < t → ∀ z ∈ localizationDomain γ t, + HasDerivAt (fun u => g u z) (2 / (g t z - (driver t : ℂ))) t) ∧ + (∀ t, 0 ≤ t → Tendsto + (fun y : ℝ => f t ((driver t : ℂ) + (y : ℂ) * Complex.I)) + (𝓝[>] 0) (𝓝 (γ t))) + +def loewnerRadius (g : ℝ → ℂ → ℂ) (t : ℝ) (z : ℂ) : ℝ := + 2 * (g t z).im / ‖deriv (g t) z‖ + +def loewnerAngleSine (κ : ℝ) (B : ℝ≥0 → ℝ) + (g : ℝ → ℂ → ℂ) (t : ℝ) (z : ℂ) : ℝ := + (g t z).im / ‖g t z - (Real.sqrt κ * B t.toNNReal : ℂ)‖ + +def firstLiveRadiusStop (γ : ℝ → ℂ) (g : ℝ → ℂ → ℂ) + (z : ℂ) (u : ℝ) : ℝ≥0∞ := + sInf ((fun t : ℝ≥0 => (t : ℝ≥0∞)) '' + {t : ℝ≥0 | z ∈ localizationDomain γ t ∧ + loewnerRadius g t z = (2 * z.im) * Real.exp (-u)}) + +def finiteStoppedDensity (κ : ℝ) (B : ℝ≥0 → ℝ) (γ : ℝ → ℂ) + (g : ℝ → ℂ → ℂ) (z : ℂ) (u : ℝ) : ℝ≥0∞ := + let τ := firstLiveRadiusStop γ g z u + if τ = ∞ then 0 else + ENNReal.ofReal ((loewnerRadius g τ.toReal z) ^ (-codimension κ) * + (loewnerAngleSine κ B g τ.toReal z) ^ (8 / κ - 1)) + +lemma halfPlane_open : IsOpen halfPlane := + isOpen_lt continuous_const Complex.continuous_im + +lemma halfPlane_preconnected : IsPreconnected halfPlane := + (convex_halfSpace_im_gt 0).isPreconnected + +lemma halfPlane_not_bounded : ¬ Bornology.IsBounded halfPlane := by + intro hb + obtain ⟨R, hR, hbound⟩ := hb.exists_pos_norm_lt + have hm : ((R : ℂ) * Complex.I) ∈ halfPlane := by + simpa [halfPlane] using hR + have hh := hbound _ hm + rw [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs, + abs_of_pos hR] at hh + exact lt_irrefl _ hh + +lemma survivingDomain_mono {γ : ℝ → ℂ} {s t : ℝ} (hst : s ≤ t) : + localizationDomain γ t ⊆ localizationDomain γ s := by + have hsub : halfPlane \ localizationSegment γ 0 t ⊆ halfPlane \ localizationSegment γ 0 s := by + apply sdiff_subset_sdiff_right + exact image_mono (Icc_subset_Icc le_rfl hst) + intro z hz + exact ⟨hsub hz.1, fun hb => hz.2 (hb.subset (connectedComponentIn_mono z hsub))⟩ + +lemma survivingDomain_zero {γ : ℝ → ℂ} (hγ : γ 0 = 0) : + localizationDomain γ 0 = halfPlane := by + have hset : halfPlane \ localizationSegment γ 0 0 = halfPlane := by + simp only [localizationSegment, Icc_self, image_singleton, hγ] + apply sdiff_singleton_eq_self + simp [halfPlane] + ext z + constructor + · exact fun h => h.1.1 + · intro hz + refine ⟨by simpa only [hset] using hz, ?_⟩ + rw [hset] + intro hb + exact halfPlane_not_bounded (hb.subset + (halfPlane_preconnected.subset_connectedComponentIn hz subset_rfl)) + +lemma survivingDomain_open {γ : ℝ → ℂ} (hγ : ContinuousOn γ (Ici 0)) + {t : ℝ} (_ht : 0 ≤ t) : IsOpen (localizationDomain γ t) := by + have hc : IsCompact (localizationSegment γ 0 t) := + isCompact_Icc.image_of_continuousOn (hγ.mono (fun _ ha => ha.1)) + have hF : IsOpen (halfPlane \ localizationSegment γ 0 t) := halfPlane_open.sdiff hc.isClosed + apply isOpen_iff_mem_nhds.2 + intro z hz + have ho := hF.connectedComponentIn (x := z) + have hn := ho.mem_nhds (mem_connectedComponentIn hz.1) + apply Filter.mem_of_superset hn + intro w hw + refine ⟨connectedComponentIn_subset _ _ hw, ?_⟩ + rw [← connectedComponentIn_eq hw] + exact hz.2 + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge +namespace IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +lemma initial (h : IsLoewnerTraceUsing driver γ g f) : + ∀ z ∈ halfPlane, g 0 z = z := h.2.2.2.2.1 + +lemma continuous_eval (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (_hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => g t z) (Icc 0 T) := by + rcases h with ⟨hγ, hzero, him, htrans, hinit, hg, hf, hgmap, hfmap, hfg, hgf, hc, hd, htip⟩ + apply (hc z hz.1.1).mono + intro t ht + exact ⟨ht.1, survivingDomain_mono ht.2 hz⟩ + +lemma im_pos (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + 0 < (g t z).im := h.2.2.2.2.2.2.2.1 t ht hz + +lemma analytic_eval (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + AnalyticAt ℂ (g t) z := h.2.2.2.2.2.1 t ht z hz + +lemma deriv_initial (h : IsLoewnerTraceUsing driver γ g f) + {z : ℂ} (hz : z ∈ halfPlane) : deriv (g 0) z = 1 := by + have heq : g 0 =ᶠ[𝓝 z] id := by + filter_upwards [halfPlane_open.mem_nhds hz] with w hw + exact h.initial w hw + rw [heq.deriv_eq] + exact deriv_id z + +lemma hasDerivAt_eval (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 < t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + HasDerivAt (fun u => g u z) (2 / (g t z - (driver t : ℂ))) t := by + rcases h with ⟨hγ, hzero, him, htrans, hinit, hg, hf, hgmap, hfmap, hfg, hgf, hc, hd, htip⟩ + exact hd t ht z hz + +lemma deriv_ne_zero (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + deriv (g t) z ≠ 0 := by + rcases h with ⟨hγ, hzero, him, htrans, hinit, hg, hf, hgmap, hfmap, hfg, hgf, hc, hd, htip⟩ + have hgd := (hg t ht z hz).differentiableAt.hasDerivAt + have hfd := (hf t ht _ (hgmap t ht hz)).differentiableAt.hasDerivAt + have heq : (fun w => f t (g t w)) =ᶠ[𝓝 z] id := by + filter_upwards [(survivingDomain_open hγ ht).mem_nhds hz] with w hw + exact hfg t ht w hw + have hh := (hfd.comp z hgd).congr_of_eventuallyEq heq.symm + have he := hh.unique (hasDerivAt_id z) + intro hn + simp [hn] at he + +lemma radius_pos (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + 0 < loewnerRadius g t z := by + unfold loewnerRadius + exact div_pos (mul_pos (by norm_num) (h.im_pos ht hz)) + (norm_pos_iff.2 (h.deriv_ne_zero ht hz)) + +lemma radius_initial (h : IsLoewnerTraceUsing driver γ g f) + {z : ℂ} (hz : z ∈ halfPlane) : loewnerRadius g 0 z = 2 * z.im := by + simp [loewnerRadius, h.initial z hz, h.deriv_initial hz] + +lemma centered_ne_zero (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + g t z - (driver t : ℂ) ≠ 0 := by + intro he + have hi := congrArg Complex.im he + have hp := h.im_pos ht hz + simp only [Complex.sub_im, Complex.ofReal_im, sub_zero, Complex.zero_im] at hi + exact hp.ne' hi + +lemma hasDerivAt_height (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 < t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + HasDerivAt (fun s => (g s z).im) + (-2 * (g t z).im / Complex.normSq (g t z - (driver t : ℂ))) t := by + have hh := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t (h.hasDerivAt_eval ht hz) + simpa [Complex.div_im, Function.comp_def, neg_div] using hh + +lemma height_antitone (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) : + AntitoneOn (fun t => (g t z).im) (Icc 0 T) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 0 T) + (Complex.continuous_im.comp_continuousOn (h.continuous_eval hT hz)) + (f' := fun t => -2 * (g t z).im / Complex.normSq (g t z - (driver t : ℂ))) + · intro t ht + rw [interior_Icc] at ht + exact (h.hasDerivAt_height ht.1 (survivingDomain_mono ht.2.le hz)).hasDerivWithinAt + · intro t ht + rw [interior_Icc] at ht + exact div_nonpos_of_nonpos_of_nonneg + (mul_nonpos_of_nonpos_of_nonneg (by norm_num) + (h.im_pos ht.1.le (survivingDomain_mono ht.2.le hz)).le) + (Complex.normSq_nonneg _) + +lemma height_le_initial (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + (g t z).im ≤ z.im := by + have hh := h.height_antitone ht hz ⟨le_rfl, ht⟩ ⟨ht, le_rfl⟩ ht + simpa only [h.initial z hz.1.1] using hh + +lemma continuous_velocity (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => 2 / (g t z - (driver t : ℂ))) (Icc 0 T) := by + apply continuousOn_const.div + ((h.continuous_eval hT hz).sub (Complex.continuous_ofReal.comp_continuousOn hU)) + intro t ht + exact h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hz) + +lemma integral_velocity (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) + {a b : ℝ} (ha : a ∈ Icc 0 T) (hb : b ∈ Icc 0 T) (hab : a ≤ b) : + (∫ t in a..b, 2 / (g t z - (driver t : ℂ))) = g b z - g a z := by + have hsub : Icc a b ⊆ Icc 0 T := Icc_subset_Icc ha.1 hb.2 + apply intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hab + ((h.continuous_eval hT hz).mono hsub) + · intro t ht + exact h.hasDerivAt_eval (lt_of_le_of_lt ha.1 ht.1) + (survivingDomain_mono (ht.2.le.trans hb.2) hz) + · apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le hab] using (h.continuous_velocity hT hU hz).mono hsub + +lemma norm_velocity_le (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) {z : ℂ} (hz : z ∈ localizationDomain γ T) + {t : ℝ} (ht : t ∈ Icc 0 T) : + ‖2 / (g t z - (driver t : ℂ))‖ ≤ 2 / (g T z).im := by + have hY := h.im_pos hT hz + have hm : (g T z).im ≤ (g t z).im := + h.height_antitone hT hz ht ⟨hT, le_rfl⟩ ht.2 + have hn : (g t z).im ≤ ‖g t z - (driver t : ℂ)‖ := by + have hh := Complex.im_le_norm (g t z - (driver t : ℂ)) + simpa only [Complex.sub_im, Complex.ofReal_im, sub_zero] using hh + rw [norm_div, Complex.norm_ofNat] + exact div_le_div_of_nonneg_left (by norm_num) hY (hm.trans hn) + +lemma norm_time_sub_le (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) + {a b : ℝ} (ha : a ∈ Icc 0 T) (hb : b ∈ Icc 0 T) : + ‖g b z - g a z‖ ≤ (2 / (g T z).im) * |b - a| := by + wlog hab : a ≤ b generalizing a b + · have hh := this hb ha (le_of_not_ge hab) + simpa only [norm_sub_rev, abs_sub_comm] using hh + rw [← h.integral_velocity hT hU hz ha hb hab] + exact intervalIntegral.norm_integral_le_of_norm_le_const fun t ht => + h.norm_velocity_le hT hz ⟨ha.1.trans (uIoc_of_le hab ▸ ht).1.le, + (uIoc_of_le hab ▸ ht).2.trans hb.2⟩ + +end IsLoewnerTraceUsing + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge + +lemma firstLiveRadiusStop_zero {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + (h : IsLoewnerTraceUsing driver γ g f) {z : ℂ} (hz : z ∈ halfPlane) : + firstLiveRadiusStop γ g z 0 = 0 := by + apply le_antisymm ?_ bot_le + apply sInf_le + refine ⟨0, ⟨?_, ?_⟩, rfl⟩ + · simpa only [NNReal.coe_zero, survivingDomain_zero h.2.1] using hz + · simpa only [NNReal.coe_zero, neg_zero, Real.exp_zero, mul_one] using h.radius_initial hz + +end SLEExactGauge + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.IsLoewnerTraceUsing +variable {driver : ℝ → ℝ} {γ : ℝ → ℂ} {g f : ℝ → ℂ → ℂ} + +def differenceCoefficient (driver : ℝ → ℝ) (g : ℝ → ℂ → ℂ) (w z : ℂ) (t : ℝ) : ℂ := + -2 / ((g t w - (driver t : ℂ)) * (g t z - (driver t : ℂ))) + +lemma continuous_differenceCoefficient (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {w z : ℂ} (hw : w ∈ localizationDomain γ T) (hz : z ∈ localizationDomain γ T) : + ContinuousOn (differenceCoefficient driver g w z) (Icc 0 T) := by + apply continuousOn_const.div + (((h.continuous_eval hT hw).sub (Complex.continuous_ofReal.comp_continuousOn hU)).mul + ((h.continuous_eval hT hz).sub (Complex.continuous_ofReal.comp_continuousOn hU))) + intro t ht + exact mul_ne_zero (h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hw)) + (h.centered_ne_zero ht.1 (survivingDomain_mono ht.2 hz)) + +lemma difference_eq_exp_integral (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {w z : ℂ} (hw : w ∈ localizationDomain γ T) (hz : z ∈ localizationDomain γ T) : + g T w - g T z = (w-z) * Complex.exp + (∫ s in (0 : ℝ)..T, differenceCoefficient driver g w z s) := by + let a := differenceCoefficient driver g w z + let A : ℝ → ℂ := fun t => ∫ s in (0 : ℝ)..t, a s + have ha : ContinuousOn a (Icc 0 T) := h.continuous_differenceCoefficient hT hU hw hz + have hi : IntervalIntegrable a volume 0 T := ha.intervalIntegrable_of_Icc hT + have hAc : ContinuousOn A (Icc 0 T) := by + simpa only [uIcc_of_le hT, A] using + intervalIntegral.continuousOn_primitive_interval' hi (left_mem_uIcc : (0 : ℝ) ∈ uIcc 0 T) + have hAd {t : ℝ} (ht : t ∈ Ioo 0 T) : HasDerivAt A (a t) t := by + apply intervalIntegral.integral_hasDerivAt_right + (hi.mono_set (by rw [uIcc_of_le ht.1.le, uIcc_of_le hT]; exact Icc_subset_Icc le_rfl ht.2.le)) + · have hh := ha.stronglyMeasurableAtFilter_nhdsWithin (μ := volume) measurableSet_Icc t + rwa [nhdsWithin_eq_nhds.mpr (Icc_mem_nhds ht.1 ht.2)] at hh + · exact ha.continuousAt (Icc_mem_nhds ht.1 ht.2) + let R : ℝ → ℂ := fun t => (g t w - g t z) * Complex.exp (-A t) + have hRc : ContinuousOn R (Icc 0 T) := by + exact ((h.continuous_eval hT hw).sub (h.continuous_eval hT hz)).mul + (Complex.continuous_exp.comp_continuousOn hAc.neg) + have hRd (t : ℝ) (ht : t ∈ Ioo 0 T) : HasDerivAt R 0 t := by + have hd := ((h.hasDerivAt_eval ht.1 (survivingDomain_mono ht.2.le hw)).sub + (h.hasDerivAt_eval ht.1 (survivingDomain_mono ht.2.le hz))).mul (hAd ht).neg.cexp + apply hd.congr_deriv + have hw' := h.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hw) + have hz' := h.centered_ne_zero ht.1.le (survivingDomain_mono ht.2.le hz) + dsimp [a, differenceCoefficient] + field_simp + ring + have hr := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le hT hRc hRd + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (0 : ℂ)) volume 0 T) + have hR : R T = w-z := by + apply sub_eq_zero.1 + simpa only [intervalIntegral.integral_zero, R, A, intervalIntegral.integral_same, + neg_zero, Complex.exp_zero, mul_one, h.initial w hw.1.1, h.initial z hz.1.1, + ] using hr.symm + have hexp := Complex.exp_ne_zero (-A T) + dsimp [R] at hR + calc + g T w - g T z = (g T w - g T z) * (Complex.exp (-A T) * Complex.exp (A T)) := by + rw [← Complex.exp_add, neg_add_cancel, Complex.exp_zero, mul_one] + _ = (w-z) * Complex.exp (A T) := by rw [← mul_assoc, hR] + +lemma continuousAt_integral_differenceCoefficient (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousAt (fun w => ∫ s in (0 : ℝ)..T, differenceCoefficient driver g w z s) z := by + let ε := (g T z).im / 2 + have hε : 0 < ε := half_pos (h.im_pos hT hz) + have hev : ∀ᶠ w in 𝓝 z, w ∈ localizationDomain γ T ∧ ε ≤ (g T w).im := by + have hc := Complex.continuous_im.continuousAt.comp (h.analytic_eval hT hz).continuousAt + have hlt : ε < (g T z).im := by dsimp [ε]; linarith [h.im_pos hT hz] + filter_upwards [(survivingDomain_open h.1 hT).mem_nhds hz, + hc.eventually (Ioi_mem_nhds hlt)] with w hw hh + exact ⟨hw, hh.le⟩ + apply intervalIntegral.continuousAt_of_dominated_interval (bound := fun _ => 2 / ε^2) + · filter_upwards [hev] with w hw + have hc := h.continuous_differenceCoefficient hT hU hw.1 hz + apply ContinuousOn.aestronglyMeasurable _ measurableSet_uIoc + exact hc.mono (by rw [uIoc_of_le hT]; exact Ioc_subset_Icc_self) + · filter_upwards [hev] with w hw + apply ae_of_all + intro t ht + rw [uIoc_of_le hT] at ht + have hwheight : ε ≤ (g t w).im := + hw.2.trans (h.height_antitone hT hw.1 ⟨ht.1.le, ht.2⟩ ⟨hT, le_rfl⟩ ht.2) + have hzheight : ε ≤ (g t z).im := by + have hhalf : ε ≤ (g T z).im := by dsimp [ε]; linarith [h.im_pos hT hz] + exact hhalf.trans (h.height_antitone hT hz ⟨ht.1.le, ht.2⟩ ⟨hT, le_rfl⟩ ht.2) + have hwn : ε ≤ ‖g t w - (driver t : ℂ)‖ := hwheight.trans (by + simpa using Complex.im_le_norm (g t w - (driver t : ℂ))) + have hzn : ε ≤ ‖g t z - (driver t : ℂ)‖ := hzheight.trans (by + simpa using Complex.im_le_norm (g t z - (driver t : ℂ))) + simp only [differenceCoefficient, norm_div, norm_neg, Complex.norm_ofNat, norm_mul] + apply div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hε) + simpa only [pow_two] using mul_le_mul hwn hzn hε.le (norm_nonneg _) + · exact intervalIntegrable_const + · apply ae_of_all + intro t ht + rw [uIoc_of_le hT] at ht + have hzt := survivingDomain_mono ht.2 hz + exact continuousAt_const.div + (((h.analytic_eval ht.1.le hzt).continuousAt.sub continuousAt_const).mul continuousAt_const) + (mul_ne_zero (h.centered_ne_zero ht.1.le hzt) (h.centered_ne_zero ht.1.le hzt)) + +lemma spatial_deriv_eq_exp_integral (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + deriv (g T) z = Complex.exp (∫ s in (0 : ℝ)..T, + -2 / (g s z - (driver s : ℂ))^2) := by + have hd : HasDerivAt (g T) (Complex.exp (∫ s in (0 : ℝ)..T, + differenceCoefficient driver g z z s)) z := by + apply hasDerivAt_iff_tendsto_slope.2 + have hc := Complex.continuous_exp.continuousAt.comp + (h.continuousAt_integral_differenceCoefficient hT hU hz) + apply (hc.mono_left nhdsWithin_le_nhds).congr' + filter_upwards [self_mem_nhdsWithin, + mem_nhdsWithin_of_mem_nhds ((survivingDomain_open h.1 hT).mem_nhds hz)] + with w hwne hw + have hwz : w ≠ z := hwne + dsimp only [slope, vsub_eq_sub, Function.comp_def] + rw [h.difference_eq_exp_integral hT hU hw hz] + simp only [smul_eq_mul, ← mul_assoc, inv_mul_cancel₀ (sub_ne_zero.2 hwz), one_mul] + have he : (fun s => differenceCoefficient driver g z z s) = + (fun s => -2 / (g s z - (driver s : ℂ))^2) := by + funext s + simp only [differenceCoefficient, pow_two] + simpa only [he] using hd.deriv + +lemma log_deriv_norm_eq (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + Real.log ‖deriv (g T) z‖ = + (∫ s in (0 : ℝ)..T, -2 / (g s z - (driver s : ℂ))^2).re := by + rw [h.spatial_deriv_eq_exp_integral hT hU hz, Complex.norm_exp, Real.log_exp] + +lemma continuous_spatialCoefficient (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun s => -2 / (g s z - (driver s : ℂ))^2) (Icc 0 T) := by + have hc := h.continuous_differenceCoefficient hT hU hz hz + unfold differenceCoefficient at hc + simpa only [pow_two] using hc + +lemma continuous_log_deriv_norm (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => Real.log ‖deriv (g t) z‖) (Icc 0 T) := by + have hi : IntervalIntegrable (fun s => -2 / (g s z - (driver s : ℂ))^2) volume 0 T := + (h.continuous_spatialCoefficient hT hU hz).intervalIntegrable_of_Icc hT + have hc := Complex.continuous_re.comp_continuousOn + (intervalIntegral.continuousOn_primitive_interval' hi left_mem_uIcc) + rw [uIcc_of_le hT] at hc + apply hc.congr + intro t ht + exact h.log_deriv_norm_eq ht.1 + (hU.mono (Icc_subset_Icc le_rfl ht.2)) (survivingDomain_mono ht.2 hz) + +lemma hasDerivAt_log_deriv_norm (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (fun s => Real.log ‖deriv (g s) z‖) + (-2 / (g t z - (driver t : ℂ))^2).re t := by + have hc := h.continuous_spatialCoefficient hT hU hz + have hi : IntervalIntegrable (fun s => -2 / (g s z - (driver s : ℂ))^2) volume 0 t := + (hc.intervalIntegrable_of_Icc hT).mono_set (by + rw [uIcc_of_le ht.1.le, uIcc_of_le hT] + exact Icc_subset_Icc le_rfl ht.2.le) + have hm := hc.stronglyMeasurableAtFilter_nhdsWithin (μ := volume) measurableSet_Icc t + rw [nhdsWithin_eq_nhds.mpr (Icc_mem_nhds ht.1 ht.2)] at hm + have hd := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t + (intervalIntegral.integral_hasDerivAt_right hi hm + (hc.continuousAt (Icc_mem_nhds ht.1 ht.2))) + apply hd.congr_of_eventuallyEq + filter_upwards [Icc_mem_nhds ht.1 ht.2] with s hs + exact h.log_deriv_norm_eq hs.1 (hU.mono (Icc_subset_Icc le_rfl hs.2)) + (survivingDomain_mono hs.2 hz) + +lemma real_spatialCoefficient (w : ℂ) : + (-2 / w^2).re = -2 * (w.re^2-w.im^2) / (Complex.normSq w)^2 := by + simp only [Complex.div_re, Complex.neg_re, Complex.re_ofNat, Complex.neg_im, + Complex.im_ofNat, neg_zero, zero_mul, map_pow] + simp only [pow_two, Complex.mul_re] + ring + +lemma log_radius_eq (h : IsLoewnerTraceUsing driver γ g f) + {t : ℝ} (ht : 0 ≤ t) {z : ℂ} (hz : z ∈ localizationDomain γ t) : + Real.log (loewnerRadius g t z) = Real.log 2 + Real.log (g t z).im - + Real.log ‖deriv (g t) z‖ := by + rw [loewnerRadius, Real.log_div (mul_ne_zero (by norm_num) (h.im_pos ht hz).ne') + (norm_ne_zero_iff.2 (h.deriv_ne_zero ht hz)), + Real.log_mul (by norm_num) (h.im_pos ht hz).ne'] + +lemma continuous_log_radius (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => Real.log (loewnerRadius g t z)) (Icc 0 T) := by + have hc := ((Complex.continuous_im.comp_continuousOn (h.continuous_eval hT hz)).log + (fun t ht => (h.im_pos ht.1 (survivingDomain_mono ht.2 hz)).ne')).const_add (Real.log 2) + apply (hc.sub (h.continuous_log_deriv_norm hT hU hz)).congr + intro t ht + exact h.log_radius_eq ht.1 (survivingDomain_mono ht.2 hz) + +lemma hasDerivAt_log_radius (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) {t : ℝ} (ht : t ∈ Ioo 0 T) : + HasDerivAt (fun s => Real.log (loewnerRadius g s z)) + (-4 * (g t z).im^2 / (Complex.normSq (g t z - (driver t : ℂ)))^2) t := by + have hzt := survivingDomain_mono ht.2.le hz + have hY := h.im_pos ht.1.le hzt + have hd := (((h.hasDerivAt_height ht.1 hzt).log hY.ne').const_add (Real.log 2)).sub + (h.hasDerivAt_log_deriv_norm hT hU hz ht) + have he : HasDerivAt (fun s => Real.log (loewnerRadius g s z)) + ((-2 * (g t z).im / Complex.normSq (g t z - (driver t : ℂ))) / (g t z).im - + (-2 / (g t z - (driver t : ℂ))^2).re) t := by + apply hd.congr_of_eventuallyEq + filter_upwards [Icc_mem_nhds ht.1 ht.2] with s hs + exact h.log_radius_eq hs.1 (survivingDomain_mono hs.2 hz) + apply he.congr_deriv + rw [real_spatialCoefficient] + simp only [Complex.sub_im, Complex.ofReal_im, sub_zero] + rw [Complex.normSq_apply] + simp only [Complex.sub_re, Complex.ofReal_re, Complex.sub_im, Complex.ofReal_im, sub_zero] + field_simp + ring + +lemma continuous_radius (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + ContinuousOn (fun t => loewnerRadius g t z) (Icc 0 T) := by + apply (Real.continuous_exp.comp_continuousOn (h.continuous_log_radius hT hU hz)).congr + intro t ht + exact (Real.exp_log (h.radius_pos ht.1 (survivingDomain_mono ht.2 hz))).symm + +lemma log_radius_strictAnti (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + StrictAntiOn (fun t => Real.log (loewnerRadius g t z)) (Icc 0 T) := by + apply strictAntiOn_of_hasDerivWithinAt_neg (convex_Icc 0 T) + (h.continuous_log_radius hT hU hz) + (f' := fun t => -4 * (g t z).im^2 / (Complex.normSq (g t z - (driver t : ℂ)))^2) + · intro t ht + rw [interior_Icc] at ht + exact (h.hasDerivAt_log_radius hT hU hz ht).hasDerivWithinAt + · intro t ht + rw [interior_Icc] at ht + have hzt := survivingDomain_mono ht.2.le hz + have hy := h.im_pos ht.1.le hzt + have hq := Complex.normSq_pos.2 (h.centered_ne_zero ht.1.le hzt) + exact div_neg_of_neg_of_pos (mul_neg_of_neg_of_pos (by norm_num) (sq_pos_of_pos hy)) + (sq_pos_of_pos hq) + +lemma radius_strictAnti (h : IsLoewnerTraceUsing driver γ g f) + {T : ℝ} (hT : 0 ≤ T) (hU : ContinuousOn driver (Icc 0 T)) + {z : ℂ} (hz : z ∈ localizationDomain γ T) : + StrictAntiOn (fun t => loewnerRadius g t z) (Icc 0 T) := by + intro s hs t ht hst + exact (Real.log_lt_log_iff (h.radius_pos ht.1 (survivingDomain_mono ht.2 hz)) + (h.radius_pos hs.1 (survivingDomain_mono hs.2 hz))).1 + (h.log_radius_strictAnti hT hU hz hs ht hst) + +lemma live_radius_injective (h : IsLoewnerTraceUsing driver γ g f) + (hU : ContinuousOn driver (Ici 0)) {z : ℂ} {s t : ℝ} + (hs : 0 ≤ s) (ht : 0 ≤ t) (hzs : z ∈ localizationDomain γ s) + (hzt : z ∈ localizationDomain γ t) (he : loewnerRadius g s z = loewnerRadius g t z) : + s = t := by + rcases le_total s t with hst | hts + · exact (h.radius_strictAnti ht (hU.mono Icc_subset_Ici_self) hzt).injOn + ⟨hs, hst⟩ ⟨ht, le_rfl⟩ he + · exact (h.radius_strictAnti hs (hU.mono Icc_subset_Ici_self) hzs).injOn + ⟨hs, le_rfl⟩ ⟨ht, hts⟩ he + +lemma firstLiveRadiusStop_eq (h : IsLoewnerTraceUsing driver γ g f) + (hU : ContinuousOn driver (Ici 0)) {z : ℂ} {u : ℝ} {t : ℝ≥0} + (hzt : z ∈ localizationDomain γ t) + (he : loewnerRadius g t z = (2*z.im)*Real.exp (-u)) : + firstLiveRadiusStop γ g z u = (t : ℝ≥0∞) := by + have heq : {s : ℝ≥0 | z ∈ localizationDomain γ s ∧ + loewnerRadius g s z = (2*z.im)*Real.exp (-u)} = {t} := by + ext s + constructor + · intro hs + apply mem_singleton_iff.2 + apply NNReal.coe_injective + exact h.live_radius_injective hU s.coe_nonneg t.coe_nonneg hs.1 hzt (hs.2.trans he.symm) + · rintro rfl + exact ⟨hzt, he⟩ + simp only [firstLiveRadiusStop, heq, image_singleton, sInf_singleton] + +end SLEExactGauge.IsLoewnerTraceUsing + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/TruncatedEnergy.lean b/lean/OAI/Probability/SLELocalization/TruncatedEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..49467983fd73160b4a398672526415bf0bf5b0b2 --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/TruncatedEnergy.lean @@ -0,0 +1,270 @@ +import Mathlib +import OAI.Probability.SLELocalization.CommonClocks + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma radialTruncation_fderiv_le {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) + {F : ℂ → ℂ} {z q : ℂ} (hd : DifferentiableAt ℂ F z) : + ‖fderiv ℝ (radialTruncation H q r ∘ F) z‖ ≤ ‖deriv F z‖/r := by + have hb := radialTruncation_fderiv_bound hH hr (q := q) hd + have hs : ‖fderiv ℝ (radialTruncation H q r ∘ F) z‖^2 ≤ (‖deriv F z‖/r)^2 := by + by_cases hh : r < ‖F z-q‖ ∧ ‖F z-q‖ < Real.exp H*r + · rw [ite_eq_left hh] at hb + refine hb.trans ?_ + rw [div_pow] + exact div_le_div_of_nonneg_left (sq_nonneg _) (sq_pos_of_pos hr) + (pow_le_pow_left₀ hr.le hh.1.le 2) + · rw [ite_eq_right hh] at hb + exact hb.trans (sq_nonneg _) + exact (sq_le_sq₀ (norm_nonneg _) (div_nonneg (norm_nonneg _) hr.le)).1 hs + +lemma truncated_gradient_comp_integrable + {α : Type*} [TopologicalSpace α] [T2Space α] [MeasurableSpace α] [BorelSpace α] + {μ : Measure α} [IsFiniteMeasureOnCompacts μ] + {K : Set α} (hK : IsCompact K) {c : α → ℂ} (hc : Continuous c) + {U : Set ℂ} (hU : IsOpen U) {F : ℂ → ℂ} (hF : DifferentiableOn ℂ F U) + (hmap : MapsTo c K U) {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) : + IntegrableOn (fun x => ‖fderiv ℝ (radialTruncation H q r ∘ F) (c x)‖^2) K μ := by + have hcont : ContinuousOn (fun x => deriv F (c x)) K := + (hF.deriv hU).continuousOn.comp hc.continuousOn hmap + obtain ⟨M,hM⟩ := hK.exists_bound_of_continuousOn hcont + have hm : AEStronglyMeasurable + (fun x => ‖fderiv ℝ (radialTruncation H q r ∘ F) (c x)‖^2) (μ.restrict K) := + (((measurable_fderiv ℝ _).comp hc.measurable).norm.pow_const 2).aestronglyMeasurable + let : IsFiniteMeasure (μ.restrict K) := isFiniteMeasure_restrict.2 hK.measure_lt_top.ne + apply (integrable_const ((M/r)^2)).mono' hm + filter_upwards [ae_restrict_mem₀ hK.nullMeasurableSet] with x hx + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + have hb := (radialTruncation_fderiv_le hH hr (q := q) (hF.differentiableAt (hU.mem_nhds (hmap hx)))).trans + (div_le_div_of_nonneg_right (hM x hx) hr.le) + exact pow_le_pow_left₀ (norm_nonneg _) hb 2 + +end SLEExactGauge.RectangleEnergy + +end + +/-! Conformal localization and Rectangle Energy estimates. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma truncated_line_oscillation {U : Set ℂ} (hU : IsOpen U) {F : ℂ → ℂ} + (hF : DifferentiableOn ℂ F U) {z e : ℂ} (he : ‖e‖ = 1) {a b x y : ℝ} + (hx : x ∈ Icc a b) (hy : y ∈ Icc a b) + (hmap : MapsTo (fun s : ℝ => z+s • e) (Icc a b) U) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) : + (radialTruncation H q r (F (z+y • e))- + radialTruncation H q r (F (z+x • e)))^2 ≤ + (b-a)*(∫ s in a..b, ‖fderiv ℝ (radialTruncation H q r ∘ F) (z+s • e)‖^2) := by + let c := fun s : ℝ => z+s • e + let u := radialTruncation H q r ∘ F + have hab := hx.1.trans hx.2 + have hc : ContDiff ℝ 1 c := contDiff_const.add (contDiff_id.smul contDiff_const) + have hG : ContDiffOn ℝ 1 (F ∘ c) (Icc a b) := + ((hF.contDiffOn hU).restrict_scalars ℝ).comp hc.contDiffOn hmap + obtain ⟨K,hK⟩ := hG.exists_lipschitzOnWith (by norm_num) (convex_Icc _ _) isCompact_Icc + have hLip := (radialTruncation_lipschitz hr H q).comp_lipschitzOnWith hK + have hD := lipschitzOn_deriv_memLp hLip + have ht := acl_oscillation_energy + (radialTruncation_along_C1_AC hr H q (by simpa only [uIcc_of_le hab] using hG)) hD hx hy + have hgrad := truncated_gradient_comp_integrable (μ := volume) isCompact_Icc hc.continuous hU hF hmap hH hr q + have hderiv (s : ℝ) (hs : s ∈ Icc a b) : + deriv (u ∘ c) s = fderiv ℝ u (c s) e := by + apply radialTruncation_directional_deriv hH hr q (c := c) (t := s) (d := e) (hF.differentiableAt (hU.mem_nhds (hmap hs))) + simpa only [one_smul,c,id_eq] using ((hasDerivAt_id s).smul_const e).const_add z + have hbnd : (∫ s in a..b, (deriv (u ∘ c) s)^2) ≤ + ∫ s in a..b, ‖fderiv ℝ u (c s)‖^2 := by + apply intervalIntegral.integral_mono_on hab + ((intervalIntegrable_iff_integrableOn_Ioc_of_le hab).2 hD.integrable_sq) + ((intervalIntegrable_iff_integrableOn_Icc_of_le hab).2 hgrad) + intro s hs + change (deriv (u ∘ c) s)^2 ≤ ‖fderiv ℝ u (c s)‖^2 + rw [hderiv s hs] + have hh := (fderiv ℝ u (c s)).le_opNorm e + rw [he,mul_one] at hh + have hh' := pow_le_pow_left₀ (norm_nonneg _) hh 2 + simpa only [Real.norm_eq_abs,sq_abs] using hh' + exact ht.trans (mul_le_mul_of_nonneg_left hbnd (sub_nonneg.2 hab)) + +theorem truncated_rectangle_two_lines {U : Set ℂ} (hU : IsOpen U) {F : ℂ → ℂ} + (hF : DifferentiableOn ℂ F U) {a b c d x₁ x₂ y₁ y₂ : ℝ} + (hx₁ : x₁ ∈ Icc a b) (hx₂ : x₂ ∈ Icc a b) + (hy₁ : y₁ ∈ Icc c d) (hy₂ : y₂ ∈ Icc c d) + (hrect : ∀ x ∈ Icc a b, ∀ y ∈ Icc c d, (x:ℂ)+(y:ℂ)*Complex.I ∈ U) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) : + (radialTruncation H q r (F ((x₁:ℂ)+(y₁:ℂ)*Complex.I))- + radialTruncation H q r (F ((x₂:ℂ)+(y₂:ℂ)*Complex.I)))^2 ≤ + 2*(b-a)*(∫ x in a..b, ‖fderiv ℝ (radialTruncation H q r ∘ F) + ((x:ℂ)+(y₁:ℂ)*Complex.I)‖^2)+ + 2*(d-c)*(∫ y in c..d, ‖fderiv ℝ (radialTruncation H q r ∘ F) + ((x₂:ℂ)+(y:ℂ)*Complex.I)‖^2) := by + have hh := truncated_line_oscillation hU hF (z := (y₁:ℂ)*Complex.I) (e := 1) + (by simp) hx₂ hx₁ (by + intro x hx + simpa only [Complex.real_smul,Complex.ofReal_mul,mul_one,add_comm] using hrect x hx y₁ hy₁) hH hr q + have hv := truncated_line_oscillation hU hF (z := (x₂:ℂ)) (e := Complex.I) + (by simp) hy₂ hy₁ (by + intro y hy + simpa only [Complex.real_smul] using hrect x₂ hx₂ y hy) hH hr q + simp only [Complex.real_smul,mul_one] at hh hv + have hi : (∫ x in a..b, ‖fderiv ℝ (radialTruncation H q r ∘ F) ((y₁:ℂ)*Complex.I+(x:ℂ))‖^2) = + ∫ x in a..b, ‖fderiv ℝ (radialTruncation H q r ∘ F) ((x:ℂ)+(y₁:ℂ)*Complex.I)‖^2 := by + congr 1 + funext x + rw [add_comm] + rw [hi,add_comm ((y₁:ℂ)*Complex.I) (x₁:ℂ),add_comm ((y₁:ℂ)*Complex.I) (x₂:ℂ)] at hh + nlinarith [sq_nonneg + (radialTruncation H q r (F ((x₁:ℂ)+(y₁:ℂ)*Complex.I))+ + radialTruncation H q r (F ((x₂:ℂ)+(y₂:ℂ)*Complex.I))- + 2*radialTruncation H q r (F ((x₂:ℂ)+(y₁:ℂ)*Complex.I)))] + +end SLEExactGauge.RectangleEnergy + +end + +/-! Conformal localization and Rectangle Energy estimates. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma radial_section_mem {z : ℂ} {a b s : ℝ} (ha : 0 < a) (hs : s ∈ Icc a b) (θ : ℝ) : + z+s • circleMap 0 1 θ ∈ closedBall z b := by + rw [mem_closedBall_iff_norm,add_sub_cancel_left,norm_smul,norm_circleMap_zero,abs_one,mul_one, + Real.norm_of_nonneg (ha.trans_le hs.1).le] + exact hs.2 + +lemma truncated_radial_energy {U : Set ℂ} (hU : IsOpen U) {F : ℂ → ℂ} + (hF : DifferentiableOn ℂ F U) {z : ℂ} {a b : ℝ} + (ha : 0 < a) (hab : a ≤ b) (hball : closedBall z b ⊆ U) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) (θ : ℝ) : + (radialTruncation H q r (F (z+b • circleMap 0 1 θ))- + radialTruncation H q r (F (z+a • circleMap 0 1 θ)))^2 ≤ + Real.log (b/a)*(∫ s in a..b, s*‖fderiv ℝ (radialTruncation H q r ∘ F) + (z+s • circleMap 0 1 θ)‖^2) := by + let c := fun s : ℝ => z+s • circleMap 0 1 θ + let u := radialTruncation H q r ∘ F + have hc : ContDiff ℝ 1 c := contDiff_const.add (contDiff_id.smul contDiff_const) + have hmap : MapsTo c (Icc a b) U := fun s hs => hball (radial_section_mem ha hs θ) + have hG : ContDiffOn ℝ 1 (F ∘ c) (Icc a b) := + ((hF.contDiffOn hU).restrict_scalars ℝ).comp hc.contDiffOn hmap + have ht := truncated_curve_weighted_energy hr ha hab q hG (H := H) + have hgrad := truncated_gradient_comp_integrable (μ := volume) isCompact_Icc hc.continuous hU hF hmap hH hr q + have hgradw : IntervalIntegrable + (fun s => s*‖fderiv ℝ u (c s)‖^2) volume a b := + (intervalIntegrable_iff_integrableOn_Icc_of_le hab).2 + (hgrad.continuousOn_mul continuousOn_id isCompact_Icc) + obtain ⟨K,hK⟩ := hG.exists_lipschitzOnWith (by norm_num) (convex_Icc _ _) isCompact_Icc + have hLip := (radialTruncation_lipschitz hr H q).comp_lipschitzOnWith hK + have hl2 := lipschitzOn_weighted_deriv_memLp ha hLip + have hi : IntegrableOn (fun s => s*(deriv (u ∘ c) s)^2) (Ioc a b) := by + have hh := (memLp_two_iff_integrable_sq hl2.aestronglyMeasurable).1 hl2 + apply hh.congr + filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs + rw [mul_pow,Real.sq_sqrt (ha.trans_le hs.1.le).le] + rfl + have hderiv (s : ℝ) (hs : s ∈ Icc a b) : + deriv (u ∘ c) s = fderiv ℝ u (c s) (circleMap 0 1 θ) := by + apply radialTruncation_directional_deriv hH hr q (hF.differentiableAt (hU.mem_nhds (hmap hs))) + simpa only [one_smul,c,id_eq] using ((hasDerivAt_id s).smul_const (circleMap 0 1 θ)).const_add z + have hbnd : (∫ s in a..b, s*(deriv (u ∘ c) s)^2) ≤ + ∫ s in a..b, s*‖fderiv ℝ u (c s)‖^2 := by + apply intervalIntegral.integral_mono_on hab + ((intervalIntegrable_iff_integrableOn_Ioc_of_le hab).2 hi) hgradw + intro s hs + rw [hderiv s hs] + apply mul_le_mul_of_nonneg_left _ (ha.trans_le hs.1).le + have hh := (fderiv ℝ u (c s)).le_opNorm (circleMap 0 1 θ) + rw [norm_circleMap_zero,abs_one,mul_one] at hh + have hh' := pow_le_pow_left₀ (norm_nonneg _) hh 2 + simpa only [Real.norm_eq_abs,sq_abs] using hh' + have hlog : 0 ≤ Real.log (b/a) := Real.log_nonneg ((one_le_div ha).2 hab) + exact ht.trans (mul_le_mul_of_nonneg_left hbnd hlog) + +end SLEExactGauge.RectangleEnergy + +end + +/-! Conformal localization and Rectangle Energy estimates. -/ + +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +theorem truncated_circle_energy {U : Set ℂ} (hU : IsOpen U) {F : ℂ → ℂ} + (hF : DifferentiableOn ℂ F U) {z : ℂ} {a b : ℝ} + (ha : 0 < a) (hab : a ≤ b) (hball : closedBall z b ⊆ U) + {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q : ℂ) : + ((∫ θ in -Real.pi..Real.pi, radialTruncation H q r (F (z+b • circleMap 0 1 θ)))- + (∫ θ in -Real.pi..Real.pi, radialTruncation H q r (F (z+a • circleMap 0 1 θ))))^2 ≤ + 2*Real.pi*Real.log (b/a)*(∫ θ in -Real.pi..Real.pi, ∫ s in a..b, + s*‖fderiv ℝ (radialTruncation H q r ∘ F) (z+s • circleMap 0 1 θ)‖^2) := by + let u := radialTruncation H q r ∘ F + let D := fun θ => u (z+b • circleMap 0 1 θ)-u (z+a • circleMap 0 1 θ) + let E := fun θ => ∫ s in a..b, s*‖fderiv ℝ u (z+s • circleMap 0 1 θ)‖^2 + have hp : -Real.pi ≤ Real.pi := by linarith [Real.pi_pos] + have hc (s : ℝ) (hs : s ∈ Icc a b) : Continuous (fun θ => u (z+s • circleMap 0 1 θ)) := by + apply (radialTruncation_continuous hr H q).comp + apply continuousOn_univ.1 + exact hF.continuousOn.comp + (continuous_const.add ((continuous_circleMap 0 1).const_smul s)).continuousOn + (fun θ _ => hball (radial_section_mem ha hs θ)) + have hca := hc a (left_mem_Icc.2 hab) + have hcb := hc b (right_mem_Icc.2 hab) + have hD : Continuous D := hcb.sub hca + let c := fun p : ℝ × ℝ => z+p.2 • circleMap 0 1 p.1 + have hcc : Continuous c := continuous_const.add (continuous_snd.smul ((continuous_circleMap 0 1).comp continuous_fst)) + have hmap : MapsTo c (Icc (-Real.pi) Real.pi ×ˢ Icc a b) U := + fun p hp => hball (radial_section_mem ha hp.2 p.1) + have hi := truncated_gradient_comp_integrable (μ := volume) (isCompact_Icc.prod isCompact_Icc) + hcc hU hF hmap hH hr q + have hiw : IntegrableOn (fun p : ℝ × ℝ => p.2*‖fderiv ℝ u (c p)‖^2) + (Icc (-Real.pi) Real.pi ×ˢ Icc a b) := + hi.continuousOn_mul continuous_snd.continuousOn (isCompact_Icc.prod isCompact_Icc) + have hiprod : Integrable (fun p : ℝ × ℝ => p.2*‖fderiv ℝ u (c p)‖^2) + ((volume.restrict (Ioc (-Real.pi) Real.pi)).prod (volume.restrict (Ioc a b))) := by + rw [Measure.prod_restrict] + exact hiw.mono_set (prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) + have hE : IntervalIntegrable E volume (-Real.pi) Real.pi := by + apply (intervalIntegrable_iff_integrableOn_Ioc_of_le hp).2 + simpa only [E,intervalIntegral.integral_of_le hab,c,IntegrableOn] using hiprod.integral_prod_left + have hcs := integral_mul_square_le (continuousOn_memLp_two_Ioc hp hD.continuousOn) + (memLp_const (1:ℝ)) + have hid : (∫ θ in Ioc (-Real.pi) Real.pi, D θ*1) = + (∫ θ in -Real.pi..Real.pi, u (z+b • circleMap 0 1 θ))- + (∫ θ in -Real.pi..Real.pi, u (z+a • circleMap 0 1 θ)) := by + simp only [mul_one,← intervalIntegral.integral_of_le hp,D] + exact intervalIntegral.integral_sub (hcb.intervalIntegrable _ _) (hca.intervalIntegrable _ _) + have hi1 : (∫ θ in Ioc (-Real.pi) Real.pi, (1:ℝ)^2) = 2*Real.pi := by + rw [← intervalIntegral.integral_of_le hp] + simp + ring + rw [hid,hi1,← intervalIntegral.integral_of_le hp] at hcs + have hbound : (∫ θ in -Real.pi..Real.pi, D θ^2) ≤ + ∫ θ in -Real.pi..Real.pi, Real.log (b/a)*E θ := by + apply intervalIntegral.integral_mono_on hp ((hD.pow 2).intervalIntegrable _ _) + (hE.const_mul _) + intro θ hθ + exact truncated_radial_energy hU hF ha hab hball hH hr q θ + rw [intervalIntegral.integral_const_mul] at hbound + have hm := mul_le_mul_of_nonneg_left hbound (by positivity : 0 ≤ 2*Real.pi) + apply hcs.trans + convert hm using 1 <;> ring + +end SLEExactGauge.RectangleEnergy + +end + +end OAI diff --git a/lean/OAI/Probability/SLELocalization/WeightedEnergy.lean b/lean/OAI/Probability/SLELocalization/WeightedEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b3396f1e554a71e67624692a0e370bec17cd05e --- /dev/null +++ b/lean/OAI/Probability/SLELocalization/WeightedEnergy.lean @@ -0,0 +1,859 @@ +import Mathlib + +namespace OAI + + +/-! Conformal localization and Rectangle Energy estimates. -/ + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy + +lemma integral_mul_square_le {α : Type*} [MeasurableSpace α] {μ : Measure α} + {f g : α → ℝ} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + (∫ x, f x*g x ∂μ)^2 ≤ (∫ x, f x^2 ∂μ)*(∫ x, g x^2 ∂μ) := by + have hi {a b : α → ℝ} (ha : MemLp a 2 μ) (hb : MemLp b 2 μ) : + inner ℝ (ha.toLp a) (hb.toLp b) = ∫ x, a x*b x ∂μ := by + rw [MeasureTheory.L2.inner_def] + apply integral_congr_ae + filter_upwards [ha.coeFn_toLp,hb.coeFn_toLp] with x hx hy + rw [hx,hy] + change b x*a x = a x*b x + ring + have hn := norm_inner_le_norm (𝕜 := ℝ) (hf.toLp f) (hg.toLp g) + have hh := pow_le_pow_left₀ (norm_nonneg _) hn 2 + rw [mul_pow,← real_inner_self_eq_norm_sq (hf.toLp f),← real_inner_self_eq_norm_sq (hg.toLp g), + hi hf hg,hi hf hf,hi hg hg] at hh + simpa only [Real.norm_eq_abs,sq_abs,← sq] using hh + +lemma continuousOn_memLp_two_Ioc {a b : ℝ} (hab : a ≤ b) {f : ℝ → ℝ} + (hf : ContinuousOn f (Icc a b)) : MemLp f 2 (volume.restrict (Ioc a b)) := by + apply (memLp_two_iff_integrable_sq ((hf.mono Ioc_subset_Icc_self).aestronglyMeasurable measurableSet_Ioc)).2 + exact ((hf.pow 2).intervalIntegrable_of_Icc hab).1 + +lemma weighted_interval_energy {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) + {F D : ℝ → ℝ} (hD : ContinuousOn D (Icc a b)) + (hF : ∀ s ∈ Icc a b, HasDerivAt F (D s) s) : + (F b-F a)^2 ≤ Real.log (b/a)*(∫ s in a..b, s*(D s)^2) := by + let f := fun s : ℝ => Real.sqrt s*D s + let g := fun s : ℝ => (Real.sqrt s)⁻¹ + have hs (s : ℝ) (hs : s ∈ Icc a b) : 0 < s := ha.trans_le hs.1 + have hf : ContinuousOn f (Icc a b) := Real.continuous_sqrt.continuousOn.mul hD + have hg : ContinuousOn g (Icc a b) := Real.continuous_sqrt.continuousOn.inv₀ + (fun s hs' => (Real.sqrt_pos.2 (hs s hs')).ne') + have hc := integral_mul_square_le (continuousOn_memLp_two_Ioc hab hf) + (continuousOn_memLp_two_Ioc hab hg) + have hfg : (∫ s in Ioc a b, f s*g s) = F b-F a := by + calc + _ = ∫ s in a..b, D s := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp [f,g] + have hne := (Real.sqrt_pos.2 (hs s (Ioc_subset_Icc_self hs'))).ne' + field_simp + _ = _ := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun s hs' => hF s (by simpa only [uIcc_of_le hab] using hs')) + (hD.intervalIntegrable_of_Icc hab) + have hff : (∫ s in Ioc a b, f s^2) = ∫ s in a..b, s*(D s)^2 := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp only [f] + rw [mul_pow,Real.sq_sqrt (hs s (Ioc_subset_Icc_self hs')).le] + have hgg : (∫ s in Ioc a b, g s^2) = Real.log (b/a) := by + calc + _ = ∫ s in a..b, s⁻¹ := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp only [g] + rw [inv_pow,Real.sq_sqrt (hs s (Ioc_subset_Icc_self hs')).le] + _ = _ := by + apply integral_inv + rw [uIcc_of_le hab] + intro hz + exact (not_le_of_gt ha) hz.1 + rw [hfg,hff,hgg] at hc + simpa only [mul_comm] using hc + +def radialTruncation (H : ℝ) (q : ℂ) (r : ℝ) (w : ℂ) : ℝ := + min H (Real.log (max r ‖w-q‖/r)) + +lemma radialTruncation_source {r : ℝ} (hr : 0 < r) (H : ℝ) (q w : ℂ) : + radialTruncation H q r w = min H (max 0 (Real.log (‖w-q‖/r))) := by + unfold radialTruncation + by_cases h : ‖w-q‖ ≤ r + · rw [max_eq_left h,div_self hr.ne',Real.log_one, + max_eq_left (Real.log_nonpos (div_nonneg (norm_nonneg _) hr.le) ((div_le_one hr).2 h))] + · have hh : r < ‖w-q‖ := lt_of_not_ge h + rw [max_eq_right hh.le,max_eq_right (Real.log_nonneg ((one_le_div hr).2 hh.le))] + +lemma radialTruncation_bounds {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) (q w : ℂ) : + 0 ≤ radialTruncation H q r w ∧ radialTruncation H q r w ≤ H := by + unfold radialTruncation + exact ⟨le_min hH (Real.log_nonneg ((one_le_div hr).2 (le_max_left _ _))),min_le_left _ _⟩ + +lemma radialTruncation_continuous {r : ℝ} (hr : 0 < r) (H : ℝ) (q : ℂ) : + Continuous (radialTruncation H q r) := by + have hm : Continuous (fun w : ℂ => max r ‖w-q‖/r) := + (continuous_const.max ((continuous_id.sub continuous_const).norm)).div_const r + exact continuous_const.min (hm.log (fun w => (div_pos (lt_of_lt_of_le hr (le_max_left _ _)) hr).ne')) + +lemma radialTruncation_zero {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) {q w : ℂ} + (hw : ‖w-q‖ ≤ r) : radialTruncation H q r w = 0 := by + simp only [radialTruncation,max_eq_left hw,div_self hr.ne',Real.log_one,min_eq_right hH] + +lemma radialTruncation_top {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) {q w : ℂ} + (hw : Real.exp H*r ≤ ‖w-q‖) : radialTruncation H q r w = H := by + have he : 1 ≤ Real.exp H := Real.one_le_exp_iff.2 hH + have hrw : r ≤ ‖w-q‖ := (le_mul_of_one_le_left hr.le he).trans hw + have hn : 0 < ‖w-q‖/r := div_pos (hr.trans_le hrw) hr + have hl : H ≤ Real.log (‖w-q‖/r) := + (Real.le_log_iff_exp_le hn).2 ((le_div_iff₀ hr).2 hw) + simp only [radialTruncation,max_eq_right hrw,min_eq_left hl] + +lemma radialTruncation_middle {H r : ℝ} (hr : 0 < r) {q w : ℂ} + (hw : r < ‖w-q‖) (hw' : ‖w-q‖ < Real.exp H*r) : + radialTruncation H q r w = (1/2:ℝ)*Real.log (‖w-q‖^2)-Real.log r := by + have hn := hr.trans hw + have hl : Real.log (‖w-q‖/r) < H := + (Real.log_lt_iff_lt_exp (div_pos hn hr)).2 ((div_lt_iff₀ hr).2 hw') + rw [radialTruncation,max_eq_right hw.le,min_eq_right hl.le, + Real.log_div hn.ne' hr.ne',Real.log_pow] + ring + +lemma log_normSq_fderiv_le {F : ℂ → ℂ} {z q : ℂ} (hd : DifferentiableAt ℂ F z) + (hn : 0 < ‖F z-q‖) (r : ℝ) : + ‖fderiv ℝ (fun w => (1/2:ℝ)*Real.log (‖F w-q‖^2)-Real.log r) z‖ ≤ + ‖deriv F z‖/‖F z-q‖ := by + let A := (ContinuousLinearMap.toSpanSingleton ℂ (deriv F z)).restrictScalars ℝ + have hA : ‖A‖ = ‖deriv F z‖ := by + dsimp [A] + rw [ContinuousLinearMap.norm_restrictScalars,ContinuousLinearMap.norm_toSpanSingleton] + have hF : HasFDerivAt F A z := hd.hasDerivAt.hasFDerivAt.restrictScalars ℝ + have hs := ((hF.sub_const q).norm_sq.log (pow_ne_zero 2 hn.ne')).const_mul (1/2:ℝ) + have hs' := hs.sub_const (Real.log r) + have hd' : HasFDerivAt + (fun w => (1/2:ℝ)*Real.log (‖F w-q‖^2)-Real.log r) + ((‖F z-q‖^2)⁻¹ • (innerSL ℝ (F z-q)).comp A) z := by + convert! hs' using 1 + ext v + simp + ring + rw [hd'.fderiv,norm_smul,Real.norm_eq_abs,abs_inv,abs_pow,abs_norm] + have hb := (innerSL ℝ (F z-q)).opNorm_comp_le A + rw [innerSL_apply_norm,hA] at hb + calc + (‖F z-q‖^2)⁻¹*‖(innerSL ℝ (F z-q)).comp A‖ ≤ + (‖F z-q‖^2)⁻¹*(‖F z-q‖*‖deriv F z‖) := + mul_le_mul_of_nonneg_left hb (by positivity) + _ = ‖deriv F z‖/‖F z-q‖ := by field_simp + +lemma radialTruncation_fderiv_bound {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) + {F : ℂ → ℂ} {z q : ℂ} (hd : DifferentiableAt ℂ F z) : + ‖fderiv ℝ (radialTruncation H q r ∘ F) z‖^2 ≤ + if r < ‖F z-q‖ ∧ ‖F z-q‖ < Real.exp H*r then + ‖deriv F z‖^2/‖F z-q‖^2 else 0 := by + by_cases hlow : ‖F z-q‖ ≤ r + · have hz : fderiv ℝ (radialTruncation H q r ∘ F) z = 0 := by + apply IsLocalMin.fderiv_eq_zero + filter_upwards with w + change radialTruncation H q r (F z) ≤ radialTruncation H q r (F w) + rw [radialTruncation_zero hH hr hlow] + exact (radialTruncation_bounds hH hr q _).1 + rw [hz] + simp [not_lt_of_ge hlow] + · have hl : r < ‖F z-q‖ := lt_of_not_ge hlow + by_cases hhigh : Real.exp H*r ≤ ‖F z-q‖ + · have hz : fderiv ℝ (radialTruncation H q r ∘ F) z = 0 := by + apply IsLocalMax.fderiv_eq_zero + filter_upwards with w + change radialTruncation H q r (F w) ≤ radialTruncation H q r (F z) + rw [radialTruncation_top hH hr hhigh] + exact (radialTruncation_bounds hH hr q _).2 + rw [hz] + simp [not_lt_of_ge hhigh] + · have hh : ‖F z-q‖ < Real.exp H*r := lt_of_not_ge hhigh + have hc : ContinuousAt (fun w => ‖F w-q‖) z := (hd.continuousAt.sub continuousAt_const).norm + have he : (radialTruncation H q r ∘ F) =ᶠ[𝓝 z] + (fun w => (1/2:ℝ)*Real.log (‖F w-q‖^2)-Real.log r) := by + filter_upwards [continuousAt_const.eventually_lt hc hl, + hc.eventually_lt continuousAt_const hh] with w hw hw' + exact radialTruncation_middle hr hw hw' + rw [he.fderiv_eq,ite_eq_left ⟨hl,hh⟩] + have ht := pow_le_pow_left₀ (norm_nonneg _) (log_normSq_fderiv_le hd (hr.trans hl) r) 2 + simpa only [div_pow] using ht + +lemma radialTruncation_lipschitz {r : ℝ} (hr : 0 < r) (H : ℝ) (q : ℂ) : + LipschitzWith ⟨1/r,by positivity⟩ (radialTruncation H q r) := by + let K : ℝ≥0 := ⟨1/r,by positivity⟩ + have hlog : LipschitzOnWith K Real.log (Ici r) := by + apply Convex.lipschitzOnWith_of_nnnorm_deriv_le + (fun x hx => Real.differentiableAt_log (hr.trans_le hx).ne') _ (convex_Ici r) + intro x hx + change ‖deriv Real.log x‖ ≤ 1/r + rw [Real.deriv_log,Real.norm_of_nonneg (inv_nonneg.2 (hr.trans_le hx).le),one_div] + exact inv_anti₀ hr hx + have hnorm : LipschitzWith 1 (fun w : ℂ => ‖w-q‖) := by + apply LipschitzWith.of_dist_le_mul + intro x y + calc + dist ‖x-q‖ ‖y-q‖ ≤ ‖(x-q)-(y-q)‖ := dist_norm_norm_le _ _ + _ = ‖x-y‖ := by congr 1; abel + _ = (1:ℝ≥0)*dist x y := by simp [dist_eq_norm] + have hmax := hnorm.const_max r + have hl : LipschitzWith K (fun w : ℂ => Real.log (max r ‖w-q‖)) := by + apply LipschitzWith.of_dist_le_mul + intro x y + exact (hlog.dist_le_mul (max r ‖x-q‖) (show r ≤ max r ‖x-q‖ from le_max_left _ _) (max r ‖y-q‖) (show r ≤ max r ‖y-q‖ from le_max_left _ _)).trans + (mul_le_mul_of_nonneg_left (by simpa using hmax.dist_le_mul x y) K.coe_nonneg) + have hsub : LipschitzWith K (fun w : ℂ => Real.log (max r ‖w-q‖)-Real.log r) := by + simpa using hl.sub (LipschitzWith.const (Real.log r)) + have he : radialTruncation H q r = fun w : ℂ => min H (Real.log (max r ‖w-q‖)-Real.log r) := by + ext w + rw [radialTruncation,Real.log_div (hr.trans_le (le_max_left _ _)).ne' hr.ne'] + rw [he] + exact hsub.const_min H + +lemma radialTruncation_along_C1_AC {r : ℝ} (hr : 0 < r) (H : ℝ) (q : ℂ) + {G : ℝ → ℂ} {a b : ℝ} (hG : ContDiffOn ℝ 1 G (uIcc a b)) : + AbsolutelyContinuousOnInterval (radialTruncation H q r ∘ G) a b := by + obtain ⟨K,hK⟩ := hG.exists_lipschitzOnWith (by norm_num) (convex_uIcc _ _) isCompact_uIcc + exact ((radialTruncation_lipschitz hr H q).comp_lipschitzOnWith hK).absolutelyContinuousOnInterval + +lemma radialTruncation_along_C1_FTC {r : ℝ} (hr : 0 < r) (H : ℝ) (q : ℂ) + {G : ℝ → ℂ} {a b : ℝ} (hG : ContDiffOn ℝ 1 G (uIcc a b)) : + (∫ s in a..b, deriv (radialTruncation H q r ∘ G) s) = + radialTruncation H q r (G b)-radialTruncation H q r (G a) := + (radialTruncation_along_C1_AC hr H q hG).integral_deriv_eq_sub + +lemma radialTruncation_directional_deriv {H r : ℝ} (hH : 0 ≤ H) (hr : 0 < r) + (q : ℂ) {F : ℂ → ℂ} {c : ℝ → ℂ} {d : ℂ} {t : ℝ} + (hF : DifferentiableAt ℂ F (c t)) (hc : HasDerivAt c d t) : + deriv (radialTruncation H q r ∘ F ∘ c) t = + fderiv ℝ (radialTruncation H q r ∘ F) (c t) d := by + by_cases hl : ‖F (c t)-q‖ ≤ r + · have hz : fderiv ℝ (radialTruncation H q r ∘ F) (c t) = 0 := by + apply IsLocalMin.fderiv_eq_zero + filter_upwards with w + change radialTruncation H q r (F (c t)) ≤ radialTruncation H q r (F w) + rw [radialTruncation_zero hH hr hl] + exact (radialTruncation_bounds hH hr q _).1 + rw [hz,zero_apply] + apply IsLocalMin.deriv_eq_zero + filter_upwards with s + change radialTruncation H q r (F (c t)) ≤ radialTruncation H q r (F (c s)) + rw [radialTruncation_zero hH hr hl] + exact (radialTruncation_bounds hH hr q _).1 + · have hl' := lt_of_not_ge hl + by_cases hh : Real.exp H*r ≤ ‖F (c t)-q‖ + · have hz : fderiv ℝ (radialTruncation H q r ∘ F) (c t) = 0 := by + apply IsLocalMax.fderiv_eq_zero + filter_upwards with w + change radialTruncation H q r (F w) ≤ radialTruncation H q r (F (c t)) + rw [radialTruncation_top hH hr hh] + exact (radialTruncation_bounds hH hr q _).2 + rw [hz,zero_apply] + apply IsLocalMax.deriv_eq_zero + filter_upwards with s + change radialTruncation H q r (F (c s)) ≤ radialTruncation H q r (F (c t)) + rw [radialTruncation_top hH hr hh] + exact (radialTruncation_bounds hH hr q _).2 + · have hh' := lt_of_not_ge hh + have hcont : ContinuousAt (fun w => ‖F w-q‖) (c t) := (hF.continuousAt.sub continuousAt_const).norm + have he : (radialTruncation H q r ∘ F) =ᶠ[𝓝 (c t)] + (fun w => (1/2:ℝ)*Real.log (‖F w-q‖^2)-Real.log r) := by + filter_upwards [continuousAt_const.eventually_lt hcont hl', + hcont.eventually_lt continuousAt_const hh'] with w hw hw' + exact radialTruncation_middle hr hw hw' + have hdiff : DifferentiableAt ℝ (radialTruncation H q r ∘ F) (c t) := by + apply he.differentiableAt_iff.2 + exact (((((hF.restrictScalars ℝ).sub_const q).norm_sq (𝕜 := ℝ)).log + (pow_ne_zero 2 (hr.trans hl').ne')).const_mul (1/2:ℝ)).sub_const (Real.log r) + exact (hdiff.hasFDerivAt.comp_hasDerivAt t hc).deriv + +lemma acl_interval_energy {a b : ℝ} (hab : a ≤ b) {f : ℝ → ℝ} + (hf : AbsolutelyContinuousOnInterval f a b) + (hD : MemLp (deriv f) 2 (volume.restrict (Ioc a b))) : + (f b-f a)^2 ≤ (b-a)*(∫ s in a..b, (deriv f s)^2) := by + have hc := integral_mul_square_le hD (memLp_const (1:ℝ)) + have he : (∫ s in Ioc a b, deriv f s*1) = f b-f a := by + simp only [mul_one,← intervalIntegral.integral_of_le hab,hf.integral_deriv_eq_sub] + have he1 : (∫ s in Ioc a b, (1:ℝ)^2) = b-a := by simp [hab] + rw [he,he1] at hc + simpa only [intervalIntegral.integral_of_le hab,mul_comm] using hc + +lemma weighted_acl_interval_energy {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) + {f : ℝ → ℝ} (hf : AbsolutelyContinuousOnInterval f a b) + (hD : MemLp (fun s => Real.sqrt s*deriv f s) 2 (volume.restrict (Ioc a b))) : + (f b-f a)^2 ≤ Real.log (b/a)*(∫ s in a..b, s*(deriv f s)^2) := by + let g := fun s : ℝ => (Real.sqrt s)⁻¹ + have hs (s : ℝ) (hs : s ∈ Icc a b) : 0 < s := ha.trans_le hs.1 + have hg : ContinuousOn g (Icc a b) := Real.continuous_sqrt.continuousOn.inv₀ + (fun s hs' => (Real.sqrt_pos.2 (hs s hs')).ne') + have hc := integral_mul_square_le hD (continuousOn_memLp_two_Ioc hab hg) + have hfg : (∫ s in Ioc a b, (Real.sqrt s*deriv f s)*g s) = f b-f a := by + calc + _ = ∫ s in a..b, deriv f s := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp [g] + have hne := (Real.sqrt_pos.2 (hs s (Ioc_subset_Icc_self hs'))).ne' + field_simp + _ = _ := hf.integral_deriv_eq_sub + have hff : (∫ s in Ioc a b, (Real.sqrt s*deriv f s)^2) = + ∫ s in a..b, s*(deriv f s)^2 := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp only + rw [mul_pow,Real.sq_sqrt (hs s (Ioc_subset_Icc_self hs')).le] + have hgg : (∫ s in Ioc a b, g s^2) = Real.log (b/a) := by + calc + _ = ∫ s in a..b, s⁻¹ := by + rw [intervalIntegral.integral_of_le hab] + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs' + dsimp only [g] + rw [inv_pow,Real.sq_sqrt (hs s (Ioc_subset_Icc_self hs')).le] + _ = _ := by + apply integral_inv + rw [uIcc_of_le hab] + intro hz + exact (not_le_of_gt ha) hz.1 + rw [hfg,hff,hgg] at hc + simpa only [mul_comm] using hc + +lemma lipschitzOn_deriv_memLp {a b : ℝ} {K : ℝ≥0} {f : ℝ → ℝ} + (hf : LipschitzOnWith K f (Icc a b)) : + MemLp (deriv f) 2 (volume.restrict (Ioc a b)) := by + apply MemLp.of_bound (measurable_deriv f).aestronglyMeasurable (K:ℝ) + filter_upwards [ae_restrict_mem measurableSet_Ioc, + (ae_restrict_of_ae (μ := volume) (volume.ae_ne b))] with s hs hsb + have hsl : s ∈ Ioo a b := ⟨hs.1,lt_of_le_of_ne hs.2 hsb⟩ + exact norm_deriv_le_of_lipschitzOn (mem_of_superset (isOpen_Ioo.mem_nhds hsl) Ioo_subset_Icc_self) hf + +lemma lipschitzOn_weighted_deriv_memLp {a b : ℝ} {K : ℝ≥0} {f : ℝ → ℝ} + (ha : 0 < a) (hf : LipschitzOnWith K f (Icc a b)) : + MemLp (fun s => Real.sqrt s*deriv f s) 2 (volume.restrict (Ioc a b)) := by + apply (lipschitzOn_deriv_memLp hf).of_le_mul + ((Real.continuous_sqrt.measurable).mul (measurable_deriv f)).aestronglyMeasurable (c := Real.sqrt b) + filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs + rw [Pi.mul_apply,norm_mul,Real.norm_of_nonneg (Real.sqrt_pos.2 (ha.trans hs.1)).le] + exact mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt hs.2) (norm_nonneg _) + +lemma truncated_curve_weighted_energy {H r a b : ℝ} (hr : 0 < r) + (ha : 0 < a) (hab : a ≤ b) (q : ℂ) {G : ℝ → ℂ} + (hG : ContDiffOn ℝ 1 G (Icc a b)) : + (radialTruncation H q r (G b)-radialTruncation H q r (G a))^2 ≤ + Real.log (b/a)*(∫ s in a..b, s*(deriv (radialTruncation H q r ∘ G) s)^2) := by + obtain ⟨K,hK⟩ := hG.exists_lipschitzOnWith (by norm_num) (convex_Icc _ _) isCompact_Icc + have hL := (radialTruncation_lipschitz hr H q).comp_lipschitzOnWith hK + exact weighted_acl_interval_energy ha hab + (radialTruncation_along_C1_AC hr H q (by simpa only [uIcc_of_le hab] using hG)) + (lipschitzOn_weighted_deriv_memLp ha hL) + +lemma mean_difference_square_le + {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + {μ : Measure α} {ν : Measure β} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {u : α → ℝ} {v : β → ℝ} (hu : MemLp u 2 μ) (hv : MemLp v 2 ν) : + ((∫ x, u x ∂μ)-(∫ y, v y ∂ν))^2 ≤ + ∫ x, ∫ y, (u x-v y)^2 ∂ν ∂μ := by + have hD := (hu.comp_fst ν).sub (hv.comp_snd μ) + have hc := integral_mul_square_le hD (memLp_const (1:ℝ)) + have hDi : Integrable (fun p : α × β => u p.1-v p.2) (μ.prod ν) := + hD.integrable (by norm_num) + have he : (∫ p : α × β, (u p.1-v p.2)*1 ∂μ.prod ν) = + (∫ x, u x ∂μ)-(∫ y, v y ∂ν) := by + simp only [mul_one] + rw [integral_prod _ hDi] + have hiu := hu.integrable (by norm_num : (1:ℝ≥0∞) ≤ 2) + have hiv := hv.integrable (by norm_num : (1:ℝ≥0∞) ≤ 2) + simp_rw [integral_sub (integrable_const _) hiv] + simp only [integral_const,probReal_univ,one_smul] + rw [integral_sub hiu (integrable_const _)] + simp + have he1 : (∫ _ : α × β, (1:ℝ)^2 ∂μ.prod ν) = 1 := by simp + simp only [Pi.sub_apply] at hc + rw [he,he1,mul_one] at hc + have hsq : Integrable (fun p : α × β => (u p.1-v p.2)^2) (μ.prod ν) := hD.integrable_sq + rw [integral_prod _ hsq] at hc + exact hc + +lemma acl_oscillation_energy {a b : ℝ} {f : ℝ → ℝ} + (hf : AbsolutelyContinuousOnInterval f a b) + (hD : MemLp (deriv f) 2 (volume.restrict (Ioc a b))) + {x y : ℝ} (hx : x ∈ Icc a b) (hy : y ∈ Icc a b) : + (f y-f x)^2 ≤ (b-a)*(∫ s in a..b, (deriv f s)^2) := by + have hab := hx.1.trans hx.2 + suffices ∀ x ∈ Icc a b, ∀ y ∈ Icc a b, x ≤ y → + (f y-f x)^2 ≤ (b-a)*(∫ s in a..b, (deriv f s)^2) by + rcases le_total x y with h | h + · exact this x hx y hy h + · have hh := this y hy x hx h + nlinarith + intro x hx y hy hxy + have hsub : Ioc x y ⊆ Ioc a b := fun s hs => ⟨hx.1.trans_lt hs.1,hs.2.trans hy.2⟩ + have hD' := hD.mono_measure (Measure.restrict_mono_set _ hsub) + have hf' : AbsolutelyContinuousOnInterval f x y := hf.mono + (by simpa only [uIcc_of_le hab,uIcc_of_le hxy] using (Icc_subset_Icc hx.1 hy.2)) + have he := acl_interval_energy hxy hf' hD' + have hmono : (∫ s in x..y, (deriv f s)^2) ≤ ∫ s in a..b, (deriv f s)^2 := by + rw [intervalIntegral.integral_of_le hxy,intervalIntegral.integral_of_le hab] + apply setIntegral_mono_set hD.integrable_sq + (by filter_upwards with s; positivity) ?_ + exact ae_of_all _ (fun s hs => hsub hs) + have hnon : 0 ≤ ∫ s in a..b, (deriv f s)^2 := + intervalIntegral.integral_nonneg hab (fun s hs => sq_nonneg _) + exact he.trans ((mul_le_mul_of_nonneg_left hmono (sub_nonneg.2 hxy)).trans + (mul_le_mul_of_nonneg_right (by linarith [hx.1,hy.2]) hnon)) + +lemma acl_congr {f g : ℝ → ℝ} {a b : ℝ} + (hf : AbsolutelyContinuousOnInterval f a b) (he : EqOn f g (uIcc a b)) : + AbsolutelyContinuousOnInterval g a b := by + rw [absolutelyContinuousOnInterval_iff] at hf ⊢ + intro ε hε + obtain ⟨δ,hδ,hδ'⟩ := hf ε hε + refine ⟨δ,hδ,?_⟩ + intro E hE hsum + have hh := hδ' E hE hsum + convert hh using 1 + apply Finset.sum_congr rfl + intro i hi + rw [he ((hE.1 i hi).1),he ((hE.1 i hi).2)] + +lemma acl_of_interior {a b : ℝ} (hab : a < b) {f : ℝ → ℝ} + (hc : ContinuousOn f (Icc a b)) + (hi : IntervalIntegrable (deriv f) volume a b) + (hloc : ∀ x ∈ Ioo a b, ∀ y ∈ Ioo a b, AbsolutelyContinuousOnInterval f x y) : + AbsolutelyContinuousOnInterval f a b := by + let m := (a+b)/2 + have hm : m ∈ Ioo a b := by dsimp [m]; constructor <;> linarith + let g := fun x => (∫ s in m..x, deriv f s)+f m + have hg : AbsolutelyContinuousOnInterval g a b := by + have hh := hi.absolutelyContinuousOnInterval_intervalIntegral + (c := m) (by simpa only [uIcc_of_le hab.le] using Ioo_subset_Icc_self hm) + have hk : AbsolutelyContinuousOnInterval (fun _ : ℝ => f m) a b := + (LipschitzWith.const (f m)).lipschitzOnWith.absolutelyContinuousOnInterval + exact hh.add hk + have he : EqOn f g (Ioo a b) := by + intro x hx + dsimp only [g] + rw [(hloc m hm x hx).integral_deriv_eq_sub] + ring + have he' : EqOn f g (Icc a b) := he.of_subset_closure hc + (by simpa only [uIcc_of_le hab.le] using hg.continuousOn) + Ioo_subset_Icc_self (by rw [closure_Ioo hab.ne]) + exact acl_congr hg (by simpa only [uIcc_of_le hab.le] using he'.symm) + +lemma boundary_zero_energy {a b : ℝ} (hab : a < b) {f : ℝ → ℝ} + (hc : ContinuousOn f (Icc a b)) + (hD : MemLp (deriv f) 2 (volume.restrict (Ioc a b))) + (hloc : ∀ x ∈ Ioo a b, ∀ y ∈ Ioo a b, AbsolutelyContinuousOnInterval f x y) + {z : ℝ} (hz : z ∈ Icc a b) (hfz : f z = 0) {y : ℝ} (hy : y ∈ Icc a b) : + (f y)^2 ≤ (b-a)*(∫ s in a..b, (deriv f s)^2) := by + have hi : IntervalIntegrable (deriv f) volume a b := + (intervalIntegrable_iff_integrableOn_Ioc_of_le hab.le).2 (hD.integrable (by norm_num)) + have h := acl_oscillation_energy (acl_of_interior hab hc hi hloc) hD hz hy + simpa only [hfz,sub_zero] using h + +end SLEExactGauge.RectangleEnergy + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology +namespace SLEExactGauge.Layer + +lemma compact_parameter_derivative {F F' : ℝ → ℝ → ℝ} {a b l h x : ℝ} + (hab : a ≤ b) (hlx : l < x) (hxh : x < h) + (hF : ContinuousOn (Function.uncurry F) (Icc l h ×ˢ Icc a b)) + (hF' : ContinuousOn (Function.uncurry F') (Icc l h ×ˢ Icc a b)) + (hd : ∀ t ∈ Icc a b, ∀ y ∈ Icc l h, HasDerivAt (fun y => F y t) (F' y t) y) : + HasDerivAt (fun y => ∫ t in a..b, F y t) (∫ t in a..b, F' x t) x := by + have hc (y : ℝ) (hy : y ∈ Icc l h) : ContinuousOn (F y) (Icc a b) := + hF.comp (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hy,ht⟩) + have hc' (y : ℝ) (hy : y ∈ Icc l h) : ContinuousOn (F' y) (Icc a b) := + hF'.comp (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hy,ht⟩) + obtain ⟨C,hC⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hF' + have hxx : x ∈ Icc l h := ⟨hlx.le,hxh.le⟩ + apply (intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Icc l h) (F' := F') (bound := fun _ => C) (Icc_mem_nhds hlx hxh) ?_ + (by apply ContinuousOn.intervalIntegrable; simpa only [uIcc_of_le hab] using hc x hxx) + ?_ ?_ intervalIntegrable_const ?_).2 + · filter_upwards [Icc_mem_nhds hlx hxh] with y hy + have hh := ((hc y hy).mono Ioc_subset_Icc_self).aestronglyMeasurable (μ := volume) measurableSet_Ioc + simpa only [uIoc_of_le hab] using hh + · have hh := ((hc' x hxx).mono Ioc_subset_Icc_self).aestronglyMeasurable (μ := volume) measurableSet_Ioc + simpa only [uIoc_of_le hab] using hh + · filter_upwards with t ht y hy + exact hC (y,t) ⟨hy,Ioc_subset_Icc_self (by simpa only [uIoc_of_le hab] using ht)⟩ + · filter_upwards with t ht y hy + exact hd t (Ioc_subset_Icc_self (by simpa only [uIoc_of_le hab] using ht)) y hy + +lemma rotated_trace (H : ℂ →L[ℝ] ℂ →L[ℝ] ℝ) (v : ℂ) (hv : ‖v‖ = 1) : + H v v + H (Complex.I*v) (Complex.I*v) = H 1 1 + H Complex.I Complex.I := by + have he : v = v.re • (1:ℂ) + v.im • Complex.I := by + simp only [Complex.real_smul, mul_one] + exact (Complex.re_add_im v).symm + have hi : Complex.I*v = (-v.im) • (1:ℂ) + v.re • Complex.I := by + apply Complex.ext <;> simp [Complex.mul_re,Complex.mul_im] + have hh : v.re^2+v.im^2 = 1 := by + have hsq := Complex.sq_norm v + rw [hv,one_pow,Complex.normSq_apply] at hsq + linarith + calc + _ = H (v.re • (1:ℂ) + v.im • Complex.I) (v.re • (1:ℂ) + v.im • Complex.I) + + H ((-v.im) • (1:ℂ) + v.re • Complex.I) ((-v.im) • (1:ℂ) + v.re • Complex.I) := by + rw [← he,← hi] + _ = (v.re^2+v.im^2)*(H 1 1+H Complex.I Complex.I) := by + simp only [map_add,map_smul,add_apply,smul_apply, + smul_eq_mul] + ring + _ = _ := by rw [hh,one_mul] + +lemma laplacian_eq_hessian (u : ℂ → ℝ) (z : ℂ) : + Laplacian.laplacian u z = + fderiv ℝ (fderiv ℝ u) z 1 1 + fderiv ℝ (fderiv ℝ u) z Complex.I Complex.I := by + simp only [InnerProductSpace.laplacian_eq_iteratedFDeriv_complexPlane, + iteratedFDeriv_two_apply,Matrix.cons_val_zero,Matrix.cons_val_one] + +lemma path_second {u : ℂ → ℝ} {c c' : ℝ → ℂ} {c'' : ℂ} {t : ℝ} + (hu : ContDiffAt ℝ 2 u (c t)) (hc : HasDerivAt c (c' t) t) + (hc' : HasDerivAt c' c'' t) : + HasDerivAt (fun s => fderiv ℝ u (c s) (c' s)) + (fderiv ℝ (fderiv ℝ u) (c t) (c' t) (c' t) + fderiv ℝ u (c t) c'') t := by + have hd : ContDiffAt ℝ 1 (fderiv ℝ u) (c t) := hu.fderiv_right (by norm_num) + exact (hd.differentiableAt (by norm_num)).hasFDerivAt.comp_hasDerivAt t hc |>.clm_apply hc' + +def circleMean (u : ℂ → ℝ) (r : ℝ) : ℝ := + ∫ θ in -Real.pi..Real.pi, u (r • circleMap 0 1 θ) + +def circleDMean (u : ℂ → ℝ) (r : ℝ) : ℝ := + ∫ θ in -Real.pi..Real.pi, fderiv ℝ u (r • circleMap 0 1 θ) (circleMap 0 1 θ) + +def circleDDMean (u : ℂ → ℝ) (r : ℝ) : ℝ := + ∫ θ in -Real.pi..Real.pi, + fderiv ℝ (fderiv ℝ u) (r • circleMap 0 1 θ) (circleMap 0 1 θ) (circleMap 0 1 θ) + +lemma radial_norm (r θ : ℝ) : ‖r • circleMap 0 1 θ‖ = |r| := by + simp [norm_circleMap_zero,Real.norm_eq_abs] + +lemma radial_mem {r : ℝ} (hr : |r| < 1) (θ : ℝ) : + r • circleMap 0 1 θ ∈ ball (0:ℂ) 1 := by + rwa [mem_ball_zero_iff,radial_norm] + +lemma radial_continuous : Continuous (fun p : ℝ × ℝ => p.1 • circleMap 0 1 p.2) := + continuous_fst.smul ((continuous_circleMap 0 1).comp continuous_snd) + +lemma radial_interval_maps {l h a b : ℝ} (hl : -1 < l) (hh : h < 1) : + MapsTo (fun p : ℝ × ℝ => p.1 • circleMap 0 1 p.2) + (Icc l h ×ˢ Icc a b) (ball (0:ℂ) 1) := by + rintro ⟨r,θ⟩ ⟨hr,hθ⟩ + exact radial_mem (abs_lt.2 ⟨hl.trans_le hr.1,hr.2.trans_lt hh⟩) θ + +lemma circle_means_derivatives {u : ℂ → ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) {r : ℝ} (hr : |r| < 1) : + HasDerivAt (circleMean u) (circleDMean u r) r ∧ + HasDerivAt (circleDMean u) (circleDDMean u r) r := by + have hr' := abs_lt.1 hr + let l := (r-1)/2 + let h := (r+1)/2 + have hl : -1 < l := by dsimp [l]; linarith + have hh : h < 1 := by dsimp [h]; linarith + have hlr : l < r := by dsimp [l]; linarith + have hrh : r < h := by dsimp [h]; linarith + let K := Icc l h ×ˢ Icc (-Real.pi) Real.pi + have hm : MapsTo (fun p : ℝ × ℝ => p.1 • circleMap 0 1 p.2) K (ball (0:ℂ) 1) := + radial_interval_maps hl hh + have hdu : ContDiffOn ℝ 1 (fderiv ℝ u) (ball 0 1) := + hu.fderiv_of_isOpen isOpen_ball (by norm_num) + have hddu : ContDiffOn ℝ 0 (fderiv ℝ (fderiv ℝ u)) (ball 0 1) := + hdu.fderiv_of_isOpen isOpen_ball (by norm_num) + have hE : Continuous (fun p : ℝ × ℝ => circleMap 0 1 p.2) := + (continuous_circleMap 0 1).comp continuous_snd + have h0 : ContinuousOn (fun p : ℝ × ℝ => u (p.1 • circleMap 0 1 p.2)) K := + hu.continuousOn.comp radial_continuous.continuousOn hm + have h1 : ContinuousOn (fun p : ℝ × ℝ => fderiv ℝ u (p.1 • circleMap 0 1 p.2) (circleMap 0 1 p.2)) K := + (hdu.continuousOn.comp radial_continuous.continuousOn hm).clm_apply hE.continuousOn + have h2 : ContinuousOn (fun p : ℝ × ℝ => + fderiv ℝ (fderiv ℝ u) (p.1 • circleMap 0 1 p.2) (circleMap 0 1 p.2) (circleMap 0 1 p.2)) K := + ((hddu.continuousOn.comp radial_continuous.continuousOn hm).clm_apply hE.continuousOn).clm_apply hE.continuousOn + constructor + · apply compact_parameter_derivative + (F := fun s θ => u (s • circleMap 0 1 θ)) + (F' := fun s θ => fderiv ℝ u (s • circleMap 0 1 θ) (circleMap 0 1 θ)) + (neg_le_self Real.pi_pos.le) hlr hrh h0 h1 + intro θ hθ s hs + have hmem := hm (show (s,θ) ∈ K from ⟨hs,hθ⟩) + exact ((hu.differentiableOn (by norm_num)).differentiableAt (isOpen_ball.mem_nhds hmem)).hasFDerivAt.comp_hasDerivAt s + (by simpa using (hasDerivAt_id s).smul_const (circleMap 0 1 θ)) + · apply compact_parameter_derivative + (F := fun s θ => fderiv ℝ u (s • circleMap 0 1 θ) (circleMap 0 1 θ)) + (F' := fun s θ => fderiv ℝ (fderiv ℝ u) (s • circleMap 0 1 θ) (circleMap 0 1 θ) (circleMap 0 1 θ)) + (neg_le_self Real.pi_pos.le) hlr hrh h1 h2 + intro θ hθ s hs + have hmem := hm (show (s,θ) ∈ K from ⟨hs,hθ⟩) + have huc := hu.contDiffAt (isOpen_ball.mem_nhds hmem) + have hd := path_second (c := fun t => t • circleMap 0 1 θ) (c' := fun _ => circleMap 0 1 θ) + huc (by simpa using (hasDerivAt_id s).smul_const (circleMap 0 1 θ)) + (hasDerivAt_const s (circleMap 0 1 θ)) + simpa only [map_zero,add_zero] using hd + +lemma circle_laplacian_continuous {u : ℂ → ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) {r : ℝ} (hr : |r| < 1) : + Continuous (fun θ => Laplacian.laplacian u (r • circleMap 0 1 θ)) := by + have hc := (hu.fderiv_of_isOpen isOpen_ball (show (1:WithTop ℕ∞)+1 ≤ 2 by norm_num)).fderiv_of_isOpen + isOpen_ball (show (0:WithTop ℕ∞)+1 ≤ 1 by norm_num) + have hmaps : MapsTo (fun θ => r • circleMap 0 1 θ) univ (ball (0:ℂ) 1) := fun θ _ => radial_mem hr θ + have hc' : Continuous (fun θ => fderiv ℝ (fderiv ℝ u) (r • circleMap 0 1 θ)) := + continuousOn_univ.1 (hc.continuousOn.comp ((continuous_circleMap 0 1).const_smul r).continuousOn hmaps) + simp_rw [laplacian_eq_hessian] + exact (hc'.clm_apply continuous_const |>.clm_apply continuous_const).add + (hc'.clm_apply continuous_const |>.clm_apply continuous_const) + +lemma circle_angular_laplacian {u : ℂ → ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) {r : ℝ} (hr : 0 < r) (hr1 : r < 1) : + r * (∫ θ in -Real.pi..Real.pi, Laplacian.laplacian u (r • circleMap 0 1 θ)) = + circleDMean u r + r*circleDDMean u r := by + have hrabs : |r| < 1 := by rwa [abs_of_pos hr] + let E : ℝ → ℂ := circleMap 0 1 + let c : ℝ → ℂ := fun θ => r • E θ + let H : ℂ → ℂ →L[ℝ] ℂ →L[ℝ] ℝ := fderiv ℝ (fderiv ℝ u) + let J : ℝ → ℝ := fun θ => H (c θ) (E θ*Complex.I) (E θ*Complex.I) + let D : ℝ → ℝ := fun θ => fderiv ℝ u (c θ) (E θ) + let Q : ℝ → ℝ := fun θ => H (c θ) (E θ) (E θ) + have hc : Continuous c := (continuous_circleMap 0 1).const_smul r + have hEm : Continuous E := continuous_circleMap 0 1 + have hmem (θ : ℝ) : c θ ∈ ball (0:ℂ) 1 := radial_mem hrabs θ + have hdu : ContDiffOn ℝ 1 (fderiv ℝ u) (ball 0 1) := + hu.fderiv_of_isOpen isOpen_ball (by norm_num) + have hddu : ContDiffOn ℝ 0 H (ball 0 1) := + hdu.fderiv_of_isOpen isOpen_ball (by norm_num) + have hdc : Continuous (fun θ => fderiv ℝ u (c θ)) := + continuousOn_univ.1 (hdu.continuousOn.comp hc.continuousOn (fun θ _ => hmem θ)) + have hHc : Continuous (fun θ => H (c θ)) := + continuousOn_univ.1 (hddu.continuousOn.comp hc.continuousOn (fun θ _ => hmem θ)) + have hD : Continuous D := hdc.clm_apply hEm + have hJ : Continuous J := (hHc.clm_apply (hEm.mul_const Complex.I)).clm_apply (hEm.mul_const Complex.I) + have hQ : Continuous Q := (hHc.clm_apply hEm).clm_apply hEm + let V : ℝ → ℝ := fun θ => fderiv ℝ u (c θ) (r • (E θ*Complex.I)) + have hdV (θ : ℝ) : HasDerivAt V (r^2*J θ-r*D θ) θ := by + have hcp : HasDerivAt c (r • (E θ*Complex.I)) θ := (hasDerivAt_circleMap 0 1 θ).const_smul r + have hcpp : HasDerivAt (fun t => r • (E t*Complex.I)) (-(c θ)) θ := by + have hh := ((hasDerivAt_circleMap 0 1 θ).mul_const Complex.I).const_smul r + simpa only [Pi.smul_apply,E,c,mul_assoc,Complex.I_mul_I,mul_neg_one,smul_neg] using! hh + have hh := path_second (hu.contDiffAt (isOpen_ball.mem_nhds (hmem θ))) hcp hcpp + convert hh using 1 + dsimp only [H,J,D] + simp only [map_smul,smul_apply,smul_eq_mul,map_neg] + change r^2*((H (c θ)) (E θ*Complex.I)) (E θ*Complex.I)-r*(fderiv ℝ u (c θ)) (E θ) = + r*(r*((H (c θ)) (E θ*Complex.I)) (E θ*Complex.I))-(fderiv ℝ u (c θ)) (r • E θ) + rw [map_smul,smul_eq_mul] + ring + have hEnds : E (-Real.pi) = E Real.pi := by + simp [E,circleMap,Complex.exp_neg_pi_mul_I,Complex.exp_pi_mul_I] + have hVeq : V Real.pi = V (-Real.pi) := by + dsimp only [V,c] + rw [hEnds] + have hz := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun θ _ => hdV θ) + (((hJ.const_mul (r^2)).sub (hD.const_mul r)).intervalIntegrable (-Real.pi) Real.pi) + rw [hVeq,sub_self] at hz + rw [intervalIntegral.integral_sub ((hJ.intervalIntegrable _ _).const_mul _) ((hD.intervalIntegrable _ _).const_mul _), + intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul] at hz + have htrace (θ : ℝ) : Laplacian.laplacian u (c θ) = Q θ+J θ := by + rw [laplacian_eq_hessian] + symm + convert rotated_trace (H (c θ)) (E θ) (by simp [E,norm_circleMap_zero]) using 1 + simp only [Q,J,H,mul_comm Complex.I] + have hli : (∫ θ in -Real.pi..Real.pi, Laplacian.laplacian u (c θ)) = + circleDDMean u r + ∫ θ in -Real.pi..Real.pi, J θ := by + calc + _ = ∫ θ in -Real.pi..Real.pi, Q θ+J θ := intervalIntegral.integral_congr (fun θ _ => htrace θ) + _ = _ := intervalIntegral.integral_add (hQ.intervalIntegrable _ _) (hJ.intervalIntegrable _ _) + change r*(∫ θ in -Real.pi..Real.pi, Laplacian.laplacian u (c θ)) = _ + rw [hli] + change r^2*(∫ θ in -Real.pi..Real.pi, J θ)-r*circleDMean u r = 0 at hz + nlinarith + +lemma weighted_circle_derivative {u : ℂ → ℝ} + (hu : ContDiffOn ℝ 2 u (ball 0 1)) {r : ℝ} (hr : 0 < r) (hr1 : r < 1) : + HasDerivAt (fun s => s*circleDMean u s) + (r*(∫ θ in -Real.pi..Real.pi, Laplacian.laplacian u (r • circleMap 0 1 θ))) r := by + have hd := (hasDerivAt_id r).mul (circle_means_derivatives hu (by rwa [abs_of_pos hr])).2 + simpa only [Pi.mul_apply,id_eq,one_mul,circle_angular_laplacian hu hr hr1] using! hd + +lemma compact_parameter_continuousAt {F : ℝ → ℝ → ℝ} {a b l h x : ℝ} + (hab : a ≤ b) (hlx : l < x) (hxh : x < h) + (hF : ContinuousOn (Function.uncurry F) (Icc l h ×ˢ Icc a b)) : + ContinuousAt (fun y => ∫ t in a..b, F y t) x := by + have hc (y : ℝ) (hy : y ∈ Icc l h) : ContinuousOn (F y) (Icc a b) := + hF.comp (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hy,ht⟩) + obtain ⟨C,hC⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hF + apply intervalIntegral.continuousAt_of_dominated_interval (bound := fun _ => C) ?_ ?_ intervalIntegrable_const ?_ + · filter_upwards [Icc_mem_nhds hlx hxh] with y hy + have hh := ((hc y hy).mono Ioc_subset_Icc_self).aestronglyMeasurable (μ := volume) measurableSet_Ioc + simpa only [uIoc_of_le hab] using hh + · filter_upwards [Icc_mem_nhds hlx hxh] with y hy + filter_upwards with t ht + exact hC (y,t) ⟨hy,Ioc_subset_Icc_self (by simpa only [uIoc_of_le hab] using ht)⟩ + · filter_upwards with t ht + have ht' : t ∈ Icc a b := Ioc_subset_Icc_self (by simpa only [uIoc_of_le hab] using ht) + have hh : ContinuousOn (fun y => F y t) (Icc l h) := + hF.comp (continuous_id.prodMk continuous_const).continuousOn (fun y hy => ⟨hy,ht'⟩) + exact hh.continuousAt (Icc_mem_nhds hlx hxh) + +lemma laplacian_continuousOn {u : ℂ → ℝ} (hu : ContDiffOn ℝ 2 u (ball 0 1)) : + ContinuousOn (Laplacian.laplacian u) (ball (0:ℂ) 1) := by + have hc := ((hu.fderiv_of_isOpen isOpen_ball (show (1:WithTop ℕ∞)+1 ≤ 2 by norm_num)).fderiv_of_isOpen + isOpen_ball (show (0:WithTop ℕ∞)+1 ≤ 1 by norm_num)).continuousOn + have he : Laplacian.laplacian u = fun z => + fderiv ℝ (fderiv ℝ u) z 1 1 + fderiv ℝ (fderiv ℝ u) z Complex.I Complex.I := + funext (laplacian_eq_hessian u) + rw [he] + exact (hc.clm_apply continuousOn_const |>.clm_apply continuousOn_const).add + (hc.clm_apply continuousOn_const |>.clm_apply continuousOn_const) + +def circleLMean (u : ℂ → ℝ) (r : ℝ) : ℝ := + ∫ θ in -Real.pi..Real.pi, Laplacian.laplacian u (r • circleMap 0 1 θ) + +lemma circle_lmean_continuous {u : ℂ → ℝ} (hu : ContDiffOn ℝ 2 u (ball 0 1)) : + ContinuousOn (circleLMean u) (Ioo (-1:ℝ) 1) := by + intro r hr + let l := (r-1)/2 + let h := (r+1)/2 + have hl : -1 < l := by dsimp [l]; linarith [hr.1] + have hh : h < 1 := by dsimp [h]; linarith [hr.2] + have hlr : l < r := by dsimp [l]; linarith [hr.1] + have hrh : r < h := by dsimp [h]; linarith [hr.2] + apply ContinuousAt.continuousWithinAt + apply compact_parameter_continuousAt (F := fun r θ => Laplacian.laplacian u (r • circleMap 0 1 θ)) + (neg_le_self Real.pi_pos.le) hlr hrh + exact (laplacian_continuousOn hu).comp radial_continuous.continuousOn (radial_interval_maps hl hh) + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal +namespace SLEExactGauge.Layer + +lemma polar_symm_circle (r θ : ℝ) : + Complex.polarCoord.symm (r,θ) = r • circleMap 0 1 θ := by + rw [Complex.polarCoord_symm_apply] + simp only [circleMap_zero,Complex.ofReal_one,one_mul,Complex.real_smul,Complex.exp_ofReal_mul_I] + +lemma polar_disk_lintegral_le (f : ℂ → ℝ≥0∞) : + (∫⁻ z in ball (0:ℂ) 1, f z) ≤ + ∫⁻ r in Ioo (0:ℝ) 1, ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal r * f (r • circleMap 0 1 θ) := by + classical + let g := (ball (0:ℂ) 1).indicator f + have hp := Complex.lintegral_comp_polarCoord_symm g + rw [← lintegral_indicator measurableSet_ball f,← hp] + change (∫⁻ p, ENNReal.ofReal p.1 * g (Complex.polarCoord.symm p) + ∂(volume.prod volume).restrict (Ioi (0:ℝ) ×ˢ Ioo (-Real.pi) Real.pi)) ≤ _ + rw [← Measure.prod_restrict] + apply (lintegral_prod_le _).trans + have he : (fun r => ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal r * g (Complex.polarCoord.symm (r,θ))) =ᵐ[volume.restrict (Ioi (0:ℝ))] + (Iio (1:ℝ)).indicator (fun r => ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal r * f (r • circleMap 0 1 θ)) := by + filter_upwards [ae_restrict_mem measurableSet_Ioi] with r hr + have hr0 : 0 < r := hr + by_cases h1 : r < 1 + · rw [indicator_of_mem (show r ∈ Iio (1:ℝ) from h1)] + apply lintegral_congr + intro θ + rw [polar_symm_circle] + dsimp only [g] + rw [indicator_of_mem (radial_mem (by rwa [abs_of_pos hr0]) θ)] + · rw [indicator_of_notMem (show r ∉ Iio (1:ℝ) from h1)] + apply lintegral_eq_zero_of_ae_eq_zero + filter_upwards with θ + have hn : r • circleMap 0 1 θ ∉ ball (0:ℂ) 1 := by + simpa only [mem_ball_zero_iff,radial_norm,abs_of_pos hr0] using h1 + rw [polar_symm_circle] + dsimp only [g] + simp only [indicator_of_notMem hn,mul_zero,Pi.zero_apply] + rw [lintegral_congr_ae he,lintegral_indicator measurableSet_Iio, + Measure.restrict_restrict measurableSet_Iio] + have hset : Iio (1:ℝ) ∩ Ioi (0:ℝ) = Ioo (0:ℝ) 1 := by ext r; simp [and_comm] + rw [hset] + +end SLEExactGauge.Layer + +end + +end + +section +noncomputable section +open Set Filter MeasureTheory Metric +open scoped Topology ENNReal NNReal +namespace SLEExactGauge.RectangleEnergy +open Layer + +lemma polar_annulus_lintegral_le (f : ℂ → ℝ≥0∞) {r R : ℝ} (hr : 0 < r) : + (∫⁻ z in {z : ℂ | r < ‖z‖ ∧ ‖z‖ < R}, f z) ≤ + ∫⁻ s in Ioo r R, ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal s*f (s • circleMap 0 1 θ) := by + classical + let A := {z : ℂ | r < ‖z‖ ∧ ‖z‖ < R} + have hA : MeasurableSet A := (measurableSet_lt measurable_const measurable_norm).inter + (measurableSet_lt measurable_norm measurable_const) + let g := A.indicator f + have hp := Complex.lintegral_comp_polarCoord_symm g + rw [← lintegral_indicator hA f,← hp] + change (∫⁻ p, ENNReal.ofReal p.1*g (Complex.polarCoord.symm p) + ∂(volume.prod volume).restrict (Ioi (0:ℝ) ×ˢ Ioo (-Real.pi) Real.pi)) ≤ _ + rw [← Measure.prod_restrict] + apply (lintegral_prod_le _).trans + have he : (fun s => ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal s*g (Complex.polarCoord.symm (s,θ))) =ᵐ[volume.restrict (Ioi (0:ℝ))] + (Ioo r R).indicator (fun s => ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ENNReal.ofReal s*f (s • circleMap 0 1 θ)) := by + filter_upwards [ae_restrict_mem measurableSet_Ioi] with s hs + have hs0 : 0 < s := hs + by_cases hh : s ∈ Ioo r R + · rw [indicator_of_mem hh] + apply lintegral_congr + intro θ + rw [polar_symm_circle] + have hm : s • circleMap 0 1 θ ∈ A := by + simpa only [A,mem_ofPred_eq,mem_Ioo,radial_norm,abs_of_pos hs0] using hh + rw [show g (s • circleMap 0 1 θ) = f (s • circleMap 0 1 θ) by exact indicator_of_mem hm f] + · rw [indicator_of_notMem hh] + apply lintegral_eq_zero_of_ae_eq_zero + filter_upwards with θ + have hn : s • circleMap 0 1 θ ∉ A := by + simpa only [A,mem_ofPred_eq,mem_Ioo,radial_norm,abs_of_pos hs0] using hh + rw [polar_symm_circle] + dsimp only [g] + simp only [indicator_of_notMem hn,mul_zero,Pi.zero_apply] + rw [lintegral_congr_ae he,lintegral_indicator measurableSet_Ioo, + Measure.restrict_restrict measurableSet_Ioo] + have hset : Ioo r R ∩ Ioi (0:ℝ) = Ioo r R := + inter_eq_left.2 (fun _ hs => hr.trans hs.1) + rw [hset] + +end SLEExactGauge.RectangleEnergy + +end + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AlgebraicCycleSpace.lean b/lean/OAI/Probability/SpanningForest/AlgebraicCycleSpace.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc666b82f424b7caf2666b85cb420c7013176768 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AlgebraicCycleSpace.lean @@ -0,0 +1,155 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +namespace Problem336 + +abbrev EdgeFlow := EdgeCode →₀ ℝ + +def edgeBoundary : EdgeFlow →ₗ[ℝ] (ℕ →₀ ℝ) := + Finsupp.linearCombination ℝ (fun e : EdgeCode => + Finsupp.single e.1.1 1 - Finsupp.single e.1.2 1) + +@[simp] theorem edgeBoundary_single (e : EdgeCode) (c : ℝ) : + edgeBoundary (Finsupp.single e c) = + c • (Finsupp.single e.1.1 1 - Finsupp.single e.1.2 1) := by + simp [edgeBoundary] + +def finiteCodeEdges (K : FiniteSubgraphCode) : Set EdgeCode := + {e | e.1 ∈ K.2} + +def graphCodeEdges (G : GraphCode) : Set EdgeCode := + {e | Adj G e.1.1 e.1.2} + +def finiteCycleSpace (K : FiniteSubgraphCode) : Submodule ℝ EdgeFlow := + Finsupp.supported ℝ ℝ (finiteCodeEdges K) ⊓ LinearMap.ker edgeBoundary + +def graphCycleSpace (G : GraphCode) : Submodule ℝ EdgeFlow := + Finsupp.supported ℝ ℝ (graphCodeEdges G) ⊓ LinearMap.ker edgeBoundary + +@[simp] theorem mem_finiteCycleSpace (K : FiniteSubgraphCode) (f : EdgeFlow) : + f ∈ finiteCycleSpace K ↔ + (∀ e ∈ f.support, e.1 ∈ K.2) ∧ edgeBoundary f = 0 := by + simp [finiteCycleSpace, Finsupp.mem_supported, finiteCodeEdges, Set.subset_def] + +@[simp] theorem mem_graphCycleSpace (G : GraphCode) (f : EdgeFlow) : + f ∈ graphCycleSpace G ↔ + (∀ e ∈ f.support, Adj G e.1.1 e.1.2) ∧ edgeBoundary f = 0 := by + simp [graphCycleSpace, Finsupp.mem_supported, graphCodeEdges, Set.subset_def] + + theorem finiteCycleSpace_mono {K L : FiniteSubgraphCode} (h : K.2 ⊆ L.2) : + finiteCycleSpace K ≤ finiteCycleSpace L := by + apply inf_le_inf_right + exact Finsupp.supported_mono (fun _ he => h he) + + theorem IsFiniteConnectedSubgraph.finiteCycleSpace_le {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) : + finiteCycleSpace K ≤ graphCycleSpace G := by + apply inf_le_inf_right + exact Finsupp.supported_mono (fun e he => (hK.2.1 e.1 he).2.2.2) + + theorem IsConnectedExhaustion.finiteCodeEdges_monotone {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + Monotone (fun n => finiteCodeEdges (H n)) := by + apply monotone_nat_of_le_succ + intro n e he + exact (hH.2.1 n).2 he + + theorem IsConnectedExhaustion.iUnion_finiteCodeEdges {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + (⋃ n, finiteCodeEdges (H n)) = graphCodeEdges G := by + ext e + constructor + · intro he + obtain ⟨n, hn⟩ := Set.mem_iUnion.mp he + exact ((hH.1 n).2.1 e.1 hn).2.2.2 + · intro he + obtain ⟨n, hn⟩ := hH.2.2 e.1.1 e.1.2 e.2 he + exact Set.mem_iUnion.mpr ⟨n, hn⟩ + + theorem IsConnectedExhaustion.finiteCycleSpace_monotone {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + Monotone (fun n => finiteCycleSpace (H n)) := by + apply monotone_nat_of_le_succ + intro n + exact finiteCycleSpace_mono (hH.2.1 n).2 + + theorem IsConnectedExhaustion.iSup_finiteCycleSpace {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + (⨆ n, finiteCycleSpace (H n)) = graphCycleSpace G := by + have hm : Monotone (fun n => Finsupp.supported ℝ ℝ (finiteCodeEdges (H n))) := + fun _ _ h => Finsupp.supported_mono (hH.finiteCodeEdges_monotone h) + unfold finiteCycleSpace graphCycleSpace + rw [← hm.directed_le.iSup_inf_eq, ← Finsupp.supported_iUnion, + hH.iUnion_finiteCodeEdges] + + theorem finiteCodeEdges_finite (K : FiniteSubgraphCode) : + (finiteCodeEdges K).Finite := + Set.Finite.preimage Subtype.val_injective.injOn K.2.finite_toSet + +instance finiteDimensional_finiteCycleSpace (K : FiniteSubgraphCode) : + FiniteDimensional ℝ (finiteCycleSpace K) := by + let : Fintype (finiteCodeEdges K) := (finiteCodeEdges_finite K).fintype + let : FiniteDimensional ℝ (Finsupp.supported ℝ ℝ (finiteCodeEdges K)) := + (Finsupp.supportedEquivFinsupp (M := ℝ) (R := ℝ) (finiteCodeEdges K)).symm.finiteDimensional + exact Submodule.finiteDimensional_of_le + (show finiteCycleSpace K ≤ Finsupp.supported ℝ ℝ (finiteCodeEdges K) from inf_le_left) + +abbrev EdgeHilbert := lp (fun _ : EdgeCode => ℝ) 2 + +def edgeFlowToHilbert : EdgeFlow →ₗ[ℝ] EdgeHilbert := + Finsupp.linearCombination ℝ (fun e : EdgeCode => lp.single 2 e (1 : ℝ)) + +@[simp] theorem edgeFlowToHilbert_single (e : EdgeCode) (c : ℝ) : + edgeFlowToHilbert (Finsupp.single e c) = lp.single 2 e c := by + simp [edgeFlowToHilbert, ← lp.single_smul] + +@[simp] theorem edgeFlowToHilbert_apply (f : EdgeFlow) (e : EdgeCode) : + edgeFlowToHilbert f e = f e := by + classical + induction f using Finsupp.induction with + | zero => simp + | single_add a b f ha hb ih => + simp only [map_add, edgeFlowToHilbert_single, lp.coeFn_add, Pi.add_apply, + Finsupp.add_apply, ih] + simp [lp.single_apply, Finsupp.single_apply, Pi.single_apply, eq_comm] + + theorem edgeFlowToHilbert_injective : Function.Injective edgeFlowToHilbert := by + intro f g h + ext e + simpa only [edgeFlowToHilbert_apply] using congrArg (fun x : EdgeHilbert => x e) h + +def finiteHilbertCycleSpace (K : FiniteSubgraphCode) : Submodule ℝ EdgeHilbert := + (finiteCycleSpace K).map edgeFlowToHilbert + +def closedGraphCycleSpace (G : GraphCode) : Submodule ℝ EdgeHilbert := + ((graphCycleSpace G).map edgeFlowToHilbert).topologicalClosure + +instance finiteDimensional_finiteHilbertCycleSpace (K : FiniteSubgraphCode) : + FiniteDimensional ℝ (finiteHilbertCycleSpace K) := by + unfold finiteHilbertCycleSpace + infer_instance + + theorem finiteHilbertCycleSpace_closed (K : FiniteSubgraphCode) : + IsClosed (finiteHilbertCycleSpace K : Set EdgeHilbert) := + Submodule.closed_of_finiteDimensional _ + + theorem IsConnectedExhaustion.finiteHilbertCycleSpace_monotone {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + Monotone (fun n => finiteHilbertCycleSpace (H n)) := by + intro m n hmn + exact Submodule.map_mono (hH.finiteCycleSpace_monotone hmn) + + theorem IsConnectedExhaustion.closure_iSup_finiteHilbertCycleSpace {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + (⨆ n, finiteHilbertCycleSpace (H n)).topologicalClosure = closedGraphCycleSpace G := by + unfold finiteHilbertCycleSpace closedGraphCycleSpace + rw [← Submodule.map_iSup, hH.iSup_finiteCycleSpace] + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairAllocation.lean b/lean/OAI/Probability/SpanningForest/AllPairAllocation.lean new file mode 100644 index 0000000000000000000000000000000000000000..52c45c96d3b8a40ad38a2f55014b9cc2102614e7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairAllocation.lean @@ -0,0 +1,202 @@ +import OAI.Probability.SpanningForest.GraphBalls +import OAI.Probability.SpanningForest.GraphDomain +import OAI.Probability.SpanningForest.EdgeAllocationMeasurable + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Problem336.AllPairAllocation + +private def radiusPredicate (G : GraphCode) (u v n : ℕ) : Prop := + withinRadius G n u v ∨ ¬ ∃ m, withinRadius G m u v + +private theorem exists_radiusPredicate (G : GraphCode) (u v : ℕ) : + ∃ n, radiusPredicate G u v n := by + classical + by_cases h : ∃ n, withinRadius G n u v + · obtain ⟨n, hn⟩ := h + exact ⟨n, Or.inl hn⟩ + · exact ⟨0, Or.inr h⟩ + +def radius (G : GraphCode) (u v : ℕ) : ℕ := by + classical + exact Nat.find (exists_radiusPredicate G u v) + +theorem withinRadius_radius (G : GraphCode) (hc : GraphConnected G) (u v : ℕ) : + withinRadius G (radius G u v) u v := by + classical + have h := Nat.find_spec (exists_radiusPredicate G u v) + exact h.resolve_right (not_not.mpr (exists_withinRadius G hc u v)) + +theorem radius_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) (u v : ℕ) : + radius (relabelGraph σ G) (σ u) (σ v) = radius G u v := by + classical + unfold radius + apply Nat.find_congr' + intro n + simp only [radiusPredicate, withinRadius_relabel] + +theorem measurable_radius (u v : ℕ) : + Measurable (fun G : GraphCode => radius G u v) := by + classical + unfold radius + apply measurable_find + intro n + simp only [radiusPredicate, Set.ofPred_or] + refine (measurableSet_withinRadius n u v).union ?_ + convert (MeasurableSet.iUnion (fun m => measurableSet_withinRadius m u v)).compl using 1 + ext G + simp + +def ballRank (G : GraphCode) (key : ℕ → ℝ) (n u v : ℕ) : ℕ := + Set.ncard {w | withinRadius G n u w ∧ key w < key v} + +theorem ballRank_strictMono {G : GraphCode} (hf : GraphLocallyFinite G) + {key : ℕ → ℝ} {n u v w : ℕ} (hv : withinRadius G n u v) + (hvw : key v < key w) : ballRank G key n u v < ballRank G key n u w := by + apply Set.ncard_lt_ncard + · refine Set.ssubset_iff_subset_ne.mpr ⟨?_, ?_⟩ + · intro x hx + exact ⟨hx.1, hx.2.trans hvw⟩ + · intro heq + have hmem : v ∈ {x | withinRadius G n u x ∧ key x < key w} := ⟨hv, hvw⟩ + rw [← heq] at hmem + exact (lt_irrefl (key v)) hmem.2 + · exact (finite_withinRadius G hf n u).subset (fun _ h => h.1) + +theorem ballRank_injOn {G : GraphCode} (hf : GraphLocallyFinite G) + {key : ℕ → ℝ} (hk : Function.Injective key) (n u : ℕ) : + Set.InjOn (ballRank G key n u) {v | withinRadius G n u v} := by + intro v hv w hw hrank + apply hk + rcases lt_trichotomy (key v) (key w) with h | h | h + · exact False.elim ((ne_of_lt (ballRank_strictMono hf hv h)) hrank) + · exact h + · exact False.elim ((ne_of_lt (ballRank_strictMono hf hw h)) hrank.symm) + +def coordinate (G : GraphCode) (key : ℕ → ℝ) (e : EdgeCode) : ℕ × (ℕ × ℕ) := + let u := EdgeAllocation.source key e + let v := EdgeAllocation.target key e + let n := radius G u v + (u, n, ballRank G key n u v) + +theorem coordinate_injective {G : GraphCode} (hc : GraphConnected G) + (hf : GraphLocallyFinite G) {key : ℕ → ℝ} (hk : Function.Injective key) : + Function.Injective (coordinate G key) := by + intro e f h + have hu : EdgeAllocation.source key e = EdgeAllocation.source key f := congrArg Prod.fst h + have hn : radius G (EdgeAllocation.source key e) (EdgeAllocation.target key e) = + radius G (EdgeAllocation.source key f) (EdgeAllocation.target key f) := + congrArg (fun x => x.2.1) h + have hr : ballRank G key + (radius G (EdgeAllocation.source key e) (EdgeAllocation.target key e)) + (EdgeAllocation.source key e) (EdgeAllocation.target key e) = + ballRank G key + (radius G (EdgeAllocation.source key f) (EdgeAllocation.target key f)) + (EdgeAllocation.source key f) (EdgeAllocation.target key f) := + congrArg (fun x => x.2.2) h + rw [← hn, ← hu] at hr + have hvf : withinRadius G + (radius G (EdgeAllocation.source key e) (EdgeAllocation.target key e)) + (EdgeAllocation.source key e) (EdgeAllocation.target key f) := by + rw [hn, hu] + exact withinRadius_radius G hc _ _ + have hv := ballRank_injOn hf hk _ _ (withinRadius_radius G hc _ _) hvf hr + apply Subtype.ext + rw [← EdgeAllocation.rawPair_source_target key e, + ← EdgeAllocation.rawPair_source_target key f, hu, hv] + +theorem ballRank_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) (key : ℕ → ℝ) + (n u v : ℕ) : + ballRank (relabelGraph σ G) (relabelLabels σ key) n (σ u) (σ v) = + ballRank G key n u v := by + unfold ballRank + have hs : {w | withinRadius (relabelGraph σ G) n (σ u) w ∧ + relabelLabels σ key w < relabelLabels σ key (σ v)} = + σ '' {w | withinRadius G n u w ∧ key w < key v} := by + ext w + constructor + · intro h + refine ⟨σ.symm w, ?_, σ.apply_symm_apply w⟩ + constructor + · exact (withinRadius_relabel σ G n u (σ.symm w)).mp (by simpa using h.1) + · simpa [relabelLabels] using h.2 + · rintro ⟨x, hx, rfl⟩ + exact ⟨(withinRadius_relabel σ G n u x).mpr hx.1, + by simpa [relabelLabels] using hx.2⟩ + rw [hs, Set.ncard_image_of_injective _ σ.injective] + +theorem coordinate_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) {key : ℕ → ℝ} + (hk : Function.Injective key) (e : EdgeCode) : + coordinate (relabelGraph σ G) (relabelLabels σ key) (mapEdge σ e) = + (σ (coordinate G key e).1, (coordinate G key e).2) := by + simp only [coordinate, EdgeAllocation.source_relabel σ hk, + EdgeAllocation.target_relabel σ hk, radius_relabel, ballRank_relabel] + +def coordinateNat (G : GraphCode) (key : ℕ → ℝ) (e : EdgeCode) : ℕ × ℕ := + let c := coordinate G key e + (c.1, Nat.pair c.2.1 c.2.2) + +theorem coordinateNat_injective {G : GraphCode} (hc : GraphConnected G) + (hf : GraphLocallyFinite G) {key : ℕ → ℝ} (hk : Function.Injective key) : + Function.Injective (coordinateNat G key) := by + intro e f h + apply coordinate_injective hc hf hk + simp only [coordinateNat, Prod.mk.injEq, Nat.pair_eq_pair] at h + exact Prod.ext h.1 (Prod.ext h.2.1 h.2.2) + +theorem coordinateNat_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) {key : ℕ → ℝ} + (hk : Function.Injective key) (e : EdgeCode) : + coordinateNat (relabelGraph σ G) (relabelLabels σ key) (mapEdge σ e) = + (σ (coordinateNat G key e).1, (coordinateNat G key e).2) := by + simp only [coordinateNat, coordinate_relabel σ G hk] + +theorem measurable_radius_joint : + Measurable (fun q : GraphCode × (ℕ × ℕ) => radius q.1 q.2.1 q.2.2) := + measurable_from_prod_countable_left fun p => measurable_radius p.1 p.2 + +theorem measurable_ballRank (n u v : ℕ) : + Measurable (fun q : GraphCode × (ℕ → ℝ) => ballRank q.1 q.2 n u v) := by + apply measurable_ncard.comp + apply measurable_set_iff.mpr + intro w + change Measurable (fun q : GraphCode × (ℕ → ℝ) => + withinRadius q.1 n u w ∧ q.2 w < q.2 v) + apply Measurable.and + · exact (measurableSet_setOfPred.mp (measurableSet_withinRadius n u w)).comp measurable_fst + · exact measurableSet_setOfPred.mp + (measurableSet_lt (measurable_snd.eval) (measurable_snd.eval)) + +theorem measurable_ballRank_joint : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × (ℕ × (ℕ × ℕ)) => + ballRank q.1.1 q.1.2 q.2.1 q.2.2.1 q.2.2.2) := + measurable_from_prod_countable_left fun p => measurable_ballRank p.1 p.2.1 p.2.2 + +theorem measurable_coordinate : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + coordinate q.1.1 q.1.2 q.2) := by + have hs : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + EdgeAllocation.source q.1.2 q.2) := + EdgeAllocation.measurable_source_joint.comp (measurable_fst.snd.prodMk measurable_snd) + have ht : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + EdgeAllocation.target q.1.2 q.2) := + EdgeAllocation.measurable_target_joint.comp (measurable_fst.snd.prodMk measurable_snd) + have hn : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + radius q.1.1 (EdgeAllocation.source q.1.2 q.2) (EdgeAllocation.target q.1.2 q.2)) := + measurable_radius_joint.comp (measurable_fst.fst.prodMk (hs.prodMk ht)) + exact hs.prodMk (hn.prodMk (measurable_ballRank_joint.comp + (measurable_fst.prodMk (hn.prodMk (hs.prodMk ht))))) + +theorem measurable_coordinateNat : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + coordinateNat q.1.1 q.1.2 q.2) := by + have hm : Measurable (fun c : ℕ × (ℕ × ℕ) => (c.1, Nat.pair c.2.1 c.2.2)) := + Measurable.of_discrete + exact hm.comp measurable_coordinate + +end Problem336.AllPairAllocation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairFactorAssembly.lean b/lean/OAI/Probability/SpanningForest/AllPairFactorAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2bf503c75bc8039a35b366e50b5cb7227e03346 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairFactorAssembly.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SpanningForest.AllPairIID +import OAI.Probability.SpanningForest.EdgeAction +import OAI.Probability.SpanningForest.FUSFLawUnique + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336 + +theorem factor_witness_of_all_pair_decoder {Y : Type} [MeasurableSpace Y] + [Nonempty Y] [StandardBorelSpace Y] (ν : Measure Y) [IsProbabilityMeasure ν] + (D : GraphCode → (EdgeCode → Y) → EdgeConfiguration) + (hD : Measurable (fun q : GraphCode × ((EdgeCode → Y) × EdgeCode) => + D q.1 q.2.1 q.2.2)) + (hEquiv : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (W : EdgeCode → Y) (e : EdgeCode), + D (relabelGraph σ G) (fun f => W (mapEdge σ.symm f)) (mapEdge σ e) = D G W e) + (hLaw : ∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G (Measure.infinitePi (fun _ : EdgeCode => ν)) (D G)) : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ + ∀ G : GraphCode, WorksOnGraph Phi G := by + obtain ⟨Ψ, hΨ, hΨeq, hΨlaw⟩ := AllPairIID.exists_equivariant_all_pair_iid_sampler ν + let Phi : FactorRule := fun G U => D G (Ψ G U) + have hΨfield : Measurable (fun q : GraphCode × (ℕ → ℝ) => Ψ q.1 q.2) := by + apply Measurable.of_eval + intro e + exact hΨ.comp (measurable_fst.prodMk (measurable_snd.prodMk measurable_const)) + have hPhi : RuleBorel Phi := by + exact hD.comp (measurable_fst.prodMk + ((hΨfield.comp (measurable_fst.prodMk measurable_snd.fst)).prodMk measurable_snd.snd)) + refine ⟨Phi, hPhi, ?_, ?_⟩ + · intro σ G U e + have hfield : Ψ (relabelGraph σ G) (relabelLabels σ U) = + fun f => Ψ G U (mapEdge σ.symm f) := by + funext f + simpa only [mapEdge_apply_symm] using hΨeq σ G U (mapEdge σ.symm f) + change D (relabelGraph σ G) (Ψ (relabelGraph σ G) (relabelLabels σ U)) + (mapEdge σ e) = D G (Ψ G U) e + rw [hfield] + exact hEquiv σ G (Ψ G U) e + · intro G hconn hfin Ω _ P U hU + have hlabels : Measurable (fun ω i => U i ω) := Measurable.of_eval hU.1 + have hinput : Measurable (fun ω => Ψ G (fun i => U i ω)) := + hΨfield.comp (measurable_const.prodMk hlabels) + have hdecode : Measurable (D G) := by + apply Measurable.of_eval + intro e + exact hD.comp (measurable_const.prodMk (measurable_id.prodMk measurable_const)) + have houtput : Measurable (fun ω => Phi G (fun i => U i ω)) := hdecode.comp hinput + have hreference := hLaw G hconn hfin + have hinputlaw := hΨlaw G hconn hfin Ω P U hU + have hmap : P.map (fun ω => Phi G (fun i => U i ω)) = + (Measure.infinitePi (fun _ : EdgeCode => ν)).map (D G) := by + change P.map ((D G) ∘ (fun ω => Ψ G (fun i => U i ω))) = _ + rw [← Measure.map_map hdecode hinput, hinputlaw] + refine ⟨fun e => (measurable_pi_apply e).comp houtput, ?_⟩ + intro H hH A B + have hcyl := congrArg (fun μ : Measure EdgeConfiguration => + μ (configurationCylinder A B)) hmap + rw [Measure.map_apply houtput (measurableSet_configurationCylinder A B), + Measure.map_apply hdecode (measurableSet_configurationCylinder A B)] at hcyl + rw [show P {ω | (∀ e ∈ A, Phi G (fun i => U i ω) e = true) ∧ + (∀ e ∈ B, Phi G (fun i => U i ω) e = false)} = + (Measure.infinitePi (fun _ : EdgeCode => ν)) + {W | (∀ e ∈ A, D G W e = true) ∧ (∀ e ∈ B, D G W e = false)} from hcyl] + exact hreference.2 H hH A B + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairIID.lean b/lean/OAI/Probability/SpanningForest/AllPairIID.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba46690e11390df6021d02b051f392a984108d62 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairIID.lean @@ -0,0 +1,172 @@ +import OAI.Probability.SpanningForest.AllPairAllocation +import OAI.Probability.SpanningForest.EdgeUniformRule + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +namespace Problem336.AllPairIID + +local instance : IsProbabilityMeasure uniform01 := sampler_uniform01_probability +local instance : IsProbabilityMeasure privatePoolLaw := privatePoolLaw_probability +local instance : NullSingletonClass uniform01 := by + unfold uniform01 + infer_instance + +def raw (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : ℝ := + EdgeIID.pool U (AllPairAllocation.coordinateNat G (EdgeIID.keys U) e) + +theorem measurable_coordinate_fixed (G : GraphCode) (e : EdgeCode) : + Measurable (fun key => AllPairAllocation.coordinateNat G key e) := + AllPairAllocation.measurable_coordinateNat.comp + ((measurable_const.prodMk measurable_id).prodMk measurable_const) + +theorem measurable_raw_joint : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => raw q.1.1 q.1.2 q.2) := by + have hk := EdgeIID.measurable_keys.comp + (measurable_fst.snd : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => q.1.2)) + have hp := EdgeIID.measurable_pool.comp + (measurable_fst.snd : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => q.1.2)) + have ha := AllPairAllocation.measurable_coordinateNat.comp + ((measurable_fst.fst.prodMk hk).prodMk measurable_snd) + have he : Measurable (fun p : ((ℕ × ℕ) → ℝ) × (ℕ × ℕ) => p.1 p.2) := + measurable_from_prod_countable_left fun p => measurable_pi_apply p + exact he.comp (hp.prodMk ha) + +theorem measurable_raw (G : GraphCode) (e : EdgeCode) : + Measurable (fun U => raw G U e) := + measurable_raw_joint.comp + ((measurable_const.prodMk measurable_id).prodMk measurable_const) + +theorem map_keys_raw (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) : + privatePoolLaw.map (fun U => (EdgeIID.keys U, raw G U)) = + privatePoolLaw.prod (Measure.infinitePi (fun _ : EdgeCode => uniform01)) := by + apply RandomReindex.map_random_injective_reindex_of_joint_law + privatePoolLaw privatePoolLaw uniform01 EdgeIID.keys EdgeIID.pool + EdgeIID.measurable_keys EdgeIID.measurable_pool EdgeIID.map_keys_pool + (fun key (e : EdgeCode) => AllPairAllocation.coordinateNat G key e) + (measurable_coordinate_fixed G) + filter_upwards [RandomReindex.ae_injective_infinitePi (J := ℕ) uniform01] with key hk + exact AllPairAllocation.coordinateNat_injective hc hf hk + +theorem map_raw (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) : + privatePoolLaw.map (raw G) = Measure.infinitePi (fun _ : EdgeCode => uniform01) := by + have h := congrArg (fun μ : Measure ((ℕ → ℝ) × (EdgeCode → ℝ)) => μ.map Prod.snd) + (map_keys_raw G hc hf) + rw [Measure.map_map measurable_snd + (EdgeIID.measurable_keys.prodMk (Measurable.of_eval (measurable_raw G))), + Measure.map_snd_prod, measure_univ, one_smul] at h + exact h + +def uniformRule (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : ℝ := by + classical + exact if Function.Injective (EdgeIID.keys U) then raw G U e else 0 + +theorem measurable_uniformRule : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + uniformRule q.1.1 q.1.2 q.2) := by + classical + exact Measurable.ite + (measurable_injective_keyField.comp + (EdgeIID.measurable_keys.comp measurable_fst.snd)).setOf + measurable_raw_joint measurable_const + +theorem measurable_uniformRule_uncurried : + Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => + uniformRule q.1 q.2.1 q.2.2) := + measurable_uniformRule.comp + ((measurable_fst.prodMk measurable_snd.fst).prodMk measurable_snd.snd) + +theorem measurable_uniformRule_fixed (G : GraphCode) (e : EdgeCode) : + Measurable (fun U => uniformRule G U e) := + measurable_uniformRule.comp + ((measurable_const.prodMk measurable_id).prodMk measurable_const) + +theorem raw_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) + (hk : Function.Injective (EdgeIID.keys U)) (e : EdgeCode) : + raw (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = raw G U e := by + unfold raw + rw [show EdgeIID.keys (relabelLabels σ U) = relabelLabels σ (EdgeIID.keys U) from rfl, + AllPairAllocation.coordinateNat_relabel σ G hk] + simp [EdgeIID.pool, EdgeIID.expanded, relabelLabels] + +theorem uniformRule_equivariant (σ : Equiv ℕ ℕ) (G : GraphCode) + (U : ℕ → ℝ) (e : EdgeCode) : + uniformRule (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = + uniformRule G U e := by + by_cases hk : Function.Injective (EdgeIID.keys U) + · simp only [uniformRule, + show EdgeIID.keys (relabelLabels σ U) = relabelLabels σ (EdgeIID.keys U) from rfl, + injective_relabelLabels_iff, hk, ite_true] + exact raw_relabel σ G U hk e + · simp only [uniformRule, + show EdgeIID.keys (relabelLabels σ U) = relabelLabels σ (EdgeIID.keys U) from rfl, + injective_relabelLabels_iff, hk, ite_false] + +theorem map_uniformRule (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) : + privatePoolLaw.map (uniformRule G) = + Measure.infinitePi (fun _ : EdgeCode => uniform01) := by + rw [← map_raw G hc hf] + apply Measure.map_congr + filter_upwards [EdgeIID.ae_injective_keys] with U hU + funext e + simp [uniformRule, hU] + +theorem uniformRule_law {Ω : Type} [MeasurableSpace Ω] + (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) : + P.map (fun ω e => uniformRule G (fun v => U v ω) e) = + Measure.infinitePi (fun _ : EdgeCode => uniform01) := by + have hm : Measurable (fun ω v => U v ω) := Measurable.of_eval hU.1 + rw [show (fun ω e => uniformRule G (fun v => U v ω) e) = + uniformRule G ∘ (fun ω v => U v ω) from rfl, + ← Measure.map_map (Measurable.of_eval (measurable_uniformRule_fixed G)) hm, + CanonicalIID.map_labels hU] + exact map_uniformRule G hc hf + +theorem sampled_uniformRule_law {Ω Y : Type} [MeasurableSpace Ω] + [MeasurableSpace Y] (ν : Measure Y) + (sample : ℝ → Y) (hsample : Measurable sample) + (hsample_law : uniform01.map sample = ν) + (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) : + P.map (fun ω e => sample (uniformRule G (fun v => U v ω) e)) = + Measure.infinitePi (fun _ : EdgeCode => ν) := by + have hm : Measurable (fun ω e => uniformRule G (fun v => U v ω) e) := + (Measurable.of_eval (measurable_uniformRule_fixed G)).comp + (Measurable.of_eval hU.1) + have hs : Measurable (fun x : EdgeCode → ℝ => fun e => sample (x e)) := + Measurable.of_eval (fun e => hsample.comp (measurable_pi_apply e)) + rw [show (fun ω e => sample (uniformRule G (fun v => U v ω) e)) = + (fun x : EdgeCode → ℝ => fun e => sample (x e)) ∘ + (fun ω e => uniformRule G (fun v => U v ω) e) from rfl, + ← Measure.map_map hs hm, uniformRule_law G hc hf P U hU, + Measure.infinitePi_map_pi] + · simp only [hsample_law] + · intro e + exact hsample + +theorem exists_equivariant_all_pair_iid_sampler {Y : Type} [MeasurableSpace Y] + [Nonempty Y] [StandardBorelSpace Y] (ν : Measure Y) [IsProbabilityMeasure ν] : + ∃ Ψ : GraphCode → (ℕ → ℝ) → EdgeCode → Y, + Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => Ψ q.1 q.2.1 q.2.2) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Ψ (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Ψ G U e) ∧ + ∀ (G : GraphCode), GraphConnected G → GraphLocallyFinite G → + ∀ (Ω : Type) [MeasurableSpace Ω] (P : Measure Ω) (U : ℕ → Ω → ℝ), + IsVertexIID P U → + P.map (fun ω e => Ψ G (fun v => U v ω) e) = + Measure.infinitePi (fun _ : EdgeCode => ν) := by + obtain ⟨sample, hm, hlaw⟩ := exists_uniform01_sampler ν + refine ⟨fun G U e => sample (uniformRule G U e), + hm.comp measurable_uniformRule_uncurried, ?_, ?_⟩ + · intro σ G U e + exact congrArg sample (uniformRule_equivariant σ G U e) + · intro G hc hf Ω _ P U hU + exact sampled_uniformRule_law ν sample hm hlaw G hc hf P U hU + +end Problem336.AllPairIID + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairIntrinsicBridge.lean b/lean/OAI/Probability/SpanningForest/AllPairIntrinsicBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..0108501c6033995cdaede7bd26275b3141690e6f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairIntrinsicBridge.lean @@ -0,0 +1,49 @@ +import OAI.Probability.SpanningForest.AllPairObservation +import OAI.Probability.SpanningForest.GraphTreePosterior + +namespace OAI + +noncomputable section + +namespace Problem336.AllPairObservation + +attribute [local instance] Classical.propDecidable + +theorem mem_edgeCodes_exhaustion_iff {G : GraphCode} + (hf : GraphLocallyFinite G) (e a : EdgeCode) (n : ℕ) : + a ∈ GraphTreePosterior.edgeCodes (Intrinsic.exhaustion G e n) ↔ + a ∈ observations G e n ∧ Adj G a.1.1 a.1.2 := by + rw [GraphTreePosterior.mem_edgeCodes, + Intrinsic.exhaustion_eq_edgeBallSubgraph G hf, + IntrinsicExhaustion.mem_edgeBallSubgraph_edges, mem_observations] + simp only [hf, true_and, a.2] + tauto + +theorem edgeCodes_exhaustion_eq_filter {G : GraphCode} + (hf : GraphLocallyFinite G) (e : EdgeCode) (n : ℕ) : + GraphTreePosterior.edgeCodes (Intrinsic.exhaustion G e n) = + (observations G e n).filter (fun a => Adj G a.1.1 a.1.2) := by + classical + ext a + simp only [Finset.mem_filter, mem_edgeCodes_exhaustion_iff hf] + +theorem edgeCodes_exhaustion_subset_observations {G : GraphCode} + (hf : GraphLocallyFinite G) (e : EdgeCode) (n : ℕ) : + GraphTreePosterior.edgeCodes (Intrinsic.exhaustion G e n) ⊆ + observations G e n := by + intro a ha + exact ((mem_edgeCodes_exhaustion_iff hf e a n).mp ha).1 + +theorem not_adj_of_mem_observations_not_mem_edgeCodes {G : GraphCode} + (hf : GraphLocallyFinite G) (e a : EdgeCode) (n : ℕ) + (ha : a ∈ observations G e n) + (hnot : a ∉ GraphTreePosterior.edgeCodes (Intrinsic.exhaustion G e n)) : + ¬ Adj G a.1.1 a.1.2 := by + intro hadj + exact hnot ((mem_edgeCodes_exhaustion_iff hf e a n).mpr ⟨ha, hadj⟩) + +end Problem336.AllPairObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairObservation.lean b/lean/OAI/Probability/SpanningForest/AllPairObservation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0aa17c9798cc1f669203bd9b3e66b6cce55f6dd0 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairObservation.lean @@ -0,0 +1,119 @@ +import OAI.Probability.SpanningForest.IntrinsicExhaustion +import OAI.Probability.SpanningForest.GraphDomain +import OAI.Probability.SpanningForest.EdgeAction + +namespace OAI + +noncomputable section +open MeasureTheory +namespace Problem336.AllPairObservation + +def vertexPairs (V : Finset ℕ) : Finset EdgeCode := + (V.product V).subtype (fun p => p.1 < p.2) + +@[simp] theorem mem_vertexPairs (V : Finset ℕ) (e : EdgeCode) : + e ∈ vertexPairs V ↔ e.1.1 ∈ V ∧ e.1.2 ∈ V := by + simp [vertexPairs] + +theorem vertexPairs_mono {V W : Finset ℕ} (h : V ⊆ W) : + vertexPairs V ⊆ vertexPairs W := by + intro e he + rw [mem_vertexPairs] at he ⊢ + exact ⟨h he.1, h he.2⟩ + +def observations (G : GraphCode) (e : EdgeCode) (n : ℕ) : Finset EdgeCode := by + classical + exact if h : GraphLocallyFinite G then + vertexPairs (IntrinsicExhaustion.edgeBallSubgraph G h e n).1 else ∅ + +@[simp] theorem mem_observations (G : GraphCode) (e a : EdgeCode) (n : ℕ) : + a ∈ observations G e n ↔ GraphLocallyFinite G ∧ + a.1.1 ∈ IntrinsicExhaustion.edgeBall G e n ∧ + a.1.2 ∈ IntrinsicExhaustion.edgeBall G e n := by + classical + by_cases h : GraphLocallyFinite G <;> simp [observations, h] + +theorem observations_mono (G : GraphCode) (e : EdgeCode) : + Monotone (observations G e) := by + intro n m hnm a ha + rw [mem_observations] at ha ⊢ + exact ⟨ha.1, IntrinsicExhaustion.edgeBall_mono G e hnm ha.2.1, + IntrinsicExhaustion.edgeBall_mono G e hnm ha.2.2⟩ + +theorem self_mem_observations {G : GraphCode} (hG : GraphLocallyFinite G) + (e : EdgeCode) (n : ℕ) : e ∈ observations G e n := by + simp [hG] + +theorem exists_mem_observations {G : GraphCode} (hc : GraphConnected G) + (hf : GraphLocallyFinite G) (e a : EdgeCode) : + ∃ n, a ∈ observations G e n := by + obtain ⟨n, hn⟩ := IntrinsicExhaustion.GraphConnected.exists_mem_edgeBall hc e a.1.1 + obtain ⟨m, hm⟩ := IntrinsicExhaustion.GraphConnected.exists_mem_edgeBall hc e a.1.2 + refine ⟨max n m, (mem_observations G e a _).mpr ⟨hf, ?_, ?_⟩⟩ + · exact IntrinsicExhaustion.edgeBall_mono G e (le_max_left n m) hn + · exact IntrinsicExhaustion.edgeBall_mono G e (le_max_right n m) hm + +theorem eventually_mem_observations {G : GraphCode} (hc : GraphConnected G) + (hf : GraphLocallyFinite G) (e a : EdgeCode) : + ∀ᶠ n in Filter.atTop, a ∈ observations G e n := by + obtain ⟨n, hn⟩ := exists_mem_observations hc hf e a + exact Filter.eventually_atTop.mpr ⟨n, fun m hnm => observations_mono G e hnm hn⟩ + +private theorem measurable_finset_from_membership + {α β : Type*} [Countable α] [MeasurableSpace α] [MeasurableSpace β] + (f : β → Finset α) (hf : ∀ a, MeasurableSet {b | a ∈ f b}) : Measurable f := by + apply measurable_to_countable + intro y + have hpre : f ⁻¹' {f y} = ⋂ a, {b | a ∈ f b ↔ a ∈ f y} := by + ext b + simp only [Set.mem_preimage, Set.mem_singleton_iff, Set.mem_iInter, Set.mem_ofPred_eq, + Finset.ext_iff] + rw [hpre] + apply MeasurableSet.iInter + intro a + by_cases ha : a ∈ f y + · simpa only [ha, iff_true] using hf a + · simpa only [ha, iff_false, Set.compl_ofPred] using (hf a).compl + +theorem measurable_observations (e : EdgeCode) (n : ℕ) : + Measurable (fun G : GraphCode => observations G e n) := by + apply measurable_finset_from_membership + intro a + simpa only [mem_observations, Set.ofPred_and] using + measurableSet_graphLocallyFinite.inter + ((IntrinsicExhaustion.measurableSet_mem_edgeBall e a.1.1 n).inter + (IntrinsicExhaustion.measurableSet_mem_edgeBall e a.1.2 n)) + +private theorem locallyFinite_relabel {G : GraphCode} (hG : GraphLocallyFinite G) + (σ : Equiv ℕ ℕ) : GraphLocallyFinite (relabelGraph σ G) := by + intro u + apply ((hG (σ.symm u)).image σ).subset + intro v hv + exact ⟨σ.symm v, hv, σ.apply_symm_apply v⟩ + +private theorem locallyFinite_relabel_iff (G : GraphCode) (σ : Equiv ℕ ℕ) : + GraphLocallyFinite (relabelGraph σ G) ↔ GraphLocallyFinite G := by + constructor + · intro h + have h' := locallyFinite_relabel h σ.symm + simpa [relabelGraph] using h' + · exact fun h => locallyFinite_relabel h σ + +private theorem endpoints_mapEdge (σ : Equiv ℕ ℕ) (a : EdgeCode) (P : ℕ → Prop) : + (P (mapEdge σ a).1.1 ∧ P (mapEdge σ a).1.2) ↔ + (P (σ a.1.1) ∧ P (σ a.1.2)) := by + unfold mapEdge mkEdge + split_ifs <;> simp only [and_comm] + +theorem mem_observations_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (e a : EdgeCode) (n : ℕ) : + mapEdge σ a ∈ observations (relabelGraph σ G) (mapEdge σ e) n ↔ + a ∈ observations G e n := by + simp only [mem_observations, locallyFinite_relabel_iff, + endpoints_mapEdge, IntrinsicExhaustion.mem_edgeBall_relabel] + +end Problem336.AllPairObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairPicardDecoder.lean b/lean/OAI/Probability/SpanningForest/AllPairPicardDecoder.lean new file mode 100644 index 0000000000000000000000000000000000000000..abc33e426a643af418430d7dd1437fe554645c4e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairPicardDecoder.lean @@ -0,0 +1,106 @@ +import OAI.Probability.SpanningForest.AllPairFactorAssembly +import OAI.Probability.SpanningForest.FactorAssembly + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology +namespace Problem336.AllPairPicardDecoder +open FactorAssembly + +def decoder {Y : Type*} (eval : Y → ℝ → ℝ) (b : GraphDrift) + (G : GraphCode) (W : EdgeCode → Y) (e : EdgeCode) : Bool := by + classical + exact if (1 / 2 : ℝ) < limsup + (fun n : ℕ => Picard.decode (fun f => eval (W f)) (b G) e (n : ℝ) / (n : ℝ)) + atTop then true else false + +theorem measurable_decodedPath {Y : Type*} [MeasurableSpace Y] + (eval : Y → ℝ → ℝ) (heval : Measurable (Function.uncurry eval)) + (b : GraphDrift) (hb : DriftBorel b) (e : EdgeCode) : + Measurable (fun p : (GraphCode × (EdgeCode → Y)) × ℝ => + Picard.decode (fun f => eval (p.1.2 f)) (b p.1.1) e p.2) := by + have hw (f : EdgeCode) : + Measurable (fun p : (GraphCode × (EdgeCode → Y)) × ℝ => eval (p.1.2 f) p.2) := by + have hm : Measurable (fun p : (GraphCode × (EdgeCode → Y)) × ℝ => + (p.1.2 f, p.2)) := + ((measurable_pi_apply f).comp measurable_fst.snd).prodMk measurable_snd + exact heval.comp hm + apply Picard.measurable_decode + (w := fun p : GraphCode × (EdgeCode → Y) => fun f => eval (p.2 f)) + (b := fun p : GraphCode × (EdgeCode → Y) => b p.1) hw + intro i + exact (hb i).comp (measurable_fst.fst.prodMk measurable_snd) + +theorem measurable_decoder_edge {Y : Type*} [MeasurableSpace Y] + (eval : Y → ℝ → ℝ) (heval : Measurable (Function.uncurry eval)) + (b : GraphDrift) (hb : DriftBorel b) (e : EdgeCode) : + Measurable (fun p : GraphCode × (EdgeCode → Y) => decoder eval b p.1 p.2 e) := by + classical + have hl : Measurable (fun p : GraphCode × (EdgeCode → Y) => limsup + (fun n : ℕ => Picard.decode (fun f => eval (p.2 f)) (b p.1) e n / n) atTop) := + Measurable.limsup (fun n => + ((measurable_decodedPath eval heval b hb e).comp + (measurable_id.prodMk measurable_const)).div_const (n : ℝ)) + change Measurable (fun p : GraphCode × (EdgeCode → Y) => + if (1 / 2 : ℝ) < limsup + (fun n : ℕ => Picard.decode (fun f => eval (p.2 f)) (b p.1) e n / n) atTop + then true else false) + exact Measurable.ite (measurableSet_lt measurable_const hl) measurable_const measurable_const + +private theorem joint_measurable_of_coordinates {A : Type*} [MeasurableSpace A] + (F : GraphCode → A → EdgeConfiguration) + (hF : ∀ e, Measurable (fun p : GraphCode × A => F p.1 p.2 e)) : + Measurable (fun q : GraphCode × (A × EdgeCode) => F q.1 q.2.1 q.2.2) := by + have hall : Measurable (fun q : (GraphCode × A) × EdgeCode => F q.1.1 q.1.2 q.2) := + measurable_from_prod_countable_left hF + have hpair : Measurable (fun q : GraphCode × (A × EdgeCode) => + ((q.1, q.2.1), q.2.2)) := + (measurable_fst.prodMk measurable_snd.fst).prodMk measurable_snd.snd + exact hall.comp hpair + +theorem measurable_decoder {Y : Type*} [MeasurableSpace Y] + (eval : Y → ℝ → ℝ) (heval : Measurable (Function.uncurry eval)) + (b : GraphDrift) (hb : DriftBorel b) : + Measurable (fun q : GraphCode × ((EdgeCode → Y) × EdgeCode) => + decoder eval b q.1 q.2.1 q.2.2) := + joint_measurable_of_coordinates (decoder eval b) (measurable_decoder_edge eval heval b hb) + +theorem decoder_equivariant {Y : Type*} (eval : Y → ℝ → ℝ) + (b : GraphDrift) (hb : DriftEquivariant b) + (σ : Equiv ℕ ℕ) (G : GraphCode) (W : EdgeCode → Y) (e : EdgeCode) : + decoder eval b (relabelGraph σ G) (fun f => W (mapEdge σ.symm f)) (mapEdge σ e) = + decoder eval b G W e := by + classical + have hp (t : ℝ) : + Picard.decode (fun f => eval (W (mapEdge σ.symm f))) (b (relabelGraph σ G)) + (mapEdge σ e) t = Picard.decode (fun f => eval (W f)) (b G) e t := by + apply Picard.decode_relabel (edgeEquiv σ) (fun f => eval (W f)) + (fun f => eval (W (mapEdge σ.symm f))) (b G) (b (relabelGraph σ G)) + · intro f s + simp only [edgeEquiv_apply, mapEdge_symm_apply] + · exact hb σ G + simp only [decoder, hp] + +theorem decoder_eq_rule {Y : Type*} (eval : Y → ℝ → ℝ) (b : GraphDrift) + (Ψ : GraphCode → (ℕ → ℝ) → EdgeCode → Y) (G : GraphCode) (U : ℕ → ℝ) : + decoder eval b G (Ψ G U) = + FactorAssembly.rule b (fun G U e => eval (Ψ G U e)) G U := rfl + +theorem exists_factor_of_decoder_law {Y : Type} [MeasurableSpace Y] + [Nonempty Y] [StandardBorelSpace Y] (ν : Measure Y) [IsProbabilityMeasure ν] + (eval : Y → ℝ → ℝ) (heval : Measurable (Function.uncurry eval)) + (b : GraphDrift) (hb : DriftBorel b) (heq : DriftEquivariant b) + (hlaw : ∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G (Measure.infinitePi (fun _ : EdgeCode => ν)) (decoder eval b G)) : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ + ∀ G : GraphCode, WorksOnGraph Phi G := + factor_witness_of_all_pair_decoder ν (decoder eval b) + (measurable_decoder eval heval b hb) (decoder_equivariant eval b heq) hlaw + +end Problem336.AllPairPicardDecoder + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairPosteriorDrift.lean b/lean/OAI/Probability/SpanningForest/AllPairPosteriorDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e4c02671d258228089e37767aadc366e7f7b54f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairPosteriorDrift.lean @@ -0,0 +1,62 @@ +import OAI.Probability.SpanningForest.AllPairIntrinsicBridge +import OAI.Probability.SpanningForest.IntrinsicPosteriorDrift +import OAI.Probability.SpanningForest.PosteriorNullCoordinates + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.GraphTreePosterior + +theorem finiteTiltMean_eq_allPair_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (n : ℕ) (h : EdgeCode → ℝ) (a : EdgeCode) : + TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) h a = + TiltLimit.finiteTiltMean μ (AllPairObservation.observations G e n) h a := by + apply TiltLimit.finiteTiltMean_eq_of_zero_extra μ + (AllPairObservation.edgeCodes_exhaustion_subset_observations hf e n) + obtain ⟨H, hH⟩ := hc.exists_connected_exhaustion + filter_upwards [hμ.ae_subgraph H hH] with X hX + intro f hT hS + cases hxf : X f with + | false => rfl + | true => + exact False.elim + (AllPairObservation.not_adj_of_mem_observations_not_mem_edgeCodes hf e f n hT hS + (hX f hxf)) + +theorem drift_eq_allPair_posteriorDrift_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + drift G t y e = + PosteriorDrift.drift μ (AllPairObservation.observations G) t y e := by + rw [drift_eq_posteriorDrift_all_of_hasFUSFLaw hc hf hμ] + change Filter.limsup + (fun n => TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) + (fun f => y f - t / 2) e) Filter.atTop = + Filter.limsup + (fun n => TiltLimit.finiteTiltMean μ (AllPairObservation.observations G e n) + (fun f => y f - t / 2) e) Filter.atTop + apply Filter.limsup_congr + exact Filter.Eventually.of_forall fun n => + finiteTiltMean_eq_allPair_of_hasFUSFLaw hc hf hμ e n (fun f => y f - t / 2) e + +theorem drift_fun_eq_allPair_posteriorDrift_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) : + drift G = PosteriorDrift.drift μ (AllPairObservation.observations G) := by + funext t y e + exact drift_eq_allPair_posteriorDrift_of_hasFUSFLaw hc hf hμ e t y + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AllPairWiener.lean b/lean/OAI/Probability/SpanningForest/AllPairWiener.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee40b4af8faed38884249f7d09cd1fc14ae39db3 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AllPairWiener.lean @@ -0,0 +1,133 @@ +import OAI.Probability.SpanningForest.WienerSampler +import OAI.Probability.SpanningForest.AllPairPicardDecoder +import OAI.Probability.SpanningForest.PicardNonnegativeSampler +import OAI.Probability.SpanningForest.FactorSampler + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.AllPairWiener +open FactorAssembly +abbrev Path := GlobalWiener.Path +local instance : MeasurableSpace Path := borel _ +local instance : BorelSpace Path := ⟨rfl⟩ + +def law : Measure (EdgeCode → Path) := + Measure.infinitePi (fun _ : EdgeCode => GlobalWiener.wienerMeasure) + +instance law_isProbabilityMeasure : IsProbabilityMeasure law := by + unfold law + infer_instance + +theorem eval_hasLaw (e : EdgeCode) : + HasLaw (fun W : EdgeCode → Path => W e) GlobalWiener.wienerMeasure law := + ⟨(measurable_pi_apply e).aemeasurable, + Measure.infinitePi_map_eval (fun _ : EdgeCode => GlobalWiener.wienerMeasure) e⟩ + +theorem isBrownian_eval (e : EdgeCode) : + IsBrownianReal (fun t (W : EdgeCode → Path) => W e t) law := by + constructor + · constructor + intro S + exact (GlobalWiener.isBrownian_wienerMeasure.toIsPreBrownianReal.hasLaw S).comp + (eval_hasLaw e) + · exact ae_of_all _ (fun W => (W e).continuous) + +theorem independent_paths : + iIndepFun (fun e (W : EdgeCode → Path) => W e) law := + iIndepFun_infinitePi (P := fun _ : EdgeCode => GlobalWiener.wienerMeasure) + (X := fun _ w => w) (fun _ => measurable_id) + +theorem independent_processes : + iIndepFun (fun e (W : EdgeCode → Path) t => W e t) law := + iIndepFun_infinitePi (P := fun _ : EdgeCode => GlobalWiener.wienerMeasure) + (X := fun _ (w : Path) t => w t) + (fun _ => Measurable.of_eval (fun t => (continuous_eval_const t).measurable)) + +def pathEval (w : Path) (t : ℝ) : ℝ := w (Real.toNNReal t) + +theorem measurable_pathEval : Measurable (Function.uncurry pathEval) := + ContinuousEval.continuous_eval.measurable.comp + (measurable_fst.prodMk (continuous_real_toNNReal.measurable.comp measurable_snd)) + +def paths (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : Path := + WienerSampler.sample (AllPairIID.uniformRule G U e) + +theorem measurable_paths : + Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => paths q.1 q.2.1 q.2.2) := + WienerSampler.measurable_sample.comp AllPairIID.measurable_uniformRule_uncurried + +theorem measurable_paths_field (G : GraphCode) : Measurable (paths G) := by + apply Measurable.of_eval + intro e + exact WienerSampler.measurable_sample.comp (AllPairIID.measurable_uniformRule_fixed G e) + +theorem paths_equivariant (σ : Equiv ℕ ℕ) (G : GraphCode) + (U : ℕ → ℝ) (e : EdgeCode) : + paths (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = paths G U e := + congrArg WienerSampler.sample (AllPairIID.uniformRule_equivariant σ G U e) + +theorem paths_hasLaw {Ω : Type} [MeasurableSpace Ω] + (G : GraphCode) (hc : GraphConnected G) (hf : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) : + HasLaw (fun ω => paths G (fun v => U v ω)) law P := by + refine ⟨((measurable_paths_field G).comp (Measurable.of_eval hU.1)).aemeasurable, ?_⟩ + exact AllPairIID.sampled_uniformRule_law GlobalWiener.wienerMeasure + WienerSampler.sample WienerSampler.measurable_sample WienerSampler.map_sample + G hc hf P U hU + +def noise : GraphNoise := fun G U e => pathEval (paths G U e) + +theorem noise_borel : NoiseBorel noise := by + intro e + have hp : Measurable (fun p : (GraphCode × (ℕ → ℝ)) × ℝ => paths p.1.1 p.1.2 e) := + measurable_paths.comp (measurable_fst.fst.prodMk + (measurable_fst.snd.prodMk measurable_const)) + exact measurable_pathEval.comp (hp.prodMk measurable_snd) + +theorem noise_equivariant : NoiseEquivariant noise := by + intro σ G U e t + exact congrArg (fun w => pathEval w t) (paths_equivariant σ G U e) + +theorem continuous_noise (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : + Continuous (noise G U e) := + (paths G U e).continuous.comp continuous_real_toNNReal + +theorem decoder_eq_nonnegative_sample (b : GraphDrift) (G : GraphCode) : + AllPairPicardDecoder.decoder pathEval b G = + PicardSampler.NonnegativeTime.sample + (fun (W : EdgeCode → Path) e t => W e t) (b G) := by + funext W e + exact (PicardSampler.sample_apply_unshifted + (fun (W : EdgeCode → Path) e => pathEval (W e)) (b G) W e).symm + +theorem sampler_hasLaw_of_product + (b : GraphDrift) (G : GraphCode) (hc : GraphConnected G) + (hf : GraphLocallyFinite G) {ν : Measure EdgeConfiguration} + (hLaw : HasLaw (PicardSampler.NonnegativeTime.sample + (fun (W : EdgeCode → Path) e t => W e t) (b G)) ν law) : + HasLaw (PicardSampler.sample (noise G) (b G)) ν privatePoolLaw := by + exact hLaw.comp (paths_hasLaw G hc hf privatePoolLaw + (fun v U => U v) CanonicalIID.canonical_isVertexIID) + +theorem exists_factor_of_sampler_laws + (b : GraphDrift) (hb : DriftBorel b) (heq : DriftEquivariant b) + (ν : GraphCode → Measure EdgeConfiguration) + (hν : ∀ G, GraphConnected G → GraphLocallyFinite G → HasFUSFLaw G (ν G) id) + (hLaw : ∀ G, GraphConnected G → GraphLocallyFinite G → + HasLaw (PicardSampler.NonnegativeTime.sample + (fun (W : EdgeCode → Path) e t => W e t) (b G)) (ν G) law) : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ + ∀ G : GraphCode, WorksOnGraph Phi G := + FactorAssembly.exists_factor_of_canonical_sampler_laws b noise hb noise_borel + heq noise_equivariant ν hν + (fun G hc hf => sampler_hasLaw_of_product b G hc hf (hLaw G hc hf)) + +end Problem336.AllPairWiener + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/AnalyticSupport.lean b/lean/OAI/Probability/SpanningForest/AnalyticSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..f09945d43866a122a71f0f0bbe6317d66ea78d00 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/AnalyticSupport.lean @@ -0,0 +1,17 @@ +import OAI.Probability.SpanningForest.FactorSampler +import OAI.Probability.SpanningForest.FactorReadout +import OAI.Probability.SpanningForest.FactorLawTransport +import OAI.Probability.SpanningForest.FactorAssembly +import OAI.Probability.SpanningForest.PicardUniqueness +import OAI.Probability.SpanningForest.GibbsResponse +import OAI.Probability.SpanningForest.TiltResponse +import OAI.Probability.SpanningForest.CanonicalDrift +import OAI.Probability.SpanningForest.FiniteTiltLimit +import OAI.Probability.SpanningForest.FiniteTiltMeasure +import OAI.Probability.SpanningForest.FiniteResponse +import OAI.Probability.SpanningForest.ResponseLipschitz +import OAI.Probability.SpanningForest.USTResponse +import OAI.Probability.SpanningForest.ExponentialFamily +import OAI.Probability.SpanningForest.RandomSelection +import OAI.Probability.SpanningForest.PicardSolution +import OAI.Probability.SpanningForest.ProjectionLimit diff --git a/lean/OAI/Probability/SpanningForest/BinaryGaussianPosterior.lean b/lean/OAI/Probability/SpanningForest/BinaryGaussianPosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f5b1eb4299025b71b8c5d70f70af13d86f19379 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BinaryGaussianPosterior.lean @@ -0,0 +1,88 @@ +import OAI.Probability.SpanningForest.FiniteGaussianPosterior + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal NNReal BigOperators ProbabilityTheory + +namespace Problem336.FinitePosterior + +def binaryValue (b : Bool) : ℝ := if b then 1 else 0 + +lemma binaryValue_binary (b : Bool) : binaryValue b = 0 ∨ binaryValue b = 1 := by + cases b <;> simp [binaryValue] + +def binarySummary {I ι : Type*} (observed : ι → I) (target : I) (x : I → Bool) : + Bool × (ι → Bool) := (x target, fun j => x (observed j)) + +lemma measurable_binarySummary {I ι : Type*} (observed : ι → I) (target : I) : + Measurable (binarySummary observed target) := by + unfold binarySummary + fun_prop + +def gaussianFiniteTilt {I ι : Type*} [Fintype ι] (ν : Measure (I → Bool)) + (observed : ι → I) (target : I) (t : ℝ) (y : ι → ℝ) : ℝ := + (∫ x, Real.exp (∑ j, (y j - t / 2) * binaryValue (x (observed j))) * + binaryValue (x target) ∂ν) / + (∫ x, Real.exp (∑ j, (y j - t / 2) * binaryValue (x (observed j))) ∂ν) + +lemma finiteMarginal_ratio_eq_integral {A Θ : Type*} [MeasurableSpace A] + [Fintype Θ] [MeasurableSpace Θ] [MeasurableSingletonClass Θ] + (ν : Measure A) [IsFiniteMeasure ν] (R : A → Θ) (hR : Measurable R) + (w g : Θ → ℝ) : + (∑ θ, ((ν.map R) {θ}).toReal * w θ * g θ) / + (∑ θ, ((ν.map R) {θ}).toReal * w θ) = + (∫ x, w (R x) * g (R x) ∂ν) / (∫ x, w (R x) ∂ν) := by + rw [← integral_map_of_stronglyMeasurable hR + (measurable_of_countable (fun θ => w θ * g θ)).stronglyMeasurable, + ← integral_map_of_stronglyMeasurable hR (measurable_of_countable w).stronglyMeasurable] + simp only [integral_fintype (Integrable.of_finite), Measure.real, smul_eq_mul, mul_assoc] + +theorem binaryField_gaussian_condExp + {Ω I ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (P : Measure Ω) [IsProbabilityMeasure P] + (ν : Measure (I → Bool)) [IsProbabilityMeasure ν] + (X : Ω → (I → Bool)) (noise : Ω → (ι → ℝ)) + (hX : Measurable X) (hnoise : Measurable noise) + (observed : ι → I) (target : I) (t : ℝ≥0) (ht : t ≠ 0) + (hprior : P.map X = ν) + (hnoiseLaw : P.map noise = Measure.pi (fun _ : ι => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) : + let Yobs := fun ω j => (t : ℝ) * binaryValue (X ω (observed j)) + noise ω j + P[fun ω => binaryValue (X ω target) | + (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => gaussianFiniteTilt ν observed target t (Yobs ω) := by + classical + let R : (I → Bool) → Bool × (ι → Bool) := binarySummary observed target + have hR : Measurable R := measurable_binarySummary observed target + let π := ν.map R + let : IsProbabilityMeasure π := inferInstance + let signal : (Bool × (ι → Bool)) → ι → ℝ := fun θ j => binaryValue (θ.2 j) + let g : (Bool × (ι → Bool)) → ℝ := fun θ => binaryValue θ.1 + have hsignal : ∀ θ j, signal θ j = 0 ∨ signal θ j = 1 := by + intro θ j + exact binaryValue_binary _ + have hprior' : P.map (fun ω => R (X ω)) = π := by + change P.map (R ∘ X) = ν.map R + rw [← Measure.map_map hR hX, hprior] + have hindep' : (fun ω => R (X ω)) ⟂ᵢ[P] noise := by + simpa only [Function.comp_def, id_eq] using hindep.comp hR measurable_id + have h := gaussian_condExp_eq_exponential_ratio_of_independent P + (fun ω => R (X ω)) noise (hR.comp hX) hnoise π t ht signal hsignal + hprior' hnoiseLaw hindep' g + have hratio (y : ι → ℝ) : + (∑ θ, (π {θ}).toReal * Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j) * g θ) / + (∑ θ, (π {θ}).toReal * Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j)) = + gaussianFiniteTilt ν observed target t y := by + simpa only [π, R, signal, g, binarySummary, gaussianFiniteTilt] using + finiteMarginal_ratio_eq_integral ν R hR + (fun θ => Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j)) g + filter_upwards [h] with ω hω + exact hω.trans (hratio _) + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BinaryLawUnique.lean b/lean/OAI/Probability/SpanningForest/BinaryLawUnique.lean new file mode 100644 index 0000000000000000000000000000000000000000..bddd60647468ec9b2fc9a14e7aa97d60deeedf8c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BinaryLawUnique.lean @@ -0,0 +1,101 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336.BinaryLaw + +def signedCylinder {I : Type*} (A B : Finset I) : Set (I → Bool) := + {x | (∀ e ∈ A, x e = true) ∧ (∀ e ∈ B, x e = false)} + +theorem measurableSet_signedCylinder {I : Type*} (A B : Finset I) : + MeasurableSet (signedCylinder A B) := by + unfold signedCylinder + convert (A.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton true)).inter + (B.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton false)) using 1 + ext x + simp + +theorem measure_ext_of_signed_cylinders {I : Type*} {μ ν : Measure (I → Bool)} [IsFiniteMeasure μ] + (h : ∀ A B : Finset I, + μ {x | (∀ e ∈ A, x e = true) ∧ (∀ e ∈ B, x e = false)} = + ν {x | (∀ e ∈ A, x e = true) ∧ (∀ e ∈ B, x e = false)}) : μ = ν := by + classical + let F : (s : Finset I) → Measure (s → Bool) := + fun s => μ.map s.restrict + have hμ : IsProjectiveLimit μ F := fun s => rfl + have hν : IsProjectiveLimit ν F := by + intro s + apply Measure.ext_of_singleton + intro a + let f : I → Bool := fun e => if he : e ∈ s then a ⟨e, he⟩ else false + let A := s.filter (fun e => f e = true) + let B := s.filter (fun e => f e = false) + have hset : s.restrict ⁻¹' ({a} : Set (s → Bool)) = + {x | (∀ e ∈ A, x e = true) ∧ (∀ e ∈ B, x e = false)} := by + ext x + change (s.restrict x = a) ↔ _ + constructor + · intro hx + constructor + · intro e he + obtain ⟨hes, he⟩ := Finset.mem_filter.mp he + have hx' := congrFun hx (⟨e, hes⟩ : s) + simpa [f, hes, ← hx'] using he + · intro e he + obtain ⟨hes, he⟩ := Finset.mem_filter.mp he + have hx' := congrFun hx (⟨e, hes⟩ : s) + simpa [f, hes, ← hx'] using he + · intro hx + funext e + have hf : f e = a e := by simp [f, e.property] + cases ha : a e + · exact hx.2 e (Finset.mem_filter.mpr ⟨e.property, hf.trans ha⟩) + · exact hx.1 e (Finset.mem_filter.mpr ⟨e.property, hf.trans ha⟩) + change (ν.map s.restrict) {a} = (μ.map s.restrict) {a} + rw [Measure.map_apply (Finset.measurable_restrict s) (measurableSet_singleton a), + Measure.map_apply (Finset.measurable_restrict s) (measurableSet_singleton a), hset] + exact (h A B).symm + exact hμ.unique hν + +theorem measure_ext_of_positive_cylinders {I : Type*} {μ ν : Measure (I → Bool)} + [IsFiniteMeasure μ] + (h : ∀ A : Finset I, μ {x | ∀ e ∈ A, x e = true} = + ν {x | ∀ e ∈ A, x e = true}) : μ = ν := by + classical + apply measure_ext_of_signed_cylinders + intro A B + change μ (signedCylinder A B) = ν (signedCylinder A B) + induction B using Finset.induction_on generalizing A with + | empty => simpa [signedCylinder] using h A + | @insert e B he ih => + have hu : signedCylinder A B = + signedCylinder (insert e A) B ∪ signedCylinder A (insert e B) := by + ext x + simp only [signedCylinder, Set.mem_ofPred_eq, Set.mem_union, Finset.mem_insert, + forall_eq_or_imp] + cases x e <;> simp + have hd : Disjoint (signedCylinder (insert e A) B) + (signedCylinder A (insert e B)) := by + rw [Set.disjoint_left] + intro x hx hy + have ht := hx.1 e (Finset.mem_insert_self e A) + have hf := hy.2 e (Finset.mem_insert_self e B) + exact Bool.noConfusion (ht.symm.trans hf) + have hsplit (ρ : Measure (I → Bool)) : + ρ (signedCylinder A B) = ρ (signedCylinder (insert e A) B) + + ρ (signedCylinder A (insert e B)) := by + rw [hu, measure_union hd (measurableSet_signedCylinder A (insert e B))] + have heq := ih A + rw [hsplit μ, hsplit ν, ← ih (insert e A)] at heq + exact (ENNReal.add_right_inj (measure_ne_top μ _)).mp heq + +end Problem336.BinaryLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BinaryWeakConvergence.lean b/lean/OAI/Probability/SpanningForest/BinaryWeakConvergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..944ab4ed46b51a73a9495d52f379bccca0e42475 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BinaryWeakConvergence.lean @@ -0,0 +1,90 @@ +import OAI.Probability.SpanningForest.CylinderLimitMeasure +import OAI.Probability.SpanningForest.BinaryLawUnique + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336.BinaryLaw + +theorem tendsto_iff_signedCylinders + {I α : Type*} [Countable I] {F : Filter α} + {μs : α → ProbabilityMeasure (I → Bool)} + {μ : ProbabilityMeasure (I → Bool)} : + Tendsto μs F (𝓝 μ) ↔ ∀ A B : Finset I, + Tendsto (fun a => (μs a : Measure (I → Bool)) (signedCylinder A B)) F + (𝓝 ((μ : Measure (I → Bool)) (signedCylinder A B))) := by + constructor + · intro h A B + have hv := ProbabilityMeasure.tendsto_measure_of_isClopen_of_tendsto h + (Problem336.isClopen_boolCylinder A B) + simpa only [ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure, + Function.comp_def, signedCylinder] using (ENNReal.continuous_coe.tendsto _).comp hv + · intro h + apply tendsto_nhds_of_unique_mapClusterPt + intro ν hν + apply ProbabilityMeasure.toMeasure_injective + apply measure_ext_of_signed_cylinders + intro A B + exact Problem336.clopen_measure_eq_of_mapClusterPt hν + (Problem336.isClopen_boolCylinder A B) (h A B) + +theorem exists_weakLimit_of_signedCylinder_limits + {I : Type*} [Countable I] + (μn : ℕ → ProbabilityMeasure (I → Bool)) + (L : Finset I → Finset I → ℝ≥0∞) + (hL : ∀ A B, Tendsto + (fun n => (μn n : Measure (I → Bool)) (signedCylinder A B)) + atTop (𝓝 (L A B))) : + ∃ μ : ProbabilityMeasure (I → Bool), + (∀ A B, (μ : Measure (I → Bool)) (signedCylinder A B) = L A B) ∧ + Tendsto μn atTop (𝓝 μ) := by + obtain ⟨μ, hμ⟩ := Problem336.exists_probabilityMeasure_of_boolCylinder_limits μn L hL + refine ⟨μ, hμ, tendsto_iff_signedCylinders.mpr (fun A B => ?_)⟩ + simpa only [signedCylinder, hμ A B] using hL A B + +theorem tendsto_iff_positiveCylinders + {I α : Type*} [Countable I] {F : Filter α} + {μs : α → ProbabilityMeasure (I → Bool)} + {μ : ProbabilityMeasure (I → Bool)} : + Tendsto μs F (𝓝 μ) ↔ ∀ A : Finset I, + Tendsto (fun a => (μs a : Measure (I → Bool)) {x | ∀ i ∈ A, x i = true}) F + (𝓝 ((μ : Measure (I → Bool)) {x | ∀ i ∈ A, x i = true})) := by + constructor + · intro h A + simpa [signedCylinder] using (tendsto_iff_signedCylinders.mp h) A ∅ + · intro h + apply tendsto_nhds_of_unique_mapClusterPt + intro ν hν + apply ProbabilityMeasure.toMeasure_injective + apply measure_ext_of_positive_cylinders + intro A + have hS : IsClopen {x : I → Bool | ∀ i ∈ A, x i = true} := by + simpa using Problem336.isClopen_boolCylinder A ∅ + exact Problem336.clopen_measure_eq_of_mapClusterPt hν hS (h A) + +theorem exists_weakLimit_of_positiveCylinder_limits + {I : Type*} [Countable I] + (μn : ℕ → ProbabilityMeasure (I → Bool)) (L : Finset I → ℝ≥0∞) + (hL : ∀ A, Tendsto + (fun n => (μn n : Measure (I → Bool)) {x | ∀ i ∈ A, x i = true}) + atTop (𝓝 (L A))) : + ∃ μ : ProbabilityMeasure (I → Bool), + (∀ A, (μ : Measure (I → Bool)) {x | ∀ i ∈ A, x i = true} = L A) ∧ + Tendsto μn atTop (𝓝 μ) := by + apply Problem336.exists_probabilityMeasure_tendsto_of_clopen_limits μn + (fun A => {x | ∀ i ∈ A, x i = true}) _ _ L hL + · intro A + simpa using Problem336.isClopen_boolCylinder A ∅ + · intro μ ν h + apply ProbabilityMeasure.toMeasure_injective + exact measure_ext_of_positive_cylinders h + +end Problem336.BinaryLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BitRecovery.lean b/lean/OAI/Probability/SpanningForest/BitRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..29631dc7da6b559da1488f8785eb516ba56b7ee0 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BitRecovery.lean @@ -0,0 +1,126 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology BigOperators NNReal + +namespace Problem336 + +def bitValue (b : Bool) : ℝ := if b then 1 else 0 + +def slopeReadout (z : ℕ → ℝ) : Bool := + if (1 / 2 : ℝ) < limsup (fun n : ℕ => z (n + 1) / (n + 1 : ℝ)) atTop + then true else false + +theorem measurable_slopeReadout : Measurable slopeReadout := by + have h : Measurable (fun z : ℕ → ℝ => + limsup (fun n : ℕ => z (n + 1) / (n + 1 : ℝ)) atTop) := + Measurable.limsup (fun n => (measurable_pi_apply (n + 1)).div_const _) + exact Measurable.ite (measurableSet_lt measurable_const h) + measurable_const measurable_const + +theorem slopeReadout_of_tendsto {z : ℕ → ℝ} {b : Bool} + (h : Tendsto (fun n : ℕ => z (n + 1) / (n + 1 : ℝ)) atTop + (𝓝 (bitValue b))) : + slopeReadout z = b := by + unfold slopeReadout + rw [h.limsup_eq] + cases b <;> norm_num [bitValue] + +theorem slopeReadout_linear_add_noise (b : Bool) (noise : ℕ → ℝ) + (hnoise : Tendsto (fun n : ℕ => noise (n + 1) / (n + 1 : ℝ)) atTop (𝓝 0)) : + slopeReadout (fun n => (n : ℝ) * bitValue b + noise n) = b := by + apply slopeReadout_of_tendsto + have h := (tendsto_const_nhds (x := bitValue b) (f := atTop)).add hnoise + simp only [add_zero] at h + convert h using 1 + ext n + have hn : (n + 1 : ℝ) ≠ 0 := by positivity + simp [add_div, hn] + +theorem brownian_integer_slopes {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : ℝ≥0 → Ω → ℝ} (hB : IsPreBrownianReal B P) : + ∀ᵐ ω ∂P, Tendsto (fun n : ℕ => B (n : ℝ≥0) ω / (n : ℝ)) atTop (𝓝 0) := by + let X : ℕ → Ω → ℝ := fun n ω => B ((n + 1 : ℕ) : ℝ≥0) ω - B (n : ℝ≥0) ω + have hdist (n : ℕ) : + nndist (((n + 1 : ℕ) : ℝ≥0) : ℝ) ((n : ℝ≥0) : ℝ) = (1 : ℝ≥0) := by + apply NNReal.eq + simp [coe_nndist] + have hlaw (n : ℕ) : HasLaw (X n) (gaussianReal 0 1) P := by + have h := hB.hasLaw_sub (((n + 1 : ℕ) : ℝ≥0)) (n : ℝ≥0) + change HasLaw (X n) + (gaussianReal 0 (nndist (((n + 1 : ℕ) : ℝ≥0) : ℝ) ((n : ℝ≥0) : ℝ))) P at h + rw [hdist n] at h + exact h + have hindep : iIndepFun X P := hB.hasIndepIncrements.nat Nat.mono_cast + have hmean : P[X 0] = 0 := by + rw [(hlaw 0).integral_eq, integral_id_gaussianReal] + have hstrong := strong_law_ae_real X (hlaw 0).hasGaussianLaw.integrable + (fun _ _ h => hindep.indepFun h) (fun n => (hlaw n).identDistrib (hlaw 0)) + rw [hmean] at hstrong + filter_upwards [hstrong, hB.eval_zero_ae_eq_zero] with ω hω hzero + have hsum (n : ℕ) : (∑ i ∈ Finset.range n, X i ω) = B (n : ℝ≥0) ω := by + simpa only [X, Nat.cast_zero, hzero, sub_zero] using + Finset.sum_range_sub (fun n : ℕ => B (n : ℝ≥0) ω) n + simpa only [hsum] using hω + +theorem ae_slopeReadout_brownian_observation {I Ω : Type*} [Countable I] + [MeasurableSpace Ω] {P : Measure Ω} (X : Ω → I → Bool) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) : + ∀ᵐ ω ∂P, (fun i => slopeReadout + (fun n => (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω)) = X ω := by + have hslopes : ∀ᵐ ω ∂P, ∀ i, + Tendsto (fun n : ℕ => B i (n : ℝ≥0) ω / (n : ℝ)) atTop (𝓝 0) := + ae_all_iff.mpr (fun i => brownian_integer_slopes (hB i)) + filter_upwards [hslopes] with ω hω + funext i + apply slopeReadout_linear_add_noise + simpa only [Nat.cast_add, Nat.cast_one] using + (tendsto_add_atTop_iff_nat 1).mpr (hω i) + +def configurationReadout {I : Type*} (z : I → ℕ → ℝ) : I → Bool := + fun i => slopeReadout (z i) + +theorem measurable_configurationReadout {I : Type*} : + Measurable (configurationReadout (I := I)) := + Measurable.of_eval fun i => measurable_slopeReadout.comp (measurable_pi_apply i) + +theorem configurationReadout_reindex {I J : Type*} (f : J → I) (z : I → ℕ → ℝ) : + configurationReadout (fun j => z (f j)) = fun j => configurationReadout z (f j) := rfl + +theorem brownian_observation_readout_hasLaw {I Ω : Type*} [Countable I] + [MeasurableSpace Ω] {P : Measure Ω} {ν : Measure (I → Bool)} + (X : Ω → I → Bool) (hX : HasLaw X ν P) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) : + HasLaw (fun ω => configurationReadout + (fun i (n : ℕ) => (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω)) ν P := + hX.congr (ae_slopeReadout_brownian_observation X B hB) + +theorem sampler_hasLaw_of_brownian_inversion + {I Ω W Ω' : Type*} [Countable I] + [MeasurableSpace Ω] [MeasurableSpace W] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} {ρ : Measure W} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsPreBrownianReal (B i) P) + {innovation : Ω → W} (hinnovation : HasLaw innovation ρ P) + {fresh : Ω' → W} (hfresh : HasLaw fresh ρ P') + {Z : W → I → ℕ → ℝ} (hZ : Measurable Z) + (hinverse : ∀ᵐ ω ∂P, Z (innovation ω) = + fun i (n : ℕ) => (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω) : + HasLaw (fun ω => configurationReadout (Z (fresh ω))) ν P' := by + have href : HasLaw (fun ω => configurationReadout (Z (innovation ω))) ν P := by + apply (brownian_observation_readout_hasLaw X hX B hB).congr + filter_upwards [hinverse] with ω hω + rw [hω] + exact HasLaw.comp_of_hasLaw_comp + (f := fun w : W => configurationReadout (Z w)) + (measurable_configurationReadout.comp hZ).aemeasurable hinnovation hfresh href + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BorelExhaustion.lean b/lean/OAI/Probability/SpanningForest/BorelExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..914b3aac696aba0bb5d494e34e448e4439d7820d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BorelExhaustion.lean @@ -0,0 +1,172 @@ +import OAI.Probability.SpanningForest.BorelFiniteChoice +import OAI.Probability.SpanningForest.ExhaustionExistence + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.BorelExhaustion + +def edgeWindow (G : GraphCode) (n : ℕ) : Finset (ℕ × ℕ) := by + classical + exact ((Finset.range (n + 1)).product (Finset.range (n + 1))).filter + (fun p => p.1 < p.2 ∧ Adj G p.1 p.2) + +lemma mem_edgeWindow (G : GraphCode) (n : ℕ) (p : ℕ × ℕ) : + p ∈ edgeWindow G n ↔ p.1 < n + 1 ∧ p.2 < n + 1 ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + rcases p with ⟨u, v⟩ + simp [edgeWindow, and_assoc] + +lemma measurable_edgeWindow (n : ℕ) : Measurable (fun G => edgeWindow G n) := by + rw [measurable_finset_iff] + intro p + simp only [mem_edgeWindow] + exact measurable_const.and (measurable_const.and + (measurable_const.and (measurableSet_setOfPred.mp (BorelFiniteChoice.measurableSet_adj p.1 p.2)))) + +def extensionChoice : GraphCode × FiniteSubgraphCode → FiniteSubgraphCode := + Classical.choose BorelFiniteChoice.exists_measurable_connected_extension + +lemma measurable_extensionChoice : Measurable extensionChoice := + (Classical.choose_spec BorelFiniteChoice.exists_measurable_connected_extension).1 + +lemma extensionChoice_spec (G : GraphCode) (K₀ : FiniteSubgraphCode) + (h : ∃ K, IsFiniteConnectedSubgraph G K ∧ K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2) : + IsFiniteConnectedSubgraph G (extensionChoice (G, K₀)) ∧ + K₀.1 ⊆ (extensionChoice (G, K₀)).1 ∧ K₀.2 ⊆ (extensionChoice (G, K₀)).2 := + (Classical.choose_spec BorelFiniteChoice.exists_measurable_connected_extension).2 G K₀ h + +def requirements (G : GraphCode) (n : ℕ) (K : FiniteSubgraphCode) : FiniteSubgraphCode := + (K.1 ∪ Finset.range (n + 1), K.2 ∪ edgeWindow G n) + +lemma measurable_requirements (n : ℕ) : + Measurable (fun q : GraphCode × FiniteSubgraphCode => requirements q.1 n q.2) := by + apply measurable_from_prod_countable_left + intro K + change Measurable (fun G : GraphCode => + (K.1 ∪ Finset.range (n + 1), K.2 ∪ edgeWindow G n)) + exact measurable_const.prodMk + ((measurable_of_countable (fun E : Finset (ℕ × ℕ) => K.2 ∪ E)).comp + (measurable_edgeWindow n)) + +def candidate (G : GraphCode) : ℕ → FiniteSubgraphCode + | 0 => extensionChoice (G, requirements G 0 (∅, ∅)) + | n + 1 => extensionChoice (G, requirements G (n + 1) (candidate G n)) + +lemma measurable_candidate (n : ℕ) : Measurable (fun G => candidate G n) := by + induction n with + | zero => + exact measurable_extensionChoice.comp (measurable_id.prodMk + ((measurable_requirements 0).comp (measurable_id.prodMk measurable_const))) + | succ n ih => + exact measurable_extensionChoice.comp (measurable_id.prodMk + ((measurable_requirements (n + 1)).comp (measurable_id.prodMk ih))) + +lemma measurable_candidate_sequence : Measurable candidate := + Measurable.of_eval measurable_candidate + +def ExtensionProperty (G : GraphCode) : Prop := + ∀ K₀ : FiniteSubgraphCode, + (∀ p ∈ K₀.2, p.1 < p.2 ∧ Adj G p.1 p.2) → + ∃ K, IsFiniteConnectedSubgraph G K ∧ K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2 + +lemma step_spec (G : GraphCode) (hExt : ExtensionProperty G) + (n : ℕ) (K : FiniteSubgraphCode) + (hedges : ∀ p ∈ K.2, p.1 < p.2 ∧ Adj G p.1 p.2) : + IsFiniteConnectedSubgraph G (extensionChoice (G, requirements G n K)) ∧ + (requirements G n K).1 ⊆ (extensionChoice (G, requirements G n K)).1 ∧ + (requirements G n K).2 ⊆ (extensionChoice (G, requirements G n K)).2 := by + apply extensionChoice_spec + apply hExt + intro p hp + rcases Finset.mem_union.mp hp with hp | hp + · exact hedges p hp + · exact (mem_edgeWindow G n p).mp hp |>.2.2 + +lemma candidate_spec (G : GraphCode) (hExt : ExtensionProperty G) (n : ℕ) : + IsFiniteConnectedSubgraph G (candidate G n) ∧ + Finset.range (n + 1) ⊆ (candidate G n).1 ∧ + edgeWindow G n ⊆ (candidate G n).2 := by + induction n with + | zero => + have hs := step_spec G hExt 0 (∅, ∅) (by simp) + exact ⟨hs.1, Finset.subset_union_right.trans hs.2.1, + Finset.subset_union_right.trans hs.2.2⟩ + | succ n ih => + have hs := step_spec G hExt (n + 1) (candidate G n) + (fun p hp => (ih.1.2.1 p hp).2.2) + exact ⟨hs.1, Finset.subset_union_right.trans hs.2.1, + Finset.subset_union_right.trans hs.2.2⟩ + +lemma candidate_isConnectedExhaustion (G : GraphCode) (hExt : ExtensionProperty G) : + IsConnectedExhaustion G (candidate G) := by + refine ⟨fun n => (candidate_spec G hExt n).1, ?_, ?_⟩ + · intro n + have hs := step_spec G hExt (n + 1) (candidate G n) + (fun p hp => ((candidate_spec G hExt n).1.2.1 p hp).2.2) + exact ⟨Finset.subset_union_left.trans hs.2.1, Finset.subset_union_left.trans hs.2.2⟩ + · intro u v huv hadj + refine ⟨v, (candidate_spec G hExt v).2.2 ?_⟩ + exact (mem_edgeWindow G v (u, v)).mpr ⟨by omega, by omega, huv, hadj⟩ + +lemma extensionProperty_of_graphConnected {G : GraphCode} (hG : GraphConnected G) : + ExtensionProperty G := + hG.exists_finiteConnected_extension + +theorem candidate_isConnectedExhaustion_of_connected {G : GraphCode} + (hG : GraphConnected G) : IsConnectedExhaustion G (candidate G) := + candidate_isConnectedExhaustion G (extensionProperty_of_graphConnected hG) + +theorem exists_measurable_connected_exhaustion : + ∃ H : GraphCode → ℕ → FiniteSubgraphCode, Measurable H ∧ + ∀ G, GraphConnected G → IsConnectedExhaustion G (H G) := + ⟨candidate, measurable_candidate_sequence, + fun _ hG => candidate_isConnectedExhaustion_of_connected hG⟩ + +lemma subgraphAdj_implies_adj {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {u v : ℕ} (h : SubgraphAdj K u v) : + Adj G u v := by + have hp := h.2.2 + unfold rawPair at hp + by_cases huv : u < v + · have hm : (u, v) ∈ K.2 := by simpa [huv] using hp + exact (hK.2.1 (u, v) hm).2.2.2 + · have hm : (v, u) ∈ K.2 := by simpa [huv] using hp + have ha := (hK.2.1 (v, u) hm).2.2.2 + unfold Adj at * + rwa [G.2.2 u v] + +lemma graphConnected_iff_finiteConnected_pairs (G : GraphCode) : + GraphConnected G ↔ ∀ u v : ℕ, ∃ K : FiniteSubgraphCode, + IsFiniteConnectedSubgraph G K ∧ u ∈ K.1 ∧ v ∈ K.1 := by + constructor + · intro hG u v + obtain ⟨K, hK, hsub⟩ := hG.exists_finiteConnected_containing {u, v} + exact ⟨K, hK, hsub (by simp), hsub (by simp)⟩ + · intro h u v + obtain ⟨K, hK, hu, hv⟩ := h u v + exact Relation.ReflTransGen.mono + (fun _ _ hadj => subgraphAdj_implies_adj hK hadj) u v (hK.2.2 u hu v hv) + +lemma measurableSet_graphConnected : MeasurableSet {G : GraphCode | GraphConnected G} := by + have hm : Measurable (fun G : GraphCode => ∀ u v : ℕ, ∃ K : FiniteSubgraphCode, + IsFiniteConnectedSubgraph G K ∧ u ∈ K.1 ∧ v ∈ K.1) := by + apply Measurable.forall + intro u + apply Measurable.forall + intro v + apply Measurable.exists + intro K + exact (measurableSet_setOfPred.mp (BorelFiniteChoice.measurableSet_finiteConnected K)).and + (measurable_const : Measurable (fun _ : GraphCode => u ∈ K.1 ∧ v ∈ K.1)) + convert measurableSet_setOfPred.mpr hm using 1 + ext G + exact graphConnected_iff_finiteConnected_pairs G + +end Problem336.BorelExhaustion + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BorelFUSFKernel.lean b/lean/OAI/Probability/SpanningForest/BorelFUSFKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbd6928b87ae4389f2e0392385811dcba268a9cf --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BorelFUSFKernel.lean @@ -0,0 +1,106 @@ +import OAI.Probability.SpanningForest.BorelExhaustion +import OAI.Probability.SpanningForest.CylinderKernel +import OAI.Probability.SpanningForest.GraphEncoding +import OAI.Probability.SpanningForest.FiniteUSTMeasure + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336.BorelFUSFKernel + +def CommonCylinderLimits (G : GraphCode) + (p : Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) : Prop := + ∀ H, IsConnectedExhaustion G H → ∀ A B, + Tendsto (fun n => ustCylinder (H n) A B) atTop (𝓝 (p A B)) + +lemma measurable_common_cylinder_limits + (D : Set GraphCode) (hconn : ∀ G : D, GraphConnected G.1) + (p : D → Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hp : ∀ G : D, CommonCylinderLimits G.1 (p G)) (A B : Finset EdgeCode) : + Measurable (fun G => p G A B) := by + apply measurable_of_tendsto_metrizable + (f := fun n (G : D) => ustCylinder (BorelExhaustion.candidate G.1 n) A B) + · intro n + exact (measurable_of_countable (fun K : FiniteSubgraphCode => ustCylinder K A B)).comp + ((BorelExhaustion.measurable_candidate n).comp measurable_subtype_coe) + · apply tendsto_pi_nhds.mpr + intro G + exact hp G (BorelExhaustion.candidate G.1) + (BorelExhaustion.candidate_isConnectedExhaustion_of_connected (hconn G)) A B + +theorem exists_measurable_fusf_kernel_of_common_limits + (D : Set GraphCode) (hconn : ∀ G : D, GraphConnected G.1) + (p : D → Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hp : ∀ G : D, CommonCylinderLimits G.1 (p G)) : + ∃ μ : D → ProbabilityMeasure EdgeConfiguration, Measurable μ ∧ + ∀ G : D, HasFUSFLaw G.1 (μ G : Measure EdgeConfiguration) id := by + let μn (n : ℕ) (G : D) : ProbabilityMeasure EdgeConfiguration := + ⟨finiteUSTMeasure (BorelExhaustion.candidate G.1 n), + finiteUSTMeasure_isProbabilityMeasure _ + (FiniteEncoding.spanningTrees_nonempty + ((BorelExhaustion.candidate_isConnectedExhaustion_of_connected (hconn G)).1 n))⟩ + obtain ⟨μ, hμm, hμ⟩ := + CylinderKernel.exists_measurable_probabilityMeasure_of_cylinder_limits μn p + (measurable_common_cylinder_limits D hconn p hp) (by + intro G A B + have h := hp G (BorelExhaustion.candidate G.1) + (BorelExhaustion.candidate_isConnectedExhaustion_of_connected (hconn G)) A B + change Tendsto + (fun n => finiteUSTMeasure (BorelExhaustion.candidate G.1 n) (edgeCylinder A B)) + atTop (𝓝 (p G A B)) + simpa only [finiteUSTMeasure_edgeCylinder] using h) + refine ⟨μ, hμm, fun G => ?_⟩ + constructor + · intro e + exact measurable_pi_apply e + · intro H hH A B + change Tendsto (fun n => ustCylinder (H n) A B) atTop + (𝓝 ((μ G : Measure EdgeConfiguration) (CylinderKernel.cylinder A B))) + rw [hμ G A B] + exact hp G H hH A B + +theorem exists_measurable_fusf_kernel + (D : Set GraphCode) (hconn : ∀ G : D, GraphConnected G.1) + (hlimits : ∀ G : D, ∃ p, CommonCylinderLimits G.1 p) : + ∃ μ : D → ProbabilityMeasure EdgeConfiguration, Measurable μ ∧ + ∀ G : D, HasFUSFLaw G.1 (μ G : Measure EdgeConfiguration) id := by + choose p hp using hlimits + exact exists_measurable_fusf_kernel_of_common_limits D hconn p hp + +theorem exists_measurable_fusf_kernel_of_exists + (D : Set GraphCode) (hconn : ∀ G : D, GraphConnected G.1) + (hex : ∀ G : D, ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G.1 (μ : Measure EdgeConfiguration) id) : + ∃ μ : D → ProbabilityMeasure EdgeConfiguration, Measurable μ ∧ + ∀ G : D, HasFUSFLaw G.1 (μ G : Measure EdgeConfiguration) id := by + apply exists_measurable_fusf_kernel D hconn + intro G + obtain ⟨μ, hμ⟩ := hex G + refine ⟨fun A B => (μ : Measure EdgeConfiguration) (edgeCylinder A B), ?_⟩ + exact hμ.2 + +theorem exists_measurable_fusf_kernel_global + (D : Set GraphCode) (hD : MeasurableSet D) + (hconn : ∀ G : D, GraphConnected G.1) + (hlimits : ∀ G : D, ∃ p, CommonCylinderLimits G.1 p) : + ∃ μ : GraphCode → ProbabilityMeasure EdgeConfiguration, Measurable μ ∧ + ∀ G ∈ D, HasFUSFLaw G (μ G : Measure EdgeConfiguration) id := by + classical + obtain ⟨μ, hμm, hμ⟩ := exists_measurable_fusf_kernel D hconn hlimits + let μ₀ : ProbabilityMeasure EdgeConfiguration := + ⟨Measure.dirac (fun _ => false), inferInstance⟩ + let μ' (G : GraphCode) := if h : G ∈ D then μ ⟨G, h⟩ else μ₀ + refine ⟨μ', ?_, ?_⟩ + · exact Measurable.dite hμm measurable_const hD + · intro G hG + simpa only [μ', dite_eq_left hG] using hμ ⟨G, hG⟩ + +end Problem336.BorelFUSFKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BorelFiniteChoice.lean b/lean/OAI/Probability/SpanningForest/BorelFiniteChoice.lean new file mode 100644 index 0000000000000000000000000000000000000000..1510a1f40c17d1f20e15fa0313e366a36af01dec --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BorelFiniteChoice.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.BorelFiniteChoice + +theorem exists_measurable_selector {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + [Countable β] [Nonempty β] (P : α → β → Prop) + (hP : ∀ b, MeasurableSet {a | P a b}) (hex : ∀ a, ∃ b, P a b) : + ∃ f : α → β, Measurable f ∧ ∀ a, P a (f a) := by + classical + obtain ⟨e, he⟩ := exists_surjective_nat β + have hn : ∀ a, ∃ n, P a (e n) := by + intro a + obtain ⟨b, hb⟩ := hex a + obtain ⟨n, rfl⟩ := he b + exact ⟨n, hb⟩ + refine ⟨fun a => e (Nat.find (hn a)), ?_, fun a => Nat.find_spec (hn a)⟩ + exact (measurable_of_countable e).comp (measurable_find hn (fun n => hP (e n))) + +theorem exists_measurable_partial_selector {α β : Type*} + [MeasurableSpace α] [MeasurableSpace β] [Countable β] [Nonempty β] + (P : α → β → Prop) (hP : ∀ b, MeasurableSet {a | P a b}) : + ∃ f : α → β, Measurable f ∧ ∀ a, (∃ b, P a b) → P a (f a) := by + classical + have hexm : MeasurableSet {a | ∃ b, P a b} := by + have := MeasurableSet.iUnion hP + convert this using 1 + ext a + simp + obtain ⟨f, hf, hfw⟩ := exists_measurable_selector + (fun a b => P a b ∨ ¬∃ c, P a c) + (fun b => (hP b).union hexm.compl) (by + intro a + by_cases h : ∃ b, P a b + · obtain ⟨b, hb⟩ := h + exact ⟨b, Or.inl hb⟩ + · exact ⟨Classical.choice inferInstance, Or.inr h⟩) + exact ⟨f, hf, fun a ha => (hfw a).resolve_right (not_not_intro ha)⟩ + +lemma measurableSet_adj (u v : ℕ) : MeasurableSet {G : GraphCode | Adj G u v} := by + exact measurableSet_eq_fun + ((measurable_pi_apply v).comp ((measurable_pi_apply u).comp measurable_subtype_coe)) + measurable_const + +lemma measurableSet_finiteConnected (K : FiniteSubgraphCode) : + MeasurableSet {G : GraphCode | IsFiniteConnectedSubgraph G K} := by + classical + have hadj (u v : ℕ) : Measurable (fun G : GraphCode => Adj G u v) := + measurableSet_setOfPred.mp (measurableSet_adj u v) + unfold IsFiniteConnectedSubgraph + measurability + +theorem exists_measurable_connected_extension : + ∃ f : GraphCode × FiniteSubgraphCode → FiniteSubgraphCode, + Measurable f ∧ ∀ G K₀, + (∃ K, IsFiniteConnectedSubgraph G K ∧ K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2) → + IsFiniteConnectedSubgraph G (f (G, K₀)) ∧ + K₀.1 ⊆ (f (G, K₀)).1 ∧ K₀.2 ⊆ (f (G, K₀)).2 := by + have hpred (K : FiniteSubgraphCode) : + MeasurableSet {q : GraphCode × FiniteSubgraphCode | + IsFiniteConnectedSubgraph q.1 K ∧ q.2.1 ⊆ K.1 ∧ q.2.2 ⊆ K.2} := by + apply measurableSet_setOfPred.mpr + apply measurable_from_prod_countable_left + intro K₀ + change Measurable (fun G : GraphCode => + IsFiniteConnectedSubgraph G K ∧ K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2) + exact (measurableSet_setOfPred.mp (measurableSet_finiteConnected K)).and + (measurable_const : Measurable (fun _ : GraphCode => K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2)) + obtain ⟨f, hf, hfw⟩ := exists_measurable_partial_selector + (fun q : GraphCode × FiniteSubgraphCode => fun K => + IsFiniteConnectedSubgraph q.1 K ∧ q.2.1 ⊆ K.1 ∧ q.2.2 ⊆ K.2) hpred + exact ⟨f, hf, fun G K₀ => hfw (G, K₀)⟩ + +end Problem336.BorelFiniteChoice + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianBridge.lean b/lean/OAI/Probability/SpanningForest/BrownianBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..381197bec3fe3b94145cbe74129480727f0d2874 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianBridge.lean @@ -0,0 +1,281 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.BrownianBridge + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} + +def residual (B : ℝ≥0 → Ω → ℝ) (t s : ℝ≥0) (ω : Ω) : ℝ := + B s ω - (s : ℝ) / (t : ℝ) * B t ω + +theorem indepFun_residual_endpoint (hB : IsPreBrownianReal B P) + (t : ℝ≥0) (ht : t ≠ 0) : + IndepFun (fun ω (s : Set.Iic t) => residual B t s ω) (B t) P := by + have hm s := hB.aemeasurable s + have h : IndepFun (fun ω (s : Set.Iic t) => residual B t s ω) + (fun ω (_ : Unit) => B t ω) P := by + apply IsGaussianProcess.indepFun_of_covariance_eq_zero + · apply hB.isGaussianProcess.of_isGaussianProcess + rintro (⟨s, hs⟩ | _) + · exact ⟨{s, t}, + { toFun x := x ⟨s, by simp⟩ - (s : ℝ) / (t : ℝ) * x ⟨t, by simp⟩ + map_add' x y := by simp; ring + map_smul' c x := by simp; ring }, by simp [residual]⟩ + · exact ⟨{t}, + { toFun x := x ⟨t, by simp⟩ + map_add' x y := by simp + map_smul' c x := by simp }, by simp⟩ + · intro s + exact (hm s).sub ((hm t).const_mul _) + · intro _ + exact hm t + · rintro ⟨s, hs⟩ _ + have := hB.isGaussianProcess.isProbabilityMeasure + unfold residual + rw [covariance_fun_sub_left, covariance_const_mul_left, + hB.covariance_eval, hB.covariance_eval, min_self, min_eq_left hs] + · have ht' : (t : ℝ) ≠ 0 := by exact_mod_cast ht + field_simp + ring + · exact (hB.isGaussianProcess.hasGaussianLaw_eval s).memLp_two + · exact (hB.isGaussianProcess.hasGaussianLaw_eval t).memLp_two.const_mul _ + · exact (hB.isGaussianProcess.hasGaussianLaw_eval t).memLp_two + exact h.comp measurable_id (measurable_pi_apply ()) + +theorem indepFun_regroup {A C D : Type*} [MeasurableSpace A] + [MeasurableSpace C] [MeasurableSpace D] [IsFiniteMeasure P] + {X : Ω → A} {Y : Ω → C} {Z : Ω → D} + (hX : Measurable X) (hY : Measurable Y) (hZ : Measurable Z) + (hXYZ : IndepFun X (fun ω => (Y ω, Z ω)) P) + (hYZ : IndepFun Y Z P) : + IndepFun Y (fun ω => (X ω, Z ω)) P := by + let μX := P.map X + let μY := P.map Y + let μZ := P.map Z + let swapFirst : A × (C × D) → C × (A × D) := fun q => (q.2.1, q.1, q.2.2) + have hm : Measurable swapFirst := by fun_prop + have hp : MeasurePreserving swapFirst (μX.prod (μY.prod μZ)) + (μY.prod (μX.prod μZ)) := by + exact (measurePreserving_prodAssoc μY μX μZ).comp + (((Measure.measurePreserving_swap (μ := μX) (ν := μY)).prod + (MeasurePreserving.id μZ)).comp + ((measurePreserving_prodAssoc μX μY μZ).symm MeasurableEquiv.prodAssoc)) + have hpair : P.map (fun ω => (Y ω, Z ω)) = μY.prod μZ := + hYZ.map_prod_eq_prod_map_map hY.aemeasurable hZ.aemeasurable + have hall : P.map (fun ω => (X ω, (Y ω, Z ω))) = μX.prod (μY.prod μZ) := by + rw [hXYZ.map_prod_eq_prod_map_map hX.aemeasurable + (hY.prodMk hZ).aemeasurable, hpair] + have hxz : IndepFun X Z P := hXYZ.comp measurable_id measurable_snd + apply (indepFun_iff_map_prod_eq_prod_map_map hY.aemeasurable + (hX.prodMk hZ).aemeasurable).2 + rw [hxz.map_prod_eq_prod_map_map hX.aemeasurable hZ.aemeasurable] + change P.map (swapFirst ∘ (fun ω => (X ω, (Y ω, Z ω)))) = _ + rw [← Measure.map_map hm (hX.prodMk (hY.prodMk hZ)), hall] + exact hp.map_eq + +omit [MeasurableSpace Ω] in + +theorem residual_add_linear (X : Ω → ℝ) (t s : ℝ≥0) (ht : t ≠ 0) (ω : Ω) : + residual (fun r ω => (r : ℝ) * X ω + B r ω) t s ω = residual B t s ω := by + have ht' : (t : ℝ) ≠ 0 := by exact_mod_cast ht + unfold residual + field_simp + ring + +theorem indepFun_residual_hidden_endpoint (hB : IsPreBrownianReal B P) + (hBm : ∀ s, Measurable (B s)) {X : Ω → ℝ} (hXm : Measurable X) + (hXB : IndepFun X (fun ω s => B s ω) P) (t : ℝ≥0) (ht : t ≠ 0) : + IndepFun (fun ω (s : Set.Iic t) => residual B t s ω) + (fun ω => (X ω, (t : ℝ) * X ω + B t ω)) P := by + have := hB.isGaussianProcess.isProbabilityMeasure + have hpair : IndepFun X + (fun ω => ((fun s : Set.Iic t => residual B t s ω), B t ω)) P := by + exact hXB.comp measurable_id + (show Measurable (fun f : ℝ≥0 → ℝ => + ((fun s : Set.Iic t => f s - (s : ℝ) / (t : ℝ) * f t), f t)) by fun_prop) + have hm : Measurable (fun ω (s : Set.Iic t) => residual B t s ω) := by + apply Measurable.of_eval + intro s + exact (hBm s).sub ((hBm t).const_mul _) + have h := indepFun_regroup hXm hm (hBm t) hpair (indepFun_residual_endpoint hB t ht) + exact h.comp measurable_id + (show Measurable (fun q : ℝ × ℝ => (q.1, (t : ℝ) * q.1 + q.2)) by fun_prop) + +omit [MeasurableSpace Ω] in + +theorem history_comap_eq_endpoint_residual (Y : ℝ≥0 → Ω → ℝ) (t : ℝ≥0) : + MeasurableSpace.comap (fun ω (s : Set.Iic t) => Y s ω) inferInstance = + MeasurableSpace.comap + (fun ω => (Y t ω, fun s : Set.Iic t => residual Y t s ω)) inferInstance := by + let H := fun ω (s : Set.Iic t) => Y s ω + let F := fun ω => (Y t ω, fun s : Set.Iic t => residual Y t s ω) + let decompose : (Set.Iic t → ℝ) → ℝ × (Set.Iic t → ℝ) := + fun f => (f ⟨t, by simp⟩, fun s => f s - (s : ℝ) / (t : ℝ) * f ⟨t, by simp⟩) + let assemble : ℝ × (Set.Iic t → ℝ) → (Set.Iic t → ℝ) := + fun q s => q.2 s + (s : ℝ) / (t : ℝ) * q.1 + have hd : Measurable decompose := by fun_prop + have ha : Measurable assemble := by fun_prop + have hF : F = decompose ∘ H := rfl + have hH : H = assemble ∘ F := by + funext ω s + simp [H, F, assemble, residual] + change MeasurableSpace.comap H _ = MeasurableSpace.comap F _ + apply le_antisymm + · rw [hH, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono ha.comap_le + · rw [hF, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono hd.comap_le + +theorem isGaussianProcess_independent_family {I T : Type*} + {C : I → T → Ω → ℝ} (hC : ∀ i, IsGaussianProcess (C i) P) + (hind : iIndepFun (fun i ω t => C i t ω) P) : + IsGaussianProcess (fun p : I × T => C p.1 p.2) P := by + classical + constructor + intro S + let J := S.image Prod.fst + let K := S.image Prod.snd + have hG : ∀ i : J, HasGaussianLaw (fun ω (t : K) => C i t ω) P := + fun i => (hC i).hasGaussianLaw K + have hI : iIndepFun (fun (i : J) ω (t : K) => C i t ω) P := by + exact (hind.precomp Subtype.val_injective).comp + (fun _ f (t : K) => f t) (fun _ => by fun_prop) + let L : (J → K → ℝ) →L[ℝ] (S → ℝ) := + { toFun x := fun p => x ⟨p.1.1, Finset.mem_image_of_mem _ p.2⟩ + ⟨p.1.2, Finset.mem_image_of_mem _ p.2⟩ + map_add' x y := by rfl + map_smul' c x := by rfl } + exact (hI.hasGaussianLaw hG).map L + +omit [MeasurableSpace Ω] in + +theorem observation_history_comap (X : Ω → ℝ) (t : ℝ≥0) (ht : t ≠ 0) : + MeasurableSpace.comap + (fun ω (s : Set.Iic t) => (s : ℝ) * X ω + B s ω) inferInstance = + MeasurableSpace.comap (fun ω => (t : ℝ) * X ω + B t ω) inferInstance ⊔ + MeasurableSpace.comap (fun ω (s : Set.Iic t) => residual B t s ω) inferInstance := by + rw [history_comap_eq_endpoint_residual (fun r ω => (r : ℝ) * X ω + B r ω) t] + simp_rw [residual_add_linear X t _ ht] + exact MeasurableSpace.comap_prodMk _ _ + +theorem indepFun_residual_family_endpoint {I : Type*} + {C : I → ℝ≥0 → Ω → ℝ} (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) (t : ℝ≥0) (ht : t ≠ 0) : + IndepFun (fun ω (p : I × Set.Iic t) => residual (C p.1) t p.2 ω) + (fun ω i => C i t ω) P := by + classical + have hp := hind.isProbabilityMeasure + have hg := isGaussianProcess_independent_family (fun i => (hC i).isGaussianProcess) hind + have hLp i s := ((hC i).isGaussianProcess.hasGaussianLaw_eval s).memLp_two + have hm i s := (hC i).aemeasurable s + apply IsGaussianProcess.indepFun_of_covariance_eq_zero + · apply hg.of_isGaussianProcess + rintro (⟨i, s, hs⟩ | i) + · exact ⟨{(i, s), (i, t)}, + { toFun x := x ⟨(i, s), by simp⟩ - (s : ℝ) / (t : ℝ) * x ⟨(i, t), by simp⟩ + map_add' x y := by simp; ring + map_smul' c x := by simp; ring }, by simp [residual]⟩ + · exact ⟨{(i, t)}, + { toFun x := x ⟨(i, t), by simp⟩ + map_add' x y := by simp + map_smul' c x := by simp }, by simp⟩ + · intro p + exact (hm p.1 p.2).sub ((hm p.1 t).const_mul _) + · intro i + exact hm i t + · rintro ⟨i, s, hs⟩ j + unfold residual + rw [covariance_fun_sub_left (hLp i s) ((hLp i t).const_mul _) (hLp j t), + covariance_const_mul_left] + by_cases hij : i = j + · subst j + rw [(hC i).covariance_eval, (hC i).covariance_eval, min_self, min_eq_left hs] + have ht' : (t : ℝ) ≠ 0 := by exact_mod_cast ht + field_simp + ring + · have hc (r : ℝ≥0) : cov[C i r, C j t; P] = 0 := + ((hind.indepFun hij).comp (measurable_pi_apply r) + (measurable_pi_apply t)).covariance_eq_zero (hLp i r) (hLp j t) + rw [hc s, hc t] + ring + +theorem indepFun_residual_family_hidden_endpoint {I A : Type*} [MeasurableSpace A] + {C : I → ℝ≥0 → Ω → ℝ} (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) + (hCm : ∀ i s, Measurable (C i s)) {X : Ω → A} (hXm : Measurable X) + (D : A → I → ℝ) (hD : Measurable D) + (hXC : IndepFun X (fun ω (p : I × ℝ≥0) => C p.1 p.2 ω) P) + (t : ℝ≥0) (ht : t ≠ 0) : + IndepFun (fun ω (p : I × Set.Iic t) => residual (C p.1) t p.2 ω) + (fun ω => (X ω, fun i => (t : ℝ) * D (X ω) i + C i t ω)) P := by + have := hind.isProbabilityMeasure + have hpair : IndepFun X + (fun ω => ((fun p : I × Set.Iic t => residual (C p.1) t p.2 ω), + fun i => C i t ω)) P := by + exact hXC.comp measurable_id + (show Measurable (fun f : I × ℝ≥0 → ℝ => + ((fun p : I × Set.Iic t => f (p.1, p.2) - + (p.2 : ℝ) / (t : ℝ) * f (p.1, t)), fun i => f (i, t))) by fun_prop) + have hm : Measurable (fun ω (p : I × Set.Iic t) => residual (C p.1) t p.2 ω) := by + apply Measurable.of_eval + intro p + exact (hCm p.1 p.2).sub ((hCm p.1 t).const_mul _) + have hE : Measurable (fun ω i => C i t ω) := Measurable.of_eval (fun i => hCm i t) + have h := indepFun_regroup hXm hm hE hpair (indepFun_residual_family_endpoint hC hind t ht) + exact h.comp measurable_id + (show Measurable (fun q : A × (I → ℝ) => + (q.1, fun i => (t : ℝ) * D q.1 i + q.2 i)) by fun_prop) + +omit [MeasurableSpace Ω] in + +theorem observation_family_history_comap {I A : Type*} (C : I → ℝ≥0 → Ω → ℝ) + (X : Ω → A) (D : A → I → ℝ) (t : ℝ≥0) (ht : t ≠ 0) : + MeasurableSpace.comap + (fun ω (p : I × Set.Iic t) => (p.2 : ℝ) * D (X ω) p.1 + C p.1 p.2 ω) inferInstance = + MeasurableSpace.comap (fun ω i => (t : ℝ) * D (X ω) i + C i t ω) inferInstance ⊔ + MeasurableSpace.comap + (fun ω (p : I × Set.Iic t) => residual (C p.1) t p.2 ω) inferInstance := by + let H := fun ω (p : I × Set.Iic t) => (p.2 : ℝ) * D (X ω) p.1 + C p.1 p.2 ω + let F := fun ω => ((fun i => (t : ℝ) * D (X ω) i + C i t ω), + fun p : I × Set.Iic t => residual (C p.1) t p.2 ω) + let decompose : (I × Set.Iic t → ℝ) → (I → ℝ) × (I × Set.Iic t → ℝ) := + fun f => (fun i => f (i, ⟨t, by simp⟩), + fun p => f p - (p.2 : ℝ) / (t : ℝ) * f (p.1, ⟨t, by simp⟩)) + let assemble : (I → ℝ) × (I × Set.Iic t → ℝ) → (I × Set.Iic t → ℝ) := + fun q p => q.2 p + (p.2 : ℝ) / (t : ℝ) * q.1 p.1 + have hd : Measurable decompose := by fun_prop + have ha : Measurable assemble := by fun_prop + have ht' : (t : ℝ) ≠ 0 := by exact_mod_cast ht + have hF : F = decompose ∘ H := by + funext ω + apply Prod.ext + · rfl + · funext p + dsimp [F, decompose, H, residual] + field_simp + ring + have hH : H = assemble ∘ F := by + funext ω p + dsimp [H, F, assemble, residual] + field_simp + ring + rw [← MeasurableSpace.comap_prodMk] + change MeasurableSpace.comap H _ = MeasurableSpace.comap F _ + apply le_antisymm + · rw [hH, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono ha.comap_le + · rw [hF, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono hd.comap_le + +end Problem336.BrownianBridge + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianCanonicalPosterior.lean b/lean/OAI/Probability/SpanningForest/BrownianCanonicalPosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c8ebced76dde058c47af840f1ff66f157e19784 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianCanonicalPosterior.lean @@ -0,0 +1,194 @@ +import OAI.Probability.SpanningForest.CanonicalPosteriorIdentification +import OAI.Probability.SpanningForest.BrownianPosteriorReduction +import OAI.Probability.SpanningForest.BinaryGaussianPosterior + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter +open scoped NNReal BigOperators ProbabilityTheory Topology + +namespace Problem336.Observation + +theorem gaussianFiniteTilt_finset_eq {I : Type*} + (μ : ProbabilityMeasure (I → Bool)) (S : Finset I) (e : I) + (t : ℝ) (y : I → ℝ) : + FinitePosterior.gaussianFiniteTilt (μ : Measure (I → Bool)) + (fun i : S => (i : I)) e t (fun i => y i) = + TiltLimit.finiteTiltMean μ S (fun i => y i - t / 2) e := by + unfold FinitePosterior.gaussianFiniteTilt TiltLimit.finiteTiltMean + TiltLimit.tiltedMean TiltLimit.finiteEnergy + have hsum (x : I → Bool) : + (∑ i : S, (y i - t / 2) * FinitePosterior.binaryValue (x i)) = + ∑ i ∈ S, (y i - t / 2) * FinitePosterior.binaryValue (x i) := + Finset.sum_coe_sort S (fun i : I => (y i - t / 2) * FinitePosterior.binaryValue (x i)) + simp_rw [hsum] + simp only [FinitePosterior.binaryValue, TiltLimit.bit] + congr 1 + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun x => mul_comm _ _) + +theorem finiteTiltMean_eq_condExp_brownian_history + {Ω I : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (μ : ProbabilityMeasure (I → Bool)) (X : Ω → I → Bool) (hX : Measurable X) + (hprior : P.map X = (μ : Measure (I → Bool))) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) + (hind : iIndepFun (fun i ω s => B i s ω) P) + (hBm : ∀ i s, Measurable (B i s)) + (hXB : IndepFun X (fun ω (p : I × ℝ≥0) => B p.1 p.2 ω) P) + (S : Finset I) (e : I) (t : ℝ≥0) (ht : t ≠ 0) : + (fun ω => TiltLimit.finiteTiltMean μ S + (fun i => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω - (t : ℝ) / 2) e) =ᵐ[P] + P[fun ω => TiltLimit.bit (X ω e) | + historySigma (fun (i : S) (s : Set.Iic t) ω => + (s : ℝ) * TiltLimit.bit (X ω i) + B i s ω)] := by + classical + let noise : Ω → S → ℝ := fun ω i => B i t ω + have hnoise : Measurable noise := Measurable.of_eval (fun i => hBm i t) + have hbind : iIndepFun (fun (i : S) ω s => B i s ω) P := + hind.precomp Subtype.val_injective + have heind : iIndepFun (fun (i : S) ω => B i t ω) P := + hbind.comp (fun _ f => f t) (fun _ => measurable_pi_apply t) + have hnoiseLaw : P.map noise = Measure.pi (fun _ : S => gaussianReal 0 t) := by + rw [iIndepFun.map_fun_eq_pi_map (fun (i : S) => (hBm i t).aemeasurable) heind] + congr 1 + funext i + exact (hB i).hasLaw_eval t |>.map_eq + have hXnoise : IndepFun X noise P := hXB.comp measurable_id + (show Measurable (fun f : I × ℝ≥0 → ℝ => fun i : S => f (i, t)) by fun_prop) + have hXsub : IndepFun X (fun ω (p : S × ℝ≥0) => B p.1 p.2 ω) P := + hXB.comp measurable_id + (show Measurable (fun f : I × ℝ≥0 → ℝ => fun p : S × ℝ≥0 => f (p.1, p.2)) by + fun_prop) + let D : (I → Bool) → S → ℝ := fun x i => TiltLimit.bit (x i) + have hD : Measurable D := Measurable.of_eval (fun i => + TiltLimit.continuous_bit.measurable.comp (measurable_pi_apply (i : I))) + let f : (I → Bool) → ℝ := fun x => TiltLimit.bit (x e) + have hf : Measurable f := + TiltLimit.continuous_bit.measurable.comp (measurable_pi_apply e) + have hfi : Integrable (f ∘ X) P := by + exact (show Integrable TiltLimit.bit (P.map (fun ω => X ω e)) from + Integrable.of_finite).comp_measurable ((measurable_pi_apply e).comp hX) + have hh := BrownianBridge.condExp_observation_history_eq_endpoint + (fun (i : S) => hB i) hbind (fun i s => hBm i s) hX D hD hXsub t ht f hf hfi + have he := FinitePosterior.binaryField_gaussian_condExp P + (μ : Measure (I → Bool)) X noise hX hnoise (fun i : S => (i : I)) e t ht + hprior hnoiseLaw hXnoise + have he' : P[f ∘ X | MeasurableSpace.comap + (fun ω (i : S) => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω) inferInstance] =ᵐ[P] + fun ω => TiltLimit.finiteTiltMean μ S + (fun i => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω - (t : ℝ) / 2) e := by + filter_upwards [he] with ω hω + exact hω.trans (gaussianFiniteTilt_finset_eq μ S e t + (fun i => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω)) + exact (hh.trans he').symm + +theorem drift_eq_condExp_brownian_history + {Ω I : Type*} [MeasurableSpace Ω] [Countable I] + (P : Measure Ω) [IsProbabilityMeasure P] + (μ : ProbabilityMeasure (I → Bool)) (X : Ω → I → Bool) (hX : Measurable X) + (hprior : P.map X = (μ : Measure (I → Bool))) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) + (hind : iIndepFun (fun i ω s => B i s ω) P) + (hBm : ∀ i s, Measurable (B i s)) + (hXB : IndepFun X (fun ω (p : I × ℝ≥0) => B p.1 p.2 ω) P) + (S : I → ℕ → Finset I) (e : I) + (hS : Monotone (S e)) (hcover : ∀ i, ∃ n, i ∈ S e n) + (t : ℝ≥0) (ht : t ≠ 0) : + (fun ω => PosteriorDrift.drift μ S t + (fun i => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω) e) =ᵐ[P] + P[fun ω => TiltLimit.bit (X ω e) | + historySigma (fun i (s : Set.Iic t) ω => + (s : ℝ) * TiltLimit.bit (X ω i) + B i s ω)] := by + apply drift_eq_condExp_of_finite_history P μ S e hS hcover + (fun i s ω => (s : ℝ) * TiltLimit.bit (X ω i) + B i s ω) + · intro i s + exact ((TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply i).comp hX)).const_mul _).add (hBm i s) + · intro n + exact finiteTiltMean_eq_condExp_brownian_history P μ X hX hprior B hB hind hBm hXB + (S e n) e t ht + +theorem drift_zero_zero {I : Type*} [Countable I] + (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) (e : I) : + PosteriorDrift.drift μ S 0 (fun _ => 0) e = + ∫ x, TiltLimit.bit (x e) ∂(μ : Measure (I → Bool)) := by + apply PosteriorDrift.drift_eq_of_tendsto + simp [TiltLimit.finiteTiltMean, TiltLimit.tiltedMean, TiltLimit.finiteEnergy] + +theorem drift_eq_condExp_brownian_history_zero + {Ω I : Type*} [MeasurableSpace Ω] [Countable I] + (P : Measure Ω) [IsProbabilityMeasure P] + (μ : ProbabilityMeasure (I → Bool)) (X : Ω → I → Bool) (hX : Measurable X) + (hprior : P.map X = (μ : Measure (I → Bool))) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i s, Measurable (B i s)) + (S : I → ℕ → Finset I) (e : I) : + (fun ω => PosteriorDrift.drift μ S 0 + (fun i => (0 : ℝ) * TiltLimit.bit (X ω i) + B i 0 ω) e) =ᵐ[P] + P[fun ω => TiltLimit.bit (X ω e) | + historySigma (fun i (s : Set.Iic (0 : ℝ≥0)) ω => + (s : ℝ) * TiltLimit.bit (X ω i) + B i s ω)] := by + let H := fun ω (p : I × Set.Iic (0 : ℝ≥0)) => + (p.2 : ℝ) * TiltLimit.bit (X ω p.1) + B p.1 p.2 ω + have hH : Measurable H := by + apply Measurable.of_eval + intro p + exact ((TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply p.1).comp hX)).const_mul _).add (hBm p.1 p.2) + have hzero : ∀ᵐ ω ∂P, ∀ i, B i 0 ω = 0 := + ae_all_iff.mpr (fun i => (hB i).eval_zero_ae_eq_zero) + have hHzero : H =ᵐ[P] fun _ => (0 : I × Set.Iic (0 : ℝ≥0) → ℝ) := by + filter_upwards [hzero] with ω hω + funext p + have hs : (p.2 : ℝ≥0) = 0 := le_antisymm p.2.2 (by positivity) + simp [H, hs, hω p.1] + have hind0 : IndepFun X H P := + (indepFun_const_right X (0 : I × Set.Iic (0 : ℝ≥0) → ℝ)).congr + Filter.EventuallyEq.rfl hHzero.symm + have hs : StronglyMeasurable[(inferInstance : MeasurableSpace (I → Bool)).comap X] + (fun ω => TiltLimit.bit (X ω e)) := + (TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply e).comp (comap_measurable X))).stronglyMeasurable + have hc := condExp_indep_eq hX.comap_le hH.comap_le hs hind0 + have hmean : (∫ ω, TiltLimit.bit (X ω e) ∂P) = + ∫ x, TiltLimit.bit (x e) ∂(μ : Measure (I → Bool)) := by + rw [← hprior] + exact (integral_map_of_stronglyMeasurable hX + (TiltLimit.continuous_bit.measurable.comp (measurable_pi_apply e)).stronglyMeasurable).symm + filter_upwards [hzero, hc] with ω hω hcω + have hy : (fun i => (0 : ℝ) * TiltLimit.bit (X ω i) + B i 0 ω) = + (fun _ => 0) := by + funext i + simp [hω i] + rw [hy, drift_zero_zero] + exact hmean.symm.trans hcω.symm + +theorem drift_eq_condExp_brownian_history_all_times + {Ω I : Type*} [MeasurableSpace Ω] [Countable I] + (P : Measure Ω) [IsProbabilityMeasure P] + (μ : ProbabilityMeasure (I → Bool)) (X : Ω → I → Bool) (hX : Measurable X) + (hprior : P.map X = (μ : Measure (I → Bool))) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) + (hind : iIndepFun (fun i ω s => B i s ω) P) + (hBm : ∀ i s, Measurable (B i s)) + (hXB : IndepFun X (fun ω (p : I × ℝ≥0) => B p.1 p.2 ω) P) + (S : I → ℕ → Finset I) (e : I) + (hS : Monotone (S e)) (hcover : ∀ i, ∃ n, i ∈ S e n) + (t : ℝ≥0) : + (fun ω => PosteriorDrift.drift μ S t + (fun i => (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω) e) =ᵐ[P] + P[fun ω => TiltLimit.bit (X ω e) | + historySigma (fun i (s : Set.Iic t) ω => + (s : ℝ) * TiltLimit.bit (X ω i) + B i s ω)] := by + by_cases ht : t = 0 + · subst t + exact drift_eq_condExp_brownian_history_zero P μ X hX hprior B hB hBm S e + · exact drift_eq_condExp_brownian_history P μ X hX hprior B hB hind hBm hXB + S e hS hcover t ht + +end Problem336.Observation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianFamilyIdentification.lean b/lean/OAI/Probability/SpanningForest/BrownianFamilyIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..206366ad5bec0a24a0a4c4ba2db9ea81770ba707 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianFamilyIdentification.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SpanningForest.IndependentProcessVectors +import OAI.Probability.SpanningForest.JointInnovationLaw + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace Problem336.BrownianFamilyIdentification + +variable {I : Type*} + +def vectorGaussian (S : Finset I) (h : ℝ≥0) : Measure (EuclideanSpace ℝ S) := + (Measure.infinitePi (fun _ : S => gaussianReal 0 h)).map + (MeasurableEquiv.toLp 2 (S → ℝ)) + +instance (S : Finset I) (h : ℝ≥0) : IsProbabilityMeasure (vectorGaussian S h) := by + unfold vectorGaussian + infer_instance + +theorem charFun_vectorGaussian (S : Finset I) (h : ℝ≥0) (θ : EuclideanSpace ℝ S) : + charFun (vectorGaussian S h) θ = + Complex.exp (-((h : ℝ) : ℂ) * (‖θ‖ : ℂ) ^ 2 / 2) := by + classical + rw [vectorGaussian, Measure.infinitePi_eq_pi] + change charFun ((Measure.pi (fun _ : S => gaussianReal 0 h)).map + (WithLp.toLp 2)) θ = _ + rw [charFun_pi] + simp only [charFun_gaussianReal, Complex.ofReal_zero, mul_zero, zero_mul, zero_sub] + rw [← Complex.exp_sum] + congr 1 + rw [← Complex.ofReal_pow, EuclideanSpace.real_norm_sq_eq] + simp [Complex.ofReal_sum, Finset.sum_div, Finset.mul_sum, neg_div, neg_mul] + +variable {Ω Ω' : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace Ω'] + {P : Measure Ω} [IsProbabilityMeasure P] + {Q : Measure Ω'} [IsProbabilityMeasure Q] + +theorem identDistrib_brownian_family + (F : Filtration ℝ≥0 mΩ) + (W : I → ℝ≥0 → Ω → ℝ) (B : I → ℝ≥0 → Ω' → ℝ) + (hW : ∀ i, Adapted F (W i)) (hBm : ∀ i t, Measurable (B i t)) + (hW0 : ∀ i, ∀ᵐ ω ∂P, W i 0 ω = 0) + (hB : ∀ i, IsPreBrownianReal (B i) Q) + (hi : iIndepFun (fun i ω t => B i t ω) Q) + (hchar : ∀ (S : Finset I) (s t : ℝ≥0), s ≤ t → + ∀ A : Set Ω, MeasurableSet[F s] A → ∀ θ : EuclideanSpace ℝ S, + (∫ ω in A, Complex.exp ((inner ℝ + (WithLp.toLp 2 (fun i : S => W i t ω - W i s ω) : EuclideanSpace ℝ S) θ : ℂ) + * Complex.I) ∂P) = (P A).toReal • charFun (vectorGaussian S (t - s)) θ) : + IdentDistrib (fun ω i t => W i t ω) (fun ω i t => B i t ω) P Q := by + refine JointInnovationLaw.identDistrib_of_past_characteristic F W B hW hBm + hW0 (fun i => (hB i).eval_zero_ae_eq_zero) + (fun S s t => vectorGaussian S (t - s)) hchar ?_ ?_ + · intro S + exact IndependentProcessVectors.hasIndepIncrements_vector hBm hi + (fun i => (hB i).hasIndepIncrements) S + · intro S s t hst + have hstR : (s : ℝ) ≤ (t : ℝ) := hst + have hd : nndist t.1 s.1 = t - s := by + apply NNReal.coe_injective + change dist (t : ℝ) (s : ℝ) = ((t - s : ℝ≥0) : ℝ) + rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hstR), NNReal.coe_sub hst] + simpa only [vectorGaussian, hd] using + IndependentProcessVectors.brownian_vector_increment_hasLaw hBm hi hB S s t + +end Problem336.BrownianFamilyIdentification + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianFamilyNoise.lean b/lean/OAI/Probability/SpanningForest/BrownianFamilyNoise.lean new file mode 100644 index 0000000000000000000000000000000000000000..9819643ec6b81206884c7b5a3018f3831fb972b7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianFamilyNoise.lean @@ -0,0 +1,44 @@ +import OAI.Probability.SpanningForest.BrownianFamilyPast +import OAI.Probability.SpanningForest.GaussianSum + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal BigOperators + +namespace Problem336.BrownianFamilyPast + +variable {Ω I : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : I → ℝ≥0 → Ω → ℝ} + +theorem weighted_increment_hasLaw + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hI : iIndepFun (fun i ω t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) (u h : ℝ≥0) : + HasLaw (fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) + (gaussianReal 0 (h * ∑ i ∈ S, ⟨(θ i)^2, sq_nonneg _⟩)) P := by + classical + have hQ (i : S) : HasLaw (fun ω => B i (u + h) ω - B i u ω) + (gaussianReal 0 h) P := ((hB i).shift u).hasLaw_eval h + have hJ : iIndepFun (fun (i : S) ω => B i (u + h) ω - B i u ω) P := + (hI.precomp Subtype.val_injective).comp + (fun (_ : S) (f : ℝ≥0 → ℝ) => f (u + h) - f u) (fun _ => by fun_prop) + have hsum := independent_weighted_gaussian_sum_hasLaw hQ hJ (fun i : S => θ i) + have heq : (fun ω => ∑ i : S, θ i * (B i (u + h) ω - B i u ω)) = + (fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) := by + funext ω + exact Finset.sum_coe_sort S (fun i => θ i * (B i (u + h) ω - B i u ω)) + have hv : (∑ i : S, NNReal.mk ((θ i)^2) (sq_nonneg _) * h) = + h * ∑ i ∈ S, NNReal.mk ((θ i)^2) (sq_nonneg _) := by + rw [Finset.sum_coe_sort S (fun i => NNReal.mk ((θ i)^2) (sq_nonneg _) * h)] + rw [← Finset.sum_mul, mul_comm] + rw [heq, hv] at hsum + exact hsum + +end Problem336.BrownianFamilyPast + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianFamilyPast.lean b/lean/OAI/Probability/SpanningForest/BrownianFamilyPast.lean new file mode 100644 index 0000000000000000000000000000000000000000..635ef1a35a24b63cc4cd5704558491facab5111e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianFamilyPast.lean @@ -0,0 +1,160 @@ +import OAI.Probability.SpanningForest.BrownianBridge + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal BigOperators + +namespace Problem336.BrownianFamilyPast + +variable {Ω I : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : I → ℝ≥0 → Ω → ℝ} + +theorem indepFun_shift_past + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hI : iIndepFun (fun i ω t => B i t ω) P) (u : ℝ≥0) : + IndepFun + (fun ω (p : I × ℝ≥0) => B p.1 (u + p.2) ω - B p.1 u ω) + (fun ω (p : I × Set.Iic u) => B p.1 p.2 ω) P := by + classical + have hG := BrownianBridge.isGaussianProcess_independent_family + (fun i => (hB i).isGaussianProcess) hI + apply IsGaussianProcess.indepFun_of_covariance_eq_zero + · apply hG.of_isGaussianProcess + rintro (⟨i, t⟩ | ⟨i, ⟨t, ht⟩⟩) + · exact ⟨{(i, u), (i, u + t)}, + { toFun x := x ⟨(i, u + t), by simp⟩ - x ⟨(i, u), by simp⟩ + map_add' x y := by simp; abel + map_smul' c x := by simp; ring }, by simp⟩ + · exact ⟨{(i, t)}, + { toFun x := x ⟨(i, t), by simp⟩ + map_add' x y := by simp + map_smul' c x := by simp }, by simp⟩ + · intro p + exact ((hB p.1).aemeasurable _).sub ((hB p.1).aemeasurable _) + · intro p + exact (hB p.1).aemeasurable _ + · rintro ⟨i, t⟩ ⟨j, s⟩ + have hf := (hB i).isGaussianProcess.hasGaussianLaw_sub + (s := u + t) (t := u) + have hg := (hB j).isGaussianProcess.hasGaussianLaw_eval (s : ℝ≥0) + apply IndepFun.covariance_eq_zero _ hf.memLp_two hg.memLp_two + by_cases hij : i = j + · subst j + exact ((hB i).indepFun_shift u).comp + (measurable_pi_apply t) (measurable_pi_apply s) + · exact (hI.indepFun hij).comp + (show Measurable (fun f : ℝ≥0 → ℝ => f (u + t) - f u) by fun_prop) + (measurable_pi_apply (s : ℝ≥0)) + +theorem indepFun_shift_hidden_past {A : Type*} [MeasurableSpace A] + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → A} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) (u : ℝ≥0) : + IndepFun + (fun ω (p : I × ℝ≥0) => B p.1 (u + p.2) ω - B p.1 u ω) + (fun ω => (X ω, fun p : I × Set.Iic u => B p.1 p.2 ω)) P := by + have : IsProbabilityMeasure P := hI.isProbabilityMeasure + have hpair : IndepFun X + (fun ω => + ((fun p : I × ℝ≥0 => B p.1 (u + p.2) ω - B p.1 u ω), + fun p : I × Set.Iic u => B p.1 p.2 ω)) P := by + exact hXB.comp measurable_id + (show Measurable (fun f : I → ℝ≥0 → ℝ => + ((fun p : I × ℝ≥0 => f p.1 (u + p.2) - f p.1 u), + fun p : I × Set.Iic u => f p.1 p.2)) by fun_prop) + exact BrownianBridge.indepFun_regroup hX (by fun_prop) (by fun_prop) + hpair (indepFun_shift_past hB hI u) + +theorem indepFun_shift_hidden_observation + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → I → ℝ} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) (u : ℝ≥0) : + IndepFun + (fun ω (p : I × ℝ≥0) => B p.1 (u + p.2) ω - B p.1 u ω) + (fun ω => (X ω, fun p : I × Set.Iic u => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω)) P := by + exact (indepFun_shift_hidden_past hB hBm hI hX hXB u).comp measurable_id + (show Measurable (fun q : (I → ℝ) × (I × Set.Iic u → ℝ) => + (q.1, fun p : I × Set.Iic u => (p.2 : ℝ≥0) * q.1 p.1 + q.2 p)) by fun_prop) + +theorem indepFun_weighted_increment_observation + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → I → ℝ} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) (u h : ℝ≥0) : + IndepFun (fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) + (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) P := by + exact (indepFun_shift_hidden_observation hB hBm hI hX hXB u).comp + (show Measurable (fun f : I × ℝ≥0 → ℝ => ∑ i ∈ S, θ i * f (i, h)) by fun_prop) + measurable_snd + +theorem integral_weighted_increment_eq_zero + (hB : ∀ i, IsPreBrownianReal (B i) P) + (S : Finset I) (θ : I → ℝ) (u h : ℝ≥0) : + (∫ ω, ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω) ∂P) = 0 := by + have hi (i : I) : Integrable (fun ω => θ i * (B i (u + h) ω - B i u ω)) P := + (((hB i).integrable_eval (u + h)).sub ((hB i).integrable_eval u)).const_mul (θ i) + rw [integral_finsetSum _ (fun i _ => hi i)] + apply Finset.sum_eq_zero + intro i hi + rw [integral_const_mul, integral_sub ((hB i).integrable_eval _) + ((hB i).integrable_eval _), (hB i).integral_eval, (hB i).integral_eval] + simp + +theorem condExp_weighted_increment_observation_eq_zero + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → I → ℝ} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) (u h : ℝ≥0) : + P[(fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) | + MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance] + =ᵐ[P] (fun _ => (0 : ℝ)) := by + have : IsProbabilityMeasure P := hI.isProbabilityMeasure + have hQ : Measurable (fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) := by + fun_prop + have hH : Measurable (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) := by fun_prop + have hc := condExp_indep_eq hQ.comap_le hH.comap_le + (comap_measurable _).stronglyMeasurable + (indepFun_weighted_increment_observation hB hBm hI hX hXB S θ u h) + simpa only [integral_weighted_increment_eq_zero hB S θ u h] using hc + +theorem setIntegral_weighted_increment_observation_eq_zero + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → I → ℝ} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) (u h : ℝ≥0) {A : Set Ω} + (hA : MeasurableSet[MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance] A) : + (∫ ω in A, ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω) ∂P) = 0 := by + have : IsProbabilityMeasure P := hI.isProbabilityMeasure + have hH : Measurable (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) := by fun_prop + have hQ : Integrable (fun ω => ∑ i ∈ S, θ i * (B i (u + h) ω - B i u ω)) P := by + apply integrable_finsetSum + intro i hi + exact (((hB i).integrable_eval (u + h)).sub ((hB i).integrable_eval u)).const_mul _ + rw [← setIntegral_condExp hH.comap_le hQ hA] + exact integral_eq_zero_of_ae (ae_restrict_of_ae + (condExp_weighted_increment_observation_eq_zero hB hBm hI hX hXB S θ u h)) + +end Problem336.BrownianFamilyPast + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianFinitePosterior.lean b/lean/OAI/Probability/SpanningForest/BrownianFinitePosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..ded259e7bc4157ccce44a78ec9b69c3a267196c7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianFinitePosterior.lean @@ -0,0 +1,55 @@ +import OAI.Probability.SpanningForest.FinitePosteriorTilt + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal ProbabilityTheory + +namespace Problem336.FinitePosterior + +theorem brownian_finset_endpoint_law + {Ω I : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {C : I → ℝ≥0 → Ω → ℝ} (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) + (S : Finset I) (t : ℝ≥0) : + P.map (fun ω (i : S) => C i t ω) = + Measure.pi (fun _ : S => gaussianReal 0 t) := by + classical + have hi : iIndepFun (fun (i : S) ω => C i t ω) P := + (hind.precomp Subtype.val_injective).comp + (fun _ f => f t) (fun _ => measurable_pi_apply t) + rw [hi.map_fun_eq_pi_map (fun (i : S) => (hC i).aemeasurable t)] + congr 1 + funext i + exact ((hC i).hasLaw_eval t).map_eq + +theorem brownian_binaryField_finset_condExp + {Ω I : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] + (ν : ProbabilityMeasure (I → Bool)) + (X : Ω → (I → Bool)) (hX : Measurable X) + (hprior : P.map X = (ν : Measure (I → Bool))) + (C : I → ℝ≥0 → Ω → ℝ) (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) + (hCm : ∀ i s, Measurable (C i s)) + (hXC : X ⟂ᵢ[P] (fun ω (p : I × ℝ≥0) => C p.1 p.2 ω)) + (S : Finset I) (e : I) (t : ℝ≥0) (ht : t ≠ 0) : + let Y := fun ω i => (t : ℝ) * TiltLimit.bit (X ω i) + C i t ω + P[fun ω => TiltLimit.bit (X ω e) | + (inferInstance : MeasurableSpace (S → ℝ)).comap (fun ω (i : S) => Y ω i)] =ᵐ[P] + fun ω => TiltLimit.finiteTiltMean ν S (fun i => Y ω i - (t : ℝ) / 2) e := by + have hnoise : Measurable (fun ω i => C i t ω) := + Measurable.of_eval (fun i => hCm i t) + have hi : X ⟂ᵢ[P] (fun ω i => C i t ω) := by + exact hXC.comp measurable_id + (show Measurable (fun f : I × ℝ≥0 → ℝ => fun i => f (i, t)) from + Measurable.of_eval (fun i => measurable_pi_apply (i, t))) + exact binaryField_finset_condExp P ν X (fun ω i => C i t ω) + hX hnoise S e t ht hprior (brownian_finset_endpoint_law hC hind S t) hi + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianPosteriorReduction.lean b/lean/OAI/Probability/SpanningForest/BrownianPosteriorReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcbd4437b9b1fbe462dd8d879ec514b43733a59f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianPosteriorReduction.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SpanningForest.BrownianBridge +import OAI.Probability.SpanningForest.PosteriorIndependentExtension + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal ProbabilityTheory + +namespace Problem336.BrownianBridge + +theorem condExp_observation_history_eq_endpoint + {Ω I A : Type*} {mΩ : MeasurableSpace Ω} [MeasurableSpace A] {P : Measure Ω} + {C : I → ℝ≥0 → Ω → ℝ} (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) + (hCm : ∀ i s, Measurable (C i s)) {X : Ω → A} (hXm : Measurable X) + (D : A → I → ℝ) (hD : Measurable D) + (hXC : IndepFun X (fun ω (p : I × ℝ≥0) => C p.1 p.2 ω) P) + (t : ℝ≥0) (ht : t ≠ 0) (f : A → ℝ) (hf : Measurable f) + (hfi : Integrable (f ∘ X) P) : + P[f ∘ X | MeasurableSpace.comap + (fun ω (p : I × Set.Iic t) => (p.2 : ℝ) * D (X ω) p.1 + C p.1 p.2 ω) inferInstance] + =ᵐ[P] + P[f ∘ X | MeasurableSpace.comap + (fun ω i => (t : ℝ) * D (X ω) i + C i t ω) inferInstance] := by + have := hind.isProbabilityMeasure + let E := fun ω i => (t : ℝ) * D (X ω) i + C i t ω + let R := fun ω (p : I × Set.Iic t) => residual (C p.1) t p.2 ω + let hidden := MeasurableSpace.comap (fun ω => (X ω, E ω)) inferInstance + let : MeasurableSpace Ω := mΩ + have hE : Measurable[mΩ] E := by + apply Measurable.of_eval + intro i + exact (((measurable_pi_apply i).comp (hD.comp hXm)).const_mul _).add (hCm i t) + have hR : Measurable[mΩ] R := by + apply Measurable.of_eval + intro p + exact (hCm p.1 p.2).sub ((hCm p.1 t).const_mul _) + have hhidden : hidden ≤ mΩ := (hXm.prodMk hE).comap_le + have hobs : MeasurableSpace.comap E inferInstance ≤ hidden := + (comap_measurable (fun ω => (X ω, E ω))).snd.comap_le + have hXhidden : @Measurable Ω A hidden _ X := + (comap_measurable (fun ω => (X ω, E ω))).fst + have hfh : StronglyMeasurable[hidden] (f ∘ X) := (hf.comp hXhidden).stronglyMeasurable + have hbridge : Indep hidden (MeasurableSpace.comap R inferInstance) P := + (indepFun_residual_family_hidden_endpoint hC hind hCm hXm D hD hXC t ht).symm + rw [observation_family_history_comap C X D t ht] + exact Observation.condExp_sup_independent P hhidden hR.comap_le hobs hfh hfi hbridge + +theorem zero_history_comap {Ω I : Type*} (C : I → ℝ≥0 → Ω → ℝ) : + MeasurableSpace.comap (fun ω (p : I × Set.Iic (0 : ℝ≥0)) => C p.1 p.2 ω) inferInstance = + MeasurableSpace.comap (fun ω i => C i 0 ω) inferInstance := by + let H := fun ω (p : I × Set.Iic (0 : ℝ≥0)) => C p.1 p.2 ω + let E := fun ω i => C i 0 ω + let extract : (I × Set.Iic (0 : ℝ≥0) → ℝ) → (I → ℝ) := + fun f i => f (i, ⟨0, by simp⟩) + let extend : (I → ℝ) → (I × Set.Iic (0 : ℝ≥0) → ℝ) := fun f p => f p.1 + have he : Measurable extract := by fun_prop + have hx : Measurable extend := by fun_prop + have hE : E = extract ∘ H := rfl + have hH : H = extend ∘ E := by + funext ω ⟨i, s, hs⟩ + have hs0 : s = 0 := le_antisymm hs (by positivity) + subst s + rfl + change MeasurableSpace.comap H _ = MeasurableSpace.comap E _ + apply le_antisymm + · rw [hH, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono hx.comap_le + · rw [hE, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono he.comap_le + +theorem condExp_observation_history_eq_endpoint_all + {Ω I A : Type*} {mΩ : MeasurableSpace Ω} [MeasurableSpace A] {P : Measure Ω} + {C : I → ℝ≥0 → Ω → ℝ} (hC : ∀ i, IsPreBrownianReal (C i) P) + (hind : iIndepFun (fun i ω s => C i s ω) P) + (hCm : ∀ i s, Measurable (C i s)) {X : Ω → A} (hXm : Measurable X) + (D : A → I → ℝ) (hD : Measurable D) + (hXC : IndepFun X (fun ω (p : I × ℝ≥0) => C p.1 p.2 ω) P) + (t : ℝ≥0) (f : A → ℝ) (hf : Measurable f) + (hfi : Integrable (f ∘ X) P) : + P[f ∘ X | MeasurableSpace.comap + (fun ω (p : I × Set.Iic t) => (p.2 : ℝ) * D (X ω) p.1 + C p.1 p.2 ω) inferInstance] + =ᵐ[P] + P[f ∘ X | MeasurableSpace.comap + (fun ω i => (t : ℝ) * D (X ω) i + C i t ω) inferInstance] := by + by_cases ht : t = 0 + · subst t + rw [zero_history_comap (fun i r ω => (r : ℝ) * D (X ω) i + C i r ω)] + · exact condExp_observation_history_eq_endpoint hC hind hCm hXm D hD hXC t ht f hf hfi + +end Problem336.BrownianBridge + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianReference.lean b/lean/OAI/Probability/SpanningForest/BrownianReference.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b8d669669900e5e3e82a02db7a7767a985ef1b4 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianReference.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SpanningForest.BrownianBridge + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.BrownianReference + +variable {A W I : Type*} [MeasurableSpace A] [MeasurableSpace W] + (ν : Measure A) (ρ : Measure W) [IsProbabilityMeasure ν] [IsProbabilityMeasure ρ] + +def coupling : Measure (A × (I → W)) := ν.prod (Measure.infinitePi (fun _ : I => ρ)) + +instance coupling_probability : IsProbabilityMeasure (coupling (I := I) ν ρ) := by + unfold coupling + infer_instance + +omit [IsProbabilityMeasure ν] in +theorem hidden_hasLaw : HasLaw (fun q : A × (I → W) => q.1) ν (coupling ν ρ) := + measurePreserving_fst.hasLaw + +theorem noise_coordinate_preserving (i : I) : + MeasurePreserving (fun q : A × (I → W) => q.2 i) (coupling ν ρ) ρ := + (measurePreserving_eval_infinitePi (fun _ : I => ρ) i).comp measurePreserving_snd + +theorem independent_samples : + iIndepFun (fun (i : I) (q : A × (I → W)) => q.2 i) (coupling ν ρ) := by + have hm : ∀ i : I, Measurable (fun q : A × (I → W) => q.2 i) := + fun i => (measurable_pi_apply i).comp measurable_snd + apply (iIndepFun_iff_map_fun_eq_infinitePi_map hm).2 + simp_rw [(noise_coordinate_preserving ν ρ _).map_eq] + exact measurePreserving_snd.map_eq + +theorem independent_processes (b : ℝ≥0 → W → ℝ) (hb : ∀ t, Measurable (b t)) : + iIndepFun (fun (i : I) (q : A × (I → W)) t => b t (q.2 i)) (coupling ν ρ) := + (independent_samples ν ρ).comp (fun _ w t => b t w) + (fun _ => Measurable.of_eval hb) + +theorem hidden_independent_field (b : ℝ≥0 → W → ℝ) (hb : ∀ t, Measurable (b t)) : + IndepFun (fun q : A × (I → W) => q.1) + (fun q (p : I × ℝ≥0) => b p.2 (q.2 p.1)) (coupling ν ρ) := by + have h : IndepFun (fun q : A × (I → W) => q.1) (fun q => q.2) (coupling ν ρ) := + indepFun_prod measurable_id measurable_id + exact h.comp measurable_id + (Measurable.of_eval (fun p : I × ℝ≥0 => (hb p.2).comp (measurable_pi_apply p.1))) + +theorem measurable_process (b : ℝ≥0 → W → ℝ) (hb : ∀ t, Measurable (b t)) + (i : I) (t : ℝ≥0) : Measurable (fun q : A × (I → W) => b t (q.2 i)) := + (hb t).comp ((measurable_pi_apply i).comp measurable_snd) + +theorem preBrownian_process {b : ℝ≥0 → W → ℝ} (hB : IsPreBrownianReal b ρ) (i : I) : + IsPreBrownianReal (fun t (q : A × (I → W)) => b t (q.2 i)) (coupling ν ρ) := by + constructor + intro S + exact (hB.hasLaw S).comp (noise_coordinate_preserving ν ρ i).hasLaw + +theorem brownian_process {b : ℝ≥0 → W → ℝ} (hB : IsBrownianReal b ρ) (i : I) : + IsBrownianReal (fun t (q : A × (I → W)) => b t (q.2 i)) (coupling ν ρ) where + toIsPreBrownianReal := preBrownian_process ν ρ hB.toIsPreBrownianReal i + cont := (noise_coordinate_preserving ν ρ i).quasiMeasurePreserving.ae hB.cont + +theorem bridge_independent_hidden_endpoint (b : ℝ≥0 → W → ℝ) + (hb : ∀ t, Measurable (b t)) (hB : IsPreBrownianReal b ρ) + (D : A → I → ℝ) (hD : Measurable D) (t : ℝ≥0) (ht : t ≠ 0) : + IndepFun + (fun (q : A × (I → W)) (p : I × Set.Iic t) => + BrownianBridge.residual (fun s q => b s (q.2 p.1)) t p.2 q) + (fun q => (q.1, fun i => (t : ℝ) * D q.1 i + b t (q.2 i))) + (coupling ν ρ) := by + exact BrownianBridge.indepFun_residual_family_hidden_endpoint + (fun i => preBrownian_process ν ρ hB i) (independent_processes ν ρ b hb) + (fun i s => measurable_process b hb i s) measurable_fst D hD + (hidden_independent_field ν ρ b hb) t ht + +end Problem336.BrownianReference + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/BrownianSublinear.lean b/lean/OAI/Probability/SpanningForest/BrownianSublinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ae0b3dd0cd700bc1f7434225cc4edad90c2daa7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/BrownianSublinear.lean @@ -0,0 +1,53 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped BigOperators Topology NNReal + +namespace Problem336 + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {B : ℝ≥0 → Ω → ℝ} + +theorem brownian_integer_increment_hasLaw (hB : IsPreBrownianReal B P) (n : ℕ) : + HasLaw (fun ω => B ((n + 1 : ℕ) : ℝ≥0) ω - B n ω) (gaussianReal 0 1) P := by + have h := hB.hasLaw_sub ((n + 1 : ℕ) : ℝ≥0) (n : ℝ≥0) + convert h using 1 + congr 1 + apply NNReal.coe_injective + simp + +theorem brownian_integer_sublinear (hB : IsPreBrownianReal B P) : + ∀ᵐ ω ∂P, Tendsto (fun n : ℕ => B n ω / (n : ℝ)) atTop (𝓝 0) := by + let X : ℕ → Ω → ℝ := fun n ω => B ((n + 1 : ℕ) : ℝ≥0) ω - B n ω + have hXlaw (n : ℕ) : HasLaw (X n) (gaussianReal 0 1) P := + brownian_integer_increment_hasLaw hB n + have hXint : Integrable (X 0) P := (hXlaw 0).hasGaussianLaw.integrable + have hXind : iIndepFun X P := + hB.hasIndepIncrements.nat (t := fun n : ℕ => (n : ℝ≥0)) + (fun i j hij => Nat.cast_le.mpr hij) + have hXident (n : ℕ) : IdentDistrib (X n) (X 0) P P := + (hXlaw n).identDistrib (hXlaw 0) + have hmean : ∫ ω, X 0 ω ∂P = 0 := by + rw [(hXlaw 0).integral_eq, integral_id_gaussianReal] + have hslln := strong_law_ae_real X hXint (fun i j hij => hXind.indepFun hij) hXident + rw [hmean] at hslln + filter_upwards [hslln, hB.eval_zero_ae_eq_zero] with ω hω hzero + have hsum (n : ℕ) : (∑ i ∈ Finset.range n, X i ω) = B n ω := by + change (∑ i ∈ Finset.range n, (B ((i + 1 : ℕ) : ℝ≥0) ω - B i ω)) = _ + rw [Finset.sum_range_sub (fun i : ℕ => B i ω), Nat.cast_zero, hzero, sub_zero] + simpa only [hsum] using hω + +theorem brownian_integer_sublinear_all {ι : Type*} [Countable ι] + {W : ι → ℝ≥0 → Ω → ℝ} (hW : ∀ i, IsPreBrownianReal (W i) P) : + ∀ᵐ ω ∂P, ∀ i, Tendsto (fun n : ℕ => W i n ω / (n : ℝ)) atTop (𝓝 0) := + ae_all_iff.mpr (fun i => brownian_integer_sublinear (hW i)) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalBrownianReference.lean b/lean/OAI/Probability/SpanningForest/CanonicalBrownianReference.lean new file mode 100644 index 0000000000000000000000000000000000000000..3186f546ad315a8c9174802b2b63aa68315620b1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalBrownianReference.lean @@ -0,0 +1,138 @@ +import OAI.Probability.SpanningForest.GlobalWiener +import OAI.Probability.SpanningForest.BrownianReference +import OAI.Probability.SpanningForest.BrownianCanonicalPosterior + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal Topology + +namespace Problem336.CanonicalBrownianReference + +local instance : MeasurableSpace GlobalWiener.Path := borel _ +local instance : BorelSpace GlobalWiener.Path := ⟨rfl⟩ + +abbrev Space (I : Type*) := (I → Bool) × (I → GlobalWiener.Path) + +def noiseLaw (I : Type*) : Measure (I → GlobalWiener.Path) := + Measure.infinitePi (fun _ : I => GlobalWiener.wienerMeasure) + +instance noiseLaw_probability (I : Type*) : IsProbabilityMeasure (noiseLaw I) := by + unfold noiseLaw + infer_instance + +def law {I : Type*} (μ : ProbabilityMeasure (I → Bool)) : Measure (Space I) := + BrownianReference.coupling (μ : Measure (I → Bool)) GlobalWiener.wienerMeasure + +instance law_probability {I : Type*} (μ : ProbabilityMeasure (I → Bool)) : + IsProbabilityMeasure (law μ) := by + unfold law + infer_instance + +def hidden {I : Type*} (q : Space I) : I → Bool := q.1 + +def noise {I : Type*} (i : I) (t : ℝ≥0) (q : Space I) : ℝ := q.2 i t + +def observation {I : Type*} (t : ℝ≥0) (q : Space I) (i : I) : ℝ := + (t : ℝ) * TiltLimit.bit (hidden q i) + noise i t q + +variable {I : Type*} (μ : ProbabilityMeasure (I → Bool)) + +theorem hidden_measurable : Measurable (hidden (I := I)) := measurable_fst + +theorem hidden_hasLaw : HasLaw hidden (μ : Measure (I → Bool)) (law μ) := + BrownianReference.hidden_hasLaw (μ : Measure (I → Bool)) GlobalWiener.wienerMeasure + +theorem paths_hasLaw : + HasLaw (fun q : Space I => q.2) (noiseLaw I) (law μ) := + measurePreserving_snd.hasLaw + +theorem raw_noise_hasLaw : + HasLaw (fun (q : Space I) i t => noise i t q) + ((noiseLaw I).map (fun (w : I → GlobalWiener.Path) i t => w i t)) (law μ) := by + have hm : Measurable (fun (w : I → GlobalWiener.Path) i t => w i t) := + Measurable.of_eval (fun i => Measurable.of_eval (fun t => + (continuous_eval_const t).measurable.comp (measurable_pi_apply i))) + exact (show HasLaw (fun (w : I → GlobalWiener.Path) i t => w i t) + ((noiseLaw I).map (fun (w : I → GlobalWiener.Path) i t => w i t)) + (noiseLaw I) from ⟨hm.aemeasurable, rfl⟩).comp (paths_hasLaw μ) + +theorem noise_measurable (i : I) (t : ℝ≥0) : Measurable (noise i t) := + (continuous_eval_const t).measurable.comp ((measurable_pi_apply i).comp measurable_snd) + +theorem noise_jointlyMeasurable (i : I) : + Measurable (fun p : ℝ≥0 × Space I => noise i p.1 p.2) := by + exact continuous_eval.measurable.comp + (((measurable_pi_apply i).comp measurable_snd.snd).prodMk measurable_fst) + +theorem noise_continuous (q : Space I) (i : I) : + Continuous (fun t => noise i t q) := (q.2 i).continuous + +theorem noise_brownian (i : I) : IsBrownianReal (noise i) (law μ) := + BrownianReference.brownian_process (μ : Measure (I → Bool)) + GlobalWiener.wienerMeasure GlobalWiener.isBrownian_wienerMeasure i + +theorem noise_independent : + iIndepFun (fun i (q : Space I) t => noise i t q) (law μ) := + BrownianReference.independent_processes (μ : Measure (I → Bool)) + GlobalWiener.wienerMeasure (fun t w => w t) + (fun t => (continuous_eval_const t).measurable) + +theorem hidden_independent_flat_noise : + IndepFun hidden (fun (q : Space I) (p : I × ℝ≥0) => noise p.1 p.2 q) (law μ) := + BrownianReference.hidden_independent_field (μ : Measure (I → Bool)) + GlobalWiener.wienerMeasure (fun t w => w t) + (fun t => (continuous_eval_const t).measurable) + +theorem hidden_independent_noise : + IndepFun hidden (fun (q : Space I) i t => noise i t q) (law μ) := by + exact (hidden_independent_flat_noise μ).comp measurable_id + (show Measurable (fun f : I × ℝ≥0 → ℝ => fun i t => f (i, t)) by fun_prop) + +theorem bit_hidden_measurable : + Measurable (fun q : Space I => fun i => TiltLimit.bit (hidden q i)) := by + apply Measurable.of_eval + intro i + exact TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply i).comp measurable_fst) + +theorem bit_hidden_independent_noise : + IndepFun (fun q : Space I => fun i => TiltLimit.bit (hidden q i)) + (fun (q : Space I) i t => noise i t q) (law μ) := by + exact (hidden_independent_noise μ).comp + (Measurable.of_eval (fun i => TiltLimit.continuous_bit.measurable.comp + (measurable_pi_apply i))) measurable_id + +theorem bit_hidden_mem_Icc (q : Space I) (i : I) : + TiltLimit.bit (hidden q i) ∈ Set.Icc (0 : ℝ) 1 := by + cases hidden q i <;> norm_num [TiltLimit.bit] + +theorem observation_continuous (q : Space I) (i : I) : + Continuous (fun t => observation t q i) := + (continuous_subtype_val.mul continuous_const).add (noise_continuous q i) + +theorem observation_jointlyMeasurable : + Measurable (fun p : ℝ≥0 × Space I => observation p.1 p.2) := by + apply Measurable.of_eval + intro i + exact ((measurable_subtype_coe.comp measurable_fst).mul + (TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply i).comp measurable_snd.fst))).add (noise_jointlyMeasurable i) + +theorem posterior [Countable I] + (S : I → ℕ → Finset I) (e : I) + (hS : Monotone (S e)) (hcover : ∀ i, ∃ n, i ∈ S e n) (t : ℝ≥0) : + (fun q : Space I => PosteriorDrift.drift μ S t (observation t q) e) =ᵐ[law μ] + (law μ)[fun q => TiltLimit.bit (hidden q e) | + Observation.historySigma (fun i (s : Set.Iic t) q => observation s q i)] := by + exact Observation.drift_eq_condExp_brownian_history_all_times + (law μ) μ hidden hidden_measurable (hidden_hasLaw μ).map_eq noise + (fun i => (noise_brownian μ i).toIsPreBrownianReal) (noise_independent μ) + noise_measurable (hidden_independent_flat_noise μ) S e hS hcover t + +end Problem336.CanonicalBrownianReference + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalBrownianSampler.lean b/lean/OAI/Probability/SpanningForest/CanonicalBrownianSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..98175d74c995f3bd8d0d3a3bf1b5879b209fed75 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalBrownianSampler.lean @@ -0,0 +1,112 @@ +import OAI.Probability.SpanningForest.CanonicalBrownianReference +import OAI.Probability.SpanningForest.CanonicalPosteriorMartingale +import OAI.Probability.SpanningForest.InnovationProcessLaw +import OAI.Probability.SpanningForest.RawInnovationSampler + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal Topology + +namespace Problem336.CanonicalBrownianSampler + +local instance : MeasurableSpace GlobalWiener.Path := borel _ +local instance : BorelSpace GlobalWiener.Path := ⟨rfl⟩ + +open CanonicalBrownianReference + +variable {I : Type*} [countableIndices : Countable I] + +def signal (q : Space I) (i : I) : ℝ := TiltLimit.bit (CanonicalBrownianReference.hidden q i) + +def driftField (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (i : I) (s : ℝ) (q : Space I) : ℝ := + PosteriorDrift.drift μ S s (CanonicalBrownianReference.observation s.toNNReal q) i + +omit countableIndices in +theorem observation_measurable [Countable I] (t : ℝ≥0) (i : I) : + Measurable (fun q : Space I => CanonicalBrownianReference.observation t q i) := + (measurable_pi_apply i).comp (observation_jointlyMeasurable.comp + (measurable_const.prodMk measurable_id)) + +def filtration : Filtration ℝ≥0 (inferInstance : MeasurableSpace (Space I)) := + Innovation.observationHistoryFiltration CanonicalBrownianReference.observation observation_measurable + +omit countableIndices in +theorem measurable_driftField [Countable I] (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) (i : I) : + Measurable (Function.uncurry (driftField μ S i)) := by + have hf : Measurable (fun p : ℝ × Space I => CanonicalBrownianReference.observation p.1.toNNReal p.2) := + observation_jointlyMeasurable.comp + ((continuous_real_toNNReal.measurable.comp measurable_fst).prodMk measurable_snd) + change Measurable (fun p : ℝ × Space I => + PosteriorDrift.drift μ S p.1 (CanonicalBrownianReference.observation p.1.toNNReal p.2) i) + let f : ℝ × Space I → ℝ × (I → ℝ) := fun p => + (p.1, CanonicalBrownianReference.observation p.1.toNNReal p.2) + have hm : Measurable f := measurable_fst.prodMk hf + exact (PosteriorDrift.measurable_drift_coordinate μ S i).comp (f := f) hm + +theorem martingale_innovation (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) (i : I) + (hS : Monotone (S i)) (hcover : ∀ j, ∃ n, j ∈ S i n) : + Martingale (Innovation.nnInnovation (fun q : Space I => signal q i) + (CanonicalBrownianReference.noise i) (driftField μ S i)) filtration (law μ) := by + exact CanonicalPosteriorMartingale.martingale_nnInnovation (law μ) μ CanonicalBrownianReference.hidden + hidden_measurable (hidden_hasLaw μ).map_eq CanonicalBrownianReference.noise + (fun i => (noise_brownian μ i).toIsPreBrownianReal) noise_measurable + noise_continuous (noise_independent μ) (hidden_independent_flat_noise μ) + S i hS hcover + +theorem raw_innovation_identDistrib (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) + (hS : ∀ i, Monotone (S i)) (hcover : ∀ i j, ∃ n, j ∈ S i n) : + IdentDistrib + (fun q i t => Innovation.nnInnovation (fun q : Space I => signal q i) + (CanonicalBrownianReference.noise i) (driftField μ S i) t q) + (fun (q : Space I) i t => CanonicalBrownianReference.noise i t q) (law μ) (law μ) := by + apply InnovationProcessLaw.identDistrib_nnInnovation (law μ) filtration signal CanonicalBrownianReference.noise + (driftField μ S) + · exact fun i => (noise_brownian μ i).toIsPreBrownianReal + · exact noise_measurable + · exact noise_independent μ + · exact bit_hidden_measurable + · exact bit_hidden_independent_noise μ + · exact measurable_driftField μ S + · exact bit_hidden_mem_Icc + · exact fun i s q => PosteriorDrift.drift_mem_Icc μ S s _ i + · exact fun i => martingale_innovation μ S i (hS i) (hcover i) + · intro u + exact le_rfl + +theorem raw_innovation_hasLaw (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) + (hS : ∀ i, Monotone (S i)) (hcover : ∀ i j, ∃ n, j ∈ S i n) : + HasLaw (RawInnovationSampler.rawInnovation CanonicalBrownianReference.hidden CanonicalBrownianReference.noise (PosteriorDrift.drift μ S)) + ((noiseLaw I).map ContinuousPathLaw.raw) (law μ) := by + have hd := raw_innovation_identDistrib μ S hS hcover + exact ⟨hd.aemeasurable_fst, hd.map_eq.trans (raw_noise_hasLaw μ).map_eq⟩ + +theorem hasLaw_sample + (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (hS : ∀ e, Monotone (S e)) (hcover : ∀ e i, ∃ n, i ∈ S e n) + {L : ℝ} (hL : 0 ≤ L) (hresponse : PosteriorDrift.FiniteResponseBound μ S L) : + HasLaw (PicardSampler.NonnegativeTime.sample ContinuousPathLaw.raw + (PosteriorDrift.drift μ S)) (μ : Measure (I → Bool)) (noiseLaw I) := by + have hfresh : HasLaw (id : (I → GlobalWiener.Path) → I → GlobalWiener.Path) + (noiseLaw I) (noiseLaw I) := ⟨measurable_id.aemeasurable, Measure.map_id⟩ + exact RawInnovationSampler.hasLaw_of_raw_innovation (hidden_hasLaw μ) + (noise_brownian μ) (PosteriorDrift.drift μ S) + (PosteriorDrift.measurable_drift_coordinate μ S) + (fun t y i => by + have h := PosteriorDrift.drift_mem_Icc μ S t y i + rw [abs_of_nonneg h.1] + exact h.2) hL + (fun t y z D hD hdiff i => PosteriorDrift.drift_response μ S hresponse + t y z hD hdiff i) (raw_innovation_hasLaw μ S hS hcover) hfresh + +end Problem336.CanonicalBrownianSampler + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalDecoder.lean b/lean/OAI/Probability/SpanningForest/CanonicalDecoder.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d07d8e037bff7564a07be46f00cb542d82f2c09 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalDecoder.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SpanningForest.CanonicalDrift +import OAI.Probability.SpanningForest.PicardSolution + +namespace OAI + +noncomputable section + +open Filter MeasureTheory Set +open scoped Topology + +namespace Problem336.CanonicalDecoder + +variable {α ι : Type*} + +def drift (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (a : α) (t : ℝ) (y : ι → ℝ) (i : ι) : ℝ := + CanonicalDrift.outerLimit (fun n (p : ℝ × (ι → ℝ)) => f n a p.1 p.2 i) (t, y) + +lemma measurable_drift [MeasurableSpace α] + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (hf : ∀ n i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => f n p.1 p.2.1 p.2.2 i)) (i : ι) : + Measurable (fun p : α × (ℝ × (ι → ℝ)) => drift f p.1 p.2.1 p.2.2 i) := by + exact Measurable.limsup (fun n => hf n i) + +lemma drift_mem_Icc + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (hf : ∀ n a t y i, f n a t y i ∈ Icc (0 : ℝ) 1) + (a : α) (t : ℝ) (y : ι → ℝ) (i : ι) : + drift f a t y i ∈ Icc (0 : ℝ) 1 := by + unfold drift + exact CanonicalDrift.outerLimit_mem_Icc + (b := fun n (p : ℝ × (ι → ℝ)) => f n a p.1 p.2 i) + (fun n p => hf n a p.1 p.2 i) (t, y) + +lemma abs_drift_le_one + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (hf : ∀ n a t y i, f n a t y i ∈ Icc (0 : ℝ) 1) + (a : α) (t : ℝ) (y : ι → ℝ) (i : ι) : + |drift f a t y i| ≤ 1 := by + have h := drift_mem_Icc f hf a t y i + simpa only [abs_of_nonneg h.1] using h.2 + +lemma drift_response + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (hf : ∀ n a t y i, f n a t y i ∈ Icc (0 : ℝ) 1) + {L : ℝ} + (hresponse : ∀ n a t y y' D, 0 ≤ D → + (∀ j, |y j - y' j| ≤ D) → ∀ i, + |f n a t y i - f n a t y' i| ≤ L * D) + (a : α) (t : ℝ) (y y' : ι → ℝ) (D : ℝ) (hD : 0 ≤ D) + (hyy' : ∀ j, |y j - y' j| ≤ D) (i : ι) : + |drift f a t y i - drift f a t y' i| ≤ L * D := by + unfold drift + exact CanonicalDrift.abs_outerLimit_sub_le + (b := fun n (p : ℝ × (ι → ℝ)) => f n a p.1 p.2 i) + (lo := 0) (hi := 1) (x := (t, y)) (y := (t, y')) + (fun n p => hf n a p.1 p.2 i) + (fun n => hresponse n a t y y' D hD hyy' i) + +lemma drift_relabel + {β κ : Type*} (e : ι ≃ κ) (a : α) (a' : β) + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (g : ℕ → β → ℝ → (κ → ℝ) → κ → ℝ) + (hfg : ∀ n t y i, g n a' t (fun k => y (e.symm k)) (e i) = f n a t y i) + (t : ℝ) (y : ι → ℝ) (i : ι) : + drift g a' t (fun k => y (e.symm k)) (e i) = drift f a t y i := by + exact Filter.limsup_congr (Filter.Eventually.of_forall (fun n => hfg n t y i)) + +lemma measurable_decode [MeasurableSpace α] + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) (w : α → ι → ℝ → ℝ) + (hf : ∀ n i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => f n p.1 p.2.1 p.2.2 i)) + (hw : ∀ i, Measurable (fun p : α × ℝ => w p.1 i p.2)) (i : ι) : + Measurable (fun p : α × ℝ => Picard.decode (w p.1) (drift f p.1) i p.2) := + Picard.measurable_decode w (drift f) hw (measurable_drift f hf) i + +lemma decode_integral_equation [MeasurableSpace α] + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (hf : ∀ n i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => f n p.1 p.2.1 p.2.2 i)) + (hbound : ∀ n a t y i, f n a t y i ∈ Icc (0 : ℝ) 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ n a t y y' D, 0 ≤ D → + (∀ j, |y j - y' j| ≤ D) → ∀ i, + |f n a t y i - f n a t y' i| ≤ L * D) + (a : α) (w : ι → ℝ → ℝ) (hw : ∀ i, Continuous (w i)) + (i : ι) {t : ℝ} (ht : 0 ≤ t) : + Picard.decode w (drift f a) i t = w i t + + ∫ s in (0 : ℝ)..t, drift f a s (fun j => Picard.decode w (drift f a) j s) i := by + have hp : Measurable (fun p : ℝ × (ι → ℝ) => (a, p)) := + measurable_const.prodMk measurable_id + have hm : ∀ j, Measurable (fun p : ℝ × (ι → ℝ) => drift f a p.1 p.2 j) := by + intro j + change Measurable (fun p : ℝ × (ι → ℝ) => + Filter.limsup (fun n => f n a p.1 p.2 j) atTop) + apply Measurable.limsup + intro n + exact (hf n j).comp hp + exact Picard.decode_integral_equation w (drift f a) hw hm + (abs_drift_le_one f hbound a) hL (drift_response f hbound hresponse a) i ht + +lemma decode_relabel + {β κ : Type*} (e : ι ≃ κ) (a : α) (a' : β) + (f : ℕ → α → ℝ → (ι → ℝ) → ι → ℝ) + (g : ℕ → β → ℝ → (κ → ℝ) → κ → ℝ) + (hfg : ∀ n t y i, g n a' t (fun k => y (e.symm k)) (e i) = f n a t y i) + (w : ι → ℝ → ℝ) (w' : κ → ℝ → ℝ) + (hw : ∀ i t, w' (e i) t = w i t) (i : ι) (t : ℝ) : + Picard.decode w' (drift g a') (e i) t = Picard.decode w (drift f a) i t := by + exact Picard.decode_relabel e w w' (drift f a) (drift g a') hw + (fun s y j => drift_relabel e a a' f g hfg s y j) i t + +end Problem336.CanonicalDecoder + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalDrift.lean b/lean/OAI/Probability/SpanningForest/CanonicalDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..b45b19c93625196e4758a08dfb2c05cc8dfa07aa --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalDrift.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter MeasureTheory +open scoped Topology + +namespace Problem336 +namespace CanonicalDrift + +def outerLimit {X : Type*} (b : ℕ → X → ℝ) (x : X) : ℝ := + Filter.limsup (fun n => b n x) Filter.atTop + +theorem measurable_outerLimit {X : Type*} [MeasurableSpace X] + {b : ℕ → X → ℝ} (hb : ∀ n, Measurable (b n)) : + Measurable (outerLimit b) := + Measurable.limsup hb + +theorem outerLimit_mem_Icc {X : Type*} {b : ℕ → X → ℝ} + {a c : ℝ} (hb : ∀ n x, b n x ∈ Set.Icc a c) (x : X) : + outerLimit b x ∈ Set.Icc a c := by + have hu : atTop.IsBoundedUnder (· ≤ ·) (fun n => b n x) := + isBoundedUnder_of ⟨c, fun n => (hb n x).2⟩ + have hl : atTop.IsCoboundedUnder (· ≤ ·) (fun n => b n x) := + isCoboundedUnder_le_of_le atTop fun n => (hb n x).1 + constructor + · exact le_limsup_of_frequently_le + (Eventually.of_forall fun n => (hb n x).1).frequently hu + · exact limsup_le_of_le hl (Eventually.of_forall fun n => (hb n x).2) + +theorem outerLimit_le_add {X Y : Type*} + {b : ℕ → X → ℝ} {c : ℕ → Y → ℝ} + {lo hi : ℝ} (hb : ∀ n x, lo ≤ b n x) + (hc : ∀ n y, c n y ∈ Set.Icc lo hi) + {x : X} {y : Y} {d : ℝ} (hbc : ∀ n, b n x ≤ c n y + d) : + outerLimit b x ≤ outerLimit c y + d := by + have hbl : atTop.IsCoboundedUnder (· ≤ ·) (fun n => b n x) := + isCoboundedUnder_le_of_le atTop fun n => hb n x + have hcu : atTop.IsBoundedUnder (· ≤ ·) (fun n => c n y) := + isBoundedUnder_of ⟨hi, fun n => (hc n y).2⟩ + have hcl : atTop.IsCoboundedUnder (· ≤ ·) (fun n => c n y) := + isCoboundedUnder_le_of_le atTop fun n => (hc n y).1 + have hcdu : atTop.IsBoundedUnder (· ≤ ·) (fun n => c n y + d) := + isBoundedUnder_of ⟨hi + d, fun n => add_le_add (hc n y).2 le_rfl⟩ + exact (limsup_le_limsup (Eventually.of_forall hbc) hbl hcdu).trans_eq + (limsup_add_const atTop (fun n => c n y) d hcu hcl) + +theorem abs_outerLimit_sub_le {X : Type*} {b : ℕ → X → ℝ} + {lo hi : ℝ} (hb : ∀ n x, b n x ∈ Set.Icc lo hi) + {x y : X} {d : ℝ} (hxy : ∀ n, |b n x - b n y| ≤ d) : + |outerLimit b x - outerLimit b y| ≤ d := by + apply abs_le.mpr + constructor + · have h := outerLimit_le_add (fun n x => (hb n x).1) hb + (x := y) (y := x) (d := d) (fun n => by + have h := (abs_le.mp (hxy n)).1 + linarith) + linarith + · have h := outerLimit_le_add (fun n x => (hb n x).1) hb + (x := x) (y := y) (d := d) (fun n => by + have h := (abs_le.mp (hxy n)).2 + linarith) + linarith + +theorem outerLimit_transport {X Y : Type*} + {b : ℕ → X → ℝ} {c : ℕ → Y → ℝ} (f : X → Y) + (h : ∀ n x, c n (f x) = b n x) (x : X) : + outerLimit c (f x) = outerLimit b x := by + exact limsup_congr (Eventually.of_forall fun n => h n x) + +theorem outerLimit_eq_of_tendsto {X : Type*} {b : ℕ → X → ℝ} + {x : X} {a : ℝ} (h : Tendsto (fun n => b n x) atTop (nhds a)) : + outerLimit b x = a := + h.limsup_eq + +end CanonicalDrift +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalFUSFLaw.lean b/lean/OAI/Probability/SpanningForest/CanonicalFUSFLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..17bc686f3e7d8d2864e11b18135b8c9f92cdbffb --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalFUSFLaw.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SpanningForest.GraphFUSFLaw +import OAI.Probability.SpanningForest.EquivariantFUSFKernel + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336.CanonicalFUSFLaw + +theorem exists_kernel : + ∃ μ : GraphCode → ProbabilityMeasure EdgeConfiguration, + Measurable μ ∧ + (∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G (μ G : Measure EdgeConfiguration) id) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode), + (μ G : Measure EdgeConfiguration).map (configurationRelabel σ) = + (μ (relabelGraph σ G) : Measure EdgeConfiguration)) := + BorelFUSFKernel.exists_measurable_equivariant_fusf_kernel + Problem336.exists_hasFUSFLaw + +def probability (G : GraphCode) : ProbabilityMeasure EdgeConfiguration := + Classical.choose exists_kernel G + +theorem measurable_probability : Measurable probability := + (Classical.choose_spec exists_kernel).1 + +theorem hasFUSFLaw (G : GraphCode) (hC : GraphConnected G) + (hL : GraphLocallyFinite G) : + HasFUSFLaw G (probability G : Measure EdgeConfiguration) id := + (Classical.choose_spec exists_kernel).2.1 G hC hL + +theorem map_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) : + (probability G : Measure EdgeConfiguration).map (configurationRelabel σ) = + (probability (relabelGraph σ G) : Measure EdgeConfiguration) := + (Classical.choose_spec exists_kernel).2.2 σ G + +def measure (G : GraphCode) : Measure EdgeConfiguration := probability G + +instance (G : GraphCode) : IsProbabilityMeasure (measure G) := by + unfold measure + infer_instance + +theorem hasLaw_of_hasFUSFLaw + {Ω : Type} [MeasurableSpace Ω] {P : Measure Ω} + {G : GraphCode} (hC : GraphConnected G) (hL : GraphLocallyFinite G) + {X : Ω → EdgeConfiguration} (hX : HasFUSFLaw G P X) : + ProbabilityTheory.HasLaw X (measure G) P := by + obtain ⟨H, hH⟩ := Problem336.exists_connectedExhaustion G hC hL + refine ⟨(Measurable.of_eval hX.1).aemeasurable, ?_⟩ + have h := (hasFUSFLaw G hC hL).map_eq hX hH + simpa only [Measure.map_id, measure] using h.symm + +theorem isProbabilityMeasure_of_hasFUSFLaw + {Ω : Type} [MeasurableSpace Ω] {P : Measure Ω} + {G : GraphCode} (hC : GraphConnected G) (hL : GraphLocallyFinite G) + {X : Ω → EdgeConfiguration} (hX : HasFUSFLaw G P X) : + IsProbabilityMeasure P := + (hasLaw_of_hasFUSFLaw hC hL hX).isProbabilityMeasure + +end Problem336.CanonicalFUSFLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalIID.lean b/lean/OAI/Probability/SpanningForest/CanonicalIID.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0c7d92b156b4c476bbf942486b0375c31d15f4a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalIID.lean @@ -0,0 +1,89 @@ +import OAI.Probability.SpanningForest.LabelNoCollision +import OAI.Probability.SpanningForest.UniformSampler + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped unitInterval + +namespace Problem336.CanonicalIID + +private theorem uniform_probability : IsProbabilityMeasure uniform01 := by + rw [uniform01_eq_map_unitInterval] + exact inferInstance + +local instance : IsProbabilityMeasure uniform01 := uniform_probability + +private theorem labels_probability : IsProbabilityMeasure privatePoolLaw := by + unfold privatePoolLaw + infer_instance + +local instance : IsProbabilityMeasure privatePoolLaw := labels_probability + +theorem map_labels {Ω : Type} [MeasurableSpace Ω] {P : Measure Ω} + {U : ℕ → Ω → ℝ} (h : IsVertexIID P U) : + P.map (fun ω i => U i ω) = privatePoolLaw := by + rw [iIndepFun.map_fun_eq_infinitePi_map h.1 (LabelNoCollision.independent h)] + simp only [LabelNoCollision.map_marginal h] + rfl + +theorem canonical_isVertexIID : + IsVertexIID privatePoolLaw (fun i U => U i) := by + constructor + · intro i + exact measurable_pi_apply i + · intro s A hA + have hInd : iIndepFun (fun (i : ℕ) (U : ℕ → ℝ) => U i) privatePoolLaw := + iIndepFun_infinitePi (P := fun _ : ℕ => uniform01) (X := fun _ x => x) + (fun _ => measurable_id) + calc + privatePoolLaw {U | ∀ i ∈ s, U i ∈ A i} = + privatePoolLaw (⋂ i ∈ s, (fun U : ℕ → ℝ => U i) ⁻¹' A i) := by + congr 1 + ext U + simp + _ = ∏ i ∈ s, privatePoolLaw ((fun U : ℕ → ℝ => U i) ⁻¹' A i) := + hInd.measure_inter_preimage_eq_mul s hA + _ = ∏ i ∈ s, uniform01 (A i) := by + apply Finset.prod_congr rfl + intro i hi + have hm : privatePoolLaw.map (fun U : ℕ → ℝ => U i) = uniform01 := + Measure.infinitePi_map_eval (fun _ : ℕ => uniform01) i + have heq := congrArg (fun μ : Measure ℝ => μ (A i)) hm + rwa [Measure.map_apply (measurable_pi_apply i) (hA i hi)] at heq + +theorem transfer_hasFUSFLaw {Ω : Type} [MeasurableSpace Ω] + {G : GraphCode} {P : Measure Ω} {U : ℕ → Ω → ℝ} + {X : (ℕ → ℝ) → EdgeConfiguration} (hU : IsVertexIID P U) + (hX : HasFUSFLaw G privatePoolLaw X) : + HasFUSFLaw G P (fun ω => X (fun i => U i ω)) := by + have hlabels : Measurable (fun ω i => U i ω) := Measurable.of_eval hU.1 + constructor + · intro e + exact (hX.1 e).comp hlabels + · intro H hH A B + have hE : MeasurableSet {l : ℕ → ℝ | + (∀ e ∈ A, X l e = true) ∧ (∀ e ∈ B, X l e = false)} := by + exact ((Measurable.forall (fun e => measurable_const.imp ((hX.1 e).eq_const true))).and + (Measurable.forall (fun e => measurable_const.imp ((hX.1 e).eq_const false)))).setOf + have heq := congrArg (fun μ : Measure (ℕ → ℝ) => μ {l | + (∀ e ∈ A, X l e = true) ∧ (∀ e ∈ B, X l e = false)}) (map_labels hU) + rw [Measure.map_apply hlabels hE] at heq + exact heq ▸ hX.2 H hH A B + +theorem worksOnGraph_iff_canonical (Phi : FactorRule) (G : GraphCode) : + WorksOnGraph Phi G ↔ + (GraphConnected G → GraphLocallyFinite G → HasFUSFLaw G privatePoolLaw (Phi G)) := by + constructor + · intro h hconn hfin + exact h hconn hfin (ℕ → ℝ) privatePoolLaw (fun i U => U i) canonical_isVertexIID + · intro h hconn hfin Ω _ P U hU + exact transfer_hasFUSFLaw hU (h hconn hfin) + +end Problem336.CanonicalIID + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalPosteriorIdentification.lean b/lean/OAI/Probability/SpanningForest/CanonicalPosteriorIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8fe962a86a0256532f60ba03b507b130d9598b2 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalPosteriorIdentification.lean @@ -0,0 +1,69 @@ +import OAI.Probability.SpanningForest.ObservationPosterior +import OAI.Probability.SpanningForest.PosteriorDrift + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped NNReal Topology + +namespace Problem336.Observation + +abbrev historySigma {Ω I T : Type*} (Y : I → T → Ω → ℝ) : MeasurableSpace Ω := + MeasurableSpace.comap (fun ω (p : I × T) => Y p.1 p.2 ω) inferInstance + +theorem historySigma_eq_iSup {Ω I T : Type*} (Y : I → T → Ω → ℝ) : + historySigma Y = + ⨆ i, MeasurableSpace.comap (fun ω s => Y i s ω) inferInstance := by + simp only [historySigma, MeasurableSpace.comap_process_pi, iSup_prod] + +theorem historySigma_finset_eq {Ω I T : Type*} (Y : I → T → Ω → ℝ) + (S : Finset I) : + historySigma (fun (i : S) s ω => Y i s ω) = + ⨆ i ∈ S, MeasurableSpace.comap (fun ω s => Y i s ω) inferInstance := by + rw [historySigma_eq_iSup] + simp only [iSup_subtype] + +theorem historySigma_le {Ω I T : Type*} [mΩ : MeasurableSpace Ω] + (Y : I → T → Ω → ℝ) (hY : ∀ i s, Measurable (Y i s)) : + historySigma Y ≤ mΩ := + (Measurable.of_eval (f := fun ω (p : I × T) => Y p.1 p.2 ω) + (fun p => hY p.1 p.2)).comap_le + +theorem drift_eq_condExp_of_finite_history + {Ω I : Type*} [mΩ : MeasurableSpace Ω] [Countable I] + (P : Measure Ω) [IsFiniteMeasure P] (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) (e : I) + (hS : Monotone (S e)) (hcover : ∀ i, ∃ n, i ∈ S e n) + (Y : I → ℝ≥0 → Ω → ℝ) (hY : ∀ i s, Measurable (Y i s)) + (X : Ω → ℝ) (t : ℝ≥0) + (hfinite : ∀ n, + (fun ω => TiltLimit.finiteTiltMean μ (S e n) + (fun i => Y i t ω - (t : ℝ) / 2) e) =ᵐ[P] + P[X | historySigma (fun (i : S e n) (s : Set.Iic t) ω => Y i s ω)]) : + (fun ω => PosteriorDrift.drift μ S (t : ℝ) (fun i => Y i t ω) e) =ᵐ[P] + P[X | historySigma (fun i (s : Set.Iic t) ω => Y i s ω)] := by + let coordinate : I → MeasurableSpace Ω := fun i => + MeasurableSpace.comap (fun ω (s : Set.Iic t) => Y i s ω) inferInstance + have hcoordinate : ∀ i, coordinate i ≤ mΩ := fun i => + (Measurable.of_eval (f := fun ω (s : Set.Iic t) => Y i s ω) + (fun s => hY i s)).comap_le + have hfinite' : ∀ n, + (fun ω => TiltLimit.finiteTiltMean μ (S e n) + (fun i => Y i t ω - (t : ℝ) / 2) e) =ᵐ[P] + P[X | ⨆ i ∈ S e n, coordinate i] := by + intro n + have hn := hfinite n + rw [historySigma_finset_eq (fun i (s : Set.Iic t) ω => Y i s ω) (S e n)] at hn + exact hn + have h := limsup_posterior_all_coordinates P coordinate hcoordinate (S e) + hS hcover X _ hfinite' + simpa only [PosteriorDrift.drift, CanonicalDrift.outerLimit, + PosteriorDrift.finiteStage, historySigma_eq_iSup] using h + +end Problem336.Observation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CanonicalPosteriorMartingale.lean b/lean/OAI/Probability/SpanningForest/CanonicalPosteriorMartingale.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3d4ccd9c14350e36ca00c486468a1afa8a3cbfe --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CanonicalPosteriorMartingale.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SpanningForest.BrownianCanonicalPosterior +import OAI.Probability.SpanningForest.ObservedBrownianMartingale + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.CanonicalPosteriorMartingale + +def observation {I Ω : Type*} (X : Ω → I → Bool) + (B : I → ℝ≥0 → Ω → ℝ) (t : ℝ≥0) (ω : Ω) (i : I) : ℝ := + (t : ℝ) * TiltLimit.bit (X ω i) + B i t ω + +lemma measurable_observation {I Ω : Type*} [MeasurableSpace Ω] + (X : Ω → I → Bool) (hX : Measurable X) (B : I → ℝ≥0 → Ω → ℝ) + (hBm : ∀ i t, Measurable (B i t)) (t : ℝ≥0) (i : I) : + Measurable (fun ω => observation X B t ω i) := + ((TiltLimit.continuous_bit.measurable.comp + ((measurable_pi_apply i).comp hX)).const_mul _).add (hBm i t) + +theorem martingale_nnInnovation + {I Ω : Type*} [Countable I] [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] + (μ : ProbabilityMeasure (I → Bool)) + (X : Ω → I → Bool) (hX : Measurable X) + (hprior : P.map X = (μ : Measure (I → Bool))) + (B : I → ℝ≥0 → Ω → ℝ) + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hBcont : ∀ ω i, Continuous (fun t => B i t ω)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + (hXB : IndepFun X (fun ω (p : I × ℝ≥0) => B p.1 p.2 ω) P) + (S : I → ℕ → Finset I) (e : I) + (hS : Monotone (S e)) (hcover : ∀ i, ∃ n, i ∈ S e n) : + Martingale (Innovation.nnInnovation (fun ω => TiltLimit.bit (X ω e)) (B e) + (fun s ω => PosteriorDrift.drift μ S s + (observation X B s.toNNReal ω) e)) + (Innovation.observationHistoryFiltration (observation X B) + (measurable_observation X hX B hBm)) P := by + let R : (I → Bool) → I → ℝ := fun x i => TiltLimit.bit (x i) + have hR : Measurable R := Measurable.of_eval (fun i => + TiltLimit.continuous_bit.measurable.comp (measurable_pi_apply i)) + have hXI : IndepFun (R ∘ X) (fun ω i t => B i t ω) P := + hXB.comp hR (Measurable.of_eval (fun i => + Measurable.of_eval (fun t => measurable_pi_apply (i, t)))) + have hYcont : ∀ ω i, Continuous (fun t => observation X B t ω i) := by + intro ω i + exact (continuous_subtype_val.mul continuous_const).add (hBcont ω i) + have hbound : ∀ t y, + ‖PosteriorDrift.drift μ S (t : ℝ≥0) y e‖ ≤ (1 : ℝ) := by + intro t y + have h := PosteriorDrift.drift_mem_Icc μ S t y e + rw [Real.norm_eq_abs, abs_of_nonneg h.1] + exact h.2 + have hb : Measurable (Function.uncurry + (fun (t : ℝ≥0) y => PosteriorDrift.drift μ S t y e)) := by + let f : ℝ≥0 × (I → ℝ) → ℝ × (I → ℝ) := + fun p => ((p.1 : ℝ), p.2) + have hf : Measurable f := + (measurable_subtype_coe.comp measurable_fst).prodMk measurable_snd + exact (PosteriorDrift.measurable_drift_coordinate μ S e).comp (f := f) hf + have hM := Innovation.martingale_nnInnovation_of_brownian_family P + (observation X B) (measurable_observation X hX B hBm) hYcont + B hB hBm hI (R ∘ X) (hR.comp hX) hXI (fun _ _ _ => rfl) e + (fun ω => by cases h : X ω e <;> simp [R, TiltLimit.bit, h]) + (fun t y => PosteriorDrift.drift μ S t y e) hb hbound + (fun t => Observation.drift_eq_condExp_brownian_history_all_times + P μ X hX hprior B hB hI hBm hXB S e hS hcover t) + have heq : Innovation.nnInnovation (fun ω => TiltLimit.bit (X ω e)) (B e) + (fun s ω => PosteriorDrift.drift μ S (s.toNNReal : ℝ) + (observation X B s.toNNReal ω) e) = + Innovation.nnInnovation (fun ω => TiltLimit.bit (X ω e)) (B e) + (fun s ω => PosteriorDrift.drift μ S s + (observation X B s.toNNReal ω) e) := by + funext t ω + simp only [Innovation.nnInnovation_apply] + congr 1 + apply intervalIntegral.integral_congr + intro s hs + have ht : (0 : ℝ) ≤ (t : ℝ) := t.2 + have hs0 : 0 ≤ s := by + simpa only [min_eq_left ht] using hs.1 + dsimp only + rw [Real.coe_toNNReal s hs0] + change Martingale (Innovation.nnInnovation (fun ω => TiltLimit.bit (X ω e)) (B e) + (fun s ω => PosteriorDrift.drift μ S (s.toNNReal : ℝ) + (observation X B s.toNNReal ω) e)) _ P at hM + rw [heq] at hM + exact hM + +end Problem336.CanonicalPosteriorMartingale + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CauchyBinet.lean b/lean/OAI/Probability/SpanningForest/CauchyBinet.lean new file mode 100644 index 0000000000000000000000000000000000000000..60378fa2afff7a2c40ec3dfb45b87eb43601a82b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CauchyBinet.lean @@ -0,0 +1,163 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Matrix Polynomial +open scoped BigOperators + +namespace Problem336.CauchyBinet + +variable {R m n : Type*} [CommRing R] +variable [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] + +theorem coeff_det_one_add_X_smul_card (M : Matrix n n R) : + (Matrix.det (1 + (X : R[X]) • M.map C)).coeff (Fintype.card n) = M.det := by + rw [Matrix.coeff_det_one_add_X_smul_eq_sum_minors] + have hsets : (Finset.univ : Finset n).powersetCard (Fintype.card n) = + {Finset.univ} := by + ext s + simp only [Finset.mem_powersetCard, Finset.subset_univ, true_and, + Finset.mem_singleton] + exact Finset.card_eq_iff_eq_univ s + rw [hsets, Finset.sum_singleton] + let e : (Finset.univ : Finset n) ≃ n := + { toFun := Subtype.val + invFun := fun i => ⟨i, Finset.mem_univ i⟩ + left_inv := fun _ => rfl + right_inv := fun _ => rfl } + exact Matrix.det_submatrix_equiv_self e M + +theorem det_one_add_X_mul_comm (A : Matrix n m R) (B : Matrix m n R) : + Matrix.det (1 + (X : R[X]) • (A * B).map C) = + Matrix.det (1 + (X : R[X]) • (B * A).map C) := by + simpa only [Matrix.smul_mul, Matrix.mul_smul, ← Matrix.map_mul] using + Matrix.det_one_add_mul_comm ((X : R[X]) • A.map C) (B.map C) + +theorem det_mul_eq_sum_principal_minors (A : Matrix n m R) (B : Matrix m n R) : + Matrix.det (A * B) = + ∑ s ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n), + Matrix.det ((B * A).submatrix (Subtype.val : s → m) (Subtype.val : s → m)) := by + rw [← coeff_det_one_add_X_smul_card (A * B), det_one_add_X_mul_comm A B, + Matrix.coeff_det_one_add_X_smul_eq_sum_minors] + +theorem det_mul_transpose_eq_sum_principal_minors (A : Matrix n m R) : + Matrix.det (A * A.transpose) = + ∑ s ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n), + Matrix.det ((A.transpose * A).submatrix + (Subtype.val : s → m) (Subtype.val : s → m)) := + det_mul_eq_sum_principal_minors A A.transpose + +abbrev ColumnSets (n m : Type*) [Fintype n] [Fintype m] := + ((Finset.univ : Finset m).powersetCard (Fintype.card n)) + +def columnIndexEquiv (s : ColumnSets n m) : (s.val : Finset m) ≃ n := + Fintype.equivOfCardEq (by + rw [Fintype.card_coe] + exact (Finset.mem_powersetCard.mp s.property).2) + +def columnMinor (A : Matrix n m R) (s : ColumnSets n m) : + Matrix (s.val : Finset m) (s.val : Finset m) R := + A.submatrix (columnIndexEquiv s) Subtype.val + +omit [DecidableEq m] [DecidableEq n] in +theorem columnMinor_map {S : Type*} [CommRing S] + (A : Matrix n m R) (f : R →+* S) (s : ColumnSets n m) : + columnMinor (A.map f) s = (columnMinor A s).map f := rfl + +omit [DecidableEq n] in +theorem columnMinor_map_det {S : Type*} [CommRing S] + (A : Matrix n m R) (f : R →+* S) (s : ColumnSets n m) : + (columnMinor (A.map f) s).det = f (columnMinor A s).det := by + rw [columnMinor_map] + exact (RingHom.map_det f (columnMinor A s)).symm + +theorem det_mul_eq_sum_minors (A : Matrix n m R) (B : Matrix m n R) : + Matrix.det (A * B) = + ∑ s : ColumnSets n m, + (columnMinor A s).det * + (B.submatrix Subtype.val (columnIndexEquiv s)).det := by + rw [det_mul_eq_sum_principal_minors, ← Finset.sum_coe_sort] + apply Finset.sum_congr rfl + intro s _ + rw [← Matrix.submatrix_mul_equiv B A Subtype.val (columnIndexEquiv s) Subtype.val, + Matrix.det_mul] + exact mul_comm _ _ + +theorem det_mul_transpose_eq_sum_sq_minors (A : Matrix n m R) : + Matrix.det (A * A.transpose) = + ∑ s : ColumnSets n m, (columnMinor A s).det ^ 2 := by + rw [det_mul_eq_sum_minors] + apply Finset.sum_congr rfl + intro s _ + have ht : A.transpose.submatrix Subtype.val (columnIndexEquiv s) = + (columnMinor A s).transpose := rfl + rw [ht, Matrix.det_transpose, pow_two] + +omit [DecidableEq n] in +theorem columnMinor_mul_diagonal (A : Matrix n m R) (w : m → R) + (s : ColumnSets n m) : + columnMinor (A * Matrix.diagonal w) s = + columnMinor A s * Matrix.diagonal (fun j : (s.val : Finset m) => w j.val) := by + ext i j + simp [columnMinor, Matrix.mul_diagonal] + +theorem det_weighted_gram_eq_sum_sq_minors (A : Matrix n m R) (w : m → R) : + Matrix.det (A * Matrix.diagonal w * A.transpose) = + ∑ s : ColumnSets n m, + (∏ j : (s.val : Finset m), w j.val) * (columnMinor A s).det ^ 2 := by + rw [det_mul_eq_sum_minors] + apply Finset.sum_congr rfl + intro s _ + have ht : A.transpose.submatrix Subtype.val (columnIndexEquiv s) = + (columnMinor A s).transpose := rfl + rw [columnMinor_mul_diagonal, Matrix.det_mul, Matrix.det_diagonal, + ht, Matrix.det_transpose] + ring + +theorem det_weighted_gram_eq_sum_of_sq_minors + (A : Matrix n m R) (w : m → R) (P : Finset m → Prop) [DecidablePred P] + (hminor : ∀ s : ColumnSets n m, + (columnMinor A s).det ^ 2 = if P s.val then 1 else 0) : + Matrix.det (A * Matrix.diagonal w * A.transpose) = + ∑ s ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n), + if P s then ∏ j ∈ s, w j else 0 := by + rw [det_weighted_gram_eq_sum_sq_minors, + ← Finset.sum_coe_sort (ColumnSets n m) + (fun s : Finset m => if P s then ∏ j ∈ s, w j else 0)] + apply Finset.sum_congr rfl + intro s _ + rw [hminor s] + by_cases hs : P s.val + · simp only [ite_eq_left hs, mul_one] + exact Finset.prod_coe_sort s.val w + · simp only [ite_eq_right hs, mul_zero] + +theorem det_weighted_gram_eq_sum_filter + (A : Matrix n m R) (w : m → R) (P : Finset m → Prop) [DecidablePred P] + (hminor : ∀ s : ColumnSets n m, + (columnMinor A s).det ^ 2 = if P s.val then 1 else 0) : + Matrix.det (A * Matrix.diagonal w * A.transpose) = + ∑ s ∈ ((Finset.univ : Finset m).powersetCard (Fintype.card n)).filter P, + ∏ j ∈ s, w j := by + rw [det_weighted_gram_eq_sum_of_sq_minors A w P hminor, Finset.sum_filter] + +theorem det_weighted_gram_map_eq_sum_filter {S : Type*} [CommRing S] + (A : Matrix n m R) (f : R →+* S) (w : m → S) + (P : Finset m → Prop) [DecidablePred P] + (hminor : ∀ s : ColumnSets n m, + (columnMinor A s).det ^ 2 = if P s.val then 1 else 0) : + Matrix.det (A.map f * Matrix.diagonal w * (A.map f).transpose) = + ∑ s ∈ ((Finset.univ : Finset m).powersetCard (Fintype.card n)).filter P, + ∏ j ∈ s, w j := by + apply det_weighted_gram_eq_sum_filter + intro s + rw [columnMinor_map_det, ← map_pow, hminor s] + by_cases hs : P s.val <;> simp [hs] + +end Problem336.CauchyBinet + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CharacteristicRemainder.lean b/lean/OAI/Probability/SpanningForest/CharacteristicRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..52a1cc4ef63950f6319d1b114a7c1507607c88d0 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CharacteristicRemainder.lean @@ -0,0 +1,220 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators + +namespace Problem336.Innovation + +theorem norm_exp_mul_I_remainder_le (x : ℝ) : + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2‖ ≤ 4 * |x| ^ 3 := by + let z : ℂ := (x : ℂ) * Complex.I + have hz : ‖z‖ = |x| := by simp [z] + have hpoly : (∑ m ∈ Finset.range 3, z ^ m / (m.factorial : ℂ)) = + 1 + (x : ℂ) * Complex.I - (x : ℂ) ^ 2 / 2 := by + norm_num [Finset.sum_range_succ, z, mul_pow, Complex.I_sq] + ring + by_cases hx : |x| ≤ 1 + · have h := Complex.exp_bound (x := z) (by simpa [hz] using hx) (n := 3) (by decide) + rw [hz, hpoly] at h + have heq : Complex.exp z - (1 + (x : ℂ) * Complex.I - (x : ℂ)^2 / 2) = + Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ)^2 / 2 := by dsimp [z]; ring + rw [heq] at h + norm_num at h + exact h.trans (by nlinarith [pow_nonneg (abs_nonneg x) 3]) + · have hx1 : 1 ≤ |x| := le_of_not_ge hx + have habs : 0 ≤ |x| := abs_nonneg x + have hexp : ‖Complex.exp ((x : ℂ) * Complex.I)‖ = 1 := by simp + calc + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ)^2 / 2‖ + ≤ ‖Complex.exp ((x : ℂ) * Complex.I)‖ + ‖(1 : ℂ)‖ + + ‖(x : ℂ) * Complex.I‖ + ‖(x : ℂ)^2 / 2‖ := by + calc + _ ≤ ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I‖ + + ‖(x : ℂ)^2 / 2‖ := norm_add_le _ _ + _ ≤ (‖Complex.exp ((x : ℂ) * Complex.I) - 1‖ + + ‖(x : ℂ) * Complex.I‖) + ‖(x : ℂ)^2 / 2‖ := by + gcongr + exact norm_sub_le _ _ + _ ≤ _ := by + gcongr + exact norm_sub_le _ _ + _ = 2 + |x| + |x|^2 / 2 := by norm_num [hexp] + _ ≤ 4 * |x|^3 := by + have hsq : |x| ≤ |x|^2 := by nlinarith + have hcube : |x|^2 ≤ |x|^3 := by nlinarith [mul_nonneg (sq_nonneg |x|) (sub_nonneg.mpr hx1)] + nlinarith + +theorem norm_integral_exp_remainder_le + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] + {X : Ω → ℝ} (hX : Integrable X μ) + (hX2 : Integrable (fun ω => X ω ^ 2) μ) + (hX3 : Integrable (fun ω => |X ω| ^ 3) μ) : + ‖(∫ ω, Complex.exp ((X ω : ℂ) * Complex.I) ∂μ) - + (μ.real Set.univ : ℂ) - (∫ ω, X ω ∂μ : ℝ) * Complex.I + + (∫ ω, X ω ^ 2 ∂μ : ℝ) / 2‖ ≤ + 4 * ∫ ω, |X ω| ^ 3 ∂μ := by + have hcX : Integrable (fun ω => (X ω : ℂ)) μ := hX.ofReal + have hcX2 : Integrable (fun ω => (((X ω) ^ 2 : ℝ) : ℂ)) μ := hX2.ofReal + have hE : Integrable (fun ω => Complex.exp ((X ω : ℂ) * Complex.I)) μ := by + apply Integrable.of_bound + (Complex.continuous_exp.comp_aestronglyMeasurable + (hcX.aestronglyMeasurable.mul_const Complex.I)) 1 + filter_upwards [] with ω + simp + have hcX2' : Integrable (fun ω => (X ω : ℂ) ^ 2 / 2) μ := by + simpa using hcX2.div_const 2 + have hE1 : Integrable (fun ω => Complex.exp ((X ω : ℂ) * Complex.I) - 1) μ := + hE.sub (integrable_const 1) + have hS : Integrable (fun ω => Complex.exp ((X ω : ℂ) * Complex.I) - 1 - + (X ω : ℂ) * Complex.I) μ := hE1.sub (hcX.mul_const Complex.I) + have hR : Integrable (fun ω => Complex.exp ((X ω : ℂ) * Complex.I) - 1 - + (X ω : ℂ) * Complex.I + (X ω : ℂ) ^ 2 / 2) μ := + ((hE.sub (integrable_const 1)).sub (hcX.mul_const Complex.I)).add hcX2' + have hrew : (∫ ω, Complex.exp ((X ω : ℂ) * Complex.I) - 1 - + (X ω : ℂ) * Complex.I + (X ω : ℂ) ^ 2 / 2 ∂μ) = + (∫ ω, Complex.exp ((X ω : ℂ) * Complex.I) ∂μ) - + (μ.real Set.univ : ℂ) - (∫ ω, X ω ∂μ : ℝ) * Complex.I + + (∫ ω, X ω ^ 2 ∂μ : ℝ) / 2 := by + rw [integral_add hS hcX2', integral_sub hE1 (hcX.mul_const Complex.I), + integral_sub hE (integrable_const 1)] + simp only [integral_const, integral_mul_const, integral_div, + ← Complex.ofReal_pow, integral_complex_ofReal, Complex.real_smul, mul_one] + rw [← hrew] + calc + _ ≤ ∫ ω, ‖Complex.exp ((X ω : ℂ) * Complex.I) - 1 - + (X ω : ℂ) * Complex.I + (X ω : ℂ) ^ 2 / 2‖ ∂μ := + norm_integral_le_integral_norm _ + _ ≤ ∫ ω, 4 * |X ω| ^ 3 ∂μ := + integral_mono hR.norm (hX3.const_mul 4) (fun ω => norm_exp_mul_I_remainder_le (X ω)) + _ = _ := integral_const_mul _ _ + +theorem norm_condExp_exp_remainder_le + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] + (hm : m ≤ mΩ) {X : Ω → ℝ} (hX : Integrable X μ) + (hX2 : Integrable (fun ω => X ω ^ 2) μ) + (hX3 : Integrable (fun ω => |X ω| ^ 3) μ) : + ∀ᵐ ω ∂μ, + ‖μ[fun ω => Complex.exp ((X ω : ℂ) * Complex.I) | m] ω - 1 - + (μ[X | m] ω : ℂ) * Complex.I + + (μ[fun ω => X ω ^ 2 | m] ω : ℂ) / 2‖ ≤ + 4 * μ[fun ω => |X ω| ^ 3 | m] ω := by + let E : Ω → ℂ := fun ω => Complex.exp ((X ω : ℂ) * Complex.I) + let S : Ω → ℂ := fun ω => E ω - 1 - (X ω : ℂ) * Complex.I + let R : Ω → ℂ := fun ω => S ω + (X ω : ℂ) ^ 2 / 2 + have hcX : Integrable (fun ω => (X ω : ℂ)) μ := hX.ofReal + have hcX2 : Integrable (fun ω => ((X ω ^ 2 : ℝ) : ℂ)) μ := hX2.ofReal + have hE : Integrable E μ := by + apply Integrable.of_bound + (Complex.continuous_exp.comp_aestronglyMeasurable + (hcX.aestronglyMeasurable.mul_const Complex.I)) 1 + filter_upwards [] with ω + simp + have hE1 : Integrable (fun ω => E ω - 1) μ := hE.sub (integrable_const 1) + have hS : Integrable S μ := hE1.sub (hcX.mul_const Complex.I) + have hQ : Integrable (fun ω => (X ω : ℂ) ^ 2 / 2) μ := by + simpa only [Complex.ofReal_pow] using hcX2.div_const 2 + have hR : Integrable R μ := hS.add hQ + have hnorm : ∀ᵐ ω ∂μ, ‖μ[R | m] ω‖ ≤ 4 * μ[fun ω => |X ω| ^ 3 | m] ω := by + have hmono := condExp_mono (m := m) hR.norm (hX3.const_mul 4) + (Filter.Eventually.of_forall (fun ω => norm_exp_mul_I_remainder_le (X ω))) + have hscale := condExp_smul (μ := μ) (4 : ℝ) (fun ω => |X ω| ^ 3) m + filter_upwards [norm_condExp_le (m := m) R, hmono, hscale] with ω h₁ h₂ h₃ + exact h₁.trans (h₂.trans_eq h₃) + have hcx : (fun ω => (μ[X | m] ω : ℂ)) =ᵐ[μ] μ[fun ω => (X ω : ℂ) | m] := by + simpa only [Function.comp_def, Complex.ofRealCLM_apply] using + (Complex.ofRealCLM.comp_condExp_comm (m := m) hX) + have hcx2 : (fun ω => (μ[fun ω => X ω ^ 2 | m] ω : ℂ)) =ᵐ[μ] + μ[fun ω => (X ω : ℂ) ^ 2 | m] := by + simpa only [Function.comp_def, Complex.ofRealCLM_apply, Complex.ofReal_pow] using + (Complex.ofRealCLM.comp_condExp_comm (m := m) hX2) + have hmul : μ[fun ω => (X ω : ℂ) * Complex.I | m] =ᵐ[μ] + (fun ω => μ[fun ω => (X ω : ℂ) | m] ω * Complex.I) := by + have h := condExp_smul (μ := μ) Complex.I (fun ω => (X ω : ℂ)) m + change μ[fun ω => Complex.I * (X ω : ℂ) | m] =ᵐ[μ] + (fun ω => Complex.I * μ[fun ω => (X ω : ℂ) | m] ω) at h + simpa only [mul_comm] using h + have hdiv : μ[fun ω => (X ω : ℂ) ^ 2 / 2 | m] =ᵐ[μ] + (fun ω => μ[fun ω => (X ω : ℂ) ^ 2 | m] ω / 2) := by + have h := condExp_smul (μ := μ) ((2 : ℂ)⁻¹) (fun ω => (X ω : ℂ)^2) m + change μ[fun ω => (2 : ℂ)⁻¹ * (X ω : ℂ)^2 | m] =ᵐ[μ] + (fun ω => (2 : ℂ)⁻¹ * μ[fun ω => (X ω : ℂ)^2 | m] ω) at h + simpa only [div_eq_mul_inv, mul_comm] using h + filter_upwards [hnorm, condExp_add hS hQ m, + condExp_sub hE1 (hcX.mul_const Complex.I) m, + condExp_sub hE (integrable_const (1 : ℂ)) m, + hcx, hcx2, hmul, hdiv] with ω hn ha hs he hx hx2 hmulω hdivω + change μ[R | m] ω = μ[S | m] ω + μ[fun ω => (X ω : ℂ)^2 / 2 | m] ω at ha + change μ[S | m] ω = μ[fun ω => E ω - 1 | m] ω - + μ[fun ω => (X ω : ℂ) * Complex.I | m] ω at hs + change μ[fun ω => E ω - 1 | m] ω = μ[E | m] ω - μ[fun _ => (1 : ℂ) | m] ω at he + change ‖μ[R | m] ω‖ ≤ _ at hn + rw [ha, hs, he, condExp_const hm, hmulω, hdivω, ← hx, ← hx2] at hn + exact hn + +theorem norm_sub_gaussian_char_le + {z : ℂ} {m₂ v ε δ : ℝ} (hv : 0 ≤ v) (hv₂ : v ≤ 2) + (hz : ‖z - 1 + (m₂ : ℂ) / 2‖ ≤ ε) (hm₂ : |m₂ - v| ≤ δ) : + ‖z - Complex.exp (-(v : ℂ) / 2)‖ ≤ ε + δ / 2 + v ^ 2 / 4 := by + have hsmall : ‖-(v : ℂ) / 2‖ ≤ 1 := by + norm_num [norm_div, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hv] + linarith + have hexp : ‖(1 : ℂ) - (v : ℂ) / 2 - Complex.exp (-(v : ℂ) / 2)‖ ≤ v ^ 2 / 4 := by + have h := Complex.norm_exp_sub_one_sub_id_le hsmall + have heq : (1 : ℂ) - (v : ℂ) / 2 - Complex.exp (-(v : ℂ) / 2) = + -(Complex.exp (-(v : ℂ) / 2) - 1 - (-(v : ℂ) / 2)) := by ring + rw [heq, norm_neg] + convert h using 1 + norm_num [norm_div, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hv] + ring + have hdiff : ‖((v - m₂ : ℝ) : ℂ) / 2‖ ≤ δ / 2 := by + have heq : ‖((v - m₂ : ℝ) : ℂ) / 2‖ = |v - m₂| / 2 := by + simp only [norm_div, Complex.norm_real, Real.norm_eq_abs] + norm_num + rw [heq, abs_sub_comm] + exact div_le_div_of_nonneg_right hm₂ (by norm_num) + have heq : z - Complex.exp (-(v : ℂ) / 2) = + (z - 1 + (m₂ : ℂ) / 2) + ((v - m₂ : ℝ) : ℂ) / 2 + + ((1 : ℂ) - (v : ℂ) / 2 - Complex.exp (-(v : ℂ) / 2)) := by + push_cast + ring + rw [heq] + calc + _ ≤ ‖z - 1 + (m₂ : ℂ) / 2 + ((v - m₂ : ℝ) : ℂ) / 2‖ + + ‖(1 : ℂ) - (v : ℂ) / 2 - Complex.exp (-(v : ℂ) / 2)‖ := norm_add_le _ _ + _ ≤ (‖z - 1 + (m₂ : ℂ) / 2‖ + ‖((v - m₂ : ℝ) : ℂ) / 2‖) + + ‖(1 : ℂ) - (v : ℂ) / 2 - Complex.exp (-(v : ℂ) / 2)‖ := + add_le_add (norm_add_le _ _) le_rfl + _ ≤ _ := add_le_add (add_le_add hz hdiff) hexp + +theorem conditional_characteristic_error + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] + (hm : m ≤ mΩ) {X : Ω → ℝ} (hX : Integrable X μ) + (hX2 : Integrable (fun ω => X ω ^ 2) μ) + (hX3 : Integrable (fun ω => |X ω| ^ 3) μ) + {v δ η : ℝ} (hv : 0 ≤ v) (hv₂ : v ≤ 2) + (hmean : μ[X | m] =ᵐ[μ] 0) + (hsecond : ∀ᵐ ω ∂μ, |μ[fun ω => X ω ^ 2 | m] ω - v| ≤ δ) + (hthird : ∀ᵐ ω ∂μ, μ[fun ω => |X ω| ^ 3 | m] ω ≤ η) : + ∀ᵐ ω ∂μ, + ‖μ[fun ω => Complex.exp ((X ω : ℂ) * Complex.I) | m] ω - + Complex.exp (-(v : ℂ) / 2)‖ ≤ 4 * η + δ / 2 + v ^ 2 / 4 := by + filter_upwards [norm_condExp_exp_remainder_le hm hX hX2 hX3, + hmean, hsecond, hthird] with ω hrem hmeanω hsecondω hthirdω + simp only [Pi.zero_apply] at hmeanω + rw [hmeanω] at hrem + simp only [Complex.ofReal_zero, zero_mul, sub_zero] at hrem + exact norm_sub_gaussian_char_le hv hv₂ + (hrem.trans (mul_le_mul_of_nonneg_left hthirdω (by norm_num))) hsecondω + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CharacteristicTaylor.lean b/lean/OAI/Probability/SpanningForest/CharacteristicTaylor.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa81de5cb3070af9dad5f6c162e44fe9f9869afd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CharacteristicTaylor.lean @@ -0,0 +1,106 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped BigOperators Topology + +namespace Problem336 + +theorem norm_exp_imaginary_taylor_two_le (x : ℝ) : + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2‖ ≤ 4 * |x| ^ 3 := by + have hnorm : ‖(x : ℂ) * Complex.I‖ = |x| := by simp + by_cases hx : |x| ≤ 1 + · have hb := Complex.exp_bound (x := (x : ℂ) * Complex.I) + (by simpa only [hnorm] using hx) (n := 3) (by decide) + have heq : (∑ m ∈ Finset.range 3, + ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)) = + 1 + (x : ℂ) * Complex.I - (x : ℂ) ^ 2 / 2 := by + norm_num [Finset.sum_range_succ, mul_pow, Complex.I_sq] + ring + rw [heq, hnorm] at hb + have hn : 0 ≤ |x| ^ 3 := by positivity + norm_num at hb + calc + _ = ‖Complex.exp ((x : ℂ) * Complex.I) - + (1 + (x : ℂ) * Complex.I - (x : ℂ) ^ 2 / 2)‖ := by congr 1; ring + _ ≤ 4 * |x| ^ 3 := by linarith + · have hx1 : 1 ≤ |x| := le_of_lt (lt_of_not_ge hx) + have hbound : + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2‖ ≤ 2 + |x| + |x| ^ 2 / 2 := by + calc + _ ≤ ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I‖ + + ‖(x : ℂ) ^ 2 / 2‖ := norm_add_le _ _ + _ ≤ (‖Complex.exp ((x : ℂ) * Complex.I) - 1‖ + + ‖(x : ℂ) * Complex.I‖) + ‖(x : ℂ) ^ 2 / 2‖ := + by + gcongr + exact norm_sub_le _ _ + _ ≤ ((‖Complex.exp ((x : ℂ) * Complex.I)‖ + ‖(1 : ℂ)‖) + + ‖(x : ℂ) * Complex.I‖) + ‖(x : ℂ) ^ 2 / 2‖ := by + gcongr + exact norm_sub_le _ _ + _ = 2 + |x| + |x| ^ 2 / 2 := by + simp [Complex.norm_exp_ofReal_mul_I, norm_pow] + ring + have hsq : |x| ≤ |x| ^ 2 := by nlinarith [abs_nonneg x] + have hcube : |x| ^ 2 ≤ |x| ^ 3 := by + nlinarith [mul_nonneg (sq_nonneg |x|) (sub_nonneg.mpr hx1)] + nlinarith + +theorem characteristic_taylor_two_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsFiniteMeasure P] {D : Ω → ℝ} + (hD : Integrable D P) (hD2 : Integrable (fun ω => D ω ^ 2) P) + (hD3 : Integrable (fun ω => |D ω| ^ 3) P) : + ‖(∫ ω, Complex.exp ((D ω : ℂ) * Complex.I) ∂P) - + ((P.real Set.univ : ℂ) + (∫ ω, D ω ∂P : ℝ) * Complex.I - + (∫ ω, D ω ^ 2 ∂P : ℝ) / 2)‖ ≤ 4 * ∫ ω, |D ω| ^ 3 ∂P := by + have hm : AEStronglyMeasurable + (fun ω => Complex.exp ((D ω : ℂ) * Complex.I)) P := + (show Continuous (fun x : ℝ => Complex.exp ((x : ℂ) * Complex.I)) by + fun_prop).comp_aestronglyMeasurable hD.aestronglyMeasurable + have hc : Integrable (fun ω => Complex.exp ((D ω : ℂ) * Complex.I)) P := + Integrable.of_bound hm 1 (Eventually.of_forall (fun ω => by simp)) + have hl : Integrable (fun ω => (D ω : ℂ) * Complex.I) P := + hD.ofReal.mul_const Complex.I + have hq : Integrable (fun ω => (D ω : ℂ) ^ 2 / 2) P := by + have hq0 : Integrable (fun ω => ((D ω ^ 2 : ℝ) : ℂ)) P := hD2.ofReal + convert hq0.div_const (2 : ℂ) using 1 + ext ω + push_cast + rfl + let R : Ω → ℂ := fun ω => Complex.exp ((D ω : ℂ) * Complex.I) - 1 - + (D ω : ℂ) * Complex.I + (D ω : ℂ) ^ 2 / 2 + have hR : Integrable R P := ((hc.sub (integrable_const 1)).sub hl).add hq + have hRI : (∫ ω, R ω ∂P) = + (∫ ω, Complex.exp ((D ω : ℂ) * Complex.I) ∂P) - + ((P.real Set.univ : ℂ) + (∫ ω, D ω ∂P : ℝ) * Complex.I - + (∫ ω, D ω ^ 2 ∂P : ℝ) / 2) := by + dsimp [R] + have hs : Integrable (fun ω => Complex.exp ((D ω : ℂ) * Complex.I) - 1 - + (D ω : ℂ) * Complex.I) P := (hc.sub (integrable_const 1)).sub hl + have hs' : Integrable (fun ω => Complex.exp ((D ω : ℂ) * Complex.I) - 1) P := + hc.sub (integrable_const 1) + rw [integral_add hs hq, integral_sub hs' hl, + integral_sub hc (integrable_const 1), integral_const, + integral_mul_const, integral_div, integral_complex_ofReal] + simp only [← Complex.ofReal_pow, integral_complex_ofReal, + Complex.real_smul, mul_one] + ring + rw [← hRI] + calc + ‖∫ ω, R ω ∂P‖ ≤ ∫ ω, ‖R ω‖ ∂P := norm_integral_le_integral_norm _ + _ ≤ ∫ ω, 4 * |D ω| ^ 3 ∂P := + integral_mono_ae hR.norm (hD3.const_mul 4) + (Eventually.of_forall (fun ω => norm_exp_imaginary_taylor_two_le (D ω))) + _ = 4 * ∫ ω, |D ω| ^ 3 ∂P := integral_const_mul _ _ + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodeLaplacian.lean b/lean/OAI/Probability/SpanningForest/CodeLaplacian.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc62627396acfac1a4defd0aad5bc998f4fd4c90 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodeLaplacian.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.ReducedLaplacian + +namespace OAI + +namespace Problem336 + +open scoped Matrix + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def codeSource (hK : IsFiniteConnectedSubgraph G K) (e : K.2) : K.1 := + ⟨e.val.1, (hK.2.1 e.val e.property).1⟩ + +def codeTarget (hK : IsFiniteConnectedSubgraph G K) (e : K.2) : K.1 := + ⟨e.val.2, (hK.2.1 e.val e.property).2.1⟩ + +theorem code_edgeAdj_iff (hK : IsFiniteConnectedSubgraph G K) (u v : K.1) : + ReducedLaplacian.EdgeAdj (codeSource hK) (codeTarget hK) u v ↔ + SubgraphAdj K u.val v.val := by + constructor + · rintro ⟨e, h | h⟩ + · refine ⟨u.property, v.property, ?_⟩ + have hs := congrArg Subtype.val h.1 + have ht := congrArg Subtype.val h.2 + change e.val.1 = u.val at hs + change e.val.2 = v.val at ht + rw [← hs, ← ht] + have hlt := (hK.2.1 e.val e.property).2.2.1 + simpa only [rawPair, ite_eq_left hlt, Prod.mk.eta] using e.property + · refine ⟨u.property, v.property, ?_⟩ + have hs := congrArg Subtype.val h.1 + have ht := congrArg Subtype.val h.2 + change e.val.1 = v.val at hs + change e.val.2 = u.val at ht + rw [← hs, ← ht] + have hlt := (hK.2.1 e.val e.property).2.2.1 + have hnot : ¬e.val.2 < e.val.1 := Nat.not_lt.mpr (Nat.le_of_lt hlt) + simpa only [rawPair, ite_eq_right hnot, Prod.mk.eta] using e.property + · intro h + refine ⟨⟨rawPair u.val v.val, h.2.2⟩, ?_⟩ + by_cases huv : u.val < v.val + · left + constructor <;> apply Subtype.ext <;> simp [codeSource, codeTarget, rawPair, huv] + · right + constructor <;> apply Subtype.ext <;> simp [codeSource, codeTarget, rawPair, huv] + +theorem code_endpoints_connected (hK : IsFiniteConnectedSubgraph G K) : + ReducedLaplacian.Connected (codeSource hK) (codeTarget hK) := by + intro u v + have liftPath {a b : ℕ} (hab : Relation.ReflTransGen (SubgraphAdj K) a b) : + ∀ (ha : a ∈ K.1) (hb : b ∈ K.1), + Relation.ReflTransGen + (ReducedLaplacian.EdgeAdj (codeSource hK) (codeTarget hK)) + (⟨a, ha⟩ : K.1) (⟨b, hb⟩ : K.1) := by + induction hab with + | refl => intro _ _; exact .refl + | @tail b c hab hbc ih => + intro ha hc + exact (ih ha hbc.1).tail + ((code_edgeAdj_iff hK ⟨b, hbc.1⟩ ⟨c, hc⟩).2 hbc) + exact liftPath (hK.2.2 u.val u.property v.val v.property) u.property v.property + +def codeWeightedLaplacian (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (w : K.2 → ℝ) : + Matrix {v : K.1 // v ≠ root} {v : K.1 // v ≠ root} ℝ := + ReducedLaplacian.weightedLaplacian (codeSource hK) (codeTarget hK) root w + +theorem codeWeightedLaplacian_posDef (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (w : K.2 → ℝ) (hw : ∀ e, 0 < w e) : + (codeWeightedLaplacian hK root w).PosDef := + ReducedLaplacian.weightedLaplacian_posDef + (codeSource hK) (codeTarget hK) root w (code_endpoints_connected hK) hw + +theorem codeWeightedLaplacian_det_ne_zero (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (w : K.2 → ℝ) (hw : ∀ e, 0 < w e) : + (codeWeightedLaplacian hK root w).det ≠ 0 := + ReducedLaplacian.weightedLaplacian_det_ne_zero + (codeSource hK) (codeTarget hK) root w (code_endpoints_connected hK) hw + +end Problem336 + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodeTransferKernel.lean b/lean/OAI/Probability/SpanningForest/CodeTransferKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a791f25f7dd2c05ae1dedf9a6aa95b1eaa5d02a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodeTransferKernel.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SpanningForest.ReducedCycleKernel + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace CodeTransferKernel + +open scoped Matrix + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def edgeEquiv (hK : IsFiniteConnectedSubgraph G K) : K.2 ≃ finiteCodeEdges K where + toFun e := ⟨⟨e.1, (hK.2.1 e.1 e.2).2.2.1⟩, e.2⟩ + invFun e := ⟨e.1.1, e.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +def incidence (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + Matrix {v : K.1 // v ≠ root} K.2 ℝ := + (ReducedLaplacian.reducedGradient (Problem336.codeSource hK) + (Problem336.codeTarget hK) root).transpose + +theorem incidence_eq_submatrix (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + incidence hK root = + (ReducedCycleKernel.reducedFiniteIncidence K root).submatrix id (edgeEquiv hK) := by + classical + ext v e + simp only [incidence, ReducedLaplacian.reducedGradient, Matrix.transpose_apply, + ReducedCycleKernel.reducedFiniteIncidence, finiteIncidence, Matrix.submatrix_apply, + edgeEquiv, Equiv.coe_fn_mk, id_eq, Problem336.codeSource, Problem336.codeTarget, + Subtype.ext_iff] + +theorem gram_submatrix {m n p : Type*} [Fintype n] [Fintype p] + (A : Matrix m n ℝ) (e : p ≃ n) : + A.submatrix id e * (A.submatrix id e).transpose = A * A.transpose := by + change A.submatrix id e * A.transpose.submatrix e id = A * A.transpose + simpa only [Matrix.submatrix_id_id] using + Matrix.submatrix_mul_equiv A A.transpose id e id + +theorem gram_eq_codeWeightedLaplacian (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) : + (ReducedCycleKernel.reducedFiniteIncidence K root) * + (ReducedCycleKernel.reducedFiniteIncidence K root).transpose = + codeWeightedLaplacian hK root (fun _ => 1) := by + classical + rw [← gram_submatrix _ (edgeEquiv hK), ← incidence_eq_submatrix hK root] + simp [incidence, codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian] + +theorem transferMatrix_submatrix {m n p : Type*} [Fintype m] [DecidableEq m] + [Fintype n] [Fintype p] (A : Matrix m n ℝ) (e : p ≃ n) : + TransferProjection.transferMatrix (A.submatrix id e) = + (TransferProjection.transferMatrix A).submatrix e e := by + rw [TransferProjection.transferMatrix, gram_submatrix] + change A.transpose.submatrix e id * (A * A.transpose)⁻¹ * A.submatrix id e = _ + ext i j + rfl + +theorem transfer_entry_eq_projection (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (e f : K.2) : + TransferProjection.transferMatrix (incidence hK root) e f = + inner ℝ (lp.single 2 (edgeEquiv hK e).1 (1 : ℝ)) + ((finiteHilbertEmbedding K).toLinearMap.range.starProjection + (lp.single 2 (edgeEquiv hK f).1 (1 : ℝ)) - + (finiteHilbertCycleSpace K).starProjection + (lp.single 2 (edgeEquiv hK f).1 (1 : ℝ))) := by + rw [incidence_eq_submatrix, transferMatrix_submatrix] + exact ReducedCycleKernel.finite_transfer_entry_eq_projection hK root + (edgeEquiv hK e) (edgeEquiv hK f) + +end CodeTransferKernel +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedIncidenceMinors.lean b/lean/OAI/Probability/SpanningForest/CodedIncidenceMinors.lean new file mode 100644 index 0000000000000000000000000000000000000000..a54627c5c9d855a79ace31e2e825fdc0c30f4f32 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedIncidenceMinors.lean @@ -0,0 +1,170 @@ +import OAI.Probability.SpanningForest.FiniteIncidenceBridge +import OAI.Probability.SpanningForest.IncidenceMinorClassification +import OAI.Probability.SpanningForest.CauchyBinet + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix +open Classical + +namespace Problem336.FiniteIncidence + +theorem edgeAdj_comp_equiv {V E F : Type*} (s t : E → V) (e : F ≃ E) (u v : V) : + ReducedLaplacian.EdgeAdj (s ∘ e) (t ∘ e) u v ↔ + ReducedLaplacian.EdgeAdj s t u v := by + constructor + · rintro ⟨a, ha⟩ + exact ⟨e a, ha⟩ + · rintro ⟨a, ha⟩ + refine ⟨e.symm a, ?_⟩ + simpa only [Function.comp_apply, e.apply_symm_apply] using ha + +theorem connected_comp_equiv {V E F : Type*} (s t : E → V) (e : F ≃ E) : + ReducedLaplacian.Connected (s ∘ e) (t ∘ e) ↔ + ReducedLaplacian.Connected s t := by + have hrel : ReducedLaplacian.EdgeAdj (s ∘ e) (t ∘ e) = + ReducedLaplacian.EdgeAdj s t := + funext fun u => funext fun v => propext (edgeAdj_comp_equiv s t e u v) + simp only [ReducedLaplacian.Connected, hrel] + +theorem squareReducedGradient_det_sq_eq_connected + (V : Finset ℕ) (T : Finset (ℕ × ℕ)) (h : ValidEdges V T) + (root : V) (e : T ≃ {v : V // v ≠ root}) : + (squareReducedGradient V T h root e).det ^ 2 = + if ReducedLaplacian.Connected (src V T h) (dst V T h) then 1 else 0 := by + classical + change (ReducedLaplacian.reducedGradient + (src V T h ∘ e.symm) (dst V T h ∘ e.symm) root).det ^ 2 = _ + rw [IncidenceMinor.reducedGradient_det_sq_eq_indicator, connected_comp_equiv] + +theorem squareReducedGradient_det_sq_eq_treeOn + {G : GraphCode} {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + {T : Finset (ℕ × ℕ)} (hT : T ⊆ K.2) + (hcard : T.card + 1 = K.1.card) (root : K.1) + (e : T ≃ {v : K.1 // v ≠ root}) : + (squareReducedGradient K.1 T (validEdges_of_subgraph hK hT) root e).det ^ 2 = + if TreeOn K T then 1 else 0 := by + classical + rw [squareReducedGradient_det_sq_eq_connected] + have heq : TreeOn K T ↔ ReducedLaplacian.Connected + (src K.1 T (validEdges_of_subgraph hK hT)) + (dst K.1 T (validEdges_of_subgraph hK hT)) := by + rw [treeOn_iff_connected hK hT] + exact and_iff_right hcard + simp only [← heq] + +def selectedEdges {K : FiniteSubgraphCode} (s : Finset K.2) : Finset (ℕ × ℕ) := + s.map (Function.Embedding.subtype (fun p => p ∈ K.2)) + +theorem selectedEdges_subset {K : FiniteSubgraphCode} (s : Finset K.2) : + selectedEdges s ⊆ K.2 := by + intro p hp + obtain ⟨a, _, rfl⟩ := Finset.mem_map.mp hp + exact a.property + +@[simp] theorem selectedEdges_card {K : FiniteSubgraphCode} (s : Finset K.2) : + (selectedEdges s).card = s.card := Finset.card_map _ + +def selectedEdgeEquiv {K : FiniteSubgraphCode} (s : Finset K.2) : + s ≃ selectedEdges s := + Equiv.ofBijective + (fun e => ⟨e.val.val, Finset.mem_map.mpr ⟨e.val, e.property, rfl⟩⟩) + ⟨by + intro a b hab + apply Subtype.ext + apply Subtype.ext + exact congrArg (fun p : selectedEdges s => p.val) hab, + by + intro p + obtain ⟨e, he, hep⟩ := Finset.mem_map.mp p.property + exact ⟨⟨e, he⟩, Subtype.ext hep⟩⟩ + +theorem connected_restrict_iff_selectedEdges + {G : GraphCode} {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + (s : Finset K.2) : + ReducedLaplacian.Connected + (src K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp)) ∘ + (Subtype.val : s → K.2)) + (dst K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp)) ∘ + (Subtype.val : s → K.2)) ↔ + ReducedLaplacian.Connected + (src K.1 (selectedEdges s) (validEdges_of_subgraph hK (selectedEdges_subset s))) + (dst K.1 (selectedEdges s) (validEdges_of_subgraph hK (selectedEdges_subset s))) := by + change ReducedLaplacian.Connected + (src K.1 (selectedEdges s) (validEdges_of_subgraph hK (selectedEdges_subset s)) ∘ + selectedEdgeEquiv s) + (dst K.1 (selectedEdges s) (validEdges_of_subgraph hK (selectedEdges_subset s)) ∘ + selectedEdgeEquiv s) ↔ _ + exact connected_comp_equiv _ _ (selectedEdgeEquiv s) + +theorem connected_restrict_iff_treeOn + {G : GraphCode} {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + (s : Finset K.2) (hcard : s.card + 1 = K.1.card) : + ReducedLaplacian.Connected + (src K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp)) ∘ + (Subtype.val : s → K.2)) + (dst K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp)) ∘ + (Subtype.val : s → K.2)) ↔ TreeOn K (selectedEdges s) := by + rw [connected_restrict_iff_selectedEdges hK s, treeOn_iff_connected hK (selectedEdges_subset s)] + exact (and_iff_right (by simpa only [selectedEdges_card] using hcard)).symm + +theorem selectedEdges_card_add_one {K : FiniteSubgraphCode} (root : K.1) + (s : CauchyBinet.ColumnSets {v : K.1 // v ≠ root} K.2) : + (selectedEdges s.val).card + 1 = K.1.card := by + rw [selectedEdges_card, (Finset.mem_powersetCard.mp s.property).2, + Fintype.card_subtype_compl (fun v : K.1 => v = root), Fintype.card_coe, + Fintype.card_subtype_eq] + have hpos : 0 < K.1.card := Finset.card_pos.mpr ⟨root.val, root.property⟩ + omega + +theorem columnMinor_det_sq_eq_treeOn + {G : GraphCode} {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) + (s : CauchyBinet.ColumnSets {v : K.1 // v ≠ root} K.2) : + (CauchyBinet.columnMinor + (ReducedLaplacian.reducedGradient + (src K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp))) + (dst K.1 K.2 (validEdges_of_subgraph hK (fun _ hp => hp))) root).transpose s).det ^ 2 = + if TreeOn K (selectedEdges s.val) then 1 else 0 := by + let hv := validEdges_of_subgraph hK (fun _ hp => hp) + let A := (ReducedLaplacian.reducedGradient (src K.1 K.2 hv) (dst K.1 K.2 hv) root).transpose + let ix := CauchyBinet.columnIndexEquiv s + let f : {v : K.1 // v ≠ root} → K.2 := fun i => (ix.symm i).val + have hdet : (CauchyBinet.columnMinor A s).det = (A.submatrix id f).det := by + calc + _ = ((CauchyBinet.columnMinor A s).submatrix ix.symm ix.symm).det := + (Matrix.det_submatrix_equiv_self ix.symm _).symm + _ = _ := by + congr 1 + ext i j + simp [CauchyBinet.columnMinor, Matrix.submatrix, ix, f] + change (CauchyBinet.columnMinor A s).det ^ 2 = _ + rw [hdet] + change (((ReducedLaplacian.reducedGradient + (src K.1 K.2 hv) (dst K.1 K.2 hv) root).transpose).submatrix id f).det ^ 2 = _ + rw [IncidenceMinor.selected_minor_det_sq_eq_indicator] + let hs := validEdges_of_subgraph hK (selectedEdges_subset s.val) + let e : {v : K.1 // v ≠ root} ≃ selectedEdges s.val := + ix.symm.trans (selectedEdgeEquiv s.val) + have hc : ReducedLaplacian.Connected (src K.1 K.2 hv ∘ f) (dst K.1 K.2 hv ∘ f) ↔ + ReducedLaplacian.Connected (src K.1 (selectedEdges s.val) hs) + (dst K.1 (selectedEdges s.val) hs) := by + change ReducedLaplacian.Connected + (src K.1 (selectedEdges s.val) hs ∘ e) + (dst K.1 (selectedEdges s.val) hs ∘ e) ↔ _ + exact connected_comp_equiv _ _ e + rw [hc] + have ht : TreeOn K (selectedEdges s.val) ↔ + ReducedLaplacian.Connected (src K.1 (selectedEdges s.val) hs) + (dst K.1 (selectedEdges s.val) hs) := by + rw [treeOn_iff_connected hK (selectedEdges_subset s.val)] + exact and_iff_right (selectedEdges_card_add_one root s) + simp only [← ht] + +end Problem336.FiniteIncidence + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedInclusion.lean b/lean/OAI/Probability/SpanningForest/CodedInclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b2911eedf2368f9144655bb5294dc195ff89415 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedInclusion.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SpanningForest.CodedMatrixTree +import OAI.Probability.SpanningForest.MarkedGram +import OAI.Probability.SpanningForest.InclusionPolynomial + +namespace OAI + +noncomputable section + +open scoped BigOperators Polynomial Matrix +open Classical Polynomial + +namespace Problem336 + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def codeTransferCurrent (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (c : (ℕ × ℕ) → ℝ) (S : Finset K.2) : Matrix S S ℝ := + Matrix.diagonal (fun e : S => c e.val.val) * + ((codeIncidence hK root).submatrix id (Subtype.val : S → K.2)).transpose * + (codeWeightedLaplacian hK root (fun e => c e.val))⁻¹ * + (codeIncidence hK root).submatrix id (Subtype.val : S → K.2) + +theorem code_tree_marker_identity (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (c : (ℕ × ℕ) → ℝ) (hc : ∀ e : K.2, 0 < c e.val) (S : Finset K.2) : + (∑ T ∈ spanningTrees K, C (∏ p ∈ T, c p) * + (1 + (X : ℝ[X])) ^ (T ∩ SubtypeSubsetSums.forget K.2 S).card) = + C (∑ T ∈ spanningTrees K, ∏ p ∈ T, c p) * + (1 + (X : ℝ[X]) • (codeTransferCurrent hK root c S).map C).det := by + have hA : IsUnit ((codeIncidence hK root) * + Matrix.diagonal (fun e : K.2 => c e.val) * (codeIncidence hK root).transpose).det := by + apply isUnit_iff_ne_zero.mpr + simpa only [codeIncidence, Matrix.transpose_transpose, codeWeightedLaplacian, + ReducedLaplacian.weightedLaplacian] using + codeWeightedLaplacian_det_ne_zero hK root (fun e => c e.val) hc + have hp := codeIncidence_weighted_partition hK root C + (fun p => C (c p) * + (if p ∈ SubtypeSubsetSums.forget K.2 S then 1 + (X : ℝ[X]) else 1)) + simp only [SubtypeSubsetSums.mem_forget] at hp + have hm := Determinantal.det_marked_weighted_gram + (codeIncidence hK root) (fun e : K.2 => c e.val) hA S + rw [hp] at hm + have hZ : ((codeIncidence hK root) * Matrix.diagonal (fun e : K.2 => c e.val) * + (codeIncidence hK root).transpose).det = + ∑ T ∈ spanningTrees K, ∏ p ∈ T, c p := by + exact codeWeightedLaplacian_tree_partition hK root c + rw [hZ] at hm + simpa only [Determinantal.prod_marked_weights, ← map_prod, + codeTransferCurrent, codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian, + codeIncidence, Matrix.transpose_transpose, Matrix.mul_assoc] using hm + +theorem code_tree_inclusion_mass (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (c : (ℕ × ℕ) → ℝ) (hc : ∀ e : K.2, 0 < c e.val) (S : Finset K.2) : + (∑ T ∈ (spanningTrees K).filter (fun T => SubtypeSubsetSums.forget K.2 S ⊆ T), + ∏ p ∈ T, c p) = + (∑ T ∈ spanningTrees K, ∏ p ∈ T, c p) * (codeTransferCurrent hK root c S).det := by + have hp := congrArg (fun p : ℝ[X] => p.coeff (SubtypeSubsetSums.forget K.2 S).card) + (code_tree_marker_identity hK root c hc S) + rw [InclusionPolynomial.coeff_partition, Polynomial.coeff_C_mul] at hp + have ht := InclusionPolynomial.coeff_det_one_add_X_top (codeTransferCurrent hK root c S) + simp only [Fintype.card_coe, SubtypeSubsetSums.card_forget] at hp ht + rwa [ht] at hp + +theorem code_tree_inclusion_ratio (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (c : (ℕ × ℕ) → ℝ) (hc : ∀ e : K.2, 0 < c e.val) (S : Finset K.2) : + (∑ T ∈ (spanningTrees K).filter (fun T => SubtypeSubsetSums.forget K.2 S ⊆ T), + ∏ p ∈ T, c p) / (∑ T ∈ spanningTrees K, ∏ p ∈ T, c p) = + (codeTransferCurrent hK root c S).det := by + have hZ : (∑ T ∈ spanningTrees K, ∏ p ∈ T, c p) ≠ 0 := by + rw [← codeWeightedLaplacian_tree_partition hK root c] + exact codeWeightedLaplacian_det_ne_zero hK root (fun e => c e.val) hc + rw [code_tree_inclusion_mass hK root c hc S] + exact mul_div_cancel_left₀ _ hZ + +theorem codeTransferCurrent_one (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (S : Finset K.2) : + codeTransferCurrent hK root (fun _ => 1) S = + (Determinantal.transferKernel (codeIncidence hK root)).submatrix + (Subtype.val : S → K.2) (Subtype.val : S → K.2) := by + rw [← Determinantal.transferKernel_submatrix] + simp [codeTransferCurrent, codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian, + codeIncidence, Matrix.mul_assoc] + +theorem code_uniform_tree_inclusion_ratio + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) (S : Finset K.2) : + (((spanningTrees K).filter (fun T => SubtypeSubsetSums.forget K.2 S ⊆ T)).card : ℝ) / + (spanningTrees K).card = + ((Determinantal.transferKernel (codeIncidence hK root)).submatrix + (Subtype.val : S → K.2) (Subtype.val : S → K.2)).det := by + simpa only [Finset.prod_const_one, Finset.sum_const, nsmul_eq_mul, mul_one, + codeTransferCurrent_one] using + code_tree_inclusion_ratio hK root (fun _ => 1) (fun _ => zero_lt_one) S + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedMarginal.lean b/lean/OAI/Probability/SpanningForest/CodedMarginal.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e333c6722bb99156d970c52cdb0df9bfe332922 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedMarginal.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SpanningForest.CodedInclusion +import OAI.Probability.SpanningForest.WeightedTreeResponse +import OAI.Probability.SpanningForest.IncidenceResponse + +namespace OAI + +noncomputable section +open scoped BigOperators Matrix +open Classical + +namespace Problem336 + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +lemma codeTransferCurrent_apply_bilinear (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (c : (ℕ × ℕ) → ℝ) (S : Finset K.2) (e f : S) : + codeTransferCurrent hK root c S e f = c e.val.val * + TransferCurrent.bilinear (codeWeightedLaplacian hK root (fun a => c a.val))⁻¹ + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root e.val) + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root f.val) := by + simp only [codeTransferCurrent, Matrix.mul_apply, Matrix.diagonal, + Matrix.submatrix_apply, Matrix.transpose_apply, codeIncidence, + Matrix.of_apply, TransferCurrent.bilinear, Matrix.mulVec, dotProduct, + ite_mul, zero_mul, + Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true, id_eq] + ring + +lemma codeTransferCurrent_singleton (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (h : (ℕ × ℕ) → ℝ) (e : K.2) : + (codeTransferCurrent hK root (fun p => Real.exp (h p)) {e}).det = + TransferCurrent.marginal + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root) + (fun f => h f.val) e := by + let : Unique ({e} : Finset K.2) := + { default := ⟨e, by simp⟩ + uniq := by intro f; apply Subtype.ext; exact Finset.mem_singleton.mp f.property } + rw [Matrix.det_unique, codeTransferCurrent_apply_bilinear] + unfold TransferCurrent.marginal + rw [TransferCurrent.laplacian_reducedGradient] + rfl + +theorem weightedTree_inclusion_eq_marginal (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (h : WeightedTree.Field) (e : K.2) : + WeightedTree.inclusion K e.val h = + TransferCurrent.marginal + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root) + (fun f => h f.val) e := by + have hr := code_tree_inclusion_ratio hK root (fun p => Real.exp (h p)) + (fun _ => Real.exp_pos _) {e} + rw [codeTransferCurrent_singleton] at hr + simpa only [WeightedTree.inclusion, WeightedTree.numerator, WeightedTree.partition, + WeightedTree.weight, Real.exp_sum, SubtypeSubsetSums.forget, Finset.map_singleton, + Function.Embedding.subtype_apply, Finset.singleton_subset_iff] using hr + +theorem USTResponse.inclusion_eq_transferCurrent (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (h : USTResponse.FiniteEdge K → ℝ) (e : USTResponse.FiniteEdge K) : + USTResponse.inclusion K h e = + TransferCurrent.marginal + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root) h e := by + let ext : WeightedTree.Field := fun p => if hp : p ∈ K.2 then h ⟨p, hp⟩ else 0 + have hext : (fun f : K.2 => ext f.val) = h := by + funext f + simp only [ext, dite_eq_left f.property] + rw [← hext, WeightedTree.ustResponse_inclusion_eq] + exact weightedTree_inclusion_eq_marginal hK root ext e + +theorem USTResponse.inclusion_response_connected (hK : IsFiniteConnectedSubgraph G K) + (a b : USTResponse.FiniteEdge K → ℝ) (e : USTResponse.FiniteEdge K) + (D : ℝ) (hD : 0 ≤ D) (hab : ∀ f, |b f - a f| ≤ D) : + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2 := by + obtain ⟨v, hv⟩ := hK.1 + let root : K.1 := ⟨v, hv⟩ + rw [USTResponse.inclusion_eq_transferCurrent hK root, + USTResponse.inclusion_eq_transferCurrent hK root] + simpa only [div_eq_mul_inv, one_mul, mul_comm] using + TransferCurrent.incidence_marginal_sub_le_half (codeSource hK) (codeTarget hK) root + (code_endpoints_connected hK) a b e D hD hab + +theorem WeightedTree.inclusion_response_connected (hK : IsFiniteConnectedSubgraph G K) + (a b : WeightedTree.Field) (e : ℕ × ℕ) (D : ℝ) (hD : 0 ≤ D) + (hab : ∀ f ∈ K.2, |b f - a f| ≤ D) : + |WeightedTree.inclusion K e b - WeightedTree.inclusion K e a| ≤ D / 2 := by + by_cases he : e ∈ K.2 + · rw [← WeightedTree.ustResponse_inclusion_eq K b ⟨e, he⟩, + ← WeightedTree.ustResponse_inclusion_eq K a ⟨e, he⟩] + exact USTResponse.inclusion_response_connected hK (fun f => a f.val) + (fun f => b f.val) ⟨e, he⟩ D hD (fun f => hab f.val f.property) + · rw [WeightedTree.inclusion_eq_zero_of_not_mem he, + WeightedTree.inclusion_eq_zero_of_not_mem he] + simpa using div_nonneg hD (by norm_num : (0 : ℝ) ≤ 2) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedMatrixTree.lean b/lean/OAI/Probability/SpanningForest/CodedMatrixTree.lean new file mode 100644 index 0000000000000000000000000000000000000000..747a3cd98f1afb981da211b6daa6ebeb99c7543e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedMatrixTree.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SpanningForest.CodeLaplacian +import OAI.Probability.SpanningForest.CodedIncidenceMinors +import OAI.Probability.SpanningForest.SubtypeSubsetSums + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix +open Classical + +namespace Problem336 + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def codeIncidence (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + Matrix {v : K.1 // v ≠ root} K.2 ℝ := + (ReducedLaplacian.reducedGradient (codeSource hK) (codeTarget hK) root).transpose + +theorem spanningTrees_eq_powersetCard_filter (root : K.1) : + spanningTrees K = (K.2.powersetCard (Fintype.card {v : K.1 // v ≠ root})).filter + (TreeOn K) := by + have hc : Fintype.card {v : K.1 // v ≠ root} = K.1.card - 1 := by + rw [Fintype.card_subtype_compl (fun v : K.1 => v = root), + Fintype.card_coe, Fintype.card_subtype_eq] + ext T + simp only [spanningTrees, Finset.mem_filter, Finset.mem_powerset, + Finset.mem_powersetCard] + constructor + · rintro ⟨hsub, ht⟩ + exact ⟨⟨hsub, by rw [hc]; have := ht.2.1; omega⟩, ht⟩ + · rintro ⟨⟨hsub, _⟩, ht⟩ + exact ⟨hsub, ht⟩ + +theorem codeIncidence_minor_sq (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (s : CauchyBinet.ColumnSets {v : K.1 // v ≠ root} K.2) : + (CauchyBinet.columnMinor (codeIncidence hK root) s).det ^ 2 = + if TreeOn K (SubtypeSubsetSums.forget K.2 s.val) then 1 else 0 := + FiniteIncidence.columnMinor_det_sq_eq_treeOn hK root s + +theorem codeIncidence_weighted_partition {R : Type*} [CommRing R] + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (f : ℝ →+* R) (c : (ℕ × ℕ) → R) : + Matrix.det ((codeIncidence hK root).map f * + Matrix.diagonal (fun e : K.2 => c e.val) * + ((codeIncidence hK root).map f).transpose) = + ∑ T ∈ spanningTrees K, ∏ p ∈ T, c p := by + rw [CauchyBinet.det_weighted_gram_map_eq_sum_filter + (codeIncidence hK root) f (fun e : K.2 => c e.val) + (fun s => TreeOn K (SubtypeSubsetSums.forget K.2 s)) + (codeIncidence_minor_sq hK root)] + calc + _ = ∑ s ∈ ((Finset.univ : Finset K.2).powersetCard + (Fintype.card {v : K.1 // v ≠ root})).filter + (fun s => TreeOn K (SubtypeSubsetSums.forget K.2 s)), + ∏ p ∈ SubtypeSubsetSums.forget K.2 s, c p := by + apply Finset.sum_congr rfl + intro s _ + exact (SubtypeSubsetSums.prod_forget K.2 s c).symm + _ = ∑ T ∈ (K.2.powersetCard + (Fintype.card {v : K.1 // v ≠ root})).filter (TreeOn K), + ∏ p ∈ T, c p := + SubtypeSubsetSums.sum_powersetCard_filter K.2 _ (TreeOn K) (fun T => ∏ p ∈ T, c p) + _ = _ := by rw [← spanningTrees_eq_powersetCard_filter root] + +theorem codeWeightedLaplacian_tree_partition + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (c : (ℕ × ℕ) → ℝ) : + (codeWeightedLaplacian hK root (fun e => c e.val)).det = + ∑ T ∈ spanningTrees K, ∏ p ∈ T, c p := by + simpa only [RingHom.coe_id, Matrix.map_id, codeIncidence, Matrix.transpose_transpose, + codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian] using + codeIncidence_weighted_partition hK root (RingHom.id ℝ) c + +theorem codeWeightedLaplacian_det_eq_tree_count + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + (codeWeightedLaplacian hK root (fun _ => 1)).det = (spanningTrees K).card := by + simpa using codeWeightedLaplacian_tree_partition hK root (fun _ => 1) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedTransferBridge.lean b/lean/OAI/Probability/SpanningForest/CodedTransferBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1ebfb6883a1763599680ce9d1b4140402ad9ace --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedTransferBridge.lean @@ -0,0 +1,68 @@ +import OAI.Probability.SpanningForest.CodedInclusion +import OAI.Probability.SpanningForest.FiniteKernelBridge + +namespace OAI + +noncomputable section +open scoped Matrix +namespace Problem336.CodedTransferBridge +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def edgeEquiv (hK : IsFiniteConnectedSubgraph G K) : finiteCodeEdges K ≃ K.2 where + toFun e := ⟨e.1.1, e.2⟩ + invFun e := ⟨⟨e.1, (hK.2.1 e.1 e.2).2.2.1⟩, e.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +theorem incidence_eq_submatrix (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + ReducedCycleKernel.reducedFiniteIncidence K root = + (codeIncidence hK root).submatrix id (edgeEquiv hK) := by + classical + ext v e + simp [ReducedCycleKernel.reducedFiniteIncidence, finiteIncidence, + codeIncidence, ReducedLaplacian.reducedGradient, Matrix.transpose_apply, + Matrix.submatrix_apply, codeSource, codeTarget, edgeEquiv, Subtype.ext_iff, id_eq] + +theorem gram_eq_laplacian (hK : IsFiniteConnectedSubgraph G K) (root : K.1) : + ReducedCycleKernel.reducedFiniteIncidence K root * + (ReducedCycleKernel.reducedFiniteIncidence K root).transpose = + codeWeightedLaplacian hK root (fun _ => 1) := by + classical + rw [incidence_eq_submatrix hK root, Matrix.transpose_submatrix] + rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_id_id] + simp [codeIncidence, codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian] + +theorem current_entry_eq_transfer (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) (e f : S) : + codeTransferCurrent hK root (fun _ => 1) S e f = + TransferProjection.transferMatrix (ReducedCycleKernel.reducedFiniteIncidence K root) + ((edgeEquiv hK).symm e.1) ((edgeEquiv hK).symm f.1) := by + classical + unfold TransferProjection.transferMatrix + rw [gram_eq_laplacian hK root] + simp only [codeTransferCurrent, Matrix.diagonal_one, Matrix.one_mul, + incidence_eq_submatrix hK root, Matrix.mul_apply, Matrix.transpose_apply, + Matrix.submatrix_apply, id_eq, Equiv.apply_symm_apply] + +theorem current_entry_eq_finiteKernel (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) (e f : S) : + codeTransferCurrent hK root (fun _ => 1) S e f = + inner ℝ (FreeKernel.edgeVector ((edgeEquiv hK).symm e.1).1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector ((edgeEquiv hK).symm f.1).1)) := by + rw [current_entry_eq_transfer] + exact FiniteKernelBridge.transfer_entry_eq_finiteKernel hK root _ _ + +theorem current_det_eq_finiteKernel (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) : + (codeTransferCurrent hK root (fun _ => 1) S).det = + Matrix.det (fun e f : S => + inner ℝ (FreeKernel.edgeVector ((edgeEquiv hK).symm e.1).1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector ((edgeEquiv hK).symm f.1).1))) := by + congr 1 + funext e f + exact current_entry_eq_finiteKernel hK root S e f +end Problem336.CodedTransferBridge + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CodedTransferProjection.lean b/lean/OAI/Probability/SpanningForest/CodedTransferProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e959ce9d258aa47ff79271b3de7e762c8da1969 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CodedTransferProjection.lean @@ -0,0 +1,81 @@ +import OAI.Probability.SpanningForest.CodeTransferKernel +import OAI.Probability.SpanningForest.CodedInclusion +import OAI.Probability.SpanningForest.FiniteKernelBridge + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace CodeTransferKernel + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +theorem codeTransferCurrent_one (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) : + codeTransferCurrent hK root (fun _ => 1) S = + (TransferProjection.transferMatrix (incidence hK root)).submatrix + (Subtype.val : S → K.2) (Subtype.val : S → K.2) := by + classical + simp only [codeTransferCurrent, Matrix.diagonal_one, Matrix.one_mul, + codeWeightedLaplacian, ReducedLaplacian.weightedLaplacian, Matrix.mul_one, + TransferProjection.transferMatrix, incidence, codeIncidence, + Matrix.transpose_transpose] + rfl + +theorem codeTransferCurrent_one_entry (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) (e f : S) : + codeTransferCurrent hK root (fun _ => 1) S e f = + inner ℝ (lp.single 2 (edgeEquiv hK e.1).1 (1 : ℝ)) + ((finiteHilbertEmbedding K).toLinearMap.range.starProjection + (lp.single 2 (edgeEquiv hK f.1).1 (1 : ℝ)) - + (finiteHilbertCycleSpace K).starProjection + (lp.single 2 (edgeEquiv hK f.1).1 (1 : ℝ))) := by + rw [codeTransferCurrent_one] + exact transfer_entry_eq_projection hK root e.1 f.1 + +theorem code_tree_inclusion_ratio_projection (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) : + (((spanningTrees K).filter + (fun T => SubtypeSubsetSums.forget K.2 S ⊆ T)).card : ℝ) / + (spanningTrees K).card = + Matrix.det (fun e f : S => + inner ℝ (lp.single 2 (edgeEquiv hK e.1).1 (1 : ℝ)) + ((finiteHilbertEmbedding K).toLinearMap.range.starProjection + (lp.single 2 (edgeEquiv hK f.1).1 (1 : ℝ)) - + (finiteHilbertCycleSpace K).starProjection + (lp.single 2 (edgeEquiv hK f.1).1 (1 : ℝ)))) := by + have h := code_tree_inclusion_ratio hK root (fun _ => 1) (fun _ => by norm_num) S + simp only [Finset.prod_const_one, Finset.sum_const, nsmul_eq_mul, mul_one] at h + rw [h] + congr 1 + ext e f + exact codeTransferCurrent_one_entry hK root S e f + +theorem codeTransferCurrent_one_eq_finiteKernel (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) : + codeTransferCurrent hK root (fun _ => 1) S = + fun e f : S => inner ℝ (FreeKernel.edgeVector (edgeEquiv hK e.1).1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector (edgeEquiv hK f.1).1)) := by + ext e f + rw [codeTransferCurrent_one_entry, FiniteKernelBridge.embedding_projection] + rfl + +theorem code_tree_inclusion_ratio_finiteKernel (hK : IsFiniteConnectedSubgraph G K) + (root : K.1) (S : Finset K.2) : + (((spanningTrees K).filter + (fun T => SubtypeSubsetSums.forget K.2 S ⊆ T)).card : ℝ) / + (spanningTrees K).card = + Matrix.det (fun e f : S => + inner ℝ (FreeKernel.edgeVector (edgeEquiv hK e.1).1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector (edgeEquiv hK f.1).1))) := by + have h := code_tree_inclusion_ratio hK root (fun _ => 1) (fun _ => by norm_num) S + simpa only [Finset.prod_const_one, Finset.sum_const, nsmul_eq_mul, mul_one, + codeTransferCurrent_one_eq_finiteKernel] using h + +end CodeTransferKernel +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ConditionalInnovation.lean b/lean/OAI/Probability/SpanningForest/ConditionalInnovation.lean new file mode 100644 index 0000000000000000000000000000000000000000..770845994cea8c4c9424a6894ac43da30a9647d5 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ConditionalInnovation.lean @@ -0,0 +1,186 @@ +import OAI.Probability.SpanningForest.CharacteristicRemainder +import OAI.Probability.SpanningForest.GaussianBoundedCorrection +import OAI.Probability.SpanningForest.GaussianMomentScaling + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.Innovation + +theorem conditional_square_perturbation_le + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} [IsFiniteMeasure P] + (hm : m ≤ mΩ) {Q R : Ω → ℝ} {a : ℝ} + (hQ : Integrable Q P) (hQ2 : Integrable (fun ω => Q ω ^ 2) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ a) : + ∀ᵐ ω ∂P, + |P[fun ω => (Q ω + R ω) ^ 2 | m] ω - P[fun ω => Q ω ^ 2 | m] ω| ≤ + 2 * a * P[fun ω => |Q ω| | m] ω + a ^ 2 := by + have hD2 := GaussianBoundedCorrection.integrable_sq_add_of_bounded hQ.aestronglyMeasurable + hQ2 hR ha hbound + let Δ : Ω → ℝ := fun ω => (Q ω + R ω)^2 - Q ω^2 + have hΔ : Integrable Δ P := hD2.sub hQ2 + have hdom : Integrable (fun ω => 2 * a * |Q ω| + a^2) P := + (hQ.abs.const_mul (2 * a)).add (integrable_const _) + have hmono := condExp_mono (m := m) hΔ.abs hdom (by + filter_upwards [hbound] with ω hω + exact GaussianBoundedCorrection.abs_sq_add_sub_sq_le (Q ω) (R ω) a ha hω) + have hscale : P[fun ω => 2 * a * |Q ω| | m] =ᵐ[P] + (fun ω => 2 * a * P[fun ω => |Q ω| | m] ω) := by + have h := condExp_smul (μ := P) (2 * a) (fun ω => |Q ω|) m + exact h + filter_upwards [abs_condExp_ae_le_condExp_abs (m := m) Δ, hmono, + condExp_sub hD2 hQ2 m, condExp_add (hQ.abs.const_mul (2*a)) (integrable_const (a^2)) m, + hscale] with ω hn hmonoω hsub hadd hscaleω + change |P[Δ | m] ω| ≤ P[fun ω => |Δ ω| | m] ω at hn + change P[Δ | m] ω = P[fun ω => (Q ω + R ω)^2 | m] ω - P[fun ω => Q ω^2 | m] ω at hsub + change P[fun ω => 2*a*|Q ω| + a^2 | m] ω = + P[fun ω => 2*a*|Q ω| | m] ω + P[fun _ => a^2 | m] ω at hadd + rw [hadd, hscaleω, condExp_const hm] at hmonoω + rw [hsub] at hn + exact hn.trans hmonoω + +theorem conditional_cube_perturbation_le + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} [IsFiniteMeasure P] + (hm : m ≤ mΩ) {Q R : Ω → ℝ} {a : ℝ} + (hQ : AEStronglyMeasurable Q P) (hQ3 : Integrable (fun ω => |Q ω| ^ 3) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ a) : + ∀ᵐ ω ∂P, + P[fun ω => |Q ω + R ω| ^ 3 | m] ω ≤ + 4 * (P[fun ω => |Q ω| ^ 3 | m] ω + a ^ 3) := by + have hD3 := GaussianBoundedCorrection.integrable_abs_cube_add_of_bounded hQ hQ3 hR ha hbound + have hdom : Integrable (fun ω => 4 * (|Q ω|^3 + a^3)) P := + (hQ3.add (integrable_const _)).const_mul _ + have hmono := condExp_mono (m := m) hD3 hdom (by + filter_upwards [hbound] with ω hω + exact GaussianBoundedCorrection.abs_add_cube_le (Q ω) (R ω) a ha hω) + have hscale : P[fun ω => 4 * (|Q ω|^3 + a^3) | m] =ᵐ[P] + (fun ω => 4 * P[fun ω => |Q ω|^3 + a^3 | m] ω) := + condExp_smul (μ := P) (4 : ℝ) (fun ω => |Q ω|^3 + a^3) m + filter_upwards [hmono, hscale, condExp_add hQ3 (integrable_const (a^3)) m] + with ω hmonoω hscaleω hadd + change P[fun ω => |Q ω|^3 + a^3 | m] ω = + P[fun ω => |Q ω|^3 | m] ω + P[fun _ => a^3 | m] ω at hadd + rw [hscaleω, hadd, condExp_const hm] at hmonoω + exact hmonoω + +theorem conditional_noise_function_eq_integral + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} [IsFiniteMeasure P] + (hm : m ≤ mΩ) {Q : Ω → ℝ} (hQ : Measurable Q) + (hindep : Indep (MeasurableSpace.comap Q (inferInstance : MeasurableSpace ℝ)) m P) + {f : ℝ → ℝ} (hf : Measurable f) : + P[fun ω => f (Q ω) | m] =ᵐ[P] fun _ => ∫ ω, f (Q ω) ∂P := by + exact condExp_indep_eq hQ.comap_le hm + (hf.comp (comap_measurable Q)).stronglyMeasurable hindep + +theorem conditional_gaussian_bounded_correction_error + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} + (hm : m ≤ mΩ) {Q R : Ω → ℝ} {v : ℝ≥0} {a : ℝ} + (hQ : HasLaw Q (gaussianReal 0 v) P) (hQmeas : Measurable Q) + (hindep : Indep (MeasurableSpace.comap Q (inferInstance : MeasurableSpace ℝ)) m P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ a) + (hcenter : P[fun ω => Q ω + R ω | m] =ᵐ[P] 0) + (hv : (v : ℝ) ≤ 2) : + ∀ᵐ ω ∂P, + ‖P[fun ω => Complex.exp (((Q ω + R ω : ℝ) : ℂ) * Complex.I) | m] ω - + Complex.exp (-(v : ℂ) / 2)‖ ≤ + 16 * (Real.sqrt v ^ 3 * GaussianBoundedCorrection.standardGaussianAbsMoment 3 + a ^ 3) + + (2 * a * Real.sqrt v + a ^ 2) / 2 + (v : ℝ) ^ 2 / 4 := by + let : IsProbabilityMeasure P := hQ.isProbabilityMeasure + have hQi := hQ.hasGaussianLaw.integrable + have hQ2 : Integrable (fun ω => Q ω^2) P := by + simpa only [sq_abs] using gaussian_hasLaw_integrable_abs_pow hQ 2 + have hQ3 := gaussian_hasLaw_integrable_abs_pow hQ 3 + have hRi : Integrable R P := Integrable.of_bound hR a (by + simpa only [Real.norm_eq_abs] using hbound) + have hD2 := GaussianBoundedCorrection.integrable_sq_add_of_bounded hQi.aestronglyMeasurable + hQ2 hR ha hbound + have hD3 := GaussianBoundedCorrection.integrable_abs_cube_add_of_bounded + hQi.aestronglyMeasurable hQ3 hR ha hbound + have hqcond₂ := conditional_noise_function_eq_integral hm hQmeas hindep + (show Measurable (fun x : ℝ => x^2) by fun_prop) + have hqcond₁ := conditional_noise_function_eq_integral hm hQmeas hindep + (show Measurable (fun x : ℝ => |x|) by fun_prop) + have hqcond₃ := conditional_noise_function_eq_integral hm hQmeas hindep + (show Measurable (fun x : ℝ => |x|^3) by fun_prop) + have hsecond : ∀ᵐ ω ∂P, + |P[fun ω => (Q ω + R ω)^2 | m] ω - (v : ℝ)| ≤ 2*a*Real.sqrt v + a^2 := by + filter_upwards [conditional_square_perturbation_le hm hQi hQ2 hR ha hbound, + hqcond₂, hqcond₁] with ω hb h₂ h₁ + rw [h₂, h₁, gaussian_hasLaw_second_moment hQ] at hb + have hc : 0 ≤ 2 * a := mul_nonneg (by norm_num) ha + exact hb.trans (add_le_add + (mul_le_mul_of_nonneg_left (gaussian_hasLaw_absolute_first_moment_le hQ) hc) le_rfl) + have hthird : ∀ᵐ ω ∂P, P[fun ω => |Q ω + R ω|^3 | m] ω ≤ + 4 * (Real.sqrt v^3 * GaussianBoundedCorrection.standardGaussianAbsMoment 3 + a^3) := by + filter_upwards [conditional_cube_perturbation_le hm hQi.aestronglyMeasurable hQ3 hR ha hbound, + hqcond₃] with ω hb h₃ + rw [h₃, GaussianBoundedCorrection.hasLaw_gaussian_abs_moment hQ 3] at hb + exact hb + have h := conditional_characteristic_error hm (hQi.add hRi) hD2 hD3 + v.coe_nonneg hv hcenter hsecond hthird + simpa only [Pi.add_apply, ← mul_assoc, show (4 : ℝ) * 4 = 16 by norm_num] using h + +theorem gaussian_correction_error_rate + {h L σ c : ℝ} (hh : 0 ≤ h) (hh₁ : h ≤ 1) + (hL : 0 ≤ L) (hσ : 0 ≤ σ) : + 16 * (Real.sqrt (h * σ^2)^3 * c + (h*L)^3) + + (2*(h*L)*Real.sqrt (h*σ^2) + (h*L)^2)/2 + (h*σ^2)^2/4 ≤ + (16*(σ^3*c + L^3) + L*σ + L^2/2 + σ^4/4) * (h*Real.sqrt h) := by + have hr₀ : 0 ≤ Real.sqrt h := Real.sqrt_nonneg h + have hr₁ : Real.sqrt h ≤ 1 := Real.sqrt_le_one.mpr hh₁ + have hr₂ : Real.sqrt h ^ 2 = h := Real.sq_sqrt hh + have hhroot : h ≤ Real.sqrt h := by nlinarith + have hh₂ : h^2 ≤ h*Real.sqrt h := by nlinarith + have hh₃ : h^3 ≤ h*Real.sqrt h := by + have h32 : h^3 ≤ h^2 := by nlinarith [mul_nonneg (sq_nonneg h) (sub_nonneg.mpr hh₁)] + exact h32.trans hh₂ + have hroot₃ : Real.sqrt h ^ 3 = h * Real.sqrt h := by + calc + _ = Real.sqrt h ^ 2 * Real.sqrt h := by ring + _ = _ := by rw [hr₂] + calc + _ = 16*σ^3*c*(h*Real.sqrt h) + 16*L^3*h^3 + + L*σ*(h*Real.sqrt h) + (L^2/2)*h^2 + (σ^4/4)*h^2 := by + rw [Real.sqrt_mul hh, Real.sqrt_sq hσ] + simp only [mul_pow, hroot₃] + ring + _ ≤ 16*σ^3*c*(h*Real.sqrt h) + 16*L^3*(h*Real.sqrt h) + + L*σ*(h*Real.sqrt h) + (L^2/2)*(h*Real.sqrt h) + + (σ^4/4)*(h*Real.sqrt h) := by + gcongr + _ = _ := by ring + +theorem conditional_gaussian_increment_error + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} + (hm : m ≤ mΩ) {Q R : Ω → ℝ} {v : ℝ≥0} {h L σ : ℝ} + (hQ : HasLaw Q (gaussianReal 0 v) P) (hQmeas : Measurable Q) + (hindep : Indep (MeasurableSpace.comap Q (inferInstance : MeasurableSpace ℝ)) m P) + (hR : AEStronglyMeasurable R P) (hh : 0 ≤ h) (hh₁ : h ≤ 1) + (hL : 0 ≤ L) (hσ : 0 ≤ σ) (hvariance : (v : ℝ) = h*σ^2) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ h*L) + (hcenter : P[fun ω => Q ω + R ω | m] =ᵐ[P] 0) + (hv : (v : ℝ) ≤ 2) : + ∀ᵐ ω ∂P, + ‖P[fun ω => Complex.exp (((Q ω + R ω : ℝ) : ℂ) * Complex.I) | m] ω - + Complex.exp (-(v : ℂ) / 2)‖ ≤ + (16*(σ^3*GaussianBoundedCorrection.standardGaussianAbsMoment 3 + L^3) + + L*σ + L^2/2 + σ^4/4) * (h*Real.sqrt h) := by + have hlocal := conditional_gaussian_bounded_correction_error hm hQ hQmeas hindep hR + (mul_nonneg hh hL) hbound hcenter hv + filter_upwards [hlocal] with ω hω + apply hω.trans + rw [hvariance] + exact gaussian_correction_error_rate hh hh₁ hL hσ + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ContinuousPathLaw.lean b/lean/OAI/Probability/SpanningForest/ContinuousPathLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4596d22a757878d8851c964a98811173f745fac --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ContinuousPathLaw.lean @@ -0,0 +1,178 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336.ContinuousPathLaw + +variable {I T : Type*} [TopologicalSpace T] + [TopologicalSpace.SeparableSpace T] [Nonempty T] + [MeasurableSpace C(T, ℝ)] [BorelSpace C(T, ℝ)] + [StandardBorelSpace C(T, ℝ)] + +def raw (x : I → C(T, ℝ)) : I → T → ℝ := fun i t => x i t + +def denseEval (x : I → C(T, ℝ)) : I → ℕ → ℝ := + fun i n => x i (TopologicalSpace.denseSeq T n) + +omit [TopologicalSpace.SeparableSpace T] [Nonempty T] + [StandardBorelSpace C(T, ℝ)] in +lemma measurable_raw : Measurable (raw (I := I) (T := T)) := by + apply measurable_pi_iff.mpr + intro i + apply measurable_pi_iff.mpr + intro t + exact (show Continuous (fun x : C(T, ℝ) => x t) by fun_prop).measurable.comp + (measurable_pi_apply i) + +omit [StandardBorelSpace C(T, ℝ)] in +lemma measurable_denseEval : Measurable (denseEval (I := I) (T := T)) := by + apply measurable_pi_iff.mpr + intro i + apply measurable_pi_iff.mpr + intro n + exact (show Continuous (fun x : C(T, ℝ) => + x (TopologicalSpace.denseSeq T n)) by fun_prop).measurable.comp (measurable_pi_apply i) + +omit [MeasurableSpace C(T, ℝ)] [BorelSpace C(T, ℝ)] + [StandardBorelSpace C(T, ℝ)] in +lemma denseEval_injective : Function.Injective (denseEval (I := I) (T := T)) := by + intro x y h + funext i + apply DFunLike.coe_injective + apply (TopologicalSpace.denseRange_denseSeq T).equalizer (x i).continuous (y i).continuous + funext n + exact congrFun (congrFun h i) n + +lemma measurableEmbedding_denseEval [Countable I] : + MeasurableEmbedding (denseEval (I := I) (T := T)) := + measurable_denseEval.measurableEmbedding denseEval_injective + +theorem measure_eq_of_raw [Countable I] {μ ν : Measure (I → C(T, ℝ))} + (h : μ.map raw = ν.map raw) : μ = ν := by + let r : (I → T → ℝ) → I → ℕ → ℝ := + fun x i n => x i (TopologicalSpace.denseSeq T n) + have hr : Measurable r := by + apply measurable_pi_iff.mpr + intro i + apply measurable_pi_iff.mpr + intro n + exact (measurable_pi_apply (TopologicalSpace.denseSeq T n)).comp (measurable_pi_apply i) + apply measurableEmbedding_denseEval.map_injective + calc + μ.map denseEval = (μ.map raw).map r := (Measure.map_map hr measurable_raw).symm + _ = (ν.map raw).map r := congrArg (Measure.map r) h + _ = ν.map denseEval := Measure.map_map hr measurable_raw + +theorem measurable_iff_evaluation [Countable I] {Ω : Type*} [MeasurableSpace Ω] + {X : Ω → I → C(T, ℝ)} : + Measurable X ↔ ∀ i t, Measurable (fun ω => X ω i t) := by + constructor + · intro h i t + exact (measurable_pi_apply t).comp + ((measurable_pi_apply i).comp (measurable_raw.comp h)) + · intro h + apply measurableEmbedding_denseEval.measurable_comp_iff.mp + exact measurable_pi_iff.mpr fun i => measurable_pi_iff.mpr fun n => + h i (TopologicalSpace.denseSeq T n) + +theorem law_eq_of_raw [Countable I] {Ω₁ Ω₂ : Type*} + [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] + {μ : Measure Ω₁} {ν : Measure Ω₂} + {X : Ω₁ → I → C(T, ℝ)} {Y : Ω₂ → I → C(T, ℝ)} + (hX : Measurable X) (hY : Measurable Y) + (h : μ.map (fun ω => raw (X ω)) = ν.map (fun ω => raw (Y ω))) : + μ.map X = ν.map Y := by + apply measure_eq_of_raw + rw [Measure.map_map measurable_raw hX, Measure.map_map measurable_raw hY] + exact h + +theorem decoder_law_eq_of_raw [Countable I] {Ω₁ Ω₂ A : Type*} + [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] [MeasurableSpace A] + {μ : Measure Ω₁} {ν : Measure Ω₂} + {X : Ω₁ → I → C(T, ℝ)} {Y : Ω₂ → I → C(T, ℝ)} + (hX : Measurable X) (hY : Measurable Y) + (h : μ.map (fun ω => raw (X ω)) = ν.map (fun ω => raw (Y ω))) + {D : (I → C(T, ℝ)) → A} (hD : Measurable D) : + μ.map (fun ω => D (X ω)) = ν.map (fun ω => D (Y ω)) := by + have hpath := law_eq_of_raw hX hY h + simpa only [Measure.map_map hD hX, Measure.map_map hD hY, Function.comp_def] using + congrArg (Measure.map D) hpath + +theorem exists_measurable_lift [Countable I] {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} (U : Ω → I → T → ℝ) + (hU : ∀ i t, Measurable (fun ω => U ω i t)) + (hc : ∀ᵐ ω ∂μ, ∀ i, Continuous (U ω i)) : + ∃ X : Ω → I → C(T, ℝ), Measurable X ∧ + (fun ω => raw (X ω)) =ᵐ[μ] U := by + classical + obtain ⟨N, hsub, hNm, hNnull⟩ := exists_measurable_superset_of_null (ae_iff.mp hc) + have hgood (ω : Ω) (hω : ω ∉ N) : ∀ i, Continuous (U ω i) := by + by_contra h + exact hω (hsub h) + let X : Ω → I → C(T, ℝ) := fun ω i => + if h : ω ∈ N then 0 else ⟨U ω i, hgood ω h i⟩ + refine ⟨X, measurable_iff_evaluation.mpr ?_, ?_⟩ + · intro i t + have heq : (fun ω => X ω i t) = + (fun ω => if ω ∈ N then (0 : ℝ) else U ω i t) := by + funext ω + by_cases h : ω ∈ N <;> simp [X, h] + rw [heq] + exact Measurable.ite hNm measurable_const (hU i t) + · have havoid : ∀ᵐ ω ∂μ, ω ∉ N := by + apply ae_iff.mpr + simpa only [not_not, Set.ofPred_mem_eq] using hNnull + filter_upwards [havoid] with ω hω + funext i t + simp [raw, X, hω] + +theorem exists_measurable_lift_of_aemeasurable [Countable I] + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + (U : Ω → I → T → ℝ) + (hU : ∀ i t, AEMeasurable (fun ω => U ω i t) μ) + (hc : ∀ᵐ ω ∂μ, ∀ i, Continuous (U ω i)) : + ∃ X : Ω → I → C(T, ℝ), Measurable X ∧ + (fun ω => raw (X ω)) =ᵐ[μ] U := by + classical + let X : Ω → I → C(T, ℝ) := fun ω i => + if h : ∀ j, Continuous (U ω j) then ⟨U ω i, h i⟩ else 0 + have hraw : (fun ω => raw (X ω)) =ᵐ[μ] U := by + filter_upwards [hc] with ω hω + funext i t + simp [X, raw, hω] + have hd : AEMeasurable (denseEval ∘ X) μ := by + apply aemeasurable_pi_iff.mpr + intro i + apply aemeasurable_pi_iff.mpr + intro n + apply (hU i (TopologicalSpace.denseSeq T n)).congr + filter_upwards [hraw] with ω hω + exact (congrFun (congrFun hω i) (TopologicalSpace.denseSeq T n)).symm + have hX : AEMeasurable X μ := + measurableEmbedding_denseEval.aemeasurable_comp_iff.mp hd + refine ⟨hX.mk X, hX.measurable_mk, ?_⟩ + filter_upwards [hX.ae_eq_mk, hraw] with ω heq hω + rw [← heq] + exact hω + +theorem exists_measurable_lift_with_law [Countable I] + {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + (U : Ω → I → T → ℝ) + (hU : ∀ i t, AEMeasurable (fun ω => U ω i t) μ) + (hc : ∀ᵐ ω ∂μ, ∀ i, Continuous (U ω i)) + {ν : Measure (I → C(T, ℝ))} (hlaw : μ.map U = ν.map raw) : + ∃ X : Ω → I → C(T, ℝ), Measurable X ∧ + (fun ω => raw (X ω)) =ᵐ[μ] U ∧ μ.map X = ν := by + obtain ⟨X, hX, heq⟩ := exists_measurable_lift_of_aemeasurable U hU hc + refine ⟨X, hX, heq, measure_eq_of_raw ?_⟩ + rw [Measure.map_map measurable_raw hX] + exact (Measure.map_congr heq).trans hlaw + +end Problem336.ContinuousPathLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ContinuousPathLimit.lean b/lean/OAI/Probability/SpanningForest/ContinuousPathLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..bffc385d4abb431f8a2351336bf072c69c04ad73 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ContinuousPathLimit.lean @@ -0,0 +1,116 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace Problem336.ContinuousPathLimit + +open Filter MeasureTheory +open scoped Topology + +variable {T Ω : Type*} [TopologicalSpace T] [CompactSpace T] + +def pathLimit (F : ℕ → C(T, ℝ)) : C(T, ℝ) := by + classical + exact if ∃ f, Tendsto F atTop (𝓝 f) then limUnder atTop F else 0 + +omit [CompactSpace T] in + +theorem pathLimit_eq_of_tendsto {F : ℕ → C(T, ℝ)} {f : C(T, ℝ)} + (h : Tendsto F atTop (𝓝 f)) : pathLimit F = f := by + rw [pathLimit, ite_eq_left ⟨f, h⟩] + exact h.limUnder_eq + +theorem tendsto_pathLimit_of_summable {F : ℕ → C(T, ℝ)} (d : ℕ → ℝ) + (hF : ∀ n, dist (F n) (F (n + 1)) ≤ d n) (hd : Summable d) : + Tendsto F atTop (𝓝 (pathLimit F)) := by + obtain ⟨f, hf⟩ := cauchySeq_tendsto_of_complete + (cauchySeq_of_dist_le_of_summable d hF hd) + rwa [pathLimit_eq_of_tendsto hf] + +theorem tendsto_pathLimit_of_eventually_summable {F : ℕ → C(T, ℝ)} (d : ℕ → ℝ) + (hF : ∀ᶠ n in atTop, dist (F n) (F (n + 1)) ≤ d n) (hd : Summable d) : + Tendsto F atTop (𝓝 (pathLimit F)) := by + let d' n := max (dist (F n) (F (n + 1))) (d n) + have heq : d =ᶠ[cofinite] d' := by + rw [Nat.cofinite_eq_atTop] + exact hF.mono (fun n hn => (max_eq_right hn).symm) + exact tendsto_pathLimit_of_summable d' (fun n => le_max_left _ _) + (hd.congr_cofinite heq) + +theorem dist_pathLimit_le_tsum {F : ℕ → C(T, ℝ)} (d : ℕ → ℝ) + (hF : ∀ n, dist (F n) (F (n + 1)) ≤ d n) (hd : Summable d) (n : ℕ) : + dist (F n) (pathLimit F) ≤ ∑' m, d (n + m) := + dist_le_tsum_of_dist_le_of_tendsto d hF hd + (tendsto_pathLimit_of_summable d hF hd) n + +theorem tendsto_eval_pathLimit {F : ℕ → C(T, ℝ)} (d : ℕ → ℝ) + (hF : ∀ n, dist (F n) (F (n + 1)) ≤ d n) (hd : Summable d) (t : T) : + Tendsto (fun n => F n t) atTop (𝓝 (pathLimit F t)) := + (continuous_eval_const t).continuousAt.tendsto.comp + (tendsto_pathLimit_of_summable d hF hd) + +theorem pathLimit_eval_eq_of_eventually {F : ℕ → C(T, ℝ)} (d : ℕ → ℝ) + (hF : ∀ n, dist (F n) (F (n + 1)) ≤ d n) (hd : Summable d) + (t : T) (a : ℝ) (ha : ∀ᶠ n in atTop, F n t = a) : pathLimit F t = a := + tendsto_nhds_unique (tendsto_eval_pathLimit d hF hd t) + (tendsto_const_nhds.congr' (ha.mono (fun _ hn => hn.symm))) + +section Measurability + +variable [MeasurableSpace Ω] + +theorem stronglyMeasurable_pathLimit (F : ℕ → Ω → C(T, ℝ)) + (hF : ∀ n, StronglyMeasurable (F n)) : + StronglyMeasurable (fun ω => pathLimit (fun n => F n ω)) := by + classical + have hc : MeasurableSet {ω | ∃ f, Tendsto (fun n => F n ω) atTop (𝓝 f)} := + StronglyMeasurable.measurableSet_exists_tendsto (l := atTop) hF + unfold pathLimit + exact StronglyMeasurable.ite hc + (StronglyMeasurable.limUnder (l := atTop) hF) stronglyMeasurable_const + +variable [MeasurableSpace C(T, ℝ)] [BorelSpace C(T, ℝ)] + +theorem measurable_pathLimit [SecondCountableTopology C(T, ℝ)] + (F : ℕ → Ω → C(T, ℝ)) (hF : ∀ n, Measurable (F n)) : + Measurable (fun ω => pathLimit (fun n => F n ω)) := + (stronglyMeasurable_pathLimit F (fun n => (hF n).stronglyMeasurable)).measurable + +end Measurability + +open ProbabilityTheory + +variable [MeasurableSpace Ω] {P : Measure Ω} + +theorem ae_tendsto_pathLimit_of_eventually_summable + (F : ℕ → Ω → C(T, ℝ)) (d : ℕ → ℝ) (hd : Summable d) + (hF : ∀ᵐ ω ∂P, ∀ᶠ n in atTop, dist (F n ω) (F (n + 1) ω) ≤ d n) : + ∀ᵐ ω ∂P, Tendsto (fun n => F n ω) atTop + (𝓝 (pathLimit (fun n => F n ω))) := by + filter_upwards [hF] with ω hω + exact tendsto_pathLimit_of_eventually_summable d hω hd + +omit [CompactSpace T] in + +theorem hasLaw_eval_pathLimit {ι : Type*} (times : ι → T) + (F : ℕ → Ω → C(T, ℝ)) (a : Ω → ι → ℝ) (μ : Measure (ι → ℝ)) + (hconv : ∀ᵐ ω ∂P, ∃ f, Tendsto (fun n => F n ω) atTop (𝓝 f)) + (hstab : ∀ᵐ ω ∂P, ∀ i, ∀ᶠ n in atTop, F n ω (times i) = a ω i) + (ha : HasLaw a μ P) : + HasLaw (fun ω i => pathLimit (fun n => F n ω) (times i)) μ P := by + apply ha.congr + filter_upwards [hconv, hstab] with ω hω hs + obtain ⟨f, hf⟩ := hω + funext i + rw [pathLimit_eq_of_tendsto hf] + exact tendsto_nhds_unique + ((continuous_eval_const (times i)).continuousAt.tendsto.comp hf) + (tendsto_const_nhds.congr' ((hs i).mono (fun _ hn => hn.symm))) + +end Problem336.ContinuousPathLimit + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ContinuousPathSampler.lean b/lean/OAI/Probability/SpanningForest/ContinuousPathSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..b750cf46cd8623f4c59a8c1470f41077c6046b4c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ContinuousPathSampler.lean @@ -0,0 +1,67 @@ +import OAI.Probability.SpanningForest.ContinuousPathLaw +import OAI.Probability.SpanningForest.PicardNonnegativeSampler + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.ContinuousPathSampler + +variable {I : Type*} + [MeasurableSpace C(ℝ≥0, ℝ)] [BorelSpace C(ℝ≥0, ℝ)] + +lemma measurable_raw_eval (i : I) : + Measurable (fun p : (I → C(ℝ≥0, ℝ)) × ℝ≥0 => + ContinuousPathLaw.raw p.1 i p.2) := by + have hm : Measurable (fun p : (I → C(ℝ≥0, ℝ)) × ℝ≥0 => (p.1 i, p.2)) := + ((measurable_pi_apply i).comp measurable_fst).prodMk measurable_snd + exact (show Continuous (fun p : C(ℝ≥0, ℝ) × ℝ≥0 => p.1 p.2) by + fun_prop).measurable.comp hm + +theorem hasLaw_of_raw_integral_coupling [Countable I] + {Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} + {ρ : Measure (I → C(ℝ≥0, ℝ))} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsPreBrownianReal (B i) P) + (U : Ω → I → ℝ≥0 → ℝ) + (hU : ∀ i t, AEMeasurable (fun ω => U ω i t) P) + (hUc : ∀ᵐ ω ∂P, ∀ i, Continuous (U ω i)) + (hUlaw : P.map U = ρ.map ContinuousPathLaw.raw) + {fresh : Ω' → I → C(ℝ≥0, ℝ)} (hfresh : HasLaw fresh ρ P') + (b : ℝ → (I → ℝ) → I → ℝ) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) + (Y : Ω → I → ℝ≥0 → ℝ) + (hY : ∀ᵐ ω ∂P, ∀ i, Measurable (Y ω i)) + (heq : ∀ᵐ ω ∂P, ∀ (t : ℝ≥0) i, + Y ω i t = U ω i t + + ∫ s in (0 : ℝ)..(t : ℝ), b s (fun j => Y ω j (Real.toNNReal s)) i) + (hobs : ∀ᵐ ω ∂P, ∀ i (n : ℕ), + Y ω i n = (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω) : + HasLaw (fun ω => PicardSampler.NonnegativeTime.sample + ContinuousPathLaw.raw b (fresh ω)) ν P' := by + obtain ⟨V, hVm, hVeq, hVlaw⟩ := + ContinuousPathLaw.exists_measurable_lift_with_law U hU hUc hUlaw + have hV : HasLaw V ρ P := ⟨hVm.aemeasurable, hVlaw⟩ + apply PicardSampler.NonnegativeTime.hasLaw_of_integral_coupling hX hB hV hfresh + ContinuousPathLaw.raw b measurable_raw_eval hb hbound hL hresponse Y + · filter_upwards [hY] with ω hω + exact ⟨fun i => (V ω i).continuous, hω⟩ + · filter_upwards [heq, hVeq] with ω hω hvω + intro t i + rw [show ContinuousPathLaw.raw (V ω) i t = U ω i t from + congrFun (congrFun hvω i) t] + exact hω t i + · exact hobs + +end Problem336.ContinuousPathSampler + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CoordinateTruncation.lean b/lean/OAI/Probability/SpanningForest/CoordinateTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..696dc94f107911d099385bc3794a94349e18eed1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CoordinateTruncation.lean @@ -0,0 +1,153 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter +open scoped BigOperators Topology ENNReal + +namespace Problem336.CoordinateTruncation + +variable {ι 𝕜 : Type*} [DecidableEq ι] [RCLike 𝕜] + +abbrev Space (ι 𝕜 : Type*) [RCLike 𝕜] := lp (fun _ : ι => 𝕜) 2 + +def truncate (s : Finset ι) : Space ι 𝕜 →L[𝕜] Space ι 𝕜 := + ∑ i ∈ s, (lp.singleContinuousLinearMap 𝕜 (fun _ : ι => 𝕜) 2 i).comp + (lp.evalCLM 𝕜 (fun _ : ι => 𝕜) 2 i) + +lemma truncate_eq_sum (s : Finset ι) (x : Space ι 𝕜) : + truncate s x = ∑ i ∈ s, lp.single 2 i (x i) := by + simp only [truncate, sum_apply, ContinuousLinearMap.comp_apply, + lp.singleContinuousLinearMap_apply] + rfl + +@[simp] theorem truncate_apply (s : Finset ι) (x : Space ι 𝕜) (i : ι) : + truncate s x i = if i ∈ s then x i else 0 := by + rw [truncate_eq_sum] + simp only [lp.coeFn_sum, Finset.sum_apply, lp.single_apply, Finset.sum_pi_single] + +theorem tendsto_truncate (s : ℕ → Finset ι) (hmono : Monotone s) + (hcover : ∀ i, ∃ n, i ∈ s n) (x : Space ι 𝕜) : + Tendsto (fun n => truncate (s n) x) atTop (𝓝 x) := by + simpa only [truncate_eq_sum, Function.comp_def] using + (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ⊤) x).comp + (hmono.tendsto_atTop_finset hcover) + +def supported (s : Set ι) : Submodule 𝕜 (Space ι 𝕜) where + carrier := {x | ∀ i, i ∉ s → x i = 0} + zero_mem' := by simp + add_mem' := by intro x y hx hy i hi; simp [hx i hi, hy i hi] + smul_mem' := by intro c x hx i hi; simp [hx i hi] + +omit [DecidableEq ι] in +@[simp] theorem mem_supported (s : Set ι) (x : Space ι 𝕜) : + x ∈ supported s ↔ ∀ i, i ∉ s → x i = 0 := Iff.rfl + +omit [DecidableEq ι] in +theorem supported_mono {s t : Set ι} (h : s ⊆ t) : + supported (𝕜 := 𝕜) s ≤ supported t := by + intro x hx i hi + exact hx i (fun hs => hi (h hs)) + +instance supported_isClosed (s : Set ι) : + IsClosed (supported (𝕜 := 𝕜) s : Set (Space ι 𝕜)) := by + change IsClosed {x : Space ι 𝕜 | ∀ i, i ∉ s → x i = 0} + simp only [Set.ofPred_forall] + apply isClosed_iInter + intro i + apply isClosed_iInter + intro hi + exact isClosed_eq ((continuous_apply i).comp lp.uniformContinuous_coe.continuous) + continuous_const + +instance supported_completeSpace (s : Set ι) : + CompleteSpace (supported (𝕜 := 𝕜) s) := IsClosed.completeSpace_coe + +instance supported_hasOrthogonalProjection (s : Set ι) : + (supported (𝕜 := 𝕜) s).HasOrthogonalProjection := inferInstance + +theorem single_mem_supported {s : Set ι} {i : ι} (hi : i ∈ s) (a : 𝕜) : + lp.single 2 i a ∈ supported s := by + intro j hj + have hji : j ≠ i := by intro h; subst j; exact hj hi + simp [lp.single_apply, Pi.single_eq_of_ne hji] + +theorem supported_starProjection_apply (s : Set ι) [DecidablePred (· ∈ s)] (x : Space ι 𝕜) (i : ι) : + (supported s).starProjection x i = if i ∈ s then x i else 0 := by + classical + by_cases hi : i ∈ s + · rw [ite_eq_left hi] + have ho := (supported s).sub_starProjection_mem_orthogonal x + (lp.single 2 i (1 : 𝕜)) (single_mem_supported hi 1) + rw [lp.inner_single_left] at ho + simpa using (sub_eq_zero.mp (by simpa using ho) : + x i = (supported s).starProjection x i).symm + · rw [ite_eq_right hi] + exact (supported s).starProjection_apply_mem x i hi + +theorem truncate_mem_supported (s : Finset ι) (x : Space ι 𝕜) : + truncate s x ∈ supported (s : Set ι) := by + intro i hi + simp only [Finset.mem_coe] at hi + simp [hi] + +theorem sub_truncate_mem_orthogonal (s : Finset ι) (x : Space ι 𝕜) : + x - truncate s x ∈ (supported (s : Set ι))ᗮ := by + intro y hy + rw [lp.inner_eq_tsum] + have hz : ∀ i, inner 𝕜 (y i) ((x - truncate s x) i) = 0 := by + intro i + by_cases hi : i ∈ s + · simp [hi] + · have hyi : y i = 0 := hy i hi + simp [hyi] + simp only [hz, tsum_zero] + +theorem starProjection_supported (s : Finset ι) : + (supported (𝕜 := 𝕜) (s : Set ι)).starProjection = truncate s := by + apply ContinuousLinearMap.ext + intro x + exact Submodule.eq_starProjection_of_mem_orthogonal + (truncate_mem_supported s x) (sub_truncate_mem_orthogonal s x) + +theorem closure_iSup_supported (s : ℕ → Finset ι) (S : Set ι) + (hcover : ∀ i, i ∈ S ↔ ∃ n, i ∈ s n) : + (⨆ n, supported (𝕜 := 𝕜) (s n : Set ι)).topologicalClosure = supported S := by + apply le_antisymm + · apply Submodule.topologicalClosure_minimal + · apply iSup_le + intro n + apply supported_mono + intro i hi + exact (hcover i).mpr ⟨n, hi⟩ + · exact supported_isClosed S + · intro x hx + rw [← SetLike.mem_coe, Submodule.topologicalClosure_coe] + apply mem_closure_of_tendsto + (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ⊤) x) + apply Eventually.of_forall + intro t + apply Submodule.sum_mem + intro i hi + by_cases his : i ∈ S + · obtain ⟨n, hin⟩ := (hcover i).mp his + exact Submodule.mem_iSup_of_mem n (single_mem_supported hin (x i)) + · simp only [hx i his, lp.single_zero] + exact Submodule.zero_mem _ + +theorem tendsto_truncate_supported (s : ℕ → Finset ι) (hmono : Monotone s) + (S : Set ι) (hcover : ∀ i, i ∈ S ↔ ∃ n, i ∈ s n) (x : Space ι 𝕜) : + Tendsto (fun n => truncate (s n) x) atTop + (𝓝 ((supported S).starProjection x)) := by + have h := Submodule.starProjection_tendsto_closure_iSup + (fun n => supported (𝕜 := 𝕜) (s n : Set ι)) + (fun m n hmn => supported_mono (hmono hmn)) x + simpa only [starProjection_supported, closure_iSup_supported s S hcover] using h + +end Problem336.CoordinateTruncation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CountableBrownian.lean b/lean/OAI/Probability/SpanningForest/CountableBrownian.lean new file mode 100644 index 0000000000000000000000000000000000000000..bafda46494132aa59893f0fff895affa2a2aa50e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CountableBrownian.lean @@ -0,0 +1,134 @@ +import OAI.Probability.SpanningForest.CountableProjective + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Finset +open scoped NNReal + +namespace Problem336.CountableBrownian + +open BrownianReal + +def pullbackTimes (τ : ℕ → ℝ≥0) (I : Finset ℕ) : + ((I.image τ) → ℝ) → (I → ℝ) := + fun x i => x ⟨τ i, Finset.mem_image.mpr ⟨i, i.property, rfl⟩⟩ + +@[fun_prop] +lemma measurable_pullbackTimes (τ : ℕ → ℝ≥0) (I : Finset ℕ) : + Measurable (pullbackTimes τ I) := by + exact Measurable.of_eval (fun i => measurable_pi_apply _) + +def family (τ : ℕ → ℝ≥0) (I : Finset ℕ) : Measure (I → ℝ) := + (projectiveFamily (I.image τ)).map (pullbackTimes τ I) + +instance family_probability (τ : ℕ → ℝ≥0) (I : Finset ℕ) : + IsProbabilityMeasure (family τ I) := by + unfold family + infer_instance + +instance family_isGaussian (τ : ℕ → ℝ≥0) (I : Finset ℕ) : + IsGaussian (family τ I) := by + let L : ((I.image τ) → ℝ) →L[ℝ] (I → ℝ) := + ContinuousLinearMap.pi (fun i => ContinuousLinearMap.proj + ⟨τ i, Finset.mem_image.mpr ⟨i, i.property, rfl⟩⟩) + have h : HasGaussianLaw (pullbackTimes τ I) (projectiveFamily (I.image τ)) := + (IsGaussian.hasGaussianLaw_id (μ := projectiveFamily (I.image τ))).map L + exact h.isGaussian_map + +lemma family_projective (τ : ℕ → ℝ≥0) : + IsProjectiveMeasureFamily (α := fun _ : ℕ => ℝ) (family τ) := by + classical + intro I J hJI + unfold family + rw [isProjectiveMeasureFamily_projectiveFamily (I.image τ) (J.image τ) + (Finset.image_subset_image hJI)] + rw [Measure.map_map (measurable_pullbackTimes τ J) + (Finset.measurable_restrict₂ (X := fun _ : ℝ≥0 => ℝ) (Finset.image_subset_image hJI)), + Measure.map_map (Finset.measurable_restrict₂ (X := fun _ : ℕ => ℝ) hJI) (measurable_pullbackTimes τ I)] + congr 1 + +theorem exists_countable_brownian_law (τ : ℕ → ℝ≥0) : + ∃ μ : Measure (ℕ → ℝ), IsProbabilityMeasure μ ∧ + IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ) := + CountableProjective.exists_projectiveLimit (family τ) (family_projective τ) + +theorem hasLaw_increment {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ)) (i j : ℕ) : + HasLaw (fun ω => ω i - ω j) (gaussianReal 0 (nndist (τ i) (τ j))) μ := by + classical + let I : Finset ℕ := {i, j} + let a : I := ⟨i, by simp [I]⟩ + let b : I := ⟨j, by simp [I]⟩ + have hX : HasLaw (pullbackTimes τ I) (family τ I) + (projectiveFamily (I.image τ)) := + ⟨(measurable_pullbackTimes τ I).aemeasurable, rfl⟩ + have hY : HasLaw I.restrict (family τ I) μ := + ⟨(Finset.measurable_restrict I).aemeasurable, hμ I⟩ + have hD : HasLaw (fun x => pullbackTimes τ I x a - pullbackTimes τ I x b) + (gaussianReal 0 (nndist (τ i) (τ j))) (projectiveFamily (I.image τ)) := + (measurePreserving_eval_sub_eval_projectiveFamily (I.image τ) + ⟨τ i, Finset.mem_image.mpr ⟨i, by simp [I], rfl⟩⟩ + ⟨τ j, Finset.mem_image.mpr ⟨j, by simp [I], rfl⟩⟩).hasLaw + exact HasLaw.comp_of_hasLaw_comp (f := fun x : I → ℝ => x a - x b) + (by fun_prop) hX hY hD + +theorem hasLaw_eval {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ)) (i : ℕ) : + HasLaw (fun ω => ω i) (gaussianReal 0 (τ i)) μ := by + classical + let I : Finset ℕ := {i} + let a : I := ⟨i, by simp [I]⟩ + have hX : HasLaw (pullbackTimes τ I) (family τ I) + (projectiveFamily (I.image τ)) := + ⟨(measurable_pullbackTimes τ I).aemeasurable, rfl⟩ + have hY : HasLaw I.restrict (family τ I) μ := + ⟨(Finset.measurable_restrict I).aemeasurable, hμ I⟩ + have hE : HasLaw (fun x => pullbackTimes τ I x a) + (gaussianReal 0 (τ i)) (projectiveFamily (I.image τ)) := + (measurePreserving_eval_projectiveFamily + ⟨τ i, Finset.mem_image.mpr ⟨i, by simp [I], rfl⟩⟩).hasLaw + exact HasLaw.comp_of_hasLaw_comp (f := fun x : I → ℝ => x a) + (measurable_pi_apply a).aemeasurable hX hY hE + +theorem isGaussianProcess {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ)) : + IsGaussianProcess (fun i ω => ω i) μ where + hasGaussianLaw I := + (show HasLaw I.restrict (family τ I) μ from + ⟨(Finset.measurable_restrict I).aemeasurable, hμ I⟩).hasGaussianLaw + +lemma integral_eval {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ)) (i : ℕ) : + ∫ ω, ω i ∂μ = 0 := by + rw [(hasLaw_eval hμ i).integral_eq, integral_id_gaussianReal] + +lemma covariance_eval {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (family τ)) (i j : ℕ) : + cov[fun ω => ω i, fun ω => ω j; μ] = min (τ i : ℝ) (τ j : ℝ) := by + classical + let I : Finset ℕ := {i, j} + let a : I := ⟨i, by simp [I]⟩ + let b : I := ⟨j, by simp [I]⟩ + have hX : HasLaw (pullbackTimes τ I) (family τ I) + (projectiveFamily (I.image τ)) := + ⟨(measurable_pullbackTimes τ I).aemeasurable, rfl⟩ + have hY : HasLaw I.restrict (family τ I) μ := + ⟨(Finset.measurable_restrict I).aemeasurable, hμ I⟩ + calc + cov[fun ω => ω i, fun ω => ω j; μ] = + cov[fun x : I → ℝ => x a, fun x : I → ℝ => x b; family τ I] := + hY.covariance_fun_comp (measurable_pi_apply a).aemeasurable + (measurable_pi_apply b).aemeasurable + _ = cov[fun x => pullbackTimes τ I x a, fun x => pullbackTimes τ I x b; + projectiveFamily (I.image τ)] := + (hX.covariance_fun_comp (measurable_pi_apply a).aemeasurable + (measurable_pi_apply b).aemeasurable).symm + _ = min (τ i : ℝ) (τ j : ℝ) := covariance_eval_projectiveFamily _ _ _ + +end Problem336.CountableBrownian + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CountableProjective.lean b/lean/OAI/Probability/SpanningForest/CountableProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e1148811300d1ddd2d7fe4cf9575b99e1b021aa --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CountableProjective.lean @@ -0,0 +1,102 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Finset Preorder +open scoped ENNReal + +namespace Problem336.CountableProjective + +variable {X : Type*} [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] + +abbrev Prefix (X : Type*) (n : ℕ) := Finset.Iic n → X + +def stepEquiv (n : ℕ) : (Prefix X n × X) ≃ᵐ Prefix X (n + 1) := + ((MeasurableEquiv.refl (Prefix X n)).prodCongr + (MeasurableEquiv.piSingleton (X := fun _ => X) n)).trans + (MeasurableEquiv.IicProdIoc (X := fun _ => X) n.le_succ) + +omit [StandardBorelSpace X] [Nonempty X] in +lemma stepEquiv_symm_fst (n : ℕ) (x : Prefix X (n + 1)) : + ((stepEquiv n).symm x).1 = frestrictLe₂ (π := fun _ => X) n.le_succ x := rfl + +variable (P : (n : ℕ) → Measure (Prefix X n)) [probabilityPrefixes : ∀ n, IsProbabilityMeasure (P n)] + +def stepLaw (n : ℕ) : Measure (Prefix X n × X) := + (P (n + 1)).map (stepEquiv n).symm + +instance stepLaw_probability (n : ℕ) : IsProbabilityMeasure (stepLaw P n) := by + unfold stepLaw + infer_instance + +def transition (n : ℕ) : Kernel (Prefix X n) X := + (stepLaw P n).condKernel + +instance transition_markov (n : ℕ) : IsMarkovKernel (transition P n) := by + unfold transition + infer_instance + +variable (hP : ∀ n, (P (n + 1)).map (frestrictLe₂ (π := fun _ => X) n.le_succ) = P n) + +include hP + +omit [StandardBorelSpace X] [Nonempty X] [∀ n, IsProbabilityMeasure (P n)] in +lemma stepLaw_fst (n : ℕ) : (stepLaw P n).fst = P n := by + rw [Measure.fst, stepLaw, Measure.map_map measurable_fst (stepEquiv n).symm.measurable] + exact hP n + +include probabilityPrefixes in +lemma compProd_transition (n : ℕ) : P n ⊗ₘ transition P n = stepLaw P n := by + rw [← stepLaw_fst P hP n] + exact (stepLaw P n).disintegrate (stepLaw P n).condKernel + +lemma partialTraj_step (n : ℕ) : + Kernel.partialTraj (X := fun _ => X) (transition P) n (n + 1) ∘ₘ P n = P (n + 1) := by + have hg : Measurable (IicProdIoc (X := fun _ => X) n (n + 1)) := + measurable_IicProdIoc + rw [Kernel.partialTraj_succ_self, + ← Measure.map_comp _ _ hg, + ← Measure.compProd_eq_comp_prod, + Measure.compProd_map (MeasurableEquiv.piSingleton (X := fun _ => X) n).measurable, + compProd_transition P hP n, + Measure.map_map hg + (measurable_id.prodMap (MeasurableEquiv.piSingleton (X := fun _ => X) n).measurable)] + change (stepLaw P n).map (stepEquiv n) = P (n + 1) + exact (stepEquiv n).map_map_symm + +lemma partialTraj_initial (n : ℕ) : + Kernel.partialTraj (X := fun _ => X) (transition P) 0 n ∘ₘ P 0 = P n := by + induction n with + | zero => rw [Kernel.partialTraj_self, Measure.id_comp] + | succ n ih => + rw [Kernel.partialTraj_succ_eq_comp (Nat.zero_le n), + ← Measure.comp_assoc, ih, partialTraj_step P hP n] + +theorem exists_measure_prefix : + ∃ μ : Measure (ℕ → X), IsProbabilityMeasure μ ∧ + ∀ n, μ.map (frestrictLe (π := fun _ => X) n) = P n := by + let μ : Measure (ℕ → X) := Kernel.traj (X := fun _ => X) (transition P) 0 ∘ₘ P 0 + refine ⟨μ, inferInstance, ?_⟩ + intro n + change (Kernel.traj (X := fun _ => X) (transition P) 0 ∘ₘ P 0).map (frestrictLe n) = P n + rw [Measure.map_comp _ _ (measurable_frestrictLe n), + Kernel.traj_map_frestrictLe] + exact partialTraj_initial P hP n + +omit hP + +theorem exists_projectiveLimit + (Q : (s : Finset ℕ) → Measure (s → X)) [∀ s, IsProbabilityMeasure (Q s)] + (hQ : IsProjectiveMeasureFamily (α := fun _ : ℕ => X) Q) : + ∃ μ : Measure (ℕ → X), IsProbabilityMeasure μ ∧ IsProjectiveLimit (α := fun _ : ℕ => X) μ Q := by + obtain ⟨μ, hμ, hmarg⟩ := exists_measure_prefix (fun n => Q (Iic n)) + (fun n => (hQ (Iic (n + 1)) (Iic n) (Iic_subset_Iic.mpr n.le_succ)).symm) + exact ⟨μ, hμ, (isProjectiveLimit_nat_iff hQ μ).mpr hmarg⟩ + +end Problem336.CountableProjective + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CylinderKernel.lean b/lean/OAI/Probability/SpanningForest/CylinderKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..70c42fa2fd32c6a366230ba42647d759656ccf40 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CylinderKernel.lean @@ -0,0 +1,149 @@ +import OAI.Probability.SpanningForest.CylinderLimitMeasure +import OAI.Probability.SpanningForest.BinaryWeakConvergence + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336.CylinderKernel + +def cylinder {I : Type*} (A B : Finset I) : Set (I → Bool) := + {x | (∀ i ∈ A, x i = true) ∧ (∀ i ∈ B, x i = false)} + +def cylinders (I : Type*) : Set (Set (I → Bool)) := + {s | ∃ A B : Finset I, s = cylinder A B} + +lemma isPiSystem_cylinders (I : Type*) : IsPiSystem (cylinders I) := by + classical + rintro s ⟨A, B, rfl⟩ t ⟨C, D, rfl⟩ _ + refine ⟨A ∪ C, B ∪ D, ?_⟩ + ext x + simp only [cylinder, Set.mem_inter_iff, Set.mem_ofPred_eq, + Finset.mem_union, or_imp, forall_and] + tauto + +lemma generateFrom_cylinders (I : Type*) [Countable I] : + MeasurableSpace.generateFrom (cylinders I) = + (inferInstance : MeasurableSpace (I → Bool)) := by + classical + apply le_antisymm + · apply MeasurableSpace.generateFrom_le + rintro s ⟨A, B, rfl⟩ + exact (Problem336.isClopen_boolCylinder A B).isOpen.measurableSet + · have hid : @Measurable (I → Bool) (I → Bool) + (MeasurableSpace.generateFrom (cylinders I)) inferInstance id := by + refine @Measurable.of_eval (I → Bool) I (fun _ => Bool) + (MeasurableSpace.generateFrom (cylinders I)) (fun _ => inferInstance) id ?_ + intro i + apply measurable_to_bool + apply MeasurableSpace.measurableSet_generateFrom + refine ⟨{i}, ∅, ?_⟩ + ext x + simp [cylinder] + intro s hs + exact hid hs + +theorem measurable_probabilityMeasure_of_cylinders + {X I : Type*} [MeasurableSpace X] [Countable I] + (μ : X → ProbabilityMeasure (I → Bool)) + (hμ : ∀ A B : Finset I, + Measurable (fun x => (μ x : Measure (I → Bool)) (cylinder A B))) : + Measurable μ := by + have h : Measurable (fun x => (μ x : Measure (I → Bool))) := by + apply Measurable.measure_of_isPiSystem_of_isProbabilityMeasure + (generateFrom_cylinders I).symm (isPiSystem_cylinders I) + rintro s ⟨A, B, rfl⟩ + exact hμ A B + exact h.subtype_mk + +theorem exists_measurable_probabilityMeasure_of_cylinder_limits + {X I : Type*} [MeasurableSpace X] [Countable I] + (μn : ℕ → X → ProbabilityMeasure (I → Bool)) + (L : X → Finset I → Finset I → ℝ≥0∞) + (hLm : ∀ A B, Measurable (fun x => L x A B)) + (hL : ∀ x A B, Tendsto + (fun n => (μn n x : Measure (I → Bool)) (cylinder A B)) + atTop (𝓝 (L x A B))) : + ∃ μ : X → ProbabilityMeasure (I → Bool), Measurable μ ∧ + ∀ x A B, (μ x : Measure (I → Bool)) (cylinder A B) = L x A B := by + have hex (x : X) := Problem336.exists_probabilityMeasure_of_boolCylinder_limits + (fun n => μn n x) (L x) (hL x) + choose μ hμ using hex + refine ⟨μ, measurable_probabilityMeasure_of_cylinders μ (fun A B => ?_), hμ⟩ + convert hLm A B using 1 + funext x + exact hμ x A B + +def positiveCylinders (I : Type*) : Set (Set (I → Bool)) := + {s | ∃ A : Finset I, s = {x | ∀ i ∈ A, x i = true}} + +lemma isPiSystem_positiveCylinders (I : Type*) : IsPiSystem (positiveCylinders I) := by + classical + rintro s ⟨A, rfl⟩ t ⟨B, rfl⟩ _ + refine ⟨A ∪ B, ?_⟩ + ext x + simp only [Set.mem_inter_iff, Set.mem_ofPred_eq, Finset.mem_union, or_imp, forall_and] + +lemma generateFrom_positiveCylinders (I : Type*) [Countable I] : + MeasurableSpace.generateFrom (positiveCylinders I) = + (inferInstance : MeasurableSpace (I → Bool)) := by + classical + apply le_antisymm + · apply MeasurableSpace.generateFrom_le + rintro s ⟨A, rfl⟩ + have hS : IsClopen {x : I → Bool | ∀ i ∈ A, x i = true} := by + simpa using Problem336.isClopen_boolCylinder A ∅ + exact hS.isOpen.measurableSet + · have hid : @Measurable (I → Bool) (I → Bool) + (MeasurableSpace.generateFrom (positiveCylinders I)) inferInstance id := by + refine @Measurable.of_eval (I → Bool) I (fun _ => Bool) + (MeasurableSpace.generateFrom (positiveCylinders I)) (fun _ => inferInstance) id ?_ + intro i + apply measurable_to_bool + apply MeasurableSpace.measurableSet_generateFrom + refine ⟨{i}, ?_⟩ + ext x + simp + intro s hs + exact hid hs + +theorem measurable_probabilityMeasure_of_positiveCylinders + {X I : Type*} [MeasurableSpace X] [Countable I] + (μ : X → ProbabilityMeasure (I → Bool)) + (hμ : ∀ A : Finset I, + Measurable (fun x => (μ x : Measure (I → Bool)) {z | ∀ i ∈ A, z i = true})) : + Measurable μ := by + have h : Measurable (fun x => (μ x : Measure (I → Bool))) := by + apply Measurable.measure_of_isPiSystem_of_isProbabilityMeasure + (generateFrom_positiveCylinders I).symm (isPiSystem_positiveCylinders I) + rintro s ⟨A, rfl⟩ + exact hμ A + exact h.subtype_mk + +theorem exists_measurable_weakLimit_of_positiveCylinder_limits + {X I : Type*} [MeasurableSpace X] [Countable I] + (μn : ℕ → X → ProbabilityMeasure (I → Bool)) + (L : X → Finset I → ℝ≥0∞) + (hLm : ∀ A, Measurable (fun x => L x A)) + (hL : ∀ x A, Tendsto + (fun n => (μn n x : Measure (I → Bool)) {z | ∀ i ∈ A, z i = true}) + atTop (𝓝 (L x A))) : + ∃ μ : X → ProbabilityMeasure (I → Bool), Measurable μ ∧ + (∀ x A, (μ x : Measure (I → Bool)) {z | ∀ i ∈ A, z i = true} = L x A) ∧ + ∀ x, Tendsto (fun n => μn n x) atTop (𝓝 (μ x)) := by + have hex (x : X) := BinaryLaw.exists_weakLimit_of_positiveCylinder_limits + (fun n => μn n x) (L x) (hL x) + choose μ hμ hw using hex + refine ⟨μ, measurable_probabilityMeasure_of_positiveCylinders μ (fun A => ?_), hμ, hw⟩ + convert hLm A using 1 + funext x + exact hμ x A + +end Problem336.CylinderKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/CylinderLimitMeasure.lean b/lean/OAI/Probability/SpanningForest/CylinderLimitMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..1bed5e2ec6585e2970f763ff3ff99b933334fbed --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/CylinderLimitMeasure.lean @@ -0,0 +1,96 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336 + +theorem clopen_measure_eq_of_mapClusterPt + {E : Type*} [MeasurableSpace E] [TopologicalSpace E] + [OpensMeasurableSpace E] [HasOuterApproxClosed E] + {α : Type*} {F : Filter α} {μs : α → ProbabilityMeasure E} + {μ : ProbabilityMeasure E} (hμ : MapClusterPt μ F μs) + {S : Set E} (hS : IsClopen S) {L : ℝ≥0∞} + (hL : Tendsto (fun a => (μs a : Measure E) S) F (𝓝 L)) : + (μ : Measure E) S = L := by + let G := 𝓝 μ ⊓ Filter.map μs F + have : G.NeBot := hμ.neBot + have ht : Tendsto (id : ProbabilityMeasure E → ProbabilityMeasure E) G (𝓝 μ) := by + change G ≤ 𝓝 μ + exact inf_le_left + have hv := ProbabilityMeasure.tendsto_measure_of_isClopen_of_tendsto ht hS + have hev : Tendsto (fun ν : ProbabilityMeasure E => (ν : Measure E) S) G + (𝓝 ((μ : Measure E) S)) := by + simpa only [ProbabilityMeasure.ennreal_coeFn_eq_coeFn_toMeasure, id_eq, + Function.comp_def] using (ENNReal.continuous_coe.tendsto _).comp hv + have hl : Tendsto (fun ν : ProbabilityMeasure E => (ν : Measure E) S) + (Filter.map μs F) (𝓝 L) := tendsto_map'_iff.mpr hL + exact tendsto_nhds_unique hev (hl.mono_left inf_le_right) + +theorem exists_probabilityMeasure_of_clopen_limits + {E : Type*} [MeasurableSpace E] [TopologicalSpace E] + [T2Space E] [CompactSpace E] [BorelSpace E] [HasOuterApproxClosed E] + {ι : Type*} (μn : ℕ → ProbabilityMeasure E) + (S : ι → Set E) (hS : ∀ i, IsClopen (S i)) (L : ι → ℝ≥0∞) + (hL : ∀ i, Tendsto (fun n => (μn n : Measure E) (S i)) atTop (𝓝 (L i))) : + ∃ μ : ProbabilityMeasure E, ∀ i, (μ : Measure E) (S i) = L i := by + obtain ⟨μ, hμ⟩ := exists_clusterPt_of_compactSpace (Filter.map μn atTop) + exact ⟨μ, fun i => clopen_measure_eq_of_mapClusterPt hμ (hS i) (hL i)⟩ + +theorem exists_probabilityMeasure_tendsto_of_clopen_limits + {E : Type*} [MeasurableSpace E] [TopologicalSpace E] + [T2Space E] [CompactSpace E] [BorelSpace E] [HasOuterApproxClosed E] + {ι : Type*} (μn : ℕ → ProbabilityMeasure E) + (S : ι → Set E) (hS : ∀ i, IsClopen (S i)) + (hsep : ∀ μ ν : ProbabilityMeasure E, + (∀ i, (μ : Measure E) (S i) = (ν : Measure E) (S i)) → μ = ν) + (L : ι → ℝ≥0∞) + (hL : ∀ i, Tendsto (fun n => (μn n : Measure E) (S i)) atTop (𝓝 (L i))) : + ∃ μ : ProbabilityMeasure E, + (∀ i, (μ : Measure E) (S i) = L i) ∧ Tendsto μn atTop (𝓝 μ) := by + obtain ⟨μ, hμ⟩ := exists_probabilityMeasure_of_clopen_limits μn S hS L hL + refine ⟨μ, hμ, tendsto_nhds_of_unique_mapClusterPt (fun ν hν => ?_)⟩ + exact hsep ν μ fun i => + (clopen_measure_eq_of_mapClusterPt hν (hS i) (hL i)).trans (hμ i).symm + +theorem isClopen_boolCylinder {I : Type*} (A B : Finset I) : + IsClopen {x : I → Bool | + (∀ i ∈ A, x i = true) ∧ (∀ i ∈ B, x i = false)} := by + have h (s : Finset I) (b : Bool) : + IsClopen {x : I → Bool | ∀ i ∈ s, x i = b} := by + have heq : {x : I → Bool | ∀ i ∈ s, x i = b} = + ⋂ i ∈ s, (fun x : I → Bool => x i) ⁻¹' {b} := by + ext x + simp + rw [heq] + exact isClopen_biInter_finset fun i _ => + (isClopen_discrete ({b} : Set Bool)).preimage (continuous_apply i) + exact (h A true).inter (h B false) + +theorem exists_probabilityMeasure_of_boolCylinder_limits + {I : Type*} [Countable I] + (μn : ℕ → ProbabilityMeasure (I → Bool)) + (L : Finset I → Finset I → ℝ≥0∞) + (hL : ∀ A B, Tendsto + (fun n => (μn n : Measure (I → Bool)) + {x | (∀ i ∈ A, x i = true) ∧ (∀ i ∈ B, x i = false)}) + atTop (𝓝 (L A B))) : + ∃ μ : ProbabilityMeasure (I → Bool), ∀ A B, + (μ : Measure (I → Bool)) + {x | (∀ i ∈ A, x i = true) ∧ (∀ i ∈ B, x i = false)} = L A B := by + obtain ⟨μ, hμ⟩ := exists_probabilityMeasure_of_clopen_limits μn + (fun p : Finset I × Finset I => + {x | (∀ i ∈ p.1, x i = true) ∧ (∀ i ∈ p.2, x i = false)}) + (fun p => isClopen_boolCylinder p.1 p.2) + (fun p => L p.1 p.2) (fun p => hL p.1 p.2) + exact ⟨μ, fun A B => hμ (A, B)⟩ + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DecoderBundle.lean b/lean/OAI/Probability/SpanningForest/DecoderBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5b48f76b9985cb9ae361d60286b8a987469b2b4 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DecoderBundle.lean @@ -0,0 +1,5 @@ +import OAI.Probability.SpanningForest.CanonicalDecoder +import OAI.Probability.SpanningForest.PicardUniqueness +import OAI.Probability.SpanningForest.DecoderRestriction +import OAI.Probability.SpanningForest.PicardNonnegativeTime +import OAI.Probability.SpanningForest.DecoderPathSpace diff --git a/lean/OAI/Probability/SpanningForest/DecoderPathSpace.lean b/lean/OAI/Probability/SpanningForest/DecoderPathSpace.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d67dc9791d3f5ff00425fb873205066b983f21c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DecoderPathSpace.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SpanningForest.PicardNonnegativeTime + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped Topology NNReal + +namespace Problem336.DecoderPathSpace + +lemma measurable_of_evaluations {α : Type*} [MeasurableSpace α] + [MeasurableSpace C(ℝ≥0, ℝ)] [BorelSpace C(ℝ≥0, ℝ)] + (F : α → C(ℝ≥0, ℝ)) + (hF : ∀ t, Measurable (fun a => F a t)) : Measurable F := by + obtain ⟨S, hS, hd⟩ := TopologicalSpace.exists_countable_dense ℝ≥0 + let : Countable S := hS.to_subtype + let evalS : C(ℝ≥0, ℝ) → S → ℝ := fun p s => p s + have hc : Continuous evalS := by + apply continuous_pi + intro s + exact continuous_eval.comp (continuous_id.prodMk continuous_const) + have hI : Function.Injective evalS := by + intro p q hpq + apply ContinuousMap.ext + have hh : (p : ℝ≥0 → ℝ) = q := + Continuous.ext_on hd p.continuous q.continuous + (fun t ht => congrFun hpq ⟨t, ht⟩) + exact congrFun hh + apply hc.measurableEmbedding hI |>.measurable_comp_iff.mp + exact Measurable.of_eval (fun s => hF s) + +variable {ι : Type*} + +def decodedPath + (w : ι → ℝ≥0 → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) (i : ι) : C(ℝ≥0, ℝ) := + ⟨Picard.NonnegativeTime.decodePath w b i, + Picard.NonnegativeTime.continuous_decodePath w b hw hb hbound hL hresponse i⟩ + +lemma measurable_decodedPath + {α : Type*} [MeasurableSpace α] + [MeasurableSpace C(ℝ≥0, ℝ)] [BorelSpace C(ℝ≥0, ℝ)] + (w : α → ι → ℝ≥0 → ℝ) (b : α → ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ a i, Continuous (w a i)) + (hwm : ∀ i, Measurable (fun p : α × ℝ≥0 => w p.1 i p.2)) + (hbm : ∀ i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => b p.1 p.2.1 p.2.2 i)) + (hb : ∀ a i, Measurable (fun p : ℝ × (ι → ℝ) => b a p.1 p.2 i)) + (hbound : ∀ a t y i, |b a t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ a t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b a t y i - b a t z i| ≤ L * D) (i : ι) : + Measurable (fun a => decodedPath (w a) (b a) (hw a) (hb a) + (hbound a) hL (hresponse a) i) := by + apply measurable_of_evaluations + intro t + have hm := Picard.NonnegativeTime.measurable_decodePath w b hwm hbm i + exact hm.comp (measurable_id.prodMk measurable_const) + +end Problem336.DecoderPathSpace + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DecoderRestriction.lean b/lean/OAI/Probability/SpanningForest/DecoderRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..8facdb9b721be4c8da792e71f3323cacbebfa58b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DecoderRestriction.lean @@ -0,0 +1,68 @@ +import OAI.Probability.SpanningForest.Picard + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology + +namespace Problem336.Picard + +lemma iterate_restrict {ι κ : Type*} (f : κ → ι) + (w : ι → ℝ → ℝ) (v : κ → ℝ → ℝ) + (b : ℝ → (ι → ℝ) → ι → ℝ) (c : ℝ → (κ → ℝ) → κ → ℝ) + (hw : ∀ k t, w (f k) t = v k t) + (hb : ∀ t (y : ι → ℝ) k, b t y (f k) = c t (fun j => y (f j)) k) : + ∀ n k t, iterate w b n (f k) t = iterate v c n k t := by + intro n + induction n with + | zero => exact hw + | succ n ih => + intro k t + simp only [iterate, hw] + congr 1 + apply congrArg (fun g : ℝ → ℝ => ∫ s in (0 : ℝ)..t, g s) + funext s + rw [hb] + have hfield : (fun j => iterate w b n (f j) s) = + (fun j => iterate v c n j s) := by + funext j + exact ih j s + rw [hfield] + +lemma decode_restrict {ι κ : Type*} (f : κ → ι) + (w : ι → ℝ → ℝ) (v : κ → ℝ → ℝ) + (b : ℝ → (ι → ℝ) → ι → ℝ) (c : ℝ → (κ → ℝ) → κ → ℝ) + (hw : ∀ k t, w (f k) t = v k t) + (hb : ∀ t (y : ι → ℝ) k, b t y (f k) = c t (fun j => y (f j)) k) + (k : κ) (t : ℝ) : decode w b (f k) t = decode v c k t := by + unfold decode + congr 1 + funext n + exact iterate_restrict f w v b c hw hb n k t + +lemma iterate_eq_input_of_drift_zero {ι : Type*} + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (i : ι) + (hb : ∀ t y, b t y i = 0) : + ∀ n t, iterate w b n i t = w i t := by + intro n t + cases n with + | zero => rfl + | succ n => simp [iterate, hb] + +lemma decode_eq_input_of_drift_zero {ι : Type*} + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (i : ι) + (hb : ∀ t y, b t y i = 0) (t : ℝ) : decode w b i t = w i t := by + unfold decode + have heq : (fun n => iterate w b n i t) = (fun _ : ℕ => w i t) := by + funext n + exact iterate_eq_input_of_drift_zero w b i hb n t + rw [heq] + exact tendsto_const_nhds.limUnder_eq + +end Problem336.Picard + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Definitions.lean b/lean/OAI/Probability/SpanningForest/Definitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..68fb2602e3ce6fbde5d32a94b8527644e03ad2bc --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Definitions.lean @@ -0,0 +1,163 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators ENNReal Topology + +namespace Problem336 + +abbrev GraphCode := + {a : ℕ → ℕ → Bool // + (∀ u, a u u = false) ∧ (∀ u v, a u v = a v u)} + +abbrev EdgeCode := {p : ℕ × ℕ // p.1 < p.2} + +abbrev EdgeConfiguration := EdgeCode → Bool + +abbrev FactorRule := GraphCode → (ℕ → ℝ) → EdgeCode → Bool + +abbrev FiniteSubgraphCode := Finset ℕ × Finset (ℕ × ℕ) + +def Adj (G : GraphCode) (u v : ℕ) : Prop := G.1 u v = true + +def GraphConnected (G : GraphCode) : Prop := + ∀ u v, Relation.ReflTransGen (fun x y => Adj G x y) u v + +def GraphLocallyFinite (G : GraphCode) : Prop := + ∀ u, Set.Finite {v : ℕ | Adj G u v} + +def mkEdge (u v : ℕ) (h : u ≠ v) : EdgeCode := by + by_cases huv : u < v + · exact ⟨(u, v), huv⟩ + · exact ⟨(v, u), lt_of_le_of_ne (Nat.le_of_not_gt huv) (Ne.symm h)⟩ + +def rawPair (u v : ℕ) : ℕ × ℕ := + if u < v then (u, v) else (v, u) + +def relabelGraph (σ : Equiv ℕ ℕ) (G : GraphCode) : GraphCode := + ⟨fun u v => G.1 (σ.symm u) (σ.symm v), by + constructor + · intro u + exact G.2.1 (σ.symm u) + · intro u v + exact G.2.2 (σ.symm u) (σ.symm v)⟩ + +def relabelLabels (σ : Equiv ℕ ℕ) (U : ℕ → ℝ) : ℕ → ℝ := + fun u => U (σ.symm u) + +def mapEdge (σ : Equiv ℕ ℕ) (e : EdgeCode) : EdgeCode := + mkEdge (σ e.1.1) (σ e.1.2) (by + intro h + apply Nat.ne_of_lt e.2 + exact σ.injective h) + +def RuleBorel (Phi : FactorRule) : Prop := + Measurable + (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => + Phi q.1 q.2.1 q.2.2) + +def RuleEquivariant (Phi : FactorRule) : Prop := + ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Phi (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = + Phi G U e + +def TreeAdj (T : Finset (ℕ × ℕ)) (u v : ℕ) : Prop := + rawPair u v ∈ T + +def SubgraphAdj (K : FiniteSubgraphCode) (u v : ℕ) : Prop := + u ∈ K.1 ∧ v ∈ K.1 ∧ rawPair u v ∈ K.2 + +def TreeOn (K : FiniteSubgraphCode) + (T : Finset (ℕ × ℕ)) : Prop := + T ⊆ K.2 ∧ + T.card + 1 = K.1.card ∧ + ∀ u ∈ K.1, ∀ v ∈ K.1, + Relation.ReflTransGen (TreeAdj T) u v + +def spanningTrees (K : FiniteSubgraphCode) : + Finset (Finset (ℕ × ℕ)) := by + classical + exact K.2.powerset.filter (TreeOn K) + +def ustCylinder (K : FiniteSubgraphCode) + (A B : Finset EdgeCode) : ℝ≥0∞ := by + classical + let all := spanningTrees K + let good := all.filter (fun T => + (∀ e ∈ A, e.1 ∈ T) ∧ (∀ e ∈ B, e.1 ∉ T)) + exact (good.card : ℝ≥0∞) / (all.card : ℝ≥0∞) + +def IsFiniteConnectedSubgraph + (G : GraphCode) (K : FiniteSubgraphCode) : Prop := + K.1.Nonempty ∧ + (∀ p ∈ K.2, + p.1 ∈ K.1 ∧ p.2 ∈ K.1 ∧ p.1 < p.2 ∧ Adj G p.1 p.2) ∧ + ∀ u ∈ K.1, ∀ v ∈ K.1, + Relation.ReflTransGen (SubgraphAdj K) u v + +def IsConnectedExhaustion + (G : GraphCode) (H : ℕ → FiniteSubgraphCode) : Prop := + (∀ n, IsFiniteConnectedSubgraph G (H n)) ∧ + (∀ n, (H n).1 ⊆ (H (n + 1)).1 ∧ + (H n).2 ⊆ (H (n + 1)).2) ∧ + (∀ u v, u < v → Adj G u v → + ∃ n, (u, v) ∈ (H n).2) + +def uniform01 : Measure ℝ := + volume.restrict (Set.Icc (0 : ℝ) 1) + +def IsVertexIID {Ω : Type} [MeasurableSpace Ω] + (P : Measure Ω) (U : ℕ → Ω → ℝ) : Prop := + (∀ i, Measurable (U i)) ∧ + ∀ (s : Finset ℕ) (A : ℕ → Set ℝ), + (∀ i ∈ s, MeasurableSet (A i)) → + P {ω | ∀ i ∈ s, U i ω ∈ A i} = + Finset.prod s (fun i => uniform01 (A i)) + +def HasFUSFLaw {Ω : Type} [MeasurableSpace Ω] + (G : GraphCode) (P : Measure Ω) + (X : Ω → EdgeConfiguration) : Prop := + (∀ e, Measurable (fun ω => X ω e)) ∧ + ∀ (H : ℕ → FiniteSubgraphCode), IsConnectedExhaustion G H → + ∀ (A B : Finset EdgeCode), + Filter.Tendsto + (fun n => ustCylinder (H n) A B) + Filter.atTop + (nhds (P {ω | + (∀ e ∈ A, X ω e = true) ∧ + (∀ e ∈ B, X ω e = false)})) + +def WorksOnGraph (Phi : FactorRule) (G : GraphCode) : Prop := + GraphConnected G → GraphLocallyFinite G → + ∀ (Ω : Type) [MeasurableSpace Ω] (P : Measure Ω) + (U : ℕ → Ω → ℝ), + IsVertexIID P U → + HasFUSFLaw G P + (fun ω e => Phi G (fun v => U v ω) e) + +def TransportEquivariant + (f : GraphCode → ℕ → ℕ → ℝ≥0∞) : Prop := + ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (u v : ℕ), + f (relabelGraph σ G) (σ u) (σ v) = f G u v + +def IsUnimodular (Q : Measure (GraphCode × ℕ)) : Prop := + Q Set.univ = 1 ∧ + ∀ f : GraphCode → ℕ → ℕ → ℝ≥0∞, + Measurable + (fun q : GraphCode × (ℕ × ℕ) => + f q.1 q.2.1 q.2.2) → + TransportEquivariant f → + (∫⁻ x, ∑' v : ℕ, f x.1 x.2 v ∂Q) = + ∫⁻ x, ∑' v : ℕ, f x.1 v x.2 ∂Q + +def GraphLawSupported (Q : Measure (GraphCode × ℕ)) : Prop := + ∀ᵐ x ∂Q, GraphConnected x.1 ∧ GraphLocallyFinite x.1 + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DenseBrownian.lean b/lean/OAI/Probability/SpanningForest/DenseBrownian.lean new file mode 100644 index 0000000000000000000000000000000000000000..99d231a2519047b01770d58d4a071b5e0d1e48ab --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DenseBrownian.lean @@ -0,0 +1,225 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal Topology Matrix + +namespace Problem336.DenseBrownian + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} +variable {X : ℝ≥0 → Ω → ℝ} + +def evaluationChar {ι : Type*} [Fintype ι] (X : ℝ≥0 → Ω → ℝ) (P : Measure Ω) + (a : ι → ℝ) (t : ι → ℝ≥0) : ℂ := + ∫ ω, Complex.exp ((((∑ i, a i * X (t i) ω) : ℝ) : ℂ) * Complex.I) ∂P + +def brownianChar {ι : Type*} [Fintype ι] (a : ι → ℝ) (t : ι → ℝ≥0) : ℂ := + Complex.exp (-(((∑ i, ∑ j, a i * a j * min (t i : ℝ) (t j : ℝ)) : ℝ) : ℂ) / 2) + +lemma continuous_evaluationChar [IsFiniteMeasure P] {ι : Type*} [Fintype ι] + (hX : ∀ t, Measurable (X t)) (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (a : ι → ℝ) : Continuous (evaluationChar X P a) := by + classical + unfold evaluationChar + apply continuous_of_dominated (bound := fun _ => (1 : ℝ)) + · intro t + apply Measurable.aestronglyMeasurable + fun_prop + · intro t + exact Filter.Eventually.of_forall (fun ω => by + rw [Complex.norm_exp_ofReal_mul_I]) + · exact integrable_const 1 + · filter_upwards [hc] with ω hω + have hi (i : ι) : Continuous (fun t : ι → ℝ≥0 => a i * X (t i) ω) := + continuous_const.mul (hω.comp (continuous_apply i)) + fun_prop + +lemma continuous_brownianChar {ι : Type*} [Fintype ι] (a : ι → ℝ) : + Continuous (brownianChar a) := by + unfold brownianChar + fun_prop + +theorem characteristic_of_dense [IsFiniteMeasure P] {D : Set ℝ≥0} (hD : Dense D) + (hX : ∀ t, Measurable (X t)) (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + {ι : Type*} [Fintype ι] (a : ι → ℝ) + (hd : ∀ t : ι → ℝ≥0, (∀ i, t i ∈ D) → + evaluationChar X P a t = brownianChar a t) : + ∀ t : ι → ℝ≥0, evaluationChar X P a t = brownianChar a t := by + have hpi : Dense (Set.pi Set.univ (fun _ : ι => D)) := + dense_pi Set.univ (fun _ _ => hD) + have heq := Continuous.ext_on hpi (continuous_evaluationChar hX hc a) + (continuous_brownianChar a) (fun t ht => hd t (fun i => ht i (Set.mem_univ i))) + exact fun t => congrFun heq t + +lemma evaluationChar_reindex {ι κ : Type*} [Fintype ι] [Fintype κ] + (e : ι ≃ κ) (a : κ → ℝ) (t : κ → ℝ≥0) : + evaluationChar X P (a ∘ e) (t ∘ e) = evaluationChar X P a t := by + unfold evaluationChar + congr 1 + funext ω + simp only [Function.comp_apply] + rw [e.sum_comp (fun i => a i * X (t i) ω)] + +lemma brownianChar_reindex {ι κ : Type*} [Fintype ι] [Fintype κ] + (e : ι ≃ κ) (a : κ → ℝ) (t : κ → ℝ≥0) : + brownianChar (a ∘ e) (t ∘ e) = brownianChar a t := by + unfold brownianChar + simp only [Function.comp_apply] + have hs : (∑ i : ι, ∑ j : ι, + a (e i) * a (e j) * min (t (e i) : ℝ) (t (e j) : ℝ)) = + ∑ i : κ, ∑ j : κ, a i * a j * min (t i : ℝ) (t j : ℝ) := by + calc + _ = ∑ i : ι, ∑ j : κ, a (e i) * a j * min (t (e i) : ℝ) (t j : ℝ) := by + apply Finset.sum_congr rfl + intro i _ + exact e.sum_comp (fun j => a (e i) * a j * min (t (e i) : ℝ) (t j : ℝ)) + _ = _ := e.sum_comp (fun i => ∑ j : κ, a i * a j * min (t i : ℝ) (t j : ℝ)) + rw [hs] + +def timeCovariance {ι : Type*} (t : ι → ℝ≥0) : Matrix ι ι ℝ := + Matrix.of (fun i j => min (t i : ℝ) (t j : ℝ)) + +lemma timeCovariance_posSemidef {ι : Type*} [Fintype ι] (t : ι → ℝ≥0) : + (timeCovariance t).PosSemidef := by + have heq : timeCovariance t = Matrix.of (fun i j => + volume.real ((Set.Icc 0 (t i : ℝ)) ∩ (Set.Icc 0 (t j : ℝ)))) := by + ext i j + simp [timeCovariance, Set.Icc_inter_Icc] + rw [heq] + exact posSemidef_matrix_measure_inter (fun _ => measurableSet_Icc) + (fun _ => isCompact_Icc.measure_ne_top) + +lemma characteristic_of_gaussian_hasLaw {ι : Type*} [Fintype ι] [DecidableEq ι] + (t : ι → ℝ≥0) (a : ι → ℝ) + (h : HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) + (multivariateGaussian 0 (timeCovariance t)) P) : + evaluationChar X P a t = brownianChar a t := by + classical + have heq : evaluationChar X P a t = + charFun (multivariateGaussian 0 (timeCovariance t)) (WithLp.toLp 2 a) := by + have hi := h.integral_comp (f := fun x : EuclideanSpace ℝ ι => + Complex.exp ((inner (𝕜 := ℝ) x (WithLp.toLp 2 a) : ℂ) * Complex.I)) + (by fun_prop) + simpa [evaluationChar, charFun_apply, Function.comp_def, PiLp.inner_apply] using hi + rw [heq, charFun_multivariateGaussian (timeCovariance_posSemidef t)] + unfold brownianChar + congr 1 + simp only [inner_zero_right, Complex.ofReal_zero, zero_mul, zero_sub, + dotProduct, Matrix.mulVec, timeCovariance, Matrix.of_apply] + simp_rw [Finset.mul_sum] + have hs : (∑ i : ι, ∑ j : ι, a i * (min (t i : ℝ) (t j : ℝ) * a j)) = + ∑ i : ι, ∑ j : ι, a i * a j * min (t i : ℝ) (t j : ℝ) := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + rw [hs] + ring + +theorem isPreBrownian_of_characteristic [IsProbabilityMeasure P] + (hX : ∀ t, Measurable (X t)) + (hchar : ∀ (I : Finset ℝ≥0) (a : I → ℝ), + evaluationChar X P a (fun i => i.val) = brownianChar a (fun i => i.val)) : + IsPreBrownianReal X P := by + classical + refine ⟨fun I => ?_⟩ + have hm : Measurable (fun ω => I.restrict (X · ω)) := by + exact Measurable.of_eval (fun i => hX i.val) + refine ⟨hm.aemeasurable, ?_⟩ + apply (MeasurableEquiv.toLp 2 (I → ℝ)).map_measurableEquiv_injective + rw [Measure.map_map (MeasurableEquiv.measurable _) hm] + rw [MeasurableEquiv.coe_toLp] + rw [(BrownianReal.measurePreserving_toLp_projectiveFamily I).map_eq] + apply Measure.ext_of_charFun + funext a + rw [charFun_apply, integral_map] + · rw [charFun_multivariateGaussian (BrownianReal.posSemidef_covMatrix I)] + have hinner (ω : Ω) : + inner (𝕜 := ℝ) (WithLp.toLp 2 (I.restrict (X · ω))) a = + ∑ i : I, a i * X i.val ω := by + simp [PiLp.inner_apply, Finset.restrict_def] + simp_rw [Function.comp_apply, hinner] + change evaluationChar X P (fun i => a i) (fun i => i.val) = _ + rw [hchar] + unfold brownianChar + congr 1 + simp only [inner_zero_right, Complex.ofReal_zero, zero_mul, zero_sub] + simp only [dotProduct, Matrix.mulVec, BrownianReal.covMatrix_apply] + simp_rw [Finset.mul_sum] + have hsum : (∑ i : I, ∑ j : I, a i * a j * min (i.val : ℝ) (j.val : ℝ)) = + ∑ i : I, ∑ j : I, a i * ((min i.val j.val : ℝ≥0) * a j) := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [NNReal.coe_min] + ring + rw [hsum] + ring + · simpa only [MeasurableEquiv.coe_toLp] using + ((MeasurableEquiv.toLp 2 (I → ℝ)).measurable.comp hm).aemeasurable + · fun_prop + +theorem isBrownian_of_dense_characteristic [IsProbabilityMeasure P] + {D : Set ℝ≥0} (hD : Dense D) (hX : ∀ t, Measurable (X t)) + (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hchar : ∀ (I : Finset ℝ≥0) (a : I → ℝ) (t : I → ℝ≥0), + (∀ i, t i ∈ D) → evaluationChar X P a t = brownianChar a t) : + IsBrownianReal X P := by + refine ⟨isPreBrownian_of_characteristic hX ?_, hc⟩ + intro I a + exact characteristic_of_dense hD hX hc a (hchar I a) (fun i => i.val) + +theorem isBrownian_of_dense_characteristic_fin [IsProbabilityMeasure P] + {D : Set ℝ≥0} (hD : Dense D) (hX : ∀ t, Measurable (X t)) + (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hchar : ∀ (n : ℕ) (a : Fin n → ℝ) (t : Fin n → ℝ≥0), + (∀ i, t i ∈ D) → evaluationChar X P a t = brownianChar a t) : + IsBrownianReal X P := by + apply isBrownian_of_dense_characteristic hD hX hc + intro I a t ht + let e : Fin (Fintype.card I) ≃ I := (Fintype.equivFin I).symm + have h := hchar (Fintype.card I) (a ∘ e) (t ∘ e) (fun i => ht (e i)) + rwa [evaluationChar_reindex e a t, brownianChar_reindex e a t] at h + +def dyadicTimes : Set ℝ≥0 := + {t | ∃ n k : ℕ, t = (k : ℝ≥0) / (2 : ℝ≥0) ^ n} + +lemma dense_dyadicTimes : Dense dyadicTimes := by + intro t + let q : ℕ → ℝ≥0 := fun n => + (⌊(t : ℝ) * (2 : ℝ) ^ n⌋₊ : ℝ≥0) / (2 : ℝ≥0) ^ n + have hq : Filter.Tendsto q Filter.atTop (nhds t) := by + apply NNReal.tendsto_coe.mp + have h := (tendsto_nat_floor_mul_div_atTop t.property).comp + (tendsto_pow_atTop_atTop_of_one_lt (show (1 : ℝ) < 2 by norm_num)) + convert h using 1 <;> simp [q, Function.comp_def] + apply mem_closure_of_tendsto hq + exact Filter.Eventually.of_forall (fun n => ⟨n, ⌊(t : ℝ) * (2 : ℝ) ^ n⌋₊, rfl⟩) + +theorem isBrownian_of_dyadic_characteristic_fin [IsProbabilityMeasure P] + (hX : ∀ t, Measurable (X t)) (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hchar : ∀ (n : ℕ) (a : Fin n → ℝ) (t : Fin n → ℝ≥0), + (∀ i, t i ∈ dyadicTimes) → evaluationChar X P a t = brownianChar a t) : + IsBrownianReal X P := + isBrownian_of_dense_characteristic_fin dense_dyadicTimes hX hc hchar + +theorem isBrownian_of_dyadic_gaussian_fin [IsProbabilityMeasure P] + (hX : ∀ t, Measurable (X t)) (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hlaw : ∀ (n : ℕ) (t : Fin n → ℝ≥0), (∀ i, t i ∈ dyadicTimes) → + HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) + (multivariateGaussian 0 (timeCovariance t)) P) : + IsBrownianReal X P := by + apply isBrownian_of_dyadic_characteristic_fin hX hc + intro n a t ht + exact characteristic_of_gaussian_hasLaw t a (hlaw n t ht) + +end Problem336.DenseBrownian + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DenseGaussian.lean b/lean/OAI/Probability/SpanningForest/DenseGaussian.lean new file mode 100644 index 0000000000000000000000000000000000000000..c96bcc388dad5e0c19d8cb96b4a72c0ac10bee4c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DenseGaussian.lean @@ -0,0 +1,137 @@ +import OAI.Probability.SpanningForest.DenseBrownian + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal Topology Matrix + +namespace Problem336.DenseGaussian + +variable {T Ω : Type*} [TopologicalSpace T] [FirstCountableTopology T] [MeasurableSpace Ω] +variable {P : Measure Ω} {X : T → Ω → ℝ} + +theorem hasLaw_finite_of_dense [IsProbabilityMeasure P] + {ι : Type*} [Fintype ι] [DecidableEq ι] + {D : Set T} (hD : Dense D) + (hX : ∀ t, Measurable (X t)) + (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (ν : (ι → T) → ProbabilityMeasure (EuclideanSpace ℝ ι)) + (hν : ∀ a, Continuous (fun t => charFun (ν t : Measure (EuclideanSpace ℝ ι)) a)) + (hd : ∀ t : ι → T, (∀ i, t i ∈ D) → + HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) (ν t : Measure (EuclideanSpace ℝ ι)) P) + (t : ι → T) : + HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) (ν t : Measure (EuclideanSpace ℝ ι)) P := by + classical + have hm (s : ι → T) : Measurable + (fun ω => WithLp.toLp 2 (fun i => X (s i) ω)) := by + exact (MeasurableEquiv.toLp 2 (ι → ℝ)).measurable.comp + (Measurable.of_eval (fun i => hX (s i))) + refine ⟨(hm t).aemeasurable, ?_⟩ + apply Measure.ext_of_charFun + funext a + let F : (ι → T) → ℂ := fun s => + ∫ ω, Complex.exp ((inner (𝕜 := ℝ) + (WithLp.toLp 2 (fun i => X (s i) ω)) a : ℂ) * Complex.I) ∂P + have hF : Continuous F := by + apply continuous_of_dominated (bound := fun _ => (1 : ℝ)) + · intro s + apply Measurable.aestronglyMeasurable + simp only [PiLp.inner_apply] + fun_prop + · intro s + exact Filter.Eventually.of_forall (fun ω => by + rw [Complex.norm_exp_ofReal_mul_I]) + · exact integrable_const 1 + · filter_upwards [hc] with ω hω + simp only [PiLp.inner_apply] + have hi (i : ι) : Continuous (fun s : ι → T => X (s i) ω) := + hω.comp (continuous_apply i) + fun_prop + have hpi : Dense (Set.pi Set.univ (fun _ : ι => D)) := + dense_pi Set.univ (fun _ _ => hD) + have heq : F = fun s => charFun (ν s : Measure (EuclideanSpace ℝ ι)) a := by + apply Continuous.ext_on hpi hF (hν a) + intro s hs + have hlaw := hd s (fun i => hs i (Set.mem_univ i)) + simpa [F, charFun_apply] using hlaw.integral_comp + (f := fun x : EuclideanSpace ℝ ι => + Complex.exp ((inner (𝕜 := ℝ) x a : ℂ) * Complex.I)) (by fun_prop) + rw [charFun_apply, integral_map (hm t).aemeasurable (by fun_prop)] + exact congrFun heq t + +theorem hasLaw_brownian_finite_of_dense [IsProbabilityMeasure P] + {ι : Type*} [Fintype ι] [DecidableEq ι] + (τ : T → ℝ≥0) (hτ : Continuous τ) + {D : Set T} (hD : Dense D) + (hX : ∀ t, Measurable (X t)) + (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hd : ∀ t : ι → T, (∀ i, t i ∈ D) → + HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (τ ∘ t))) P) + (t : ι → T) : + HasLaw (fun ω => WithLp.toLp 2 (fun i => X (t i) ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (τ ∘ t))) P := by + apply hasLaw_finite_of_dense hD hX hc + (fun s => ⟨multivariateGaussian 0 (DenseBrownian.timeCovariance (τ ∘ s)), + inferInstance⟩) ?_ hd t + intro a + simp only [ProbabilityMeasure.coe_mk] + simp_rw [charFun_multivariateGaussian (DenseBrownian.timeCovariance_posSemidef _)] + simp only [DenseBrownian.timeCovariance, Matrix.of_apply, Matrix.mulVec, dotProduct] + fun_prop + +variable [DecidableEq T] +omit [TopologicalSpace T] [FirstCountableTopology T] + +theorem isGaussianProcess_of_finite_laws (τ : T → ℝ≥0) + (h : ∀ I : Finset T, + HasLaw (fun ω => WithLp.toLp 2 (fun i : I => X i.val ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (fun i : I => τ i.val))) P) : + IsGaussianProcess X P := by + classical + constructor + intro I + exact (h I).hasGaussianLaw.map_equiv + (PiLp.continuousLinearEquiv 2 ℝ (fun _ : I => ℝ)) + +theorem hasLaw_eval_of_finite_laws (τ : T → ℝ≥0) + (h : ∀ I : Finset T, + HasLaw (fun ω => WithLp.toLp 2 (fun i : I => X i.val ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (fun i : I => τ i.val))) P) + (t : T) : HasLaw (X t) (gaussianReal 0 (τ t)) P := by + classical + have hlaw := (measurePreserving_eval_multivariateGaussian + (DenseBrownian.timeCovariance_posSemidef (fun i : ({t} : Finset T) => τ i.val)) + (i := ⟨t, by simp⟩)).hasLaw.comp (h {t}) + simpa [DenseBrownian.timeCovariance, Function.comp_def] using hlaw + +theorem integral_of_finite_laws (τ : T → ℝ≥0) + (h : ∀ I : Finset T, + HasLaw (fun ω => WithLp.toLp 2 (fun i : I => X i.val ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (fun i : I => τ i.val))) P) + (t : T) : ∫ ω, X t ω ∂P = 0 := by + simpa using (hasLaw_eval_of_finite_laws τ h t).integral_eq + +theorem covariance_of_finite_laws (τ : T → ℝ≥0) + (h : ∀ I : Finset T, + HasLaw (fun ω => WithLp.toLp 2 (fun i : I => X i.val ω)) + (multivariateGaussian 0 (DenseBrownian.timeCovariance (fun i : I => τ i.val))) P) + (s t : T) : cov[X s, X t; P] = min (τ s : ℝ) (τ t : ℝ) := by + classical + let I : Finset T := {s, t} + let i : I := ⟨s, by simp [I]⟩ + let j : I := ⟨t, by simp [I]⟩ + have heq := (h I).covariance_fun_comp + (f := fun x : EuclideanSpace ℝ I => x i) + (g := fun x : EuclideanSpace ℝ I => x j) + (by fun_prop) (by fun_prop) + rw [covariance_eval_multivariateGaussian + (DenseBrownian.timeCovariance_posSemidef _)] at heq + exact heq + +end Problem336.DenseGaussian + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DenseGaussianModification.lean b/lean/OAI/Probability/SpanningForest/DenseGaussianModification.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd6d76a01557e41166d1d11437eb8fa2b0f44f3b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DenseGaussianModification.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SpanningForest.DenseBrownian + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal Topology + +namespace Problem336.DenseBrownian + +variable {Ω J : Type*} [MeasurableSpace Ω] {P : Measure Ω} +variable {Y : J → Ω → ℝ} {τ : J → ℝ≥0} + +lemma characteristic_of_gaussian_family [IsProbabilityMeasure P] + (hY : IsGaussianProcess Y P) (hm : ∀ j, ∫ ω, Y j ω ∂P = 0) + (hv : ∀ i j, cov[Y i, Y j; P] = min (τ i : ℝ) (τ j : ℝ)) + {ι : Type*} [Fintype ι] (b : ι → J) (a : ι → ℝ) : + (∫ ω, Complex.exp ((((∑ i, a i * Y (b i) ω) : ℝ) : ℂ) * Complex.I) ∂P) = + brownianChar a (τ ∘ b) := by + classical + let Z : Ω → ℝ := fun ω => ∑ i, a i * Y (b i) ω + have hZ : HasGaussianLaw Z P := by + simpa [Z, Function.comp_def, smul_eq_mul] using + ((hY.comp_right b).smul a).hasGaussianLaw_fun_sum (I := Finset.univ) + have hmean : ∫ ω, Z ω ∂P = 0 := by + dsimp [Z] + rw [integral_finsetSum] + · simp [integral_const_mul, hm] + · intro i _ + exact (hY.hasGaussianLaw_eval (b i)).integrable.const_mul (a i) + have hmem (i : ι) : MemLp (fun ω => a i * Y (b i) ω) 2 P := + (hY.hasGaussianLaw_eval (b i)).memLp_two.const_mul (a i) + have hvar : Var[Z; P] = ∑ i, ∑ j, + a i * a j * min (τ (b i) : ℝ) (τ (b j) : ℝ) := by + rw [← covariance_self hZ.aemeasurable] + dsimp [Z] + rw [covariance_fun_sum_fun_sum hmem hmem] + simp_rw [covariance_const_mul_left, covariance_const_mul_right, hv] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + have hc := hZ.charFun_map_eq (1 : ℝ) + simp only [Real.inner_apply, one_mul] at hc + rw [hmean, hvar] at hc + have hi : charFun (P.map Z) (1 : ℝ) = + ∫ ω, Complex.exp (((Z ω : ℝ) : ℂ) * Complex.I) ∂P := by + rw [charFun_apply, integral_map hZ.aemeasurable (by fun_prop)] + simp + rw [hi] at hc + simpa [Z, brownianChar, Function.comp_def, neg_div] using hc + +theorem isBrownian_of_dense_gaussian_modification [IsProbabilityMeasure P] + {X : ℝ≥0 → Ω → ℝ} {D : Set ℝ≥0} (hD : Dense D) + (hX : ∀ t, Measurable (X t)) + (hc : ∀ᵐ ω ∂P, Continuous (fun t => X t ω)) + (hY : IsGaussianProcess Y P) (hm : ∀ j, ∫ ω, Y j ω ∂P = 0) + (hv : ∀ i j, cov[Y i, Y j; P] = min (τ i : ℝ) (τ j : ℝ)) + (hmod : ∀ t ∈ D, ∃ j, τ j = t ∧ X t =ᵐ[P] Y j) : + IsBrownianReal X P := by + classical + apply isBrownian_of_dense_characteristic_fin hD hX hc + intro n a t ht + choose b hb heq using fun i => hmod (t i) (ht i) + have ha : ∀ᵐ ω ∂P, ∀ i, X (t i) ω = Y (b i) ω := + ae_all_iff.mpr heq + have hi : evaluationChar X P a t = + ∫ ω, Complex.exp ((((∑ i, a i * Y (b i) ω) : ℝ) : ℂ) * Complex.I) ∂P := by + unfold evaluationChar + apply integral_congr_ae + filter_upwards [ha] with ω hω + simp_rw [hω] + rw [hi, characteristic_of_gaussian_family hY hm hv b a] + congr 1 + funext i + exact hb i + +end Problem336.DenseBrownian + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DeterminantalResponse.lean b/lean/OAI/Probability/SpanningForest/DeterminantalResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..651158449324a10a6338cc5af255299db4b9ba5f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DeterminantalResponse.lean @@ -0,0 +1,96 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.Determinantal + +variable {V E : Type*} [Fintype V] [finiteEdges : Fintype E] +variable [DecidableEq V] [decidableEdges : DecidableEq E] + +def transferKernel (A : Matrix V E ℝ) : Matrix E E ℝ := + A.transpose * (A * A.transpose)⁻¹ * A + +omit decidableEdges in +theorem transferKernel_transpose [DecidableEq E] (A : Matrix V E ℝ) : + (transferKernel A).transpose = transferKernel A := by + simp only [transferKernel, Matrix.transpose_mul, Matrix.transpose_transpose, + Matrix.transpose_nonsing_inv] + simp only [Matrix.mul_assoc] + +omit decidableEdges in +theorem transferKernel_idempotent [DecidableEq E] (A : Matrix V E ℝ) + (hA : IsUnit (A * A.transpose).det) : + transferKernel A * transferKernel A = transferKernel A := by + unfold transferKernel + calc + A.transpose * (A * A.transpose)⁻¹ * A * + (A.transpose * (A * A.transpose)⁻¹ * A) = + A.transpose * ((A * A.transpose)⁻¹ * (A * A.transpose)) * + (A * A.transpose)⁻¹ * A := by simp only [Matrix.mul_assoc] + _ = A.transpose * (A * A.transpose)⁻¹ * A := by + rw [Matrix.nonsing_inv_mul _ hA, Matrix.mul_one] + +omit decidableEdges in +theorem projection_diagonal_eq_sum_sq [DecidableEq E] (K : Matrix E E ℝ) + (hKsym : K.transpose = K) (hKproj : K * K = K) (e : E) : + K e e = ∑ f, (K e f) ^ 2 := by + have hsym (f : E) : K f e = K e f := by + exact congrArg (fun M : Matrix E E ℝ => M e f) hKsym + calc + K e e = (K * K) e e := by rw [hKproj] + _ = ∑ f, (K e f) ^ 2 := by + simp only [Matrix.mul_apply, hsym, pow_two] + +theorem projection_diagonal_mem_Icc (K : Matrix E E ℝ) + (hKsym : K.transpose = K) (hKproj : K * K = K) (e : E) : + K e e ∈ Set.Icc (0 : ℝ) 1 := by + have hsum := projection_diagonal_eq_sum_sq K hKsym hKproj e + have hnonneg : 0 ≤ K e e := by + rw [hsum] + exact Finset.sum_nonneg (fun f _ => sq_nonneg (K e f)) + have hsquare : (K e e) ^ 2 ≤ K e e := by + calc + (K e e) ^ 2 ≤ ∑ f, (K e f) ^ 2 := + Finset.single_le_sum (fun f _ => sq_nonneg (K e f)) (Finset.mem_univ e) + _ = K e e := hsum.symm + constructor + · exact hnonneg + · nlinarith + +theorem transferKernel_diagonal_mem_Icc (A : Matrix V E ℝ) + (hA : IsUnit (A * A.transpose).det) (e : E) : + transferKernel A e e ∈ Set.Icc (0 : ℝ) 1 := + projection_diagonal_mem_Icc (transferKernel A) + (transferKernel_transpose A) (transferKernel_idempotent A hA) e + +def pairMatrix (K : Matrix E E ℝ) (e f : E) : Matrix (Fin 2) (Fin 2) ℝ := + !![K e e, K e f; K f e, K f f] + +omit finiteEdges decidableEdges in +theorem pairMatrix_det [Fintype E] [DecidableEq E] (K : Matrix E E ℝ) (e f : E) : + (pairMatrix K e f).det = K e e * K f f - K e f * K f e := by + exact Matrix.det_fin_two_of _ _ _ _ + +theorem determinantal_pair_covariance (K : Matrix E E ℝ) + (hKsym : K.transpose = K) (e f : E) : + (pairMatrix K e f).det - K e e * K f f = -(K e f) ^ 2 := by + have hsym : K f e = K e f := + congrArg (fun M : Matrix E E ℝ => M e f) hKsym + rw [pairMatrix_det, hsym] + ring + +theorem determinantal_pair_covariance_nonpos (K : Matrix E E ℝ) + (hKsym : K.transpose = K) (e f : E) : + (pairMatrix K e f).det - K e e * K f f ≤ 0 := by + rw [determinantal_pair_covariance K hKsym e f] + exact neg_nonpos.mpr (sq_nonneg _) + +end Problem336.Determinantal + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DisconnectedIncidence.lean b/lean/OAI/Probability/SpanningForest/DisconnectedIncidence.lean new file mode 100644 index 0000000000000000000000000000000000000000..20e32c0fcf294c02d4f381c05f545b86cf04d88d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DisconnectedIncidence.lean @@ -0,0 +1,111 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.IncidenceDisconnected + +variable {V E : Type*} + +def EndpointAdj (src dst : E → V) (u v : V) : Prop := + ∃ e, (src e = u ∧ dst e = v) ∨ (src e = v ∧ dst e = u) + +theorem reachable_endpoints_iff (src dst : E → V) (r : V) (e : E) : + Relation.ReflTransGen (EndpointAdj src dst) r (src e) ↔ + Relation.ReflTransGen (EndpointAdj src dst) r (dst e) := by + constructor + · intro h + exact h.tail ⟨e, Or.inl ⟨rfl, rfl⟩⟩ + · intro h + exact h.tail ⟨e, Or.inr ⟨rfl, rfl⟩⟩ + +variable [Fintype V] [DecidableEq V] + +def reducedIncidence (r : V) (src dst : E → V) : + Matrix {v : V // v ≠ r} E ℝ := + fun v e => (if v.1 = src e then 1 else 0) - (if v.1 = dst e then 1 else 0) + +theorem sum_reduced_indicator (r : V) (f : V → ℝ) (hr : f r = 0) (v : V) : + (∑ i : {v : V // v ≠ r}, f i.1 * (if i.1 = v then 1 else 0)) = f v := by + by_cases hv : v = r + · subst v + rw [hr] + apply Finset.sum_eq_zero + intro i hi + simp only [ite_eq_right i.property, mul_zero] + · have heq (i : {v : V // v ≠ r}) : i.1 = v ↔ i = ⟨v, hv⟩ := + ⟨fun h => Subtype.ext h, fun h => congrArg Subtype.val h⟩ + simp only [mul_ite, mul_one, mul_zero, heq] + simp + +theorem vecMul_reducedIncidence (r : V) (src dst : E → V) + (f : V → ℝ) (hr : f r = 0) : + (fun i : {v : V // v ≠ r} => f i.1) ᵥ* reducedIncidence r src dst = + fun e => f (src e) - f (dst e) := by + ext e + simp only [Matrix.vecMul, dotProduct, reducedIncidence, mul_sub, Finset.sum_sub_distrib] + rw [sum_reduced_indicator r f hr, sum_reduced_indicator r f hr] + +theorem exists_nonzero_vecMul_reducedIncidence_eq_zero + (r : V) (src dst : E → V) + (hdis : ¬ ∀ v, Relation.ReflTransGen (EndpointAdj src dst) r v) : + ∃ f : {v : V // v ≠ r} → ℝ, f ≠ 0 ∧ f ᵥ* reducedIncidence r src dst = 0 := by + classical + obtain ⟨v, hv⟩ := not_forall.mp hdis + let f : V → ℝ := fun w => if Relation.ReflTransGen (EndpointAdj src dst) r w then 0 else 1 + have hr : f r = 0 := by simp [f, Relation.ReflTransGen.refl] + have hvr : v ≠ r := by + intro heq + subst v + exact hv Relation.ReflTransGen.refl + refine ⟨fun w => f w.1, ?_, ?_⟩ + · intro hz + have h := congr_fun hz ⟨v, hvr⟩ + simp [f, hv] at h + · rw [vecMul_reducedIncidence r src dst f hr] + funext e + have heq := reachable_endpoints_iff src dst r e + simp only [f, heq, sub_self, Pi.zero_apply] + +theorem det_reducedIncidence_eq_zero_of_not_connected + (r : V) (src dst : {v : V // v ≠ r} → V) + (hdis : ¬ ∀ v, Relation.ReflTransGen (EndpointAdj src dst) r v) : + (reducedIncidence r src dst).det = 0 := by + exact Matrix.exists_vecMul_eq_zero_iff.mp + (exists_nonzero_vecMul_reducedIncidence_eq_zero r src dst hdis) + +theorem det_reindexed_reducedIncidence_eq_zero_of_not_connected + (r : V) (src dst : E → V) (e : {v : V // v ≠ r} ≃ E) + (hdis : ¬ ∀ v, Relation.ReflTransGen (EndpointAdj src dst) r v) : + ((reducedIncidence r src dst).submatrix id e).det = 0 := by + obtain ⟨f, hf, hkernel⟩ := exists_nonzero_vecMul_reducedIncidence_eq_zero r src dst hdis + apply Matrix.exists_vecMul_eq_zero_iff.mp + refine ⟨f, hf, ?_⟩ + ext j + exact congr_fun hkernel (e j) + +theorem det_reducedLaplacian_eq_zero_of_not_connected + [Fintype E] [DecidableEq E] (r : V) (src dst : E → V) (c : E → ℝ) + (hdis : ¬ ∀ v, Relation.ReflTransGen (EndpointAdj src dst) r v) : + (reducedIncidence r src dst * Matrix.diagonal c * (reducedIncidence r src dst).transpose).det = 0 := by + obtain ⟨f, hf, hkernel⟩ := exists_nonzero_vecMul_reducedIncidence_eq_zero r src dst hdis + apply Matrix.exists_vecMul_eq_zero_iff.mp + refine ⟨f, hf, ?_⟩ + rw [← Matrix.vecMul_vecMul, ← Matrix.vecMul_vecMul, hkernel] + simp + +theorem connected_of_det_reducedIncidence_ne_zero + (r : V) (src dst : {v : V // v ≠ r} → V) + (hdet : (reducedIncidence r src dst).det ≠ 0) : + ∀ v, Relation.ReflTransGen (EndpointAdj src dst) r v := by + by_contra hdis + exact hdet (det_reducedIncidence_eq_zero_of_not_connected r src dst hdis) + +end Problem336.IncidenceDisconnected + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DyadicGaussianBound.lean b/lean/OAI/Probability/SpanningForest/DyadicGaussianBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca9b53b23ed885783d0e5a3f565f4bdfe8d1901d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DyadicGaussianBound.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SpanningForest.CountableBrownian +import OAI.Probability.SpanningForest.SchauderTail + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology + +namespace Problem336.DyadicGaussianBound + +variable {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} + +theorem ae_time_consistent + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) : + ∀ᵐ ω ∂μ, ∀ i j, τ i = τ j → ω i = ω j := by + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro j + by_cases hij : τ i = τ j + · have h := CountableBrownian.hasLaw_increment hμ i j + rw [hij, nndist_self, gaussianReal_zero_var] at h + filter_upwards [h.ae_eq_of_dirac] with ω hω + exact fun _ => sub_eq_zero.mp hω + · exact ae_of_all _ (fun _ h => (hij h).elim) + +theorem ae_zero_coordinates + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) : + ∀ᵐ ω ∂μ, ∀ i, τ i = 0 → ω i = 0 := by + apply ae_all_iff.mpr + intro i + by_cases hi : τ i = 0 + · have h := CountableBrownian.hasLaw_eval hμ i + rw [hi, gaussianReal_zero_var] at h + filter_upwards [h.ae_eq_of_dirac] with ω hω + exact fun _ => hω + · exact ae_of_all _ (fun _ h => (hi h).elim) + +def sample (τ : ℕ → ℝ≥0) (ω : ℕ → ℝ) (t : ℝ) : ℝ := by + classical + exact if h : ∃ i, (τ i : ℝ) = t then ω (Classical.choose h) else 0 + +@[fun_prop] +theorem measurable_sample (τ : ℕ → ℝ≥0) (t : ℝ) : + Measurable (fun ω : ℕ → ℝ => sample τ ω t) := by + classical + unfold sample + split_ifs + · exact measurable_pi_apply _ + · exact measurable_const + +theorem sample_time_eq {ω : ℕ → ℝ} + (hω : ∀ i j, τ i = τ j → ω i = ω j) (i : ℕ) : + sample τ ω (τ i) = ω i := by + classical + unfold sample + split_ifs with hi + · apply hω + exact NNReal.coe_injective (Classical.choose_spec hi) + · exact (hi ⟨i, rfl⟩).elim + +lemma nndist_adjacent_grid (n k : ℕ) : + nndist (((k + 1 : ℕ) : ℝ≥0) / (2 : ℝ≥0) ^ n) + ((k : ℝ≥0) / (2 : ℝ≥0) ^ n) = (2 : ℝ≥0)⁻¹ ^ n := by + apply NNReal.coe_injective + simp only [coe_nndist, NNReal.coe_pow, NNReal.coe_inv, NNReal.coe_ofNat] + change |((k + 1 : ℕ) : ℝ) / (2 : ℝ) ^ n - (k : ℝ) / (2 : ℝ) ^ n| = + (2 : ℝ)⁻¹ ^ n + rw [Nat.cast_add, Nat.cast_one, add_div, add_sub_cancel_left, one_div, inv_pow] + exact abs_of_nonneg (by positivity) + +theorem hasLaw_grid_increment + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) + (idx : ℕ → ℕ → ℕ) + (hidx : ∀ n k, τ (idx n k) = (k : ℝ≥0) / (2 : ℝ≥0) ^ n) (n k : ℕ) : + HasLaw (fun ω : ℕ → ℝ => ω (idx n (k + 1)) - ω (idx n k)) + (gaussianReal 0 ((2 : ℝ≥0)⁻¹ ^ n)) μ := by + have h := CountableBrownian.hasLaw_increment hμ (idx n (k + 1)) (idx n k) + rwa [hidx, hidx, nndist_adjacent_grid] at h + +theorem ae_all_grid_increment_bound + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) + (idx : ℕ → ℕ → ℕ) + (hidx : ∀ n k, τ (idx n k) = (k : ℝ≥0) / (2 : ℝ≥0) ^ n) : + ∀ᵐ ω ∂μ, ∀ m : ℕ, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), + |ω (idx n (m * 2 ^ n + k.val + 1)) - ω (idx n (m * 2 ^ n + k.val))| ≤ + SchauderTail.incrementRatio ^ n := by + apply SchauderTail.ae_all_eventually_gaussian_increment_bound (P := μ) + (fun (m : ℕ) (n : ℕ) (k : Fin (2 ^ n)) (ω : ℕ → ℝ) => ω (idx n (m * 2 ^ n + k.val + 1)) - + ω (idx n (m * 2 ^ n + k.val))) + intro m n k + exact hasLaw_grid_increment hμ idx hidx n (m * 2 ^ n + k.val) + +theorem ae_all_sample_increment_bound + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) + (idx : ℕ → ℕ → ℕ) + (hidx : ∀ n k, τ (idx n k) = (k : ℝ≥0) / (2 : ℝ≥0) ^ n) : + ∀ᵐ ω ∂μ, ∀ m : ℕ, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), + |sample τ ω (((m * 2 ^ n + k.val + 1 : ℕ) : ℝ) / (2 : ℝ) ^ n) - + sample τ ω (((m * 2 ^ n + k.val : ℕ) : ℝ) / (2 : ℝ) ^ n)| ≤ + SchauderTail.incrementRatio ^ n := by + filter_upwards [ae_time_consistent hμ, ae_all_grid_increment_bound hμ idx hidx] + with ω hω hbound + have heval (n k : ℕ) : sample τ ω ((k : ℝ) / (2 : ℝ) ^ n) = ω (idx n k) := by + have h := sample_time_eq hω (idx n k) + simpa [hidx, NNReal.coe_div, NNReal.coe_pow] using h + intro m + filter_upwards [hbound m] with n hn + intro k + simpa only [heval] using hn k + +end Problem336.DyadicGaussianBound + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DyadicInterpolation.lean b/lean/OAI/Probability/SpanningForest/DyadicInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..175024659ec937983fdfac3c81b32dc90d2baec2 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DyadicInterpolation.lean @@ -0,0 +1,179 @@ +import OAI.Probability.SpanningForest.SchauderTents + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.DyadicInterpolation + +open SchauderTents + +def grid (n j : ℕ) : ℝ := (j : ℝ) / 2 ^ n + +@[simp] theorem grid_zero (n : ℕ) : grid n 0 = 0 := by simp [grid] +@[simp] theorem grid_zero_level (j : ℕ) : grid 0 j = j := by simp [grid] + +theorem grid_succ_even (n j : ℕ) : grid (n + 1) (2 * j) = grid n j := by + unfold grid + push_cast + rw [pow_succ] + field_simp + +theorem grid_succ_odd (n j : ℕ) : grid (n + 1) (2 * j + 1) = midpoint n j := by + unfold grid SchauderTents.midpoint + push_cast + rw [pow_succ] + field_simp + +theorem midpoint_eq_average (n j : ℕ) : + midpoint n j = (grid n j + grid n (j + 1)) / 2 := by + unfold SchauderTents.midpoint grid + push_cast + ring + +def residual (x : ℝ → ℝ) (n k : ℕ) : ℝ := + x (midpoint n k) - (x (grid n k) + x (grid n (k + 1))) / 2 + +def coefficient (x : ℝ → ℝ) (n k : ℕ) : ℝ := + 2 * residual x n k / amplitude n + +def approx (x : ℝ → ℝ) (n : ℕ) (t : ℝ) : ℝ := + x 0 + (x 1 - x 0) * t + ∑ m ∈ Finset.range n, level m (coefficient x m) t + +theorem continuous_approx (x : ℝ → ℝ) (n : ℕ) : Continuous (approx x n) := by + unfold approx + apply Continuous.add + · fun_prop + · exact continuous_finsetSum _ fun m _ => continuous_level m (coefficient x m) + +theorem approx_succ (x : ℝ → ℝ) (n : ℕ) (t : ℝ) : + approx x (n + 1) t = approx x n t + level n (coefficient x n) t := by + simp only [approx, Finset.sum_range_succ] + ring + +theorem approx_old_midpoint (x : ℝ → ℝ) (n j : ℕ) : + approx x n (midpoint n j) = + (approx x n (grid n j) + approx x n (grid n (j + 1))) / 2 := by + have hs : + (∑ m ∈ Finset.range n, level m (coefficient x m) (midpoint n j)) = + ((∑ m ∈ Finset.range n, level m (coefficient x m) (grid n j)) + + ∑ m ∈ Finset.range n, level m (coefficient x m) (grid n (j + 1))) / 2 := by + calc + _ = ∑ m ∈ Finset.range n, + (level m (coefficient x m) (grid n j) + + level m (coefficient x m) (grid n (j + 1))) / 2 := by + apply Finset.sum_congr rfl + intro m hm + simpa only [grid, Nat.cast_add, Nat.cast_one] using + level_old_midpoint (Finset.mem_range.mp hm) (coefficient x m) j + _ = _ := by rw [← Finset.sum_div, Finset.sum_add_distrib] + simp only [approx] + rw [hs, midpoint_eq_average] + ring + +theorem level_coefficient_midpoint (x : ℝ → ℝ) (n k : ℕ) (hk : k < 2 ^ n) : + level n (coefficient x n) (midpoint n k) = residual x n k := by + rw [level_at_midpoint n k _ hk, coefficient] + have ha : amplitude n ≠ 0 := ne_of_gt (amplitude_pos n) + field_simp + +theorem approx_grid (x : ℝ → ℝ) (n j : ℕ) (hj : j ≤ 2 ^ n) : + approx x n (grid n j) = x (grid n j) := by + induction n generalizing j with + | zero => + have hj' : j = 0 ∨ j = 1 := by norm_num at hj; omega + rcases hj' with rfl | rfl <;> simp [approx, grid] + | succ n ih => + obtain ⟨k, h | h⟩ : ∃ k, j = 2 * k ∨ j = 2 * k + 1 := + ⟨j / 2, by omega⟩ + · subst j + have hk : k ≤ 2 ^ n := by rw [pow_succ] at hj; omega + rw [grid_succ_even, approx_succ] + have hz : level n (coefficient x n) (grid n k) = 0 := by + simpa only [Nat.add_zero, grid] using + level_prior_grid_zero n 0 k (coefficient x n) + rw [hz, add_zero, ih k hk] + · subst j + have hk : k < 2 ^ n := by rw [pow_succ] at hj; omega + rw [grid_succ_odd, approx_succ, approx_old_midpoint, + level_coefficient_midpoint x n k hk, ih k hk.le, ih (k + 1) (by omega)] + unfold residual + ring + +theorem abs_residual_le (x : ℝ → ℝ) (n k : ℕ) {D : ℝ} + (hleft : |x (midpoint n k) - x (grid n k)| ≤ D) + (hright : |x (grid n (k + 1)) - x (midpoint n k)| ≤ D) : + |residual x n k| ≤ D := by + obtain ⟨hl₁, hl₂⟩ := abs_le.mp hleft + obtain ⟨hr₁, hr₂⟩ := abs_le.mp hright + rw [residual, abs_le] + constructor <;> linarith + +theorem abs_residual_le_of_increments (x : ℝ → ℝ) (n k : ℕ) {D : ℝ} + (hk : k < 2 ^ n) + (hinc : ∀ j < 2 ^ (n + 1), + |x (grid (n + 1) (j + 1)) - x (grid (n + 1) j)| ≤ D) : + |residual x n k| ≤ D := by + apply abs_residual_le + · have h := hinc (2 * k) (by rw [pow_succ]; omega) + simpa only [grid_succ_even, grid_succ_odd] using h + · have h := hinc (2 * k + 1) (by rw [pow_succ]; omega) + have heq : 2 * k + 1 + 1 = 2 * (k + 1) := by omega + simpa only [heq, grid_succ_even, grid_succ_odd] using h + +theorem abs_approx_succ_sub_le_of_residual (x : ℝ → ℝ) (n : ℕ) {D : ℝ} + (hD : 0 ≤ D) (hres : ∀ k < 2 ^ n, |residual x n k| ≤ D) (t : ℝ) : + |approx x (n + 1) t - approx x n t| ≤ D := by + have ha : 0 < amplitude n := amplitude_pos n + have hC : 0 ≤ 2 * D / amplitude n := div_nonneg (by positivity) ha.le + have hc : ∀ k < 2 ^ n, |coefficient x n k| ≤ 2 * D / amplitude n := by + intro k hk + rw [coefficient, abs_div, abs_mul, abs_of_pos ha, + abs_of_nonneg (show (0 : ℝ) ≤ 2 by norm_num)] + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (hres k hk) (by norm_num)) ha.le + have h := abs_level_le n (coefficient x n) hC hc t + have hbound : (2 * D / amplitude n) * amplitude n / 2 = D := by + field_simp + rw [hbound] at h + simpa only [approx_succ, add_sub_cancel_left] using h + +theorem abs_approx_succ_sub_le (x : ℝ → ℝ) (n : ℕ) {D : ℝ} (hD : 0 ≤ D) + (hinc : ∀ j < 2 ^ (n + 1), + |x (grid (n + 1) (j + 1)) - x (grid (n + 1) j)| ≤ D) (t : ℝ) : + |approx x (n + 1) t - approx x n t| ≤ D := + abs_approx_succ_sub_le_of_residual x n hD + (fun k hk => abs_residual_le_of_increments x n k hk hinc) t + +variable {Ω : Type*} [MeasurableSpace Ω] (x : Ω → ℝ → ℝ) + (hx : ∀ t, Measurable (fun ω => x ω t)) + +include hx + +theorem measurable_residual (n k : ℕ) : + Measurable (fun ω => residual (x ω) n k) := by + exact (hx _).sub (((hx _).add (hx _)).div_const 2) + +theorem measurable_coefficient (n k : ℕ) : + Measurable (fun ω => coefficient (x ω) n k) := by + exact ((measurable_residual x hx n k).const_mul 2).div_const _ + +theorem measurable_approx (n : ℕ) : + Measurable (fun q : Ω × ℝ => approx (x q.1) n q.2) := by + unfold approx level + apply Measurable.add + · exact ((hx 0).comp measurable_fst).add + ((((hx 1).sub (hx 0)).comp measurable_fst).mul measurable_snd) + · apply Finset.measurable_sum + intro m hm + apply Finset.measurable_sum + intro k hk + exact ((measurable_coefficient x hx m k).comp measurable_fst).mul + ((continuous_tent m k).measurable.comp measurable_snd) + +end Problem336.DyadicInterpolation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DyadicPathLimit.lean b/lean/OAI/Probability/SpanningForest/DyadicPathLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..49a06cf8e4f000010bc2f3c248dec418d53df002 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DyadicPathLimit.lean @@ -0,0 +1,135 @@ +import OAI.Probability.SpanningForest.DyadicInterpolation +import OAI.Probability.SpanningForest.ContinuousPathLimit + +namespace OAI + +noncomputable section + +namespace Problem336.DyadicPathLimit + +open Filter MeasureTheory ProbabilityTheory +open scoped Topology BigOperators +open DyadicInterpolation + +def unitApprox (x : ℝ → ℝ) (n : ℕ) : C(unitInterval, ℝ) := + ⟨fun t => approx x n t, (continuous_approx x n).comp continuous_subtype_val⟩ + +@[simp] theorem unitApprox_apply (x : ℝ → ℝ) (n : ℕ) (t : unitInterval) : + unitApprox x n t = approx x n t := rfl + +def unitPath (x : ℝ → ℝ) : C(unitInterval, ℝ) := + ContinuousPathLimit.pathLimit (unitApprox x) + +theorem approx_grid_add (x : ℝ → ℝ) (n j : ℕ) (hj : j ≤ 2 ^ n) (r : ℕ) : + approx x (n + r) (grid n j) = x (grid n j) := by + induction r with + | zero => simpa using approx_grid x n j hj + | succ r ih => + rw [Nat.add_succ, approx_succ, ih] + have hz := SchauderTents.level_prior_grid_zero n r j (coefficient x (n + r)) + change SchauderTents.level (n + r) (coefficient x (n + r)) (grid n j) = 0 at hz + rw [hz, add_zero] + +theorem eventually_unitApprox_grid (x : ℝ → ℝ) (n j : ℕ) (hj : j ≤ 2 ^ n) + (t : unitInterval) (ht : (t : ℝ) = grid n j) : + ∀ᶠ m in atTop, unitApprox x m t = x t := by + filter_upwards [eventually_ge_atTop n] with m hm + obtain ⟨r, rfl⟩ := Nat.exists_eq_add_of_le hm + simpa only [unitApprox_apply, ht] using approx_grid_add x n j hj r + +theorem dist_unitApprox_succ_le (x : ℝ → ℝ) (n : ℕ) {D : ℝ} (hD : 0 ≤ D) + (hinc : ∀ j < 2 ^ (n + 1), + |x (grid (n + 1) (j + 1)) - x (grid (n + 1) j)| ≤ D) : + dist (unitApprox x n) (unitApprox x (n + 1)) ≤ D := by + apply (ContinuousMap.dist_le hD).mpr + intro t + rw [dist_comm, Real.dist_eq] + exact abs_approx_succ_sub_le x n hD hinc t + +theorem tendsto_unitPath (x : ℝ → ℝ) (d : ℕ → ℝ) + (hd0 : ∀ n, 0 ≤ d n) (hd : Summable d) + (hinc : ∀ᶠ n in atTop, ∀ j < 2 ^ (n + 1), + |x (grid (n + 1) (j + 1)) - x (grid (n + 1) j)| ≤ d n) : + Tendsto (unitApprox x) atTop (𝓝 (unitPath x)) := by + exact ContinuousPathLimit.tendsto_pathLimit_of_eventually_summable d + (hinc.mono fun n hn => dist_unitApprox_succ_le x n (hd0 n) hn) hd + +theorem unitPath_grid (x : ℝ → ℝ) (d : ℕ → ℝ) + (hd0 : ∀ n, 0 ≤ d n) (hd : Summable d) + (hinc : ∀ᶠ n in atTop, ∀ j < 2 ^ (n + 1), + |x (grid (n + 1) (j + 1)) - x (grid (n + 1) j)| ≤ d n) + (n j : ℕ) (hj : j ≤ 2 ^ n) (t : unitInterval) (ht : (t : ℝ) = grid n j) : + unitPath x t = x t := by + exact tendsto_nhds_unique + ((continuous_eval_const t).continuousAt.tendsto.comp (tendsto_unitPath x d hd0 hd hinc)) + (tendsto_const_nhds.congr' ((eventually_unitApprox_grid x n j hj t ht).mono (fun _ h => h.symm))) + +section EvaluationLaws + +variable {Ω ι : Type*} [MeasurableSpace Ω] {P : Measure Ω} + +theorem ae_unitPath_grid (x : Ω → ℝ → ℝ) (d : ℕ → ℝ) + (hd0 : ∀ n, 0 ≤ d n) (hd : Summable d) + (hinc : ∀ᵐ ω ∂P, ∀ᶠ n in atTop, ∀ j < 2 ^ (n + 1), + |x ω (grid (n + 1) (j + 1)) - x ω (grid (n + 1) j)| ≤ d n) + (times : ι → unitInterval) + (hgrid : ∀ i, ∃ n j, j ≤ 2 ^ n ∧ (times i : ℝ) = grid n j) : + ∀ᵐ ω ∂P, ∀ i, unitPath (x ω) (times i) = x ω (times i) := by + filter_upwards [hinc] with ω hω + intro i + obtain ⟨n, j, hj, ht⟩ := hgrid i + exact unitPath_grid (x ω) d hd0 hd hω n j hj (times i) ht + +theorem hasLaw_unitPath_grid (x : Ω → ℝ → ℝ) (d : ℕ → ℝ) + (hd0 : ∀ n, 0 ≤ d n) (hd : Summable d) + (hinc : ∀ᵐ ω ∂P, ∀ᶠ n in atTop, ∀ j < 2 ^ (n + 1), + |x ω (grid (n + 1) (j + 1)) - x ω (grid (n + 1) j)| ≤ d n) + (times : ι → unitInterval) + (hgrid : ∀ i, ∃ n j, j ≤ 2 ^ n ∧ (times i : ℝ) = grid n j) + (μ : Measure (ι → ℝ)) (ha : HasLaw (fun ω i => x ω (times i)) μ P) : + HasLaw (fun ω i => unitPath (x ω) (times i)) μ P := by + apply ha.congr + filter_upwards [ae_unitPath_grid x d hd0 hd hinc times hgrid] with ω hω + exact funext hω + +end EvaluationLaws + +variable {Ω : Type*} [MeasurableSpace Ω] +variable [MeasurableSpace C(unitInterval, ℝ)] [BorelSpace C(unitInterval, ℝ)] + +theorem measurable_unitApprox (x : Ω → ℝ → ℝ) + (hx : ∀ t, Measurable (fun ω => x ω t)) (n : ℕ) : + Measurable (fun ω => unitApprox (x ω) n) := by + let coordinate : C(unitInterval, ℝ) := ⟨Subtype.val, continuous_subtype_val⟩ + let tentPath (m k : ℕ) : C(unitInterval, ℝ) := + ⟨fun t => SchauderTents.tent m k t, + (SchauderTents.continuous_tent m k).comp continuous_subtype_val⟩ + have hc : Continuous (ContinuousMap.const unitInterval : ℝ → C(unitInterval, ℝ)) := + ContinuousMap.continuous_of_continuous_uncurry _ continuous_fst + have heq : (fun ω => unitApprox (x ω) n) = fun ω => + ContinuousMap.const unitInterval (x ω 0) + (x ω 1 - x ω 0) • coordinate + + ∑ m ∈ Finset.range n, ∑ k ∈ Finset.range (2 ^ m), + coefficient (x ω) m k • tentPath m k := by + funext ω + ext t + simp [unitApprox, approx, SchauderTents.level, coordinate, tentPath] + rw [heq] + apply Measurable.add + · exact (hc.measurable.comp (hx 0)).add (((hx 1).sub (hx 0)).smul measurable_const) + · apply Finset.measurable_sum + intro m hm + apply Finset.measurable_sum + intro k hk + exact (measurable_coefficient x hx m k).smul measurable_const + +theorem measurable_unitPath (x : Ω → ℝ → ℝ) + (hx : ∀ t, Measurable (fun ω => x ω t)) : + Measurable (fun ω => unitPath (x ω)) := + ContinuousPathLimit.measurable_pathLimit (fun n ω => unitApprox (x ω) n) + (measurable_unitApprox x hx) + +end Problem336.DyadicPathLimit + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/DyadicTimes.lean b/lean/OAI/Probability/SpanningForest/DyadicTimes.lean new file mode 100644 index 0000000000000000000000000000000000000000..8063f08d286fb92a947e50789c2c6e305d608354 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/DyadicTimes.lean @@ -0,0 +1,96 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology NNReal + +namespace Problem336.DyadicTimes + +def grid (n k : ℕ) : ℝ≥0 := (k : ℝ≥0) / (2 : ℝ≥0) ^ n + +def enumeration (i : ℕ) : ℝ≥0 := grid (Nat.unpair i).1 (Nat.unpair i).2 + +@[simp] theorem enumeration_pair (n k : ℕ) : enumeration (Nat.pair n k) = grid n k := by + simp [enumeration] + +@[simp] theorem enumeration_zero : enumeration 0 = 0 := by + norm_num [enumeration, grid, Nat.unpair] + +@[simp] theorem coe_grid (n k : ℕ) : + (grid n k : ℝ) = (k : ℝ) / (2 : ℝ) ^ n := by + simp [grid] + +@[simp] theorem grid_zero (n : ℕ) : grid n 0 = 0 := by simp [grid] + +@[simp] theorem grid_level_zero (k : ℕ) : grid 0 k = k := by simp [grid] + +lemma grid_refine_even (n k : ℕ) : grid (n + 1) (2 * k) = grid n k := by + apply NNReal.coe_injective + simp only [coe_grid, Nat.cast_mul, Nat.cast_ofNat, pow_succ] + field_simp + +lemma grid_refine_midpoint (n k : ℕ) : + (grid (n + 1) (2 * k + 1) : ℝ) = + ((grid n k : ℝ) + (grid n (k + 1) : ℝ)) / 2 := by + simp only [coe_grid, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one, pow_succ] + field_simp + ring + +lemma grid_increment (n k : ℕ) : + (grid n (k + 1) : ℝ) - (grid n k : ℝ) = ((2 : ℝ) ^ n)⁻¹ := by + simp only [coe_grid, Nat.cast_add, Nat.cast_one] + field_simp + ring + +lemma grid_le_one_iff (n k : ℕ) : grid n k ≤ 1 ↔ k ≤ 2 ^ n := by + change (grid n k : ℝ) ≤ (1 : ℝ) ↔ k ≤ 2 ^ n + rw [coe_grid, div_le_iff₀ (by positivity : (0 : ℝ) < 2 ^ n), one_mul] + exact_mod_cast (Iff.rfl : k ≤ 2 ^ n ↔ k ≤ 2 ^ n) + +def approximant (n : ℕ) (t : ℝ≥0) : ℝ≥0 := + grid n ⌊(t : ℝ) * (2 : ℝ) ^ n⌋₊ + +lemma approximant_le (n : ℕ) (t : ℝ≥0) : approximant n t ≤ t := by + change (approximant n t : ℝ) ≤ (t : ℝ) + simp only [approximant, coe_grid] + apply (div_le_iff₀ (pow_pos (by norm_num : (0 : ℝ) < 2) n)).2 + exact Nat.floor_le (mul_nonneg t.2 (by positivity)) + +lemma sub_approximant_nonneg (n : ℕ) (t : ℝ≥0) : + 0 ≤ (t : ℝ) - approximant n t := + sub_nonneg.mpr (show (approximant n t : ℝ) ≤ (t : ℝ) from approximant_le n t) + +lemma sub_approximant_lt (n : ℕ) (t : ℝ≥0) : + (t : ℝ) - approximant n t < ((2 : ℝ) ^ n)⁻¹ := by + have hp : 0 < (2 : ℝ) ^ n := by positivity + have hfloor := Nat.lt_floor_add_one ((t : ℝ) * (2 : ℝ) ^ n) + simp only [approximant, coe_grid] + apply (mul_lt_mul_iff_left₀ hp).mp + field_simp + nlinarith + +lemma tendsto_approximant (t : ℝ≥0) : + Tendsto (fun n => approximant n t) atTop (nhds t) := by + apply NNReal.tendsto_coe.mp + change Tendsto (fun n : ℕ => (⌊(t : ℝ) * (2 : ℝ) ^ n⌋₊ : ℝ) / (2 : ℝ) ^ n) + atTop (nhds (t : ℝ)) + exact (tendsto_nat_floor_mul_div_atTop t.2).comp + (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : ℝ) < 2)) + +lemma approximant_mem_range (n : ℕ) (t : ℝ≥0) : + approximant n t ∈ Set.range enumeration := by + exact ⟨Nat.pair n ⌊(t : ℝ) * (2 : ℝ) ^ n⌋₊, enumeration_pair _ _⟩ + +theorem denseRange_enumeration : DenseRange enumeration := by + intro t + exact mem_closure_of_tendsto (tendsto_approximant t) + (Filter.Eventually.of_forall (fun n => approximant_mem_range n t)) + +end Problem336.DyadicTimes + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeAction.lean b/lean/OAI/Probability/SpanningForest/EdgeAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..775bd2e87a49b08396424f567c6d0a474fb22a86 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeAction.lean @@ -0,0 +1,89 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +namespace Problem336 + +theorem rawPair_comm (u v : ℕ) : rawPair u v = rawPair v u := by + unfold rawPair + split_ifs <;> simp_all <;> omega + +@[simp] theorem rawPair_of_lt {u v : ℕ} (h : u < v) : + rawPair u v = (u, v) := by + simp [rawPair, h] + +@[simp] theorem mkEdge_val (u v : ℕ) (h : u ≠ v) : + (mkEdge u v h).val = rawPair u v := by + unfold mkEdge rawPair + split_ifs <;> rfl + +@[simp] theorem mkEdge_of_lt {u v : ℕ} (h : u < v) : + mkEdge u v (Nat.ne_of_lt h) = ⟨(u, v), h⟩ := by + simp [mkEdge, h] + +theorem mkEdge_swap (u v : ℕ) (h : u ≠ v) : + mkEdge u v h = mkEdge v u h.symm := by + apply Subtype.ext + simpa only [mkEdge_val] using rawPair_comm u v + +@[simp] theorem mkEdge_endpoints (e : EdgeCode) : + mkEdge e.val.1 e.val.2 (Nat.ne_of_lt e.property) = e := by + apply Subtype.ext + simp [mkEdge, e.property] + +theorem mapEdge_mkEdge (σ : Equiv ℕ ℕ) (u v : ℕ) (h : u ≠ v) : + mapEdge σ (mkEdge u v h) = + mkEdge (σ u) (σ v) (fun huv => h (σ.injective huv)) := by + by_cases huv : u < v + · simp [mapEdge, mkEdge, huv] + · have hvu : v < u := lt_of_le_of_ne (Nat.le_of_not_gt huv) h.symm + have he : mkEdge u v h = ⟨(v, u), hvu⟩ := by + simp [mkEdge, huv] + rw [he] + change mkEdge (σ v) (σ u) _ = mkEdge (σ u) (σ v) _ + exact mkEdge_swap _ _ _ + +@[simp] theorem mapEdge_refl (e : EdgeCode) : + mapEdge (Equiv.refl ℕ) e = e := by + change mkEdge e.val.1 e.val.2 _ = e + exact mkEdge_endpoints e + +theorem mapEdge_trans (σ τ : Equiv ℕ ℕ) (e : EdgeCode) : + mapEdge (σ.trans τ) e = mapEdge τ (mapEdge σ e) := by + symm + exact mapEdge_mkEdge τ (σ e.val.1) (σ e.val.2) _ + +@[simp] theorem mapEdge_symm_apply (σ : Equiv ℕ ℕ) (e : EdgeCode) : + mapEdge σ.symm (mapEdge σ e) = e := by + rw [← mapEdge_trans] + simp + +@[simp] theorem mapEdge_apply_symm (σ : Equiv ℕ ℕ) (e : EdgeCode) : + mapEdge σ (mapEdge σ.symm e) = e := by + simpa using mapEdge_symm_apply σ.symm e + +def edgeEquiv (σ : Equiv ℕ ℕ) : Equiv EdgeCode EdgeCode where + toFun := mapEdge σ + invFun := mapEdge σ.symm + left_inv := mapEdge_symm_apply σ + right_inv := mapEdge_apply_symm σ + +@[simp] theorem edgeEquiv_apply (σ : Equiv ℕ ℕ) (e : EdgeCode) : + edgeEquiv σ e = mapEdge σ e := rfl + +theorem mapEdge_injective (σ : Equiv ℕ ℕ) : Function.Injective (mapEdge σ) := + (edgeEquiv σ).injective + +theorem mapEdge_surjective (σ : Equiv ℕ ℕ) : Function.Surjective (mapEdge σ) := + (edgeEquiv σ).surjective + +@[simp] theorem mapEdge_inj (σ : Equiv ℕ ℕ) (e f : EdgeCode) : + mapEdge σ e = mapEdge σ f ↔ e = f := (mapEdge_injective σ).eq_iff + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeAllocation.lean b/lean/OAI/Probability/SpanningForest/EdgeAllocation.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec097f22a99d6a748372b8523abb7638db47ad9f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeAllocation.lean @@ -0,0 +1,129 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section +namespace Problem336 +namespace EdgeAllocation + +def neighborRank (G : GraphCode) (key : ℕ → ℝ) (u v : ℕ) : ℕ := + Set.ncard {w : ℕ | Adj G u w ∧ key w < key v} + +lemma neighborRank_strictMono {G : GraphCode} (hG : GraphLocallyFinite G) + {key : ℕ → ℝ} {u v w : ℕ} (hv : Adj G u v) + (hvw : key v < key w) : neighborRank G key u v < neighborRank G key u w := by + apply Set.ncard_lt_ncard + · refine Set.ssubset_iff_subset_ne.mpr ⟨?_, ?_⟩ + · intro x hx + exact ⟨hx.1, hx.2.trans hvw⟩ + · intro heq + have hmem : v ∈ {x : ℕ | Adj G u x ∧ key x < key w} := ⟨hv, hvw⟩ + rw [← heq] at hmem + exact (lt_irrefl (key v)) hmem.2 + · exact (hG u).subset (fun _ h => h.1) + +lemma neighborRank_injOn {G : GraphCode} (hG : GraphLocallyFinite G) + {key : ℕ → ℝ} (hkey : Function.Injective key) (u : ℕ) : + Set.InjOn (neighborRank G key u) {v : ℕ | Adj G u v} := by + intro v hv w hw hrank + apply hkey + rcases lt_trichotomy (key v) (key w) with hlt | heq | hgt + · exact False.elim ((ne_of_lt (neighborRank_strictMono hG hv hlt)) hrank) + · exact heq + · exact False.elim ((ne_of_lt (neighborRank_strictMono hG hw hgt)) hrank.symm) + +def source (key : ℕ → ℝ) (e : EdgeCode) : ℕ := + if key e.1.1 < key e.1.2 then e.1.1 else e.1.2 + +def target (key : ℕ → ℝ) (e : EdgeCode) : ℕ := + if key e.1.1 < key e.1.2 then e.1.2 else e.1.1 + +def coordinate (G : GraphCode) (key : ℕ → ℝ) (e : EdgeCode) : ℕ × ℕ := + (source key e, neighborRank G key (source key e) (target key e)) + +lemma rawPair_source_target (key : ℕ → ℝ) (e : EdgeCode) : + rawPair (source key e) (target key e) = e.1 := by + unfold source target + split_ifs with h + · simp [rawPair, e.2] + · simp [rawPair, Nat.not_lt.mpr (Nat.le_of_lt e.2)] + +lemma adjacent_source_target {G : GraphCode} {key : ℕ → ℝ} {e : EdgeCode} + (he : Adj G e.1.1 e.1.2) : Adj G (source key e) (target key e) := by + unfold source target + split_ifs + · exact he + · unfold Adj at * + rw [G.2.2] + exact he + +theorem coordinate_injOn {G : GraphCode} (hG : GraphLocallyFinite G) + {key : ℕ → ℝ} (hkey : Function.Injective key) : + Set.InjOn (coordinate G key) {e : EdgeCode | Adj G e.1.1 e.1.2} := by + intro e he f hf hcoord + have hs : source key e = source key f := congrArg Prod.fst hcoord + have hr : neighborRank G key (source key e) (target key e) = + neighborRank G key (source key f) (target key f) := congrArg Prod.snd hcoord + rw [← hs] at hr + have hf' : Adj G (source key e) (target key f) := by + rw [hs] + exact adjacent_source_target hf + have ht := neighborRank_injOn hG hkey (source key e) + (adjacent_source_target he) hf' hr + apply Subtype.ext + rw [← rawPair_source_target key e, ← rawPair_source_target key f, hs, ht] + +lemma neighborRank_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) (key : ℕ → ℝ) + (u v : ℕ) : + neighborRank (relabelGraph σ G) (relabelLabels σ key) (σ u) (σ v) = + neighborRank G key u v := by + unfold neighborRank + have hset : {w : ℕ | Adj (relabelGraph σ G) (σ u) w ∧ + relabelLabels σ key w < relabelLabels σ key (σ v)} = + σ '' {w : ℕ | Adj G u w ∧ key w < key v} := by + ext w + constructor + · intro hw + refine ⟨σ.symm w, ?_, σ.apply_symm_apply w⟩ + simpa [Adj, relabelGraph, relabelLabels] using hw + · rintro ⟨x, hx, rfl⟩ + simpa [Adj, relabelGraph, relabelLabels] using hx + rw [hset, Set.ncard_image_of_injective _ σ.injective] + +lemma source_relabel (σ : Equiv ℕ ℕ) {key : ℕ → ℝ} + (hkey : Function.Injective key) (e : EdgeCode) : + source (relabelLabels σ key) (mapEdge σ e) = σ (source key e) := by + have hne : key e.1.1 ≠ key e.1.2 := fun h => Nat.ne_of_lt e.2 (hkey h) + by_cases hs : σ e.1.1 < σ e.1.2 + · simp [source, mapEdge, mkEdge, hs, relabelLabels] + split_ifs <;> rfl + · by_cases hk : key e.1.1 < key e.1.2 + · simp [source, mapEdge, mkEdge, hs, relabelLabels, hk, not_lt_of_gt hk] + · have hr : key e.1.2 < key e.1.1 := lt_of_le_of_ne (le_of_not_gt hk) hne.symm + simp [source, mapEdge, mkEdge, hs, relabelLabels, hk, hr] + +lemma target_relabel (σ : Equiv ℕ ℕ) {key : ℕ → ℝ} + (hkey : Function.Injective key) (e : EdgeCode) : + target (relabelLabels σ key) (mapEdge σ e) = σ (target key e) := by + have hne : key e.1.1 ≠ key e.1.2 := fun h => Nat.ne_of_lt e.2 (hkey h) + by_cases hs : σ e.1.1 < σ e.1.2 + · simp [target, mapEdge, mkEdge, hs, relabelLabels] + split_ifs <;> rfl + · by_cases hk : key e.1.1 < key e.1.2 + · simp [target, mapEdge, mkEdge, hs, relabelLabels, hk, not_lt_of_gt hk] + · have hr : key e.1.2 < key e.1.1 := lt_of_le_of_ne (le_of_not_gt hk) hne.symm + simp [target, mapEdge, mkEdge, hs, relabelLabels, hk, hr] + +theorem coordinate_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) {key : ℕ → ℝ} + (hkey : Function.Injective key) (e : EdgeCode) : + coordinate (relabelGraph σ G) (relabelLabels σ key) (mapEdge σ e) = + (σ (coordinate G key e).1, (coordinate G key e).2) := by + simp only [coordinate, source_relabel σ hkey, target_relabel σ hkey, + neighborRank_relabel] + +end EdgeAllocation +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeAllocationMeasurable.lean b/lean/OAI/Probability/SpanningForest/EdgeAllocationMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..c68515547f0755fdd827e0b21d15d5b7fe90e481 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeAllocationMeasurable.lean @@ -0,0 +1,69 @@ +import OAI.Probability.SpanningForest.EdgeAllocation + +namespace OAI + +noncomputable section +namespace Problem336.EdgeAllocation + +@[fun_prop] +theorem measurable_neighborRank (u v : ℕ) : + Measurable (fun q : GraphCode × (ℕ → ℝ) => neighborRank q.1 q.2 u v) := by + apply measurable_ncard.comp + apply measurable_set_iff.mpr + intro w + change Measurable (fun q : GraphCode × (ℕ → ℝ) => + q.1.1 u w = true ∧ q.2 w < q.2 v) + apply Measurable.and + · have h : Measurable (fun q : GraphCode × (ℕ → ℝ) => q.1.1 u w) := + (measurable_pi_apply w).comp ((measurable_pi_apply u).comp + (measurable_subtype_coe.comp measurable_fst)) + exact h.eq_const true + · exact measurableSet_setOfPred.mp + (measurableSet_lt (measurable_snd.eval) (measurable_snd.eval)) + +@[fun_prop] +theorem measurable_neighborRank_joint : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × (ℕ × ℕ) => + neighborRank q.1.1 q.1.2 q.2.1 q.2.2) := + measurable_from_prod_countable_left fun p => measurable_neighborRank p.1 p.2 + +@[fun_prop] +theorem measurable_source (e : EdgeCode) : + Measurable (fun key : ℕ → ℝ => source key e) := by + apply Measurable.ite _ measurable_const measurable_const + exact measurableSet_lt (measurable_pi_apply _) (measurable_pi_apply _) + +@[fun_prop] +theorem measurable_target (e : EdgeCode) : + Measurable (fun key : ℕ → ℝ => target key e) := by + apply Measurable.ite _ measurable_const measurable_const + exact measurableSet_lt (measurable_pi_apply _) (measurable_pi_apply _) + +@[fun_prop] +theorem measurable_source_joint : + Measurable (fun q : (ℕ → ℝ) × EdgeCode => source q.1 q.2) := + measurable_from_prod_countable_left measurable_source + +@[fun_prop] +theorem measurable_target_joint : + Measurable (fun q : (ℕ → ℝ) × EdgeCode => target q.1 q.2) := + measurable_from_prod_countable_left measurable_target + +@[fun_prop] +theorem measurable_coordinate : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + coordinate q.1.1 q.1.2 q.2) := by + have hs : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + source q.1.2 q.2) := + measurable_source_joint.comp (measurable_fst.snd.prodMk measurable_snd) + have ht : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + target q.1.2 q.2) := + measurable_target_joint.comp (measurable_fst.snd.prodMk measurable_snd) + exact hs.prodMk (measurable_neighborRank_joint.comp + (measurable_fst.prodMk (hs.prodMk ht))) + +end Problem336.EdgeAllocation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeBallExhaustion.lean b/lean/OAI/Probability/SpanningForest/EdgeBallExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..65f9810080117eabc1a20f24215891a6a81aaaa5 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeBallExhaustion.lean @@ -0,0 +1,194 @@ +import OAI.Probability.SpanningForest.GraphBalls + +namespace OAI + +noncomputable section + +namespace Problem336 + +@[simp] theorem fst_mem_edgeBall (G : GraphCode) (e : EdgeCode) (n : ℕ) : + e.1.1 ∈ edgeBall G n e := Or.inl (withinRadius_refl G n e.1.1) + +@[simp] theorem snd_mem_edgeBall (G : GraphCode) (e : EdgeCode) (n : ℕ) : + e.1.2 ∈ edgeBall G n e := Or.inr (withinRadius_refl G n e.1.2) + +theorem withinRadius_reachable_inside {G : GraphCode} {c v n : ℕ} + (hv : withinRadius G n c v) : + Relation.ReflTransGen + (fun x y => withinRadius G n c x ∧ withinRadius G n c y ∧ Adj G x y) c v := by + induction n generalizing v with + | zero => + have : c = v := hv + subst v + exact .refl + | succ n ih => + have hlift : ∀ {v}, withinRadius G n c v → + Relation.ReflTransGen + (fun x y => withinRadius G (n + 1) c x ∧ + withinRadius G (n + 1) c y ∧ Adj G x y) c v := by + intro v hv + exact Relation.ReflTransGen.mono (fun x y h => + ⟨Or.inl h.1, Or.inl h.2.1, h.2.2⟩) _ _ (ih hv) + rcases hv with hv | ⟨u, hu, huv⟩ + · exact hlift hv + · exact (hlift hu).tail ⟨Or.inl hu, Or.inr ⟨u, hu, huv⟩, huv⟩ + +theorem edgeBall_reachable {G : GraphCode} {e : EdgeCode} {v n : ℕ} + (he : Adj G e.1.1 e.1.2) (hv : v ∈ edgeBall G n e) : + Relation.ReflTransGen + (fun x y => x ∈ edgeBall G n e ∧ y ∈ edgeBall G n e ∧ Adj G x y) e.1.1 v := by + rcases hv with hv | hv + · exact Relation.ReflTransGen.mono + (fun x y h => ⟨Or.inl h.1, Or.inl h.2.1, h.2.2⟩) _ _ (withinRadius_reachable_inside hv) + · exact (Relation.ReflTransGen.single + ⟨fst_mem_edgeBall G e n, snd_mem_edgeBall G e n, he⟩).trans + (Relation.ReflTransGen.mono + (fun x y h => ⟨Or.inr h.1, Or.inr h.2.1, h.2.2⟩) _ _ (withinRadius_reachable_inside hv)) + +def ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) : FiniteSubgraphCode := by + classical + exact (s, (s.product s).filter (fun p => p.1 < p.2 ∧ Adj G p.1 p.2)) + +@[simp] theorem ballInducedSubgraph_vertices (G : GraphCode) (s : Finset ℕ) : + (ballInducedSubgraph G s).1 = s := rfl + +@[simp] theorem mem_ballInducedSubgraph_edges (G : GraphCode) (s : Finset ℕ) + (p : ℕ × ℕ) : + p ∈ (ballInducedSubgraph G s).2 ↔ + p.1 ∈ s ∧ p.2 ∈ s ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + classical + simp [ballInducedSubgraph, and_assoc] + +private theorem ballAdj_symm {G : GraphCode} {u v : ℕ} (h : Adj G u v) : Adj G v u := + (G.2.2 v u).trans h + +private theorem ballAdj_ne {G : GraphCode} {u v : ℕ} (h : Adj G u v) : u ≠ v := by + rintro rfl + have hfalse := G.2.1 u + simp [Adj, hfalse] at h + +@[simp] theorem rawPair_mem_ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) + (u v : ℕ) : + rawPair u v ∈ (ballInducedSubgraph G s).2 ↔ u ∈ s ∧ v ∈ s ∧ Adj G u v := by + by_cases huv : u < v + · simp [rawPair, huv] + · simp only [rawPair, ite_eq_right huv, mem_ballInducedSubgraph_edges] + constructor + · rintro ⟨hv, hu, _, hAdj⟩ + exact ⟨hu, hv, ballAdj_symm hAdj⟩ + · rintro ⟨hu, hv, hAdj⟩ + exact ⟨hv, hu, lt_of_le_of_ne (Nat.le_of_not_gt huv) (Ne.symm (ballAdj_ne hAdj)), + ballAdj_symm hAdj⟩ + +@[simp] theorem subgraphAdj_ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) + (u v : ℕ) : + SubgraphAdj (ballInducedSubgraph G s) u v ↔ u ∈ s ∧ v ∈ s ∧ Adj G u v := by + simp only [SubgraphAdj, ballInducedSubgraph_vertices, rawPair_mem_ballInducedSubgraph] + tauto + +def edgeBallSubgraph (G : GraphCode) (hG : GraphLocallyFinite G) + (e : EdgeCode) (n : ℕ) : FiniteSubgraphCode := + ballInducedSubgraph G (finite_edgeBall G hG n e).toFinset + +@[simp] theorem mem_edgeBallSubgraph_vertices (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n v : ℕ) : + v ∈ (edgeBallSubgraph G hG e n).1 ↔ v ∈ edgeBall G n e := by + simp [edgeBallSubgraph] + +@[simp] theorem subgraphAdj_edgeBallSubgraph (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n u v : ℕ) : + SubgraphAdj (edgeBallSubgraph G hG e n) u v ↔ + u ∈ edgeBall G n e ∧ v ∈ edgeBall G n e ∧ Adj G u v := by + simp [edgeBallSubgraph] + +theorem isFiniteConnectedSubgraph_edgeBallSubgraph {G : GraphCode} + (hG : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.1.1 e.1.2) (n : ℕ) : + IsFiniteConnectedSubgraph G (edgeBallSubgraph G hG e n) := by + refine ⟨⟨e.1.1, by simp⟩, ?_, ?_⟩ + · intro p hp + simpa [edgeBallSubgraph] using hp + · intro u hu v hv + have path (w : ℕ) (hw : w ∈ (edgeBallSubgraph G hG e n).1) : + Relation.ReflTransGen (SubgraphAdj (edgeBallSubgraph G hG e n)) e.1.1 w := by + apply Relation.ReflTransGen.mono (fun x y hxy => + (subgraphAdj_edgeBallSubgraph G hG e n x y).mpr hxy) _ _ + (edgeBall_reachable he ((mem_edgeBallSubgraph_vertices G hG e n w).mp hw)) + let : Std.Symm (SubgraphAdj (edgeBallSubgraph G hG e n)) := ⟨fun x y hxy => by + rw [subgraphAdj_edgeBallSubgraph] at hxy ⊢ + exact ⟨hxy.2.1, hxy.1, ballAdj_symm hxy.2.2⟩⟩ + exact (symm (path u hu)).trans (path v hv) + +@[simp] theorem mem_edgeBallSubgraph_edges (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n : ℕ) (p : ℕ × ℕ) : + p ∈ (edgeBallSubgraph G hG e n).2 ↔ + p.1 ∈ edgeBall G n e ∧ p.2 ∈ edgeBall G n e ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + simp [edgeBallSubgraph] + +theorem isConnectedExhaustion_edgeBallSubgraph {G : GraphCode} + (hC : GraphConnected G) (hL : GraphLocallyFinite G) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) : + IsConnectedExhaustion G (edgeBallSubgraph G hL e) := by + refine ⟨isFiniteConnectedSubgraph_edgeBallSubgraph hL e he, ?_, ?_⟩ + · intro n + constructor + · intro v hv + rw [mem_edgeBallSubgraph_vertices] at hv ⊢ + exact edgeBall_mono G e (Nat.le_succ n) hv + · intro p hp + rw [mem_edgeBallSubgraph_edges] at hp ⊢ + exact ⟨edgeBall_mono G e (Nat.le_succ n) hp.1, + edgeBall_mono G e (Nat.le_succ n) hp.2.1, hp.2.2⟩ + · intro u v huv hAdj + obtain ⟨m, hm⟩ := exists_mem_edgeBall G hC e u + obtain ⟨n, hn⟩ := exists_mem_edgeBall G hC e v + refine ⟨max m n, ?_⟩ + rw [mem_edgeBallSubgraph_edges] + exact ⟨edgeBall_mono G e (le_max_left m n) hm, + edgeBall_mono G e (le_max_right m n) hn, huv, hAdj⟩ + +private theorem measurable_finset_from_membership + {α β : Type*} [Countable α] [MeasurableSpace α] [MeasurableSpace β] + (f : β → Finset α) (hf : ∀ a, MeasurableSet {b | a ∈ f b}) : Measurable f := by + apply measurable_to_countable + intro y + have hpre : f ⁻¹' {f y} = ⋂ a, {b | a ∈ f b ↔ a ∈ f y} := by + ext b + simp only [Set.mem_preimage, Set.mem_singleton_iff, Set.mem_iInter, Set.mem_ofPred_eq, + Finset.ext_iff] + rw [hpre] + apply MeasurableSet.iInter + intro a + by_cases ha : a ∈ f y + · simpa only [ha, iff_true] using hf a + · simpa only [ha, iff_false, Set.compl_ofPred] using (hf a).compl + +theorem measurable_edgeBallSubgraph (e : EdgeCode) (n : ℕ) : + Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + edgeBallSubgraph G.1 G.2 e n) := by + have hV : Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + (edgeBallSubgraph G.1 G.2 e n).1) := by + apply measurable_finset_from_membership + intro v + simpa only [mem_edgeBallSubgraph_vertices, Set.preimage_ofPred_eq] using + (measurableSet_mem_edgeBall n v e).preimage measurable_subtype_coe + have hE : Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + (edgeBallSubgraph G.1 G.2 e n).2) := by + apply measurable_finset_from_membership + intro p + by_cases hp : p.1 < p.2 + · have h := ((measurableSet_mem_edgeBall n p.1 e).inter + ((measurableSet_mem_edgeBall n p.2 e).inter + (measurableSet_adj p.1 p.2))).preimage + (measurable_subtype_coe : Measurable + (fun G : {G : GraphCode // GraphLocallyFinite G} => G.1)) + simpa only [mem_edgeBallSubgraph_edges, hp, true_and, Set.preimage_inter, + Set.preimage_ofPred_eq, Set.ofPred_and] using h + · simp only [mem_edgeBallSubgraph_edges, hp, false_and, and_false, Set.ofPred_false, + MeasurableSet.empty] + exact hV.prodMk hE + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeIID.lean b/lean/OAI/Probability/SpanningForest/EdgeIID.lean new file mode 100644 index 0000000000000000000000000000000000000000..58a856c1eb2f3555c724b0f73d5e044b891176f4 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeIID.lean @@ -0,0 +1,198 @@ +import OAI.Probability.SpanningForest.IIDBlocks +import OAI.Probability.SpanningForest.UniformSampler +import OAI.Probability.SpanningForest.EdgeAllocationMeasurable +import OAI.Probability.SpanningForest.CanonicalIID + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.EdgeIID + +local instance : IsProbabilityMeasure uniform01 := sampler_uniform01_probability +local instance : IsProbabilityMeasure privatePoolLaw := privatePoolLaw_probability +local instance : NullSingletonClass uniform01 := by + unfold uniform01 + infer_instance + +abbrev Stream := Option ℕ → ℝ + +def streamLaw : Measure Stream := Measure.infinitePi (fun _ : Option ℕ => uniform01) + +local instance : IsProbabilityMeasure streamLaw := by + unfold streamLaw + infer_instance + +def stream : ℝ → Stream := Classical.choose (exists_uniform01_sampler streamLaw) + +@[fun_prop] theorem measurable_stream : Measurable stream := + (Classical.choose_spec (exists_uniform01_sampler streamLaw)).1 + +theorem map_stream : uniform01.map stream = streamLaw := + (Classical.choose_spec (exists_uniform01_sampler streamLaw)).2 + +def expanded (U : ℕ → ℝ) (p : ℕ × Option ℕ) : ℝ := stream (U p.1) p.2 + +@[fun_prop] theorem measurable_expanded : Measurable expanded := by + apply Measurable.of_eval + intro p + exact (measurable_pi_apply p.2).comp (measurable_stream.comp (measurable_pi_apply p.1)) + +theorem map_expanded : + privatePoolLaw.map expanded = + Measure.infinitePi (fun _ : ℕ × Option ℕ => uniform01) := by + have hm : Measurable (fun U : ℕ → ℝ => fun v => stream (U v)) := by fun_prop + have heq : expanded = (MeasurableEquiv.curry ℕ (Option ℕ) ℝ).symm ∘ + (fun U : ℕ → ℝ => fun v => stream (U v)) := rfl + rw [heq, ← Measure.map_map (MeasurableEquiv.curry ℕ (Option ℕ) ℝ).symm.measurable hm] + unfold privatePoolLaw + rw [Measure.infinitePi_map_pi _ (fun _ => measurable_stream)] + simp only [map_stream, streamLaw] + exact Measure.infinitePi_map_curry_symm (fun (_ : ℕ) (_ : Option ℕ) => uniform01) + +def keys (U : ℕ → ℝ) (v : ℕ) : ℝ := expanded U (v, none) + +def pool (U : ℕ → ℝ) (p : ℕ × ℕ) : ℝ := expanded U (p.1, some p.2) + +@[fun_prop] theorem measurable_keys : Measurable keys := by + exact Measurable.of_eval (fun v => (measurable_pi_apply (v, none)).comp measurable_expanded) + +@[fun_prop] theorem measurable_pool : Measurable pool := by + exact Measurable.of_eval (fun p => + (measurable_pi_apply (p.1, some p.2)).comp measurable_expanded) + +theorem map_keys_pool : + privatePoolLaw.map (fun U => (keys U, pool U)) = + privatePoolLaw.prod (Measure.infinitePi (fun _ : ℕ × ℕ => uniform01)) := by + let a : ℕ → ℕ × Option ℕ := fun v => (v, none) + let b : ℕ × ℕ → ℕ × Option ℕ := fun p => (p.1, some p.2) + have ha : Function.Injective a := by + intro i j h + exact congrArg Prod.fst h + have hb : Function.Injective b := by + intro p q h + have h1 := congrArg Prod.fst h + have h2 := congrArg Prod.snd h + exact Prod.ext h1 (Option.some.inj h2) + have hab : Disjoint (Set.range a) (Set.range b) := by + rw [Set.disjoint_left] + rintro _ ⟨v, rfl⟩ ⟨p, h⟩ + have hh := congrArg Prod.snd h + simp [a, b] at hh + have hm : Measurable (fun z : (ℕ × Option ℕ) → ℝ => + ((fun v => z (a v)), (fun p => z (b p)))) := by fun_prop + have heq : (fun U => (keys U, pool U)) = + (fun z : (ℕ × Option ℕ) → ℝ => + ((fun v => z (a v)), (fun p => z (b p)))) ∘ expanded := rfl + rw [heq, ← Measure.map_map hm measurable_expanded, map_expanded] + exact RandomReindex.map_infinitePi_two_blocks uniform01 a b ha hb hab + +abbrev GraphEdge (G : GraphCode) := {e : EdgeCode // Adj G e.1.1 e.1.2} + +def raw (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : ℝ := + pool U (EdgeAllocation.coordinate G (keys U) e) + +theorem map_keys_raw (G : GraphCode) (hG : GraphLocallyFinite G) + (hm : ∀ e : EdgeCode, Measurable (fun k => EdgeAllocation.coordinate G k e)) : + privatePoolLaw.map (fun U => (keys U, fun e : GraphEdge G => raw G U e)) = + privatePoolLaw.prod (Measure.infinitePi (fun _ : GraphEdge G => uniform01)) := by + apply RandomReindex.map_random_injective_reindex_of_joint_law + privatePoolLaw privatePoolLaw uniform01 keys pool measurable_keys measurable_pool + map_keys_pool (fun k (e : GraphEdge G) => EdgeAllocation.coordinate G k e) + (fun e => hm e) + filter_upwards [RandomReindex.ae_injective_infinitePi (J := ℕ) uniform01] with k hk + intro e f hef + apply Subtype.ext + exact EdgeAllocation.coordinate_injOn hG hk e.property f.property hef + +theorem measurable_coordinate_fixed (G : GraphCode) (e : EdgeCode) : + Measurable (fun k => EdgeAllocation.coordinate G k e) := + EdgeAllocation.measurable_coordinate.comp + ((measurable_const.prodMk measurable_id).prodMk measurable_const) + +@[fun_prop] theorem measurable_raw (G : GraphCode) (e : EdgeCode) : + Measurable (fun U => raw G U e) := by + have hm := (measurable_coordinate_fixed G e).comp measurable_keys + exact (RandomReindex.measurable_random_eval + (fun U => EdgeAllocation.coordinate G (keys U) e) hm).comp + (measurable_id.prodMk measurable_pool) + +theorem map_keys : privatePoolLaw.map keys = privatePoolLaw := by + have h := congrArg (fun μ : Measure ((ℕ → ℝ) × ((ℕ × ℕ) → ℝ)) => + μ.map Prod.fst) map_keys_pool + rw [Measure.map_map measurable_fst (measurable_keys.prodMk measurable_pool), + Measure.map_fst_prod, measure_univ, one_smul] at h + exact h + +theorem ae_injective_keys : ∀ᵐ U ∂privatePoolLaw, Function.Injective (keys U) := by + apply ae_of_ae_map measurable_keys.aemeasurable + rw [map_keys] + exact RandomReindex.ae_injective_infinitePi uniform01 + +theorem map_raw (G : GraphCode) (hG : GraphLocallyFinite G) : + privatePoolLaw.map (fun U => fun e : GraphEdge G => raw G U e) = + Measure.infinitePi (fun _ : GraphEdge G => uniform01) := by + have h := congrArg (fun μ : Measure ((ℕ → ℝ) × (GraphEdge G → ℝ)) => + μ.map Prod.snd) (map_keys_raw G hG (measurable_coordinate_fixed G)) + rw [Measure.map_map measurable_snd (measurable_keys.prodMk + (Measurable.of_eval (fun e : GraphEdge G => measurable_raw G e))), + Measure.map_snd_prod, measure_univ, one_smul] at h + exact h + +theorem map_rule_of_eq_raw (G : GraphCode) (hG : GraphLocallyFinite G) + (F : (ℕ → ℝ) → EdgeCode → ℝ) + (hF : ∀ U, Function.Injective (keys U) → ∀ e, F U e = raw G U e) : + privatePoolLaw.map (fun U => fun e : GraphEdge G => F U e) = + Measure.infinitePi (fun _ : GraphEdge G => uniform01) := by + rw [← map_raw G hG] + apply Measure.map_congr + filter_upwards [ae_injective_keys] with U hU + exact funext (fun e => hF U hU e) + +theorem map_rule_of_vertexIID {Ω : Type} [MeasurableSpace Ω] + (G : GraphCode) (hG : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) + (F : (ℕ → ℝ) → EdgeCode → ℝ) + (hm : ∀ e, Measurable (fun labels => F labels e)) + (hF : ∀ labels, Function.Injective (keys labels) → + ∀ e, F labels e = raw G labels e) : + P.map (fun ω => fun e : GraphEdge G => F (fun v => U v ω) e) = + Measure.infinitePi (fun _ : GraphEdge G => uniform01) := by + have hlabels : Measurable (fun ω v => U v ω) := Measurable.of_eval hU.1 + rw [show (fun ω => fun e : GraphEdge G => F (fun v => U v ω) e) = + (fun labels => fun e : GraphEdge G => F labels e) ∘ (fun ω v => U v ω) from rfl, + ← Measure.map_map (Measurable.of_eval (fun e : GraphEdge G => hm e)) hlabels, + CanonicalIID.map_labels hU] + exact map_rule_of_eq_raw G hG F hF + +theorem map_sampled_rule_of_vertexIID {Ω Y : Type} [MeasurableSpace Ω] + [MeasurableSpace Y] (ν : Measure Y) + (sample : ℝ → Y) (hsample : Measurable sample) + (hsample_law : uniform01.map sample = ν) + (G : GraphCode) (hG : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) + (F : (ℕ → ℝ) → EdgeCode → ℝ) + (hm : ∀ e, Measurable (fun labels => F labels e)) + (hF : ∀ labels, Function.Injective (keys labels) → + ∀ e, F labels e = raw G labels e) : + P.map (fun ω => fun e : GraphEdge G => sample (F (fun v => U v ω) e)) = + Measure.infinitePi (fun _ : GraphEdge G => ν) := by + have hlabels : Measurable (fun ω v => U v ω) := Measurable.of_eval hU.1 + have hfield : Measurable (fun ω => fun e : GraphEdge G => F (fun v => U v ω) e) := + Measurable.of_eval (fun e => (hm e).comp hlabels) + have happly : Measurable (fun x : GraphEdge G → ℝ => fun e => sample (x e)) := + Measurable.of_eval (fun e => hsample.comp (measurable_pi_apply e)) + rw [show (fun ω => fun e : GraphEdge G => sample (F (fun v => U v ω) e)) = + (fun x : GraphEdge G → ℝ => fun e => sample (x e)) ∘ + (fun ω => fun e : GraphEdge G => F (fun v => U v ω) e) from rfl, + ← Measure.map_map happly hfield, map_rule_of_vertexIID G hG P U hU F hm hF, + Measure.infinitePi_map_pi _ (fun _ => hsample)] + simp only [hsample_law] + +end Problem336.EdgeIID + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EdgeUniformRule.lean b/lean/OAI/Probability/SpanningForest/EdgeUniformRule.lean new file mode 100644 index 0000000000000000000000000000000000000000..278e7ace0bc8b091fb5cfa2b6795fa2e6b18ef53 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EdgeUniformRule.lean @@ -0,0 +1,142 @@ +import OAI.Probability.SpanningForest.EdgeIID +import OAI.Probability.SpanningForest.EdgeAllocationMeasurable +import OAI.Probability.SpanningForest.NoCollisionExtension + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def vertexKeys (U : ℕ → ℝ) : ℕ → ℝ := EdgeIID.keys U + +def vertexPools (U : ℕ → ℝ) : (ℕ × ℕ) → ℝ := EdgeIID.pool U + +@[fun_prop] +theorem measurable_vertexKeys : Measurable vertexKeys := EdgeIID.measurable_keys + +@[fun_prop] +theorem measurable_vertexPools : Measurable vertexPools := EdgeIID.measurable_pool + +@[fun_prop] +theorem measurable_injective_keyField : + Measurable (fun key : ℕ → ℝ => Function.Injective key) := by + apply Measurable.forall + intro i + apply Measurable.forall + intro j + exact (measurableSet_setOfPred.mp + (measurableSet_eq_fun (measurable_pi_apply i) (measurable_pi_apply j))).imp + measurable_const + +@[simp] +theorem vertexKeys_relabel (σ : Equiv ℕ ℕ) (U : ℕ → ℝ) : + vertexKeys (relabelLabels σ U) = relabelLabels σ (vertexKeys U) := rfl + +def edgeUniformRule (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : ℝ := by + classical + exact if Function.Injective (vertexKeys U) then + vertexPools U (EdgeAllocation.coordinate G (vertexKeys U) e) + else 0 + +theorem edgeUniformRule_of_injective (G : GraphCode) {U : ℕ → ℝ} + (hU : Function.Injective (vertexKeys U)) (e : EdgeCode) : + edgeUniformRule G U e = + vertexPools U (EdgeAllocation.coordinate G (vertexKeys U) e) := by + simp [edgeUniformRule, hU] + +@[fun_prop] +theorem measurable_edgeUniformRule : + Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + edgeUniformRule q.1.1 q.1.2 q.2) := by + classical + have hkeys : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + vertexKeys q.1.2) := measurable_vertexKeys.comp measurable_fst.snd + have hpool : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + vertexPools q.1.2) := measurable_vertexPools.comp measurable_fst.snd + have hcoord : Measurable (fun q : (GraphCode × (ℕ → ℝ)) × EdgeCode => + EdgeAllocation.coordinate q.1.1 (vertexKeys q.1.2) q.2) := + EdgeAllocation.measurable_coordinate.comp + ((measurable_fst.fst.prodMk hkeys).prodMk measurable_snd) + have heval : Measurable + (fun p : ((ℕ × ℕ) → ℝ) × (ℕ × ℕ) => p.1 p.2) := + measurable_from_prod_countable_left fun p => measurable_pi_apply p + exact Measurable.ite + (measurable_injective_keyField.comp hkeys).setOf + (heval.comp (hpool.prodMk hcoord)) measurable_const + +theorem measurable_edgeUniformRule_uncurried : + Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => + edgeUniformRule q.1 q.2.1 q.2.2) := + measurable_edgeUniformRule.comp + ((measurable_fst.prodMk measurable_snd.fst).prodMk measurable_snd.snd) + +theorem edgeUniformRule_equivariant (σ : Equiv ℕ ℕ) (G : GraphCode) + (U : ℕ → ℝ) (e : EdgeCode) : + edgeUniformRule (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = + edgeUniformRule G U e := by + by_cases hk : Function.Injective (vertexKeys U) + · simp only [edgeUniformRule, vertexKeys_relabel, injective_relabelLabels_iff, + hk, ite_true, EdgeAllocation.coordinate_relabel σ G hk] + simp [vertexPools, EdgeIID.pool, EdgeIID.expanded, relabelLabels] + · simp [edgeUniformRule, injective_relabelLabels_iff, hk] + +theorem edgeUniformRule_eq_raw (G : GraphCode) (U : ℕ → ℝ) + (hU : Function.Injective (EdgeIID.keys U)) (e : EdgeCode) : + edgeUniformRule G U e = EdgeIID.raw G U e := by + exact edgeUniformRule_of_injective G hU e + +@[fun_prop] +theorem measurable_edgeUniformRule_fixed (G : GraphCode) (e : EdgeCode) : + Measurable (fun U => edgeUniformRule G U e) := + measurable_edgeUniformRule.comp + ((measurable_const.prodMk measurable_id).prodMk measurable_const) + +theorem edgeUniformRule_law {Ω : Type} [MeasurableSpace Ω] + (G : GraphCode) (hG : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) : + P.map (fun ω => fun e : EdgeIID.GraphEdge G => + edgeUniformRule G (fun v => U v ω) e) = + Measure.infinitePi (fun _ : EdgeIID.GraphEdge G => uniform01) := + EdgeIID.map_rule_of_vertexIID G hG P U hU (edgeUniformRule G) + (measurable_edgeUniformRule_fixed G) (edgeUniformRule_eq_raw G) + +theorem sampled_edgeUniformRule_law {Ω Y : Type} [MeasurableSpace Ω] + [MeasurableSpace Y] (ν : Measure Y) + (sample : ℝ → Y) (hsample : Measurable sample) + (hsample_law : uniform01.map sample = ν) + (G : GraphCode) (hG : GraphLocallyFinite G) + (P : Measure Ω) (U : ℕ → Ω → ℝ) (hU : IsVertexIID P U) : + P.map (fun ω => fun e : EdgeIID.GraphEdge G => + sample (edgeUniformRule G (fun v => U v ω) e)) = + Measure.infinitePi (fun _ : EdgeIID.GraphEdge G => ν) := + EdgeIID.map_sampled_rule_of_vertexIID ν sample hsample hsample_law + G hG P U hU (edgeUniformRule G) (measurable_edgeUniformRule_fixed G) + (edgeUniformRule_eq_raw G) + +theorem exists_equivariant_edge_iid_sampler {Y : Type} [MeasurableSpace Y] + [Nonempty Y] [StandardBorelSpace Y] (ν : Measure Y) [IsProbabilityMeasure ν] : + ∃ Ψ : GraphCode → (ℕ → ℝ) → EdgeCode → Y, + Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => Ψ q.1 q.2.1 q.2.2) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Ψ (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Ψ G U e) ∧ + ∀ (G : GraphCode), GraphLocallyFinite G → + ∀ (Ω : Type) [MeasurableSpace Ω] (P : Measure Ω) (U : ℕ → Ω → ℝ), + IsVertexIID P U → + P.map (fun ω => fun e : EdgeIID.GraphEdge G => Ψ G (fun v => U v ω) e) = + Measure.infinitePi (fun _ : EdgeIID.GraphEdge G => ν) := by + obtain ⟨sample, hm, hlaw⟩ := exists_uniform01_sampler ν + refine ⟨fun G U e => sample (edgeUniformRule G U e), + hm.comp measurable_edgeUniformRule_uncurried, ?_, ?_⟩ + · intro σ G U e + exact congrArg sample (edgeUniformRule_equivariant σ G U e) + · intro G hG Ω _ P U hU + exact sampled_edgeUniformRule_law ν sample hm hlaw G hG P U hU + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/EquivariantFUSFKernel.lean b/lean/OAI/Probability/SpanningForest/EquivariantFUSFKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb39f799adc5033db7a58a920533c122bca39092 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/EquivariantFUSFKernel.lean @@ -0,0 +1,70 @@ +import OAI.Probability.SpanningForest.BorelFUSFKernel +import OAI.Probability.SpanningForest.FUSFRelabelMeasure +import OAI.Probability.SpanningForest.GraphDomain +import OAI.Probability.SpanningForest.Relabeling + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.BorelFUSFKernel + +theorem exists_measurable_equivariant_fusf_kernel_on + (D : Set GraphCode) (hD : MeasurableSet D) + (hconn : ∀ G : D, GraphConnected G.1) + (hinv : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode), relabelGraph σ G ∈ D ↔ G ∈ D) + (hex : ∀ G : D, ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G.1 (μ : Measure EdgeConfiguration) id) : + ∃ μ : GraphCode → ProbabilityMeasure EdgeConfiguration, + Measurable μ ∧ + (∀ G ∈ D, HasFUSFLaw G (μ G : Measure EdgeConfiguration) id) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode), + (μ G : Measure EdgeConfiguration).map (configurationRelabel σ) = + (μ (relabelGraph σ G) : Measure EdgeConfiguration)) := by + classical + obtain ⟨μ, hμm, hμ⟩ := exists_measurable_fusf_kernel_of_exists D hconn hex + let μ₀ : ProbabilityMeasure EdgeConfiguration := + ⟨Measure.dirac (fun _ => false), inferInstance⟩ + let ν (G : GraphCode) := if h : G ∈ D then μ ⟨G, h⟩ else μ₀ + refine ⟨ν, Measurable.dite hμm measurable_const hD, ?_, ?_⟩ + · intro G hG + simpa only [ν, dite_eq_left hG] using hμ ⟨G, hG⟩ + · intro σ G + by_cases hG : G ∈ D + · have hσG := (hinv σ G).mpr hG + simp only [ν, dite_eq_left hG, dite_eq_left hσG] + exact (hμ ⟨G, hG⟩).map_configurationRelabel σ (hμ ⟨_, hσG⟩) + (BorelExhaustion.candidate_isConnectedExhaustion_of_connected (hconn ⟨G, hG⟩)) + · have hσG : relabelGraph σ G ∉ D := fun h => hG ((hinv σ G).mp h) + simp only [ν, dite_eq_right hG, dite_eq_right hσG] + change (Measure.dirac (fun _ : EdgeCode => false)).map + (configurationRelabel σ) = Measure.dirac (fun _ : EdgeCode => false) + rw [Measure.map_dirac' (configurationRelabel σ).measurable] + rfl + +theorem exists_measurable_equivariant_fusf_kernel + (hex : ∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id) : + ∃ μ : GraphCode → ProbabilityMeasure EdgeConfiguration, + Measurable μ ∧ + (∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G (μ G : Measure EdgeConfiguration) id) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode), + (μ G : Measure EdgeConfiguration).map (configurationRelabel σ) = + (μ (relabelGraph σ G) : Measure EdgeConfiguration)) := by + obtain ⟨μ, hμm, hμ, hμeq⟩ := exists_measurable_equivariant_fusf_kernel_on + {G : GraphCode | GraphConnected G ∧ GraphLocallyFinite G} + measurableSet_validGraph (fun G => G.2.1) + (fun σ G => by simp only [Set.mem_ofPred_eq, graphConnected_relabelGraph_iff, + graphLocallyFinite_relabelGraph_iff]) + (fun G => hex G.1 G.2.1 G.2.2) + exact ⟨μ, hμm, fun G hc hf => hμ G ⟨hc, hf⟩, hμeq⟩ + +end Problem336.BorelFUSFKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Exhaustion.lean b/lean/OAI/Probability/SpanningForest/Exhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..af2779eb003c78db125b53d59dffd29c728be428 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Exhaustion.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open Filter + +namespace Problem336 + +theorem GraphConnected.exists_adj {G : GraphCode} (hG : GraphConnected G) (u : ℕ) : + ∃ v, Adj G u v := by + rcases (hG u (u + 1)).cases_head with h | ⟨v, huv, _⟩ + · omega + · exact ⟨v, huv⟩ + +namespace IsConnectedExhaustion + +variable {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + +theorem monotone_vertices (hH : IsConnectedExhaustion G H) : + Monotone (fun n => (H n).1) := + monotone_nat_of_le_succ (fun n => (hH.2.1 n).1) + +theorem monotone_edges (hH : IsConnectedExhaustion G H) : + Monotone (fun n => (H n).2) := + monotone_nat_of_le_succ (fun n => (hH.2.1 n).2) + +theorem eventually_mem_edges (hH : IsConnectedExhaustion G H) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) : + ∀ᶠ n in atTop, e.1 ∈ (H n).2 := by + obtain ⟨n, hn⟩ := hH.2.2 e.1.1 e.1.2 e.2 he + filter_upwards [eventually_ge_atTop n] with m hm + exact hH.monotone_edges hm hn + +theorem eventually_mem_edges_finset (hH : IsConnectedExhaustion G H) + (s : Finset EdgeCode) (hs : ∀ e ∈ s, Adj G e.1.1 e.1.2) : + ∀ᶠ n in atTop, ∀ e ∈ s, e.1 ∈ (H n).2 := by + rw [Finset.eventually_all] + intro e he + exact hH.eventually_mem_edges e (hs e he) + +theorem endpoints_mem (hH : IsConnectedExhaustion G H) + {n : ℕ} {p : ℕ × ℕ} (hp : p ∈ (H n).2) : + p.1 ∈ (H n).1 ∧ p.2 ∈ (H n).1 := by + exact ⟨((hH.1 n).2.1 p hp).1, ((hH.1 n).2.1 p hp).2.1⟩ + +theorem eventually_mem_rawPair (hH : IsConnectedExhaustion G H) + {u v : ℕ} (huv : Adj G u v) : + ∀ᶠ n in atTop, rawPair u v ∈ (H n).2 := by + have hne : u ≠ v := by + intro h + subst v + have hfalse := G.2.1 u + simp [Adj, hfalse] at huv + unfold rawPair + split_ifs with hlt + · exact hH.eventually_mem_edges ⟨(u, v), hlt⟩ huv + · have hgt : v < u := lt_of_le_of_ne (Nat.le_of_not_gt hlt) (Ne.symm hne) + have hvu : Adj G v u := by + unfold Adj at * + rw [G.2.2 v u] + exact huv + exact hH.eventually_mem_edges ⟨(v, u), hgt⟩ hvu + +theorem eventually_mem_vertices (hH : IsConnectedExhaustion G H) + (hG : GraphConnected G) (u : ℕ) : + ∀ᶠ n in atTop, u ∈ (H n).1 := by + obtain ⟨v, huv⟩ := hG.exists_adj u + filter_upwards [hH.eventually_mem_rawPair huv] with n hn + have hend := hH.endpoints_mem hn + unfold rawPair at hend + split_ifs at hend with hlt + · exact hend.1 + · exact hend.2 + +theorem eventually_subset_vertices (hH : IsConnectedExhaustion G H) + (hG : GraphConnected G) (s : Finset ℕ) : + ∀ᶠ n in atTop, s ⊆ (H n).1 := by + change ∀ᶠ n in atTop, ∀ u ∈ s, u ∈ (H n).1 + rw [Finset.eventually_all] + intro u _ + exact hH.eventually_mem_vertices hG u + +theorem eventually_subset_edges (hH : IsConnectedExhaustion G H) + (s : Finset (ℕ × ℕ)) + (hs : ∀ p ∈ s, p.1 < p.2 ∧ Adj G p.1 p.2) : + ∀ᶠ n in atTop, s ⊆ (H n).2 := by + change ∀ᶠ n in atTop, ∀ p ∈ s, p ∈ (H n).2 + rw [Finset.eventually_all] + intro p hp + exact hH.eventually_mem_edges ⟨p, (hs p hp).1⟩ (hs p hp).2 + +theorem eventually_contains (hH : IsConnectedExhaustion G H) + (hG : GraphConnected G) {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : + ∀ᶠ n in atTop, K.1 ⊆ (H n).1 ∧ K.2 ⊆ (H n).2 := by + refine (hH.eventually_subset_vertices hG K.1).and ?_ + apply hH.eventually_subset_edges K.2 + intro p hp + exact ((hK.2.1 p hp).2.2) + +end IsConnectedExhaustion + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ExhaustionExistence.lean b/lean/OAI/Probability/SpanningForest/ExhaustionExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0bfd368451c6e1a4d8521d22509572cdbc4d4b6 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ExhaustionExistence.lean @@ -0,0 +1,202 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +namespace Problem336 + +theorem reflTransGen_finite_rooted_support {α : Type*} [DecidableEq α] + {r : α → α → Prop} {a b : α} (h : Relation.ReflTransGen r a b) : + ∃ S : Finset α, a ∈ S ∧ b ∈ S ∧ + ∀ v ∈ S, Relation.ReflTransGen + (fun x y => x ∈ S ∧ y ∈ S ∧ r x y) a v := by + induction h with + | refl => + refine ⟨{a}, by simp, by simp, ?_⟩ + intro v hv + have : v = a := Finset.mem_singleton.mp hv + subst v + exact .refl + | @tail b c hab hbc ih => + obtain ⟨S, ha, hb, hS⟩ := ih + have lift {v : α} (hv : v ∈ S) : + Relation.ReflTransGen + (fun x y => x ∈ insert c S ∧ y ∈ insert c S ∧ r x y) a v := + Relation.ReflTransGen.mono (fun x y hxy => + ⟨Finset.mem_insert_of_mem hxy.1, + Finset.mem_insert_of_mem hxy.2.1, hxy.2.2⟩) a v (hS v hv) + refine ⟨insert c S, Finset.mem_insert_of_mem ha, by simp, ?_⟩ + intro v hv + rcases Finset.mem_insert.mp hv with rfl | hv + · exact (lift hb).tail + ⟨Finset.mem_insert_of_mem hb, Finset.mem_insert_self _ _, hbc⟩ + · exact lift hv + +def inducedFiniteCode (G : GraphCode) (S : Finset ℕ) : FiniteSubgraphCode := by + classical + exact (S, (S.product S).filter (fun p => p.1 < p.2 ∧ Adj G p.1 p.2)) + +@[simp] theorem mem_inducedFiniteCode_edges {G : GraphCode} {S : Finset ℕ} + {u v : ℕ} : + (u, v) ∈ (inducedFiniteCode G S).2 ↔ + u ∈ S ∧ v ∈ S ∧ u < v ∧ Adj G u v := by + classical + constructor + · intro h + have hfilter := Finset.mem_filter.mp h + have hprod := Finset.mem_product.mp hfilter.1 + exact ⟨hprod.1, hprod.2, hfilter.2.1, hfilter.2.2⟩ + · rintro ⟨hu, hv, hlt, hadj⟩ + exact Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨hu, hv⟩, hlt, hadj⟩ + +private theorem adj_symm_exhaustion {G : GraphCode} {u v : ℕ} + (h : Adj G u v) : Adj G v u := by + unfold Adj at * + rw [G.2.2 v u] + exact h + +private theorem adj_ne_exhaustion {G : GraphCode} {u v : ℕ} + (h : Adj G u v) : u ≠ v := by + intro huv + subst v + unfold Adj at h + rw [G.2.1 u] at h + cases h + +theorem subgraphAdj_inducedFiniteCode_iff {G : GraphCode} {S : Finset ℕ} + {u v : ℕ} : + SubgraphAdj (inducedFiniteCode G S) u v ↔ + u ∈ S ∧ v ∈ S ∧ Adj G u v := by + unfold SubgraphAdj rawPair + change (u ∈ S ∧ v ∈ S ∧ + (if u < v then (u, v) else (v, u)) ∈ (inducedFiniteCode G S).2) ↔ _ + by_cases huv : u < v + · simp only [ite_eq_left huv, mem_inducedFiniteCode_edges] + tauto + · simp only [ite_eq_right huv, mem_inducedFiniteCode_edges] + constructor + · rintro ⟨hu, hv, _, _, _, hadj⟩ + exact ⟨hu, hv, adj_symm_exhaustion hadj⟩ + · rintro ⟨hu, hv, hadj⟩ + exact ⟨hu, hv, hv, hu, + lt_of_le_of_ne (Nat.le_of_not_gt huv) (Ne.symm (adj_ne_exhaustion hadj)), + adj_symm_exhaustion hadj⟩ + +theorem inducedFiniteCode_connected_of_rooted {G : GraphCode} {S : Finset ℕ} + {a : ℕ} (ha : a ∈ S) + (hS : ∀ v ∈ S, Relation.ReflTransGen + (fun x y => x ∈ S ∧ y ∈ S ∧ Adj G x y) a v) : + IsFiniteConnectedSubgraph G (inducedFiniteCode G S) := by + refine ⟨⟨a, ha⟩, ?_, ?_⟩ + · intro p hp + exact mem_inducedFiniteCode_edges.mp hp + · intro u hu v hv + have forward (w : ℕ) (hw : w ∈ S) : + Relation.ReflTransGen (SubgraphAdj (inducedFiniteCode G S)) a w := + Relation.ReflTransGen.mono + (fun x y hxy => subgraphAdj_inducedFiniteCode_iff.mpr hxy) a w (hS w hw) + have backward : Relation.ReflTransGen (SubgraphAdj (inducedFiniteCode G S)) u a := by + have h := forward u hu + induction h with + | refl => exact .refl + | @tail b c hab hbc ih => + have hc := subgraphAdj_inducedFiniteCode_iff.mp hbc + exact (Relation.ReflTransGen.single + (subgraphAdj_inducedFiniteCode_iff.mpr + ⟨hc.2.1, hc.1, adj_symm_exhaustion hc.2.2⟩)).trans (ih hc.1) + exact backward.trans (forward v hv) + +theorem GraphConnected.exists_connected_exhaustion {G : GraphCode} + (hG : GraphConnected G) : + ∃ H : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H := by + classical + have supports : ∀ n : ℕ, ∃ S : Finset ℕ, 0 ∈ S ∧ n ∈ S ∧ + ∀ v ∈ S, Relation.ReflTransGen + (fun x y => x ∈ S ∧ y ∈ S ∧ Adj G x y) 0 v := + fun n => reflTransGen_finite_rooted_support (hG 0 n) + choose S hzero hn hroot using supports + let V : ℕ → Finset ℕ := fun n => (Finset.range (n + 1)).biUnion S + have hsub {n i : ℕ} (hi : i ≤ n) : S i ⊆ V n := by + intro u hu + exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_range.mpr (by omega), hu⟩ + have hvertex (n : ℕ) : n ∈ V n := hsub (le_refl n) (hn n) + have hzeroV (n : ℕ) : 0 ∈ V n := hsub (Nat.zero_le n) (hzero 0) + have hmono {n m : ℕ} (hnm : n ≤ m) : V n ⊆ V m := by + intro u hu + obtain ⟨i, hi, hui⟩ := Finset.mem_biUnion.mp hu + exact hsub (by have := Finset.mem_range.mp hi; omega) hui + have hrootV (n : ℕ) (v : ℕ) (hv : v ∈ V n) : + Relation.ReflTransGen + (fun x y => x ∈ V n ∧ y ∈ V n ∧ Adj G x y) 0 v := by + obtain ⟨i, hi, hvi⟩ := Finset.mem_biUnion.mp hv + have hisub : S i ⊆ V n := hsub (by have := Finset.mem_range.mp hi; omega) + exact Relation.ReflTransGen.mono + (fun x y hxy => ⟨hisub hxy.1, hisub hxy.2.1, hxy.2.2⟩) + 0 v (hroot i v hvi) + refine ⟨fun n => inducedFiniteCode G (V n), ?_, ?_, ?_⟩ + · intro n + exact inducedFiniteCode_connected_of_rooted (hzeroV n) (hrootV n) + · intro n + refine ⟨hmono (Nat.le_succ n), ?_⟩ + intro p hp + obtain ⟨hu, hv, hlt, hadj⟩ := mem_inducedFiniteCode_edges.mp hp + exact mem_inducedFiniteCode_edges.mpr + ⟨hmono (Nat.le_succ n) hu, hmono (Nat.le_succ n) hv, hlt, hadj⟩ + · intro u v huv hadj + refine ⟨v, mem_inducedFiniteCode_edges.mpr ?_⟩ + exact ⟨hmono (Nat.le_of_lt huv) (hvertex u), hvertex v, huv, hadj⟩ + +theorem GraphConnected.exists_finite_induced_containing {G : GraphCode} + (hG : GraphConnected G) (V : Finset ℕ) : + ∃ S : Finset ℕ, V ⊆ S ∧ + IsFiniteConnectedSubgraph G (inducedFiniteCode G S) := by + classical + have supports : ∀ n : ℕ, ∃ S : Finset ℕ, 0 ∈ S ∧ n ∈ S ∧ + ∀ v ∈ S, Relation.ReflTransGen + (fun x y => x ∈ S ∧ y ∈ S ∧ Adj G x y) 0 v := + fun n => reflTransGen_finite_rooted_support (hG 0 n) + choose S hzero hn hroot using supports + let W : Finset ℕ := (insert 0 V).biUnion S + have hsub {i : ℕ} (hi : i ∈ insert 0 V) : S i ⊆ W := by + intro u hu + exact Finset.mem_biUnion.mpr ⟨i, hi, hu⟩ + refine ⟨W, ?_, inducedFiniteCode_connected_of_rooted + (hsub (Finset.mem_insert_self 0 V) (hzero 0)) ?_⟩ + · intro u hu + exact hsub (Finset.mem_insert_of_mem hu) (hn u) + · intro v hv + obtain ⟨i, hi, hvi⟩ := Finset.mem_biUnion.mp hv + exact Relation.ReflTransGen.mono + (fun x y hxy => ⟨hsub hi hxy.1, hsub hi hxy.2.1, hxy.2.2⟩) + 0 v (hroot i v hvi) + +theorem GraphConnected.exists_finiteConnected_containing {G : GraphCode} + (hG : GraphConnected G) (V : Finset ℕ) : + ∃ K : FiniteSubgraphCode, IsFiniteConnectedSubgraph G K ∧ V ⊆ K.1 := by + obtain ⟨S, hVS, hS⟩ := hG.exists_finite_induced_containing V + exact ⟨inducedFiniteCode G S, hS, hVS⟩ + +theorem GraphConnected.exists_finiteConnected_extension {G : GraphCode} + (hG : GraphConnected G) (K₀ : FiniteSubgraphCode) + (hE : ∀ p ∈ K₀.2, p.1 < p.2 ∧ Adj G p.1 p.2) : + ∃ K : FiniteSubgraphCode, IsFiniteConnectedSubgraph G K ∧ + K₀.1 ⊆ K.1 ∧ K₀.2 ⊆ K.2 := by + classical + let V := K₀.1 ∪ K₀.2.image Prod.fst ∪ K₀.2.image Prod.snd + obtain ⟨S, hVS, hS⟩ := hG.exists_finite_induced_containing V + refine ⟨inducedFiniteCode G S, hS, ?_, ?_⟩ + · intro u hu + exact hVS (Finset.mem_union_left _ (Finset.mem_union_left _ hu)) + · intro p hp + apply mem_inducedFiniteCode_edges.mpr + refine ⟨hVS ?_, hVS ?_, (hE p hp).1, (hE p hp).2⟩ + · exact Finset.mem_union_left _ + (Finset.mem_union_right _ (Finset.mem_image_of_mem Prod.fst hp)) + · exact Finset.mem_union_right _ (Finset.mem_image_of_mem Prod.snd hp) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ExponentialFamily.lean b/lean/OAI/Probability/SpanningForest/ExponentialFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ce460173b3a51c54c317768a6d6bf44274824ec --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ExponentialFamily.lean @@ -0,0 +1,111 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.ExponentialFamily + +variable {α : Type*} [Fintype α] + +def partition (w g : α → ℝ) (t : ℝ) : ℝ := + ∑ a, w a * Real.exp (t * g a) + +def numerator (w g f : α → ℝ) (t : ℝ) : ℝ := + ∑ a, w a * Real.exp (t * g a) * f a + +def mean (w g f : α → ℝ) (t : ℝ) : ℝ := + numerator w g f t / partition w g t + +lemma hasDerivAt_partition (w g : α → ℝ) (t : ℝ) : + HasDerivAt (partition w g) (numerator w g g t) t := by + unfold partition numerator + apply HasDerivAt.fun_sum + intro a _ + simpa only [id_eq, one_mul, mul_assoc, mul_comm, mul_left_comm] using + (((hasDerivAt_id t).mul_const (g a)).exp.const_mul (w a)) + +lemma hasDerivAt_numerator (w g f : α → ℝ) (t : ℝ) : + HasDerivAt (numerator w g f) + (numerator w g (fun a => f a * g a) t) t := by + unfold numerator + apply HasDerivAt.fun_sum + intro a _ + simpa only [id_eq, one_mul, mul_assoc, mul_comm, mul_left_comm] using + ((((hasDerivAt_id t).mul_const (g a)).exp.const_mul (w a)).mul_const (f a)) + +theorem hasDerivAt_mean (w g f : α → ℝ) (t : ℝ) + (hz : partition w g t ≠ 0) : + HasDerivAt (mean w g f) + (mean w g (fun a => f a * g a) t - mean w g f t * mean w g g t) t := by + have h := (hasDerivAt_numerator w g f t).div (hasDerivAt_partition w g t) hz + apply h.congr_deriv + unfold mean + field_simp + +lemma partition_pos (w g : α → ℝ) (t : ℝ) + (hw : ∀ a, 0 ≤ w a) (hpos : ∃ a, 0 < w a) : + 0 < partition w g t := by + classical + obtain ⟨a, ha⟩ := hpos + unfold partition + exact Finset.sum_pos' (fun b _ => mul_nonneg (hw b) (Real.exp_pos _).le) + ⟨a, Finset.mem_univ a, mul_pos ha (Real.exp_pos _)⟩ + +theorem hasDerivAt_mean_of_nonneg (w g f : α → ℝ) (t : ℝ) + (hw : ∀ a, 0 ≤ w a) (hpos : ∃ a, 0 < w a) : + HasDerivAt (mean w g f) + (mean w g (fun a => f a * g a) t - mean w g f t * mean w g g t) t := + hasDerivAt_mean w g f t (ne_of_gt (partition_pos w g t hw hpos)) + +def mass (w g : α → ℝ) (t : ℝ) (a : α) : ℝ := + w a * Real.exp (t * g a) / partition w g t + +lemma sum_mass (w g : α → ℝ) (t : ℝ) (hz : partition w g t ≠ 0) : + ∑ a, mass w g t a = 1 := by + simp only [mass, ← Finset.sum_div] + exact div_self hz + +lemma mass_nonneg (w g : α → ℝ) (t : ℝ) (hw : ∀ a, 0 ≤ w a) (a : α) : + 0 ≤ mass w g t a := by + unfold mass partition + exact div_nonneg (mul_nonneg (hw a) (Real.exp_pos _).le) + (Finset.sum_nonneg (fun b _ => mul_nonneg (hw b) (Real.exp_pos _).le)) + +lemma mean_eq_sum_mass (w g f : α → ℝ) (t : ℝ) : + mean w g f t = ∑ a, mass w g t a * f a := by + simp only [mean, numerator, mass, Finset.sum_div] + apply Finset.sum_congr rfl + intro a _ + ring + +lemma mean_nonneg (w g f : α → ℝ) (t : ℝ) + (hw : ∀ a, 0 ≤ w a) (hf : ∀ a, 0 ≤ f a) : + 0 ≤ mean w g f t := by + rw [mean_eq_sum_mass] + exact Finset.sum_nonneg (fun a _ => mul_nonneg (mass_nonneg w g t hw a) (hf a)) + +lemma mean_le_const (w g f : α → ℝ) (t c : ℝ) + (hw : ∀ a, 0 ≤ w a) (hz : partition w g t ≠ 0) (hf : ∀ a, f a ≤ c) : + mean w g f t ≤ c := by + rw [mean_eq_sum_mass] + calc + ∑ a, mass w g t a * f a ≤ ∑ a, mass w g t a * c := + Finset.sum_le_sum (fun a _ => mul_le_mul_of_nonneg_left (hf a) + (mass_nonneg w g t hw a)) + _ = c := by rw [← Finset.sum_mul, sum_mass w g t hz, one_mul] + +lemma mean_mem_Icc (w g f : α → ℝ) (t : ℝ) + (hw : ∀ a, 0 ≤ w a) (hz : partition w g t ≠ 0) + (hf : ∀ a, f a ∈ Set.Icc (0 : ℝ) 1) : + mean w g f t ∈ Set.Icc (0 : ℝ) 1 := + ⟨mean_nonneg w g f t hw (fun a => (hf a).1), + mean_le_const w g f t 1 hw hz (fun a => (hf a).2)⟩ + +end Problem336.ExponentialFamily + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FUSFExistenceReduction.lean b/lean/OAI/Probability/SpanningForest/FUSFExistenceReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..c13cc074226c26948cb536c1b700b3b109eec6d1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FUSFExistenceReduction.lean @@ -0,0 +1,41 @@ +import OAI.Probability.SpanningForest.FiniteUSTLimit +import OAI.Probability.SpanningForest.GraphEncoding + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336 + +theorem exists_hasFUSFLaw_of_inclusion_limits + (G : GraphCode) (H : ℕ → FiniteSubgraphCode) + (hH : IsConnectedExhaustion G H) + (L : Finset EdgeCode → ℝ≥0∞) + (hL : ∀ H' : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H' → + ∀ A, Tendsto (fun n => ustCylinder (H' n) A ∅) atTop (𝓝 (L A))) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := + exists_hasFUSFLaw_of_common_inclusion_limits G H hH + (fun _ hH' n => FiniteEncoding.spanningTrees_nonempty (hH'.1 n)) L hL + +theorem HasFUSFLaw.tendsto_finiteUSTProbabilityMeasure + {G : GraphCode} {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) : + Tendsto (fun n => finiteUSTProbabilityMeasure (H n) + (FiniteEncoding.spanningTrees_nonempty (hH.1 n))) atTop (𝓝 μ) := by + apply BinaryLaw.tendsto_iff_signedCylinders.mpr + intro A B + change Tendsto (fun n => finiteUSTMeasure (H n) (edgeCylinder A B)) atTop + (𝓝 ((μ : Measure EdgeConfiguration) (edgeCylinder A B))) + simp only [finiteUSTMeasure_edgeCylinder] + exact hμ.2 H hH A B + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FUSFLawSupport.lean b/lean/OAI/Probability/SpanningForest/FUSFLawSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bd794803c9e123ddd89eabf8fc82297677d0e57 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FUSFLawSupport.lean @@ -0,0 +1,137 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators ENNReal Topology + +namespace Problem336 + +theorem ustCylinder_eq_zero_of_present_not_mem + (K : FiniteSubgraphCode) (A B : Finset EdgeCode) (e : EdgeCode) + (he : e ∈ A) (hne : e.1 ∉ K.2) : + ustCylinder K A B = 0 := by + classical + unfold ustCylinder + apply ENNReal.div_eq_zero_iff.mpr + left + rw [Nat.cast_eq_zero, Finset.card_eq_zero] + apply Finset.ext + intro T + simp only [Finset.mem_filter, Finset.notMem_empty, iff_false] + rintro ⟨hT, hgood⟩ + have ht : T ⊆ K.2 ∧ TreeOn K T := by + simpa only [spanningTrees, Finset.mem_filter, Finset.mem_powerset] using hT + exact hne (ht.2.1 (hgood.1 e he)) + +theorem ustCylinder_eq_zero_of_nonedge + {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) + (A B : Finset EdgeCode) (e : EdgeCode) (he : e ∈ A) + (hne : ¬ Adj G e.1.1 e.1.2) : + ustCylinder K A B = 0 := by + apply ustCylinder_eq_zero_of_present_not_mem K A B e he + intro hmem + exact hne (hK.2.1 e.1 hmem).2.2.2 + +theorem HasFUSFLaw.measure_cylinder_eq_zero_of_nonedge + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) + (A B : Finset EdgeCode) (e : EdgeCode) (he : e ∈ A) + (hne : ¬ Adj G e.1.1 e.1.2) : + P {ω | (∀ f ∈ A, X ω f = true) ∧ (∀ f ∈ B, X ω f = false)} = 0 := by + have hconv := hX.2 H hH A B + have hzero : (fun n => ustCylinder (H n) A B) = fun _ => 0 := by + funext n + exact ustCylinder_eq_zero_of_nonedge (hH.1 n) A B e he hne + rw [hzero] at hconv + exact tendsto_nhds_unique hconv tendsto_const_nhds + +theorem HasFUSFLaw.measure_present_eq_zero_of_nonedge + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) + (e : EdgeCode) (hne : ¬ Adj G e.1.1 e.1.2) : + P {ω | X ω e = true} = 0 := by + simpa using hX.measure_cylinder_eq_zero_of_nonedge H hH {e} ∅ e + (Finset.mem_singleton_self e) hne + +theorem HasFUSFLaw.ae_false_of_nonedge + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) + (e : EdgeCode) (hne : ¬ Adj G e.1.1 e.1.2) : + ∀ᵐ ω ∂P, X ω e = false := by + rw [ae_iff] + simpa only [Bool.not_eq_false] using + hX.measure_present_eq_zero_of_nonedge H hH e hne + +theorem HasFUSFLaw.ae_subgraph + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) : + ∀ᵐ ω ∂P, ∀ e : EdgeCode, X ω e = true → Adj G e.1.1 e.1.2 := by + rw [ae_all_iff] + intro e + by_cases he : Adj G e.1.1 e.1.2 + · exact Filter.Eventually.of_forall (fun _ _ => he) + · filter_upwards [hX.ae_false_of_nonedge H hH e he] with ω hω + intro htrue + simp [hω] at htrue + +theorem HasFUSFLaw.congr_ae + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X Y : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (hY : ∀ e, Measurable (fun ω => Y ω e)) + (hXY : ∀ e, (fun ω => X ω e) =ᵐ[P] fun ω => Y ω e) : + HasFUSFLaw G P Y := by + refine ⟨hY, ?_⟩ + intro H hH A B + have hall : ∀ᵐ ω ∂P, ∀ e, X ω e = Y ω e := ae_all_iff.mpr hXY + have hevents : {ω | (∀ e ∈ A, X ω e = true) ∧ (∀ e ∈ B, X ω e = false)} + =ᵐ[P] {ω | (∀ e ∈ A, Y ω e = true) ∧ (∀ e ∈ B, Y ω e = false)} := by + filter_upwards [hall] with ω hω + exact congrArg (fun z : EdgeConfiguration => + (∀ e ∈ A, z e = true) ∧ (∀ e ∈ B, z e = false)) (funext hω) + rw [← measure_congr hevents] + exact hX.2 H hH A B + +theorem HasFUSFLaw.measure_univ_eq_one_of_spanningTrees_nonempty + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) + (hne : ∀ n, (spanningTrees (H n)).Nonempty) : + P Set.univ = 1 := by + classical + have hnorm (n : ℕ) : ustCylinder (H n) ∅ ∅ = 1 := by + have hc : (spanningTrees (H n)).card ≠ 0 := Finset.card_ne_zero.mpr (hne n) + simp only [ustCylinder, Finset.notMem_empty, false_implies, implies_true, + and_self, Finset.filter_true] + exact ENNReal.div_self (by exact_mod_cast hc) (by simp) + have hconv := hX.2 H hH ∅ ∅ + simp only [hnorm] at hconv + simpa using tendsto_nhds_unique hconv tendsto_const_nhds + +theorem HasFUSFLaw.isProbabilityMeasure_of_spanningTrees_nonempty + {Ω : Type} [MeasurableSpace Ω] {G : GraphCode} + {P : Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (H : ℕ → FiniteSubgraphCode) (hH : IsConnectedExhaustion G H) + (hne : ∀ n, (spanningTrees (H n)).Nonempty) : + IsProbabilityMeasure P := + ⟨hX.measure_univ_eq_one_of_spanningTrees_nonempty H hH hne⟩ + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FUSFLawUnique.lean b/lean/OAI/Probability/SpanningForest/FUSFLawUnique.lean new file mode 100644 index 0000000000000000000000000000000000000000..54906378c4385f9d1e6abc69c3aa26dc19087b09 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FUSFLawUnique.lean @@ -0,0 +1,57 @@ +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.BinaryLawUnique + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal Topology + +namespace Problem336 + +def configurationCylinder (A B : Finset EdgeCode) : Set EdgeConfiguration := + {x | (∀ e ∈ A, x e = true) ∧ (∀ e ∈ B, x e = false)} + +theorem measurableSet_configurationCylinder (A B : Finset EdgeCode) : + MeasurableSet (configurationCylinder A B) := by + unfold configurationCylinder + convert (A.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton true)).inter + (B.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton false)) using 1 + ext x + simp + +theorem HasFUSFLaw.cylinder_eq + {Ω Ω' : Type} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {G : GraphCode} {P : Measure Ω} {Q : Measure Ω'} + {X : Ω → EdgeConfiguration} {Y : Ω' → EdgeConfiguration} + (hX : HasFUSFLaw G P X) (hY : HasFUSFLaw G Q Y) + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) + (A B : Finset EdgeCode) : + P (X ⁻¹' configurationCylinder A B) = Q (Y ⁻¹' configurationCylinder A B) := by + exact tendsto_nhds_unique (hX.2 H hH A B) (hY.2 H hH A B) + +theorem configurationMeasure_ext {μ ν : Measure EdgeConfiguration} [IsFiniteMeasure μ] + (h : ∀ A B : Finset EdgeCode, + μ (configurationCylinder A B) = ν (configurationCylinder A B)) : μ = ν := + BinaryLaw.measure_ext_of_signed_cylinders h + +theorem HasFUSFLaw.map_eq + {Ω Ω' : Type} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {G : GraphCode} {P : Measure Ω} {Q : Measure Ω'} [IsFiniteMeasure P] + {X : Ω → EdgeConfiguration} {Y : Ω' → EdgeConfiguration} + (hX : HasFUSFLaw G P X) (hY : HasFUSFLaw G Q Y) + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + P.map X = Q.map Y := by + apply configurationMeasure_ext + intro A B + rw [Measure.map_apply (Measurable.of_eval hX.1) (measurableSet_configurationCylinder A B), + Measure.map_apply (Measurable.of_eval hY.1) (measurableSet_configurationCylinder A B)] + exact hX.cylinder_eq hY hH A B + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FUSFPosteriorResponse.lean b/lean/OAI/Probability/SpanningForest/FUSFPosteriorResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce56052247ff2963bd827a93f60f6da06fb95b39 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FUSFPosteriorResponse.lean @@ -0,0 +1,46 @@ +import OAI.Probability.SpanningForest.CodedMarginal +import OAI.Probability.SpanningForest.USTPosteriorResponse +import OAI.Probability.SpanningForest.FUSFExistenceReduction +import OAI.Probability.SpanningForest.ExhaustionExistence +import OAI.Probability.SpanningForest.PosteriorDrift + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped Topology + +namespace Problem336 + +theorem HasFUSFLaw.finiteTiltMean_response + {G : GraphCode} (hc : GraphConnected G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (S : Finset EdgeCode) (h h' : EdgeCode → ℝ) (e : EdgeCode) + (D : ℝ) (hD : 0 ≤ D) (hh : ∀ f ∈ S, |h f - h' f| ≤ D) : + |TiltLimit.finiteTiltMean μ S h e - TiltLimit.finiteTiltMean μ S h' e| ≤ D / 2 := by + obtain ⟨H, hH⟩ := hc.exists_connected_exhaustion + apply TiltLimit.finiteTiltMean_response_bound_of_tendsto + (hμ.tendsto_finiteUSTProbabilityMeasure H hH) S h h' e + apply Filter.Eventually.of_forall + intro n + exact USTResponse.finiteUST_posterior_response_of_response (H n) + (FiniteEncoding.spanningTrees_nonempty (hH.1 n)) + (USTResponse.inclusion_response_connected (hH.1 n)) S h' h e D hD hh + +theorem HasFUSFLaw.finiteResponseBound + {G : GraphCode} (hc : GraphConnected G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (S : EdgeCode → ℕ → Finset EdgeCode) : + PosteriorDrift.FiniteResponseBound μ S (1 / 2 : ℝ) := by + intro e n h h' D hD hh + simpa only [div_eq_mul_inv, one_mul, mul_comm] using + hμ.finiteTiltMean_response hc (S e n) h h' e D hD hh + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FUSFRelabelMeasure.lean b/lean/OAI/Probability/SpanningForest/FUSFRelabelMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2c6a8be85bac278092670308f8e585b71829c54 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FUSFRelabelMeasure.lean @@ -0,0 +1,59 @@ +import OAI.Probability.SpanningForest.FiniteUSTRelabel +import OAI.Probability.SpanningForest.FUSFLawUnique + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336 + +def configurationRelabel (σ : Equiv ℕ ℕ) : EdgeConfiguration ≃ᵐ EdgeConfiguration := + MeasurableEquiv.arrowCongr' (edgeEquiv σ) (MeasurableEquiv.refl Bool) + +@[simp] theorem configurationRelabel_apply (σ : Equiv ℕ ℕ) + (x : EdgeConfiguration) (e : EdgeCode) : + configurationRelabel σ x e = x (mapEdge σ.symm e) := rfl + +@[simp] theorem configurationRelabel_symm_apply (σ : Equiv ℕ ℕ) + (x : EdgeConfiguration) : + configurationRelabel σ.symm (configurationRelabel σ x) = x := by + funext e + simp + +theorem configurationRelabel_preimage_cylinder (σ : Equiv ℕ ℕ) + (A B : Finset EdgeCode) : + configurationRelabel σ ⁻¹' configurationCylinder A B = + configurationCylinder (A.image (mapEdge σ.symm)) (B.image (mapEdge σ.symm)) := by + ext x + simp only [configurationCylinder, Set.mem_preimage, Set.mem_ofPred_eq, + configurationRelabel_apply, Finset.forall_mem_image] + +theorem HasFUSFLaw.map_configurationRelabel + {G : GraphCode} {μ ν : Measure EdgeConfiguration} [IsFiniteMeasure μ] + (hμ : HasFUSFLaw G μ id) (σ : Equiv ℕ ℕ) + (hν : HasFUSFLaw (relabelGraph σ G) ν id) + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + μ.map (configurationRelabel σ) = ν := by + have h := (hμ.relabel σ).map_eq hν (hH.relabel σ) + have hf : (fun x : EdgeConfiguration => fun e => x (mapEdge σ.symm e)) = + (configurationRelabel σ : EdgeConfiguration → EdgeConfiguration) := by + funext x e + rfl + simpa only [id_eq, hf, Measure.map_id] using h + +theorem fusfMeasureFamily_relabel + (μ : GraphCode → Measure EdgeConfiguration) + (hfinite : ∀ G, IsFiniteMeasure (μ G)) + (hlaw : ∀ G, HasFUSFLaw G (μ G) id) + {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (σ : Equiv ℕ ℕ) : + (μ G).map (configurationRelabel σ) = μ (relabelGraph σ G) := by + let := hfinite G + exact (hlaw G).map_configurationRelabel σ (hlaw (relabelGraph σ G)) hH + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Factor.lean b/lean/OAI/Probability/SpanningForest/Factor.lean new file mode 100644 index 0000000000000000000000000000000000000000..a602e1999373b3d4c17585082b668f3f0a10a353 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Factor.lean @@ -0,0 +1,28 @@ +import OAI.Probability.SpanningForest.Theory +import OAI.Probability.SpanningForest.FinalFactor + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators ENNReal Topology + +namespace Problem336 + +theorem fusf_is_factor_iid : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ ∀ G : GraphCode, WorksOnGraph Phi G := by + exact FinalFactor.exists_factor + +theorem fusf_factor_for_every_unimodular_law : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ ∀ Q : Measure (GraphCode × ℕ), IsUnimodular Q → GraphLawSupported Q → ∀ᵐ x ∂Q, WorksOnGraph Phi x.1 := by + obtain ⟨Phi, hBorel, hEquivariant, hWorks⟩ := fusf_is_factor_iid + refine ⟨Phi, hBorel, hEquivariant, ?_⟩ + intro Q _ _ + exact Filter.Eventually.of_forall (fun x => hWorks x.1) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FactorAssembly.lean b/lean/OAI/Probability/SpanningForest/FactorAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..f29f28675c808f4b751e40d1430974709a53c48f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FactorAssembly.lean @@ -0,0 +1,109 @@ +import OAI.Probability.SpanningForest.EdgeAction +import OAI.Probability.SpanningForest.Picard + +namespace OAI + +noncomputable section + +open Filter MeasureTheory +open scoped Topology + +namespace Problem336 +namespace FactorAssembly + +abbrev EdgeField := EdgeCode → ℝ +abbrev GraphDrift := GraphCode → ℝ → EdgeField → EdgeCode → ℝ +abbrev GraphNoise := GraphCode → (ℕ → ℝ) → EdgeCode → ℝ → ℝ + +def DriftBorel (b : GraphDrift) : Prop := + ∀ e, Measurable (fun p : GraphCode × (ℝ × EdgeField) => b p.1 p.2.1 p.2.2 e) + +def NoiseBorel (w : GraphNoise) : Prop := + ∀ e, Measurable (fun p : (GraphCode × (ℕ → ℝ)) × ℝ => w p.1.1 p.1.2 e p.2) + +def DriftEquivariant (b : GraphDrift) : Prop := + ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (t : ℝ) (y : EdgeField) (e : EdgeCode), + b (relabelGraph σ G) t (fun f => y (mapEdge σ.symm f)) (mapEdge σ e) = b G t y e + +def NoiseEquivariant (w : GraphNoise) : Prop := + ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) (t : ℝ), + w (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) t = w G U e t + +def decodedSlope (b : GraphDrift) (w : GraphNoise) + (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) (n : ℕ) : ℝ := + Picard.decode (w G U) (b G) e (n : ℝ) / (n : ℝ) + +def rule (b : GraphDrift) (w : GraphNoise) : FactorRule := by + classical + exact fun G U e => + if (1 / 2 : ℝ) < limsup (decodedSlope b w G U e) atTop then true else false + +theorem measurable_decodedPath {b : GraphDrift} {w : GraphNoise} + (hb : DriftBorel b) (hw : NoiseBorel w) (e : EdgeCode) : + Measurable (fun p : (GraphCode × (ℕ → ℝ)) × ℝ => + Picard.decode (w p.1.1 p.1.2) (b p.1.1) e p.2) := by + apply Picard.measurable_decode + (w := fun p : GraphCode × (ℕ → ℝ) => w p.1 p.2) + (b := fun p : GraphCode × (ℕ → ℝ) => b p.1) hw + intro i + exact (hb i).comp (measurable_fst.fst.prodMk measurable_snd) + +theorem measurable_decodedSlope {b : GraphDrift} {w : GraphNoise} + (hb : DriftBorel b) (hw : NoiseBorel w) (e : EdgeCode) (n : ℕ) : + Measurable (fun p : GraphCode × (ℕ → ℝ) => decodedSlope b w p.1 p.2 e n) := by + exact ((measurable_decodedPath hb hw e).comp + (measurable_id.prodMk measurable_const)).div_const (n : ℝ) + +theorem measurable_rule_edge {b : GraphDrift} {w : GraphNoise} + (hb : DriftBorel b) (hw : NoiseBorel w) (e : EdgeCode) : + Measurable (fun p : GraphCode × (ℕ → ℝ) => rule b w p.1 p.2 e) := by + classical + have hl : Measurable (fun p : GraphCode × (ℕ → ℝ) => + limsup (decodedSlope b w p.1 p.2 e) atTop) := + Measurable.limsup (fun n => measurable_decodedSlope hb hw e n) + change Measurable (fun p : GraphCode × (ℕ → ℝ) => + if (1 / 2 : ℝ) < limsup (decodedSlope b w p.1 p.2 e) atTop then true else false) + exact Measurable.ite (measurableSet_lt measurable_const hl) measurable_const measurable_const + +theorem ruleBorel_of_coordinate_measurable (Phi : FactorRule) + (hPhi : ∀ e, Measurable (fun p : GraphCode × (ℕ → ℝ) => Phi p.1 p.2 e)) : + RuleBorel Phi := by + have hall : Measurable (fun p : (GraphCode × (ℕ → ℝ)) × EdgeCode => + Phi p.1.1 p.1.2 p.2) := + measurable_from_prod_countable_left hPhi + have hpair : Measurable (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => + ((q.1, q.2.1), q.2.2)) := + (measurable_fst.prodMk measurable_snd.fst).prodMk measurable_snd.snd + exact hall.comp hpair + +theorem rule_borel {b : GraphDrift} {w : GraphNoise} + (hb : DriftBorel b) (hw : NoiseBorel w) : RuleBorel (rule b w) := + ruleBorel_of_coordinate_measurable (rule b w) (measurable_rule_edge hb hw) + +theorem decodedPath_relabel {b : GraphDrift} {w : GraphNoise} + (hb : DriftEquivariant b) (hw : NoiseEquivariant w) + (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) (t : ℝ) : + Picard.decode (w (relabelGraph σ G) (relabelLabels σ U)) + (b (relabelGraph σ G)) (mapEdge σ e) t = + Picard.decode (w G U) (b G) e t := by + exact Picard.decode_relabel (edgeEquiv σ) (w G U) + (w (relabelGraph σ G) (relabelLabels σ U)) (b G) (b (relabelGraph σ G)) + (hw σ G U) (hb σ G) e t + +theorem rule_equivariant {b : GraphDrift} {w : GraphNoise} + (hb : DriftEquivariant b) (hw : NoiseEquivariant w) : + RuleEquivariant (rule b w) := by + classical + intro σ G U e + have hs : decodedSlope b w (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = + decodedSlope b w G U e := by + funext n + exact congrArg (fun x : ℝ => x / (n : ℝ)) (decodedPath_relabel hb hw σ G U e n) + simp only [rule, hs] + +end FactorAssembly +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FactorLawTransport.lean b/lean/OAI/Probability/SpanningForest/FactorLawTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..72418f8310a7e39c27427923172c2482f15dc524 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FactorLawTransport.lean @@ -0,0 +1,59 @@ +import OAI.Probability.SpanningForest.FactorAssembly +import OAI.Probability.SpanningForest.FUSFLawUnique + +namespace OAI + +noncomputable section +open MeasureTheory + +namespace Problem336.FactorAssembly + +theorem measurable_rule_section {Phi : FactorRule} (hPhi : RuleBorel Phi) + (G : GraphCode) : Measurable (Phi G) := by + apply measurable_pi_iff.mpr + intro e + exact hPhi.comp (measurable_const.prodMk + (measurable_id.prodMk measurable_const)) + +theorem measurable_rule_output {Ω : Type*} [MeasurableSpace Ω] + {Phi : FactorRule} (hPhi : RuleBorel Phi) (G : GraphCode) + (U : ℕ → Ω → ℝ) (hU : ∀ v, Measurable (U v)) : + Measurable (fun ω e => Phi G (fun v => U v ω) e) := by + apply measurable_pi_iff.mpr + intro e + exact hPhi.comp (measurable_const.prodMk + ((Measurable.of_eval hU).prodMk measurable_const)) + +theorem hasFUSFLaw_of_map_eq + {Ω Ω' : Type} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {G : GraphCode} {P : Measure Ω} {Q : Measure Ω'} + {X : Ω → EdgeConfiguration} {Y : Ω' → EdgeConfiguration} + (hX : Measurable X) (hY : HasFUSFLaw G Q Y) + (hLaw : P.map X = Q.map Y) : HasFUSFLaw G P X := by + refine ⟨fun e => (measurable_pi_apply e).comp hX, ?_⟩ + intro H hH A B + have hc : P (X ⁻¹' configurationCylinder A B) = + Q (Y ⁻¹' configurationCylinder A B) := by + rw [← Measure.map_apply hX (measurableSet_configurationCylinder A B), + ← Measure.map_apply (Measurable.of_eval hY.1) + (measurableSet_configurationCylinder A B), hLaw] + change Filter.Tendsto (fun n => ustCylinder (H n) A B) Filter.atTop + (nhds (P (X ⁻¹' configurationCylinder A B))) + rw [hc] + exact hY.2 H hH A B + +theorem assembled_hasFUSFLaw_of_map_eq + {Ω Ω' : Type} [MeasurableSpace Ω] [MeasurableSpace Ω'] + {b : GraphDrift} {w : GraphNoise} (hb : DriftBorel b) (hw : NoiseBorel w) + (G : GraphCode) (P : Measure Ω) (U : ℕ → Ω → ℝ) + (hU : ∀ v, Measurable (U v)) {Q : Measure Ω'} {Y : Ω' → EdgeConfiguration} + (hY : HasFUSFLaw G Q Y) + (hLaw : P.map (fun ω e => rule b w G (fun v => U v ω) e) = Q.map Y) : + HasFUSFLaw G P (fun ω e => rule b w G (fun v => U v ω) e) := + hasFUSFLaw_of_map_eq (measurable_rule_output (rule_borel hb hw) G U hU) hY hLaw + +end Problem336.FactorAssembly + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FactorReadout.lean b/lean/OAI/Probability/SpanningForest/FactorReadout.lean new file mode 100644 index 0000000000000000000000000000000000000000..84f747493bf483fc4fca4b2eef162e1229d5e626 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FactorReadout.lean @@ -0,0 +1,32 @@ +import OAI.Probability.SpanningForest.FactorAssembly +import OAI.Probability.SpanningForest.SlopeReadout + +namespace OAI + +noncomputable section +open Filter + +namespace Problem336.FactorAssembly + +theorem rule_eq_slopeReadout (b : GraphDrift) (w : GraphNoise) + (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode) : + rule b w G U e = + SlopeReadout.readout (fun n => Picard.decode (w G U) (b G) e (n : ℝ)) := by + classical + have hs := Filter.limsup_nat_add (decodedSlope b w G U e) 1 + unfold rule SlopeReadout.readout SlopeReadout.slope + rw [← hs] + rfl + +theorem rule_eq_readout_family (b : GraphDrift) (w : GraphNoise) + (G : GraphCode) (U : ℕ → ℝ) : + rule b w G U = SlopeReadout.family + (fun e n => Picard.decode (w G U) (b G) e (n : ℝ)) := by + funext e + exact rule_eq_slopeReadout b w G U e + +end Problem336.FactorAssembly + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FactorSampler.lean b/lean/OAI/Probability/SpanningForest/FactorSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..09a42c801cdc62c85b68139089f6571630aa6db4 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FactorSampler.lean @@ -0,0 +1,58 @@ +import OAI.Probability.SpanningForest.FactorLawTransport +import OAI.Probability.SpanningForest.PicardSamplerLaw +import OAI.Probability.SpanningForest.CanonicalIID + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory + +namespace Problem336.FactorAssembly + +theorem rule_eq_sample (b : GraphDrift) (w : GraphNoise) (G : GraphCode) : + rule b w G = PicardSampler.sample (w G) (b G) := by + funext U e + exact (PicardSampler.sample_apply_unshifted (w G) (b G) U e).symm + +theorem canonical_hasFUSFLaw_of_sampler_hasLaw + {b : GraphDrift} {w : GraphNoise} (hb : DriftBorel b) (hw : NoiseBorel w) + (G : GraphCode) {ν : Measure EdgeConfiguration} + (hν : HasFUSFLaw G ν id) + (hLaw : HasLaw (PicardSampler.sample (w G) (b G)) ν privatePoolLaw) : + HasFUSFLaw G privatePoolLaw (rule b w G) := by + have hm : Measurable (rule b w G) := + measurable_rule_section (rule_borel hb hw) G + have heq : privatePoolLaw.map (rule b w G) = ν.map id := by + rw [rule_eq_sample, hLaw.map_eq, Measure.map_id] + exact hasFUSFLaw_of_map_eq (X := rule b w G) (Y := id) hm hν heq + +theorem worksOnGraph_of_canonical_sampler_law + {b : GraphDrift} {w : GraphNoise} (hb : DriftBorel b) (hw : NoiseBorel w) + (G : GraphCode) (ν : Measure EdgeConfiguration) + (hν : GraphConnected G → GraphLocallyFinite G → HasFUSFLaw G ν id) + (hLaw : GraphConnected G → GraphLocallyFinite G → + HasLaw (PicardSampler.sample (w G) (b G)) ν privatePoolLaw) : + WorksOnGraph (rule b w) G := by + apply (CanonicalIID.worksOnGraph_iff_canonical (rule b w) G).mpr + intro hconn hfin + exact canonical_hasFUSFLaw_of_sampler_hasLaw hb hw G + (hν hconn hfin) (hLaw hconn hfin) + +theorem exists_factor_of_canonical_sampler_laws + (b : GraphDrift) (w : GraphNoise) + (hb : DriftBorel b) (hw : NoiseBorel w) + (hbe : DriftEquivariant b) (hwe : NoiseEquivariant w) + (ν : GraphCode → Measure EdgeConfiguration) + (hν : ∀ G, GraphConnected G → GraphLocallyFinite G → HasFUSFLaw G (ν G) id) + (hLaw : ∀ G, GraphConnected G → GraphLocallyFinite G → + HasLaw (PicardSampler.sample (w G) (b G)) (ν G) privatePoolLaw) : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ + ∀ G : GraphCode, WorksOnGraph Phi G := by + exact ⟨rule b w, rule_borel hb hw, rule_equivariant hbe hwe, + fun G => worksOnGraph_of_canonical_sampler_law hb hw G (ν G) (hν G) (hLaw G)⟩ + +end Problem336.FactorAssembly + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FinalFactor.lean b/lean/OAI/Probability/SpanningForest/FinalFactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..c99d5c1f76d09e991d5b539e8858c860c815fed1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FinalFactor.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SpanningForest.AllPairWiener +import OAI.Probability.SpanningForest.GraphTreePosteriorEquiv +import OAI.Probability.SpanningForest.CanonicalBrownianSampler +import OAI.Probability.SpanningForest.GraphFUSFLaw +import OAI.Probability.SpanningForest.FUSFPosteriorResponse +import OAI.Probability.SpanningForest.AllPairPosteriorDrift + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.FinalFactor + +local instance : MeasurableSpace GlobalWiener.Path := borel _ +local instance : BorelSpace GlobalWiener.Path := ⟨rfl⟩ + +def rule : FactorRule := + FactorAssembly.rule GraphTreePosterior.drift AllPairWiener.noise + +theorem rule_borel : RuleBorel rule := + FactorAssembly.rule_borel GraphTreePosterior.measurable_drift + AllPairWiener.noise_borel + +theorem rule_equivariant : RuleEquivariant rule := + FactorAssembly.rule_equivariant GraphTreePosterior.drift_relabel + AllPairWiener.noise_equivariant + +theorem rule_eq_sample (G : GraphCode) : + rule G = PicardSampler.sample (AllPairWiener.noise G) (GraphTreePosterior.drift G) := + FactorAssembly.rule_eq_sample GraphTreePosterior.drift AllPairWiener.noise G + +theorem sample_hasLaw {G : GraphCode} + (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) : + HasLaw (PicardSampler.NonnegativeTime.sample + (fun (W : EdgeCode → GlobalWiener.Path) e t => W e t) + (GraphTreePosterior.drift G)) (μ : Measure EdgeConfiguration) AllPairWiener.law := by + rw [GraphTreePosterior.drift_fun_eq_allPair_posteriorDrift_of_hasFUSFLaw hc hf hμ] + exact CanonicalBrownianSampler.hasLaw_sample μ (AllPairObservation.observations G) + (AllPairObservation.observations_mono G) + (fun e f => AllPairObservation.exists_mem_observations hc hf e f) + (L := (1 / 2 : ℝ)) (by norm_num) (hμ.finiteResponseBound hc _) + +theorem worksOnGraph (G : GraphCode) : WorksOnGraph rule G := by + apply (CanonicalIID.worksOnGraph_iff_canonical rule G).mpr + intro hc hf + obtain ⟨μ, hμ⟩ := exists_hasFUSFLaw G hc hf + exact FactorAssembly.canonical_hasFUSFLaw_of_sampler_hasLaw + GraphTreePosterior.measurable_drift AllPairWiener.noise_borel G hμ + (AllPairWiener.sampler_hasLaw_of_product GraphTreePosterior.drift G hc hf + (sample_hasLaw hc hf hμ)) + +theorem exists_factor : + ∃ Phi : FactorRule, RuleBorel Phi ∧ RuleEquivariant Phi ∧ + ∀ G : GraphCode, WorksOnGraph Phi G := + ⟨rule, rule_borel, rule_equivariant, worksOnGraph⟩ + +end Problem336.FinalFactor + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteCycleIncidence.lean b/lean/OAI/Probability/SpanningForest/FiniteCycleIncidence.lean new file mode 100644 index 0000000000000000000000000000000000000000..13d99190f04be12e26ca5afbf37c372f45767a4e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteCycleIncidence.lean @@ -0,0 +1,172 @@ +import OAI.Probability.SpanningForest.AlgebraicCycleSpace + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336 + +instance finiteCodeEdgesFintype (K : FiniteSubgraphCode) : Fintype (finiteCodeEdges K) := + (finiteCodeEdges_finite K).fintype + +def finiteFlowEmbedding (K : FiniteSubgraphCode) : + (finiteCodeEdges K → ℝ) →ₗ[ℝ] EdgeFlow := + Fintype.linearCombination ℝ (fun e : finiteCodeEdges K => Finsupp.single e.1 1) + +@[simp] theorem finiteFlowEmbedding_apply (K : FiniteSubgraphCode) + (x : finiteCodeEdges K → ℝ) (e : finiteCodeEdges K) : + finiteFlowEmbedding K x e.1 = x e := by + classical + simp only [finiteFlowEmbedding, Fintype.linearCombination_apply, Finsupp.finsetSum_apply, + Finsupp.smul_apply, smul_eq_mul, Finsupp.single_apply] + rw [Finset.sum_eq_single e] + · simp + · intro b hb hbe + have hval : b.1 ≠ e.1 := fun h => hbe (Subtype.ext h) + simp [hval] + · simp + + theorem finiteFlowEmbedding_range (K : FiniteSubgraphCode) : + LinearMap.range (finiteFlowEmbedding K) = Finsupp.supported ℝ ℝ (finiteCodeEdges K) := by + rw [finiteFlowEmbedding, Fintype.range_linearCombination, Finsupp.supported_eq_span_single] + congr 1 + ext f + simp + + theorem finiteFlowEmbedding_injective (K : FiniteSubgraphCode) : + Function.Injective (finiteFlowEmbedding K) := by + intro x y h + funext e + simpa only [finiteFlowEmbedding_apply] using congrArg (fun f : EdgeFlow => f e.1) h + +def finiteIncidence (K : FiniteSubgraphCode) : + Matrix ↥K.1 (finiteCodeEdges K) ℝ := + fun v e => (if v.1 = e.1.1.1 then 1 else 0) - (if v.1 = e.1.1.2 then 1 else 0) + + theorem finiteIncidence_mulVec (K : FiniteSubgraphCode) + (x : finiteCodeEdges K → ℝ) (v : ↥K.1) : + (finiteIncidence K).mulVec x v = edgeBoundary (finiteFlowEmbedding K x) v.1 := by + classical + simp only [finiteIncidence, Matrix.mulVec, dotProduct, finiteFlowEmbedding, + Fintype.linearCombination_apply, map_sum, map_smul, edgeBoundary_single, + Finsupp.finsetSum_apply, Finsupp.smul_apply, Finsupp.sub_apply, + Finsupp.single_apply, smul_eq_mul] + apply Finset.sum_congr rfl + intro e he + simp only [eq_comm] + ring + + theorem IsFiniteConnectedSubgraph.boundary_eq_zero_outside {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + (x : finiteCodeEdges K → ℝ) {v : ℕ} (hv : v ∉ K.1) : + edgeBoundary (finiteFlowEmbedding K x) v = 0 := by + classical + simp only [finiteFlowEmbedding, Fintype.linearCombination_apply, + map_sum, map_smul, edgeBoundary_single, Finsupp.finsetSum_apply, + Finsupp.smul_apply, Finsupp.sub_apply, Finsupp.single_apply, smul_eq_mul] + apply Finset.sum_eq_zero + intro e he + have hends := hK.2.1 e.1.1 e.2 + have hleft : e.1.1.1 ≠ v := fun h => hv (h ▸ hends.1) + have hright : e.1.1.2 ≠ v := fun h => hv (h ▸ hends.2.1) + simp [hleft, hright] + + theorem IsFiniteConnectedSubgraph.finiteCycleSpace_eq_incidenceKernel {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) : + finiteCycleSpace K = + (LinearMap.ker (Matrix.mulVecLin (finiteIncidence K))).map (finiteFlowEmbedding K) := by + classical + apply le_antisymm + · intro f hf + have hs : f ∈ LinearMap.range (finiteFlowEmbedding K) := by + rw [finiteFlowEmbedding_range] + exact hf.1 + obtain ⟨x, rfl⟩ := hs + apply Submodule.mem_map.mpr + refine ⟨x, ?_, rfl⟩ + change (finiteIncidence K).mulVec x = 0 + funext v + rw [finiteIncidence_mulVec] + exact congrArg (fun f : ℕ →₀ ℝ => f v.1) hf.2 + · intro f hf + obtain ⟨x, hx, rfl⟩ := Submodule.mem_map.mp hf + refine ⟨?_, ?_⟩ + · rw [← finiteFlowEmbedding_range] + exact ⟨x, rfl⟩ + · change edgeBoundary (finiteFlowEmbedding K x) = 0 + ext v + by_cases hv : v ∈ K.1 + · have hrow := congrArg (fun y : ↥K.1 → ℝ => y ⟨v, hv⟩) hx + simpa only [Matrix.mulVecLin_apply, finiteIncidence_mulVec, Pi.zero_apply, Finsupp.zero_apply] using hrow + · exact hK.boundary_eq_zero_outside x hv + + theorem IsFiniteConnectedSubgraph.finiteHilbertCycleSpace_eq_incidenceKernel {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) : + finiteHilbertCycleSpace K = + (LinearMap.ker (Matrix.mulVecLin (finiteIncidence K))).map + (edgeFlowToHilbert.comp (finiteFlowEmbedding K)) := by + rw [finiteHilbertCycleSpace, hK.finiteCycleSpace_eq_incidenceKernel, Submodule.map_comp] + +def finiteHilbertEmbeddingLinear (K : FiniteSubgraphCode) : + EuclideanSpace ℝ (finiteCodeEdges K) →ₗ[ℝ] EdgeHilbert := + (edgeFlowToHilbert.comp (finiteFlowEmbedding K)).comp + (WithLp.linearEquiv 2 ℝ (finiteCodeEdges K → ℝ)).toLinearMap + +@[simp] theorem finiteHilbertEmbeddingLinear_apply (K : FiniteSubgraphCode) + (x : EuclideanSpace ℝ (finiteCodeEdges K)) (e : finiteCodeEdges K) : + finiteHilbertEmbeddingLinear K x e.1 = x e := by + simp [finiteHilbertEmbeddingLinear] + + theorem finiteHilbertEmbeddingLinear_sum (K : FiniteSubgraphCode) + (x : EuclideanSpace ℝ (finiteCodeEdges K)) : + finiteHilbertEmbeddingLinear K x = + ∑ e : finiteCodeEdges K, x e • lp.single 2 e.1 (1 : ℝ) := by + simp [finiteHilbertEmbeddingLinear, finiteFlowEmbedding, Fintype.linearCombination_apply, + map_sum, ← lp.single_smul] + + theorem finiteHilbertEmbeddingLinear_inner (K : FiniteSubgraphCode) + (x y : EuclideanSpace ℝ (finiteCodeEdges K)) : + inner ℝ (finiteHilbertEmbeddingLinear K x) (finiteHilbertEmbeddingLinear K y) = + inner ℝ x y := by + classical + rw [finiteHilbertEmbeddingLinear_sum K x] + simp [sum_inner, inner_smul_left, lp.inner_single_left, PiLp.inner_apply, + finiteHilbertEmbeddingLinear_apply, mul_comm] + +def finiteHilbertEmbedding (K : FiniteSubgraphCode) : + EuclideanSpace ℝ (finiteCodeEdges K) →ₗᵢ[ℝ] EdgeHilbert := + (finiteHilbertEmbeddingLinear K).isometryOfInner (finiteHilbertEmbeddingLinear_inner K) + +@[simp] theorem finiteHilbertEmbedding_apply (K : FiniteSubgraphCode) + (x : EuclideanSpace ℝ (finiteCodeEdges K)) (e : finiteCodeEdges K) : + finiteHilbertEmbedding K x e.1 = x e := + finiteHilbertEmbeddingLinear_apply K x e + + theorem IsFiniteConnectedSubgraph.finiteHilbertCycleSpace_eq_euclideanKernel {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) : + finiteHilbertCycleSpace K = + (LinearMap.ker (Matrix.toEuclideanLin (finiteIncidence K))).map + (finiteHilbertEmbedding K).toLinearMap := by + classical + rw [hK.finiteHilbertCycleSpace_eq_incidenceKernel] + ext z + constructor + · rintro ⟨x, hx, rfl⟩ + refine ⟨WithLp.toLp 2 x, ?_, rfl⟩ + change Matrix.toEuclideanLin (finiteIncidence K) (WithLp.toLp 2 x) = 0 + change (finiteIncidence K).mulVec x = 0 at hx + simp only [Matrix.toLpLin_apply, hx, WithLp.toLp_zero] + · rintro ⟨x, hx, rfl⟩ + refine ⟨x.ofLp, ?_, rfl⟩ + change (finiteIncidence K).mulVec x.ofLp = 0 + change Matrix.toEuclideanLin (finiteIncidence K) x = 0 at hx + have hh := congrArg WithLp.ofLp hx + simpa only [Matrix.toLpLin_apply, WithLp.ofLp_toLp, WithLp.ofLp_zero] using hh + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteGaussianPosterior.lean b/lean/OAI/Probability/SpanningForest/FiniteGaussianPosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b1a034423119c836a48a4ae6c324c76e01fefca --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteGaussianPosterior.lean @@ -0,0 +1,127 @@ +import OAI.Probability.SpanningForest.FinitePosterior +import OAI.Probability.SpanningForest.GaussianObservationKernel + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal NNReal BigOperators ProbabilityTheory + +namespace Problem336.FinitePosterior + +variable {Θ ι : Type*} [Fintype Θ] [MeasurableSpace Θ] + [MeasurableSingletonClass Θ] [Fintype ι] + +def gaussianLikelihood (t : ℝ≥0) (signal : Θ → ι → ℝ) (θ : Θ) (y : ι → ℝ) : ℝ≥0∞ := + ENNReal.ofReal (Real.exp (∑ i, (y i - (t : ℝ) / 2) * signal θ i)) + +omit [Fintype Θ] [MeasurableSpace Θ] [MeasurableSingletonClass Θ] in +lemma measurable_gaussianLikelihood (t : ℝ≥0) (signal : Θ → ι → ℝ) (θ : Θ) : + Measurable (gaussianLikelihood t signal θ) := by + unfold gaussianLikelihood + fun_prop + +lemma gaussianObservationKernel_eq_withDensity (t : ℝ≥0) (ht : t ≠ 0) + (signal : Θ → ι → ℝ) (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (θ : Θ) : + GaussianObservation.endpointKernel t signal θ = + (Measure.pi (fun _ : ι => gaussianReal 0 t)).withDensity + (gaussianLikelihood t signal θ) := by + rw [GaussianObservation.endpointKernel_apply t ht signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary θ] + exact GaussianObservation.gaussian_pi_binary_shift_withDensity t ht (signal θ) (hbinary θ) + +theorem gaussian_condExp_eq_exponential_ratio + [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (ht : t ≠ 0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) (g : Θ → ℝ) : + (π ⊗ₘ GaussianObservation.endpointKernel t signal)[fun z : Θ × (ι → ℝ) => g z.1 | + (inferInstance : MeasurableSpace (ι → ℝ)).comap Prod.snd] =ᵐ[ + π ⊗ₘ GaussianObservation.endpointKernel t signal] + fun z => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (z.2 i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (z.2 i - (t : ℝ) / 2) * signal θ i)) := by + let := GaussianObservation.endpointKernel_markov t ht signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary + have hfinite : ∀ θ y, gaussianLikelihood t signal θ y ≠ ∞ := by + intro θ y + exact ENNReal.ofReal_ne_top + have hpositive : ∀ θ y, gaussianLikelihood t signal θ y ≠ 0 := by + intro θ y + exact ENNReal.ofReal_ne_zero_iff.mpr (Real.exp_pos _) + have h := condExp_eq_likelihood_ratio π (GaussianObservation.endpointKernel t signal) + (Measure.pi (fun _ : ι => gaussianReal 0 t)) (gaussianLikelihood t signal) + (measurable_gaussianLikelihood t signal) hfinite + (mixtureDensity_ne_zero_of_positive π _ hpositive) + (gaussianObservationKernel_eq_withDensity t ht signal hbinary) g + simpa only [mixtureDensity_toReal π _ hfinite, gaussianLikelihood, + ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + +theorem gaussian_condExp_eq_exponential_ratio_of_jointLaw + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Yobs : Ω → (ι → ℝ)) (hX : Measurable X) (hY : Measurable Yobs) + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (ht : t ≠ 0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (hjoint : P.map (fun ω => (X ω, Yobs ω)) = + π ⊗ₘ GaussianObservation.endpointKernel t signal) (g : Θ → ℝ) : + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i)) := by + let := GaussianObservation.endpointKernel_markov t ht signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary + have hfinite : ∀ θ y, gaussianLikelihood t signal θ y ≠ ∞ := by + intro θ y + exact ENNReal.ofReal_ne_top + have hpositive : ∀ θ y, gaussianLikelihood t signal θ y ≠ 0 := by + intro θ y + exact ENNReal.ofReal_ne_zero_iff.mpr (Real.exp_pos _) + have h := condExp_eq_likelihood_ratio_of_jointLaw P X Yobs hX hY π + (GaussianObservation.endpointKernel t signal) hjoint + (Measure.pi (fun _ : ι => gaussianReal 0 t)) (gaussianLikelihood t signal) + (measurable_gaussianLikelihood t signal) hfinite + (mixtureDensity_ne_zero_of_positive π _ hpositive) + (gaussianObservationKernel_eq_withDensity t ht signal hbinary) g + simpa only [mixtureDensity_toReal π _ hfinite, gaussianLikelihood, + ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + +theorem gaussian_condExp_eq_exponential_ratio_of_independent + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (X : Ω → Θ) (noise : Ω → (ι → ℝ)) (hX : Measurable X) (hnoise : Measurable noise) + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (ht : t ≠ 0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (hprior : P.map X = π) + (hnoiseLaw : P.map noise = Measure.pi (fun _ : ι => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) (g : Θ → ℝ) : + let Yobs := fun ω i => (t : ℝ) * signal (X ω) i + noise ω i + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i)) := by + let Yobs := fun ω i => (t : ℝ) * signal (X ω) i + noise ω i + have hs : Measurable signal := measurable_of_countable signal + have hY : Measurable Yobs := by + unfold Yobs + fun_prop + have hjoint := GaussianObservation.hasLaw_independent_gaussian_observation P π t ht signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary X noise + ⟨hX.aemeasurable, hprior⟩ ⟨hnoise.aemeasurable, hnoiseLaw⟩ hindep + exact gaussian_condExp_eq_exponential_ratio_of_jointLaw P X Yobs hX hY π t ht signal + hbinary hjoint.map_eq g + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteGradientResponse.lean b/lean/OAI/Probability/SpanningForest/FiniteGradientResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..7126d889ef51b113c0bef9efb268eda23370cb5c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteGradientResponse.lean @@ -0,0 +1,66 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.FiniteGradientResponse + +variable {ι : Type*} + +def segmentField (h k : ι → ℝ) (t : ℝ) : ι → ℝ := + fun i => h i + t * (k i - h i) + +@[simp] theorem segmentField_zero (h k : ι → ℝ) : segmentField h k 0 = h := by + funext i + simp [segmentField] + +@[simp] theorem segmentField_one (h k : ι → ℝ) : segmentField h k 1 = k := by + funext i + simp [segmentField] + +theorem abs_sum_mul_le (E : Finset ι) (row direction : ι → ℝ) + (L D : ℝ) (hD : 0 ≤ D) + (hrow : (∑ i ∈ E, |row i|) ≤ L) + (hdir : ∀ i ∈ E, |direction i| ≤ D) : + |∑ i ∈ E, row i * direction i| ≤ L * D := by + calc + |∑ i ∈ E, row i * direction i| ≤ ∑ i ∈ E, |row i * direction i| := + Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i ∈ E, |row i| * D := by + apply Finset.sum_le_sum + intro i hi + rw [abs_mul] + exact mul_le_mul_of_nonneg_left (hdir i hi) (abs_nonneg _) + _ = (∑ i ∈ E, |row i|) * D := (Finset.sum_mul _ _ _).symm + _ ≤ L * D := mul_le_mul_of_nonneg_right hrow hD + +theorem response_le_of_line_derivative (E : Finset ι) + (p : (ι → ℝ) → ℝ) (row : (ι → ℝ) → ι → ℝ) + (h k : ι → ℝ) (L D : ℝ) (hD : 0 ≤ D) + (hdir : ∀ i ∈ E, |k i - h i| ≤ D) + (hderiv : ∀ t ∈ Set.Icc (0 : ℝ) 1, + HasDerivAt (fun s => p (segmentField h k s)) + (∑ i ∈ E, row (segmentField h k t) i * (k i - h i)) t) + (hrow : ∀ t ∈ Set.Ico (0 : ℝ) 1, + (∑ i ∈ E, |row (segmentField h k t) i|) ≤ L) : + |p k - p h| ≤ L * D := by + have hbound : ‖p (segmentField h k 1) - p (segmentField h k 0)‖ ≤ L * D := by + apply norm_image_sub_le_of_norm_deriv_le_segment_01' + (f := fun s => p (segmentField h k s)) + (f' := fun t => ∑ i ∈ E, row (segmentField h k t) i * (k i - h i)) + · intro t ht + exact (hderiv t ht).hasDerivWithinAt + · intro t ht + simpa only [Real.norm_eq_abs] using + abs_sum_mul_le E (row (segmentField h k t)) (fun i => k i - h i) + L D hD (hrow t ht) hdir + simpa only [segmentField_one, segmentField_zero, Real.norm_eq_abs] using hbound + +end Problem336.FiniteGradientResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteIncidenceBridge.lean b/lean/OAI/Probability/SpanningForest/FiniteIncidenceBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..aae218f3f13c267819b23605fb7a33a69f81ddd0 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteIncidenceBridge.lean @@ -0,0 +1,167 @@ +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.ReducedLaplacian + +namespace OAI + +noncomputable section + +namespace Problem336.FiniteIncidence + +def ValidEdges (V : Finset ℕ) (T : Finset (ℕ × ℕ)) : Prop := + ∀ p ∈ T, p.1 ∈ V ∧ p.2 ∈ V ∧ p.1 < p.2 + +def src (V : Finset ℕ) (T : Finset (ℕ × ℕ)) (h : ValidEdges V T) : T → V := + fun e => ⟨e.val.1, (h e.val e.property).1⟩ + +def dst (V : Finset ℕ) (T : Finset (ℕ × ℕ)) (h : ValidEdges V T) : T → V := + fun e => ⟨e.val.2, (h e.val e.property).2.1⟩ + +theorem ValidEdges.mono {V : Finset ℕ} {S T : Finset (ℕ × ℕ)} + (h : ValidEdges V T) (hST : S ⊆ T) : ValidEdges V S := + fun p hp => h p (hST hp) + +def edgeInclusion {S T : Finset (ℕ × ℕ)} (hST : S ⊆ T) : S ↪ T where + toFun e := ⟨e.val, hST e.property⟩ + inj' := fun _ _ he => Subtype.ext (congrArg (fun e : T => e.val) he) + +theorem reducedGradient_submatrix {V : Finset ℕ} {S T : Finset (ℕ × ℕ)} + (h : ValidEdges V T) (hST : S ⊆ T) (root : V) : + (ReducedLaplacian.reducedGradient (src V T h) (dst V T h) root).submatrix + (edgeInclusion hST) id = + ReducedLaplacian.reducedGradient (src V S (h.mono hST)) + (dst V S (h.mono hST)) root := rfl + +theorem edgeAdj_iff_treeAdj (V : Finset ℕ) (T : Finset (ℕ × ℕ)) + (h : ValidEdges V T) (u v : V) : + ReducedLaplacian.EdgeAdj (src V T h) (dst V T h) u v ↔ + TreeAdj T u.val v.val := by + constructor + · rintro ⟨e, he | he⟩ + · have h1 := congrArg Subtype.val he.1 + have h2 := congrArg Subtype.val he.2 + change e.val.1 = u.val at h1 + change e.val.2 = v.val at h2 + change rawPair u.val v.val ∈ T + rw [← h1, ← h2] + simp [rawPair, (h e.val e.property).2.2, e.property] + · have h1 := congrArg Subtype.val he.1 + have h2 := congrArg Subtype.val he.2 + change e.val.1 = v.val at h1 + change e.val.2 = u.val at h2 + change rawPair u.val v.val ∈ T + rw [← h1, ← h2] + simp [rawPair, Nat.not_lt_of_ge (le_of_lt (h e.val e.property).2.2), e.property] + · intro ht + change rawPair u.val v.val ∈ T at ht + by_cases huv : u.val < v.val + · refine ⟨⟨(u.val, v.val), by simpa [rawPair, huv] using ht⟩, Or.inl ?_⟩ + exact ⟨Subtype.ext rfl, Subtype.ext rfl⟩ + · refine ⟨⟨(v.val, u.val), by simpa [rawPair, huv] using ht⟩, Or.inr ?_⟩ + exact ⟨Subtype.ext rfl, Subtype.ext rfl⟩ + +theorem treeAdj_endpoints_mem {V : Finset ℕ} {T : Finset (ℕ × ℕ)} + (h : ValidEdges V T) {u v : ℕ} (huv : TreeAdj T u v) : + u ∈ V ∧ v ∈ V := by + have hm := h (rawPair u v) huv + by_cases hlt : u < v + · simpa [rawPair, hlt] using And.intro hm.1 hm.2.1 + · simpa [rawPair, hlt] using And.intro hm.2.1 hm.1 + +theorem treePath_endpoint_mem {V : Finset ℕ} {T : Finset (ℕ × ℕ)} + (h : ValidEdges V T) {u v : ℕ} (hu : u ∈ V) + (hp : Relation.ReflTransGen (TreeAdj T) u v) : v ∈ V := by + induction hp with + | refl => exact hu + | tail _ hbc _ => exact (treeAdj_endpoints_mem h hbc).2 + +theorem treePath_lift {V : Finset ℕ} {T : Finset (ℕ × ℕ)} + (h : ValidEdges V T) {u v : ℕ} (hu : u ∈ V) (hv : v ∈ V) + (hp : Relation.ReflTransGen (TreeAdj T) u v) : + Relation.ReflTransGen (ReducedLaplacian.EdgeAdj (src V T h) (dst V T h)) + ⟨u, hu⟩ ⟨v, hv⟩ := by + induction hp with + | refl => exact .refl + | @tail b c hab hbc ih => + have hb : b ∈ V := treePath_endpoint_mem h hu hab + exact (ih hb).tail ((edgeAdj_iff_treeAdj V T h ⟨b, hb⟩ ⟨c, hv⟩).mpr hbc) + +theorem connected_iff_treePaths (V : Finset ℕ) (T : Finset (ℕ × ℕ)) + (h : ValidEdges V T) : + ReducedLaplacian.Connected (src V T h) (dst V T h) ↔ + ∀ u ∈ V, ∀ v ∈ V, Relation.ReflTransGen (TreeAdj T) u v := by + constructor + · intro hc u hu v hv + exact Relation.ReflTransGen.lift Subtype.val + (fun a b hab => (edgeAdj_iff_treeAdj V T h a b).mp hab) _ _ + (hc ⟨u, hu⟩ ⟨v, hv⟩) + · intro hc u v + exact treePath_lift h u.property v.property (hc u.val u.property v.val v.property) + +theorem validEdges_of_subgraph {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} (hT : T ⊆ K.2) : + ValidEdges K.1 T := by + intro p hp + have h := hK.2.1 p (hT hp) + exact ⟨h.1, h.2.1, h.2.2.1⟩ + +theorem treeOn_iff_connected {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} (hT : T ⊆ K.2) : + TreeOn K T ↔ T.card + 1 = K.1.card ∧ + ReducedLaplacian.Connected + (src K.1 T (validEdges_of_subgraph hK hT)) + (dst K.1 T (validEdges_of_subgraph hK hT)) := by + rw [connected_iff_treePaths] + exact ⟨fun ht => ht.2, fun ht => ⟨hT, ht⟩⟩ + +theorem treeOn_weightedLaplacian_posDef {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} (hT : TreeOn K T) + (root : K.1) (w : T → ℝ) (hw : ∀ e, 0 < w e) : + (ReducedLaplacian.weightedLaplacian + (src K.1 T (validEdges_of_subgraph hK hT.1)) + (dst K.1 T (validEdges_of_subgraph hK hT.1)) root w).PosDef := + ReducedLaplacian.weightedLaplacian_posDef _ _ root w + ((treeOn_iff_connected hK hT.1).mp hT).2 hw + +def edgeEquivNonroot {V : Finset ℕ} {T : Finset (ℕ × ℕ)} + (hcard : T.card + 1 = V.card) (root : V) : T ≃ {v : V // v ≠ root} := + Fintype.equivOfCardEq (by + rw [Fintype.card_coe, Fintype.card_subtype_compl (fun v : V => v = root), + Fintype.card_coe, Fintype.card_subtype_eq] + omega) + +def treeEdgeEquivNonroot {K : FiniteSubgraphCode} {T : Finset (ℕ × ℕ)} + (hT : TreeOn K T) (root : K.1) : T ≃ {v : K.1 // v ≠ root} := + edgeEquivNonroot hT.2.1 root + +def squareReducedGradient (V : Finset ℕ) (T : Finset (ℕ × ℕ)) + (h : ValidEdges V T) (root : V) (e : T ≃ {v : V // v ≠ root}) : + Matrix {v : V // v ≠ root} {v : V // v ≠ root} ℝ := + (ReducedLaplacian.reducedGradient (src V T h) (dst V T h) root).submatrix e.symm id + +theorem squareReducedGradient_det_ne_zero (V : Finset ℕ) (T : Finset (ℕ × ℕ)) + (h : ValidEdges V T) (root : V) (e : T ≃ {v : V // v ≠ root}) + (hc : ReducedLaplacian.Connected (src V T h) (dst V T h)) : + (squareReducedGradient V T h root e).det ≠ 0 := by + have hinj : Function.Injective (squareReducedGradient V T h root e).mulVec := by + intro x y hxy + apply ReducedLaplacian.reducedGradient_mulVec_injective + (src V T h) (dst V T h) root hc + funext a + have he := congrFun hxy (e a) + simpa [squareReducedGradient, Matrix.mulVec, dotProduct, Matrix.submatrix] using he + exact isUnit_iff_ne_zero.mp + ((Matrix.isUnit_iff_isUnit_det _).mp (Matrix.mulVec_injective_iff_isUnit.mp hinj)) + +theorem treeOn_squareReducedGradient_det_ne_zero + {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} (hT : TreeOn K T) + (root : K.1) : + (squareReducedGradient K.1 T (validEdges_of_subgraph hK hT.1) root + (treeEdgeEquivNonroot hT root)).det ≠ 0 := + squareReducedGradient_det_ne_zero _ _ _ _ _ ((treeOn_iff_connected hK hT.1).mp hT).2 + +end Problem336.FiniteIncidence + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteKernelBridge.lean b/lean/OAI/Probability/SpanningForest/FiniteKernelBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cf537cd15dd61a9f7c170b575c575c241964a51 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteKernelBridge.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SpanningForest.ReducedCycleKernel +import OAI.Probability.SpanningForest.FiniteKernelEmbedding + +namespace OAI + +noncomputable section +open scoped BigOperators Topology +namespace Problem336.FiniteKernelBridge +open CoordinateTruncation + +theorem embedding_range (K : FiniteSubgraphCode) : + (finiteHilbertEmbedding K).toLinearMap.range = + supported (finiteEdges K : Set EdgeCode) := by + classical + apply le_antisymm + · rintro x ⟨y, rfl⟩ e he + exact FreeKernel.finiteHilbertEmbedding_mem_supported K y e he + · intro x hx + refine ⟨WithLp.toLp 2 (fun e : finiteCodeEdges K => x e.1), ?_⟩ + apply lp.ext + funext e + by_cases he : e ∈ finiteEdges K + · exact finiteHilbertEmbedding_apply K _ ⟨e, (mem_finiteEdges K e).mp he⟩ + · exact (FreeKernel.finiteHilbertEmbedding_mem_supported K _ e he).trans (hx e he).symm + +theorem embedding_projection (K : FiniteSubgraphCode) : + (finiteHilbertEmbedding K).toLinearMap.range.starProjection = + truncate (finiteEdges K) := by + simpa only [embedding_range] using (starProjection_supported (𝕜 := ℝ) (finiteEdges K)) + +theorem transfer_entry_eq_finiteKernel {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) (e f : finiteCodeEdges K) : + TransferProjection.transferMatrix (ReducedCycleKernel.reducedFiniteIncidence K root) e f = + inner ℝ (FreeKernel.edgeVector e.1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector f.1)) := by + rw [ReducedCycleKernel.finite_transfer_entry_eq_projection hK root, + embedding_projection] + rfl + +theorem transfer_operator_eq_finiteKernel {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) (x : EdgeHilbert) : + finiteHilbertEmbedding K + ((TransferProjection.transferMatrix (ReducedCycleKernel.reducedFiniteIncidence K root)).toEuclideanLin + ((finiteHilbertEmbedding K).toContinuousLinearMap.adjoint x)) = + FreeKernel.finiteKernel K x := by + rw [ReducedCycleKernel.finite_transfer_eq_coordinate_sub_cycle_of_connected hK root, + embedding_projection] + rfl + +theorem transfer_minor_eq_finiteKernel {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + {ι : Type*} [Fintype ι] [DecidableEq ι] (e : ι → finiteCodeEdges K) : + Matrix.det (fun i j => + TransferProjection.transferMatrix (ReducedCycleKernel.reducedFiniteIncidence K root) (e i) (e j)) = + Matrix.det (fun i j => inner ℝ (FreeKernel.edgeVector (e i).1) + (FreeKernel.finiteKernel K (FreeKernel.edgeVector (e j).1))) := by + congr 1 + funext i j + exact transfer_entry_eq_finiteKernel hK root (e i) (e j) + +end Problem336.FiniteKernelBridge + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteKernelEmbedding.lean b/lean/OAI/Probability/SpanningForest/FiniteKernelEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..a00a2d055c8a204056aa99758980cce5b9e4e604 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteKernelEmbedding.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SpanningForest.GraphFreeKernel +import OAI.Probability.SpanningForest.FiniteCycleIncidence + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.FreeKernel + +open CoordinateTruncation + +theorem finiteHilbertEmbedding_mem_supported (K : FiniteSubgraphCode) + (x : EuclideanSpace ℝ (finiteCodeEdges K)) : + finiteHilbertEmbedding K x ∈ supported (finiteEdges K : Set EdgeCode) := by + change finiteHilbertEmbeddingLinear K x ∈ supported (finiteEdges K : Set EdgeCode) + rw [finiteHilbertEmbeddingLinear_sum] + apply Submodule.sum_mem + intro e he + apply Submodule.smul_mem + exact single_mem_supported ((mem_finiteEdges K e.1).mpr e.2) 1 + +@[simp] theorem truncate_finiteHilbertEmbedding (K : FiniteSubgraphCode) + (x : EuclideanSpace ℝ (finiteCodeEdges K)) : + truncate (finiteEdges K) (finiteHilbertEmbedding K x) = finiteHilbertEmbedding K x := by + rw [← starProjection_supported] + exact Submodule.starProjection_eq_self_iff.mpr (finiteHilbertEmbedding_mem_supported K x) + +theorem finiteKernel_embedding {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (x : EuclideanSpace ℝ (finiteCodeEdges K)) : + finiteKernel K (finiteHilbertEmbedding K x) = + finiteHilbertEmbedding K + (x - (LinearMap.ker (Matrix.toEuclideanLin (finiteIncidence K))).starProjection x) := by + let C := LinearMap.ker (Matrix.toEuclideanLin (finiteIncidence K)) + have hmap : C.map (finiteHilbertEmbedding K).toLinearMap = finiteHilbertCycleSpace K := + hK.finiteHilbertCycleSpace_eq_euclideanKernel.symm + have : (C.map (finiteHilbertEmbedding K).toLinearMap).HasOrthogonalProjection := by + rw [hmap] + infer_instance + have hp := (finiteHilbertEmbedding K).map_starProjection C x + have hp' : finiteHilbertEmbedding K (C.starProjection x) = + (finiteHilbertCycleSpace K).starProjection (finiteHilbertEmbedding K x) := by + simpa only [hmap] using hp + change truncate (finiteEdges K) (finiteHilbertEmbedding K x) - + (finiteHilbertCycleSpace K).starProjection (finiteHilbertEmbedding K x) = + finiteHilbertEmbedding K (x - C.starProjection x) + rw [truncate_finiteHilbertEmbedding, ← hp', map_sub] + +theorem finiteKernel_embedding_inner {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) + (x y : EuclideanSpace ℝ (finiteCodeEdges K)) : + inner ℝ (finiteHilbertEmbedding K x) (finiteKernel K (finiteHilbertEmbedding K y)) = + inner ℝ x + (y - (LinearMap.ker (Matrix.toEuclideanLin (finiteIncidence K))).starProjection y) := by + rw [finiteKernel_embedding hK] + exact (finiteHilbertEmbedding K).inner_map_map _ _ + +@[simp] theorem finiteHilbertEmbedding_single (K : FiniteSubgraphCode) + (e : finiteCodeEdges K) : + finiteHilbertEmbedding K (EuclideanSpace.single e (1 : ℝ)) = edgeVector e.1 := by + change finiteHilbertEmbeddingLinear K (EuclideanSpace.single e (1 : ℝ)) = edgeVector e.1 + rw [finiteHilbertEmbeddingLinear_sum] + simp [EuclideanSpace.single, PiLp.single_apply, edgeVector] + +theorem finiteKernel_basis_minor_eq {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {ι : Type*} [Fintype ι] [DecidableEq ι] + (e : ι → finiteCodeEdges K) : + Matrix.det (fun i j => inner ℝ (edgeVector (e i).1) + (finiteKernel K (edgeVector (e j).1))) = + Matrix.det (fun i j => inner ℝ (EuclideanSpace.single (e i) (1 : ℝ)) + (EuclideanSpace.single (e j) (1 : ℝ) - + (LinearMap.ker (Matrix.toEuclideanLin (finiteIncidence K))).starProjection + (EuclideanSpace.single (e j) (1 : ℝ)))) := by + congr 1 + funext i j + rw [← finiteHilbertEmbedding_single K (e i), ← finiteHilbertEmbedding_single K (e j)] + exact finiteKernel_embedding_inner hK _ _ + +end Problem336.FreeKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteKernelSupport.lean b/lean/OAI/Probability/SpanningForest/FiniteKernelSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..e77480b29990517092dea03a0cbb71da55dd8fcb --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteKernelSupport.lean @@ -0,0 +1,61 @@ +import OAI.Probability.SpanningForest.GraphFreeKernel + +namespace OAI + +noncomputable section + +namespace Problem336.FreeKernel + +open CoordinateTruncation + +theorem finiteKernel_minor_eq_zero_of_absent + (K : FiniteSubgraphCode) {ι : Type*} [Fintype ι] [DecidableEq ι] + (e : ι → EdgeCode) (i : ι) (hi : (e i).1 ∉ K.2) : + Matrix.det (fun a b => inner ℝ (edgeVector (e a)) + (finiteKernel K (edgeVector (e b)))) = 0 := + Matrix.det_eq_zero_of_row_eq_zero i fun j => + finiteKernel_inner_edge_eq_zero_of_not_mem K (e i) (edgeVector (e j)) hi + +theorem graphKernel_minor_eq_zero_of_nonedge + (G : GraphCode) {ι : Type*} [Fintype ι] [DecidableEq ι] + (e : ι → EdgeCode) (i : ι) (hi : ¬ Adj G (e i).1.1 (e i).1.2) : + Matrix.det (fun a b => kernelEntry G (e a) (e b)) = 0 := + Matrix.det_eq_zero_of_row_eq_zero i fun j => + kernelEntry_eq_zero_of_not_adj G (e i) (e j) hi + +theorem ustCylinder_eq_zero_of_required_absent (K : FiniteSubgraphCode) + (A B : Finset EdgeCode) (e : EdgeCode) (he : e ∈ A) (habs : e.1 ∉ K.2) : + ustCylinder K A B = 0 := by + classical + have hz : ∀ T ∈ spanningTrees K, + ¬ ((∀ a ∈ A, a.1 ∈ T) ∧ (∀ b ∈ B, b.1 ∉ T)) := by + intro T hT hc + have hsub : T ⊆ K.2 := (Finset.mem_filter.mp hT).2.1 + exact habs (hsub (hc.1 e he)) + simp only [ustCylinder, ENNReal.div_eq_zero_iff, Nat.cast_eq_zero, + Finset.card_eq_zero, Finset.filter_eq_empty_iff] + exact Or.inl hz + +theorem inclusion_identity_of_contained_identity (K : FiniteSubgraphCode) + (hinside : ∀ A : Finset EdgeCode, (∀ e ∈ A, e.1 ∈ K.2) → + ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.1) + (finiteKernel K (edgeVector f.1))))) : + ∀ A : Finset EdgeCode, ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.1) + (finiteKernel K (edgeVector f.1)))) := by + classical + intro A + by_cases hA : ∀ e ∈ A, e.1 ∈ K.2 + · exact hinside A hA + · push Not at hA + obtain ⟨e, he, habs⟩ := hA + rw [ustCylinder_eq_zero_of_required_absent K A ∅ e he habs, + finiteKernel_minor_eq_zero_of_absent K (fun e : A => e.1) ⟨e, he⟩ habs] + simp + +end Problem336.FreeKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteObservationReduction.lean b/lean/OAI/Probability/SpanningForest/FiniteObservationReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6af98c26d35423e0e9e8a44435b5d1d09f0c5a0a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteObservationReduction.lean @@ -0,0 +1,76 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators Classical + +namespace Problem336.GaussianObservation + +variable {I : Type*} + +def bitValue (b : Bool) : ℝ := if b then 1 else 0 + +theorem bitValue_binary (b : Bool) : bitValue b = 0 ∨ bitValue b = 1 := by + cases b <;> simp [bitValue] + +theorem finiteProjection_integrable (ν : Measure (I → Bool)) [IsFiniteMeasure ν] + (A : Finset I) (F : (A → Bool) → ℝ) : + Integrable (fun ω => F (A.restrict ω)) ν := by + exact (Integrable.of_finite (μ := ν.map A.restrict) (f := F)).comp_measurable + (Finset.measurable_restrict A) + +theorem finiteProjection_integral (ν : Measure (I → Bool)) [IsFiniteMeasure ν] + (A : Finset I) (F : (A → Bool) → ℝ) : + (∫ ω, F (A.restrict ω) ∂ν) = + ∑ a : A → Bool, (ν.map A.restrict).real {a} * F a := by + have hF : Integrable F (ν.map A.restrict) := Integrable.of_finite + have hA : HasLaw A.restrict (ν.map A.restrict) ν := + ⟨(Finset.measurable_restrict A).aemeasurable, rfl⟩ + calc + _ = ∫ a, F a ∂ν.map A.restrict := hA.integral_comp hF.aestronglyMeasurable + _ = _ := by simpa only [smul_eq_mul] using integral_fintype hF + +theorem finiteProjection_mass_sum (ν : Measure (I → Bool)) [IsProbabilityMeasure ν] + (A : Finset I) : + (∑ a : A → Bool, (ν.map A.restrict).real {a}) = 1 := by + simp + +def finiteTiltMean (ν : Measure (I → Bool)) (S : Finset I) + (h : I → ℝ) (e : I) : ℝ := + (∫ ω, bitValue (ω e) * Real.exp (∑ j : S, h j * bitValue (ω j)) ∂ν) / + (∫ ω, Real.exp (∑ j : S, h j * bitValue (ω j)) ∂ν) + +theorem integrable_finiteTiltWeight (ν : Measure (I → Bool)) [IsFiniteMeasure ν] + (S : Finset I) (h : I → ℝ) : + Integrable (fun ω => Real.exp (∑ j : S, h j * bitValue (ω j))) ν := + finiteProjection_integrable ν S (fun a => Real.exp (∑ j : S, h j * bitValue (a j))) + +theorem finiteTilt_denominator_pos (ν : Measure (I → Bool)) [IsProbabilityMeasure ν] + (S : Finset I) (h : I → ℝ) : + 0 < ∫ ω, Real.exp (∑ j : S, h j * bitValue (ω j)) ∂ν := + integral_exp_pos (integrable_finiteTiltWeight ν S h) + +theorem finiteTiltMean_eq_marginal_sum (ν : Measure (I → Bool)) [IsFiniteMeasure ν] + (S A : Finset I) (hSA : S ⊆ A) (h : I → ℝ) (e : I) (he : e ∈ A) : + finiteTiltMean ν S h e = + (∑ a : A → Bool, (ν.map A.restrict).real {a} * + (bitValue (a ⟨e, he⟩) * + Real.exp (∑ j : S, h j * bitValue (a ⟨j, hSA j.property⟩)))) / + (∑ a : A → Bool, (ν.map A.restrict).real {a} * + Real.exp (∑ j : S, h j * bitValue (a ⟨j, hSA j.property⟩))) := by + unfold finiteTiltMean + rw [← finiteProjection_integral ν A + (fun a => bitValue (a ⟨e, he⟩) * + Real.exp (∑ j : S, h j * bitValue (a ⟨j, hSA j.property⟩))), + ← finiteProjection_integral ν A + (fun a => Real.exp (∑ j : S, h j * bitValue (a ⟨j, hSA j.property⟩)))] + rfl + +end Problem336.GaussianObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FinitePosterior.lean b/lean/OAI/Probability/SpanningForest/FinitePosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..05ecee8f1da4d4f03e78bc64ce4708a4489a82c2 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FinitePosterior.lean @@ -0,0 +1,225 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal BigOperators ProbabilityTheory + +namespace Problem336.FinitePosterior + +variable {Θ Y : Type*} [Fintype Θ] [MeasurableSpace Θ] + [MeasurableSingletonClass Θ] [MeasurableSpace Y] + +def mixtureDensity (π : Measure Θ) (f : Θ → Y → ℝ≥0∞) (y : Y) : ℝ≥0∞ := + ∑ θ, π {θ} * f θ y + +omit [MeasurableSingletonClass Θ] in +lemma measurable_mixtureDensity (π : Measure Θ) (f : Θ → Y → ℝ≥0∞) + (hf : ∀ θ, Measurable (f θ)) : Measurable (mixtureDensity π f) := by + unfold mixtureDensity + fun_prop + +theorem marginal_eq_withDensity (π : Measure Θ) (κ : Kernel Θ Y) (ν : Measure Y) + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) : + κ ∘ₘ π = ν.withDensity (mixtureDensity π f) := by + calc + κ ∘ₘ π = Measure.sum (fun θ => π {θ} • ν.withDensity (f θ)) := by + rw [Measure.comp_eq_sum_of_countable] + simp_rw [hκ] + _ = Measure.sum (fun θ => ν.withDensity (fun y => π {θ} * f θ y)) := by + congr 1 + funext θ + exact (withDensity_smul (π {θ}) (hf θ)).symm + _ = ν.withDensity (∑' θ, fun y => π {θ} * f θ y) := by + exact (withDensity_tsum (fun θ => measurable_const.mul (hf θ))).symm + _ = ν.withDensity (mixtureDensity π f) := by + congr 1 + ext y + simp [mixtureDensity] + +omit [MeasurableSingletonClass Θ] [MeasurableSpace Y] in +lemma mixtureDensity_ne_top (π : Measure Θ) [IsFiniteMeasure π] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ y, f θ y ≠ ∞) (y : Y) : + mixtureDensity π f y ≠ ∞ := by + unfold mixtureDensity + exact ENNReal.sum_ne_top.mpr (fun θ _ => ENNReal.mul_ne_top (measure_ne_top π _) (hf θ y)) + +omit [MeasurableSpace Y] in + +lemma mixtureDensity_ne_zero_of_positive (π : Measure Θ) [IsProbabilityMeasure π] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ y, f θ y ≠ 0) (y : Y) : + mixtureDensity π f y ≠ 0 := by + have hsum : (∑ θ, π {θ}) = 1 := by simp + have hpos : 0 < ∑ θ, π {θ} := by rw [hsum]; exact zero_lt_one + obtain ⟨θ, hθ, hpθ⟩ := Finset.sum_pos_iff.mp hpos + apply ne_of_gt + exact Finset.sum_pos_iff.mpr ⟨θ, hθ, ENNReal.mul_pos hpθ.ne' (hf θ y)⟩ + +omit [MeasurableSingletonClass Θ] [MeasurableSpace Y] in + +lemma mixtureDensity_toReal (π : Measure Θ) [IsFiniteMeasure π] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ y, f θ y ≠ ∞) (y : Y) : + (mixtureDensity π f y).toReal = ∑ θ, (π {θ}).toReal * (f θ y).toReal := by + rw [mixtureDensity, ENNReal.toReal_sum] + · simp only [ENNReal.toReal_mul] + · intro θ _ + exact ENNReal.mul_ne_top (measure_ne_top π _) (hf θ y) + +theorem likelihood_rnDeriv_marginal (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] (ν : Measure Y) [SigmaFinite ν] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hfinite : ∀ θ y, f θ y ≠ ∞) + (hpositive : ∀ y, mixtureDensity π f y ≠ 0) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) (θ : Θ) : + (κ θ).rnDeriv (κ ∘ₘ π) =ᵐ[ν] + fun y => f θ y / mixtureDensity π f y := by + have hright := Measure.rnDeriv_withDensity_right (κ θ) ν + (measurable_mixtureDensity π f hf).aemeasurable + (Filter.Eventually.of_forall hpositive) + (Filter.Eventually.of_forall (mixtureDensity_ne_top π f hfinite)) + have hleft : (κ θ).rnDeriv ν =ᵐ[ν] f θ := by + rw [hκ θ] + exact Measure.rnDeriv_withDensity ν (hf θ) + rw [marginal_eq_withDensity π κ ν f hf hκ] + filter_upwards [hright, hleft] with y hy hy' + rw [hy, hy', div_eq_mul_inv, mul_comm] + +theorem posterior_singleton_formula [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] (ν : Measure Y) [SigmaFinite ν] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hfinite : ∀ θ y, f θ y ≠ ∞) + (hpositive : ∀ y, mixtureDensity π f y ≠ 0) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) : + ∀ᵐ y ∂(κ ∘ₘ π), ∀ θ, + (κ†π) y {θ} = π {θ} * f θ y / mixtureDensity π f y := by + have hac : κ ∘ₘ π ≪ ν := by + rw [marginal_eq_withDensity π κ ν f hf hκ] + exact withDensity_absolutelyContinuous ν _ + have hrn : ∀ᵐ y ∂(κ ∘ₘ π), ∀ θ, + (κ θ).rnDeriv (κ ∘ₘ π) y = f θ y / mixtureDensity π f y := by + exact hac.ae_le (ae_all_iff.mpr (fun θ => + likelihood_rnDeriv_marginal π κ ν f hf hfinite hpositive hκ θ)) + filter_upwards [posterior_eq_withDensity_of_countable κ π, hrn] with y hy hrny + intro θ + rw [hy] + simp only [withDensity_apply _ (measurableSet_singleton θ), lintegral_singleton, hrny θ] + rw [mul_comm, mul_div_assoc] + +theorem posterior_mean_formula [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] (ν : Measure Y) [SigmaFinite ν] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hfinite : ∀ θ y, f θ y ≠ ∞) + (hpositive : ∀ y, mixtureDensity π f y ≠ 0) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) (g : Θ → ℝ) : + ∀ᵐ y ∂(κ ∘ₘ π), + (∫ θ, g θ ∂(κ†π) y) = + (∑ θ, (π {θ}).toReal * (f θ y).toReal * g θ) / + (mixtureDensity π f y).toReal := by + filter_upwards [posterior_singleton_formula π κ ν f hf hfinite hpositive hκ] + with y hy + rw [integral_fintype (Integrable.of_finite)] + simp only [Measure.real, hy, ENNReal.toReal_div, ENNReal.toReal_mul, smul_eq_mul] + simp_rw [div_mul_eq_mul_div] + exact (Finset.sum_div _ _ _).symm + +theorem condExp_eq_posterior_mean [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] (g : Θ → ℝ) : + (π ⊗ₘ κ)[fun z : Θ × Y => g z.1 | + (inferInstance : MeasurableSpace Y).comap Prod.snd] =ᵐ[π ⊗ₘ κ] + fun z => ∫ θ, g θ ∂(κ†π) z.2 := by + have hgint : Integrable (fun z : Θ × Y => g z.1) (π ⊗ₘ κ) := + (show Integrable g ((π ⊗ₘ κ).map Prod.fst) from Integrable.of_finite).comp_measurable + measurable_fst + have h := condExp_ae_eq_integral_condDistrib (μ := π ⊗ₘ κ) + measurable_snd measurable_fst.aemeasurable + (measurable_of_countable g).stronglyMeasurable hgint + have hkernel : condDistrib (Prod.fst : Θ × Y → Θ) Prod.snd (π ⊗ₘ κ) = κ†π := by + rw [condDistrib, posterior] + congr 1 + rwa [hkernel] at h + +theorem condExp_eq_likelihood_ratio [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] (ν : Measure Y) [SigmaFinite ν] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hfinite : ∀ θ y, f θ y ≠ ∞) + (hpositive : ∀ y, mixtureDensity π f y ≠ 0) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) (g : Θ → ℝ) : + (π ⊗ₘ κ)[fun z : Θ × Y => g z.1 | + (inferInstance : MeasurableSpace Y).comap Prod.snd] =ᵐ[π ⊗ₘ κ] + fun z => (∑ θ, (π {θ}).toReal * (f θ z.2).toReal * g θ) / + (mixtureDensity π f z.2).toReal := by + apply (condExp_eq_posterior_mean π κ g).trans + have hpost := posterior_mean_formula π κ ν f hf hfinite hpositive hκ g + have hmap : (π ⊗ₘ κ).map Prod.snd = κ ∘ₘ π := Measure.snd_compProd π κ + rw [← hmap] at hpost + exact ae_of_ae_map (μ := π ⊗ₘ κ) (f := Prod.snd) measurable_snd.aemeasurable hpost + +theorem condExp_eq_posterior_mean_of_jointLaw + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Yobs : Ω → Y) (hX : Measurable X) (hY : Measurable Yobs) + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] + (hjoint : P.map (fun ω => (X ω, Yobs ω)) = π ⊗ₘ κ) (g : Θ → ℝ) : + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace Y).comap Yobs] =ᵐ[P] + fun ω => ∫ θ, g θ ∂(κ†π) (Yobs ω) := by + have hmapY : P.map Yobs = κ ∘ₘ π := by + calc + P.map Yobs = (P.map (fun ω => (X ω, Yobs ω))).map Prod.snd := by + rw [Measure.map_map measurable_snd (hX.prodMk hY)] + rfl + _ = (π ⊗ₘ κ).snd := by rw [hjoint]; rfl + _ = κ ∘ₘ π := Measure.snd_compProd π κ + have hswap : P.map (fun ω => (Yobs ω, X ω)) = (π ⊗ₘ κ).map Prod.swap := by + rw [← hjoint, Measure.map_map measurable_swap (hX.prodMk hY)] + rfl + have hkernel : condDistrib X Yobs P =ᵐ[P.map Yobs] κ†π := by + apply condDistrib_ae_eq_of_measure_eq_compProd_of_measurable hY hX + rw [hmapY, compProd_posterior_eq_map_swap] + exact hswap + have hgint : Integrable (fun ω => g (X ω)) P := + (show Integrable g (P.map X) from Integrable.of_finite).comp_measurable hX + have hcond := condExp_ae_eq_integral_condDistrib hY hX.aemeasurable + (measurable_of_countable g).stronglyMeasurable hgint + have hkernel' := ae_of_ae_map hY.aemeasurable hkernel + filter_upwards [hcond, hkernel'] with ω hω hkω + rwa [hkω] at hω + +theorem condExp_eq_likelihood_ratio_of_jointLaw + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Yobs : Ω → Y) (hX : Measurable X) (hY : Measurable Yobs) + (π : Measure Θ) [IsFiniteMeasure π] + (κ : Kernel Θ Y) [IsFiniteKernel κ] + (hjoint : P.map (fun ω => (X ω, Yobs ω)) = π ⊗ₘ κ) + (ν : Measure Y) [SigmaFinite ν] + (f : Θ → Y → ℝ≥0∞) (hf : ∀ θ, Measurable (f θ)) + (hfinite : ∀ θ y, f θ y ≠ ∞) + (hpositive : ∀ y, mixtureDensity π f y ≠ 0) + (hκ : ∀ θ, κ θ = ν.withDensity (f θ)) (g : Θ → ℝ) : + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace Y).comap Yobs] =ᵐ[P] + fun ω => (∑ θ, (π {θ}).toReal * (f θ (Yobs ω)).toReal * g θ) / + (mixtureDensity π f (Yobs ω)).toReal := by + apply (condExp_eq_posterior_mean_of_jointLaw P X Yobs hX hY π κ hjoint g).trans + have hmapY : P.map Yobs = κ ∘ₘ π := by + calc + P.map Yobs = (P.map (fun ω => (X ω, Yobs ω))).map Prod.snd := by + rw [Measure.map_map measurable_snd (hX.prodMk hY)] + rfl + _ = (π ⊗ₘ κ).snd := by rw [hjoint]; rfl + _ = κ ∘ₘ π := Measure.snd_compProd π κ + have hpost := posterior_mean_formula π κ ν f hf hfinite hpositive hκ g + rw [← hmapY] at hpost + exact ae_of_ae_map hY.aemeasurable hpost + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FinitePosteriorTilt.lean b/lean/OAI/Probability/SpanningForest/FinitePosteriorTilt.lean new file mode 100644 index 0000000000000000000000000000000000000000..93b36b68e8008baaf37d6c3aaf02669599dbb188 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FinitePosteriorTilt.lean @@ -0,0 +1,58 @@ +import OAI.Probability.SpanningForest.BinaryGaussianPosterior +import OAI.Probability.SpanningForest.PosteriorTiltLimit + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal NNReal BigOperators ProbabilityTheory + +namespace Problem336.FinitePosterior + +lemma gaussianFiniteTilt_finset_eq {I : Type*} + (ν : ProbabilityMeasure (I → Bool)) (S : Finset I) + (e : I) (t : ℝ) (y : I → ℝ) : + gaussianFiniteTilt (ν : Measure (I → Bool)) (fun i : S => (i : I)) e t + (fun i => y i) = + TiltLimit.finiteTiltMean ν S (fun i => y i - t / 2) e := by + classical + have hsum (x : I → Bool) : + (∑ j : S, (y j - t / 2) * binaryValue (x j)) = + ∑ j ∈ S, (y j - t / 2) * binaryValue (x j) := + Finset.sum_coe_sort S (fun j => (y j - t / 2) * binaryValue (x j)) + unfold gaussianFiniteTilt TiltLimit.finiteTiltMean TiltLimit.tiltedMean TiltLimit.finiteEnergy + simp_rw [hsum] + simp only [binaryValue, TiltLimit.bit, mul_comm] + +theorem binaryField_finset_condExp + {Ω I : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] + (ν : ProbabilityMeasure (I → Bool)) + (X : Ω → (I → Bool)) (noise : Ω → (I → ℝ)) + (hX : Measurable X) (hnoise : Measurable noise) + (S : Finset I) (e : I) (t : ℝ≥0) (ht : t ≠ 0) + (hprior : P.map X = (ν : Measure (I → Bool))) + (hnoiseLaw : P.map (fun ω (i : S) => noise ω i) = + Measure.pi (fun _ : S => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) : + let Y := fun ω i => (t : ℝ) * TiltLimit.bit (X ω i) + noise ω i + P[fun ω => TiltLimit.bit (X ω e) | + (inferInstance : MeasurableSpace (S → ℝ)).comap (fun ω (i : S) => Y ω i)] =ᵐ[P] + fun ω => TiltLimit.finiteTiltMean ν S (fun i => Y ω i - (t : ℝ) / 2) e := by + classical + let restrict : (I → ℝ) → S → ℝ := fun y i => y i + have hr : Measurable restrict := Measurable.of_eval (fun i => measurable_pi_apply (i : I)) + have hi : X ⟂ᵢ[P] (fun ω (i : S) => noise ω i) := by + simpa only [Function.comp_def, id_eq] using hindep.comp measurable_id hr + have h := binaryField_gaussian_condExp P (ν : Measure (I → Bool)) X + (fun ω (i : S) => noise ω i) hX (hr.comp hnoise) + (fun i : S => (i : I)) e t ht hprior hnoiseLaw hi + filter_upwards [h] with ω hω + exact hω.trans (gaussianFiniteTilt_finset_eq ν S e t + (fun i => (t : ℝ) * binaryValue (X ω i) + noise ω i)) + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteProductDensity.lean b/lean/OAI/Probability/SpanningForest/FiniteProductDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..99ecb6f489fb021177cbd9c08901f51513f34b08 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteProductDensity.lean @@ -0,0 +1,90 @@ +import OAI.Probability.SpanningForest.GaussianLikelihood + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators ENNReal NNReal + +namespace Problem336.GaussianObservation + +theorem pi_withDensity_of_probability {ι : Type*} [Fintype ι] + {α : ι → Type*} [∀ i, MeasurableSpace (α i)] + (μ ν : (i : ι) → Measure (α i)) [∀ i, IsProbabilityMeasure (μ i)] + [∀ i, SigmaFinite (ν i)] (f : (i : ι) → α i → ℝ≥0∞) + (hf : ∀ i, Measurable (f i)) (hν : ∀ i, ν i = (μ i).withDensity (f i)) : + Measure.pi ν = (Measure.pi μ).withDensity (fun y => ∏ i, f i (y i)) := by + classical + apply Measure.pi_eq + intro s hs + have hrect := MeasurableSet.univ_pi hs + have hind : (Set.univ.pi s).indicator (fun y => ∏ i, f i (y i)) = + (fun y => ∏ i, (s i).indicator (f i) (y i)) := by + funext y + by_cases hy : ∀ i, y i ∈ s i + · rw [Set.indicator_of_mem (by simpa only [Set.mem_univ_pi] using hy)] + apply Finset.prod_congr rfl + intro i hi + exact (Set.indicator_of_mem (hy i) (f i)).symm + · rw [Set.indicator_of_notMem (by simpa only [Set.mem_univ_pi] using hy)] + obtain ⟨i, hi⟩ := not_forall.mp hy + symm + exact Finset.prod_eq_zero (Finset.mem_univ i) (Set.indicator_of_notMem hi (f i)) + rw [withDensity_apply _ hrect, ← lintegral_indicator hrect, hind] + rw [lintegral_prod_eq_prod_lintegral_of_indepFun Finset.univ + (fun i (y : ∀ j, α j) => (s i).indicator (f i) (y i)) + (iIndepFun_pi (fun i => ((hf i).indicator (hs i)).aemeasurable)) + (fun i => ((hf i).indicator (hs i)).comp (measurable_pi_apply i))] + apply Finset.prod_congr rfl + intro i hi + rw [(measurePreserving_eval μ i).lintegral_comp ((hf i).indicator (hs i)), + lintegral_indicator (hs i), hν i, withDensity_apply _ (hs i)] + +theorem gaussian_pi_binary_shift_withDensity {ι : Type*} [Fintype ι] + (v : ℝ≥0) (hv : v ≠ 0) (x : ι → ℝ) (hx : ∀ i, x i = 0 ∨ x i = 1) : + Measure.pi (fun i => gaussianReal ((v : ℝ) * x i) v) = + (Measure.pi (fun _ : ι => gaussianReal 0 v)).withDensity + (fun y => ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * x i))) := by + have h := pi_withDensity_of_probability + (fun _ : ι => gaussianReal 0 v) (fun i => gaussianReal ((v : ℝ) * x i) v) + (fun i y => ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x i))) + (fun _ => by fun_prop) (fun i => gaussian_binary_shift_withDensity v hv (x i) (hx i)) + simpa only [Real.exp_sum, + ENNReal.ofReal_prod_of_nonneg (fun _ _ => (Real.exp_pos _).le)] using h + +theorem gaussian_pi_binary_shift_withDensity_all {ι : Type*} [Fintype ι] + (v : ℝ≥0) (x : ι → ℝ) (hx : ∀ i, x i = 0 ∨ x i = 1) : + Measure.pi (fun i => gaussianReal ((v : ℝ) * x i) v) = + (Measure.pi (fun _ : ι => gaussianReal 0 v)).withDensity + (fun y => ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * x i))) := by + have h := pi_withDensity_of_probability + (fun _ : ι => gaussianReal 0 v) (fun i => gaussianReal ((v : ℝ) * x i) v) + (fun i y => ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x i))) + (fun _ => by fun_prop) (fun i => gaussian_binary_shift_withDensity_all v (x i) (hx i)) + simpa only [Real.exp_sum, + ENNReal.ofReal_prod_of_nonneg (fun _ _ => (Real.exp_pos _).le)] using h + +theorem rnDeriv_gaussian_pi_binary_shift {ι : Type*} [Fintype ι] + (v : ℝ≥0) (hv : v ≠ 0) (x : ι → ℝ) (hx : ∀ i, x i = 0 ∨ x i = 1) : + (Measure.pi (fun i => gaussianReal ((v : ℝ) * x i) v)).rnDeriv + (Measure.pi (fun _ : ι => gaussianReal 0 v)) =ᵐ[ + Measure.pi (fun _ : ι => gaussianReal 0 v)] + (fun y => ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * x i))) := by + rw [gaussian_pi_binary_shift_withDensity v hv x hx] + exact Measure.rnDeriv_withDensity _ (by fun_prop) + +theorem gaussian_pi_likelihood_lintegral_eq_one {ι : Type*} [Fintype ι] + (v : ℝ≥0) (hv : v ≠ 0) (x : ι → ℝ) (hx : ∀ i, x i = 0 ∨ x i = 1) : + (∫⁻ y, ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * x i)) + ∂Measure.pi (fun _ : ι => gaussianReal 0 v)) = 1 := by + have h := congrArg (fun μ : Measure (ι → ℝ) => μ Set.univ) + (gaussian_pi_binary_shift_withDensity v hv x hx) + simpa only [measure_univ, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ] using h.symm + +end Problem336.GaussianObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteResponse.lean b/lean/OAI/Probability/SpanningForest/FiniteResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..b44ccce33c3ee6a3f1685ab68d83b06925c7ab88 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteResponse.lean @@ -0,0 +1,115 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.FiniteResponse + +variable {Ω E : Type*} [Fintype Ω] [Fintype E] + +def mean (p : Ω → ℝ) (x : Ω → E → ℝ) (e : E) : ℝ := + ∑ ω, p ω * x ω e + +def covariance (p : Ω → ℝ) (x : Ω → E → ℝ) (e f : E) : ℝ := + (∑ ω, p ω * x ω e * x ω f) - mean p x e * mean p x f + +omit [Fintype E] in +lemma mean_nonneg (p : Ω → ℝ) (x : Ω → E → ℝ) + (hp : ∀ ω, 0 ≤ p ω) (hx : ∀ ω e, 0 ≤ x ω e) (e : E) : + 0 ≤ mean p x e := by + exact Finset.sum_nonneg fun ω _ => mul_nonneg (hp ω) (hx ω e) + +omit [Fintype E] in +lemma mean_le_one (p : Ω → ℝ) (x : Ω → E → ℝ) + (hp : ∀ ω, 0 ≤ p ω) (hnorm : ∑ ω, p ω = 1) + (hx : ∀ ω e, x ω e ≤ 1) (e : E) : mean p x e ≤ 1 := by + calc + mean p x e ≤ ∑ ω, p ω := by + apply Finset.sum_le_sum + intro ω _ + exact mul_le_of_le_one_right (hp ω) (hx ω e) + _ = 1 := hnorm + +omit [Fintype E] in +lemma covariance_self (p : Ω → ℝ) (x : Ω → E → ℝ) + (hx : ∀ ω e, x ω e = 0 ∨ x ω e = 1) (e : E) : + covariance p x e e = mean p x e * (1 - mean p x e) := by + have hid : (∑ ω, p ω * x ω e * x ω e) = mean p x e := by + apply Finset.sum_congr rfl + intro ω _ + rcases hx ω e with h | h <;> simp [h] + rw [covariance, hid] + ring + +lemma sum_covariance_eq_zero (p : Ω → ℝ) (x : Ω → E → ℝ) + (hnorm : ∑ ω, p ω = 1) (r : ℝ) + (hfixed : ∀ ω, ∑ f, x ω f = r) (e : E) : + ∑ f, covariance p x e f = 0 := by + have hmean : (∑ f, mean p x f) = r := by + simp only [mean] + rw [Finset.sum_comm] + simp_rw [← Finset.mul_sum, hfixed] + rw [← Finset.sum_mul, hnorm, one_mul] + have hsecond : (∑ f, ∑ ω, p ω * x ω e * x ω f) = mean p x e * r := by + rw [Finset.sum_comm] + simp_rw [← Finset.mul_sum, hfixed] + rw [← Finset.sum_mul] + rfl + simp only [covariance, Finset.sum_sub_distrib] + rw [hsecond, ← Finset.mul_sum, hmean, sub_self] + +lemma sum_abs_of_row_sum_zero (c : E → ℝ) (e : E) + (hsum : ∑ f, c f = 0) (hdiag : 0 ≤ c e) + (hoff : ∀ f, f ≠ e → c f ≤ 0) : + ∑ f, |c f| = 2 * c e := by + classical + have hs : (∑ f ∈ Finset.univ.erase e, c f) = -c e := by + have ht := Finset.sum_erase_add Finset.univ c (Finset.mem_univ e) + rw [hsum] at ht + linarith + rw [← Finset.sum_erase_add Finset.univ (fun f => |c f|) (Finset.mem_univ e)] + have ha : (∑ f ∈ Finset.univ.erase e, |c f|) = + -(∑ f ∈ Finset.univ.erase e, c f) := by + rw [← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro f hf + exact abs_of_nonpos (hoff f (Finset.mem_erase.mp hf).1) + rw [ha, hs, abs_of_nonneg hdiag] + ring + +theorem covariance_abs_row (p : Ω → ℝ) (x : Ω → E → ℝ) + (hp : ∀ ω, 0 ≤ p ω) (hnorm : ∑ ω, p ω = 1) + (hx : ∀ ω e, x ω e = 0 ∨ x ω e = 1) + (r : ℝ) (hfixed : ∀ ω, ∑ f, x ω f = r) + (hneg : ∀ e f, e ≠ f → covariance p x e f ≤ 0) (e : E) : + (∑ f, |covariance p x e f|) = 2 * mean p x e * (1 - mean p x e) := by + have hm0 : 0 ≤ mean p x e := mean_nonneg p x hp (by + intro ω f + rcases hx ω f with h | h <;> simp [h]) e + have hm1 : mean p x e ≤ 1 := mean_le_one p x hp hnorm (by + intro ω f + rcases hx ω f with h | h <;> simp [h]) e + have hd : 0 ≤ covariance p x e e := by + rw [covariance_self p x hx e] + exact mul_nonneg hm0 (sub_nonneg.mpr hm1) + rw [sum_abs_of_row_sum_zero (fun f => covariance p x e f) e + (sum_covariance_eq_zero p x hnorm r hfixed e) hd + (fun f hfe => hneg e f (Ne.symm hfe)), covariance_self p x hx e] + ring + +theorem covariance_abs_row_le_half (p : Ω → ℝ) (x : Ω → E → ℝ) + (hp : ∀ ω, 0 ≤ p ω) (hnorm : ∑ ω, p ω = 1) + (hx : ∀ ω e, x ω e = 0 ∨ x ω e = 1) + (r : ℝ) (hfixed : ∀ ω, ∑ f, x ω f = r) + (hneg : ∀ e f, e ≠ f → covariance p x e f ≤ 0) (e : E) : + (∑ f, |covariance p x e f|) ≤ (1 : ℝ) / 2 := by + rw [covariance_abs_row p x hp hnorm hx r hfixed hneg e] + nlinarith [sq_nonneg (mean p x e - 1 / 2)] + +end Problem336.FiniteResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteResponseBundle.lean b/lean/OAI/Probability/SpanningForest/FiniteResponseBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..33992379e6dbebacf13b0075dba389d88485dd94 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteResponseBundle.lean @@ -0,0 +1 @@ +import OAI.Probability.SpanningForest.USTPosteriorResponse diff --git a/lean/OAI/Probability/SpanningForest/FiniteTiltLimit.lean b/lean/OAI/Probability/SpanningForest/FiniteTiltLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..74b8f81ee22d6b2cc22f37b6d50ea2a160f39ac2 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteTiltLimit.lean @@ -0,0 +1,119 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter +open scoped BigOperators Topology + +namespace Problem336 +namespace FiniteTiltLimit + +variable {S : Type*} [Fintype S] + +def partition (p w : S → ℝ) : ℝ := ∑ s, p s * w s + +def mean (p w f : S → ℝ) : ℝ := + (∑ s, p s * w s * f s) / partition p w + +theorem partition_pos {p w : S → ℝ} (hp : ∀ s, 0 ≤ p s) + (hp_sum : ∑ s, p s = 1) (hw : ∀ s, 0 < w s) : + 0 < partition p w := by + have hex : ∃ s, 0 < p s := by + by_contra h + push Not at h + have hz : ∀ s, p s = 0 := fun s => le_antisymm (h s) (hp s) + simp [hz] at hp_sum + obtain ⟨s, hs⟩ := hex + exact Finset.sum_pos' (fun t _ => mul_nonneg (hp t) (hw t).le) + ⟨s, Finset.mem_univ s, mul_pos hs (hw s)⟩ + +theorem mean_mem_Icc {p w f : S → ℝ} (hp : ∀ s, 0 ≤ p s) + (hp_sum : ∑ s, p s = 1) (hw : ∀ s, 0 < w s) + (hf : ∀ s, f s ∈ Set.Icc (0 : ℝ) 1) : + mean p w f ∈ Set.Icc (0 : ℝ) 1 := by + have hz := partition_pos hp hp_sum hw + constructor + · exact div_nonneg (Finset.sum_nonneg fun s _ => + mul_nonneg (mul_nonneg (hp s) (hw s).le) (hf s).1) hz.le + · apply (div_le_one hz).mpr + exact Finset.sum_le_sum fun s _ => + mul_le_of_le_one_right (mul_nonneg (hp s) (hw s).le) (hf s).2 + +theorem tendsto_partition {p : ℕ → S → ℝ} {q w : S → ℝ} + (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) : + Tendsto (fun n => partition (p n) w) atTop (nhds (partition q w)) := by + exact tendsto_finsetSum _ fun s _ => (hp s).mul tendsto_const_nhds + +theorem tendsto_mean {p : ℕ → S → ℝ} {q w f : S → ℝ} + (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hq : partition q w ≠ 0) : + Tendsto (fun n => mean (p n) w f) atTop (nhds (mean q w f)) := by + apply Tendsto.div _ (tendsto_partition hp) hq + exact tendsto_finsetSum _ fun s _ => + ((hp s).mul tendsto_const_nhds).mul tendsto_const_nhds + +theorem tendsto_mean_of_probability {p : ℕ → S → ℝ} {q w f : S → ℝ} + (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hq : ∀ s, 0 ≤ q s) (hq_sum : ∑ s, q s = 1) + (hw : ∀ s, 0 < w s) : + Tendsto (fun n => mean (p n) w f) atTop (nhds (mean q w f)) := + tendsto_mean hp (ne_of_gt (partition_pos hq hq_sum hw)) + +theorem response_le_of_eventually {p : ℕ → S → ℝ} {q w w' f : S → ℝ} + {d : ℝ} (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hw : partition q w ≠ 0) (hw' : partition q w' ≠ 0) + (hresponse : ∀ᶠ n in atTop, |mean (p n) w f - mean (p n) w' f| ≤ d) : + |mean q w f - mean q w' f| ≤ d := by + exact le_of_tendsto + (((tendsto_mean hp hw).sub (tendsto_mean hp hw')).abs) hresponse + +theorem response_le_of_tendsto {p : ℕ → S → ℝ} {q w w' f : S → ℝ} + {d : ℝ} (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hw : partition q w ≠ 0) (hw' : partition q w' ≠ 0) + (hresponse : ∀ n, |mean (p n) w f - mean (p n) w' f| ≤ d) : + |mean q w f - mean q w' f| ≤ d := by + exact le_of_tendsto + (((tendsto_mean hp hw).sub (tendsto_mean hp hw')).abs) + (Eventually.of_forall hresponse) + +theorem probability_of_tendsto {p : ℕ → S → ℝ} {q : S → ℝ} + (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hp_nonneg : ∀ n s, 0 ≤ p n s) (hp_sum : ∀ n, ∑ s, p n s = 1) : + (∀ s, 0 ≤ q s) ∧ ∑ s, q s = 1 := by + constructor + · intro s + exact ge_of_tendsto (hp s) (Eventually.of_forall fun n => hp_nonneg n s) + · have hsum : Tendsto (fun n => ∑ s, p n s) atTop (nhds (∑ s, q s)) := + tendsto_finsetSum _ fun s _ => hp s + have hone : Tendsto (fun n => ∑ s, p n s) atTop (nhds (1 : ℝ)) := by + simpa only [hp_sum] using (tendsto_const_nhds : + Tendsto (fun _ : ℕ => (1 : ℝ)) atTop (nhds 1)) + exact tendsto_nhds_unique hsum hone + +theorem tendsto_exponential_mean {p : ℕ → S → ℝ} {q f g : S → ℝ} + (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hq : ∀ s, 0 ≤ q s) (hq_sum : ∑ s, q s = 1) : + Tendsto (fun n => mean (p n) (fun s => Real.exp (g s)) f) + atTop (nhds (mean q (fun s => Real.exp (g s)) f)) := + tendsto_mean_of_probability hp hq hq_sum (fun s => Real.exp_pos (g s)) + +theorem exponential_response_le {p : ℕ → S → ℝ} {q f g g' : S → ℝ} + {d : ℝ} (hp : ∀ s, Tendsto (fun n => p n s) atTop (nhds (q s))) + (hq : ∀ s, 0 ≤ q s) (hq_sum : ∑ s, q s = 1) + (hresponse : ∀ n, + |mean (p n) (fun s => Real.exp (g s)) f - + mean (p n) (fun s => Real.exp (g' s)) f| ≤ d) : + |mean q (fun s => Real.exp (g s)) f - + mean q (fun s => Real.exp (g' s)) f| ≤ d := + response_le_of_tendsto hp + (ne_of_gt (partition_pos hq hq_sum (fun s => Real.exp_pos (g s)))) + (ne_of_gt (partition_pos hq hq_sum (fun s => Real.exp_pos (g' s)))) hresponse + +end FiniteTiltLimit +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteTiltMeasure.lean b/lean/OAI/Probability/SpanningForest/FiniteTiltMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c5b94b45d617e2bb2bcfac02b6d40ad12fb232c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteTiltMeasure.lean @@ -0,0 +1,133 @@ +import OAI.Probability.SpanningForest.FiniteTiltLimit + +namespace OAI + +noncomputable section + +open Filter MeasureTheory +open scoped BigOperators Topology + +namespace Problem336 +namespace FiniteTiltLimit + +variable {S : Type*} [Fintype S] [MeasurableSpace S] + [MeasurableSingletonClass S] + +theorem sum_real_singleton_eq_one (μ : Measure S) [IsProbabilityMeasure μ] : + ∑ s, μ.real {s} = 1 := by + simp + +theorem mean_measure_eq_integral_ratio (μ : Measure S) [IsFiniteMeasure μ] + (w f : S → ℝ) : + mean (fun s => μ.real {s}) w f = + (∫ s, w s * f s ∂μ) / (∫ s, w s ∂μ) := by + simp only [mean, partition, integral_fintype (Integrable.of_finite), smul_eq_mul] + congr 1 + apply Finset.sum_congr rfl + intro s _ + exact mul_assoc _ _ _ + +omit [Fintype S] [MeasurableSingletonClass S] in + +theorem tendsto_real_singleton {μ : ℕ → Measure S} {ν : Measure S} + [IsFiniteMeasure ν] + (h : ∀ s, Tendsto (fun n => μ n {s}) atTop (nhds (ν {s}))) (s : S) : + Tendsto (fun n => (μ n).real {s}) atTop (nhds (ν.real {s})) := + (ENNReal.tendsto_toReal (measure_ne_top ν {s})).comp (h s) + +theorem tendsto_integral_ratio {μ : ℕ → Measure S} {ν : Measure S} + [∀ n, IsFiniteMeasure (μ n)] [IsProbabilityMeasure ν] + (h : ∀ s, Tendsto (fun n => μ n {s}) atTop (nhds (ν {s}))) + (w f : S → ℝ) (hw : ∀ s, 0 < w s) : + Tendsto (fun n => (∫ s, w s * f s ∂μ n) / (∫ s, w s ∂μ n)) + atTop (nhds ((∫ s, w s * f s ∂ν) / (∫ s, w s ∂ν))) := by + simpa only [mean_measure_eq_integral_ratio] using + tendsto_mean_of_probability (tendsto_real_singleton h) + (fun s => measureReal_nonneg) (sum_real_singleton_eq_one ν) hw + +theorem integral_ratio_response_le {μ : ℕ → Measure S} {ν : Measure S} + [∀ n, IsFiniteMeasure (μ n)] [IsProbabilityMeasure ν] + (h : ∀ s, Tendsto (fun n => μ n {s}) atTop (nhds (ν {s}))) + (w w' f : S → ℝ) (hw : ∀ s, 0 < w s) (hw' : ∀ s, 0 < w' s) + {d : ℝ} (hresponse : ∀ n, + |(∫ s, w s * f s ∂μ n) / (∫ s, w s ∂μ n) - + (∫ s, w' s * f s ∂μ n) / (∫ s, w' s ∂μ n)| ≤ d) : + |(∫ s, w s * f s ∂ν) / (∫ s, w s ∂ν) - + (∫ s, w' s * f s ∂ν) / (∫ s, w' s ∂ν)| ≤ d := by + exact le_of_tendsto + (((tendsto_integral_ratio h w f hw).sub + (tendsto_integral_ratio h w' f hw')).abs) + (Eventually.of_forall hresponse) + +theorem mean_statistic_eq_integral_ratio {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] (R : Ω → S) (hR : Measurable R) + (w f : S → ℝ) : + mean (fun s => μ.real (R ⁻¹' {s})) w f = + (∫ ω, w (R ω) * f (R ω) ∂μ) / (∫ ω, w (R ω) ∂μ) := by + have h := mean_measure_eq_integral_ratio (μ.map R) w f + simp only [map_measureReal_apply hR (measurableSet_singleton _)] at h + rw [integral_map_of_stronglyMeasurable hR + (measurable_of_finite (fun s => w s * f s)).stronglyMeasurable, + integral_map_of_stronglyMeasurable hR + (measurable_of_finite w).stronglyMeasurable] at h + exact h + +theorem tendsto_statistic_integral_ratio {Ω : Type*} [MeasurableSpace Ω] + {μ : ℕ → Measure Ω} {ν : Measure Ω} + [∀ n, IsFiniteMeasure (μ n)] [IsProbabilityMeasure ν] + (R : Ω → S) (hR : Measurable R) + (h : ∀ s, Tendsto (fun n => μ n (R ⁻¹' {s})) atTop + (nhds (ν (R ⁻¹' {s})))) + (w f : S → ℝ) (hw : ∀ s, 0 < w s) : + Tendsto (fun n => + (∫ ω, w (R ω) * f (R ω) ∂μ n) / (∫ ω, w (R ω) ∂μ n)) + atTop (nhds ((∫ ω, w (R ω) * f (R ω) ∂ν) / + (∫ ω, w (R ω) ∂ν))) := by + have hp : ∀ s, Tendsto (fun n => (μ n).real (R ⁻¹' {s})) atTop + (nhds (ν.real (R ⁻¹' {s}))) := fun s => + (ENNReal.tendsto_toReal (measure_ne_top ν (R ⁻¹' {s}))).comp (h s) + have hsum : ∑ s, ν.real (R ⁻¹' {s}) = 1 := by + simpa using (sum_measureReal_preimage_singleton (μ := ν) + (Finset.univ : Finset S) (fun s _ => hR (measurableSet_singleton s))) + simpa only [mean_statistic_eq_integral_ratio _ R hR] using + tendsto_mean_of_probability hp (fun s => measureReal_nonneg) hsum hw + +theorem statistic_integral_ratio_response_le_of_eventually + {Ω : Type*} [MeasurableSpace Ω] {μ : ℕ → Measure Ω} {ν : Measure Ω} + [∀ n, IsFiniteMeasure (μ n)] [IsProbabilityMeasure ν] + (R : Ω → S) (hR : Measurable R) + (h : ∀ s, Tendsto (fun n => μ n (R ⁻¹' {s})) atTop + (nhds (ν (R ⁻¹' {s})))) + (w w' f : S → ℝ) (hw : ∀ s, 0 < w s) (hw' : ∀ s, 0 < w' s) + {d : ℝ} (hresponse : ∀ᶠ n in atTop, + |(∫ ω, w (R ω) * f (R ω) ∂μ n) / (∫ ω, w (R ω) ∂μ n) - + (∫ ω, w' (R ω) * f (R ω) ∂μ n) / (∫ ω, w' (R ω) ∂μ n)| ≤ d) : + |(∫ ω, w (R ω) * f (R ω) ∂ν) / (∫ ω, w (R ω) ∂ν) - + (∫ ω, w' (R ω) * f (R ω) ∂ν) / (∫ ω, w' (R ω) ∂ν)| ≤ d := by + exact le_of_tendsto + (((tendsto_statistic_integral_ratio R hR h w f hw).sub + (tendsto_statistic_integral_ratio R hR h w' f hw')).abs) hresponse + +theorem statistic_integral_ratio_response_le {Ω : Type*} [MeasurableSpace Ω] + {μ : ℕ → Measure Ω} {ν : Measure Ω} + [∀ n, IsFiniteMeasure (μ n)] [IsProbabilityMeasure ν] + (R : Ω → S) (hR : Measurable R) + (h : ∀ s, Tendsto (fun n => μ n (R ⁻¹' {s})) atTop + (nhds (ν (R ⁻¹' {s})))) + (w w' f : S → ℝ) (hw : ∀ s, 0 < w s) (hw' : ∀ s, 0 < w' s) + {d : ℝ} (hresponse : ∀ n, + |(∫ ω, w (R ω) * f (R ω) ∂μ n) / (∫ ω, w (R ω) ∂μ n) - + (∫ ω, w' (R ω) * f (R ω) ∂μ n) / (∫ ω, w' (R ω) ∂μ n)| ≤ d) : + |(∫ ω, w (R ω) * f (R ω) ∂ν) / (∫ ω, w (R ω) ∂ν) - + (∫ ω, w' (R ω) * f (R ω) ∂ν) / (∫ ω, w' (R ω) ∂ν)| ≤ d := by + exact le_of_tendsto + (((tendsto_statistic_integral_ratio R hR h w f hw).sub + (tendsto_statistic_integral_ratio R hR h w' f hw')).abs) + (Eventually.of_forall hresponse) + +end FiniteTiltLimit +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteUSTIntegrals.lean b/lean/OAI/Probability/SpanningForest/FiniteUSTIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f67801850901539dfc5267055909d355d7e5af1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteUSTIntegrals.lean @@ -0,0 +1,86 @@ +import OAI.Probability.SpanningForest.FiniteUSTMeasure + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators ENNReal Classical + +namespace Problem336 + +lemma finiteUSTMeasure_ae_treeOn (K : FiniteSubgraphCode) : + ∀ᵐ X ∂finiteUSTMeasure K, + ∃ T, TreeOn K T ∧ finiteTreeConfiguration T = X := by + filter_upwards [finiteUSTMeasure_concentrated K] with X hX + obtain ⟨T, hT, rfl⟩ := hX + refine ⟨T, ?_, rfl⟩ + exact (Finset.mem_filter.mp hT).2 + +lemma lintegral_finiteUSTMeasure (K : FiniteSubgraphCode) + (f : EdgeConfiguration → ℝ≥0∞) : + (∫⁻ X, f X ∂finiteUSTMeasure K) = + (∑ T ∈ spanningTrees K, f (finiteTreeConfiguration T)) / + (↑(spanningTrees K).card : ℝ≥0∞) := by + simp only [finiteUSTMeasure, lintegral_smul_measure, + lintegral_finsetSum_measure, lintegral_dirac, smul_eq_mul, + ENNReal.div_eq_inv_mul] + +lemma integrable_finiteUSTMeasure (K : FiniteSubgraphCode) + (f : EdgeConfiguration → ℝ) : Integrable f (finiteUSTMeasure K) := by + classical + by_cases hK : (spanningTrees K).Nonempty + · unfold finiteUSTMeasure + apply Integrable.smul_measure + (integrable_finsetSum_measure.mpr (fun T _ => integrable_dirac (by simp))) + exact ENNReal.inv_ne_top.mpr (by exact_mod_cast hK.card_pos.ne') + · rw [finiteUSTMeasure_eq_zero K (Finset.not_nonempty_iff_eq_empty.mp hK)] + exact integrable_zero_measure + +lemma integral_finiteUSTMeasure (K : FiniteSubgraphCode) + (f : EdgeConfiguration → ℝ) : + (∫ X, f X ∂finiteUSTMeasure K) = + (∑ T ∈ spanningTrees K, f (finiteTreeConfiguration T)) / + (↑(spanningTrees K).card : ℝ) := by + rw [finiteUSTMeasure, integral_smul_measure, + integral_finsetSum_measure (fun T _ => integrable_dirac (by simp))] + simp only [integral_dirac, ENNReal.toReal_inv, ENNReal.toReal_natCast, + smul_eq_mul, div_eq_mul_inv, mul_comm] + +lemma integral_ratio_finiteUSTMeasure (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) (f g : EdgeConfiguration → ℝ) : + (∫ X, f X ∂finiteUSTMeasure K) / (∫ X, g X ∂finiteUSTMeasure K) = + (∑ T ∈ spanningTrees K, f (finiteTreeConfiguration T)) / + (∑ T ∈ spanningTrees K, g (finiteTreeConfiguration T)) := by + rw [integral_finiteUSTMeasure, integral_finiteUSTMeasure] + exact div_div_div_cancel_right₀ (by exact_mod_cast hK.card_pos.ne') _ _ + +lemma integral_finiteUSTMeasure_pos (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) (f : EdgeConfiguration → ℝ) + (hf : ∀ T ∈ spanningTrees K, 0 < f (finiteTreeConfiguration T)) : + 0 < ∫ X, f X ∂finiteUSTMeasure K := by + rw [integral_finiteUSTMeasure] + exact div_pos (Finset.sum_pos hf hK) (by exact_mod_cast hK.card_pos) + +lemma integral_exp_finiteUSTMeasure_pos (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) (f : EdgeConfiguration → ℝ) : + 0 < ∫ X, Real.exp (f X) ∂finiteUSTMeasure K := + integral_finiteUSTMeasure_pos K hK _ (fun _ _ => Real.exp_pos _) + +lemma measurable_finiteUSTMeasure : Measurable finiteUSTMeasure := + measurable_of_countable _ + +def finiteUSTKernel : ProbabilityTheory.Kernel FiniteSubgraphCode EdgeConfiguration := + ⟨finiteUSTMeasure, measurable_finiteUSTMeasure⟩ + +@[simp] lemma finiteUSTKernel_apply (K : FiniteSubgraphCode) : + finiteUSTKernel K = finiteUSTMeasure K := rfl + +instance finiteUSTKernel_isFiniteKernel : ProbabilityTheory.IsFiniteKernel finiteUSTKernel := + ⟨⟨1, ENNReal.one_lt_top, finiteUSTMeasure_univ_le_one⟩⟩ + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteUSTLimit.lean b/lean/OAI/Probability/SpanningForest/FiniteUSTLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..25e152f773ce7ddb02478b72d18ec35f4525604b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteUSTLimit.lean @@ -0,0 +1,107 @@ +import OAI.Probability.SpanningForest.CylinderLimitMeasure +import OAI.Probability.SpanningForest.BinaryWeakConvergence +import OAI.Probability.SpanningForest.FiniteUSTMeasure +import OAI.Probability.SpanningForest.FUSFLawUnique + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336 + +def finiteUSTProbabilityMeasure (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) : ProbabilityMeasure EdgeConfiguration := + ⟨finiteUSTMeasure K, finiteUSTMeasure_isProbabilityMeasure K hK⟩ + +theorem exists_finiteUST_limit + (H : ℕ → FiniteSubgraphCode) + (hH : ∀ n, (spanningTrees (H n)).Nonempty) + (L : Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hL : ∀ A B, Tendsto (fun n => ustCylinder (H n) A B) atTop (𝓝 (L A B))) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + (∀ A B, (μ : Measure EdgeConfiguration) (edgeCylinder A B) = L A B) ∧ + Tendsto (fun n => finiteUSTProbabilityMeasure (H n) (hH n)) atTop (𝓝 μ) := by + let μn := fun n => finiteUSTProbabilityMeasure (H n) (hH n) + have hsep : ∀ μ ν : ProbabilityMeasure EdgeConfiguration, + (∀ p : Finset EdgeCode × Finset EdgeCode, + (μ : Measure EdgeConfiguration) (edgeCylinder p.1 p.2) = + (ν : Measure EdgeConfiguration) (edgeCylinder p.1 p.2)) → μ = ν := by + intro μ ν h + have : IsProbabilityMeasure (μ : Measure EdgeConfiguration) := μ.property + apply ProbabilityMeasure.toMeasure_injective + exact configurationMeasure_ext fun A B => h (A, B) + obtain ⟨μ, hμ, hweak⟩ := exists_probabilityMeasure_tendsto_of_clopen_limits μn + (fun p : Finset EdgeCode × Finset EdgeCode => edgeCylinder p.1 p.2) + (fun p => isClopen_boolCylinder p.1 p.2) hsep + (fun p => L p.1 p.2) (by + intro p + simpa only [μn, finiteUSTProbabilityMeasure, ProbabilityMeasure.coe_mk, + finiteUSTMeasure_edgeCylinder] using hL p.1 p.2) + exact ⟨μ, fun A B => hμ (A, B), hweak⟩ + +theorem exists_hasFUSFLaw_of_common_cylinder_limits + (G : GraphCode) (H : ℕ → FiniteSubgraphCode) + (hH : IsConnectedExhaustion G H) + (hne : ∀ n, (spanningTrees (H n)).Nonempty) + (L : Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hL : ∀ H' : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H' → + ∀ A B, Tendsto (fun n => ustCylinder (H' n) A B) atTop (𝓝 (L A B))) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := by + obtain ⟨μ, hμ, _⟩ := exists_finiteUST_limit H hne L (hL H hH) + refine ⟨μ, (fun e => measurable_pi_apply e), ?_⟩ + intro H' hH' A B + simpa only [← hμ A B, edgeCylinder, id_eq] using hL H' hH' A B + +theorem finiteUSTMeasure_positiveCylinder (K : FiniteSubgraphCode) + (A : Finset EdgeCode) : + finiteUSTMeasure K {x | ∀ e ∈ A, x e = true} = ustCylinder K A ∅ := by + simpa [edgeCylinder] using finiteUSTMeasure_edgeCylinder K A ∅ + +theorem exists_finiteUST_limit_of_inclusion_limits + (H : ℕ → FiniteSubgraphCode) + (hH : ∀ n, (spanningTrees (H n)).Nonempty) + (L : Finset EdgeCode → ℝ≥0∞) + (hL : ∀ A, Tendsto (fun n => ustCylinder (H n) A ∅) atTop (𝓝 (L A))) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + (∀ A, (μ : Measure EdgeConfiguration) {x | ∀ e ∈ A, x e = true} = L A) ∧ + Tendsto (fun n => finiteUSTProbabilityMeasure (H n) (hH n)) atTop (𝓝 μ) := by + apply BinaryLaw.exists_weakLimit_of_positiveCylinder_limits + (fun n => finiteUSTProbabilityMeasure (H n) (hH n)) L + intro A + simpa only [finiteUSTProbabilityMeasure, ProbabilityMeasure.coe_mk, + finiteUSTMeasure_positiveCylinder] using hL A + +theorem exists_hasFUSFLaw_of_common_inclusion_limits + (G : GraphCode) (H : ℕ → FiniteSubgraphCode) + (hH : IsConnectedExhaustion G H) + (hne : ∀ H' : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H' → + ∀ n, (spanningTrees (H' n)).Nonempty) + (L : Finset EdgeCode → ℝ≥0∞) + (hL : ∀ H' : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H' → + ∀ A, Tendsto (fun n => ustCylinder (H' n) A ∅) atTop (𝓝 (L A))) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := by + obtain ⟨μ, hμ, _⟩ := exists_finiteUST_limit_of_inclusion_limits H (hne H hH) L (hL H hH) + refine ⟨μ, (fun e => measurable_pi_apply e), ?_⟩ + intro H' hH' A B + have hw : Tendsto (fun n => finiteUSTProbabilityMeasure (H' n) (hne H' hH' n)) + atTop (𝓝 μ) := by + apply BinaryLaw.tendsto_iff_positiveCylinders.mpr + intro C + simpa only [finiteUSTProbabilityMeasure, ProbabilityMeasure.coe_mk, + finiteUSTMeasure_positiveCylinder, hμ C] using hL H' hH' C + have hc := BinaryLaw.tendsto_iff_signedCylinders.mp hw A B + change Tendsto (fun n => finiteUSTMeasure (H' n) (edgeCylinder A B)) atTop + (𝓝 ((μ : Measure EdgeConfiguration) (edgeCylinder A B))) at hc + simp only [finiteUSTMeasure_edgeCylinder] at hc + exact hc + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteUSTMeasure.lean b/lean/OAI/Probability/SpanningForest/FiniteUSTMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..e22bd58159398a9f889f0be349eed1bcf8b528da --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteUSTMeasure.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators ENNReal + +namespace Problem336 + +attribute [local instance] Classical.propDecidable + +def finiteTreeConfiguration (T : Finset (ℕ × ℕ)) : EdgeConfiguration := + fun e => decide (e.1 ∈ T) + +def edgeCylinder (A B : Finset EdgeCode) : Set EdgeConfiguration := + {X | (∀ e ∈ A, X e = true) ∧ (∀ e ∈ B, X e = false)} + +lemma measurableSet_edgeCylinder (A B : Finset EdgeCode) : + MeasurableSet (edgeCylinder A B) := by + unfold edgeCylinder + convert (A.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton true)).inter + (B.measurableSet_biInter fun e _ => + (measurable_pi_apply e) (measurableSet_singleton false)) using 1 + ext X + simp + +def finiteUSTMeasure (K : FiniteSubgraphCode) : Measure EdgeConfiguration := + (↑(spanningTrees K).card : ℝ≥0∞)⁻¹ • + ∑ T ∈ spanningTrees K, Measure.dirac (finiteTreeConfiguration T) + +lemma finiteUSTMeasure_apply (K : FiniteSubgraphCode) + (s : Set EdgeConfiguration) (hs : MeasurableSet s) : + finiteUSTMeasure K s = + (↑((spanningTrees K).filter (fun T => finiteTreeConfiguration T ∈ s)).card : ℝ≥0∞) / + (↑(spanningTrees K).card : ℝ≥0∞) := by + classical + simp only [finiteUSTMeasure, Measure.smul_apply, smul_eq_mul, + Measure.finsetSum_apply, Measure.dirac_apply' _ hs, Set.indicator_apply, + Pi.one_apply] + rw [ENNReal.div_eq_inv_mul] + congr 1 + simp + +lemma finiteUSTMeasure_edgeCylinder (K : FiniteSubgraphCode) (A B : Finset EdgeCode) : + finiteUSTMeasure K (edgeCylinder A B) = ustCylinder K A B := by + classical + rw [finiteUSTMeasure_apply K _ (measurableSet_edgeCylinder A B)] + simp only [ustCylinder, edgeCylinder, Set.mem_ofPred_eq, finiteTreeConfiguration, + decide_eq_true_eq, decide_eq_false_iff_not] + congr 2 + apply congrArg Finset.card + ext T + simp + +lemma finiteUSTMeasure_isProbabilityMeasure (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) : IsProbabilityMeasure (finiteUSTMeasure K) := by + constructor + rw [finiteUSTMeasure_apply K Set.univ MeasurableSet.univ] + simp only [Set.mem_univ, Finset.filter_true] + exact ENNReal.div_self (by exact_mod_cast Finset.card_ne_zero.mpr hK) (by simp) + +lemma finiteUSTMeasure_eq_zero (K : FiniteSubgraphCode) + (hK : spanningTrees K = ∅) : finiteUSTMeasure K = 0 := by + simp [finiteUSTMeasure, hK] + +lemma finiteUSTMeasure_univ_le_one (K : FiniteSubgraphCode) : + finiteUSTMeasure K Set.univ ≤ 1 := by + classical + by_cases hK : (spanningTrees K).Nonempty + · let := finiteUSTMeasure_isProbabilityMeasure K hK + simp + · rw [finiteUSTMeasure_eq_zero K (Finset.not_nonempty_iff_eq_empty.mp hK)] + simp + +instance finiteUSTMeasure_isFiniteMeasure (K : FiniteSubgraphCode) : + IsFiniteMeasure (finiteUSTMeasure K) := + ⟨lt_of_le_of_lt (finiteUSTMeasure_univ_le_one K) ENNReal.one_lt_top⟩ + +lemma finiteUSTMeasure_concentrated (K : FiniteSubgraphCode) : + ∀ᵐ X ∂finiteUSTMeasure K, + ∃ T ∈ spanningTrees K, finiteTreeConfiguration T = X := by + classical + rw [ae_iff] + let S : Finset EdgeConfiguration := (spanningTrees K).image finiteTreeConfiguration + have hS : MeasurableSet (S : Set EdgeConfiguration) := S.finite_toSet.measurableSet + have hset : {X | ¬ ∃ T ∈ spanningTrees K, finiteTreeConfiguration T = X} = + (S : Set EdgeConfiguration)ᶜ := by + ext X + simp [S] + rw [hset, finiteUSTMeasure_apply K _ hS.compl] + simp + intro T hT + exact Finset.mem_image.mpr ⟨T, hT, rfl⟩ + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteUSTProbability.lean b/lean/OAI/Probability/SpanningForest/FiniteUSTProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..02000a9a603a5f59b70ff355e09e1c241903b509 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteUSTProbability.lean @@ -0,0 +1,23 @@ +import OAI.Probability.SpanningForest.FiniteUSTIntegrals + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def finiteUSTProbability (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) : ProbabilityMeasure EdgeConfiguration := + ⟨finiteUSTMeasure K, finiteUSTMeasure_isProbabilityMeasure K hK⟩ + +@[simp] lemma finiteUSTProbability_toMeasure (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) : + (finiteUSTProbability K hK : Measure EdgeConfiguration) = finiteUSTMeasure K := rfl + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FiniteUSTRelabel.lean b/lean/OAI/Probability/SpanningForest/FiniteUSTRelabel.lean new file mode 100644 index 0000000000000000000000000000000000000000..82ded8f704e021f8042659d0fa53ec598c724046 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FiniteUSTRelabel.lean @@ -0,0 +1,314 @@ +import OAI.Probability.SpanningForest.EdgeAction + +namespace OAI + +noncomputable section +open scoped ENNReal + +namespace Problem336 + +def relabelPair (σ : Equiv ℕ ℕ) (p : ℕ × ℕ) : ℕ × ℕ := + rawPair (σ p.1) (σ p.2) + +def relabelEdgeSet (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) : Finset (ℕ × ℕ) := + T.image (relabelPair σ) + +def relabelFiniteSubgraph (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) : + FiniteSubgraphCode := + (K.1.image σ, relabelEdgeSet σ K.2) + +@[simp] theorem relabelPair_rawPair (σ : Equiv ℕ ℕ) (u v : ℕ) : + relabelPair σ (rawPair u v) = rawPair (σ u) (σ v) := by + unfold relabelPair + by_cases h : u < v + · rw [rawPair_of_lt h] + · have hraw : rawPair u v = (v, u) := by simp [rawPair, h] + rw [hraw] + exact rawPair_comm _ _ + +@[simp] theorem relabelPair_edge (σ : Equiv ℕ ℕ) (e : EdgeCode) : + relabelPair σ e.val = (mapEdge σ e).val := by + simp [relabelPair, mapEdge] + +@[simp] theorem relabelPair_symm (σ : Equiv ℕ ℕ) {p : ℕ × ℕ} + (hp : p.1 < p.2) : + relabelPair σ.symm (relabelPair σ p) = p := by + have h := congrArg Subtype.val (mapEdge_symm_apply σ ⟨p, hp⟩) + simpa only [← relabelPair_edge] using h + +theorem relabelPair_injOn (σ : Equiv ℕ ℕ) : + Set.InjOn (relabelPair σ) {p : ℕ × ℕ | p.1 < p.2} := by + intro p hp q hq h + have h' := congrArg (relabelPair σ.symm) h + simpa only [relabelPair_symm σ hp, relabelPair_symm σ hq] using h' + +theorem relabelEdgeSet_card (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) + (hT : ∀ p ∈ T, p.1 < p.2) : + (relabelEdgeSet σ T).card = T.card := by + apply Finset.card_image_iff.mpr + intro p hp q hq h + exact relabelPair_injOn σ (hT p hp) (hT q hq) h + +@[simp] theorem relabelEdgeSet_symm (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) + (hT : ∀ p ∈ T, p.1 < p.2) : + relabelEdgeSet σ.symm (relabelEdgeSet σ T) = T := by + unfold relabelEdgeSet + rw [Finset.image_image] + calc + T.image (fun p => relabelPair σ.symm (relabelPair σ p)) = T.image id := by + apply Finset.image_congr + intro p hp + exact relabelPair_symm σ (hT p hp) + _ = T := Finset.image_id + +theorem relabelEdgeSet_valid (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) + (hT : ∀ p ∈ T, p.1 < p.2) : + ∀ p ∈ relabelEdgeSet σ T, p.1 < p.2 := by + intro p hp + obtain ⟨q, hq, rfl⟩ := Finset.mem_image.mp hp + have h := (mapEdge σ ⟨q, hT q hq⟩).property + simpa only [← relabelPair_edge] using h + +theorem treeAdj_relabelEdgeSet (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) + (hT : ∀ p ∈ T, p.1 < p.2) (u v : ℕ) : + TreeAdj (relabelEdgeSet σ T) (σ u) (σ v) ↔ TreeAdj T u v := by + constructor + · intro h + obtain ⟨p, hp, heq⟩ := Finset.mem_image.mp h + have hback := congrArg (relabelPair σ.symm) heq + have hpraw : p = rawPair u v := by + simpa only [relabelPair_symm σ (hT p hp), relabelPair_rawPair, + Equiv.symm_apply_apply] using hback + simpa only [TreeAdj, ← hpraw] using hp + · intro h + apply Finset.mem_image.mpr + exact ⟨rawPair u v, h, relabelPair_rawPair σ u v⟩ + +theorem treeOn_relabel (σ : Equiv ℕ ℕ) {K : FiniteSubgraphCode} + (hK : ∀ p ∈ K.2, p.1 < p.2) {T : Finset (ℕ × ℕ)} + (hT : TreeOn K T) : + TreeOn (relabelFiniteSubgraph σ K) (relabelEdgeSet σ T) := by + have hTv : ∀ p ∈ T, p.1 < p.2 := fun p hp => hK p (hT.1 hp) + refine ⟨Finset.image_subset_image hT.1, ?_, ?_⟩ + · change (relabelEdgeSet σ T).card + 1 = (K.1.image σ).card + rw [relabelEdgeSet_card σ T hTv, Finset.card_image_of_injective _ σ.injective] + exact hT.2.1 + · intro u hu v hv + obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hu + obtain ⟨b, hb, rfl⟩ := Finset.mem_image.mp hv + have hpath := hT.2.2 a ha b hb + clear ha hb hu hv + induction hpath with + | refl => exact Relation.ReflTransGen.refl + | @tail b c hab hbc ih => + exact ih.tail ((treeAdj_relabelEdgeSet σ T hTv b c).mpr hbc) + +@[simp] theorem relabelFiniteSubgraph_symm (σ : Equiv ℕ ℕ) + (K : FiniteSubgraphCode) (hK : ∀ p ∈ K.2, p.1 < p.2) : + relabelFiniteSubgraph σ.symm (relabelFiniteSubgraph σ K) = K := by + apply Prod.ext + · simp [relabelFiniteSubgraph, Finset.image_image] + · exact relabelEdgeSet_symm σ K.2 hK + +theorem treeOn_relabel_iff (σ : Equiv ℕ ℕ) {K : FiniteSubgraphCode} + (hK : ∀ p ∈ K.2, p.1 < p.2) {T : Finset (ℕ × ℕ)} + (hT : ∀ p ∈ T, p.1 < p.2) : + TreeOn (relabelFiniteSubgraph σ K) (relabelEdgeSet σ T) ↔ TreeOn K T := by + constructor + · intro h + have hback := treeOn_relabel σ.symm (relabelEdgeSet_valid σ K.2 hK) h + simpa only [relabelFiniteSubgraph_symm σ K hK, relabelEdgeSet_symm σ T hT] + using hback + · exact treeOn_relabel σ hK + +private theorem treeOn_of_mem_spanningTrees {K : FiniteSubgraphCode} + {T : Finset (ℕ × ℕ)} (h : T ∈ spanningTrees K) : TreeOn K T := by + classical + exact (Finset.mem_filter.mp h).2 + +private theorem mem_spanningTrees_of_treeOn {K : FiniteSubgraphCode} + {T : Finset (ℕ × ℕ)} (h : TreeOn K T) : T ∈ spanningTrees K := by + simp only [spanningTrees, Finset.mem_filter, Finset.mem_powerset] + exact ⟨h.1, h⟩ + +theorem spanningTrees_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) : + spanningTrees (relabelFiniteSubgraph σ K) = + (spanningTrees K).image (relabelEdgeSet σ) := by + ext T + constructor + · intro h + have hT := treeOn_of_mem_spanningTrees h + have hKv := relabelEdgeSet_valid σ K.2 hK + have hTv : ∀ p ∈ T, p.1 < p.2 := fun p hp => hKv p (hT.1 hp) + refine Finset.mem_image.mpr ⟨relabelEdgeSet σ.symm T, ?_, ?_⟩ + · apply mem_spanningTrees_of_treeOn + have hback := treeOn_relabel σ.symm hKv hT + simpa only [relabelFiniteSubgraph_symm σ K hK] using hback + · simpa only [Equiv.symm_symm] using relabelEdgeSet_symm σ.symm T hTv + · intro h + obtain ⟨S, hS, rfl⟩ := Finset.mem_image.mp h + exact mem_spanningTrees_of_treeOn (treeOn_relabel σ hK (treeOn_of_mem_spanningTrees hS)) + +private theorem relabelEdgeSet_injOn_spanningTrees (σ : Equiv ℕ ℕ) + (K : FiniteSubgraphCode) (hK : ∀ p ∈ K.2, p.1 < p.2) : + Set.InjOn (relabelEdgeSet σ) (spanningTrees K) := by + intro T hT S hS h + have hTv : ∀ p ∈ T, p.1 < p.2 := + fun p hp => hK p ((treeOn_of_mem_spanningTrees hT).1 hp) + have hSv : ∀ p ∈ S, p.1 < p.2 := + fun p hp => hK p ((treeOn_of_mem_spanningTrees hS).1 hp) + have hback := congrArg (relabelEdgeSet σ.symm) h + simpa only [relabelEdgeSet_symm σ T hTv, relabelEdgeSet_symm σ S hSv] using hback + +theorem spanningTrees_card_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) : + (spanningTrees (relabelFiniteSubgraph σ K)).card = (spanningTrees K).card := by + rw [spanningTrees_relabel σ K hK] + exact Finset.card_image_iff.mpr (relabelEdgeSet_injOn_spanningTrees σ K hK) + +theorem mem_relabelEdgeSet_iff (σ : Equiv ℕ ℕ) (T : Finset (ℕ × ℕ)) + (hT : ∀ p ∈ T, p.1 < p.2) (e : EdgeCode) : + (mapEdge σ e).val ∈ relabelEdgeSet σ T ↔ e.val ∈ T := by + simpa only [TreeAdj, mapEdge, mkEdge_val, rawPair_of_lt e.property] using + treeAdj_relabelEdgeSet σ T hT e.val.1 e.val.2 + +theorem ustCylinder_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (A B : Finset EdgeCode) : + ustCylinder (relabelFiniteSubgraph σ K) + (A.image (mapEdge σ)) (B.image (mapEdge σ)) = ustCylinder K A B := by + classical + let good := (spanningTrees K).filter (fun T => + (∀ e ∈ A, e.val ∈ T) ∧ (∀ e ∈ B, e.val ∉ T)) + have hgood : (spanningTrees (relabelFiniteSubgraph σ K)).filter (fun T => + (∀ e ∈ A.image (mapEdge σ), e.val ∈ T) ∧ + (∀ e ∈ B.image (mapEdge σ), e.val ∉ T)) = + good.image (relabelEdgeSet σ) := by + rw [spanningTrees_relabel σ K hK] + ext T + simp only [good, Finset.mem_filter, Finset.mem_image] + constructor + · rintro ⟨⟨S, hS, rfl⟩, hyes, hno⟩ + have hSv : ∀ p ∈ S, p.1 < p.2 := + fun p hp => hK p ((treeOn_of_mem_spanningTrees hS).1 hp) + refine ⟨S, ⟨hS, ?_⟩, rfl⟩ + constructor + · intro e he + exact (mem_relabelEdgeSet_iff σ S hSv e).mp (hyes _ ⟨e, he, rfl⟩) + · intro e he hin + exact hno _ ⟨e, he, rfl⟩ ((mem_relabelEdgeSet_iff σ S hSv e).mpr hin) + · rintro ⟨S, ⟨hS, hyes, hno⟩, rfl⟩ + have hSv : ∀ p ∈ S, p.1 < p.2 := + fun p hp => hK p ((treeOn_of_mem_spanningTrees hS).1 hp) + refine ⟨⟨S, hS, rfl⟩, ?_⟩ + constructor + · rintro e ⟨a, ha, rfl⟩ + exact (mem_relabelEdgeSet_iff σ S hSv a).mpr (hyes a ha) + · rintro e ⟨a, ha, rfl⟩ hin + exact hno a ha ((mem_relabelEdgeSet_iff σ S hSv a).mp hin) + have hcard : (good.image (relabelEdgeSet σ)).card = good.card := by + apply Finset.card_image_iff.mpr + intro T hT S hS h + change T ∈ good at hT + change S ∈ good at hS + simp only [good, Finset.mem_filter] at hT hS + exact relabelEdgeSet_injOn_spanningTrees σ K hK hT.1 hS.1 h + unfold ustCylinder + dsimp only + rw [hgood, hcard, spanningTrees_card_relabel σ K hK] + +theorem IsFiniteConnectedSubgraph.relabel {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (σ : Equiv ℕ ℕ) : + IsFiniteConnectedSubgraph (relabelGraph σ G) (relabelFiniteSubgraph σ K) := by + have hKv : ∀ p ∈ K.2, p.1 < p.2 := fun p hp => (hK.2.1 p hp).2.2.1 + refine ⟨hK.1.image σ, ?_, ?_⟩ + · intro p hp + obtain ⟨q, hq, rfl⟩ := Finset.mem_image.mp hp + obtain ⟨hqu, hqv, hqlt, hqa⟩ := hK.2.1 q hq + have hqua : Adj G q.2 q.1 := by + unfold Adj at * + rw [G.2.2 q.2 q.1] + exact hqa + have hne : σ q.1 ≠ σ q.2 := fun h => Nat.ne_of_lt hqlt (σ.injective h) + by_cases hlt : σ q.1 < σ q.2 + · simp only [relabelPair, rawPair, hlt, ite_true] + exact ⟨Finset.mem_image_of_mem σ hqu, Finset.mem_image_of_mem σ hqv, + True.intro, by simpa [Adj, relabelGraph] using hqa⟩ + · have hgt : σ q.2 < σ q.1 := by omega + simp only [relabelPair, rawPair, hlt, ite_false] + exact ⟨Finset.mem_image_of_mem σ hqv, Finset.mem_image_of_mem σ hqu, + hgt, by simpa [Adj, relabelGraph] using hqua⟩ + · intro u hu v hv + obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hu + obtain ⟨b, hb, rfl⟩ := Finset.mem_image.mp hv + have hpath := hK.2.2 a ha b hb + clear ha hb hu hv + induction hpath with + | refl => exact Relation.ReflTransGen.refl + | @tail b c hab hbc ih => + apply ih.tail + refine ⟨Finset.mem_image_of_mem σ hbc.1, + Finset.mem_image_of_mem σ hbc.2.1, ?_⟩ + exact (treeAdj_relabelEdgeSet σ K.2 hKv b c).mpr hbc.2.2 + +theorem IsFiniteConnectedSubgraph.ustCylinder_relabel {G : GraphCode} + {K : FiniteSubgraphCode} (hK : IsFiniteConnectedSubgraph G K) + (σ : Equiv ℕ ℕ) (A B : Finset EdgeCode) : + ustCylinder (relabelFiniteSubgraph σ K) + (A.image (mapEdge σ)) (B.image (mapEdge σ)) = ustCylinder K A B := + Problem336.ustCylinder_relabel σ K (fun p hp => (hK.2.1 p hp).2.2.1) A B + +theorem IsConnectedExhaustion.relabel {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) + (σ : Equiv ℕ ℕ) : + IsConnectedExhaustion (relabelGraph σ G) + (fun n => relabelFiniteSubgraph σ (H n)) := by + refine ⟨fun n => (hH.1 n).relabel σ, ?_, ?_⟩ + · intro n + exact ⟨Finset.image_subset_image (hH.2.1 n).1, + Finset.image_subset_image (hH.2.1 n).2⟩ + · intro u v huv hadj + have hadj' : Adj G (σ.symm u) (σ.symm v) := hadj + have hne : σ.symm u ≠ σ.symm v := fun h => Nat.ne_of_lt huv (σ.symm.injective h) + by_cases hlt : σ.symm u < σ.symm v + · obtain ⟨n, hn⟩ := hH.2.2 _ _ hlt hadj' + refine ⟨n, Finset.mem_image.mpr ⟨(σ.symm u, σ.symm v), hn, ?_⟩⟩ + simp [relabelPair, rawPair_of_lt huv] + · have hgt : σ.symm v < σ.symm u := by omega + have hadj'' : Adj G (σ.symm v) (σ.symm u) := by + unfold Adj at * + rw [G.2.2 (σ.symm v) (σ.symm u)] + exact hadj' + obtain ⟨n, hn⟩ := hH.2.2 _ _ hgt hadj'' + refine ⟨n, Finset.mem_image.mpr ⟨(σ.symm v, σ.symm u), hn, ?_⟩⟩ + simp only [relabelPair, Equiv.apply_symm_apply] + rw [rawPair_comm, rawPair_of_lt huv] + +theorem HasFUSFLaw.relabel {Ω : Type} [MeasurableSpace Ω] + {G : GraphCode} {P : MeasureTheory.Measure Ω} {X : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) (σ : Equiv ℕ ℕ) : + HasFUSFLaw (relabelGraph σ G) P + (fun ω e => X ω (mapEdge σ.symm e)) := by + refine ⟨fun e => hX.1 (mapEdge σ.symm e), ?_⟩ + intro H hH A B + have hG : relabelGraph σ.symm (relabelGraph σ G) = G := by + apply Subtype.ext + funext u v + simp [relabelGraph] + have hHback : IsConnectedExhaustion G + (fun n => relabelFiniteSubgraph σ.symm (H n)) := by + simpa only [hG] using hH.relabel σ.symm + have hlim := hX.2 _ hHback (A.image (mapEdge σ.symm)) (B.image (mapEdge σ.symm)) + have hcyl : (fun n => ustCylinder (relabelFiniteSubgraph σ.symm (H n)) + (A.image (mapEdge σ.symm)) (B.image (mapEdge σ.symm))) = + (fun n => ustCylinder (H n) A B) := by + funext n + exact (hH.1 n).ustCylinder_relabel σ.symm A B + rw [hcyl] at hlim + simpa only [Finset.forall_mem_image] using hlim + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/FullObservationPosterior.lean b/lean/OAI/Probability/SpanningForest/FullObservationPosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b6cb75d5918f159f94708f8af060ba9103f8585 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/FullObservationPosterior.lean @@ -0,0 +1,42 @@ +import OAI.Probability.SpanningForest.PosteriorIndependentExtension +import OAI.Probability.SpanningForest.BrownianBridge + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal ProbabilityTheory + +namespace Problem336.Observation + +theorem condExp_brownian_history_eq_endpoint + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (B : ℝ≥0 → Ω → ℝ) (hB : IsPreBrownianReal B P) + (hBm : ∀ s, Measurable (B s)) (X : Ω → ℝ) (hX : Measurable X) + (hXB : IndepFun X (fun ω s => B s ω) P) + (t : ℝ≥0) (ht : t ≠ 0) + (g : ℝ → ℝ) (hg : Measurable g) (hgi : Integrable (fun ω => g (X ω)) P) : + P[fun ω => g (X ω) | + MeasurableSpace.comap (fun ω (s : Set.Iic t) => + (s : ℝ) * X ω + B s ω) inferInstance] =ᵐ[P] + P[fun ω => g (X ω) | + MeasurableSpace.comap (fun ω => (t : ℝ) * X ω + B t ω) inferInstance] := by + rw [BrownianBridge.history_comap_eq_endpoint_residual + (fun r ω => (r : ℝ) * X ω + B r ω) t] + simp_rw [BrownianBridge.residual_add_linear X t _ ht] + have hbridge : Measurable + (fun ω (s : Set.Iic t) => BrownianBridge.residual B t s ω) := by + apply Measurable.of_eval + intro s + exact (hBm s).sub ((hBm t).const_mul _) + exact condExp_pair_of_indep P X (fun ω => (t : ℝ) * X ω + B t ω) + (fun ω (s : Set.Iic t) => BrownianBridge.residual B t s ω) + hX ((hX.const_mul _).add (hBm t)) hbridge g hg hgi + (BrownianBridge.indepFun_residual_hidden_endpoint hB hBm hX hXB t ht).symm + +end Problem336.Observation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianBoundedCorrection.lean b/lean/OAI/Probability/SpanningForest/GaussianBoundedCorrection.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d9e64b88502436f2176dc0ed41ce000c1b0abe6 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianBoundedCorrection.lean @@ -0,0 +1,183 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal +open scoped BigOperators + +namespace Problem336.GaussianBoundedCorrection + +theorem abs_sq_add_sub_sq_le (x r a : ℝ) (_ha : 0 ≤ a) (hr : |r| ≤ a) : + |(x + r) ^ 2 - x ^ 2| ≤ 2 * a * |x| + a ^ 2 := by + calc + |(x + r) ^ 2 - x ^ 2| = |2 * x * r + r ^ 2| := by congr 1; ring + _ ≤ |2 * x * r| + |r ^ 2| := abs_add_le _ _ + _ = 2 * |x| * |r| + |r| ^ 2 := by simp [abs_mul, abs_pow] + _ ≤ 2 * |x| * a + a ^ 2 := by gcongr + _ = 2 * a * |x| + a ^ 2 := by ring + +theorem abs_add_cube_le (x r a : ℝ) (ha : 0 ≤ a) (hr : |r| ≤ a) : + |x + r| ^ 3 ≤ 4 * (|x| ^ 3 + a ^ 3) := by + have habs : |x + r| ≤ |x| + a := (abs_add_le x r).trans (add_le_add le_rfl hr) + have hcube : |x + r| ^ 3 ≤ (|x| + a) ^ 3 := by gcongr + have hprod : 0 ≤ (|x| + a) * (|x| - a) ^ 2 := + mul_nonneg (add_nonneg (abs_nonneg x) ha) (sq_nonneg _) + nlinarith + +theorem sq_add_le (x r a : ℝ) (_ha : 0 ≤ a) (hr : |r| ≤ a) : + (x + r) ^ 2 ≤ 2 * (x ^ 2 + a ^ 2) := by + have habs : |x + r| ≤ |x| + a := (abs_add_le x r).trans (add_le_add le_rfl hr) + have hsq : |x + r| ^ 2 ≤ (|x| + a) ^ 2 := by gcongr + have hgap := sq_nonneg (|x| - a) + simp only [sq_abs] at hsq hgap + nlinarith [sq_abs x] + +section Integral + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] + +theorem integrable_sq_add_of_bounded {Q R : Ω → ℝ} {a : ℝ} + (hQ : AEStronglyMeasurable Q μ) (hQ2 : Integrable (fun ω => Q ω ^ 2) μ) + (hR : AEStronglyMeasurable R μ) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + Integrable (fun ω => (Q ω + R ω) ^ 2) μ := by + apply ((hQ2.add (integrable_const (a ^ 2))).const_mul 2).mono' + ((hQ.add hR).pow 2) + filter_upwards [hbound] with ω hω + change |(Q ω + R ω) ^ 2| ≤ 2 * (Q ω ^ 2 + a ^ 2) + rw [abs_of_nonneg (sq_nonneg _)] + exact sq_add_le (Q ω) (R ω) a ha hω + +theorem abs_integral_sq_add_sub_sq_le {Q R : Ω → ℝ} {a : ℝ} + (hQ : Integrable Q μ) (hQ2 : Integrable (fun ω => Q ω ^ 2) μ) + (hR : AEStronglyMeasurable R μ) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + |(∫ ω, (Q ω + R ω) ^ 2 ∂μ) - ∫ ω, Q ω ^ 2 ∂μ| ≤ + 2 * a * (∫ ω, |Q ω| ∂μ) + μ.real Set.univ * a ^ 2 := by + have hD2 := integrable_sq_add_of_bounded hQ.aestronglyMeasurable hQ2 hR ha hbound + have hdom : Integrable (fun ω => 2 * a * |Q ω| + a ^ 2) μ := + (hQ.abs.const_mul (2 * a)).add (integrable_const _) + calc + |(∫ ω, (Q ω + R ω) ^ 2 ∂μ) - ∫ ω, Q ω ^ 2 ∂μ| = + |∫ ω, (Q ω + R ω) ^ 2 - Q ω ^ 2 ∂μ| := by rw [integral_sub hD2 hQ2] + _ ≤ ∫ ω, |(Q ω + R ω) ^ 2 - Q ω ^ 2| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ ω, 2 * a * |Q ω| + a ^ 2 ∂μ := by + apply integral_mono_ae (hD2.sub hQ2).abs hdom + filter_upwards [hbound] with ω hω + exact abs_sq_add_sub_sq_le (Q ω) (R ω) a ha hω + _ = 2 * a * (∫ ω, |Q ω| ∂μ) + μ.real Set.univ * a ^ 2 := by + rw [integral_add (hQ.abs.const_mul _) (integrable_const _), + integral_const_mul, integral_const] + rfl + +theorem integrable_abs_cube_add_of_bounded {Q R : Ω → ℝ} {a : ℝ} + (hQ : AEStronglyMeasurable Q μ) (hQ3 : Integrable (fun ω => |Q ω| ^ 3) μ) + (hR : AEStronglyMeasurable R μ) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + Integrable (fun ω => |Q ω + R ω| ^ 3) μ := by + have hm : AEStronglyMeasurable (fun ω => |Q ω + R ω| ^ 3) μ := by + exact (continuous_abs.pow 3).comp_aestronglyMeasurable (hQ.add hR) + apply ((hQ3.add (integrable_const (a ^ 3))).const_mul 4).mono' hm + filter_upwards [hbound] with ω hω + change |(|Q ω + R ω| ^ 3)| ≤ 4 * (|Q ω| ^ 3 + a ^ 3) + rw [abs_of_nonneg (pow_nonneg (abs_nonneg _) 3)] + exact abs_add_cube_le (Q ω) (R ω) a ha hω + +theorem integral_abs_cube_add_le {Q R : Ω → ℝ} {a : ℝ} + (hQ : AEStronglyMeasurable Q μ) (hQ3 : Integrable (fun ω => |Q ω| ^ 3) μ) + (hR : AEStronglyMeasurable R μ) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + (∫ ω, |Q ω + R ω| ^ 3 ∂μ) ≤ + 4 * ((∫ ω, |Q ω| ^ 3 ∂μ) + μ.real Set.univ * a ^ 3) := by + calc + (∫ ω, |Q ω + R ω| ^ 3 ∂μ) ≤ ∫ ω, 4 * (|Q ω| ^ 3 + a ^ 3) ∂μ := by + apply integral_mono_ae (integrable_abs_cube_add_of_bounded hQ hQ3 hR ha hbound) + ((hQ3.add (integrable_const _)).const_mul _) + filter_upwards [hbound] with ω hω + exact abs_add_cube_le (Q ω) (R ω) a ha hω + _ = 4 * ((∫ ω, |Q ω| ^ 3 ∂μ) + μ.real Set.univ * a ^ 3) := by + rw [integral_const_mul, integral_add hQ3 (integrable_const _), integral_const] + rfl + +end Integral + +def standardGaussianAbsMoment (k : ℕ) : ℝ := + ∫ x : ℝ, |x| ^ k ∂gaussianReal 0 1 + +theorem standardGaussianAbsMoment_nonneg (k : ℕ) : + 0 ≤ standardGaussianAbsMoment k := + integral_nonneg (fun x => pow_nonneg (abs_nonneg x) k) + +theorem gaussian_abs_moment (v : ℝ≥0) (k : ℕ) : + (∫ x : ℝ, |x| ^ k ∂gaussianReal 0 v) = + Real.sqrt v ^ k * standardGaussianAbsMoment k := by + have hs : (⟨Real.sqrt v ^ 2, sq_nonneg _⟩ : ℝ≥0) = v := + NNReal.eq (Real.sq_sqrt v.property) + have hscale : (gaussianReal 0 1).map (fun x : ℝ => Real.sqrt v * x) = + gaussianReal 0 v := by + rw [gaussianReal_map_const_mul, mul_zero, mul_one] + congr 1 + rw [← hscale, integral_map (by fun_prop) (by fun_prop)] + simp_rw [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _), mul_pow] + exact integral_const_mul _ _ + +theorem hasLaw_gaussian_abs_moment {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {Q : Ω → ℝ} {v : ℝ≥0} + (hQ : HasLaw Q (gaussianReal 0 v) P) (k : ℕ) : + (∫ ω, |Q ω| ^ k ∂P) = Real.sqrt v ^ k * standardGaussianAbsMoment k := by + calc + (∫ ω, |Q ω| ^ k ∂P) = ∫ x : ℝ, |x| ^ k ∂gaussianReal 0 v := by + exact hQ.integral_comp (f := fun x : ℝ => |x| ^ k) (by fun_prop) + _ = _ := gaussian_abs_moment v k + +theorem hasLaw_gaussian_integral_sq {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {Q : Ω → ℝ} {v : ℝ≥0} + (hQ : HasLaw Q (gaussianReal 0 v) P) : + (∫ ω, Q ω ^ 2 ∂P) = v := by + have hm : (∫ ω, Q ω ∂P) = 0 := by + rw [hQ.integral_eq, integral_id_gaussianReal] + have hv := hQ.variance_eq + rw [variance_eq_integral hQ.aemeasurable, hm] at hv + simpa only [sub_zero, variance_id_gaussianReal] using hv + +theorem gaussian_bounded_correction_second_moment + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {Q R : Ω → ℝ} {v : ℝ≥0} {a : ℝ} + (hQ : HasLaw Q (gaussianReal 0 v) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ a) : + |(∫ ω, (Q ω + R ω) ^ 2 ∂P) - v| ≤ + 2 * a * Real.sqrt v * standardGaussianAbsMoment 1 + a ^ 2 := by + let : IsProbabilityMeasure P := hQ.isProbabilityMeasure + have hint := hQ.hasGaussianLaw.integrable + have hQ2 : Integrable (fun ω => Q ω ^ 2) P := + (memLp_two_iff_integrable_sq hint.aestronglyMeasurable).mp hQ.hasGaussianLaw.memLp_two + have h := abs_integral_sq_add_sub_sq_le hint hQ2 hR ha hbound + rw [hasLaw_gaussian_integral_sq hQ] at h + have hfirst : (∫ ω, |Q ω| ∂P) = Real.sqrt v * standardGaussianAbsMoment 1 := by + simpa only [pow_one] using hasLaw_gaussian_abs_moment hQ 1 + simpa only [hfirst, probReal_univ, one_mul, mul_assoc] using h + +theorem gaussian_bounded_correction_third_moment + {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {Q R : Ω → ℝ} {v : ℝ≥0} {a : ℝ} + (hQ : HasLaw Q (gaussianReal 0 v) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hbound : ∀ᵐ ω ∂P, |R ω| ≤ a) : + (∫ ω, |Q ω + R ω| ^ 3 ∂P) ≤ + 4 * (Real.sqrt v ^ 3 * standardGaussianAbsMoment 3 + a ^ 3) := by + let : IsProbabilityMeasure P := hQ.isProbabilityMeasure + have hQ3 : Integrable (fun ω => |Q ω| ^ 3) P := by + simpa only [Real.norm_eq_abs] using + (hQ.hasGaussianLaw.memLp (p := 3) (by norm_num)).integrable_norm_pow (by norm_num : 3 ≠ 0) + have h := integral_abs_cube_add_le hQ.aemeasurable.aestronglyMeasurable hQ3 hR ha hbound + simpa only [hasLaw_gaussian_abs_moment hQ 3, probReal_univ, one_mul] using h + +end Problem336.GaussianBoundedCorrection + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianLikelihood.lean b/lean/OAI/Probability/SpanningForest/GaussianLikelihood.lean new file mode 100644 index 0000000000000000000000000000000000000000..02ca391ddea106caeaa8bd816d3cabef8b2d5ea5 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianLikelihood.lean @@ -0,0 +1,91 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal + +namespace Problem336.GaussianObservation + +theorem pdf_binary_shift (v : ℝ≥0) (hv : v ≠ 0) (x y : ℝ) + (hx : x = 0 ∨ x = 1) : + gaussianPDFReal ((v : ℝ) * x) v y = + gaussianPDFReal 0 v y * Real.exp ((y - (v : ℝ) / 2) * x) := by + rcases hx with rfl | rfl + · simp + · have hv' : (v : ℝ) ≠ 0 := by exact_mod_cast hv + have hexp : -(y - (v : ℝ)) ^ 2 / (2 * (v : ℝ)) = + -y ^ 2 / (2 * (v : ℝ)) + (y - (v : ℝ) / 2) := by + field_simp + ring + simp only [mul_one, gaussianPDFReal, sub_zero] + rw [hexp, Real.exp_add] + ring + +theorem pdf_binary_shift_ennreal (v : ℝ≥0) (hv : v ≠ 0) (x y : ℝ) + (hx : x = 0 ∨ x = 1) : + gaussianPDF ((v : ℝ) * x) v y = + gaussianPDF 0 v y * ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x)) := by + simp only [gaussianPDF, pdf_binary_shift v hv x y hx, + ENNReal.ofReal_mul (gaussianPDFReal_nonneg 0 v y)] + +theorem gaussian_binary_shift_withDensity (v : ℝ≥0) (hv : v ≠ 0) (x : ℝ) + (hx : x = 0 ∨ x = 1) : + gaussianReal ((v : ℝ) * x) v = + (gaussianReal 0 v).withDensity + (fun y => ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x))) := by + rw [gaussianReal_of_var_ne_zero _ hv, gaussianReal_of_var_ne_zero _ hv, + ← withDensity_mul volume (measurable_gaussianPDF 0 v) (by fun_prop)] + congr 1 + funext y + exact pdf_binary_shift_ennreal v hv x y hx + +theorem gaussian_binary_shift_withDensity_all (v : ℝ≥0) (x : ℝ) + (hx : x = 0 ∨ x = 1) : + gaussianReal ((v : ℝ) * x) v = + (gaussianReal 0 v).withDensity + (fun y => ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x))) := by + by_cases hv : v = 0 + · subst v + simp [dirac_withDensity] + · exact gaussian_binary_shift_withDensity v hv x hx + +theorem likelihood_lintegral_eq_one (v : ℝ≥0) (hv : v ≠ 0) (x : ℝ) + (hx : x = 0 ∨ x = 1) : + (∫⁻ y, ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x)) + ∂gaussianReal 0 v) = 1 := by + have h := congrArg (fun μ : Measure ℝ => μ Set.univ) + (gaussian_binary_shift_withDensity v hv x hx) + simpa only [measure_univ, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ] using h.symm + +theorem gaussian_binary_shift_absolutelyContinuous (v : ℝ≥0) (hv : v ≠ 0) + (x : ℝ) (hx : x = 0 ∨ x = 1) : + gaussianReal ((v : ℝ) * x) v ≪ gaussianReal 0 v := by + rw [gaussian_binary_shift_withDensity v hv x hx] + exact withDensity_absolutelyContinuous _ _ + +theorem rnDeriv_gaussian_binary_shift (v : ℝ≥0) (hv : v ≠ 0) + (x : ℝ) (hx : x = 0 ∨ x = 1) : + (gaussianReal ((v : ℝ) * x) v).rnDeriv (gaussianReal 0 v) =ᵐ[gaussianReal 0 v] + (fun y => ENNReal.ofReal (Real.exp ((y - (v : ℝ) / 2) * x))) := by + rw [gaussian_binary_shift_withDensity v hv x hx] + exact Measure.rnDeriv_withDensity _ (by fun_prop) + +theorem prod_pdf_binary_shift {ι : Type*} (s : Finset ι) (v : ℝ≥0) + (hv : v ≠ 0) (x y : ι → ℝ) (hx : ∀ i ∈ s, x i = 0 ∨ x i = 1) : + (∏ i ∈ s, gaussianPDFReal ((v : ℝ) * x i) v (y i)) = + (∏ i ∈ s, gaussianPDFReal 0 v (y i)) * + Real.exp (∑ i ∈ s, (y i - (v : ℝ) / 2) * x i) := by + rw [Real.exp_sum, ← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i hi + exact pdf_binary_shift v hv (x i) (y i) (hx i hi) + +end Problem336.GaussianObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianMomentScaling.lean b/lean/OAI/Probability/SpanningForest/GaussianMomentScaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..faedbc8cf0acc4430d07f0d36cd73689890db180 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianMomentScaling.lean @@ -0,0 +1,127 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace Problem336 + +theorem standardGaussian_sqrt_hasLaw (v : ℝ≥0) : + HasLaw (fun z : ℝ => Real.sqrt v * z) (gaussianReal 0 v) (gaussianReal 0 1) := by + have h := gaussianReal_const_mul + (HasLaw.id (μ := gaussianReal 0 1)) (Real.sqrt v) + have hv : (⟨(Real.sqrt (v : ℝ)) ^ 2, sq_nonneg _⟩ : ℝ≥0) = v := by + apply NNReal.coe_injective + exact Real.sq_sqrt v.coe_nonneg + simp only [mul_zero, mul_one, id_eq] at h + convert h using 1 + congr 1 + exact hv.symm + +theorem gaussian_absolute_moment_scaling (v : ℝ≥0) (k : ℕ) : + (∫ z : ℝ, |z| ^ k ∂gaussianReal 0 v) = + (Real.sqrt (v : ℝ)) ^ k * (∫ z : ℝ, |z| ^ k ∂gaussianReal 0 1) := by + rw [← (standardGaussian_sqrt_hasLaw v).integral_comp (f := fun z : ℝ => |z| ^ k) + (by fun_prop)] + simp only [Function.comp_apply, abs_mul, abs_of_nonneg (Real.sqrt_nonneg _), mul_pow] + exact integral_const_mul _ _ + +theorem standardGaussian_absolute_first_moment_le_one : + (∫ z : ℝ, |z| ∂gaussianReal 0 1) ≤ 1 := by + have hint : Integrable (fun z : ℝ => |z|) (gaussianReal 0 1) := + (memLp_id_gaussianReal (μ := 0) (v := 1) 1).integrable (by norm_num) |>.abs + have hsint : Integrable (fun z : ℝ => z ^ 2) (gaussianReal 0 1) := by + simpa only [id_eq, Real.norm_eq_abs, sq_abs] using + (memLp_id_gaussianReal (μ := 0) (v := 1) 2).integrable_norm_pow' (p := 2) + have hsq : (∫ z : ℝ, z ^ 2 ∂gaussianReal 0 1) = 1 := by + have h := variance_id_gaussianReal (μ := 0) (v := 1) + simp only [variance_eq_integral aemeasurable_id, id_eq, integral_id_gaussianReal, sub_zero] at h + simpa only [id_eq, sub_zero, NNReal.coe_one] using h + have hle := integral_mono (hint.const_mul 2) (hsint.add (integrable_const 1)) + (fun z : ℝ => show 2 * |z| ≤ z ^ 2 + 1 by nlinarith [sq_nonneg (|z| - 1), sq_abs z]) + simp only [Pi.add_apply] at hle + rw [integral_const_mul, integral_add hsint (integrable_const 1), hsq, integral_const] at hle + norm_num at hle + linarith + +theorem gaussian_absolute_first_moment_le_sqrt (v : ℝ≥0) : + (∫ z : ℝ, |z| ∂gaussianReal 0 v) ≤ Real.sqrt v := by + have h := gaussian_absolute_moment_scaling v 1 + simp only [pow_one] at h + rw [h] + simpa only [mul_one] using + mul_le_mul_of_nonneg_left standardGaussian_absolute_first_moment_le_one (Real.sqrt_nonneg _) + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {Q : Ω → ℝ} {v : ℝ≥0} + +theorem gaussian_hasLaw_integrable_abs_pow (hQ : HasLaw Q (gaussianReal 0 v) P) (k : ℕ) : + Integrable (fun ω => |Q ω| ^ k) P := by + let := hQ.isProbabilityMeasure + simpa only [Real.norm_eq_abs] using + (hQ.hasGaussianLaw.memLp (p := (k : ℝ≥0∞)) (by simp)).integrable_norm_pow' (p := k) + +theorem gaussian_hasLaw_absolute_moment (hQ : HasLaw Q (gaussianReal 0 v) P) (k : ℕ) : + (∫ ω, |Q ω| ^ k ∂P) = + (Real.sqrt (v : ℝ)) ^ k * (∫ z : ℝ, |z| ^ k ∂gaussianReal 0 1) := by + calc + (∫ ω, |Q ω| ^ k ∂P) = (∫ z : ℝ, |z| ^ k ∂gaussianReal 0 v) := + hQ.integral_comp (f := fun z : ℝ => |z| ^ k) (by fun_prop) + _ = _ := gaussian_absolute_moment_scaling v k + +theorem gaussian_hasLaw_second_moment (hQ : HasLaw Q (gaussianReal 0 v) P) : + (∫ ω, (Q ω) ^ 2 ∂P) = (v : ℝ) := by + have h := variance_id_gaussianReal (μ := 0) (v := v) + simp only [variance_eq_integral aemeasurable_id, id_eq, integral_id_gaussianReal, sub_zero] at h + calc + (∫ ω, (Q ω) ^ 2 ∂P) = (∫ z : ℝ, z ^ 2 ∂gaussianReal 0 v) := + hQ.integral_comp (f := fun z : ℝ => z ^ 2) (by fun_prop) + _ = _ := h + +theorem gaussian_hasLaw_absolute_first_moment_le (hQ : HasLaw Q (gaussianReal 0 v) P) : + (∫ ω, |Q ω| ∂P) ≤ Real.sqrt v := by + calc + (∫ ω, |Q ω| ∂P) = (∫ z : ℝ, |z| ∂gaussianReal 0 v) := + hQ.integral_comp (f := fun z : ℝ => |z|) (by fun_prop) + _ ≤ _ := gaussian_absolute_first_moment_le_sqrt v + +theorem gaussian_setIntegral_absolute_moment (hQ : HasLaw Q (gaussianReal 0 v) P) + {A : Set Ω} (hA : MeasurableSet A) + (hind : IndepFun (A.indicator (fun _ : Ω => (1 : ℝ))) Q P) (k : ℕ) : + (∫ ω in A, |Q ω| ^ k ∂P) = + P.real A * ((Real.sqrt (v : ℝ)) ^ k * + (∫ z : ℝ, |z| ^ k ∂gaussianReal 0 1)) := by + have hZ : AEStronglyMeasurable (fun ω => |Q ω| ^ k) P := + (gaussian_hasLaw_integrable_abs_pow hQ k).aestronglyMeasurable + have hi' := hind.comp measurable_id (by fun_prop : Measurable (fun z : ℝ => |z| ^ k)) + have hi := hi'.integral_fun_mul_eq_mul_integral + ((measurable_const.indicator hA).aestronglyMeasurable) hZ + have heq : (fun ω => id (A.indicator (fun _ : Ω => (1 : ℝ)) ω) * |Q ω| ^ k) = + A.indicator (fun ω => |Q ω| ^ k) := by + funext ω + by_cases hω : ω ∈ A <;> simp [hω] + change (∫ ω, id (A.indicator (fun _ : Ω => (1 : ℝ)) ω) * |Q ω| ^ k ∂P) = _ at hi + rw [heq, integral_indicator hA] at hi + simpa only [Function.comp_apply, id_eq, integral_indicator hA, integral_const, + smul_eq_mul, mul_one, Measure.real, Measure.restrict_apply_univ, gaussian_hasLaw_absolute_moment hQ k] using hi + +theorem gaussian_independent_weighted_second_moment + (hQ : HasLaw Q (gaussianReal 0 v) P) {K : Ω → ℂ} + (hK : AEMeasurable K P) (hind : IndepFun K Q P) : + (∫ ω, K ω * (Q ω : ℂ) ^ 2 ∂P) = + (∫ ω, K ω ∂P) * (v : ℂ) := by + have hi := hind.integral_fun_comp_mul_comp hK hQ.aemeasurable + (f := id) (g := fun z : ℝ => (z : ℂ) ^ 2) (by fun_prop) (by fun_prop) + have hmoment : (∫ ω, (Q ω : ℂ) ^ 2 ∂P) = (v : ℂ) := by + simp only [← Complex.ofReal_pow, integral_complex_ofReal, + gaussian_hasLaw_second_moment hQ] + simpa only [id_eq, hmoment] using hi + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianObservationDensity.lean b/lean/OAI/Probability/SpanningForest/GaussianObservationDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c554a43938b28f3cb828ccbb563f37dae62dff54 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianObservationDensity.lean @@ -0,0 +1,58 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal + +namespace Problem336 + +theorem gaussianPDFReal_binary_observation (t : ℝ≥0) (ht : t ≠ 0) + (x y : ℝ) (hx : x = 0 ∨ x = 1) : + gaussianPDFReal ((t : ℝ) * x) t y = + gaussianPDFReal 0 t y * Real.exp ((y - (t : ℝ) / 2) * x) := by + rcases hx with rfl | rfl + · simp + · have ht' : (t : ℝ) ≠ 0 := NNReal.coe_ne_zero.mpr ht + have hexp : -(y - (t : ℝ)) ^ 2 / (2 * (t : ℝ)) = + -y ^ 2 / (2 * (t : ℝ)) + (y - (t : ℝ) / 2) := by + field_simp + ring + simp only [mul_one, gaussianPDFReal, sub_zero, hexp, Real.exp_add] + ring + +theorem gaussianPDFReal_finite_binary_observation {ι : Type*} + (s : Finset ι) (t : ℝ≥0) (ht : t ≠ 0) (x y : ι → ℝ) + (hx : ∀ i ∈ s, x i = 0 ∨ x i = 1) : + (∏ i ∈ s, gaussianPDFReal ((t : ℝ) * x i) t (y i)) = + (∏ i ∈ s, gaussianPDFReal 0 t (y i)) * + Real.exp (∑ i ∈ s, (y i - (t : ℝ) / 2) * x i) := by + rw [Real.exp_sum, ← Finset.prod_mul_distrib] + exact Finset.prod_congr rfl (fun i hi => gaussianPDFReal_binary_observation t ht _ _ (hx i hi)) + +theorem gaussianPDF_binary_observation (t : ℝ≥0) (ht : t ≠ 0) + (x y : ℝ) (hx : x = 0 ∨ x = 1) : + gaussianPDF ((t : ℝ) * x) t y = + gaussianPDF 0 t y * ENNReal.ofReal (Real.exp ((y - (t : ℝ) / 2) * x)) := by + unfold gaussianPDF + rw [gaussianPDFReal_binary_observation t ht x y hx, + ENNReal.ofReal_mul (gaussianPDFReal_nonneg 0 t y)] + +theorem gaussianReal_binary_observation (t : ℝ≥0) (ht : t ≠ 0) + (x : ℝ) (hx : x = 0 ∨ x = 1) : + gaussianReal ((t : ℝ) * x) t = + (gaussianReal 0 t).withDensity + (fun y => ENNReal.ofReal (Real.exp ((y - (t : ℝ) / 2) * x))) := by + rw [gaussianReal_of_var_ne_zero _ ht, gaussianReal_of_var_ne_zero _ ht, + ← withDensity_mul _ (measurable_gaussianPDF 0 t) (by fun_prop)] + congr 1 + funext y + exact gaussianPDF_binary_observation t ht x y hx + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianObservationKernel.lean b/lean/OAI/Probability/SpanningForest/GaussianObservationKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..43292a0b3799877800bc934a7024d54e4006623e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianObservationKernel.lean @@ -0,0 +1,147 @@ +import OAI.Probability.SpanningForest.FiniteProductDensity + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators ENNReal NNReal + +namespace Problem336.GaussianObservation + +variable {ι α : Type*} [Fintype ι] [MeasurableSpace α] + +def endpointKernel (v : ℝ≥0) (ξ : α → ι → ℝ) : Kernel α (ι → ℝ) := + (Kernel.const α (Measure.pi (fun _ : ι => gaussianReal 0 v))).withDensity + (fun a y => ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * ξ a i))) + +theorem measurable_endpoint_likelihood (v : ℝ≥0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) : + Measurable (Function.uncurry + (fun (a : α) (y : ι → ℝ) => + ENNReal.ofReal (Real.exp (∑ i, (y i - (v : ℝ) / 2) * ξ a i)))) := by + change Measurable (fun q : α × (ι → ℝ) => + ENNReal.ofReal (Real.exp (∑ i, (q.2 i - (v : ℝ) / 2) * ξ q.1 i))) + fun_prop + +theorem endpointKernel_apply (v : ℝ≥0) (hv : v ≠ 0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) (a : α) : + endpointKernel v ξ a = Measure.pi (fun i => gaussianReal ((v : ℝ) * ξ a i) v) := by + rw [endpointKernel, Kernel.withDensity_apply _ (measurable_endpoint_likelihood v ξ hξ), + Kernel.const_apply] + exact (gaussian_pi_binary_shift_withDensity v hv (ξ a) (hbinary a)).symm + +theorem endpointKernel_markov (v : ℝ≥0) (hv : v ≠ 0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) : IsMarkovKernel (endpointKernel v ξ) := by + constructor + intro a + rw [endpointKernel_apply v hv ξ hξ hbinary a] + infer_instance + +theorem endpointKernel_apply_all (v : ℝ≥0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) (a : α) : + endpointKernel v ξ a = Measure.pi (fun i => gaussianReal ((v : ℝ) * ξ a i) v) := by + rw [endpointKernel, Kernel.withDensity_apply _ (measurable_endpoint_likelihood v ξ hξ), + Kernel.const_apply] + exact (gaussian_pi_binary_shift_withDensity_all v (ξ a) (hbinary a)).symm + +theorem endpointKernel_markov_all (v : ℝ≥0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) : IsMarkovKernel (endpointKernel v ξ) := by + constructor + intro a + rw [endpointKernel_apply_all v ξ hξ hbinary a] + infer_instance + +theorem centered_gaussian_pi_map_shift (v : ℝ≥0) (z : ι → ℝ) : + (Measure.pi (fun _ : ι => gaussianReal 0 v)).map (fun y i => z i + y i) = + Measure.pi (fun i => gaussianReal (z i) v) := by + rw [Measure.pi_map_pi (fun _ => by fun_prop)] + congr 1 + funext i + simpa only [zero_add] using (gaussianReal_map_const_add (μ := 0) (v := v) (z i)) + +theorem map_prod_endpoint_eq_compProd (v : ℝ≥0) (hv : v ≠ 0) + (ξ : α → ι → ℝ) (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) + (π : Measure α) [SFinite π] : + (π.prod (Measure.pi (fun _ : ι => gaussianReal 0 v))).map + (fun q => (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) = + π ⊗ₘ endpointKernel v ξ := by + let := endpointKernel_markov v hv ξ hξ hbinary + have hmap : Measurable (fun q : α × (ι → ℝ) => + (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) := by fun_prop + ext s hs + rw [Measure.map_apply hmap hs, Measure.prod_apply (hs.preimage hmap), + Measure.compProd_apply hs] + apply lintegral_congr + intro a + rw [endpointKernel_apply v hv ξ hξ hbinary a, + ← centered_gaussian_pi_map_shift v (fun i => (v : ℝ) * ξ a i), + Measure.map_apply (by fun_prop) (hs.preimage measurable_prodMk_left)] + rfl + +theorem hasLaw_independent_gaussian_observation {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (π : Measure α) [IsProbabilityMeasure π] + (v : ℝ≥0) (hv : v ≠ 0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) + (X : Ω → α) (B : Ω → ι → ℝ) (hX : HasLaw X π P) + (hB : HasLaw B (Measure.pi (fun _ : ι => gaussianReal 0 v)) P) + (hIndep : IndepFun X B P) : + HasLaw (fun ω => (X ω, fun i => (v : ℝ) * ξ (X ω) i + B ω i)) + (π ⊗ₘ endpointKernel v ξ) P := by + have hpair := hIndep.hasLaw_prod hX hB + have hmap : HasLaw + (fun q : α × (ι → ℝ) => (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) + (π ⊗ₘ endpointKernel v ξ) + (π.prod (Measure.pi (fun _ : ι => gaussianReal 0 v))) := + ⟨by fun_prop, map_prod_endpoint_eq_compProd v hv ξ hξ hbinary π⟩ + exact hmap.fun_comp hpair + +theorem map_prod_endpoint_eq_compProd_all (v : ℝ≥0) + (ξ : α → ι → ℝ) (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) + (π : Measure α) [SFinite π] : + (π.prod (Measure.pi (fun _ : ι => gaussianReal 0 v))).map + (fun q => (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) = + π ⊗ₘ endpointKernel v ξ := by + let := endpointKernel_markov_all v ξ hξ hbinary + have hmap : Measurable (fun q : α × (ι → ℝ) => + (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) := by fun_prop + ext s hs + rw [Measure.map_apply hmap hs, Measure.prod_apply (hs.preimage hmap), + Measure.compProd_apply hs] + apply lintegral_congr + intro a + rw [endpointKernel_apply_all v ξ hξ hbinary a, + ← centered_gaussian_pi_map_shift v (fun i => (v : ℝ) * ξ a i), + Measure.map_apply (by fun_prop) (hs.preimage measurable_prodMk_left)] + rfl + +theorem hasLaw_independent_gaussian_observation_all {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (π : Measure α) [IsProbabilityMeasure π] + (v : ℝ≥0) (ξ : α → ι → ℝ) + (hξ : ∀ i, Measurable (fun a => ξ a i)) + (hbinary : ∀ a i, ξ a i = 0 ∨ ξ a i = 1) + (X : Ω → α) (B : Ω → ι → ℝ) (hX : HasLaw X π P) + (hB : HasLaw B (Measure.pi (fun _ : ι => gaussianReal 0 v)) P) + (hIndep : IndepFun X B P) : + HasLaw (fun ω => (X ω, fun i => (v : ℝ) * ξ (X ω) i + B ω i)) + (π ⊗ₘ endpointKernel v ξ) P := by + have hpair := hIndep.hasLaw_prod hX hB + have hmap : HasLaw + (fun q : α × (ι → ℝ) => (q.1, fun i => (v : ℝ) * ξ q.1 i + q.2 i)) + (π ⊗ₘ endpointKernel v ξ) + (π.prod (Measure.pi (fun _ : ι => gaussianReal 0 v))) := + ⟨by fun_prop, map_prod_endpoint_eq_compProd_all v ξ hξ hbinary π⟩ + exact hmap.fun_comp hpair + +end Problem336.GaussianObservation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianPosteriorAllTime.lean b/lean/OAI/Probability/SpanningForest/GaussianPosteriorAllTime.lean new file mode 100644 index 0000000000000000000000000000000000000000..53aecbd9b05c022ffdb063bbf0ccf8a834e51c3a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianPosteriorAllTime.lean @@ -0,0 +1,186 @@ +import OAI.Probability.SpanningForest.FinitePosteriorTilt + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped ENNReal NNReal BigOperators ProbabilityTheory + +namespace Problem336.FinitePosterior + +variable {Θ ι : Type*} [Fintype Θ] [MeasurableSpace Θ] + [MeasurableSingletonClass Θ] [Fintype ι] + +lemma gaussianObservationKernel_eq_withDensity_all (t : ℝ≥0) + (signal : Θ → ι → ℝ) (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (θ : Θ) : + GaussianObservation.endpointKernel t signal θ = + (Measure.pi (fun _ : ι => gaussianReal 0 t)).withDensity + (gaussianLikelihood t signal θ) := by + rw [GaussianObservation.endpointKernel_apply_all t signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary θ] + exact GaussianObservation.gaussian_pi_binary_shift_withDensity_all t (signal θ) (hbinary θ) + +theorem gaussian_condExp_eq_exponential_ratio_all + [StandardBorelSpace Θ] [Nonempty Θ] + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) (g : Θ → ℝ) : + (π ⊗ₘ GaussianObservation.endpointKernel t signal)[fun z : Θ × (ι → ℝ) => g z.1 | + (inferInstance : MeasurableSpace (ι → ℝ)).comap Prod.snd] =ᵐ[ + π ⊗ₘ GaussianObservation.endpointKernel t signal] + fun z => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (z.2 i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (z.2 i - (t : ℝ) / 2) * signal θ i)) := by + let := GaussianObservation.endpointKernel_markov_all t signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary + have hfinite : ∀ θ y, gaussianLikelihood t signal θ y ≠ ∞ := by + intro θ y + exact ENNReal.ofReal_ne_top + have hpositive : ∀ θ y, gaussianLikelihood t signal θ y ≠ 0 := by + intro θ y + exact ENNReal.ofReal_ne_zero_iff.mpr (Real.exp_pos _) + have h := condExp_eq_likelihood_ratio π (GaussianObservation.endpointKernel t signal) + (Measure.pi (fun _ : ι => gaussianReal 0 t)) (gaussianLikelihood t signal) + (measurable_gaussianLikelihood t signal) hfinite + (mixtureDensity_ne_zero_of_positive π _ hpositive) + (gaussianObservationKernel_eq_withDensity_all t signal hbinary) g + simpa only [mixtureDensity_toReal π _ hfinite, gaussianLikelihood, + ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + +theorem gaussian_condExp_eq_exponential_ratio_of_jointLaw_all + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Yobs : Ω → (ι → ℝ)) (hX : Measurable X) (hY : Measurable Yobs) + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (hjoint : P.map (fun ω => (X ω, Yobs ω)) = + π ⊗ₘ GaussianObservation.endpointKernel t signal) (g : Θ → ℝ) : + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i)) := by + let := GaussianObservation.endpointKernel_markov_all t signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary + have hfinite : ∀ θ y, gaussianLikelihood t signal θ y ≠ ∞ := by + intro θ y + exact ENNReal.ofReal_ne_top + have hpositive : ∀ θ y, gaussianLikelihood t signal θ y ≠ 0 := by + intro θ y + exact ENNReal.ofReal_ne_zero_iff.mpr (Real.exp_pos _) + have h := condExp_eq_likelihood_ratio_of_jointLaw P X Yobs hX hY π + (GaussianObservation.endpointKernel t signal) hjoint + (Measure.pi (fun _ : ι => gaussianReal 0 t)) (gaussianLikelihood t signal) + (measurable_gaussianLikelihood t signal) hfinite + (mixtureDensity_ne_zero_of_positive π _ hpositive) + (gaussianObservationKernel_eq_withDensity_all t signal hbinary) g + simpa only [mixtureDensity_toReal π _ hfinite, gaussianLikelihood, + ENNReal.toReal_ofReal (Real.exp_pos _).le] using h + +theorem gaussian_condExp_eq_exponential_ratio_of_independent_all + [StandardBorelSpace Θ] [Nonempty Θ] + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + (X : Ω → Θ) (noise : Ω → (ι → ℝ)) (hX : Measurable X) (hnoise : Measurable noise) + (π : Measure Θ) [IsProbabilityMeasure π] + (t : ℝ≥0) (signal : Θ → ι → ℝ) + (hbinary : ∀ θ i, signal θ i = 0 ∨ signal θ i = 1) + (hprior : P.map X = π) + (hnoiseLaw : P.map noise = Measure.pi (fun _ : ι => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) (g : Θ → ℝ) : + let Yobs := fun ω i => (t : ℝ) * signal (X ω) i + noise ω i + P[fun ω => g (X ω) | (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i) * g θ) / + (∑ θ, (π {θ}).toReal * + Real.exp (∑ i, (Yobs ω i - (t : ℝ) / 2) * signal θ i)) := by + let Yobs := fun ω i => (t : ℝ) * signal (X ω) i + noise ω i + have hs : Measurable signal := measurable_of_countable signal + have hY : Measurable Yobs := by + unfold Yobs + fun_prop + have hjoint := GaussianObservation.hasLaw_independent_gaussian_observation_all P π t signal + (fun i => measurable_of_countable (fun θ => signal θ i)) hbinary X noise + ⟨hX.aemeasurable, hprior⟩ ⟨hnoise.aemeasurable, hnoiseLaw⟩ hindep + exact gaussian_condExp_eq_exponential_ratio_of_jointLaw_all P X Yobs hX hY π t signal + hbinary hjoint.map_eq g + +theorem binaryField_gaussian_condExp_all + {Ω I ι : Type*} [MeasurableSpace Ω] [Fintype ι] + (P : Measure Ω) [IsProbabilityMeasure P] + (ν : Measure (I → Bool)) [IsProbabilityMeasure ν] + (X : Ω → (I → Bool)) (noise : Ω → (ι → ℝ)) + (hX : Measurable X) (hnoise : Measurable noise) + (observed : ι → I) (target : I) (t : ℝ≥0) + (hprior : P.map X = ν) + (hnoiseLaw : P.map noise = Measure.pi (fun _ : ι => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) : + let Yobs := fun ω j => (t : ℝ) * binaryValue (X ω (observed j)) + noise ω j + P[fun ω => binaryValue (X ω target) | + (inferInstance : MeasurableSpace (ι → ℝ)).comap Yobs] =ᵐ[P] + fun ω => gaussianFiniteTilt ν observed target t (Yobs ω) := by + classical + let R : (I → Bool) → Bool × (ι → Bool) := binarySummary observed target + have hR : Measurable R := measurable_binarySummary observed target + let π := ν.map R + let : IsProbabilityMeasure π := inferInstance + let signal : (Bool × (ι → Bool)) → ι → ℝ := fun θ j => binaryValue (θ.2 j) + let g : (Bool × (ι → Bool)) → ℝ := fun θ => binaryValue θ.1 + have hsignal : ∀ θ j, signal θ j = 0 ∨ signal θ j = 1 := by + intro θ j + exact binaryValue_binary _ + have hprior' : P.map (fun ω => R (X ω)) = π := by + change P.map (R ∘ X) = ν.map R + rw [← Measure.map_map hR hX, hprior] + have hindep' : (fun ω => R (X ω)) ⟂ᵢ[P] noise := by + simpa only [Function.comp_def, id_eq] using hindep.comp hR measurable_id + have h := gaussian_condExp_eq_exponential_ratio_of_independent_all P + (fun ω => R (X ω)) noise (hR.comp hX) hnoise π t signal hsignal + hprior' hnoiseLaw hindep' g + have hratio (y : ι → ℝ) : + (∑ θ, (π {θ}).toReal * Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j) * g θ) / + (∑ θ, (π {θ}).toReal * Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j)) = + gaussianFiniteTilt ν observed target t y := by + simpa only [π, R, signal, g, binarySummary, gaussianFiniteTilt] using + finiteMarginal_ratio_eq_integral ν R hR + (fun θ => Real.exp (∑ j, (y j - (t : ℝ) / 2) * signal θ j)) g + filter_upwards [h] with ω hω + exact hω.trans (hratio _) + +theorem binaryField_finset_condExp_all + {Ω I : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] + (ν : ProbabilityMeasure (I → Bool)) + (X : Ω → (I → Bool)) (noise : Ω → (I → ℝ)) + (hX : Measurable X) (hnoise : Measurable noise) + (S : Finset I) (e : I) (t : ℝ≥0) + (hprior : P.map X = (ν : Measure (I → Bool))) + (hnoiseLaw : P.map (fun ω (i : S) => noise ω i) = + Measure.pi (fun _ : S => gaussianReal 0 t)) + (hindep : X ⟂ᵢ[P] noise) : + let Y := fun ω i => (t : ℝ) * TiltLimit.bit (X ω i) + noise ω i + P[fun ω => TiltLimit.bit (X ω e) | + (inferInstance : MeasurableSpace (S → ℝ)).comap (fun ω (i : S) => Y ω i)] =ᵐ[P] + fun ω => TiltLimit.finiteTiltMean ν S (fun i => Y ω i - (t : ℝ) / 2) e := by + classical + let restrict : (I → ℝ) → S → ℝ := fun y i => y i + have hr : Measurable restrict := Measurable.of_eval (fun i => measurable_pi_apply (i : I)) + have hi : X ⟂ᵢ[P] (fun ω (i : S) => noise ω i) := by + simpa only [Function.comp_def, id_eq] using hindep.comp measurable_id hr + have h := binaryField_gaussian_condExp_all P (ν : Measure (I → Bool)) X + (fun ω (i : S) => noise ω i) hX (hr.comp hnoise) + (fun i : S => (i : I)) e t hprior hnoiseLaw hi + filter_upwards [h] with ω hω + exact hω.trans (gaussianFiniteTilt_finset_eq ν S e t + (fun i => (t : ℝ) * binaryValue (X ω i) + noise ω i)) + +end Problem336.FinitePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GaussianSum.lean b/lean/OAI/Probability/SpanningForest/GaussianSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..c70e71d8c2d973101ea9b3a921dbcedcbea4f674 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GaussianSum.lean @@ -0,0 +1,51 @@ +import OAI.Probability.SpanningForest.GaussianMomentScaling + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped BigOperators NNReal ENNReal + +namespace Problem336 + +variable {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] + {P : Measure Ω} {Q : ι → Ω → ℝ} {v : ι → ℝ≥0} + +theorem independent_centered_gaussian_sum_hasLaw + (hQ : ∀ i, HasLaw (Q i) (gaussianReal 0 (v i)) P) (hind : iIndepFun Q P) : + HasLaw (fun ω => ∑ i, Q i ω) (gaussianReal 0 (∑ i, v i)) P := by + have hG : HasGaussianLaw (fun ω => ∑ i, Q i ω) P := + iIndepFun.hasGaussianLaw_fun_sum (fun i => (hQ i).hasGaussianLaw) hind + have hmean : (∫ ω, ∑ i, Q i ω ∂P) = 0 := by + rw [integral_finsetSum _ (fun i _ => (hQ i).hasGaussianLaw.integrable)] + simp only [fun i => (hQ i).integral_eq, integral_id_gaussianReal, Finset.sum_const_zero] + have hvar : Var[fun ω => ∑ i, Q i ω; P] = ∑ i, (v i : ℝ) := by + have h := IndepFun.variance_sum (s := Finset.univ) + (fun i _ => (hQ i).hasGaussianLaw.memLp_two) + (fun i _ j _ hij => hind.indepFun hij) + have heq : (fun ω => ∑ i, Q i ω) = ∑ i, Q i := by + funext ω + simp only [Finset.sum_apply] + rw [heq] + simpa only [fun i => (hQ i).variance_eq, variance_id_gaussianReal] using h + refine ⟨hG.aemeasurable, ?_⟩ + rw [hG.map_eq_gaussianReal, hmean, hvar] + congr 1 + simp only [← NNReal.coe_sum, Real.toNNReal_coe] + +theorem independent_weighted_gaussian_sum_hasLaw + (hQ : ∀ i, HasLaw (Q i) (gaussianReal 0 (v i)) P) + (hind : iIndepFun Q P) (θ : ι → ℝ) : + HasLaw (fun ω => ∑ i, θ i * Q i ω) + (gaussianReal 0 (∑ i, NNReal.mk ((θ i) ^ 2) (sq_nonneg _) * v i)) P := by + apply independent_centered_gaussian_sum_hasLaw + · intro i + simpa only [mul_zero] using gaussianReal_const_mul (hQ i) (θ i) + · exact hind.comp (fun i z => θ i * z) (by fun_prop) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GeneratorExhaustion.lean b/lean/OAI/Probability/SpanningForest/GeneratorExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1f72001880d59396233c027cbe71aea094a7cbc --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GeneratorExhaustion.lean @@ -0,0 +1,100 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter Topology + +namespace Problem336 +namespace FreeKernel + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def finiteSpan {α : Type*} (v : α → E) (s : Finset α) : Submodule ℝ E := + Submodule.span ℝ (v '' (s : Set α)) + +instance finiteSpan_finiteDimensional {α : Type*} (v : α → E) (s : Finset α) : + FiniteDimensional ℝ (finiteSpan v s) := + FiniteDimensional.span_of_finite ℝ (s.finite_toSet.image v) + +theorem finiteSpan_mono {α : Type*} (v : α → E) {s t : Finset α} + (h : s ⊆ t) : finiteSpan v s ≤ finiteSpan v t := + Submodule.span_mono (Set.image_mono h) + +theorem iSup_finiteSpan_eq_span_range {α : Type*} (v : α → E) + (s : ℕ → Finset α) (hCover : ∀ a, ∃ n, a ∈ s n) : + (⨆ n, finiteSpan v (s n)) = Submodule.span ℝ (Set.range v) := by + apply le_antisymm + · refine iSup_le fun n => Submodule.span_mono ?_ + exact Set.image_subset_range v (s n : Set α) + · apply Submodule.span_le.mpr + rintro _ ⟨a, rfl⟩ + obtain ⟨n, hn⟩ := hCover a + exact (le_iSup (fun n => finiteSpan v (s n)) n) + (Submodule.subset_span ⟨a, hn, rfl⟩) + +theorem finiteSpan_projection_tendsto_self {α : Type*} (v : α → E) + (s : ℕ → Finset α) (hMono : Monotone s) + (hCover : ∀ a, ∃ n, a ∈ s n) + (hDense : (Submodule.span ℝ (Set.range v)).topologicalClosure = ⊤) + (x : E) : + Tendsto (fun n => (finiteSpan v (s n)).starProjection x) atTop (𝓝 x) := by + apply Submodule.starProjection_tendsto_self + · intro n m hnm + exact finiteSpan_mono v (hMono hnm) + · rw [iSup_finiteSpan_eq_span_range v s hCover, hDense] + +theorem exhausted_generators_minor_tendsto + [CompleteSpace E] + {α β ι : Type*} [Fintype ι] [DecidableEq ι] + (q : α → E) (c : β → E) + (s : ℕ → Finset α) (t : ℕ → Finset β) + (hs : Monotone s) (ht : Monotone t) + (hsCover : ∀ a, ∃ n, a ∈ s n) + (htCover : ∀ b, ∃ n, b ∈ t n) + (hqDense : (Submodule.span ℝ (Set.range q)).topologicalClosure = ⊤) + (v : ι → E) : + Tendsto + (fun n => Matrix.det (fun i j => inner ℝ (v i) + ((finiteSpan q (s n)).starProjection (v j) - + (finiteSpan c (t n)).starProjection (v j)))) + atTop + (𝓝 (Matrix.det (fun i j => inner ℝ (v i) + (v j - (Submodule.span ℝ (Set.range c)).topologicalClosure.starProjection + (v j))))) := by + have hQ : Monotone (fun n => finiteSpan q (s n)) := + fun _ _ h => finiteSpan_mono q (hs h) + have hC : Monotone (fun n => finiteSpan c (t n)) := + fun _ _ h => finiteSpan_mono c (ht h) + have hDense : (⨆ n, finiteSpan q (s n)).topologicalClosure = ⊤ := by + rw [iSup_finiteSpan_eq_span_range q s hsCover, hqDense] + have hp : ∀ x, Tendsto + (fun n => (finiteSpan q (s n)).starProjection x - + (finiteSpan c (t n)).starProjection x) atTop + (𝓝 (x - (Submodule.span ℝ (Set.range c)).topologicalClosure.starProjection x)) := by + intro x + have hc := Submodule.starProjection_tendsto_closure_iSup + (fun n => finiteSpan c (t n)) hC x + rw [iSup_finiteSpan_eq_span_range c t htCover] at hc + exact (finiteSpan_projection_tendsto_self q s hs hsCover hqDense x).sub hc + have hm : Tendsto + (fun n i j => inner ℝ (v i) + ((finiteSpan q (s n)).starProjection (v j) - + (finiteSpan c (t n)).starProjection (v j))) atTop + (𝓝 (fun i j => inner ℝ (v i) + (v j - (Submodule.span ℝ (Set.range c)).topologicalClosure.starProjection + (v j)))) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + exact tendsto_const_nhds.inner (hp (v j)) + exact continuous_id.matrix_det.continuousAt.tendsto.comp hm + +end FreeKernel +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GibbsField.lean b/lean/OAI/Probability/SpanningForest/GibbsField.lean new file mode 100644 index 0000000000000000000000000000000000000000..c026edaa6691b39a60bf6f827e44b979eb59fc7b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GibbsField.lean @@ -0,0 +1,162 @@ +import OAI.Probability.SpanningForest.ExponentialFamily + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336 +namespace GibbsField + +variable {α ι : Type*} [Fintype α] [Fintype ι] + +def weight (x : α → ι → ℝ) (h : ι → ℝ) (a : α) : ℝ := + Real.exp (∑ j, h j * x a j) + +def mean (x : α → ι → ℝ) (a : α → ℝ) (h : ι → ℝ) : ℝ := + (∑ i, weight x h i * a i) / ∑ i, weight x h i + +def directionValue (x : α → ι → ℝ) (k : ι → ℝ) (a : α) : ℝ := + ∑ j, k j * x a j + +omit [Fintype α] in +theorem weight_pos (x : α → ι → ℝ) (h : ι → ℝ) (i : α) : + 0 < weight x h i := Real.exp_pos _ + +omit [Fintype α] in +theorem weight_shift (x : α → ι → ℝ) (h k : ι → ℝ) (i : α) (t : ℝ) : + weight x (fun j => h j + t * k j) i = + weight x h i * Real.exp (t * directionValue x k i) := by + simp [weight, directionValue, add_mul, mul_assoc, Finset.sum_add_distrib, + Finset.mul_sum, Real.exp_add] + +theorem mean_shift_eq (x : α → ι → ℝ) (a : α → ℝ) (h k : ι → ℝ) (t : ℝ) : + mean x a (fun j => h j + t * k j) = + ExponentialFamily.mean (weight x h) (directionValue x k) a t := by + simp only [mean, weight_shift, ExponentialFamily.mean, ExponentialFamily.numerator, ExponentialFamily.partition] + +theorem hasDerivAt_mean_direction [Nonempty α] + (x : α → ι → ℝ) (a : α → ℝ) (h k : ι → ℝ) (t : ℝ) : + HasDerivAt (fun s => mean x a (fun j => h j + s * k j)) + (mean x (fun i => a i * directionValue x k i) (fun j => h j + t * k j) - + mean x a (fun j => h j + t * k j) * + mean x (directionValue x k) (fun j => h j + t * k j)) t := by + have hpos : ∃ i, 0 < weight x h i := ⟨Classical.choice ‹Nonempty α›, weight_pos x h _⟩ + simpa only [mean_shift_eq] using + (ExponentialFamily.hasDerivAt_mean_of_nonneg (weight x h) (directionValue x k) a + t (fun i => (weight_pos x h i).le) hpos) + +def covariance (x : α → ι → ℝ) (a b : α → ℝ) (h : ι → ℝ) : ℝ := + mean x (fun i => a i * b i) h - mean x a h * mean x b h + +theorem mean_sum {κ : Type*} [Fintype κ] + (x : α → ι → ℝ) (f : κ → α → ℝ) (h : ι → ℝ) : + mean x (fun i => ∑ j, f j i) h = ∑ j, mean x (f j) h := by + simp only [mean, Finset.mul_sum, Finset.sum_div] + rw [Finset.sum_comm] + +theorem mean_const_mul (x : α → ι → ℝ) (a : α → ℝ) (h : ι → ℝ) (c : ℝ) : + mean x (fun i => c * a i) h = c * mean x a h := by + simp only [mean] + rw [← mul_div_assoc, Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro i _ + ring + +theorem covariance_direction (x : α → ι → ℝ) (a : α → ℝ) (h k : ι → ℝ) : + covariance x a (directionValue x k) h = + ∑ j, k j * covariance x a (fun i => x i j) h := by + unfold covariance directionValue + simp only [Finset.mul_sum, mean_sum] + have hm : (fun j => mean x (fun i => a i * (k j * x i j)) h) = + (fun j => k j * mean x (fun i => a i * x i j) h) := by + funext j + rw [← mean_const_mul] + congr 1 + funext i + ring + rw [hm] + simp only [mean_const_mul, mul_sub, Finset.sum_sub_distrib] + congr 1 + apply Finset.sum_congr rfl + intro j _ + ring + +theorem hasDerivAt_mean_direction_sum [Nonempty α] + (x : α → ι → ℝ) (a : α → ℝ) (h k : ι → ℝ) (t : ℝ) : + HasDerivAt (fun s => mean x a (fun j => h j + s * k j)) + (∑ j, k j * covariance x a (fun i => x i j) (fun j => h j + t * k j)) t := by + exact (hasDerivAt_mean_direction x a h k t).congr_deriv + (covariance_direction x a (fun j => h j + t * k j) k) + +theorem hasDerivAt_mean_coordinate [Nonempty α] [DecidableEq ι] + (x : α → ι → ℝ) (a : α → ℝ) (h : ι → ℝ) (e : ι) : + HasDerivAt (fun t => mean x a (Function.update h e (h e + t))) + (covariance x a (fun i => x i e) h) 0 := by + classical + let k : ι → ℝ := fun j => if j = e then 1 else 0 + have hk : directionValue x k = fun i => x i e := by + funext i + simp [directionValue, k] + have hp : (fun t => mean x a (Function.update h e (h e + t))) = + (fun t => mean x a (fun j => h j + t * k j)) := by + funext t + congr 1 + funext j + by_cases hj : j = e <;> simp [k, hj] + rw [hp] + simpa only [zero_mul, add_zero, hk, covariance] using + (hasDerivAt_mean_direction x a h k 0) + +theorem partition_pos [Nonempty α] (x : α → ι → ℝ) (h : ι → ℝ) : + 0 < ∑ i, weight x h i := by + apply Finset.sum_pos' + · exact fun i _ => (weight_pos x h i).le + · exact ⟨Classical.choice ‹Nonempty α›, Finset.mem_univ _, weight_pos x h _⟩ + +omit [Fintype α] in +@[fun_prop] +theorem continuous_weight (x : α → ι → ℝ) (i : α) : + Continuous (fun h => weight x h i) := by + unfold weight + fun_prop + +theorem continuous_mean [Nonempty α] (x : α → ι → ℝ) (a : α → ℝ) : + Continuous (mean x a) := by + unfold mean + apply Continuous.div + · fun_prop + · fun_prop + · intro h + exact ne_of_gt (partition_pos x h) + +theorem measurable_mean [Nonempty α] (x : α → ι → ℝ) (a : α → ℝ) : + Measurable (mean x a) := (continuous_mean x a).measurable + +def mass (x : α → ι → ℝ) (h : ι → ℝ) (i : α) : ℝ := + weight x h i / ∑ j, weight x h j + +theorem mass_nonneg (x : α → ι → ℝ) (h : ι → ℝ) (i : α) : + 0 ≤ mass x h i := by + exact div_nonneg (weight_pos x h i).le + (Finset.sum_nonneg fun j _ => (weight_pos x h j).le) + +theorem sum_mass [Nonempty α] (x : α → ι → ℝ) (h : ι → ℝ) : + ∑ i, mass x h i = 1 := by + simp only [mass, ← Finset.sum_div] + exact div_self (ne_of_gt (partition_pos x h)) + +theorem mean_eq_sum_mass (x : α → ι → ℝ) (a : α → ℝ) (h : ι → ℝ) : + mean x a h = ∑ i, mass x h i * a i := by + simp only [mean, mass, Finset.sum_div] + apply Finset.sum_congr rfl + intro i _ + ring + +end GibbsField +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GibbsResponse.lean b/lean/OAI/Probability/SpanningForest/GibbsResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..93f1e7f7cbe061c1404cf118a1e0a432b0c47ed9 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GibbsResponse.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SpanningForest.GibbsField +import OAI.Probability.SpanningForest.ResponseLipschitz + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.GibbsField + +variable {α ι : Type*} [Fintype α] [Fintype ι] + +theorem coordinate_mean_eq_finiteResponse (x : α → ι → ℝ) (h : ι → ℝ) (e : ι) : + mean x (fun i => x i e) h = FiniteResponse.mean (mass x h) x e := + mean_eq_sum_mass x (fun i => x i e) h + +theorem coordinate_covariance_eq_finiteResponse + (x : α → ι → ℝ) (h : ι → ℝ) (e f : ι) : + covariance x (fun i => x i e) (fun i => x i f) h = + FiniteResponse.covariance (mass x h) x e f := by + simp only [covariance, FiniteResponse.covariance, mean_eq_sum_mass, + FiniteResponse.mean, mul_assoc] + +theorem covariance_abs_row_le_half [Nonempty α] + (x : α → ι → ℝ) + (hx : ∀ i e, x i e = 0 ∨ x i e = 1) + (r : ℝ) (hfixed : ∀ i, ∑ f, x i f = r) + (h : ι → ℝ) + (hneg : ∀ e f, e ≠ f → covariance x (fun i => x i e) (fun i => x i f) h ≤ 0) + (e : ι) : + (∑ f, |covariance x (fun i => x i e) (fun i => x i f) h|) ≤ (1 : ℝ) / 2 := by + simp_rw [coordinate_covariance_eq_finiteResponse] at hneg ⊢ + exact FiniteResponse.covariance_abs_row_le_half (mass x h) x + (mass_nonneg x h) (sum_mass x h) hx r hfixed hneg e + +theorem response_bound [Nonempty α] + (x : α → ι → ℝ) + (hx : ∀ i e, x i e = 0 ∨ x i e = 1) + (r : ℝ) (hfixed : ∀ i, ∑ f, x i f = r) + (hneg : ∀ h e f, e ≠ f → + covariance x (fun i => x i e) (fun i => x i f) h ≤ 0) + (a b : ι → ℝ) (e : ι) : + |mean x (fun i => x i e) b - mean x (fun i => x i e) a| ≤ + (1 / 2 : ℝ) * ‖b - a‖ := by + apply FiniteResponse.abs_sub_le_of_line_derivative_row_bound + (f := mean x (fun i => x i e)) + (c := fun h f => covariance x (fun i => x i e) (fun i => x i f) h) + · intro h k t + apply (hasDerivAt_mean_direction_sum x (fun i => x i e) h (k - h) t).congr_deriv + apply Finset.sum_congr rfl + intro f _ + exact mul_comm _ _ + · intro h + exact covariance_abs_row_le_half x hx r hfixed h (hneg h) e + +theorem response_bound_of_coordinate_bound [Nonempty α] + (x : α → ι → ℝ) + (hx : ∀ i e, x i e = 0 ∨ x i e = 1) + (r : ℝ) (hfixed : ∀ i, ∑ f, x i f = r) + (hneg : ∀ h e f, e ≠ f → + covariance x (fun i => x i e) (fun i => x i f) h ≤ 0) + (a b : ι → ℝ) (e : ι) (D : ℝ) (hD : 0 ≤ D) + (hab : ∀ j, |b j - a j| ≤ D) : + |mean x (fun i => x i e) b - mean x (fun i => x i e) a| ≤ D / 2 := by + apply (response_bound x hx r hfixed hneg a b e).trans + have hn : ‖b - a‖ ≤ D := (pi_norm_le_iff_of_nonneg hD).mpr hab + linarith + +end Problem336.GibbsField + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GlobalWiener.lean b/lean/OAI/Probability/SpanningForest/GlobalWiener.lean new file mode 100644 index 0000000000000000000000000000000000000000..598c44d00479390ec76d507313e7a996d6a6d551 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GlobalWiener.lean @@ -0,0 +1,86 @@ +import OAI.Probability.SpanningForest.SampledPathConcatenation +import OAI.Probability.SpanningForest.DenseGaussianModification + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped Topology NNReal + +namespace Problem336.GlobalWiener + +abbrev Path := C(ℝ≥0, ℝ) + +local instance : MeasurableSpace C(ℝ, ℝ) := borel _ +local instance : BorelSpace C(ℝ, ℝ) := ⟨rfl⟩ +local instance : MeasurableSpace Path := borel _ +local instance : BorelSpace Path := ⟨rfl⟩ + +def nonnegativeEmbedding : C(ℝ≥0, ℝ) := ⟨Subtype.val, continuous_subtype_val⟩ + +def samplePath (ω : ℕ → ℝ) : Path := + (SampledPathConcatenation.fullPath DyadicTimes.enumeration ω).comp nonnegativeEmbedding + +lemma measurable_samplePath : Measurable samplePath := + (ContinuousMap.continuous_precomp nonnegativeEmbedding).measurable.comp + (SampledPathConcatenation.measurable_fullPath DyadicTimes.enumeration) + +theorem isBrownian_samplePath {μ : Measure (ℕ → ℝ)} [IsProbabilityMeasure μ] + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ + (CountableBrownian.family DyadicTimes.enumeration)) : + IsBrownianReal (fun t ω => samplePath ω t) μ := by + apply DenseBrownian.isBrownian_of_dense_gaussian_modification + (τ := DyadicTimes.enumeration) (Y := fun i ω => ω i) + DenseBrownian.dense_dyadicTimes + · intro t + exact (continuous_eval_const t).measurable.comp measurable_samplePath + · exact ae_of_all _ (fun ω => (samplePath ω).continuous) + · exact CountableBrownian.isGaussianProcess hμ + · exact CountableBrownian.integral_eval hμ + · exact CountableBrownian.covariance_eval hμ + · intro t ht + obtain ⟨n, k, rfl⟩ := ht + refine ⟨Nat.pair n k, ?_, ?_⟩ + · simp [DyadicTimes.grid] + · filter_upwards [SampledPathConcatenation.ae_fullPath_coordinates hμ Nat.pair + (by intro n k; simp [DyadicTimes.grid])] with ω hω + change SampledPathConcatenation.fullPath DyadicTimes.enumeration ω + (((k : ℝ≥0) / 2 ^ n : ℝ≥0) : ℝ) = ω (Nat.pair n k) + simpa using hω n k + +theorem exists_wiener : + ∃ ρ : Measure Path, IsProbabilityMeasure ρ ∧ + IsBrownianReal (fun t (w : Path) => w t) ρ := by + obtain ⟨μ, hprob, hμ⟩ := + CountableBrownian.exists_countable_brownian_law DyadicTimes.enumeration + let : IsProbabilityMeasure μ := hprob + let ρ : Measure Path := μ.map samplePath + have hρ : IsProbabilityMeasure ρ := + inferInstance + have hB := isBrownian_samplePath hμ + refine ⟨ρ, hρ, ?_⟩ + constructor + · constructor + intro I + have hm : Measurable (fun w : Path => I.restrict (fun t => w t)) := + Measurable.of_eval (fun i => (continuous_eval_const i.val).measurable) + refine ⟨hm.aemeasurable, ?_⟩ + change (μ.map samplePath).map (fun w : Path => I.restrict (fun t => w t)) = _ + rw [Measure.map_map hm measurable_samplePath] + exact (hB.toIsPreBrownianReal.hasLaw I).map_eq + · exact ae_of_all _ (fun w => w.continuous) + +def wienerMeasure : Measure Path := Classical.choose exists_wiener + +instance wienerMeasure_isProbabilityMeasure : IsProbabilityMeasure wienerMeasure := + (Classical.choose_spec exists_wiener).1 + +theorem isBrownian_wienerMeasure : + IsBrownianReal (fun t (w : Path) => w t) wienerMeasure := + (Classical.choose_spec exists_wiener).2 + +end Problem336.GlobalWiener + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GramDeterminantUpdate.lean b/lean/OAI/Probability/SpanningForest/GramDeterminantUpdate.lean new file mode 100644 index 0000000000000000000000000000000000000000..95657d6ec6ec9b8a74f62955151cec87cfd3dc66 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GramDeterminantUpdate.lean @@ -0,0 +1,61 @@ +import OAI.Probability.SpanningForest.DeterminantalResponse + +namespace OAI + +noncomputable section + +open scoped Matrix + +namespace Problem336.Determinantal + +variable {ν ι κ : Type*} +variable [Fintype ν] [DecidableEq ν] [Fintype ι] [decidableColumns : DecidableEq ι] +variable [finiteAuxiliary : Fintype κ] [decidableAuxiliary : DecidableEq κ] + +omit decidableColumns finiteAuxiliary decidableAuxiliary in +theorem transferKernel_submatrix [DecidableEq ι] [Fintype κ] [DecidableEq κ] + (A : Matrix ν ι ℝ) (f : κ → ι) : + (A.submatrix id f).transpose * (A * A.transpose)⁻¹ * A.submatrix id f = + (transferKernel A).submatrix f f := by + ext i j + rfl + +theorem det_gram_update_div_det + (A : Matrix ν ι ℝ) (hA : IsUnit (A * A.transpose).det) + (f : κ → ι) (z : κ → ℝ) : + (A * A.transpose + A.submatrix id f * Matrix.diagonal z * + (A.submatrix id f).transpose).det / (A * A.transpose).det = + (1 + Matrix.diagonal z * (transferKernel A).submatrix f f).det := by + let C := A.submatrix id f + have hd := Matrix.det_add_mul C (Matrix.diagonal z * C.transpose) hA + have hc : C.transpose * (A * A.transpose)⁻¹ * C = + (transferKernel A).submatrix f f := transferKernel_submatrix A f + have heq : Matrix.diagonal z * C.transpose * (A * A.transpose)⁻¹ * C = + Matrix.diagonal z * (transferKernel A).submatrix f f := by + rw [← hc] + simp only [Matrix.mul_assoc] + rw [heq] at hd + change (A * A.transpose + C * Matrix.diagonal z * C.transpose).det / + (A * A.transpose).det = _ + rw [Matrix.mul_assoc C, hd] + exact mul_div_cancel_left₀ _ hA.ne_zero + +theorem det_gram_two_update_div_det + (A : Matrix ν ι ℝ) (hA : IsUnit (A * A.transpose).det) + (e f : ι) (s t : ℝ) : + (A * A.transpose + A.submatrix id ![e, f] * Matrix.diagonal ![s, t] * + (A.submatrix id ![e, f]).transpose).det / (A * A.transpose).det = + 1 + s * transferKernel A e e + t * transferKernel A f f + + s * t * (pairMatrix (transferKernel A) e f).det := by + rw [det_gram_update_div_det A hA, Matrix.det_fin_two, pairMatrix_det] + simp only [Matrix.add_apply, Matrix.diagonal_mul, Matrix.submatrix_apply, + Matrix.one_apply, Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one, + Matrix.cons_val_fin_one, ite_true, Fin.zero_ne_one, ite_false, + zero_add] + norm_num; ring + +end Problem336.Determinantal + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphBalls.lean b/lean/OAI/Probability/SpanningForest/GraphBalls.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6c6efa2121be90d2547b9f9571db00cad346a66 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphBalls.lean @@ -0,0 +1,219 @@ +import OAI.Probability.SpanningForest.EdgeAction + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def withinRadius (G : GraphCode) : ℕ → ℕ → ℕ → Prop + | 0, u, v => u = v + | n + 1, u, v => withinRadius G n u v ∨ + ∃ w, withinRadius G n u w ∧ Adj G w v + +@[simp] theorem withinRadius_zero (G : GraphCode) (u v : ℕ) : + withinRadius G 0 u v ↔ u = v := Iff.rfl + +theorem withinRadius_succ (G : GraphCode) (n u v : ℕ) : + withinRadius G (n + 1) u v ↔ withinRadius G n u v ∨ + ∃ w, withinRadius G n u w ∧ Adj G w v := Iff.rfl + +theorem withinRadius_mono {G : GraphCode} {n m u v : ℕ} + (hnm : n ≤ m) (h : withinRadius G n u v) : withinRadius G m u v := by + induction hnm with + | refl => exact h + | step hnm ih => exact Or.inl ih + +@[simp] theorem withinRadius_refl (G : GraphCode) (n u : ℕ) : + withinRadius G n u u := + withinRadius_mono (Nat.zero_le n) rfl + +theorem withinRadius_reachable {G : GraphCode} {n u v : ℕ} + (h : withinRadius G n u v) : + Relation.ReflTransGen (Adj G) u v := by + induction n generalizing v with + | zero => exact (withinRadius_zero G u v).mp h ▸ Relation.ReflTransGen.refl + | succ n ih => + rcases h with h | ⟨w, hw, hwv⟩ + · exact ih h + · exact (ih hw).tail hwv + +theorem exists_withinRadius_of_reachable {G : GraphCode} {u v : ℕ} + (h : Relation.ReflTransGen (Adj G) u v) : + ∃ n, withinRadius G n u v := by + induction h with + | refl => exact ⟨0, rfl⟩ + | tail huv hvw ih => + rcases ih with ⟨n, hn⟩ + exact ⟨n + 1, Or.inr ⟨_, hn, hvw⟩⟩ + +theorem reachable_iff_exists_withinRadius (G : GraphCode) (u v : ℕ) : + Relation.ReflTransGen (Adj G) u v ↔ ∃ n, withinRadius G n u v := + ⟨exists_withinRadius_of_reachable, fun ⟨_, hn⟩ => withinRadius_reachable hn⟩ + +theorem exists_withinRadius (G : GraphCode) (hG : GraphConnected G) (u v : ℕ) : + ∃ n, withinRadius G n u v := + exists_withinRadius_of_reachable (hG u v) + +theorem finite_withinRadius (G : GraphCode) (hG : GraphLocallyFinite G) + (n u : ℕ) : Set.Finite {v | withinRadius G n u v} := by + induction n with + | zero => simp [withinRadius] + | succ n ih => + have hf := ih.biUnion (fun w _ => hG w) + convert ih.union hf using 1 + ext v + simp [withinRadius] + +theorem measurableSet_adj (u v : ℕ) : + MeasurableSet {G : GraphCode | Adj G u v} := by + exact measurableSet_eq_fun + ((measurable_pi_apply v).comp ((measurable_pi_apply u).comp measurable_subtype_coe)) + measurable_const + +theorem measurableSet_withinRadius (n u v : ℕ) : + MeasurableSet {G : GraphCode | withinRadius G n u v} := by + induction n generalizing u v with + | zero => + by_cases h : u = v <;> simp [withinRadius, h] + | succ n ih => + simp only [withinRadius, Set.ofPred_or, Set.ofPred_exists, Set.ofPred_and] + exact (ih u v).union (MeasurableSet.iUnion fun w => + (ih u w).inter (measurableSet_adj w v)) + +@[simp] theorem withinRadius_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (n u v : ℕ) : + withinRadius (relabelGraph σ G) n (σ u) (σ v) ↔ withinRadius G n u v := by + induction n generalizing u v with + | zero => simp [withinRadius] + | succ n ih => + simp only [withinRadius_succ, ih] + constructor + · rintro (h | ⟨w, hw, hwv⟩) + · exact Or.inl h + · right + refine ⟨σ.symm w, ?_, ?_⟩ + · simpa using (ih u (σ.symm w)).mp (by simpa using hw) + · simpa [Adj, relabelGraph] using hwv + · rintro (h | ⟨w, hw, hwv⟩) + · exact Or.inl h + · right + exact ⟨σ w, (ih u w).mpr hw, by simpa [Adj, relabelGraph] using hwv⟩ + +def edgeBall (G : GraphCode) (n : ℕ) (e : EdgeCode) : Set ℕ := + {v | withinRadius G n e.val.1 v ∨ withinRadius G n e.val.2 v} + +theorem finite_edgeBall (G : GraphCode) (hG : GraphLocallyFinite G) + (n : ℕ) (e : EdgeCode) : (edgeBall G n e).Finite := + (finite_withinRadius G hG n e.val.1).union + (finite_withinRadius G hG n e.val.2) + +theorem edgeBall_mono (G : GraphCode) (e : EdgeCode) {n m : ℕ} (h : n ≤ m) : + edgeBall G n e ⊆ edgeBall G m e := by + intro v hv + exact hv.imp (withinRadius_mono h) (withinRadius_mono h) + +theorem measurableSet_mem_edgeBall (n v : ℕ) (e : EdgeCode) : + MeasurableSet {G : GraphCode | v ∈ edgeBall G n e} := + (measurableSet_withinRadius n e.val.1 v).union + (measurableSet_withinRadius n e.val.2 v) + +theorem mem_edgeBall_mkEdge (G : GraphCode) (n u v w : ℕ) (h : u ≠ v) : + w ∈ edgeBall G n (mkEdge u v h) ↔ + withinRadius G n u w ∨ withinRadius G n v w := by + unfold edgeBall mkEdge + split_ifs <;> simp only [Set.mem_ofPred_eq]; tauto + +@[simp] theorem mem_edgeBall_mapEdge (σ : Equiv ℕ ℕ) (G : GraphCode) + (n v : ℕ) (e : EdgeCode) : + σ v ∈ edgeBall (relabelGraph σ G) n (mapEdge σ e) ↔ v ∈ edgeBall G n e := by + unfold mapEdge + rw [mem_edgeBall_mkEdge] + simp only [withinRadius_relabel] + rfl + +theorem edgeBall_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (n : ℕ) (e : EdgeCode) : + edgeBall (relabelGraph σ G) n (mapEdge σ e) = σ '' edgeBall G n e := by + ext v + constructor + · intro hv + refine ⟨σ.symm v, ?_, by simp⟩ + exact (mem_edgeBall_mapEdge σ G n (σ.symm v) e).mp (by simpa using hv) + · rintro ⟨w, hw, rfl⟩ + exact (mem_edgeBall_mapEdge σ G n w e).mpr hw + +theorem exists_mem_edgeBall (G : GraphCode) (hG : GraphConnected G) + (e : EdgeCode) (v : ℕ) : ∃ n, v ∈ edgeBall G n e := by + rcases exists_withinRadius G hG e.val.1 v with ⟨n, hn⟩ + exact ⟨n, Or.inl hn⟩ + +theorem measurable_edgeBall (n : ℕ) (e : EdgeCode) : + Measurable (fun G : GraphCode => edgeBall G n e) := by + exact Measurable.of_eval fun v => + measurableSet_setOfPred.mp (measurableSet_mem_edgeBall n v e) + +theorem measurable_edgeBall_joint : + Measurable (fun q : GraphCode × (ℕ × EdgeCode) => edgeBall q.1 q.2.1 q.2.2) := + measurable_from_prod_countable_left fun ne => measurable_edgeBall ne.1 ne.2 + +def finiteSetCode (s : Set ℕ) : Finset ℕ := by + classical + exact if hs : s.Finite then hs.toFinset else ∅ + +@[simp] theorem finiteSetCode_of_finite (s : Set ℕ) (hs : s.Finite) : + finiteSetCode s = hs.toFinset := by + simp [finiteSetCode, hs] + +theorem finiteSetCode_eq_iff (s : Set ℕ) (t : Finset ℕ) : + finiteSetCode s = t ↔ s = (t : Set ℕ) ∨ (t = ∅ ∧ ¬s.Finite) := by + classical + by_cases hs : s.Finite + · simp only [finiteSetCode, hs, not_true_eq_false, and_false, or_false] + rw [← Finset.coe_inj] + simp + · have hne : s ≠ (t : Set ℕ) := fun h => hs (h ▸ t.finite_toSet) + simp [finiteSetCode, hs, hne, eq_comm] + +theorem measurable_finiteSetCode : Measurable finiteSetCode := by + have hf (t : Finset ℕ) : MeasurableSet {s : Set ℕ | finiteSetCode s = t} := by + simp only [finiteSetCode_eq_iff] + exact ((measurable_id.eq_const (t : Set ℕ)).or + (measurable_const.and (measurableSet_setOfPred.mp + Set.Countable.ofPred_finite.measurableSet).not)).setOf + exact measurable_to_countable fun s => hf (finiteSetCode s) + +def edgeBallCode (G : GraphCode) (n : ℕ) (e : EdgeCode) : Finset ℕ := + finiteSetCode (edgeBall G n e) + +theorem measurable_edgeBallCode : + Measurable (fun q : GraphCode × (ℕ × EdgeCode) => edgeBallCode q.1 q.2.1 q.2.2) := + measurable_finiteSetCode.comp measurable_edgeBall_joint + +@[simp] theorem mem_edgeBallCode (G : GraphCode) (hG : GraphLocallyFinite G) + (n v : ℕ) (e : EdgeCode) : v ∈ edgeBallCode G n e ↔ v ∈ edgeBall G n e := by + simp [edgeBallCode, finiteSetCode, finite_edgeBall G hG n e] + +theorem finiteSetCode_image (σ : Equiv ℕ ℕ) (s : Set ℕ) : + finiteSetCode (σ '' s) = (finiteSetCode s).image σ := by + classical + by_cases hs : s.Finite + · rw [finiteSetCode_of_finite s hs, + finiteSetCode_of_finite (σ '' s) (hs.image σ)] + exact hs.toFinset_image σ (hs.image σ) + · have hi : ¬(σ '' s).Finite := fun h => hs (h.of_finite_image σ.injective.injOn) + simp [finiteSetCode, hs, hi] + +theorem edgeBallCode_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (n : ℕ) (e : EdgeCode) : + edgeBallCode (relabelGraph σ G) n (mapEdge σ e) = (edgeBallCode G n e).image σ := by + unfold edgeBallCode + rw [edgeBall_relabel, finiteSetCode_image] + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphBorel.lean b/lean/OAI/Probability/SpanningForest/GraphBorel.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb8876808f7f4dc48b49bd7782aeaee14f24c59d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphBorel.lean @@ -0,0 +1,119 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.GraphBorel + +def FiniteReach {ι : Type*} (r : ι → ι → Prop) : ℕ → ι → ι → Prop + | 0, a, b => a = b + | n + 1, a, b => FiniteReach r n a b ∨ ∃ c, FiniteReach r n a c ∧ r c b + +theorem finiteReach_reflTransGen {ι : Type*} {r : ι → ι → Prop} + {n : ℕ} {a b : ι} (h : FiniteReach r n a b) : Relation.ReflTransGen r a b := by + induction n generalizing a b with + | zero => + cases h + exact .refl + | succ n ih => + rcases h with h | ⟨c, hac, hcb⟩ + · exact ih h + · exact (ih hac).tail hcb + +theorem reflTransGen_iff_exists_finiteReach {ι : Type*} {r : ι → ι → Prop} + {a b : ι} : Relation.ReflTransGen r a b ↔ ∃ n, FiniteReach r n a b := by + constructor + · intro h + induction h with + | refl => exact ⟨0, rfl⟩ + | @tail b c hab hbc ih => + obtain ⟨n, hn⟩ := ih + exact ⟨n + 1, Or.inr ⟨b, hn, hbc⟩⟩ + · rintro ⟨n, hn⟩ + exact finiteReach_reflTransGen hn + +theorem measurable_finiteReach {α ι : Type*} [MeasurableSpace α] [Countable ι] + {r : α → ι → ι → Prop} (hr : ∀ a b, Measurable (fun x => r x a b)) + (n : ℕ) (a b : ι) : Measurable (fun x => FiniteReach (r x) n a b) := by + induction n generalizing a b with + | zero => exact measurable_const + | succ n ih => + exact (ih a b).or (Measurable.exists (fun c => (ih a c).and (hr c b))) + +theorem measurable_reflTransGen {α ι : Type*} [MeasurableSpace α] [Countable ι] + {r : α → ι → ι → Prop} (hr : ∀ a b, Measurable (fun x => r x a b)) + (a b : ι) : Measurable (fun x => Relation.ReflTransGen (r x) a b) := by + simpa only [reflTransGen_iff_exists_finiteReach] using + Measurable.exists (fun n => measurable_finiteReach hr n a b) + +theorem measurable_adj (u v : ℕ) : Measurable (fun G : GraphCode => Adj G u v) := by + have h₁ : Measurable (fun G : GraphCode => G.1) := measurable_subtype_coe + have h₂ : Measurable (fun G : GraphCode => G.1 u) := + (measurable_pi_apply u).comp h₁ + have h₃ : Measurable (fun G : GraphCode => G.1 u v) := + (measurable_pi_apply v).comp h₂ + exact h₃.eq_const true + +theorem measurable_graphConnected : Measurable (GraphConnected : GraphCode → Prop) := by + exact Measurable.forall (fun u => Measurable.forall (fun v => + measurable_reflTransGen measurable_adj u v)) + +theorem measurableSet_graphConnected : MeasurableSet {G : GraphCode | GraphConnected G} := + measurable_graphConnected.setOf + +private theorem finite_setOf_iff {ι : Type*} (p : ι → Prop) : + Set.Finite {i | p i} ↔ ∃ s : Finset ι, ∀ i, p i → i ∈ s := by + classical + constructor + · intro h + exact ⟨h.toFinset, fun i hi => h.mem_toFinset.mpr hi⟩ + · rintro ⟨s, hs⟩ + exact s.finite_toSet.subset hs + +theorem measurable_finite_setOf {α ι : Type*} [MeasurableSpace α] [Countable ι] + {p : α → ι → Prop} (hp : ∀ i, Measurable (fun x => p x i)) : + Measurable (fun x => Set.Finite {i | p x i}) := by + simp only [finite_setOf_iff] + exact Measurable.exists (fun s => Measurable.forall (fun i => + (hp i).imp measurable_const)) + +theorem measurable_graphLocallyFinite : Measurable (GraphLocallyFinite : GraphCode → Prop) := by + exact Measurable.forall (fun u => measurable_finite_setOf (fun v => measurable_adj u v)) + +theorem measurableSet_graphLocallyFinite : + MeasurableSet {G : GraphCode | GraphLocallyFinite G} := + measurable_graphLocallyFinite.setOf + +theorem measurableSet_graphSupported : + MeasurableSet {G : GraphCode | GraphConnected G ∧ GraphLocallyFinite G} := + measurableSet_graphConnected.inter measurableSet_graphLocallyFinite + +theorem measurable_isFiniteConnectedSubgraph (K : FiniteSubgraphCode) : + Measurable (fun G : GraphCode => IsFiniteConnectedSubgraph G K) := by + exact measurable_const.and ((Measurable.forall (fun p : ℕ × ℕ => + measurable_const.imp (measurable_const.and (measurable_const.and + (measurable_const.and (measurable_adj p.1 p.2)))))).and measurable_const) + +theorem measurable_isConnectedExhaustion (H : ℕ → FiniteSubgraphCode) : + Measurable (fun G : GraphCode => IsConnectedExhaustion G H) := by + exact (Measurable.forall (fun n => measurable_isFiniteConnectedSubgraph (H n))).and + (measurable_const.and (Measurable.forall (fun u => Measurable.forall (fun v => + measurable_const.imp ((measurable_adj u v).imp measurable_const))))) + +theorem measurable_injective_labels : + Measurable (fun U : ℕ → ℝ => Function.Injective U) := by + exact Measurable.forall (fun u => Measurable.forall (fun v => + ((measurable_pi_apply u).eq (measurable_pi_apply v)).imp measurable_const)) + +theorem measurableSet_injective_labels : + MeasurableSet {U : ℕ → ℝ | Function.Injective U} := + measurable_injective_labels.setOf + +end Problem336.GraphBorel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphCoordinateTruncation.lean b/lean/OAI/Probability/SpanningForest/GraphCoordinateTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..01a197d76a41198d0e01eb02cbbb0b43dd55ab88 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphCoordinateTruncation.lean @@ -0,0 +1,59 @@ +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.CoordinateTruncation + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology + +namespace Problem336.CoordinateTruncation + +def finiteEdges (K : FiniteSubgraphCode) : Finset EdgeCode := + K.2.subtype (fun p => p.1 < p.2) + +@[simp] theorem mem_finiteEdges (K : FiniteSubgraphCode) (e : EdgeCode) : + e ∈ finiteEdges K ↔ e.1 ∈ K.2 := by + simp [finiteEdges] + +def graphEdges (G : GraphCode) : Set EdgeCode := + {e | Adj G e.1.1 e.1.2} + +theorem exhaustion_finiteEdges_monotone {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) : + Monotone (fun n => finiteEdges (H n)) := by + apply monotone_nat_of_le_succ + intro n e he + apply (mem_finiteEdges (H (n + 1)) e).mpr + exact (hH.2.1 n).2 ((mem_finiteEdges (H n) e).mp he) + +theorem exhaustion_graphEdges {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (e : EdgeCode) : + e ∈ graphEdges G ↔ ∃ n, e ∈ finiteEdges (H n) := by + constructor + · intro he + obtain ⟨n, hn⟩ := hH.2.2 e.1.1 e.1.2 e.2 he + exact ⟨n, (mem_finiteEdges (H n) e).mpr hn⟩ + · rintro ⟨n, hn⟩ + exact ((hH.1 n).2.1 e.1 ((mem_finiteEdges (H n) e).mp hn)).2.2.2 + +theorem graph_coordinate_closure {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) : + (⨆ n, supported (𝕜 := ℝ) (finiteEdges (H n) : Set EdgeCode)).topologicalClosure = + supported (graphEdges G) := + closure_iSup_supported (fun n => finiteEdges (H n)) (graphEdges G) + (exhaustion_graphEdges hH) + +theorem graph_truncate_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (x : Space EdgeCode ℝ) : + Tendsto (fun n => truncate (finiteEdges (H n)) x) atTop + (𝓝 ((supported (graphEdges G)).starProjection x)) := + tendsto_truncate_supported (fun n => finiteEdges (H n)) + (exhaustion_finiteEdges_monotone hH) (graphEdges G) (exhaustion_graphEdges hH) x + +end Problem336.CoordinateTruncation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphDomain.lean b/lean/OAI/Probability/SpanningForest/GraphDomain.lean new file mode 100644 index 0000000000000000000000000000000000000000..1997d02d6f04bcf433c89275cf0e7ea390b571fb --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphDomain.lean @@ -0,0 +1,88 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def ReachLength (G : GraphCode) : ℕ → ℕ → ℕ → Prop + | 0, u, v => u = v + | n + 1, u, v => ∃ w, ReachLength G n u w ∧ Adj G w v + +theorem reachLength_reflTransGen {G : GraphCode} {n u v : ℕ} + (h : ReachLength G n u v) : Relation.ReflTransGen (Adj G) u v := by + induction n generalizing v with + | zero => + change u = v at h + subst v + exact .refl + | succ n ih => + obtain ⟨w, hw, hv⟩ := h + exact (ih hw).tail hv + +theorem reflTransGen_iff_exists_reachLength (G : GraphCode) (u v : ℕ) : + Relation.ReflTransGen (Adj G) u v ↔ ∃ n, ReachLength G n u v := by + constructor + · intro h + induction h with + | refl => exact ⟨0, rfl⟩ + | @tail v w h hv ih => + obtain ⟨n, hn⟩ := ih + exact ⟨n + 1, v, hn, hv⟩ + · rintro ⟨n, hn⟩ + exact reachLength_reflTransGen hn + +theorem measurable_adj (u v : ℕ) : + Measurable (fun G : GraphCode => Adj G u v) := by + have h : Measurable (fun G : GraphCode => G.1 u v) := + (measurable_pi_apply v).comp + ((measurable_pi_apply u).comp measurable_subtype_coe) + exact h.eq_const true + +theorem measurable_reachLength (n u v : ℕ) : + Measurable (fun G : GraphCode => ReachLength G n u v) := by + induction n generalizing v with + | zero => exact measurable_const + | succ n ih => + exact Measurable.exists (fun w => (ih w).and (measurable_adj w v)) + +theorem measurable_reflTransGen (u v : ℕ) : + Measurable (fun G : GraphCode => Relation.ReflTransGen (Adj G) u v) := by + simp_rw [reflTransGen_iff_exists_reachLength] + exact Measurable.exists (fun n => measurable_reachLength n u v) + +theorem measurable_graphConnected : Measurable GraphConnected := by + exact Measurable.forall (fun u => + Measurable.forall (fun v => measurable_reflTransGen u v)) + +theorem measurableSet_graphConnected : + MeasurableSet {G : GraphCode | GraphConnected G} := + measurable_graphConnected.setOf + +theorem graphLocallyFinite_iff_bounded_neighbors (G : GraphCode) : + GraphLocallyFinite G ↔ ∀ u, ∃ n, ∀ v, Adj G u v → v ≤ n := by + simp only [GraphLocallyFinite, Set.finite_iff_bddAbove] + rfl + +theorem measurable_graphLocallyFinite : Measurable GraphLocallyFinite := by + change Measurable (fun G : GraphCode => GraphLocallyFinite G) + simp_rw [graphLocallyFinite_iff_bounded_neighbors] + exact Measurable.forall (fun u => Measurable.exists (fun n => + Measurable.forall (fun v => (measurable_adj u v).imp measurable_const))) + +theorem measurableSet_graphLocallyFinite : + MeasurableSet {G : GraphCode | GraphLocallyFinite G} := + measurable_graphLocallyFinite.setOf + +theorem measurableSet_validGraph : + MeasurableSet {G : GraphCode | GraphConnected G ∧ GraphLocallyFinite G} := + measurableSet_graphConnected.inter measurableSet_graphLocallyFinite + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphEncoding.lean b/lean/OAI/Probability/SpanningForest/GraphEncoding.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa5a5d19ba8a6e6d7d14ccbcc5999cca51aea1bd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphEncoding.lean @@ -0,0 +1,248 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section +namespace Problem336 +namespace FiniteEncoding + +lemma rawPair_comm (u v : ℕ) : rawPair u v = rawPair v u := by + unfold rawPair + split_ifs <;> simp_all <;> omega + +def graph (K : FiniteSubgraphCode) : SimpleGraph {v : ℕ // v ∈ K.1} where + Adj u v := u ≠ v ∧ rawPair u.1 v.1 ∈ K.2 + symm := ⟨by + intro u v h + exact ⟨h.1.symm, by simpa [rawPair_comm] using h.2⟩⟩ + loopless := ⟨by + intro u h + exact h.1 rfl⟩ + +lemma rawPair_self (u : ℕ) : rawPair u u = (u,u) := by simp [rawPair] + +lemma rawPair_ne_of_mem {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {u v : ℕ} + (h : rawPair u v ∈ K.2) : u ≠ v := by + intro huv + subst v + have hp := (hK.2.1 _ h).2.2.1 + simp [rawPair_self] at hp + +lemma reachable_of_subgraphPath {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {u v : ℕ} + (p : Relation.ReflTransGen (SubgraphAdj K) u v) + (hu : u ∈ K.1) (hv : v ∈ K.1) : + (graph K).Reachable ⟨u, hu⟩ ⟨v, hv⟩ := by + induction p with + | refl => exact SimpleGraph.Reachable.refl _ + | @tail w z p hwz ih => + exact (ih hwz.1).trans (SimpleGraph.Adj.reachable (G := graph K) + ⟨by intro he; exact rawPair_ne_of_mem hK hwz.2.2 (congrArg Subtype.val he), hwz.2.2⟩) + +lemma connected {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : (graph K).Connected := by + obtain ⟨u, hu⟩ := hK.1 + let : Nonempty {v : ℕ // v ∈ K.1} := ⟨⟨u, hu⟩⟩ + exact ⟨fun v w => reachable_of_subgraphPath hK + (hK.2.2 v.1 v.2 w.1 w.2) v.2 w.2⟩ + +def edgePair {s : Finset ℕ} : Sym2 {v : ℕ // v ∈ s} → ℕ × ℕ := + Sym2.lift ⟨fun u v => rawPair u.1 v.1, fun u v => rawPair_comm u.1 v.1⟩ + +@[simp] lemma edgePair_mk {s : Finset ℕ} (u v : {v : ℕ // v ∈ s}) : + edgePair s(u,v) = rawPair u.1 v.1 := rfl + +lemma edgePair_forget {s : Finset ℕ} (e : Sym2 {v : ℕ // v ∈ s}) : + s((edgePair e).1, (edgePair e).2) = Sym2.map Subtype.val e := by + induction e using Sym2.inductionOn with + | _ u v => + simp only [edgePair_mk, Sym2.map_mk] + unfold rawPair + split_ifs + · rfl + · exact Sym2.eq_swap + +lemma edgePair_injective {s : Finset ℕ} : + Function.Injective (edgePair (s := s)) := by + intro a b hab + apply Sym2.map.injective Subtype.val_injective + rw [← edgePair_forget a, ← edgePair_forget b, hab] + +def edgePairs {s : Finset ℕ} (F : SimpleGraph {v : ℕ // v ∈ s}) : + Finset (ℕ × ℕ) := by + classical + exact F.edgeFinset.image edgePair + +lemma card_edgePairs {s : Finset ℕ} (F : SimpleGraph {v : ℕ // v ∈ s}) : + (edgePairs F).card = Nat.card F.edgeSet := by + classical + rw [edgePairs, Finset.card_image_of_injective _ edgePair_injective, + SimpleGraph.edgeFinset, Set.toFinset_card, Nat.card_eq_fintype_card] + +lemma rawPair_mem_edgePairs {s : Finset ℕ} {F : SimpleGraph {v : ℕ // v ∈ s}} + {u v : {v : ℕ // v ∈ s}} (h : F.Adj u v) : + rawPair u.1 v.1 ∈ edgePairs F := by + classical + exact Finset.mem_image.mpr ⟨s(u,v), by simpa using h, rfl⟩ + +lemma edgePairs_subset {K : FiniteSubgraphCode} + {F : SimpleGraph {v : ℕ // v ∈ K.1}} (hF : F ≤ graph K) : + edgePairs F ⊆ K.2 := by + classical + intro p hp + obtain ⟨e, he, rfl⟩ := Finset.mem_image.mp hp + induction e using Sym2.inductionOn with + | _ u v => + have h : F.Adj u v := by simpa using he + exact (hF h).2 + +lemma treeOn_edgePairs {K : FiniteSubgraphCode} + {F : SimpleGraph {v : ℕ // v ∈ K.1}} + (hF : F ≤ graph K) (hT : F.IsTree) : TreeOn K (edgePairs F) := by + classical + refine ⟨edgePairs_subset hF, ?_, ?_⟩ + · rw [card_edgePairs] + simpa [SimpleGraph.edgeFinset, Nat.card_eq_fintype_card] using hT.card_edgeFinset + · intro u hu v hv + have hp := (F.reachable_iff_reflTransGen _ _).mp + (hT.connected ⟨u, hu⟩ ⟨v,hv⟩) + exact hp.lift Subtype.val (fun a b hab => rawPair_mem_edgePairs hab) + +lemma rawPair_mem_endpoints {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {u v : ℕ} + (h : rawPair u v ∈ K.2) : u ∈ K.1 ∧ v ∈ K.1 := by + have hp := hK.2.1 _ h + unfold rawPair at hp + split_ifs at hp with huv + · exact ⟨hp.1, hp.2.1⟩ + · exact ⟨hp.2.1, hp.1⟩ + +lemma edgePairs_graph {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : edgePairs (graph K) = K.2 := by + classical + apply Finset.Subset.antisymm (edgePairs_subset le_rfl) + intro p hp + obtain ⟨hu, hv, huv, _⟩ := hK.2.1 p hp + have hadj : (graph K).Adj ⟨p.1,hu⟩ ⟨p.2,hv⟩ := by + refine ⟨?_, ?_⟩ + · intro h + exact Nat.ne_of_lt huv (congrArg Subtype.val h) + · simpa [rawPair, huv] using hp + simpa [rawPair, huv] using rawPair_mem_edgePairs hadj + +lemma finiteConnected_treeCode {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} + (hT : TreeOn K T) : IsFiniteConnectedSubgraph G (K.1,T) := by + refine ⟨hK.1, ?_, ?_⟩ + · intro p hp + exact hK.2.1 p (hT.1 hp) + · intro u hu v hv + have hrel : TreeAdj T ≤ SubgraphAdj (K.1,T) := by + intro a b hab + have hm := rawPair_mem_endpoints hK (hT.1 hab) + exact ⟨hm.1, hm.2, hab⟩ + exact Relation.ReflTransGen.mono hrel _ _ (hT.2.2 u hu v hv) + +lemma isTree_graph_treeCode {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} + (hT : TreeOn K T) : (graph (K.1,T)).IsTree := by + have hc := finiteConnected_treeCode hK hT + apply SimpleGraph.isTree_iff_connected_and_card.mpr + refine ⟨connected hc, ?_⟩ + rw [← card_edgePairs, edgePairs_graph hc] + simpa [Nat.card_eq_fintype_card] using hT.2.1 + +lemma rawPair_mem_edgePairs_iff {s : Finset ℕ} + {F : SimpleGraph {v : ℕ // v ∈ s}} {u v : {v : ℕ // v ∈ s}} : + rawPair u.1 v.1 ∈ edgePairs F ↔ F.Adj u v := by + classical + constructor + · intro h + obtain ⟨e, he, heq⟩ := Finset.mem_image.mp h + have heq' : e = s(u,v) := edgePair_injective heq + subst e + simpa using he + · exact rawPair_mem_edgePairs + +lemma graph_edgePairs {s : Finset ℕ} (F : SimpleGraph {v : ℕ // v ∈ s}) : + graph (s, edgePairs F) = F := by + ext u v + change (u ≠ v ∧ rawPair u.1 v.1 ∈ edgePairs F) ↔ F.Adj u v + rw [rawPair_mem_edgePairs_iff] + exact ⟨And.right, fun h => ⟨h.ne, h⟩⟩ + +lemma edgePairs_graph_of_valid {K : FiniteSubgraphCode} + (hK : ∀ p ∈ K.2, p.1 ∈ K.1 ∧ p.2 ∈ K.1 ∧ p.1 < p.2) : + edgePairs (graph K) = K.2 := by + classical + apply Finset.Subset.antisymm (edgePairs_subset le_rfl) + intro p hp + obtain ⟨hu, hv, huv⟩ := hK p hp + have hadj : (graph K).Adj ⟨p.1,hu⟩ ⟨p.2,hv⟩ := by + refine ⟨?_, ?_⟩ + · intro h + exact Nat.ne_of_lt huv (congrArg Subtype.val h) + · simpa [rawPair, huv] using hp + simpa [rawPair, huv] using rawPair_mem_edgePairs hadj + +lemma treeOn_iff_isTree {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) {T : Finset (ℕ × ℕ)} + (hsub : T ⊆ K.2) : TreeOn K T ↔ (graph (K.1,T)).IsTree := by + constructor + · exact isTree_graph_treeCode hK + · intro hT + have hle : graph (K.1,T) ≤ graph K := by + intro u v h + exact ⟨h.1, hsub h.2⟩ + have hvalid : ∀ p ∈ T, p.1 ∈ K.1 ∧ p.2 ∈ K.1 ∧ p.1 < p.2 := by + intro p hp + have h := hK.2.1 p (hsub hp) + exact ⟨h.1, h.2.1, h.2.2.1⟩ + have h := treeOn_edgePairs (K := K) hle hT + rw [edgePairs_graph_of_valid (K := (K.1,T)) hvalid] at h + exact h + +lemma mem_spanningTrees_iff {K : FiniteSubgraphCode} {T : Finset (ℕ × ℕ)} : + T ∈ spanningTrees K ↔ TreeOn K T := by + classical + simp only [spanningTrees, Finset.mem_filter, Finset.mem_powerset] + exact ⟨And.right, fun h => ⟨h.1,h⟩⟩ + +def spanningTreeEquiv {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : + {T : Finset (ℕ × ℕ) // T ∈ spanningTrees K} ≃ + {F : SimpleGraph {v : ℕ // v ∈ K.1} // F ≤ graph K ∧ F.IsTree} where + toFun T := by + have ht := mem_spanningTrees_iff.mp T.2 + refine ⟨graph (K.1,T.1), ?_, isTree_graph_treeCode hK ht⟩ + intro u v h + exact ⟨h.1, ht.1 h.2⟩ + invFun F := ⟨edgePairs F.1, mem_spanningTrees_iff.mpr (treeOn_edgePairs F.2.1 F.2.2)⟩ + left_inv T := by + apply Subtype.ext + apply edgePairs_graph_of_valid (K := (K.1,T.1)) + intro p hp + have h := hK.2.1 p ((mem_spanningTrees_iff.mp T.2).1 hp) + exact ⟨h.1, h.2.1, h.2.2.1⟩ + right_inv F := by + apply Subtype.ext + exact graph_edgePairs F.1 + +lemma card_spanningTrees {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : + (spanningTrees K).card = + Nat.card {F : SimpleGraph {v : ℕ // v ∈ K.1} // F ≤ graph K ∧ F.IsTree} := by + rw [← Nat.card_congr (spanningTreeEquiv hK), Nat.card_eq_fintype_card, Fintype.card_coe] + +lemma spanningTrees_nonempty {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) : (spanningTrees K).Nonempty := by + obtain ⟨F, hF, hT⟩ := (connected hK).exists_isTree_le + exact ⟨edgePairs F, mem_spanningTrees_iff.mpr (treeOn_edgePairs hF hT)⟩ + +end FiniteEncoding +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphFUSFLaw.lean b/lean/OAI/Probability/SpanningForest/GraphFUSFLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..6538019d21495888dffc8be54bd9a0861a2a1bf9 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphFUSFLaw.lean @@ -0,0 +1,51 @@ +import OAI.Probability.SpanningForest.USTFiniteDeterminantal +import OAI.Probability.SpanningForest.GraphFreeKernel +import OAI.Probability.SpanningForest.FUSFExistenceReduction +import OAI.Probability.SpanningForest.IntrinsicExhaustion +import OAI.Probability.SpanningForest.Exhaustion + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +theorem exists_connectedExhaustion (G : GraphCode) + (hC : GraphConnected G) (hL : GraphLocallyFinite G) : + ∃ H : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H := by + obtain ⟨v, hv⟩ := hC.exists_adj 0 + have hv0 : v ≠ 0 := by + intro h + subst v + simp [Adj, G.2.1 0] at hv + let e : EdgeCode := ⟨(0, v), Nat.pos_of_ne_zero hv0⟩ + exact ⟨IntrinsicExhaustion.edgeBallSubgraph G hL e, + IntrinsicExhaustion.isConnectedExhaustion_edgeBallSubgraph hC hL e hv⟩ + +theorem exists_hasFUSFLaw_of_finite_identity (G : GraphCode) + (hC : GraphConnected G) (hL : GraphLocallyFinite G) + (hfinite : ∀ K : FiniteSubgraphCode, IsFiniteConnectedSubgraph G K → + ∀ A : Finset EdgeCode, + ustCylinder K A ∅ = FreeKernel.finiteInclusionMinor K A) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := by + obtain ⟨H, hH⟩ := exists_connectedExhaustion G hC hL + exact exists_hasFUSFLaw_of_inclusion_limits G H hH + (FreeKernel.inclusionMinorLimit G) + (FreeKernel.common_inclusion_limits_of_finite_identity G hfinite) + +theorem exists_hasFUSFLaw (G : GraphCode) + (hC : GraphConnected G) (hL : GraphLocallyFinite G) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := by + apply exists_hasFUSFLaw_of_finite_identity G hC hL + intro K hK A + exact FreeKernel.ustCylinder_eq_finiteKernel_minor hK A + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphFreeKernel.lean b/lean/OAI/Probability/SpanningForest/GraphFreeKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..44cd64e10af92d17ba1897c1b799309a51ff9c10 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphFreeKernel.lean @@ -0,0 +1,146 @@ +import OAI.Probability.SpanningForest.AlgebraicCycleSpace +import OAI.Probability.SpanningForest.GraphCoordinateTruncation + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology ENNReal + +namespace Problem336.FreeKernel + +open CoordinateTruncation + +instance complete_closedGraphCycleSpace (G : GraphCode) : + CompleteSpace (closedGraphCycleSpace G) := by + unfold closedGraphCycleSpace + infer_instance + +instance projection_closedGraphCycleSpace (G : GraphCode) : + (closedGraphCycleSpace G).HasOrthogonalProjection := + Submodule.HasOrthogonalProjection.ofCompleteSpace _ + +def finiteKernel (K : FiniteSubgraphCode) : EdgeHilbert →L[ℝ] EdgeHilbert := + truncate (finiteEdges K) - (finiteHilbertCycleSpace K).starProjection + +def graphKernel (G : GraphCode) : EdgeHilbert →L[ℝ] EdgeHilbert := + (supported (graphEdges G)).starProjection - (closedGraphCycleSpace G).starProjection + +theorem cycle_projection_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (x : EdgeHilbert) : + Tendsto (fun n => (finiteHilbertCycleSpace (H n)).starProjection x) atTop + (𝓝 ((closedGraphCycleSpace G).starProjection x)) := by + have h := Submodule.starProjection_tendsto_closure_iSup + (fun n => finiteHilbertCycleSpace (H n)) hH.finiteHilbertCycleSpace_monotone x + simpa only [hH.closure_iSup_finiteHilbertCycleSpace] using h + +theorem finiteKernel_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (x : EdgeHilbert) : + Tendsto (fun n => finiteKernel (H n) x) atTop (𝓝 (graphKernel G x)) := by + simpa only [finiteKernel, graphKernel, sub_apply] using + (graph_truncate_tendsto hH x).sub (cycle_projection_tendsto hH x) + +theorem finiteKernel_inner_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (x y : EdgeHilbert) : + Tendsto (fun n => inner ℝ x (finiteKernel (H n) y)) atTop + (𝓝 (inner ℝ x (graphKernel G y))) := + tendsto_const_nhds.inner (finiteKernel_tendsto hH y) + +theorem finiteKernel_minor_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) {ι : Type*} [Fintype ι] [DecidableEq ι] + (v : ι → EdgeHilbert) : + Tendsto (fun n => Matrix.det (fun i j => inner ℝ (v i) (finiteKernel (H n) (v j)))) + atTop (𝓝 (Matrix.det (fun i j => inner ℝ (v i) (graphKernel G (v j))))) := by + have hd : Continuous (Matrix.det : Matrix ι ι ℝ → ℝ) := continuous_id.matrix_det + apply (hd.tendsto _).comp + refine tendsto_pi_nhds.mpr fun i => tendsto_pi_nhds.mpr fun j => ?_ + exact finiteKernel_inner_tendsto hH (v i) (v j) + +def edgeVector (e : EdgeCode) : EdgeHilbert := lp.single 2 e (1 : ℝ) + +def kernelEntry (G : GraphCode) (e f : EdgeCode) : ℝ := + inner ℝ (edgeVector e) (graphKernel G (edgeVector f)) + +theorem finiteKernel_edge_minor_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) {ι : Type*} [Fintype ι] [DecidableEq ι] + (e : ι → EdgeCode) : + Tendsto (fun n => Matrix.det (fun i j => + inner ℝ (edgeVector (e i)) (finiteKernel (H n) (edgeVector (e j))))) + atTop (𝓝 (Matrix.det (fun i j => kernelEntry G (e i) (e j)))) := + finiteKernel_minor_tendsto hH (fun i => edgeVector (e i)) + +def finiteInclusionMinor (K : FiniteSubgraphCode) (A : Finset EdgeCode) : ℝ≥0∞ := + ENNReal.ofReal (Matrix.det (fun e f : A => + inner ℝ (edgeVector e.1) (finiteKernel K (edgeVector f.1)))) + +def inclusionMinorLimit (G : GraphCode) (A : Finset EdgeCode) : ℝ≥0∞ := + ENNReal.ofReal (Matrix.det (fun e f : A => kernelEntry G e.1 f.1)) + +theorem finiteInclusionMinor_tendsto {G : GraphCode} {H : ℕ → FiniteSubgraphCode} + (hH : IsConnectedExhaustion G H) (A : Finset EdgeCode) : + Tendsto (fun n => finiteInclusionMinor (H n) A) atTop + (𝓝 (inclusionMinorLimit G A)) := by + simpa only [finiteInclusionMinor, inclusionMinorLimit, Function.comp_def] using + (ENNReal.continuous_ofReal.tendsto _).comp + (finiteKernel_edge_minor_tendsto hH (fun e : A => e.1)) + +theorem common_inclusion_limits_of_finite_identity (G : GraphCode) + (hfinite : ∀ K : FiniteSubgraphCode, IsFiniteConnectedSubgraph G K → + ∀ A : Finset EdgeCode, ustCylinder K A ∅ = finiteInclusionMinor K A) : + ∀ H : ℕ → FiniteSubgraphCode, IsConnectedExhaustion G H → + ∀ A : Finset EdgeCode, Tendsto (fun n => ustCylinder (H n) A ∅) atTop + (𝓝 (inclusionMinorLimit G A)) := by + intro H hH A + simpa only [hfinite _ (hH.1 _) A] using finiteInclusionMinor_tendsto hH A + +theorem finiteCycle_le_supported (K : FiniteSubgraphCode) : + finiteHilbertCycleSpace K ≤ supported (finiteEdges K : Set EdgeCode) := by + rintro x ⟨f, hf, rfl⟩ e he + rw [edgeFlowToHilbert_apply] + apply Finsupp.notMem_support_iff.mp + intro hes + apply he + exact (mem_finiteEdges K e).mpr (((mem_finiteCycleSpace K f).mp hf).1 e hes) + +theorem finiteKernel_mem_supported (K : FiniteSubgraphCode) (x : EdgeHilbert) : + finiteKernel K x ∈ supported (finiteEdges K : Set EdgeCode) := + (supported (finiteEdges K : Set EdgeCode)).sub_mem + (truncate_mem_supported (finiteEdges K) x) + (finiteCycle_le_supported K ((finiteHilbertCycleSpace K).starProjection_apply_mem x)) + +theorem finiteKernel_inner_edge_eq_zero_of_not_mem (K : FiniteSubgraphCode) + (e : EdgeCode) (x : EdgeHilbert) (he : e.1 ∉ K.2) : + inner ℝ (edgeVector e) (finiteKernel K x) = 0 := by + rw [edgeVector, lp.inner_single_left] + have hz := finiteKernel_mem_supported K x e + (fun h => he ((mem_finiteEdges K e).mp h)) + simpa using hz + +theorem graphCycle_le_supported (G : GraphCode) : + closedGraphCycleSpace G ≤ supported (graphEdges G) := by + apply Submodule.topologicalClosure_minimal + · rintro x ⟨f, hf, rfl⟩ e he + rw [edgeFlowToHilbert_apply] + apply Finsupp.notMem_support_iff.mp + intro hes + exact he (((mem_graphCycleSpace G f).mp hf).1 e hes) + · exact supported_isClosed _ + +theorem graphKernel_mem_supported (G : GraphCode) (x : EdgeHilbert) : + graphKernel G x ∈ supported (graphEdges G) := + (supported (graphEdges G)).sub_mem + ((supported (graphEdges G)).starProjection_apply_mem x) + (graphCycle_le_supported G ((closedGraphCycleSpace G).starProjection_apply_mem x)) + +@[simp] theorem kernelEntry_eq_zero_of_not_adj (G : GraphCode) (e f : EdgeCode) + (he : ¬ Adj G e.1.1 e.1.2) : kernelEntry G e f = 0 := by + rw [kernelEntry, edgeVector, lp.inner_single_left] + simp only [RCLike.inner_apply, starRingEnd_apply, star_one, mul_one] + exact graphKernel_mem_supported G (edgeVector f) e he + +end Problem336.FreeKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphLaw.lean b/lean/OAI/Probability/SpanningForest/GraphLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e7d13831768c09f7f9bcbad33e9e7672c7b1b05 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphLaw.lean @@ -0,0 +1,50 @@ +import OAI.Probability.SpanningForest.USTDeterminant +import OAI.Probability.SpanningForest.FUSFExistenceReduction +import OAI.Probability.SpanningForest.ExhaustionExistence +import OAI.Probability.SpanningForest.EquivariantFUSFKernel + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped ENNReal Topology + +namespace Problem336.GraphLaw + +theorem positive_cylinders_tendsto {G : GraphCode} + {H : ℕ → FiniteSubgraphCode} (hH : IsConnectedExhaustion G H) + (A : Finset EdgeCode) : + Tendsto (fun n => ustCylinder (H n) A ∅) atTop + (𝓝 (ENNReal.ofReal (Matrix.det + (fun e f : A => FreeKernel.kernelEntry G e.val f.val)))) := by + classical + simp_rw [FreeKernel.ustCylinder_positive_eq_finiteKernel_det (hH.1 _)] + exact ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (FreeKernel.finiteKernel_edge_minor_tendsto hH (fun e : A => e.val)) + +theorem exists_fusf_probability (G : GraphCode) (hG : GraphConnected G) : + ∃ μ : ProbabilityMeasure EdgeConfiguration, + HasFUSFLaw G (μ : Measure EdgeConfiguration) id := by + classical + obtain ⟨H, hH⟩ := hG.exists_connected_exhaustion + exact exists_hasFUSFLaw_of_inclusion_limits G H hH + (fun A => ENNReal.ofReal (Matrix.det + (fun e f : A => FreeKernel.kernelEntry G e.val f.val))) + (fun _ hH' A => positive_cylinders_tendsto hH' A) + +theorem exists_equivariant_fusf_kernel : + ∃ μ : GraphCode → ProbabilityMeasure EdgeConfiguration, + Measurable μ ∧ + (∀ G, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G (μ G : Measure EdgeConfiguration) id) ∧ + (∀ (σ : Equiv ℕ ℕ) (G : GraphCode), + (μ G : Measure EdgeConfiguration).map (configurationRelabel σ) = + (μ (relabelGraph σ G) : Measure EdgeConfiguration)) := + BorelFUSFKernel.exists_measurable_equivariant_fusf_kernel + (fun G hG _ => exists_fusf_probability G hG) + +end Problem336.GraphLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphTreePosterior.lean b/lean/OAI/Probability/SpanningForest/GraphTreePosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa7721b38508a53b6c719868a367547c51fb7261 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphTreePosterior.lean @@ -0,0 +1,175 @@ +import OAI.Probability.SpanningForest.IntrinsicBridge +import OAI.Probability.SpanningForest.Exhaustion + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.GraphTreePosterior + +def energy (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := by + classical + exact ∑ f ∈ S, if f.1 ∈ T then y f - t / 2 else 0 + +def weight (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := Real.exp (energy T S t y) + +def partition (K : FiniteSubgraphCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := + ∑ T ∈ spanningTrees K, weight T S t y + +def numerator (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := by + classical + exact ∑ T ∈ (spanningTrees K).filter (fun T => e.1 ∈ T), weight T S t y + +def mean (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := numerator K e S t y / partition K S t y + +theorem weight_pos (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : 0 < weight T S t y := Real.exp_pos _ + +theorem partition_nonneg (K : FiniteSubgraphCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : 0 ≤ partition K S t y := + Finset.sum_nonneg (fun T _ => (weight_pos T S t y).le) + +theorem partition_pos {K : FiniteSubgraphCode} (hK : (spanningTrees K).Nonempty) + (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : 0 < partition K S t y := + Finset.sum_pos (fun T _ => weight_pos T S t y) hK + +theorem numerator_nonneg (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : 0 ≤ numerator K e S t y := + Finset.sum_nonneg (fun T _ => (weight_pos T S t y).le) + +theorem numerator_le_partition (K : FiniteSubgraphCode) (e : EdgeCode) + (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + numerator K e S t y ≤ partition K S t y := by + classical + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun T _ _ => (weight_pos T S t y).le) + +theorem mean_mem_Icc (K : FiniteSubgraphCode) (e : EdgeCode) + (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y ∈ Set.Icc (0 : ℝ) 1 := by + refine ⟨div_nonneg (numerator_nonneg K e S t y) (partition_nonneg K S t y), ?_⟩ + by_cases h : partition K S t y = 0 + · simp [mean, h] + · exact (div_le_one (lt_of_le_of_ne (partition_nonneg K S t y) (Ne.symm h))).2 + (numerator_le_partition K e S t y) + +theorem measurable_energy (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => energy T S q.1 q.2) := by + classical + apply Finset.measurable_sum + intro f _ + by_cases hf : f.1 ∈ T + · have hy : Measurable (fun q : ℝ × (EdgeCode → ℝ) => q.2 f) := + (measurable_pi_apply f).comp measurable_snd + have ht : Measurable (fun q : ℝ × (EdgeCode → ℝ) => q.1 / 2) := + measurable_fst.div_const (2 : ℝ) + simpa only [hf, ite_true, Pi.sub_def] using hy.sub ht + · simp only [hf, ite_false] + exact measurable_const + +theorem measurable_weight (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => weight T S q.1 q.2) := + (measurable_energy T S).exp + +theorem measurable_partition (K : FiniteSubgraphCode) (S : Finset EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => partition K S q.1 q.2) := + Finset.measurable_sum _ (fun T _ => measurable_weight T S) + +theorem measurable_numerator (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => numerator K e S q.1 q.2) := + Finset.measurable_sum _ (fun T _ => measurable_weight T S) + +theorem measurable_mean (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => mean K e S q.1 q.2) := + (measurable_numerator K e S).div (measurable_partition K S) + +theorem measurable_mean_joint : + Measurable (fun q : (FiniteSubgraphCode × (EdgeCode × Finset EdgeCode)) × + (ℝ × (EdgeCode → ℝ)) => mean q.1.1 q.1.2.1 q.1.2.2 q.2.1 q.2.2) := by + apply measurable_from_prod_countable_right + intro q + exact measurable_mean q.1 q.2.1 q.2.2 + +theorem mean_zero (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) : + mean K e S 0 (fun _ => 0) = (ustCylinder K {e} ∅).toReal := by + classical + simp [mean, numerator, partition, weight, energy, ustCylinder, ENNReal.toReal_div] + +theorem mean_of_not_mem {K : FiniteSubgraphCode} {e : EdgeCode} + (he : e.1 ∉ K.2) (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y = 0 := by + classical + have hempty : (spanningTrees K).filter (fun T => e.1 ∈ T) = ∅ := by + apply Finset.filter_eq_empty_iff.mpr + intro T hT heT + have hTree : TreeOn K T := (Finset.mem_filter.mp hT).2 + exact he (hTree.1 heT) + simp [mean, numerator, hempty] + +def edgeCodes (K : FiniteSubgraphCode) : Finset EdgeCode := + K.2.subtype (fun p => p.1 < p.2) + +@[simp] theorem mem_edgeCodes (K : FiniteSubgraphCode) (e : EdgeCode) : + e ∈ edgeCodes K ↔ e.1 ∈ K.2 := Finset.mem_subtype + +theorem measurable_edgeCodes : Measurable edgeCodes := measurable_of_countable _ + +theorem mean_congr_field (K : FiniteSubgraphCode) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y z : EdgeCode → ℝ) (h : ∀ f ∈ S, y f = z f) : + mean K e S t y = mean K e S t z := by + have hw (T : Finset (ℕ × ℕ)) : weight T S t y = weight T S t z := by + unfold weight energy + congr 1 + apply Finset.sum_congr rfl + intro f hf + rw [h f hf] + simp only [mean, numerator, partition, hw] + +def finiteBallMean (G : GraphCode) (e : EdgeCode) (n m : ℕ) + (t : ℝ) (y : EdgeCode → ℝ) : ℝ := + mean (Intrinsic.exhaustion G e m) e (edgeCodes (Intrinsic.exhaustion G e n)) t y + +theorem finiteBallMean_mem_Icc (G : GraphCode) (e : EdgeCode) (n m : ℕ) + (t : ℝ) (y : EdgeCode → ℝ) : + finiteBallMean G e n m t y ∈ Set.Icc (0 : ℝ) 1 := + mean_mem_Icc (Intrinsic.exhaustion G e m) e (edgeCodes (Intrinsic.exhaustion G e n)) t y + +theorem measurable_finiteBallMean (e : EdgeCode) (n m : ℕ) : + Measurable (fun q : GraphCode × (ℝ × (EdgeCode → ℝ)) => + finiteBallMean q.1 e n m q.2.1 q.2.2) := by + let Ω := GraphCode × (ℝ × (EdgeCode → ℝ)) + have hK0 : Measurable (fun G : GraphCode => Intrinsic.exhaustion G e m) := + Intrinsic.measurable_exhaustion.comp (measurable_id.prodMk + (measurable_const : Measurable (fun _ : GraphCode => (m, e)))) + have hS0 : Measurable (fun G : GraphCode => Intrinsic.exhaustion G e n) := + Intrinsic.measurable_exhaustion.comp (measurable_id.prodMk + (measurable_const : Measurable (fun _ : GraphCode => (n, e)))) + have hK : Measurable (fun q : Ω => Intrinsic.exhaustion q.1 e m) := + hK0.comp measurable_fst + have hS : Measurable (fun q : Ω => edgeCodes (Intrinsic.exhaustion q.1 e n)) := + measurable_edgeCodes.comp (hS0.comp measurable_fst) + have hE : Measurable (fun _ : Ω => e) := measurable_const + have hF : Measurable (fun q : Ω => q.2) := measurable_snd + have hArgs := (hK.prodMk (hE.prodMk hS)).prodMk hF + have h := measurable_mean_joint.comp hArgs + simpa only [Function.comp_def, finiteBallMean] using h + +theorem eventually_mem_observedEdges {G : GraphCode} (hC : GraphConnected G) + (hL : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.1.1 e.1.2) + (f : EdgeCode) (hf : Adj G f.1.1 f.1.2) : + ∀ᶠ n in Filter.atTop, f ∈ edgeCodes (Intrinsic.exhaustion G e n) := by + have hH := Intrinsic.isConnectedExhaustion G hC hL e he + simpa only [mem_edgeCodes] using hH.eventually_mem_edges f hf + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphTreePosteriorEquiv.lean b/lean/OAI/Probability/SpanningForest/GraphTreePosteriorEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6566af9210091642ff2949a628205a72b8cb4b3 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphTreePosteriorEquiv.lean @@ -0,0 +1,105 @@ +import OAI.Probability.SpanningForest.IntrinsicTreeDrift +import OAI.Probability.SpanningForest.IntrinsicRelabel +import OAI.Probability.SpanningForest.WeightedTreeEquiv + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.GraphTreePosterior + +theorem energy_eq_pairField (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + energy T S t y = ∑ p ∈ T, + WeightedTree.finiteField (S.image Subtype.val) t (WeightedTree.extendField y) p := by + classical + have hs : (∑ p ∈ S.image Subtype.val, + if p ∈ T then WeightedTree.extendField y p - t / 2 else 0) = + energy T S t y := by + rw [Finset.sum_image (fun _ _ _ _ h => Subtype.ext h)] + simp only [WeightedTree.extendField_apply, energy] + unfold WeightedTree.finiteField + rw [Finset.sum_ite_mem] at hs ⊢ + rw [Finset.inter_comm] at hs + exact hs.symm + +theorem mean_eq_weightedTree (K : FiniteSubgraphCode) (e : EdgeCode) + (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y = WeightedTree.inclusion K e.1 + (WeightedTree.finiteField (S.image Subtype.val) t (WeightedTree.extendField y)) := by + have hw (T : Finset (ℕ × ℕ)) : weight T S t y = + WeightedTree.weight + (WeightedTree.finiteField (S.image Subtype.val) t (WeightedTree.extendField y)) T := by + unfold weight WeightedTree.weight + rw [energy_eq_pairField] + simp only [mean, numerator, partition, WeightedTree.inclusion, + WeightedTree.numerator, WeightedTree.partition, hw] + +private theorem observed_pairs_relabel (σ : Equiv ℕ ℕ) (S : Finset EdgeCode) : + (S.image (mapEdge σ)).image Subtype.val = + relabelEdgeSet σ (S.image Subtype.val) := by + classical + simp only [relabelEdgeSet, Finset.image_image] + apply Finset.image_congr + intro e _ + exact (relabelPair_edge σ e).symm + +theorem mean_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + mean (relabelFiniteSubgraph σ K) (mapEdge σ e) (S.image (mapEdge σ)) t + (fun f => y (mapEdge σ.symm f)) = mean K e S t y := by + classical + rw [mean_eq_weightedTree, mean_eq_weightedTree, observed_pairs_relabel] + apply WeightedTree.finiteTilt_edgeField_relabel σ K hK + intro p hp + obtain ⟨f, _, rfl⟩ := Finset.mem_image.mp hp + exact f.2 + +theorem edgeCodes_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) : + edgeCodes (relabelFiniteSubgraph σ K) = (edgeCodes K).image (mapEdge σ) := by + classical + ext f + obtain ⟨e, rfl⟩ := mapEdge_surjective σ f + rw [mem_edgeCodes] + change (mapEdge σ e).1 ∈ relabelEdgeSet σ K.2 ↔ _ + rw [mem_relabelEdgeSet_iff σ K.2 hK e] + constructor + · intro he + exact Finset.mem_image.mpr ⟨e, (mem_edgeCodes K e).mpr he, rfl⟩ + · intro he + obtain ⟨f, hf, hfe⟩ := Finset.mem_image.mp he + have hfe' := mapEdge_injective σ hfe + subst f + exact (mem_edgeCodes K e).mp hf + +theorem finiteBallMean_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (e : EdgeCode) (n m : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + finiteBallMean (relabelGraph σ G) (mapEdge σ e) n m t + (fun f => y (mapEdge σ.symm f)) = finiteBallMean G e n m t y := by + have hK (k : ℕ) : ∀ p ∈ (Intrinsic.exhaustion G e k).2, p.1 < p.2 := by + intro p hp + exact ((mem_inducedCode_edges G (edgeBallCode G k e) p).mp hp).2.2.1 + simp only [finiteBallMean, Intrinsic.exhaustion_relabel, + edgeCodes_relabel σ _ (hK n)] + exact mean_relabel σ _ (hK m) e _ t y + +theorem innerMean_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (e : EdgeCode) (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + innerMean (relabelGraph σ G) (mapEdge σ e) n t + (fun f => y (mapEdge σ.symm f)) = innerMean G e n t y := by + simp only [innerMean, CanonicalDrift.outerLimit, finiteBallMean_relabel] + +theorem drift_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (t : ℝ) (y : EdgeCode → ℝ) (e : EdgeCode) : + drift (relabelGraph σ G) t (fun f => y (mapEdge σ.symm f)) (mapEdge σ e) = + drift G t y e := by + simp only [drift, CanonicalDrift.outerLimit, innerMean_relabel] + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/GraphTreeResponse.lean b/lean/OAI/Probability/SpanningForest/GraphTreeResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc4e20e98af423bc1cd8598140e878713530d6b6 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/GraphTreeResponse.lean @@ -0,0 +1,74 @@ +import OAI.Probability.SpanningForest.TreePosteriorBridge +import OAI.Probability.SpanningForest.GraphEncoding + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped Topology + +namespace Problem336 + +theorem Intrinsic.exhaustion_spanningTrees_nonempty (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.1.1 e.1.2) (n : ℕ) : + (spanningTrees (Intrinsic.exhaustion G e n)).Nonempty := + FiniteEncoding.spanningTrees_nonempty (Intrinsic.exhaustion_finiteConnected G hG e he n) + +namespace GraphTreePosterior + +theorem finiteBallMean_response_of_connected_response (G : GraphCode) + (hG : GraphLocallyFinite G) + (hresponse : ∀ (K : FiniteSubgraphCode), IsFiniteConnectedSubgraph G K → + ∀ (a b : USTResponse.FiniteEdge K → ℝ) + (e : USTResponse.FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2) + (e : EdgeCode) (n m : ℕ) (t : ℝ) (y z : EdgeCode → ℝ) + (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f ∈ edgeCodes (Intrinsic.exhaustion G e n), |y f - z f| ≤ D) : + |finiteBallMean G e n m t y - finiteBallMean G e n m t z| ≤ D / 2 := by + by_cases he : Adj G e.1.1 e.1.2 + · exact mean_response_of_inclusion_response (Intrinsic.exhaustion G e m) + (Intrinsic.exhaustion_spanningTrees_nonempty G hG e he m) + (hresponse _ (Intrinsic.exhaustion_finiteConnected G hG e he m)) + e (edgeCodes (Intrinsic.exhaustion G e n)) t y z D hD hyz + · simp only [finiteBallMean_of_not_adj e he, sub_self, abs_zero] + exact div_nonneg hD (by norm_num) + +theorem drift_response_of_connected_response (G : GraphCode) + (hG : GraphLocallyFinite G) + (hresponse : ∀ (K : FiniteSubgraphCode), IsFiniteConnectedSubgraph G K → + ∀ (a b : USTResponse.FiniteEdge K → ℝ) + (e : USTResponse.FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2) + (t : ℝ) (y z : EdgeCode → ℝ) (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f, Adj G f.1.1 f.1.2 → |y f - z f| ≤ D) (e : EdgeCode) : + |drift G t y e - drift G t z e| ≤ D / 2 := by + apply drift_response_of_finite e t y z + intro n m + apply finiteBallMean_response_of_connected_response G hG hresponse e n m t y z D hD + intro f hf + apply hyz f + exact ((mem_inducedCode_edges G (edgeBallCode G n e) f.1).mp + ((mem_edgeCodes (Intrinsic.exhaustion G e n) f).mp hf)).2.2.2 + +theorem innerMean_eq_posterior_of_graph_weak_limit (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.1.1 e.1.2) + (μ : ProbabilityMeasure EdgeConfiguration) + (hμ : Tendsto (fun m => finiteUSTProbability (Intrinsic.exhaustion G e m) + (Intrinsic.exhaustion_spanningTrees_nonempty G hG e he m)) atTop (nhds μ)) + (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + innerMean G e n t y = + TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) + (fun f => y f - t / 2) e := + innerMean_eq_posterior_of_weak_limit G e + (Intrinsic.exhaustion_spanningTrees_nonempty G hG e he) μ hμ n t y + +end GraphTreePosterior +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/HilbertBundle.lean b/lean/OAI/Probability/SpanningForest/HilbertBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..53d7a3537f1de949e99095d1e961ec8ffc0673db --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/HilbertBundle.lean @@ -0,0 +1,7 @@ +import OAI.Probability.SpanningForest.ProjectionLimit +import OAI.Probability.SpanningForest.GeneratorExhaustion +import OAI.Probability.SpanningForest.TransferProjection +import OAI.Probability.SpanningForest.FiniteCycleIncidence +import OAI.Probability.SpanningForest.GraphFreeKernel +import OAI.Probability.SpanningForest.ReducedCycleKernel +import OAI.Probability.SpanningForest.FiniteKernelBridge diff --git a/lean/OAI/Probability/SpanningForest/IIDBlocks.lean b/lean/OAI/Probability/SpanningForest/IIDBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..58a9c2ba1047e835c8a6b4e4c41e64f6cae775ef --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IIDBlocks.lean @@ -0,0 +1,55 @@ +import OAI.Probability.SpanningForest.RandomReindex + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.RandomReindex + +theorem indepFun_infinitePi_blocks + {I J L V : Type*} [MeasurableSpace V] + (ν : Measure V) [IsProbabilityMeasure ν] + (a : I → J) (b : L → J) + (hab : Disjoint (Set.range a) (Set.range b)) : + IndepFun (fun v : J → V => fun i => v (a i)) + (fun v : J → V => fun l => v (b l)) + (Measure.infinitePi (fun _ : J => ν)) := by + have hi : iIndep (fun j : J => + MeasurableSpace.comap (fun v : J → V => v j) inferInstance) + (Measure.infinitePi (fun _ : J => ν)) := + iIndepFun_infinitePi (X := fun _ x => x) (fun _ => measurable_id) + have hblocks := indep_iSup_of_disjoint + (fun j : J => (measurable_iff_comap_le.mp (measurable_pi_apply j))) hi hab + apply indep_of_indep_of_le hblocks + · rw [MeasurableSpace.comap_process_pi] + apply iSup_le + intro i + exact le_iSup_of_le (a i) (le_iSup_of_le ⟨i, rfl⟩ le_rfl) + · rw [MeasurableSpace.comap_process_pi] + apply iSup_le + intro l + exact le_iSup_of_le (b l) (le_iSup_of_le ⟨l, rfl⟩ le_rfl) + +theorem map_infinitePi_two_blocks + {I J L V : Type*} [MeasurableSpace V] + (ν : Measure V) [IsProbabilityMeasure ν] + (a : I → J) (b : L → J) + (ha : Function.Injective a) (hb : Function.Injective b) + (hab : Disjoint (Set.range a) (Set.range b)) : + (Measure.infinitePi (fun _ : J => ν)).map + (fun v : J → V => ((fun i => v (a i)), (fun l => v (b l)))) = + (Measure.infinitePi (fun _ : I => ν)).prod + (Measure.infinitePi (fun _ : L => ν)) := by + rw [(indepFun_infinitePi_blocks ν a b hab).map_prod_eq_prod_map_map + (Measurable.aemeasurable (Measurable.of_eval (fun i => measurable_pi_apply (a i)))) + (Measurable.aemeasurable (Measurable.of_eval (fun l => measurable_pi_apply (b l)))), + Measure.map_infinitePi_infinitePi_of_inj ha, + Measure.map_infinitePi_infinitePi_of_inj hb] + +end Problem336.RandomReindex + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IncidenceCirculation.lean b/lean/OAI/Probability/SpanningForest/IncidenceCirculation.lean new file mode 100644 index 0000000000000000000000000000000000000000..521554a80bb44db20b85eaadf39be6f61a69c23b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IncidenceCirculation.lean @@ -0,0 +1,132 @@ +import Mathlib.LinearAlgebra.Matrix.ToLin + +namespace OAI + +noncomputable section + +open scoped BigOperators +open Matrix + +namespace Problem336.IncidenceCirculation + +variable {V E R : Type*} [DecidableEq V] [Fintype V] [Fintype E] [CommRing R] + +def incidence (src dst : E → V) : Matrix V E R := + fun v e => (if v = src e then 1 else 0) - (if v = dst e then 1 else 0) + +def reducedIncidence (src dst : E → V) (root : V) : Matrix {v : V // v ≠ root} E R := + fun v e => incidence src dst v.1 e + +omit [Fintype E] in +@[simp] theorem sum_incidence_column (src dst : E → V) (e : E) : + ∑ v, incidence (R := R) src dst v e = 0 := by + simp [incidence, Finset.sum_sub_distrib] + +theorem sum_divergence (src dst : E → V) (x : E → R) : + ∑ v, (incidence src dst *ᵥ x) v = 0 := by + simp only [Matrix.mulVec, dotProduct] + rw [Finset.sum_comm] + simp_rw [← Finset.sum_mul, sum_incidence_column, zero_mul] + exact Finset.sum_const_zero + +theorem divergence_eq_zero_of_off_root (src dst : E → V) (root : V) (x : E → R) + (h : ∀ v, v ≠ root → (incidence src dst *ᵥ x) v = 0) : + incidence src dst *ᵥ x = 0 := by + have hroot : (incidence src dst *ᵥ x) root = 0 := by + have hsum := sum_divergence src dst x + rwa [Finset.sum_eq_single root (fun v _ hv => h v hv) (by simp)] at hsum + funext v + by_cases hv : v = root + · simpa [hv] using hroot + · exact h v hv + +theorem reduced_mulVec_eq_zero_iff (src dst : E → V) (root : V) (x : E → R) : + reducedIncidence src dst root *ᵥ x = 0 ↔ incidence src dst *ᵥ x = 0 := by + constructor + · intro h + apply divergence_eq_zero_of_off_root src dst root x + intro v hv + exact congrFun h ⟨v, hv⟩ + · intro h + funext v + exact congrFun h v.1 + +theorem reduced_mulVec_eq_zero_iff_root (src dst : E → V) (root root' : V) (x : E → R) : + reducedIncidence src dst root *ᵥ x = 0 ↔ + reducedIncidence src dst root' *ᵥ x = 0 := by + rw [reduced_mulVec_eq_zero_iff, reduced_mulVec_eq_zero_iff] + +def pushMatrix {A B : Type*} [DecidableEq B] (f : A → B) : Matrix B A R := + fun b a => if f a = b then 1 else 0 + +variable {V' E' : Type*} [DecidableEq V'] [DecidableEq E'] [finiteTargetVertices : Fintype V'] [Fintype E'] + +omit [Fintype E] [Fintype V'] in + +theorem incidence_naturality (src dst : E → V) (src' dst' : E' → V') + (f : E → E') (g : V → V') + (hsrc : ∀ e, src' (f e) = g (src e)) (hdst : ∀ e, dst' (f e) = g (dst e)) : + (incidence (R := R) src' dst' * pushMatrix f : Matrix V' E R) = + pushMatrix g * incidence src dst := by + ext v e + simp only [Matrix.mul_apply, incidence, pushMatrix] + simp [mul_sub, Finset.sum_sub_distrib, hsrc, hdst, eq_comm] + +omit [Fintype V'] in + +theorem circulation_pushForward (src dst : E → V) (src' dst' : E' → V') + (f : E → E') (g : V → V') + (hsrc : ∀ e, src' (f e) = g (src e)) (hdst : ∀ e, dst' (f e) = g (dst e)) + (x : E → R) (hx : incidence src dst *ᵥ x = 0) : + incidence src' dst' *ᵥ (pushMatrix f *ᵥ x) = 0 := by + rw [Matrix.mulVec_mulVec, incidence_naturality src dst src' dst' f g hsrc hdst, + ← Matrix.mulVec_mulVec, hx, Matrix.mulVec_zero] + +theorem reduced_circulation_pushForward (src dst : E → V) (src' dst' : E' → V') + (root : V) (root' : V') (f : E → E') (g : V → V') + (hsrc : ∀ e, src' (f e) = g (src e)) (hdst : ∀ e, dst' (f e) = g (dst e)) + (x : E → R) (hx : reducedIncidence src dst root *ᵥ x = 0) : + reducedIncidence src' dst' root' *ᵥ (pushMatrix f *ᵥ x) = 0 := by + apply (reduced_mulVec_eq_zero_iff src' dst' root' _).2 + exact circulation_pushForward src dst src' dst' f g hsrc hdst x + ((reduced_mulVec_eq_zero_iff src dst root x).1 hx) + +omit [Fintype E'] in + +theorem pushMatrix_mulVec_apply (f : E → E') (hf : Function.Injective f) (x : E → R) (e : E) : + (pushMatrix f *ᵥ x) (f e) = x e := by + classical + simp [Matrix.mulVec, dotProduct, pushMatrix, hf.eq_iff] + +omit [Fintype E'] in + +theorem pushMatrix_mulVec_apply_of_not_mem_range (f : E → E') (x : E → R) (e' : E') + (he' : e' ∉ Set.range f) : (pushMatrix f *ᵥ x) e' = 0 := by + apply Finset.sum_eq_zero + intro e _ + have hne : f e ≠ e' := fun h => he' ⟨e, h⟩ + simp [pushMatrix, hne] + +def circulationSpace (src dst : E → V) : Submodule R (E → R) := + LinearMap.ker (incidence src dst).mulVecLin + +theorem reduced_circulationSpace_eq (src dst : E → V) (root : V) : + LinearMap.ker (reducedIncidence (R := R) src dst root).mulVecLin = + circulationSpace src dst := by + ext x + exact reduced_mulVec_eq_zero_iff src dst root x + +omit finiteTargetVertices in +theorem circulationSpace_map_le [Fintype V'] (src dst : E → V) (src' dst' : E' → V') + (f : E → E') (g : V → V') + (hsrc : ∀ e, src' (f e) = g (src e)) (hdst : ∀ e, dst' (f e) = g (dst e)) : + (circulationSpace (R := R) src dst).map (pushMatrix f).mulVecLin ≤ + circulationSpace src' dst' := by + rintro y ⟨x, hx, rfl⟩ + exact circulation_pushForward src dst src' dst' f g hsrc hdst x hx + +end Problem336.IncidenceCirculation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IncidenceMinorClassification.lean b/lean/OAI/Probability/SpanningForest/IncidenceMinorClassification.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd1002f9d2ebf66600ca6ab57a3e6cc7ea4f1010 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IncidenceMinorClassification.lean @@ -0,0 +1,104 @@ +import OAI.Probability.SpanningForest.ReducedLaplacian +import OAI.Probability.SpanningForest.IncidenceUnimodular +import OAI.Probability.SpanningForest.DisconnectedIncidence +import OAI.Probability.SpanningForest.WeightedCauchyBinet + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.IncidenceMinor + +open ReducedLaplacian Classical + +variable {V E : Type*} + +theorem connected_iff_root_reachable (src dst : E → V) (root : V) : + Connected src dst ↔ + ∀ v, Relation.ReflTransGen (EdgeAdj src dst) root v := by + constructor + · intro h v + exact h root v + · intro h + let : Std.Symm (EdgeAdj src dst) := ⟨fun _ _ ⟨e, he⟩ => ⟨e, he.symm⟩⟩ + intro u v + exact (symm (h u)).trans (h v) + +variable [Fintype V] [DecidableEq V] + +theorem reducedGradient_det_ne_zero (root : V) + (src dst : {v : V // v ≠ root} → V) (hconn : Connected src dst) : + (reducedGradient src dst root).det ≠ 0 := by + have hu : IsUnit (reducedGradient src dst root) := + Matrix.mulVec_injective_iff_isUnit.mp + (reducedGradient_mulVec_injective src dst root hconn) + exact isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hu) + +theorem reducedGradient_det_eq_zero (root : V) + (src dst : {v : V // v ≠ root} → V) (hconn : ¬Connected src dst) : + (reducedGradient src dst root).det = 0 := by + have hroot : ¬∀ v, Relation.ReflTransGen (EdgeAdj src dst) root v := + fun h => hconn ((connected_iff_root_reachable src dst root).mpr h) + change ((IncidenceDisconnected.reducedIncidence root src dst)ᵀ).det = 0 + rw [Matrix.det_transpose] + exact IncidenceDisconnected.det_reducedIncidence_eq_zero_of_not_connected + root src dst hroot + +theorem reducedGradient_det_ne_zero_iff (root : V) + (src dst : {v : V // v ≠ root} → V) : + (reducedGradient src dst root).det ≠ 0 ↔ Connected src dst := by + constructor + · intro hd + by_contra hc + exact hd (reducedGradient_det_eq_zero root src dst hc) + · exact reducedGradient_det_ne_zero root src dst + +theorem reducedGradient_det_sq_eq_indicator (root : V) + (src dst : {v : V // v ≠ root} → V) : + (reducedGradient src dst root).det ^ 2 = + if Connected src dst then 1 else 0 := by + classical + by_cases hc : Connected src dst + · rw [ite_eq_left hc] + have hd := reducedGradient_det_ne_zero root src dst hc + have hs := Incidence.signedIncidence_det_sq_eq_one_of_ne_zero + src dst (fun v : {v : V // v ≠ root} => v.val) id + (by + change ((reducedGradient src dst root)ᵀ).det ≠ 0 + simpa only [Matrix.det_transpose] using hd) + change ((reducedGradient src dst root)ᵀ).det ^ 2 = 1 at hs + simpa only [Matrix.det_transpose] using hs + · rw [ite_eq_right hc, reducedGradient_det_eq_zero root src dst hc] + norm_num + +theorem selected_minor_det_sq_eq_indicator (src dst : E → V) (root : V) + (f : {v : V // v ≠ root} → E) : + (((reducedGradient src dst root)ᵀ).submatrix id f).det ^ 2 = + if Connected (src ∘ f) (dst ∘ f) then 1 else 0 := by + have heq : ((reducedGradient src dst root)ᵀ).submatrix id f = + (reducedGradient (src ∘ f) (dst ∘ f) root)ᵀ := rfl + rw [heq, Matrix.det_transpose, reducedGradient_det_sq_eq_indicator] + +theorem weightedLaplacian_connected_list_partition [Fintype E] [DecidableEq E] + (src dst : E → V) (root : V) (c : E → ℝ) : + (weightedLaplacian src dst root c).det = + (∑ f : {v : V // v ≠ root} → E, + if Connected (src ∘ f) (dst ∘ f) then ∏ i, c (f i) else 0) / + (Fintype.card {v : V // v ≠ root}).factorial := by + have h := WeightedCauchyBinet.weighted_gram_det_real + (reducedGradient src dst root)ᵀ c + simp only [Matrix.transpose_transpose] at h + rw [weightedLaplacian, h] + congr 1 + apply Finset.sum_congr rfl + intro f _ + rw [selected_minor_det_sq_eq_indicator] + split_ifs <;> simp + +end Problem336.IncidenceMinor + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IncidenceResponse.lean b/lean/OAI/Probability/SpanningForest/IncidenceResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1f00d22c27e3c021e28ef1aaadc83ad63775c29 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IncidenceResponse.lean @@ -0,0 +1,38 @@ +import OAI.Probability.SpanningForest.TransferCurrentLipschitz +import OAI.Probability.SpanningForest.ReducedLaplacian + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.TransferCurrent + +variable {V E : Type*} [Fintype V] [DecidableEq V] [Fintype E] [DecidableEq E] + +omit [Fintype V] in + +lemma laplacian_reducedGradient (src dst : E → V) (root : V) (h : E → ℝ) : + laplacian (ReducedLaplacian.reducedGradient src dst root) h = + ReducedLaplacian.weightedLaplacian src dst root (fun e => Real.exp (h e)) := by + ext i j + simp [laplacian, ReducedLaplacian.weightedLaplacian, Matrix.mul_apply, + Matrix.diagonal, Matrix.vecMulVec, Matrix.of_apply, Matrix.sum_apply, smul_eq_mul, mul_comm, mul_assoc] + +lemma incidence_marginal_sub_le_half (src dst : E → V) (root : V) + (hconn : ReducedLaplacian.Connected src dst) (h k : E → ℝ) (e : E) + (D : ℝ) (hD : 0 ≤ D) (hdir : ∀ f, |k f - h f| ≤ D) : + |marginal (ReducedLaplacian.reducedGradient src dst root) k e - + marginal (ReducedLaplacian.reducedGradient src dst root) h e| ≤ (1 : ℝ) / 2 * D := by + apply marginal_sub_le_half _ h k e D hD hdir + intro t ht + rw [laplacian_reducedGradient] + exact ReducedLaplacian.weightedLaplacian_isUnit src dst root _ hconn + (fun f => Real.exp_pos _) + +end Problem336.TransferCurrent + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IncidenceUnimodular.lean b/lean/OAI/Probability/SpanningForest/IncidenceUnimodular.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae629c6edaf41358b19fd5a1722d0604d4d2dbef --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IncidenceUnimodular.lean @@ -0,0 +1,147 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.Incidence + +variable {V E : Type*} [DecidableEq V] + +def signedIncidence (src dst : E → V) : Matrix V E ℝ := + fun v e => (if v = src e then 1 else 0) - (if v = dst e then 1 else 0) + +lemma sum_endpoint_indicator {n : ℕ} (f : Fin n → V) + (hf : Function.Injective f) (v : V) : + (∑ i, if f i = v then (1 : ℝ) else 0) = + if ∃ i, f i = v then 1 else 0 := by + classical + by_cases hv : ∃ i, f i = v + · obtain ⟨i, rfl⟩ := hv + simp [hf.eq_iff] + · rw [ite_eq_right hv] + apply Finset.sum_eq_zero + intro i _ + exact ite_eq_right (fun hi => hv ⟨i, hi⟩) + +lemma incidence_column_sum {n : ℕ} (src dst : E → V) + (f : Fin n → V) (hf : Function.Injective f) (e : E) : + (∑ i, signedIncidence src dst (f i) e) = + (if ∃ i, f i = src e then 1 else 0) - + (if ∃ i, f i = dst e then 1 else 0) := by + simp only [signedIncidence, Finset.sum_sub_distrib, + sum_endpoint_indicator f hf] + +lemma incidence_source_only {n : ℕ} (src dst : E → V) + (f : Fin n → V) (hf : Function.Injective f) (e : E) + (i : Fin n) (hsrc : f i = src e) (hdst : ¬ ∃ k, f k = dst e) : + (fun k => signedIncidence src dst (f k) e) = Pi.single i 1 := by + ext k + have hkd : f k ≠ dst e := fun hk => hdst ⟨k, hk⟩ + simp [signedIncidence, ← hsrc, hf.eq_iff, hkd, Pi.single_apply] + +lemma incidence_target_only {n : ℕ} (src dst : E → V) + (f : Fin n → V) (hf : Function.Injective f) (e : E) + (i : Fin n) (hdst : f i = dst e) (hsrc : ¬ ∃ k, f k = src e) : + (fun k => signedIncidence src dst (f k) e) = Pi.single i (-1) := by + ext k + have hks : f k ≠ src e := fun hk => hsrc ⟨k, hk⟩ + simp [signedIncidence, ← hdst, hf.eq_iff, hks, Pi.single_apply] + split_ifs <;> norm_num + +theorem signedIncidence_minor_mem_sign (src dst : E → V) (n : ℕ) + (f : Fin n → V) (g : Fin n → E) (hf : Function.Injective f) : + ((signedIncidence src dst).submatrix f g).det ∈ Set.range SignType.cast := by + classical + induction n with + | zero => + exact ⟨1, by simp⟩ + | succ n ih => + let A := (signedIncidence src dst).submatrix f g + by_cases hsplit : ∃ j, + ((∃ i, f i = src (g j)) ∧ ¬ ∃ i, f i = dst (g j)) ∨ + ((∃ i, f i = dst (g j)) ∧ ¬ ∃ i, f i = src (g j)) + · obtain ⟨j, hj⟩ := hsplit + have hsingle : ∃ i : Fin (n + 1), ∃ s : SignType, + (fun k => A k j) = Pi.single i (s.cast : ℝ) := by + rcases hj with ⟨⟨i, hi⟩, hother⟩ | ⟨⟨i, hi⟩, hother⟩ + · exact ⟨i, 1, incidence_source_only src dst f hf (g j) i hi hother⟩ + · refine ⟨i, -1, ?_⟩ + simpa [A] using incidence_target_only src dst f hf (g j) i hi hother + obtain ⟨i, s, hs⟩ := hsingle + have hdet := Matrix.det_succ_column A j + rw [Fintype.sum_eq_single i] at hdet + · have hii : A i j = s.cast := by + simpa using congrFun hs i + rw [hii] at hdet + change A.det ∈ Set.range SignType.cast + rw [hdet] + change _ ∈ MonoidHom.mrange SignType.castHom.toMonoidHom + refine mul_mem (mul_mem ?_ (Set.mem_range_self s)) ?_ + · apply pow_mem + exact ⟨-1, by simp⟩ + · exact ih (f ∘ i.succAbove) (g ∘ j.succAbove) + (hf.comp Fin.succAbove_right_injective) + · intro k hki + have hkj : A k j = 0 := by + simpa [Pi.single_eq_of_ne hki] using congrFun hs k + simp [hkj] + · have hsum : ∀ j : Fin (n + 1), ∑ i, A i j = 0 := by + intro j + have hiff : (∃ i, f i = src (g j)) ↔ (∃ i, f i = dst (g j)) := by + constructor + · intro h + by_contra hn + exact hsplit ⟨j, Or.inl ⟨h, hn⟩⟩ + · intro h + by_contra hn + exact hsplit ⟨j, Or.inr ⟨h, hn⟩⟩ + change (∑ i, signedIncidence src dst (f i) (g j)) = 0 + rw [incidence_column_sum src dst f hf] + simp only [hiff, sub_self] + have hdet : A.det = 0 := by + rw [Matrix.det_eq_sum_column_mul_submatrix_succAbove_succAbove_det + A 0 0 (fun j _ => hsum j), hsum 0, mul_zero, zero_mul] + exact ⟨0, by simpa using hdet.symm⟩ + +theorem signedIncidence_isTotallyUnimodular (src dst : E → V) : + (signedIncidence src dst).IsTotallyUnimodular := by + intro n f g hf _ + exact signedIncidence_minor_mem_sign src dst n f g hf + +theorem signedIncidence_submatrix_det_mem_sign {ι : Type*} + [Fintype ι] [DecidableEq ι] (src dst : E → V) + (f : ι → V) (g : ι → E) : + ((signedIncidence src dst).submatrix f g).det ∈ Set.range SignType.cast := by + exact (Matrix.isTotallyUnimodular_iff_fintype _).mp + (signedIncidence_isTotallyUnimodular src dst) ι f g + +theorem signedIncidence_det_sq_eq_one_of_ne_zero {ι : Type*} + [Fintype ι] [DecidableEq ι] (src dst : E → V) + (f : ι → V) (g : ι → E) + (hdet : ((signedIncidence src dst).submatrix f g).det ≠ 0) : + (((signedIncidence src dst).submatrix f g).det)^2 = 1 := by + obtain ⟨s, hs⟩ := signedIncidence_submatrix_det_mem_sign src dst f g + rw [← hs] at hdet ⊢ + cases s with + | zero => exact (hdet rfl).elim + | neg => norm_num [SignType.cast] + | pos => norm_num [SignType.cast] + +theorem signedIncidence_det_sq_eq_indicator {ι : Type*} + [Fintype ι] [DecidableEq ι] (src dst : E → V) + (f : ι → V) (g : ι → E) : + (((signedIncidence src dst).submatrix f g).det)^2 = + if ((signedIncidence src dst).submatrix f g).det = 0 then 0 else 1 := by + classical + by_cases hd : ((signedIncidence src dst).submatrix f g).det = 0 + · simp [hd] + · simp [hd, signedIncidence_det_sq_eq_one_of_ne_zero src dst f g hd] + +end Problem336.Incidence + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InclusionPolynomial.lean b/lean/OAI/Probability/SpanningForest/InclusionPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..da47df5a7ea437baedbf8f522edd3dd22acfb5f3 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InclusionPolynomial.lean @@ -0,0 +1,104 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Polynomial Matrix +open Polynomial Finset + +namespace Problem336 +namespace InclusionPolynomial + +variable {E R : Type*} [DecidableEq E] [CommRing R] + +theorem coeff_marked_power (T F : Finset E) : + ((1 + X : R[X]) ^ (T ∩ F).card).coeff F.card = if F ⊆ T then 1 else 0 := by + rw [Polynomial.coeff_one_add_X_pow] + by_cases h : F ⊆ T + · have hI : T ∩ F = F := Finset.inter_eq_right.mpr h + simp [h, hI] + · have hlt : (T ∩ F).card < F.card := by + apply Finset.card_lt_card + apply Finset.ssubset_iff_subset_ne.mpr + refine ⟨Finset.inter_subset_right, ?_⟩ + intro heq + apply h + rw [← heq] + exact Finset.inter_subset_left + simp [h, Nat.choose_eq_zero_of_lt hlt] + +theorem coeff_partition (trees : Finset (Finset E)) (w : Finset E → R) (F : Finset E) : + (∑ T ∈ trees, C (w T) * (1 + X : R[X]) ^ (T ∩ F).card).coeff F.card = + ∑ T ∈ trees with F ⊆ T, w T := by + simp only [Polynomial.finsetSum_coeff, Polynomial.coeff_C_mul, coeff_marked_power] + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro T _ + split_ifs <;> simp + +theorem coeff_det_one_add_X_top {ι : Type*} [Fintype ι] [DecidableEq ι] + (K : Matrix ι ι R) : + ((1 + (X : R[X]) • K.map C).det).coeff (Fintype.card ι) = K.det := by + rw [Matrix.coeff_det_one_add_X_smul_eq_sum_minors] + simp only [← Finset.card_univ (α := ι), Finset.powersetCard_self, + Finset.sum_singleton] + exact Matrix.det_submatrix_equiv_self (Equiv.subtypeUnivEquiv (fun i : ι => Finset.mem_univ i)) K + +theorem inclusion_mass_eq_of_partition_identity + (trees : Finset (Finset E)) (w : Finset E → R) (F : Finset E) + (K : Matrix F F R) (Z : R) + (hpoly : (∑ T ∈ trees, C (w T) * (1 + X : R[X]) ^ (T ∩ F).card) = + C Z * (1 + (X : R[X]) • K.map C).det) : + (∑ T ∈ trees with F ⊆ T, w T) = Z * K.det := by + have hcoeff := congrArg (fun p : R[X] => p.coeff F.card) hpoly + rw [coeff_partition, Polynomial.coeff_C_mul] at hcoeff + have htop : ((1 + (X : R[X]) • K.map C).det).coeff F.card = K.det := by + simpa only [Fintype.card_coe] using coeff_det_one_add_X_top K + rwa [htop] at hcoeff + +theorem inclusion_ratio_eq_of_partition_identity + (trees : Finset (Finset E)) (w : Finset E → ℝ) (F : Finset E) + (K : Matrix F F ℝ) (Z : ℝ) (hZ : Z ≠ 0) + (hpoly : (∑ T ∈ trees, C (w T) * (1 + X : ℝ[X]) ^ (T ∩ F).card) = + C Z * (1 + (X : ℝ[X]) • K.map C).det) : + (∑ T ∈ trees with F ⊆ T, w T) / Z = K.det := by + rw [inclusion_mass_eq_of_partition_identity trees w F K Z hpoly] + field_simp + +theorem eval_zero_partition + (trees : Finset (Finset E)) (w : Finset E → R) (F : Finset E) : + (∑ T ∈ trees, C (w T) * (1 + X : R[X]) ^ (T ∩ F).card).eval 0 = + ∑ T ∈ trees, w T := by + simp [Polynomial.eval_finsetSum] + +theorem eval_det_marker {ι : Type*} [Fintype ι] [DecidableEq ι] + (K : Matrix ι ι ℝ) (t : ℝ) : + ((1 + (X : ℝ[X]) • K.map C).det).eval t = (1 + t • K).det := by + change (Polynomial.evalRingHom t) ((1 + (X : ℝ[X]) • K.map C).det) = _ + rw [RingHom.map_det] + congr 1 + ext i j + simp [Matrix.map_apply, Matrix.add_apply, Matrix.smul_apply, Matrix.one_apply, + smul_eq_mul] + split_ifs <;> simp [mul_comm] + +theorem inclusion_ratio_eq_of_real_marker_identity + (trees : Finset (Finset E)) (w : Finset E → ℝ) (F : Finset E) + (K : Matrix F F ℝ) (Z : ℝ) (hZ : Z ≠ 0) + (hmarker : ∀ t : ℝ, (∑ T ∈ trees, w T * (1 + t) ^ (T ∩ F).card) = + Z * (1 + t • K).det) : + (∑ T ∈ trees with F ⊆ T, w T) / Z = K.det := by + apply inclusion_ratio_eq_of_partition_identity trees w F K Z hZ + apply Polynomial.funext + intro t + simpa only [Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, + Polynomial.eval_pow, Polynomial.eval_add, Polynomial.eval_one, Polynomial.eval_X, + eval_det_marker] using hmarker t + +end InclusionPolynomial +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IncreasingProjections.lean b/lean/OAI/Probability/SpanningForest/IncreasingProjections.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b4573d1b7a8ad890d3b3bf0a7c543729b9578fd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IncreasingProjections.lean @@ -0,0 +1,89 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter Topology + +namespace Problem336 + +variable {𝕜 E : Type*} [RCLike 𝕜] + [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] + +theorem tendsto_starProjection_of_mem_closure_iSup + (C : ℕ → Submodule 𝕜 E) [∀ n, (C n).HasOrthogonalProjection] + (hC : Monotone C) {x : E} + (hx : x ∈ (⨆ n, C n).topologicalClosure) : + Tendsto (fun n => (C n).starProjection x) atTop (𝓝 x) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + obtain ⟨y, hy, hxy⟩ := Metric.mem_closure_iff.mp hx (ε / 2) (by positivity) + obtain ⟨N, hyN⟩ := (Submodule.mem_iSup_of_directed C hC.directed_le).mp hy + refine ⟨N, fun n hn => ?_⟩ + have hyn : y ∈ C n := hC hn hyN + have hfix : (C n).starProjection y = y := + (C n).starProjection_eq_self_iff.mpr hyn + have hdist : dist ((C n).starProjection x) y ≤ dist x y := by + simpa only [hfix, NNReal.coe_one, one_mul] using + (C n).lipschitzWith_starProjection.dist_le_mul x y + calc + dist ((C n).starProjection x) x ≤ + dist ((C n).starProjection x) y + dist y x := dist_triangle _ _ _ + _ ≤ dist x y + dist y x := add_le_add hdist le_rfl + _ < ε := by rw [dist_comm y x]; linarith + +theorem tendsto_starProjection_of_closure_iSup_eq + (C : ℕ → Submodule 𝕜 E) [∀ n, (C n).HasOrthogonalProjection] + (hC : Monotone C) (D : Submodule 𝕜 E) [D.HasOrthogonalProjection] + (hD : (⨆ n, C n).topologicalClosure = D) (x : E) : + Tendsto (fun n => (C n).starProjection x) atTop (𝓝 (D.starProjection x)) := by + have hCD (n : ℕ) : C n ≤ D := by + rw [← hD] + exact (le_iSup C n).trans (Submodule.le_topologicalClosure _) + have hx : D.starProjection x ∈ (⨆ n, C n).topologicalClosure := by + rw [hD] + exact D.starProjection_apply_mem x + have hconv := tendsto_starProjection_of_mem_closure_iSup C hC hx + have heq (n : ℕ) : (C n).starProjection (D.starProjection x) = + (C n).starProjection x := by + exact congrArg (fun f : E →L[𝕜] E => f x) + (Submodule.starProjection_comp_starProjection_of_le (hCD n)) + simpa only [heq] using hconv + +theorem tendsto_sub_starProjection_of_closure_iSup_eq + (C : ℕ → Submodule 𝕜 E) [∀ n, (C n).HasOrthogonalProjection] + (hC : Monotone C) (D : Submodule 𝕜 E) [D.HasOrthogonalProjection] + (hD : (⨆ n, C n).topologicalClosure = D) + (Q : ℕ → E →L[𝕜] E) + (hQ : ∀ x, Tendsto (fun n => Q n x) atTop (𝓝 x)) (x : E) : + Tendsto (fun n => Q n x - (C n).starProjection x) atTop + (𝓝 (x - D.starProjection x)) := + (hQ x).sub (tendsto_starProjection_of_closure_iSup_eq C hC D hD x) + +theorem tendsto_det_sub_starProjection_of_closure_iSup_eq + {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : ℕ → Submodule 𝕜 E) [∀ n, (C n).HasOrthogonalProjection] + (hC : Monotone C) (D : Submodule 𝕜 E) [D.HasOrthogonalProjection] + (hD : (⨆ n, C n).topologicalClosure = D) + (Q : ℕ → E →L[𝕜] E) + (hQ : ∀ x, Tendsto (fun n => Q n x) atTop (𝓝 x)) (v : ι → E) : + Tendsto (fun n => Matrix.det (fun i j => + inner 𝕜 (v i) (Q n (v j) - (C n).starProjection (v j)))) atTop + (𝓝 (Matrix.det (fun i j => inner 𝕜 (v i) (v j - D.starProjection (v j))))) := by + have hm : Tendsto (fun n => (fun i j => + inner 𝕜 (v i) (Q n (v j) - (C n).starProjection (v j)))) atTop + (𝓝 (fun i j => inner 𝕜 (v i) (v j - D.starProjection (v j)))) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + exact tendsto_const_nhds.inner + (tendsto_sub_starProjection_of_closure_iSup_eq C hC D hD Q hQ (v j)) + exact (continuous_id.matrix_det.tendsto _).comp hm + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IndependentProcessVectors.lean b/lean/OAI/Probability/SpanningForest/IndependentProcessVectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..329e799fb7d22df8ed2a2e36df36a4d3540cd516 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IndependentProcessVectors.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Measure ProbabilityTheory +open scoped NNReal ENNReal + +namespace Problem336.IndependentProcessVectors + +variable {Ω I J T E : Type*} [MeasurableSpace Ω] [MeasurableSpace E] + {P : Measure Ω} [IsProbabilityMeasure P] + +theorem iIndepFun_curry {X : I → J → Ω → E} + (hX : ∀ i j, Measurable (X i j)) + (h : iIndepFun (fun p : I × J => X p.1 p.2) P) : + iIndepFun (fun i ω j => X i j ω) P := by + have : ∀ i j, IsProbabilityMeasure (P.map (X i j)) := + inferInstance + rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] + have hflat : Measurable (fun ω (p : I × J) => X p.1 p.2 ω) := by fun_prop + have hc : (fun ω i j => X i j ω) = + (MeasurableEquiv.curry I J E) ∘ (fun ω (p : I × J) => X p.1 p.2 ω) := rfl + rw [hc, ← Measure.map_map (MeasurableEquiv.curry I J E).measurable hflat, + (iIndepFun.map_fun_eq_infinitePi_map (X := fun p : I × J => X p.1 p.2) (fun p => hX p.1 p.2) h), Measure.infinitePi_map_curry (fun i j => P.map (X i j))] + congr 1 + funext i + exact (iIndepFun.map_fun_eq_infinitePi_map (X := X i) (hX i) + (h.precomp (g := fun j : J => (i, j)) (fun a b hab => (Prod.mk.inj hab).2))).symm + +theorem hasIndepIncrements_vector [Preorder T] + {B : I → T → Ω → ℝ} + (hm : ∀ i t, Measurable (B i t)) + (hi : iIndepFun (fun i ω t => B i t ω) P) + (hB : ∀ i, HasIndepIncrements (B i) P) (S : Finset I) : + HasIndepIncrements + (fun t ω => (WithLp.toLp 2 (fun i : S => B i t ω) : EuclideanSpace ℝ S)) P := by + intro n times htimes + let D (i : S) (j : Fin n) (ω : Ω) := + B i (times j.succ) ω - B i (times j.castSucc) ω + have hD (i : S) (j : Fin n) : Measurable (D i j) := (hm _ _).sub (hm _ _) + have hrows : iIndepFun (fun i : S => fun ω (j : Fin n) => D i j ω) P := by + exact (hi.precomp Subtype.val_injective).comp + (fun _ (z : T → ℝ) (j : Fin n) => z (times j.succ) - z (times j.castSucc)) + (by intro i; fun_prop) + have hflat : iIndepFun (fun p : S × Fin n => D p.1 p.2) P := + iIndepFun_uncurry' hD hrows (fun i => hB i n times htimes) + have hswap : iIndepFun (fun p : Fin n × S => D p.2 p.1) P := + hflat.precomp (Equiv.prodComm (Fin n) S).injective + have hcols := iIndepFun_curry (fun j i => hD i j) hswap + exact hcols.comp (fun _ => (MeasurableEquiv.toLp 2 (S → ℝ))) + (fun _ => (MeasurableEquiv.toLp 2 (S → ℝ)).measurable) + +omit [IsProbabilityMeasure P] in + +theorem brownian_vector_increment_hasLaw + {B : I → ℝ≥0 → Ω → ℝ} + (hm : ∀ i t, Measurable (B i t)) + (hi : iIndepFun (fun i ω t => B i t ω) P) + (hB : ∀ i, IsPreBrownianReal (B i) P) + (S : Finset I) (s t : ℝ≥0) : + HasLaw (fun ω => (WithLp.toLp 2 + (fun i : S => B i t ω - B i s ω) : EuclideanSpace ℝ S)) + ((Measure.infinitePi (fun _ : S => gaussianReal 0 (nndist t.1 s.1))).map + (MeasurableEquiv.toLp 2 (S → ℝ))) P := by + have hd : iIndepFun (fun i : S => fun ω => B i t ω - B i s ω) P := + (hi.precomp Subtype.val_injective).comp (fun _ (z : ℝ≥0 → ℝ) => z t - z s) + (by intro i; fun_prop) + have hl := hd.hasLaw_infinitePi (fun i : S => (hB i).hasLaw_sub t s) + (Measurable.aemeasurable (by fun_prop)) + have he : HasLaw (MeasurableEquiv.toLp 2 (S → ℝ)) + ((Measure.infinitePi (fun _ : S => gaussianReal 0 (nndist t.1 s.1))).map + (MeasurableEquiv.toLp 2 (S → ℝ))) + (Measure.infinitePi (fun _ : S => gaussianReal 0 (nndist t.1 s.1))) := + ⟨(MeasurableEquiv.toLp 2 (S → ℝ)).measurable.aemeasurable, rfl⟩ + exact he.comp hl + +end Problem336.IndependentProcessVectors + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InducedCode.lean b/lean/OAI/Probability/SpanningForest/InducedCode.lean new file mode 100644 index 0000000000000000000000000000000000000000..e57ffb487201b5c0a6e971a9f008a2a3578cad99 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InducedCode.lean @@ -0,0 +1,108 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section +namespace Problem336 + +def inducedCode (G : GraphCode) (S : Finset ℕ) : FiniteSubgraphCode := by + classical + exact (S, (S.product S).filter (fun p => p.1 < p.2 ∧ Adj G p.1 p.2)) + +@[simp] theorem inducedCode_vertices (G : GraphCode) (S : Finset ℕ) : + (inducedCode G S).1 = S := rfl + +@[simp] theorem mem_inducedCode_edges (G : GraphCode) (S : Finset ℕ) (p : ℕ × ℕ) : + p ∈ (inducedCode G S).2 ↔ p.1 ∈ S ∧ p.2 ∈ S ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + classical + rcases p with ⟨u, v⟩ + simp only [inducedCode, Finset.mem_filter] + have hprod : (u,v) ∈ S.product S ↔ u ∈ S ∧ v ∈ S := Finset.mem_product + rw [hprod] + tauto + +private theorem inducedCode_adj_symm (G : GraphCode) (u v : ℕ) : Adj G u v ↔ Adj G v u := by + unfold Adj + rw [G.2.2 u v] + +private theorem inducedCode_adj_ne {G : GraphCode} {u v : ℕ} (h : Adj G u v) : u ≠ v := by + intro huv + subst v + unfold Adj at h + rw [G.2.1 u] at h + contradiction + +@[simp] theorem rawPair_mem_inducedCode_edges (G : GraphCode) (S : Finset ℕ) (u v : ℕ) : + rawPair u v ∈ (inducedCode G S).2 ↔ u ∈ S ∧ v ∈ S ∧ Adj G u v := by + rw [mem_inducedCode_edges] + by_cases h : u < v + · simp only [rawPair, ite_eq_left h] + tauto + · simp only [rawPair, ite_eq_right h] + constructor + · rintro ⟨hv, hu, _, hadj⟩ + exact ⟨hu, hv, (inducedCode_adj_symm G v u).mp hadj⟩ + · rintro ⟨hu, hv, hadj⟩ + exact ⟨hv, hu, by have := inducedCode_adj_ne hadj; omega, + (inducedCode_adj_symm G u v).mp hadj⟩ + +@[simp] theorem subgraphAdj_inducedCode (G : GraphCode) (S : Finset ℕ) (u v : ℕ) : + SubgraphAdj (inducedCode G S) u v ↔ u ∈ S ∧ v ∈ S ∧ Adj G u v := by + simp only [SubgraphAdj, inducedCode_vertices, rawPair_mem_inducedCode_edges] + tauto + +theorem inducedCode_isFiniteConnectedSubgraph {G : GraphCode} {S : Finset ℕ} + (hS : S.Nonempty) + (hconn : ∀ u ∈ S, ∀ v ∈ S, + Relation.ReflTransGen (fun a b => a ∈ S ∧ b ∈ S ∧ Adj G a b) u v) : + IsFiniteConnectedSubgraph G (inducedCode G S) := by + refine ⟨hS, ?_, ?_⟩ + · intro p hp + exact (mem_inducedCode_edges G S p).mp hp + · intro u hu v hv + exact Relation.ReflTransGen.mono + (fun a b h => (subgraphAdj_inducedCode G S a b).mpr h) _ _ (hconn u hu v hv) + +theorem inducedCode_mono (G : GraphCode) {S T : Finset ℕ} (h : S ⊆ T) : + (inducedCode G S).1 ⊆ (inducedCode G T).1 ∧ + (inducedCode G S).2 ⊆ (inducedCode G T).2 := by + refine ⟨h, ?_⟩ + intro p hp + rcases (mem_inducedCode_edges G S p).mp hp with ⟨hu, hv, hlt, hadj⟩ + exact (mem_inducedCode_edges G T p).mpr ⟨h hu, h hv, hlt, hadj⟩ + +theorem inducedCode_isConnectedExhaustion {G : GraphCode} (S : ℕ → Finset ℕ) + (hne : ∀ n, (S n).Nonempty) + (hconn : ∀ n, ∀ u ∈ S n, ∀ v ∈ S n, + Relation.ReflTransGen (fun a b => a ∈ S n ∧ b ∈ S n ∧ Adj G a b) u v) + (hmono : Monotone S) + (hcover : ∀ v, ∃ n, v ∈ S n) : + IsConnectedExhaustion G (fun n => inducedCode G (S n)) := by + refine ⟨fun n => inducedCode_isFiniteConnectedSubgraph (hne n) (hconn n), + fun n => inducedCode_mono G (hmono (Nat.le_succ n)), ?_⟩ + intro u v huv hadj + obtain ⟨nu, hnu⟩ := hcover u + obtain ⟨nv, hnv⟩ := hcover v + refine ⟨max nu nv, (mem_inducedCode_edges G (S (max nu nv)) (u, v)).mpr ?_⟩ + exact ⟨hmono (le_max_left nu nv) hnu, hmono (le_max_right nu nv) hnv, huv, hadj⟩ + +theorem measurable_inducedCode {X : Type*} [MeasurableSpace X] + {G : X → GraphCode} {S : X → Finset ℕ} + (hG : Measurable G) (hS : Measurable S) : + Measurable (fun x => inducedCode (G x) (S x)) := by + have hedges : Measurable (fun x => (inducedCode (G x) (S x)).2) := by + apply measurable_finset_iff.mpr + intro p + have ha : Measurable (fun x => Adj (G x) p.1 p.2) := by + exact ((measurable_pi_apply p.2).comp + ((measurable_pi_apply p.1).comp (measurable_subtype_coe.comp hG))).eq_const true + have hu := (measurable_finset_iff.mp hS) p.1 + have hv := (measurable_finset_iff.mp hS) p.2 + simpa only [mem_inducedCode_edges] using hu.and (hv.and (measurable_const.and ha)) + exact hS.prodMk hedges + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationAdapted.lean b/lean/OAI/Probability/SpanningForest/InnovationAdapted.lean new file mode 100644 index 0000000000000000000000000000000000000000..4204ca38a2ddb767129661db6ccaebc1f3962d46 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationAdapted.lean @@ -0,0 +1,129 @@ +import OAI.Probability.SpanningForest.InnovationMartingale + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped NNReal Topology + +namespace Problem336.Innovation + +theorem measurable_stopped_observation {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (ℱ : Filtration ℝ≥0 mΩ) (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) (T : ℝ≥0) : + Measurable[(borel ℝ).prod (ℱ T)] + (fun q : ℝ × Ω => Y (min q.1.toNNReal T) q.2) := by + let : MeasurableSpace Ω := ℱ T + apply Measurable.of_eval + intro i + apply measurable_uncurry_of_continuous_of_measurable (m := ℱ T) + (u := fun s : ℝ => fun ω : Ω => Y (min s.toNNReal T) ω i) + · intro ω + exact (hcont ω i).comp (by fun_prop) + · intro s + exact (hadapted (min s.toNNReal T) i).mono + (ℱ.mono (min_le_right _ _)) le_rfl + +theorem stronglyMeasurable_integrated_observation_drift + {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (ℱ : Filtration ℝ≥0 mΩ) (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) + (b : ℝ≥0 → (ι → ℝ) → ℝ) (hb : Measurable (Function.uncurry b)) + (T : ℝ≥0) : + StronglyMeasurable[ℱ T] + (fun ω => ∫ s in (0 : ℝ)..T, b s.toNNReal (Y s.toNNReal ω)) := by + let : MeasurableSpace Ω := ℱ T + have htime : Measurable[(borel ℝ).prod (ℱ T)] + (fun q : ℝ × Ω => min q.1.toNNReal T) := by + exact (show Continuous (fun s : ℝ => min s.toNNReal T) by fun_prop).measurable.comp + measurable_fst + have hfield := measurable_stopped_observation ℱ Y hcont hadapted T + have hstop : Measurable[(borel ℝ).prod (ℱ T)] + (fun q : ℝ × Ω => b (min q.1.toNNReal T) (Y (min q.1.toNNReal T) q.2)) := + hb.comp (htime.prodMk hfield) + have hint : StronglyMeasurable[ℱ T] + (fun ω => ∫ s in Ioc (0 : ℝ) (T : ℝ), + b (min s.toNNReal T) (Y (min s.toNNReal T) ω)) := + hstop.stronglyMeasurable.integral_prod_left' + convert hint using 1 + funext ω + calc + (∫ s in (0 : ℝ)..T, b s.toNNReal (Y s.toNNReal ω)) = + ∫ s in Ioc (0 : ℝ) (T : ℝ), b s.toNNReal (Y s.toNNReal ω) := + intervalIntegral.integral_of_le T.2 + _ = ∫ s in Ioc (0 : ℝ) (T : ℝ), + b (min s.toNNReal T) (Y (min s.toNNReal T) ω) := by + apply setIntegral_congr_fun measurableSet_Ioc + intro s hs + dsimp only + rw [min_eq_left (Real.toNNReal_le_iff_le_coe.mpr hs.2)] + +theorem stronglyAdapted_observation_innovation + {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (ℱ : Filtration ℝ≥0 mΩ) (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) + (b : ℝ≥0 → (ι → ℝ) → ℝ) (hb : Measurable (Function.uncurry b)) + (i : ι) : + StronglyAdapted ℱ (fun t ω => Y t ω i - + ∫ s in (0 : ℝ)..t, b s.toNNReal (Y s.toNNReal ω)) := by + intro t + exact (hadapted t i).stronglyMeasurable.sub + (stronglyMeasurable_integrated_observation_drift ℱ Y hcont hadapted b hb t) + +theorem measurable_observation_field {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (ℱ : Filtration ℝ≥0 mΩ) (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) : + Measurable (fun q : ℝ × Ω => Y q.1.toNNReal q.2) := by + apply Measurable.of_eval + intro i + apply measurable_uncurry_of_continuous_of_measurable + (u := fun s : ℝ => fun ω : Ω => Y s.toNNReal ω i) + · intro ω + exact (hcont ω i).comp (by fun_prop) + · intro s + exact (hadapted s.toNNReal i).mono (ℱ.le _) le_rfl + +theorem martingale_borel_observation + {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ≥0 mΩ) + (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) + (i : ι) (X : Ω → ℝ) (B : ℝ≥0 → Ω → ℝ) + (hobs : ∀ t ω, Y t ω i = (t : ℝ) * X ω + B t ω) + (hX : Integrable X P) (hB : ∀ t, Integrable (B t) P) + (b : ℝ≥0 → (ι → ℝ) → ℝ) (hb : Measurable (Function.uncurry b)) + {C : ℝ} (hbound : ∀ t y, ‖b t y‖ ≤ C) + (hposterior : ∀ t : ℝ≥0, (fun ω => b t (Y t ω)) =ᵐ[P] P[X | ℱ t]) + (hnoise : ∀ u v, u ≤ v → ∀ A : Set Ω, MeasurableSet[ℱ u] A → + (∫ ω in A, (B v ω - B u ω) ∂P) = 0) : + Martingale (fun t ω => Y t ω i - + ∫ s in (0 : ℝ)..t, b s.toNNReal (Y s.toNNReal ω)) ℱ P := by + let bt : ℝ → Ω → ℝ := fun s ω => b s.toNNReal (Y s.toNNReal ω) + have hbt : Measurable (Function.uncurry bt) := + hb.comp ((show Measurable (fun q : ℝ × Ω => q.1.toNNReal) by fun_prop).prodMk + (measurable_observation_field ℱ Y hcont hadapted)) + have hbnd : ∀ t ω, ‖bt t ω‖ ≤ C := fun t ω => hbound _ _ + have hpost : ∀ t : ℝ≥0, bt t =ᵐ[P] P[X | ℱ t] := by + intro t + simpa only [bt, Real.toNNReal_coe] using hposterior t + have heq : nnInnovation X B bt = (fun t ω => Y t ω i - + ∫ s in (0 : ℝ)..t, b s.toNNReal (Y s.toNNReal ω)) := by + funext t ω + rw [nnInnovation_apply, hobs] + have hstrong : StronglyAdapted ℱ (nnInnovation X B bt) := by + rw [heq] + exact stronglyAdapted_observation_innovation ℱ Y hcont hadapted b hb i + rw [← heq] + exact martingale_nnInnovation P ℱ hX hB hbt hbnd hpost hstrong hnoise + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationErrorRate.lean b/lean/OAI/Probability/SpanningForest/InnovationErrorRate.lean new file mode 100644 index 0000000000000000000000000000000000000000..1323b15d7e6caa434830853d96db02986c3b115c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationErrorRate.lean @@ -0,0 +1,68 @@ +import OAI.Probability.SpanningForest.WeightedInnovation + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal +namespace Problem336.Innovation + +theorem gaussian_error_le_smallStep {h L c m : ℝ} + (hh0 : 0 ≤ h) (hh1 : h ≤ 1) (hL : 0 ≤ L) : + 16 * ((Real.sqrt (h * c)) ^ 3 * m + (h * L) ^ 3) + + (2 * (h * L) * Real.sqrt (h * c) + (h * L) ^ 2) / 2 + + (h * c / 2) ^ 2 ≤ + (16 * ((Real.sqrt c) ^ 3 * m + L ^ 3) + L * Real.sqrt c + + L ^ 2 / 2 + c ^ 2 / 4) * h * Real.sqrt h := by + have hs0 := Real.sqrt_nonneg h + have hs1 : Real.sqrt h ≤ 1 := by + rw [Real.sqrt_le_one] + exact hh1 + have hs2 := Real.sq_sqrt hh0 + have hh_s : h ≤ Real.sqrt h := by + nlinarith [mul_nonneg hs0 (sub_nonneg.mpr hs1)] + have hh2 : h ^ 2 ≤ h * Real.sqrt h := by + nlinarith [mul_le_mul_of_nonneg_left hh_s hh0] + have hh3 : h ^ 3 ≤ h * Real.sqrt h := by + nlinarith [mul_nonneg (sq_nonneg h) (sub_nonneg.mpr hh1)] + have hs3 : (Real.sqrt h) ^ 3 = h * Real.sqrt h := by nlinarith + rw [Real.sqrt_mul hh0, mul_pow, hs3] + have hL3 := mul_le_mul_of_nonneg_right hh3 (pow_nonneg hL 3) + have hL2 := mul_le_mul_of_nonneg_right hh2 (sq_nonneg L) + have hc2 := mul_le_mul_of_nonneg_right hh2 (sq_nonneg c) + nlinarith [hL3, hL2, hc2] + +def gaussianErrorConstant (L c : ℝ) : ℝ := + 16 * ((Real.sqrt c) ^ 3 * (∫ z : ℝ, |z| ^ 3 ∂gaussianReal 0 1) + L ^ 3) + + L * Real.sqrt c + L ^ 2 / 2 + c ^ 2 / 4 + +lemma gaussianErrorConstant_nonneg {L c : ℝ} (hL : 0 ≤ L) : + 0 ≤ gaussianErrorConstant L c := by + have hm : 0 ≤ ∫ z : ℝ, |z| ^ 3 ∂gaussianReal 0 1 := + integral_nonneg (fun z => pow_nonneg (abs_nonneg z) 3) + unfold gaussianErrorConstant + positivity + +theorem gaussian_smallStep_characteristic {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {Q R : Ω → ℝ} {K : Ω → ℂ} {h L c : ℝ} {v : ℝ≥0} + (hLaw : HasLaw Q (gaussianReal 0 v) P) (hIndep : IndepFun K Q P) + (hR : AEStronglyMeasurable R P) + (hh0 : 0 ≤ h) (hh1 : h ≤ 1) (hL : 0 ≤ L) + (hvariance : (v : ℝ) = h * c) (hsmall : h * c ≤ 2) + (hRbound : ∀ᵐ ω ∂P, |R ω| ≤ h * L) + (hKmeas : AEStronglyMeasurable K P) (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hmean : (∫ ω, K ω * ((Q ω + R ω : ℝ) : ℂ) ∂P) = 0) : + ‖(∫ ω, K ω * Complex.exp (((Q ω + R ω : ℝ) : ℂ) * Complex.I) ∂P) - + (Real.exp (-(h * c / 2)) : ℂ) * (∫ ω, K ω ∂P)‖ ≤ + gaussianErrorConstant L c * h * Real.sqrt h := by + have hv : (v : ℝ) ≤ 2 := by simpa only [hvariance] using hsmall + have hbase := gaussian_bounded_perturbation_characteristic hLaw hIndep hR + (mul_nonneg hh0 hL) hRbound hKmeas hK hmean hv + rw [hvariance] at hbase + exact hbase.trans (gaussian_error_le_smallStep hh0 hh1 hL) + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationFiniteGaussian.lean b/lean/OAI/Probability/SpanningForest/InnovationFiniteGaussian.lean new file mode 100644 index 0000000000000000000000000000000000000000..d73b2e5af7870ffee87f21847799cc9bb0e54ccb --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationFiniteGaussian.lean @@ -0,0 +1,172 @@ +import OAI.Probability.SpanningForest.InnovationGaussianProcess +import OAI.Probability.SpanningForest.InnovationMartingale +import OAI.Probability.SpanningForest.BrownianFamilyPast +import OAI.Probability.SpanningForest.GaussianSum + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal BigOperators + +namespace Problem336.InnovationFiniteGaussian + +theorem martingale_projection {I T Ω : Type*} [Preorder T] + [mΩ : MeasurableSpace Ω] (P : Measure Ω) (F : Filtration T mΩ) + (M : I → T → Ω → ℝ) (hM : ∀ i, Martingale (M i) F P) + (S : Finset I) (θ : I → ℝ) : + Martingale (fun t ω => ∑ i ∈ S, θ i * M i t ω) F P := by + classical + induction S using Finset.induction_on with + | empty => + convert (martingale_zero ℝ F P : Martingale (0 : T → Ω → ℝ) F P) using 1 + funext t ω + simp + | @insert i S hi ih => + simpa only [Finset.sum_insert hi, Pi.add_def, Pi.smul_def, smul_eq_mul] using + ((hM i).smul (θ i)).add ih + +theorem brownian_projection_law {I Ω : Type*} [Fintype I] [MeasurableSpace Ω] + {P : Measure Ω} {B : I → ℝ≥0 → Ω → ℝ} + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hI : iIndepFun (fun i ω t => B i t ω) P) + (θ : I → ℝ) (u v : ℝ≥0) : + HasLaw (fun ω => ∑ i, θ i * (B i v ω - B i u ω)) + (gaussianReal 0 (∑ i, NNReal.mk (θ i ^ 2) (sq_nonneg _) * + nndist (v : ℝ) (u : ℝ))) P := by + apply independent_weighted_gaussian_sum_hasLaw + · intro i + exact (hB i).hasLaw_sub v u + · exact hI.comp (fun _ f => f v - f u) (by fun_prop) + +theorem brownian_finset_projection_law {I Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B : I → ℝ≥0 → Ω → ℝ} + (hB : ∀ i, IsPreBrownianReal (B i) P) + (hI : iIndepFun (fun i ω t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) (u v : ℝ≥0) : + HasLaw (fun ω => ∑ i ∈ S, θ i * (B i v ω - B i u ω)) + (gaussianReal 0 (∑ i ∈ S, NNReal.mk (θ i ^ 2) (sq_nonneg _) * + nndist (v : ℝ) (u : ℝ))) P := by + classical + have hi := brownian_projection_law (fun i : S => hB i) + (hI.precomp (g := fun i : S => (i : I)) Subtype.val_injective) + (fun i : S => θ i) u v + have heq : (fun ω => ∑ i : S, θ i * (B i v ω - B i u ω)) = + (fun ω => ∑ i ∈ S, θ i * (B i v ω - B i u ω)) := by + funext ω + exact Finset.sum_coe_sort S (fun i => θ i * (B i v ω - B i u ω)) + have hv := Finset.sum_coe_sort S (fun i => NNReal.mk (θ i ^ 2) (sq_nonneg _) * + nndist (v : ℝ) (u : ℝ)) + rw [heq, hv] at hi + exact hi + +theorem brownian_projection_indep {I Ω : Type*} [mΩ : MeasurableSpace Ω] + {P : Measure Ω} {B : I → ℝ≥0 → Ω → ℝ} + (hB : ∀ i, IsPreBrownianReal (B i) P) (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + {X : Ω → I → ℝ} (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (S : Finset I) (θ : I → ℝ) {u v : ℝ≥0} (huv : u ≤ v) + {m : MeasurableSpace Ω} + (hm : m ≤ MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance) + {K : Ω → ℂ} (hK : Measurable[m] K) : + IndepFun K (fun ω => ∑ i ∈ S, θ i * (B i v ω - B i u ω)) P := by + let : MeasurableSpace Ω := mΩ + have hi := BrownianFamilyPast.indepFun_weighted_increment_observation + hB hBm hI hX hXB S θ u (v - u) + rw [add_tsub_cancel_of_le huv] at hi + exact (indep_of_indep_of_le_right hi (hK.comap_le.trans hm)).symm + +theorem restricted_characteristic_nnInnovation + {I Ω : Type*} [mΩ : MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (F : Filtration ℝ≥0 mΩ) + (X : Ω → I → ℝ) (B : I → ℝ≥0 → Ω → ℝ) (b : I → ℝ → Ω → ℝ) + (hB : ∀ i, IsPreBrownianReal (B i) P) (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (hb : ∀ i, Measurable (Function.uncurry (b i))) + (hXrange : ∀ ω i, X ω i ∈ Set.Icc (0 : ℝ) 1) + (hbrange : ∀ i t ω, b i t ω ∈ Set.Icc (0 : ℝ) 1) + (hM : ∀ i, Martingale (Innovation.nnInnovation (fun ω => X ω i) (B i) (b i)) F P) + (hF : ∀ u, F u ≤ MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance) + (S : Finset I) (θ : I → ℝ) (s t : ℝ≥0) (τ : ℕ → ℕ → ℝ≥0) + (hτ : ∀ n, Monotone (τ n)) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (duration : ℝ) (hduration : 0 ≤ duration) + (hstep : ∀ n k, k < n + 1 → + (τ n (k + 1) : ℝ) - (τ n k : ℝ) = duration / ((n + 1 : ℕ) : ℝ)) + {A : Set Ω} (hA : MeasurableSet[F s] A) : + (∫ ω in A, Complex.exp (((∑ i ∈ S, θ i * + (Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) t ω - + Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) s ω) : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-duration * ((∑ i ∈ S, θ i ^ 2) / 2)) : ℂ) * (P.real A : ℂ) := by + let W := fun i => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) + let Z := fun r ω => ∑ i ∈ S, θ i * W i r ω + have hZ : Martingale Z F P := martingale_projection P F W hM S θ + let Q := fun n k ω => ∑ i ∈ S, θ i * (B i (τ n (k + 1)) ω - B i (τ n k) ω) + let R := fun n k ω => Z (τ n (k + 1)) ω - Z (τ n k) ω - Q n k ω + let v := fun n k => ∑ i ∈ S, NNReal.mk (θ i ^ 2) (sq_nonneg _) * + nndist (τ n (k + 1) : ℝ) (τ n k : ℝ) + have hZsub (u v : ℝ≥0) (ω : Ω) : + Z v ω - Z u ω = ∑ i ∈ S, θ i * (W i v ω - W i u ω) := by + simp only [Z, mul_sub, Finset.sum_sub_distrib] + have hmono (n k : ℕ) : τ n k ≤ τ n (k + 1) := hτ n (Nat.le_succ k) + have hres := InnovationGaussianProcess.restricted_characteristic_of_gaussian_perturbations + Z s t τ (fun n k => F (τ n k)) (fun n k => F.le _) (F.le s A hA) + (fun n k => F.mono (by simpa only [hstart n] using hτ n (Nat.zero_le k)) A hA) + (fun n k => (hZ.stronglyMeasurable s).measurable.mono + (F.mono (by simpa only [hstart n] using hτ n (Nat.zero_le k))) le_rfl) + (fun n k => (hZ.stronglyMeasurable _).measurable) + hstart hfinish duration (∑ i ∈ S, θ i ^ 2) (∑ i ∈ S, |θ i|) hduration + (Finset.sum_nonneg (fun i _ => sq_nonneg _)) + (Finset.sum_nonneg (fun i _ => abs_nonneg _)) Q R v + (fun n k _ => brownian_finset_projection_law hB hI S θ _ _) ?_ ?_ ?_ ?_ ?_ ?_ + · simpa only [hZsub] using hres + · intro n k hk + simp only [v, NNReal.coe_sum, NNReal.coe_mul, NNReal.coe_mk, + coe_nndist, Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr (show (τ n k : ℝ) ≤ (τ n (k + 1) : ℝ) from hmono n k))] + rw [hstep n k hk, ← Finset.sum_mul, mul_comm] + · intro n k hk + have hq : Measurable (Q n k) := by dsimp [Q]; fun_prop + exact (((hZ.integrable _).sub (hZ.integrable _)).aestronglyMeasurable).sub + hq.aestronglyMeasurable + · intro n k hk + apply Filter.Eventually.of_forall + intro ω + have hid : R n k ω = ∑ i ∈ S, θ i * + (W i (τ n (k + 1)) ω - W i (τ n k) ω - + (B i (τ n (k + 1)) ω - B i (τ n k) ω)) := by + simp only [R, hZsub, Q, mul_sub, Finset.sum_sub_distrib] + rw [hid, ← hstep n k hk] + calc + _ ≤ ∑ i ∈ S, |θ i * (W i (τ n (k + 1)) ω - W i (τ n k) ω - + (B i (τ n (k + 1)) ω - B i (τ n k) ω))| := by + simpa only [Real.norm_eq_abs] using norm_sum_le S (fun i => θ i * + (W i (τ n (k + 1)) ω - W i (τ n k) ω - + (B i (τ n (k + 1)) ω - B i (τ n k) ω))) + _ ≤ ∑ i ∈ S, |θ i| * ((τ n (k + 1) : ℝ) - (τ n k : ℝ)) := by + apply Finset.sum_le_sum + intro i hi + rw [abs_mul] + apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) + have hi := Innovation.innovation_sub_noise_bound + (fun ω => X ω i) (fun r => B i r.toNNReal) (hb i) + (fun ω => hXrange ω i) (hbrange i) (τ n k) (τ n (k + 1)) ω + simpa only [W, Innovation.nnInnovation, Real.toNNReal_coe, + Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr (show (τ n k : ℝ) ≤ (τ n (k + 1) : ℝ) from hmono n k))] using hi + _ = _ := by rw [← Finset.sum_mul, mul_comm] + · intro n k hk + exact Filter.Eventually.of_forall (fun ω => by dsimp [R]; ring) + · intro n k hk K hK + exact brownian_projection_indep hB hBm hI hX hXB S θ (hmono n k) (hF _) hK + · intro n k hk K hK hKbound + exact Innovation.integral_weighted_martingale_sub_eq_zero P F hZ (hmono n k) + hK.stronglyMeasurable (Filter.Eventually.of_forall hKbound) + +end Problem336.InnovationFiniteGaussian + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationGaussianLaw.lean b/lean/OAI/Probability/SpanningForest/InnovationGaussianLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..ceb0b05678a5a9d701c8822bfe0cce6dda487f51 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationGaussianLaw.lean @@ -0,0 +1,49 @@ +import OAI.Probability.SpanningForest.InnovationSubdivision +import OAI.Probability.SpanningForest.InnovationLawIdentification + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal Topology + +namespace Problem336.InnovationGaussianLaw + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [CompleteSpace E] [mE : MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +theorem hasLaw_and_indep_of_gaussian_recurrences + (P : Measure Ω) [IsProbabilityMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (X : Ω → E) (hX : Measurable X) (past : MeasurableSpace Ω) + (hpast : past ≤ mΩ) (T : ℝ) (hT : 0 ≤ T) + (v C : E → ℝ) (hv : ∀ θ, 0 ≤ v θ) + (hchar : ∀ θ, charFun ν θ = (Real.exp (-T * v θ) : ℂ)) + (μ : Set Ω → E → ℕ → ℕ → ℂ) + (hinit : ∀ A, MeasurableSet[past] A → ∀ θ n, + μ A θ n 0 = ((P A).toReal : ℂ)) + (hfinal : ∀ A, MeasurableSet[past] A → ∀ θ n, + μ A θ n (n + 1) = + ∫ ω in A, Complex.exp ((inner ℝ (X ω) θ : ℝ) * Complex.I) ∂P) + (hstep : ∀ A, MeasurableSet[past] A → ∀ θ, + ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, + ‖μ A θ n (k + 1) - + (Real.exp (-(T / ((n + 1 : ℕ) : ℝ)) * v θ) : ℂ) * μ A θ n k‖ ≤ + C θ * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) : + HasLaw X ν P ∧ Indep (MeasurableSpace.comap X mE) past P := by + let : MeasurableSpace Ω := mΩ + apply InnovationLawIdentification.hasLaw_and_indep_of_restricted_integral + P ν X hX past hpast + intro A hA θ + have heq := InnovationSubdivision.gaussian_identity_of_subdivision_recurrences + (∫ ω in A, Complex.exp ((inner ℝ (X ω) θ : ℝ) * Complex.I) ∂P) + ((P A).toReal : ℂ) (μ A θ) (C θ) T (v θ) hT (hv θ) + (hinit A hA θ) (hfinal A hA θ) (hstep A hA θ) + simpa only [hchar θ, mul_comm] using heq + +end Problem336.InnovationGaussianLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationGaussianObservation.lean b/lean/OAI/Probability/SpanningForest/InnovationGaussianObservation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1de4f3354dc57a847454d5c08f099d8c449ae98 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationGaussianObservation.lean @@ -0,0 +1,84 @@ +import OAI.Probability.SpanningForest.InnovationAdapted + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Set +open scoped NNReal + +namespace Problem336.Innovation + +theorem integral_gaussian_on_independent_past + {Ω : Type*} {m mΩ : MeasurableSpace Ω} {P : Measure Ω} + (hm : m ≤ mΩ) {Q : Ω → ℝ} {v : ℝ≥0} + (hQ : HasLaw Q (gaussianReal 0 v) P) (hQmeas : Measurable Q) + (hindep : Indep (MeasurableSpace.comap Q (inferInstance : MeasurableSpace ℝ)) m P) + {A : Set Ω} (hA : MeasurableSet[m] A) : + (∫ ω in A, Q ω ∂P) = 0 := by + let : IsProbabilityMeasure P := hQ.isProbabilityMeasure + have hmean : (∫ ω, Q ω ∂P) = 0 := by + rw [hQ.integral_eq, integral_id_gaussianReal] + have hcond : P[Q | m] =ᵐ[P] fun _ => (0 : ℝ) := by + simpa only [hmean] using condExp_indep_eq hQmeas.comap_le hm + (comap_measurable Q).stronglyMeasurable hindep + rw [← setIntegral_condExp hm hQ.hasGaussianLaw.integrable hA] + calc + (∫ ω in A, P[Q | m] ω ∂P) = ∫ _ in A, (0 : ℝ) ∂P := + integral_congr_ae (ae_restrict_of_ae hcond) + _ = 0 := by simp + +theorem martingale_borel_observation_of_gaussian_increments + {ι Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) (ℱ : Filtration ℝ≥0 mΩ) + (Y : ℝ≥0 → Ω → ι → ℝ) + (hcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (hadapted : ∀ t i, Measurable[ℱ t] (fun ω => Y t ω i)) + (i : ι) (X : Ω → ℝ) (hXmeas : Measurable X) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + (B : ℝ≥0 → Ω → ℝ) + (hobs : ∀ t ω, Y t ω i = (t : ℝ) * X ω + B t ω) + (hBzero : B 0 =ᵐ[P] 0) + (hinc : ∀ u v : ℝ≥0, u ≤ v → + HasLaw (fun ω => B v ω - B u ω) (gaussianReal 0 (v - u)) P) + (hindep : ∀ u v : ℝ≥0, u ≤ v → + Indep (MeasurableSpace.comap (fun ω => B v ω - B u ω) + (inferInstance : MeasurableSpace ℝ)) (ℱ u) P) + (b : ℝ≥0 → (ι → ℝ) → ℝ) (hb : Measurable (Function.uncurry b)) + {C : ℝ} (hbound : ∀ t y, ‖b t y‖ ≤ C) + (hposterior : ∀ t : ℝ≥0, (fun ω => b t (Y t ω)) =ᵐ[P] P[X | ℱ t]) : + Martingale (fun t ω => Y t ω i - + ∫ s in (0 : ℝ)..t, b s.toNNReal (Y s.toNNReal ω)) ℱ P := by + let : IsProbabilityMeasure P := (hinc 0 0 le_rfl).isProbabilityMeasure + have hX : Integrable X P := Integrable.of_bound hXmeas.aestronglyMeasurable 1 (by + apply Filter.Eventually.of_forall + intro ω + rw [Real.norm_eq_abs, abs_of_nonneg (hXbound ω).1] + exact (hXbound ω).2) + have hBmeas (t : ℝ≥0) : Measurable (B t) := by + have heq : B t = fun ω => Y t ω i - (t : ℝ) * X ω := by + funext ω + rw [hobs] + ring + rw [heq] + exact ((hadapted t i).mono (ℱ.le t) le_rfl).sub (measurable_const.mul hXmeas) + have hB (t : ℝ≥0) : Integrable (B t) P := by + have hlaw : HasLaw (B t) (gaussianReal 0 t) P := by + have hzero := (hinc 0 t (by exact zero_le)).congr (show + B t =ᵐ[P] fun ω => B t ω - B 0 ω from by + filter_upwards [hBzero] with ω hω + simp only [Pi.zero_apply] at hω + rw [hω, sub_zero]) + simpa only [tsub_zero] using hzero + exact hlaw.hasGaussianLaw.integrable + apply martingale_borel_observation P ℱ Y hcont hadapted i X B hobs hX hB b hb + hbound hposterior + intro u v huv A hA + exact integral_gaussian_on_independent_past (ℱ.le u) (hinc u v huv) + ((hBmeas v).sub (hBmeas u)) (hindep u v huv) hA + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationGaussianProcess.lean b/lean/OAI/Probability/SpanningForest/InnovationGaussianProcess.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca4d2a18cacca4a2988cfc5756f3f3b09f42dde7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationGaussianProcess.lean @@ -0,0 +1,135 @@ +import OAI.Probability.SpanningForest.InnovationErrorRate +import OAI.Probability.SpanningForest.InnovationPhaseRecurrence +import OAI.Probability.SpanningForest.InnovationLawIdentification + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology NNReal + +namespace Problem336.InnovationGaussianProcess + +theorem restricted_characteristic_of_gaussian_perturbations + {Ω T : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + (X : T → Ω → ℝ) (s t : T) (τ : ℕ → ℕ → T) + (past : ℕ → ℕ → MeasurableSpace Ω) + (hpast : ∀ n k, past n k ≤ mΩ) + {A : Set Ω} (hA : MeasurableSet A) + (hApast : ∀ n k, MeasurableSet[past n k] A) + (hXstart : ∀ n k, Measurable[past n k] (X s)) + (hXpast : ∀ n k, Measurable[past n k] (X (τ n k))) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (duration c L : ℝ) (hduration : 0 ≤ duration) (hc : 0 ≤ c) (hL : 0 ≤ L) + (Q R : ℕ → ℕ → Ω → ℝ) (variance : ℕ → ℕ → ℝ≥0) + (hLaw : ∀ n k, k < n + 1 → HasLaw (Q n k) (gaussianReal 0 (variance n k)) P) + (hvariance : ∀ n k, k < n + 1 → + (variance n k : ℝ) = (duration / ((n + 1 : ℕ) : ℝ)) * c) + (hR : ∀ n k, k < n + 1 → AEStronglyMeasurable (R n k) P) + (hRbound : ∀ n k, k < n + 1 → ∀ᵐ ω ∂P, + |R n k ω| ≤ (duration / ((n + 1 : ℕ) : ℝ)) * L) + (hdecomp : ∀ n k, k < n + 1 → ∀ᵐ ω ∂P, + X (τ n (k + 1)) ω - X (τ n k) ω = Q n k ω + R n k ω) + (hIndep : ∀ n k, k < n + 1 → ∀ K : Ω → ℂ, + Measurable[past n k] K → IndepFun K (Q n k) P) + (hmean : ∀ n k, k < n + 1 → ∀ K : Ω → ℂ, + Measurable[past n k] K → (∀ ω, ‖K ω‖ ≤ 1) → + (∫ ω, K ω * ((X (τ n (k + 1)) ω - X (τ n k) ω : ℝ) : ℂ) ∂P) = 0) : + (∫ ω in A, Complex.exp (((X t ω - X s ω : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-duration * (c / 2)) : ℂ) * (P.real A : ℂ) := by + apply InnovationPhaseRecurrence.restricted_characteristic_of_bounded_test_steps + X s t τ past hA hApast hXstart hXpast hstart hfinish + (Innovation.gaussianErrorConstant L c) duration (c / 2) hduration (by positivity) + have hquot : Tendsto (fun n : ℕ => duration / ((n + 1 : ℕ) : ℝ)) atTop (𝓝 0) := + (tendsto_const_div_atTop_nhds_zero_nat duration).comp (tendsto_add_atTop_nat 1) + have htimes : Tendsto (fun n : ℕ => (duration / ((n + 1 : ℕ) : ℝ)) * c) + atTop (𝓝 0) := by simpa using hquot.mul_const c + have hsmall1 : ∀ᶠ n : ℕ in atTop, duration / ((n + 1 : ℕ) : ℝ) < 1 := + hquot.eventually (gt_mem_nhds (by norm_num : (0 : ℝ) < 1)) + have hsmall2 : ∀ᶠ n : ℕ in atTop, + (duration / ((n + 1 : ℕ) : ℝ)) * c < 2 := + htimes.eventually (gt_mem_nhds (by norm_num : (0 : ℝ) < 2)) + filter_upwards [hsmall1, hsmall2] with n hn1 hn2 + intro k hk K hKmeas hKbound + have hKΩ : Measurable K := hKmeas.mono (hpast n k) le_rfl + have hmean' : (∫ ω, K ω * ((Q n k ω + R n k ω : ℝ) : ℂ) ∂P) = 0 := by + rw [← hmean n k hk K hKmeas hKbound] + apply integral_congr_ae + filter_upwards [hdecomp n k hk] with ω hω + rw [hω] + have hstep := Innovation.gaussian_smallStep_characteristic + (hLaw n k hk) (hIndep n k hk K hKmeas) (hR n k hk) + (div_nonneg hduration (by positivity)) hn1.le hL + (hvariance n k hk) hn2.le (hRbound n k hk) hKΩ.aestronglyMeasurable + (Filter.Eventually.of_forall hKbound) hmean' + have hphase : (∫ ω, K ω * Complex.exp (((Q n k ω + R n k ω : ℝ) : ℂ) * Complex.I) ∂P) = + ∫ ω, K ω * Complex.exp (((X (τ n (k + 1)) ω - X (τ n k) ω : ℝ) : ℂ) * Complex.I) ∂P := by + apply integral_congr_ae + filter_upwards [hdecomp n k hk] with ω hω + rw [hω] + rw [hphase] at hstep + have hexponent : -(duration / ((n + 1 : ℕ) : ℝ) * c / 2) = + -(duration / ((n + 1 : ℕ) : ℝ)) * (c / 2) := by ring + rw [hexponent] at hstep + simpa only [mul_comm] using hstep + +theorem hasLaw_and_indep_of_gaussian_perturbations + {Ω T E : Type*} [mΩ : MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + [mE : MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + (P : Measure Ω) [IsProbabilityMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (Z : T → Ω → E) (s t : T) (τ : ℕ → ℕ → T) + (past : ℕ → ℕ → MeasurableSpace Ω) (basePast : MeasurableSpace Ω) + (hpast : ∀ n k, past n k ≤ mΩ) (hbase : ∀ n k, basePast ≤ past n k) + (hZstart : Measurable[basePast] (Z s)) + (hZpast : ∀ n k, Measurable[past n k] (Z (τ n k))) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (duration : ℝ) (hduration : 0 ≤ duration) (c L : E → ℝ) + (hc : ∀ θ, 0 ≤ c θ) (hL : ∀ θ, 0 ≤ L θ) + (hchar : ∀ θ, charFun ν θ = (Real.exp (-duration * (c θ / 2)) : ℂ)) + (Q R : E → ℕ → ℕ → Ω → ℝ) (variance : E → ℕ → ℕ → ℝ≥0) + (hLaw : ∀ θ n k, k < n + 1 → + HasLaw (Q θ n k) (gaussianReal 0 (variance θ n k)) P) + (hvariance : ∀ θ n k, k < n + 1 → + (variance θ n k : ℝ) = (duration / ((n + 1 : ℕ) : ℝ)) * c θ) + (hR : ∀ θ n k, k < n + 1 → AEStronglyMeasurable[mΩ] (R θ n k) P) + (hRbound : ∀ θ n k, k < n + 1 → ∀ᵐ ω ∂P, + |R θ n k ω| ≤ (duration / ((n + 1 : ℕ) : ℝ)) * L θ) + (hdecomp : ∀ θ n k, k < n + 1 → ∀ᵐ ω ∂P, + inner ℝ (Z (τ n (k + 1)) ω - Z (τ n k) ω) θ = Q θ n k ω + R θ n k ω) + (hIndep : ∀ θ n k, k < n + 1 → ∀ K : Ω → ℂ, + Measurable[past n k] K → IndepFun K (Q θ n k) P) + (hmean : ∀ θ n k, k < n + 1 → ∀ K : Ω → ℂ, + Measurable[past n k] K → (∀ ω, ‖K ω‖ ≤ 1) → + (∫ ω, K ω * ((inner ℝ (Z (τ n (k + 1)) ω - Z (τ n k) ω) θ : ℝ) : ℂ) ∂P) = 0) : + HasLaw (fun ω => Z t ω - Z s ω) ν P ∧ + Indep (MeasurableSpace.comap (fun ω => Z t ω - Z s ω) mE) basePast P := by + let : MeasurableSpace Ω := mΩ + have hbΩ : basePast ≤ mΩ := (hbase 0 0).trans (hpast 0 0) + have hZs : Measurable (Z s) := hZstart.mono hbΩ le_rfl + have hZt : Measurable (Z t) := by + simpa only [hfinish 0] using (hZpast 0 1).mono (hpast 0 1) le_rfl + apply InnovationLawIdentification.hasLaw_and_indep_of_restricted_integral + P ν (fun ω => Z t ω - Z s ω) (hZt.sub hZs) basePast hbΩ + intro A hA θ + have hscalar := restricted_characteristic_of_gaussian_perturbations + (fun r ω => inner ℝ (Z r ω) θ) s t τ past hpast (hbΩ A hA) + (fun n k => hbase n k A hA) + (fun n k => by + have hZ := hZstart.mono (hbase n k) le_rfl + fun_prop) + (fun n k => by + have hZ := hZpast n k + fun_prop) + hstart hfinish duration (c θ) (L θ) hduration (hc θ) (hL θ) + (Q θ) (R θ) (variance θ) (hLaw θ) (hvariance θ) (hR θ) (hRbound θ) + (by simpa only [inner_sub_left] using hdecomp θ) (hIndep θ) + (by simpa only [inner_sub_left] using hmean θ) + simpa only [hchar θ, inner_sub_left, Measure.real, mul_comm] using hscalar + +end Problem336.InnovationGaussianProcess + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationIdentification.lean b/lean/OAI/Probability/SpanningForest/InnovationIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..4604e0825695b526daa6f22bafd55835327aad6e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationIdentification.lean @@ -0,0 +1,207 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped InnerProductSpace ENNReal NNReal + +namespace Problem336.InnovationIdentification + +variable {Ω E : Type*} [mΩ : MeasurableSpace Ω] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + [MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +theorem restrict_map_eq_smul_of_characteristic + {P : Measure Ω} [IsFiniteMeasure P] {ν : Measure E} [IsFiniteMeasure ν] + {D : Ω → E} (hD : Measurable D) (A : Set Ω) + (hchar : ∀ θ : E, + (∫ ω in A, Complex.exp ((inner ℝ (D ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun ν θ) : + (P.restrict A).map D = P A • ν := by + have : IsFiniteMeasure (P A • ν) := ⟨by + rw [Measure.smul_apply, smul_eq_mul] + exact ENNReal.mul_lt_top (measure_lt_top P A) (measure_lt_top ν Set.univ)⟩ + apply Measure.ext_of_charFun + funext θ + rw [charFun_apply, integral_map hD.aemeasurable (by fun_prop), hchar θ] + simp only [charFun_apply, integral_smul_measure] + +theorem law_and_indep_of_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] {ν : Measure E} [IsProbabilityMeasure ν] + {D : Ω → E} (hD : Measurable D) + {PastEvent : Set Ω → Prop} (huniv : PastEvent Set.univ) + (hchar : ∀ A : Set Ω, PastEvent A → ∀ θ : E, + (∫ ω in A, Complex.exp ((inner ℝ (D ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun ν θ) : + P.map D = ν ∧ ∀ {Past : Type*} [MeasurableSpace Past] (Y : Ω → Past), + (∀ t : Set Past, MeasurableSet t → PastEvent (Y ⁻¹' t)) → IndepFun D Y P := by + have hLaw : P.map D = ν := by + simpa using restrict_map_eq_smul_of_characteristic hD Set.univ + (hchar Set.univ huniv) + refine ⟨hLaw, ?_⟩ + intro Past _ Y hY + apply indepFun_iff_measure_inter_preimage_eq_mul.2 + intro s t hs ht + have heq := congrArg (fun ρ : Measure E => ρ s) + (restrict_map_eq_smul_of_characteristic hD (Y ⁻¹' t) (hchar _ (hY t ht))) + rw [Measure.map_apply hD hs, Measure.restrict_apply (hD hs), + Measure.smul_apply, smul_eq_mul] at heq + have hLs : ν s = P (D ⁻¹' s) := by + rw [← hLaw, Measure.map_apply hD hs] + rw [hLs, mul_comm] at heq + exact heq + +theorem iIndepFun_of_past_characteristic + {ι : Type*} [LinearOrder ι] + {P : Measure Ω} [IsProbabilityMeasure P] + {ν : ι → Measure E} [∀ i, IsProbabilityMeasure (ν i)] + {D : ι → Ω → E} (hD : ∀ i, Measurable (D i)) + (hchar : ∀ (i : ι) (s : Finset ι) (sets : ι → Set E), + (∀ j ∈ s, j < i) → (∀ j ∈ s, MeasurableSet (sets j)) → ∀ θ : E, + (∫ ω in ⋂ j ∈ s, D j ⁻¹' sets j, + Complex.exp ((inner ℝ (D i ω) θ : ℂ) * Complex.I) ∂P) = + (P (⋂ j ∈ s, D j ⁻¹' sets j)).toReal • charFun (ν i) θ) : + iIndepFun D P := by + classical + have hLaw (i : ι) : P.map (D i) = ν i := by + have h := restrict_map_eq_smul_of_characteristic (hD i) + (⋂ j ∈ (∅ : Finset ι), D j ⁻¹' (Set.univ : Set E)) + (hchar i ∅ (fun _ => Set.univ) (by simp) (by simp)) + simpa using h + apply iIndepFun_iff_measure_inter_preimage_eq_mul.2 + intro s sets hs + induction s using Finset.induction_on_max with + | empty => simp + | insert i s his ih => + have hi : i ∉ s := fun hi => lt_irrefl i (his i hi) + have hsi : ∀ j ∈ s, MeasurableSet (sets j) := + fun j hj => hs j (Finset.mem_insert_of_mem hj) + have hmi : MeasurableSet (sets i) := hs i (Finset.mem_insert_self i s) + have heq := congrArg (fun ρ : Measure E => ρ (sets i)) + (restrict_map_eq_smul_of_characteristic (hD i) + (⋂ j ∈ s, D j ⁻¹' sets j) (hchar i s sets his hsi)) + rw [Measure.map_apply (hD i) hmi, Measure.restrict_apply ((hD i) hmi), + Measure.smul_apply, smul_eq_mul] at heq + have hLi : ν i (sets i) = P (D i ⁻¹' sets i) := by + rw [← hLaw i, Measure.map_apply (hD i) hmi] + rw [hLi, ih hsi, mul_comm] at heq + simpa only [Finset.set_biInter_insert, Finset.prod_insert hi] using heq + +theorem hasLaw_infinitePi_of_past_characteristic + {ι : Type*} [LinearOrder ι] + {P : Measure Ω} [IsProbabilityMeasure P] + {ν : ι → Measure E} [∀ i, IsProbabilityMeasure (ν i)] + {D : ι → Ω → E} (hD : ∀ i, Measurable (D i)) + (hchar : ∀ (i : ι) (s : Finset ι) (sets : ι → Set E), + (∀ j ∈ s, j < i) → (∀ j ∈ s, MeasurableSet (sets j)) → ∀ θ : E, + (∫ ω in ⋂ j ∈ s, D j ⁻¹' sets j, + Complex.exp ((inner ℝ (D i ω) θ : ℂ) * Complex.I) ∂P) = + (P (⋂ j ∈ s, D j ⁻¹' sets j)).toReal • charFun (ν i) θ) : + HasLaw (fun ω i => D i ω) (Measure.infinitePi ν) P := by + apply (iIndepFun_of_past_characteristic hD hchar).hasLaw_infinitePi + · intro i + refine ⟨(hD i).aemeasurable, ?_⟩ + have h := restrict_map_eq_smul_of_characteristic (hD i) + (⋂ j ∈ (∅ : Finset ι), D j ⁻¹' (Set.univ : Set E)) + (hchar i ∅ (fun _ => Set.univ) (by simp) (by simp)) + simpa using h + · exact (Measurable.of_eval hD).aemeasurable + +theorem hasIndepIncrements_of_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] + {ν : ℝ≥0 → ℝ≥0 → Measure E} [∀ s t, IsProbabilityMeasure (ν s t)] + {W : ℝ≥0 → Ω → E} {ℱ : Filtration ℝ≥0 mΩ} (hW : Adapted ℱ W) + (hchar : ∀ (s t : ℝ≥0), s ≤ t → ∀ A : Set Ω, MeasurableSet[ℱ s] A → + ∀ θ : E, + (∫ ω in A, Complex.exp ((inner ℝ (W t ω - W s ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun (ν s t) θ) : + HasIndepIncrements W P := by + intro n times htimes + apply iIndepFun_of_past_characteristic + (ν := fun i : Fin n => ν (times i.castSucc) (times i.succ)) + (fun i => hW.measurable.sub hW.measurable) + intro i s sets hprior hsets θ + apply hchar (times i.castSucc) (times i.succ) (htimes (Fin.castSucc_le_succ i)) + apply MeasurableSet.iInter + intro j + apply MeasurableSet.iInter + intro hj + have hjs : j.succ ≤ i.castSucc := by + exact_mod_cast hprior j hj + have hjc : j.castSucc ≤ i.castSucc := (Fin.castSucc_le_succ j).trans hjs + exact ((hW.measurable_le (htimes hjs)).sub + (hW.measurable_le (htimes hjc))) (hsets j hj) + +theorem isPreBrownianReal_of_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] + {W : ℝ≥0 → Ω → ℝ} {ℱ : Filtration ℝ≥0 mΩ} (hW : Adapted ℱ W) + (hzero : ∀ᵐ ω ∂P, W 0 ω = 0) + (hchar : ∀ (s t : ℝ≥0), s ≤ t → ∀ A : Set Ω, MeasurableSet[ℱ s] A → + ∀ θ : ℝ, + (∫ ω in A, Complex.exp ((inner ℝ (W t ω - W s ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun (gaussianReal 0 (t - s)) θ) : + IsPreBrownianReal W P := by + have hinc : HasIndepIncrements W P := + hasIndepIncrements_of_past_characteristic hW hchar + apply HasIndepIncrements.isPreBrownianReal_of_hasLaw _ hinc + intro t + have hlaw : HasLaw (W t - W 0) (gaussianReal 0 t) P := by + refine ⟨(hW.measurable.sub hW.measurable).aemeasurable, ?_⟩ + have h := restrict_map_eq_smul_of_characteristic + (hW.measurable.sub hW.measurable) Set.univ + (hchar 0 t zero_le Set.univ MeasurableSet.univ) + simpa using h + apply hlaw.congr + filter_upwards [hzero] with ω hω + simp [hω] + +theorem isBrownianReal_of_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] + {W : ℝ≥0 → Ω → ℝ} {ℱ : Filtration ℝ≥0 mΩ} (hW : Adapted ℱ W) + (hzero : ∀ᵐ ω ∂P, W 0 ω = 0) + (hcont : ∀ᵐ ω ∂P, Continuous (fun t => W t ω)) + (hchar : ∀ (s t : ℝ≥0), s ≤ t → ∀ A : Set Ω, MeasurableSet[ℱ s] A → + ∀ θ : ℝ, + (∫ ω in A, Complex.exp ((inner ℝ (W t ω - W s ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun (gaussianReal 0 (t - s)) θ) : + IsBrownianReal W P := + ⟨isPreBrownianReal_of_past_characteristic hW hzero hchar, hcont⟩ + +theorem hasIndepIncrements_of_strict_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] + {ν : ℝ≥0 → ℝ≥0 → Measure E} [∀ s t, IsProbabilityMeasure (ν s t)] + {W : ℝ≥0 → Ω → E} {ℱ : Filtration ℝ≥0 mΩ} (hW : Adapted ℱ W) + (hdiag : ∀ s, ν s s = Measure.dirac 0) + (hchar : ∀ (s t : ℝ≥0), s < t → ∀ A : Set Ω, MeasurableSet[ℱ s] A → + ∀ θ : E, + (∫ ω in A, Complex.exp ((inner ℝ (W t ω - W s ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun (ν s t) θ) : + HasIndepIncrements W P := by + apply hasIndepIncrements_of_past_characteristic (ν := ν) hW + intro s t hst A hA θ + rcases eq_or_lt_of_le hst with rfl | hst + · simp [hdiag, charFun_apply, measureReal_def] + · exact hchar s t hst A hA θ + +theorem isPreBrownianReal_of_strict_past_characteristic + {P : Measure Ω} [IsProbabilityMeasure P] + {W : ℝ≥0 → Ω → ℝ} {ℱ : Filtration ℝ≥0 mΩ} (hW : Adapted ℱ W) + (hzero : ∀ᵐ ω ∂P, W 0 ω = 0) + (hchar : ∀ (s t : ℝ≥0), s < t → ∀ A : Set Ω, MeasurableSet[ℱ s] A → + ∀ θ : ℝ, + (∫ ω in A, Complex.exp ((inner ℝ (W t ω - W s ω) θ : ℂ) * Complex.I) ∂P) = + (P A).toReal • charFun (gaussianReal 0 (t - s)) θ) : + IsPreBrownianReal W P := by + apply isPreBrownianReal_of_past_characteristic hW hzero + intro s t hst A hA θ + rcases eq_or_lt_of_le hst with rfl | hst + · simp [charFun_apply, measureReal_def] + · exact hchar s t hst A hA θ + +end Problem336.InnovationIdentification + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationLawIdentification.lean b/lean/OAI/Probability/SpanningForest/InnovationLawIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5d11609961f7c294a8f176055a4cb40a683df8f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationLawIdentification.lean @@ -0,0 +1,97 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +namespace Problem336.InnovationLawIdentification + +variable {Ω : Type*} [mΩ : MeasurableSpace Ω] +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [CompleteSpace E] [mE : MeasurableSpace E] [BorelSpace E] [SecondCountableTopology E] + +theorem map_restrict_eq_smul_of_charFun + (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (X : Ω → E) (A : Set Ω) + (h : ∀ t : E, charFun ((P.restrict A).map X) t = + ((P A).toReal : ℂ) * charFun ν t) : + (P.restrict A).map X = P A • ν := by + have : IsFiniteMeasure (P A • ν) := ν.smul_finite (measure_ne_top P A) + apply Measure.ext_of_charFun + funext t + rw [h t] + simp only [charFun_apply, integral_smul_measure, RCLike.real_smul_eq_coe_mul] + rfl + +theorem hasLaw_and_indepFun_of_restricted_charFun + {F : Type*} [MeasurableSpace F] + (P : Measure Ω) [IsProbabilityMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (X : Ω → E) (Y : Ω → F) (hX : Measurable X) + (h : ∀ B : Set F, MeasurableSet B → ∀ t : E, + charFun ((P.restrict (Y ⁻¹' B)).map X) t = + ((P (Y ⁻¹' B)).toReal : ℂ) * charFun ν t) : + HasLaw X ν P ∧ IndepFun X Y P := by + have hrestricted (B : Set F) (hB : MeasurableSet B) : + (P.restrict (Y ⁻¹' B)).map X = P (Y ⁻¹' B) • ν := + map_restrict_eq_smul_of_charFun P ν X (Y ⁻¹' B) (h B hB) + have hlaw : P.map X = ν := by + simpa using hrestricted Set.univ MeasurableSet.univ + refine ⟨⟨hX.aemeasurable, hlaw⟩, + indepFun_iff_measure_inter_preimage_eq_mul.mpr ?_⟩ + intro s t hs ht + have heq := congrArg (fun ρ : Measure E => ρ s) (hrestricted t ht) + rw [Measure.map_apply hX hs, Measure.restrict_apply (hs.preimage hX), + Measure.smul_apply] at heq + have hmargin : P (X ⁻¹' s) = ν s := by + rw [← hlaw, Measure.map_apply hX hs] + rw [heq, hmargin] + exact mul_comm _ _ + +theorem hasLaw_and_indep_of_restricted_charFun + (P : Measure Ω) [IsProbabilityMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (X : Ω → E) (hX : Measurable X) (past : MeasurableSpace Ω) + (hpast : past ≤ mΩ) + (h : ∀ A : Set Ω, MeasurableSet[past] A → ∀ t : E, + charFun (@Measure.map Ω E mΩ mE X (P.restrict A)) t = + ((P A).toReal : ℂ) * charFun ν t) : + HasLaw X ν P ∧ Indep (MeasurableSpace.comap X mE) past P := by + let : MeasurableSpace Ω := mΩ + have hrestricted (A : Set Ω) (hA : MeasurableSet[past] A) : + (P.restrict A).map X = P A • ν := + map_restrict_eq_smul_of_charFun P ν X A (h A hA) + have hlaw : P.map X = ν := by + simpa using hrestricted Set.univ MeasurableSet.univ + refine ⟨⟨hX.aemeasurable, hlaw⟩, (indep_iff_forall_indepSet P).mpr ?_⟩ + intro s A hs hA + rcases MeasurableSpace.measurableSet_comap.mp hs with ⟨B, hB, rfl⟩ + apply (indepSet_iff_measure_inter_eq_mul (hB.preimage hX) (hpast A hA) P).mpr + have heq := congrArg (fun ρ : Measure E => ρ B) (hrestricted A hA) + rw [Measure.map_apply hX hB, Measure.restrict_apply (hB.preimage hX), + Measure.smul_apply] at heq + have hmargin : P (X ⁻¹' B) = ν B := by + rw [← hlaw, Measure.map_apply hX hB] + rw [heq, hmargin] + exact mul_comm _ _ + +theorem hasLaw_and_indep_of_restricted_integral + (P : Measure Ω) [IsProbabilityMeasure P] (ν : Measure E) [IsFiniteMeasure ν] + (X : Ω → E) (hX : Measurable X) (past : MeasurableSpace Ω) + (hpast : past ≤ mΩ) + (h : ∀ A : Set Ω, MeasurableSet[past] A → ∀ t : E, + (∫ ω in A, Complex.exp ((inner ℝ (X ω) t : ℝ) * Complex.I) ∂P) = + ((P A).toReal : ℂ) * charFun ν t) : + HasLaw X ν P ∧ Indep (MeasurableSpace.comap X mE) past P := by + let : MeasurableSpace Ω := mΩ + apply hasLaw_and_indep_of_restricted_charFun P ν X hX past hpast + intro A hA t + rw [charFun_apply, integral_map hX.aemeasurable (by fun_prop)] + exact h A hA t + +end Problem336.InnovationLawIdentification + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationMartingale.lean b/lean/OAI/Probability/SpanningForest/InnovationMartingale.lean new file mode 100644 index 0000000000000000000000000000000000000000..8287415ae3553d6748e562920032e579665003fe --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationMartingale.lean @@ -0,0 +1,335 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Filter Set +open scoped Topology NNReal + +namespace Problem336.Innovation + +theorem integrable_bounded_field {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsFiniteMeasure P] {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (u v : ℝ) (A : Set Ω) : + Integrable (Function.uncurry b) + ((volume.restrict (uIoc u v)).prod (P.restrict A)) := by + let : IsFiniteMeasure (volume.restrict (uIoc u v)) := by + change IsFiniteMeasure (volume.restrict (Ioc (min u v) (max u v))) + infer_instance + exact Integrable.of_bound hb.aestronglyMeasurable C + (Eventually.of_forall (fun q => hbound q.1 q.2)) + +theorem integral_integrated_drift {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsFiniteMeasure P] {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (u v : ℝ) (A : Set Ω) (m : ℝ) + (hmean : ∀ t ∈ uIoc u v, ∫ ω in A, b t ω ∂P = m) : + (∫ ω in A, (∫ t in u..v, b t ω) ∂P) = (v - u) * m := by + rw [← intervalIntegral_integral_swap + (integrable_bounded_field P hb hbound u v A)] + calc + (∫ t in u..v, ∫ ω in A, b t ω ∂P) = ∫ _t in u..v, m := by + apply intervalIntegral.integral_congr_ae + exact Eventually.of_forall hmean + _ = (v - u) * m := by simp + +theorem integral_posterior_on_past {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} (hX : Integrable X P) {b : ℝ → Ω → ℝ} + (hposterior : ∀ t, b t =ᵐ[P] P[X | ℱ t]) + {u t : ℝ} (hut : u ≤ t) {A : Set Ω} (hA : MeasurableSet[ℱ u] A) : + (∫ ω in A, b t ω ∂P) = ∫ ω in A, X ω ∂P := by + calc + (∫ ω in A, b t ω ∂P) = ∫ ω in A, P[X | ℱ t] ω ∂P := + integral_congr_ae (ae_restrict_of_ae (hposterior t)) + _ = ∫ ω in A, X ω ∂P := + setIntegral_condExp (ℱ.le t) hX ((ℱ.mono hut) A hA) + +theorem integral_integrated_posterior {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} (hX : Integrable X P) {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) + (hposterior : ∀ t, b t =ᵐ[P] P[X | ℱ t]) + {u v : ℝ} (huv : u ≤ v) {A : Set Ω} (hA : MeasurableSet[ℱ u] A) : + (∫ ω in A, (∫ t in u..v, b t ω) ∂P) = + (v - u) * ∫ ω in A, X ω ∂P := by + apply integral_integrated_drift P hb hbound u v A + intro t ht + rw [uIoc_of_le huv] at ht + exact integral_posterior_on_past P ℱ hX hposterior ht.1.le hA + +theorem integrable_integrated_field {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsFiniteMeasure P] {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (u v : ℝ) : + Integrable (fun ω => ∫ t in u..v, b t ω) P := by + have hprod := integrable_bounded_field P hb hbound u v univ + simp only [Measure.restrict_univ] at hprod + have hint := hprod.integral_prod_right + simpa only [intervalIntegral.intervalIntegral_eq_integral_uIoc, + Function.uncurry_apply_pair, Pi.smul_def] using + hint.smul (if u ≤ v then (1 : ℝ) else -1) + +theorem intervalIntegrable_field {Ω : Type*} [MeasurableSpace Ω] + {b : ℝ → Ω → ℝ} (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (u v : ℝ) (ω : Ω) : + IntervalIntegrable (fun t => b t ω) volume u v := by + rw [intervalIntegrable_iff] + let : IsFiniteMeasure (volume.restrict (uIoc u v)) := by + change IsFiniteMeasure (volume.restrict (Ioc (min u v) (max u v))) + infer_instance + exact Integrable.of_bound + (hb.comp (measurable_id.prodMk measurable_const)).aestronglyMeasurable C + (Eventually.of_forall (fun t => hbound t ω)) + +def innovation {Ω : Type*} (X : Ω → ℝ) (B b : ℝ → Ω → ℝ) + (t : ℝ) (ω : Ω) : ℝ := + t * X ω + B t ω - ∫ s in 0..t, b s ω + +theorem innovation_sub {Ω : Type*} [MeasurableSpace Ω] + (X : Ω → ℝ) (B : ℝ → Ω → ℝ) {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (u v : ℝ) (ω : Ω) : + innovation X B b v ω - innovation X B b u ω = + (v - u) * X ω + (B v ω - B u ω) - ∫ t in u..v, b t ω := by + have hi := intervalIntegral.integral_interval_sub_left + (intervalIntegrable_field hb hbound 0 v ω) + (intervalIntegrable_field hb hbound 0 u ω) + simp only [innovation] + rw [← hi] + ring + +theorem integrable_innovation {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsFiniteMeasure P] {X : Ω → ℝ} (hX : Integrable X P) + {B b : ℝ → Ω → ℝ} (hB : ∀ t, Integrable (B t) P) + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) (t : ℝ) : + Integrable (innovation X B b t) P := + ((hX.const_mul t).add (hB t)).sub (integrable_integrated_field P hb hbound 0 t) + +theorem integral_innovation_sub {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} (hX : Integrable X P) {B b : ℝ → Ω → ℝ} + (hB : ∀ t, Integrable (B t) P) + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) + (hposterior : ∀ t, b t =ᵐ[P] P[X | ℱ t]) + {u v : ℝ} (huv : u ≤ v) {A : Set Ω} (hA : MeasurableSet[ℱ u] A) + (hnoise : (∫ ω in A, (B v ω - B u ω) ∂P) = 0) : + (∫ ω in A, (innovation X B b v ω - innovation X B b u ω) ∂P) = 0 := by + simp_rw [innovation_sub X B hb hbound u v] + have hs : Integrable (fun ω => (v - u) * X ω) (P.restrict A) := + (hX.const_mul (v - u)).integrableOn + have hn : Integrable (fun ω => B v ω - B u ω) (P.restrict A) := by + simpa only [IntegrableOn, Pi.sub_def] using ((hB v).sub (hB u)).integrableOn (s := A) + have hsum : Integrable (fun ω => (v - u) * X ω + (B v ω - B u ω)) + (P.restrict A) := by + simpa only [Pi.add_def] using hs.add hn + rw [integral_sub hsum (integrable_integrated_field P hb hbound u v).integrableOn] + rw [integral_add hs hn] + rw [integral_const_mul, hnoise, + integral_integrated_posterior P ℱ hX hb hbound hposterior huv hA] + ring + +theorem martingale_innovation {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} (hX : Integrable X P) {B b : ℝ → Ω → ℝ} + (hB : ∀ t, Integrable (B t) P) + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) + (hposterior : ∀ t, b t =ᵐ[P] P[X | ℱ t]) + (hadapted : StronglyAdapted ℱ (innovation X B b)) + (hnoise : ∀ u v, u ≤ v → ∀ A : Set Ω, MeasurableSet[ℱ u] A → + (∫ ω in A, (B v ω - B u ω) ∂P) = 0) : + Martingale (innovation X B b) ℱ P := by + have hint := integrable_innovation P hX hB hb hbound + refine ⟨hadapted, fun u v huv => ?_⟩ + apply EventuallyEq.symm + apply ae_eq_condExp_of_forall_setIntegral_eq (ℱ.le u) (hint v) + · intro A _ _ + exact (hint u).integrableOn + · intro A hA _ + have hzero := integral_innovation_sub P ℱ hX hB hb hbound hposterior + huv hA (hnoise u v huv A hA) + rw [integral_sub (hint v).integrableOn (hint u).integrableOn] at hzero + linarith + · exact (hadapted u).aestronglyMeasurable + +theorem condExp_innovation_sub_eq_zero {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} {B b : ℝ → Ω → ℝ} + (hM : Martingale (innovation X B b) ℱ P) + {u v : ℝ} (huv : u ≤ v) : + P[(fun ω => innovation X B b v ω - innovation X B b u ω) | ℱ u] + =ᵐ[P] (fun _ => (0 : ℝ)) := by + have hsub := condExp_sub (hM.integrable v) (hM.integrable u) (ℱ u) + have hv := hM.condExp_ae_eq huv + have hu := hM.condExp_ae_eq (le_refl u) + filter_upwards [hsub, hv, hu] with ω hω hvω huω + simpa only [Pi.sub_def, hvω, huω, sub_self] using hω + +theorem integral_weighted_eq_zero_of_condExp {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + {D : Ω → ℝ} (hD : Integrable D P) + (hzero : P[D | m] =ᵐ[P] (fun _ => (0 : ℝ))) + {K : Ω → ℂ} (hK : StronglyMeasurable[m] K) {C : ℝ} + (hKbound : ∀ᵐ ω ∂P, ‖K ω‖ ≤ C) : + (∫ ω, K ω * (D ω : ℂ) ∂P) = 0 := by + let M : ℂ →L[ℝ] ℝ →L[ℝ] ℂ := (ContinuousLinearMap.lsmul ℝ ℝ).flip + have hprod : Integrable (fun ω => M (K ω) (D ω)) P := + M.integrable_of_bilin_of_bdd_left C (hK.mono hm).aestronglyMeasurable hKbound hD + have hpull := condExp_bilin_of_stronglyMeasurable_left M hK hprod hD + have hz : P[(fun ω => M (K ω) (D ω)) | m] =ᵐ[P] (fun _ => (0 : ℂ)) := by + filter_upwards [hpull, hzero] with ω hω hzω + simpa only [hzω, map_zero] using hω + have hi : (∫ ω, M (K ω) (D ω) ∂P) = 0 := by + rw [← integral_condExp hm] + simpa only [integral_zero] using integral_congr_ae hz + simpa only [M, ContinuousLinearMap.flip_apply, ContinuousLinearMap.lsmul_apply, + Complex.real_smul, mul_comm] using hi + +theorem integral_weighted_innovation_sub_eq_zero + {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ mΩ) + {X : Ω → ℝ} {B b : ℝ → Ω → ℝ} + (hM : Martingale (innovation X B b) ℱ P) + {u v : ℝ} (huv : u ≤ v) {K : Ω → ℂ} + (hK : StronglyMeasurable[ℱ u] K) {C : ℝ} + (hKbound : ∀ᵐ ω ∂P, ‖K ω‖ ≤ C) : + (∫ ω, K ω * ((innovation X B b v ω - innovation X B b u ω : ℝ) : ℂ) ∂P) = 0 := by + apply integral_weighted_eq_zero_of_condExp P (ℱ.le u) + (D := fun ω => innovation X B b v ω - innovation X B b u ω) + · simpa only [Pi.sub_def] using (hM.integrable v).sub (hM.integrable u) + · exact condExp_innovation_sub_eq_zero P ℱ hM huv + · exact hK + · exact hKbound + +def nnInnovation {Ω : Type*} (X : Ω → ℝ) (B : ℝ≥0 → Ω → ℝ) + (b : ℝ → Ω → ℝ) (t : ℝ≥0) (ω : Ω) : ℝ := + innovation X (fun s => B s.toNNReal) b t ω + +@[simp] +theorem nnInnovation_apply {Ω : Type*} (X : Ω → ℝ) (B : ℝ≥0 → Ω → ℝ) + (b : ℝ → Ω → ℝ) (t : ℝ≥0) (ω : Ω) : + nnInnovation X B b t ω = (t : ℝ) * X ω + B t ω - ∫ s in 0..t, b s ω := by + simp [nnInnovation, innovation] + +theorem integral_integrated_posterior_nnreal {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ≥0 mΩ) + {X : Ω → ℝ} (hX : Integrable X P) {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) + (hposterior : ∀ t : ℝ≥0, b t =ᵐ[P] P[X | ℱ t]) + {u v : ℝ≥0} (huv : u ≤ v) {A : Set Ω} (hA : MeasurableSet[ℱ u] A) : + (∫ ω in A, (∫ t in (u : ℝ)..v, b t ω) ∂P) = + ((v : ℝ) - u) * ∫ ω in A, X ω ∂P := by + apply integral_integrated_drift P hb hbound u v A + intro t ht + rw [uIoc_of_le (show (u : ℝ) ≤ v from huv)] at ht + let t' : ℝ≥0 := ⟨t, u.2.trans ht.1.le⟩ + have hut : u ≤ t' := ht.1.le + calc + (∫ ω in A, b t ω ∂P) = ∫ ω in A, P[X | ℱ t'] ω ∂P := + integral_congr_ae (ae_restrict_of_ae (hposterior t')) + _ = ∫ ω in A, X ω ∂P := + setIntegral_condExp (ℱ.le t') hX ((ℱ.mono hut) A hA) + +theorem martingale_nnInnovation {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ℝ≥0 mΩ) + {X : Ω → ℝ} (hX : Integrable X P) + {B : ℝ≥0 → Ω → ℝ} {b : ℝ → Ω → ℝ} + (hB : ∀ t, Integrable (B t) P) + (hb : Measurable (Function.uncurry b)) {C : ℝ} + (hbound : ∀ t ω, ‖b t ω‖ ≤ C) + (hposterior : ∀ t : ℝ≥0, b t =ᵐ[P] P[X | ℱ t]) + (hadapted : StronglyAdapted ℱ (nnInnovation X B b)) + (hnoise : ∀ u v, u ≤ v → ∀ A : Set Ω, MeasurableSet[ℱ u] A → + (∫ ω in A, (B v ω - B u ω) ∂P) = 0) : + Martingale (nnInnovation X B b) ℱ P := by + have hint (t : ℝ≥0) : Integrable (nnInnovation X B b t) P := + integrable_innovation P hX (fun s => hB s.toNNReal) hb hbound t + refine ⟨hadapted, fun u v huv => ?_⟩ + apply EventuallyEq.symm + apply ae_eq_condExp_of_forall_setIntegral_eq (ℱ.le u) (hint v) + · intro A _ _ + exact (hint u).integrableOn + · intro A hA _ + have hid (ω : Ω) : + nnInnovation X B b v ω - nnInnovation X B b u ω = + ((v : ℝ) - u) * X ω + (B v ω - B u ω) - + ∫ t in (u : ℝ)..v, b t ω := by + simpa only [nnInnovation, Real.toNNReal_coe] using + innovation_sub X (fun s => B s.toNNReal) hb hbound u v ω + have hs : Integrable (fun ω => ((v : ℝ) - u) * X ω) (P.restrict A) := + (hX.const_mul ((v : ℝ) - u)).integrableOn + have hn : Integrable (fun ω => B v ω - B u ω) (P.restrict A) := by + simpa only [IntegrableOn, Pi.sub_def] using + ((hB v).sub (hB u)).integrableOn (s := A) + have hsum : Integrable + (fun ω => ((v : ℝ) - u) * X ω + (B v ω - B u ω)) (P.restrict A) := by + simpa only [Pi.add_def] using hs.add hn + have hzero : (∫ ω in A, + (nnInnovation X B b v ω - nnInnovation X B b u ω) ∂P) = 0 := by + simp_rw [hid] + rw [integral_sub hsum + (integrable_integrated_field P hb hbound u v).integrableOn] + rw [integral_add hs hn, integral_const_mul, hnoise u v huv A hA, + integral_integrated_posterior_nnreal P ℱ hX hb hbound hposterior huv hA] + ring + rw [integral_sub (hint v).integrableOn (hint u).integrableOn] at hzero + linarith + · exact (hadapted u).aestronglyMeasurable + +theorem integral_weighted_martingale_sub_eq_zero + {ι Ω : Type*} [Preorder ι] {mΩ : MeasurableSpace Ω} + (P : Measure Ω) [IsFiniteMeasure P] (ℱ : Filtration ι mΩ) + {M : ι → Ω → ℝ} (hM : Martingale M ℱ P) + {u v : ι} (huv : u ≤ v) {K : Ω → ℂ} + (hK : StronglyMeasurable[ℱ u] K) {C : ℝ} + (hKbound : ∀ᵐ ω ∂P, ‖K ω‖ ≤ C) : + (∫ ω, K ω * ((M v ω - M u ω : ℝ) : ℂ) ∂P) = 0 := by + have hD : Integrable (fun ω => M v ω - M u ω) P := by + simpa only [Pi.sub_def] using (hM.integrable v).sub (hM.integrable u) + apply integral_weighted_eq_zero_of_condExp P (ℱ.le u) hD _ hK hKbound + have hsub := condExp_sub (hM.integrable v) (hM.integrable u) (ℱ u) + filter_upwards [hsub, hM.condExp_ae_eq huv, hM.condExp_ae_eq (le_refl u)] + with ω hω hvω huω + simpa only [Pi.sub_def, hvω, huω, sub_self] using hω + +theorem innovation_sub_noise_bound {Ω : Type*} [MeasurableSpace Ω] + (X : Ω → ℝ) (B : ℝ → Ω → ℝ) {b : ℝ → Ω → ℝ} + (hb : Measurable (Function.uncurry b)) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) + (u v : ℝ) (ω : Ω) : + ‖innovation X B b v ω - innovation X B b u ω - (B v ω - B u ω)‖ ≤ + |v - u| := by + have hbound : ∀ t ω, ‖b t ω‖ ≤ 1 := by + intro t ω + rw [Real.norm_eq_abs, abs_of_nonneg (hbbound t ω).1] + exact (hbbound t ω).2 + rw [innovation_sub X B hb hbound u v] + have hid : (v - u) * X ω + (B v ω - B u ω) - + (∫ t in u..v, b t ω) - (B v ω - B u ω) = + ∫ t in u..v, (X ω - b t ω) := by + rw [intervalIntegral.integral_sub intervalIntegrable_const + (intervalIntegrable_field hb hbound u v ω)] + simp only [intervalIntegral.integral_const, smul_eq_mul] + ring + rw [hid] + have hdiff : ∀ t ∈ uIoc u v, ‖X ω - b t ω‖ ≤ 1 := by + intro t _ + rw [Real.norm_eq_abs, abs_le] + have hx := hXbound ω + have ht := hbbound t ω + constructor <;> linarith [hx.1, hx.2, ht.1, ht.2] + simpa only [one_mul] using intervalIntegral.norm_integral_le_of_norm_le_const hdiff + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationMean.lean b/lean/OAI/Probability/SpanningForest/InnovationMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..e941826eca8561e8ac7a03e37dd673577402fecf --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationMean.lean @@ -0,0 +1,155 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem336.InnovationMean + +theorem integrable_of_mem_Icc {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsFiniteMeasure P] {X : Ω → ℝ} + (hX : Measurable X) (hbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) : + Integrable X P := by + apply (integrable_const (1 : ℝ)).mono' hX.aestronglyMeasurable + exact Filter.Eventually.of_forall fun ω => by + rw [Real.norm_eq_abs, abs_of_nonneg (hbound ω).1] + exact (hbound ω).2 + +theorem posterior_setIntegral {Ω : Type*} {mΩ : MeasurableSpace Ω} + {P : Measure Ω} [IsFiniteMeasure P] + {m : MeasurableSpace Ω} (hm : m ≤ mΩ) + {X Y : Ω → ℝ} (hX : Integrable X P) + {A : Set Ω} (hA : MeasurableSet[m] A) + (hpost : Y =ᵐ[P] P[X | m]) : + ∫ ω in A, Y ω ∂P = ∫ ω in A, X ω ∂P := by + calc + ∫ ω in A, Y ω ∂P = ∫ ω in A, (P[X | m]) ω ∂P := + integral_congr_ae (ae_restrict_of_ae hpost) + _ = ∫ ω in A, X ω ∂P := setIntegral_condExp hm hX hA + +theorem setIntegral_intervalIntegral_posterior_sub_eq_zero + {Ω : Type*} {mΩ : MeasurableSpace Ω} + {P : Measure Ω} [IsFiniteMeasure P] + {m : ℝ → MeasurableSpace Ω} (hm : ∀ t, m t ≤ mΩ) + {X : Ω → ℝ} (hX : Measurable X) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + {b : ℝ → Ω → ℝ} (hb : Measurable (Function.uncurry b)) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) + {u v : ℝ} (huv : u ≤ v) {A : Set Ω} + (hA : ∀ t ∈ Icc u v, MeasurableSet[m t] A) + (hpost : ∀ t ∈ Icc u v, b t =ᵐ[P] P[X | m t]) : + ∫ ω in A, (∫ t in u..v, (X ω - b t ω)) ∂P = 0 := by + have hXi : Integrable X P := integrable_of_mem_Icc hX hXbound + have hbi (t : ℝ) : Integrable (b t) P := + integrable_of_mem_Icc hb.of_uncurry_left (hbbound t) + have : IsFiniteMeasure (volume.restrict (uIoc u v)) := ⟨by simp⟩ + have hint : Integrable + (Function.uncurry fun t ω => X ω - b t ω) + ((volume.restrict (uIoc u v)).prod (P.restrict A)) := by + apply (integrable_const (1 : ℝ)).mono' + ((hX.comp measurable_snd).sub hb).aestronglyMeasurable + exact Filter.Eventually.of_forall fun p => by + change ‖X p.2 - b p.1 p.2‖ ≤ 1 + rw [Real.norm_eq_abs, abs_le] + have hx := hXbound p.2 + have hbt := hbbound p.1 p.2 + constructor <;> linarith [hx.1, hx.2, hbt.1, hbt.2] + rw [← intervalIntegral_integral_swap hint] + apply intervalIntegral.integral_zero_ae + exact Filter.Eventually.of_forall fun t ht => by + have ht' : t ∈ Icc u v := by + rw [uIoc_of_le huv] at ht + exact ⟨ht.1.le, ht.2⟩ + rw [integral_sub hXi.restrict (hbi t).restrict] + rw [posterior_setIntegral (hm t) hXi (hA t ht') (hpost t ht')] + exact sub_self _ + +theorem integrable_correction_prod + {T Ω : Type*} [MeasurableSpace T] [MeasurableSpace Ω] + {ν : Measure T} [IsFiniteMeasure ν] + {P : Measure Ω} [IsFiniteMeasure P] + {X : Ω → ℝ} (hX : Measurable X) + {b : T → Ω → ℝ} (hb : Measurable (Function.uncurry b)) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) : + Integrable (Function.uncurry fun t ω => X ω - b t ω) (ν.prod P) := by + apply (integrable_const (1 : ℝ)).mono' + ((hX.comp measurable_snd).sub hb).aestronglyMeasurable + exact Filter.Eventually.of_forall fun p => by + change ‖X p.2 - b p.1 p.2‖ ≤ 1 + rw [Real.norm_eq_abs, abs_le] + have hx := hXbound p.2 + have hbt := hbbound p.1 p.2 + constructor <;> linarith [hx.1, hx.2, hbt.1, hbt.2] + +theorem integrable_intervalCorrection + {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} [IsFiniteMeasure P] + {X : Ω → ℝ} (hX : Measurable X) + {b : ℝ → Ω → ℝ} (hb : Measurable (Function.uncurry b)) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) + {u v : ℝ} (huv : u ≤ v) : + Integrable (fun ω => ∫ t in u..v, (X ω - b t ω)) P := by + have hint := integrable_correction_prod (ν := volume.restrict (Ioc u v)) + (P := P) hX hb hXbound hbbound + simpa only [intervalIntegral.integral_of_le huv, Function.uncurry_apply_pair] + using hint.integral_prod_right + +theorem condExp_intervalCorrection_eq_zero + {Ω : Type*} {mΩ : MeasurableSpace Ω} + {P : Measure Ω} [IsFiniteMeasure P] + {m : ℝ → MeasurableSpace Ω} (hm : ∀ t, m t ≤ mΩ) + (hmono : Monotone m) + {X : Ω → ℝ} (hX : Measurable X) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + {b : ℝ → Ω → ℝ} (hb : Measurable (Function.uncurry b)) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) + {u v : ℝ} (huv : u ≤ v) + (hpost : ∀ t ∈ Icc u v, b t =ᵐ[P] P[X | m t]) : + P[(fun ω => ∫ t in u..v, (X ω - b t ω)) | m u] =ᵐ[P] 0 := by + apply (ae_eq_condExp_of_forall_setIntegral_eq (hm u) + (integrable_intervalCorrection hX hb hXbound hbbound huv) + (g := (0 : Ω → ℝ)) ?_ ?_ ?_).symm + · intro A _ _ + exact integrable_zero _ _ _ + · intro A hA _ + simp only [Pi.zero_apply, integral_zero] + symm + exact setIntegral_intervalIntegral_posterior_sub_eq_zero hm hX hXbound hb hbbound huv + (fun t ht => hmono ht.1 A hA) hpost + · exact stronglyMeasurable_zero.aestronglyMeasurable + +theorem condExp_noise_add_intervalCorrection_eq_zero + {Ω : Type*} {mΩ : MeasurableSpace Ω} + {P : Measure Ω} [IsFiniteMeasure P] + {m : ℝ → MeasurableSpace Ω} (hm : ∀ t, m t ≤ mΩ) + (hmono : Monotone m) + {X : Ω → ℝ} (hX : Measurable X) + (hXbound : ∀ ω, X ω ∈ Icc (0 : ℝ) 1) + {b : ℝ → Ω → ℝ} (hb : Measurable (Function.uncurry b)) + (hbbound : ∀ t ω, b t ω ∈ Icc (0 : ℝ) 1) + {u v : ℝ} (huv : u ≤ v) + (hpost : ∀ t ∈ Icc u v, b t =ᵐ[P] P[X | m t]) + {N : Ω → ℝ} (hNi : Integrable N P) + (hN : P[N | m u] =ᵐ[P] 0) : + P[(fun ω => N ω + ∫ t in u..v, (X ω - b t ω)) | m u] =ᵐ[P] 0 := by + have hc := condExp_intervalCorrection_eq_zero hm hmono hX hXbound hb hbbound huv hpost + have hci := integrable_intervalCorrection (P := P) hX hb hXbound hbbound huv + have hadd := condExp_add hNi hci (m u) + have heq : (fun ω => N ω + ∫ t in u..v, (X ω - b t ω)) = + N + (fun ω => ∫ t in u..v, (X ω - b t ω)) := by + funext ω + rfl + rw [heq] + filter_upwards [hadd, hN, hc] with ω ha hn hcω + exact ha.trans (by simp only [Pi.add_apply, Pi.zero_apply, hn, hcω, zero_add]) + +end Problem336.InnovationMean + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationMoments.lean b/lean/OAI/Probability/SpanningForest/InnovationMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffd6cdc1a5304457697b4d9b4ce24f4c8da6a70b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationMoments.lean @@ -0,0 +1,112 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem336.InnovationMoments + +theorem abs_square_perturbation_le (q r a : ℝ) (ha : 0 ≤ a) (hr : |r| ≤ a) : + |(q + r) ^ 2 - q ^ 2| ≤ 2 * a * |q| + a ^ 2 := by + have hqr : |q * r| ≤ |q| * a := by + rw [abs_mul] + exact mul_le_mul_of_nonneg_left hr (abs_nonneg q) + have hqr' := abs_le.mp hqr + have hr2 : r ^ 2 ≤ a ^ 2 := by + nlinarith [sq_abs r, mul_nonneg (sub_nonneg.mpr hr) (add_nonneg (abs_nonneg r) ha)] + apply abs_le.mpr + constructor <;> nlinarith [sq_nonneg r] + +theorem abs_cube_perturbation_le (q r a : ℝ) (ha : 0 ≤ a) (hr : |r| ≤ a) : + |q + r| ^ 3 ≤ 4 * (|q| ^ 3 + a ^ 3) := by + have hsum : |q + r| ≤ |q| + a := (abs_add_le q r).trans (add_le_add le_rfl hr) + have hcube := pow_le_pow_left₀ (abs_nonneg (q + r)) hsum 3 + have hexpand := mul_nonneg (add_nonneg (abs_nonneg q) ha) (sq_nonneg (|q| - a)) + nlinarith + +theorem square_perturbation_le (q r a : ℝ) (ha : 0 ≤ a) (hr : |r| ≤ a) : + (q + r) ^ 2 ≤ 2 * (q ^ 2 + a ^ 2) := by + have hr2 : r ^ 2 ≤ a ^ 2 := by + nlinarith [sq_abs r, mul_nonneg (sub_nonneg.mpr hr) (add_nonneg (abs_nonneg r) ha)] + nlinarith [sq_nonneg (q - r)] + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] + {Q R : Ω → ℝ} {a : ℝ} + +theorem integrable_square_add_of_bounded + (hQ : AEStronglyMeasurable Q μ) (hR : AEStronglyMeasurable R μ) + (hQ2 : Integrable (fun ω => Q ω ^ 2) μ) + (ha : 0 ≤ a) (hRbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + Integrable (fun ω => (Q ω + R ω) ^ 2) μ := by + apply ((hQ2.add (integrable_const (a ^ 2))).const_mul 2).mono' + ((hQ.add hR).pow 2) + filter_upwards [hRbound] with ω hω + change |(Q ω + R ω) ^ 2| ≤ 2 * (Q ω ^ 2 + a ^ 2) + rw [abs_of_nonneg (sq_nonneg _)] + exact square_perturbation_le (Q ω) (R ω) a ha hω + +theorem integrable_abs_cube_add_of_bounded + (hQ : AEStronglyMeasurable Q μ) (hR : AEStronglyMeasurable R μ) + (hQ3 : Integrable (fun ω => |Q ω| ^ 3) μ) + (ha : 0 ≤ a) (hRbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + Integrable (fun ω => |Q ω + R ω| ^ 3) μ := by + apply ((hQ3.add (integrable_const (a ^ 3))).const_mul 4).mono' + (by + apply ((hQ.add hR).norm.pow 3).congr + filter_upwards [] with ω + simp only [Pi.pow_apply, Pi.add_apply, Real.norm_eq_abs]) + filter_upwards [hRbound] with ω hω + change |(|Q ω + R ω| ^ 3)| ≤ 4 * (|Q ω| ^ 3 + a ^ 3) + rw [abs_of_nonneg (pow_nonneg (abs_nonneg _) _)] + exact abs_cube_perturbation_le (Q ω) (R ω) a ha hω + +theorem integral_square_perturbation_le + (hQ : Integrable Q μ) (hR : AEStronglyMeasurable R μ) + (hQ2 : Integrable (fun ω => Q ω ^ 2) μ) + (ha : 0 ≤ a) (hRbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + |(∫ ω, (Q ω + R ω) ^ 2 ∂μ) - ∫ ω, Q ω ^ 2 ∂μ| ≤ + 2 * a * (∫ ω, |Q ω| ∂μ) + a ^ 2 * μ.real Set.univ := by + have hD2 := integrable_square_add_of_bounded hQ.aestronglyMeasurable hR hQ2 ha hRbound + have hbound : Integrable (fun ω => 2 * a * |Q ω| + a ^ 2) μ := + (hQ.abs.const_mul (2 * a)).add (integrable_const _) + calc + _ = |∫ ω, (Q ω + R ω) ^ 2 - Q ω ^ 2 ∂μ| := by + rw [integral_sub hD2 hQ2] + _ ≤ ∫ ω, |(Q ω + R ω) ^ 2 - Q ω ^ 2| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ ω, 2 * a * |Q ω| + a ^ 2 ∂μ := by + apply integral_mono_ae (hD2.sub hQ2).abs hbound + filter_upwards [hRbound] with ω hω + exact abs_square_perturbation_le (Q ω) (R ω) a ha hω + _ = _ := by + rw [integral_add (hQ.abs.const_mul _) (integrable_const _), integral_const_mul, + integral_const] + simp only [smul_eq_mul] + ring + +theorem integral_abs_cube_perturbation_le + (hQ : AEStronglyMeasurable Q μ) (hR : AEStronglyMeasurable R μ) + (hQ3 : Integrable (fun ω => |Q ω| ^ 3) μ) + (ha : 0 ≤ a) (hRbound : ∀ᵐ ω ∂μ, |R ω| ≤ a) : + (∫ ω, |Q ω + R ω| ^ 3 ∂μ) ≤ + 4 * ((∫ ω, |Q ω| ^ 3 ∂μ) + a ^ 3 * μ.real Set.univ) := by + have hD3 := integrable_abs_cube_add_of_bounded hQ hR hQ3 ha hRbound + have hbound : Integrable (fun ω => 4 * (|Q ω| ^ 3 + a ^ 3)) μ := + (hQ3.add (integrable_const _)).const_mul _ + calc + _ ≤ ∫ ω, 4 * (|Q ω| ^ 3 + a ^ 3) ∂μ := by + apply integral_mono_ae hD3 hbound + filter_upwards [hRbound] with ω hω + exact abs_cube_perturbation_le (Q ω) (R ω) a ha hω + _ = _ := by + rw [integral_const_mul, integral_add hQ3 (integrable_const _), integral_const] + simp only [smul_eq_mul] + ring + +end Problem336.InnovationMoments + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationPhaseRecurrence.lean b/lean/OAI/Probability/SpanningForest/InnovationPhaseRecurrence.lean new file mode 100644 index 0000000000000000000000000000000000000000..21a67c7bb31be3db2ff726d05972fe1ca260b1ec --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationPhaseRecurrence.lean @@ -0,0 +1,203 @@ +import OAI.Probability.SpanningForest.InnovationSubdivision + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped Topology NNReal + +namespace Problem336.InnovationPhaseRecurrence + +def phaseOn {Ω : Type*} (A : Set Ω) (X Y : Ω → ℝ) : Ω → ℂ := + A.indicator (fun ω => Complex.exp (((Y ω - X ω : ℝ) : ℂ) * Complex.I)) + +lemma norm_phaseOn_le_one {Ω : Type*} (A : Set Ω) (X Y : Ω → ℝ) (ω : Ω) : + ‖phaseOn A X Y ω‖ ≤ 1 := by + classical + by_cases hω : ω ∈ A + · simp only [phaseOn, Set.indicator_of_mem hω, Complex.norm_exp_ofReal_mul_I] + exact le_rfl + · simp [phaseOn, hω] + +lemma measurable_phaseOn {Ω : Type*} [MeasurableSpace Ω] {A : Set Ω} {X Y : Ω → ℝ} + (hA : MeasurableSet A) (hX : Measurable X) (hY : Measurable Y) : + Measurable (phaseOn A X Y) := by + apply Measurable.indicator _ hA + fun_prop + +lemma phaseOn_mul_increment {Ω : Type*} (A : Set Ω) (X Y Z : Ω → ℝ) (ω : Ω) : + phaseOn A X Y ω * Complex.exp (((Z ω - Y ω : ℝ) : ℂ) * Complex.I) = + phaseOn A X Z ω := by + classical + by_cases hω : ω ∈ A + · simp only [phaseOn, Set.indicator_of_mem hω] + rw [← Complex.exp_add] + congr 1 + push_cast + ring + · simp [phaseOn, hω] + +lemma integral_phaseOn_self {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + {A : Set Ω} (hA : MeasurableSet A) (X : Ω → ℝ) : + (∫ ω, phaseOn A X X ω ∂P) = (P.real A : ℂ) := by + simp [phaseOn, integral_indicator hA] + +lemma integral_phaseOn_eq_setIntegral {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {A : Set Ω} (hA : MeasurableSet A) (X Y : Ω → ℝ) : + (∫ ω, phaseOn A X Y ω ∂P) = + ∫ ω in A, Complex.exp (((Y ω - X ω : ℝ) : ℂ) * Complex.I) ∂P := by + exact integral_indicator hA + +lemma phase_recurrence_of_weighted_step {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} (A : Set Ω) (X Y Z : Ω → ℝ) (a : ℂ) (ε : ℝ) + (hstep : ‖(∫ ω, phaseOn A X Y ω * + Complex.exp (((Z ω - Y ω : ℝ) : ℂ) * Complex.I) ∂P) - + (∫ ω, phaseOn A X Y ω ∂P) * a‖ ≤ ε) : + ‖(∫ ω, phaseOn A X Z ω ∂P) - a * (∫ ω, phaseOn A X Y ω ∂P)‖ ≤ ε := by + simp only [phaseOn_mul_increment] at hstep + simpa only [mul_comm] using hstep + +theorem restricted_characteristic_of_phase_steps + {Ω T : Type*} [MeasurableSpace Ω] {P : Measure Ω} + (X : T → Ω → ℝ) (s t : T) (τ : ℕ → ℕ → T) + {A : Set Ω} (hA : MeasurableSet A) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (C duration v : ℝ) (hduration : 0 ≤ duration) (hv : 0 ≤ v) + (hstep : ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, + ‖(∫ ω, phaseOn A (X s) (X (τ n k)) ω * + Complex.exp (((X (τ n (k + 1)) ω - X (τ n k) ω : ℝ) : ℂ) * Complex.I) ∂P) - + (∫ ω, phaseOn A (X s) (X (τ n k)) ω ∂P) * + (Real.exp (-(duration / ((n + 1 : ℕ) : ℝ)) * v) : ℂ)‖ ≤ + C * (duration / ((n + 1 : ℕ) : ℝ)) * + Real.sqrt (duration / ((n + 1 : ℕ) : ℝ))) : + (∫ ω in A, Complex.exp (((X t ω - X s ω : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-duration * v) : ℂ) * (P.real A : ℂ) := by + let μ : ℕ → ℕ → ℂ := fun n k => ∫ ω, phaseOn A (X s) (X (τ n k)) ω ∂P + apply InnovationSubdivision.gaussian_identity_of_subdivision_recurrences + _ _ μ C duration v hduration hv + · intro n + dsimp [μ] + rw [hstart n] + exact integral_phaseOn_self hA (X s) + · intro n + dsimp [μ] + rw [hfinish n] + exact integral_phaseOn_eq_setIntegral hA (X s) (X t) + · filter_upwards [hstep] with n hn + intro k hk + exact phase_recurrence_of_weighted_step A (X s) (X (τ n k)) + (X (τ n (k + 1))) _ _ (hn k hk) + +theorem restricted_characteristic_of_bounded_test_steps + {Ω T : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + (X : T → Ω → ℝ) (s t : T) (τ : ℕ → ℕ → T) + (past : ℕ → ℕ → MeasurableSpace Ω) + {A : Set Ω} (hA : MeasurableSet A) + (hApast : ∀ n k, MeasurableSet[past n k] A) + (hXstart : ∀ n k, Measurable[past n k] (X s)) + (hXpast : ∀ n k, Measurable[past n k] (X (τ n k))) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (C duration v : ℝ) (hduration : 0 ≤ duration) (hv : 0 ≤ v) + (hlocal : ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, ∀ K : Ω → ℂ, + Measurable[past n k] K → (∀ ω, ‖K ω‖ ≤ 1) → + ‖(∫ ω, K ω * + Complex.exp (((X (τ n (k + 1)) ω - X (τ n k) ω : ℝ) : ℂ) * Complex.I) ∂P) - + (∫ ω, K ω ∂P) * (Real.exp (-(duration / ((n + 1 : ℕ) : ℝ)) * v) : ℂ)‖ ≤ + C * (duration / ((n + 1 : ℕ) : ℝ)) * + Real.sqrt (duration / ((n + 1 : ℕ) : ℝ))) : + (∫ ω in A, Complex.exp (((X t ω - X s ω : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-duration * v) : ℂ) * (P.real A : ℂ) := by + apply restricted_characteristic_of_phase_steps X s t τ hA hstart hfinish + C duration v hduration hv + filter_upwards [hlocal] with n hn + intro k hk + exact hn k hk (phaseOn A (X s) (X (τ n k))) + (@measurable_phaseOn Ω (past n k) A (X s) (X (τ n k)) + (hApast n k) (hXstart n k) (hXpast n k)) + (norm_phaseOn_le_one A (X s) (X (τ n k))) + +theorem restricted_characteristic_of_adapted_bounded_test_steps + {Ω T : Type*} [mΩ : MeasurableSpace Ω] [Preorder T] {P : Measure Ω} + (ℱ : Filtration T mΩ) (X : T → Ω → ℝ) (hX : Adapted ℱ X) + (s t : T) (τ : ℕ → ℕ → T) + {A : Set Ω} (hA : MeasurableSet[ℱ s] A) + (hle : ∀ n k, s ≤ τ n k) + (hstart : ∀ n, τ n 0 = s) (hfinish : ∀ n, τ n (n + 1) = t) + (C duration v : ℝ) (hduration : 0 ≤ duration) (hv : 0 ≤ v) + (hlocal : ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, ∀ K : Ω → ℂ, + Measurable[ℱ (τ n k)] K → (∀ ω, ‖K ω‖ ≤ 1) → + ‖(∫ ω, K ω * + Complex.exp (((X (τ n (k + 1)) ω - X (τ n k) ω : ℝ) : ℂ) * Complex.I) ∂P) - + (∫ ω, K ω ∂P) * (Real.exp (-(duration / ((n + 1 : ℕ) : ℝ)) * v) : ℂ)‖ ≤ + C * (duration / ((n + 1 : ℕ) : ℝ)) * + Real.sqrt (duration / ((n + 1 : ℕ) : ℝ))) : + (∫ ω in A, Complex.exp (((X t ω - X s ω : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-duration * v) : ℂ) * (P.real A : ℂ) := by + apply restricted_characteristic_of_bounded_test_steps X s t τ + (fun n k => ℱ (τ n k)) (ℱ.le s A hA) + (fun n k => ℱ.mono (hle n k) A hA) + (fun n k => (hX s).mono (ℱ.mono (hle n k)) le_rfl) + (fun n k => hX (τ n k)) hstart hfinish C duration v hduration hv hlocal + +def timeGrid (s d : ℝ≥0) (n k : ℕ) : ℝ≥0 := + s + (k : ℝ≥0) * (d / ((n + 1 : ℕ) : ℝ≥0)) + +@[simp] lemma timeGrid_zero (s d : ℝ≥0) (n : ℕ) : timeGrid s d n 0 = s := by + simp [timeGrid] + +@[simp] lemma timeGrid_finish (s d : ℝ≥0) (n : ℕ) : + timeGrid s d n (n + 1) = s + d := by + simp [timeGrid, mul_div_cancel₀] + +lemma timeGrid_mono (s d : ℝ≥0) (n : ℕ) : Monotone (timeGrid s d n) := by + intro k l hkl + dsimp [timeGrid] + gcongr + +lemma le_timeGrid (s d : ℝ≥0) (n k : ℕ) : s ≤ timeGrid s d n k := by + exact le_add_of_nonneg_right zero_le + +lemma timeGrid_le_finish (s d : ℝ≥0) (n k : ℕ) (hk : k ≤ n + 1) : + timeGrid s d n k ≤ s + d := by + simpa only [timeGrid_finish] using timeGrid_mono s d n hk + +lemma timeGrid_succ_sub (s d : ℝ≥0) (n k : ℕ) : + (timeGrid s d n (k + 1) : ℝ) - (timeGrid s d n k : ℝ) = + (d : ℝ) / ((n + 1 : ℕ) : ℝ) := by + simp only [timeGrid, NNReal.coe_add, NNReal.coe_mul, NNReal.coe_div, + NNReal.coe_natCast, NNReal.coe_one, Nat.cast_add, Nat.cast_one] + ring + +theorem restricted_characteristic_of_local_bounded_test_bound + {Ω : Type*} [mΩ : MeasurableSpace Ω] {P : Measure Ω} + (ℱ : Filtration ℝ≥0 mΩ) (X : ℝ≥0 → Ω → ℝ) (hX : Adapted ℱ X) + (s d : ℝ≥0) {A : Set Ω} (hA : MeasurableSet[ℱ s] A) + (C rate δ : ℝ) (hrate : 0 ≤ rate) (hδ : 0 < δ) + (hlocal : ∀ u v : ℝ≥0, s ≤ u → u ≤ v → v ≤ s + d → + (v : ℝ) - (u : ℝ) ≤ δ → ∀ K : Ω → ℂ, + Measurable[ℱ u] K → (∀ ω, ‖K ω‖ ≤ 1) → + ‖(∫ ω, K ω * + Complex.exp (((X v ω - X u ω : ℝ) : ℂ) * Complex.I) ∂P) - + (∫ ω, K ω ∂P) * (Real.exp (-((v : ℝ) - (u : ℝ)) * rate) : ℂ)‖ ≤ + C * ((v : ℝ) - (u : ℝ)) * Real.sqrt ((v : ℝ) - (u : ℝ))) : + (∫ ω in A, Complex.exp (((X (s + d) ω - X s ω : ℝ) : ℂ) * Complex.I) ∂P) = + (Real.exp (-(d : ℝ) * rate) : ℂ) * (P.real A : ℂ) := by + apply restricted_characteristic_of_adapted_bounded_test_steps ℱ X hX s (s + d) + (timeGrid s d) hA (le_timeGrid s d) (timeGrid_zero s d) (timeGrid_finish s d) + C (d : ℝ) rate d.property hrate + have hlim : Tendsto (fun n : ℕ => (d : ℝ) / ((n + 1 : ℕ) : ℝ)) atTop (𝓝 0) := + (tendsto_const_div_atTop_nhds_zero_nat (d : ℝ)).comp (tendsto_add_atTop_nat 1) + filter_upwards [hlim.eventually (gt_mem_nhds hδ)] with n hn + intro k hk K hK hKbound + have hb := hlocal (timeGrid s d n k) (timeGrid s d n (k + 1)) + (le_timeGrid s d n k) (timeGrid_mono s d n (Nat.le_succ k)) + (timeGrid_le_finish s d n (k + 1) (Nat.succ_le_of_lt hk)) + (by rw [timeGrid_succ_sub]; exact hn.le) K hK hKbound + simpa only [timeGrid_succ_sub] using hb + +end Problem336.InnovationPhaseRecurrence + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationProcessLaw.lean b/lean/OAI/Probability/SpanningForest/InnovationProcessLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab40f85b60b3c16a50f009a4b8cd9e475b418834 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationProcessLaw.lean @@ -0,0 +1,125 @@ +import OAI.Probability.SpanningForest.InnovationFiniteGaussian +import OAI.Probability.SpanningForest.BrownianFamilyIdentification +import OAI.Probability.SpanningForest.ContinuousPathLaw + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal BigOperators + +namespace Problem336.InnovationProcessLaw + +theorem identDistrib_nnInnovation + {I Ω : Type*} [mΩ : MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (F : Filtration ℝ≥0 mΩ) + (X : Ω → I → ℝ) (B : I → ℝ≥0 → Ω → ℝ) (b : I → ℝ → Ω → ℝ) + (hB : ∀ i, IsPreBrownianReal (B i) P) (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (hb : ∀ i, Measurable (Function.uncurry (b i))) + (hXrange : ∀ ω i, X ω i ∈ Set.Icc (0 : ℝ) 1) + (hbrange : ∀ i t ω, b i t ω ∈ Set.Icc (0 : ℝ) 1) + (hM : ∀ i, Martingale (Innovation.nnInnovation (fun ω => X ω i) (B i) (b i)) F P) + (hF : ∀ u, F u ≤ MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance) : + IdentDistrib + (fun ω i t => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) t ω) + (fun ω i t => B i t ω) P P := by + classical + let W := fun i => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) + apply BrownianFamilyIdentification.identDistrib_brownian_family F W B + (fun i t => (hM i).stronglyMeasurable t |>.measurable) hBm + · intro i + filter_upwards [(hB i).eval_zero_ae_eq_zero] with ω hω + simpa [W, Innovation.nnInnovation_apply] using hω + · exact hB + · exact hI + · intro S s t hst A hA θ + let θ' : I → ℝ := fun i => if hi : i ∈ S then θ ⟨i, hi⟩ else 0 + have heval (i : S) : θ' i = θ i := by simp [θ', i.property] + have hscalar := InnovationFiniteGaussian.restricted_characteristic_nnInnovation + P F X B b hB hBm hI hX hXB hb hXrange hbrange hM hF S θ' s (s + (t - s)) + (InnovationPhaseRecurrence.timeGrid s (t - s)) + (InnovationPhaseRecurrence.timeGrid_mono s (t - s)) + (InnovationPhaseRecurrence.timeGrid_zero s (t - s)) + (InnovationPhaseRecurrence.timeGrid_finish s (t - s)) + ((t - s : ℝ≥0) : ℝ) (NNReal.coe_nonneg _) + (fun n k _ => InnovationPhaseRecurrence.timeGrid_succ_sub s (t - s) n k) hA + rw [add_tsub_cancel_of_le hst] at hscalar + have hsum (ω : Ω) : (∑ i ∈ S, θ' i * (W i t ω - W i s ω)) = + ∑ i : S, θ i * (W i t ω - W i s ω) := by + rw [← Finset.sum_coe_sort S (fun i => θ' i * (W i t ω - W i s ω))] + simp only [heval] + have hsq : (∑ i ∈ S, θ' i ^ 2) = ‖θ‖ ^ 2 := by + rw [← Finset.sum_coe_sort S (fun i => θ' i ^ 2), EuclideanSpace.real_norm_sq_eq] + simp only [heval] + change (∫ ω in A, Complex.exp (((∑ i ∈ S, θ' i * + (W i t ω - W i s ω) : ℝ) : ℂ) * Complex.I) ∂P) = _ at hscalar + simp_rw [hsum] at hscalar + rw [hsq] at hscalar + convert hscalar using 1 + simp only [BrownianFamilyIdentification.charFun_vectorGaussian, + RCLike.real_smul_eq_coe_mul, Measure.real, mul_comm] + rw [Complex.ofReal_exp] + congr 2 + push_cast + ring + +theorem continuous_nnInnovation_ae + {I Ω : Type*} [Countable I] [MeasurableSpace Ω] + {P : Measure Ω} (X : Ω → I → ℝ) (B : I → ℝ≥0 → Ω → ℝ) + (b : I → ℝ → Ω → ℝ) (hB : ∀ i, IsBrownianReal (B i) P) + (hb : ∀ i, Measurable (Function.uncurry (b i))) + (hbrange : ∀ i t ω, b i t ω ∈ Set.Icc (0 : ℝ) 1) : + ∀ᵐ ω ∂P, ∀ i, Continuous + (fun t => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) t ω) := by + have hc := ae_all_iff.mpr (fun i => (hB i).cont) + filter_upwards [hc] with ω hω + intro i + have hbound : ∀ t ω, ‖b i t ω‖ ≤ 1 := by + intro t ω + rw [Real.norm_eq_abs, abs_of_nonneg (hbrange i t ω).1] + exact (hbrange i t ω).2 + have hi : Continuous (fun t : ℝ => ∫ s in (0 : ℝ)..t, b i s ω) := + intervalIntegral.continuous_primitive + (fun u v => Innovation.intervalIntegrable_field (hb i) hbound u v ω) 0 + simp only [Innovation.nnInnovation_apply] + exact ((continuous_subtype_val.mul continuous_const).add (hω i)).sub + (hi.comp continuous_subtype_val) + +theorem exists_continuous_innovation_with_law + {I Ω : Type*} [Countable I] [mΩ : MeasurableSpace Ω] + [MeasurableSpace C(ℝ≥0, ℝ)] [BorelSpace C(ℝ≥0, ℝ)] + [StandardBorelSpace C(ℝ≥0, ℝ)] + (P : Measure Ω) [IsProbabilityMeasure P] (F : Filtration ℝ≥0 mΩ) + (X : Ω → I → ℝ) (B : I → ℝ≥0 → Ω → ℝ) (b : I → ℝ → Ω → ℝ) + (hB : ∀ i, IsBrownianReal (B i) P) (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (hb : ∀ i, Measurable (Function.uncurry (b i))) + (hXrange : ∀ ω i, X ω i ∈ Set.Icc (0 : ℝ) 1) + (hbrange : ∀ i t ω, b i t ω ∈ Set.Icc (0 : ℝ) 1) + (hM : ∀ i, Martingale (Innovation.nnInnovation (fun ω => X ω i) (B i) (b i)) F P) + (hF : ∀ u, F u ≤ MeasurableSpace.comap (fun ω (p : I × Set.Iic u) => + (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) inferInstance) + (ν : Measure (I → C(ℝ≥0, ℝ))) + (hBlaw : HasLaw (fun ω i t => B i t ω) (ν.map ContinuousPathLaw.raw) P) : + ∃ W : Ω → I → C(ℝ≥0, ℝ), Measurable W ∧ + (fun ω => ContinuousPathLaw.raw (W ω)) =ᵐ[P] + (fun ω i t => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) t ω) ∧ + HasLaw W ν P := by + have hd := identDistrib_nnInnovation P F X B b (fun i => (hB i).toIsPreBrownianReal) + hBm hI hX hXB hb hXrange hbrange hM hF + obtain ⟨W, hW, heq, hlaw⟩ := ContinuousPathLaw.exists_measurable_lift_with_law + (fun ω i t => Innovation.nnInnovation (fun ω => X ω i) (B i) (b i) t ω) + (fun i t => (((hM i).stronglyMeasurable t).measurable.mono (F.le t) le_rfl).aemeasurable) + (continuous_nnInnovation_ae X B b hB hb hbrange) + (hd.map_eq.trans hBlaw.map_eq) + exact ⟨W, hW, heq, ⟨hW.aemeasurable, hlaw⟩⟩ + +end Problem336.InnovationProcessLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationProjection.lean b/lean/OAI/Probability/SpanningForest/InnovationProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ee6d9d2b565cd96c861efe528ac2b2e61e65f5a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationProjection.lean @@ -0,0 +1,82 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped BigOperators + +namespace Problem336.InnovationProjection + +theorem abs_scalar_correction_le + {u v x : ℝ} {b : ℝ → ℝ} (huv : u ≤ v) + (hx0 : 0 ≤ x) (hx1 : x ≤ 1) + (hb : IntervalIntegrable b volume u v) + (hb0 : ∀ t ∈ Set.Icc u v, 0 ≤ b t) + (hb1 : ∀ t ∈ Set.Icc u v, b t ≤ 1) : + |(v - u) * x - ∫ t in u..v, b t| ≤ v - u := by + have hnonneg : 0 ≤ ∫ t in u..v, b t := intervalIntegral.integral_nonneg huv hb0 + have hupper : (∫ t in u..v, b t) ≤ v - u := by + have h := intervalIntegral.integral_mono_on huv hb + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => (1 : ℝ)) volume u v) hb1 + simpa using h + have htime : 0 ≤ v - u := sub_nonneg.mpr huv + have hsignal0 := mul_nonneg htime hx0 + have hsignal1 : (v - u) * x ≤ v - u := by + simpa using mul_le_mul_of_nonneg_left hx1 htime + exact abs_le.mpr ⟨by linarith, by linarith⟩ + +theorem abs_finite_correction_le {I : Type*} (s : Finset I) + (θ x : I → ℝ) (b : I → ℝ → ℝ) {u v : ℝ} (huv : u ≤ v) + (hx : ∀ i ∈ s, 0 ≤ x i ∧ x i ≤ 1) + (hb : ∀ i ∈ s, IntervalIntegrable (b i) volume u v) + (hbrange : ∀ i ∈ s, ∀ t ∈ Set.Icc u v, 0 ≤ b i t ∧ b i t ≤ 1) : + |∑ i ∈ s, θ i * ((v - u) * x i - ∫ t in u..v, b i t)| ≤ + (v - u) * ∑ i ∈ s, |θ i| := by + calc + _ ≤ ∑ i ∈ s, |θ i * ((v - u) * x i - ∫ t in u..v, b i t)| := by + simpa only [Real.norm_eq_abs] using + norm_sum_le s (fun i => θ i * ((v - u) * x i - ∫ t in u..v, b i t)) + _ ≤ ∑ i ∈ s, |θ i| * (v - u) := by + apply Finset.sum_le_sum + intro i hi + rw [abs_mul] + apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) + exact abs_scalar_correction_le huv (hx i hi).1 (hx i hi).2 (hb i hi) + (fun t ht => (hbrange i hi t ht).1) (fun t ht => (hbrange i hi t ht).2) + _ = (v - u) * ∑ i ∈ s, |θ i| := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring + +theorem scalar_increment_decomposition (x : ℝ) (B b : ℝ → ℝ) (u v : ℝ) + (h0u : IntervalIntegrable b volume 0 u) + (huv : IntervalIntegrable b volume u v) : + (v * x + B v - ∫ t in (0 : ℝ)..v, b t) - + (u * x + B u - ∫ t in (0 : ℝ)..u, b t) = + (B v - B u) + ((v - u) * x - ∫ t in u..v, b t) := by + rw [← intervalIntegral.integral_add_adjacent_intervals h0u huv] + ring + +theorem finite_increment_decomposition {I : Type*} (s : Finset I) + (θ x : I → ℝ) (B b : I → ℝ → ℝ) (u v : ℝ) + (h0u : ∀ i ∈ s, IntervalIntegrable (b i) volume 0 u) + (huv : ∀ i ∈ s, IntervalIntegrable (b i) volume u v) : + (∑ i ∈ s, θ i * + ((v * x i + B i v - ∫ t in (0 : ℝ)..v, b i t) - + (u * x i + B i u - ∫ t in (0 : ℝ)..u, b i t))) = + (∑ i ∈ s, θ i * (B i v - B i u)) + + (∑ i ∈ s, θ i * ((v - u) * x i - ∫ t in u..v, b i t)) := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + rw [scalar_increment_decomposition (x i) (B i) (b i) u v (h0u i hi) (huv i hi)] + ring + +end Problem336.InnovationProjection + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationStep.lean b/lean/OAI/Probability/SpanningForest/InnovationStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb884912ce4e189c3f516e828f98aafafec77ba1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationStep.lean @@ -0,0 +1,94 @@ +import OAI.Probability.SpanningForest.InnovationAdapted +import OAI.Probability.SpanningForest.ConditionalInnovation + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped NNReal + +namespace Problem336.Innovation + +theorem conditional_martingale_increment_error + {τ Ω : Type*} [Preorder τ] {mΩ : MeasurableSpace Ω} + (P : Measure Ω) (ℱ : Filtration τ mΩ) {M : τ → Ω → ℝ} + (hM : Martingale M ℱ P) {u v : τ} (huv : u ≤ v) + {Q : Ω → ℝ} {variance : ℝ≥0} {h L σ : ℝ} + (hQ : HasLaw Q (gaussianReal 0 variance) P) (hQmeas : Measurable Q) + (hindep : Indep (MeasurableSpace.comap Q (inferInstance : MeasurableSpace ℝ)) (ℱ u) P) + (hh : 0 ≤ h) (hh₁ : h ≤ 1) (hL : 0 ≤ L) (hσ : 0 ≤ σ) + (hvariance : (variance : ℝ) = h * σ ^ 2) + (hcorrection : ∀ᵐ ω ∂P, |M v ω - M u ω - Q ω| ≤ h * L) + (hv : (variance : ℝ) ≤ 2) : + ∀ᵐ ω ∂P, + ‖P[fun ω => Complex.exp (((M v ω - M u ω : ℝ) : ℂ) * Complex.I) | ℱ u] ω - + Complex.exp (-(variance : ℂ) / 2)‖ ≤ + (16 * (σ ^ 3 * GaussianBoundedCorrection.standardGaussianAbsMoment 3 + L ^ 3) + + L * σ + L ^ 2 / 2 + σ ^ 4 / 4) * (h * Real.sqrt h) := by + let : IsProbabilityMeasure P := hQ.isProbabilityMeasure + let R : Ω → ℝ := fun ω => M v ω - M u ω - Q ω + have hD : Integrable (fun ω => M v ω - M u ω) P := by + simpa only [Pi.sub_def] using (hM.integrable v).sub (hM.integrable u) + have hR : AEStronglyMeasurable R P := by + have hr := hD.sub hQ.hasGaussianLaw.integrable + simpa only [R, Pi.sub_def] using hr.aestronglyMeasurable + have hcenterD : P[(fun ω => M v ω - M u ω) | ℱ u] =ᵐ[P] 0 := by + have hsub := condExp_sub (hM.integrable v) (hM.integrable u) (ℱ u) + filter_upwards [hsub, hM.condExp_ae_eq huv, hM.condExp_ae_eq (le_refl u)] + with ω hω hvω huω + simpa only [Pi.sub_def, Pi.zero_apply, hvω, huω, sub_self] using hω + have hQR (ω : Ω) : Q ω + R ω = M v ω - M u ω := by + dsimp only [R] + ring + have hcenter : P[(fun ω => Q ω + R ω) | ℱ u] =ᵐ[P] 0 := by + simp_rw [hQR] + exact hcenterD + have hlocal := conditional_gaussian_increment_error (ℱ.le u) hQ hQmeas hindep hR + hh hh₁ hL hσ hvariance hcorrection hcenter hv + simpa only [hQR] using hlocal + +theorem conditional_nnInnovation_increment_error + {Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) (ℱ : Filtration ℝ≥0 mΩ) + (X : Ω → ℝ) (B : ℝ≥0 → Ω → ℝ) {b : ℝ → Ω → ℝ} + (hM : Martingale (nnInnovation X B b) ℱ P) + (hb : Measurable (Function.uncurry b)) + (hXbound : ∀ ω, X ω ∈ Set.Icc (0 : ℝ) 1) + (hbbound : ∀ t ω, b t ω ∈ Set.Icc (0 : ℝ) 1) + {u v : ℝ≥0} (huv : u ≤ v) (hshort : (v : ℝ) - u ≤ 1) + (hQ : HasLaw (fun ω => B v ω - B u ω) (gaussianReal 0 (v - u)) P) + (hQmeas : Measurable (fun ω => B v ω - B u ω)) + (hindep : Indep + (MeasurableSpace.comap (fun ω => B v ω - B u ω) (inferInstance : MeasurableSpace ℝ)) + (ℱ u) P) : + ∀ᵐ ω ∂P, + ‖P[fun ω => Complex.exp + (((nnInnovation X B b v ω - nnInnovation X B b u ω : ℝ) : ℂ) * Complex.I) | + ℱ u] ω - Complex.exp (-((v - u : ℝ≥0) : ℂ) / 2)‖ ≤ + (16 * (GaussianBoundedCorrection.standardGaussianAbsMoment 3 + 1) + 1 + + (1 : ℝ) / 2 + 1 / 4) * (((v : ℝ) - u) * Real.sqrt ((v : ℝ) - u)) := by + have hnonneg : 0 ≤ (v : ℝ) - u := sub_nonneg.mpr huv + have hvariance : ((v - u : ℝ≥0) : ℝ) = ((v : ℝ) - u) * (1 : ℝ) ^ 2 := by + simp only [NNReal.coe_sub huv, one_pow, mul_one] + have hbound : ∀ᵐ ω ∂P, + |nnInnovation X B b v ω - nnInnovation X B b u ω - (B v ω - B u ω)| ≤ + ((v : ℝ) - u) * 1 := by + apply Eventually.of_forall + intro ω + simpa only [nnInnovation, Real.toNNReal_coe, Real.norm_eq_abs, + abs_of_nonneg hnonneg, mul_one] using + innovation_sub_noise_bound X (fun t => B t.toNNReal) hb hXbound hbbound u v ω + have hv : ((v - u : ℝ≥0) : ℝ) ≤ 2 := by + rw [NNReal.coe_sub huv] + linarith + have hlocal := conditional_martingale_increment_error P ℱ hM huv hQ hQmeas hindep + hnonneg hshort (by norm_num : (0 : ℝ) ≤ 1) (by norm_num : (0 : ℝ) ≤ 1) + hvariance hbound hv + simpa only [one_pow, one_mul] using hlocal + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationSubdivision.lean b/lean/OAI/Probability/SpanningForest/InnovationSubdivision.lean new file mode 100644 index 0000000000000000000000000000000000000000..102148bc81fb0cae87dc71c4c9592286c28db4ba --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationSubdivision.lean @@ -0,0 +1,125 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology + +namespace Problem336.InnovationSubdivision + +theorem norm_sub_geometric_le {A : Type*} [NormedRing A] + (a : A) (μ : ℕ → A) (ε : ℝ) (ha : ‖a‖ ≤ 1) : + ∀ n, (∀ k < n, ‖μ (k + 1) - a * μ k‖ ≤ ε) → + ‖μ n - a ^ n * μ 0‖ ≤ (n : ℝ) * ε := by + intro n + induction n with + | zero => simp + | succ n ih => + intro hstep + have ih' := ih (fun k hk => hstep k (Nat.lt_trans hk (Nat.lt_succ_self n))) + have hid : μ (n + 1) - a ^ (n + 1) * μ 0 = + (μ (n + 1) - a * μ n) + a * (μ n - a ^ n * μ 0) := by + rw [pow_succ'] + noncomm_ring + rw [hid] + calc + ‖(μ (n + 1) - a * μ n) + a * (μ n - a ^ n * μ 0)‖ + ≤ ‖μ (n + 1) - a * μ n‖ + ‖a * (μ n - a ^ n * μ 0)‖ := + norm_add_le _ _ + _ ≤ ε + ‖a‖ * ‖μ n - a ^ n * μ 0‖ := + add_le_add (hstep n (Nat.lt_succ_self n)) (norm_mul_le _ _) + _ ≤ ε + 1 * ((n : ℝ) * ε) := by gcongr + _ = ((n + 1 : ℕ) : ℝ) * ε := by push_cast; ring + +theorem tendsto_subdivision_error (C T : ℝ) : + Tendsto (fun n : ℕ => ((n + 1 : ℕ) : ℝ) * C * + (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) + atTop (𝓝 0) := by + have hquot : Tendsto (fun n : ℕ => T / ((n + 1 : ℕ) : ℝ)) atTop (𝓝 0) := + (tendsto_const_div_atTop_nhds_zero_nat T).comp (tendsto_add_atTop_nat 1) + have hroot := Real.continuous_sqrt.continuousAt.tendsto.comp hquot + have hlim : Tendsto (fun n : ℕ => C * T * + Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) atTop (𝓝 0) := by + simpa using (tendsto_const_nhds (x := C * T)).mul hroot + convert hlim using 1 + funext n + have hn : (((n + 1 : ℕ) : ℝ)) ≠ 0 := by positivity + field_simp + +theorem eq_of_subdivision_bounds {A : Type*} [NormedAddCommGroup A] + (z w : A) (C T : ℝ) + (h : ∀ n : ℕ, ‖z - w‖ ≤ ((n + 1 : ℕ) : ℝ) * C * + (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) : + z = w := by + have hzero : ‖z - w‖ ≤ 0 := ge_of_tendsto' (tendsto_subdivision_error C T) h + exact sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm hzero (norm_nonneg _))) + +theorem eq_of_subdivision_recurrences {A : Type*} [NormedRing A] + (z w : A) (a : ℕ → A) (μ : ℕ → ℕ → A) (C T : ℝ) + (ha : ∀ n, ‖a n‖ ≤ 1) + (hfinal : ∀ n, μ n (n + 1) = z) + (hfree : ∀ n, a n ^ (n + 1) * μ n 0 = w) + (hstep : ∀ n k, k < n + 1 → + ‖μ n (k + 1) - a n * μ n k‖ ≤ + C * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) : + z = w := by + apply eq_of_subdivision_bounds z w C T + intro n + have hbound := norm_sub_geometric_le (a n) (μ n) + (C * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) + (ha n) (n + 1) (hstep n) + rw [hfinal n, hfree n] at hbound + simpa only [mul_assoc] using hbound + +theorem eq_of_eventual_subdivision_recurrences {A : Type*} [NormedRing A] + (z w : A) (a : ℕ → A) (μ : ℕ → ℕ → A) (C T : ℝ) + (ha : ∀ n, ‖a n‖ ≤ 1) + (hfinal : ∀ n, μ n (n + 1) = z) + (hfree : ∀ n, a n ^ (n + 1) * μ n 0 = w) + (hstep : ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, + ‖μ n (k + 1) - a n * μ n k‖ ≤ + C * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) : + z = w := by + have hb : ∀ᶠ n : ℕ in atTop, ‖z - w‖ ≤ ((n + 1 : ℕ) : ℝ) * C * + (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ)) := by + filter_upwards [hstep] with n hn + have hbound := norm_sub_geometric_le (a n) (μ n) + (C * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) + (ha n) (n + 1) hn + rw [hfinal n, hfree n] at hbound + simpa only [mul_assoc] using hbound + have hz : ‖z - w‖ ≤ 0 := ge_of_tendsto (tendsto_subdivision_error C T) hb + exact sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm hz (norm_nonneg _))) + +theorem gaussian_identity_of_subdivision_recurrences + (z m : ℂ) (μ : ℕ → ℕ → ℂ) (C T v : ℝ) (hT : 0 ≤ T) (hv : 0 ≤ v) + (hinit : ∀ n, μ n 0 = m) (hfinal : ∀ n, μ n (n + 1) = z) + (hstep : ∀ᶠ n : ℕ in atTop, ∀ k < n + 1, + ‖μ n (k + 1) - (Real.exp (-(T / ((n + 1 : ℕ) : ℝ)) * v) : ℂ) * μ n k‖ ≤ + C * (T / ((n + 1 : ℕ) : ℝ)) * Real.sqrt (T / ((n + 1 : ℕ) : ℝ))) : + z = (Real.exp (-T * v) : ℂ) * m := by + apply eq_of_eventual_subdivision_recurrences z ((Real.exp (-T * v) : ℂ) * m) + (fun n => (Real.exp (-(T / ((n + 1 : ℕ) : ℝ)) * v) : ℂ)) μ C T + ?_ hfinal ?_ hstep + · intro n + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] + apply Real.exp_le_one_iff.mpr + exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (div_nonneg hT (by positivity))) hv + · intro n + rw [hinit n] + congr 1 + have he : Real.exp (-(T / ((n + 1 : ℕ) : ℝ)) * v) ^ (n + 1) = + Real.exp (-T * v) := by + rw [← Real.exp_nat_mul] + congr 1 + have hn : (((n + 1 : ℕ) : ℝ)) ≠ 0 := by positivity + field_simp + exact_mod_cast he + +end Problem336.InnovationSubdivision + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/InnovationTaylor.lean b/lean/OAI/Probability/SpanningForest/InnovationTaylor.lean new file mode 100644 index 0000000000000000000000000000000000000000..d75229add5a5ba62e80e13f69e643bf88489102b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/InnovationTaylor.lean @@ -0,0 +1,169 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Problem336 +namespace Innovation + +theorem norm_exp_I_taylor_two (x : ℝ) : + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2‖ ≤ 4 * |x| ^ 3 := by + have hnorm : ‖(x : ℂ) * Complex.I‖ = |x| := by simp + by_cases hx : |x| ≤ 1 + · have hb := Complex.exp_bound (x := (x : ℂ) * Complex.I) + (by simpa only [hnorm] using hx) (n := 3) (by decide) + have hpoly : (∑ m ∈ Finset.range 3, + ((x : ℂ) * Complex.I) ^ m / (m.factorial : ℂ)) = + 1 + (x : ℂ) * Complex.I - (x : ℂ) ^ 2 / 2 := by + norm_num [Finset.sum_range_succ, mul_pow, Complex.I_sq] + ring + rw [hpoly, hnorm] at hb + norm_num at hb + have heq : Complex.exp ((x : ℂ) * Complex.I) - + (1 + (x : ℂ) * Complex.I - (x : ℂ) ^ 2 / 2) = + Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2 := by ring + rw [heq] at hb + nlinarith [pow_nonneg (abs_nonneg x) 3] + · have hx1 : 1 ≤ |x| := (lt_of_not_ge hx).le + have hsq : |x| ≤ |x| ^ 2 := by nlinarith [mul_nonneg (abs_nonneg x) (sub_nonneg.mpr hx1)] + have hcube : |x| ^ 2 ≤ |x| ^ 3 := by + nlinarith [mul_nonneg (sq_nonneg |x|) (sub_nonneg.mpr hx1)] + calc + ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I + + (x : ℂ) ^ 2 / 2‖ + ≤ ‖Complex.exp ((x : ℂ) * Complex.I) - 1 - (x : ℂ) * Complex.I‖ + + ‖(x : ℂ) ^ 2 / 2‖ := norm_add_le _ _ + _ ≤ (‖Complex.exp ((x : ℂ) * Complex.I) - 1‖ + + ‖(x : ℂ) * Complex.I‖) + ‖(x : ℂ) ^ 2 / 2‖ := by + gcongr + exact norm_sub_le _ _ + _ ≤ ((‖Complex.exp ((x : ℂ) * Complex.I)‖ + ‖(1 : ℂ)‖) + + ‖(x : ℂ) * Complex.I‖) + ‖(x : ℂ) ^ 2 / 2‖ := by + gcongr + exact norm_sub_le _ _ + _ = 2 + |x| + |x| ^ 2 / 2 := by simp [norm_pow]; ring + _ ≤ 4 * |x| ^ 3 := by nlinarith + +theorem norm_integral_weighted_taylor {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (D : Ω → ℝ) (K : Ω → ℂ) + (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hthird : Integrable (fun ω => |D ω| ^ 3) P) : + ‖∫ ω, K ω * (Complex.exp ((D ω : ℂ) * Complex.I) - 1 - + (D ω : ℂ) * Complex.I + (D ω : ℂ) ^ 2 / 2) ∂P‖ ≤ + 4 * ∫ ω, |D ω| ^ 3 ∂P := by + calc + _ ≤ ∫ ω, 4 * |D ω| ^ 3 ∂P := by + apply norm_integral_le_of_norm_le (hthird.const_mul 4) + filter_upwards [hK] with ω hω + rw [norm_mul] + calc + _ ≤ 1 * ‖Complex.exp ((D ω : ℂ) * Complex.I) - 1 - + (D ω : ℂ) * Complex.I + (D ω : ℂ) ^ 2 / 2‖ := + mul_le_mul_of_nonneg_right hω (norm_nonneg _) + _ ≤ 4 * |D ω| ^ 3 := by simpa using norm_exp_I_taylor_two (D ω) + _ = _ := integral_const_mul 4 _ + +theorem characteristic_second_order {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) (D : Ω → ℝ) (K : Ω → ℂ) + (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hthird : Integrable (fun ω => |D ω| ^ 3) P) + (hconst : Integrable K P) + (hlinear : Integrable (fun ω => K ω * (D ω : ℂ)) P) + (hquad : Integrable (fun ω => K ω * (D ω : ℂ) ^ 2) P) + (hchar : Integrable (fun ω => K ω * Complex.exp ((D ω : ℂ) * Complex.I)) P) + (hmean : (∫ ω, K ω * (D ω : ℂ) ∂P) = 0) : + ‖(∫ ω, K ω * Complex.exp ((D ω : ℂ) * Complex.I) ∂P) - + (∫ ω, K ω ∂P) + (∫ ω, K ω * (D ω : ℂ) ^ 2 ∂P) / 2‖ ≤ + 4 * ∫ ω, |D ω| ^ 3 ∂P := by + have hbound := norm_integral_weighted_taylor P D K hK hthird + have hfun : (fun ω => K ω * (Complex.exp ((D ω : ℂ) * Complex.I) - 1 - + (D ω : ℂ) * Complex.I + (D ω : ℂ) ^ 2 / 2)) = + (fun ω => (K ω * Complex.exp ((D ω : ℂ) * Complex.I) - K ω) - + (K ω * (D ω : ℂ)) * Complex.I + (K ω * (D ω : ℂ) ^ 2) / 2) := by + funext ω + ring + rw [hfun] at hbound + have hadd := integral_add ((hchar.sub hconst).sub (hlinear.mul_const Complex.I)) + (hquad.div_const 2) + have hsub := integral_sub (hchar.sub hconst) (hlinear.mul_const Complex.I) + have hsub' := integral_sub hchar hconst + simp only [Pi.sub_apply] at hadd hsub hsub' + rw [hadd, hsub, hsub', integral_mul_const, integral_div, hmean] at hbound + simpa using hbound + +theorem gaussian_approximation_of_moments {A B M : ℂ} {r d q : ℝ} + (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hB : ‖B‖ ≤ 1) + (hTaylor : ‖A - B + M / 2‖ ≤ r) + (hMoment : ‖M - (2 * q : ℝ) * B‖ ≤ d) : + ‖A - (Real.exp (-q) : ℂ) * B‖ ≤ r + d / 2 + q ^ 2 := by + have hexp : |Real.exp (-q) - 1 + q| ≤ q ^ 2 := by + have h := Real.norm_exp_sub_one_sub_id_le (x := -q) + (by simpa [Real.norm_eq_abs, abs_of_nonneg hq0] using hq1) + simpa [Real.norm_eq_abs, sub_neg_eq_add] using h + have hdecomp : A - (Real.exp (-q) : ℂ) * B = + (A - B + M / 2) - (M - (2 * q : ℝ) * B) / 2 - + ((Real.exp (-q) - 1 + q : ℝ) : ℂ) * B := by + push_cast + ring + rw [hdecomp] + calc + _ ≤ ‖A - B + M / 2‖ + ‖(M - (2 * q : ℝ) * B) / 2‖ + + ‖((Real.exp (-q) - 1 + q : ℝ) : ℂ) * B‖ := by + apply (norm_sub_le _ _).trans + gcongr + exact norm_sub_le _ _ + _ ≤ r + d / 2 + q ^ 2 := by + have hdiv : ‖(M - (2 * q : ℝ) * B) / 2‖ ≤ d / 2 := by + simpa [norm_div] using div_le_div_of_nonneg_right hMoment (by norm_num : (0 : ℝ) ≤ 2) + have hmul : ‖((Real.exp (-q) - 1 + q : ℝ) : ℂ) * B‖ ≤ q ^ 2 := by + rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] + calc + _ ≤ q ^ 2 * 1 := mul_le_mul hexp hB (norm_nonneg _) (sq_nonneg _) + _ = q ^ 2 := mul_one _ + exact add_le_add (add_le_add hTaylor hdiv) hmul + +theorem weighted_characteristic_gaussian_bound {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] (D : Ω → ℝ) (K : Ω → ℂ) + (hKmeas : AEStronglyMeasurable K P) (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hfirst : Integrable D P) (hsecond : Integrable (fun ω => D ω ^ 2) P) + (hthird : Integrable (fun ω => |D ω| ^ 3) P) + (hmean : (∫ ω, K ω * (D ω : ℂ) ∂P) = 0) + {q δ : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) + (hsecond_est : ‖(∫ ω, K ω * (D ω : ℂ) ^ 2 ∂P) - + (2 * q : ℝ) * (∫ ω, K ω ∂P)‖ ≤ δ) : + ‖(∫ ω, K ω * Complex.exp ((D ω : ℂ) * Complex.I) ∂P) - + (Real.exp (-q) : ℂ) * (∫ ω, K ω ∂P)‖ ≤ + 4 * (∫ ω, |D ω| ^ 3 ∂P) + δ / 2 + q ^ 2 := by + have hconst : Integrable K P := Integrable.of_bound hKmeas 1 hK + have hlinear : Integrable (fun ω => K ω * (D ω : ℂ)) P := + hfirst.ofReal.bdd_mul hKmeas hK + have hsq : Integrable (fun ω => (D ω : ℂ) ^ 2) P := by + have h : Integrable (fun ω => ((D ω ^ 2 : ℝ) : ℂ)) P := hsecond.ofReal + simpa only [Complex.ofReal_pow] using h + have hquad : Integrable (fun ω => K ω * (D ω : ℂ) ^ 2) P := + hsq.bdd_mul hKmeas hK + have hphase : AEStronglyMeasurable + (fun ω => Complex.exp ((D ω : ℂ) * Complex.I)) P := + Complex.continuous_exp.comp_aestronglyMeasurable + ((hfirst.ofReal : Integrable (fun ω => (D ω : ℂ)) P).aestronglyMeasurable.mul_const _) + have hphase_int : Integrable (fun ω => Complex.exp ((D ω : ℂ) * Complex.I)) P := + Integrable.of_bound hphase 1 (Filter.Eventually.of_forall (fun ω => by simp)) + have hchar : Integrable (fun ω => K ω * Complex.exp ((D ω : ℂ) * Complex.I)) P := + hphase_int.bdd_mul hKmeas hK + have hB : ‖∫ ω, K ω ∂P‖ ≤ 1 := by + simpa using norm_integral_le_of_norm_le (integrable_const (1 : ℝ)) hK + exact gaussian_approximation_of_moments hq0 hq1 hB + (characteristic_second_order P D K hK hthird hconst hlinear hquad hchar hmean) + hsecond_est + +end Innovation +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicBridge.lean b/lean/OAI/Probability/SpanningForest/IntrinsicBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6515b76b557371250d55e31e219917486784a7d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicBridge.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SpanningForest.GraphBalls +import OAI.Probability.SpanningForest.InducedCode +import OAI.Probability.SpanningForest.IntrinsicExhaustion + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.Intrinsic + +theorem withinRadius_iff_vertexBall (G : GraphCode) (n u v : ℕ) : + withinRadius G n u v ↔ v ∈ IntrinsicExhaustion.vertexBall G u n := by + induction n generalizing v with + | zero => simp [withinRadius, IntrinsicExhaustion.vertexBall, eq_comm] + | succ n ih => + simp only [withinRadius, IntrinsicExhaustion.mem_vertexBall_succ, ih] + +theorem edgeBall_eq_selected (G : GraphCode) (e : EdgeCode) (n : ℕ) : + Problem336.edgeBall G n e = IntrinsicExhaustion.edgeBall G e n := by + ext v + simp only [Problem336.edgeBall, IntrinsicExhaustion.edgeBall, + Set.mem_ofPred_eq, Set.mem_union, withinRadius_iff_vertexBall] + +def exhaustion (G : GraphCode) (e : EdgeCode) (n : ℕ) : FiniteSubgraphCode := + inducedCode G (edgeBallCode G n e) + +theorem measurable_exhaustion : + Measurable (fun q : GraphCode × (ℕ × EdgeCode) => exhaustion q.1 q.2.2 q.2.1) := by + exact measurable_inducedCode measurable_fst measurable_edgeBallCode + +theorem exhaustion_eq_edgeBallSubgraph (G : GraphCode) (hf : GraphLocallyFinite G) + (e : EdgeCode) (n : ℕ) : + exhaustion G e n = IntrinsicExhaustion.edgeBallSubgraph G hf e n := by + apply Prod.ext + · ext v + simp only [exhaustion, inducedCode_vertices, mem_edgeBallCode G hf, + IntrinsicExhaustion.mem_edgeBallSubgraph_vertices, edgeBall_eq_selected] + · ext p + simp only [exhaustion, mem_inducedCode_edges, mem_edgeBallCode G hf, + IntrinsicExhaustion.mem_edgeBallSubgraph_edges, edgeBall_eq_selected] + +@[simp] theorem subgraphAdj_exhaustion (G : GraphCode) (hG : GraphLocallyFinite G) + (e : EdgeCode) (n u v : ℕ) : + SubgraphAdj (exhaustion G e n) u v ↔ + u ∈ Problem336.edgeBall G n e ∧ v ∈ Problem336.edgeBall G n e ∧ Adj G u v := by + simp only [exhaustion, subgraphAdj_inducedCode, mem_edgeBallCode G hG] + +theorem exhaustion_finiteConnected (G : GraphCode) (hG : GraphLocallyFinite G) + (e : EdgeCode) (he : Adj G e.val.1 e.val.2) (n : ℕ) : + IsFiniteConnectedSubgraph G (exhaustion G e n) := by + rw [exhaustion_eq_edgeBallSubgraph G hG] + exact IntrinsicExhaustion.isFiniteConnectedSubgraph_edgeBallSubgraph hG e he n + +theorem exhaustion_mono (G : GraphCode) (hG : GraphLocallyFinite G) + (e : EdgeCode) {n m : ℕ} (hnm : n ≤ m) : + (exhaustion G e n).1 ⊆ (exhaustion G e m).1 ∧ + (exhaustion G e n).2 ⊆ (exhaustion G e m).2 := by + apply inducedCode_mono + intro v hv + exact (mem_edgeBallCode G hG m v e).mpr + (edgeBall_mono G e hnm ((mem_edgeBallCode G hG n v e).mp hv)) + +theorem isConnectedExhaustion (G : GraphCode) (hc : GraphConnected G) + (hf : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.val.1 e.val.2) : + IsConnectedExhaustion G (exhaustion G e) := by + have hfun : exhaustion G e = IntrinsicExhaustion.edgeBallSubgraph G hf e := + funext fun n => exhaustion_eq_edgeBallSubgraph G hf e n + rw [hfun] + exact IntrinsicExhaustion.isConnectedExhaustion_edgeBallSubgraph hc hf e he + +end Problem336.Intrinsic + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicExhaustion.lean b/lean/OAI/Probability/SpanningForest/IntrinsicExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..b261291f4ff0c0f71387f85a8682115329366287 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicExhaustion.lean @@ -0,0 +1,299 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace IntrinsicExhaustion + +def vertexBall (G : GraphCode) (c : ℕ) : ℕ → Set ℕ + | 0 => {c} + | n + 1 => vertexBall G c n ∪ {v | ∃ u ∈ vertexBall G c n, Adj G u v} + +@[simp] theorem mem_vertexBall_zero (G : GraphCode) (c v : ℕ) : + v ∈ vertexBall G c 0 ↔ v = c := Iff.rfl + +@[simp] theorem mem_vertexBall_succ (G : GraphCode) (c v n : ℕ) : + v ∈ vertexBall G c (n + 1) ↔ + v ∈ vertexBall G c n ∨ ∃ u ∈ vertexBall G c n, Adj G u v := Iff.rfl + +theorem vertexBall_mono (G : GraphCode) (c : ℕ) : Monotone (vertexBall G c) := + monotone_nat_of_le_succ (fun _ _ hv => Or.inl hv) + +@[simp] theorem center_mem_vertexBall (G : GraphCode) (c n : ℕ) : + c ∈ vertexBall G c n := + vertexBall_mono G c (Nat.zero_le n) rfl + +theorem finite_vertexBall {G : GraphCode} (hG : GraphLocallyFinite G) + (c n : ℕ) : (vertexBall G c n).Finite := by + induction n with + | zero => exact Set.finite_singleton c + | succ n ih => + have h := ih.union (ih.biUnion (fun u _ => hG u)) + convert h using 1 + ext v + simp [vertexBall] + +theorem exists_mem_vertexBall_of_reachable {G : GraphCode} {c v : ℕ} + (h : Relation.ReflTransGen (Adj G) c v) : + ∃ n, v ∈ vertexBall G c n := by + induction h with + | refl => exact ⟨0, rfl⟩ + | @tail v w hpath hadj ih => + obtain ⟨n, hn⟩ := ih + exact ⟨n + 1, Or.inr ⟨v, hn, hadj⟩⟩ + +theorem GraphConnected.exists_mem_vertexBall {G : GraphCode} + (hG : GraphConnected G) (c v : ℕ) : + ∃ n, v ∈ vertexBall G c n := + exists_mem_vertexBall_of_reachable (hG c v) + +theorem mem_vertexBall_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (c v n : ℕ) : + σ v ∈ vertexBall (relabelGraph σ G) (σ c) n ↔ v ∈ vertexBall G c n := by + induction n generalizing v with + | zero => simp + | succ n ih => + simp only [mem_vertexBall_succ, ih] + constructor + · rintro (hv | ⟨u, hu, huv⟩) + · exact Or.inl hv + · right + refine ⟨σ.symm u, ?_, ?_⟩ + · exact (ih (σ.symm u)).mp (by simpa using hu) + · simpa [Adj, relabelGraph] using huv + · rintro (hv | ⟨u, hu, huv⟩) + · exact Or.inl hv + · exact Or.inr ⟨σ u, (ih u).mpr hu, by simpa [Adj, relabelGraph] using huv⟩ + +private theorem measurableSet_ballAdj (u v : ℕ) : + MeasurableSet {G : GraphCode | Adj G u v} := by + have hm : Measurable (fun G : GraphCode => G.1 u v) := + (measurable_pi_apply v).comp ((measurable_pi_apply u).comp measurable_subtype_coe) + exact (measurableSet_singleton true).preimage hm + +theorem measurableSet_mem_vertexBall (c v n : ℕ) : + MeasurableSet {G : GraphCode | v ∈ vertexBall G c n} := by + induction n generalizing v with + | zero => simp only [mem_vertexBall_zero]; exact MeasurableSet.const _ + | succ n ih => + simpa only [mem_vertexBall_succ, Set.ofPred_or, Set.ofPred_exists, Set.ofPred_and] + using (ih v).union (MeasurableSet.iUnion (fun u => (ih u).inter (measurableSet_ballAdj u v))) + +def edgeBall (G : GraphCode) (e : EdgeCode) (n : ℕ) : Set ℕ := + vertexBall G e.1.1 n ∪ vertexBall G e.1.2 n + +theorem edgeBall_mono (G : GraphCode) (e : EdgeCode) : Monotone (edgeBall G e) := by + intro n m hnm v hv + exact hv.elim (fun h => Or.inl (vertexBall_mono G e.1.1 hnm h)) + (fun h => Or.inr (vertexBall_mono G e.1.2 hnm h)) + +theorem finite_edgeBall {G : GraphCode} (hG : GraphLocallyFinite G) + (e : EdgeCode) (n : ℕ) : (edgeBall G e n).Finite := + (finite_vertexBall hG e.1.1 n).union (finite_vertexBall hG e.1.2 n) + +@[simp] theorem fst_mem_edgeBall (G : GraphCode) (e : EdgeCode) (n : ℕ) : + e.1.1 ∈ edgeBall G e n := Or.inl (center_mem_vertexBall G e.1.1 n) + +@[simp] theorem snd_mem_edgeBall (G : GraphCode) (e : EdgeCode) (n : ℕ) : + e.1.2 ∈ edgeBall G e n := Or.inr (center_mem_vertexBall G e.1.2 n) + +theorem GraphConnected.exists_mem_edgeBall {G : GraphCode} + (hG : GraphConnected G) (e : EdgeCode) (v : ℕ) : + ∃ n, v ∈ edgeBall G e n := by + obtain ⟨n, hn⟩ := GraphConnected.exists_mem_vertexBall hG e.1.1 v + exact ⟨n, Or.inl hn⟩ + +theorem mem_edgeBall_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (e : EdgeCode) (v n : ℕ) : + σ v ∈ edgeBall (relabelGraph σ G) (mapEdge σ e) n ↔ v ∈ edgeBall G e n := by + unfold edgeBall mapEdge mkEdge + split_ifs <;> simp only [Set.mem_union, mem_vertexBall_relabel, or_comm] + +theorem measurableSet_mem_edgeBall (e : EdgeCode) (v n : ℕ) : + MeasurableSet {G : GraphCode | v ∈ edgeBall G e n} := + (measurableSet_mem_vertexBall e.1.1 v n).union + (measurableSet_mem_vertexBall e.1.2 v n) + +theorem vertexBall_reachable {G : GraphCode} {c v n : ℕ} + (hv : v ∈ vertexBall G c n) : + Relation.ReflTransGen + (fun x y => x ∈ vertexBall G c n ∧ y ∈ vertexBall G c n ∧ Adj G x y) c v := by + induction n generalizing v with + | zero => + have : v = c := hv + subst v + exact .refl + | succ n ih => + have hlift : ∀ {v}, v ∈ vertexBall G c n → + Relation.ReflTransGen + (fun x y => x ∈ vertexBall G c (n + 1) ∧ + y ∈ vertexBall G c (n + 1) ∧ Adj G x y) c v := by + intro v hv + apply Relation.ReflTransGen.mono (fun x y h => + ⟨Or.inl h.1, Or.inl h.2.1, h.2.2⟩) _ _ (ih hv) + rcases hv with hv | ⟨u, hu, huv⟩ + · exact hlift hv + · exact (hlift hu).tail ⟨Or.inl hu, Or.inr ⟨u, hu, huv⟩, huv⟩ + +theorem edgeBall_reachable {G : GraphCode} {e : EdgeCode} {v n : ℕ} + (he : Adj G e.1.1 e.1.2) (hv : v ∈ edgeBall G e n) : + Relation.ReflTransGen + (fun x y => x ∈ edgeBall G e n ∧ y ∈ edgeBall G e n ∧ Adj G x y) e.1.1 v := by + rcases hv with hv | hv + · exact Relation.ReflTransGen.mono + (fun x y h => ⟨Or.inl h.1, Or.inl h.2.1, h.2.2⟩) _ _ (vertexBall_reachable hv) + · exact (Relation.ReflTransGen.single + ⟨fst_mem_edgeBall G e n, snd_mem_edgeBall G e n, he⟩).trans + (Relation.ReflTransGen.mono + (fun x y h => ⟨Or.inr h.1, Or.inr h.2.1, h.2.2⟩) _ _ (vertexBall_reachable hv)) + +def ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) : FiniteSubgraphCode := by + classical + exact (s, (s.product s).filter (fun p => p.1 < p.2 ∧ Adj G p.1 p.2)) + +@[simp] theorem ballInducedSubgraph_vertices (G : GraphCode) (s : Finset ℕ) : + (ballInducedSubgraph G s).1 = s := rfl + +@[simp] theorem mem_ballInducedSubgraph_edges (G : GraphCode) (s : Finset ℕ) + (p : ℕ × ℕ) : + p ∈ (ballInducedSubgraph G s).2 ↔ + p.1 ∈ s ∧ p.2 ∈ s ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + classical + simp [ballInducedSubgraph, and_assoc] + +private theorem ballAdj_symm {G : GraphCode} {u v : ℕ} (h : Adj G u v) : Adj G v u := + (G.2.2 v u).trans h + +private theorem ballAdj_ne {G : GraphCode} {u v : ℕ} (h : Adj G u v) : u ≠ v := by + rintro rfl + have hfalse := G.2.1 u + simp [Adj, hfalse] at h + +@[simp] theorem rawPair_mem_ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) + (u v : ℕ) : + rawPair u v ∈ (ballInducedSubgraph G s).2 ↔ u ∈ s ∧ v ∈ s ∧ Adj G u v := by + by_cases huv : u < v + · simp [rawPair, huv] + · simp only [rawPair, ite_eq_right huv, mem_ballInducedSubgraph_edges] + constructor + · rintro ⟨hv, hu, _, hAdj⟩ + exact ⟨hu, hv, ballAdj_symm hAdj⟩ + · rintro ⟨hu, hv, hAdj⟩ + exact ⟨hv, hu, lt_of_le_of_ne (Nat.le_of_not_gt huv) (Ne.symm (ballAdj_ne hAdj)), + ballAdj_symm hAdj⟩ + +@[simp] theorem subgraphAdj_ballInducedSubgraph (G : GraphCode) (s : Finset ℕ) + (u v : ℕ) : + SubgraphAdj (ballInducedSubgraph G s) u v ↔ u ∈ s ∧ v ∈ s ∧ Adj G u v := by + simp only [SubgraphAdj, ballInducedSubgraph_vertices, rawPair_mem_ballInducedSubgraph] + tauto + +def edgeBallSubgraph (G : GraphCode) (hG : GraphLocallyFinite G) + (e : EdgeCode) (n : ℕ) : FiniteSubgraphCode := + ballInducedSubgraph G (finite_edgeBall hG e n).toFinset + +@[simp] theorem mem_edgeBallSubgraph_vertices (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n v : ℕ) : + v ∈ (edgeBallSubgraph G hG e n).1 ↔ v ∈ edgeBall G e n := by + simp [edgeBallSubgraph] + +@[simp] theorem subgraphAdj_edgeBallSubgraph (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n u v : ℕ) : + SubgraphAdj (edgeBallSubgraph G hG e n) u v ↔ + u ∈ edgeBall G e n ∧ v ∈ edgeBall G e n ∧ Adj G u v := by + simp [edgeBallSubgraph] + +theorem isFiniteConnectedSubgraph_edgeBallSubgraph {G : GraphCode} + (hG : GraphLocallyFinite G) (e : EdgeCode) (he : Adj G e.1.1 e.1.2) (n : ℕ) : + IsFiniteConnectedSubgraph G (edgeBallSubgraph G hG e n) := by + refine ⟨⟨e.1.1, by simp⟩, ?_, ?_⟩ + · intro p hp + simpa [edgeBallSubgraph] using hp + · intro u hu v hv + have path (w : ℕ) (hw : w ∈ (edgeBallSubgraph G hG e n).1) : + Relation.ReflTransGen (SubgraphAdj (edgeBallSubgraph G hG e n)) e.1.1 w := by + apply Relation.ReflTransGen.mono (fun x y hxy => + (subgraphAdj_edgeBallSubgraph G hG e n x y).mpr hxy) _ _ + (edgeBall_reachable he ((mem_edgeBallSubgraph_vertices G hG e n w).mp hw)) + let : Std.Symm (SubgraphAdj (edgeBallSubgraph G hG e n)) := ⟨fun x y hxy => by + rw [subgraphAdj_edgeBallSubgraph] at hxy ⊢ + exact ⟨hxy.2.1, hxy.1, ballAdj_symm hxy.2.2⟩⟩ + exact (symm (path u hu)).trans (path v hv) + +@[simp] theorem mem_edgeBallSubgraph_edges (G : GraphCode) + (hG : GraphLocallyFinite G) (e : EdgeCode) (n : ℕ) (p : ℕ × ℕ) : + p ∈ (edgeBallSubgraph G hG e n).2 ↔ + p.1 ∈ edgeBall G e n ∧ p.2 ∈ edgeBall G e n ∧ p.1 < p.2 ∧ Adj G p.1 p.2 := by + simp [edgeBallSubgraph] + +theorem isConnectedExhaustion_edgeBallSubgraph {G : GraphCode} + (hC : GraphConnected G) (hL : GraphLocallyFinite G) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) : + IsConnectedExhaustion G (edgeBallSubgraph G hL e) := by + refine ⟨isFiniteConnectedSubgraph_edgeBallSubgraph hL e he, ?_, ?_⟩ + · intro n + constructor + · intro v hv + rw [mem_edgeBallSubgraph_vertices] at hv ⊢ + exact edgeBall_mono G e (Nat.le_succ n) hv + · intro p hp + rw [mem_edgeBallSubgraph_edges] at hp ⊢ + exact ⟨edgeBall_mono G e (Nat.le_succ n) hp.1, + edgeBall_mono G e (Nat.le_succ n) hp.2.1, hp.2.2⟩ + · intro u v huv hAdj + obtain ⟨m, hm⟩ := GraphConnected.exists_mem_edgeBall hC e u + obtain ⟨n, hn⟩ := GraphConnected.exists_mem_edgeBall hC e v + refine ⟨max m n, ?_⟩ + rw [mem_edgeBallSubgraph_edges] + exact ⟨edgeBall_mono G e (le_max_left m n) hm, + edgeBall_mono G e (le_max_right m n) hn, huv, hAdj⟩ + +private theorem measurable_finset_from_membership + {α β : Type*} [Countable α] [MeasurableSpace α] [MeasurableSpace β] + (f : β → Finset α) (hf : ∀ a, MeasurableSet {b | a ∈ f b}) : Measurable f := by + apply measurable_to_countable + intro y + have hpre : f ⁻¹' {f y} = ⋂ a, {b | a ∈ f b ↔ a ∈ f y} := by + ext b + simp only [Set.mem_preimage, Set.mem_singleton_iff, Set.mem_iInter, Set.mem_ofPred_eq, + Finset.ext_iff] + rw [hpre] + apply MeasurableSet.iInter + intro a + by_cases ha : a ∈ f y + · simpa only [ha, iff_true] using hf a + · simpa only [ha, iff_false, Set.compl_ofPred] using (hf a).compl + +theorem measurable_edgeBallSubgraph (e : EdgeCode) (n : ℕ) : + Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + edgeBallSubgraph G.1 G.2 e n) := by + have hV : Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + (edgeBallSubgraph G.1 G.2 e n).1) := by + apply measurable_finset_from_membership + intro v + simpa only [mem_edgeBallSubgraph_vertices, Set.preimage_ofPred_eq] using + (measurableSet_mem_edgeBall e v n).preimage measurable_subtype_coe + have hE : Measurable (fun G : {G : GraphCode // GraphLocallyFinite G} => + (edgeBallSubgraph G.1 G.2 e n).2) := by + apply measurable_finset_from_membership + intro p + by_cases hp : p.1 < p.2 + · have h := ((measurableSet_mem_edgeBall e p.1 n).inter + ((measurableSet_mem_edgeBall e p.2 n).inter + (measurableSet_ballAdj p.1 p.2))).preimage + (measurable_subtype_coe : Measurable + (fun G : {G : GraphCode // GraphLocallyFinite G} => G.1)) + simpa only [mem_edgeBallSubgraph_edges, hp, true_and, Set.preimage_inter, + Set.preimage_ofPred_eq, Set.ofPred_and] using h + · simp only [mem_edgeBallSubgraph_edges, hp, false_and, and_false, Set.ofPred_false, + MeasurableSet.empty] + exact hV.prodMk hE + +end IntrinsicExhaustion +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicHalfResponse.lean b/lean/OAI/Probability/SpanningForest/IntrinsicHalfResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..343a205e9f61776cbe61daa2fa8528f2794020a7 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicHalfResponse.lean @@ -0,0 +1,42 @@ +import OAI.Probability.SpanningForest.TotalTreeResponse +import OAI.Probability.SpanningForest.CodedMarginal + +namespace OAI + +noncomputable section + +namespace Problem336.GraphTreePosterior + +theorem mean_response_connected {G : GraphCode} {K : FiniteSubgraphCode} + (hK : IsFiniteConnectedSubgraph G K) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y z : EdgeCode → ℝ) (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f ∈ S, |y f - z f| ≤ D) : + |mean K e S t y - mean K e S t z| ≤ D / 2 := + mean_response_of_inclusion_response K (FiniteEncoding.spanningTrees_nonempty hK) + (USTResponse.inclusion_response_connected hK) e S t y z D hD hyz + +theorem finiteBallMean_response (G : GraphCode) (e : EdgeCode) (n m : ℕ) + (t : ℝ) (y z : EdgeCode → ℝ) (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f ∈ edgeCodes (Intrinsic.exhaustion G e n), |y f - z f| ≤ D) : + |finiteBallMean G e n m t y - finiteBallMean G e n m t z| ≤ D / 2 := + finiteBallMean_response_total G + (fun _ hK => USTResponse.inclusion_response_connected hK) e n m t y z D hD hyz + +theorem drift_response (G : GraphCode) (t : ℝ) (y z : EdgeCode → ℝ) + (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f, Adj G f.1.1 f.1.2 → |y f - z f| ≤ D) (e : EdgeCode) : + |drift G t y e - drift G t z e| ≤ D / 2 := + drift_response_total G + (fun _ hK => USTResponse.inclusion_response_connected hK) t y z D hD hyz e + +theorem drift_picard_response (G : GraphCode) (t : ℝ) (y z : EdgeCode → ℝ) + (D : ℝ) (hD : 0 ≤ D) (hyz : ∀ f, |y f - z f| ≤ D) (e : EdgeCode) : + |drift G t y e - drift G t z e| ≤ (1 / 2 : ℝ) * D := by + simpa only [div_eq_mul_inv, one_mul, mul_comm] using + drift_response G t y z D hD (fun f _ => hyz f) e + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorDrift.lean b/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..2020113a0e577e8cbfb7ebf8ab3f554c81e76791 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorDrift.lean @@ -0,0 +1,46 @@ +import OAI.Probability.SpanningForest.IntrinsicPosteriorIdentification +import OAI.Probability.SpanningForest.PosteriorSupport +import OAI.Probability.SpanningForest.FUSFLawSupport +import OAI.Probability.SpanningForest.ExhaustionExistence + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336.GraphTreePosterior + +theorem drift_eq_posteriorDrift_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) + (t : ℝ) (y : EdgeCode → ℝ) : + drift G t y e = + PosteriorDrift.drift μ (fun f n => edgeCodes (Intrinsic.exhaustion G f n)) t y e := by + unfold drift PosteriorDrift.drift + congr 1 + funext n q + exact innerMean_eq_finiteTiltMean_of_hasFUSFLaw hc hf hμ e he n q.1 q.2 + +theorem drift_eq_posteriorDrift_all_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + drift G t y e = + PosteriorDrift.drift μ (fun f n => edgeCodes (Intrinsic.exhaustion G f n)) t y e := by + by_cases he : Adj G e.1.1 e.1.2 + · exact drift_eq_posteriorDrift_of_hasFUSFLaw hc hf hμ e he t y + · obtain ⟨H, hH⟩ := hc.exists_connected_exhaustion + have habsent : ∀ᵐ X ∂(μ : Measure EdgeConfiguration), X e = false := + hμ.ae_false_of_nonedge H hH e he + rw [drift_of_not_adj e he t y, + PosteriorDrift.drift_eq_zero_of_ae_absent μ _ t y e habsent] + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorIdentification.lean b/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..4512a89170dff1d3a87cfff9066350c1026bba87 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicPosteriorIdentification.lean @@ -0,0 +1,85 @@ +import OAI.Probability.SpanningForest.IntrinsicTreeDrift +import OAI.Probability.SpanningForest.PosteriorTiltLimit +import OAI.Probability.SpanningForest.FiniteUSTIntegrals +import OAI.Probability.SpanningForest.FUSFExistenceReduction + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped BigOperators Topology + +namespace Problem336.GraphTreePosterior + +theorem finiteEnergy_finiteTreeConfiguration (T : Finset (ℕ × ℕ)) + (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + TiltLimit.finiteEnergy S (fun f => y f - t / 2) (finiteTreeConfiguration T) = + energy T S t y := by + classical + unfold TiltLimit.finiteEnergy energy + apply Finset.sum_congr rfl + intro f hf + by_cases h : f.1 ∈ T <;> simp [TiltLimit.bit, finiteTreeConfiguration, h] + +theorem mean_eq_finiteUSTProbabilityMeasure_tilt (K : FiniteSubgraphCode) + (hK : (spanningTrees K).Nonempty) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y = + TiltLimit.finiteTiltMean (finiteUSTProbabilityMeasure K hK) S + (fun f => y f - t / 2) e := by + classical + unfold TiltLimit.finiteTiltMean TiltLimit.tiltedMean + change mean K e S t y = + (∫ X, TiltLimit.bit (X e) * + Real.exp (TiltLimit.finiteEnergy S (fun f => y f - t / 2) X) + ∂finiteUSTMeasure K) / + (∫ X, Real.exp (TiltLimit.finiteEnergy S (fun f => y f - t / 2) X) + ∂finiteUSTMeasure K) + rw [integral_ratio_finiteUSTMeasure K hK] + simp only [finiteEnergy_finiteTreeConfiguration] + unfold mean numerator partition weight + congr 1 + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro T hT + by_cases h : e.1 ∈ T <;> simp [TiltLimit.bit, finiteTreeConfiguration, h] + +theorem tendsto_finiteBallMean_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) + (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + Tendsto (fun m => finiteBallMean G e n m t y) atTop + (𝓝 (TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) + (fun f => y f - t / 2) e)) := by + have hH := Intrinsic.isConnectedExhaustion G hc hf e he + have hweak := hμ.tendsto_finiteUSTProbabilityMeasure (Intrinsic.exhaustion G e) hH + have hseq : (fun m => finiteBallMean G e n m t y) = + (fun m => TiltLimit.finiteTiltMean + (finiteUSTProbabilityMeasure (Intrinsic.exhaustion G e m) + (FiniteEncoding.spanningTrees_nonempty (hH.1 m))) + (edgeCodes (Intrinsic.exhaustion G e n)) (fun f => y f - t / 2) e) := by + funext m + exact mean_eq_finiteUSTProbabilityMeasure_tilt _ _ _ _ _ _ + rw [hseq] + exact TiltLimit.tendsto_finiteTiltMean hweak _ _ _ + +theorem innerMean_eq_finiteTiltMean_of_hasFUSFLaw + {G : GraphCode} (hc : GraphConnected G) (hf : GraphLocallyFinite G) + {μ : ProbabilityMeasure EdgeConfiguration} + (hμ : HasFUSFLaw G (μ : Measure EdgeConfiguration) id) + (e : EdgeCode) (he : Adj G e.1.1 e.1.2) + (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + innerMean G e n t y = + TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) + (fun f => y f - t / 2) e := + innerMean_eq_of_tendsto e n t y + (tendsto_finiteBallMean_of_hasFUSFLaw hc hf hμ e he n t y) + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicRelabel.lean b/lean/OAI/Probability/SpanningForest/IntrinsicRelabel.lean new file mode 100644 index 0000000000000000000000000000000000000000..01be1ccef3da0feb6196c1f35c96bc46b75ae50c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicRelabel.lean @@ -0,0 +1,87 @@ +import OAI.Probability.SpanningForest.IntrinsicBridge +import OAI.Probability.SpanningForest.FiniteUSTRelabel + +namespace OAI + +noncomputable section + +namespace Problem336 + +theorem relabelFiniteSubgraph_inducedCode (σ : Equiv ℕ ℕ) (G : GraphCode) + (S : Finset ℕ) : + relabelFiniteSubgraph σ (inducedCode G S) = + inducedCode (relabelGraph σ G) (S.image σ) := by + apply Prod.ext + · rfl + · ext p + change p ∈ ((inducedCode G S).2.image (relabelPair σ)) ↔ + p ∈ (inducedCode (relabelGraph σ G) (S.image σ)).2 + constructor + · intro hp + rcases Finset.mem_image.mp hp with ⟨q, hq, rfl⟩ + rcases (mem_inducedCode_edges G S q).mp hq with ⟨hu, hv, _, ha⟩ + apply (rawPair_mem_inducedCode_edges (relabelGraph σ G) (S.image σ) _ _).mpr + exact ⟨Finset.mem_image_of_mem σ hu, Finset.mem_image_of_mem σ hv, + by simpa [Adj, relabelGraph] using ha⟩ + · intro hp + rcases (mem_inducedCode_edges (relabelGraph σ G) (S.image σ) p).mp hp with + ⟨hu, hv, hlt, ha⟩ + have hu' : σ.symm p.1 ∈ S := by + rcases Finset.mem_image.mp hu with ⟨u, hu, he⟩ + rw [← he] + simpa using hu + have hv' : σ.symm p.2 ∈ S := by + rcases Finset.mem_image.mp hv with ⟨v, hv, he⟩ + rw [← he] + simpa using hv + refine Finset.mem_image.mpr ⟨rawPair (σ.symm p.1) (σ.symm p.2), ?_, ?_⟩ + · apply (rawPair_mem_inducedCode_edges G S _ _).mpr + exact ⟨hu', hv', by simpa [Adj, relabelGraph] using ha⟩ + · simp only [relabelPair_rawPair, Equiv.apply_symm_apply, rawPair_of_lt hlt] + +namespace Intrinsic + +theorem exhaustion_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) (e : EdgeCode) (n : ℕ) : + exhaustion (relabelGraph σ G) (mapEdge σ e) n = + relabelFiniteSubgraph σ (exhaustion G e n) := by + unfold exhaustion + rw [edgeBallCode_relabel, relabelFiniteSubgraph_inducedCode] + +theorem ustCylinder_exhaustion_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (e : EdgeCode) (n : ℕ) (A B : Finset EdgeCode) : + ustCylinder (exhaustion (relabelGraph σ G) (mapEdge σ e) n) + (A.image (mapEdge σ)) (B.image (mapEdge σ)) = + ustCylinder (exhaustion G e n) A B := by + rw [exhaustion_relabel] + apply ustCylinder_relabel + intro p hp + exact ((mem_inducedCode_edges G _ p).mp hp).2.2.1 + +end Intrinsic + +namespace IntrinsicExhaustion + +theorem edgeBallSubgraph_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (hG : GraphLocallyFinite G) (hσG : GraphLocallyFinite (relabelGraph σ G)) + (e : EdgeCode) (n : ℕ) : + edgeBallSubgraph (relabelGraph σ G) hσG (mapEdge σ e) n = + relabelFiniteSubgraph σ (edgeBallSubgraph G hG e n) := by + rw [← Intrinsic.exhaustion_eq_edgeBallSubgraph (relabelGraph σ G) hσG, + ← Intrinsic.exhaustion_eq_edgeBallSubgraph G hG, Intrinsic.exhaustion_relabel] + +theorem ustCylinder_edgeBallSubgraph_relabel (σ : Equiv ℕ ℕ) (G : GraphCode) + (hG : GraphLocallyFinite G) (hσG : GraphLocallyFinite (relabelGraph σ G)) + (e : EdgeCode) (n : ℕ) (A B : Finset EdgeCode) : + ustCylinder (edgeBallSubgraph (relabelGraph σ G) hσG (mapEdge σ e) n) + (A.image (mapEdge σ)) (B.image (mapEdge σ)) = + ustCylinder (edgeBallSubgraph G hG e n) A B := by + rw [← Intrinsic.exhaustion_eq_edgeBallSubgraph (relabelGraph σ G) hσG, + ← Intrinsic.exhaustion_eq_edgeBallSubgraph G hG] + exact Intrinsic.ustCylinder_exhaustion_relabel σ G e n A B + +end IntrinsicExhaustion +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicTotalExhaustion.lean b/lean/OAI/Probability/SpanningForest/IntrinsicTotalExhaustion.lean new file mode 100644 index 0000000000000000000000000000000000000000..6518a4f8bcdf0096aaabb10e4ed416f4bbef7c62 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicTotalExhaustion.lean @@ -0,0 +1 @@ +import OAI.Probability.SpanningForest.IntrinsicBridge diff --git a/lean/OAI/Probability/SpanningForest/IntrinsicTreeDrift.lean b/lean/OAI/Probability/SpanningForest/IntrinsicTreeDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..0026b5cc2dffa1a48b5367427463b60aee8e33df --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/IntrinsicTreeDrift.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SpanningForest.GraphTreePosterior +import OAI.Probability.SpanningForest.CanonicalDrift + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology + +namespace Problem336.GraphTreePosterior + +def innerMean (G : GraphCode) + (e : EdgeCode) (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : ℝ := + CanonicalDrift.outerLimit + (fun m (q : ℝ × (EdgeCode → ℝ)) => finiteBallMean G e n m q.1 q.2) (t, y) + +def drift (G : GraphCode) + (t : ℝ) (y : EdgeCode → ℝ) (e : EdgeCode) : ℝ := + CanonicalDrift.outerLimit + (fun n (q : ℝ × (EdgeCode → ℝ)) => innerMean G e n q.1 q.2) (t, y) + +theorem innerMean_mem_Icc (G : GraphCode) + (e : EdgeCode) (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + innerMean G e n t y ∈ Set.Icc (0 : ℝ) 1 := + CanonicalDrift.outerLimit_mem_Icc + (b := fun m (q : ℝ × (EdgeCode → ℝ)) => finiteBallMean G e n m q.1 q.2) + (fun m q => finiteBallMean_mem_Icc G e n m q.1 q.2) (t, y) + +theorem drift_mem_Icc (G : GraphCode) + (t : ℝ) (y : EdgeCode → ℝ) (e : EdgeCode) : + drift G t y e ∈ Set.Icc (0 : ℝ) 1 := + CanonicalDrift.outerLimit_mem_Icc + (b := fun n (q : ℝ × (EdgeCode → ℝ)) => innerMean G e n q.1 q.2) + (fun n q => innerMean_mem_Icc G e n q.1 q.2) (t, y) + +theorem measurable_innerMean (e : EdgeCode) (n : ℕ) : + Measurable (fun q : GraphCode × + (ℝ × (EdgeCode → ℝ)) => innerMean q.1 e n q.2.1 q.2.2) := by + exact CanonicalDrift.measurable_outerLimit (fun m => measurable_finiteBallMean e n m) + +theorem measurable_drift (e : EdgeCode) : + Measurable (fun q : GraphCode × + (ℝ × (EdgeCode → ℝ)) => drift q.1 q.2.1 q.2.2 e) := by + exact CanonicalDrift.measurable_outerLimit (fun n => measurable_innerMean e n) + +theorem innerMean_eq_of_tendsto {G : GraphCode} + (e : EdgeCode) (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) {a : ℝ} + (h : Tendsto (fun m => finiteBallMean G e n m t y) atTop (nhds a)) : + innerMean G e n t y = a := CanonicalDrift.outerLimit_eq_of_tendsto h + +theorem drift_response_of_finite {G : GraphCode} + (e : EdgeCode) (t : ℝ) (y z : EdgeCode → ℝ) {d : ℝ} + (h : ∀ n m, |finiteBallMean G e n m t y - finiteBallMean G e n m t z| ≤ d) : + |drift G t y e - drift G t z e| ≤ d := by + apply CanonicalDrift.abs_outerLimit_sub_le + (b := fun n (q : ℝ × (EdgeCode → ℝ)) => innerMean G e n q.1 q.2) + (x := (t, y)) (y := (t, z)) + (fun n q => innerMean_mem_Icc G e n q.1 q.2) + intro n + exact CanonicalDrift.abs_outerLimit_sub_le + (b := fun m (q : ℝ × (EdgeCode → ℝ)) => finiteBallMean G e n m q.1 q.2) + (x := (t, y)) (y := (t, z)) + (fun m q => finiteBallMean_mem_Icc G e n m q.1 q.2) (h n) + +theorem finiteBallMean_of_not_adj {G : GraphCode} + (e : EdgeCode) (he : ¬ Adj G e.1.1 e.1.2) (n m : ℕ) + (t : ℝ) (y : EdgeCode → ℝ) : finiteBallMean G e n m t y = 0 := by + apply mean_of_not_mem + intro hmem + exact he ((mem_inducedCode_edges G (edgeBallCode G m e) e.1).mp hmem).2.2.2 + +theorem drift_of_not_adj {G : GraphCode} + (e : EdgeCode) (he : ¬ Adj G e.1.1 e.1.2) (t : ℝ) (y : EdgeCode → ℝ) : + drift G t y e = 0 := by + simp only [drift, innerMean, CanonicalDrift.outerLimit, + finiteBallMean_of_not_adj e he, limsup_const] + +theorem measurable_drift_joint : + Measurable (fun q : (GraphCode × (ℝ × (EdgeCode → ℝ))) × EdgeCode => + drift q.1.1 q.1.2.1 q.1.2.2 q.2) := + measurable_from_prod_countable_left (fun e => measurable_drift e) + +theorem measurable_drift_fixed (G : GraphCode) (e : EdgeCode) : + Measurable (fun q : ℝ × (EdgeCode → ℝ) => drift G q.1 q.2 e) := by + apply CanonicalDrift.measurable_outerLimit + (b := fun n (q : ℝ × (EdgeCode → ℝ)) => innerMean G e n q.1 q.2) + intro n + apply CanonicalDrift.measurable_outerLimit + (b := fun m (q : ℝ × (EdgeCode → ℝ)) => finiteBallMean G e n m q.1 q.2) + intro m + exact measurable_mean (Intrinsic.exhaustion G e m) e (edgeCodes (Intrinsic.exhaustion G e n)) + +theorem abs_drift_le_one (G : GraphCode) (t : ℝ) (y : EdgeCode → ℝ) (e : EdgeCode) : + |drift G t y e| ≤ 1 := by + obtain ⟨h0, h1⟩ := drift_mem_Icc G t y e + exact abs_le.mpr ⟨by linarith, h1⟩ + +theorem finiteBallMean_congr_on_edges {G : GraphCode} (y z : EdgeCode → ℝ) + (h : ∀ f, Adj G f.1.1 f.1.2 → y f = z f) (e : EdgeCode) (n m : ℕ) (t : ℝ) : + finiteBallMean G e n m t y = finiteBallMean G e n m t z := by + apply mean_congr_field + intro f hf + apply h f + exact ((mem_inducedCode_edges G (edgeBallCode G n e) f.1).mp + ((mem_edgeCodes (Intrinsic.exhaustion G e n) f).mp hf)).2.2.2 + +theorem drift_congr_on_edges {G : GraphCode} (y z : EdgeCode → ℝ) + (h : ∀ f, Adj G f.1.1 f.1.2 → y f = z f) (e : EdgeCode) (t : ℝ) : + drift G t y e = drift G t z e := by + simp only [drift, innerMean, CanonicalDrift.outerLimit, + finiteBallMean_congr_on_edges y z h] + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/JointInnovationLaw.lean b/lean/OAI/Probability/SpanningForest/JointInnovationLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..201156e8f5b34a155970d18c789ea3d06b33c07b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/JointInnovationLaw.lean @@ -0,0 +1,65 @@ +import OAI.Probability.SpanningForest.InnovationIdentification +import OAI.Probability.SpanningForest.JointProcessLaw + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped NNReal ENNReal + +namespace Problem336.JointInnovationLaw + +variable {Ω Ω' I : Type*} [mΩ : MeasurableSpace Ω] [MeasurableSpace Ω'] + {P : Measure Ω} [IsProbabilityMeasure P] + {Q : Measure Ω'} [IsProbabilityMeasure Q] + +omit [IsProbabilityMeasure Q] in + +theorem identDistrib_of_past_characteristic + (F : Filtration ℝ≥0 mΩ) + (W : I → ℝ≥0 → Ω → ℝ) (B : I → ℝ≥0 → Ω' → ℝ) + (hW : ∀ i, Adapted F (W i)) (hB : ∀ i t, Measurable (B i t)) + (hW0 : ∀ i, ∀ᵐ ω ∂P, W i 0 ω = 0) + (hB0 : ∀ i, ∀ᵐ ω ∂Q, B i 0 ω = 0) + (ν : (S : Finset I) → ℝ≥0 → ℝ≥0 → Measure (EuclideanSpace ℝ S)) + [∀ S s t, IsProbabilityMeasure (ν S s t)] + (hchar : ∀ (S : Finset I) (s t : ℝ≥0), s ≤ t → + ∀ A : Set Ω, MeasurableSet[F s] A → ∀ θ : EuclideanSpace ℝ S, + (∫ ω in A, Complex.exp ((inner ℝ + (WithLp.toLp 2 (fun i : S => W i t ω - W i s ω) : EuclideanSpace ℝ S) θ : ℂ) + * Complex.I) ∂P) = (P A).toReal • charFun (ν S s t) θ) + (hBi : ∀ S : Finset I, HasIndepIncrements + (fun t ω => (WithLp.toLp 2 (fun i : S => B i t ω) : EuclideanSpace ℝ S)) Q) + (hBLaw : ∀ (S : Finset I) (s t : ℝ≥0), s ≤ t → + HasLaw (fun ω => (WithLp.toLp 2 (fun i : S => B i t ω - B i s ω) : + EuclideanSpace ℝ S)) (ν S s t) Q) : + IdentDistrib (fun ω i t => W i t ω) (fun ω i t => B i t ω) P Q := by + have hWS (S : Finset I) : Adapted F + (fun t ω => (WithLp.toLp 2 (fun i : S => W i t ω) : EuclideanSpace ℝ S)) := by + intro t + let : MeasurableSpace Ω := F t + exact (MeasurableEquiv.toLp 2 (S → ℝ)).measurable.comp + (Measurable.of_eval (fun i => hW i t)) + refine JointProcessLaw.identDistrib_family_of_finite_increments + (fun i t => (hW i).measurable (i := t)) hB hW0 hB0 ?_ hBi ?_ + · intro S + exact InnovationIdentification.hasIndepIncrements_of_past_characteristic + (hWS S) (hchar S) + · intro S s t hst + have hD : Measurable (fun ω => (WithLp.toLp 2 + (fun i : S => W i t ω - W i s ω) : EuclideanSpace ℝ S)) := + ((hWS S).measurable (i := t)).sub ((hWS S).measurable (i := s)) + have hlaw : HasLaw (fun ω => (WithLp.toLp 2 + (fun i : S => W i t ω - W i s ω) : EuclideanSpace ℝ S)) (ν S s t) P := by + refine ⟨hD.aemeasurable, ?_⟩ + have h := InnovationIdentification.restrict_map_eq_smul_of_characteristic + hD Set.univ (hchar S s t hst Set.univ MeasurableSet.univ) + simpa using h + exact hlaw.identDistrib (hBLaw S s t hst) + +end Problem336.JointInnovationLaw + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/JointProcessLaw.lean b/lean/OAI/Probability/SpanningForest/JointProcessLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..a274d24f3dbd23f5cd617eb58ba0712dcbe5ea8a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/JointProcessLaw.lean @@ -0,0 +1,141 @@ +module + +public import Mathlib +import all Mathlib.Probability.Independence.Process.HasIndepIncrements.IsGaussianProcess + +namespace OAI + +public section + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.JointProcessLaw + +variable {Ω Ω' T E : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] + [LinearOrder T] [OrderBot T] + [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] + [BorelSpace E] [SecondCountableTopology E] + {P : Measure Ω} [IsProbabilityMeasure P] + {Q : Measure Ω'} [IsProbabilityMeasure Q] + {X : T → Ω → E} {Y : T → Ω' → E} + +omit [IsProbabilityMeasure Q] in + +theorem identDistrib_process_of_increments + (hX : ∀ t, Measurable (X t)) (hY : ∀ t, Measurable (Y t)) + (hX0 : ∀ᵐ ω ∂P, X ⊥ ω = 0) (hY0 : ∀ᵐ ω ∂Q, Y ⊥ ω = 0) + (hXi : HasIndepIncrements X P) (hYi : HasIndepIncrements Y Q) + (hinc : ∀ s t, s ≤ t → + IdentDistrib (fun ω => X t ω - X s ω) (fun ω => Y t ω - Y s ω) P Q) : + IdentDistrib (fun ω t => X t ω) (fun ω t => Y t ω) P Q := by + classical + have hXm : Measurable (fun ω t => X t ω) := Measurable.of_eval hX + have hYm : Measurable (fun ω t => Y t ω) := Measurable.of_eval hY + have hrestrict (S : Finset T) : + IdentDistrib (fun ω => S.restrict (X · ω)) + (fun ω => S.restrict (Y · ω)) P Q := by + let DX : Fin S.card → Ω → E := fun i ω => + X (S.orderEmbOfFinWithBot i.succ) ω - X (S.orderEmbOfFinWithBot i.castSucc) ω + let DY : Fin S.card → Ω' → E := fun i ω => + Y (S.orderEmbOfFinWithBot i.succ) ω - Y (S.orderEmbOfFinWithBot i.castSucc) ω + have hDX : ∀ i, Measurable (DX i) := fun _ => (hX _).sub (hX _) + have hDY : ∀ i, Measurable (DY i) := fun _ => (hY _).sub (hY _) + have hdmap : P.map (fun ω i => DX i ω) = Q.map (fun ω i => DY i ω) := by + rw [(hXi _ _ (S.monotone_orderEmbOfFinWithBot)).map_fun_eq_infinitePi_map hDX, + (hYi _ _ (S.monotone_orderEmbOfFinWithBot)).map_fun_eq_infinitePi_map hDY] + congr 1 + funext i + exact (hinc _ _ (S.monotone_orderEmbOfFinWithBot (Fin.castSucc_le_succ i))).map_eq + have hd : IdentDistrib (fun ω i => DX i ω) (fun ω i => DY i ω) P Q := + ⟨(Measurable.of_eval hDX).aemeasurable, + (Measurable.of_eval hDY).aemeasurable, hdmap⟩ + have hc := hd.comp (incrementsToRestrict ℝ S).measurable + have hx := incrementsToRestrict_increments_orderEmbOfFinWithBot_ae_eq_restrict ℝ hX0 S + have hy := incrementsToRestrict_increments_orderEmbOfFinWithBot_ae_eq_restrict ℝ hY0 S + exact ((IdentDistrib.of_ae_eq + (Measurable.of_eval (fun i => hX i.1)).aemeasurable hx).trans hc).trans + (IdentDistrib.of_ae_eq + (Measurable.of_eval (fun i => hY i.1)).aemeasurable hy).symm + refine ⟨hXm.aemeasurable, hYm.aemeasurable, ?_⟩ + let F (S : Finset T) : Measure (S → E) := + (P.map (fun ω t => X t ω)).map S.restrict + have hp : IsProjectiveLimit (P.map (fun ω t => X t ω)) F := fun _ => rfl + have hq : IsProjectiveLimit (Q.map (fun ω t => Y t ω)) F := by + intro S + have hm : Measurable (fun z : T → E => S.restrict z) := + Measurable.of_eval (fun i => measurable_pi_apply i.1) + change (Q.map (fun ω t => Y t ω)).map S.restrict = + (P.map (fun ω t => X t ω)).map S.restrict + rw [Measure.map_map hm hYm, Measure.map_map hm hXm] + exact (hrestrict S).map_eq.symm + exact hp.unique hq + +omit [IsProbabilityMeasure Q] in + +theorem identDistrib_family_of_finite_increments {I : Type*} + {W : I → T → Ω → ℝ} {B : I → T → Ω' → ℝ} + (hW : ∀ i t, Measurable (W i t)) (hB : ∀ i t, Measurable (B i t)) + (hW0 : ∀ i, ∀ᵐ ω ∂P, W i ⊥ ω = 0) + (hB0 : ∀ i, ∀ᵐ ω ∂Q, B i ⊥ ω = 0) + (hWi : ∀ S : Finset I, HasIndepIncrements + (fun t ω => (WithLp.toLp 2 (fun i : S => W i t ω) : EuclideanSpace ℝ S)) P) + (hBi : ∀ S : Finset I, HasIndepIncrements + (fun t ω => (WithLp.toLp 2 (fun i : S => B i t ω) : EuclideanSpace ℝ S)) Q) + (hinc : ∀ (S : Finset I) (s t : T), s ≤ t → + IdentDistrib + (fun ω => (WithLp.toLp 2 (fun i : S => W i t ω - W i s ω) : EuclideanSpace ℝ S)) + (fun ω => (WithLp.toLp 2 (fun i : S => B i t ω - B i s ω) : EuclideanSpace ℝ S)) P Q) : + IdentDistrib (fun ω i t => W i t ω) (fun ω i t => B i t ω) P Q := by + classical + have hWm : Measurable (fun ω i t => W i t ω) := + Measurable.of_eval (fun i => Measurable.of_eval (hW i)) + have hBm : Measurable (fun ω i t => B i t ω) := + Measurable.of_eval (fun i => Measurable.of_eval (hB i)) + have hrestrict (S : Finset I) : + IdentDistrib (fun ω => S.restrict (fun i t => W i t ω)) + (fun ω => S.restrict (fun i t => B i t ω)) P Q := by + have hWS (t : T) : Measurable + (fun ω => (WithLp.toLp 2 (fun i : S => W i t ω) : EuclideanSpace ℝ S)) := + (MeasurableEquiv.toLp 2 (S → ℝ)).measurable.comp + (Measurable.of_eval (fun i => hW i t)) + have hBS (t : T) : Measurable + (fun ω => (WithLp.toLp 2 (fun i : S => B i t ω) : EuclideanSpace ℝ S)) := + (MeasurableEquiv.toLp 2 (S → ℝ)).measurable.comp + (Measurable.of_eval (fun i => hB i t)) + have hWS0 : ∀ᵐ ω ∂P, + (WithLp.toLp 2 (fun i : S => W i ⊥ ω) : EuclideanSpace ℝ S) = 0 := by + filter_upwards [ae_all_iff.mpr (fun i : S => hW0 i)] with ω hω + ext i + exact hω i + have hBS0 : ∀ᵐ ω ∂Q, + (WithLp.toLp 2 (fun i : S => B i ⊥ ω) : EuclideanSpace ℝ S) = 0 := by + filter_upwards [ae_all_iff.mpr (fun i : S => hB0 i)] with ω hω + ext i + exact hω i + have hproc := identDistrib_process_of_increments hWS hBS hWS0 hBS0 (hWi S) (hBi S) + (fun s t hst => hinc S s t hst) + have hswap : Measurable (fun z : T → EuclideanSpace ℝ S => fun i : S => fun t => z t i) := by + fun_prop + exact hproc.comp hswap + refine ⟨hWm.aemeasurable, hBm.aemeasurable, ?_⟩ + let F (S : Finset I) : Measure (S → T → ℝ) := + (P.map (fun ω i t => W i t ω)).map S.restrict + have hp : IsProjectiveLimit (P.map (fun ω i t => W i t ω)) F := fun _ => rfl + have hq : IsProjectiveLimit (Q.map (fun ω i t => B i t ω)) F := by + intro S + have hm : Measurable (fun z : I → T → ℝ => S.restrict z) := + Measurable.of_eval (fun i => measurable_pi_apply i.1) + change (Q.map (fun ω i t => B i t ω)).map S.restrict = + (P.map (fun ω i t => W i t ω)).map S.restrict + rw [Measure.map_map hm hBm, Measure.map_map hm hWm] + exact (hrestrict S).map_eq.symm + exact hp.unique hq + +end Problem336.JointProcessLaw + +end +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/LabelNoCollision.lean b/lean/OAI/Probability/SpanningForest/LabelNoCollision.lean new file mode 100644 index 0000000000000000000000000000000000000000..c64624cf6e7687553d6f564d6064fac2143ed15b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/LabelNoCollision.lean @@ -0,0 +1,95 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped ENNReal + +namespace Problem336.LabelNoCollision + +variable {Ω : Type} [MeasurableSpace Ω] {P : Measure Ω} {U : ℕ → Ω → ℝ} + +theorem probability (h : IsVertexIID P U) : IsProbabilityMeasure P := by + constructor + simpa using h.2 ∅ (fun _ => Set.univ) (by simp) + +theorem marginal (h : IsVertexIID P U) (i : ℕ) {s : Set ℝ} + (hs : MeasurableSet s) : P (U i ⁻¹' s) = uniform01 s := by + change P {ω | U i ω ∈ s} = uniform01 s + simpa using h.2 {i} (fun _ => s) (by simpa using hs) + +theorem map_marginal (h : IsVertexIID P U) (i : ℕ) : P.map (U i) = uniform01 := by + apply Measure.ext + intro s hs + rw [Measure.map_apply (h.1 i) hs] + exact marginal h i hs + +theorem independent (h : IsVertexIID P U) : iIndepFun U P := by + rw [iIndepFun_iff_measure_inter_preimage_eq_mul] + intro s sets hs + calc + P (⋂ i ∈ s, U i ⁻¹' sets i) = P {ω | ∀ i ∈ s, U i ω ∈ sets i} := by + congr 1 + ext ω + simp + _ = ∏ i ∈ s, uniform01 (sets i) := h.2 s sets hs + _ = ∏ i ∈ s, P (U i ⁻¹' sets i) := by + apply Finset.prod_congr rfl + intro i hi + exact (marginal h i (hs i hi)).symm + +theorem map_pair (h : IsVertexIID P U) {i j : ℕ} (hij : i ≠ j) : + P.map (fun ω => (U i ω, U j ω)) = uniform01.prod uniform01 := by + let : IsProbabilityMeasure P := probability h + rw [(independent h).indepFun hij |>.map_prod_eq_prod_map_map + (h.1 i).aemeasurable (h.1 j).aemeasurable] + rw [map_marginal h i, map_marginal h j] + +theorem uniform01_noAtoms : NullSingletonClass uniform01 := by + unfold uniform01 + infer_instance + +theorem uniform01_finite : IsFiniteMeasure uniform01 := by + unfold uniform01 + infer_instance + +theorem diagonal_null : (uniform01.prod uniform01) (Set.diagonal ℝ) = 0 := by + let : NullSingletonClass uniform01 := uniform01_noAtoms + let : IsFiniteMeasure uniform01 := uniform01_finite + rw [Measure.prod_apply measurableSet_diagonal] + have hsection (x : ℝ) : Prod.mk x ⁻¹' Set.diagonal ℝ = {x} := by + ext y + simp [Set.diagonal, eq_comm] + simp only [hsection, measure_singleton, lintegral_zero] + +theorem pair_collision_null (h : IsVertexIID P U) {i j : ℕ} (hij : i ≠ j) : + P {ω | U i ω = U j ω} = 0 := by + have hm : Measurable (fun ω => (U i ω, U j ω)) := (h.1 i).prodMk (h.1 j) + have heq := congrArg (fun μ : Measure (ℝ × ℝ) => μ (Set.diagonal ℝ)) (map_pair h hij) + rw [Measure.map_apply hm measurableSet_diagonal, diagonal_null] at heq + exact heq + +theorem ae_ne (h : IsVertexIID P U) {i j : ℕ} (hij : i ≠ j) : + ∀ᵐ ω ∂P, U i ω ≠ U j ω := by + rw [ae_iff] + simpa only [not_not] using pair_collision_null h hij + +theorem ae_injective_labels (h : IsVertexIID P U) : + ∀ᵐ ω ∂P, Function.Injective (fun i => U i ω) := by + change ∀ᵐ ω ∂P, ∀ ⦃i j : ℕ⦄, U i ω = U j ω → i = j + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro j + by_cases hij : i = j + · exact Filter.Eventually.of_forall (fun _ _ => hij) + · filter_upwards [ae_ne h hij] with ω hω + exact fun heq => (hω heq).elim + +end Problem336.LabelNoCollision + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/LawLimits.lean b/lean/OAI/Probability/SpanningForest/LawLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2c21ae7a7906ce070425fb0cb4737e472d3f880 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/LawLimits.lean @@ -0,0 +1,6 @@ +import OAI.Probability.SpanningForest.BinaryLawUnique +import OAI.Probability.SpanningForest.BinaryWeakConvergence +import OAI.Probability.SpanningForest.CylinderKernel +import OAI.Probability.SpanningForest.FiniteUSTLimit + +import OAI.Probability.SpanningForest.FUSFExistenceReduction diff --git a/lean/OAI/Probability/SpanningForest/LawPosteriorBundle.lean b/lean/OAI/Probability/SpanningForest/LawPosteriorBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a1f3440e8e909c9321a1cbb56dd9a92e35ba800 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/LawPosteriorBundle.lean @@ -0,0 +1,3 @@ +import OAI.Probability.SpanningForest.LawLimits +import OAI.Probability.SpanningForest.IntrinsicRelabel +import OAI.Probability.SpanningForest.IntrinsicPosteriorDrift diff --git a/lean/OAI/Probability/SpanningForest/Main.lean b/lean/OAI/Probability/SpanningForest/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..5499d8195fec7930f0746e9acdfaa07b7ea5bce8 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Main.lean @@ -0,0 +1,230 @@ +import OAI.Probability.SpanningForest.AlgebraicCycleSpace +import OAI.Probability.SpanningForest.AllPairAllocation +import OAI.Probability.SpanningForest.AllPairFactorAssembly +import OAI.Probability.SpanningForest.AllPairIID +import OAI.Probability.SpanningForest.AllPairIntrinsicBridge +import OAI.Probability.SpanningForest.AllPairObservation +import OAI.Probability.SpanningForest.AllPairPicardDecoder +import OAI.Probability.SpanningForest.AllPairPosteriorDrift +import OAI.Probability.SpanningForest.AllPairWiener +import OAI.Probability.SpanningForest.AnalyticSupport +import OAI.Probability.SpanningForest.BinaryGaussianPosterior +import OAI.Probability.SpanningForest.BinaryLawUnique +import OAI.Probability.SpanningForest.BinaryWeakConvergence +import OAI.Probability.SpanningForest.BitRecovery +import OAI.Probability.SpanningForest.BorelExhaustion +import OAI.Probability.SpanningForest.BorelFUSFKernel +import OAI.Probability.SpanningForest.BorelFiniteChoice +import OAI.Probability.SpanningForest.BrownianBridge +import OAI.Probability.SpanningForest.BrownianCanonicalPosterior +import OAI.Probability.SpanningForest.BrownianFamilyIdentification +import OAI.Probability.SpanningForest.BrownianFamilyNoise +import OAI.Probability.SpanningForest.BrownianFamilyPast +import OAI.Probability.SpanningForest.BrownianFinitePosterior +import OAI.Probability.SpanningForest.BrownianPosteriorReduction +import OAI.Probability.SpanningForest.BrownianReference +import OAI.Probability.SpanningForest.BrownianSublinear +import OAI.Probability.SpanningForest.CanonicalBrownianReference +import OAI.Probability.SpanningForest.CanonicalBrownianSampler +import OAI.Probability.SpanningForest.CanonicalDecoder +import OAI.Probability.SpanningForest.CanonicalDrift +import OAI.Probability.SpanningForest.CanonicalFUSFLaw +import OAI.Probability.SpanningForest.CanonicalIID +import OAI.Probability.SpanningForest.CanonicalPosteriorIdentification +import OAI.Probability.SpanningForest.CanonicalPosteriorMartingale +import OAI.Probability.SpanningForest.CauchyBinet +import OAI.Probability.SpanningForest.CharacteristicRemainder +import OAI.Probability.SpanningForest.CharacteristicTaylor +import OAI.Probability.SpanningForest.CodeLaplacian +import OAI.Probability.SpanningForest.CodeTransferKernel +import OAI.Probability.SpanningForest.CodedIncidenceMinors +import OAI.Probability.SpanningForest.CodedInclusion +import OAI.Probability.SpanningForest.CodedMarginal +import OAI.Probability.SpanningForest.CodedMatrixTree +import OAI.Probability.SpanningForest.CodedTransferBridge +import OAI.Probability.SpanningForest.CodedTransferProjection +import OAI.Probability.SpanningForest.ConditionalInnovation +import OAI.Probability.SpanningForest.ContinuousPathLaw +import OAI.Probability.SpanningForest.ContinuousPathLimit +import OAI.Probability.SpanningForest.ContinuousPathSampler +import OAI.Probability.SpanningForest.CoordinateTruncation +import OAI.Probability.SpanningForest.CountableBrownian +import OAI.Probability.SpanningForest.CountableProjective +import OAI.Probability.SpanningForest.CylinderKernel +import OAI.Probability.SpanningForest.CylinderLimitMeasure +import OAI.Probability.SpanningForest.DecoderBundle +import OAI.Probability.SpanningForest.DecoderPathSpace +import OAI.Probability.SpanningForest.DecoderRestriction +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.DenseBrownian +import OAI.Probability.SpanningForest.DenseGaussian +import OAI.Probability.SpanningForest.DenseGaussianModification +import OAI.Probability.SpanningForest.DeterminantalResponse +import OAI.Probability.SpanningForest.DisconnectedIncidence +import OAI.Probability.SpanningForest.DyadicGaussianBound +import OAI.Probability.SpanningForest.DyadicInterpolation +import OAI.Probability.SpanningForest.DyadicPathLimit +import OAI.Probability.SpanningForest.DyadicTimes +import OAI.Probability.SpanningForest.EdgeAction +import OAI.Probability.SpanningForest.EdgeAllocation +import OAI.Probability.SpanningForest.EdgeAllocationMeasurable +import OAI.Probability.SpanningForest.EdgeBallExhaustion +import OAI.Probability.SpanningForest.EdgeIID +import OAI.Probability.SpanningForest.EdgeUniformRule +import OAI.Probability.SpanningForest.EquivariantFUSFKernel +import OAI.Probability.SpanningForest.Exhaustion +import OAI.Probability.SpanningForest.ExhaustionExistence +import OAI.Probability.SpanningForest.ExponentialFamily +import OAI.Probability.SpanningForest.FUSFExistenceReduction +import OAI.Probability.SpanningForest.FUSFLawSupport +import OAI.Probability.SpanningForest.FUSFLawUnique +import OAI.Probability.SpanningForest.FUSFPosteriorResponse +import OAI.Probability.SpanningForest.FUSFRelabelMeasure +import OAI.Probability.SpanningForest.Factor +import OAI.Probability.SpanningForest.FactorAssembly +import OAI.Probability.SpanningForest.FactorLawTransport +import OAI.Probability.SpanningForest.FactorReadout +import OAI.Probability.SpanningForest.FactorSampler +import OAI.Probability.SpanningForest.FinalFactor +import OAI.Probability.SpanningForest.FiniteCycleIncidence +import OAI.Probability.SpanningForest.FiniteGaussianPosterior +import OAI.Probability.SpanningForest.FiniteGradientResponse +import OAI.Probability.SpanningForest.FiniteIncidenceBridge +import OAI.Probability.SpanningForest.FiniteKernelBridge +import OAI.Probability.SpanningForest.FiniteKernelEmbedding +import OAI.Probability.SpanningForest.FiniteKernelSupport +import OAI.Probability.SpanningForest.FiniteObservationReduction +import OAI.Probability.SpanningForest.FinitePosterior +import OAI.Probability.SpanningForest.FinitePosteriorTilt +import OAI.Probability.SpanningForest.FiniteProductDensity +import OAI.Probability.SpanningForest.FiniteResponse +import OAI.Probability.SpanningForest.FiniteResponseBundle +import OAI.Probability.SpanningForest.FiniteTiltLimit +import OAI.Probability.SpanningForest.FiniteTiltMeasure +import OAI.Probability.SpanningForest.FiniteUSTIntegrals +import OAI.Probability.SpanningForest.FiniteUSTLimit +import OAI.Probability.SpanningForest.FiniteUSTMeasure +import OAI.Probability.SpanningForest.FiniteUSTProbability +import OAI.Probability.SpanningForest.FiniteUSTRelabel +import OAI.Probability.SpanningForest.FullObservationPosterior +import OAI.Probability.SpanningForest.GaussianBoundedCorrection +import OAI.Probability.SpanningForest.GaussianLikelihood +import OAI.Probability.SpanningForest.GaussianMomentScaling +import OAI.Probability.SpanningForest.GaussianObservationDensity +import OAI.Probability.SpanningForest.GaussianObservationKernel +import OAI.Probability.SpanningForest.GaussianPosteriorAllTime +import OAI.Probability.SpanningForest.GaussianSum +import OAI.Probability.SpanningForest.GeneratorExhaustion +import OAI.Probability.SpanningForest.GibbsField +import OAI.Probability.SpanningForest.GibbsResponse +import OAI.Probability.SpanningForest.GlobalWiener +import OAI.Probability.SpanningForest.GramDeterminantUpdate +import OAI.Probability.SpanningForest.GraphBalls +import OAI.Probability.SpanningForest.GraphBorel +import OAI.Probability.SpanningForest.GraphCoordinateTruncation +import OAI.Probability.SpanningForest.GraphDomain +import OAI.Probability.SpanningForest.GraphEncoding +import OAI.Probability.SpanningForest.GraphFUSFLaw +import OAI.Probability.SpanningForest.GraphFreeKernel +import OAI.Probability.SpanningForest.GraphLaw +import OAI.Probability.SpanningForest.GraphTreePosterior +import OAI.Probability.SpanningForest.GraphTreePosteriorEquiv +import OAI.Probability.SpanningForest.GraphTreeResponse +import OAI.Probability.SpanningForest.HilbertBundle +import OAI.Probability.SpanningForest.IIDBlocks +import OAI.Probability.SpanningForest.IncidenceCirculation +import OAI.Probability.SpanningForest.IncidenceMinorClassification +import OAI.Probability.SpanningForest.IncidenceResponse +import OAI.Probability.SpanningForest.IncidenceUnimodular +import OAI.Probability.SpanningForest.InclusionPolynomial +import OAI.Probability.SpanningForest.IncreasingProjections +import OAI.Probability.SpanningForest.IndependentProcessVectors +import OAI.Probability.SpanningForest.InducedCode +import OAI.Probability.SpanningForest.InnovationAdapted +import OAI.Probability.SpanningForest.InnovationErrorRate +import OAI.Probability.SpanningForest.InnovationFiniteGaussian +import OAI.Probability.SpanningForest.InnovationGaussianLaw +import OAI.Probability.SpanningForest.InnovationGaussianObservation +import OAI.Probability.SpanningForest.InnovationGaussianProcess +import OAI.Probability.SpanningForest.InnovationIdentification +import OAI.Probability.SpanningForest.InnovationLawIdentification +import OAI.Probability.SpanningForest.InnovationMartingale +import OAI.Probability.SpanningForest.InnovationMean +import OAI.Probability.SpanningForest.InnovationMoments +import OAI.Probability.SpanningForest.InnovationPhaseRecurrence +import OAI.Probability.SpanningForest.InnovationProcessLaw +import OAI.Probability.SpanningForest.InnovationProjection +import OAI.Probability.SpanningForest.InnovationStep +import OAI.Probability.SpanningForest.InnovationSubdivision +import OAI.Probability.SpanningForest.InnovationTaylor +import OAI.Probability.SpanningForest.IntrinsicBridge +import OAI.Probability.SpanningForest.IntrinsicExhaustion +import OAI.Probability.SpanningForest.IntrinsicHalfResponse +import OAI.Probability.SpanningForest.IntrinsicPosteriorDrift +import OAI.Probability.SpanningForest.IntrinsicPosteriorIdentification +import OAI.Probability.SpanningForest.IntrinsicRelabel +import OAI.Probability.SpanningForest.IntrinsicTotalExhaustion +import OAI.Probability.SpanningForest.IntrinsicTreeDrift +import OAI.Probability.SpanningForest.JointInnovationLaw +import OAI.Probability.SpanningForest.JointProcessLaw +import OAI.Probability.SpanningForest.LabelNoCollision +import OAI.Probability.SpanningForest.LawLimits +import OAI.Probability.SpanningForest.LawPosteriorBundle +import OAI.Probability.SpanningForest.MarkedGram +import OAI.Probability.SpanningForest.MatrixTreeSupport +import OAI.Probability.SpanningForest.NoCollisionExtension +import OAI.Probability.SpanningForest.ObservationPosterior +import OAI.Probability.SpanningForest.ObservedBrownianMartingale +import OAI.Probability.SpanningForest.OrderedMinorCounting +import OAI.Probability.SpanningForest.PathConcatenation +import OAI.Probability.SpanningForest.Picard +import OAI.Probability.SpanningForest.PicardBounds +import OAI.Probability.SpanningForest.PicardNonnegativeSampler +import OAI.Probability.SpanningForest.PicardNonnegativeTime +import OAI.Probability.SpanningForest.PicardSamplerLaw +import OAI.Probability.SpanningForest.PicardSolution +import OAI.Probability.SpanningForest.PicardUniqueness +import OAI.Probability.SpanningForest.PolynomialGramUpdate +import OAI.Probability.SpanningForest.PosteriorDrift +import OAI.Probability.SpanningForest.PosteriorIndependentExtension +import OAI.Probability.SpanningForest.PosteriorNullCoordinates +import OAI.Probability.SpanningForest.PosteriorSupport +import OAI.Probability.SpanningForest.PosteriorTiltLimit +import OAI.Probability.SpanningForest.ProjectionLimit +import OAI.Probability.SpanningForest.RandomReindex +import OAI.Probability.SpanningForest.RandomSelection +import OAI.Probability.SpanningForest.RawInnovationSampler +import OAI.Probability.SpanningForest.ReducedCycleKernel +import OAI.Probability.SpanningForest.ReducedLaplacian +import OAI.Probability.SpanningForest.Relabeling +import OAI.Probability.SpanningForest.ResponseLipschitz +import OAI.Probability.SpanningForest.RuleExtension +import OAI.Probability.SpanningForest.SampledPathConcatenation +import OAI.Probability.SpanningForest.SampledUnitPath +import OAI.Probability.SpanningForest.SchauderTail +import OAI.Probability.SpanningForest.SchauderTents +import OAI.Probability.SpanningForest.SlopeReadout +import OAI.Probability.SpanningForest.StochasticBundle +import OAI.Probability.SpanningForest.SubtypeSubsetSums +import OAI.Probability.SpanningForest.Theory +import OAI.Probability.SpanningForest.TiltResponse +import OAI.Probability.SpanningForest.TotalTreeResponse +import OAI.Probability.SpanningForest.TransferCurrent +import OAI.Probability.SpanningForest.TransferCurrentLipschitz +import OAI.Probability.SpanningForest.TransferProjection +import OAI.Probability.SpanningForest.TreePosteriorBridge +import OAI.Probability.SpanningForest.USTCylinder +import OAI.Probability.SpanningForest.USTDeterminant +import OAI.Probability.SpanningForest.USTFiniteDeterminantal +import OAI.Probability.SpanningForest.USTFiniteTilt +import OAI.Probability.SpanningForest.USTInclusionCount +import OAI.Probability.SpanningForest.USTPosteriorResponse +import OAI.Probability.SpanningForest.USTResponse +import OAI.Probability.SpanningForest.UniformSampler +import OAI.Probability.SpanningForest.WeightedCauchyBinet +import OAI.Probability.SpanningForest.WeightedInnovation +import OAI.Probability.SpanningForest.WeightedTreeBorel +import OAI.Probability.SpanningForest.WeightedTreeEquiv +import OAI.Probability.SpanningForest.WeightedTreeResponse +import OAI.Probability.SpanningForest.WeightedTreeTransport +import OAI.Probability.SpanningForest.WienerSampler diff --git a/lean/OAI/Probability/SpanningForest/MarkedGram.lean b/lean/OAI/Probability/SpanningForest/MarkedGram.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2c1ea37ff591a235e2dad4481927bfdbd0aa26e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/MarkedGram.lean @@ -0,0 +1,83 @@ +import OAI.Probability.SpanningForest.PolynomialGramUpdate + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix + +namespace Problem336.Determinantal + +variable {ν ι R : Type*} [finiteRows : Fintype ν] [decidableRows : DecidableEq ν] +variable [Fintype ι] [DecidableEq ι] [CommRing R] + +omit [Fintype ι] in + +theorem prod_marked_weights (c : ι → R) (T S : Finset ι) (z : R) : + (∏ e ∈ T, c e * (if e ∈ S then 1 + z else 1)) = + (∏ e ∈ T, c e) * (1 + z) ^ (T ∩ S).card := by + rw [Finset.prod_mul_distrib] + congr 1 + simp only [Finset.prod_ite, Finset.prod_const, Finset.filter_mem_eq_inter, + one_pow, mul_one] + +omit finiteRows decidableRows in +private theorem gram_entry [Fintype ν] [DecidableEq ν] {E : Type*} + [Fintype E] [DecidableEq E] + (A : Matrix ν E R) (c : E → R) (i j : ν) : + (A * Matrix.diagonal c * A.transpose) i j = ∑ e, A i e * c e * A j e := by + rw [Matrix.mul_apply] + simp only [Matrix.mul_diagonal, Matrix.transpose_apply] + +theorem gram_marked_diagonal (A : Matrix ν ι R) (c : ι → R) + (S : Finset ι) (z : R) : + A * Matrix.diagonal (fun e => c e * (if e ∈ S then 1 + z else 1)) * A.transpose = + A * Matrix.diagonal c * A.transpose + + z • (A.submatrix id (Subtype.val : S → ι) * + Matrix.diagonal (fun e : S => c e) * + (A.submatrix id (Subtype.val : S → ι)).transpose) := by + ext i j + simp only [Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, gram_entry, + Matrix.submatrix_apply, id_eq] + have hterm (e : ι) : A i e * (c e * (if e ∈ S then 1 + z else 1)) * A j e = + A i e * c e * A j e + (if e ∈ S then z * (A i e * c e * A j e) else 0) := by + split_ifs <;> ring + have hsub : (∑ e : S, A i e * c e * A j e) = + ∑ e ∈ S, A i e * c e * A j e := + Finset.sum_coe_sort S (fun e : ι => A i e * c e * A j e) + simp_rw [hterm] + rw [Finset.sum_add_distrib, hsub] + congr 1 + simp only [Finset.sum_ite_mem, Finset.univ_inter, Finset.mul_sum] + +theorem det_marked_weighted_gram (A : Matrix ν ι ℝ) (c : ι → ℝ) + (hA : IsUnit (A * Matrix.diagonal c * A.transpose).det) (S : Finset ι) : + (A.map Polynomial.C * Matrix.diagonal (fun e => + Polynomial.C (c e) * (if e ∈ S then 1 + (Polynomial.X : Polynomial ℝ) else 1)) * + (A.map Polynomial.C).transpose).det = + Polynomial.C (A * Matrix.diagonal c * A.transpose).det * + (1 + (Polynomial.X : Polynomial ℝ) • + (Matrix.diagonal (fun e : S => c e) * + ((A.submatrix id (Subtype.val : S → ι)).transpose * + (A * Matrix.diagonal c * A.transpose)⁻¹ * + A.submatrix id (Subtype.val : S → ι))).map Polynomial.C).det := by + have hm := gram_marked_diagonal (A.map Polynomial.C) + (fun e => Polynomial.C (c e)) S (Polynomial.X : Polynomial ℝ) + have hm' : A.map Polynomial.C * Matrix.diagonal (fun e => + Polynomial.C (c e) * (if e ∈ S then 1 + (Polynomial.X : Polynomial ℝ) else 1)) * + (A.map Polynomial.C).transpose = + (A * Matrix.diagonal c * A.transpose).map Polynomial.C + + (Polynomial.X : Polynomial ℝ) • + (A.submatrix id (Subtype.val : S → ι) * + Matrix.diagonal (fun e : S => c e) * + (A.submatrix id (Subtype.val : S → ι)).transpose).map Polynomial.C := by + simpa only [Matrix.map_mul, Matrix.diagonal_map (map_zero Polynomial.C), + Matrix.transpose_map, Matrix.submatrix_map] using hm + rw [hm'] + exact det_polynomial_weighted_columns _ hA _ _ + +end Problem336.Determinantal + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/MatrixTreeSupport.lean b/lean/OAI/Probability/SpanningForest/MatrixTreeSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..34cc6ef6a2af567857270369f52e8658e8d3585a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/MatrixTreeSupport.lean @@ -0,0 +1,14 @@ +import OAI.Probability.SpanningForest.WeightedCauchyBinet +import OAI.Probability.SpanningForest.InclusionPolynomial +import OAI.Probability.SpanningForest.ReducedLaplacian +import OAI.Probability.SpanningForest.CodeLaplacian +import OAI.Probability.SpanningForest.IncidenceUnimodular +import OAI.Probability.SpanningForest.DisconnectedIncidence +import OAI.Probability.SpanningForest.DeterminantalResponse +import OAI.Probability.SpanningForest.GramDeterminantUpdate +import OAI.Probability.SpanningForest.IncidenceMinorClassification +import OAI.Probability.SpanningForest.OrderedMinorCounting +import OAI.Probability.SpanningForest.USTDeterminant +import OAI.Probability.SpanningForest.CodedInclusion +import OAI.Probability.SpanningForest.CodedMatrixTree +import OAI.Probability.SpanningForest.SubtypeSubsetSums diff --git a/lean/OAI/Probability/SpanningForest/NoCollisionExtension.lean b/lean/OAI/Probability/SpanningForest/NoCollisionExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..4bfd72965773751a6c76052ec984f995ef1b75cf --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/NoCollisionExtension.lean @@ -0,0 +1,175 @@ +import OAI.Probability.SpanningForest.CanonicalIID +import OAI.Probability.SpanningForest.GraphBorel +import OAI.Probability.SpanningForest.RuleExtension + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def noCollisionRule (Phi : FactorRule) : FactorRule := + gatedRule (fun _ U => Function.Injective U) Phi + +theorem injective_relabelLabels_iff (σ : Equiv ℕ ℕ) (U : ℕ → ℝ) : + Function.Injective (relabelLabels σ U) ↔ Function.Injective U := by + constructor + · intro h u v huv + have heq : relabelLabels σ U (σ u) = relabelLabels σ U (σ v) := by + simpa [relabelLabels] using huv + exact σ.injective (h heq) + · intro h u v huv + exact σ.symm.injective (h huv) + +theorem RuleBorel.noCollision {Phi : FactorRule} (hPhi : RuleBorel Phi) : + RuleBorel (noCollisionRule Phi) := + hPhi.gated (GraphBorel.measurable_injective_labels.comp measurable_snd) + +theorem noCollisionRule_equivariant {Phi : FactorRule} + (hPhi : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Function.Injective U → + Phi (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Phi G U e) : + RuleEquivariant (noCollisionRule Phi) := by + classical + intro σ G U e + by_cases hU : Function.Injective U + · simpa [noCollisionRule, gatedRule, hU, injective_relabelLabels_iff] using + hPhi σ G U e hU + · simp [noCollisionRule, gatedRule, hU, injective_relabelLabels_iff] + +theorem RuleEquivariant.noCollision {Phi : FactorRule} (hPhi : RuleEquivariant Phi) : + RuleEquivariant (noCollisionRule Phi) := + noCollisionRule_equivariant (fun σ G U e _ => hPhi σ G U e) + +theorem noCollisionRule_ae_eq {Ω : Type} [MeasurableSpace Ω] + {P : Measure Ω} {U : ℕ → Ω → ℝ} (hU : IsVertexIID P U) + (Phi : FactorRule) (G : GraphCode) : + (fun ω => noCollisionRule Phi G (fun i => U i ω)) =ᵐ[P] + (fun ω => Phi G (fun i => U i ω)) := + gatedRule_ae_eq (LabelNoCollision.ae_injective_labels hU) + +theorem WorksOnGraph.noCollision {Phi : FactorRule} {G : GraphCode} + (hWorks : WorksOnGraph Phi G) (hBorel : RuleBorel Phi) : + WorksOnGraph (noCollisionRule Phi) G := by + intro hconn hfin Ω _ P U hU + apply (hWorks hconn hfin Ω P U hU).congr + · intro e + have hlabels : Measurable (fun ω i => U i ω) := Measurable.of_eval hU.1 + exact hBorel.noCollision.comp + (measurable_const.prodMk (hlabels.prodMk measurable_const)) + · exact (noCollisionRule_ae_eq hU Phi G).symm + +theorem factor_witness_of_collision_free {Phi : FactorRule} + (hBorel : RuleBorel Phi) + (hEquiv : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Function.Injective U → + Phi (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Phi G U e) + (hLaw : ∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G privatePoolLaw (Phi G)) : + ∃ Psi : FactorRule, RuleBorel Psi ∧ RuleEquivariant Psi ∧ + ∀ G : GraphCode, WorksOnGraph Psi G := by + refine ⟨noCollisionRule Phi, hBorel.noCollision, noCollisionRule_equivariant hEquiv, ?_⟩ + intro G + exact ((CanonicalIID.worksOnGraph_iff_canonical Phi G).mpr (hLaw G)).noCollision hBorel + +theorem IsVertexIID.comp_uniform {Ω : Type} [MeasurableSpace Ω] + {P : Measure Ω} {U : ℕ → Ω → ℝ} (hU : IsVertexIID P U) + {κ : ℝ → ℝ} (hκ : Measurable κ) (hmap : uniform01.map κ = uniform01) : + IsVertexIID P (fun i ω => κ (U i ω)) := by + constructor + · intro i + exact hκ.comp (hU.1 i) + · intro s A hA + calc + P {ω | ∀ i ∈ s, κ (U i ω) ∈ A i} = + ∏ i ∈ s, uniform01 (κ ⁻¹' A i) := + hU.2 s (fun i => κ ⁻¹' A i) (fun i hi => hκ (hA i hi)) + _ = ∏ i ∈ s, uniform01 (A i) := by + apply Finset.prod_congr rfl + intro i hi + have heq := congrArg (fun μ : Measure ℝ => μ (A i)) hmap + rwa [Measure.map_apply hκ (hA i hi)] at heq + +def keyCollisionRule (κ : ℝ → ℝ) (Phi : FactorRule) : FactorRule := + gatedRule (fun _ U => Function.Injective (fun i => κ (U i))) Phi + +theorem injective_keys_relabel_iff (κ : ℝ → ℝ) (σ : Equiv ℕ ℕ) (U : ℕ → ℝ) : + Function.Injective (fun i => κ (relabelLabels σ U i)) ↔ + Function.Injective (fun i => κ (U i)) := + injective_relabelLabels_iff σ (fun i => κ (U i)) + +theorem RuleBorel.keyCollision {Phi : FactorRule} (hPhi : RuleBorel Phi) + {κ : ℝ → ℝ} (hκ : Measurable κ) : RuleBorel (keyCollisionRule κ Phi) := by + apply hPhi.gated + exact GraphBorel.measurable_injective_labels.comp + (Measurable.of_eval (fun i => hκ.comp ((measurable_pi_apply i).comp measurable_snd))) + +theorem keyCollisionRule_equivariant {Phi : FactorRule} {κ : ℝ → ℝ} + (hPhi : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Function.Injective (fun i => κ (U i)) → + Phi (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Phi G U e) : + RuleEquivariant (keyCollisionRule κ Phi) := by + classical + intro σ G U e + by_cases hU : Function.Injective (fun i => κ (U i)) + · simpa [keyCollisionRule, gatedRule, hU, injective_keys_relabel_iff] using + hPhi σ G U e hU + · simp [keyCollisionRule, gatedRule, hU, injective_keys_relabel_iff] + +theorem keyCollisionRule_ae_eq {Ω : Type} [MeasurableSpace Ω] + {P : Measure Ω} {U : ℕ → Ω → ℝ} (hU : IsVertexIID P U) + {κ : ℝ → ℝ} (hκ : Measurable κ) (hmap : uniform01.map κ = uniform01) + (Phi : FactorRule) (G : GraphCode) : + (fun ω => keyCollisionRule κ Phi G (fun i => U i ω)) =ᵐ[P] + (fun ω => Phi G (fun i => U i ω)) := + gatedRule_ae_eq (LabelNoCollision.ae_injective_labels (hU.comp_uniform hκ hmap)) + +theorem WorksOnGraph.keyCollision {Phi : FactorRule} {G : GraphCode} + (hWorks : WorksOnGraph Phi G) (hBorel : RuleBorel Phi) + {κ : ℝ → ℝ} (hκ : Measurable κ) (hmap : uniform01.map κ = uniform01) : + WorksOnGraph (keyCollisionRule κ Phi) G := by + intro hconn hfin Ω _ P U hU + apply (hWorks hconn hfin Ω P U hU).congr + · intro e + have hlabels : Measurable (fun ω i => U i ω) := Measurable.of_eval hU.1 + exact (hBorel.keyCollision hκ).comp + (measurable_const.prodMk (hlabels.prodMk measurable_const)) + · exact (keyCollisionRule_ae_eq hU hκ hmap Phi G).symm + +theorem map_splitVertexKey : + uniform01.map (fun x => (splitVertexLabel x).1) = uniform01 := by + let : IsProbabilityMeasure privatePoolLaw := + LabelNoCollision.probability CanonicalIID.canonical_isVertexIID + change uniform01.map (Prod.fst ∘ splitVertexLabel) = uniform01 + rw [← Measure.map_map measurable_fst measurable_splitVertexLabel, map_splitVertexLabel] + simp [keyPoolLaw] + +theorem ae_injective_splitVertexKeys {Ω : Type} [MeasurableSpace Ω] + {P : Measure Ω} {U : ℕ → Ω → ℝ} (hU : IsVertexIID P U) : + ∀ᵐ ω ∂P, Function.Injective (fun i => (splitVertexLabel (U i ω)).1) := + LabelNoCollision.ae_injective_labels + (hU.comp_uniform measurable_splitVertexLabel.fst map_splitVertexKey) + +theorem factor_witness_of_canonical_keys {Phi : FactorRule} {κ : ℝ → ℝ} + (hκ : Measurable κ) (hmap : uniform01.map κ = uniform01) + (hBorel : RuleBorel Phi) + (hEquiv : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ) (e : EdgeCode), + Function.Injective (fun i => κ (U i)) → + Phi (relabelGraph σ G) (relabelLabels σ U) (mapEdge σ e) = Phi G U e) + (hLaw : ∀ G : GraphCode, GraphConnected G → GraphLocallyFinite G → + HasFUSFLaw G privatePoolLaw (Phi G)) : + ∃ Psi : FactorRule, RuleBorel Psi ∧ RuleEquivariant Psi ∧ + ∀ G : GraphCode, WorksOnGraph Psi G := by + refine ⟨keyCollisionRule κ Phi, hBorel.keyCollision hκ, + keyCollisionRule_equivariant hEquiv, ?_⟩ + intro G + exact ((CanonicalIID.worksOnGraph_iff_canonical Phi G).mpr (hLaw G)).keyCollision + hBorel hκ hmap + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ObservationPosterior.lean b/lean/OAI/Probability/SpanningForest/ObservationPosterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe20bfde9303df8351de13a945301bdbbc010115 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ObservationPosterior.lean @@ -0,0 +1,102 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped BigOperators Topology NNReal + +namespace Problem336.Observation + +theorem gaussianPDFReal_binary_shift (t : ℝ≥0) (ht : t ≠ 0) + (x y : ℝ) (hx : x = 0 ∨ x = 1) : + gaussianPDFReal ((t : ℝ) * x) t y = + gaussianPDFReal 0 t y * Real.exp ((y - (t : ℝ) / 2) * x) := by + rcases hx with rfl | rfl + · simp + · have ht' : (t : ℝ) ≠ 0 := by exact_mod_cast ht + simp only [mul_one, gaussianPDFReal, sub_zero] + simp only [mul_assoc] + rw [← Real.exp_add] + congr 2 + field_simp + ring + +theorem gaussianPDFReal_binary_shift_prod {I : Type*} (s : Finset I) + (t : ℝ≥0) (ht : t ≠ 0) (x y : I → ℝ) + (hx : ∀ i ∈ s, x i = 0 ∨ x i = 1) : + (∏ i ∈ s, gaussianPDFReal ((t : ℝ) * x i) t (y i)) = + (∏ i ∈ s, gaussianPDFReal 0 t (y i)) * + Real.exp (∑ i ∈ s, (y i - (t : ℝ) / 2) * x i) := by + calc + _ = ∏ i ∈ s, gaussianPDFReal 0 t (y i) * + Real.exp ((y i - (t : ℝ) / 2) * x i) := by + apply Finset.prod_congr rfl + intro i hi + exact gaussianPDFReal_binary_shift t ht (x i) (y i) (hx i hi) + _ = _ := by rw [Finset.prod_mul_distrib, Real.exp_sum] + +def finiteObservationFiltration {Ω I : Type*} {mΩ : MeasurableSpace Ω} + (coordinate : I → MeasurableSpace Ω) (hcoordinate : ∀ i, coordinate i ≤ mΩ) + (S : ℕ → Finset I) (hS : Monotone S) : Filtration ℕ mΩ where + seq n := ⨆ i ∈ S n, coordinate i + mono' := by + intro n m hnm + exact iSup_le fun i => iSup_le fun hi => + le_iSup_of_le i (le_iSup_of_le (hS hnm hi) le_rfl) + le' n := iSup_le fun i => iSup_le fun _ => hcoordinate i + +theorem iSup_finiteObservationFiltration {Ω I : Type*} {mΩ : MeasurableSpace Ω} + (coordinate : I → MeasurableSpace Ω) (hcoordinate : ∀ i, coordinate i ≤ mΩ) + (S : ℕ → Finset I) (hS : Monotone S) (hcover : ∀ i, ∃ n, i ∈ S n) : + (⨆ n, finiteObservationFiltration coordinate hcoordinate S hS n) = + ⨆ i, coordinate i := by + apply le_antisymm + · exact iSup_le fun _ => iSup_le fun i => iSup_le fun _ => le_iSup coordinate i + · refine iSup_le fun i => ?_ + obtain ⟨n, hi⟩ := hcover i + exact le_iSup_of_le n (le_iSup_of_le i (le_iSup_of_le hi le_rfl)) + +theorem tendsto_posterior_of_finite_stage + {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) + [IsFiniteMeasure P] (F : Filtration ℕ mΩ) (X : Ω → ℝ) + (posterior : ℕ → Ω → ℝ) + (hposterior : ∀ n, posterior n =ᵐ[P] P[X | F n]) : + ∀ᵐ ω ∂P, Tendsto (fun n => posterior n ω) atTop + (nhds ((P[X | ⨆ n, F n]) ω)) := by + have hall : ∀ᵐ ω ∂P, ∀ n, posterior n ω = (P[X | F n]) ω := + ae_all_iff.mpr hposterior + filter_upwards [hall, MeasureTheory.tendsto_ae_condExp (μ := P) (ℱ := F) X] + with ω hω hlim + exact hlim.congr (fun n => (hω n).symm) + +theorem limsup_posterior_of_finite_stage + {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) + [IsFiniteMeasure P] (F : Filtration ℕ mΩ) (X : Ω → ℝ) + (posterior : ℕ → Ω → ℝ) + (hposterior : ∀ n, posterior n =ᵐ[P] P[X | F n]) : + (fun ω => limsup (fun n => posterior n ω) atTop) =ᵐ[P] + P[X | ⨆ n, F n] := by + filter_upwards [tendsto_posterior_of_finite_stage P F X posterior hposterior] + with ω hω + exact hω.limsup_eq + +theorem limsup_posterior_all_coordinates + {Ω I : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) + [IsFiniteMeasure P] (coordinate : I → MeasurableSpace Ω) + (hcoordinate : ∀ i, coordinate i ≤ mΩ) + (S : ℕ → Finset I) (hS : Monotone S) (hcover : ∀ i, ∃ n, i ∈ S n) + (X : Ω → ℝ) (posterior : ℕ → Ω → ℝ) + (hposterior : ∀ n, posterior n =ᵐ[P] P[X | ⨆ i ∈ S n, coordinate i]) : + (fun ω => limsup (fun n => posterior n ω) atTop) =ᵐ[P] + P[X | ⨆ i, coordinate i] := by + have h := limsup_posterior_of_finite_stage P + (finiteObservationFiltration coordinate hcoordinate S hS) X posterior hposterior + simpa only [iSup_finiteObservationFiltration coordinate hcoordinate S hS hcover] using h + +end Problem336.Observation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ObservedBrownianMartingale.lean b/lean/OAI/Probability/SpanningForest/ObservedBrownianMartingale.lean new file mode 100644 index 0000000000000000000000000000000000000000..be468910575447684b1f9d9004d588b1af88cd26 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ObservedBrownianMartingale.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SpanningForest.InnovationAdapted +import OAI.Probability.SpanningForest.BrownianFamilyPast + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Set +open scoped NNReal BigOperators + +namespace Problem336.Innovation + +def observationHistoryFiltration {I Ω : Type*} {mΩ : MeasurableSpace Ω} + (Y : ℝ≥0 → Ω → I → ℝ) (hY : ∀ t i, Measurable (fun ω => Y t ω i)) : + Filtration ℝ≥0 mΩ where + seq t := MeasurableSpace.comap (fun ω (p : I × Iic t) => Y p.2 ω p.1) inferInstance + mono' := by + intro u v huv + let restrict : (I × Iic v → ℝ) → (I × Iic u → ℝ) := + fun f p => f (p.1, ⟨p.2, p.2.2.trans huv⟩) + have hr : Measurable restrict := by fun_prop + have heq : (fun ω (p : I × Iic u) => Y p.2 ω p.1) = + restrict ∘ (fun ω (p : I × Iic v) => Y p.2 ω p.1) := rfl + dsimp only + rw [heq, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono hr.comap_le + le' t := (Measurable.of_eval (fun p : I × Iic t => hY p.2 p.1)).comap_le + +theorem measurable_observationHistoryFiltration {I Ω : Type*} + {mΩ : MeasurableSpace Ω} (Y : ℝ≥0 → Ω → I → ℝ) + (hY : ∀ t i, Measurable (fun ω => Y t ω i)) (t : ℝ≥0) (i : I) : + Measurable[observationHistoryFiltration (mΩ := mΩ) Y hY t] (fun ω => Y t ω i) := by + exact (measurable_pi_apply ((i, ⟨t, by simp⟩) : I × Iic t)).comp + (comap_measurable (fun ω (p : I × Iic t) => Y p.2 ω p.1)) + +theorem martingale_nnInnovation_of_brownian_family + {I Ω : Type*} {mΩ : MeasurableSpace Ω} + (P : Measure Ω) (Y : ℝ≥0 → Ω → I → ℝ) + (hYmeas : ∀ t i, Measurable (fun ω => Y t ω i)) + (hYcont : ∀ ω i, Continuous (fun t => Y t ω i)) + (B : I → ℝ≥0 → Ω → ℝ) (hB : ∀ i, IsPreBrownianReal (B i) P) + (hBm : ∀ i t, Measurable (B i t)) + (hI : iIndepFun (fun i ω t => B i t ω) P) + (X : Ω → I → ℝ) (hX : Measurable X) + (hXB : IndepFun X (fun ω i t => B i t ω) P) + (hobs : ∀ t ω i, Y t ω i = (t : ℝ) * X ω i + B i t ω) + (i : I) (hXbound : ∀ ω, X ω i ∈ Icc (0 : ℝ) 1) + (b : ℝ≥0 → (I → ℝ) → ℝ) (hb : Measurable (Function.uncurry b)) + {C : ℝ} (hbound : ∀ t y, ‖b t y‖ ≤ C) + (hposterior : ∀ t : ℝ≥0, (fun ω => b t (Y t ω)) =ᵐ[P] + P[(fun ω => X ω i) | observationHistoryFiltration Y hYmeas t]) : + Martingale (nnInnovation (fun ω => X ω i) (B i) + (fun s ω => b s.toNNReal (Y s.toNNReal ω))) + (observationHistoryFiltration Y hYmeas) P := by + classical + let : IsProbabilityMeasure P := hI.isProbabilityMeasure + have hXi : Integrable (fun ω => X ω i) P := + Integrable.of_bound ((measurable_pi_apply i).comp hX).aestronglyMeasurable 1 (by + apply Filter.Eventually.of_forall + intro ω + rw [Real.norm_eq_abs, abs_of_nonneg (hXbound ω).1] + exact (hXbound ω).2) + have hnoise : ∀ u v : ℝ≥0, u ≤ v → ∀ A : Set Ω, + MeasurableSet[observationHistoryFiltration Y hYmeas u] A → + (∫ ω in A, (B i v ω - B i u ω) ∂P) = 0 := by + intro u v huv A hA + have hA' : MeasurableSet[MeasurableSpace.comap + (fun ω (p : I × Iic u) => (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) + inferInstance] A := by + change MeasurableSet[MeasurableSpace.comap + (fun ω (p : I × Iic u) => Y p.2 ω p.1) inferInstance] A at hA + have hhist : (fun ω (p : I × Iic u) => Y p.2 ω p.1) = + (fun ω (p : I × Iic u) => (p.2 : ℝ≥0) * X ω p.1 + B p.1 p.2 ω) := by + funext ω p + exact hobs p.2 ω p.1 + rw [hhist] at hA + exact hA + have hz := BrownianFamilyPast.setIntegral_weighted_increment_observation_eq_zero + hB hBm hI hX hXB {i} (fun _ => (1 : ℝ)) u (v - u) hA' + simpa only [Finset.sum_singleton, one_mul, add_tsub_cancel_of_le huv] using hz + have heq : nnInnovation (fun ω => X ω i) (B i) + (fun s ω => b s.toNNReal (Y s.toNNReal ω)) = + (fun t ω => Y t ω i - + ∫ s in (0 : ℝ)..t, b s.toNNReal (Y s.toNNReal ω)) := by + funext t ω + rw [nnInnovation_apply, hobs] + rw [heq] + exact martingale_borel_observation P (observationHistoryFiltration Y hYmeas) + Y hYcont (measurable_observationHistoryFiltration Y hYmeas) i + (fun ω => X ω i) (B i) (fun t ω => hobs t ω i) hXi + (fun t => (hB i).integrable_eval t) b hb hbound hposterior hnoise + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/OrderedMinorCounting.lean b/lean/OAI/Probability/SpanningForest/OrderedMinorCounting.lean new file mode 100644 index 0000000000000000000000000000000000000000..d545da5619264000738b713f98f248c8b0852fbd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/OrderedMinorCounting.lean @@ -0,0 +1,129 @@ +import OAI.Probability.SpanningForest.WeightedCauchyBinet + +namespace OAI + +noncomputable section + +open scoped BigOperators +open Finset Function + +namespace Problem336.OrderedMinorCounting + +variable {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] + +def embeddingRange (f : n ↪ m) : Finset m := Finset.univ.map f + +omit [DecidableEq n] [Fintype m] [DecidableEq m] in +@[simp] lemma mem_embeddingRange (f : n ↪ m) (x : m) : + x ∈ embeddingRange f ↔ ∃ i, f i = x := by + simp [embeddingRange] + +omit [DecidableEq n] [Fintype m] [DecidableEq m] in +@[simp] lemma card_embeddingRange (f : n ↪ m) : + (embeddingRange f).card = Fintype.card n := by + simp [embeddingRange] + +def embeddingFiberEquiv (s : Finset m) : + {f : n ↪ m // embeddingRange f = s} ≃ (n ≃ ↥s) where + toFun f := Equiv.ofBijective + (fun i => (⟨f.1 i, by simpa only [f.2] using (mem_embeddingRange f.1 _).mpr ⟨i, rfl⟩⟩ : ↥s)) + (by + constructor + · intro i j h + exact f.1.injective (congrArg Subtype.val h) + · intro x + have hx : x.1 ∈ embeddingRange f.1 := by rw [f.2]; exact x.2 + obtain ⟨i, hi⟩ := (mem_embeddingRange f.1 x.1).mp hx + exact ⟨i, Subtype.ext hi⟩) + invFun e := ⟨e.toEmbedding.trans ⟨Subtype.val, Subtype.val_injective⟩, by + ext x + rw [mem_embeddingRange] + constructor + · rintro ⟨i, rfl⟩ + exact (e i).2 + · intro hx + obtain ⟨i, hi⟩ := e.surjective ⟨x, hx⟩ + exact ⟨i, congrArg Subtype.val hi⟩⟩ + left_inv f := by + apply Subtype.ext + ext i + rfl + right_inv e := by + ext i + rfl + +lemma card_embedding_fiber (s : Finset m) (hs : s.card = Fintype.card n) : + (Finset.univ.filter (fun f : n ↪ m => embeddingRange f = s)).card = + Fintype.card (Equiv.Perm n) := by + classical + let e : n ≃ ↥s := Fintype.equivOfCardEq (by simpa using hs.symm) + have hc := Fintype.card_congr (embeddingFiberEquiv (n := n) s) + have he := Fintype.card_equiv e + rw [Fintype.card_perm] + rw [← he, ← hc] + exact (Fintype.card_subtype _).symm + +theorem sum_embeddingRange {R : Type*} [Semiring R] (F : Finset m → R) : + (∑ f : n ↪ m, F (embeddingRange f)) = + (Fintype.card (Equiv.Perm n) : R) * + ∑ s ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n), F s := by + classical + have hmap (f : n ↪ m) (_hf : f ∈ Finset.univ) : + embeddingRange f ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n) := by + simp + rw [← Finset.sum_fiberwise_of_maps_to' hmap F] + simp only [Finset.sum_const, nsmul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro s hs + rw [card_embedding_fiber s (Finset.mem_powersetCard.mp hs).2] + +def minorSquare {R : Type*} [CommRing R] (A : Matrix n m R) (s : Finset m) : R := + Matrix.det ((A.transpose * A).submatrix (fun i : ↥s => i.1) (fun i : ↥s => i.1)) + +omit [Fintype m] in +lemma minorSquare_embeddingRange {R : Type*} [CommRing R] + (A : Matrix n m R) (f : n ↪ m) : + minorSquare A (embeddingRange f) = Matrix.det (A.submatrix id f) ^ 2 := by + let e : n ≃ ↥(embeddingRange f) := embeddingFiberEquiv (embeddingRange f) ⟨f, rfl⟩ + unfold minorSquare + rw [← Matrix.det_submatrix_equiv_self e] + change Matrix.det ((A.transpose * A).submatrix f f) = _ + have hm : (A.transpose * A).submatrix f f = + (A.submatrix id f).transpose * A.submatrix id f := by + ext i j + simp only [Matrix.submatrix_apply, Matrix.mul_apply, Matrix.transpose_apply, id_eq] + rw [hm, Matrix.det_mul, Matrix.det_transpose, pow_two] + +lemma sum_embedding_eq_sum_injective {R : Type*} [AddCommMonoid R] (F : (n → m) → R) : + (∑ f : n ↪ m, F f) = ∑ f : n → m with Function.Injective f, F f := by + classical + have hs : (∑ f : n → m with Function.Injective f, F f) = + ∑ f : {f : n → m // Function.Injective f}, F f.1 := + Finset.sum_subtype _ (by simp) F + rw [hs] + exact (Equiv.subtypeInjectiveEquivEmbedding n m).sum_comp (fun f : n ↪ m => F f) |>.symm + +theorem weighted_gram_det_unordered (A : Matrix n m ℝ) (c : m → ℝ) : + Matrix.det (A * Matrix.diagonal c * A.transpose) = + ∑ s ∈ (Finset.univ : Finset m).powersetCard (Fintype.card n), + minorSquare A s * ∏ j ∈ s, c j := by + classical + have h := WeightedCauchyBinet.weighted_gram_det_injective A c + rw [← sum_embedding_eq_sum_injective] at h + have he : (∑ f : n ↪ m, Matrix.det (A.submatrix id f) ^ 2 * ∏ i, c (f i)) = + ∑ f : n ↪ m, minorSquare A (embeddingRange f) * ∏ j ∈ embeddingRange f, c j := by + apply Finset.sum_congr rfl + intro f hf + rw [minorSquare_embeddingRange A f] + simp only [embeddingRange, Finset.prod_map] + rw [he] at h + rw [sum_embeddingRange (n := n) (fun s => minorSquare A s * ∏ j ∈ s, c j)] at h + have hk : (Fintype.card (Equiv.Perm n) : ℝ) ≠ 0 := by positivity + exact mul_left_cancel₀ hk h + +end Problem336.OrderedMinorCounting + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PathConcatenation.lean b/lean/OAI/Probability/SpanningForest/PathConcatenation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9d83cd3fa6ca3a99b943d0365c14a50c4c71d42 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PathConcatenation.lean @@ -0,0 +1,121 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology +namespace Problem336.PathConcatenation +abbrev UnitPath := C(Set.Icc (0 : ℝ) 1, ℝ) +local instance : MeasurableSpace UnitPath := borel UnitPath +local instance : BorelSpace UnitPath := ⟨rfl⟩ +local instance : MeasurableSpace C(ℝ, ℝ) := borel C(ℝ, ℝ) +local instance : BorelSpace C(ℝ, ℝ) := ⟨rfl⟩ +def leftEnd : Set.Icc (0 : ℝ) 1 := ⟨0, by norm_num⟩ +def rightEnd : Set.Icc (0 : ℝ) 1 := ⟨1, by norm_num⟩ + +def segment (w : ℕ → UnitPath) (k : ℕ) (t : ℝ) : ℝ := + w k (Set.projIcc 0 1 (by norm_num) (t - k)) - w k leftEnd +theorem continuous_segment (w : ℕ → UnitPath) (k : ℕ) : Continuous (segment w k) := by + unfold segment + exact ((w k).continuous.comp (continuous_projIcc.comp + (continuous_id.sub continuous_const))).sub continuous_const +theorem segment_eq_zero_of_le (w : ℕ → UnitPath) (k : ℕ) {t : ℝ} + (ht : t ≤ k) : segment w k t = 0 := by + unfold segment + rw [Set.projIcc_of_le_left _ (sub_nonpos.mpr ht)] + exact sub_self _ +theorem segment_eq_endpoint_of_ge (w : ℕ → UnitPath) (k : ℕ) {t : ℝ} + (ht : (k : ℝ) + 1 ≤ t) : segment w k t = w k rightEnd - w k leftEnd := by + unfold segment + rw [Set.projIcc_of_right_le _ (by linarith : (1 : ℝ) ≤ t - k)] + rfl + +def concat (w : ℕ → UnitPath) (t : ℝ) : ℝ := ∑' k, segment w k t +theorem concat_eq_sum (w : ℕ → UnitPath) (N : ℕ) {t : ℝ} (ht : t ≤ N) : + concat w t = ∑ k ∈ Finset.range N, segment w k t := by + apply tsum_eq_sum + intro k hk + apply segment_eq_zero_of_le + exact ht.trans (by exact_mod_cast (Nat.le_of_not_gt (fun h => hk (Finset.mem_range.mpr h)))) +theorem continuous_concat (w : ℕ → UnitPath) : Continuous (concat w) := by + rw [continuous_iff_continuousAt] + intro t + obtain ⟨N, hN⟩ := exists_nat_gt t + have hc : Continuous (fun s => ∑ k ∈ Finset.range N, segment w k s) := + continuous_finsetSum _ (fun k _ => continuous_segment w k) + apply hc.continuousAt.congr_of_eventuallyEq + filter_upwards [Iio_mem_nhds hN] with s hs + exact concat_eq_sum w N (le_of_lt hs) + +def concatPath (w : ℕ → UnitPath) : C(ℝ, ℝ) := ⟨concat w, continuous_concat w⟩ +@[simp] theorem concat_nonpos (w : ℕ → UnitPath) {t : ℝ} (ht : t ≤ 0) : concat w t = 0 := by + simpa using concat_eq_sum w 0 (by simpa using ht) +theorem continuous_segment_joint (k : ℕ) : + Continuous (fun q : (ℕ → UnitPath) × ℝ => segment q.1 k q.2) := by + unfold segment + have hw : Continuous (fun q : (ℕ → UnitPath) × ℝ => q.1 k) := + (continuous_apply k).comp continuous_fst + have ht : Continuous (fun q : (ℕ → UnitPath) × ℝ => + Set.projIcc (0 : ℝ) 1 (by norm_num) (q.2 - k)) := + continuous_projIcc.comp (continuous_snd.sub continuous_const) + exact (continuous_eval.comp (hw.prodMk ht)).sub + (continuous_eval.comp (hw.prodMk continuous_const)) + +theorem continuous_concat_joint : + Continuous (fun q : (ℕ → UnitPath) × ℝ => concat q.1 q.2) := by + rw [continuous_iff_continuousAt] + intro q + obtain ⟨N, hN⟩ := exists_nat_gt q.2 + have hc : Continuous (fun p : (ℕ → UnitPath) × ℝ => + ∑ k ∈ Finset.range N, segment p.1 k p.2) := + continuous_finsetSum _ (fun k _ => continuous_segment_joint k) + apply hc.continuousAt.congr_of_eventuallyEq + filter_upwards [continuous_snd.continuousAt.preimage_mem_nhds (Iio_mem_nhds hN)] with p hp + exact concat_eq_sum p.1 N (le_of_lt hp) + +theorem continuous_concatPath : Continuous concatPath := + ContinuousMap.continuous_of_continuous_uncurry _ continuous_concat_joint + +theorem measurable_concatPath : Measurable concatPath := continuous_concatPath.measurable + +theorem segment_at_nat_add (w : ℕ → UnitPath) (n : ℕ) + (x : Set.Icc (0 : ℝ) 1) : + segment w n ((n : ℝ) + x) = w n x - w n leftEnd := by + unfold segment + rw [add_sub_cancel_left, Set.projIcc_of_mem _ x.property] + +theorem concat_nat_add (w : ℕ → UnitPath) (n : ℕ) + (x : Set.Icc (0 : ℝ) 1) : + concat w ((n : ℝ) + x) = + (∑ k ∈ Finset.range n, (w k rightEnd - w k leftEnd)) + + (w n x - w n leftEnd) := by + rw [concat_eq_sum w (n + 1) (by push_cast; linarith [x.property.2]), + Finset.sum_range_succ, segment_at_nat_add] + congr 1 + apply Finset.sum_congr rfl + intro k hk + apply segment_eq_endpoint_of_ge + have hkn : (k : ℝ) + 1 ≤ n := by exact_mod_cast Finset.mem_range.mp hk + linarith [x.property.1] + +theorem concat_nat (w : ℕ → UnitPath) (n : ℕ) : + concat w n = ∑ k ∈ Finset.range n, (w k rightEnd - w k leftEnd) := by + simpa [leftEnd] using concat_nat_add w n leftEnd + +theorem concat_increment_same_segment (w : ℕ → UnitPath) (n : ℕ) + (x y : Set.Icc (0 : ℝ) 1) : + concat w ((n : ℝ) + x) - concat w ((n : ℝ) + y) = w n x - w n y := by + rw [concat_nat_add, concat_nat_add] + ring + +theorem concat_nat_add_of_start_zero (w : ℕ → UnitPath) + (h : ∀ k, w k leftEnd = 0) (n : ℕ) (x : Set.Icc (0 : ℝ) 1) : + concat w ((n : ℝ) + x) = (∑ k ∈ Finset.range n, w k rightEnd) + w n x := by + simpa only [h, sub_zero] using concat_nat_add w n x + +end Problem336.PathConcatenation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Picard.lean b/lean/OAI/Probability/SpanningForest/Picard.lean new file mode 100644 index 0000000000000000000000000000000000000000..a02acb130091e09331709a6988e95ef3bd0b82e1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Picard.lean @@ -0,0 +1,256 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter MeasureTheory Set +open scoped Topology BigOperators + +namespace Problem336.Picard + +variable {ι : Type*} + +def iterate (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) : + ℕ → ι → ℝ → ℝ + | 0 => w + | n + 1 => fun i t => w i t + + ∫ s in (0 : ℝ)..t, b s (fun j => iterate w b n j s) i + +def majorant (L T : ℝ) (n : ℕ) : ℝ := + L ^ n * T ^ (n + 1) / (n + 1).factorial + +lemma intervalIntegrable_of_measurable_bounded + {f : ℝ → ℝ} (hf : Measurable f) {C : ℝ} (hC : ∀ t, |f t| ≤ C) + (a d : ℝ) : IntervalIntegrable f volume a d := by + constructor + · apply Measure.integrableOn_of_bounded measure_Ioc_lt_top.ne hf.aestronglyMeasurable + exact Filter.Eventually.of_forall fun t => by simpa [Real.norm_eq_abs] using hC t + · apply Measure.integrableOn_of_bounded measure_Ioc_lt_top.ne hf.aestronglyMeasurable + exact Filter.Eventually.of_forall fun t => by simpa [Real.norm_eq_abs] using hC t + +lemma continuous_iterate + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) : + ∀ n i, Continuous (iterate w b n i) := by + intro n + induction n with + | zero => exact hw + | succ n ih => + intro i + have hm : Measurable (fun s => b s (fun j => iterate w b n j s) i) := by + exact (hb i).comp (measurable_id.prodMk (Measurable.of_eval (fun j => (ih j).measurable))) + exact (hw i).add (intervalIntegral.continuous_primitive + (intervalIntegrable_of_measurable_bounded hm (fun s => hbound s _ i)) 0) + +lemma majorant_nonneg {L t : ℝ} (hL : 0 ≤ L) (ht : 0 ≤ t) (n : ℕ) : + 0 ≤ majorant L t n := by + unfold majorant + positivity + +lemma continuous_majorant (L : ℝ) (n : ℕ) : Continuous (fun t => majorant L t n) := by + unfold majorant + fun_prop + +lemma integral_majorant (L t : ℝ) (n : ℕ) : + (∫ s in (0 : ℝ)..t, L * majorant L s n) = majorant L t (n + 1) := by + have heq : (fun s : ℝ => L * majorant L s n) = + (fun s : ℝ => (L ^ (n + 1) / (n + 1).factorial) * s ^ (n + 1)) := by + funext s + simp only [majorant, pow_succ] + ring + rw [heq, intervalIntegral.integral_const_mul, integral_pow] + simp only [zero_pow (by omega : n + 1 + 1 ≠ 0), sub_zero, majorant] + simp only [Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one] + field_simp + +lemma measurable_drift_iterate + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) (n : ℕ) (i : ι) : + Measurable (fun s => b s (fun j => iterate w b n j s) i) := by + exact (hb i).comp (measurable_id.prodMk (Measurable.of_eval (fun j => (continuous_iterate w b hw hb hbound n j).measurable))) + +lemma intervalIntegrable_drift_iterate + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) (n : ℕ) (i : ι) (a d : ℝ) : + IntervalIntegrable (fun s => b s (fun j => iterate w b n j s) i) volume a d := by + exact intervalIntegrable_of_measurable_bounded + (measurable_drift_iterate w b hw hb hbound n i) (fun s => hbound s _ i) a d + +lemma iterate_increment_le + (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ (s : ℝ) (y y' : ι → ℝ) (D : ℝ), + 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b s y i - b s y' i| ≤ L * D) : + ∀ n i t, 0 ≤ t → + |iterate w b (n + 1) i t - iterate w b n i t| ≤ majorant L t n := by + intro n + induction n with + | zero => + intro i t ht + simp only [iterate, add_sub_cancel_left, majorant, pow_zero, zero_add, + pow_one, Nat.factorial_one, Nat.cast_one, div_one, one_mul] + have hh := intervalIntegral.norm_integral_le_of_norm_le (f := + fun s => b s (fun j => w j s) i) (g := fun _ => (1 : ℝ)) (μ := volume) ht + (Filter.Eventually.of_forall fun s _ => by simpa [Real.norm_eq_abs] using hbound s _ i) + (intervalIntegrable_const) + simpa [Real.norm_eq_abs] using hh + | succ n ih => + intro i t ht + have hn := intervalIntegrable_drift_iterate w b hw hb hbound n i 0 t + have hn1 := intervalIntegrable_drift_iterate w b hw hb hbound (n + 1) i 0 t + have hid : iterate w b (n + 1 + 1) i t - iterate w b (n + 1) i t = + ∫ s in (0 : ℝ)..t, + (b s (fun j => iterate w b (n + 1) j s) i - + b s (fun j => iterate w b n j s) i) := by + rw [intervalIntegral.integral_sub hn1 hn] + simp only [iterate] + ring + rw [hid] + have hh := intervalIntegral.norm_integral_le_of_norm_le (f := + fun s => b s (fun j => iterate w b (n + 1) j s) i - + b s (fun j => iterate w b n j s) i) + (g := fun s => L * majorant L s n) (μ := volume) ht + (Filter.Eventually.of_forall fun s hs => by + rw [Real.norm_eq_abs] + exact hresponse s _ _ _ (majorant_nonneg hL hs.1.le n) + (fun j => ih j s hs.1.le) i) + ((continuous_const.mul (continuous_majorant L n)).intervalIntegrable 0 t) + simpa only [Real.norm_eq_abs, integral_majorant] using hh + +lemma measurable_parametric_intervalIntegral + {α : Type*} [MeasurableSpace α] (f : α → ℝ → ℝ) + (hf : Measurable (Function.uncurry f)) (a d : α → ℝ) + (ha : Measurable a) (hd : Measurable d) : + Measurable (fun x => ∫ s in a x..d x, f x s) := by + classical + have hi (a d : α → ℝ) (ha : Measurable a) (hd : Measurable d) : + Measurable (fun x => ∫ s in Ioc (a x) (d x), f x s) := by + have hm : Measurable (fun q : α × ℝ => + if a q.1 < q.2 ∧ q.2 ≤ d q.1 then f q.1 q.2 else 0) := by + exact Measurable.ite + ((measurableSet_lt (ha.comp measurable_fst) measurable_snd).inter + (measurableSet_le measurable_snd (hd.comp measurable_fst))) hf measurable_const + have hh := hm.stronglyMeasurable.integral_prod_right' (ν := volume) + convert hh.measurable using 1 + funext x + rw [← integral_indicator measurableSet_Ioc] + simp only [Set.indicator, Set.mem_Ioc] + exact (hi a d ha hd).sub (hi d a hd ha) + +lemma measurable_iterate + {α : Type*} [MeasurableSpace α] + (w : α → ι → ℝ → ℝ) (b : α → ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Measurable (fun p : α × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => b p.1 p.2.1 p.2.2 i)) : + ∀ n i, Measurable (fun p : α × ℝ => iterate (w p.1) (b p.1) n i p.2) := by + intro n + induction n with + | zero => exact hw + | succ n ih => + intro i + apply (hw i).add + apply measurable_parametric_intervalIntegral + (fun p : α × ℝ => fun s => b p.1 s + (fun j => iterate (w p.1) (b p.1) n j s) i) + _ (fun _ => 0) Prod.snd measurable_const measurable_snd + exact (hb i).comp (measurable_fst.fst.prodMk + (measurable_snd.prodMk (Measurable.of_eval (fun j => + (ih j).comp (measurable_fst.fst.prodMk measurable_snd))))) + +def decode (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (i : ι) (t : ℝ) : ℝ := + Filter.limUnder atTop (fun n => iterate w b n i t) + +lemma measurable_decode + {α : Type*} [MeasurableSpace α] + (w : α → ι → ℝ → ℝ) (b : α → ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Measurable (fun p : α × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => b p.1 p.2.1 p.2.2 i)) (i : ι) : + Measurable (fun p : α × ℝ => decode (w p.1) (b p.1) i p.2) := by + exact (StronglyMeasurable.limUnder (l := atTop) + (fun n => (measurable_iterate w b hw hb n i).stronglyMeasurable)).measurable + +lemma iterate_relabel + {κ : Type*} (e : ι ≃ κ) + (w : ι → ℝ → ℝ) (w' : κ → ℝ → ℝ) + (b : ℝ → (ι → ℝ) → ι → ℝ) (b' : ℝ → (κ → ℝ) → κ → ℝ) + (hw : ∀ i t, w' (e i) t = w i t) + (hb : ∀ t (y : ι → ℝ) i, + b' t (fun k => y (e.symm k)) (e i) = b t y i) : + ∀ n i t, iterate w' b' n (e i) t = iterate w b n i t := by + intro n + induction n with + | zero => exact hw + | succ n ih => + intro i t + simp only [iterate, hw] + congr 1 + apply congrArg (fun f : ℝ → ℝ => ∫ s in (0 : ℝ)..t, f s) + funext s + have hfield : (fun k => iterate w' b' n k s) = + (fun k => iterate w b n (e.symm k) s) := by + funext k + simpa using ih (e.symm k) s + rw [hfield] + exact hb s (fun j => iterate w b n j s) i + +lemma decode_relabel + {κ : Type*} (e : ι ≃ κ) + (w : ι → ℝ → ℝ) (w' : κ → ℝ → ℝ) + (b : ℝ → (ι → ℝ) → ι → ℝ) (b' : ℝ → (κ → ℝ) → κ → ℝ) + (hw : ∀ i t, w' (e i) t = w i t) + (hb : ∀ t (y : ι → ℝ) i, + b' t (fun k => y (e.symm k)) (e i) = b t y i) (i : ι) (t : ℝ) : + decode w' b' (e i) t = decode w b i t := by + unfold decode + congr 1 + funext n + exact iterate_relabel e w w' b b' hw hb n i t + +lemma iterate_causal + (w v : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (T : ℝ) + (hw : ∀ i t, t ∈ Icc 0 T → w i t = v i t) : + ∀ n i t, t ∈ Icc 0 T → iterate w b n i t = iterate v b n i t := by + intro n + induction n with + | zero => exact hw + | succ n ih => + intro i t ht + simp only [iterate, hw i t ht] + congr 1 + apply intervalIntegral.integral_congr + intro s hs + rw [uIcc_of_le ht.1] at hs + have hfield : (fun j => iterate w b n j s) = + (fun j => iterate v b n j s) := by + funext j + exact ih j s ⟨hs.1, hs.2.trans ht.2⟩ + exact congrArg (fun y => b s y i) hfield + +lemma decode_causal + (w v : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (T : ℝ) + (hw : ∀ i t, t ∈ Icc 0 T → w i t = v i t) + (i : ι) (t : ℝ) (ht : t ∈ Icc 0 T) : + decode w b i t = decode v b i t := by + unfold decode + congr 1 + funext n + exact iterate_causal w v b T hw n i t ht + +end Problem336.Picard + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardBounds.lean b/lean/OAI/Probability/SpanningForest/PicardBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..5fa657166a09efaa8dc91436bc2f1ebe5adac68a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardBounds.lean @@ -0,0 +1,248 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter MeasureTheory +open scoped Topology NNReal + +namespace Problem336.DeterministicDecoder + +def picardBound (L T : ℝ) (n : ℕ) : ℝ := + L ^ n * T ^ (n + 1) / (n + 1).factorial + +lemma picardBound_nonneg {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) (n : ℕ) : + 0 ≤ picardBound L T n := by + unfold picardBound + positivity + +lemma picardBound_le_exp_term {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) (n : ℕ) : + picardBound L T n ≤ T * ((L * T) ^ n / n.factorial) := by + have hfac : (n.factorial : ℝ) ≤ ((n + 1).factorial : ℝ) := by + exact_mod_cast Nat.factorial_le (Nat.le_succ n) + calc + picardBound L T n = T * (L * T) ^ n / (n + 1).factorial := by + simp only [picardBound, mul_pow, pow_succ] + ring + _ ≤ T * (L * T) ^ n / n.factorial := by + apply div_le_div_of_nonneg_left + · positivity + · positivity + · exact hfac + _ = T * ((L * T) ^ n / n.factorial) := by ring + +lemma summable_picardBound {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) : + Summable (picardBound L T) := by + exact Summable.of_nonneg_of_le (picardBound_nonneg hL hT) + (picardBound_le_exp_term hL hT) + ((Real.summable_pow_div_factorial (L * T)).mul_left T) + +lemma tendsto_picardBound_zero {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) : + Tendsto (picardBound L T) atTop (𝓝 0) := + (summable_picardBound hL hT).tendsto_atTop_zero + +theorem exists_uniform_limit_of_summable_increments + {ι E : Type*} [MetricSpace E] [CompleteSpace E] + (z : ℕ → ι → E) (d : ℕ → ℝ) (hd : Summable d) + (hz : ∀ n i, dist (z n i) (z (n + 1) i) ≤ d n) : + ∃ limit : ι → E, TendstoUniformly z limit atTop ∧ + ∀ n i, dist (z n i) (limit i) ≤ ∑' k, d (n + k) := by + have hc : ∀ i, CauchySeq (fun n => z n i) := fun i => + cauchySeq_of_dist_le_of_summable d (fun n => hz n i) hd + choose limit hlimit using fun i => cauchySeq_tendsto_of_complete (hc i) + have hbound : ∀ n i, dist (z n i) (limit i) ≤ ∑' k, d (n + k) := by + intro n i + exact dist_le_tsum_of_dist_le_of_tendsto d (fun k => hz k i) hd (hlimit i) n + refine ⟨limit, ?_, hbound⟩ + rw [Metric.tendstoUniformly_iff] + intro ε hε + have htail : Tendsto (fun n => ∑' k, d (n + k)) atTop (𝓝 0) := by + simpa only [Nat.add_comm] using tendsto_sum_nat_add d + filter_upwards [(tendsto_order.mp htail).2 ε hε] with n hn + intro i + rw [dist_comm] + exact (hbound n i).trans_lt hn + +theorem exists_uniform_limit_of_picard_increments + {ι E : Type*} [MetricSpace E] [CompleteSpace E] + (z : ℕ → ι → E) {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) + (hz : ∀ n i, dist (z n i) (z (n + 1) i) ≤ picardBound L T n) : + ∃ limit : ι → E, TendstoUniformly z limit atTop ∧ + ∀ n i, dist (z n i) (limit i) ≤ ∑' k, picardBound L T (n + k) := + exists_uniform_limit_of_summable_increments z (picardBound L T) + (summable_picardBound hL hT) hz + +theorem unique_of_picard_approximation + {ι E : Type*} [MetricSpace E] (z : ℕ → ι → E) (x y : ι → E) + {L T : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) + (hx : ∀ n i, dist (x i) (z n i) ≤ picardBound L T n) + (hy : ∀ n i, dist (y i) (z n i) ≤ picardBound L T n) : x = y := by + funext i + apply dist_eq_zero.mp + apply le_antisymm _ dist_nonneg + have ht : Tendsto (fun n => 2 * picardBound L T n) atTop (𝓝 0) := by + simpa using (tendsto_picardBound_zero hL hT).const_mul 2 + apply ge_of_tendsto' ht + intro n + calc + dist (x i) (y i) ≤ dist (x i) (z n i) + dist (z n i) (y i) := dist_triangle _ _ _ + _ ≤ picardBound L T n + picardBound L T n := by + rw [dist_comm (z n i) (y i)] + exact add_le_add (hx n i) (hy n i) + _ = 2 * picardBound L T n := by ring + +theorem uniform_drift_convergence + {ι τ : Type*} (b : τ → (ι → ℝ) → ι → ℝ) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t x y D, 0 ≤ D → + (∀ j, dist (x j) (y j) ≤ D) → + ∀ i, dist (b t x i) (b t y i) ≤ L * D) + (z : ℕ → ι → τ → ℝ) (limit : ι → τ → ℝ) + (hz : TendstoUniformly (fun n (p : ι × τ) => z n p.1 p.2) + (fun p => limit p.1 p.2) atTop) : + TendstoUniformly (fun n (p : ι × τ) => b p.2 (fun j => z n j p.2) p.1) + (fun p => b p.2 (fun j => limit j p.2) p.1) atTop := by + rw [Metric.tendstoUniformly_iff] at hz ⊢ + intro ε hε + have hpos : 0 < L + 1 := by linarith + have hδ : 0 < ε / (L + 1) := div_pos hε hpos + filter_upwards [hz (ε / (L + 1)) hδ] with n hn + intro p + have hr := hresponse p.2 (fun j => limit j p.2) (fun j => z n j p.2) + (ε / (L + 1)) hδ.le (fun j => (hn (j, p.2)).le) p.1 + have hid : (L + 1) * (ε / (L + 1)) = ε := by + field_simp + exact hr.trans_lt (by nlinarith) + +theorem continuous_coordinate_of_uniform_limit + {ι τ E : Type*} [TopologicalSpace τ] [MetricSpace E] + (z : ℕ → ι → τ → E) (limit : ι → τ → E) + (hz : TendstoUniformly (fun n (p : ι × τ) => z n p.1 p.2) + (fun p => limit p.1 p.2) atTop) + (hc : ∀ n i, Continuous (z n i)) (i : ι) : Continuous (limit i) := by + have hi := hz.comp (fun t => (i, t)) + exact hi.continuous (Filter.Eventually.of_forall (fun n => hc n i)).frequently + +lemma picardBound_mono_time {L s T : ℝ} (hL : 0 ≤ L) (hs : 0 ≤ s) + (hsT : s ≤ T) (n : ℕ) : picardBound L s n ≤ picardBound L T n := by + unfold picardBound + gcongr + +def sequenceLimit {ι : Type*} (z : ℕ → ι → ℝ → ℝ) (i : ι) (t : ℝ) : ℝ := + limUnder atTop (fun n => z n i t) + +lemma tendsto_sequenceLimit_of_picard_increments + {ι : Type*} (z : ℕ → ι → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) + (hz : ∀ n i t, 0 ≤ t → dist (z n i t) (z (n + 1) i t) ≤ picardBound L t n) + (i : ι) {t : ℝ} (ht : 0 ≤ t) : + Tendsto (fun n => z n i t) atTop (𝓝 (sequenceLimit z i t)) := by + apply tendsto_nhds_limUnder + exact cauchySeq_tendsto_of_complete + (cauchySeq_of_dist_le_of_summable (picardBound L t) + (fun n => hz n i t ht) (summable_picardBound hL ht)) + +theorem compact_uniform_sequenceLimit + {ι : Type*} (z : ℕ → ι → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) + (hz : ∀ n i t, 0 ≤ t → dist (z n i t) (z (n + 1) i t) ≤ picardBound L t n) + {T : ℝ} (hT : 0 ≤ T) : + TendstoUniformly + (fun n (p : ι × Set.Icc (0 : ℝ) T) => z n p.1 p.2) + (fun p => sequenceLimit z p.1 p.2) atTop ∧ + ∀ n i t, t ∈ Set.Icc (0 : ℝ) T → + dist (z n i t) (sequenceLimit z i t) ≤ ∑' k, picardBound L T (n + k) := by + have hinc : ∀ n (p : ι × Set.Icc (0 : ℝ) T), + dist (z n p.1 p.2) (z (n + 1) p.1 p.2) ≤ picardBound L T n := by + intro n p + exact (hz n p.1 p.2 p.2.property.1).trans + (picardBound_mono_time hL p.2.property.1 p.2.property.2 n) + obtain ⟨limit, hconv, hbound⟩ := exists_uniform_limit_of_picard_increments + (fun n (p : ι × Set.Icc (0 : ℝ) T) => z n p.1 p.2) hL hT hinc + have heq : limit = fun p => sequenceLimit z p.1 p.2 := by + funext p + exact tendsto_nhds_unique (hconv.tendsto_at p) + (tendsto_sequenceLimit_of_picard_increments z hL hz p.1 p.2.property.1) + subst limit + refine ⟨hconv, ?_⟩ + intro n i t ht + exact hbound n (i, ⟨t, ht⟩) + +theorem continuousOn_sequenceLimit + {ι : Type*} (z : ℕ → ι → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) + (hz : ∀ n i t, 0 ≤ t → dist (z n i t) (z (n + 1) i t) ≤ picardBound L t n) + (hc : ∀ n i, Continuous (z n i)) (i : ι) {T : ℝ} (hT : 0 ≤ T) : + ContinuousOn (sequenceLimit z i) (Set.Icc (0 : ℝ) T) := by + rw [continuousOn_iff_continuous_domRestrict] + exact continuous_coordinate_of_uniform_limit + (fun n i (s : Set.Icc (0 : ℝ) T) => z n i s) + (fun i (s : Set.Icc (0 : ℝ) T) => sequenceLimit z i s) + (compact_uniform_sequenceLimit z hL hz hT).1 + (fun n i => (hc n i).comp continuous_subtype_val) i + +theorem continuousOn_sequenceLimit_nonnegative + {ι : Type*} (z : ℕ → ι → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) + (hz : ∀ n i t, 0 ≤ t → dist (z n i t) (z (n + 1) i t) ≤ picardBound L t n) + (hc : ∀ n i, Continuous (z n i)) (i : ι) : + ContinuousOn (sequenceLimit z i) (Set.Ici (0 : ℝ)) := by + apply continuousOn_of_locally_continuousOn + intro t ht + refine ⟨Set.Iio (t + 1), isOpen_Iio, by simp, ?_⟩ + have hT : 0 ≤ t + 1 := by have := ht; simp only [Set.mem_Ici] at this; linarith + apply (continuousOn_sequenceLimit z hL hz hc i hT).mono + intro s hs + exact ⟨hs.1, hs.2.le⟩ + +theorem continuous_sequenceLimit_nnreal + {ι : Type*} (z : ℕ → ι → ℝ → ℝ) {L : ℝ} (hL : 0 ≤ L) + (hz : ∀ n i t, 0 ≤ t → dist (z n i t) (z (n + 1) i t) ≤ picardBound L t n) + (hc : ∀ n i, Continuous (z n i)) (i : ι) : + Continuous (fun t : ℝ≥0 => sequenceLimit z i t) := by + exact (continuousOn_iff_continuous_domRestrict.mp + (continuousOn_sequenceLimit_nonnegative z hL hz hc i)) + +theorem integral_equation_at_of_uniform_limit + {ι : Type*} (b : ℝ → (ι → ℝ) → ι → ℝ) + (w : ι → ℝ → ℝ) (z : ℕ → ι → ℝ → ℝ) (limit : ι → ℝ → ℝ) + {L T M : ℝ} (hL : 0 ≤ L) (hT : 0 ≤ T) + (hresponse : ∀ t x y D, 0 ≤ D → + (∀ j, dist (x j) (y j) ≤ D) → + ∀ i, dist (b t x i) (b t y i) ≤ L * D) + (hbound : ∀ t x i, |b t x i| ≤ M) + (hmeas : ∀ n i, Measurable (fun s => b s (fun j => z n j s) i)) + (hz : TendstoUniformly + (fun n (p : ι × Set.Icc (0 : ℝ) T) => z n p.1 p.2) + (fun p => limit p.1 p.2) atTop) + (hrec : ∀ n i, z (n + 1) i T = w i T + + ∫ s in (0 : ℝ)..T, b s (fun j => z n j s) i) : + ∀ i, limit i T = w i T + ∫ s in (0 : ℝ)..T, b s (fun j => limit j s) i := by + have hdb := uniform_drift_convergence + (fun (s : Set.Icc (0 : ℝ) T) => b s) hL + (fun s => hresponse s) + (fun n i (s : Set.Icc (0 : ℝ) T) => z n i s) + (fun i (s : Set.Icc (0 : ℝ) T) => limit i s) hz + intro i + have hint : Tendsto (fun n => ∫ s in (0 : ℝ)..T, b s (fun j => z n j s) i) + atTop (𝓝 (∫ s in (0 : ℝ)..T, b s (fun j => limit j s) i)) := by + apply intervalIntegral.tendsto_integral_filter_of_dominated_convergence (fun _ => M) + · exact Eventually.of_forall (fun n => (hmeas n i).aestronglyMeasurable) + · exact Eventually.of_forall (fun n => Eventually.of_forall (fun s _ => by + simpa only [Real.norm_eq_abs] using hbound s (fun j => z n j s) i)) + · exact intervalIntegrable_const + · apply Eventually.of_forall + intro s hs + rw [Set.uIoc_of_le hT] at hs + exact hdb.tendsto_at (i, ⟨s, hs.1.le, hs.2⟩) + have hpoint : Tendsto (fun n => z n i T) atTop (𝓝 (limit i T)) := + hz.tendsto_at (i, ⟨T, hT, le_rfl⟩) + have hsucc : Tendsto (fun n => z (n + 1) i T) atTop (𝓝 (limit i T)) := + hpoint.comp (tendsto_add_atTop_nat 1) + have heq : Tendsto (fun n => z (n + 1) i T) atTop + (𝓝 (w i T + ∫ s in (0 : ℝ)..T, b s (fun j => limit j s) i)) := by + exact (tendsto_const_nhds.add hint).congr' (Eventually.of_forall (fun n => (hrec n i).symm)) + exact tendsto_nhds_unique hsucc heq + +end Problem336.DeterministicDecoder + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardNonnegativeSampler.lean b/lean/OAI/Probability/SpanningForest/PicardNonnegativeSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..76492d5b50199c0f7c59f05739265dc047538e91 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardNonnegativeSampler.lean @@ -0,0 +1,104 @@ +import OAI.Probability.SpanningForest.PicardNonnegativeTime +import OAI.Probability.SpanningForest.PicardSamplerLaw + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter +open scoped Topology NNReal + +namespace Problem336.PicardSampler.NonnegativeTime + +open Picard.NonnegativeTime + +def sample {I W : Type*} (w : W → I → ℝ≥0 → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (q : W) : I → Bool := + PicardSampler.sample (fun q => extendInput (w q)) b q + +theorem measurable_sample {I W : Type*} [MeasurableSpace W] + (w : W → I → ℝ≥0 → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ≥0 => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) : + Measurable (sample w b) := + PicardSampler.measurable_sample _ b (measurable_extendInput w hw) hb + +theorem measurable_sample_parameterized {I W : Type*} [MeasurableSpace W] + (w : W → I → ℝ≥0 → ℝ) (b : W → ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ≥0 => w p.1 i p.2)) + (hb : ∀ i, Measurable + (fun p : W × (ℝ × (I → ℝ)) => b p.1 p.2.1 p.2.2 i)) : + Measurable (fun q => sample w (b q) q) := by + have hz : Measurable (fun q i (n : ℕ) => + Picard.decode (extendInput (w q)) (b q) i (n : ℝ)) := by + apply Measurable.of_eval + intro i + apply Measurable.of_eval + intro n + have hm : Measurable (fun p : W × ℝ => + Picard.decode (extendInput (w p.1)) (b p.1) i p.2) := + @Picard.measurable_decode I W _ (fun q => extendInput (w q)) b + (measurable_extendInput w hw) hb i + have hc : Measurable (fun q : W => (q, (n : ℝ))) := + measurable_id.prodMk measurable_const + convert hm.comp hc using 1 + rfl + exact measurable_configurationReadout.comp hz + +theorem sample_relabel {I J W W' : Type*} (e : I ≃ J) + (w : W → I → ℝ≥0 → ℝ) (w' : W' → J → ℝ≥0 → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (b' : ℝ → (J → ℝ) → J → ℝ) + (q : W) (q' : W') + (hw : ∀ i t, w' q' (e i) t = w q i t) + (hb : ∀ t (y : I → ℝ) i, + b' t (fun j => y (e.symm j)) (e i) = b t y i) + (i : I) : sample w' b' q' (e i) = sample w b q i := by + change slopeReadout (fun n : ℕ => + Picard.decode (extendInput (w' q')) b' (e i) n) = + slopeReadout (fun n : ℕ => Picard.decode (extendInput (w q)) b i n) + congr 1 + funext n + exact Picard.decode_relabel e (extendInput (w q)) (extendInput (w' q')) b b' + (fun j t => hw j (Real.toNNReal t)) hb i n + +theorem hasLaw_of_integral_coupling + {I Ω W Ω' : Type*} [Countable I] + [MeasurableSpace Ω] [MeasurableSpace W] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} {ρ : Measure W} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsPreBrownianReal (B i) P) + {innovation : Ω → W} (hinnovation : HasLaw innovation ρ P) + {fresh : Ω' → W} (hfresh : HasLaw fresh ρ P') + (w : W → I → ℝ≥0 → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ≥0 => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) + (Y : Ω → I → ℝ≥0 → ℝ) + (hpaths : ∀ᵐ ω ∂P, (∀ i, Continuous (w (innovation ω) i)) ∧ + (∀ i, Measurable (Y ω i))) + (heq : ∀ᵐ ω ∂P, ∀ (t : ℝ≥0) i, + Y ω i t = w (innovation ω) i t + + ∫ s in (0 : ℝ)..(t : ℝ), b s (fun j => Y ω j (Real.toNNReal s)) i) + (hobs : ∀ᵐ ω ∂P, ∀ i (n : ℕ), + Y ω i n = (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω) : + HasLaw (fun ω => sample w b (fresh ω)) ν P' := by + apply PicardSampler.hasLaw_of_integral_coupling hX hB hinnovation hfresh + (fun q => extendInput (w q)) b (measurable_extendInput w hw) + hb hbound hL hresponse (fun ω => extendInput (Y ω)) + · filter_upwards [hpaths] with ω hω + exact ⟨continuous_extendInput hω.1, + fun i => (hω.2 i).comp continuous_real_toNNReal.measurable⟩ + · filter_upwards [heq] with ω hω + intro t ht i + simpa only [extendInput, Real.coe_toNNReal t ht] using hω (Real.toNNReal t) i + · filter_upwards [hobs] with ω hω + intro i n + simpa only [extendInput, Real.toNNReal_natCast] using hω i n + +end Problem336.PicardSampler.NonnegativeTime + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardNonnegativeTime.lean b/lean/OAI/Probability/SpanningForest/PicardNonnegativeTime.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b212e449bf7fa1c96228bd5c625b6b4989fd1a1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardNonnegativeTime.lean @@ -0,0 +1,150 @@ +import OAI.Probability.SpanningForest.PicardSolution +import OAI.Probability.SpanningForest.PicardUniqueness + +namespace OAI + +noncomputable section + +open Filter MeasureTheory +open scoped Topology NNReal + +namespace Problem336.Picard.NonnegativeTime + +variable {ι : Type*} + +def extendInput (w : ι → ℝ≥0 → ℝ) (i : ι) (t : ℝ) : ℝ := + w i (Real.toNNReal t) + +@[simp] theorem extendInput_coe (w : ι → ℝ≥0 → ℝ) (i : ι) (t : ℝ≥0) : + extendInput w i (t : ℝ) = w i t := by + simp only [extendInput, Real.toNNReal_coe] + +def decodePath (w : ι → ℝ≥0 → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (i : ι) (t : ℝ≥0) : ℝ := + Picard.decode (extendInput w) b i t + +theorem continuous_extendInput {w : ι → ℝ≥0 → ℝ} + (hw : ∀ i, Continuous (w i)) (i : ι) : Continuous (extendInput w i) := + (hw i).comp continuous_real_toNNReal + +theorem measurable_extendInput + {α : Type*} [MeasurableSpace α] (w : α → ι → ℝ≥0 → ℝ) + (hw : ∀ i, Measurable (fun p : α × ℝ≥0 => w p.1 i p.2)) + (i : ι) : Measurable (fun p : α × ℝ => extendInput (w p.1) i p.2) := + (hw i).comp (measurable_fst.prodMk + (continuous_real_toNNReal.measurable.comp measurable_snd)) + +theorem measurable_decodePath + {α : Type*} [MeasurableSpace α] + (w : α → ι → ℝ≥0 → ℝ) (b : α → ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Measurable (fun p : α × ℝ≥0 => w p.1 i p.2)) + (hb : ∀ i, Measurable + (fun p : α × (ℝ × (ι → ℝ)) => b p.1 p.2.1 p.2.2 i)) (i : ι) : + Measurable (fun p : α × ℝ≥0 => decodePath (w p.1) (b p.1) i p.2) := by + change Measurable (fun p : α × ℝ≥0 => + Picard.decode (extendInput (w p.1)) (b p.1) i (p.2 : ℝ)) + have hm : Measurable (fun p : α × ℝ => + Picard.decode (extendInput (w p.1)) (b p.1) i p.2) := + @Picard.measurable_decode ι α _ (fun a => extendInput (w a)) b + (measurable_extendInput w hw) hb i + have hc : Measurable (fun p : α × ℝ≥0 => (p.1, (p.2 : ℝ))) := + measurable_fst.prodMk measurable_snd.subtype_coe + convert hm.comp hc using 1 + rfl + +section Solution + +variable (w : ι → ℝ≥0 → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) + +include hw hb hbound hL hresponse + +theorem continuous_decodePath (i : ι) : Continuous (decodePath w b i) := by + exact (Picard.continuousOn_decode (extendInput w) b + (continuous_extendInput hw) hb hbound hL hresponse i).comp_continuous + NNReal.continuous_coe (fun t => t.2) + +theorem decodePath_integral_equation (i : ι) (t : ℝ≥0) : + decodePath w b i t = w i t + + ∫ s in (0 : ℝ)..(t : ℝ), b s (fun j => decodePath w b j (Real.toNNReal s)) i := by + change Picard.decode (extendInput w) b i (t : ℝ) = _ + calc + Picard.decode (extendInput w) b i (t : ℝ) = + extendInput w i (t : ℝ) + ∫ s in (0 : ℝ)..(t : ℝ), + b s (fun j => Picard.decode (extendInput w) b j s) i := + Picard.decode_integral_equation (extendInput w) b + (continuous_extendInput hw) hb hbound hL hresponse i (t := (t : ℝ)) t.2 + _ = _ := by + rw [extendInput_coe] + congr 1 + apply intervalIntegral.integral_congr + intro s hs + have hst : (0 : ℝ) ≤ (t : ℝ) := t.2 + have hs0 : 0 ≤ s := by + simpa only [min_eq_left hst] using hs.1 + have hfield : (fun j => Picard.decode (extendInput w) b j s) = + (fun j => decodePath w b j (Real.toNNReal s)) := by + funext j + simp only [decodePath, Real.coe_toNNReal s hs0] + exact congrArg (fun y => b s y i) hfield + +theorem decodePath_zero (i : ι) : decodePath w b i 0 = w i 0 := by + simpa using decodePath_integral_equation w b hw hb hbound hL hresponse i 0 + +end Solution + +theorem decodePath_relabel + {κ : Type*} (e : ι ≃ κ) + (w : ι → ℝ≥0 → ℝ) (w' : κ → ℝ≥0 → ℝ) + (b : ℝ → (ι → ℝ) → ι → ℝ) (b' : ℝ → (κ → ℝ) → κ → ℝ) + (hw : ∀ i t, w' (e i) t = w i t) + (hb : ∀ t (y : ι → ℝ) i, + b' t (fun k => y (e.symm k)) (e i) = b t y i) + (i : ι) (t : ℝ≥0) : decodePath w' b' (e i) t = decodePath w b i t := by + exact Picard.decode_relabel e (extendInput w) (extendInput w') b b' + (fun j s => hw j (Real.toNNReal s)) hb i t + +theorem decodePath_causal + (w v : ι → ℝ≥0 → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) (T : ℝ≥0) + (hw : ∀ i t, t ≤ T → w i t = v i t) + (i : ι) (t : ℝ≥0) (ht : t ≤ T) : + decodePath w b i t = decodePath v b i t := by + apply Picard.decode_causal (extendInput w) (extendInput v) b (T : ℝ) _ i + (t : ℝ) ⟨t.2, ht⟩ + intro j s hs + apply hw j (Real.toNNReal s) + change (Real.toNNReal s : ℝ) ≤ (T : ℝ) + simpa only [Real.coe_toNNReal s hs.1] using hs.2 + +theorem decodePath_eq_solution + (w x : ι → ℝ≥0 → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) (hx : ∀ i, Measurable (x i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) + (hsol : ∀ (t : ℝ≥0) i, x i t = w i t + + ∫ s in (0 : ℝ)..(t : ℝ), b s (fun j => x j (Real.toNNReal s)) i) + (i : ι) (t : ℝ≥0) : decodePath w b i t = x i t := by + have hsol' : ∀ s : ℝ, 0 ≤ s → ∀ j, + extendInput x j s = extendInput w j s + + ∫ r in (0 : ℝ)..s, b r (fun k => extendInput x k r) j := by + intro s hs j + simpa only [extendInput, Real.coe_toNNReal s hs] using hsol (Real.toNNReal s) j + have heq := Picard.decode_eq_solution (extendInput w) (extendInput x) b + (continuous_extendInput hw) + (fun j => (hx j).comp continuous_real_toNNReal.measurable) + hb hbound hL hresponse hsol' i (t : ℝ) t.2 + simpa only [decodePath, extendInput_coe] using heq + +end Problem336.Picard.NonnegativeTime + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardSamplerLaw.lean b/lean/OAI/Probability/SpanningForest/PicardSamplerLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f2e804f03d74680dbeb5d71cd66ad1688f9d76f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardSamplerLaw.lean @@ -0,0 +1,168 @@ +import OAI.Probability.SpanningForest.PicardUniqueness +import OAI.Probability.SpanningForest.BitRecovery + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology NNReal + +namespace Problem336.PicardSampler + +def decodedIntegers {I W : Type*} (w : W → I → ℝ → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (q : W) : I → ℕ → ℝ := + fun i n => Picard.decode (w q) b i n + +def sample {I W : Type*} (w : W → I → ℝ → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (q : W) : I → Bool := + configurationReadout (decodedIntegers w b q) + +lemma sample_apply_unshifted {I W : Type*} + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) (q : W) (i : I) : + sample w b q i = + if (1 / 2 : ℝ) < limsup + (fun n : ℕ => Picard.decode (w q) b i n / (n : ℝ)) atTop + then true else false := by + have hshift := Filter.limsup_nat_add + (fun n : ℕ => Picard.decode (w q) b i n / (n : ℝ)) 1 + simpa only [sample, configurationReadout, decodedIntegers, slopeReadout, + Nat.cast_add, Nat.cast_one] using + congrArg (fun r : ℝ => if (1 / 2 : ℝ) < r then true else false) hshift + +lemma measurable_decodedIntegers {I W : Type*} [MeasurableSpace W] + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) : + Measurable (decodedIntegers w b) := by + apply Measurable.of_eval + intro i + apply Measurable.of_eval + intro n + have hd := Picard.measurable_decode w (fun _ => b) hw + (fun i => (hb i).comp measurable_snd) i + exact hd.comp (measurable_id.prodMk measurable_const) + +lemma measurable_sample {I W : Type*} [MeasurableSpace W] + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) : + Measurable (sample w b) := + measurable_configurationReadout.comp (measurable_decodedIntegers w b hw hb) + +theorem hasLaw_of_slope_coupling + {I Ω W Ω' : Type*} + [MeasurableSpace Ω] [MeasurableSpace W] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} {ρ : Measure W} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {innovation : Ω → W} (hinnovation : HasLaw innovation ρ P) + {fresh : Ω' → W} (hfresh : HasLaw fresh ρ P') + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y y' D, 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b t y i - b t y' i| ≤ L * D) + (Y : Ω → I → ℝ → ℝ) + (hpaths : ∀ᵐ ω ∂P, (∀ i, Continuous (w (innovation ω) i)) ∧ + (∀ i, Measurable (Y ω i))) + (heq : ∀ᵐ ω ∂P, ∀ t, 0 ≤ t → ∀ i, + Y ω i t = w (innovation ω) i t + + ∫ s in (0 : ℝ)..t, b s (fun j => Y ω j s) i) + (hslopes : ∀ᵐ ω ∂P, ∀ i, + Tendsto (fun n : ℕ => Y ω i (n + 1 : ℕ) / (n + 1 : ℝ)) atTop + (𝓝 (bitValue (X ω i)))) : + HasLaw (fun ω => sample w b (fresh ω)) ν P' := by + have href : HasLaw (fun ω => sample w b (innovation ω)) ν P := by + apply hX.congr + filter_upwards [hpaths, heq, hslopes] with ω hp he hs + funext i + have hinv := Picard.decode_eq_solution (w (innovation ω)) (Y ω) b hp.1 hp.2 + hb hbound hL hresponse he + change slopeReadout (fun n : ℕ => Picard.decode (w (innovation ω)) b i n) = X ω i + have hseq : (fun n : ℕ => Picard.decode (w (innovation ω)) b i n) = + (fun n : ℕ => Y ω i n) := by + funext n + exact hinv i n (Nat.cast_nonneg n) + rw [hseq] + exact slopeReadout_of_tendsto (hs i) + exact HasLaw.comp_of_hasLaw_comp (f := sample w b) + (measurable_sample w b hw hb).aemeasurable hinnovation hfresh href + +theorem hasLaw_of_integral_coupling + {I Ω W Ω' : Type*} [Countable I] + [MeasurableSpace Ω] [MeasurableSpace W] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} {ρ : Measure W} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsPreBrownianReal (B i) P) + {innovation : Ω → W} (hinnovation : HasLaw innovation ρ P) + {fresh : Ω' → W} (hfresh : HasLaw fresh ρ P') + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ => w p.1 i p.2)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y y' D, 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b t y i - b t y' i| ≤ L * D) + (Y : Ω → I → ℝ → ℝ) + (hpaths : ∀ᵐ ω ∂P, (∀ i, Continuous (w (innovation ω) i)) ∧ + (∀ i, Measurable (Y ω i))) + (heq : ∀ᵐ ω ∂P, ∀ t, 0 ≤ t → ∀ i, + Y ω i t = w (innovation ω) i t + + ∫ s in (0 : ℝ)..t, b s (fun j => Y ω j s) i) + (hobs : ∀ᵐ ω ∂P, ∀ i (n : ℕ), + Y ω i n = (n : ℝ) * bitValue (X ω i) + B i (n : ℝ≥0) ω) : + HasLaw (fun ω => sample w b (fresh ω)) ν P' := by + apply sampler_hasLaw_of_brownian_inversion hX hB hinnovation hfresh + (measurable_decodedIntegers w b hw hb) + filter_upwards [hpaths, heq, hobs] with ω hp he ho + funext i n + exact (Picard.decode_eq_solution (w (innovation ω)) (Y ω) b hp.1 hp.2 + hb hbound hL hresponse he i n (Nat.cast_nonneg n)).trans (ho i n) + +def observation {I Ω : Type*} (X : Ω → I → Bool) + (B : I → ℝ≥0 → Ω → ℝ) (ω : Ω) (i : I) (t : ℝ) : ℝ := + t * bitValue (X ω i) + B i (Real.toNNReal t) ω + +theorem hasLaw_of_brownian_innovation + {I Ω W Ω' : Type*} [Countable I] + [MeasurableSpace Ω] [MeasurableSpace W] [MeasurableSpace Ω'] + {P : Measure Ω} {P' : Measure Ω'} {ρ : Measure W} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsBrownianReal (B i) P) + {innovation : Ω → W} (hinnovation : HasLaw innovation ρ P) + {fresh : Ω' → W} (hfresh : HasLaw fresh ρ P') + (w : W → I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Measurable (fun p : W × ℝ => w p.1 i p.2)) + (hwcont : ∀ᵐ ω ∂P, ∀ i, Continuous (w (innovation ω) i)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y y' D, 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b t y i - b t y' i| ≤ L * D) + (hinnovation_eq : ∀ᵐ ω ∂P, ∀ t, 0 ≤ t → ∀ i, + w (innovation ω) i t = observation X B ω i t - + ∫ s in (0 : ℝ)..t, b s (fun j => observation X B ω j s) i) : + HasLaw (fun ω => sample w b (fresh ω)) ν P' := by + apply hasLaw_of_integral_coupling hX (fun i => (hB i).toIsPreBrownianReal) + hinnovation hfresh w b hw hb hbound hL hresponse (observation X B) + · have hcont : ∀ᵐ ω ∂P, ∀ i, Continuous (fun t => B i t ω) := + ae_all_iff.mpr (fun i => (hB i).cont) + filter_upwards [hwcont, hcont] with ω hwω hBω + refine ⟨hwω, fun i => ?_⟩ + exact ((continuous_id.mul continuous_const).add + ((hBω i).comp continuous_real_toNNReal)).measurable + · filter_upwards [hinnovation_eq] with ω hω + intro t ht i + have h := hω t ht i + linarith + · apply Eventually.of_forall + intro ω i n + simp only [observation, Real.toNNReal_natCast] + +end Problem336.PicardSampler + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardSolution.lean b/lean/OAI/Probability/SpanningForest/PicardSolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..08c41502d8c06e705eb8e79e2f1d4e2afc1b3679 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardSolution.lean @@ -0,0 +1,101 @@ +import OAI.Probability.SpanningForest.Picard +import OAI.Probability.SpanningForest.PicardBounds + +namespace OAI + +noncomputable section + +open Filter MeasureTheory Set +open scoped Topology + +namespace Problem336.Picard + +variable {ι : Type*} + +lemma majorant_mono_time {L s t : ℝ} (hL : 0 ≤ L) (hs : 0 ≤ s) (hst : s ≤ t) + (n : ℕ) : majorant L s n ≤ majorant L t n := by + unfold majorant + gcongr + +variable (w : ι → ℝ → ℝ) (b : ℝ → (ι → ℝ) → ι → ℝ) + (hw : ∀ i, Continuous (w i)) + (hb : ∀ i, Measurable (fun p : ℝ × (ι → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ (s : ℝ) (y y' : ι → ℝ) (D : ℝ), + 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b s y i - b s y' i| ≤ L * D) + +include hw hb hbound hL hresponse + +lemma uniformly_iterate_decode {T : ℝ} (hT : 0 ≤ T) : + TendstoUniformly + (fun n (p : ι × Icc (0 : ℝ) T) => iterate w b n p.1 p.2) + (fun p => decode w b p.1 p.2) atTop ∧ + ∀ n (p : ι × Icc (0 : ℝ) T), + dist (iterate w b n p.1 p.2) (decode w b p.1 p.2) ≤ + ∑' k, majorant L T (n + k) := by + obtain ⟨z, hz, herror⟩ := + DeterministicDecoder.exists_uniform_limit_of_picard_increments + (fun n (p : ι × Icc (0 : ℝ) T) => iterate w b n p.1 p.2) hL hT + (fun n p => by + have hinc := iterate_increment_le w b hw hb hbound hL hresponse n p.1 p.2 p.2.2.1 + have hmono := majorant_mono_time hL p.2.2.1 p.2.2.2 n + simpa only [Real.dist_eq, abs_sub_comm, majorant, + DeterministicDecoder.picardBound] using hinc.trans hmono) + have heq : z = fun p => decode w b p.1 p.2 := by + funext p + exact (hz.tendsto_at p).limUnder_eq.symm + subst z + exact ⟨hz, herror⟩ + +lemma tendsto_iterate_decode (i : ι) {t : ℝ} (ht : 0 ≤ t) : + Tendsto (fun n => iterate w b n i t) atTop (𝓝 (decode w b i t)) := by + exact (uniformly_iterate_decode w b hw hb hbound hL hresponse ht).1.tendsto_at + (i, ⟨t, ht, le_rfl⟩) + +lemma continuous_decode_compact (i : ι) {T : ℝ} (hT : 0 ≤ T) : + Continuous (fun t : Icc (0 : ℝ) T => decode w b i t) := by + have hu := (uniformly_iterate_decode w b hw hb hbound hL hresponse hT).1 + exact (hu.comp (fun t => (i, t))).continuous + (Filter.Eventually.of_forall (fun n => + (continuous_iterate w b hw hb hbound n i).comp continuous_subtype_val)).frequently + +lemma decode_integral_equation (i : ι) {t : ℝ} (ht : 0 ≤ t) : + decode w b i t = w i t + + ∫ s in (0 : ℝ)..t, b s (fun j => decode w b j s) i := by + apply DeterministicDecoder.integral_equation_at_of_uniform_limit + b w (iterate w b) (decode w b) hL ht + · intro s x y D hD hxy j + exact hresponse s x y D hD hxy j + · exact hbound + · exact measurable_drift_iterate w b hw hb hbound + · exact (uniformly_iterate_decode w b hw hb hbound hL hresponse ht).1 + · intro n j + rfl + +omit hL hresponse in +lemma measurable_decode_time (i : ι) : Measurable (decode w b i) := by + exact (StronglyMeasurable.limUnder (l := atTop) + (fun n => (continuous_iterate w b hw hb hbound n i).measurable.stronglyMeasurable)).measurable + +omit hL hresponse in +lemma measurable_drift_decode (i : ι) : + Measurable (fun s => b s (fun j => decode w b j s) i) := by + exact (hb i).comp (measurable_id.prodMk (Measurable.of_eval (fun j => measurable_decode_time w b hw hb hbound j))) + +lemma continuousOn_decode (i : ι) : ContinuousOn (decode w b i) (Ici 0) := by + have hc : Continuous (fun t => w i t + + ∫ s in (0 : ℝ)..t, b s (fun j => decode w b j s) i) := by + exact (hw i).add (intervalIntegral.continuous_primitive + (intervalIntegrable_of_measurable_bounded + (measurable_drift_decode w b hw hb hbound i) (fun s => hbound s _ i)) 0) + apply hc.continuousOn.congr + intro t ht + exact decode_integral_equation w b hw hb hbound hL hresponse i ht + +end Problem336.Picard + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PicardUniqueness.lean b/lean/OAI/Probability/SpanningForest/PicardUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..2139bbc7b6c5470f7222d4829145945cbc072fec --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PicardUniqueness.lean @@ -0,0 +1,149 @@ +import OAI.Probability.SpanningForest.PicardBounds +import OAI.Probability.SpanningForest.Picard + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped Topology + +namespace Problem336.DeterministicDecoder + +@[simp] theorem picardBound_zero (L t : ℝ) : picardBound L t 0 = t := by + simp [picardBound] + +theorem integral_picardBound (L t : ℝ) (n : ℕ) : + (∫ s in (0 : ℝ)..t, L * picardBound L s n) = picardBound L t (n + 1) := by + exact Picard.integral_majorant L t n + +def BoundedDifferenceResponse {I : Type*} + (b : ℝ → (I → ℝ) → I → ℝ) (L : ℝ) : Prop := + ∀ t, 0 ≤ t → ∀ y y' : I → ℝ, ∀ d : ℝ, 0 ≤ d → + (∀ i, |y i - y' i| ≤ d) → ∀ i, |b t y i - b t y' i| ≤ L * d + +theorem solution_picard_bound {I : Type*} (L : ℝ) (hL : 0 ≤ L) + (b : ℝ → (I → ℝ) → I → ℝ) (z : ℕ → ℝ → I → ℝ) + (x : ℝ → I → ℝ) + (hb : ∀ t, 0 ≤ t → ∀ y i, |b t y i| ≤ 1) + (hlip : BoundedDifferenceResponse b L) + (hint : ∀ n t, 0 ≤ t → ∀ i, + IntervalIntegrable (fun s => b s (z n s) i) volume 0 t) + (hxint : ∀ t, 0 ≤ t → ∀ i, + IntervalIntegrable (fun s => b s (x s) i) volume 0 t) + (hstep : ∀ n t i, + z (n + 1) t i = z 0 t i + ∫ s in (0 : ℝ)..t, b s (z n s) i) + (hsol : ∀ t, 0 ≤ t → ∀ i, + x t i = z 0 t i + ∫ s in (0 : ℝ)..t, b s (x s) i) : + ∀ n t, 0 ≤ t → ∀ i, + |x t i - z n t i| ≤ picardBound L t n := by + intro n + induction n with + | zero => + intro t ht i + rw [hsol t ht, add_sub_cancel_left, picardBound_zero, ← Real.norm_eq_abs] + have h := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0 : ℝ)) (b := t) (C := (1 : ℝ)) + (f := fun s => b s (x s) i) (fun s hs => by + rw [uIoc_of_le ht] at hs + exact (Real.norm_eq_abs _).le.trans (hb s hs.1.le _ i)) + simpa only [sub_zero, abs_of_nonneg ht, one_mul] using h + | succ n ih => + intro t ht i + rw [hsol t ht, hstep n, add_sub_add_left_eq_sub, + ← intervalIntegral.integral_sub (hxint t ht i) (hint n t ht i), + ← Real.norm_eq_abs] + calc + ‖∫ s in (0 : ℝ)..t, b s (x s) i - b s (z n s) i‖ + ≤ ∫ s in (0 : ℝ)..t, L * picardBound L s n := by + apply intervalIntegral.norm_integral_le_of_norm_le ht + · apply Filter.Eventually.of_forall + intro s hs + rw [Real.norm_eq_abs] + exact hlip s hs.1.le _ _ _ (picardBound_nonneg hL hs.1.le n) + (ih s hs.1.le) i + · exact (show Continuous (fun s => L * picardBound L s n) by + unfold picardBound + fun_prop).intervalIntegrable _ _ + _ = picardBound L t (n + 1) := integral_picardBound L t n + +theorem integral_solution_unique {I : Type*} (L : ℝ) (hL : 0 ≤ L) + (b : ℝ → (I → ℝ) → I → ℝ) (z : ℕ → ℝ → I → ℝ) + (x y : ℝ → I → ℝ) + (hb : ∀ t, 0 ≤ t → ∀ u i, |b t u i| ≤ 1) + (hlip : BoundedDifferenceResponse b L) + (hint : ∀ n t, 0 ≤ t → ∀ i, + IntervalIntegrable (fun s => b s (z n s) i) volume 0 t) + (hxint : ∀ t, 0 ≤ t → ∀ i, + IntervalIntegrable (fun s => b s (x s) i) volume 0 t) + (hyint : ∀ t, 0 ≤ t → ∀ i, + IntervalIntegrable (fun s => b s (y s) i) volume 0 t) + (hstep : ∀ n t i, + z (n + 1) t i = z 0 t i + ∫ s in (0 : ℝ)..t, b s (z n s) i) + (hx : ∀ t, 0 ≤ t → ∀ i, + x t i = z 0 t i + ∫ s in (0 : ℝ)..t, b s (x s) i) + (hy : ∀ t, 0 ≤ t → ∀ i, + y t i = z 0 t i + ∫ s in (0 : ℝ)..t, b s (y s) i) : + ∀ t, 0 ≤ t → x t = y t := by + intro t ht + apply unique_of_picard_approximation (fun n => z n t) (x t) (y t) hL ht + · intro n i + exact solution_picard_bound L hL b z x hb hlip hint hxint hstep hx n t ht i + · intro n i + exact solution_picard_bound L hL b z y hb hlip hint hyint hstep hy n t ht i + +end Problem336.DeterministicDecoder + +namespace Problem336.Picard + +theorem solution_iterate_bound {I : Type*} + (w x : I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Continuous (w i)) (hx : ∀ i, Measurable (x i)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ (s : ℝ) (y y' : I → ℝ) (D : ℝ), + 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b s y i - b s y' i| ≤ L * D) + (hsol : ∀ t, 0 ≤ t → ∀ i, + x i t = w i t + ∫ s in (0 : ℝ)..t, b s (fun j => x j s) i) : + ∀ n i t, 0 ≤ t → + |x i t - iterate w b n i t| ≤ majorant L t n := by + have hxi (t : ℝ) (i : I) : + IntervalIntegrable (fun s => b s (fun j => x j s) i) volume 0 t := by + apply intervalIntegrable_of_measurable_bounded + · exact (hb i).comp (measurable_id.prodMk (Measurable.of_eval hx)) + · exact fun s => hbound s _ i + have h := DeterministicDecoder.solution_picard_bound L hL b + (fun n t i => iterate w b n i t) (fun t i => x i t) + (fun t _ y i => hbound t y i) + (fun t _ y y' D hD hdiff i => hresponse t y y' D hD hdiff i) + (fun n t _ i => intervalIntegrable_drift_iterate w b hw hb hbound n i 0 t) + (fun t _ i => hxi t i) (fun _ _ _ => rfl) hsol + exact fun n i t ht => h n t ht i + +theorem decode_eq_solution {I : Type*} + (w x : I → ℝ → ℝ) (b : ℝ → (I → ℝ) → I → ℝ) + (hw : ∀ i, Continuous (w i)) (hx : ∀ i, Measurable (x i)) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ (s : ℝ) (y y' : I → ℝ) (D : ℝ), + 0 ≤ D → (∀ j, |y j - y' j| ≤ D) → + ∀ i, |b s y i - b s y' i| ≤ L * D) + (hsol : ∀ t, 0 ≤ t → ∀ i, + x i t = w i t + ∫ s in (0 : ℝ)..t, b s (fun j => x j s) i) : + ∀ i t, 0 ≤ t → decode w b i t = x i t := by + intro i t ht + apply Filter.Tendsto.limUnder_eq + rw [tendsto_iff_dist_tendsto_zero] + apply squeeze_zero (fun _ => dist_nonneg) + · intro n + simpa only [Real.dist_eq, abs_sub_comm] using + solution_iterate_bound w x b hw hx hb hbound hL hresponse hsol n i t ht + · exact DeterministicDecoder.tendsto_picardBound_zero hL ht + +end Problem336.Picard + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PolynomialGramUpdate.lean b/lean/OAI/Probability/SpanningForest/PolynomialGramUpdate.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f46233184f2876b8fe181ae064dd5ba2cff13f1 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PolynomialGramUpdate.lean @@ -0,0 +1,63 @@ +import OAI.Probability.SpanningForest.GramDeterminantUpdate + +namespace OAI + +noncomputable section + +open scoped Matrix + +namespace Problem336.Determinantal + +variable {ν κ : Type*} [Fintype ν] [DecidableEq ν] [Fintype κ] [DecidableEq κ] + +theorem map_nonsing_inv_of_isUnit {R S : Type*} [CommRing R] [CommRing S] + (φ : R →+* S) (L : Matrix ν ν R) (hL : IsUnit L.det) : + (L.map φ)⁻¹ = L⁻¹.map φ := by + apply Matrix.inv_eq_right_inv + rw [← Matrix.map_mul, Matrix.mul_nonsing_inv _ hL] + simp + +theorem det_polynomial_rank_update + (L : Matrix ν ν ℝ) (hL : IsUnit L.det) + (U : Matrix ν κ ℝ) (V : Matrix κ ν ℝ) : + (L.map Polynomial.C + (Polynomial.X : Polynomial ℝ) • (U * V).map Polynomial.C).det = + Polynomial.C L.det * + (1 + (Polynomial.X : Polynomial ℝ) • (V * L⁻¹ * U).map Polynomial.C).det := by + have hdet : (L.map Polynomial.C).det = Polynomial.C L.det := by + exact (Polynomial.C.map_det L).symm + have hLC : IsUnit (L.map Polynomial.C).det := by + rw [hdet] + exact hL.map (Polynomial.C : ℝ →+* Polynomial ℝ) + have h := Matrix.det_add_mul ((Polynomial.X : Polynomial ℝ) • U.map Polynomial.C) + (V.map Polynomial.C) hLC + rw [map_nonsing_inv_of_isUnit Polynomial.C L hL] at h + simpa only [Matrix.smul_mul, Matrix.mul_smul, ← Matrix.map_mul, + hdet] using h + +theorem det_polynomial_gram_update {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ν ι ℝ) (hA : IsUnit (A * A.transpose).det) (f : κ → ι) : + ((A * A.transpose).map Polynomial.C + (Polynomial.X : Polynomial ℝ) • + (A.submatrix id f * (A.submatrix id f).transpose).map Polynomial.C).det = + Polynomial.C (A * A.transpose).det * + (1 + (Polynomial.X : Polynomial ℝ) • ((transferKernel A).submatrix f f).map Polynomial.C).det := by + have h := det_polynomial_rank_update (A * A.transpose) hA + (A.submatrix id f) (A.submatrix id f).transpose + rw [transferKernel_submatrix] at h + exact h + +theorem det_polynomial_weighted_columns + (L : Matrix ν ν ℝ) (hL : IsUnit L.det) + (A : Matrix ν κ ℝ) (c : κ → ℝ) : + (L.map Polynomial.C + (Polynomial.X : Polynomial ℝ) • + (A * Matrix.diagonal c * A.transpose).map Polynomial.C).det = + Polynomial.C L.det * + (1 + (Polynomial.X : Polynomial ℝ) • + (Matrix.diagonal c * (A.transpose * L⁻¹ * A)).map Polynomial.C).det := by + simpa only [Matrix.mul_assoc] using + det_polynomial_rank_update L hL A (Matrix.diagonal c * A.transpose) + +end Problem336.Determinantal + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PosteriorDrift.lean b/lean/OAI/Probability/SpanningForest/PosteriorDrift.lean new file mode 100644 index 0000000000000000000000000000000000000000..c30116a2a1ff6a6294f22a4b5bdb8454343b53ad --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PosteriorDrift.lean @@ -0,0 +1,102 @@ +import OAI.Probability.SpanningForest.PosteriorTiltLimit +import OAI.Probability.SpanningForest.CanonicalDrift + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped Topology + +namespace Problem336.PosteriorDrift +open TiltLimit + +variable {I : Type*} [Countable I] + +def finiteStage (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (e : I) (n : ℕ) (p : ℝ × (I → ℝ)) : ℝ := + finiteTiltMean μ (S e n) (fun i => p.2 i - p.1 / 2) e + +def drift (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (t : ℝ) (y : I → ℝ) (e : I) : ℝ := + CanonicalDrift.outerLimit (finiteStage μ S e) (t, y) + +omit [Countable I] in +theorem measurable_drift_coordinate (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) (e : I) : + Measurable (fun p : ℝ × (I → ℝ) => drift μ S p.1 p.2 e) := + CanonicalDrift.measurable_outerLimit (fun n => measurable_finitePosterior μ (S e n) e) + +omit [Countable I] in +theorem measurable_drift (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) : + Measurable (fun p : ℝ × (I → ℝ) => drift μ S p.1 p.2) := + Measurable.of_eval (fun e => measurable_drift_coordinate μ S e) + +theorem drift_mem_Icc (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (t : ℝ) (y : I → ℝ) (e : I) : drift μ S t y e ∈ Set.Icc (0 : ℝ) 1 := + CanonicalDrift.outerLimit_mem_Icc (b := finiteStage μ S e) + (fun n (p : ℝ × (I → ℝ)) => + finiteTiltMean_mem_Icc μ (S e n) (fun i => p.2 i - p.1 / 2) e) (t, y) + +def FiniteResponseBound (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (L : ℝ) : Prop := + ∀ (e : I) (n : ℕ) (h h' : I → ℝ) (D : ℝ), 0 ≤ D → + (∀ i ∈ S e n, |h i - h' i| ≤ D) → + |finiteTiltMean μ (S e n) h e - finiteTiltMean μ (S e n) h' e| ≤ L * D + +theorem drift_response (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + {L : ℝ} (hresponse : FiniteResponseBound μ S L) + (t : ℝ) (y y' : I → ℝ) {D : ℝ} (hD : 0 ≤ D) + (hdiff : ∀ i, |y i - y' i| ≤ D) (e : I) : + |drift μ S t y e - drift μ S t y' e| ≤ L * D := by + apply CanonicalDrift.abs_outerLimit_sub_le (b := finiteStage μ S e) + (fun n (p : ℝ × (I → ℝ)) => + finiteTiltMean_mem_Icc μ (S e n) (fun i => p.2 i - p.1 / 2) e) + intro n + apply hresponse e n _ _ D hD + intro i hi + simpa only [sub_sub_sub_cancel_right] using hdiff i + +theorem finiteResponseBound_of_tendsto + {J : Type*} {l : Filter J} [l.NeBot] + {μs : J → ProbabilityMeasure (I → Bool)} {μ : ProbabilityMeasure (I → Bool)} + (hμ : Tendsto μs l (𝓝 μ)) (S : I → ℕ → Finset I) {L : ℝ} + (hb : ∀ᶠ j in l, FiniteResponseBound (μs j) S L) : FiniteResponseBound μ S L := by + intro e n h h' D hD hdiff + exact finiteTiltMean_response_bound_of_tendsto hμ (S e n) h h' e + (hb.mono (fun j hj => hj e n h h' D hD hdiff)) + +theorem measurable_drift_evaluation [MeasurableSpace I] [MeasurableSingletonClass I] + (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) : + Measurable (fun p : (ℝ × (I → ℝ)) × I => drift μ S p.1.1 p.1.2 p.2) := + measurable_from_prod_countable_left (fun e => measurable_drift_coordinate μ S e) + +omit [Countable I] in + +theorem drift_reindex {J : Type*} [Countable J] (σ : I ≃ J) + (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (S' : J → ℕ → Finset J) + (hS : ∀ e n, S' (σ e) n = (S e n).map σ.toEmbedding) + (t : ℝ) (y : I → ℝ) (e : I) : + drift (μ.map (reindex σ)) S' + t (fun j => y (σ.symm j)) (σ e) = drift μ S t y e := by + unfold drift CanonicalDrift.outerLimit + apply limsup_congr + apply Eventually.of_forall + intro n + dsimp only [finiteStage] + rw [hS e n] + exact finiteTiltMean_reindex σ μ (S e n) (fun i => y i - t / 2) e + +omit [Countable I] in + +theorem drift_eq_of_tendsto (μ : ProbabilityMeasure (I → Bool)) + (S : I → ℕ → Finset I) (t : ℝ) (y : I → ℝ) (e : I) {a : ℝ} + (h : Tendsto (fun n => finiteTiltMean μ (S e n) (fun i => y i - t / 2) e) + atTop (𝓝 a)) : drift μ S t y e = a := + h.limsup_eq + +end Problem336.PosteriorDrift + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PosteriorIndependentExtension.lean b/lean/OAI/Probability/SpanningForest/PosteriorIndependentExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..d506a523836de0b4193be83ee05c16fc21d4d9a5 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PosteriorIndependentExtension.lean @@ -0,0 +1,154 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory +open scoped MeasureTheory ProbabilityTheory + +namespace Problem336.Observation + +private def fieldRectangles {Ω : Type*} (m n : MeasurableSpace Ω) : Set (Set Ω) := + {s | ∃ a b, MeasurableSet[m] a ∧ MeasurableSet[n] b ∧ a ∩ b = s} + +private theorem fieldRectangles_pi {Ω : Type*} (m n : MeasurableSpace Ω) : + IsPiSystem (fieldRectangles m n) := by + rintro s ⟨a, b, ha, hb, rfl⟩ t ⟨c, d, hc, hd, rfl⟩ _ + refine ⟨a ∩ c, b ∩ d, ha.inter hc, hb.inter hd, ?_⟩ + ext x + simp only [Set.mem_inter_iff] + tauto + +private theorem generateFrom_fieldRectangles {Ω : Type*} (m n : MeasurableSpace Ω) : + m ⊔ n = MeasurableSpace.generateFrom (fieldRectangles m n) := by + apply le_antisymm + · refine sup_le ?_ ?_ + · intro s hs + exact MeasurableSpace.measurableSet_generateFrom + ⟨s, Set.univ, hs, MeasurableSet.univ, Set.inter_univ s⟩ + · intro s hs + exact MeasurableSpace.measurableSet_generateFrom + ⟨Set.univ, s, MeasurableSet.univ, hs, Set.univ_inter s⟩ + · apply MeasurableSpace.generateFrom_le + rintro s ⟨a, b, ha, hb, rfl⟩ + exact (show MeasurableSet[m ⊔ n] a from (show m ≤ m ⊔ n from le_sup_left) a ha).inter + (show MeasurableSet[m ⊔ n] b from (show n ≤ m ⊔ n from le_sup_right) b hb) + +theorem setIntegral_eq_on_sup_of_rectangles + {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) + {m n : MeasurableSpace Ω} (hm : m ≤ mΩ) (hn : n ≤ mΩ) + {f g : Ω → ℝ} (hf : Integrable f P) (hg : Integrable g P) + (heq : ∀ a b, MeasurableSet[m] a → MeasurableSet[n] b → + ∫ ω in a ∩ b, f ω ∂P = ∫ ω in a ∩ b, g ω ∂P) : + ∀ s, MeasurableSet[m ⊔ n] s → + ∫ ω in s, f ω ∂P = ∫ ω in s, g ω ∂P := by + have hmn : m ⊔ n ≤ mΩ := sup_le hm hn + have huniv : ∫ ω, f ω ∂P = ∫ ω, g ω ∂P := by + simpa using heq Set.univ Set.univ MeasurableSet.univ MeasurableSet.univ + refine MeasurableSpace.induction_on_inter + (generateFrom_fieldRectangles m n) (fieldRectangles_pi m n) (by simp) ?_ ?_ ?_ + · rintro s ⟨a, b, ha, hb, rfl⟩ + exact heq a b ha hb + · intro s hs ih + rw [setIntegral_compl (hmn s hs) hf, setIntegral_compl (hmn s hs) hg, huniv, ih] + · intro s hd hs ih + rw [integral_iUnion (fun i => hmn _ (hs i)) hd hf.integrableOn, + integral_iUnion (fun i => hmn _ (hs i)) hd hg.integrableOn] + exact tsum_congr ih + +theorem setIntegral_of_independent_field + {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) [IsFiniteMeasure P] + {m n : MeasurableSpace Ω} (hm : m ≤ mΩ) (hn : n ≤ mΩ) + {f : Ω → ℝ} (hf : StronglyMeasurable[m] f) (hfi : Integrable f P) + (hindep : Indep m n P) {s : Set Ω} (hs : MeasurableSet[n] s) : + ∫ ω in s, f ω ∂P = P.real s * ∫ ω, f ω ∂P := by + calc + _ = ∫ ω in s, (P[f | n]) ω ∂P := (setIntegral_condExp hn hfi hs).symm + _ = ∫ _ in s, (∫ ω, f ω ∂P) ∂P := + integral_congr_ae (ae_restrict_of_ae (condExp_indep_eq hm hn hf hindep)) + _ = _ := by simp [smul_eq_mul] + +theorem condExp_sup_independent + {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) [IsFiniteMeasure P] + {hidden observed auxiliary : MeasurableSpace Ω} + (hhidden : hidden ≤ mΩ) (hauxiliary : auxiliary ≤ mΩ) + (hobserved : observed ≤ hidden) {X : Ω → ℝ} + (hX : StronglyMeasurable[hidden] X) (hXi : Integrable X P) + (hindep : Indep hidden auxiliary P) : + P[X | observed ⊔ auxiliary] =ᵐ[P] P[X | observed] := by + have ho : observed ≤ mΩ := hobserved.trans hhidden + have hoa : observed ⊔ auxiliary ≤ mΩ := sup_le ho hauxiliary + have hC : StronglyMeasurable[hidden] (P[X | observed]) := + stronglyMeasurable_condExp.mono hobserved + apply Filter.EventuallyEq.symm + apply ae_eq_condExp_of_forall_setIntegral_eq hoa hXi + (fun _ _ _ => integrable_condExp.integrableOn) + · intro s hs _ + apply setIntegral_eq_on_sup_of_rectangles P ho hauxiliary + integrable_condExp hXi _ s hs + intro a b ha hb + have hca := setIntegral_of_independent_field P hhidden hauxiliary + (hC.indicator (hobserved a ha)) + (integrable_condExp.indicator (ho a ha)) hindep hb + have hxa := setIntegral_of_independent_field P hhidden hauxiliary + (hX.indicator (hobserved a ha)) (hXi.indicator (ho a ha)) hindep hb + rw [setIntegral_indicator (ho a ha), integral_indicator (ho a ha), + Set.inter_comm b a] at hca hxa + rw [hca, hxa, setIntegral_condExp ho hXi ha] + · exact (stronglyMeasurable_condExp.mono le_sup_left).aestronglyMeasurable + +theorem condExp_pair_of_indep + {Ω Θ Y V : Type*} {mΩ : MeasurableSpace Ω} + [mΘ : MeasurableSpace Θ] [mY : MeasurableSpace Y] [mV : MeasurableSpace V] + (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Z : Ω → Y) (W : Ω → V) + (hX : Measurable X) (hZ : Measurable Z) (hW : Measurable W) + (g : Θ → ℝ) (hg : Measurable g) (hgi : Integrable (fun ω => g (X ω)) P) + (hindep : IndepFun (fun ω => (X ω, Z ω)) W P) : + P[fun ω => g (X ω) | (mY.prod mV).comap (fun ω => (Z ω, W ω))] =ᵐ[P] + P[fun ω => g (X ω) | mY.comap Z] := by + have hobs : mY.comap Z ≤ (mΘ.prod mY).comap (fun ω => (X ω, Z ω)) := by + rw [MeasurableSpace.comap_prodMk] + exact le_sup_right + have hgs : StronglyMeasurable[(mΘ.prod mY).comap (fun ω => (X ω, Z ω))] + (fun ω => g (X ω)) := + ((hg.comp measurable_fst).comp (comap_measurable _)).stronglyMeasurable + have h := condExp_sup_independent P (hX.prodMk hZ).comap_le hW.comap_le + hobs hgs hgi hindep + simpa only [MeasurableSpace.comap_prodMk] using h + +theorem comap_eq_of_mutual_reconstruction + {Ω A B : Type*} [mA : MeasurableSpace A] [mB : MeasurableSpace B] + (f : Ω → A) (g : Ω → B) (forward : A → B) (backward : B → A) + (hf : Measurable forward) (hb : Measurable backward) + (hforward : g = forward ∘ f) (hbackward : f = backward ∘ g) : + mA.comap f = mB.comap g := by + exact le_antisymm + (MeasurableSpace.comap_le_comap_of_eq_comp backward hb hbackward) + (MeasurableSpace.comap_le_comap_of_eq_comp forward hf hforward) + +theorem condExp_reconstructed_observation + {Ω Θ Y V H : Type*} {mΩ : MeasurableSpace Ω} + [mΘ : MeasurableSpace Θ] [mY : MeasurableSpace Y] + [mV : MeasurableSpace V] [mH : MeasurableSpace H] + (P : Measure Ω) [IsFiniteMeasure P] + (X : Ω → Θ) (Z : Ω → Y) (W : Ω → V) (history : Ω → H) + (hX : Measurable X) (hZ : Measurable Z) (hW : Measurable W) + (decompose : H → Y × V) (reconstruct : Y × V → H) + (hdecompose : Measurable decompose) (hreconstruct : Measurable reconstruct) + (hparts : (fun ω => (Z ω, W ω)) = decompose ∘ history) + (hhistory : history = reconstruct ∘ (fun ω => (Z ω, W ω))) + (g : Θ → ℝ) (hg : Measurable g) (hgi : Integrable (fun ω => g (X ω)) P) + (hindep : IndepFun (fun ω => (X ω, Z ω)) W P) : + P[fun ω => g (X ω) | mH.comap history] =ᵐ[P] + P[fun ω => g (X ω) | mY.comap Z] := by + rw [comap_eq_of_mutual_reconstruction history (fun ω => (Z ω, W ω)) + decompose reconstruct hdecompose hreconstruct hparts hhistory] + exact condExp_pair_of_indep P X Z W hX hZ hW g hg hgi hindep + +end Problem336.Observation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PosteriorNullCoordinates.lean b/lean/OAI/Probability/SpanningForest/PosteriorNullCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..970f027e0af74b24d264779a269bbbfa9636494f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PosteriorNullCoordinates.lean @@ -0,0 +1,52 @@ +import OAI.Probability.SpanningForest.PosteriorTiltLimit + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Problem336.TiltLimit + +theorem finiteEnergy_eq_of_zero_extra {I : Type*} + {S T : Finset I} (hST : S ⊆ T) (h : I → ℝ) (x : I → Bool) + (hzero : ∀ i ∈ T, i ∉ S → x i = false) : + finiteEnergy S h x = finiteEnergy T h x := by + classical + apply Finset.sum_subset hST + intro i hi hiS + simp [hzero i hi hiS, bit] + +theorem finiteTiltMean_eq_of_zero_extra {I : Type*} + (ν : ProbabilityMeasure (I → Bool)) {S T : Finset I} (hST : S ⊆ T) + (hzero : ∀ᵐ x ∂(ν : Measure (I → Bool)), ∀ i ∈ T, i ∉ S → x i = false) + (h : I → ℝ) (e : I) : + finiteTiltMean ν S h e = finiteTiltMean ν T h e := by + have henergy : finiteEnergy S h =ᵐ[(ν : Measure (I → Bool))] finiteEnergy T h := + hzero.mono (fun x hx => finiteEnergy_eq_of_zero_extra hST h x hx) + unfold finiteTiltMean tiltedMean + congr 1 + · apply integral_congr_ae + filter_upwards [henergy] with x hx + rw [hx] + · apply integral_congr_ae + filter_upwards [henergy] with x hx + rw [hx] + +theorem limsup_finiteTiltMean_eq_of_zero_extra {I : Type*} + (ν : ProbabilityMeasure (I → Bool)) (S T : ℕ → Finset I) + (hST : ∀ n, S n ⊆ T n) + (hzero : ∀ n, ∀ᵐ x ∂(ν : Measure (I → Bool)), + ∀ i ∈ T n, i ∉ S n → x i = false) + (h : I → ℝ) (e : I) : + Filter.limsup (fun n => finiteTiltMean ν (S n) h e) Filter.atTop = + Filter.limsup (fun n => finiteTiltMean ν (T n) h e) Filter.atTop := by + apply Filter.limsup_congr + exact Filter.Eventually.of_forall + (fun n => finiteTiltMean_eq_of_zero_extra ν (hST n) (hzero n) h e) + +end Problem336.TiltLimit + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PosteriorSupport.lean b/lean/OAI/Probability/SpanningForest/PosteriorSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..22e71fd2aa9a8cf9879a778fb4a87760f4ae45ae --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PosteriorSupport.lean @@ -0,0 +1,118 @@ +import OAI.Probability.SpanningForest.PosteriorDrift + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Problem336.TiltLimit + +variable {Ω : Type*} [MeasurableSpace Ω] + +theorem tiltedMean_congr_ae (μ : ProbabilityMeasure Ω) + {h h' X X' : Ω → ℝ} + (hh : h =ᵐ[(μ : Measure Ω)] h') (hX : X =ᵐ[(μ : Measure Ω)] X') : + tiltedMean μ h X = tiltedMean μ h' X' := by + unfold tiltedMean + congr 1 + · apply integral_congr_ae + filter_upwards [hh, hX] with x hx hXx + rw [hx, hXx] + · apply integral_congr_ae + filter_upwards [hh] with x hx + rw [hx] + +variable {I : Type*} + +theorem finiteTiltMean_eq_zero_of_ae_absent + (μ : ProbabilityMeasure (I → Bool)) (S : Finset I) (h : I → ℝ) (e : I) + (he : ∀ᵐ x ∂(μ : Measure (I → Bool)), x e = false) : + finiteTiltMean μ S h e = 0 := by + unfold finiteTiltMean tiltedMean + have hn : (∫ x, bit (x e) * Real.exp (finiteEnergy S h x) + ∂(μ : Measure (I → Bool))) = 0 := by + calc + _ = ∫ _x, (0 : ℝ) ∂(μ : Measure (I → Bool)) := by + apply integral_congr_ae + filter_upwards [he] with x hx + simp [hx, bit] + _ = 0 := integral_zero _ _ + rw [hn, zero_div] + +theorem finiteEnergy_congr_on_support + (μ : ProbabilityMeasure (I → Bool)) (active : I → Prop) + (hμ : ∀ᵐ x ∂(μ : Measure (I → Bool)), ∀ i, ¬ active i → x i = false) + (S : Finset I) {h h' : I → ℝ} (hh : ∀ i, active i → h i = h' i) : + finiteEnergy S h =ᵐ[(μ : Measure (I → Bool))] finiteEnergy S h' := by + filter_upwards [hμ] with x hx + apply Finset.sum_congr rfl + intro i hi + by_cases ha : active i + · rw [hh i ha] + · simp [hx i ha, bit] + +theorem finiteTiltMean_congr_on_support + (μ : ProbabilityMeasure (I → Bool)) (active : I → Prop) + (hμ : ∀ᵐ x ∂(μ : Measure (I → Bool)), ∀ i, ¬ active i → x i = false) + (S : Finset I) {h h' : I → ℝ} (hh : ∀ i, active i → h i = h' i) (e : I) : + finiteTiltMean μ S h e = finiteTiltMean μ S h' e := + tiltedMean_congr_ae μ (finiteEnergy_congr_on_support μ active hμ S hh) + (Filter.Eventually.of_forall fun _ => rfl) + +theorem limsup_finiteTiltMean_eq_zero_of_ae_absent + (μ : ProbabilityMeasure (I → Bool)) (S : ℕ → Finset I) + (h : ℕ → I → ℝ) (e : I) + (he : ∀ᵐ x ∂(μ : Measure (I → Bool)), x e = false) : + Filter.limsup (fun n => finiteTiltMean μ (S n) (h n) e) Filter.atTop = 0 := by + simp only [finiteTiltMean_eq_zero_of_ae_absent μ _ _ e he] + exact Filter.limsup_const (f := (Filter.atTop : Filter ℕ)) (b := (0 : ℝ)) + +theorem limsup_finiteTiltMean_congr_on_support + (μ : ProbabilityMeasure (I → Bool)) (active : I → Prop) + (hμ : ∀ᵐ x ∂(μ : Measure (I → Bool)), ∀ i, ¬ active i → x i = false) + (S : ℕ → Finset I) {h h' : ℕ → I → ℝ} + (hh : ∀ n i, active i → h n i = h' n i) (e : I) : + Filter.limsup (fun n => finiteTiltMean μ (S n) (h n) e) Filter.atTop = + Filter.limsup (fun n => finiteTiltMean μ (S n) (h' n) e) Filter.atTop := by + congr 1 + funext n + exact finiteTiltMean_congr_on_support μ active hμ (S n) (hh n) e + +end Problem336.TiltLimit + +namespace Problem336.PosteriorDrift +open TiltLimit + +variable {I : Type*} + +theorem drift_eq_zero_of_ae_absent + (μ : ProbabilityMeasure (I → Bool)) (S : I → ℕ → Finset I) + (t : ℝ) (y : I → ℝ) (e : I) + (he : ∀ᵐ x ∂(μ : Measure (I → Bool)), x e = false) : + drift μ S t y e = 0 := + limsup_finiteTiltMean_eq_zero_of_ae_absent μ (S e) (fun _ i => y i - t / 2) e he + +theorem drift_congr_on_support + (μ : ProbabilityMeasure (I → Bool)) (active : I → Prop) + (hμ : ∀ᵐ x ∂(μ : Measure (I → Bool)), ∀ i, ¬ active i → x i = false) + (S : I → ℕ → Finset I) (t : ℝ) {y y' : I → ℝ} + (hy : ∀ i, active i → y i = y' i) (e : I) : + drift μ S t y e = drift μ S t y' e := by + apply limsup_finiteTiltMean_congr_on_support μ active hμ (S e) + intro n i hi + change y i - t / 2 = y' i - t / 2 + rw [hy i hi] + +theorem drift_eq_zero_off_support + (μ : ProbabilityMeasure (I → Bool)) (active : I → Prop) + (hμ : ∀ᵐ x ∂(μ : Measure (I → Bool)), ∀ i, ¬ active i → x i = false) + (S : I → ℕ → Finset I) (t : ℝ) (y : I → ℝ) (e : I) (he : ¬ active e) : + drift μ S t y e = 0 := + drift_eq_zero_of_ae_absent μ S t y e (hμ.mono fun _ hx => hx e he) + +end Problem336.PosteriorDrift + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/PosteriorTiltLimit.lean b/lean/OAI/Probability/SpanningForest/PosteriorTiltLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..25b754dc145ca9097014b9be8111b88e49daffc6 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/PosteriorTiltLimit.lean @@ -0,0 +1,185 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology + +namespace Problem336.TiltLimit + +variable {Ω : Type*} [MeasurableSpace Ω] [TopologicalSpace Ω] + [OpensMeasurableSpace Ω] + +def tiltedMean (μ : ProbabilityMeasure Ω) (h X : Ω → ℝ) : ℝ := + (∫ x, X x * Real.exp (h x) ∂(μ : Measure Ω)) / + (∫ x, Real.exp (h x) ∂(μ : Measure Ω)) + +theorem tendsto_integral_continuous [CompactSpace Ω] + {J : Type*} {l : Filter J} {μs : J → ProbabilityMeasure Ω} {μ : ProbabilityMeasure Ω} + (hμ : Tendsto μs l (𝓝 μ)) {f : Ω → ℝ} (hf : Continuous f) : + Tendsto (fun j => ∫ x, f x ∂(μs j : Measure Ω)) l + (𝓝 (∫ x, f x ∂(μ : Measure Ω))) := by + exact ProbabilityMeasure.tendsto_iff_forall_integral_tendsto.mp hμ + (BoundedContinuousFunction.mkOfCompact ⟨f, hf⟩) + +theorem integral_exp_pos [CompactSpace Ω] (μ : ProbabilityMeasure Ω) + {h : Ω → ℝ} (hh : Continuous h) : + 0 < ∫ x, Real.exp (h x) ∂(μ : Measure Ω) := by + apply MeasureTheory.integral_exp_pos + exact (BoundedContinuousFunction.mkOfCompact ⟨_, (Real.continuous_exp.comp hh)⟩).integrable _ + +theorem tendsto_tiltedMean [CompactSpace Ω] + {J : Type*} {l : Filter J} {μs : J → ProbabilityMeasure Ω} {μ : ProbabilityMeasure Ω} + (hμ : Tendsto μs l (𝓝 μ)) {h X : Ω → ℝ} (hh : Continuous h) (hX : Continuous X) : + Tendsto (fun j => tiltedMean (μs j) h X) l (𝓝 (tiltedMean μ h X)) := by + exact (tendsto_integral_continuous hμ (hX.mul (Real.continuous_exp.comp hh))).div + (tendsto_integral_continuous hμ (Real.continuous_exp.comp hh)) (ne_of_gt (integral_exp_pos μ hh)) + +theorem response_bound_of_tendsto [CompactSpace Ω] + {J : Type*} {l : Filter J} [l.NeBot] + {μs : J → ProbabilityMeasure Ω} {μ : ProbabilityMeasure Ω} + (hμ : Tendsto μs l (𝓝 μ)) {h h' X : Ω → ℝ} + (hh : Continuous h) (hh' : Continuous h') (hX : Continuous X) {C : ℝ} + (hbound : ∀ᶠ j in l, |tiltedMean (μs j) h X - tiltedMean (μs j) h' X| ≤ C) : + |tiltedMean μ h X - tiltedMean μ h' X| ≤ C := by + exact le_of_tendsto + ((tendsto_tiltedMean hμ hh hX).sub (tendsto_tiltedMean hμ hh' hX)).abs hbound + +omit [TopologicalSpace Ω] [OpensMeasurableSpace Ω] in + +theorem measurable_tiltedMean {A : Type*} [MeasurableSpace A] + (μ : ProbabilityMeasure Ω) (h X : A → Ω → ℝ) + (hh : Measurable (Function.uncurry h)) + (hX : Measurable (Function.uncurry X)) : + Measurable (fun a => tiltedMean μ (h a) (X a)) := by + exact ((hX.mul hh.exp).stronglyMeasurable.integral_prod_right).measurable.div + (hh.exp.stronglyMeasurable.integral_prod_right).measurable + +theorem tiltedMean_mem_Icc [CompactSpace Ω] (μ : ProbabilityMeasure Ω) + {h X : Ω → ℝ} (hh : Continuous h) (hX : Continuous X) + (hb : ∀ x, X x ∈ Set.Icc (0 : ℝ) 1) : + tiltedMean μ h X ∈ Set.Icc (0 : ℝ) 1 := by + have hd := integral_exp_pos μ hh + have hi : Integrable (fun x => Real.exp (h x)) (μ : Measure Ω) := + (BoundedContinuousFunction.mkOfCompact ⟨_, Real.continuous_exp.comp hh⟩).integrable _ + have hn : Integrable (fun x => X x * Real.exp (h x)) (μ : Measure Ω) := + (BoundedContinuousFunction.mkOfCompact ⟨_, hX.mul (Real.continuous_exp.comp hh)⟩).integrable _ + constructor + · exact div_nonneg (integral_nonneg (fun x => mul_nonneg (hb x).1 (Real.exp_pos _).le)) hd.le + · apply (div_le_one₀ hd).2 + exact integral_mono hn hi (fun x => mul_le_of_le_one_left (Real.exp_pos _).le (hb x).2) + +omit [TopologicalSpace Ω] [OpensMeasurableSpace Ω] in + +theorem tiltedMean_map {Ω' : Type*} [MeasurableSpace Ω'] + (μ : ProbabilityMeasure Ω) {f : Ω → Ω'} (hf : Measurable f) + {h X : Ω' → ℝ} (hh : Measurable h) (hX : Measurable X) : + tiltedMean (μ.map f) h X = + tiltedMean μ (fun x => h (f x)) (fun x => X (f x)) := by + change (∫ x, X x * Real.exp (h x) ∂Measure.map f (μ : Measure Ω)) / + (∫ x, Real.exp (h x) ∂Measure.map f (μ : Measure Ω)) = _ + unfold tiltedMean + congr 1 + · exact integral_map_of_stronglyMeasurable hf (hX.mul hh.exp).stronglyMeasurable + · exact integral_map_of_stronglyMeasurable hf hh.exp.stronglyMeasurable + +variable {I : Type*} + +def bit (b : Bool) : ℝ := if b then 1 else 0 + +theorem continuous_bit : Continuous bit := continuous_of_discreteTopology + +def finiteEnergy (S : Finset I) (h : I → ℝ) (x : I → Bool) : ℝ := + ∑ i ∈ S, h i * bit (x i) + +theorem continuous_finiteEnergy (S : Finset I) (h : I → ℝ) : + Continuous (finiteEnergy S h) := by + apply continuous_finsetSum + intro i hi + exact continuous_const.mul (continuous_bit.comp (continuous_apply i)) + +def finiteTiltMean (μ : ProbabilityMeasure (I → Bool)) (S : Finset I) (h : I → ℝ) (e : I) : ℝ := + tiltedMean μ (finiteEnergy S h) (fun x => bit (x e)) + +variable [Countable I] + +theorem tendsto_finiteTiltMean + {J : Type*} {l : Filter J} + {μs : J → ProbabilityMeasure (I → Bool)} {μ : ProbabilityMeasure (I → Bool)} + (hμ : Tendsto μs l (𝓝 μ)) (S : Finset I) (h : I → ℝ) (e : I) : + Tendsto (fun j => finiteTiltMean (μs j) S h e) l (𝓝 (finiteTiltMean μ S h e)) := + tendsto_tiltedMean hμ (continuous_finiteEnergy S h) + (continuous_bit.comp (continuous_apply e)) + +theorem finiteTiltMean_response_bound_of_tendsto + {J : Type*} {l : Filter J} [l.NeBot] + {μs : J → ProbabilityMeasure (I → Bool)} {μ : ProbabilityMeasure (I → Bool)} + (hμ : Tendsto μs l (𝓝 μ)) (S : Finset I) (h h' : I → ℝ) (e : I) {C : ℝ} + (hbound : ∀ᶠ j in l, + |finiteTiltMean (μs j) S h e - finiteTiltMean (μs j) S h' e| ≤ C) : + |finiteTiltMean μ S h e - finiteTiltMean μ S h' e| ≤ C := + response_bound_of_tendsto hμ (continuous_finiteEnergy S h) (continuous_finiteEnergy S h') + (continuous_bit.comp (continuous_apply e)) hbound + +theorem finiteTiltMean_mem_Icc (μ : ProbabilityMeasure (I → Bool)) + (S : Finset I) (h : I → ℝ) (e : I) : + finiteTiltMean μ S h e ∈ Set.Icc (0 : ℝ) 1 := by + apply tiltedMean_mem_Icc μ (continuous_finiteEnergy S h) + (continuous_bit.comp (continuous_apply e)) + intro x + cases hx : x e <;> simp [bit, hx] + +omit [Countable I] in + +theorem measurable_finitePosterior (μ : ProbabilityMeasure (I → Bool)) + (S : Finset I) (e : I) : + Measurable (fun p : ℝ × (I → ℝ) => + finiteTiltMean μ S (fun i => p.2 i - p.1 / 2) e) := by + apply measurable_tiltedMean + · change Measurable (fun q : (ℝ × (I → ℝ)) × (I → Bool) => + ∑ i ∈ S, (q.1.2 i - q.1.1 / 2) * bit (q.2 i)) + apply Finset.measurable_sum + intro i hi + have hfield : Measurable (fun q : (ℝ × (I → ℝ)) × (I → Bool) => + q.1.2 i - q.1.1 / 2) := + (((measurable_pi_apply i).comp (measurable_snd.comp measurable_fst)).sub + ((measurable_fst.comp measurable_fst).div_const 2)) + have hbit : Measurable (fun q : (ℝ × (I → ℝ)) × (I → Bool) => bit (q.2 i)) := + continuous_bit.measurable.comp ((measurable_pi_apply i).comp measurable_snd) + exact hfield.mul hbit + · change Measurable (fun q : (ℝ × (I → ℝ)) × (I → Bool) => bit (q.2 e)) + exact continuous_bit.measurable.comp ((measurable_pi_apply e).comp measurable_snd) + +def reindex {J : Type*} (σ : I ≃ J) (x : I → Bool) : J → Bool := + fun j => x (σ.symm j) + +omit [Countable I] in +theorem measurable_reindex {J : Type*} (σ : I ≃ J) : Measurable (reindex σ) := by + exact Measurable.of_eval (fun j => measurable_pi_apply (σ.symm j)) + +omit [Countable I] in +theorem finiteEnergy_reindex {J : Type*} (σ : I ≃ J) + (S : Finset I) (h : I → ℝ) (x : I → Bool) : + finiteEnergy (S.map σ.toEmbedding) (fun j => h (σ.symm j)) (reindex σ x) = + finiteEnergy S h x := by + simp [finiteEnergy, reindex] + +omit [Countable I] in + +theorem finiteTiltMean_reindex {J : Type*} [Countable J] (σ : I ≃ J) + (μ : ProbabilityMeasure (I → Bool)) (S : Finset I) (h : I → ℝ) (e : I) : + finiteTiltMean (μ.map (reindex σ)) + (S.map σ.toEmbedding) (fun j => h (σ.symm j)) (σ e) = + finiteTiltMean μ S h e := by + have hm := tiltedMean_map μ (measurable_reindex σ) + (continuous_finiteEnergy (S.map σ.toEmbedding) (fun j => h (σ.symm j))).measurable + (show Measurable (fun x : J → Bool => bit (x (σ e))) from + continuous_bit.measurable.comp (measurable_pi_apply (σ e))) + simpa only [finiteTiltMean, finiteEnergy_reindex, reindex, Equiv.symm_apply_apply] using hm + +end Problem336.TiltLimit + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ProjectionLimit.lean b/lean/OAI/Probability/SpanningForest/ProjectionLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..b26e04179e860e9a2a1c01d3a1897feb4900220a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ProjectionLimit.lean @@ -0,0 +1,105 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open Filter +open scoped Topology + +namespace Problem336 +namespace ProjectionLimit + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem cycle_projection_tendsto + (C : ℕ → Submodule ℝ E) [∀ n, (C n).HasOrthogonalProjection] + [(⨆ n, C n).topologicalClosure.HasOrthogonalProjection] + (hC : Monotone C) (x : E) : + Tendsto (fun n => (C n).starProjection x) atTop + (𝓝 ((⨆ n, C n).topologicalClosure.starProjection x)) := + Submodule.starProjection_tendsto_closure_iSup C hC x + +theorem free_kernel_tendsto + (C : ℕ → Submodule ℝ E) [∀ n, (C n).HasOrthogonalProjection] + [(⨆ n, C n).topologicalClosure.HasOrthogonalProjection] + (hC : Monotone C) (Q : ℕ → E → E) + (hQ : ∀ x, Tendsto (fun n => Q n x) atTop (𝓝 x)) (x : E) : + Tendsto (fun n => Q n x - (C n).starProjection x) atTop + (𝓝 (x - (⨆ n, C n).topologicalClosure.starProjection x)) := + (hQ x).sub (cycle_projection_tendsto C hC x) + +theorem kernel_matrix_tendsto + {ι : Type*} (K : ℕ → E → E) (Klim : E → E) + (hK : ∀ x, Tendsto (fun n => K n x) atTop (𝓝 (Klim x))) + (v : ι → E) : + Tendsto (fun n => (fun i j => inner ℝ (v i) (K n (v j)) : Matrix ι ι ℝ)) + atTop (𝓝 (fun i j => inner ℝ (v i) (Klim (v j)))) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + exact tendsto_const_nhds.inner (hK (v j)) + +theorem kernel_minor_tendsto + {ι : Type*} [Fintype ι] [DecidableEq ι] + (K : ℕ → E → E) (Klim : E → E) + (hK : ∀ x, Tendsto (fun n => K n x) atTop (𝓝 (Klim x))) + (v : ι → E) : + Tendsto (fun n => Matrix.det (fun i j => inner ℝ (v i) (K n (v j)))) + atTop (𝓝 (Matrix.det (fun i j => inner ℝ (v i) (Klim (v j))))) := by + exact (continuous_id.matrix_det.tendsto _).comp (kernel_matrix_tendsto K Klim hK v) + +theorem free_kernel_minor_tendsto + {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : ℕ → Submodule ℝ E) [∀ n, (C n).HasOrthogonalProjection] + [(⨆ n, C n).topologicalClosure.HasOrthogonalProjection] + (hC : Monotone C) (Q : ℕ → E → E) + (hQ : ∀ x, Tendsto (fun n => Q n x) atTop (𝓝 x)) (v : ι → E) : + Tendsto + (fun n => Matrix.det + (fun i j => inner ℝ (v i) (Q n (v j) - (C n).starProjection (v j)))) + atTop + (𝓝 (Matrix.det (fun i j => inner ℝ (v i) + (v j - (⨆ n, C n).topologicalClosure.starProjection (v j))))) := + kernel_minor_tendsto _ _ (free_kernel_tendsto C hC Q hQ) v + +theorem free_kernel_minor_ofReal_tendsto + {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : ℕ → Submodule ℝ E) [∀ n, (C n).HasOrthogonalProjection] + [(⨆ n, C n).topologicalClosure.HasOrthogonalProjection] + (hC : Monotone C) (Q : ℕ → E → E) + (hQ : ∀ x, Tendsto (fun n => Q n x) atTop (𝓝 x)) (v : ι → E) : + Tendsto + (fun n => ENNReal.ofReal (Matrix.det + (fun i j => inner ℝ (v i) (Q n (v j) - (C n).starProjection (v j))))) + atTop + (𝓝 (ENNReal.ofReal (Matrix.det (fun i j => inner ℝ (v i) + (v j - (⨆ n, C n).topologicalClosure.starProjection (v j)))))) := + ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (free_kernel_minor_tendsto C hC Q hQ v) + +theorem projection_kernel_eq_gram + {ι : Type*} (C : Submodule ℝ E) [C.HasOrthogonalProjection] (v : ι → E) : + (fun i j => inner ℝ (v i) (C.starProjection (v j))) = + Matrix.gram ℝ (fun i => C.starProjection (v i)) := by + funext i j + change inner ℝ (v i) (C.starProjection (v j)) = + inner ℝ (C.starProjection (v i)) (C.starProjection (v j)) + rw [C.inner_starProjection_left_eq_right] + congr 1 + exact (C.starProjection_eq_self_iff.mpr (C.starProjection_apply_mem (v j))).symm + +theorem projection_kernel_minor_nonneg + {ι : Type*} [Fintype ι] [DecidableEq ι] + (C : Submodule ℝ E) [C.HasOrthogonalProjection] (v : ι → E) : + 0 ≤ Matrix.det (fun i j => inner ℝ (v i) (C.starProjection (v j))) := by + rw [projection_kernel_eq_gram] + exact (Matrix.posSemidef_gram ℝ _).det_nonneg + +end ProjectionLimit +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/RandomReindex.lean b/lean/OAI/Probability/SpanningForest/RandomReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..154231ef45cd7db4f12b188026b73b14e71ab1cd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/RandomReindex.lean @@ -0,0 +1,117 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.RandomReindex + +theorem map_prod_fiberwise + {K V W : Type*} [MeasurableSpace K] [MeasurableSpace V] [MeasurableSpace W] + (κ : Measure K) (ν : Measure V) (η : Measure W) + [SFinite ν] [SFinite η] + (f : K → V → W) + (hf : Measurable (fun p : K × V => f p.1 p.2)) + (hmap : ∀ᵐ k ∂κ, ν.map (f k) = η) : + (κ.prod ν).map (fun p : K × V => (p.1, f p.1 p.2)) = κ.prod η := by + have hpair : Measurable (fun p : K × V => (p.1, f p.1 p.2)) := + measurable_fst.prodMk hf + ext s hs + rw [Measure.map_apply hpair hs, Measure.prod_apply (hs.preimage hpair), + Measure.prod_apply hs] + apply lintegral_congr_ae + filter_upwards [hmap] with k hk + change ν ((f k) ⁻¹' (Prod.mk k ⁻¹' s)) = η (Prod.mk k ⁻¹' s) + have hfk : Measurable (f k) := hf.comp measurable_prodMk_left + rw [← hk, Measure.map_apply hfk (hs.preimage measurable_prodMk_left)] + +theorem measurable_random_eval + {K J V : Type*} [MeasurableSpace K] [MeasurableSpace J] + [Countable J] [MeasurableSingletonClass J] [MeasurableSpace V] + (a : K → J) (ha : Measurable a) : + Measurable (fun p : K × (J → V) => p.2 (a p.1)) := by + have hev : Measurable (fun p : J × (J → V) => p.2 p.1) := + measurable_from_prod_countable_right (fun j => measurable_pi_apply j) + exact hev.comp ((ha.comp measurable_fst).prodMk measurable_snd) + +theorem measurable_select + {K I J V : Type*} [MeasurableSpace K] [MeasurableSpace J] + [Countable J] [MeasurableSingletonClass J] [MeasurableSpace V] + (a : K → I → J) (ha : ∀ i, Measurable (fun k => a k i)) : + Measurable (fun p : K × (J → V) => fun i => p.2 (a p.1 i)) := by + exact Measurable.of_eval (fun i => measurable_random_eval (fun k => a k i) (ha i)) + +theorem map_random_injective_reindex + {K I J V : Type*} [MeasurableSpace K] [MeasurableSpace J] + [Countable J] [MeasurableSingletonClass J] [MeasurableSpace V] + (κ : Measure K) (ν : Measure V) [IsProbabilityMeasure ν] + (a : K → I → J) (ha : ∀ i, Measurable (fun k => a k i)) + (hinj : ∀ᵐ k ∂κ, Function.Injective (a k)) : + (κ.prod (Measure.infinitePi (fun _ : J => ν))).map + (fun p : K × (J → V) => (p.1, fun i => p.2 (a p.1 i))) = + κ.prod (Measure.infinitePi (fun _ : I => ν)) := by + apply map_prod_fiberwise κ (Measure.infinitePi (fun _ : J => ν)) + (Measure.infinitePi (fun _ : I => ν)) + (fun k v i => v (a k i)) (measurable_select a ha) + filter_upwards [hinj] with k hk + exact Measure.map_infinitePi_infinitePi_of_inj (P := fun _ : J => ν) hk + +theorem map_random_injective_reindex_of_joint_law + {Ω K I J V : Type*} [MeasurableSpace Ω] [MeasurableSpace K] + [MeasurableSpace J] [Countable J] [MeasurableSingletonClass J] + [MeasurableSpace V] + (P : Measure Ω) (κ : Measure K) (ν : Measure V) [IsProbabilityMeasure ν] + (key : Ω → K) (pool : Ω → J → V) + (hkey : Measurable key) (hpool : Measurable pool) + (hlaw : P.map (fun ω => (key ω, pool ω)) = + κ.prod (Measure.infinitePi (fun _ : J => ν))) + (a : K → I → J) (ha : ∀ i, Measurable (fun k => a k i)) + (hinj : ∀ᵐ k ∂κ, Function.Injective (a k)) : + P.map (fun ω => (key ω, fun i => pool ω (a (key ω) i))) = + κ.prod (Measure.infinitePi (fun _ : I => ν)) := by + have hm : Measurable (fun p : K × (J → V) => + (p.1, fun i => p.2 (a p.1 i))) := + measurable_fst.prodMk (measurable_select a ha) + rw [← map_random_injective_reindex κ ν a ha hinj, ← hlaw, + Measure.map_map hm (hkey.prodMk hpool)] + rfl + +theorem prod_diagonal_null + {V : Type*} [MeasurableSpace V] [MeasurableEq V] + (ν : Measure V) [SFinite ν] [NullSingletonClass ν] : + (ν.prod ν) (Set.diagonal V) = 0 := by + rw [Measure.prod_apply measurableSet_diagonal] + have hsection (v : V) : Prod.mk v ⁻¹' Set.diagonal V = {v} := by + ext w + simp [Set.diagonal, eq_comm] + simp [hsection] + +theorem ae_injective_infinitePi + {J V : Type*} [Countable J] [MeasurableSpace V] [MeasurableEq V] + (ν : Measure V) [IsProbabilityMeasure ν] [NullSingletonClass ν] : + ∀ᵐ v ∂Measure.infinitePi (fun _ : J => ν), Function.Injective v := by + have hne (i j : J) (hij : i ≠ j) : + ∀ᵐ v ∂Measure.infinitePi (fun _ : J => ν), v i ≠ v j := by + have hd := prod_diagonal_null ν + rw [← Measure.infinitePi_map_eval_prod (P := fun _ : J => ν) hij, + Measure.map_apply ((measurable_pi_apply i).prodMk (measurable_pi_apply j)) + measurableSet_diagonal] at hd + simpa only [ae_iff, Set.preimage, Set.mem_diagonal_iff, not_not] using hd + have hall : ∀ i j : J, + ∀ᵐ v ∂Measure.infinitePi (fun _ : J => ν), i ≠ j → v i ≠ v j := by + intro i j + by_cases hij : i = j + · exact Filter.Eventually.of_forall (fun _ h => False.elim (h hij)) + · exact (hne i j hij).mono (fun _ h _ => h) + filter_upwards [ae_all_iff.2 (fun i => ae_all_iff.2 (hall i))] with v hv + intro i j heq + by_contra hij + exact hv i j hij heq + +end Problem336.RandomReindex + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/RandomSelection.lean b/lean/OAI/Probability/SpanningForest/RandomSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d8354fabb33943b2d3326dd58141a90053a1e3b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/RandomSelection.lean @@ -0,0 +1,81 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory + +namespace Problem336.RandomSelection + +variable {K I J X : Type*} +variable [MeasurableSpace K] [MeasurableSpace J] [MeasurableSpace X] +variable [Countable J] [MeasurableSingletonClass J] + +lemma measurable_selected_array (s : K → I → J) + (hs : ∀ i, Measurable (fun k => s k i)) : + Measurable (fun p : K × (J → X) => fun i => p.2 (s p.1 i)) := by + apply measurable_pi_iff.mpr + intro i + have heval : Measurable (fun p : (J → X) × J => p.1 p.2) := + measurable_from_prod_countable_left (fun j => measurable_pi_apply j) + exact heval.comp (measurable_snd.prodMk ((hs i).comp measurable_fst)) + +theorem measurePreserving_selected_array + (μ : Measure K) [SFinite μ] (ν : Measure X) [IsProbabilityMeasure ν] + (s : K → I → J) (hs : ∀ i, Measurable (fun k => s k i)) + (hinj : ∀ᵐ k ∂μ, Function.Injective (s k)) : + MeasurePreserving + (fun p : K × (J → X) => (p.1, fun i => p.2 (s p.1 i))) + (μ.prod (Measure.infinitePi (fun _ : J => ν))) + (μ.prod (Measure.infinitePi (fun _ : I => ν))) := by + refine (MeasurePreserving.id μ).skew_product + (μc := Measure.infinitePi (fun _ : J => ν)) + (μd := Measure.infinitePi (fun _ : I => ν)) + (g := fun k (v : J → X) i => v (s k i)) + (measurable_selected_array s hs) ?_ + filter_upwards [hinj] with k hk + exact Measure.map_infinitePi_infinitePi_of_inj hk + +theorem map_selected_array + (μ : Measure K) [SFinite μ] (ν : Measure X) [IsProbabilityMeasure ν] + (s : K → I → J) (hs : ∀ i, Measurable (fun k => s k i)) + (hinj : ∀ᵐ k ∂μ, Function.Injective (s k)) : + (μ.prod (Measure.infinitePi (fun _ : J => ν))).map + (fun p : K × (J → X) => (p.1, fun i => p.2 (s p.1 i))) = + μ.prod (Measure.infinitePi (fun _ : I => ν)) := + (measurePreserving_selected_array μ ν s hs hinj).map_eq + +theorem measurePreserving_selection + (μ : Measure K) [IsProbabilityMeasure μ] (ν : Measure X) [IsProbabilityMeasure ν] + (s : K → I → J) (hs : ∀ i, Measurable (fun k => s k i)) + (hinj : ∀ᵐ k ∂μ, Function.Injective (s k)) : + MeasurePreserving + (fun p : K × (J → X) => fun i => p.2 (s p.1 i)) + (μ.prod (Measure.infinitePi (fun _ : J => ν))) + (Measure.infinitePi (fun _ : I => ν)) := by + exact (measurePreserving_snd (μ := μ) + (ν := Measure.infinitePi (fun _ : I => ν))).comp + (measurePreserving_selected_array μ ν s hs hinj) + +theorem map_selected_array_of_joint_law + {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (μ : Measure K) [SFinite μ] (ν : Measure X) [IsProbabilityMeasure ν] + (keys : Ω → K) (pool : Ω → J → X) + (hkeys : Measurable keys) (hpool : Measurable pool) + (hlaw : P.map (fun ω => (keys ω, pool ω)) = + μ.prod (Measure.infinitePi (fun _ : J => ν))) + (s : K → I → J) (hs : ∀ i, Measurable (fun k => s k i)) + (hinj : ∀ᵐ k ∂μ, Function.Injective (s k)) : + P.map (fun ω => (keys ω, fun i => pool ω (s (keys ω) i))) = + μ.prod (Measure.infinitePi (fun _ : I => ν)) := by + have hm := (measurePreserving_selected_array μ ν s hs hinj).measurable + have heq := Measure.map_map (μ := P) hm (hkeys.prodMk hpool) + rw [hlaw, map_selected_array μ ν s hs hinj] at heq + exact heq.symm + +end Problem336.RandomSelection + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/RawInnovationSampler.lean b/lean/OAI/Probability/SpanningForest/RawInnovationSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d80184183e4268fa4d3995fca7618d354bb2659 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/RawInnovationSampler.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SpanningForest.ContinuousPathSampler +import OAI.Probability.SpanningForest.InnovationMartingale + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped NNReal Topology + +namespace Problem336.RawInnovationSampler + +variable {I Ω : Type*} + +def observation (X : Ω → I → Bool) (B : I → ℝ≥0 → Ω → ℝ) + (ω : Ω) (i : I) (t : ℝ≥0) : ℝ := + (t : ℝ) * bitValue (X ω i) + B i t ω + +def rawInnovation (X : Ω → I → Bool) (B : I → ℝ≥0 → Ω → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (ω : Ω) (i : I) (t : ℝ≥0) : ℝ := + Innovation.nnInnovation (fun ω => bitValue (X ω i)) (B i) + (fun s ω => b s (fun j => observation X B ω j s.toNNReal) i) t ω + +@[simp] +lemma rawInnovation_apply (X : Ω → I → Bool) (B : I → ℝ≥0 → Ω → ℝ) + (b : ℝ → (I → ℝ) → I → ℝ) (ω : Ω) (i : I) (t : ℝ≥0) : + rawInnovation X B b ω i t = observation X B ω i t - + ∫ s in (0 : ℝ)..t, b s (fun j => observation X B ω j s.toNNReal) i := by + simp only [rawInnovation, Innovation.nnInnovation_apply, observation] + +theorem hasLaw_of_raw_innovation [Countable I] + [MeasurableSpace Ω] {Ω' : Type*} [MeasurableSpace Ω'] + [MeasurableSpace C(ℝ≥0, ℝ)] [BorelSpace C(ℝ≥0, ℝ)] + {P : Measure Ω} {P' : Measure Ω'} + {ρ : Measure (I → C(ℝ≥0, ℝ))} {ν : Measure (I → Bool)} + {X : Ω → I → Bool} (hX : HasLaw X ν P) + {B : I → ℝ≥0 → Ω → ℝ} (hB : ∀ i, IsBrownianReal (B i) P) + (b : ℝ → (I → ℝ) → I → ℝ) + (hb : ∀ i, Measurable (fun p : ℝ × (I → ℝ) => b p.1 p.2 i)) + (hbound : ∀ t y i, |b t y i| ≤ 1) + {L : ℝ} (hL : 0 ≤ L) + (hresponse : ∀ t y z D, 0 ≤ D → (∀ j, |y j - z j| ≤ D) → + ∀ i, |b t y i - b t z i| ≤ L * D) + (hinnovation : HasLaw (rawInnovation X B b) (ρ.map ContinuousPathLaw.raw) P) + {fresh : Ω' → I → C(ℝ≥0, ℝ)} (hfresh : HasLaw fresh ρ P') : + HasLaw (fun ω => PicardSampler.NonnegativeTime.sample + ContinuousPathLaw.raw b (fresh ω)) ν P' := by + have hBc : ∀ᵐ ω ∂P, ∀ i, Continuous (fun t => B i t ω) := + ae_all_iff.mpr (fun i => (hB i).cont) + have hYc : ∀ᵐ ω ∂P, ∀ i, Continuous (observation X B ω i) := by + filter_upwards [hBc] with ω hω + intro i + exact (continuous_subtype_val.mul continuous_const).add (hω i) + have hIc : ∀ᵐ ω ∂P, ∀ i, Continuous (rawInnovation X B b ω i) := by + filter_upwards [hYc] with ω hω + intro i + have hm : Measurable (fun s : ℝ => + b s (fun j => observation X B ω j s.toNNReal) i) := + (hb i).comp (measurable_id.prodMk (Measurable.of_eval (fun j => ((hω j).comp continuous_real_toNNReal).measurable))) + have hi : Continuous (fun t : ℝ => ∫ s in (0 : ℝ)..t, + b s (fun j => observation X B ω j s.toNNReal) i) := + intervalIntegral.continuous_primitive + (Picard.intervalIntegrable_of_measurable_bounded hm + (fun s => hbound s _ i)) 0 + change Continuous (fun t => rawInnovation X B b ω i t) + simp_rw [rawInnovation_apply] + exact (hω i).sub (hi.comp continuous_subtype_val) + apply ContinuousPathSampler.hasLaw_of_raw_integral_coupling hX + (fun i => (hB i).toIsPreBrownianReal) (rawInnovation X B b) + (fun i t => (measurable_pi_apply t).comp_aemeasurable + ((measurable_pi_apply i).comp_aemeasurable hinnovation.aemeasurable)) hIc hinnovation.map_eq hfresh + b hb hbound hL hresponse (observation X B) + · filter_upwards [hYc] with ω hω + exact fun i => (hω i).measurable + · exact Eventually.of_forall (fun ω t i => by rw [rawInnovation_apply]; ring) + · exact Eventually.of_forall (fun _ _ _ => rfl) + +end Problem336.RawInnovationSampler + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ReducedCycleKernel.lean b/lean/OAI/Probability/SpanningForest/ReducedCycleKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..c087ca5743b2ece613f7e73989304f3837e560b4 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ReducedCycleKernel.lean @@ -0,0 +1,161 @@ +import OAI.Probability.SpanningForest.FiniteCycleIncidence +import OAI.Probability.SpanningForest.IncidenceCirculation +import OAI.Probability.SpanningForest.TransferProjection +import OAI.Probability.SpanningForest.CodeLaplacian + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace ReducedCycleKernel + +def reducedFiniteIncidence (K : FiniteSubgraphCode) (root : ↥K.1) : + Matrix {v : ↥K.1 // v ≠ root} (finiteCodeEdges K) ℝ := + fun v e => finiteIncidence K v.1 e + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +def codeSource (hK : IsFiniteConnectedSubgraph G K) (e : finiteCodeEdges K) : ↥K.1 := + ⟨e.1.1.1, (hK.2.1 e.1.1 e.2).1⟩ + +def codeDestination (hK : IsFiniteConnectedSubgraph G K) (e : finiteCodeEdges K) : ↥K.1 := + ⟨e.1.1.2, (hK.2.1 e.1.1 e.2).2.1⟩ + +theorem finiteIncidence_eq_incidence (hK : IsFiniteConnectedSubgraph G K) : + finiteIncidence K = IncidenceCirculation.incidence (codeSource hK) (codeDestination hK) := by + classical + ext v e + simp only [finiteIncidence, IncidenceCirculation.incidence, codeSource, codeDestination, + Subtype.ext_iff] + +theorem reducedFiniteIncidence_eq_incidence (hK : IsFiniteConnectedSubgraph G K) + (root : ↥K.1) : + reducedFiniteIncidence K root = + IncidenceCirculation.reducedIncidence (codeSource hK) (codeDestination hK) root := by + classical + ext v e + exact congrFun (congrFun (finiteIncidence_eq_incidence hK) v.1) e + +theorem reducedFiniteIncidence_mulVec_eq_zero_iff + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) + (x : finiteCodeEdges K → ℝ) : + (reducedFiniteIncidence K root).mulVec x = 0 ↔ (finiteIncidence K).mulVec x = 0 := by + classical + rw [reducedFiniteIncidence_eq_incidence hK, finiteIncidence_eq_incidence hK] + exact IncidenceCirculation.reduced_mulVec_eq_zero_iff _ _ _ _ + +theorem codeEndpoints_connected (hK : IsFiniteConnectedSubgraph G K) : + ReducedLaplacian.Connected (codeSource hK) (codeDestination hK) := by + intro u v + refine Relation.ReflTransGen.mono ?_ u v (Problem336.code_endpoints_connected hK u v) + intro a b hab + obtain ⟨e, he⟩ := hab + let e' : finiteCodeEdges K := ⟨⟨e.1, (hK.2.1 e.1 e.2).2.2.1⟩, e.2⟩ + refine ⟨e', ?_⟩ + simpa only [codeSource, codeDestination, Problem336.codeSource, Problem336.codeTarget, e'] using he + +theorem reducedFiniteIncidence_eq_gradient_transpose + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) : + reducedFiniteIncidence K root = + (ReducedLaplacian.reducedGradient (codeSource hK) (codeDestination hK) root).transpose := by + classical + rw [reducedFiniteIncidence_eq_incidence hK] + rfl + +theorem reducedFiniteIncidence_gram_isUnit + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) : + IsUnit ((reducedFiniteIncidence K root) * (reducedFiniteIncidence K root).transpose).det := by + classical + apply isUnit_iff_ne_zero.mpr + have hd := ReducedLaplacian.weightedLaplacian_det_ne_zero + (codeSource hK) (codeDestination hK) root (fun _ => 1) + (codeEndpoints_connected hK) (fun _ => by norm_num) + simpa [ReducedLaplacian.weightedLaplacian, + reducedFiniteIncidence_eq_gradient_transpose hK root] using hd + +theorem reducedFiniteIncidence_euclideanKernel + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) : + (reducedFiniteIncidence K root).toEuclideanLin.ker = (finiteIncidence K).toEuclideanLin.ker := by + classical + ext x + simpa only [LinearMap.mem_ker, Matrix.toLpLin_apply, + WithLp.toLp_eq_zero] using reducedFiniteIncidence_mulVec_eq_zero_iff hK root x.ofLp + +theorem finiteHilbertCycleSpace_eq_reducedKernel + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) : + finiteHilbertCycleSpace K = + ((reducedFiniteIncidence K root).toEuclideanLin.ker).map + (finiteHilbertEmbedding K).toLinearMap := by + rw [reducedFiniteIncidence_euclideanKernel hK] + exact hK.finiteHilbertCycleSpace_eq_euclideanKernel + +theorem finite_transfer_eq_coordinate_sub_cycle + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) + (hGram : IsUnit ((reducedFiniteIncidence K root) * + (reducedFiniteIncidence K root).transpose).det) (x : EdgeHilbert) : + finiteHilbertEmbedding K + ((TransferProjection.transferMatrix (reducedFiniteIncidence K root)).toEuclideanLin + ((finiteHilbertEmbedding K).toContinuousLinearMap.adjoint x)) = + (finiteHilbertEmbedding K).toLinearMap.range.starProjection x - + (finiteHilbertCycleSpace K).starProjection x := by + classical + rw [TransferProjection.embedded_transferMatrix_eq_difference _ hGram] + congr 1 + congr 1 + congr 1 + exact (finiteHilbertCycleSpace_eq_reducedKernel hK root).symm + +theorem finite_transfer_eq_coordinate_sub_cycle_of_connected + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) (x : EdgeHilbert) : + finiteHilbertEmbedding K + ((TransferProjection.transferMatrix (reducedFiniteIncidence K root)).toEuclideanLin + ((finiteHilbertEmbedding K).toContinuousLinearMap.adjoint x)) = + (finiteHilbertEmbedding K).toLinearMap.range.starProjection x - + (finiteHilbertCycleSpace K).starProjection x := + finite_transfer_eq_coordinate_sub_cycle hK root + (reducedFiniteIncidence_gram_isUnit hK root) x + +theorem finiteHilbertEmbedding_basis (K : FiniteSubgraphCode) (e : finiteCodeEdges K) : + finiteHilbertEmbedding K (EuclideanSpace.basisFun (finiteCodeEdges K) ℝ e) = + lp.single 2 e.1 (1 : ℝ) := by + classical + change finiteHilbertEmbeddingLinear K _ = _ + rw [finiteHilbertEmbeddingLinear_sum] + simp + +theorem finite_transfer_entry_eq_projection + (hK : IsFiniteConnectedSubgraph G K) (root : ↥K.1) (e f : finiteCodeEdges K) : + TransferProjection.transferMatrix (reducedFiniteIncidence K root) e f = + inner ℝ (lp.single 2 e.1 (1 : ℝ)) + ((finiteHilbertEmbedding K).toLinearMap.range.starProjection (lp.single 2 f.1 (1 : ℝ)) - + (finiteHilbertCycleSpace K).starProjection (lp.single 2 f.1 (1 : ℝ))) := by + classical + rw [← finite_transfer_eq_coordinate_sub_cycle_of_connected hK root] + rw [← finiteHilbertEmbedding_basis K e, ← finiteHilbertEmbedding_basis K f] + have hj : (finiteHilbertEmbedding K).toContinuousLinearMap.adjoint + (finiteHilbertEmbedding K (EuclideanSpace.basisFun (finiteCodeEdges K) ℝ f)) = + EuclideanSpace.basisFun (finiteCodeEdges K) ℝ f := by + have hh := congrArg (fun F => F (EuclideanSpace.basisFun (finiteCodeEdges K) ℝ f)) + (finiteHilbertEmbedding K).adjoint_comp_self + exact hh + rw [hj, (finiteHilbertEmbedding K).inner_map_map, EuclideanSpace.basisFun_inner] + simp [Matrix.toLpLin_apply] + +theorem finite_transfer_root_independent + (hK : IsFiniteConnectedSubgraph G K) (root root' : ↥K.1) (x : EdgeHilbert) : + finiteHilbertEmbedding K + ((TransferProjection.transferMatrix (reducedFiniteIncidence K root)).toEuclideanLin + ((finiteHilbertEmbedding K).toContinuousLinearMap.adjoint x)) = + finiteHilbertEmbedding K + ((TransferProjection.transferMatrix (reducedFiniteIncidence K root')).toEuclideanLin + ((finiteHilbertEmbedding K).toContinuousLinearMap.adjoint x)) := by + rw [finite_transfer_eq_coordinate_sub_cycle_of_connected hK root, + finite_transfer_eq_coordinate_sub_cycle_of_connected hK root'] + +end ReducedCycleKernel +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ReducedLaplacian.lean b/lean/OAI/Probability/SpanningForest/ReducedLaplacian.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fc2bc024447fc50c638f15665bca26221703b96 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ReducedLaplacian.lean @@ -0,0 +1,117 @@ +import Mathlib + +namespace OAI + +namespace Problem336.ReducedLaplacian + +open scoped BigOperators Matrix + +variable {V E : Type*} + +def EdgeAdj (src dst : E → V) (u v : V) : Prop := + ∃ e, (src e = u ∧ dst e = v) ∨ (src e = v ∧ dst e = u) + +def Connected (src dst : E → V) : Prop := + ∀ u v, Relation.ReflTransGen (EdgeAdj src dst) u v + +theorem potential_eq_of_connected (src dst : E → V) (hconn : Connected src dst) + (x : V → ℝ) (hedge : ∀ e, x (src e) = x (dst e)) (u v : V) : x u = x v := by + have hp := hconn u v + induction hp with + | refl => rfl + | @tail b c hab hbc ih => + apply ih.trans + obtain ⟨e, h | h⟩ := hbc + · simpa [h.1, h.2] using hedge e + · simpa [h.1, h.2] using (hedge e).symm + +variable [DecidableEq V] + +def extendZero (root : V) (x : {v : V // v ≠ root} → ℝ) (v : V) : ℝ := + if hv : v ≠ root then x ⟨v, hv⟩ else 0 + +@[simp] theorem extendZero_root (root : V) (x : {v : V // v ≠ root} → ℝ) : + extendZero root x root = 0 := by simp [extendZero] + +@[simp] theorem extendZero_subtype (root : V) (x : {v : V // v ≠ root} → ℝ) + (v : {v : V // v ≠ root}) : extendZero root x v = x v := by + simp [extendZero, v.property] + +def reducedGradient (src dst : E → V) (root : V) : + Matrix E {v : V // v ≠ root} ℝ := + fun e v => (if v.val = src e then 1 else 0) - (if v.val = dst e then 1 else 0) + +variable [Fintype V] + +lemma sum_indicator_mul (root : V) (x : {v : V // v ≠ root} → ℝ) (v : V) : + (∑ i : {v : V // v ≠ root}, (if i.val = v then (1 : ℝ) else 0) * x i) = + extendZero root x v := by + classical + by_cases hv : v ≠ root + · rw [extendZero, dite_eq_left hv] + rw [Finset.sum_eq_single ⟨v, hv⟩] + · simp + · intro b _ hb + have hb' : b.val ≠ v := fun h => hb (Subtype.ext h) + simp [hb'] + · simp + · have hv' : v = root := not_ne_iff.mp hv + subst v + rw [extendZero_root] + apply Finset.sum_eq_zero + intro i _ + simp [i.property] + +theorem reducedGradient_mulVec (src dst : E → V) (root : V) + (x : {v : V // v ≠ root} → ℝ) (e : E) : + (reducedGradient src dst root *ᵥ x) e = + extendZero root x (src e) - extendZero root x (dst e) := by + simp only [Matrix.mulVec, dotProduct, reducedGradient, sub_mul, Finset.sum_sub_distrib] + rw [sum_indicator_mul, sum_indicator_mul] + +theorem reducedGradient_mulVec_injective (src dst : E → V) (root : V) + (hconn : Connected src dst) : + Function.Injective (reducedGradient src dst root).mulVec := by + intro x y hxy + have hedge : ∀ e, + (extendZero root x - extendZero root y) (src e) = + (extendZero root x - extendZero root y) (dst e) := by + intro e + have h := congrFun hxy e + rw [reducedGradient_mulVec, reducedGradient_mulVec] at h + simp only [Pi.sub_apply] + linarith + funext v + have h := potential_eq_of_connected src dst hconn + (extendZero root x - extendZero root y) hedge v.val root + exact sub_eq_zero.mp (by simpa using h) + +variable [Fintype E] [DecidableEq E] + +def weightedLaplacian (src dst : E → V) (root : V) (w : E → ℝ) : + Matrix {v : V // v ≠ root} {v : V // v ≠ root} ℝ := + (reducedGradient src dst root)ᵀ * Matrix.diagonal w * reducedGradient src dst root + +theorem weightedLaplacian_posDef (src dst : E → V) (root : V) (w : E → ℝ) + (hconn : Connected src dst) (hw : ∀ e, 0 < w e) : + (weightedLaplacian src dst root w).PosDef := by + have hd : (Matrix.diagonal w).PosDef := Matrix.PosDef.diagonal hw + have h := hd.conjTranspose_mul_mul_same + (reducedGradient_mulVec_injective src dst root hconn) + simpa [weightedLaplacian, Matrix.conjTranspose_eq_transpose_of_trivial] using h + +theorem weightedLaplacian_isUnit (src dst : E → V) (root : V) (w : E → ℝ) + (hconn : Connected src dst) (hw : ∀ e, 0 < w e) : + IsUnit (weightedLaplacian src dst root w) := + (weightedLaplacian_posDef src dst root w hconn hw).isUnit + +theorem weightedLaplacian_det_ne_zero (src dst : E → V) (root : V) (w : E → ℝ) + (hconn : Connected src dst) (hw : ∀ e, 0 < w e) : + (weightedLaplacian src dst root w).det ≠ 0 := by + exact isUnit_iff_ne_zero.mp + ((Matrix.isUnit_iff_isUnit_det _).mp + (weightedLaplacian_isUnit src dst root w hconn hw)) + +end Problem336.ReducedLaplacian + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Relabeling.lean b/lean/OAI/Probability/SpanningForest/Relabeling.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c49ef3f9e05c0b25f6737d5e09d5b88601e53c6 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Relabeling.lean @@ -0,0 +1,91 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +namespace Problem336 + +@[simp] theorem relabelGraph_refl (G : GraphCode) : + relabelGraph (Equiv.refl ℕ) G = G := by + apply Subtype.ext + rfl + +@[simp] theorem relabelLabels_refl (U : ℕ → ℝ) : + relabelLabels (Equiv.refl ℕ) U = U := rfl + +@[simp] theorem relabelGraph_trans (σ τ : Equiv ℕ ℕ) (G : GraphCode) : + relabelGraph (σ.trans τ) G = relabelGraph τ (relabelGraph σ G) := by + apply Subtype.ext + rfl + +@[simp] theorem relabelLabels_trans (σ τ : Equiv ℕ ℕ) (U : ℕ → ℝ) : + relabelLabels (σ.trans τ) U = relabelLabels τ (relabelLabels σ U) := rfl + +@[simp] theorem relabelGraph_symm (σ : Equiv ℕ ℕ) (G : GraphCode) : + relabelGraph σ.symm (relabelGraph σ G) = G := by + apply Subtype.ext + funext u v + simp [relabelGraph] + +@[simp] theorem relabelLabels_symm (σ : Equiv ℕ ℕ) (U : ℕ → ℝ) : + relabelLabels σ.symm (relabelLabels σ U) = U := by + funext u + simp [relabelLabels] + +@[simp] theorem adj_relabelGraph (σ : Equiv ℕ ℕ) (G : GraphCode) (u v : ℕ) : + Adj (relabelGraph σ G) u v ↔ Adj G (σ.symm u) (σ.symm v) := Iff.rfl + +@[simp] theorem adj_relabelGraph_apply (σ : Equiv ℕ ℕ) (G : GraphCode) (u v : ℕ) : + Adj (relabelGraph σ G) (σ u) (σ v) ↔ Adj G u v := by + simp + +theorem relabelGraph_reachable (σ : Equiv ℕ ℕ) (G : GraphCode) + {u v : ℕ} (h : Relation.ReflTransGen (Adj G) u v) : + Relation.ReflTransGen (Adj (relabelGraph σ G)) (σ u) (σ v) := by + exact Relation.ReflTransGen.lift σ + (fun a b hab => (adj_relabelGraph_apply σ G a b).2 hab) u v h + +theorem GraphConnected.relabel (σ : Equiv ℕ ℕ) {G : GraphCode} + (h : GraphConnected G) : GraphConnected (relabelGraph σ G) := by + intro u v + simpa only [Equiv.apply_symm_apply] using relabelGraph_reachable σ G (h (σ.symm u) (σ.symm v)) + +@[simp] theorem graphConnected_relabelGraph_iff (σ : Equiv ℕ ℕ) (G : GraphCode) : + GraphConnected (relabelGraph σ G) ↔ GraphConnected G := by + constructor + · intro h + simpa using h.relabel σ.symm + · exact GraphConnected.relabel σ + +theorem GraphLocallyFinite.relabel (σ : Equiv ℕ ℕ) {G : GraphCode} + (h : GraphLocallyFinite G) : GraphLocallyFinite (relabelGraph σ G) := by + intro u + exact (h (σ.symm u)).preimage σ.symm.injective.injOn + +@[simp] theorem graphLocallyFinite_relabelGraph_iff (σ : Equiv ℕ ℕ) (G : GraphCode) : + GraphLocallyFinite (relabelGraph σ G) ↔ GraphLocallyFinite G := by + constructor + · intro h + simpa using h.relabel σ.symm + · exact GraphLocallyFinite.relabel σ + +theorem measurable_relabelGraph (σ : Equiv ℕ ℕ) : Measurable (relabelGraph σ) := by + apply Measurable.subtype_mk + apply Measurable.of_eval + intro u + apply Measurable.of_eval + intro v + exact (measurable_pi_apply (σ.symm v)).comp + ((measurable_pi_apply (σ.symm u)).comp measurable_subtype_coe) + +theorem measurable_relabelLabels (σ : Equiv ℕ ℕ) : Measurable (relabelLabels σ) := by + apply Measurable.of_eval + intro u + exact measurable_pi_apply (σ.symm u) + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/ResponseLipschitz.lean b/lean/OAI/Probability/SpanningForest/ResponseLipschitz.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa0c5839e6a1698d01db7731d194549fafeaa2bb --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/ResponseLipschitz.lean @@ -0,0 +1,99 @@ +import OAI.Probability.SpanningForest.FiniteResponse + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.FiniteResponse + +variable {E : Type*} [Fintype E] + +lemma abs_sum_mul_le_sup (c v : E → ℝ) : + |∑ i, c i * v i| ≤ (∑ i, |c i|) * ‖v‖ := by + calc + |∑ i, c i * v i| ≤ ∑ i, |c i * v i| := Finset.abs_sum_le_sum_abs _ _ + _ = ∑ i, |c i| * |v i| := by simp only [abs_mul] + _ ≤ ∑ i, |c i| * ‖v‖ := by + apply Finset.sum_le_sum + intro i _ + exact mul_le_mul_of_nonneg_left (norm_le_pi_norm v i) (abs_nonneg _) + _ = (∑ i, |c i|) * ‖v‖ := (Finset.sum_mul _ _ _).symm + +lemma opNorm_le_abs_row_sum (d : (E → ℝ) →L[ℝ] ℝ) (c : E → ℝ) + (hrow : ∀ v, d v = ∑ i, c i * v i) : + ‖d‖ ≤ ∑ i, |c i| := by + apply d.opNorm_le_bound (Finset.sum_nonneg fun _ _ => abs_nonneg _) + intro v + rw [Real.norm_eq_abs, hrow] + exact abs_sum_mul_le_sup c v + +theorem abs_sub_le_of_derivative_row_bound + (f : (E → ℝ) → ℝ) (d : (E → ℝ) → (E → ℝ) →L[ℝ] ℝ) + (c : (E → ℝ) → E → ℝ) (L : ℝ) + (hd : ∀ h, HasFDerivAt f (d h) h) + (hrow : ∀ h v, d h v = ∑ i, c h i * v i) + (hbound : ∀ h, ∑ i, |c h i| ≤ L) (x y : E → ℝ) : + |f y - f x| ≤ L * ‖y - x‖ := by + have hop : ∀ h, ‖d h‖ ≤ L := fun h => + (opNorm_le_abs_row_sum (d h) (c h) (hrow h)).trans (hbound h) + simpa only [Real.norm_eq_abs] using + (convex_univ : Convex ℝ (Set.univ : Set (E → ℝ))).norm_image_sub_le_of_norm_hasFDerivWithin_le + (fun h _ => (hd h).hasFDerivWithinAt) (fun h _ => hop h) + (Set.mem_univ x) (Set.mem_univ y) + +theorem abs_sub_le_of_derivative_row_bound_of_coordinate_bound + (f : (E → ℝ) → ℝ) (d : (E → ℝ) → (E → ℝ) →L[ℝ] ℝ) + (c : (E → ℝ) → E → ℝ) (L D : ℝ) + (hL : 0 ≤ L) (hD : 0 ≤ D) + (hd : ∀ h, HasFDerivAt f (d h) h) + (hrow : ∀ h v, d h v = ∑ i, c h i * v i) + (hbound : ∀ h, ∑ i, |c h i| ≤ L) + (x y : E → ℝ) (hxy : ∀ i, |y i - x i| ≤ D) : + |f y - f x| ≤ L * D := by + apply (abs_sub_le_of_derivative_row_bound f d c L hd hrow hbound x y).trans + apply mul_le_mul_of_nonneg_left _ hL + exact (pi_norm_le_iff_of_nonneg hD).mpr hxy + +theorem abs_sub_le_of_line_derivative_row_bound + (f : (E → ℝ) → ℝ) (c : (E → ℝ) → E → ℝ) (L : ℝ) + (hd : ∀ a b t, HasDerivAt + (fun s : ℝ => f (a + s • (b - a))) + (∑ i, c (a + t • (b - a)) i * (b i - a i)) t) + (hbound : ∀ h, ∑ i, |c h i| ≤ L) (a b : E → ℝ) : + |f b - f a| ≤ L * ‖b - a‖ := by + have hderiv : ∀ t ∈ Set.Icc (0 : ℝ) 1, HasDerivWithinAt + (fun s : ℝ => f (a + s • (b - a))) + (∑ i, c (a + t • (b - a)) i * (b i - a i)) + (Set.Icc (0 : ℝ) 1) t := fun t _ => (hd a b t).hasDerivWithinAt + have hb : ∀ t ∈ Set.Ico (0 : ℝ) 1, + ‖∑ i, c (a + t • (b - a)) i * (b i - a i)‖ ≤ L * ‖b - a‖ := by + intro t _ + rw [Real.norm_eq_abs] + exact (abs_sum_mul_le_sup (c (a + t • (b - a))) (b - a)).trans + (mul_le_mul_of_nonneg_right (hbound _) (norm_nonneg _)) + simpa only [zero_smul, add_zero, one_smul, add_sub_cancel, + Real.norm_eq_abs] using + norm_image_sub_le_of_norm_deriv_le_segment_01' hderiv hb + +theorem mean_abs_sub_le_half {Ω : Type*} [Fintype Ω] + (p : (E → ℝ) → Ω → ℝ) (x : Ω → E → ℝ) (e : E) + (d : (E → ℝ) → (E → ℝ) →L[ℝ] ℝ) + (hp : ∀ h ω, 0 ≤ p h ω) (hnorm : ∀ h, ∑ ω, p h ω = 1) + (hx : ∀ ω f, x ω f = 0 ∨ x ω f = 1) + (r : ℝ) (hfixed : ∀ ω, ∑ f, x ω f = r) + (hneg : ∀ h e f, e ≠ f → covariance (p h) x e f ≤ 0) + (hd : ∀ h, HasFDerivAt (fun h => mean (p h) x e) (d h) h) + (hrow : ∀ h v, d h v = ∑ f, covariance (p h) x e f * v f) + (a b : E → ℝ) : + |mean (p b) x e - mean (p a) x e| ≤ (1 / 2 : ℝ) * ‖b - a‖ := by + exact abs_sub_le_of_derivative_row_bound (fun h => mean (p h) x e) d + (fun h f => covariance (p h) x e f) (1 / 2) hd hrow + (fun h => covariance_abs_row_le_half (p h) x (hp h) (hnorm h) hx r hfixed + (hneg h) e) a b + +end Problem336.FiniteResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/RuleExtension.lean b/lean/OAI/Probability/SpanningForest/RuleExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..11a5908d021e83787075d15231b3b2dc2ed87e1b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/RuleExtension.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem336 + +def gatedRule (p : GraphCode → (ℕ → ℝ) → Prop) (Phi : FactorRule) : FactorRule := by + classical + exact fun G U e => if p G U then Phi G U e else false + +theorem RuleBorel.gated {Phi : FactorRule} (hPhi : RuleBorel Phi) + {p : GraphCode → (ℕ → ℝ) → Prop} + (hp : Measurable (fun q : GraphCode × (ℕ → ℝ) => p q.1 q.2)) : + RuleBorel (gatedRule p Phi) := by + classical + have hgate : Measurable + (fun q : GraphCode × ((ℕ → ℝ) × EdgeCode) => p q.1 q.2.1) := + hp.comp (measurable_fst.prodMk (measurable_fst.comp measurable_snd)) + exact Measurable.ite hgate.setOf hPhi measurable_const + +theorem RuleEquivariant.gated {Phi : FactorRule} (hPhi : RuleEquivariant Phi) + {p : GraphCode → (ℕ → ℝ) → Prop} + (hp : ∀ (σ : Equiv ℕ ℕ) (G : GraphCode) (U : ℕ → ℝ), + p (relabelGraph σ G) (relabelLabels σ U) ↔ p G U) : + RuleEquivariant (gatedRule p Phi) := by + classical + intro σ G U e + simp only [gatedRule, hp σ G U] + split_ifs + · exact hPhi σ G U e + · rfl + +theorem gatedRule_eq_of_gate {p : GraphCode → (ℕ → ℝ) → Prop} + {Phi : FactorRule} {G : GraphCode} {U : ℕ → ℝ} (h : p G U) : + gatedRule p Phi G U = Phi G U := by + classical + funext e + simp [gatedRule, h] + +theorem HasFUSFLaw.congr {Ω : Type} [MeasurableSpace Ω] + {G : GraphCode} {P : Measure Ω} {X Y : Ω → EdgeConfiguration} + (hX : HasFUSFLaw G P X) + (hY : ∀ e, Measurable (fun ω => Y ω e)) + (hXY : X =ᵐ[P] Y) : HasFUSFLaw G P Y := by + refine ⟨hY, ?_⟩ + intro H hH A B + have hcyl : + P {ω | (∀ e ∈ A, X ω e = true) ∧ (∀ e ∈ B, X ω e = false)} = + P {ω | (∀ e ∈ A, Y ω e = true) ∧ (∀ e ∈ B, Y ω e = false)} := by + apply measure_congr + filter_upwards [hXY] with ω hω + exact congrArg (fun f : EdgeConfiguration => + (∀ e ∈ A, f e = true) ∧ (∀ e ∈ B, f e = false)) hω + rw [← hcyl] + exact hX.2 H hH A B + +theorem gatedRule_ae_eq {Ω : Type} [MeasurableSpace Ω] + {P : Measure Ω} {p : GraphCode → (ℕ → ℝ) → Prop} + {Phi : FactorRule} {G : GraphCode} {U : Ω → ℕ → ℝ} + (hp : ∀ᵐ ω ∂P, p G (U ω)) : + (fun ω => gatedRule p Phi G (U ω)) =ᵐ[P] (fun ω => Phi G (U ω)) := by + filter_upwards [hp] with ω hω + exact gatedRule_eq_of_gate hω + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/SampledPathConcatenation.lean b/lean/OAI/Probability/SpanningForest/SampledPathConcatenation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e5cf5b8adba55ba69ec5500bd6af4d097f2bd00 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SampledPathConcatenation.lean @@ -0,0 +1,97 @@ +import OAI.Probability.SpanningForest.SampledUnitPath +import OAI.Probability.SpanningForest.PathConcatenation + +namespace OAI + +noncomputable section + +namespace Problem336.SampledPathConcatenation + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology BigOperators NNReal +open SampledUnitPath DyadicGaussianBound + +local instance : MeasurableSpace C(unitInterval, ℝ) := borel _ +local instance : BorelSpace C(unitInterval, ℝ) := ⟨rfl⟩ +local instance : MeasurableSpace C(ℝ, ℝ) := borel _ +local instance : BorelSpace C(ℝ, ℝ) := ⟨rfl⟩ + +def fullPath (τ : ℕ → ℝ≥0) (ω : ℕ → ℝ) : C(ℝ, ℝ) := + PathConcatenation.concatPath (pathBlock τ ω) + +theorem measurable_fullPath (τ : ℕ → ℝ≥0) : Measurable (fullPath τ) := + PathConcatenation.measurable_concatPath.comp (measurable_pathBlocks τ) + +variable {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} +variable (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) +variable (idx : ℕ → ℕ → ℕ) +variable (hidx : ∀ n k, τ (idx n k) = (k : ℝ≥0) / (2 : ℝ≥0) ^ n) +include hμ idx hidx + +theorem ae_fullPath_block_grid : + ∀ᵐ ω ∂μ, ∀ m n j : ℕ, ∀ (_ : j ≤ 2 ^ n) (t : unitInterval), + (t : ℝ) = DyadicInterpolation.grid n j → + fullPath τ ω ((m : ℝ) + t) = sample τ ω ((m : ℝ) + t) := by + filter_upwards [ae_pathBlock_grid hμ idx hidx, ae_pathBlock_endpoints hμ idx hidx, + ae_sample_zero hμ idx hidx] with ω hg he hz + intro m n j hj t ht + change PathConcatenation.concat (pathBlock τ ω) ((m : ℝ) + t) = _ + rw [PathConcatenation.concat_nat_add] + have hsum : (∑ k ∈ Finset.range m, + (pathBlock τ ω k PathConcatenation.rightEnd - + pathBlock τ ω k PathConcatenation.leftEnd)) = sample τ ω m - sample τ ω 0 := by + change (∑ k ∈ Finset.range m, (pathBlock τ ω k 1 - pathBlock τ ω k 0)) = _ + simp_rw [(he _).1, (he _).2] + simpa only [Nat.cast_add, Nat.cast_one, Nat.cast_zero] using + Finset.sum_range_sub (fun k : ℕ => sample τ ω (k : ℝ)) m + rw [hsum, hz, sub_zero, hg m n j hj t ht] + change sample τ ω m + (sample τ ω ((m : ℝ) + t) - pathBlock τ ω m 0) = _ + rw [(he m).1] + ring + +omit hμ idx hidx in + +lemma grid_decompose (n k : ℕ) : + ∃ (m j : ℕ) (t : unitInterval), j ≤ 2 ^ n ∧ + (t : ℝ) = DyadicInterpolation.grid n j ∧ + DyadicInterpolation.grid n k = (m : ℝ) + t := by + let m := k / 2 ^ n + let j := k % 2 ^ n + have hp : 0 < 2 ^ n := by positivity + have hj : j < 2 ^ n := Nat.mod_lt _ hp + have hjR : (j : ℝ) ≤ (2 : ℝ) ^ n := by exact_mod_cast hj.le + let t : unitInterval := ⟨DyadicInterpolation.grid n j, + ⟨by unfold DyadicInterpolation.grid; positivity, + by unfold DyadicInterpolation.grid; exact (div_le_one (by positivity)).mpr hjR⟩⟩ + refine ⟨m, j, t, hj.le, rfl, ?_⟩ + change (k : ℝ) / (2 : ℝ) ^ n = (m : ℝ) + (j : ℝ) / (2 : ℝ) ^ n + have hkj : j + 2 ^ n * m = k := Nat.mod_add_div k (2 ^ n) + have hcast : (j : ℝ) + (2 : ℝ) ^ n * (m : ℝ) = k := by exact_mod_cast hkj + apply (div_eq_iff (by positivity : (2 : ℝ) ^ n ≠ 0)).mpr + field_simp + nlinarith + +theorem ae_fullPath_grid : + ∀ᵐ ω ∂μ, ∀ n k : ℕ, + fullPath τ ω (DyadicInterpolation.grid n k) = + sample τ ω (DyadicInterpolation.grid n k) := by + filter_upwards [ae_fullPath_block_grid hμ idx hidx] with ω hω + intro n k + obtain ⟨m, j, t, hj, ht, hdecomp⟩ := grid_decompose n k + rw [hdecomp] + exact hω m n j hj t ht + +theorem ae_fullPath_coordinates : + ∀ᵐ ω ∂μ, ∀ n k : ℕ, + fullPath τ ω ((k : ℝ) / (2 : ℝ) ^ n) = ω (idx n k) := by + filter_upwards [ae_fullPath_grid hμ idx hidx, ae_time_consistent hμ] with ω hg hc + intro n k + rw [show ((k : ℝ) / (2 : ℝ) ^ n) = DyadicInterpolation.grid n k from rfl, hg n k] + have hs := sample_time_eq hc (idx n k) + simpa [hidx, DyadicInterpolation.grid, NNReal.coe_div, NNReal.coe_pow] using hs + +end Problem336.SampledPathConcatenation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/SampledUnitPath.lean b/lean/OAI/Probability/SpanningForest/SampledUnitPath.lean new file mode 100644 index 0000000000000000000000000000000000000000..d373abf2bebb2c121e251e884c42efff3e580596 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SampledUnitPath.lean @@ -0,0 +1,115 @@ +import OAI.Probability.SpanningForest.DyadicPathLimit +import OAI.Probability.SpanningForest.DyadicGaussianBound +import OAI.Probability.SpanningForest.DyadicTimes + +namespace OAI + +noncomputable section + +namespace Problem336.SampledUnitPath + +open MeasureTheory ProbabilityTheory Filter +open scoped Topology NNReal +open DyadicGaussianBound + +def pathBlock (τ : ℕ → ℝ≥0) (ω : ℕ → ℝ) (m : ℕ) : C(unitInterval, ℝ) := + DyadicPathLimit.unitPath (fun t => sample τ ω ((m : ℝ) + t)) + +section Measurability + +variable [MeasurableSpace C(unitInterval, ℝ)] [BorelSpace C(unitInterval, ℝ)] + +theorem measurable_pathBlock (τ : ℕ → ℝ≥0) (m : ℕ) : + Measurable (fun ω : ℕ → ℝ => pathBlock τ ω m) := + DyadicPathLimit.measurable_unitPath _ (fun _ => measurable_sample τ _) + +theorem measurable_pathBlocks (τ : ℕ → ℝ≥0) : + Measurable (fun ω : ℕ → ℝ => pathBlock τ ω) := + Measurable.of_eval (measurable_pathBlock τ) + +end Measurability + +lemma shift_grid (m n j : ℕ) : + ((m * 2 ^ n + j : ℕ) : ℝ) / (2 : ℝ) ^ n = + (m : ℝ) + DyadicInterpolation.grid n j := by + unfold DyadicInterpolation.grid + push_cast + field_simp + +lemma shift_grid_succ (m n j : ℕ) : + ((m * 2 ^ n + j + 1 : ℕ) : ℝ) / (2 : ℝ) ^ n = + (m : ℝ) + DyadicInterpolation.grid n (j + 1) := by + rw [Nat.add_assoc] + exact shift_grid m n (j + 1) + +def bound (n : ℕ) : ℝ := SchauderTail.incrementRatio ^ (n + 1) + +lemma bound_nonneg (n : ℕ) : 0 ≤ bound n := + pow_nonneg SchauderTail.incrementRatio_nonneg _ + +lemma summable_bound : Summable bound := by + change Summable (fun n : ℕ => SchauderTail.incrementRatio ^ (n + 1)) + simpa only [pow_succ] using + SchauderTail.summable_incrementRatio.mul_right SchauderTail.incrementRatio + +variable {τ : ℕ → ℝ≥0} {μ : Measure (ℕ → ℝ)} +variable (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ (CountableBrownian.family τ)) +variable (idx : ℕ → ℕ → ℕ) +variable (hidx : ∀ n k, τ (idx n k) = (k : ℝ≥0) / (2 : ℝ≥0) ^ n) + +include hμ idx hidx + +theorem ae_block_increment_bound : + ∀ᵐ ω ∂μ, ∀ m : ℕ, ∀ᶠ n in atTop, ∀ j < 2 ^ (n + 1), + |sample τ ω ((m : ℝ) + DyadicInterpolation.grid (n + 1) (j + 1)) - + sample τ ω ((m : ℝ) + DyadicInterpolation.grid (n + 1) j)| ≤ bound n := by + filter_upwards [ae_all_sample_increment_bound hμ idx hidx] with ω hω + intro m + obtain ⟨N, hN⟩ := eventually_atTop.mp (hω m) + filter_upwards [eventually_ge_atTop N] with n hn + intro j hj + have h := hN (n + 1) (by omega) ⟨j, hj⟩ + simpa only [shift_grid_succ, shift_grid, bound] using h + +theorem ae_pathBlock_grid : + ∀ᵐ ω ∂μ, ∀ m n j : ℕ, ∀ (_ : j ≤ 2 ^ n) (t : unitInterval), + (t : ℝ) = DyadicInterpolation.grid n j → + pathBlock τ ω m t = sample τ ω ((m : ℝ) + t) := by + filter_upwards [ae_block_increment_bound hμ idx hidx] with ω hω + intro m n j hj t ht + exact DyadicPathLimit.unitPath_grid _ bound bound_nonneg summable_bound + (hω m) n j hj t ht + +theorem ae_sample_zero : ∀ᵐ ω ∂μ, sample τ ω 0 = 0 := by + filter_upwards [ae_time_consistent hμ, ae_zero_coordinates hμ] with ω hc hz + have hi : τ (idx 0 0) = 0 := by simpa using hidx 0 0 + have hs := sample_time_eq hc (idx 0 0) + simpa [hi, hz _ hi] using hs + +theorem ae_pathBlock_endpoints : + ∀ᵐ ω ∂μ, ∀ m : ℕ, + pathBlock τ ω m 0 = sample τ ω m ∧ + pathBlock τ ω m 1 = sample τ ω ((m : ℝ) + 1) := by + filter_upwards [ae_pathBlock_grid hμ idx hidx] with ω hω + intro m + constructor + · simpa using hω m 0 0 (by norm_num) 0 (by simp [DyadicInterpolation.grid]) + · exact hω m 0 1 (by norm_num) 1 (by simp [DyadicInterpolation.grid]) + +omit hμ idx hidx in + +theorem ae_canonical_pathBlock_grid + {μ : Measure (ℕ → ℝ)} + (hμ : IsProjectiveLimit (α := fun _ : ℕ => ℝ) μ + (CountableBrownian.family DyadicTimes.enumeration)) : + ∀ᵐ ω ∂μ, ∀ m n j : ℕ, ∀ (_ : j ≤ 2 ^ n) (t : unitInterval), + (t : ℝ) = DyadicInterpolation.grid n j → + pathBlock DyadicTimes.enumeration ω m t = + sample DyadicTimes.enumeration ω ((m : ℝ) + t) := + ae_pathBlock_grid hμ Nat.pair (by intro n k; simp [DyadicTimes.grid]) + +end Problem336.SampledUnitPath + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/SchauderTail.lean b/lean/OAI/Probability/SpanningForest/SchauderTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ba842ae219311fc9e08d64539c458197179009a --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SchauderTail.lean @@ -0,0 +1,156 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace Problem336.SchauderTail + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + +lemma measure_abs_gt_le_fourth_moment (Z : Ω → ℝ) (hZ : AEMeasurable Z P) + (C : ℝ≥0∞) (hC : ∫⁻ ω, ‖Z ω‖ₑ ^ (4 : ℕ) ∂P ≤ C) + (b : ℝ) (hb : 0 < b) : + P {ω | b < |Z ω|} ≤ C / (ENNReal.ofReal b) ^ (4 : ℕ) := by + calc + P {ω | b < |Z ω|} ≤ P {ω | (ENNReal.ofReal b) ^ (4 : ℕ) ≤ ‖Z ω‖ₑ ^ (4 : ℕ)} := by + apply measure_mono + intro ω hω + change (ENNReal.ofReal b) ^ (4 : ℕ) ≤ ‖Z ω‖ₑ ^ (4 : ℕ) + apply pow_le_pow_left₀ (by positivity) + simpa [Real.enorm_eq_ofReal_abs] using ENNReal.ofReal_le_ofReal hω.le + _ ≤ (∫⁻ ω, ‖Z ω‖ₑ ^ (4 : ℕ) ∂P) / (ENNReal.ofReal b) ^ (4 : ℕ) := by + apply meas_ge_le_lintegral_div + · fun_prop + · exact pow_ne_zero _ (ENNReal.ofReal_ne_zero_iff.mpr hb) + · finiteness + _ ≤ C / (ENNReal.ofReal b) ^ (4 : ℕ) := by gcongr + +lemma fourth_threshold_identity (C : ℝ≥0∞) (n : ℕ) : + C / (ENNReal.ofReal ((4 / 3 : ℝ) ^ n)) ^ (4 : ℕ) = + C * ENNReal.ofReal (81 / 256 : ℝ) ^ n := by + rw [ENNReal.ofReal_pow (by norm_num), ← pow_mul, Nat.mul_comm n 4, pow_mul, + div_eq_mul_inv, ENNReal.inv_pow] + have hb : ((ENNReal.ofReal (4 / 3 : ℝ)) ^ (4 : ℕ))⁻¹ = + ENNReal.ofReal (81 / 256 : ℝ) := by + rw [← ENNReal.ofReal_pow (by norm_num), ← ENNReal.ofReal_inv_of_pos (by positivity)] + norm_num + rw [hb] + +lemma measure_bad_block_le (Z : (n : ℕ) → Fin (2 ^ n) → Ω → ℝ) + (hZ : ∀ n k, AEMeasurable (Z n k) P) (C : ℝ≥0∞) + (hC : ∀ n k, ∫⁻ ω, ‖Z n k ω‖ₑ ^ (4 : ℕ) ∂P ≤ C) (n : ℕ) : + P {ω | ∃ k : Fin (2 ^ n), (4 / 3 : ℝ) ^ n < |Z n k ω|} ≤ + C * ENNReal.ofReal (81 / 128 : ℝ) ^ n := by + classical + calc + P {ω | ∃ k : Fin (2 ^ n), (4 / 3 : ℝ) ^ n < |Z n k ω|} ≤ + ∑ k : Fin (2 ^ n), P {ω | (4 / 3 : ℝ) ^ n < |Z n k ω|} := by + rw [show {ω | ∃ k : Fin (2 ^ n), (4 / 3 : ℝ) ^ n < |Z n k ω|} = + ⋃ k : Fin (2 ^ n), {ω | (4 / 3 : ℝ) ^ n < |Z n k ω|} by ext ω; simp] + exact measure_iUnion_fintype_le P _ + _ ≤ ∑ _k : Fin (2 ^ n), C * ENNReal.ofReal (81 / 256 : ℝ) ^ n := by + apply Finset.sum_le_sum + intro k _ + rw [← fourth_threshold_identity] + exact measure_abs_gt_le_fourth_moment (Z n k) (hZ n k) C (hC n k) _ + (pow_pos (by norm_num) n) + _ = C * ENNReal.ofReal (81 / 128 : ℝ) ^ n := by + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, + Nat.cast_pow, Nat.cast_ofNat] + rw [mul_left_comm, ← mul_pow] + have hr : (2 : ℝ≥0∞) * ENNReal.ofReal (81 / 256 : ℝ) = + ENNReal.ofReal (81 / 128 : ℝ) := by + calc + (2 : ℝ≥0∞) * ENNReal.ofReal (81 / 256 : ℝ) = + ENNReal.ofReal ((2 : ℝ) * (81 / 256)) := by + simp only [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2), ENNReal.ofReal_ofNat] + _ = _ := by norm_num + rw [hr] + +theorem ae_eventually_dyadic_bound + (Z : (n : ℕ) → Fin (2 ^ n) → Ω → ℝ) + (hZ : ∀ n k, AEMeasurable (Z n k) P) (C : ℝ≥0∞) (hCfin : C < ∞) + (hC : ∀ n k, ∫⁻ ω, ‖Z n k ω‖ₑ ^ (4 : ℕ) ∂P ≤ C) : + ∀ᵐ ω ∂P, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), |Z n k ω| ≤ (4 / 3 : ℝ) ^ n := by + have hs : (∑' n, P {ω | ∃ k : Fin (2 ^ n), (4 / 3 : ℝ) ^ n < |Z n k ω|}) ≠ ∞ := by + apply ne_of_lt + apply lt_of_le_of_lt (ENNReal.tsum_le_tsum (measure_bad_block_le Z hZ C hC)) + rw [ENNReal.tsum_mul_left] + exact ENNReal.mul_lt_top hCfin (tsum_geometric_lt_top.mpr (ENNReal.ofReal_lt_one.mpr (by norm_num))) + filter_upwards [ae_eventually_notMem hs] with ω hω + filter_upwards [hω] with n hn + simpa only [Set.mem_ofPred_eq, not_exists, not_lt] using hn + +theorem ae_eventually_gaussian_dyadic_bound + (Z : (n : ℕ) → Fin (2 ^ n) → Ω → ℝ) + (hZ : ∀ n k, HasLaw (Z n k) (gaussianReal 0 1) P) : + ∀ᵐ ω ∂P, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), |Z n k ω| ≤ (4 / 3 : ℝ) ^ n := by + let C : ℝ≥0∞ := ∫⁻ x : ℝ, ‖x‖ₑ ^ (4 : ℕ) ∂gaussianReal 0 1 + have hCfin : C < ∞ := by + have hm := memLp_id_gaussianReal (μ := 0) (v := 1) (4 : ℝ≥0) + have ht := lintegral_rpow_enorm_lt_top_of_eLpNorm_lt_top + (p := (4 : ℝ≥0∞)) (by norm_num) (by norm_num) hm + simpa [C] using ht + apply ae_eventually_dyadic_bound Z (fun n k => (hZ n k).aemeasurable) C hCfin + intro n k + exact ((hZ n k).lintegral_comp (f := fun x : ℝ => ‖x‖ₑ ^ (4 : ℕ)) (by fun_prop)).le + +def incrementRatio : ℝ := (4 / 3) / Real.sqrt 2 + +lemma incrementRatio_nonneg : 0 ≤ incrementRatio := by + unfold incrementRatio + positivity + +lemma incrementRatio_lt_one : incrementRatio < 1 := by + have hs : 0 < Real.sqrt 2 := Real.sqrt_pos.2 (by norm_num) + have hsq : (Real.sqrt 2) ^ 2 = 2 := Real.sq_sqrt (by norm_num) + rw [incrementRatio, div_lt_one hs] + nlinarith + +lemma summable_incrementRatio : Summable (fun n : ℕ => incrementRatio ^ n) := + summable_geometric_of_lt_one incrementRatio_nonneg incrementRatio_lt_one + +theorem ae_eventually_gaussian_increment_bound + (D : (n : ℕ) → Fin (2 ^ n) → Ω → ℝ) + (hD : ∀ n k, HasLaw (D n k) (gaussianReal 0 ((2 : ℝ≥0)⁻¹ ^ n)) P) : + ∀ᵐ ω ∂P, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), |D n k ω| ≤ incrementRatio ^ n := by + let Z : (n : ℕ) → Fin (2 ^ n) → Ω → ℝ := + fun n k ω => (Real.sqrt 2) ^ n * D n k ω + have hZ (n : ℕ) (k : Fin (2 ^ n)) : HasLaw (Z n k) (gaussianReal 0 1) P := by + have hv : (NNReal.mk (((Real.sqrt 2) ^ n) ^ 2) (sq_nonneg _)) * + ((2 : ℝ≥0)⁻¹ ^ n) = 1 := by + apply NNReal.coe_injective + simp only [NNReal.coe_mul, NNReal.coe_mk, NNReal.coe_pow, + NNReal.coe_inv, NNReal.coe_ofNat, NNReal.coe_one] + rw [← pow_mul, Nat.mul_comm n 2, pow_mul, Real.sq_sqrt (by norm_num), ← mul_pow] + norm_num + have h := gaussianReal_const_mul (hD n k) ((Real.sqrt 2) ^ n) + rw [mul_zero, hv] at h + exact h + filter_upwards [ae_eventually_gaussian_dyadic_bound Z hZ] with ω hω + filter_upwards [hω] with n hn + intro k + have hk := hn k + have hs : 0 < (Real.sqrt 2) ^ n := pow_pos (Real.sqrt_pos.2 (by norm_num)) _ + rw [incrementRatio, div_pow] + apply (le_div_iff₀ hs).2 + simpa [Z, abs_mul, abs_of_pos hs, mul_comm] using hk + +theorem ae_all_eventually_gaussian_increment_bound {I : Type*} [Countable I] + (D : I → (n : ℕ) → Fin (2 ^ n) → Ω → ℝ) + (hD : ∀ i n k, HasLaw (D i n k) (gaussianReal 0 ((2 : ℝ≥0)⁻¹ ^ n)) P) : + ∀ᵐ ω ∂P, ∀ i, ∀ᶠ n in atTop, ∀ k : Fin (2 ^ n), + |D i n k ω| ≤ incrementRatio ^ n := by + apply ae_all_iff.mpr + intro i + exact ae_eventually_gaussian_increment_bound (D i) (hD i) + +end Problem336.SchauderTail + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/SchauderTents.lean b/lean/OAI/Probability/SpanningForest/SchauderTents.lean new file mode 100644 index 0000000000000000000000000000000000000000..af9d9200cc77f789fca0236b6dad653f59afabde --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SchauderTents.lean @@ -0,0 +1,290 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.SchauderTents + +def unitTent (t : ℝ) : ℝ := max 0 (min t (1 - t)) + +theorem continuous_unitTent : Continuous unitTent := by + unfold unitTent + fun_prop + +theorem unitTent_nonneg (t : ℝ) : 0 ≤ unitTent t := le_max_left _ _ + +theorem unitTent_le_half (t : ℝ) : unitTent t ≤ 1 / 2 := by + unfold unitTent + apply max_le (by norm_num) + by_cases h : t ≤ 1 / 2 + · exact (min_le_left _ _).trans h + · exact (min_le_right _ _).trans (by linarith) + +theorem unitTent_pos_iff (t : ℝ) : 0 < unitTent t ↔ 0 < t ∧ t < 1 := by + simp only [unitTent, lt_max_iff, lt_self_iff_false, false_or, lt_min_iff] + constructor <;> intro h <;> constructor <;> linarith [h.1, h.2] + +theorem unitTent_ne_zero_iff (t : ℝ) : unitTent t ≠ 0 ↔ 0 < t ∧ t < 1 := by + constructor + · intro h + exact (unitTent_pos_iff t).mp (lt_of_le_of_ne (unitTent_nonneg t) h.symm) + · intro h + exact ne_of_gt ((unitTent_pos_iff t).mpr h) + +theorem unitTent_eq_zero_of_le_zero {t : ℝ} (ht : t ≤ 0) : unitTent t = 0 := by + apply le_antisymm _ (unitTent_nonneg t) + exact max_le le_rfl ((min_le_left _ _).trans ht) + +theorem unitTent_eq_zero_of_one_le {t : ℝ} (ht : 1 ≤ t) : unitTent t = 0 := by + apply le_antisymm _ (unitTent_nonneg t) + exact max_le le_rfl ((min_le_right _ _).trans (by linarith)) + +@[simp] theorem unitTent_half : unitTent (1 / 2) = 1 / 2 := by + norm_num [unitTent] + +theorem unitTent_of_left {t : ℝ} (h₀ : 0 ≤ t) (h₁ : t ≤ 1 / 2) : + unitTent t = t := by + unfold unitTent + rw [min_eq_left (by linarith), max_eq_right h₀] + +theorem unitTent_of_right {t : ℝ} (h₀ : 1 / 2 ≤ t) (h₁ : t ≤ 1) : + unitTent t = 1 - t := by + unfold unitTent + rw [min_eq_right (by linarith), max_eq_right (by linarith)] + +theorem unitTent_midpoint_of_no_corner {a b : ℝ} (hab : a ≤ b) + (h : b ≤ 0 ∨ (0 ≤ a ∧ b ≤ 1 / 2) ∨ (1 / 2 ≤ a ∧ b ≤ 1) ∨ 1 ≤ a) : + unitTent ((a + b) / 2) = (unitTent a + unitTent b) / 2 := by + rcases h with h | h | h | h + · rw [unitTent_eq_zero_of_le_zero (by linarith), + unitTent_eq_zero_of_le_zero (by linarith), unitTent_eq_zero_of_le_zero h] + norm_num + · rw [unitTent_of_left (by linarith [h.1]) (by linarith [h.2]), + unitTent_of_left h.1 (by linarith [h.2]), + unitTent_of_left (by linarith [h.1]) h.2] + · rw [unitTent_of_right (by linarith [h.1]) (by linarith [h.2]), + unitTent_of_right h.1 (by linarith [h.2]), + unitTent_of_right (by linarith [h.1]) h.2] + ring + · rw [unitTent_eq_zero_of_one_le (by linarith), unitTent_eq_zero_of_one_le h, + unitTent_eq_zero_of_one_le (by linarith)] + norm_num + +theorem unitTent_even_grid_midpoint (d j k : ℕ) (hd : 0 < d) : + unitTent (((j : ℝ) + 1 / 2) / (2 * d) - k) = + (unitTent ((j : ℝ) / (2 * d) - k) + + unitTent (((j : ℝ) + 1) / (2 * d) - k)) / 2 := by + have hden : 0 < (2 : ℝ) * d := by positivity + have hden_ne : (2 : ℝ) * d ≠ 0 := ne_of_gt hden + have hmid : ((j : ℝ) + 1 / 2) / (2 * d) - k = + (((j : ℝ) / (2 * d) - k) + (((j : ℝ) + 1) / (2 * d) - k)) / 2 := by + ring + rw [hmid] + apply unitTent_midpoint_of_no_corner + · exact sub_le_sub_right (div_le_div_of_nonneg_right (by linarith) hden.le) _ + · by_cases h₀ : j < 2 * d * k + · left + have hj : (j : ℝ) + 1 ≤ 2 * d * k := by exact_mod_cast (Nat.succ_le_of_lt h₀) + exact sub_nonpos.mpr ((div_le_iff₀ hden).mpr (by nlinarith)) + · have h₀' : 2 * d * k ≤ j := le_of_not_gt h₀ + have ha : 0 ≤ (j : ℝ) / (2 * d) - k := by + apply sub_nonneg.mpr + apply (le_div_iff₀ hden).mpr + have : (2 : ℝ) * d * k ≤ j := by exact_mod_cast h₀' + nlinarith + by_cases h₁ : j < 2 * d * k + d + · right; left + refine ⟨ha, ?_⟩ + apply sub_le_iff_le_add.mpr + apply (div_le_iff₀ hden).mpr + have : (j : ℝ) + 1 ≤ 2 * d * k + d := by exact_mod_cast (Nat.succ_le_of_lt h₁) + nlinarith + · have h₁' : 2 * d * k + d ≤ j := le_of_not_gt h₁ + have ha' : 1 / 2 ≤ (j : ℝ) / (2 * d) - k := by + apply le_sub_iff_add_le.mpr + apply (le_div_iff₀ hden).mpr + have : (2 : ℝ) * d * k + d ≤ j := by exact_mod_cast h₁' + nlinarith + by_cases h₂ : j < 2 * d * (k + 1) + · right; right; left + refine ⟨ha', ?_⟩ + apply sub_le_iff_le_add.mpr + apply (div_le_iff₀ hden).mpr + have : (j : ℝ) + 1 ≤ 2 * d * (k + 1) := by exact_mod_cast (Nat.succ_le_of_lt h₂) + nlinarith + · right; right; right + apply le_sub_iff_add_le.mpr + apply (le_div_iff₀ hden).mpr + have : (2 : ℝ) * d * (k + 1) ≤ j := by exact_mod_cast (le_of_not_gt h₂) + nlinarith + +def amplitude (n : ℕ) : ℝ := (Real.sqrt 2)⁻¹ ^ n + +theorem amplitude_pos (n : ℕ) : 0 < amplitude n := by + unfold amplitude + positivity + +def tent (n k : ℕ) (t : ℝ) : ℝ := + amplitude n * unitTent ((2 : ℝ) ^ n * t - k) + +theorem continuous_tent (n k : ℕ) : Continuous (tent n k) := by + exact continuous_const.mul (continuous_unitTent.comp (by fun_prop)) + +theorem tent_nonneg (n k : ℕ) (t : ℝ) : 0 ≤ tent n k t := + mul_nonneg (amplitude_pos n).le (unitTent_nonneg _) + +theorem tent_le_half_amplitude (n k : ℕ) (t : ℝ) : + tent n k t ≤ amplitude n / 2 := by + unfold tent + simpa only [mul_one_div] using + mul_le_mul_of_nonneg_left (unitTent_le_half ((2 : ℝ) ^ n * t - k)) + (amplitude_pos n).le + +theorem tent_ne_zero_iff (n k : ℕ) (t : ℝ) : + tent n k t ≠ 0 ↔ (k : ℝ) < 2 ^ n * t ∧ 2 ^ n * t < k + 1 := by + rw [tent, mul_ne_zero_iff, and_iff_right (ne_of_gt (amplitude_pos n)), + unitTent_ne_zero_iff] + constructor <;> intro h <;> constructor <;> linarith [h.1, h.2] + +theorem tent_disjoint (n : ℕ) {k l : ℕ} (hkl : k ≠ l) (t : ℝ) + (hk : tent n k t ≠ 0) : tent n l t = 0 := by + by_contra hl + obtain ⟨hk₁, hk₂⟩ := (tent_ne_zero_iff n k t).mp hk + obtain ⟨hl₁, hl₂⟩ := (tent_ne_zero_iff n l t).mp hl + rcases lt_or_gt_of_ne hkl with h | h + · have : (k : ℝ) + 1 ≤ l := by exact_mod_cast h + linarith + · have : (l : ℝ) + 1 ≤ k := by exact_mod_cast h + linarith + +def level (n : ℕ) (z : ℕ → ℝ) (t : ℝ) : ℝ := + ∑ k ∈ Finset.range (2 ^ n), z k * tent n k t + +theorem continuous_level (n : ℕ) (z : ℕ → ℝ) : Continuous (level n z) := by + unfold level + exact continuous_finsetSum _ fun k _ => continuous_const.mul (continuous_tent n k) + +theorem abs_level_le (n : ℕ) (z : ℕ → ℝ) {C : ℝ} (hC : 0 ≤ C) + (hz : ∀ k < 2 ^ n, |z k| ≤ C) (t : ℝ) : + |level n z t| ≤ C * amplitude n / 2 := by + classical + by_cases h : ∃ k ∈ Finset.range (2 ^ n), tent n k t ≠ 0 + · obtain ⟨k, hk, hkt⟩ := h + have hsum : level n z t = z k * tent n k t := by + unfold level + apply Finset.sum_eq_single k + · intro l hl hlk + rw [tent_disjoint n (Ne.symm hlk) t hkt, mul_zero] + · exact fun hnot => (hnot hk).elim + rw [hsum, abs_mul, abs_of_nonneg (tent_nonneg n k t)] + calc + |z k| * tent n k t ≤ C * tent n k t := + mul_le_mul_of_nonneg_right (hz k (Finset.mem_range.mp hk)) (tent_nonneg n k t) + _ ≤ C * (amplitude n / 2) := + mul_le_mul_of_nonneg_left (tent_le_half_amplitude n k t) hC + _ = C * amplitude n / 2 := by ring + · have hzero : level n z t = 0 := by + unfold level + apply Finset.sum_eq_zero + intro k hk + have hkt : tent n k t = 0 := by + by_contra hne + exact h ⟨k, hk, hne⟩ + rw [hkt, mul_zero] + rw [hzero, abs_zero] + exact div_nonneg (mul_nonneg hC (amplitude_pos n).le) (by norm_num) + +theorem unitTent_nat_sub (j k : ℕ) : unitTent ((j : ℝ) - k) = 0 := by + by_cases h : j ≤ k + · apply unitTent_eq_zero_of_le_zero + have : (j : ℝ) ≤ k := by exact_mod_cast h + linarith + · apply unitTent_eq_zero_of_one_le + have : (k : ℝ) + 1 ≤ j := by exact_mod_cast (Nat.succ_le_of_lt (lt_of_not_ge h)) + linarith + +theorem tent_grid_zero (n k j : ℕ) : tent n k ((j : ℝ) / 2 ^ n) = 0 := by + have hpow : (2 : ℝ) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) + have harg : (2 : ℝ) ^ n * ((j : ℝ) / 2 ^ n) - k = (j : ℝ) - k := by + field_simp + rw [tent, harg, unitTent_nat_sub, mul_zero] + +theorem tent_prior_grid_zero (n r k j : ℕ) : + tent (n + r) k ((j : ℝ) / 2 ^ n) = 0 := by + have hpow : (2 : ℝ) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) + have harg : (2 : ℝ) ^ (n + r) * ((j : ℝ) / 2 ^ n) - k = + (((2 ^ r * j : ℕ) : ℝ) - k) := by + push_cast + rw [pow_add] + field_simp + rw [tent, harg, unitTent_nat_sub, mul_zero] + +theorem level_prior_grid_zero (n r j : ℕ) (z : ℕ → ℝ) : + level (n + r) z ((j : ℝ) / 2 ^ n) = 0 := by + simp [level, tent_prior_grid_zero] + +def midpoint (n k : ℕ) : ℝ := ((k : ℝ) + 1 / 2) / 2 ^ n + +theorem tent_at_midpoint (n k : ℕ) : + tent n k (midpoint n k) = amplitude n / 2 := by + have hpow : (2 : ℝ) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) + have harg : (2 : ℝ) ^ n * midpoint n k - k = 1 / 2 := by + unfold midpoint + field_simp + ring + rw [tent, harg, unitTent_half] + ring + +theorem tent_at_other_midpoint (n : ℕ) {k l : ℕ} (hkl : k ≠ l) : + tent n l (midpoint n k) = 0 := by + apply tent_disjoint n hkl + rw [tent_at_midpoint] + exact ne_of_gt (div_pos (amplitude_pos n) (by norm_num)) + +theorem level_at_midpoint (n k : ℕ) (z : ℕ → ℝ) (hk : k < 2 ^ n) : + level n z (midpoint n k) = z k * amplitude n / 2 := by + classical + unfold level + rw [Finset.sum_eq_single k] + · rw [tent_at_midpoint] + ring + · intro l hl hlk + rw [tent_at_other_midpoint n (Ne.symm hlk), mul_zero] + · intro hnot + exact (hnot (Finset.mem_range.mpr hk)).elim + +theorem tent_old_midpoint (m r k j : ℕ) : + tent m k (midpoint (m + r + 1) j) = + (tent m k ((j : ℝ) / 2 ^ (m + r + 1)) + + tent m k (((j : ℝ) + 1) / 2 ^ (m + r + 1))) / 2 := by + have hscale (q : ℝ) : + (2 : ℝ) ^ m * (q / 2 ^ (m + r + 1)) = q / (2 * (2 ^ r : ℕ)) := by + push_cast + rw [pow_add, pow_add, pow_one] + field_simp + simp only [tent, midpoint, hscale] + rw [unitTent_even_grid_midpoint (2 ^ r) j k (by positivity)] + ring + +theorem tent_old_midpoint_of_lt {m n : ℕ} (hmn : m < n) (k j : ℕ) : + tent m k (midpoint n j) = + (tent m k ((j : ℝ) / 2 ^ n) + tent m k (((j : ℝ) + 1) / 2 ^ n)) / 2 := by + obtain ⟨r, hr⟩ := Nat.exists_eq_add_of_le (Nat.succ_le_of_lt hmn) + have hn : n = m + r + 1 := by omega + rw [hn] + exact tent_old_midpoint m r k j + +theorem level_old_midpoint {m n : ℕ} (hmn : m < n) (z : ℕ → ℝ) (j : ℕ) : + level m z (midpoint n j) = + (level m z ((j : ℝ) / 2 ^ n) + level m z (((j : ℝ) + 1) / 2 ^ n)) / 2 := by + simp only [level, tent_old_midpoint_of_lt hmn, ← mul_div_assoc, mul_add, + ← Finset.sum_div, Finset.sum_add_distrib] + +end Problem336.SchauderTents + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/SlopeReadout.lean b/lean/OAI/Probability/SpanningForest/SlopeReadout.lean new file mode 100644 index 0000000000000000000000000000000000000000..43b7cd9ab276463905cad7d670a0c0a2c1160459 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SlopeReadout.lean @@ -0,0 +1,118 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped Topology + +namespace Problem336.SlopeReadout + +def slope (z : ℕ → ℝ) (n : ℕ) : ℝ := + z (n + 1) / (n + 1 : ℕ) + +def readout (z : ℕ → ℝ) : Bool := + if (1 / 2 : ℝ) < Filter.limsup (slope z) Filter.atTop then true else false + +@[fun_prop] +theorem measurable_slope (n : ℕ) : Measurable (fun z : ℕ → ℝ => slope z n) := by + have h : Measurable (fun z : ℕ → ℝ => z (n + 1)) := measurable_pi_apply _ + exact h.div_const ((n + 1 : ℕ) : ℝ) + +@[fun_prop] +theorem measurable_readout : Measurable readout := by + unfold readout + exact Measurable.ite + (measurableSet_lt measurable_const (Measurable.limsup measurable_slope)) + measurable_const measurable_const + +theorem readout_of_tendsto {z : ℕ → ℝ} {x : ℝ} + (hz : Tendsto (slope z) atTop (nhds x)) : + readout z = if (1 / 2 : ℝ) < x then true else false := by + unfold readout + rw [hz.limsup_eq] + +theorem readout_of_tendsto_bool {z : ℕ → ℝ} {x : Bool} + (hz : Tendsto (slope z) atTop (nhds (if x then (1 : ℝ) else 0))) : + readout z = x := by + rw [readout_of_tendsto hz] + cases x <;> norm_num + +theorem tendsto_slope_observation {B : ℕ → ℝ} {x : ℝ} + (hB : Tendsto (slope B) atTop (nhds 0)) : + Tendsto (slope (fun n => (n : ℝ) * x + B n)) atTop (nhds x) := by + have heq : slope (fun n => (n : ℝ) * x + B n) = + fun n => x + slope B n := by + funext n + have hn : ((n + 1 : ℕ) : ℝ) ≠ 0 := by positivity + simp only [slope, add_div] + rw [mul_div_cancel_left₀ x hn] + rw [heq] + simpa using tendsto_const_nhds.add hB + +theorem readout_observation {B : ℕ → ℝ} (x : Bool) + (hB : Tendsto (slope B) atTop (nhds 0)) : + readout (fun n => (n : ℝ) * (if x then 1 else 0) + B n) = x := by + exact readout_of_tendsto_bool (tendsto_slope_observation hB) + +def family {ι : Type*} (z : ι → ℕ → ℝ) : ι → Bool := + fun i => readout (z i) + +@[fun_prop] +theorem measurable_family {ι : Type*} : Measurable (@family ι) := by + apply measurable_pi_iff.2 + intro i + exact measurable_readout.comp (measurable_pi_apply i) + +theorem family_reindex {ι κ : Type*} (σ : κ → ι) (z : ι → ℕ → ℝ) : + family (fun j => z (σ j)) = fun j => family z (σ j) := rfl + +theorem family_eq_ae_of_tendsto {ι Ω : Type*} [Countable ι] [MeasurableSpace Ω] + {P : Measure Ω} {Y : Ω → ι → ℕ → ℝ} {X : Ω → ι → Bool} + (hY : ∀ i, ∀ᵐ ω ∂P, Tendsto (slope (Y ω i)) atTop + (nhds (if X ω i then (1 : ℝ) else 0))) : + (fun ω => family (Y ω)) =ᵐ[P] X := by + filter_upwards [ae_all_iff.2 hY] with ω hω + funext i + exact readout_of_tendsto_bool (hω i) + +theorem law_transfer {ι Ω Noise : Type*} [Countable ι] + [MeasurableSpace Ω] [MeasurableSpace Noise] + {P : Measure Ω} {μ : Measure Noise} + {W : Ω → Noise} {Z : Noise → ι → ℕ → ℝ} + {Y : Ω → ι → ℕ → ℝ} {X : Ω → ι → Bool} + (hW : Measurable W) (hZ : Measurable Z) (hLaw : P.map W = μ) + (hDecoder : (fun ω => Z (W ω)) =ᵐ[P] Y) + (hSlopes : ∀ i, ∀ᵐ ω ∂P, Tendsto (slope (Y ω i)) atTop + (nhds (if X ω i then (1 : ℝ) else 0))) : + μ.map (fun w => family (Z w)) = P.map X := by + rw [← hLaw] + change (P.map W).map (family ∘ Z) = P.map X + rw [Measure.map_map (measurable_family.comp hZ) hW] + apply Measure.map_congr + filter_upwards [hDecoder, family_eq_ae_of_tendsto hSlopes] with ω hD hS + change family (Z (W ω)) = X ω + rw [hD] + exact hS + +theorem law_transfer_observation {ι Ω Noise : Type*} [Countable ι] + [MeasurableSpace Ω] [MeasurableSpace Noise] + {P : Measure Ω} {μ : Measure Noise} + {W : Ω → Noise} {Z : Noise → ι → ℕ → ℝ} + {B : Ω → ι → ℕ → ℝ} {X : Ω → ι → Bool} + (hW : Measurable W) (hZ : Measurable Z) (hLaw : P.map W = μ) + (hDecoder : (fun ω => Z (W ω)) =ᵐ[P] + (fun ω i n => (n : ℝ) * (if X ω i then 1 else 0) + B ω i n)) + (hNoise : ∀ i, ∀ᵐ ω ∂P, Tendsto (slope (B ω i)) atTop (nhds 0)) : + μ.map (fun w => family (Z w)) = P.map X := by + apply law_transfer hW hZ hLaw hDecoder + intro i + filter_upwards [hNoise i] with ω hω + exact tendsto_slope_observation hω + +end Problem336.SlopeReadout + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/StochasticBundle.lean b/lean/OAI/Probability/SpanningForest/StochasticBundle.lean new file mode 100644 index 0000000000000000000000000000000000000000..6851df38a7c7983aed0aa5995087ca1436683462 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/StochasticBundle.lean @@ -0,0 +1,40 @@ +import OAI.Probability.SpanningForest.InnovationFiniteGaussian +import OAI.Probability.SpanningForest.BrownianFamilyIdentification +import OAI.Probability.SpanningForest.BrownianFamilyNoise +import OAI.Probability.SpanningForest.BrownianReference +import OAI.Probability.SpanningForest.InnovationGaussianObservation +import OAI.Probability.SpanningForest.ContinuousPathLaw +import OAI.Probability.SpanningForest.BrownianCanonicalPosterior +import OAI.Probability.SpanningForest.InnovationGaussianProcess +import OAI.Probability.SpanningForest.BrownianFinitePosterior +import OAI.Probability.SpanningForest.GaussianPosteriorAllTime +import OAI.Probability.SpanningForest.InnovationStep +import OAI.Probability.SpanningForest.BrownianPosteriorReduction +import OAI.Probability.SpanningForest.FiniteObservationReduction +import OAI.Probability.SpanningForest.InnovationPhaseRecurrence +import OAI.Probability.SpanningForest.InnovationIdentification +import OAI.Probability.SpanningForest.InnovationGaussianLaw +import OAI.Probability.SpanningForest.InnovationProjection +import OAI.Probability.SpanningForest.FullObservationPosterior +import OAI.Probability.SpanningForest.ConditionalInnovation +import OAI.Probability.SpanningForest.InnovationErrorRate +import OAI.Probability.SpanningForest.PathConcatenation +import OAI.Probability.SpanningForest.PosteriorIndependentExtension +import OAI.Probability.SpanningForest.FinitePosterior +import OAI.Probability.SpanningForest.GaussianObservationKernel +import OAI.Probability.SpanningForest.InnovationLawIdentification +import OAI.Probability.SpanningForest.GaussianMomentScaling +import OAI.Probability.SpanningForest.GaussianSum +import OAI.Probability.SpanningForest.BrownianSublinear +import OAI.Probability.SpanningForest.GaussianObservationDensity +import OAI.Probability.SpanningForest.BitRecovery +import OAI.Probability.SpanningForest.BrownianBridge +import OAI.Probability.SpanningForest.GaussianBoundedCorrection +import OAI.Probability.SpanningForest.InnovationMean +import OAI.Probability.SpanningForest.InnovationMartingale +import OAI.Probability.SpanningForest.InnovationMoments +import OAI.Probability.SpanningForest.InnovationSubdivision +import OAI.Probability.SpanningForest.CharacteristicTaylor +import OAI.Probability.SpanningForest.CharacteristicRemainder +import OAI.Probability.SpanningForest.ObservationPosterior +import OAI.Probability.SpanningForest.SlopeReadout diff --git a/lean/OAI/Probability/SpanningForest/SubtypeSubsetSums.lean b/lean/OAI/Probability/SpanningForest/SubtypeSubsetSums.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8567a797b031f5678c8db91879a64c358a73c6e --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/SubtypeSubsetSums.lean @@ -0,0 +1,62 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.SubtypeSubsetSums + +variable {α : Type*} + +def forget (s : Finset α) (T : Finset s) : Finset α := + T.map (Function.Embedding.subtype (· ∈ s)) + +@[simp] theorem card_forget (s : Finset α) (T : Finset s) : + (forget s T).card = T.card := Finset.card_map _ + +@[simp] theorem mem_forget (s : Finset α) (T : Finset s) (a : s) : + a.val ∈ forget s T ↔ a ∈ T := by + simp [forget] + +theorem forget_subset (s : Finset α) (T : Finset s) : forget s T ⊆ s := by + intro a ha + obtain ⟨b, _, rfl⟩ := Finset.mem_map.mp ha + exact b.property + +@[simp] theorem forget_univ (s : Finset α) : + forget s Finset.univ = s := by + rw [forget, Finset.univ_eq_attach, Finset.attach_map_val] + +theorem sum_powersetCard {R : Type*} [AddCommMonoid R] + (s : Finset α) (k : ℕ) (F : Finset α → R) : + (∑ T ∈ (Finset.univ : Finset s).powersetCard k, F (forget s T)) = + ∑ T ∈ s.powersetCard k, F T := by + have hm := Finset.powersetCard_map + (Function.Embedding.subtype (· ∈ s)) k (Finset.univ : Finset s) + have hu : (Finset.univ : Finset s).map + (Function.Embedding.subtype (· ∈ s)) = s := forget_univ s + rw [hu] at hm + rw [hm, Finset.sum_map] + rfl + +theorem prod_forget {R : Type*} [CommMonoid R] + (s : Finset α) (T : Finset s) (c : α → R) : + (∏ e ∈ forget s T, c e) = ∏ e ∈ T, c e.val := by + exact Finset.prod_map T (Function.Embedding.subtype (· ∈ s)) c + +theorem sum_powersetCard_filter {R : Type*} [AddCommMonoid R] + (s : Finset α) (k : ℕ) (P : Finset α → Prop) [DecidablePred P] + (F : Finset α → R) : + (∑ T ∈ ((Finset.univ : Finset s).powersetCard k).filter (fun T => P (forget s T)), + F (forget s T)) = + ∑ T ∈ (s.powersetCard k).filter P, F T := by + simp only [Finset.sum_filter] + exact sum_powersetCard s k (fun T => if P T then F T else 0) + +end Problem336.SubtypeSubsetSums + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/Theory.lean b/lean/OAI/Probability/SpanningForest/Theory.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e3d7f3773fdeac8b0c75c1af831c9918308ed39 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/Theory.lean @@ -0,0 +1,45 @@ +import OAI.Probability.SpanningForest.AllPairWiener +import OAI.Probability.SpanningForest.GlobalWiener +import OAI.Probability.SpanningForest.EquivariantFUSFKernel +import OAI.Probability.SpanningForest.LawLimits +import OAI.Probability.SpanningForest.GraphTreePosteriorEquiv +import OAI.Probability.SpanningForest.FUSFRelabelMeasure +import OAI.Probability.SpanningForest.PicardNonnegativeSampler +import OAI.Probability.SpanningForest.DecoderBundle +import OAI.Probability.SpanningForest.BorelFUSFKernel +import OAI.Probability.SpanningForest.EdgeUniformRule +import OAI.Probability.SpanningForest.HilbertBundle +import OAI.Probability.SpanningForest.MatrixTreeSupport +import OAI.Probability.SpanningForest.NoCollisionExtension +import OAI.Probability.SpanningForest.StochasticBundle +import OAI.Probability.SpanningForest.AnalyticSupport +import OAI.Probability.SpanningForest.GraphDomain +import OAI.Probability.SpanningForest.RuleExtension +import OAI.Probability.SpanningForest.EdgeAction +import OAI.Probability.SpanningForest.GraphBalls +import OAI.Probability.SpanningForest.USTCylinder +import OAI.Probability.SpanningForest.FUSFLawUnique +import OAI.Probability.SpanningForest.GraphBorel +import OAI.Probability.SpanningForest.LabelNoCollision +import OAI.Probability.SpanningForest.GraphEncoding +import OAI.Probability.SpanningForest.FiniteUSTMeasure +import OAI.Probability.SpanningForest.CylinderLimitMeasure +import OAI.Probability.SpanningForest.FiniteUSTLimit +import OAI.Probability.SpanningForest.Exhaustion +import OAI.Probability.SpanningForest.IntrinsicExhaustion +import OAI.Probability.SpanningForest.UniformSampler +import OAI.Probability.SpanningForest.CanonicalIID +import OAI.Probability.SpanningForest.FiniteUSTRelabel + +import OAI.Probability.SpanningForest.GraphFUSFLaw + +import OAI.Probability.SpanningForest.CanonicalFUSFLaw +import OAI.Probability.SpanningForest.CodedMarginal +import OAI.Probability.SpanningForest.IntrinsicHalfResponse +import OAI.Probability.SpanningForest.IntrinsicPosteriorDrift +import OAI.Probability.SpanningForest.FUSFPosteriorResponse +import OAI.Probability.SpanningForest.AllPairPosteriorDrift +import OAI.Probability.SpanningForest.InnovationProcessLaw +import OAI.Probability.SpanningForest.CanonicalPosteriorMartingale +import OAI.Probability.SpanningForest.CanonicalBrownianReference +import OAI.Probability.SpanningForest.GraphLaw diff --git a/lean/OAI/Probability/SpanningForest/TiltResponse.lean b/lean/OAI/Probability/SpanningForest/TiltResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..fab634c2e5aa3b08914c74a30bc161316d602548 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TiltResponse.lean @@ -0,0 +1,82 @@ +import OAI.Probability.SpanningForest.ExponentialFamily +import OAI.Probability.SpanningForest.FiniteGradientResponse + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.TiltResponse + +open ExponentialFamily + +variable {α ι : Type*} [Fintype α] + +def cov (w g f q : α → ℝ) (t : ℝ) : ℝ := + mean w g (fun a => f a * q a) t - mean w g f t * mean w g q t + +lemma mean_const_mul (w g f : α → ℝ) (r t : ℝ) : + mean w g (fun a => r * f a) t = r * mean w g f t := by + simp only [mean_eq_sum_mass] + simp_rw [show ∀ a, mass w g t a * (r * f a) = r * (mass w g t a * f a) + by intro a; ring] + exact (Finset.mul_sum _ _ _).symm + +lemma mean_sum (E : Finset ι) (w g : α → ℝ) (f : ι → α → ℝ) (t : ℝ) : + mean w g (fun a => ∑ i ∈ E, f i a) t = ∑ i ∈ E, mean w g (f i) t := by + simp only [mean_eq_sum_mass, Finset.mul_sum] + exact Finset.sum_comm + +lemma cov_const_mul_right (w g f q : α → ℝ) (r t : ℝ) : + cov w g f (fun a => r * q a) t = r * cov w g f q t := by + unfold cov + simp_rw [show ∀ a, f a * (r * q a) = r * (f a * q a) by intro a; ring] + rw [mean_const_mul, mean_const_mul] + ring + +lemma cov_sum_right (E : Finset ι) (w g f : α → ℝ) (q : ι → α → ℝ) (t : ℝ) : + cov w g f (fun a => ∑ i ∈ E, q i a) t = ∑ i ∈ E, cov w g f (q i) t := by + simp only [cov, Finset.mul_sum] + rw [mean_sum, mean_sum, Finset.mul_sum, Finset.sum_sub_distrib] + +theorem mean_sub_le_of_cov_le (w g f : α → ℝ) (L : ℝ) + (hZ : ∀ t ∈ Set.Icc (0 : ℝ) 1, partition w g t ≠ 0) + (hcov : ∀ t ∈ Set.Ico (0 : ℝ) 1, |cov w g f g t| ≤ L) : + |mean w g f 1 - mean w g f 0| ≤ L := by + rw [← Real.norm_eq_abs] + apply norm_image_sub_le_of_norm_deriv_le_segment_01' + · intro t ht + exact (hasDerivAt_mean w g f t (hZ t ht)).hasDerivWithinAt + · intro t ht + simpa only [Real.norm_eq_abs, cov] using hcov t ht + +theorem cov_direction_le (E : Finset ι) (w g f : α → ℝ) + (x : ι → α → ℝ) (direction : ι → ℝ) (t L D : ℝ) + (hD : 0 ≤ D) (hdir : ∀ i ∈ E, |direction i| ≤ D) + (hrow : (∑ i ∈ E, |cov w g f (x i) t|) ≤ L) : + |cov w g f (fun a => ∑ i ∈ E, direction i * x i a) t| ≤ L * D := by + rw [cov_sum_right] + simp_rw [cov_const_mul_right, mul_comm (direction _)] + exact FiniteGradientResponse.abs_sum_mul_le E (fun i => cov w g f (x i) t) + direction L D hD hrow hdir + +theorem mean_sub_le_of_covariance_row (E : Finset ι) (w f : α → ℝ) + (x : ι → α → ℝ) (direction : ι → ℝ) (L D : ℝ) + (hw : ∀ a, 0 ≤ w a) (hpos : ∃ a, 0 < w a) + (hD : 0 ≤ D) (hdir : ∀ i ∈ E, |direction i| ≤ D) + (hrow : ∀ t ∈ Set.Ico (0 : ℝ) 1, + (∑ i ∈ E, |cov w (fun a => ∑ j ∈ E, direction j * x j a) f (x i) t|) ≤ L) : + |mean w (fun a => ∑ i ∈ E, direction i * x i a) f 1 - + mean w (fun a => ∑ i ∈ E, direction i * x i a) f 0| ≤ L * D := by + apply mean_sub_le_of_cov_le + · intro t _ + exact ne_of_gt (partition_pos w _ t hw hpos) + · intro t ht + exact cov_direction_le E w _ f x direction t L D hD hdir (hrow t ht) + +end Problem336.TiltResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/TotalTreeResponse.lean b/lean/OAI/Probability/SpanningForest/TotalTreeResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b018b6f0739e01b4510577d2c2ff4f02fde024c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TotalTreeResponse.lean @@ -0,0 +1,99 @@ +import OAI.Probability.SpanningForest.GraphTreeResponse + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace Intrinsic + +theorem exhaustion_finiteConnected_of_finite (G : GraphCode) (e : EdgeCode) + (he : Adj G e.1.1 e.1.2) (n : ℕ) (hf : (Problem336.edgeBall G n e).Finite) : + IsFiniteConnectedSubgraph G (exhaustion G e n) := by + have hm (v : ℕ) : v ∈ (exhaustion G e n).1 ↔ v ∈ Problem336.edgeBall G n e := by + simp [exhaustion, edgeBallCode, finiteSetCode, hf] + have ha (u v : ℕ) : SubgraphAdj (exhaustion G e n) u v ↔ + u ∈ Problem336.edgeBall G n e ∧ v ∈ Problem336.edgeBall G n e ∧ Adj G u v := by + simp [exhaustion, subgraphAdj_inducedCode, edgeBallCode, finiteSetCode, hf] + have hpath (v : ℕ) (hv : v ∈ (exhaustion G e n).1) : + Relation.ReflTransGen (SubgraphAdj (exhaustion G e n)) e.1.1 v := by + have hv' : v ∈ IntrinsicExhaustion.edgeBall G e n := by + rw [← edgeBall_eq_selected] + exact (hm v).mp hv + apply Relation.ReflTransGen.mono _ _ _ (IntrinsicExhaustion.edgeBall_reachable he hv') + intro u w huw + apply (ha u w).mpr + simpa only [edgeBall_eq_selected] using huw + refine ⟨⟨e.1.1, (hm _).mpr (Or.inl (withinRadius_refl G n _))⟩, ?_, ?_⟩ + · intro p hp + exact (mem_inducedCode_edges G _ p).mp hp + · intro u hu v hv + let : Std.Symm (SubgraphAdj (exhaustion G e n)) := ⟨fun x y hxy => by + obtain ⟨hx, hy, hadj⟩ := (ha x y).mp hxy + exact (ha y x).mpr ⟨hy, hx, (G.2.2 y x).trans hadj⟩⟩ + exact (symm (hpath u hu)).trans (hpath v hv) + +theorem exhaustion_eq_empty_of_not_finite (G : GraphCode) (e : EdgeCode) (n : ℕ) + (hf : ¬ (Problem336.edgeBall G n e).Finite) : + exhaustion G e n = (∅, ∅) := by + simp [exhaustion, edgeBallCode, finiteSetCode, hf, inducedCode] + +end Intrinsic + +namespace GraphTreePosterior + +theorem mean_empty (e : EdgeCode) (S : Finset EdgeCode) (t : ℝ) (y : EdgeCode → ℝ) : + mean (∅, ∅) e S t y = 0 := by + classical + have htrees : spanningTrees (∅, ∅) = ∅ := by + apply Finset.filter_eq_empty_iff.mpr + intro tree _ htree + have hcard : tree.card + 1 = 0 := htree.2.1 + omega + simp [mean, numerator, partition, htrees] + +theorem finiteBallMean_response_total (G : GraphCode) + (hresponse : ∀ (K : FiniteSubgraphCode), IsFiniteConnectedSubgraph G K → + ∀ (a b : USTResponse.FiniteEdge K → ℝ) + (e : USTResponse.FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2) + (e : EdgeCode) (n m : ℕ) (t : ℝ) (y z : EdgeCode → ℝ) + (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f ∈ edgeCodes (Intrinsic.exhaustion G e n), |y f - z f| ≤ D) : + |finiteBallMean G e n m t y - finiteBallMean G e n m t z| ≤ D / 2 := by + by_cases he : Adj G e.1.1 e.1.2 + · by_cases hf : (Problem336.edgeBall G m e).Finite + · have hK := Intrinsic.exhaustion_finiteConnected_of_finite G e he m hf + exact mean_response_of_inclusion_response (Intrinsic.exhaustion G e m) + (FiniteEncoding.spanningTrees_nonempty hK) (hresponse _ hK) + e (edgeCodes (Intrinsic.exhaustion G e n)) t y z D hD hyz + · simp only [finiteBallMean, Intrinsic.exhaustion_eq_empty_of_not_finite G e m hf, + mean_empty, sub_self, abs_zero] + exact div_nonneg hD (by norm_num) + · simp only [finiteBallMean_of_not_adj e he, sub_self, abs_zero] + exact div_nonneg hD (by norm_num) + +theorem drift_response_total (G : GraphCode) + (hresponse : ∀ (K : FiniteSubgraphCode), IsFiniteConnectedSubgraph G K → + ∀ (a b : USTResponse.FiniteEdge K → ℝ) + (e : USTResponse.FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2) + (t : ℝ) (y z : EdgeCode → ℝ) (D : ℝ) (hD : 0 ≤ D) + (hyz : ∀ f, Adj G f.1.1 f.1.2 → |y f - z f| ≤ D) (e : EdgeCode) : + |drift G t y e - drift G t z e| ≤ D / 2 := by + apply drift_response_of_finite e t y z + intro n m + apply finiteBallMean_response_total G hresponse e n m t y z D hD + intro f hf + apply hyz f + exact ((mem_inducedCode_edges G (edgeBallCode G n e) f.1).mp + ((mem_edgeCodes (Intrinsic.exhaustion G e n) f).mp hf)).2.2.2 + +end GraphTreePosterior +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/TransferCurrent.lean b/lean/OAI/Probability/SpanningForest/TransferCurrent.lean new file mode 100644 index 0000000000000000000000000000000000000000..55483f60018d9c8ffe3a4e03a436c14edc4fa9a9 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TransferCurrent.lean @@ -0,0 +1,303 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix Matrix.Norms.Operator + +namespace Problem336.TransferCurrent + +variable {n : Type*} [Fintype n] [DecidableEq n] + +local instance : TopologicalSpace (Matrix n n ℝ) := + (Matrix.linftyOpNormedAddCommGroup : NormedAddCommGroup (Matrix n n ℝ)).toMetricSpace.toUniformSpace.toTopologicalSpace + +def bilinear (M : Matrix n n ℝ) (a b : n → ℝ) : ℝ := + a ⬝ᵥ (M *ᵥ b) + +omit [DecidableEq n] in +lemma bilinear_symmetric {M : Matrix n n ℝ} (hM : Mᵀ = M) (a b : n → ℝ) : + bilinear M a b = bilinear M b a := by + simpa [bilinear, hM] using Matrix.dotProduct_transpose_mulVec M a b + +lemma inverse_symmetric {M : Matrix n n ℝ} (hM : Mᵀ = M) : + (M⁻¹)ᵀ = M⁻¹ := by + rw [Matrix.transpose_nonsing_inv, hM] + +omit [DecidableEq n] in +lemma bilinear_rankOne (M : Matrix n n ℝ) (a b : n → ℝ) : + bilinear (M * Matrix.vecMulVec b b * M) a a = + bilinear M a b * bilinear M b a := by + simp [bilinear, ← Matrix.mulVec_mulVec, Matrix.vecMulVec_mulVec, + Matrix.mulVec_smul, dotProduct_smul, op_smul_eq_smul, mul_comm] + +def bilinearCLM (a b : n → ℝ) : Matrix n n ℝ →L[ℝ] ℝ := + LinearMap.toContinuousLinearMap + { toFun := fun M => bilinear M a b + map_add' := by + intro M N + simp [bilinear, Matrix.add_mulVec, dotProduct_add] + map_smul' := by + intro c M + simp [bilinear, Matrix.smul_mulVec, dotProduct_smul] } + +@[simp] lemma bilinearCLM_apply (a b : n → ℝ) (M : Matrix n n ℝ) : + bilinearCLM a b M = bilinear M a b := rfl + +lemma hasDerivAt_inverse_affine (M D : Matrix n n ℝ) (hM : IsUnit M) : + HasDerivAt (fun t : ℝ => (M + t • D)⁻¹) (- (M⁻¹ * D * M⁻¹)) 0 := by + rcases hM with ⟨u, rfl⟩ + have hline : HasDerivAt (fun t : ℝ => (u : Matrix n n ℝ) + t • D) D 0 := by + simpa only [Function.id_def, one_smul] using + ((hasDerivAt_id (0 : ℝ)).smul_const D).const_add (u : Matrix n n ℝ) + have hinv := hasFDerivAt_ringInverse (𝕜 := ℝ) u + have hcomp := hinv.comp_hasDerivAt_of_eq (0 : ℝ) hline (by simp) + simpa [Function.comp_def, ← Matrix.nonsing_inv_eq_ringInverse, + ContinuousLinearMap.mulLeftRight_apply, Matrix.coe_units_inv] using hcomp + +omit [DecidableEq n] in +lemma bilinear_neg (M : Matrix n n ℝ) (a b : n → ℝ) : + bilinear (-M) a b = -bilinear M a b := by + simp [bilinear, Matrix.neg_mulVec] + +omit [DecidableEq n] in +lemma bilinear_smul (c : ℝ) (M : Matrix n n ℝ) (a b : n → ℝ) : + bilinear (c • M) a b = c * bilinear M a b := by + simp [bilinear, Matrix.smul_mulVec, dotProduct_smul] + +lemma hasDerivAt_bilinear_inverse_affine (M D : Matrix n n ℝ) + (hM : IsUnit M) (a b : n → ℝ) : + HasDerivAt (fun t : ℝ => bilinear (M + t • D)⁻¹ a b) + (-bilinear (M⁻¹ * D * M⁻¹) a b) 0 := by + have h := (bilinearCLM a b).hasFDerivAt.comp_hasDerivAt (0 : ℝ) + (hasDerivAt_inverse_affine M D hM) + simpa only [Function.comp_def, bilinearCLM_apply, bilinear_neg] using h + +lemma hasDerivAt_transfer_rankOne (M : Matrix n n ℝ) + (hM : IsUnit M) (hs : Mᵀ = M) (a b : n → ℝ) (ce cf : ℝ) : + HasDerivAt (fun t : ℝ => ce * bilinear (M + t • (cf • Matrix.vecMulVec b b))⁻¹ a a) + (-(ce * cf * (bilinear M⁻¹ a b)^2)) 0 := by + have h := (hasDerivAt_bilinear_inverse_affine M (cf • Matrix.vecMulVec b b) + hM a a).const_mul ce + have hval : ce * -bilinear (M⁻¹ * (cf • Matrix.vecMulVec b b) * M⁻¹) a a = + -(ce * cf * (bilinear M⁻¹ a b)^2) := by + rw [Matrix.mul_smul, Matrix.smul_mul, bilinear_smul, bilinear_rankOne] + rw [bilinear_symmetric (inverse_symmetric hs) b a] + ring + rw [hval] at h + exact h + +lemma transfer_response_nonpos (M : Matrix n n ℝ) (a b : n → ℝ) + {ce cf : ℝ} (he : 0 ≤ ce) (hf : 0 ≤ cf) : + -(ce * cf * (bilinear M⁻¹ a b)^2) ≤ 0 := by + exact neg_nonpos.mpr (mul_nonneg (mul_nonneg he hf) (sq_nonneg _)) + +lemma hasDerivAt_transfer_logWeight (M : Matrix n n ℝ) + (hM : IsUnit M) (hs : Mᵀ = M) (a b : n → ℝ) (ce cf : ℝ) : + HasDerivAt + (fun t : ℝ => ce * bilinear + (M + (Real.exp t - 1) • (cf • Matrix.vecMulVec b b))⁻¹ a a) + (-(ce * cf * (bilinear M⁻¹ a b)^2)) 0 := by + have hexp : HasDerivAt (fun t : ℝ => Real.exp t - 1) 1 0 := by + simpa using (Real.hasDerivAt_exp (0 : ℝ)).sub_const 1 + have h := (hasDerivAt_transfer_rankOne M hM hs a b ce cf).comp_of_eq + (0 : ℝ) hexp (by simp) + simpa only [Function.comp_def, mul_one] using h + +lemma hasDerivAt_transfer_logWeight_self (M : Matrix n n ℝ) + (hM : IsUnit M) (hs : Mᵀ = M) (a : n → ℝ) (c : ℝ) : + HasDerivAt + (fun t : ℝ => Real.exp t * + (c * bilinear (M + (Real.exp t - 1) • (c • Matrix.vecMulVec a a))⁻¹ a a)) + ((c * bilinear M⁻¹ a a) * (1 - c * bilinear M⁻¹ a a)) 0 := by + have h := (Real.hasDerivAt_exp (0 : ℝ)).mul + (hasDerivAt_transfer_logWeight M hM hs a a c c) + simp only [Real.exp_zero, sub_self, zero_smul, add_zero, one_mul] at h + have hval : c * bilinear M⁻¹ a a + -(c * c * (bilinear M⁻¹ a a)^2) = + (c * bilinear M⁻¹ a a) * (1 - c * bilinear M⁻¹ a a) := by ring + rw [hval] at h + exact h + +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +def laplacian (a : ι → n → ℝ) (h : ι → ℝ) : Matrix n n ℝ := + ∑ i, Real.exp (h i) • Matrix.vecMulVec (a i) (a i) + +def shift (h : ι → ℝ) (f : ι) (t : ℝ) : ι → ℝ := + fun i => h i + if i = f then t else 0 + +omit [Fintype n] [DecidableEq n] [DecidableEq ι] in +lemma laplacian_symmetric (a : ι → n → ℝ) (h : ι → ℝ) : + (laplacian a h)ᵀ = laplacian a h := by + simp [laplacian, Matrix.transpose_sum, Matrix.transpose_smul, Matrix.transpose_vecMulVec] + +omit [Fintype n] [DecidableEq n] in +lemma laplacian_shift (a : ι → n → ℝ) (h : ι → ℝ) (f : ι) (t : ℝ) : + laplacian a (shift h f t) = laplacian a h + + (Real.exp t - 1) • (Real.exp (h f) • Matrix.vecMulVec (a f) (a f)) := by + have hterm (i : ι) : + Real.exp (shift h f t i) • Matrix.vecMulVec (a i) (a i) = + Real.exp (h i) • Matrix.vecMulVec (a i) (a i) + + if i = f then + (Real.exp t - 1) • (Real.exp (h f) • Matrix.vecMulVec (a f) (a f)) + else 0 := by + by_cases hi : i = f + · subst i + simp only [shift, ite_true, Real.exp_add, smul_smul] + rw [← add_smul] + congr 1 + ring + · simp [shift, hi] + simp only [laplacian, hterm, Finset.sum_add_distrib, Finset.sum_ite_eq', Finset.mem_univ, + ite_true] + +def marginal (a : ι → n → ℝ) (h : ι → ℝ) (e : ι) : ℝ := + Real.exp (h e) * bilinear (laplacian a h)⁻¹ (a e) (a e) + +lemma hasDerivAt_marginal_shift_of_ne (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) {e f : ι} (hef : e ≠ f) : + HasDerivAt (fun t : ℝ => marginal a (shift h f t) e) + (-(Real.exp (h e) * Real.exp (h f) * + (bilinear (laplacian a h)⁻¹ (a e) (a f))^2)) 0 := by + simpa only [marginal, laplacian_shift, shift, ite_eq_right hef, add_zero] using + hasDerivAt_transfer_logWeight (laplacian a h) hL (laplacian_symmetric a h) + (a e) (a f) (Real.exp (h e)) (Real.exp (h f)) + +lemma hasDerivAt_marginal_shift_self (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : + HasDerivAt (fun t : ℝ => marginal a (shift h e t) e) + (marginal a h e * (1 - marginal a h e)) 0 := by + simpa only [marginal, laplacian_shift, shift, ite_true, Real.exp_add, + mul_assoc, mul_comm (Real.exp (h e)) (Real.exp _)] using + hasDerivAt_transfer_logWeight_self (laplacian a h) hL (laplacian_symmetric a h) + (a e) (Real.exp (h e)) + +lemma deriv_marginal_shift_nonpos (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) {e f : ι} (hef : e ≠ f) : + deriv (fun t : ℝ => marginal a (shift h f t) e) 0 ≤ 0 := by + rw [(hasDerivAt_marginal_shift_of_ne a h hL hef).deriv] + exact transfer_response_nonpos _ _ _ (Real.exp_pos _).le (Real.exp_pos _).le + +omit [DecidableEq ι] in + +lemma sum_weighted_transfer_sq (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : + (∑ f, Real.exp (h f) * (bilinear (laplacian a h)⁻¹ (a e) (a f))^2) = + bilinear (laplacian a h)⁻¹ (a e) (a e) := by + let M := laplacian a h + have hs : (M⁻¹)ᵀ = M⁻¹ := inverse_symmetric (laplacian_symmetric a h) + have hterm (f : ι) : + Real.exp (h f) * (bilinear M⁻¹ (a e) (a f))^2 = + bilinear (M⁻¹ * (Real.exp (h f) • Matrix.vecMulVec (a f) (a f)) * M⁻¹) + (a e) (a e) := by + rw [Matrix.mul_smul, Matrix.smul_mul, bilinear_smul, bilinear_rankOne, + bilinear_symmetric hs (a f) (a e)] + ring + change (∑ f, Real.exp (h f) * (bilinear M⁻¹ (a e) (a f))^2) = _ + simp_rw [hterm] + have hsum := map_sum (bilinearCLM (a e) (a e)) + (fun f => M⁻¹ * (Real.exp (h f) • Matrix.vecMulVec (a f) (a f)) * M⁻¹) + Finset.univ + simp only [bilinearCLM_apply] at hsum + rw [← hsum, ← Matrix.sum_mul, ← Matrix.mul_sum] + change bilinear (M⁻¹ * M * M⁻¹) (a e) (a e) = bilinear M⁻¹ (a e) (a e) + rw [Matrix.nonsing_inv_mul _ ((Matrix.isUnit_iff_isUnit_det _).mp hL), Matrix.one_mul] + +def responseSquare (a : ι → n → ℝ) (h : ι → ℝ) (e f : ι) : ℝ := + Real.exp (h e) * Real.exp (h f) * + (bilinear (laplacian a h)⁻¹ (a e) (a f))^2 + +omit [DecidableEq ι] in +lemma responseSquare_nonneg (a : ι → n → ℝ) (h : ι → ℝ) (e f : ι) : + 0 ≤ responseSquare a h e f := by + exact mul_nonneg (mul_nonneg (Real.exp_pos _).le (Real.exp_pos _).le) (sq_nonneg _) + +omit [DecidableEq ι] in +lemma responseSquare_self (a : ι → n → ℝ) (h : ι → ℝ) (e : ι) : + responseSquare a h e e = (marginal a h e)^2 := by + unfold responseSquare marginal + ring + +omit [DecidableEq ι] in +lemma sum_responseSquare (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : + ∑ f, responseSquare a h e f = marginal a h e := by + have hs := congrArg (fun x : ℝ => Real.exp (h e) * x) + (sum_weighted_transfer_sq a h hL e) + simpa only [Finset.mul_sum, marginal, responseSquare, mul_assoc] using hs + +omit [DecidableEq ι] in +lemma marginal_nonneg (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : 0 ≤ marginal a h e := by + rw [← sum_responseSquare a h hL e] + exact Finset.sum_nonneg (fun f _ => responseSquare_nonneg a h e f) + +omit [DecidableEq ι] in +lemma marginal_le_one (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : marginal a h e ≤ 1 := by + have hsq : responseSquare a h e e ≤ ∑ f, responseSquare a h e f := + Finset.single_le_sum (fun f _ => responseSquare_nonneg a h e f) (Finset.mem_univ e) + rw [sum_responseSquare a h hL e, responseSquare_self] at hsq + nlinarith [sq_nonneg (marginal a h e - 1)] + +def response (a : ι → n → ℝ) (h : ι → ℝ) (e f : ι) : ℝ := + (if e = f then marginal a h e else 0) - responseSquare a h e f + +lemma response_self (a : ι → n → ℝ) (h : ι → ℝ) (e : ι) : + response a h e e = marginal a h e * (1 - marginal a h e) := by + simp only [response, ite_true, responseSquare_self] + ring + +lemma response_ne_nonpos (a : ι → n → ℝ) (h : ι → ℝ) + {e f : ι} (hef : e ≠ f) : response a h e f ≤ 0 := by + simp only [response, ite_eq_right hef, zero_sub] + exact neg_nonpos.mpr (responseSquare_nonneg a h e f) + +lemma hasDerivAt_marginal_shift (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e f : ι) : + HasDerivAt (fun t : ℝ => marginal a (shift h f t) e) (response a h e f) 0 := by + by_cases hef : e = f + · subst f + rw [response_self] + exact hasDerivAt_marginal_shift_self a h hL e + · simpa only [response, ite_eq_right hef, zero_sub, responseSquare] using + hasDerivAt_marginal_shift_of_ne a h hL hef + +lemma sum_response (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : ∑ f, response a h e f = 0 := by + simp only [response, Finset.sum_sub_distrib, Finset.sum_ite_eq, Finset.mem_univ, + ite_true, sum_responseSquare a h hL e, sub_self] + +lemma sum_abs_response (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : + ∑ f, |response a h e f| = 2 * marginal a h e * (1 - marginal a h e) := by + have hd : 0 ≤ response a h e e := by + rw [response_self] + exact mul_nonneg (marginal_nonneg a h hL e) + (sub_nonneg.mpr (marginal_le_one a h hL e)) + have habs (f : ι) : |response a h e f| = + (if e = f then 2 * response a h e e else 0) - response a h e f := by + by_cases hef : e = f + · subst f + rw [ite_eq_left rfl, abs_of_nonneg hd] + ring + · rw [ite_eq_right hef, zero_sub, abs_of_nonpos (response_ne_nonpos a h hef)] + simp_rw [habs] + rw [Finset.sum_sub_distrib, sum_response a h hL e] + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true, sub_zero] + rw [response_self] + ring + +lemma sum_abs_deriv_marginal_le_half (a : ι → n → ℝ) (h : ι → ℝ) + (hL : IsUnit (laplacian a h)) (e : ι) : + (∑ f, |deriv (fun t : ℝ => marginal a (shift h f t) e) 0|) ≤ (1 : ℝ) / 2 := by + simp_rw [(hasDerivAt_marginal_shift a h hL e _).deriv] + rw [sum_abs_response a h hL e] + nlinarith [sq_nonneg (marginal a h e - 1 / 2)] + +end Problem336.TransferCurrent + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/TransferCurrentLipschitz.lean b/lean/OAI/Probability/SpanningForest/TransferCurrentLipschitz.lean new file mode 100644 index 0000000000000000000000000000000000000000..9eea5ee4a46033a286fea711d9ffe199d70e7420 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TransferCurrentLipschitz.lean @@ -0,0 +1,122 @@ +import OAI.Probability.SpanningForest.TransferCurrent +import OAI.Probability.SpanningForest.FiniteGradientResponse + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix Matrix.Norms.Operator + +namespace Problem336.TransferCurrent + +variable {n : Type*} [Fintype n] [DecidableEq n] + +local instance : TopologicalSpace (Matrix n n ℝ) := + (Matrix.linftyOpNormedAddCommGroup : NormedAddCommGroup (Matrix n n ℝ)).toMetricSpace.toUniformSpace.toTopologicalSpace + +lemma hasDerivAt_inverse_curve (M : ℝ → Matrix n n ℝ) (D : Matrix n n ℝ) (t : ℝ) + (hM : HasDerivAt M D t) (hU : IsUnit (M t)) : + HasDerivAt (fun s => (M s)⁻¹) (-((M t)⁻¹ * D * (M t)⁻¹)) t := by + rcases hU with ⟨u, hu⟩ + have h := (hasFDerivAt_ringInverse (𝕜 := ℝ) u).comp_hasDerivAt_of_eq t hM hu + simpa only [Function.comp_def, ← Matrix.nonsing_inv_eq_ringInverse, + neg_apply, ContinuousLinearMap.mulLeftRight_apply, + Matrix.coe_units_inv, hu] using h + +lemma hasDerivAt_bilinear_inverse_curve (M : ℝ → Matrix n n ℝ) (D : Matrix n n ℝ) + (t : ℝ) (hM : HasDerivAt M D t) (hU : IsUnit (M t)) (a b : n → ℝ) : + HasDerivAt (fun s => bilinear (M s)⁻¹ a b) + (-bilinear ((M t)⁻¹ * D * (M t)⁻¹) a b) t := by + have h := (bilinearCLM a b).hasFDerivAt.comp_hasDerivAt t + (hasDerivAt_inverse_curve M D t hM hU) + simpa only [Function.comp_def, bilinearCLM_apply, bilinear_neg] using h + +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +open FiniteGradientResponse + +omit [Fintype ι] [DecidableEq ι] in +lemma hasDerivAt_segmentField_apply (h k : ι → ℝ) (i : ι) (t : ℝ) : + HasDerivAt (fun s => segmentField h k s i) (k i - h i) t := by + simpa only [segmentField, Function.id_def, one_mul] using + ((hasDerivAt_id t).mul_const (k i - h i)).const_add (h i) + +omit [DecidableEq ι] in +lemma hasDerivAt_laplacian_segment (a : ι → n → ℝ) (h k : ι → ℝ) (t : ℝ) : + HasDerivAt (fun s => laplacian a (segmentField h k s)) + (∑ f, (Real.exp (segmentField h k t f) * (k f - h f)) • + Matrix.vecMulVec (a f) (a f)) t := by + have hf (f : ι) : HasDerivAt + (fun s => Real.exp (segmentField h k s f) • Matrix.vecMulVec (a f) (a f)) + ((Real.exp (segmentField h k t f) * (k f - h f)) • Matrix.vecMulVec (a f) (a f)) t := + (hasDerivAt_segmentField_apply h k f t).exp.smul_const _ + simpa only [laplacian, Finset.sum_apply] using + HasDerivAt.fun_sum (u := Finset.univ) (fun f _ => hf f) + +omit [DecidableEq ι] in +lemma bilinear_laplacian_direction (a : ι → n → ℝ) (h d : ι → ℝ) (e : ι) : + Real.exp (h e) * bilinear + ((laplacian a h)⁻¹ * + (∑ f, (Real.exp (h f) * d f) • Matrix.vecMulVec (a f) (a f)) * + (laplacian a h)⁻¹) (a e) (a e) = + ∑ f, responseSquare a h e f * d f := by + rw [Matrix.mul_sum, Matrix.sum_mul] + change Real.exp (h e) * bilinearCLM (a e) (a e) (∑ f, + (laplacian a h)⁻¹ * ((Real.exp (h f) * d f) • Matrix.vecMulVec (a f) (a f)) * + (laplacian a h)⁻¹) = _ + rw [map_sum, Finset.mul_sum] + simp only [bilinearCLM_apply] + apply Finset.sum_congr rfl + intro f hf + rw [Matrix.mul_smul, Matrix.smul_mul, bilinear_smul, bilinear_rankOne, + bilinear_symmetric (inverse_symmetric (laplacian_symmetric a h)) (a f) (a e)] + unfold responseSquare + ring + +lemma hasDerivAt_marginal_segment (a : ι → n → ℝ) (h k : ι → ℝ) (e : ι) (t : ℝ) + (hL : IsUnit (laplacian a (segmentField h k t))) : + HasDerivAt (fun s => marginal a (segmentField h k s) e) + (∑ f, response a (segmentField h k t) e f * (k f - h f)) t := by + let H := segmentField h k t + let D := ∑ f, (Real.exp (H f) * (k f - h f)) • Matrix.vecMulVec (a f) (a f) + have hB := hasDerivAt_bilinear_inverse_curve + (fun s => laplacian a (segmentField h k s)) D t + (hasDerivAt_laplacian_segment a h k t) hL (a e) (a e) + have hprod := (hasDerivAt_segmentField_apply h k e t).exp.mul hB + have hv : (Real.exp (H e) * (k e - h e)) * bilinear (laplacian a H)⁻¹ (a e) (a e) + + Real.exp (H e) * -bilinear ((laplacian a H)⁻¹ * D * (laplacian a H)⁻¹) (a e) (a e) = + ∑ f, response a H e f * (k f - h f) := by + rw [mul_neg] + change (Real.exp (H e) * (k e - h e)) * bilinear (laplacian a H)⁻¹ (a e) (a e) + + -(Real.exp (H e) * bilinear ((laplacian a H)⁻¹ * + (∑ f, (Real.exp (H f) * (k f - h f)) • Matrix.vecMulVec (a f) (a f)) * + (laplacian a H)⁻¹) (a e) (a e)) = _ + rw [bilinear_laplacian_direction] + simp only [response, sub_mul, Finset.sum_sub_distrib, ite_mul, zero_mul, + Finset.sum_ite_eq, Finset.mem_univ, ite_true] + unfold marginal + ring + change HasDerivAt (fun s => marginal a (segmentField h k s) e) + (∑ f, response a H e f * (k f - h f)) t + rw [← hv] + exact hprod + +lemma marginal_sub_le_half (a : ι → n → ℝ) (h k : ι → ℝ) (e : ι) + (D : ℝ) (hD : 0 ≤ D) (hdir : ∀ f, |k f - h f| ≤ D) + (hL : ∀ t ∈ Set.Icc (0 : ℝ) 1, IsUnit (laplacian a (segmentField h k t))) : + |marginal a k e - marginal a h e| ≤ (1 : ℝ) / 2 * D := by + apply response_le_of_line_derivative Finset.univ (fun H => marginal a H e) + (fun H f => response a H e f) h k (1 / 2) D hD + · intro f hf + exact hdir f + · intro t ht + exact hasDerivAt_marginal_segment a h k e t (hL t ht) + · intro t ht + rw [sum_abs_response a _ (hL t ⟨ht.1, ht.2.le⟩) e] + nlinarith [sq_nonneg (marginal a (segmentField h k t) e - 1 / 2)] + +end Problem336.TransferCurrent + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/TransferProjection.lean b/lean/OAI/Probability/SpanningForest/TransferProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..9436bb753f905390188ca8b8c420dab06b2a9161 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TransferProjection.lean @@ -0,0 +1,120 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace Problem336 +namespace TransferProjection + +section Abstract + +variable {E F : Type*} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] + +theorem adjoint_rightInverse_projection + (A : E →ₗ[ℝ] F) (B : F →ₗ[ℝ] F) + (hB : (A ∘ₗ A.adjoint) ∘ₗ B = LinearMap.id) (x : E) : + A.kerᗮ.starProjection x = A.adjoint (B (A x)) := by + apply Submodule.eq_starProjection_of_mem_orthogonal + · rw [A.orthogonal_ker] + exact ⟨B (A x), rfl⟩ + · rw [Submodule.orthogonal_orthogonal] + change A (x - A.adjoint (B (A x))) = 0 + rw [map_sub] + have h := LinearMap.congr_fun hB (A x) + change A (A.adjoint (B (A x))) = A x at h + rw [h, sub_self] + +theorem adjoint_rightInverse_eq_complement + (A : E →ₗ[ℝ] F) (B : F →ₗ[ℝ] F) + (hB : (A ∘ₗ A.adjoint) ∘ₗ B = LinearMap.id) (x : E) : + A.adjoint (B (A x)) = x - A.ker.starProjection x := by + rw [← adjoint_rightInverse_projection A B hB x] + exact A.ker.starProjection_orthogonal_val x + +end Abstract + +section Embedding + +variable {E H : Type*} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + +theorem map_projection_adjoint (j : E →ₗᵢ[ℝ] H) (C : Submodule ℝ E) (x : H) : + (C.map j.toLinearMap).starProjection x = + j (C.starProjection (j.toContinuousLinearMap.adjoint x)) := by + let : CompleteSpace E := FiniteDimensional.complete ℝ E + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero + · exact ⟨C.starProjection (j.toContinuousLinearMap.adjoint x), + C.starProjection_apply_mem _, rfl⟩ + · rintro _ ⟨y, hy, rfl⟩ + rw [inner_sub_left] + change inner ℝ x (j y) - + inner ℝ (j (C.starProjection (j.toContinuousLinearMap.adjoint x))) (j y) = 0 + have ha : inner ℝ x (j y) = inner ℝ (j.toContinuousLinearMap.adjoint x) y := + (j.toContinuousLinearMap.adjoint_inner_left y x).symm + rw [j.inner_map_map, ha, ← inner_sub_left] + exact C.starProjection_inner_eq_zero _ y hy + +theorem range_projection_adjoint (j : E →ₗᵢ[ℝ] H) (x : H) : + j.toLinearMap.range.starProjection x = j (j.toContinuousLinearMap.adjoint x) := by + let : CompleteSpace E := FiniteDimensional.complete ℝ E + simpa [Submodule.starProjection_top] using + map_projection_adjoint j (⊤ : Submodule ℝ E) x + +theorem embedded_complement_projection (j : E →ₗᵢ[ℝ] H) + (C : Submodule ℝ E) (x : H) : + j (j.toContinuousLinearMap.adjoint x - + C.starProjection (j.toContinuousLinearMap.adjoint x)) = + j.toLinearMap.range.starProjection x - (C.map j.toLinearMap).starProjection x := by + let : CompleteSpace E := FiniteDimensional.complete ℝ E + rw [map_sub, range_projection_adjoint, map_projection_adjoint] + +end Embedding + +variable {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] + +def transferMatrix (A : Matrix m n ℝ) : Matrix n n ℝ := + A.transpose * (A * A.transpose)⁻¹ * A + +theorem transferMatrix_eq_complement (A : Matrix m n ℝ) + (hA : IsUnit (A * A.transpose).det) (x : EuclideanSpace ℝ n) : + (transferMatrix A).toEuclideanLin x = + x - A.toEuclideanLin.ker.starProjection x := by + have hadj : A.transpose.toEuclideanLin = A.toEuclideanLin.adjoint := by + simpa using A.toEuclideanLin_conjTranspose_eq_adjoint + have hright : + (A.toEuclideanLin ∘ₗ A.toEuclideanLin.adjoint) ∘ₗ + (A * A.transpose)⁻¹.toEuclideanLin = LinearMap.id := by + rw [← hadj, ← Matrix.toLpLin_mul_same, ← Matrix.toLpLin_mul_same] + rw [Matrix.mul_nonsing_inv _ hA, Matrix.toLpLin_one] + have h := adjoint_rightInverse_eq_complement A.toEuclideanLin + (A * A.transpose)⁻¹.toEuclideanLin hright x + simpa only [transferMatrix, Matrix.toLpLin_mul_same, LinearMap.comp_apply, hadj] using h + +theorem embedded_transferMatrix_eq_difference + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] + (A : Matrix m n ℝ) (hA : IsUnit (A * A.transpose).det) + (j : EuclideanSpace ℝ n →ₗᵢ[ℝ] H) (x : H) : + j ((transferMatrix A).toEuclideanLin (j.toContinuousLinearMap.adjoint x)) = + j.toLinearMap.range.starProjection x - + (A.toEuclideanLin.ker.map j.toLinearMap).starProjection x := by + rw [transferMatrix_eq_complement A hA] + exact embedded_complement_projection j A.toEuclideanLin.ker x + +theorem transferMatrix_entry_eq_inner (A : Matrix m n ℝ) + (hA : IsUnit (A * A.transpose).det) (i k : n) : + transferMatrix A i k = inner ℝ (EuclideanSpace.basisFun n ℝ i) + (EuclideanSpace.basisFun n ℝ k - + A.toEuclideanLin.ker.starProjection (EuclideanSpace.basisFun n ℝ k)) := by + rw [← transferMatrix_eq_complement A hA, EuclideanSpace.basisFun_inner] + simp [Matrix.toLpLin_apply] + +end TransferProjection +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/TreePosteriorBridge.lean b/lean/OAI/Probability/SpanningForest/TreePosteriorBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..e45c9f655d6cf458fa7e2a10a27d11672b92684f --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/TreePosteriorBridge.lean @@ -0,0 +1,79 @@ +import OAI.Probability.SpanningForest.IntrinsicTreeDrift +import OAI.Probability.SpanningForest.USTPosteriorResponse + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped BigOperators Topology + +namespace Problem336.GraphTreePosterior + +theorem energy_eq_finiteEnergy (T : Finset (ℕ × ℕ)) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + energy T S t y = + TiltLimit.finiteEnergy S (fun f => y f - t / 2) (finiteTreeConfiguration T) := by + classical + simp only [energy, TiltLimit.finiteEnergy, USTResponse.bit_finiteTreeConfiguration, + mul_ite, mul_one, mul_zero] + +theorem mean_eq_finiteTiltMean (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y = + TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S (fun f => y f - t / 2) e := by + classical + rw [TiltLimit.finiteTiltMean, USTResponse.tiltedMean_finiteUSTProbability] + simp_rw [← energy_eq_finiteEnergy] + change numerator K e S t y / partition K S t y = + (∑ T : USTResponse.TreeSample K, + TiltLimit.bit (finiteTreeConfiguration T.1 e) * weight T.1 S t y) / + (∑ T : USTResponse.TreeSample K, weight T.1 S t y) + congr 1 + · rw [← Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) + (fun T => TiltLimit.bit (finiteTreeConfiguration T e) * weight T S t y)] + simp only [numerator, USTResponse.bit_finiteTreeConfiguration, + ite_mul, one_mul, zero_mul, Finset.sum_filter] + · exact Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) (fun T => weight T S t y) + +theorem mean_eq_finiteTilt (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (e : EdgeCode) (S : Finset EdgeCode) + (t : ℝ) (y : EdgeCode → ℝ) : + mean K e S t y = USTResponse.finiteTilt K (S.image Subtype.val) 0 + (USTResponse.extendMarks (fun f => y f - t / 2)) e.1 := by + rw [mean_eq_finiteTiltMean K hne, USTResponse.finiteTiltMean_eq_finiteTilt] + +theorem mean_response_of_inclusion_response (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hresponse : ∀ (a b : USTResponse.FiniteEdge K → ℝ) + (e : USTResponse.FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |USTResponse.inclusion K b e - USTResponse.inclusion K a e| ≤ D / 2) + (e : EdgeCode) (S : Finset EdgeCode) (t : ℝ) (y z : EdgeCode → ℝ) + (D : ℝ) (hD : 0 ≤ D) (hyz : ∀ f ∈ S, |y f - z f| ≤ D) : + |mean K e S t y - mean K e S t z| ≤ D / 2 := by + rw [mean_eq_finiteTiltMean K hne, mean_eq_finiteTiltMean K hne] + apply USTResponse.finiteUST_posterior_response_of_response K hne hresponse S + (fun f => z f - t / 2) (fun f => y f - t / 2) e D hD + intro f hf + simpa only [sub_sub_sub_cancel_right] using hyz f hf + +theorem innerMean_eq_posterior_of_weak_limit (G : GraphCode) (e : EdgeCode) + (hne : ∀ m, (spanningTrees (Intrinsic.exhaustion G e m)).Nonempty) + (μ : ProbabilityMeasure EdgeConfiguration) + (hμ : Tendsto (fun m => finiteUSTProbability (Intrinsic.exhaustion G e m) (hne m)) + atTop (nhds μ)) (n : ℕ) (t : ℝ) (y : EdgeCode → ℝ) : + innerMean G e n t y = + TiltLimit.finiteTiltMean μ (edgeCodes (Intrinsic.exhaustion G e n)) + (fun f => y f - t / 2) e := by + apply innerMean_eq_of_tendsto + have h := TiltLimit.tendsto_finiteTiltMean hμ + (edgeCodes (Intrinsic.exhaustion G e n)) (fun f => y f - t / 2) e + simpa only [finiteBallMean, mean_eq_finiteTiltMean _ (hne _)] using h + +end Problem336.GraphTreePosterior + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTCylinder.lean b/lean/OAI/Probability/SpanningForest/USTCylinder.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e23609e907f5ae8f05801e64a411f9776a93a32 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTCylinder.lean @@ -0,0 +1,111 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators ENNReal Topology + +namespace Problem336 + +theorem ustCylinder_split (K : FiniteSubgraphCode) + (A B : Finset EdgeCode) (e : EdgeCode) : + ustCylinder K A B = + ustCylinder K (insert e A) B + ustCylinder K A (insert e B) := by + classical + let S := (spanningTrees K).filter (fun T => + (∀ f ∈ A, f.1 ∈ T) ∧ (∀ f ∈ B, f.1 ∉ T)) + have hyes : (spanningTrees K).filter (fun T => + (∀ f ∈ insert e A, f.1 ∈ T) ∧ (∀ f ∈ B, f.1 ∉ T)) = + S.filter (fun T => e.1 ∈ T) := by + ext T + simp only [S, Finset.mem_filter, Finset.forall_mem_insert] + tauto + have hno : (spanningTrees K).filter (fun T => + (∀ f ∈ A, f.1 ∈ T) ∧ (∀ f ∈ insert e B, f.1 ∉ T)) = + S.filter (fun T => e.1 ∉ T) := by + ext T + simp only [S, Finset.mem_filter, Finset.forall_mem_insert] + tauto + unfold ustCylinder + dsimp only + change (S.card : ℝ≥0∞) / (spanningTrees K).card = _ + rw [hyes, hno] + rw [← ENNReal.add_div] + congr 1 + exact_mod_cast (Finset.card_filter_add_card_filter_not (s := S) (fun T => e.1 ∈ T)).symm + +theorem ustCylinder_antitone_constraints (K : FiniteSubgraphCode) + {A A' B B' : Finset EdgeCode} (hA : A ⊆ A') (hB : B ⊆ B') : + ustCylinder K A' B' ≤ ustCylinder K A B := by + classical + unfold ustCylinder + dsimp only + apply ENNReal.div_le_div_right + exact_mod_cast Finset.card_le_card (by + intro T hT + simp only [Finset.mem_filter] at hT ⊢ + exact ⟨hT.1, fun e he => hT.2.1 e (hA he), + fun e he => hT.2.2 e (hB he)⟩) + +theorem ustCylinder_partition (K : FiniteSubgraphCode) + (A B C : Finset EdgeCode) : + ustCylinder K A B = + ∑ D ∈ C.powerset, ustCylinder K (A ∪ D) (B ∪ (C \ D)) := by + classical + induction C using Finset.induction_on generalizing A B with + | empty => simp + | @insert e C he ih => + rw [Finset.sum_powerset_insert he] + have hfirst : + (∑ D ∈ C.powerset, + ustCylinder K (A ∪ D) (B ∪ (insert e C \ D))) = + ustCylinder K A (insert e B) := by + rw [ih A (insert e B)] + apply Finset.sum_congr rfl + intro D hD + have heD : e ∉ D := fun h => he (Finset.mem_powerset.mp hD h) + congr 1 + ext f + by_cases hfe : f = e <;> simp [hfe, heD] + have hsecond : + (∑ D ∈ C.powerset, + ustCylinder K (A ∪ insert e D) (B ∪ (insert e C \ insert e D))) = + ustCylinder K (insert e A) B := by + rw [ih (insert e A) B] + apply Finset.sum_congr rfl + intro D hD + congr 1 + · ext f + simp only [Finset.mem_union, Finset.mem_insert] + tauto + · ext f + by_cases hfe : f = e <;> simp [hfe, he] + rw [hfirst, hsecond, add_comm] + exact ustCylinder_split K A B e + +theorem ustCylinder_limit_split (H : ℕ → FiniteSubgraphCode) + (p : Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hlim : ∀ A B, Filter.Tendsto (fun n => ustCylinder (H n) A B) + Filter.atTop (nhds (p A B))) + (A B : Finset EdgeCode) (e : EdgeCode) : + p A B = p (insert e A) B + p A (insert e B) := by + apply tendsto_nhds_unique (hlim A B) + simpa only [← ustCylinder_split] using + (hlim (insert e A) B).add (hlim A (insert e B)) + +theorem ustCylinder_limit_partition (H : ℕ → FiniteSubgraphCode) + (p : Finset EdgeCode → Finset EdgeCode → ℝ≥0∞) + (hlim : ∀ A B, Filter.Tendsto (fun n => ustCylinder (H n) A B) + Filter.atTop (nhds (p A B))) + (A B C : Finset EdgeCode) : + p A B = ∑ D ∈ C.powerset, p (A ∪ D) (B ∪ (C \ D)) := by + apply tendsto_nhds_unique (hlim A B) + have h := tendsto_finsetSum C.powerset (fun D _ => hlim (A ∪ D) (B ∪ (C \ D))) + simpa only [← ustCylinder_partition] using h + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTDeterminant.lean b/lean/OAI/Probability/SpanningForest/USTDeterminant.lean new file mode 100644 index 0000000000000000000000000000000000000000..d04d8155cf02259bafdb3236fa8d6fa7f522123d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTDeterminant.lean @@ -0,0 +1,73 @@ +import OAI.Probability.SpanningForest.CodedTransferBridge +import OAI.Probability.SpanningForest.USTInclusionCount +import OAI.Probability.SpanningForest.FiniteKernelSupport + +namespace OAI + +noncomputable section + +open scoped BigOperators ENNReal +open Classical + +namespace Problem336.FreeKernel + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +theorem ustCylinder_positive_toReal_eq_det + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (A : Finset EdgeCode) (hA : ∀ e ∈ A, e.val ∈ K.2) : + (ustCylinder K A ∅).toReal = + Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val))) := by + let S := USTInclusionCount.supportedPairs K A + have hs : SubtypeSubsetSums.forget K.2 S = USTInclusionCount.edgePairs A := + USTInclusionCount.supportedPairs_map K A hA + have hr := code_tree_inclusion_ratio hK root (fun _ => 1) (fun _ => zero_lt_one) S + simp only [Finset.prod_const_one, Finset.sum_const, nsmul_eq_mul, mul_one, hs] at hr + calc + _ = (((spanningTrees K).filter + (fun T => USTInclusionCount.edgePairs A ⊆ T)).card : ℝ) / + (spanningTrees K).card := USTInclusionCount.ustCylinder_positive_toReal K A + _ = (codeTransferCurrent hK root (fun _ => 1) S).det := hr + _ = Matrix.det (fun e f : S => + inner ℝ (edgeVector ((CodedTransferBridge.edgeEquiv hK).symm e.val).val) + (finiteKernel K (edgeVector ((CodedTransferBridge.edgeEquiv hK).symm f.val).val))) := + CodedTransferBridge.current_det_eq_finiteKernel hK root S + _ = _ := by + exact (Matrix.det_submatrix_equiv_self (USTInclusionCount.requiredEdgeEquiv K A hA) + (fun e f : S => + inner ℝ (edgeVector ((CodedTransferBridge.edgeEquiv hK).symm e.val).val) + (finiteKernel K (edgeVector ((CodedTransferBridge.edgeEquiv hK).symm f.val).val)))).symm + +theorem ustCylinder_positive_eq_det_of_contained + (hK : IsFiniteConnectedSubgraph G K) (root : K.1) + (A : Finset EdgeCode) (hA : ∀ e ∈ A, e.val ∈ K.2) : + ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val)))) := by + have hcard : (spanningTrees K).card ≠ 0 := by + intro hz + have hd := codeWeightedLaplacian_det_ne_zero hK root (fun _ => 1) + (fun _ => zero_lt_one) + apply hd + rw [codeWeightedLaplacian_det_eq_tree_count] + exact_mod_cast hz + have hfinite : ustCylinder K A ∅ ≠ ∞ := by + rw [USTInclusionCount.ustCylinder_positive_eq] + exact ENNReal.div_ne_top (by simp) (by exact_mod_cast hcard) + rw [← ENNReal.ofReal_toReal hfinite, ustCylinder_positive_toReal_eq_det hK root A hA] + +theorem ustCylinder_positive_eq_finiteKernel_det + (hK : IsFiniteConnectedSubgraph G K) (A : Finset EdgeCode) : + ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val)))) := by + let root : K.1 := ⟨hK.1.choose, hK.1.choose_spec⟩ + exact inclusion_identity_of_contained_identity K + (ustCylinder_positive_eq_det_of_contained hK root) A + +end Problem336.FreeKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTFiniteDeterminantal.lean b/lean/OAI/Probability/SpanningForest/USTFiniteDeterminantal.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2f66de8882aa06c0d85dfb0187bb5e4d3a696de --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTFiniteDeterminantal.lean @@ -0,0 +1,69 @@ +import OAI.Probability.SpanningForest.USTInclusionCount +import OAI.Probability.SpanningForest.CodedTransferProjection +import OAI.Probability.SpanningForest.FiniteKernelSupport + +namespace OAI + +noncomputable section + +open scoped ENNReal + +namespace Problem336.FreeKernel + +open USTInclusionCount + +variable {G : GraphCode} {K : FiniteSubgraphCode} + +theorem ustCylinder_toReal_eq_finiteKernel_minor_of_contained + (hK : IsFiniteConnectedSubgraph G K) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) : + (ustCylinder K A ∅).toReal = + Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val))) := by + classical + let root : K.1 := ⟨hK.1.choose, hK.1.choose_spec⟩ + have hf : SubtypeSubsetSums.forget K.2 (supportedPairs K A) = edgePairs A := + supportedPairs_map K A hA + rw [ustCylinder_positive_toReal] + have hc := CodeTransferKernel.code_tree_inclusion_ratio_finiteKernel hK root + (supportedPairs K A) + rw [hf] at hc + rw [hc] + exact (det_required_reindex K A hA + (fun e f : K.2 => inner ℝ (edgeVector (CodeTransferKernel.edgeEquiv hK e).val) + (finiteKernel K (edgeVector (CodeTransferKernel.edgeEquiv hK f).val)))).symm + +theorem spanningTrees_card_ne_zero (hK : IsFiniteConnectedSubgraph G K) : + (spanningTrees K).card ≠ 0 := by + let root : K.1 := ⟨hK.1.choose, hK.1.choose_spec⟩ + have hd := codeWeightedLaplacian_det_ne_zero hK root (fun _ => 1) + (fun _ => by norm_num) + rw [codeWeightedLaplacian_det_eq_tree_count] at hd + exact_mod_cast hd + +theorem ustCylinder_eq_finiteKernel_minor_of_contained + (hK : IsFiniteConnectedSubgraph G K) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) : + ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val)))) := by + rw [← ustCylinder_toReal_eq_finiteKernel_minor_of_contained hK A hA] + apply (ENNReal.ofReal_toReal ?_).symm + unfold ustCylinder + apply ENNReal.div_ne_top + · exact ENNReal.natCast_ne_top _ + · exact_mod_cast spanningTrees_card_ne_zero hK + +theorem ustCylinder_eq_finiteKernel_minor + (hK : IsFiniteConnectedSubgraph G K) (A : Finset EdgeCode) : + ustCylinder K A ∅ = ENNReal.ofReal + (Matrix.det (fun e f : A => inner ℝ (edgeVector e.val) + (finiteKernel K (edgeVector f.val)))) := + inclusion_identity_of_contained_identity K + (ustCylinder_eq_finiteKernel_minor_of_contained hK) A + +end Problem336.FreeKernel + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTFiniteTilt.lean b/lean/OAI/Probability/SpanningForest/USTFiniteTilt.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a6518f171c44c69a78aa58517e67d260e32d385 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTFiniteTilt.lean @@ -0,0 +1,145 @@ +import OAI.Probability.SpanningForest.USTResponse + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.USTResponse + +def observationField (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) : FiniteEdge K → ℝ := + fun e => if e.1 ∈ S then y e.1 - t / 2 else 0 + +def finiteTilt (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) : ℝ := + if he : e ∈ K.2 then inclusion K (observationField K S t y) ⟨e, he⟩ else 0 + +lemma finiteTilt_of_mem (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) (he : e ∈ K.2) : + finiteTilt K S t y e = inclusion K (observationField K S t y) ⟨e, he⟩ := by + simp [finiteTilt, he] + +lemma finiteTilt_of_not_mem (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) (he : e ∉ K.2) : + finiteTilt K S t y e = 0 := by + simp [finiteTilt, he] + +lemma finiteTilt_mem_Icc (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (hne : (spanningTrees K).Nonempty) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) : + finiteTilt K S t y e ∈ Set.Icc (0 : ℝ) 1 := by + by_cases he : e ∈ K.2 + · rw [finiteTilt_of_mem K S t y e he] + exact ⟨inclusion_nonneg K _ hne _, inclusion_le_one K _ hne _⟩ + · simp [finiteTilt_of_not_mem K S t y e he] + +lemma continuous_observationField (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) : + Continuous (fun q : ℝ × ((ℕ × ℕ) → ℝ) => observationField K S q.1 q.2) := by + apply continuous_pi + intro e + unfold observationField + split_ifs <;> fun_prop + +lemma continuous_finiteTilt (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (hne : (spanningTrees K).Nonempty) (e : ℕ × ℕ) : + Continuous (fun q : ℝ × ((ℕ × ℕ) → ℝ) => finiteTilt K S q.1 q.2 e) := by + by_cases he : e ∈ K.2 + · simpa only [finiteTilt, dite_eq_left he, Function.comp_def] using + (continuous_inclusion K hne ⟨e, he⟩).comp (continuous_observationField K S) + · simp only [finiteTilt, dite_eq_right he] + exact continuous_const + +lemma measurable_finiteTilt (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (hne : (spanningTrees K).Nonempty) (e : ℕ × ℕ) : + Measurable (fun q : ℝ × ((ℕ × ℕ) → ℝ) => finiteTilt K S q.1 q.2 e) := + (continuous_finiteTilt K S hne e).measurable + +lemma finiteTilt_eq_zero_of_no_trees (K : FiniteSubgraphCode) + (hempty : ¬ (spanningTrees K).Nonempty) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) : + finiteTilt K S t y e = 0 := by + let : IsEmpty (TreeSample K) := ⟨fun T => hempty ⟨T.1, T.2⟩⟩ + unfold finiteTilt + split_ifs <;> simp [inclusion, FiniteResponse.mean] + +lemma continuous_finiteTilt_unconditional (K : FiniteSubgraphCode) + (S : Finset (ℕ × ℕ)) (e : ℕ × ℕ) : + Continuous (fun q : ℝ × ((ℕ × ℕ) → ℝ) => finiteTilt K S q.1 q.2 e) := by + by_cases hne : (spanningTrees K).Nonempty + · exact continuous_finiteTilt K S hne e + · simp only [finiteTilt_eq_zero_of_no_trees K hne] + exact continuous_const + +lemma measurable_finiteTilt_unconditional (K : FiniteSubgraphCode) + (S : Finset (ℕ × ℕ)) (e : ℕ × ℕ) : + Measurable (fun q : ℝ × ((ℕ × ℕ) → ℝ) => finiteTilt K S q.1 q.2 e) := + (continuous_finiteTilt_unconditional K S e).measurable + +lemma measurable_finiteTilt_joint : + Measurable (fun q : (FiniteSubgraphCode × (Finset (ℕ × ℕ) × (ℕ × ℕ))) × + (ℝ × ((ℕ × ℕ) → ℝ)) => + finiteTilt q.1.1 q.1.2.1 q.2.1 q.2.2 q.1.2.2) := by + apply measurable_from_prod_countable_right + intro p + exact measurable_finiteTilt_unconditional p.1 p.2.1 p.2.2 + +theorem finiteTilt_response_of_response (K : FiniteSubgraphCode) + (hresponse : ∀ (a b : FiniteEdge K → ℝ) (e : FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |inclusion K b e - inclusion K a e| ≤ D / 2) + (S : Finset (ℕ × ℕ)) (t : ℝ) (y y' : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) + (D : ℝ) (hD : 0 ≤ D) (hy : ∀ f ∈ S, |y' f - y f| ≤ D) : + |finiteTilt K S t y' e - finiteTilt K S t y e| ≤ D / 2 := by + by_cases he : e ∈ K.2 + · rw [finiteTilt_of_mem K S t y' e he, finiteTilt_of_mem K S t y e he] + apply hresponse _ _ _ D hD + intro f + by_cases hf : f.1 ∈ S + · simpa only [observationField, ite_eq_left hf, sub_sub_sub_cancel_right] using hy f.1 hf + · simpa only [observationField, ite_eq_right hf, sub_self, abs_zero] using hD + · simp only [finiteTilt, dite_eq_right he, sub_self, abs_zero] + exact div_nonneg hD (by norm_num) + +theorem finiteTilt_response (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → edgeCovariance K h e f ≤ 0) + (t : ℝ) (y y' : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) + (D : ℝ) (hD : 0 ≤ D) (hy : ∀ f ∈ S, |y' f - y f| ≤ D) : + |finiteTilt K S t y' e - finiteTilt K S t y e| ≤ D / 2 := by + by_cases he : e ∈ K.2 + · rw [finiteTilt_of_mem K S t y' e he, finiteTilt_of_mem K S t y e he] + apply inclusion_response_of_coordinate_bound K hne hneg _ _ _ D hD + intro f + by_cases hf : f.1 ∈ S + · simpa only [observationField, ite_eq_left hf, sub_sub_sub_cancel_right] using hy f.1 hf + · simpa only [observationField, ite_eq_right hf, sub_self, abs_zero] using hD + · simp only [finiteTilt, dite_eq_right he, sub_self, abs_zero] + exact div_nonneg hD (by norm_num) + +lemma observationField_zero (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) : + observationField K S 0 0 = 0 := by + funext e + simp [observationField] + +lemma observationField_empty (K : FiniteSubgraphCode) (t : ℝ) + (y : (ℕ × ℕ) → ℝ) : observationField K ∅ t y = 0 := by + funext e + simp [observationField] + +lemma finiteTilt_empty_eq_zero_field (K : FiniteSubgraphCode) (S : Finset (ℕ × ℕ)) + (t : ℝ) (y : (ℕ × ℕ) → ℝ) (e : ℕ × ℕ) : + finiteTilt K ∅ t y e = finiteTilt K S 0 0 e := by + simp only [finiteTilt, observationField_empty, observationField_zero] + +lemma finiteTilt_zero_eq_ustCylinder_of_mem (K : FiniteSubgraphCode) + (S : Finset (ℕ × ℕ)) (e : EdgeCode) (he : e.1 ∈ K.2) : + finiteTilt K S 0 0 e.1 = (ustCylinder K {e} ∅).toReal := by + rw [finiteTilt_of_mem K S 0 0 e.1 he, observationField_zero, + inclusion_zero_eq_ustCylinder K e he] + +end Problem336.USTResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTInclusionCount.lean b/lean/OAI/Probability/SpanningForest/USTInclusionCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..004da8203e8e59901f702e993a671447f4b2138d --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTInclusionCount.lean @@ -0,0 +1,91 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem336.USTInclusionCount + +def edgePairs (A : Finset EdgeCode) : Finset (ℕ × ℕ) := + A.map (Function.Embedding.subtype (fun p : ℕ × ℕ => p.1 < p.2)) + +@[simp] theorem edgePairs_card (A : Finset EdgeCode) : (edgePairs A).card = A.card := + Finset.card_map _ + +@[simp] theorem edgePairs_subset_iff (A : Finset EdgeCode) (T : Finset (ℕ × ℕ)) : + edgePairs A ⊆ T ↔ ∀ e ∈ A, e.val ∈ T := by + simp [edgePairs, Finset.subset_iff] + +theorem ustCylinder_positive_toReal (K : FiniteSubgraphCode) (A : Finset EdgeCode) : + (ustCylinder K A ∅).toReal = + (((spanningTrees K).filter (fun T => edgePairs A ⊆ T)).card : ℝ) / + ((spanningTrees K).card : ℝ) := by + classical + simp [ustCylinder, edgePairs_subset_iff, ENNReal.toReal_div] + +theorem ustCylinder_positive_eq (K : FiniteSubgraphCode) (A : Finset EdgeCode) : + ustCylinder K A ∅ = + (((spanningTrees K).filter (fun T => edgePairs A ⊆ T)).card : ℝ≥0∞) / + ((spanningTrees K).card : ℝ≥0∞) := by + classical + simp [ustCylinder, edgePairs_subset_iff] + +def supportedPairs (K : FiniteSubgraphCode) (A : Finset EdgeCode) : Finset K.2 := + (edgePairs A).subtype (fun p => p ∈ K.2) + +theorem supportedPairs_map (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) : + (supportedPairs K A).map (Function.Embedding.subtype (fun p => p ∈ K.2)) = + edgePairs A := + Finset.subtype_map_of_mem (fun _ hp => (edgePairs_subset_iff A K.2).mpr hA hp) + +def requiredEdgeEquiv (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) : A ≃ supportedPairs K A := + Equiv.ofBijective + (fun e => ⟨⟨e.val.val, hA e.val e.property⟩, + Finset.mem_subtype.mpr (Finset.mem_map.mpr ⟨e.val, e.property, rfl⟩)⟩) + ⟨by + intro a b hab + apply Subtype.ext + apply Subtype.ext + exact congrArg (fun p : supportedPairs K A => p.val.val) hab, + by + intro p + obtain ⟨e, he, hep⟩ := Finset.mem_map.mp (Finset.mem_subtype.mp p.property) + refine ⟨⟨e, he⟩, ?_⟩ + apply Subtype.ext + exact Subtype.ext hep⟩ + +@[simp] theorem requiredEdgeEquiv_val (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) (e : A) : + (requiredEdgeEquiv K A hA e).val.val = e.val.val := rfl + +theorem supportedPairs_card (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) : (supportedPairs K A).card = A.card := by + simpa only [Fintype.card_coe] using (Fintype.card_congr (requiredEdgeEquiv K A hA)).symm + +theorem supportedPairs_inclusion_iff (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) (T : Finset (ℕ × ℕ)) : + (∀ e ∈ supportedPairs K A, e.val ∈ T) ↔ edgePairs A ⊆ T := by + rw [← supportedPairs_map K A hA] + simp [Finset.subset_iff] + +theorem det_required_reindex {R : Type*} [CommRing R] + (K : FiniteSubgraphCode) (A : Finset EdgeCode) + (hA : ∀ e ∈ A, e.val ∈ K.2) (M : Matrix K.2 K.2 R) : + Matrix.det (fun e f : A => + M ⟨e.val.val, hA e.val e.property⟩ ⟨f.val.val, hA f.val f.property⟩) = + Matrix.det (M.submatrix + (Subtype.val : supportedPairs K A → K.2) + (Subtype.val : supportedPairs K A → K.2)) := by + exact Matrix.det_submatrix_equiv_self (requiredEdgeEquiv K A hA) + (M.submatrix Subtype.val Subtype.val) + +end Problem336.USTInclusionCount + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTPosteriorResponse.lean b/lean/OAI/Probability/SpanningForest/USTPosteriorResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..8137ac0d3a1b5e5282f205d38af6e50ca87504cd --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTPosteriorResponse.lean @@ -0,0 +1,149 @@ +import OAI.Probability.SpanningForest.USTFiniteTilt +import OAI.Probability.SpanningForest.FiniteUSTProbability +import OAI.Probability.SpanningForest.PosteriorTiltLimit + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped BigOperators + +namespace Problem336.USTResponse + +def extendMarks (h : EdgeCode → ℝ) (p : ℕ × ℕ) : ℝ := + if hp : p.1 < p.2 then h ⟨p, hp⟩ else 0 + +@[simp] lemma extendMarks_coe (h : EdgeCode → ℝ) (e : EdgeCode) : + extendMarks h e.1 = h e := by simp [extendMarks, e.2] + +lemma bit_finiteTreeConfiguration (T : Finset (ℕ × ℕ)) (e : EdgeCode) : + TiltLimit.bit (finiteTreeConfiguration T e) = if e.1 ∈ T then 1 else 0 := by + classical + by_cases he : e.1 ∈ T <;> simp [TiltLimit.bit, finiteTreeConfiguration, he] + +private lemma sum_restrict_support (K T S : Finset (ℕ × ℕ)) + (hT : T ⊆ K) (h : (ℕ × ℕ) → ℝ) : + (∑ p ∈ K, (if p ∈ S then h p else 0) * (if p ∈ T then 1 else 0)) = + ∑ p ∈ S, h p * (if p ∈ T then 1 else 0) := by + simp only [mul_ite, mul_one, mul_zero] + rw [← Finset.sum_filter, Finset.filter_mem_eq_inter, Finset.inter_eq_right.mpr hT] + rw [← Finset.sum_filter, ← Finset.sum_filter] + congr 1 + simp only [Finset.filter_mem_eq_inter, Finset.inter_comm] + +lemma finiteEnergy_eq_observationField (K : FiniteSubgraphCode) + (T : TreeSample K) (S : Finset EdgeCode) (h : EdgeCode → ℝ) : + TiltLimit.finiteEnergy S h (finiteTreeConfiguration T.1) = + ∑ f : FiniteEdge K, + observationField K (S.image Subtype.val) 0 (extendMarks h) f * indicator K T f := by + classical + simp only [observationField, zero_div, sub_zero, indicator] + rw [← Finset.sum_subtype K.2 (fun _ => Iff.rfl) + (fun p => (if p ∈ S.image Subtype.val then extendMarks h p else 0) * + (if p ∈ T.1 then (1 : ℝ) else 0))] + rw [sum_restrict_support K.2 T.1 (S.image Subtype.val) (tree_property K T).1] + rw [Finset.sum_image] + · simp only [TiltLimit.finiteEnergy, extendMarks_coe, bit_finiteTreeConfiguration] + · intro a _ b _ hab + exact Subtype.val_injective hab + +lemma exp_finiteEnergy_eq_weight (K : FiniteSubgraphCode) + (T : TreeSample K) (S : Finset EdgeCode) (h : EdgeCode → ℝ) : + Real.exp (TiltLimit.finiteEnergy S h (finiteTreeConfiguration T.1)) = + weight K (observationField K (S.image Subtype.val) 0 (extendMarks h)) T := by + rw [finiteEnergy_eq_observationField] + rfl + +lemma tiltedMean_finiteUSTProbability (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (energy obs : EdgeConfiguration → ℝ) : + TiltLimit.tiltedMean (finiteUSTProbability K hne) energy obs = + (∑ T : TreeSample K, obs (finiteTreeConfiguration T.1) * + Real.exp (energy (finiteTreeConfiguration T.1))) / + (∑ T : TreeSample K, Real.exp (energy (finiteTreeConfiguration T.1))) := by + have hc : ((spanningTrees K).card : ℝ) ≠ 0 := by + exact_mod_cast Finset.card_ne_zero.mpr hne + unfold TiltLimit.tiltedMean + change (∫ X, obs X * Real.exp (energy X) ∂finiteUSTMeasure K) / + (∫ X, Real.exp (energy X) ∂finiteUSTMeasure K) = _ + rw [integral_finiteUSTMeasure, integral_finiteUSTMeasure, + div_div_div_cancel_right₀ hc] + congr 1 <;> exact Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) _ + +lemma finiteTiltMean_eq_weight_ratio (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (S : Finset EdgeCode) + (h : EdgeCode → ℝ) (e : EdgeCode) : + TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h e = + (∑ T : TreeSample K, TiltLimit.bit (finiteTreeConfiguration T.1 e) * + weight K (observationField K (S.image Subtype.val) 0 (extendMarks h)) T) / + partition K (observationField K (S.image Subtype.val) 0 (extendMarks h)) := by + rw [TiltLimit.finiteTiltMean, tiltedMean_finiteUSTProbability] + simp_rw [exp_finiteEnergy_eq_weight] + rfl + +theorem finiteTiltMean_eq_finiteTilt (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (S : Finset EdgeCode) + (h : EdgeCode → ℝ) (e : EdgeCode) : + TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h e = + finiteTilt K (S.image Subtype.val) 0 (extendMarks h) e.1 := by + rw [finiteTiltMean_eq_weight_ratio] + by_cases he : e.1 ∈ K.2 + · rw [finiteTilt_of_mem K _ 0 _ e.1 he, inclusion_eq_ratio] + congr 1 + apply Finset.sum_congr rfl + intro T _ + simp [bit_finiteTreeConfiguration, indicator, mul_comm] + · rw [finiteTilt_of_not_mem K _ 0 _ e.1 he] + have hz (T : TreeSample K) : TiltLimit.bit (finiteTreeConfiguration T.1 e) = 0 := by + rw [bit_finiteTreeConfiguration, ite_eq_right] + exact fun ht => he ((tree_property K T).1 ht) + simp_rw [hz, zero_mul] + simp + +theorem finiteUST_posterior_response_of_response (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hresponse : ∀ (a b : FiniteEdge K → ℝ) (e : FiniteEdge K) (D : ℝ), + 0 ≤ D → (∀ f, |b f - a f| ≤ D) → + |inclusion K b e - inclusion K a e| ≤ D / 2) + (S : Finset EdgeCode) (h h' : EdgeCode → ℝ) (e : EdgeCode) + (D : ℝ) (hD : 0 ≤ D) (hh : ∀ f ∈ S, |h' f - h f| ≤ D) : + |TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h' e - + TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h e| ≤ D / 2 := by + rw [finiteTiltMean_eq_finiteTilt, finiteTiltMean_eq_finiteTilt] + apply finiteTilt_response_of_response K hresponse (S.image Subtype.val) 0 + (extendMarks h) (extendMarks h') e.1 D hD + intro p hp + obtain ⟨f, hf, rfl⟩ := Finset.mem_image.mp hp + simpa only [extendMarks_coe] using hh f hf + +theorem finiteUST_posterior_response (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → edgeCovariance K h e f ≤ 0) + (S : Finset EdgeCode) (h h' : EdgeCode → ℝ) (e : EdgeCode) + (D : ℝ) (hD : 0 ≤ D) (hh : ∀ f ∈ S, |h' f - h f| ≤ D) : + |TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h' e - + TiltLimit.finiteTiltMean (finiteUSTProbability K hne) S h e| ≤ D / 2 := by + rw [finiteTiltMean_eq_finiteTilt, finiteTiltMean_eq_finiteTilt] + apply finiteTilt_response K (S.image Subtype.val) hne hneg 0 + (extendMarks h) (extendMarks h') e.1 D hD + intro p hp + obtain ⟨f, hf, rfl⟩ := Finset.mem_image.mp hp + simpa only [extendMarks_coe] using hh f hf + +theorem finiteUST_limit_posterior_response {J : Type*} {l : Filter J} [l.NeBot] + (K : J → FiniteSubgraphCode) (hne : ∀ j, (spanningTrees (K j)).Nonempty) + (hneg : ∀ j h e f, e ≠ f → edgeCovariance (K j) h e f ≤ 0) + (μ : ProbabilityMeasure EdgeConfiguration) + (hμ : Filter.Tendsto (fun j => finiteUSTProbability (K j) (hne j)) l (nhds μ)) + (S : Finset EdgeCode) (h h' : EdgeCode → ℝ) (e : EdgeCode) + (D : ℝ) (hD : 0 ≤ D) (hh : ∀ f ∈ S, |h' f - h f| ≤ D) : + |TiltLimit.finiteTiltMean μ S h' e - TiltLimit.finiteTiltMean μ S h e| ≤ D / 2 := by + exact TiltLimit.finiteTiltMean_response_bound_of_tendsto hμ S h' h e + (Filter.Eventually.of_forall fun j => + finiteUST_posterior_response (K j) (hne j) (hneg j) S h h' e D hD hh) + +end Problem336.USTResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/USTResponse.lean b/lean/OAI/Probability/SpanningForest/USTResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a73c70bafdbfa36a395584a0d02feaadf456d70 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/USTResponse.lean @@ -0,0 +1,207 @@ +import OAI.Probability.SpanningForest.Definitions +import OAI.Probability.SpanningForest.GibbsResponse + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.USTResponse + +abbrev TreeSample (K : FiniteSubgraphCode) := + {T : Finset (ℕ × ℕ) // T ∈ spanningTrees K} + +abbrev FiniteEdge (K : FiniteSubgraphCode) := + {e : ℕ × ℕ // e ∈ K.2} + +def indicator (K : FiniteSubgraphCode) (T : TreeSample K) (e : FiniteEdge K) : ℝ := + if e.1 ∈ T.1 then 1 else 0 + +lemma tree_property (K : FiniteSubgraphCode) (T : TreeSample K) : TreeOn K T.1 := by + classical + exact (Finset.mem_filter.mp T.2).2 + +lemma indicator_binary (K : FiniteSubgraphCode) (T : TreeSample K) (e : FiniteEdge K) : + indicator K T e = 0 ∨ indicator K T e = 1 := by + unfold indicator + split_ifs <;> simp + +lemma sum_indicator (K : FiniteSubgraphCode) (T : TreeSample K) : + (∑ e : FiniteEdge K, indicator K T e) = (K.1.card : ℝ) - 1 := by + have hsub : T.1 ⊆ K.2 := (tree_property K T).1 + have hcard : T.1.card + 1 = K.1.card := (tree_property K T).2.1 + have heq : (∑ e : FiniteEdge K, indicator K T e) = (T.1.card : ℝ) := by + unfold indicator + rw [← Finset.sum_subtype K.2 (fun _ => Iff.rfl) + (fun e => if e ∈ T.1 then (1 : ℝ) else 0)] + rw [Finset.sum_boole, Finset.filter_mem_eq_inter, Finset.inter_eq_right.mpr hsub] + rw [heq] + have hc : (T.1.card : ℝ) + 1 = (K.1.card : ℝ) := by exact_mod_cast hcard + linarith + +def weight (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) (T : TreeSample K) : ℝ := + Real.exp (∑ e, h e * indicator K T e) + +def partition (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) : ℝ := + ∑ T : TreeSample K, weight K h T + +def mass (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) (T : TreeSample K) : ℝ := + weight K h T / partition K h + +lemma weight_pos (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) (T : TreeSample K) : + 0 < weight K h T := Real.exp_pos _ + +lemma partition_pos (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) : 0 < partition K h := by + obtain ⟨T, hT⟩ := hne + exact Finset.sum_pos (fun _ _ => weight_pos K h _) ⟨⟨T, hT⟩, Finset.mem_univ _⟩ + +lemma mass_nonneg (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) (T : TreeSample K) : 0 ≤ mass K h T := by + exact div_nonneg (weight_pos K h T).le (partition_pos K h hne).le + +lemma sum_mass (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) : (∑ T : TreeSample K, mass K h T) = 1 := by + simp only [mass, ← Finset.sum_div] + exact div_self (ne_of_gt (partition_pos K h hne)) + +def inclusion (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) (e : FiniteEdge K) : ℝ := + FiniteResponse.mean (mass K h) (indicator K) e + +def edgeCovariance (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (e f : FiniteEdge K) : ℝ := + FiniteResponse.covariance (mass K h) (indicator K) e f + +lemma weight_zero (K : FiniteSubgraphCode) (T : TreeSample K) : + weight K 0 T = 1 := by simp [weight] + +lemma partition_zero (K : FiniteSubgraphCode) : + partition K 0 = ((spanningTrees K).card : ℝ) := by + simp [partition, weight_zero] + +lemma mass_zero (K : FiniteSubgraphCode) (T : TreeSample K) : + mass K 0 T = 1 / ((spanningTrees K).card : ℝ) := by + simp [mass, weight_zero, partition_zero] + +lemma inclusion_eq_ratio (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (e : FiniteEdge K) : inclusion K h e = + (∑ T : TreeSample K, weight K h T * indicator K T e) / partition K h := by + simp only [inclusion, FiniteResponse.mean, mass, div_mul_eq_mul_div, + Finset.sum_div] + +lemma inclusion_zero (K : FiniteSubgraphCode) (e : FiniteEdge K) : + inclusion K 0 e = + (((spanningTrees K).filter (fun T => e.1 ∈ T)).card : ℝ) / + (spanningTrees K).card := by + rw [inclusion_eq_ratio, partition_zero] + simp only [weight_zero, one_mul] + unfold indicator + rw [← Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) + (fun T => if e.1 ∈ T then (1 : ℝ) else 0), Finset.sum_boole] + +lemma inclusion_zero_eq_ustCylinder (K : FiniteSubgraphCode) (e : EdgeCode) + (he : e.1 ∈ K.2) : + inclusion K 0 ⟨e.1, he⟩ = (ustCylinder K {e} ∅).toReal := by + classical + rw [inclusion_zero] + simp [ustCylinder, ENNReal.toReal_div] + +lemma inclusion_nonneg (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) (e : FiniteEdge K) : 0 ≤ inclusion K h e := by + apply FiniteResponse.mean_nonneg (mass K h) (indicator K) (mass_nonneg K h hne) + intro T f + rcases indicator_binary K T f with ht | ht <;> simp [ht] + +lemma inclusion_le_one (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) (e : FiniteEdge K) : inclusion K h e ≤ 1 := by + apply FiniteResponse.mean_le_one (mass K h) (indicator K) (mass_nonneg K h hne) + (sum_mass K h hne) + intro T f + rcases indicator_binary K T f with ht | ht <;> simp [ht] + +lemma sum_edgeCovariance_eq_zero (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) (e : FiniteEdge K) : + (∑ f, edgeCovariance K h e f) = 0 := by + exact FiniteResponse.sum_covariance_eq_zero (mass K h) (indicator K) + (sum_mass K h hne) ((K.1.card : ℝ) - 1) (sum_indicator K) e + +theorem abs_covariance_row (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ e f, e ≠ f → edgeCovariance K h e f ≤ 0) (e : FiniteEdge K) : + (∑ f, |edgeCovariance K h e f|) = + 2 * inclusion K h e * (1 - inclusion K h e) := by + exact FiniteResponse.covariance_abs_row (mass K h) (indicator K) + (mass_nonneg K h hne) (sum_mass K h hne) (indicator_binary K) + ((K.1.card : ℝ) - 1) (sum_indicator K) hneg e + +theorem abs_covariance_row_le_half (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ e f, e ≠ f → edgeCovariance K h e f ≤ 0) (e : FiniteEdge K) : + (∑ f, |edgeCovariance K h e f|) ≤ (1 : ℝ) / 2 := by + exact FiniteResponse.covariance_abs_row_le_half (mass K h) (indicator K) + (mass_nonneg K h hne) (sum_mass K h hne) (indicator_binary K) + ((K.1.card : ℝ) - 1) (sum_indicator K) hneg e + +lemma inclusion_eq_gibbs_mean (K : FiniteSubgraphCode) (h : FiniteEdge K → ℝ) + (e : FiniteEdge K) : + inclusion K h e = GibbsField.mean (indicator K) (fun T => indicator K T e) h := by + rw [GibbsField.coordinate_mean_eq_finiteResponse] + rfl + +lemma edgeCovariance_eq_gibbs_covariance (K : FiniteSubgraphCode) + (h : FiniteEdge K → ℝ) (e f : FiniteEdge K) : + edgeCovariance K h e f = + GibbsField.covariance (indicator K) (fun T => indicator K T e) + (fun T => indicator K T f) h := by + rw [GibbsField.coordinate_covariance_eq_finiteResponse] + rfl + +theorem hasDerivAt_inclusion_direction (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (h k : FiniteEdge K → ℝ) + (e : FiniteEdge K) (t : ℝ) : + HasDerivAt (fun s => inclusion K (fun f => h f + s * k f) e) + (∑ f, k f * edgeCovariance K (fun f => h f + t * k f) e f) t := by + let : Nonempty (TreeSample K) := ⟨⟨hne.choose, hne.choose_spec⟩⟩ + simpa only [inclusion_eq_gibbs_mean, edgeCovariance_eq_gibbs_covariance] using + GibbsField.hasDerivAt_mean_direction_sum (indicator K) (fun T => indicator K T e) h k t + +theorem inclusion_response (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → edgeCovariance K h e f ≤ 0) + (a b : FiniteEdge K → ℝ) (e : FiniteEdge K) : + |inclusion K b e - inclusion K a e| ≤ (1 / 2 : ℝ) * ‖b - a‖ := by + let : Nonempty (TreeSample K) := ⟨⟨hne.choose, hne.choose_spec⟩⟩ + have hn : ∀ h e f, e ≠ f → GibbsField.covariance (indicator K) + (fun T => indicator K T e) (fun T => indicator K T f) h ≤ 0 := by + simpa only [edgeCovariance_eq_gibbs_covariance] using hneg + simpa only [inclusion_eq_gibbs_mean] using + GibbsField.response_bound (indicator K) (indicator_binary K) + ((K.1.card : ℝ) - 1) (sum_indicator K) hn a b e + +theorem inclusion_response_of_coordinate_bound (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → edgeCovariance K h e f ≤ 0) + (a b : FiniteEdge K → ℝ) (e : FiniteEdge K) (D : ℝ) (hD : 0 ≤ D) + (hab : ∀ f, |b f - a f| ≤ D) : + |inclusion K b e - inclusion K a e| ≤ D / 2 := by + apply (inclusion_response K hne hneg a b e).trans + have hn : ‖b - a‖ ≤ D := (pi_norm_le_iff_of_nonneg hD).mpr hab + linarith + +lemma continuous_inclusion (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (e : FiniteEdge K) : + Continuous (fun h => inclusion K h e) := by + let : Nonempty (TreeSample K) := ⟨⟨hne.choose, hne.choose_spec⟩⟩ + simpa only [inclusion_eq_gibbs_mean] using + GibbsField.continuous_mean (indicator K) (fun T => indicator K T e) + +lemma measurable_inclusion (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) (e : FiniteEdge K) : + Measurable (fun h => inclusion K h e) := + (continuous_inclusion K hne e).measurable + +end Problem336.USTResponse + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/UniformSampler.lean b/lean/OAI/Probability/SpanningForest/UniformSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..963322b9b95a96911bb269f4516114d1167977fc --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/UniformSampler.lean @@ -0,0 +1,96 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped unitInterval + +namespace Problem336 + +def clampUniform : ℝ → I := Set.projIcc 0 1 zero_le_one + +@[fun_prop] +theorem measurable_clampUniform : Measurable clampUniform := + continuous_projIcc.measurable + +theorem uniform01_eq_map_unitInterval : + uniform01 = (volume : Measure I).map (fun x : I => (x : ℝ)) := + unitInterval.measurePreserving_coe.map_eq.symm + +theorem map_clampUniform : uniform01.map clampUniform = (volume : Measure I) := by + rw [uniform01_eq_map_unitInterval, + Measure.map_map measurable_clampUniform measurable_subtype_coe] + convert (Measure.map_id : (volume : Measure I).map id = volume) using 1 + congr 1 + funext x + exact Set.projIcc_val zero_le_one x + +theorem exists_uniform01_sampler {Y : Type*} [MeasurableSpace Y] + [Nonempty Y] [StandardBorelSpace Y] (μ : Measure Y) [IsProbabilityMeasure μ] : + ∃ f : ℝ → Y, Measurable f ∧ uniform01.map f = μ := by + obtain ⟨f, hf, hmap⟩ := μ.exists_measurable_map_eq + refine ⟨f ∘ clampUniform, hf.comp measurable_clampUniform, ?_⟩ + rw [← Measure.map_map hf measurable_clampUniform, map_clampUniform, hmap] + +theorem sampler_uniform01_probability : IsProbabilityMeasure uniform01 := by + rw [uniform01_eq_map_unitInterval] + exact inferInstance + +local instance : IsProbabilityMeasure uniform01 := sampler_uniform01_probability + +def privatePoolLaw : Measure (ℕ → ℝ) := + Measure.infinitePi (fun _ : ℕ => uniform01) + +theorem privatePoolLaw_probability : IsProbabilityMeasure privatePoolLaw := by + unfold privatePoolLaw + infer_instance + +local instance : IsProbabilityMeasure privatePoolLaw := privatePoolLaw_probability + +def keyPoolLaw : Measure (ℝ × (ℕ → ℝ)) := uniform01.prod privatePoolLaw + +theorem keyPoolLaw_probability : IsProbabilityMeasure keyPoolLaw := by + unfold keyPoolLaw + infer_instance + +local instance : IsProbabilityMeasure keyPoolLaw := keyPoolLaw_probability + +def splitVertexLabel : ℝ → ℝ × (ℕ → ℝ) := + Classical.choose (exists_uniform01_sampler keyPoolLaw) + +@[fun_prop] +theorem measurable_splitVertexLabel : Measurable splitVertexLabel := + (Classical.choose_spec (exists_uniform01_sampler keyPoolLaw)).1 + +theorem map_splitVertexLabel : uniform01.map splitVertexLabel = keyPoolLaw := + (Classical.choose_spec (exists_uniform01_sampler keyPoolLaw)).2 + +theorem exists_uniform01_kernel_sampler {X Y : Type*} [MeasurableSpace X] + [MeasurableSpace Y] [Nonempty Y] [StandardBorelSpace Y] + (κ : ProbabilityTheory.Kernel X Y) [ProbabilityTheory.IsMarkovKernel κ] : + ∃ f : X → ℝ → Y, Measurable (Function.uncurry f) ∧ + ∀ x, uniform01.map (f x) = κ x := by + obtain ⟨f, hf, hmap⟩ := κ.exists_measurable_map_eq_unitInterval + refine ⟨fun x r => f x (clampUniform r), ?_, ?_⟩ + · exact hf.comp (measurable_fst.prodMk (measurable_clampUniform.comp measurable_snd)) + · intro x + change uniform01.map (f x ∘ clampUniform) = κ x + rw [← Measure.map_map hf.of_uncurry_left measurable_clampUniform, + map_clampUniform, hmap] + +theorem map_splitVertexLabels : + (Measure.infinitePi (fun _ : ℕ => uniform01)).map + (fun U : ℕ → ℝ => fun v => splitVertexLabel (U v)) = + Measure.infinitePi (fun _ : ℕ => keyPoolLaw) := by + rw [Measure.infinitePi_map_pi] + · simp only [map_splitVertexLabel] + · intro v + exact measurable_splitVertexLabel + +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedCauchyBinet.lean b/lean/OAI/Probability/SpanningForest/WeightedCauchyBinet.lean new file mode 100644 index 0000000000000000000000000000000000000000..298e7f4bd9e6684ee63c9a894613950e1129e83c --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedCauchyBinet.lean @@ -0,0 +1,142 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators Matrix +open Equiv Finset Function + +namespace Problem336 +namespace WeightedCauchyBinet + +variable {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] +variable {R : Type*} [CommRing R] + +theorem det_mul_expansion (A : Matrix n m R) (B : Matrix m n R) : + (A * B).det = ∑ f : n → m, (A.submatrix id f).det * ∏ i, B (f i) i := by + calc + (A * B).det = ∑ f : n → m, ∑ σ : Equiv.Perm n, + ((Equiv.Perm.sign σ : ℤ) : R) * ∏ i, A (σ i) (f i) * B (f i) i := by + simp only [Matrix.det_apply', Matrix.mul_apply, prod_univ_sum, mul_sum, + Fintype.piFinset_univ] + exact Finset.sum_comm + _ = ∑ f : n → m, (A.submatrix id f).det * ∏ i, B (f i) i := by + apply Finset.sum_congr rfl + intro f _ + simp only [Matrix.det_apply', Matrix.submatrix_apply, id_eq, + Finset.sum_mul, Finset.prod_mul_distrib, mul_assoc] + +theorem ordered_cauchy_binet (A : Matrix n m R) (B : Matrix m n R) : + (Fintype.card (Equiv.Perm n) : R) * (A * B).det = + ∑ f : n → m, (A.submatrix id f).det * (B.submatrix f id).det := by + have hperm (σ : Equiv.Perm n) : + (∑ f : n → m, (A.submatrix id f).det * + (((Equiv.Perm.sign σ : ℤ) : R) * ∏ i, B (f (σ i)) i)) = + (A * B).det := by + rw [det_mul_expansion] + apply Fintype.sum_equiv (Equiv.arrowCongr σ.symm (Equiv.refl m)) + intro f + have hdet := Matrix.det_permute' σ (A.submatrix id f) + change (A.submatrix id f).det * + (((Equiv.Perm.sign σ : ℤ) : R) * ∏ i, B (f (σ i)) i) = + (A.submatrix id (fun i => f (σ i))).det * ∏ i, B (f (σ i)) i + have hmat : (A.submatrix id (fun i => f (σ i))) = + (A.submatrix id f).submatrix id σ := rfl + rw [hmat, hdet] + ring + symm + calc + (∑ f : n → m, (A.submatrix id f).det * (B.submatrix f id).det) = + ∑ σ : Equiv.Perm n, ∑ f : n → m, (A.submatrix id f).det * + (((Equiv.Perm.sign σ : ℤ) : R) * ∏ i, B (f (σ i)) i) := by + simp only [Matrix.det_apply', Matrix.submatrix_apply, id_eq, Finset.mul_sum] + exact Finset.sum_comm + _ = ∑ _σ : Equiv.Perm n, (A * B).det := by + apply Finset.sum_congr rfl + intro σ _ + exact hperm σ + _ = (Fintype.card (Equiv.Perm n) : R) * (A * B).det := by + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + +theorem weighted_gram_det [DecidableEq m] (A : Matrix n m R) (c : m → R) : + (Fintype.card (Equiv.Perm n) : R) * + (A * Matrix.diagonal c * A.transpose).det = + ∑ f : n → m, (A.submatrix id f).det ^ 2 * ∏ i, c (f i) := by + have hminor (f : n → m) : + ((Matrix.diagonal c * A.transpose).submatrix f id).det = + (∏ i, c (f i)) * (A.submatrix id f).det := by + have hmatrix : (Matrix.diagonal c * A.transpose).submatrix f id = + Matrix.of (fun i j => c (f i) * (A.submatrix id f).transpose i j) := by + ext i j + simp only [Matrix.submatrix_apply, Matrix.diagonal_mul, Matrix.transpose_apply, + Matrix.of_apply, id_eq] + rw [hmatrix, Matrix.det_mul_column, Matrix.det_transpose] + rw [Matrix.mul_assoc, ordered_cauchy_binet] + apply Finset.sum_congr rfl + intro f _ + rw [hminor] + ring + +theorem weighted_gram_det_real [DecidableEq m] (A : Matrix n m ℝ) (c : m → ℝ) : + (A * Matrix.diagonal c * A.transpose).det = + (∑ f : n → m, (A.submatrix id f).det ^ 2 * ∏ i, c (f i)) / + (Fintype.card n).factorial := by + have h := weighted_gram_det A c + rw [Fintype.card_perm] at h + have hfac : ((Fintype.card n).factorial : ℝ) ≠ 0 := by + exact_mod_cast Nat.factorial_ne_zero (Fintype.card n) + apply (eq_div_iff hfac).mpr + simpa only [mul_comm] using h + +omit [Fintype m] in + +theorem det_submatrix_eq_zero_of_not_injective (A : Matrix n m R) {f : n → m} + (hf : ¬ Function.Injective f) : (A.submatrix id f).det = 0 := by + obtain ⟨i, j, hij, hne⟩ := Function.not_injective_iff.mp hf + exact Matrix.det_zero_of_column_eq hne (fun k => by simp [Matrix.submatrix_apply, hij]) + +theorem weighted_gram_det_injective [DecidableEq m] + (A : Matrix n m R) (c : m → R) : + (Fintype.card (Equiv.Perm n) : R) * + (A * Matrix.diagonal c * A.transpose).det = + ∑ f : n → m with Function.Injective f, + (A.submatrix id f).det ^ 2 * ∏ i, c (f i) := by + classical + rw [weighted_gram_det] + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro f _ hf + have hnot : ¬ Function.Injective f := by simpa only [Finset.mem_filter_univ] using hf + rw [det_submatrix_eq_zero_of_not_injective A hnot] + simp + +theorem weighted_gram_det_nonneg [DecidableEq m] + (A : Matrix n m ℝ) (c : m → ℝ) (hc : ∀ j, 0 ≤ c j) : + 0 ≤ (A * Matrix.diagonal c * A.transpose).det := by + rw [weighted_gram_det_real] + apply div_nonneg + · exact Finset.sum_nonneg fun f _ => + mul_nonneg (sq_nonneg _) (Finset.prod_nonneg fun i _ => hc (f i)) + · positivity + +theorem weighted_gram_det_pos [DecidableEq m] + (A : Matrix n m ℝ) (c : m → ℝ) (hc : ∀ j, 0 < c j) + (hA : ∃ f : n → m, (A.submatrix id f).det ≠ 0) : + 0 < (A * Matrix.diagonal c * A.transpose).det := by + rw [weighted_gram_det_real] + apply div_pos + · apply Finset.sum_pos' + · intro f _ + exact mul_nonneg (sq_nonneg _) (Finset.prod_nonneg fun i _ => (hc (f i)).le) + · obtain ⟨f, hf⟩ := hA + exact ⟨f, Finset.mem_univ _, + mul_pos (sq_pos_of_ne_zero hf) (Finset.prod_pos fun i _ => hc (f i))⟩ + · exact_mod_cast Nat.factorial_pos (Fintype.card n) + +end WeightedCauchyBinet +end Problem336 + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedInnovation.lean b/lean/OAI/Probability/SpanningForest/WeightedInnovation.lean new file mode 100644 index 0000000000000000000000000000000000000000..135c022bb6ed0ec45ae2624871add1ad2c3f5a5b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedInnovation.lean @@ -0,0 +1,130 @@ +import OAI.Probability.SpanningForest.InnovationMoments +import OAI.Probability.SpanningForest.InnovationTaylor +import OAI.Probability.SpanningForest.GaussianMomentScaling + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped NNReal + +namespace Problem336.Innovation + +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + +theorem weighted_square_perturbation [IsFiniteMeasure P] + {Q R : Ω → ℝ} {K : Ω → ℂ} {a : ℝ} + (hQ : Integrable Q P) (hQ2 : Integrable (fun ω => Q ω ^ 2) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hRbound : ∀ᵐ ω ∂P, |R ω| ≤ a) + (hKmeas : AEStronglyMeasurable K P) (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) : + ‖(∫ ω, K ω * ((Q ω + R ω : ℝ) : ℂ) ^ 2 ∂P) - + ∫ ω, K ω * (Q ω : ℂ) ^ 2 ∂P‖ ≤ + 2 * a * (∫ ω, |Q ω| ∂P) + a ^ 2 * P.real Set.univ := by + have hD2 := InnovationMoments.integrable_square_add_of_bounded + hQ.aestronglyMeasurable hR hQ2 ha hRbound + have hCD2 : Integrable (fun ω => ((Q ω + R ω : ℝ) : ℂ) ^ 2) P := by + convert Complex.ofRealCLM.integrable_comp hD2 using 1 + ext ω + simp + have hCQ2 : Integrable (fun ω => (Q ω : ℂ) ^ 2) P := by + convert Complex.ofRealCLM.integrable_comp hQ2 using 1 + ext ω + simp + have hKD2 := hCD2.bdd_mul hKmeas hK + have hKQ2 := hCQ2.bdd_mul hKmeas hK + have hbound : Integrable (fun ω => 2 * a * |Q ω| + a ^ 2) P := + (hQ.abs.const_mul (2 * a)).add (integrable_const _) + rw [← integral_sub hKD2 hKQ2] + calc + _ ≤ ∫ ω, 2 * a * |Q ω| + a ^ 2 ∂P := by + apply norm_integral_le_of_norm_le hbound + filter_upwards [hRbound, hK] with ω hRω hKω + have heq : K ω * ((Q ω + R ω : ℝ) : ℂ) ^ 2 - K ω * (Q ω : ℂ) ^ 2 = + K ω * ((((Q ω + R ω) ^ 2 - Q ω ^ 2 : ℝ)) : ℂ) := by + push_cast + ring + rw [heq, norm_mul, Complex.norm_real, Real.norm_eq_abs] + calc + _ ≤ 1 * |(Q ω + R ω) ^ 2 - Q ω ^ 2| := + mul_le_mul_of_nonneg_right hKω (abs_nonneg _) + _ ≤ 2 * a * |Q ω| + a ^ 2 := by + simpa only [one_mul] using + InnovationMoments.abs_square_perturbation_le (Q ω) (R ω) a ha hRω + _ = _ := by + rw [integral_add (hQ.abs.const_mul _) (integrable_const _), + integral_const_mul, integral_const] + simp only [smul_eq_mul] + ring + +theorem weighted_bounded_perturbation_characteristic [IsProbabilityMeasure P] + {Q R : Ω → ℝ} {K : Ω → ℂ} {a q : ℝ} + (hQ : Integrable Q P) (hQ2 : Integrable (fun ω => Q ω ^ 2) P) + (hQ3 : Integrable (fun ω => |Q ω| ^ 3) P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hRbound : ∀ᵐ ω ∂P, |R ω| ≤ a) + (hKmeas : AEStronglyMeasurable K P) (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hmean : (∫ ω, K ω * ((Q ω + R ω : ℝ) : ℂ) ∂P) = 0) + (hq0 : 0 ≤ q) (hq1 : q ≤ 1) + (hQmoment : (∫ ω, K ω * (Q ω : ℂ) ^ 2 ∂P) = + (2 * q : ℝ) * (∫ ω, K ω ∂P)) : + ‖(∫ ω, K ω * Complex.exp (((Q ω + R ω : ℝ) : ℂ) * Complex.I) ∂P) - + (Real.exp (-q) : ℂ) * (∫ ω, K ω ∂P)‖ ≤ + 16 * ((∫ ω, |Q ω| ^ 3 ∂P) + a ^ 3) + + (2 * a * (∫ ω, |Q ω| ∂P) + a ^ 2) / 2 + q ^ 2 := by + have hRint : Integrable R P := Integrable.of_bound hR a (by simpa using hRbound) + have hD2 := InnovationMoments.integrable_square_add_of_bounded + hQ.aestronglyMeasurable hR hQ2 ha hRbound + have hD3 := InnovationMoments.integrable_abs_cube_add_of_bounded + hQ.aestronglyMeasurable hR hQ3 ha hRbound + have hM : ‖(∫ ω, K ω * ((Q ω + R ω : ℝ) : ℂ) ^ 2 ∂P) - + (2 * q : ℝ) * (∫ ω, K ω ∂P)‖ ≤ + 2 * a * (∫ ω, |Q ω| ∂P) + a ^ 2 := by + rw [← hQmoment] + simpa using weighted_square_perturbation hQ hQ2 hR ha hRbound hKmeas hK + have hstep := weighted_characteristic_gaussian_bound P (fun ω => Q ω + R ω) K + hKmeas hK (hQ.add hRint) hD2 hD3 hmean hq0 hq1 hM + have hthird : (∫ ω, |Q ω + R ω| ^ 3 ∂P) ≤ + 4 * ((∫ ω, |Q ω| ^ 3 ∂P) + a ^ 3) := by + simpa using InnovationMoments.integral_abs_cube_perturbation_le + hQ.aestronglyMeasurable hR hQ3 ha hRbound + linarith + +theorem gaussian_bounded_perturbation_characteristic + {Q R : Ω → ℝ} {K : Ω → ℂ} {a : ℝ} {v : ℝ≥0} + (hLaw : ProbabilityTheory.HasLaw Q (ProbabilityTheory.gaussianReal 0 v) P) + (hIndep : ProbabilityTheory.IndepFun K Q P) + (hR : AEStronglyMeasurable R P) (ha : 0 ≤ a) + (hRbound : ∀ᵐ ω ∂P, |R ω| ≤ a) + (hKmeas : AEStronglyMeasurable K P) (hK : ∀ᵐ ω ∂P, ‖K ω‖ ≤ 1) + (hmean : (∫ ω, K ω * ((Q ω + R ω : ℝ) : ℂ) ∂P) = 0) + (hv : (v : ℝ) ≤ 2) : + ‖(∫ ω, K ω * Complex.exp (((Q ω + R ω : ℝ) : ℂ) * Complex.I) ∂P) - + (Real.exp (-((v : ℝ) / 2)) : ℂ) * (∫ ω, K ω ∂P)‖ ≤ + 16 * ((Real.sqrt (v : ℝ)) ^ 3 * + (∫ z : ℝ, |z| ^ 3 ∂ProbabilityTheory.gaussianReal 0 1) + a ^ 3) + + (2 * a * Real.sqrt (v : ℝ) + a ^ 2) / 2 + ((v : ℝ) / 2) ^ 2 := by + let : IsProbabilityMeasure P := hLaw.isProbabilityMeasure + have hQ : Integrable Q P := hLaw.hasGaussianLaw.integrable + have hQ2 : Integrable (fun ω => Q ω ^ 2) P := by + simpa only [sq_abs] using gaussian_hasLaw_integrable_abs_pow hLaw 2 + have hQ3 := gaussian_hasLaw_integrable_abs_pow hLaw 3 + have hQmoment : (∫ ω, K ω * (Q ω : ℂ) ^ 2 ∂P) = + (2 * ((v : ℝ) / 2) : ℝ) * (∫ ω, K ω ∂P) := by + rw [gaussian_independent_weighted_second_moment hLaw hKmeas.aemeasurable hIndep] + push_cast + ring + have hq0 : 0 ≤ (v : ℝ) / 2 := by positivity + have hq1 : (v : ℝ) / 2 ≤ 1 := by linarith + have hstep := weighted_bounded_perturbation_characteristic hQ hQ2 hQ3 hR ha + hRbound hKmeas hK hmean hq0 hq1 hQmoment + apply hstep.trans + rw [gaussian_hasLaw_absolute_moment hLaw 3] + gcongr + exact gaussian_hasLaw_absolute_first_moment_le hLaw + +end Problem336.Innovation + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedTreeBorel.lean b/lean/OAI/Probability/SpanningForest/WeightedTreeBorel.lean new file mode 100644 index 0000000000000000000000000000000000000000..b592412c9e7acdf5d4c3b06503e27bbc4f8e9f73 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedTreeBorel.lean @@ -0,0 +1,190 @@ +import OAI.Probability.SpanningForest.Definitions + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem336.WeightedTree + +abbrev Field := (ℕ × ℕ) → ℝ + +def weight (h : Field) (T : Finset (ℕ × ℕ)) : ℝ := + Real.exp (∑ p ∈ T, h p) + +def partition (K : FiniteSubgraphCode) (h : Field) : ℝ := + ∑ T ∈ spanningTrees K, weight h T + +def numerator (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : ℝ := by + classical + exact ∑ T ∈ (spanningTrees K).filter (fun T => e ∈ T), weight h T + +def inclusion (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : ℝ := + numerator K e h / partition K h + +theorem weight_pos (h : Field) (T : Finset (ℕ × ℕ)) : + 0 < weight h T := Real.exp_pos _ + +theorem partition_nonneg (K : FiniteSubgraphCode) (h : Field) : + 0 ≤ partition K h := + Finset.sum_nonneg (fun T _ => (weight_pos h T).le) + +theorem partition_pos {K : FiniteSubgraphCode} + (hK : (spanningTrees K).Nonempty) (h : Field) : + 0 < partition K h := + Finset.sum_pos (fun T _ => weight_pos h T) hK + +theorem numerator_nonneg (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : + 0 ≤ numerator K e h := by + classical + exact Finset.sum_nonneg (fun T _ => (weight_pos h T).le) + +theorem numerator_le_partition (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : + numerator K e h ≤ partition K h := by + classical + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun T _ _ => (weight_pos h T).le) + +theorem inclusion_mem_Icc (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : + inclusion K e h ∈ Set.Icc (0 : ℝ) 1 := by + refine ⟨div_nonneg (numerator_nonneg K e h) (partition_nonneg K h), ?_⟩ + by_cases hzero : partition K h = 0 + · simp [inclusion, hzero] + · exact (div_le_one (lt_of_le_of_ne (partition_nonneg K h) (Ne.symm hzero))).mpr + (numerator_le_partition K e h) + +theorem measurable_weight (T : Finset (ℕ × ℕ)) : + Measurable (fun h : Field => weight h T) := by + exact (Finset.measurable_sum T (fun p _ => measurable_pi_apply p)).exp + +theorem measurable_partition (K : FiniteSubgraphCode) : + Measurable (partition K) := by + exact Finset.measurable_sum (spanningTrees K) (fun T _ => measurable_weight T) + +theorem measurable_numerator (K : FiniteSubgraphCode) (e : ℕ × ℕ) : + Measurable (numerator K e) := by + classical + exact Finset.measurable_sum _ (fun T _ => measurable_weight T) + +theorem measurable_inclusion (K : FiniteSubgraphCode) (e : ℕ × ℕ) : + Measurable (inclusion K e) := + (measurable_numerator K e).div (measurable_partition K) + +theorem measurable_partition_joint : + Measurable (fun q : FiniteSubgraphCode × Field => partition q.1 q.2) := + measurable_from_prod_countable_right measurable_partition + +theorem measurable_inclusion_joint : + Measurable (fun q : (FiniteSubgraphCode × (ℕ × ℕ)) × Field => + inclusion q.1.1 q.1.2 q.2) := + measurable_from_prod_countable_right (fun q => measurable_inclusion q.1 q.2) + +def finiteField (S : Finset (ℕ × ℕ)) (t : ℝ) (y : Field) : Field := + fun p => if p ∈ S then y p - t / 2 else 0 + +theorem measurable_finiteField (S : Finset (ℕ × ℕ)) : + Measurable (fun q : ℝ × Field => finiteField S q.1 q.2) := by + apply Measurable.of_eval + intro p + by_cases hp : p ∈ S + · have ht : Measurable (fun q : ℝ × Field => q.1 / (2 : ℝ)) := + measurable_fst.div_const (2 : ℝ) + have hy : Measurable (fun q : ℝ × Field => q.2 p) := + (measurable_pi_apply p).comp measurable_snd + simpa only [finiteField, ite_eq_left hp] using hy.fun_sub ht + · simpa only [finiteField, ite_eq_right hp] using + (measurable_const : Measurable (fun _ : ℝ × Field => (0 : ℝ))) + +theorem measurable_finiteField_joint : + Measurable (fun q : Finset (ℕ × ℕ) × (ℝ × Field) => + finiteField q.1 q.2.1 q.2.2) := + measurable_from_prod_countable_right measurable_finiteField + +theorem measurable_finiteTilt_joint : + Measurable + (fun q : (FiniteSubgraphCode × ((ℕ × ℕ) × Finset (ℕ × ℕ))) × (ℝ × Field) => + inclusion q.1.1 q.1.2.1 (finiteField q.1.2.2 q.2.1 q.2.2)) := by + apply measurable_from_prod_countable_right + intro q + exact (measurable_inclusion q.1 q.2.1).comp (measurable_finiteField q.2.2) + +def extendField (y : EdgeCode → ℝ) : Field := + fun p => if hp : p.1 < p.2 then y ⟨p, hp⟩ else 0 + +@[simp] theorem extendField_apply (y : EdgeCode → ℝ) (e : EdgeCode) : + extendField y e.1 = y e := by + simp only [extendField, dite_eq_left e.2] + +theorem measurable_extendField : Measurable extendField := by + apply Measurable.of_eval + intro p + by_cases hp : p.1 < p.2 + · simpa only [extendField, dite_eq_left hp] using + (measurable_pi_apply (⟨p, hp⟩ : EdgeCode)) + · simpa only [extendField, dite_eq_right hp] using + (measurable_const : Measurable (fun _ : EdgeCode → ℝ => (0 : ℝ))) + +theorem measurable_edgeFiniteTilt_joint : + Measurable + (fun q : (FiniteSubgraphCode × (EdgeCode × Finset (ℕ × ℕ))) × + (ℝ × (EdgeCode → ℝ)) => + inclusion q.1.1 q.1.2.1.1 + (finiteField q.1.2.2 q.2.1 (extendField q.2.2))) := by + apply measurable_from_prod_countable_right + intro q + exact (measurable_inclusion q.1 q.2.1.1).comp + ((measurable_finiteField q.2.2).comp + (measurable_fst.prodMk (measurable_extendField.comp measurable_snd))) + +theorem inclusion_zero_field (K : FiniteSubgraphCode) (e : ℕ × ℕ) : + inclusion K e 0 = + (((spanningTrees K).filter (fun T => e ∈ T)).card : ℝ) / + ((spanningTrees K).card : ℝ) := by + classical + simp [inclusion, numerator, partition, weight] + +theorem inclusion_zero_field_eq_ustCylinder (K : FiniteSubgraphCode) (e : EdgeCode) : + inclusion K e.1 0 = (ustCylinder K {e} ∅).toReal := by + classical + rw [inclusion_zero_field] + simp [ustCylinder, ENNReal.toReal_div] + +theorem ofReal_inclusion_zero_field (K : FiniteSubgraphCode) (e : EdgeCode) : + ENNReal.ofReal (inclusion K e.1 0) = ustCylinder K {e} ∅ := by + classical + by_cases hzero : (spanningTrees K).card = 0 + · have hempty : spanningTrees K = ∅ := Finset.card_eq_zero.mp hzero + simp [inclusion, numerator, partition, ustCylinder, hempty] + · rw [inclusion_zero_field, + ENNReal.ofReal_div_of_pos (by exact_mod_cast Nat.pos_of_ne_zero hzero)] + simp [ustCylinder] + +theorem inclusion_eq_zero_of_not_mem {K : FiniteSubgraphCode} {e : ℕ × ℕ} + (he : e ∉ K.2) (h : Field) : inclusion K e h = 0 := by + classical + have hfilter : (spanningTrees K).filter (fun T => e ∈ T) = ∅ := by + apply Finset.eq_empty_iff_forall_notMem.mpr + intro T hT + obtain ⟨hT, heT⟩ := Finset.mem_filter.mp hT + have hsub : T ⊆ K.2 := (Finset.mem_filter.mp hT).2.1 + exact he (hsub heT) + simp [inclusion, numerator, hfilter] + +theorem weight_image (T : Finset (ℕ × ℕ)) (φ : (ℕ × ℕ) → (ℕ × ℕ)) + (a b : Field) (hinj : Set.InjOn φ (T : Set (ℕ × ℕ))) + (hfield : ∀ p ∈ T, b (φ p) = a p) : + weight b (T.image φ) = weight a T := by + classical + unfold weight + congr 1 + rw [Finset.sum_image] + · exact Finset.sum_congr rfl hfield + · intro p hp q hq hpq + exact hinj hp hq hpq + +end Problem336.WeightedTree + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedTreeEquiv.lean b/lean/OAI/Probability/SpanningForest/WeightedTreeEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6d7efe3e5d973ee77e3776a21d950941883ef70 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedTreeEquiv.lean @@ -0,0 +1,126 @@ +import OAI.Probability.SpanningForest.WeightedTreeTransport +import OAI.Probability.SpanningForest.FiniteUSTRelabel + +namespace OAI + +noncomputable section + +namespace Problem336.WeightedTree + +private theorem tree_canonical {K : FiniteSubgraphCode} + (hK : ∀ p ∈ K.2, p.1 < p.2) (T : USTResponse.TreeSample K) : + ∀ p ∈ T.1, p.1 < p.2 := + fun p hp => hK p ((USTResponse.tree_property K T).1 hp) + +def treeRelabelEquiv (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) : + USTResponse.TreeSample K ≃ USTResponse.TreeSample (relabelFiniteSubgraph σ K) where + toFun T := ⟨relabelEdgeSet σ T.1, by + rw [spanningTrees_relabel σ K hK] + exact Finset.mem_image.mpr ⟨T.1, T.2, rfl⟩⟩ + invFun T := ⟨relabelEdgeSet σ.symm T.1, by + have hm : T.1 ∈ (spanningTrees K).image (relabelEdgeSet σ) := by + simpa only [spanningTrees_relabel σ K hK] using T.2 + obtain ⟨S, hS, heq⟩ := Finset.mem_image.mp hm + rw [← heq, relabelEdgeSet_symm σ S (tree_canonical hK ⟨S, hS⟩)] + exact hS⟩ + left_inv T := Subtype.ext (relabelEdgeSet_symm σ T.1 (tree_canonical hK T)) + right_inv T := by + apply Subtype.ext + exact relabelEdgeSet_symm σ.symm T.1 + (tree_canonical (relabelEdgeSet_valid σ K.2 hK) T) + +@[simp] theorem treeRelabelEquiv_val (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (T : USTResponse.TreeSample K) : + (treeRelabelEquiv σ K hK T).1 = relabelEdgeSet σ T.1 := rfl + +def relabelField (σ : Equiv ℕ ℕ) (h : Field) : Field := + fun p => h (relabelPair σ.symm p) + +@[simp] theorem relabelField_mapEdge (σ : Equiv ℕ ℕ) (h : Field) (e : EdgeCode) : + relabelField σ h (mapEdge σ e).1 = h e.1 := by + unfold relabelField + rw [← relabelPair_edge, relabelPair_symm σ e.2] + +theorem inclusion_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (h : Field) (e : EdgeCode) : + inclusion (relabelFiniteSubgraph σ K) (mapEdge σ e).1 (relabelField σ h) = + inclusion K e.1 h := by + apply inclusion_eq_of_tree_equiv K _ (treeRelabelEquiv σ K hK) h + (relabelField σ h) e.1 (mapEdge σ e).1 + · intro T + apply weight_image + · intro p hp q hq hpq + exact relabelPair_injOn σ (tree_canonical hK T p hp) + (tree_canonical hK T q hq) hpq + · intro p hp + simpa only [← relabelPair_edge] using + relabelField_mapEdge σ h ⟨p, tree_canonical hK T p hp⟩ + · intro T + exact mem_relabelEdgeSet_iff σ T.1 (tree_canonical hK T) e + +theorem finiteField_relabel_mapEdge (σ : Equiv ℕ ℕ) (S : Finset (ℕ × ℕ)) + (hS : ∀ p ∈ S, p.1 < p.2) (t : ℝ) (h : Field) (e : EdgeCode) : + finiteField (relabelEdgeSet σ S) t (relabelField σ h) (mapEdge σ e).1 = + finiteField S t h e.1 := by + simp only [finiteField, mem_relabelEdgeSet_iff σ S hS e, relabelField_mapEdge] + +theorem finiteTilt_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (S : Finset (ℕ × ℕ)) + (hS : ∀ p ∈ S, p.1 < p.2) (t : ℝ) (h : Field) (e : EdgeCode) : + inclusion (relabelFiniteSubgraph σ K) (mapEdge σ e).1 + (finiteField (relabelEdgeSet σ S) t (relabelField σ h)) = + inclusion K e.1 (finiteField S t h) := by + apply inclusion_eq_of_tree_equiv K _ (treeRelabelEquiv σ K hK) + (finiteField S t h) _ e.1 (mapEdge σ e).1 + · intro T + apply weight_image + · intro p hp q hq hpq + exact relabelPair_injOn σ (tree_canonical hK T p hp) + (tree_canonical hK T q hq) hpq + · intro p hp + simpa only [← relabelPair_edge] using + finiteField_relabel_mapEdge σ S hS t h ⟨p, tree_canonical hK T p hp⟩ + · intro T + exact mem_relabelEdgeSet_iff σ T.1 (tree_canonical hK T) e + +theorem inclusion_congr_on_edges (K : FiniteSubgraphCode) (a b : Field) + (e : ℕ × ℕ) (h : ∀ p ∈ K.2, a p = b p) : + inclusion K e a = inclusion K e b := by + symm + apply inclusion_eq_of_tree_equiv K K (Equiv.refl _) a b e e + · intro T + unfold weight + congr 1 + exact Finset.sum_congr rfl (fun p hp => + (h p ((USTResponse.tree_property K T).1 hp)).symm) + · intro T + rfl + +theorem extendField_relabel_canonical (σ : Equiv ℕ ℕ) (y : EdgeCode → ℝ) + (p : ℕ × ℕ) (hp : p.1 < p.2) : + extendField (fun e => y (mapEdge σ.symm e)) p = + relabelField σ (extendField y) p := by + let e : EdgeCode := ⟨p, hp⟩ + change extendField (fun e => y (mapEdge σ.symm e)) e.1 = + extendField y (relabelPair σ.symm e.1) + rw [relabelPair_edge, extendField_apply, extendField_apply] + +theorem finiteTilt_edgeField_relabel (σ : Equiv ℕ ℕ) (K : FiniteSubgraphCode) + (hK : ∀ p ∈ K.2, p.1 < p.2) (S : Finset (ℕ × ℕ)) + (hS : ∀ p ∈ S, p.1 < p.2) (t : ℝ) (y : EdgeCode → ℝ) (e : EdgeCode) : + inclusion (relabelFiniteSubgraph σ K) (mapEdge σ e).1 + (finiteField (relabelEdgeSet σ S) t + (extendField (fun f => y (mapEdge σ.symm f)))) = + inclusion K e.1 (finiteField S t (extendField y)) := by + rw [← finiteTilt_relabel σ K hK S hS t (extendField y) e] + apply inclusion_congr_on_edges + intro p hp + have hp' : p.1 < p.2 := relabelEdgeSet_valid σ K.2 hK p hp + simp only [finiteField, extendField_relabel_canonical σ y p hp'] + +end Problem336.WeightedTree + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedTreeResponse.lean b/lean/OAI/Probability/SpanningForest/WeightedTreeResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..1375a38eb3461df137fd2681ae214990fa41eb87 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedTreeResponse.lean @@ -0,0 +1,77 @@ +import OAI.Probability.SpanningForest.WeightedTreeTransport + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.WeightedTree + +theorem ustResponse_weight_eq (K : FiniteSubgraphCode) (h : Field) + (T : USTResponse.TreeSample K) : + USTResponse.weight K (fun e => h e.1) T = weight h T.1 := by + classical + have hsub : T.1 ⊆ K.2 := (USTResponse.tree_property K T).1 + unfold USTResponse.weight USTResponse.indicator weight + congr 1 + rw [← Finset.sum_subtype K.2 (fun _ => Iff.rfl) + (fun e => h e * if e ∈ T.1 then (1 : ℝ) else 0)] + simp_rw [mul_ite, mul_one, mul_zero] + rw [← Finset.sum_filter, Finset.filter_mem_eq_inter, + Finset.inter_eq_right.mpr hsub] + +theorem ustResponse_partition_eq (K : FiniteSubgraphCode) (h : Field) : + USTResponse.partition K (fun e => h e.1) = partition K h := by + classical + unfold USTResponse.partition + simp_rw [ustResponse_weight_eq] + exact (Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) + (fun T => weight h T)).symm + +theorem ustResponse_inclusion_eq (K : FiniteSubgraphCode) (h : Field) + (e : USTResponse.FiniteEdge K) : + USTResponse.inclusion K (fun f => h f.1) e = inclusion K e.1 h := by + classical + rw [USTResponse.inclusion_eq_ratio, ustResponse_partition_eq] + unfold inclusion + congr 1 + simp_rw [ustResponse_weight_eq] + unfold USTResponse.indicator + rw [← Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) + (fun T => weight h T * if e.1 ∈ T then (1 : ℝ) else 0)] + simp_rw [mul_ite, mul_one, mul_zero] + rw [← Finset.sum_filter] + rfl + +theorem inclusion_response_of_coordinate_bound (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → USTResponse.edgeCovariance K h e f ≤ 0) + (a b : Field) (e : ℕ × ℕ) (D : ℝ) (hD : 0 ≤ D) + (hab : ∀ f, |b f - a f| ≤ D) : + |inclusion K e b - inclusion K e a| ≤ D / 2 := by + classical + by_cases he : e ∈ K.2 + · rw [← ustResponse_inclusion_eq K b ⟨e, he⟩, + ← ustResponse_inclusion_eq K a ⟨e, he⟩] + exact USTResponse.inclusion_response_of_coordinate_bound K hne hneg + (fun f => a f.1) (fun f => b f.1) ⟨e, he⟩ D hD (fun f => hab f.1) + · rw [inclusion_eq_zero_of_not_mem he, inclusion_eq_zero_of_not_mem he] + simpa using div_nonneg hD (by norm_num : (0 : ℝ) ≤ 2) + +theorem finiteTilt_response (K : FiniteSubgraphCode) + (hne : (spanningTrees K).Nonempty) + (hneg : ∀ h e f, e ≠ f → USTResponse.edgeCovariance K h e f ≤ 0) + (S : Finset (ℕ × ℕ)) (t : ℝ) (a b : Field) (e : ℕ × ℕ) + (D : ℝ) (hD : 0 ≤ D) (hab : ∀ f ∈ S, |b f - a f| ≤ D) : + |inclusion K e (finiteField S t b) - inclusion K e (finiteField S t a)| ≤ D / 2 := by + apply inclusion_response_of_coordinate_bound K hne hneg _ _ e D hD + intro f + by_cases hf : f ∈ S + · simpa only [finiteField, ite_eq_left hf, sub_sub_sub_cancel_right] using hab f hf + · simpa only [finiteField, ite_eq_right hf, sub_self, abs_zero] using hD + +end Problem336.WeightedTree + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WeightedTreeTransport.lean b/lean/OAI/Probability/SpanningForest/WeightedTreeTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..81b07b84aa86647a4717cd097ae2111ccb489e1b --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WeightedTreeTransport.lean @@ -0,0 +1,43 @@ +import OAI.Probability.SpanningForest.WeightedTreeBorel +import OAI.Probability.SpanningForest.USTResponse + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem336.WeightedTree + +theorem partition_eq_sum_trees (K : FiniteSubgraphCode) (h : Field) : + partition K h = ∑ T : USTResponse.TreeSample K, weight h T.1 := by + classical + exact Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) (fun T => weight h T) + +theorem numerator_eq_sum_trees (K : FiniteSubgraphCode) (e : ℕ × ℕ) (h : Field) : + numerator K e h = ∑ T : USTResponse.TreeSample K, + if e ∈ T.1 then weight h T.1 else 0 := by + classical + unfold numerator + rw [Finset.sum_filter] + exact Finset.sum_subtype (spanningTrees K) (fun _ => Iff.rfl) + (fun T => if e ∈ T then weight h T else 0) + +theorem inclusion_eq_of_tree_equiv (K K' : FiniteSubgraphCode) + (τ : USTResponse.TreeSample K ≃ USTResponse.TreeSample K') + (a b : Field) (e e' : ℕ × ℕ) + (hw : ∀ T, weight b (τ T).1 = weight a T.1) + (he : ∀ T, e' ∈ (τ T).1 ↔ e ∈ T.1) : + inclusion K' e' b = inclusion K e a := by + classical + unfold inclusion + rw [partition_eq_sum_trees, partition_eq_sum_trees, + numerator_eq_sum_trees, numerator_eq_sum_trees] + rw [← τ.sum_comp (fun T => weight b T.1)] + rw [← τ.sum_comp (fun T => if e' ∈ T.1 then weight b T.1 else 0)] + simp_rw [hw, he] + +end Problem336.WeightedTree + +end + +end OAI diff --git a/lean/OAI/Probability/SpanningForest/WienerSampler.lean b/lean/OAI/Probability/SpanningForest/WienerSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..f37d240db5d502c8f225f1ce0d0956b4394a8647 --- /dev/null +++ b/lean/OAI/Probability/SpanningForest/WienerSampler.lean @@ -0,0 +1,61 @@ +import OAI.Probability.SpanningForest.GlobalWiener +import OAI.Probability.SpanningForest.UniformSampler + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory +open scoped NNReal + +namespace Problem336.WienerSampler + +abbrev Path := GlobalWiener.Path +local instance : MeasurableSpace Path := borel _ +local instance : BorelSpace Path := ⟨rfl⟩ + +def sample : ℝ → Path := + Classical.choose (exists_uniform01_sampler GlobalWiener.wienerMeasure) + +theorem measurable_sample : Measurable sample := + (Classical.choose_spec (exists_uniform01_sampler GlobalWiener.wienerMeasure)).1 + +theorem map_sample : uniform01.map sample = GlobalWiener.wienerMeasure := + (Classical.choose_spec (exists_uniform01_sampler GlobalWiener.wienerMeasure)).2 + +theorem hasLaw_sample : HasLaw sample GlobalWiener.wienerMeasure uniform01 := + ⟨measurable_sample.aemeasurable, map_sample⟩ + +theorem isBrownian_sample : + IsBrownianReal (fun t u => sample u t) uniform01 := by + constructor + · constructor + intro S + exact (GlobalWiener.isBrownian_wienerMeasure.toIsPreBrownianReal.hasLaw S).comp + hasLaw_sample + · exact ae_of_all _ (fun u => (sample u).continuous) + +def eval (u : ℝ) (t : ℝ≥0) : ℝ := sample u t + +theorem measurable_eval : Measurable (fun p : ℝ × ℝ≥0 => eval p.1 p.2) := + continuous_eval.measurable.comp + ((measurable_sample.comp measurable_fst).prodMk measurable_snd) + +def evalReal (u t : ℝ) : ℝ := eval u (Real.toNNReal t) + +theorem measurable_evalReal : Measurable (fun p : ℝ × ℝ => evalReal p.1 p.2) := + measurable_eval.comp + (measurable_fst.prodMk (continuous_real_toNNReal.measurable.comp measurable_snd)) + +theorem continuous_eval (u : ℝ) : Continuous (eval u) := (sample u).continuous + +theorem continuous_evalReal (u : ℝ) : Continuous (evalReal u) := + (continuous_eval u).comp continuous_real_toNNReal + +@[simp] theorem evalReal_coe (u : ℝ) (t : ℝ≥0) : evalReal u t = eval u t := by + simp [evalReal] + +end Problem336.WienerSampler + +end + +end OAI diff --git a/lean/OAI/Probability/SphericalField/Main.lean b/lean/OAI/Probability/SphericalField/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..beed02957314a4da1371289bc2d88f856bae60b9 --- /dev/null +++ b/lean/OAI/Probability/SphericalField/Main.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.Probability.SphericalField.Positivity.JointLaw +import OAI.Probability.SphericalField.Entropy.Quantile +import OAI.Probability.SphericalField.Perceptron.Concentration +import OAI.Probability.SphericalField.Positivity.FiniteLaws +import OAI.Probability.SphericalField.Gaussian.Poincare +import OAI.Probability.SphericalField.Gibbs.MixedVariance +import OAI.Probability.SphericalField.Gibbs.Contact +import OAI.Probability.SphericalField.Gibbs.GaussianIdentities +import OAI.Probability.SphericalField.Sphere.Rotations +import OAI.Probability.SphericalField.Gibbs.LimitLaws +import OAI.Probability.SphericalField.Control.SmoothTerminals +import OAI.Probability.SphericalField.Heat.Continuity +import OAI.Probability.SphericalField.Fields.BoundedUniform +import OAI.Probability.SphericalField.Quantiles.AlmostEverywhere + +namespace OAI + +section +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped Topology NNReal ENNReal BigOperators + +namespace SphericalPerceptron + +theorem spherical_linear_field_formula : SphericalLinearFieldFormula := by + constructor + · intro k w hw hw1 + constructor + · intro h hh hh0 + obtain ⟨q,hq,hq1,hmin,-⟩ := finiteSphericalFieldValue_pointwise_dual w h hw hw1 hh hh0 + exact ⟨q,hq,hq1,hmin⟩ + · intro K hK hf + exact finiteSphericalFieldValue_compact_uniform w hw hw1 hK hf + · intro B hB0 hB1 ε hε + filter_upwards [boundedSphericalFieldValue_stationary_uniform B hB0 hB1 ε hε] with n hn q hq hb + refine ⟨entropy_quantileTrial_finite_of_ae_bounded q hq hB0 hB1 hb,?_,?_⟩ + · filter_upwards [stationaryQuantileField_ae_eq q hq hB0 hB1 hb] with u hu + rw [hu] + ring + · have h := hn (clippedQuantile q hq B hB0) + rw [quantileTrial_congr (clippedQuantile_ae_eq q hq hB0 hB1 hb), + stationaryQuantileField_cross q hq hB0 hB1 hb] at h + exact h + +end SphericalPerceptron +end +end + +end OAI