Second-order necessary condition for a one-variable local minimum
ProvedEthierKurtz.second_deriv_nonneg_of_isLocalMinThis is the one-variable second-order necessary condition for a local minimum.
Let be everywhere differentiable, suppose its derivative is differentiable at the origin, and suppose attains a local minimum at . Then
In words, the second derivative at a interior local minimizer cannot be strictly negative: otherwise the function would lie strictly below its value at the minimizer on one side. This is the converse direction of the usual second-derivative test, and it is the analytic core used to deduce Hessian positive-semidefiniteness at minimizers of several-variable functions by restriction to lines.
Formalization Note Lean's deriv is defined to be where the function is not differentiable, so the hypothesis that deriv g is differentiable at carries real content: it forces to be differentiable near .
import Mathlib open scoped Topology
namespace EthierKurtz
theorem second_deriv_nonneg_of_isLocalMin {g : ℝ → ℝ}
(hdiff : Differentiable ℝ g)
(hg2 : DifferentiableAt ℝ (deriv g) 0)
(hmin : IsLocalMin g 0) :
0 ≤ deriv (deriv g) 0 := by sorry
end EthierKurtz