Buckets:
| import Mathlib | |
| import OAI.Probability.Perceptron.Brownian.CountableGaussianField | |
| namespace OAI | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal ENNReal BigOperators | |
| namespace SphericalPerceptronFreeEnergy | |
| variable {S : Type*} | |
| def gaussianTailCoefficient (w : ℕ → S → ℝ) (n : ℕ) (i : ℕ) (x : S) : ℝ := | |
| if n ≤ i then w i x else 0 | |
| lemma gaussianTailCoefficient_measurable [MeasurableSpace S] {w : ℕ → S → ℝ} | |
| (hw : ∀ i, Measurable (w i)) (n i : ℕ) : | |
| Measurable (gaussianTailCoefficient w n i) := by | |
| unfold gaussianTailCoefficient | |
| split_ifs <;> fun_prop | |
| lemma countableGaussianField_add (v w : ℕ → S → ℝ) (L : S → ℕ) (g : ℕ → ℝ) (x : S) : | |
| countableGaussianField (fun i x => v i x+w i x) L g x = | |
| countableGaussianField v L g x+countableGaussianField w L g x := by | |
| simp only [countableGaussianField,gaussianPrefixField,mul_add,Finset.sum_add_distrib] | |
| lemma countableGaussianField_smul (a : ℝ) (v : ℕ → S → ℝ) (L : S → ℕ) | |
| (g : ℕ → ℝ) (x : S) : | |
| countableGaussianField (fun i x => a*v i x) L g x = a*countableGaussianField v L g x := by | |
| simp only [countableGaussianField,gaussianPrefixField,Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| lemma countableGaussianField_tail (w : ℕ → S → ℝ) (L : S → ℕ) (n : ℕ) | |
| (g : ℕ → ℝ) (x : S) : | |
| countableGaussianField (gaussianTailCoefficient w n) L g x = | |
| countableGaussianField w L g x-truncatedCountableGaussianField w L n g x := by | |
| rw [truncatedCountableGaussianField_eq] | |
| unfold countableGaussianField gaussianPrefixField | |
| rw [Fin.sum_univ_eq_sum_range (fun i => g i*gaussianTailCoefficient w n i x) (L x), | |
| Fin.sum_univ_eq_sum_range (fun i => g i*w i x) (L x), | |
| Fin.sum_univ_eq_sum_range (fun i => g i*w i x) (min n (L x))] | |
| have he (i : ℕ) : g i*gaussianTailCoefficient w n i x = | |
| g i*w i x-(if i<n then g i*w i x else 0) := by | |
| unfold gaussianTailCoefficient | |
| by_cases h : i<n | |
| · rw [ite_eq_right (by omega),ite_eq_left h] | |
| ring | |
| · rw [ite_eq_left (by omega),ite_eq_right h] | |
| ring | |
| simp_rw [he] | |
| rw [Finset.sum_sub_distrib,sum_range_cutoff,min_comm] | |
| lemma gaussianTailCoefficient_sq_le (w : ℕ → S → ℝ) (n i : ℕ) (x : S) : | |
| gaussianTailCoefficient w n i x^2 ≤ w i x^2 := by | |
| unfold gaussianTailCoefficient | |
| split_ifs <;> simp [sq_nonneg] | |
| lemma gaussianCombinedCoefficient_sq_bound (v w : ℕ → S → ℝ) (L : S → ℕ) | |
| {D E : ℝ} (hD : ∀ x, (∑ i : Fin (L x), v i.val x^2) ≤ D) | |
| (hE : ∀ x, (∑ i : Fin (L x), w i.val x^2) ≤ E) | |
| (a b : ℝ) (n : ℕ) (x : S) : | |
| (∑ i : Fin (L x), (a*v i.val x+b*gaussianTailCoefficient w n i.val x)^2) ≤ | |
| 2*a^2*D+2*b^2*E := by | |
| calc | |
| _ ≤ ∑ i : Fin (L x), (2*a^2*v i.val x^2+2*b^2*w i.val x^2) := by | |
| apply Finset.sum_le_sum | |
| intro i _ | |
| have h := gaussianTailCoefficient_sq_le w n i.val x | |
| have hm := mul_le_mul_of_nonneg_left h (by positivity : 0 ≤ 2*b^2) | |
| nlinarith [sq_nonneg (a*v i.val x-b*gaussianTailCoefficient w n i.val x)] | |
| _ = 2*a^2*(∑ i : Fin (L x), v i.val x^2)+ | |
| 2*b^2*(∑ i : Fin (L x), w i.val x^2) := by | |
| rw [Finset.sum_add_distrib,Finset.mul_sum,Finset.mul_sum] | |
| _ ≤ _ := add_le_add (mul_le_mul_of_nonneg_left (hD x) (by positivity)) | |
| (mul_le_mul_of_nonneg_left (hE x) (by positivity)) | |
| end SphericalPerceptronFreeEnergy | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 3.49 kB
- Xet hash:
- a606a647a6a7f438f07978d3cdcd0a1f50632c1e891f4daaf8ea5f097378fa5e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.