← All episodes Formalizing Hopfield Networks and Boltzmann Machines in Lean 4

Formalizing Hopfield Networks and Boltzmann Machines in Lean 4

Oct 25, 2026
This episode explores a Lean 4 formalization of Hopfield networks and Boltzmann machines, covering about sixteen thousand new lines on top of mathlib, which the authors say is the first for either model in any proof assistant. It walks through Hopfield energy descent and asynchronous convergence, Hebbian weights and the cross-talk term for non-orthogonal patterns, and Gibbs sampling as a random-scan Markov chain with detailed balance. It also covers the zero-temperature limit that recovers the Hopfield rule. The main finding is that formalizing convergence required every neuron to be updated infinitely often, a fairness condition the textbook theorem left implicit. The episode also points out that the Boltzmann machine formalized is fully visible, with no hidden units, so the ergodicity result covers less than the word suggests. It places the work against modern context, including the link between continuous Hopfield updates and softmax attention and dense associative memory. Listeners interested in what machine-checked proofs expose in classic results will find it useful.
Sources:
1. Formalized Hopfield Networks and Boltzmann Machines — Matteo Cipollina, Michail Karatarakis, Freek Wiedijk, 2025
http://arxiv.org/abs/2512.07766
2. A Learning Algorithm for Boltzmann Machines — David H. Ackley, Geoffrey E. Hinton, Terrence J. Sejnowski, 1985
https://scholar.google.com/scholar?q=A+Learning+Algorithm+for+Boltzmann+Machines
3. Training Products of Experts by Minimizing Contrastive Divergence — Geoffrey E. Hinton, 2002
https://scholar.google.com/scholar?q=Training+Products+of+Experts+by+Minimizing+Contrastive+Divergence
4. A Fast Learning Algorithm for Deep Belief Nets — Geoffrey E. Hinton, Simon Osindero, Yee-Whye Teh, 2006
https://scholar.google.com/scholar?q=A+Fast+Learning+Algorithm+for+Deep+Belief+Nets
5. Deep Boltzmann Machines — Ruslan Salakhutdinov, Geoffrey E. Hinton, 2009
https://scholar.google.com/scholar?q=Deep+Boltzmann+Machines
6. The PageRank Citation Ranking: Bringing Order to the Web — Lawrence Page, Sergey Brin, Rajeev Motwani, Terry Winograd, 1998
https://scholar.google.com/scholar?q=The+PageRank+Citation+Ranking%3A+Bringing+Order+to+the+Web
7. Markov Chains and Mixing Times — David A. Levin, Yuval Peres, Elizabeth L. Wilmer, 2009 (2nd ed. 2017, with Propp)
https://scholar.google.com/scholar?q=Markov+Chains+and+Mixing+Times
8. Non-negative Matrices and Markov Chains — Eugene Seneta, 1981 (2nd ed.; originally 1973)
https://scholar.google.com/scholar?q=Non-negative+Matrices+and+Markov+Chains
9. Hopfield Networks is All You Need — Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, et al. (Sepp Hochreiter's group), 2020
https://scholar.google.com/scholar?q=Hopfield+Networks+is+All+You+Need
10. Dense Associative Memory for Pattern Recognition — Dmitry Krotov, John Hopfield, 2016
https://scholar.google.com/scholar?q=Dense+Associative+Memory+for+Pattern+Recognition
11. Neural networks and physical systems with emergent collective computational abilities — John J. Hopfield, 1982
https://scholar.google.com/scholar?q=Neural+networks+and+physical+systems+with+emergent+collective+computational+abilities
12. On Contrastive Divergence Learning — Miguel Á. Carreira-Perpiñán, Geoffrey E. Hinton, 2005
https://scholar.google.com/scholar?q=On+Contrastive+Divergence+Learning
13. Stochastic Ising machines and p-bits / probabilistic computing — Kerem Y. Camsari, Brian M. Sutton, Supriyo Datta (and related work), 2017-2019
https://scholar.google.com/scholar?q=Stochastic+Ising+machines+and+p-bits+%2F+probabilistic+computing
14. Formalizing Perron–Frobenius / Perron-Frobenius Theorem for Spectral Radius Analysis — René Thiemann, Jose Divasón, et al., 2016-2019
https://scholar.google.com/scholar?q=Formalizing+Perron%E2%80%93Frobenius+%2F+Perron-Frobenius+Theorem+for+Spectral+Radius+Analysis
15. Certigrad: Practical Verification of Stochastic Computation Graphs — Daniel Selsam, Percy Liang, David Dill, 2017
https://scholar.google.com/scholar?q=Certigrad%3A+Practical+Verification+of+Stochastic+Computation+Graphs
16. Rank collapse causes over-smoothing and over-squashing / Attention is not all you need: pure attention loses rank doubly exponentially with depth — Yihe Dong, Jean-Baptiste Cordonnier, Andreas Loukas, 2021
https://scholar.google.com/scholar?q=Rank+collapse+causes+over-smoothing+and+over-squashing+%2F+Attention+is+not+all+you+need%3A+pure+attention+loses+rank+doubly+exponentially+with+depth
17. Equation of State Calculations by Fast Computing Machines / Optimization by Simulated Annealing — Metropolis et al.; Kirkpatrick, Gelatt, Vecchi, 1953 / 1983
https://scholar.google.com/scholar?q=Equation+of+State+Calculations+by+Fast+Computing+Machines+%2F+Optimization+by+Simulated+Annealing
Interactive Visualization: Formalizing Hopfield Networks and Boltzmann Machines in Lean 4