roseking's picture
Add lean source and binary files (part 16)
159357f verified
Raw History Blame Contribute Delete
6.75 kB
18
def formRawDensity {N : ℕ} (ψ : FormVector N) (x : Configuration N) : ℝ :=
body · 1 line
  ∑ s : Spins N, ‖ψ.value s x‖^2
21
lemma formRawDensity_nonneg {N : ℕ} (ψ : FormVector N) (x : Configuration N) :
    0 ≤ formRawDensity ψ x := Finset.sum_nonneg (fun _ _ => sq_nonneg _)
24
lemma formRawDensity_integrable {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ) :
    Integrable (formRawDensity ψ) :=
proof · 1 line
  integrable_finsetSum _ (fun s _ => (hψ.1 s).norm.integrable_sq)
28
lemma formRawDensity_integral {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ) :
    ∫ x, formRawDensity ψ x = formMass ψ :=
proof · 1 line
  integral_finsetSum _ (fun s _ => (hψ.1 s).norm.integrable_sq)
32
def formRawLaw {N : ℕ} (ψ : FormVector N) : Measure (Configuration N) :=
body · 1 line
  volume.withDensity (fun x => ENNReal.ofReal (formRawDensity ψ x))
35
lemma formRawLaw_univ {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ) :
    formRawLaw ψ univ = ENNReal.ofReal (formMass ψ) := by
proof · 4 lines
  rw [formRawLaw,withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ]
  exact (ofReal_integral_eq_lintegral_ofReal (formRawDensity_integrable hψ)
    (ae_of_all _ (formRawDensity_nonneg ψ))).symm.trans
      (congrArg ENNReal.ofReal (formRawDensity_integral hψ))
42
lemma formRawLaw_finite {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ) :
    IsFiniteMeasure (formRawLaw ψ) := by
proof · 3 lines
  constructor
  rw [formRawLaw_univ hψ]
  exact ENNReal.ofReal_lt_top
48
lemma formRawLaw_probability {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ)
    (hm : formMass ψ = 1) : IsProbabilityMeasure (formRawLaw ψ) := by
proof · 2 lines
  constructor
  rw [formRawLaw_univ hψ,hm,ENNReal.ofReal_one]
53
lemma formRawLaw_integral {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ)
    (g : Configuration N → ℝ) :
    (∫ x, g x ∂formRawLaw ψ) = ∫ x, formRawDensity ψ x*g x := by
proof · 4 lines
  rw [formRawLaw,integral_withDensity_eq_integral_toReal_smul₀
    (formRawDensity_integrable hψ).aemeasurable.ennreal_ofReal
    (ae_of_all _ (fun _ => ENNReal.ofReal_lt_top))]
  simp only [ENNReal.toReal_ofReal (formRawDensity_nonneg ψ _),smul_eq_mul]
61
lemma formRawLaw_integral_eq_spin_sum {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ)
    {g : Configuration N → ℝ} (hg : Measurable g) {B : ℝ} (hB : ∀ x, ‖g x‖ ≤ B) :
    (∫ x, g x ∂formRawLaw ψ) = ∑ s : Spins N, ∫ x, g x*‖ψ.value s x‖^2 := by
proof · 6 lines
  rw [formRawLaw_integral hψ]
  have hi (s : Spins N) : Integrable (fun x => g x*‖ψ.value s x‖^2) :=
    ((hψ.1 s).norm.integrable_sq).bdd_mul hg.aestronglyMeasurable (ae_of_all _ hB)
  simp only [formRawDensity,Finset.sum_mul]
  simp_rw [mul_comm (‖ψ.value _ _‖^2)]
  exact integral_finsetSum _ (fun s _ => hi s)
71
def rawBallCount {N : ℕ} (y : Space) (R : ℝ) (x : Configuration N) : ℝ :=
body · 1 line
  ∑ i, if ‖x i-y‖ < R then 1 else 0
74
def rawStripCount {N : ℕ} (y : Space) (t b : ℝ) (x : Configuration N) : ℝ :=
body · 1 line
  slidingCount (fun i => ‖x i-y‖) (7*b) b t
77
lemma rawBallCount_nonneg {N : ℕ} (y : Space) (R : ℝ) (x : Configuration N) :
    0 ≤ rawBallCount y R x := by
proof · 1 line
  apply Finset.sum_nonneg; intro i _; split_ifs <;> norm_num
81
lemma rawBallCount_le {N : ℕ} (y : Space) (R : ℝ) (x : Configuration N) :
    rawBallCount y R x ≤ N := by
proof · 3 lines
  calc
    _ ≤ ∑ _ : Fin N, (1:ℝ) := Finset.sum_le_sum (fun _ _ => by split_ifs <;> norm_num)
    _ = N := by simp
87
lemma configuration_distance_measurable {N : ℕ} (y : Space) (i : Fin N) :
    Measurable (fun x : Configuration N => ‖x i-y‖) := by
proof · 2 lines
  exact (((continuous_apply i).sub continuous_const).norm :
    Continuous (fun x : Configuration N => ‖x i-y‖)).measurable
92
lemma rawBallCount_measurable {N : ℕ} (y : Space) (R : ℝ) :
    Measurable (rawBallCount (N := N) y R) := by
proof · 3 lines
  apply Finset.measurable_sum; intro i _
  exact Measurable.ite (measurableSet_lt (configuration_distance_measurable y i)
    measurable_const) measurable_const measurable_const
98
lemma rawBallCount_sq_integrable {N : ℕ} (y : Space) (R : ℝ)
    (μ : Measure (Configuration N)) [IsFiniteMeasure μ] :
    Integrable (fun x => rawBallCount y R x^2) μ := by
proof · 5 lines
  apply Integrable.of_bound ((rawBallCount_measurable y R).pow_const 2).aestronglyMeasurable
    ((N:ℝ)^2)
  exact ae_of_all _ (fun x => by
    rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)]
    exact pow_le_pow_left₀ (rawBallCount_nonneg _ _ _) (rawBallCount_le _ _ _) 2)
107
lemma rawStripCount_eq_card {N : ℕ} (y : Space) (t b : ℝ) (x : Configuration N) :
    rawStripCount y t b x =
      ((Finset.univ.filter (fun i => t-7*b ≤ ‖x i-y‖ ∧ ‖x i-y‖ ≤ t+b)).card:ℝ) := by
proof · 10 lines
  classical
  unfold rawStripCount slidingCount
  have he (i : Fin N) : slidingBit (7*b) b ‖x i-y‖ t =
      if t-7*b ≤ ‖x i-y‖ ∧ ‖x i-y‖ ≤ t+b then (1:ℝ) else 0 := by
    unfold slidingBit
    congr 1
    apply propext
    constructor <;> rintro ⟨h₁,h₂⟩ <;> constructor <;> linarith
  simp_rw [he]
  simp only [Finset.sum_boole]
121
lemma upperCount_le_rawBallCount {N : ℕ} (y : Space) {R S : ℝ} (hRS : R < S)
    (x : Configuration N) : upperCount (fun i => ‖x i-y‖) R ≤ rawBallCount y S x := by
proof · 4 lines
  apply Finset.sum_le_sum
  intro i _
  split_ifs with h₁ h₂ <;> try norm_num
  exact False.elim (h₂ (lt_of_le_of_lt h₁ hRS))
128
theorem radial_raw_radius_selection {N : ℕ} {ψ : FormVector N} (hψ : SobolevVector ψ)
    (y : Space) {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b) (hba : b < a) :
    ∃ t ∈ Icc (5*a) (6*a),
      (∫ x, rawStripCount y t b x^2 ∂formRawLaw ψ) ≤
        (8*b/a)*(∫ x, rawBallCount y (7*a) x^2 ∂formRawLaw ψ) := by
proof · 14 lines
  let : IsFiniteMeasure (formRawLaw ψ) := formRawLaw_finite hψ
  have hd (i : Fin N) : Measurable (fun x : Configuration N => ‖x i-y‖) :=
    configuration_distance_measurable y i
  obtain ⟨t,ht,hh⟩ := exists_radius_expected_square hd (formRawLaw ψ)
    (lo := 5*a) (hi := 6*a) (l := 7*b) (r := b) (by linarith) (by linarith)
  refine ⟨t,ht,?_⟩
  have he : (7*b+b)/(6*a-5*a) = 8*b/a := by congr 1 <;> ring
  rw [he] at hh
  apply hh.trans
  apply mul_le_mul_of_nonneg_left _ (div_nonneg (by positivity) ha.le)
  apply integral_mono (upperCount_sq_integrable hd (6*a+b)) (rawBallCount_sq_integrable y (7*a) _)
  intro x
  exact pow_le_pow_left₀ (upperCount_nonneg _ _)
    (upperCount_le_rawBallCount y (by linarith) x) 2