Proposition (2.4) — a nonzero gradient of d_E points away from the unique closest point
ProvedClarkeGradients.FlowInvariance.gradient_infDist_of_ne_zeroLet be a nonempty closed subset of and its distance function. Suppose that is differentiable at and that . Then
- belongs to the complement of ;
- there exists a unique point closest to , i.e. with ;
- for that point,
This is the local description of at its points of differentiability off , and it is what Corollary (2.5) and the proof of Theorem (4.4) use to compute generalized gradients of .
Formalization Note is Metric.infDist · E; " is closest to " is e ∈ E ∧ dist x e = infDist x E. Part (2) is stated with ∃!, and part (3) is stated for every closest point (equivalently, by (2), the unique one). The formula is written ; the division is well defined because by (1). The paper proves (2)–(3) by applying Theorem (2.1) (mission I's goal); mission I is a separate draft, so that theorem is not a hypothesis here.
import Mathlib
namespace ClarkeGradients.FlowInvariance
/-- Clarke (1975), Proposition (2.4): let `E ⊆ ℝⁿ` be nonempty and closed and
`d_E(y) = Metric.infDist y E`. If `∇d_E(x)` exists and is different from `0`, then
(1) `x ∉ E`; (2) there is a unique point `e ∈ E` closest to `x`; and
(3) `∇d_E(x) = (x - e)/|x - e|` for that point `e`. -/
theorem gradient_infDist_of_ne_zero {n : ℕ} (E : Set (EuclideanSpace ℝ (Fin n)))
(hE : E.Nonempty) (hEc : IsClosed E) (x : EuclideanSpace ℝ (Fin n))
(hdiff : DifferentiableAt ℝ (fun y => Metric.infDist y E) x)
(hne : gradient (fun y => Metric.infDist y E) x ≠ 0) :
x ∉ E ∧
(∃! e : EuclideanSpace ℝ (Fin n), e ∈ E ∧ dist x e = Metric.infDist x E) ∧
∀ e ∈ E, dist x e = Metric.infDist x E →
gradient (fun y => Metric.infDist y E) x = ‖x - e‖⁻¹ • (x - e) := by sorry
end ClarkeGradients.FlowInvariance
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The theorem takes:
- ;
- a set that is nonempty and closed;
- a point .
Let be the Euclidean distance to . There are two further hypotheses:
- is (Fréchet) differentiable at ;
- its gradient (the vector representing the derivative through the inner product) is not the zero vector.
The theorem then asserts three things:
- .
- There is exactly one with .
- For every with ,
(By item 1, , so the denominator is nonzero.)
Degenerate case: when , every gradient is the zero vector, so the hypothesis can never hold and the theorem is vacuous.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.