Sigmoid-type layers with squared error (eqs. 5-9)
ProvedLeCun1988.lecun_netLayers on (componentwise, differentiable with derivative ), error . With , and , the derivative of the error in is : the gradient is , so gradient descent is update (9).
import Definitions.Def_LeCun1988_Defs import Mathlib
namespace LeCun1988
theorem lecun_net {n : ℕ} {σ σ' : ℝ → ℝ} (hσ : ∀ t, HasDerivAt σ (σ' t) t) (D x0 : Fin n → ℝ)
(W : ℕ → (Fin n → ℝ) →L[ℝ] (Fin n → ℝ)) {N k : ℕ} (hk : k < N) :
HasFDerivAt (fun V => sqerr D (forward (netF σ) x0 (Function.update W k V) N))
(-((cov (yvec σ' D (forward (netF σ) x0 W) W N k)).comp
(ContinuousLinearMap.apply ℝ (Fin n → ℝ) (forward (netF σ) x0 W k)))) (W k) := by sorry
end LeCun1988Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Concrete network: all layers have the same width n, state space Fin n → ℝ, weights are continuous linear maps (Fin n → ℝ) →L (Fin n → ℝ) (square n×n matrices, no biases), layer map netF σ _ x V = componentwise σ applied to V x, loss sqerr D x = Σ_i (D i - x i)^2. Assume σ is differentiable everywhere with derivative σ'. For k < N, with X = forward (netF σ) x0 W: the map V ↦ sqerr D (X_N computed with W k replaced by V) has Fréchet derivative at W k equal to Δ ↦ -Σ_i y_k i * (Δ (X k)) i, where y_k = yvec: y_k i = σ'((W k (X k)) i) * b(k+1) i, and b is bvec: b N = 2(D - X N), b j = W jᵀ y_j for j < N (b j at index m equals Σ_i y_j i * (W j e_m) i). As a matrix the gradient is -y_k X(k)ᵀ. This matches LeCun's eqs. with C = |D - X(N)|^2 (no 1/2, hence the factor 2). I verified by compilation that bvec N = 2(D - X N) and bvec (N+1) at N equals Σ_i yvec_i * (W N (Pi.single j 1)) i, i.e. W Nᵀ y.
Auditor concerns: (a) Specialisation: equal layer widths n and no bias terms; this is a special case of LeCun's network, faithful but narrower. (b) bvec returns the junk value 2(D - X N) for every k ≥ N, but only indices k+1 ≤ N are used, so harmless. (c) n = 0 makes it trivially true, but n is universally quantified so the general case is covered. (d) The weights' topology is the operator norm on CLMs; in finite dimensions this is the standard one. (e) σ' is a hypothesis-determined function (hσ pins it down everywhere), so the statement cannot be satisfied with a wrong derivative. No vacuity: hσ holds e.g. for σ = sigmoid (lecun_sigmoid) or σ = id.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.