Gaussian variational free energy is squared mean error plus evidence surprisal
ProvedFreeEnergyPrinciple.gaussianVariationalFreeEnergy_eq_meanSquare_add_surprisalThe Gaussian instantiation of the variational bound: for an exact scalar Gaussian filter, variational free energy is a squared mean error plus evidence surprisal.
Fix a scalar Gaussian filter model: an OU prediction step (rate , center, diffusion variance rate, step duration ), a fixed-variance Gaussian observation channel with noise variance , and a nondegenerate Gaussian prior belief . The filter predicts the Gaussian belief with , forms the innovation variance , and updates in closed form:
Both the evidence and the update denominators are strictly positive, so the recognition family — the fixed-variance Gaussian family at variance — is genuinely nondegenerate.
The posterior-form variational free energy at recognition mean is the native KL from the recognition law to the posterior law , plus the evidence surprisal taken against the evidence family's density at the predicted mean. The target identity:
The first summand is the exact closed form of the fixed-variance Gaussian KL — no approximation is involved — and the second is the density-relative surprisal of the datum under the evidence law. Equality of free energy and surprisal holds exactly at , the Gaussian analogue of FEP-I's posterior-exactness theorem; the native-KL remainder vanishing characterizes the posterior mean in the fixed-variance family.
import Mathlib.InformationTheory.KullbackLeibler.Basic import Definitions.Def_fep2_gaussian_vfe
namespace FreeEnergyPrinciple
open InformationTheory
theorem gaussianVariationalFreeEnergy_eq_meanSquare_add_surprisal
(model : ScalarGaussianFilterModel) (prior : ScalarGaussianBelief)
(observation recognitionMean : ℝ) :
gaussianVariationalFreeEnergy model prior observation recognitionMean =
(recognitionMean - posteriorMean model prior observation) ^ 2 /
(2 * (posteriorVariance model prior : ℝ)) +
evidenceSurprisal model prior observation := by sorry
end FreeEnergyPrincipleRead-back
What the Lean code literally says, in plain math · glm-flash-latest
For every scalar Gaussian filter model, every prior belief, and all real (observation) and (recognition mean) — no additional hypotheses or typeclass binders; strict positivity is carried inside the structures — the theorem asserts, as an equality in :
Unfolding the bundle's own definitions:
- The left side is converted from to by the total embedding that sends to , plus . The KL is oriented recognition-to-posterior, and both Gaussians share the variance .
- (posteriorMean) is the closed-form one-step filter update: the Ornstein–Uhlenbeck predicted mean (prior mean pulled toward the dynamics center by the factor , step duration ) plus the gain (predicted variance innovation variance) times .
- (posteriorVariance) is predicted variance observation-noise variance innovation variance (predicted plus observation-noise variance), provably ; hence and no division-by-zero junk arises.
- (evidenceSurprisal) is , where is the Gaussian density with mean the predicted (pre-observation) mean and variance the innovation variance; , so the logarithm is the ordinary real one.
The quantifiers include degenerate cases such as and arbitrary .
The proof is sorry: the statement is admitted, not proved.
AUDITOR-FLAG: proof is an admitted placeholder (sorry) — the theorem is stated but nothing is established. AUDITOR-FLAG: no finiteness hypothesis is imposed on the KL; it enters through the total embedding (finiteness holds here only because the two measures share the variance ).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.