Second condition, hidden layers
ProvedLeCun1988.lagrangian_deriv_XFor , if has -derivative at , then ; its vanishing is the backward recursion.
import Definitions.Def_LeCun1988_Defs import Mathlib
namespace LeCun1988
theorem lagrangian_deriv_X {E Θ : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup Θ] [NormedSpace ℝ Θ]
{C : E → ℝ} {F : ℕ → E → Θ → E} {N : ℕ} {X : ℕ → E}
{W : ℕ → Θ} {B : ℕ → E →L[ℝ] ℝ} {j : ℕ} (hj1 : 1 ≤ j) (hjN : j < N) {DXj : E →L[ℝ] E}
(hDX : HasFDerivAt (fun x => F j x (W j)) DXj (X j)) :
HasFDerivAt (fun x => lagrangian C F N (Function.update X j x) W B)
(B j - (B (j + 1)).comp DXj) (X j) := by sorry
end LeCun1988Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
For 1 ≤ j < N, if x ↦ F j x (W j) has derivative DXj at X j, then x ↦ L(X with entry j replaced by x, W, B) has derivative B j - B(j+1) ∘ DXj at X j. (X j enters term m = j-1 as B j (X j - ...) and term m = j as -B(j+1)(F j (X j)(W j)); it does not enter C(X N) since j < N.) Setting this to zero gives LeCun's backward recursion B(j) = B(j+1)ᵀ ∂F/∂X evaluated at X(j).
Auditor concerns: none. j = 0 is correctly excluded (X(0) is the fixed input and also would lose the B j term); j = N is handled separately by lagrangian_deriv_XN. The derivative is taken at the arbitrary X j (not necessarily the forward pass), which is the correct general Lagrangian partial derivative.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.