Hopfield energy: single-step dynamics (spec layer) #
This file proves the key “global dynamics” lemma from the Hopfield literature:
Under symmetric, zero-diagonal weights, the Hopfield energy is non-increasing under an asynchronous update.
We work over ℝ, where the classical energy argument is algebraic. The executable Hopfield
implementation uses ExecFloat.Binary 8 23; floating-point executions are connected to this theorem
only
through explicit runtime/rounding bridge statements, not by silently reusing real arithmetic laws.
Symmetry condition on Hopfield weights: W i j = W j i.
Instances For
Zero-diagonal condition on Hopfield weights: W i i = 0.
Instances For
Bipolar activation vector of a state, ±1 per unit.
Instances For
The index set of all units, named so the sums below read like the paper.
Instances For
Net input at u, written as a function of the activation vector rather than the Boolean state.
The energy computations are all linear algebra over ℝ, so working with x instead of s keeps
Function.update and Finset.sum lemmas applicable throughout.
Instances For
The quadratic form ∑ᵢⱼ Wᵢⱼ xᵢ xⱼ.
Instances For
Energy as a function of the activation vector: -½ xᵀWx + θᵀx.
Instances For
The state-level energy and the vector-level one agree.
Likewise for the net input.
An update of the state becomes a Function.update of the activation vector.
Changing coordinate u shifts the net input at u only through the self-weight W u u, which
the zero-diagonal hypothesis later kills.
Contribution of a single row i ≠ u to the change in the quadratic form.
Change in the quadratic form under a single-unit update: 2 (x'ᵤ - xᵤ) · netᵤ.
Symmetry is what merges the row and column contributions into a single factor of two, and the zero diagonal is what removes the term where the unit acts on itself. Without either hypothesis the energy can increase and the network need not converge.
A single asynchronous update never increases the energy.
Exact energy change of one update: -(x'ᵤ - xᵤ)(netᵤ - θᵤ).
The sign is forced: the update sets x'ᵤ to agree with the sign of netᵤ - θᵤ, so the product is
nonnegative and the energy change is nonpositive. Everything else in this file is a corollary.
Exactly at the threshold the energy does not move, which is the flat case the active-unit counter has to handle.
Away from the threshold, a state change strictly lowers the energy.