TorchLean API

NN.MLTheory.Proofs.Hopfield.Convergence

Hopfield cyclic-sweep convergence (finite-state argument) #

This file uses the tie-handling progress lemma from Progress.lean to prove the classical finite-state global dynamics facts for cyclic sweeps:

The statements are at the “sweep level” (one full pass over coordinates), written with Mathlib's iterate notation (cycleUpdate p)^[k]. Connecting this to seqStates with cyclicUseq is routine and can be layered on top.

theorem NN.MLTheory.Proofs.Hopfield.cycleUpdate_no_nontrivial_cycles {n : ℕ} (p : Spec.Hopfield.Params ℝ n) (hsym : SymmetricW p) (hdiag : DiagonalZero p) {k : ℕ} (hk : 0 < k) (s : Spec.Hopfield.State n) (hcyc : (cycleUpdate p)^[k] s = s) :

With symmetric weights and zero diagonal, a periodic orbit of the sweep is a fixed point.

This is the heart of the Hopfield convergence argument: energy never increases along a sweep, so on a cycle it must be constant, and then the active-unit count would have to strictly increase around the cycle and return to its starting value, which is impossible.

A fixed point is reached within Fintype.card (State n) sweeps.

Finitely many states plus no nontrivial cycles gives termination; the bound is the crude pigeonhole one, not a claim about how fast the network actually settles.

The same bound written as 2 ^ n, since a state is one bit per unit.