# Direct sums > *Definition 1*: in a metric space $(X,d)$, the **distance** $\delta$ from an element $x \in X$ to a nonempty subset $M \subset X$ is defined as > > $$ > \delta = \inf_{\tilde y \in M} d(x,\tilde y). > $$ In a normed space $(X, \|\cdot\|)$ this becomes $$ \delta = \inf_{\tilde y \in M} \|x - \tilde y\|. $$ > *Definition 2*: let $X$ be a vector space and let $x, y \in X$, the **line segment** $l$ between the vectors $x$ and $y$ is defined as > > $$ > l = \{z \in X \;|\; \exists \alpha \in [0,1]: z = \alpha x + (1 - \alpha) y\}. > $$ Using definition 2, we may define the following. > *Definition 3*: a subset $M \subset X$ of a vector space $X$ is **convex** if for all $x, y \in M$ the line segment between $x$ and $y$ is contained in $M$. This definition is true for projections of convex lenses which have been discussed in [optics](). We can now provide the main theorem in this section. > *Theorem 1*: let $X$ be an inner product space and let $M \subset X$ be a complete convex subset of $X$. Then for every $x \in X$ there exists a unique $y \in M$ such that > > $$ > \delta = \inf_{\tilde y \in M} \|x - \tilde y\| = \|x - y\|, > $$ > > if $M$ is a complete subspace $Y$ of $X$, then $x - y$ is orthogonal to $X$. ??? note "*Proof*:" Will be added later. Now that the foundation is set, we may introduce direct sums. > *Definition 4*: a vector space $X$ is a **direct sum** $X = Y \oplus Z$ of two subspaces $Y \subset X$ and $Z \subset X$ of $X$ if each $x \in X$ has a unique representation > > $$ > x = y + z, > $$ > > for $y \in Y$ and $z \in Z$. Then $Z$ is called an *algebraic complement* of $Y$ in $X$ and vice versa, and $Y$, $Z$ is called a *complementary pair* of subspaces in $X$. In the case $Z = \{z \in X \;|\; z \perp Y\}$ we have that $Z$ is the *orthogonal complement* or *annihilator* of $Y$. Also denoted as $Y^\perp$. > *Proposition 1*: let $Y \subset X$ be any closed subspace of a Hilbert space $X$, then > > $$ > X = Y \oplus Y^\perp, > $$ > > with $Y^\perp = \{x\in X \;|\; x \perp Y\}$ the orthogonal complement of $Y$. ??? note "*Proof*:" Will be added later. We have that $y \in Y$ for $x = y + z$ is called the *orthogonal projection* of $x$ on $Y$. Which defines an operator $P: X \to Y: x \mapsto Px \overset{\mathrm{def}}= y$. > *Lemma 1*: let $Y \subset X$ be a subset of a Hilbert space $X$ and let $P: X \to Y$ be the orthogonal projection operator, then we have > > 1. $P$ is a bounded linear operator, > 2. $\|P\| = 1$, > 3. $\mathscr{N}(P) = \{x \in X \;|\; Px = 0\}$. ??? note "*Proof*:" Will be added later. > *Lemma 2*: if $Y$ is a closed subspace of a Hilbert space $X$, then $Y = Y^{\perp \perp}$. ??? note "*Proof*:" Will be added later. Then it follows that $X = Y^\perp \oplus Y^{\perp \perp}$. ??? note "*Proof*:" Will be added later. > *Lemma 3*: for every non-empty subset $M \subset X$ of a Hilbert space $X$ we have > > $$ > \mathrm{span}(M) \text{ is dense in } X \iff M^\perp = \{0\}. > $$ ??? note "*Proof*:" Will be added later.