Euclidean projection on a set
An Euclidean projection of a point on a set
is a point that achieves the smallest Euclidean distance from
to the set. That is, it is any solution to the optimization problem

When the set is convex, there is a unique solution to the above problem. In particular, the projection on an affine subspace is unique.
Example: assume that is the hyperplane

The projection problem reads as a linearly constrained least-squares problem, of particularly simple form:

The projection of on
turns out to be aligned with the coefficient vector
. Indeed, components of
orthogonal to
don’t appear in the constraint, and only increase the objective value. Setting
in the equation defining the hyperplane and solving for the scalar
we obtain
, so that the projection is
.