TorchLean API

NN.MLTheory.Proofs.Hopfield.Energy

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 IEEE32Exec; 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
      noncomputable def NN.MLTheory.Proofs.Hopfield.x {n : } (s : Spec.Hopfield.State n) :
      Fin n
      Instances For
        noncomputable def NN.MLTheory.Proofs.Hopfield.U {n : } :
        Instances For
          noncomputable def NN.MLTheory.Proofs.Hopfield.netx {n : } (p : Spec.Hopfield.Params n) (x : Fin n) (u : Fin n) :
          Instances For
            noncomputable def NN.MLTheory.Proofs.Hopfield.quad {n : } (p : Spec.Hopfield.Params n) (x : Fin n) :
            Instances For
              noncomputable def NN.MLTheory.Proofs.Hopfield.energyU {n : } (p : Spec.Hopfield.Params n) (x : Fin n) :
              Instances For
                theorem NN.MLTheory.Proofs.Hopfield.netx_update_eq {n : } (p : Spec.Hopfield.Params n) (x0 : Fin n) (u : Fin n) (xu' : ) :
                netx p (Function.update x0 u xu') u = netx p x0 u + p.W u u * (xu' - x0 u)
                theorem NN.MLTheory.Proofs.Hopfield.quad_inner_delta_ne {n : } (p : Spec.Hopfield.Params n) {u i : Fin n} (hi : i u) (x0 : Fin n) (xu' : ) :
                jU, p.W i j * x0 i * Function.update x0 u xu' j - jU, p.W i j * x0 i * x0 j = p.W i u * x0 i * (xu' - x0 u)
                theorem NN.MLTheory.Proofs.Hopfield.quad_delta_update {n : } (p : Spec.Hopfield.Params n) (hsym : SymmetricW p) (hdiag : DiagonalZero p) (x0 : Fin n) (u : Fin n) (xu' : ) :
                quad p (Function.update x0 u xu') - quad p x0 = 2 * (xu' - x0 u) * netx p x0 u