%22%22%22Renormalization%20Group%3A%20Central%20Limit%20Theorem%20as%20RG%20Fixed%20Point%22%22%22%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.19.4%22%0Aapp%20%3D%20marimo.App()%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20from%20derive%20import%20(%0A%20%20%20%20%20%20%20%20Symbol%2C%20symbols%2C%20Function%2C%20Matrix%2C%20Rational%2C%20Sqrt%2C%20R%2C%0A%20%20%20%20%20%20%20%20D%2C%20Integrate%2C%20NIntegrate%2C%20Simplify%2C%20Expand%2C%20Exp%2C%20Sin%2C%20Cos%2C%20Pi%2C%20I%2C%0A%20%20%20%20%20%20%20%20Limit%2C%20Series%2C%20Log%2C%20Factorial%2C%20Eq%2C%20Solve%2C%0A%20%20%20%20%20%20%20%20Nest%2C%20NestList%2C%20FixedPoint%2C%20FixedPointList%2C%0A%20%20%20%20%20%20%20%20FourierTransform%2C%20InverseFourierTransform%2C%20Convolve%2C%0A%20%20%20%20%20%20%20%20Eigenvalues%2C%20CharacteristicPolynomial%2C%0A%20%20%20%20%20%20%20%20Replace%2C%20ReplaceAll%2C%20Rule%2C%0A%20%20%20%20%20%20%20%20Table%2C%20Map%2C%20Total%2C%0A%20%20%20%20)%0A%20%20%20%20from%20derive.ode%20import%20DSolve%0A%20%20%20%20from%20derive.plotting%20import%20Plot%2C%20ListPlot%2C%20ListLinePlot%2C%20Show%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20D%2C%0A%20%20%20%20%20%20%20%20DSolve%2C%0A%20%20%20%20%20%20%20%20Eigenvalues%2C%0A%20%20%20%20%20%20%20%20Eq%2C%0A%20%20%20%20%20%20%20%20Exp%2C%0A%20%20%20%20%20%20%20%20FixedPointList%2C%0A%20%20%20%20%20%20%20%20FourierTransform%2C%0A%20%20%20%20%20%20%20%20Function%2C%0A%20%20%20%20%20%20%20%20Integrate%2C%0A%20%20%20%20%20%20%20%20ListLinePlot%2C%0A%20%20%20%20%20%20%20%20Log%2C%0A%20%20%20%20%20%20%20%20Matrix%2C%0A%20%20%20%20%20%20%20%20NestList%2C%0A%20%20%20%20%20%20%20%20Pi%2C%0A%20%20%20%20%20%20%20%20Plot%2C%0A%20%20%20%20%20%20%20%20R%2C%0A%20%20%20%20%20%20%20%20Series%2C%0A%20%20%20%20%20%20%20%20Simplify%2C%0A%20%20%20%20%20%20%20%20Sqrt%2C%0A%20%20%20%20%20%20%20%20Symbol%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Renormalization%20Group%20and%20the%20Central%20Limit%20Theorem%0A%0A%20%20%20%20This%20notebook%20demonstrates%20how%20the%20Central%20Limit%20Theorem%20emerges%20as%20a%0A%20%20%20%20**renormalization%20group%20fixed%20point**.%20The%20Gaussian%20distribution%20is%20the%0A%20%20%20%20unique%20stable%20attractor%20under%20repeated%20coarse-graining%20and%20rescaling.%0A%0A%20%20%20%20Inspired%20by%20%5BThe%20Simplest%20Renormalization%20Group%5D(https%3A%2F%2Fdinunno.substack.com%2Fp%2Fthe-simplest-renormalization-group).%0A%0A%20%20%20%20%23%23%20Overview%0A%0A%20%20%20%20We%20showcase%20symderive's%20full%20calculation%20pipeline%3A%0A%20%20%20%201.%20**FourierTransform**%3A%20Characteristic%20functions%20as%20Fourier%20transforms%0A%20%20%20%202.%20**Convolve**%3A%20Sum%20of%20random%20variables%20as%20convolution%0A%20%20%20%203.%20**Series**%3A%20Taylor%20expansion%20of%20characteristic%20functions%0A%20%20%20%204.%20**DSolve**%3A%20Solve%20the%20RG%20flow%20differential%20equations%0A%20%20%20%205.%20**Eigenvalues**%3A%20Stability%20analysis%20via%20linearization%0A%20%20%20%206.%20**Nest%2FNestList**%3A%20Iterated%20RG%20transformations%0A%20%20%20%207.%20**FixedPoint**%3A%20Convergence%20to%20Gaussian%0A%20%20%20%208.%20**Plot%2FListPlot**%3A%20Visualization%20of%20flows%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%201.%20Probability%20Densities%20and%20Characteristic%20Functions%0A%0A%20%20%20%20The%20**characteristic%20function**%20is%20the%20Fourier%20transform%20of%20the%20probability%20density%3A%0A%0A%20%20%20%20%24%24%5Cvarphi(k)%20%3D%20%5Cmathbb%7BE%7D%5Be%5E%7BikX%7D%5D%20%3D%20%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%7D%20e%5E%7Bikx%7D%20%5C%2C%20p(x)%20%5C%2C%20dx%20%3D%20%5Cmathcal%7BF%7D%5Bp%5D(k)%24%24%0A%0A%20%20%20%20For%20the%20Gaussian%20%24p(x)%20%3D%20%5Cfrac%7B1%7D%7B%5Csqrt%7B2%5Cpi%5Csigma%5E2%7D%7D%20e%5E%7B-x%5E2%2F2%5Csigma%5E2%7D%24%3A%0A%0A%20%20%20%20%24%24%5Cvarphi_%7B%5Ctext%7BGauss%7D%7D(k)%20%3D%20e%5E%7B-%5Csigma%5E2%20k%5E2%2F2%7D%24%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20FourierTransform%2C%20Pi%2C%20Simplify%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Define%20symbols%0A%20%20%20%20x%20%3D%20Symbol('x'%2C%20real%3DTrue)%0A%20%20%20%20k%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Gaussian%20probability%20density%20(unit%20variance)%0A%20%20%20%20p_gauss%20%3D%201%2FSqrt(2*Pi)%20*%20Exp(-x**2%20%2F%202)%0A%0A%20%20%20%20%23%20Compute%20characteristic%20function%20via%20Fourier%20transform%0A%20%20%20%20%23%20phi(k)%20%3D%20E%5Be%5E%7BikX%7D%5D%20%3D%20FT%20of%20density%20(with%20frequency%20variable%20k)%0A%20%20%20%20%23%20Note%3A%20Standard%20FT%20convention%20gives%20exp(-k%5E2%2F2)%20for%20unit%20Gaussian%0A%20%20%20%20phi_gauss_ft%20%3D%20FourierTransform(p_gauss%2C%20x%2C%20k)%0A%20%20%20%20phi_gauss_simplified%20%3D%20Simplify(phi_gauss_ft)%0A%0A%20%20%20%20%23%20Expected%20result%20for%20comparison%0A%20%20%20%20phi_expected%20%3D%20Exp(-k**2%20%2F%202)%0A%0A%20%20%20%20%7B%22density%22%3A%20p_gauss%2C%20%22char_function_FT%22%3A%20phi_gauss_simplified%2C%20%22expected%22%3A%20phi_expected%7D%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%202.%20The%20RG%20Transformation%20via%20Convolution%0A%0A%20%20%20%20Adding%20two%20independent%20random%20variables%20corresponds%20to%20**convolution**%20of%20densities%3A%0A%0A%20%20%20%20%24%24p_%7BX%2BY%7D(z)%20%3D%20(p_X%20*%20p_Y)(z)%20%3D%20%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%7D%20p_X(t)%20%5C%2C%20p_Y(z-t)%20%5C%2C%20dt%24%24%0A%0A%20%20%20%20In%20Fourier%20space%2C%20convolution%20becomes%20multiplication%3A%0A%0A%20%20%20%20%24%24%5Cvarphi_%7BX%2BY%7D(k)%20%3D%20%5Cvarphi_X(k)%20%5Ccdot%20%5Cvarphi_Y(k)%24%24%0A%0A%20%20%20%20The%20RG%20transformation%20for%20i.i.d.%20variables%3A%0A%20%20%20%201.%20**Add**%3A%20%24X%20%2B%20X'%20%5Cto%24%20multiply%20characteristic%20functions%0A%20%20%20%202.%20**Rescale**%3A%20%24%5Cfrac%7BX%2BX'%7D%7B%5Csqrt%7B2%7D%7D%20%5Cto%24%20substitute%20%24k%20%5Cto%20k%2F%5Csqrt%7B2%7D%24%0A%0A%20%20%20%20%24%24%5Cmathcal%7BR%7D%5B%5Cvarphi%5D(k)%20%3D%20%5Cvarphi(k%2F%5Csqrt%7B2%7D)%5E2%24%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Simplify%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Define%20the%20RG%20transformation%20symbolically%0A%20%20%20%20k_rg%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Generic%20characteristic%20function%20(represented%20by%20its%20log)%0A%20%20%20%20%23%20log(phi)%20%3D%20-k%5E2%2F2%20for%20Gaussian%0A%0A%20%20%20%20%23%20RG%20transformation%3A%20phi'(k)%20%3D%20phi(k%2Fsqrt(2))%5E2%0A%20%20%20%20def%20RG_transform_phi(phi%2C%20k_var)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Apply%20one%20RG%20step%20to%20characteristic%20function.%22%22%22%0A%20%20%20%20%20%20%20%20return%20Simplify(phi.subs(k_var%2C%20k_var%2FSqrt(2))**2)%0A%0A%20%20%20%20%23%20Verify%20Gaussian%20is%20a%20fixed%20point%0A%20%20%20%20phi_unit%20%3D%20Exp(-k_rg**2%20%2F%202)%0A%20%20%20%20phi_after_rg%20%3D%20RG_transform_phi(phi_unit%2C%20k_rg)%0A%0A%20%20%20%20%23%20Should%20equal%20original%0A%20%20%20%20(phi_unit%2C%20phi_after_rg%2C%20Simplify(phi_after_rg%20-%20phi_unit))%0A%20%20%20%20return%20RG_transform_phi%2C%20k_rg%2C%20phi_unit%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20The%20Gaussian%20is%20indeed%20a%20fixed%20point%3A%20%24%5Cmathcal%7BR%7D%5B%5Cvarphi_%7B%5Ctext%7BGauss%7D%7D%5D%20%3D%20%5Cvarphi_%7B%5Ctext%7BGauss%7D%7D%24!%0A%0A%20%20%20%20%23%23%203.%20Series%20Expansion%20of%20Characteristic%20Functions%0A%0A%20%20%20%20The%20characteristic%20function%20encodes%20all%20**cumulants**%20via%20its%20Taylor%20series%3A%0A%0A%20%20%20%20%24%24%5Clog%20%5Cvarphi(k)%20%3D%20%5Csum_%7Bn%3D1%7D%5E%7B%5Cinfty%7D%20%5Cfrac%7B(ik)%5En%7D%7Bn!%7D%20%5Ckappa_n%24%24%0A%0A%20%20%20%20where%20%24%5Ckappa_n%24%20are%20the%20cumulants%3A%0A%20%20%20%20-%20%24%5Ckappa_1%20%3D%20%5Cmu%24%20(mean)%0A%20%20%20%20-%20%24%5Ckappa_2%20%3D%20%5Csigma%5E2%24%20(variance)%0A%20%20%20%20-%20%24%5Ckappa_3%24%20(skewness)%0A%20%20%20%20-%20%24%5Ckappa_4%24%20(excess%20kurtosis)%0A%0A%20%20%20%20For%20centered%20distributions%20(%24%5Cmu%20%3D%200%24)%3A%0A%0A%20%20%20%20%24%24%5Cvarphi(k)%20%3D%201%20-%20%5Cfrac%7B%5Csigma%5E2%20k%5E2%7D%7B2%7D%20%2B%20%5Cfrac%7B%5Ckappa_4%20k%5E4%7D%7B24%7D%20%2B%20O(k%5E6)%24%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Series%2C%20Symbol)%3A%0A%20%20%20%20%23%20Series%20expansion%20of%20Gaussian%20characteristic%20function%0A%20%20%20%20k_series%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%20%20%20%20sig%20%3D%20Symbol('sigma'%2C%20positive%3DTrue)%0A%0A%20%20%20%20phi_gaussian%20%3D%20Exp(-sig**2%20*%20k_series**2%20%2F%202)%0A%0A%20%20%20%20%23%20Taylor%20series%20around%20k%3D0%20to%20order%206%0A%20%20%20%20phi_series%20%3D%20Series(phi_gaussian%2C%20(k_series%2C%200%2C%206))%0A%20%20%20%20phi_series%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Series%2C%20Simplify%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Non-Gaussian%20with%20excess%20kurtosis%0A%20%20%20%20k_ng%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%20%20%20%20eps%20%3D%20Symbol('epsilon'%2C%20real%3DTrue)%20%20%23%20Small%20kurtosis%20parameter%0A%0A%20%20%20%20%23%20phi%20%3D%20exp(-k%5E2%2F2)%20*%20(1%20%2B%20eps*k%5E4%2F24)%20to%20first%20order%20in%20epsilon%0A%20%20%20%20phi_nongauss%20%3D%20Exp(-k_ng**2%20%2F%202)%20*%20(1%20%2B%20eps%20*%20k_ng**4%20%2F%2024)%0A%0A%20%20%20%20%23%20Series%20expansion%0A%20%20%20%20phi_ng_series%20%3D%20Series(phi_nongauss%2C%20(k_ng%2C%200%2C%206))%0A%0A%20%20%20%20%23%20RG%20step%20on%20non-Gaussian%0A%20%20%20%20def%20RG_step_series(phi%2C%20k_var%2C%20eps_var)%3A%0A%20%20%20%20%20%20%20%20%22%22%22RG%20step%20keeping%20terms%20to%20O(epsilon).%22%22%22%0A%20%20%20%20%20%20%20%20transformed%20%3D%20phi.subs(k_var%2C%20k_var%20%2F%20Sqrt(2))**2%0A%20%20%20%20%20%20%20%20return%20Simplify(Series(transformed%2C%20(eps_var%2C%200%2C%202)).removeO())%0A%0A%20%20%20%20phi_ng_after_rg%20%3D%20RG_step_series(phi_nongauss%2C%20k_ng%2C%20eps)%0A%20%20%20%20(phi_ng_series%2C%20phi_ng_after_rg)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Notice%3A%20The%20coefficient%20of%20%24%5Cepsilon%24%20(the%20non-Gaussian%20part)%20**decreases**%20with%20each%0A%20%20%20%20RG%20step%2C%20showing%20flow%20toward%20the%20Gaussian%20fixed%20point.%0A%0A%20%20%20%20%23%23%204.%20RG%20Flow%20Equations%20via%20DSolve%0A%0A%20%20%20%20The%20**beta%20function**%20for%20cumulant%20%24%5Ckappa_n%24%20describes%20how%20it%20flows%20under%20RG%3A%0A%0A%20%20%20%20%24%24%5Cfrac%7Bd%5Ckappa_n%7D%7Bd%5Cell%7D%20%3D%20%5CDelta_n%20%5Ccdot%20%5Ckappa_n%20%3D%20%5Cleft(1%20-%20%5Cfrac%7Bn%7D%7B2%7D%5Cright)%20%5Ckappa_n%24%24%0A%0A%20%20%20%20where%20%24%5CDelta_n%20%3D%201%20-%20n%2F2%24%20is%20the%20**scaling%20dimension**%3A%0A%20%20%20%20-%20%24%5CDelta_2%20%3D%200%24%3A%20Variance%20is%20**marginal**%20(fixed)%0A%20%20%20%20-%20%24%5CDelta_3%20%3D%20-1%2F2%24%3A%20Skewness%20is%20**irrelevant**%20(flows%20to%200)%0A%20%20%20%20-%20%24%5CDelta_4%20%3D%20-1%24%3A%20Kurtosis%20is%20**irrelevant**%20(flows%20to%200%20faster)%0A%20%20%20%20-%20%24%5CDelta_n%20%3C%200%24%20for%20%24n%20%3E%202%24%3A%20All%20higher%20cumulants%20are%20irrelevant!%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(D%2C%20DSolve%2C%20Eq%2C%20Function%2C%20Symbol)%3A%0A%20%20%20%20%23%20Solve%20the%20RG%20flow%20ODE%20for%20a%20general%20cumulant%0A%20%20%20%20ell%20%3D%20Symbol('ell'%2C%20real%3DTrue%2C%20nonnegative%3DTrue)%20%20%23%20RG%20time%0A%20%20%20%20n_ord%20%3D%20Symbol('n'%2C%20positive%3DTrue)%20%20%23%20Cumulant%20order%0A%0A%20%20%20%20%23%20kappa_n%20as%20function%20of%20RG%20time%0A%20%20%20%20kappa%20%3D%20Function('kappa')%0A%0A%20%20%20%20%23%20Scaling%20dimension%0A%20%20%20%20Delta%20%3D%201%20-%20n_ord%20%2F%202%0A%0A%20%20%20%20%23%20The%20RG%20flow%20ODE%3A%20d(kappa)%2Fd(ell)%20%3D%20Delta%20*%20kappa%0A%20%20%20%20rg_ode%20%3D%20Eq(D(kappa(ell)%2C%20ell)%2C%20Delta%20*%20kappa(ell))%0A%0A%20%20%20%20%23%20Solve%20using%20DSolve%0A%20%20%20%20rg_solution%20%3D%20DSolve(rg_ode%2C%20kappa(ell)%2C%20ell)%0A%0A%20%20%20%20(rg_ode%2C%20rg_solution)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(D%2C%20DSolve%2C%20Eq%2C%20Function%2C%20R%2C%20Symbol)%3A%0A%20%20%20%20%23%20Solve%20for%20specific%20cumulants%0A%20%20%20%20t%20%3D%20Symbol('t'%2C%20real%3DTrue%2C%20nonnegative%3DTrue)%0A%0A%20%20%20%20%23%20Kurtosis%20(n%3D4)%3A%20Delta%20%3D%20-1%0A%20%20%20%20kappa4%20%3D%20Function('kappa_4')%0A%20%20%20%20kappa4_ode%20%3D%20Eq(D(kappa4(t)%2C%20t)%2C%20-1%20*%20kappa4(t))%0A%20%20%20%20kappa4_sol%20%3D%20DSolve(kappa4_ode%2C%20kappa4(t)%2C%20t)%0A%0A%20%20%20%20%23%20Skewness%20(n%3D3)%3A%20Delta%20%3D%20-1%2F2%0A%20%20%20%20kappa3%20%3D%20Function('kappa_3')%0A%20%20%20%20kappa3_ode%20%3D%20Eq(D(kappa3(t)%2C%20t)%2C%20R(-1%2C2)%20*%20kappa3(t))%0A%20%20%20%20kappa3_sol%20%3D%20DSolve(kappa3_ode%2C%20kappa3(t)%2C%20t)%0A%0A%20%20%20%20%23%206th%20cumulant%20(n%3D6)%3A%20Delta%20%3D%20-2%0A%20%20%20%20kappa6%20%3D%20Function('kappa_6')%0A%20%20%20%20kappa6_ode%20%3D%20Eq(D(kappa6(t)%2C%20t)%2C%20-2%20*%20kappa6(t))%0A%20%20%20%20kappa6_sol%20%3D%20DSolve(kappa6_ode%2C%20kappa6(t)%2C%20t)%0A%0A%20%20%20%20(kappa3_sol%2C%20kappa4_sol%2C%20kappa6_sol)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20The%20solutions%20are%3A%0A%20%20%20%20-%20%24%5Ckappa_3(%5Cell)%20%3D%20%5Ckappa_3(0)%20%5C%2C%20e%5E%7B-%5Cell%2F2%7D%24%20(skewness%20decays%20slowly)%0A%20%20%20%20-%20%24%5Ckappa_4(%5Cell)%20%3D%20%5Ckappa_4(0)%20%5C%2C%20e%5E%7B-%5Cell%7D%24%20(kurtosis%20decays%20faster)%0A%20%20%20%20-%20%24%5Ckappa_6(%5Cell)%20%3D%20%5Ckappa_6(0)%20%5C%2C%20e%5E%7B-2%5Cell%7D%24%20(higher%20cumulants%20decay%20even%20faster)%0A%0A%20%20%20%20All%20higher%20cumulants%20flow%20to%20zero%2C%20leaving%20only%20the%20Gaussian!%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Plot%2C%20Symbol)%3A%0A%20%20%20%20%23%20Plot%20the%20RG%20flow%20of%20cumulants%0A%20%20%20%20t_plot%20%3D%20Symbol('t'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Normalized%20cumulant%20flows%20(starting%20from%201)%0A%20%20%20%20kappa3_flow%20%3D%20Exp(-t_plot%20%2F%202)%0A%20%20%20%20kappa4_flow%20%3D%20Exp(-t_plot)%0A%20%20%20%20kappa6_flow%20%3D%20Exp(-2%20*%20t_plot)%0A%0A%20%20%20%20Plot(%0A%20%20%20%20%20%20%20%20%5Bkappa3_flow%2C%20kappa4_flow%2C%20kappa6_flow%5D%2C%0A%20%20%20%20%20%20%20%20(t_plot%2C%200%2C%205)%2C%0A%20%20%20%20%20%20%20%20PlotLabel%3D%22RG%20Flow%3A%20Cumulants%20Decay%20to%20Gaussian%22%2C%0A%20%20%20%20%20%20%20%20AxesLabel%3D%5B%22RG%20time%20%E2%84%93%22%2C%20%22%CE%BA%E2%82%99(%E2%84%93)%20%2F%20%CE%BA%E2%82%99(0)%22%5D%2C%0A%20%20%20%20%20%20%20%20PlotLegends%3D%5B%22%CE%BA%E2%82%83%20(skewness)%22%2C%20%22%CE%BA%E2%82%84%20(kurtosis)%22%2C%20%22%CE%BA%E2%82%86%22%5D%2C%0A%20%20%20%20%20%20%20%20GridLines%3DTrue%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%205.%20Stability%20Analysis%20via%20Eigenvalues%0A%0A%20%20%20%20Near%20the%20Gaussian%20fixed%20point%2C%20we%20can%20linearize%20the%20RG%20flow.%20The%20stability%0A%20%20%20%20matrix%20has%20eigenvalues%20equal%20to%20the%20scaling%20dimensions%20%24%5CDelta_n%24.%0A%0A%20%20%20%20The%20**eigenvalues**%20determine%20stability%3A%0A%20%20%20%20-%20%24%5CDelta%20%3C%200%24%3A%20Stable%20(irrelevant%20perturbation)%0A%20%20%20%20-%20%24%5CDelta%20%3D%200%24%3A%20Marginal%0A%20%20%20%20-%20%24%5CDelta%20%3E%200%24%3A%20Unstable%20(relevant%20perturbation)%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Eigenvalues%2C%20Matrix%2C%20R)%3A%0A%20%20%20%20%23%20Stability%20matrix%20for%20cumulants%20(%CE%BA%E2%82%82%2C%20%CE%BA%E2%82%83%2C%20%CE%BA%E2%82%84%2C%20%CE%BA%E2%82%86)%0A%20%20%20%20%23%20The%20RG%20is%20diagonal%20in%20cumulant%20space%20with%20eigenvalues%20%CE%94%E2%82%99%20%3D%201%20-%20n%2F2%0A%0A%20%20%20%20stability_matrix%20%3D%20Matrix(%5B%0A%20%20%20%20%20%20%20%20%5B0%2C%200%2C%200%2C%200%5D%2C%20%20%20%20%20%20%23%20%CE%94%E2%82%82%20%3D%200%20(marginal)%0A%20%20%20%20%20%20%20%20%5B0%2C%20R(-1%2C2)%2C%200%2C%200%5D%2C%20%20%23%20%CE%94%E2%82%83%20%3D%20-1%2F2%20(irrelevant)%0A%20%20%20%20%20%20%20%20%5B0%2C%200%2C%20-1%2C%200%5D%2C%20%20%20%20%20%23%20%CE%94%E2%82%84%20%3D%20-1%20(irrelevant)%0A%20%20%20%20%20%20%20%20%5B0%2C%200%2C%200%2C%20-2%5D%2C%20%20%20%20%20%23%20%CE%94%E2%82%86%20%3D%20-2%20(irrelevant)%0A%20%20%20%20%5D)%0A%0A%20%20%20%20eigenvalues%20%3D%20Eigenvalues(stability_matrix)%0A%0A%20%20%20%20(stability_matrix%2C%20eigenvalues)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20All%20eigenvalues%20are%20%24%5Cleq%200%24%2C%20confirming%20the%20Gaussian%20is%20a%20**stable%20fixed%20point**!%0A%0A%20%20%20%20%23%23%206.%20Iterated%20RG%20via%20Nest%20and%20NestList%0A%0A%20%20%20%20We%20use%20**NestList**%20to%20watch%20the%20RG%20transformation%20converge.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(NestList%2C%20RG_transform_phi%2C%20Simplify%2C%20k_rg%2C%20phi_unit)%3A%0A%20%20%20%20%23%20Apply%20RG%20transformation%20multiple%20times%20to%20Gaussian%0A%20%20%20%20%23%20Should%20stay%20at%20fixed%20point%0A%20%20%20%20gaussian_rg_sequence%20%3D%20NestList(%0A%20%20%20%20%20%20%20%20lambda%20phi%3A%20RG_transform_phi(phi%2C%20k_rg)%2C%0A%20%20%20%20%20%20%20%20phi_unit%2C%0A%20%20%20%20%20%20%20%204%0A%20%20%20%20)%0A%0A%20%20%20%20%23%20Verify%20all%20are%20equal%20(fixed%20point)%0A%20%20%20%20%5BSimplify(phi)%20for%20phi%20in%20gaussian_rg_sequence%5D%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20NestList%2C%20Simplify%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Now%20start%20with%20a%20non-Gaussian%20and%20watch%20it%20flow%20to%20Gaussian%0A%20%20%20%20k_flow%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Start%20with%20a%20characteristic%20function%20that%20has%20excess%20kurtosis%0A%20%20%20%20%23%20phi%20%3D%20exp(-k%5E2%2F2)%20*%20(1%20%2B%200.5*k%5E4%2F24)%0A%20%20%20%20phi_initial%20%3D%20Exp(-k_flow**2%20%2F%202)%20*%20(1%20%2B%200.5%20*%20k_flow**4%20%2F%2024)%0A%0A%20%20%20%20def%20RG_step(phi)%3A%0A%20%20%20%20%20%20%20%20return%20Simplify(phi.subs(k_flow%2C%20k_flow%2FSqrt(2))**2)%0A%0A%20%20%20%20%23%20Track%20flow%0A%20%20%20%20phi_sequence%20%3D%20NestList(RG_step%2C%20phi_initial%2C%205)%0A%20%20%20%20phi_sequence%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%207.%20Numerical%20Convergence%20via%20FixedPointList%0A%0A%20%20%20%20We%20can%20track%20the%20kurtosis%20coefficient%20numerically%20as%20it%20flows%20to%20zero.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(FixedPointList)%3A%0A%20%20%20%20%23%20Track%20kurtosis%20coefficient%20under%20RG%0A%20%20%20%20%23%20Each%20RG%20step%3A%20kappa4%20-%3E%20kappa4%20%2F%202%0A%0A%20%20%20%20def%20rg_kurtosis(kappa4_val)%3A%0A%20%20%20%20%20%20%20%20%22%22%22One%20RG%20step%3A%20kappa4%20-%3E%20kappa4%20%2F%202%22%22%22%0A%20%20%20%20%20%20%20%20return%20kappa4_val%20%2F%202%0A%0A%20%20%20%20%23%20Start%20with%20kurtosis%20%3D%201%2C%20iterate%20to%20fixed%20point%20(0)%0A%20%20%20%20kurtosis_convergence%20%3D%20FixedPointList(rg_kurtosis%2C%201.0%2C%20max_iter%3D20%2C%20tol%3D1e-10)%0A%20%20%20%20kurtosis_convergence%0A%20%20%20%20return%20(kurtosis_convergence%2C)%0A%0A%0A%40app.cell%0Adef%20_(ListLinePlot%2C%20kurtosis_convergence)%3A%0A%20%20%20%20%23%20Plot%20convergence%0A%20%20%20%20kurtosis_data%20%3D%20%5B(i%2C%20k)%20for%20i%2C%20k%20in%20enumerate(kurtosis_convergence)%5D%0A%0A%20%20%20%20ListLinePlot(%0A%20%20%20%20%20%20%20%20kurtosis_data%2C%0A%20%20%20%20%20%20%20%20PlotLabel%3D%22Kurtosis%20Decay%20to%20Fixed%20Point%22%2C%0A%20%20%20%20%20%20%20%20AxesLabel%3D%5B%22RG%20iteration%22%2C%20%22%CE%BA%E2%82%84%22%5D%2C%0A%20%20%20%20%20%20%20%20PlotStyle%3D%22Blue%22%2C%0A%20%20%20%20%20%20%20%20GridLines%3DTrue%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%208.%20The%20Central%20Limit%20Theorem%20as%20RG%0A%0A%20%20%20%20The%20CLT%20states%3A%20For%20i.i.d.%20random%20variables%20with%20mean%20%24%5Cmu%24%20and%20variance%20%24%5Csigma%5E2%24%2C%0A%0A%20%20%20%20%24%24S_n%20%3D%20%5Cfrac%7B1%7D%7B%5Csqrt%7Bn%7D%7D%20%5Csum_%7Bi%3D1%7D%5En%20(X_i%20-%20%5Cmu)%20%5Cxrightarrow%7Bd%7D%20%5Cmathcal%7BN%7D(0%2C%20%5Csigma%5E2)%24%24%0A%0A%20%20%20%20In%20RG%20language%3A%0A%20%20%20%20-%20Each%20%22doubling%22%20step%20adds%20variables%20and%20rescales%3A%20%24S_%7B2n%7D%20%3D%20%5Cfrac%7BS_n%20%2B%20S'_n%7D%7B%5Csqrt%7B2%7D%7D%24%0A%20%20%20%20-%20After%20%24%5Cell%24%20steps%2C%20we%20have%20%24n%20%3D%202%5E%5Cell%24%20variables%0A%20%20%20%20-%20The%20RG%20flow%20%24%5Cell%20%5Cto%20%5Cinfty%24%20corresponds%20to%20%24n%20%5Cto%20%5Cinfty%24%0A%20%20%20%20-%20The%20fixed%20point%20is%20the%20Gaussian!%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(NestList%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Demonstrate%20CLT%20numerically%3A%20start%20with%20uniform-like%20characteristic%20function%0A%20%20%20%20k_clt%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Uniform%20on%20%5B-sqrt(3)%2C%20sqrt(3)%5D%20has%20variance%201%20and%20characteristic%20function%0A%20%20%20%20%23%20phi_uniform(k)%20%3D%20sin(sqrt(3)*k)%20%2F%20(sqrt(3)*k)%0A%20%20%20%20%23%20For%20small%20k%2C%20expand%20as%201%20-%20k%5E2%2F2%20%2B%20k%5E4%2F40%20%2B%20...%0A%0A%20%20%20%20%23%20Start%20with%20a%20fourth-order%20approximation%20(non-Gaussian)%0A%20%20%20%20phi_approx%20%3D%201%20-%20k_clt**2%2F2%20%2B%20k_clt**4%2F40%0A%0A%20%20%20%20def%20rg_polynomial(phi)%3A%0A%20%20%20%20%20%20%20%20%22%22%22RG%20step%20for%20polynomial%20approximation.%22%22%22%0A%20%20%20%20%20%20%20%20return%20(phi.subs(k_clt%2C%20k_clt%2FSqrt(2))**2).expand()%0A%0A%20%20%20%20%23%20Watch%20convergence%20(coefficient%20of%20k%5E4%20should%20shrink)%0A%20%20%20%20poly_flow%20%3D%20NestList(rg_polynomial%2C%20phi_approx%2C%206)%0A%20%20%20%20poly_flow%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Notice%3A%20The%20coefficient%20of%20%24k%5E4%24%20decreases%20with%20each%20iteration%20(%241%2F40%20%5Cto%201%2F80%20%5Cto%201%2F160%20%5Cto%20%5Cldots%24)%2C%0A%20%20%20%20approaching%20the%20pure%20Gaussian%20%241%20-%20k%5E2%2F2%24.%0A%0A%20%20%20%20%23%23%209.%20Fixed%20Point%20Structure%0A%0A%20%20%20%20We%20verify%20the%20fixed%20point%20equation%20%24%5Cmathcal%7BR%7D%5B%5Cvarphi%5D%20%3D%20%5Cvarphi%24%3A%0A%0A%20%20%20%20%24%24%5Cvarphi(k%2F%5Csqrt%7B2%7D)%5E2%20%3D%20%5Cvarphi(k)%24%24%0A%0A%20%20%20%20Taking%20logs%3A%20%242%5Clog%5Cvarphi(k%2F%5Csqrt%7B2%7D)%20%3D%20%5Clog%5Cvarphi(k)%24%0A%0A%20%20%20%20The%20ansatz%20%24%5Clog%5Cvarphi%20%3D%20-a%20k%5E2%24%20solves%20this%20for%20any%20%24a%20%3E%200%24.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(R%2C%20Simplify%2C%20Symbol)%3A%0A%20%20%20%20%23%20Verify%20Gaussian%20fixed%20point%20algebraically%0A%20%20%20%20k_fp%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%20%20%20%20a%20%3D%20Symbol('a'%2C%20positive%3DTrue)%0A%0A%20%20%20%20%23%20Ansatz%3A%20log(phi)%20%3D%20-a%20*%20k%5E2%0A%20%20%20%20log_phi%20%3D%20-a%20*%20k_fp**2%0A%0A%20%20%20%20%23%20Check%20fixed%20point%3A%202%20*%20log_phi(k%2Fsqrt(2))%20%3D%20log_phi(k)%0A%20%20%20%20lhs%20%3D%202%20*%20log_phi.subs(k_fp%2C%20k_fp%20*%20R(1%2C2)**R(1%2C2))%20%20%23%20k%20-%3E%20k%2Fsqrt(2)%0A%20%20%20%20rhs%20%3D%20log_phi%0A%0A%20%20%20%20%23%20Should%20be%20zero%0A%20%20%20%20fixed_point_check%20%3D%20Simplify(lhs%20-%20rhs)%0A%20%20%20%20(lhs%2C%20rhs%2C%20fixed_point_check)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20The%20fixed%20point%20condition%20is%20satisfied!%20%24%5Cvarphi(k)%20%3D%20e%5E%7B-ak%5E2%7D%24%20is%20a%20fixed%20point%20for%20any%20%24a%20%3E%200%24.%0A%0A%20%20%20%20%23%23%2010.%20Universality%20Classes%0A%0A%20%20%20%20Different%20initial%20distributions%20(with%20finite%20variance)%20all%20flow%20to%20the%20same%0A%20%20%20%20Gaussian%20fixed%20point.%20This%20is%20**universality**%3A%20microscopic%20details%20don't%20matter!%0A%0A%20%20%20%20However%2C%20if%20variance%20is%20**infinite**%20(heavy%20tails)%2C%20the%20RG%20flows%20to%20different%0A%20%20%20%20fixed%20points%3A%20**L%C3%A9vy%20stable%20distributions**.%0A%0A%20%20%20%20%24%24%5Cvarphi_%5Calpha(k)%20%3D%20e%5E%7B-%7Ck%7C%5E%5Calpha%7D%24%24%0A%0A%20%20%20%20-%20%24%5Calpha%20%3D%202%24%3A%20Gaussian%20(finite%20variance)%0A%20%20%20%20-%20%24%5Calpha%20%3D%201%24%3A%20Cauchy%20(infinite%20variance)%0A%20%20%20%20-%20%240%20%3C%20%5Calpha%20%3C%202%24%3A%20L%C3%A9vy%20stable%20(heavy%20tails)%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Plot%2C%20Symbol)%3A%0A%20%20%20%20%23%20Compare%20different%20fixed%20points%0A%20%20%20%20k_levy%20%3D%20Symbol('k'%2C%20real%3DTrue)%0A%0A%20%20%20%20%23%20Different%20stability%20indices%0A%20%20%20%20phi_gauss_2%20%3D%20Exp(-k_levy**2)%20%20%20%20%20%20%20%23%20alpha%20%3D%202%20(Gaussian)%0A%20%20%20%20phi_levy_15%20%3D%20Exp(-abs(k_levy)**1.5)%20%20%23%20alpha%20%3D%201.5%0A%20%20%20%20phi_cauchy%20%3D%20Exp(-abs(k_levy))%20%20%20%20%20%20%20%23%20alpha%20%3D%201%20(Cauchy)%0A%0A%20%20%20%20Plot(%0A%20%20%20%20%20%20%20%20%5Bphi_gauss_2%2C%20phi_levy_15%2C%20phi_cauchy%5D%2C%0A%20%20%20%20%20%20%20%20(k_levy%2C%20-3%2C%203)%2C%0A%20%20%20%20%20%20%20%20PlotLabel%3D%22L%C3%A9vy%20Stable%20Fixed%20Points%22%2C%0A%20%20%20%20%20%20%20%20AxesLabel%3D%5B%22k%22%2C%20%22%CF%86(k)%22%5D%2C%0A%20%20%20%20%20%20%20%20PlotLegends%3D%5B%22%CE%B1%3D2%20(Gaussian)%22%2C%20%22%CE%B1%3D1.5%22%2C%20%22%CE%B1%3D1%20(Cauchy)%22%5D%2C%0A%20%20%20%20%20%20%20%20GridLines%3DTrue%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%2011.%20Probability%20Distributions%0A%0A%20%20%20%20We%20can%20use%20symderive's%20probability%20module%20to%20verify%20properties%20of%20the%20Gaussian.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Integrate%2C%20Pi%2C%20Simplify%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Verify%20Gaussian%20properties%20symbolically%0A%20%20%20%20_x%20%3D%20Symbol('x'%2C%20real%3DTrue)%0A%20%20%20%20_mu%20%3D%20Symbol('mu'%2C%20real%3DTrue)%0A%20%20%20%20_sigma%20%3D%20Symbol('sigma'%2C%20positive%3DTrue)%0A%0A%20%20%20%20%23%20General%20Gaussian%20PDF%0A%20%20%20%20gauss_pdf%20%3D%201%2F(_sigma%20*%20Sqrt(2*Pi))%20*%20Exp(-(_x%20-%20_mu)**2%20%2F%20(2*_sigma**2))%0A%0A%20%20%20%20%23%20Verify%20normalization%3A%20integral%20over%20all%20x%20%3D%201%0A%20%20%20%20%23%20(For%20unit%20Gaussian)%0A%20%20%20%20unit_gauss%20%3D%201%2FSqrt(2*Pi)%20*%20Exp(-_x**2%20%2F%202)%0A%20%20%20%20normalization%20%3D%20Simplify(Integrate(unit_gauss%2C%20(_x%2C%20-float('inf')%2C%20float('inf'))))%0A%0A%20%20%20%20%23%20Verify%20variance%3A%20E%5Bx%5E2%5D%20for%20centered%20Gaussian%0A%20%20%20%20variance_integral%20%3D%20Simplify(Integrate(_x**2%20*%20unit_gauss%2C%20(_x%2C%20-float('inf')%2C%20float('inf'))))%0A%0A%20%20%20%20%7B%22pdf%22%3A%20gauss_pdf%2C%20%22normalization%22%3A%20normalization%2C%20%22variance%22%3A%20variance_integral%7D%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Exp%2C%20Pi%2C%20Plot%2C%20Sqrt%2C%20Symbol)%3A%0A%20%20%20%20%23%20Plot%20the%20Gaussian%20fixed%20point%20density%0A%20%20%20%20x_plot%20%3D%20Symbol('x'%2C%20real%3DTrue)%0A%20%20%20%20gaussian_density%20%3D%201%2FSqrt(2*Pi)%20*%20Exp(-x_plot**2%20%2F%202)%0A%0A%20%20%20%20Plot(%0A%20%20%20%20%20%20%20%20gaussian_density%2C%0A%20%20%20%20%20%20%20%20(x_plot%2C%20-4%2C%204)%2C%0A%20%20%20%20%20%20%20%20PlotLabel%3D%22The%20Gaussian%3A%20Universal%20RG%20Fixed%20Point%22%2C%0A%20%20%20%20%20%20%20%20AxesLabel%3D%5B%22x%22%2C%20%22p(x)%22%5D%2C%0A%20%20%20%20%20%20%20%20PlotStyle%3D%22Blue%22%2C%0A%20%20%20%20%20%20%20%20GridLines%3DTrue%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%2012.%20Generating%20Functions%20and%20Cumulants%0A%0A%20%20%20%20The%20**moment%20generating%20function**%20%24M(t)%20%3D%20%5Cmathbb%7BE%7D%5Be%5E%7BtX%7D%5D%24%20and%0A%20%20%20%20**cumulant%20generating%20function**%20%24K(t)%20%3D%20%5Clog%20M(t)%24%20are%20related%20to%0A%20%20%20%20the%20characteristic%20function%20by%20%24%5Cvarphi(k)%20%3D%20M(ik)%24.%0A%0A%20%20%20%20Cumulants%20are%20generated%20by%3A%0A%20%20%20%20%24%24%5Ckappa_n%20%3D%20%5Cfrac%7Bd%5En%20K%7D%7Bdt%5En%7D%5Cbigg%7C_%7Bt%3D0%7D%24%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(D%2C%20Exp%2C%20Log%2C%20Simplify%2C%20Symbol)%3A%0A%20%20%20%20%23%20Cumulant%20generating%20function%20for%20Gaussian%0A%20%20%20%20t_cgf%20%3D%20Symbol('t'%2C%20real%3DTrue)%0A%20%20%20%20mu_cgf%20%3D%20Symbol('mu'%2C%20real%3DTrue)%0A%20%20%20%20sigma_cgf%20%3D%20Symbol('sigma'%2C%20positive%3DTrue)%0A%0A%20%20%20%20%23%20MGF%20of%20N(mu%2C%20sigma%5E2)%0A%20%20%20%20M_gauss%20%3D%20Exp(mu_cgf%20*%20t_cgf%20%2B%20sigma_cgf**2%20*%20t_cgf**2%20%2F%202)%0A%0A%20%20%20%20%23%20Cumulant%20generating%20function%0A%20%20%20%20K_gauss%20%3D%20Log(M_gauss)%0A%20%20%20%20K_gauss_simplified%20%3D%20Simplify(K_gauss)%0A%0A%20%20%20%20%23%20Extract%20cumulants%20by%20differentiation%0A%20%20%20%20kappa1%20%3D%20Simplify(D(K_gauss%2C%20t_cgf).subs(t_cgf%2C%200))%20%20%23%20Mean%0A%20%20%20%20kappa2%20%3D%20Simplify(D(K_gauss%2C%20(t_cgf%2C%202)).subs(t_cgf%2C%200))%20%20%23%20Variance%0A%20%20%20%20kappa3_cgf%20%3D%20Simplify(D(K_gauss%2C%20(t_cgf%2C%203)).subs(t_cgf%2C%200))%20%20%23%20Skewness%20(should%20be%200)%0A%20%20%20%20kappa4_cgf%20%3D%20Simplify(D(K_gauss%2C%20(t_cgf%2C%204)).subs(t_cgf%2C%200))%20%20%23%20Kurtosis%20(should%20be%200)%0A%0A%20%20%20%20(K_gauss_simplified%2C%20kappa1%2C%20kappa2%2C%20kappa3_cgf%2C%20kappa4_cgf)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20For%20the%20Gaussian%2C%20only%20%24%5Ckappa_1%20%3D%20%5Cmu%24%20and%20%24%5Ckappa_2%20%3D%20%5Csigma%5E2%24%20are%20non-zero.%0A%20%20%20%20All%20higher%20cumulants%20vanish%E2%80%94this%20is%20what%20makes%20it%20the%20RG%20fixed%20point!%0A%0A%20%20%20%20%23%23%20Summary%0A%0A%20%20%20%20We%20demonstrated%20symderive's%20capabilities%20through%20RG%20analysis%3A%0A%0A%20%20%20%20%7C%20Feature%20%7C%20Usage%20%7C%0A%20%20%20%20%7C---------%7C-------%7C%0A%20%20%20%20%7C%20**FourierTransform**%20%7C%20Characteristic%20function%20%3D%20FT%20of%20density%20%7C%0A%20%20%20%20%7C%20**Series**%20%7C%20Taylor%20expansion%20of%20characteristic%20functions%20%7C%0A%20%20%20%20%7C%20**DSolve**%20%7C%20Solved%20RG%20flow%20ODE%20%24d%5Ckappa_n%2Fd%5Cell%20%3D%20%5CDelta_n%20%5Ckappa_n%24%20%7C%0A%20%20%20%20%7C%20**Eigenvalues**%20%7C%20Stability%20analysis%20of%20fixed%20point%20%7C%0A%20%20%20%20%7C%20**Nest%2FNestList**%20%7C%20Iterated%20RG%20transformations%20symbolically%20%7C%0A%20%20%20%20%7C%20**FixedPoint%2FFixedPointList**%20%7C%20Numerical%20convergence%20to%20Gaussian%20%7C%0A%20%20%20%20%7C%20**Plot%2FListLinePlot**%20%7C%20Visualized%20flows%20and%20fixed%20points%20%7C%0A%20%20%20%20%7C%20**Simplify%2FExpand**%20%7C%20Algebraic%20simplification%20%7C%0A%20%20%20%20%7C%20**D**%20%7C%20Derivatives%20for%20cumulant%20extraction%20%7C%0A%20%20%20%20%7C%20**Integrate**%20%7C%20Normalization%20and%20moment%20integrals%20%7C%0A%0A%20%20%20%20**Key%20Result**%3A%20The%20Central%20Limit%20Theorem%20is%20an%20RG%20fixed%20point%20theorem.%0A%20%20%20%20The%20Gaussian%20is%20the%20unique%20stable%20attractor%20in%20the%20space%20of%0A%20%20%20%20finite-variance%20probability%20distributions.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
b2b12a15651d687dab8cc756b8d3bbdf