Free Energy Principle II: expected free energy, Markov blankets, Gaussian variational free energy, and Bayesian model reductionResearch Paper
Free Energy Principle II: expected free energy, Markov blankets, Gaussian variational free energy, and Bayesian model reduction
Motivation
Mission Free Energy Principle I published the core variational step of the free energy principle (FEP): whatever recognition density a system carries, the posterior-form variational free energy never undercuts the data's surprisal, the bound is exact at the Bayesian posterior, and equality characterizes the posterior. That mission's shared finite substrate — normalized finite laws, finite kernels, entropy/cross-entropy/KL, and the finite generative model — now exists as platform definitions in the namespace FreeEnergyPrinciple.
The Free Energy Principle II mission formalizes the four structures the FEP literature builds on top of that core, all already machine-checked in the source repository fep_lean / fep_formal (Active Inference Institute):
- Expected free energy — the policy-selection functional of active inference: what a course of action is expected to cost in preference divergence and what it is expected to reveal. Its canonical decomposition [Friston et al. 2017] splits into risk (pragmatic divergence of predicted outcomes from preferences) plus ambiguity (expected entropy of outcomes given latent states), with epistemic value fixing the sign.
- Markov blankets — the partition that makes a self-organizing system statable: internal states are conditionally independent of external states given the sensory-active blanket. The source development proves this at the level of Mathlib's native conditional distributions, not as a finite mutual-information proxy.
- Gaussian variational free energy — the closed-form instantiation of the FEP-I bound for the exact scalar Gaussian filter, where the native Gaussian KL is exactly the squared mean error over twice the posterior variance.
- Bayesian model reduction — model comparison by Bayes factors: posterior odds equal prior odds times the likelihood ratio, the multiplicative update applied whenever a reduced model is compared against the model it was reduced from [Friston & Penny 2011].
Timeline of the mathematical content this mission formalizes:
- 2006/2010 — Friston's free energy principle: variational free energy as the quantity a self-organizing system minimizes (formalized in FEP-I).
- 2011 — Friston & Penny, Post hoc Bayesian model selection: Bayesian model reduction — evidence of reduced models evaluated by the free-energy difference; comparison by Bayes factors.
- 2015 — Friston, Rigoli, Sengupta, Pezzulo — the Markov-blanket partition (sensory/active states) as the geometry of the FEP.
- 2017 — Friston, FitzGerald, Rigoli, Schwartenbeck, Pezzulo, Active inference: a process theory: expected free energy drives policy selection.
- 2022 — Parr, Pezzulo, Friston, Active Inference (MIT Press): Gaussian treatments of filtering and the posterior-form free energy as the working equations.
- 2026 —
fep_formal(Active Inference Institute): a machine-checked Lean 4 catalogue of 155 FEP topics compiled with zero proof holes against a pinned Mathlib. This mission transcribes the proved modules behind expected free energy, native Markov blankets, the scalar Gaussian filter/VFE, and Bayesian model reduction onto the platform.
Setting
Two carriers, both fully machine-checked in the source repository:
- Finite (reusing FEP-I's published substrate). Laws are normalized real mass functions on finite types; kernels are normalized rows. This mission's expected-free-energy, model-reduction, and Markov-blanket families import the published
Definitions.Def_fep_finite_laws,Def_fep_finite_information, andDef_fep_generative_model— no substrate is re-published. Zero-mass atoms are handled by the same totalized conventions as FEP-I: entropy usesReal.negMulLog(so exactly), KL is the nonnegativeklFunintegrand, and division premises are explicit. - Native Gaussian (self-contained on Mathlib). The Gaussian family is Mathlib's own
gaussianReal/gaussianPDFat a fixed strictly positive variance; the scalar OU prediction and the closed filter update give the posterior mean/variance the recognition family varies over. The native KL between two family members is exactly — proved against Mathlib's log-likelihood-ratio definition.
The four definition items of this mission package exactly these carriers:
Def_fep2_expected_free_energy— the predicted state-outcome joint, preference risk, likelihood ambiguity, epistemic value, pragmatic cost, expected free energy (epistemic sign fixed by definition), the full-support contract, and the marginal/product/conditional-entropy/mutual-information lemmas the decomposition needs. Imports FEP-I.Def_fep2_gaussian_vfe— fixed-variance Gaussian family with its exact KL, scalar OU parameters, the exact scalar Gaussian filter (prediction, observation kernel, gain, closed posterior, evidence law), evidence surprisal, and the posterior-form Gaussian variational free energy. Self-contained.Def_fep2_bayesian_model_reduction— posterior odds, Bayes factor, and the model-odds update , with totalized division boundaries kept explicit. Imports FEP-I.Def_fep2_native_blanket— the static blanket factorization, the Dirac-mass embedding of finite laws into native measures, blanket/internal/external coordinates, the conditional-pair kernel, and the marginal/composition identifications the independence proof needs. Imports FEP-I.
Formalization targets
Goal: expected free energy decomposes into risk plus ambiguity
For every finite generative model, every policy , and every model with full support:
The epistemic-value sign is fixed by definition ( pragmatic cost epistemic value); the decomposition follows from two entropy identities: epistemic value is predicted outcome entropy minus ambiguity, and risk is cross-entropy minus the same entropy (Gibbs' inequality under full reference support). Nonnegativity of follows as a corollary — but the decomposition, not the bound, is the target.
Gaussian variational free energy in closed form
For the exact scalar Gaussian filter, the posterior-form variational free energy at recognition mean is
the exact fixed-variance Gaussian KL (the recognition-to-posterior gap) plus the density-relative evidence surprisal. Equality with the surprisal holds exactly at the posterior mean — the Gaussian analogue of FEP-I's exactness theorem.
Odds recursion of Bayesian model reduction
Bayes' rule in odds form: at positive evidence,
with the reference prior mass and reference likelihood as exact division premises. The multiplicative Bayes-factor structure (topic fep-120: factorized evidence ratios multiply; sequential model-odds updates agree with one update by product evidence) is available from the same definition layer as a further target.
Native Markov blanket conditional independence
The embedded static blanket factorization satisfies Mathlib's native CondIndepFun predicate: internal coordinates are conditionally independent of external coordinates given the blanket coordinate. The result is obtained by identifying the authored finite conditional kernels with Mathlib conditional distributions (the embedding preserves marginals and joints exactly on discrete carriers) — not by a finite mutual-information argument.
Significance
These four results are the load-bearing extensions of FEP-I's bound: expected free energy converts the variational principle into a theory of action selection; Markov blankets make "internal states" and "external states" well-defined relative to a blanket, which is what lets the FEP talk about self-organizing systems at all; the Gaussian filter is the tractable regime in which the variational machinery becomes the Kalman update; and Bayesian model reduction is the learning/comparison step that updates structure, not just parameters.
Formalizing them. All four families are proved with zero proof holes in the source repository, against a pinned Mathlib; the definition layer here is faithful (same carriers, same totalized conventions, same support contracts made explicit) and every item below compiles locally against the platform environment. The mission's value is reusable community infrastructure: the definition items publish the EFE layer, the Gaussian filter, the odds layer, and the native-blanket embedding in the shared namespace FreeEnergyPrinciple, so later missions (policy trees, collective inference, predictive coding) can import them instead of re-deriving. Status honesty: all eight items below are formalized and machine-checked locally against the platform environment; each is an open problem on the platform only in the sense that no proof has yet been submitted to it.
Difficulty
- The EFE decomposition looks like an algebraic rearrangement but the sign conventions are load-bearing: the epistemic value enters with a minus sign, and the two helper identities (epistemic value = outcome entropy ambiguity; risk = cross-entropy outcome entropy) both hold only under the full-support contract, which the definition makes explicit rather than hiding in a carrier.
- The Gaussian identity requires the exact native KL between Gaussian laws — the proof goes through Mathlib's log-likelihood-ratio definition and the Gaussian first moment — and the closed-form update's positivity (positive prediction variance, positive innovation variance) is what makes the recognition family genuine rather than degenerate.
- The odds recursion is a field-simp identity, but the premises are the point: a plausible rendering that hides division by zero behind totalized division changes the statement.
- The blanket theorem is the most intricate item: it must transport a finite factorization through the Dirac-mass embedding into Mathlib's conditional-distribution machinery, with nonemptiness premises for the conditional distributions to exist. A "proof" via finite mutual information would prove something weaker than the source.
Formalization scope
Committed conventions of this mission's Lean development:
- The expected-free-energy and model-reduction families reuse the published
Free Energy Principle Ifinite substrate (namespaceFreeEnergyPrinciple, definitionsDef_fep_finite_laws,Def_fep_finite_information,Def_fep_generative_model); this mission adds definition itemsDef_fep2_expected_free_energy,Def_fep2_gaussian_vfe,Def_fep2_bayesian_model_reduction, andDef_fep2_native_blanket, all in the same namespace. - The Gaussian family is deliberately native: Mathlib
gaussianReal/gaussianPDF, no finite substrate, no manifold geometry, no singular (zero-variance) branch. - Totalized real division boundaries (zero evidence, zero reference mass) are stated, never silently absorbed.
- The natural-gradient / dynamic-flow layer of the source's Gaussian module (natural gradient flow, strict descent away from the posterior) is deliberately left out of this mission and is a natural extension target; likewise the row-wise dynamical blanket theorem (every authored factorized transition row preserves the native blanket conditional independence), which follows directly from the static theorem via the source's
nextStaticModelconstruction. - Contributions welcome: the epistemic/pragmatic ENNReal balance (catalogue topic fep-021) onto this substrate, the treewise EFE decomposition (fep-133), Bayes-factor multiplicativity (fep-120), and blanket nonvacuity witnesses.
Selected references
- K. Friston, A free energy principle for the brain, Journal of Physiology (Paris) 100 (2006) 70–87. https://doi.org/10.1016/j.jphysparis.2006.10.001
- K. Friston, The free-energy principle: a unified brain theory?, Nature Reviews Neuroscience 11 (2010) 127–138. https://doi.org/10.1038/nrn2787
- K. Friston & W. Penny, Post hoc Bayesian model selection, NeuroImage 56 (2011) 2089–2099. https://doi.org/10.1016/j.neuroimage.2011.03.062
- K. Friston, T. FitzGerald, F. Rigoli, P. Schwartenbeck, G. Pezzulo, Active inference: a process theory, Neural Computation 29 (2017) 1–49. https://doi.org/10.1162/neco_a_00912
- T. Parr, G. Pezzulo, K. J. Friston, Active Inference: The Free Energy Principle in Mind, Brain, and Behavior, MIT Press (2022). https://mitpress.mit.edu/9780262045354/active-inference/
- D. A. Friedman, fep_formal: Towards Lean 4 Formalization of the Free Energy Principle (v1.2.0), Active Inference Institute (2026), the formal source of truth for this mission. https://github.com/ActiveInferenceInstitute/fep_formal
- D. A. Friedman, Towards Lean 4 Formalization of the Free Energy Principle: AI-Driven Theorem Sketching and Verification for Active Inference and Bayesian Mechanics, Active Inference Journal (2026). https://doi.org/10.5281/zenodo.19699233