Download data/lean/OAI/Probability/SKFluctuations/Diagonal.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 34.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKFluctuations/Diagonal.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SKFluctuations/Diagonal.lean
-
curl -L -o Diagonal.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SKFluctuations/Diagonal.lean
34.2 kB
| import Mathlib | |
| import OAI.Probability.SKFluctuations.MarkedAttachPreserves | |
| import OAI.Probability.SKFluctuations.ScalarWeightedJet | |
| namespace OAI | |
| /-! Diagonal. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Filter | |
| open scoped BigOperators Topology | |
| open MeasureTheory Filter Set | |
| open scoped Topology | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| namespace SKFluctuations.GaussianCalculus | |
| open MeasureTheory ProbabilityTheory Filter Set Hierarchy | |
| open scoped Topology NNReal BigOperators | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] | |
| theorem ExpNormBounded.diagonal {f : (ΞΉ β β) β β} (hf : ExpNormBounded f) | |
| (x a : ΞΉ β β) : ExpNormBounded (fun z => f (x+a*z)) := by | |
| obtain β¨C,c,hC,hc,hbβ© := hf.2 | |
| refine β¨hf.1.comp (continuous_const.add (continuous_const.mul continuous_id)), | |
| C*Real.exp (c*βxβ), c*βaβ, by positivity, by positivity, fun z => ?_β© | |
| calc | |
| _ β€ C*Real.exp (c*βx+a*zβ) := hb _ | |
| _ β€ C*Real.exp (c*(βxβ+βaβ*βzβ)) := by | |
| gcongr | |
| exact (norm_add_le _ _).trans (add_le_add le_rfl (norm_mul_le a z)) | |
| _ = _ := by rw [mul_add,Real.exp_add]; ring_nf | |
| theorem ExpNormBounded.diagonal_integrable {f : (ΞΉ β β) β β} (hf : ExpNormBounded f) | |
| {Ξ½ : Measure (ΞΉ β β)} (hΞ½ : ExponentialIncrement Ξ½) (x a : ΞΉ β β) : | |
| Integrable (fun z => f (x+a*z)) Ξ½ := by | |
| simpa only [one_smul,zero_add] using (hf.diagonal x a).affine_integrable hΞ½ 0 1 | |
| theorem ExpNormBounded.diagonal_coord_integrable {f : (ΞΉ β β) β β} (hf : ExpNormBounded f) | |
| (q : ΞΉ β ββ₯0) (x a : ΞΉ β β) (i : ΞΉ) : | |
| Integrable (fun z => z i*f (x+a*z)) (Measure.pi fun i => gaussianReal 0 (q i)) := by | |
| simpa only [one_smul,zero_add] using (hf.diagonal x a).affine_coord_integrable q 0 1 i | |
| theorem standardGaussianVector_diagonal_stein {n : β} (i : Fin (n+1)) | |
| {f fβ : (Fin (n+1) β β) β β} (hf : ExpNormBounded f) (hfβ : ExpNormBounded fβ) | |
| (hd : β x t, HasDerivAt (fun s : β => f (x+s β’ Pi.single i 1)) | |
| (fβ (x+t β’ Pi.single i 1)) t) (x a : Fin (n+1) β β) : | |
| (β« z, z i*f (x+a*z) βMeasure.pi (fun _ : Fin (n+1) => gaussianReal 0 1)) = | |
| a i * β« z, fβ (x+a*z) βMeasure.pi (fun _ : Fin (n+1) => gaussianReal 0 1) := by | |
| have h := standardGaussianVector_stein i | |
| (f := fun z => f (x+a*z)) (fβ := fun z => a i*fβ (x+a*z)) | |
| ?_ (hf.diagonal_integrable (exponentialIncrement_gaussian (fun _ => 1)) x a) | |
| ((hfβ.diagonal_integrable (exponentialIncrement_gaussian (fun _ => 1)) x a).const_mul (a i)) | |
| (hf.diagonal_coord_integrable (fun _ => 1) x a i) | |
| Β· simpa only [integral_const_mul] using h | |
| Β· intro y t | |
| have he (s : β) : x+a*i.insertNth s y = | |
| (x+a*i.insertNth 0 y)+(a i*s) β’ Pi.single i 1 := by | |
| ext j | |
| by_cases hj : j = i | |
| Β· subst j | |
| simp | |
| Β· obtain β¨k,rflβ© := (Fin.eq_self_or_eq_succAbove i j).resolve_left hj | |
| simp | |
| have hd' := (hd (x+a*i.insertNth 0 y) (a i*t)).comp t | |
| ((hasDerivAt_id t).const_mul (a i)) | |
| simpa only [Function.comp_def, β he,mul_one] using hd'.congr_deriv (mul_comm _ _) | |
| end SKFluctuations.GaussianCalculus | |
| namespace SKFluctuations.GaussianCalculus | |
| open MeasureTheory ProbabilityTheory Filter Set Hierarchy | |
| open scoped Topology NNReal BigOperators | |
| theorem hasDerivAt_diagonal_heat_continuation {n : β} | |
| {F : (Fin (n+1) β β) β β} {G H : Fin (n+1) β (Fin (n+1) β β) β β} {C : ββ₯0} | |
| (hF : LipschitzWith C F) (hG : β i, BddSmooth 0 (G i)) (hH : β i, BddSmooth 0 (H i)) | |
| (hd : β x v t, HasDerivAt (fun s : β => F (x+s β’ v)) | |
| (β i, v i*G i (x+t β’ v)) t) | |
| (hdβ : β i x t, HasDerivAt (fun s : β => G i (x+s β’ Pi.single i 1)) | |
| (H i (x+t β’ Pi.single i 1)) t) | |
| {a a' : β β (Fin (n+1) β β)} {l r A B t m : β} (ht : t β Ioo l r) | |
| (ha : β s β Ioo l r, HasDerivAt a (a' s) s) | |
| (hA : β s β Ioo l r, βa sβ β€ A) (hB : β s β Ioo l r, βa' sβ β€ B) | |
| (hm : m β 0) (x : Fin (n+1) β β) : | |
| HasDerivAt (fun s => Real.log (β« z, Real.exp (m*F (x+a s*z)) | |
| βMeasure.pi (fun _ : Fin (n+1) => gaussianReal 0 1))/m) | |
| (β i, a t i*a' t i * | |
| (tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+a t*z)) (fun z => H i (x+a t*z)) + m * | |
| tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+a t*z)) (fun z => (G i (x+a t*z))^2))) t := by | |
| let P := fun y => Real.exp (m*F y) | |
| let Pβ := fun i y => m*G i y*P y | |
| let Pβ := fun i y => (m*H i y + m^2*(G i y)^2)*P y | |
| let Ξ½ := Measure.pi (fun _ : Fin (n+1) => gaussianReal 0 1) | |
| have hΞ½ : ExponentialIncrement Ξ½ := exponentialIncrement_gaussian (fun _ => 1) | |
| have hP : ExpNormBounded P := ExpNormBounded.exp_lipschitz hF m | |
| have hBβ (i) : BddSmooth 0 (fun y => m*G i y) := (hG i).const_mul m | |
| have hBβ (i) : BddSmooth 0 (fun y => m*H i y + m^2*(G i y)^2) := by | |
| simpa only [pow_two] using ((hH i).const_mul m).add (((hG i).mul (hG i)).const_mul (m*m)) | |
| have hdP (y v : Fin (n+1) β β) (s : β) : | |
| HasDerivAt (fun r : β => P (y+r β’ v)) (β i, v i*Pβ i (y+s β’ v)) s := by | |
| apply (((hd y v s).const_mul m).exp).congr_deriv | |
| dsimp [Pβ,P] | |
| rw [Finset.mul_sum, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| have hdPβ (i) (y : Fin (n+1) β β) (s : β) : | |
| HasDerivAt (fun r : β => Pβ i (y+r β’ Pi.single i 1)) | |
| (Pβ i (y+s β’ Pi.single i 1)) s := by | |
| have hp := hdP y (Pi.single i 1) s | |
| simp only [Pi.single_apply, ite_mul, one_mul, zero_mul, Finset.sum_ite_eq', Finset.mem_univ, ite_true] at hp | |
| apply (((hdβ i y s).const_mul m).mul hp).congr_deriv | |
| dsimp [Pβ,Pβ] | |
| ring | |
| have hs (i) : (β« z, z i*Pβ i (x+a t*z) βΞ½) = | |
| a t i*β« z, Pβ i (x+a t*z) βΞ½ := | |
| standardGaussianVector_diagonal_stein i (hP.bdd_mul (hBβ i)) | |
| (hP.bdd_mul (hBβ i)) (hdPβ i) x (a t) | |
| have h := hasDerivAt_integral_exp_scaledSource hΞ½ hF (fun i => (hG i).continuous) | |
| hd ht ha hA hB m x | |
| have hp : 0 < β« z, P (x+a t*z) βΞ½ := partition_pos m (hP.diagonal_integrable hΞ½ x _) | |
| have hGs (i) : BddSmooth 0 (fun y => (G i y)^2) := by | |
| simpa only [pow_two] using (hG i).mul (hG i) | |
| have hiH (i) : Integrable (fun z => H i (x+a t*z)*P (x+a t*z)) Ξ½ := | |
| (hP.bdd_mul (hH i)).diagonal_integrable hΞ½ x _ | |
| have hiGs (i) : Integrable (fun z => (G i (x+a t*z))^2*P (x+a t*z)) Ξ½ := | |
| (hP.bdd_mul (hGs i)).diagonal_integrable hΞ½ x _ | |
| have he (i) : (β« z, Pβ i (x+a t*z) βΞ½) = | |
| m*(β« z, H i (x+a t*z)*P (x+a t*z) βΞ½) + | |
| m^2*(β« z, (G i (x+a t*z))^2*P (x+a t*z) βΞ½) := by | |
| rw [β integral_const_mul, β integral_const_mul, | |
| β integral_add ((hiH i).const_mul m) ((hiGs i).const_mul (m^2))] | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun z => by dsimp [Pβ]; ring | |
| have he' : (β« z, m*(β i, (a' t*z) i*G i (x+a t*z))*P (x+a t*z) βΞ½) = | |
| β i, a' t i*(β« z, z i*Pβ i (x+a t*z) βΞ½) := by | |
| simp_rw [β integral_const_mul] | |
| rw [β integral_finsetSum _ (fun i _ => | |
| ((hP.bdd_mul (hBβ i)).diagonal_coord_integrable (fun _ => 1) x (a t) i).const_mul (a' t i))] | |
| apply integral_congr_ae | |
| exact Eventually.of_forall fun z => by | |
| dsimp only | |
| rw [Finset.mul_sum,Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| dsimp [Pβ] | |
| ring | |
| apply ((h.log hp.ne').div_const m).congr_deriv | |
| change ((β« z, m*(β i, (a' t*z) i*G i (x+a t*z))*P (x+a t*z) βΞ½)/ | |
| (β« z, P (x+a t*z) βΞ½))/m = _ | |
| rw [he',Finset.sum_div,Finset.sum_div] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [hs,he] | |
| simp only [tiltedMean] | |
| dsimp [P,Ξ½] at * | |
| field_simp | |
| end SKFluctuations.GaussianCalculus | |
| namespace SKFluctuations.GaussianCalculus | |
| open MeasureTheory ProbabilityTheory Filter Set Hierarchy | |
| open scoped Topology NNReal BigOperators | |
| theorem hasDerivAt_signed_variance_continuation {n : β} | |
| {F : (Fin (n+1) β β) β β} {G H : Fin (n+1) β (Fin (n+1) β β) β β} {C : ββ₯0} | |
| (hF : LipschitzWith C F) (hG : β i, BddSmooth 0 (G i)) (hH : β i, BddSmooth 0 (H i)) | |
| (hd : β x v t, HasDerivAt (fun s : β => F (x+s β’ v)) | |
| (β i, v i*G i (x+t β’ v)) t) | |
| (hdβ : β i x t, HasDerivAt (fun s : β => G i (x+s β’ Pi.single i 1)) | |
| (H i (x+t β’ Pi.single i 1)) t) | |
| (q d : Fin (n+1) β β) {t m : β} (ht : β i, 0 < q i+t*d i) (hm : m β 0) | |
| (x : Fin (n+1) β β) : | |
| HasDerivAt (fun s => Real.log (β« z, Real.exp (m*F (x+(fun i => Real.sqrt (q i+s*d i))*z)) | |
| βMeasure.pi (fun _ : Fin (n+1) => gaussianReal 0 1))/m) | |
| (β i, (d i/2) * | |
| (tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+(fun i => Real.sqrt (q i+t*d i))*z)) | |
| (fun z => H i (x+(fun i => Real.sqrt (q i+t*d i))*z)) + m * | |
| tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+(fun i => Real.sqrt (q i+t*d i))*z)) | |
| (fun z => (G i (x+(fun i => Real.sqrt (q i+t*d i))*z))^2))) t := by | |
| let a := fun s i => Real.sqrt (q i+s*d i) | |
| let a' := fun s i => d i/(2*Real.sqrt (q i+s*d i)) | |
| have ha : Continuous a := continuous_pi fun i => (continuous_const.add (continuous_id.mul continuous_const)).sqrt | |
| have ha' : ContinuousAt a' t := continuousAt_pi.mpr fun i => | |
| continuousAt_const.div (continuousAt_const.mul | |
| (continuousAt_const.add (continuousAt_id.mul continuousAt_const)).sqrt) | |
| (mul_ne_zero (by norm_num) (Real.sqrt_ne_zero'.mpr (ht i))) | |
| have hp : βαΆ s in π t, β i, 0 < q i+s*d i := by | |
| rw [eventually_all] | |
| intro i | |
| exact (continuousAt_const.add (continuousAt_id.mul continuousAt_const)).eventually | |
| (eventually_gt_nhds (ht i)) | |
| have hA : βαΆ s in π t, βa sβ β€ βa tβ+1 := | |
| (ha.continuousAt.norm.eventually (eventually_lt_nhds (lt_add_one _))).mono fun _ h => h.le | |
| have hB : βαΆ s in π t, βa' sβ β€ βa' tβ+1 := | |
| (ha'.norm.eventually (eventually_lt_nhds (lt_add_one _))).mono fun _ h => h.le | |
| obtain β¨l,r,htr,hlrβ© := (hp.and (hA.and hB)).exists_Ioo_subset | |
| have haD (s) (hs : s β Ioo l r) : HasDerivAt a (a' s) s := by | |
| apply hasDerivAt_pi.mpr | |
| intro i | |
| simpa only [a, a', id_eq, one_mul] using | |
| (((hasDerivAt_id s).mul_const (d i)).const_add (q i)).sqrt ((hlr hs).1 i).ne' | |
| have hh := hasDerivAt_diagonal_heat_continuation hF hG hH hd hdβ htr haD | |
| (fun s hs => (hlr hs).2.1) (fun s hs => (hlr hs).2.2) hm x | |
| apply hh.congr_deriv | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| dsimp [a,a'] | |
| rw [show Real.sqrt (q i+t*d i)*(d i/(2*Real.sqrt (q i+t*d i))) = d i/2 by | |
| field_simp [Real.sqrt_ne_zero'.mpr (ht i)]] | |
| end SKFluctuations.GaussianCalculus | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal BigOperators | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] | |
| theorem integral_diagonalGaussian (q : ΞΉ β ββ₯0) {f : (ΞΉ β β) β β} (hf : Continuous f) : | |
| (β« z, f (fun i => Real.sqrt (q i)*z i) βMeasure.pi fun _ : ΞΉ => gaussianReal 0 1) = | |
| β« z, f z βMeasure.pi fun i => gaussianReal 0 (q i) := by | |
| have hh := integral_map_of_stronglyMeasurable (ΞΌ := Measure.pi fun _ : ΞΉ => gaussianReal 0 1) | |
| (diagonalDriver q).measurable hf.stronglyMeasurable | |
| change (β« z, f z βlinearGaussian (diagonalDriver q) 1) = _ at hh | |
| rw [linearGaussian_diagonal] at hh | |
| exact hh.symm | |
| noncomputable def varianceContinuation (m : β) (F : (ΞΉ β β) β β) (q : ΞΉ β β) : (ΞΉ β β) β β := | |
| shiftedContinuation (Measure.pi fun i => gaussianReal 0 (Real.toNNReal (q i))) m F | |
| noncomputable def varianceTest (m : β) (F A : (ΞΉ β β) β β) (q : ΞΉ β β) : (ΞΉ β β) β β := | |
| shiftedMean (Measure.pi fun i => gaussianReal 0 (Real.toNNReal (q i))) m F A | |
| theorem varianceContinuation_eq {F : (ΞΉ β β) β β} (hF : Continuous F) | |
| (m : β) {q : ΞΉ β β} (hq : β i, 0 β€ q i) (x : ΞΉ β β) : | |
| varianceContinuation m F q x = Real.log (β« z, Real.exp (m*F (x+(fun i => Real.sqrt (q i))*z)) | |
| βMeasure.pi fun _ : ΞΉ => gaussianReal 0 1)/m := by | |
| have hi := integral_diagonalGaussian (fun i => Real.toNNReal (q i)) | |
| (f := fun z => Real.exp (m*F (x+z))) (by fun_prop) | |
| simp only [Real.coe_toNNReal _ (hq _)] at hi | |
| exact congrArg (fun z => Real.log z/m) hi.symm | |
| theorem varianceTest_eq {F A : (ΞΉ β β) β β} (hF : Continuous F) (hA : Continuous A) | |
| (m : β) {q : ΞΉ β β} (hq : β i, 0 β€ q i) (x : ΞΉ β β) : | |
| varianceTest m F A q x = tiltedMean (Measure.pi fun _ : ΞΉ => gaussianReal 0 1) m | |
| (fun z => F (x+(fun i => Real.sqrt (q i))*z)) (fun z => A (x+(fun i => Real.sqrt (q i))*z)) := by | |
| have hn := integral_diagonalGaussian (fun i => Real.toNNReal (q i)) | |
| (f := fun z => A (x+z)*Real.exp (m*F (x+z))) (by fun_prop) | |
| have hd := integral_diagonalGaussian (fun i => Real.toNNReal (q i)) | |
| (f := fun z => Real.exp (m*F (x+z))) (by fun_prop) | |
| simp only [Real.coe_toNNReal _ (hq _)] at hn hd | |
| exact congrArgβ (Β· / Β·) hn.symm hd.symm | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal BigOperators | |
| variable {ΞΉ : Type*} [Fintype ΞΉ] | |
| noncomputable def signedVarianceDerivative (m : β) (F : (ΞΉ β β) β β) | |
| (G H : ΞΉ β (ΞΉ β β) β β) (d q : ΞΉ β β) (x : ΞΉ β β) : β := | |
| β i, (d i/2)*(varianceTest m F (H i) q x + m*varianceTest m F (fun y => (G i y)^2) q x) | |
| theorem parametric_signed_variance {n : β} | |
| {F : (Fin (n+1) β β) β β} {G H : Fin (n+1) β (Fin (n+1) β β) β β} {C : ββ₯0} | |
| (hF : LipschitzWith C F) (hG : β i, BddSmooth 0 (G i)) (hH : β i, BddSmooth 0 (H i)) | |
| (hd : β x v t, HasDerivAt (fun s : β => F (x+s β’ v)) | |
| (β i, v i*G i (x+t β’ v)) t) | |
| (hdβ : β i x t, HasDerivAt (fun s : β => G i (x+s β’ Pi.single i 1)) | |
| (H i (x+t β’ Pi.single i 1)) t) | |
| (q d : Fin (n+1) β β) {m : β} (hm : 0 < m) : | |
| β K, β l r, (β t β Ioo l r, β i, 0 < q i+t*d i) β | |
| ParametricRegular l r K | |
| (fun t => varianceContinuation m F (fun i => q i+t*d i)) | |
| (fun t => signedVarianceDerivative m F G H d (fun i => q i+t*d i)) := by | |
| have hGs (i) : BddSmooth 0 (fun y => (G i y)^2) := by | |
| simpa only [pow_two] using (hG i).mul (hG i) | |
| choose BH hBH bH using fun i => (hH i).bound | |
| choose BG hBG bG using fun i => (hGs i).bound | |
| let K : β := β i, (|d i|/2)*(BH i+m*BG i) | |
| have hK : 0 β€ K := Finset.sum_nonneg fun i _ => | |
| mul_nonneg (div_nonneg (abs_nonneg _) (by norm_num)) | |
| (add_nonneg (hBH i) (mul_nonneg hm.le (hBG i))) | |
| have hi (t : β) (x : Fin (n+1) β β) : | |
| Integrable (fun z => Real.exp (m*F (x+z))) | |
| (Measure.pi fun i => gaussianReal 0 (Real.toNNReal (q i+t*d i))) := | |
| (exponentialIncrement_gaussian _).integrable_shift hF m x | |
| refine β¨K, fun l r hq => β¨hK, ?_, ?_, ?_, ?_β©β© | |
| Β· intro t _ | |
| exact β¨C,lipschitzWith_shiftedContinuation hF hm (hi t)β© | |
| Β· intro t _ | |
| exact continuous_finsetSum _ fun i _ => | |
| ((continuous_shiftedMean hF (hH i).continuous (hBH i) (bH i) (hi t)).add | |
| ((continuous_shiftedMean hF (hGs i).continuous (hBG i) (bG i) (hi t)).const_mul m)).const_mul (d i/2) | |
| Β· intro t _ x | |
| have hBH' (i) : |varianceTest m F (H i) (fun i => q i+t*d i) x| β€ BH i := | |
| abs_tiltedMean_le ((hH i).continuous.comp (continuous_const.add continuous_id)).measurable | |
| (hi t x) (fun z => bH i (x+z)) | |
| have hBG' (i) : |varianceTest m F (fun y => (G i y)^2) (fun i => q i+t*d i) x| β€ BG i := | |
| abs_tiltedMean_le ((hGs i).continuous.comp (continuous_const.add continuous_id)).measurable | |
| (hi t x) (fun z => bG i (x+z)) | |
| apply (Finset.abs_sum_le_sum_abs _ _).trans | |
| apply Finset.sum_le_sum | |
| intro i _ | |
| rw [abs_mul,abs_div,abs_of_pos (by norm_num : (0:β) < 2)] | |
| apply mul_le_mul_of_nonneg_left _ (by positivity) | |
| apply (abs_add_le _ _).trans | |
| rw [abs_mul,abs_of_pos hm] | |
| exact add_le_add (hBH' i) (mul_le_mul_of_nonneg_left (hBG' i) hm.le) | |
| Β· intro t ht x | |
| have hh := GaussianCalculus.hasDerivAt_signed_variance_continuation hF hG hH hd hdβ q d | |
| (hq t ht) hm.ne' x | |
| have he : (fun s => varianceContinuation m F (fun i => q i+s*d i) x) =αΆ [π t] | |
| (fun s => Real.log (β« z, Real.exp (m*F (x+(fun i => Real.sqrt (q i+s*d i))*z)) | |
| βMeasure.pi fun _ : Fin (n+1) => gaussianReal 0 1)/m) := by | |
| filter_upwards [Ioo_mem_nhds ht.1 ht.2] with s hs | |
| exact varianceContinuation_eq hF.continuous m (fun i => (hq s hs i).le) x | |
| have hde : signedVarianceDerivative m F G H d (fun i => q i+t*d i) x = | |
| (β i, (d i/2)*(tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+(fun i => Real.sqrt (q i+t*d i))*z)) | |
| (fun z => H i (x+(fun i => Real.sqrt (q i+t*d i))*z)) + m* | |
| tiltedMean (Measure.pi fun _ : Fin (n+1) => gaussianReal 0 1) m | |
| (fun z => F (x+(fun i => Real.sqrt (q i+t*d i))*z)) | |
| (fun z => (G i (x+(fun i => Real.sqrt (q i+t*d i))*z))^2))) := by | |
| simp only [signedVarianceDerivative,varianceTest_eq hF.continuous (hH _).continuous m | |
| (fun i => (hq t ht i).le),varianceTest_eq hF.continuous (hGs _).continuous m | |
| (fun i => (hq t ht i).le)] | |
| rw [hde] | |
| exact hh.congr_of_eventuallyEq he | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal BigOperators | |
| variable {ΞΉ S : Type*} [Fintype ΞΉ] [Fintype S] [Nonempty S] | |
| noncomputable def hierarchyAtom (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| (steps : List (GaussianStep ΞΉ)) (Ο : S) (x : ΞΉ β β) : β := by | |
| classical | |
| exact gaussianHierarchyMean w Ο (fun Ο => if Ο = Ο then 1 else 0) steps x | |
| theorem hierarchyAtom_nonneg {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (Ο : S) (x : ΞΉ β β) : | |
| 0 β€ hierarchyAtom w Ο steps Ο x := by | |
| classical | |
| exact gaussianHierarchyMean_nonneg hw Ο (fun Ο => by split_ifs <;> norm_num) steps ha x | |
| theorem hierarchyAtom_smooth {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (Ο : S) (r : β) : | |
| BddSmooth r (hierarchyAtom w Ο steps Ο) := | |
| gaussianHierarchyMean_smooth hw Ο _ steps ha r | |
| theorem gaussianHierarchyMean_atoms {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (A : S β β) (x : ΞΉ β β) : | |
| gaussianHierarchyMean w Ο A steps x = β Ο, A Ο*hierarchyAtom w Ο steps Ο x := by | |
| classical | |
| have he : A = fun Ο => β Ο, A Ο*(if Ο = Ο then 1 else 0) := by | |
| funext Ο | |
| simp | |
| conv_lhs => rw [he] | |
| rw [gaussianHierarchyMean_sum hw Ο steps ha] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| exact congrFun (gaussianHierarchyMean_const_mul_ordered hw Ο _ steps ha (A Ο)) x | |
| theorem hierarchyAtom_sum {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| β Ο, hierarchyAtom w Ο steps Ο x = 1 := by | |
| have h := gaussianHierarchyMean_atoms hw Ο steps ha (fun _ => 1) x | |
| rw [gaussianHierarchyMean_const hw Ο steps ha] at h | |
| simpa only [one_mul] using h.symm | |
| noncomputable def hierarchyPairMean (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| (K : S β S β β) (steps : List (GaussianStep ΞΉ)) (x : ΞΉ β β) : β := | |
| β Ο, β Ο, (hierarchyAtom w Ο steps Ο x*hierarchyAtom w Ο steps Ο x)*K Ο Ο | |
| theorem hierarchyPairMean_smooth {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (r : β) : | |
| BddSmooth r (hierarchyPairMean w Ο K steps) := by | |
| apply BddSmooth.sum Finset.univ | |
| intro Ο _ | |
| apply BddSmooth.sum Finset.univ | |
| intro Ο _ | |
| simpa only [mul_comm (K Ο Ο)] using | |
| ((hierarchyAtom_smooth hw Ο steps ha Ο r).mul | |
| (hierarchyAtom_smooth hw Ο steps ha Ο r)).const_mul (K Ο Ο) | |
| theorem hierarchyPairMean_const {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (c : β) (x : ΞΉ β β) : | |
| hierarchyPairMean w Ο (fun _ _ => c) steps x = c := by | |
| unfold hierarchyPairMean | |
| simp_rw [β Finset.sum_mul,β Finset.mul_sum,hierarchyAtom_sum hw Ο steps ha] | |
| simp only [mul_one,hierarchyAtom_sum hw Ο steps ha] | |
| ring | |
| theorem hierarchyPairMean_mono {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {K L : S β S β β} (hKL : β Ο Ο, K Ο Ο β€ L Ο Ο) | |
| (steps : List (GaussianStep ΞΉ)) {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| hierarchyPairMean w Ο K steps x β€ hierarchyPairMean w Ο L steps x := by | |
| apply Finset.sum_le_sum | |
| intro Ο _ | |
| apply Finset.sum_le_sum | |
| intro Ο _ | |
| exact mul_le_mul_of_nonneg_left (hKL Ο Ο) (mul_nonneg | |
| (hierarchyAtom_nonneg hw Ο steps ha Ο x) (hierarchyAtom_nonneg hw Ο steps ha Ο x)) | |
| omit [Nonempty S] in | |
| theorem hierarchyPairMean_linear (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| (K L : S β S β β) (steps : List (GaussianStep ΞΉ)) (c d : β) (x : ΞΉ β β) : | |
| hierarchyPairMean w Ο (fun Ο Ο => c*K Ο Ο+d*L Ο Ο) steps x = | |
| c*hierarchyPairMean w Ο K steps x+d*hierarchyPairMean w Ο L steps x := by | |
| unfold hierarchyPairMean | |
| simp_rw [mul_add,Finset.sum_add_distrib,β mul_assoc] | |
| simp_rw [mul_comm _ c,mul_comm _ d,mul_assoc,β Finset.mul_sum] | |
| theorem hierarchyPairMean_product {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (A B : S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| hierarchyPairMean w Ο (fun Ο Ο => A Ο*B Ο) steps x = | |
| gaussianHierarchyMean w Ο A steps x*gaussianHierarchyMean w Ο B steps x := by | |
| rw [gaussianHierarchyMean_atoms hw Ο steps ha,gaussianHierarchyMean_atoms hw Ο steps ha, | |
| Finset.sum_mul] | |
| simp_rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| apply Finset.sum_congr rfl | |
| intro Ο _ | |
| ring | |
| noncomputable def kernelPenalty (w : S β β) (Ο : S β (ΞΉ β β) βL[β] β) | |
| (K : S β S β β) : β β List (GaussianStep ΞΉ) β (ΞΉ β β) β β | |
| | a, [] => fun x => (1-a)*hierarchyPairMean w Ο K [] x | |
| | a, (m,q)::tail => fun x => (m-a)*hierarchyPairMean w Ο K ((m,q)::tail) x+ | |
| shiftedMean (Measure.pi fun i => gaussianReal 0 (q i)) m (gaussianHierarchy w Ο tail) | |
| (kernelPenalty w Ο K m tail) x | |
| theorem kernelPenalty_smooth {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (r : β) : | |
| BddSmooth r (kernelPenalty w Ο K a steps) := by | |
| induction steps generalizing a with | |
| | nil => exact (hierarchyPairMean_smooth hw Ο K [] ha r).const_mul (1-a) | |
| | cons st tail ih => | |
| rcases st with β¨m,qβ© | |
| exact ((hierarchyPairMean_smooth hw Ο K ((m,q)::tail) ha r).const_mul (m-a)).add | |
| ((ih ha.2.2.2).shiftedMean (gaussianHierarchy_regular hw Ο tail ha.2.2.2 r) | |
| (gaussianHierarchy_integrable hw Ο tail ha.2.2.2 m q)) | |
| theorem kernelPenalty_const {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (c : β) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun _ _ => c) a steps x = (1-a)*c := by | |
| induction steps generalizing a x with | |
| | nil => simp only [kernelPenalty,hierarchyPairMean_const hw Ο [] ha] | |
| | cons st tail ih => | |
| rcases st with β¨m,qβ© | |
| simp only [kernelPenalty,hierarchyPairMean_const hw Ο ((m,q)::tail) ha] | |
| rw [funext (ih ha.2.2.2)] | |
| rw [shiftedMean_const _ (gaussianHierarchy_integrable hw Ο tail ha.2.2.2 m q x)] | |
| ring | |
| theorem kernelPenalty_mono {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) {K L : S β S β β} (hKL : β Ο Ο, K Ο Ο β€ L Ο Ο) | |
| (steps : List (GaussianStep ΞΉ)) {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| kernelPenalty w Ο K a steps x β€ kernelPenalty w Ο L a steps x := by | |
| induction steps generalizing a x with | |
| | nil => | |
| exact mul_le_mul_of_nonneg_left (hierarchyPairMean_mono hw Ο hKL [] ha x) | |
| (sub_nonneg.mpr ha.2) | |
| | cons st tail ih => | |
| rcases st with β¨m,qβ© | |
| exact add_le_add (mul_le_mul_of_nonneg_left (hierarchyPairMean_mono hw Ο hKL _ ha x) | |
| (sub_nonneg.mpr ha.2.1)) | |
| (shiftedMean_mono (kernelPenalty_smooth hw Ο K tail ha.2.2.2 0) | |
| (kernelPenalty_smooth hw Ο L tail ha.2.2.2 0) (fun y => ih ha.2.2.2 y) | |
| (gaussianHierarchy_integrable hw Ο tail ha.2.2.2 m q x)) | |
| theorem kernelPenalty_linear {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K L : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (c d : β) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun Ο Ο => c*K Ο Ο+d*L Ο Ο) a steps x = | |
| c*kernelPenalty w Ο K a steps x+d*kernelPenalty w Ο L a steps x := by | |
| induction steps generalizing a x with | |
| | nil => simp only [kernelPenalty,hierarchyPairMean_linear]; ring | |
| | cons st tail ih => | |
| rcases st with β¨m,qβ© | |
| simp only [kernelPenalty,hierarchyPairMean_linear] | |
| rw [funext (ih ha.2.2.2)] | |
| rw [shiftedMean_add ((kernelPenalty_smooth hw Ο K tail ha.2.2.2 0).const_mul c) | |
| ((kernelPenalty_smooth hw Ο L tail ha.2.2.2 0).const_mul d) | |
| (gaussianHierarchy_integrable hw Ο tail ha.2.2.2 m q x),shiftedMean_const_mul, | |
| shiftedMean_const_mul] | |
| ring | |
| theorem kernelPenalty_rankOne {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (v : ΞΉ β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun Ο Ο => Ο Ο v*Ο Ο v) a steps x = hierarchyPenalty w Ο v a steps x := by | |
| induction steps generalizing a x with | |
| | nil => simp only [kernelPenalty,hierarchyPenalty,hierarchyPairMean_product hw Ο _ _ [] ha,pow_two] | |
| | cons st tail ih => | |
| rcases st with β¨m,qβ© | |
| simp only [kernelPenalty,hierarchyPenalty,hierarchyPairMean_product hw Ο _ _ _ ha,pow_two] | |
| rw [funext (ih ha.2.2.2)] | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations.Hierarchy | |
| open MeasureTheory ProbabilityTheory Filter Set | |
| open scoped Topology NNReal BigOperators | |
| variable {ΞΉ S : Type*} [Fintype ΞΉ] [Fintype S] [Nonempty S] | |
| theorem kernelPenalty_const_mul {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a : β} (ha : OrderedSteps a steps) (c : β) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun Ο Ο => c*K Ο Ο) a steps x = c*kernelPenalty w Ο K a steps x := by | |
| simpa only [zero_mul,add_zero] using kernelPenalty_linear hw Ο K (fun _ _ => 0) steps ha c 0 x | |
| theorem kernelPenalty_sum {ΞΊ : Type*} {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : ΞΊ β S β S β β) (is : Finset ΞΊ) | |
| (steps : List (GaussianStep ΞΉ)) {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun Ο Ο => β i β is, K i Ο Ο) a steps x = | |
| β i β is, kernelPenalty w Ο (K i) a steps x := by | |
| classical | |
| induction is using Finset.induction_on with | |
| | empty => simp only [Finset.sum_empty,kernelPenalty_const hw Ο steps ha,mul_zero] | |
| | @insert i is hi ih => | |
| simp only [Finset.sum_insert hi] | |
| have he := kernelPenalty_linear hw Ο (K i) (fun Ο Ο => β j β is, K j Ο Ο) steps ha 1 1 x | |
| simp only [one_mul] at he | |
| rw [he,ih] | |
| theorem kernelPenalty_weighted_features {ΞΊ : Type*} [Fintype ΞΊ] {w : S β β} | |
| (hw : β Ο, 0 < w Ο) (Ο : S β (ΞΉ β β) βL[β] β) (v : ΞΊ β ΞΉ β β) | |
| (d : ΞΊ β β) (steps : List (GaussianStep ΞΉ)) {a : β} (ha : OrderedSteps a steps) (x : ΞΉ β β) : | |
| kernelPenalty w Ο (fun Ο Ο => β i, d i*Ο Ο (v i)*Ο Ο (v i)) a steps x = | |
| β i, d i*hierarchyPenalty w Ο (v i) a steps x := by | |
| have he : (fun Ο Ο => β i, d i*Ο Ο (v i)*Ο Ο (v i)) = | |
| fun Ο Ο => β i, d i*(Ο Ο (v i)*Ο Ο (v i)) := by | |
| funext Ο Ο | |
| simp only [mul_assoc] | |
| rw [he,kernelPenalty_sum hw Ο _ Finset.univ steps ha] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [kernelPenalty_const_mul hw Ο _ steps ha,kernelPenalty_rankOne hw Ο _ steps ha] | |
| theorem kernelPenalty_lower_bound {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (K : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {a C : β} (ha : OrderedSteps a steps) (hK : β Ο Ο, -C β€ K Ο Ο) (x : ΞΉ β β) : | |
| -(1/2:β)*kernelPenalty w Ο K a steps x β€ (1-a)*C/2 := by | |
| have hh := kernelPenalty_mono hw Ο hK steps ha x | |
| rw [kernelPenalty_const hw Ο steps ha] at hh | |
| linarith | |
| theorem kernelPenalty_chord {w : S β β} (hw : β Ο, 0 < w Ο) | |
| (Ο : S β (ΞΉ β β) βL[β] β) (R : S β S β β) (steps : List (GaussianStep ΞΉ)) | |
| {m a : β} (hm : OrderedSteps m steps) (ha : 0 < a) (c : β) (x : ΞΉ β β) : | |
| -(1/2:β)*kernelPenalty w Ο (fun Ο Ο => a/2*(R Ο Ο)^2-c*R Ο Ο) m steps x β€ | |
| (1-m)*c^2/(4*a) := by | |
| have hK (Ο Ο) : -(c^2/(2*a)) β€ a/2*(R Ο Ο)^2-c*R Ο Ο := by | |
| rw [β neg_div,div_le_iffβ (show 0 < 2*a by positivity)] | |
| nlinarith [sq_nonneg (a*R Ο Ο-c)] | |
| have hh := kernelPenalty_lower_bound hw Ο _ steps hm hK x | |
| convert hh using 1; ring | |
| theorem prefixTest_le_const {F A : (ΞΉ β β) β β} {C : ββ₯0} | |
| (hF : LipschitzWith C F) (hA : BddSmooth 0 A) (front : List (GaussianStep ΞΉ)) | |
| (ho : β st β front, 0 < st.1) {B : β} (hb : β y, A y β€ B) (x : ΞΉ β β) : | |
| prefixTest front F A x β€ B := by | |
| have hn : β y, 0 β€ B+(-1)*A y := fun y => by linarith [hb y] | |
| have hh := prefixTest_nonneg hF hn front ho x | |
| rw [prefixTest_affine hF hA front ho B (-1) x] at hh | |
| linarith | |
| theorem rootedPrefixTest_le_const {F A : (ΞΉ β β) β β} {C : ββ₯0} | |
| (hF : LipschitzWith C F) (hA : BddSmooth 0 A) (front : List (GaussianStep ΞΉ)) | |
| (ho : β st β front, 0 < st.1) {B : β} (hb : β y, A y β€ B) | |
| (qβ : ΞΉ β ββ₯0) (x : ΞΉ β β) : | |
| zeroContinuation (Measure.pi fun i => gaussianReal 0 (qβ i)) (prefixTest front F A) x β€ B := by | |
| have hP := prefixTest_smooth0 hF hA front ho | |
| have hi : Integrable (fun z => prefixTest front F A (x+z)) | |
| (Measure.pi fun i => gaussianReal 0 (qβ i)) := by | |
| obtain β¨D,hD,hbDβ© := hP.bound | |
| exact Integrable.of_bound (hP.continuous.comp (continuous_const.add continuous_id)).aestronglyMeasurable | |
| D (Filter.Eventually.of_forall fun z => by simpa only [Real.norm_eq_abs] using hbD (x+z)) | |
| have hh := integral_mono hi (integrable_const B) (fun z => prefixTest_le_const hF hA front ho hb (x+z)) | |
| simpa [zeroContinuation] using hh | |
| end SKFluctuations.Hierarchy | |
| namespace SKFluctuations | |
| open MeasureTheory ProbabilityTheory Hierarchy | |
| open scoped Topology NNReal BigOperators | |
| theorem orderedSK_kernel_chord (n : β) (hn : 0 < n) {w : Spin n β β} | |
| (hw : β Ο, 0 < w Ο) (steps : List (GaussianStep (OrderedFeatureIndex n))) | |
| {m a : β} (hm : OrderedSteps m steps) (ha : 0 < a) (c : β) (x : OrderedFeatureIndex n β β) : | |
| -(1/2:β)*(β i : OrderedFeatureIndex n, Sum.elim (fun _ => -c) (fun _ => a) i* | |
| hierarchyPenalty w (orderedFeature n) (Pi.single i 1) m steps x) β€ | |
| (n:β)*(1-m)*c^2/(4*a) := by | |
| have he : (fun Ο Ο => β i : OrderedFeatureIndex n, Sum.elim (fun _ => -c) (fun _ => a) i* | |
| orderedFeature n Ο (Pi.single i 1)*orderedFeature n Ο (Pi.single i 1)) = | |
| fun Ο Ο => (n:β)*(a/2*(orderedOverlap n Ο Ο)^2-c*orderedOverlap n Ο Ο) := by | |
| funext Ο Ο | |
| simp only [orderedFeature_single] | |
| rw [orderedCovariance n hn] | |
| ring | |
| rw [β kernelPenalty_weighted_features hw (orderedFeature n) (fun i => Pi.single i 1) _ steps hm,he, | |
| kernelPenalty_const_mul hw (orderedFeature n) _ steps hm] | |
| have hh := mul_le_mul_of_nonneg_left (kernelPenalty_chord hw (orderedFeature n) | |
| (orderedOverlap n) steps hm ha c x) (Nat.cast_nonneg n) | |
| convert hh using 1 <;> first | rfl | ring | |
| end SKFluctuations | |
| namespace SKFluctuations | |
| open MeasureTheory ProbabilityTheory Hierarchy | |
| open scoped Topology NNReal BigOperators | |
| theorem orderedSK_kernel_chord_observed (n : β) (hn : 0 < n) {w : Spin n β β} | |
| (hw : β Ο, 0 < w Ο) (steps front : List (GaussianStep (OrderedFeatureIndex n))) | |
| {m a : β} (hm : OrderedSteps m steps) (ha : 0 < a) (c : β) | |
| (hf : β st β front, 0 < st.1) (qβ : OrderedFeatureIndex n β ββ₯0) | |
| (x : OrderedFeatureIndex n β β) : | |
| zeroContinuation (Measure.pi fun i => gaussianReal 0 (qβ i)) | |
| (prefixTest front (gaussianHierarchy w (orderedFeature n) steps) | |
| (fun y => -(1/2:β)*(β i : OrderedFeatureIndex n, | |
| Sum.elim (fun _ => -c) (fun _ => a) i* | |
| hierarchyPenalty w (orderedFeature n) (Pi.single i 1) m steps y))) x β€ | |
| (n:β)*(1-m)*c^2/(4*a) := by | |
| apply rootedPrefixTest_le_const (gaussianHierarchy_regular hw (orderedFeature n) steps hm 0).1.choose_spec | |
| ((BddSmooth.sum Finset.univ (fun i _ => | |
| (hierarchyPenalty_smooth hw (orderedFeature n) (Pi.single i 1) steps hm 0).const_mul | |
| (Sum.elim (fun _ => -c) (fun _ => a) i))).const_mul (-(1/2:β))) front hf | |
| exact fun y => orderedSK_kernel_chord n hn hw steps hm ha c y | |
| end SKFluctuations | |
| end | |
| end OAI | |