English
Define the nearest point function by composing e with nearestPtInd: nearestPt e N x = e(nearestPtInd e N x).
Русский
Определим ближайшую точку как composition: ближайшая точка x — это e(nearestPtInd e N x).
LaTeX
$$nearestPt e N = (nearestPtInd e N).map e$$
Lean4
/-- `nearestPt e N x` is the nearest point to `x` among the points `e 0`, ..., `e N`. If more than
one point are at the same distance from `x`, then `nearestPt e N x` returns the point with the
least possible index. -/
noncomputable def nearestPt (e : ℕ → α) (N : ℕ) : α →ₛ α :=
(nearestPtInd e N).map e