Let (X,∥⋅∥)(X,\|\cdot\|) be a , and let Ω⊆X\Omega\subseteq X be nonempty. The distance function to Ω\Omega is

dΩ(x):=inf⁡{∥x−w∥:w∈Ω}.d_\Omega(x):=\inf\{\|x-w\|: w\in \Omega\}.
Properties
  • dΩ(x)=0d_\Omega(x)=0 if and only if x∈Ω‾x\in\overline{\Omega}.
  • dΩd_\Omega is 11-Lipschitz:
    ∣dΩ(x)−dΩ(y)∣≤∥x−y∥.|d_\Omega(x)-d_\Omega(y)|\leq \|x-y\|.
  • If Ω\Omega is , then dΩd_\Omega is convex.

Conversely, if Ω\Omega is closed and dΩd_\Omega is convex, then Ω\Omega is convex.

Examples
  • If Ω={0}\Omega=\{0\}, then dΩ(x)=∥x∥d_\Omega(x)=\|x\|.
  • If Ω\Omega is the closed ball with center x0x_0 and radius rr, then
    dΩ(x)=max⁡{∥x−x0∥−r,0}.d_\Omega(x)=\max\{\|x-x_0\|-r,0\}.