Characterization of Euclidean projection
ProvedConvexOptimization.projection_iff_obtuse_angleCharacterization of the Euclidean projection onto a convex set: the error vector makes a non-acute angle with every feasible direction.
Let be convex, let and let . Then
The left side says is a nearest point of to ; the right side says the angle between the error and any direction pointing into is at least .
The criterion turns a minimization over into a family of linear inequalities, which is what makes projections computable and is the standard entry point to the theory of projection algorithms and separating hyperplanes. It is the special case of the first-order optimality criterion (4.21) for the objective .
Formalization Note The statement is an iff between two universally quantified conditions on , with no existence or uniqueness claim about the projection, so no completeness or closedness hypothesis on is needed. Norms and inner products are those of EuclideanSpace ℝ (Fin n). Source: B&V §8.1.1, p. 398, via eq. (4.21).
import Mathlib open scoped RealInnerProductSpace ENNReal open MeasureTheory
theorem ConvexOptimization.projection_iff_obtuse_angle {n : ℕ}
(C : Set (EuclideanSpace ℝ (Fin n))) (hC : Convex ℝ C)
(x₀ z : EuclideanSpace ℝ (Fin n)) (hz : z ∈ C) :
(∀ w ∈ C, ‖x₀ - z‖ ≤ ‖x₀ - w‖) ↔ ∀ w ∈ C, ⟪x₀ - z, w - z⟫ ≤ 0 := by
sorry
Read-back
What the Lean code literally says, in plain math · claude-fable-5
Theorem. Let be any natural number (implicit), a convex set, an arbitrary point, and . Then the following equivalence holds:
That is: is a nearest point of to (non-strict inequality of Euclidean distances against every point of ) if and only if the inner product of with is for every . The theorem does not assert that a nearest point exists or is unique — is given as data, and is not assumed closed or nonempty beyond containing . Degenerate cases: if both sides are trivially true (taking gives equality on the left and on the right); if both sides hold as well.
Confirmed by the mission captain (proposal self-audit).