finite dimensional subspace of a Banach space is complemented In 'Functional Analysis'by Rudin, Lemma $4.21$

Let $M$ be a closed subspace of a topological vector space $X$.
(a) If $X$ is locally convex and $dim(M) < \infty$, then $M$ is complemented in $X$.
(b) If $dim(X/M) < \infty$, then $M$ is complemented in $X$.

(The following proof is copied from the book)
Proof: (a) Let $\{ e_1,...,e_n \}$ be a basis for $M$. Every $x \in M$ has then a unique representation
$$x = \alpha_1(x)e_1 + ...+ \alpha_n(x)e_n.$$
Each $\alpha_i$ is continuous linear functional on $M$ which extends to a member of $X^*$, by the Hahn-Banach Theorem. Let $N$ be the intersection of the null spaces of these extensions. Then $X = M \oplus N$.
(b) Let $\pi: X \rightarrow X / M$ be the quotient map, let $\{ e_1,...,e_n \}$ be a basis for $X/M$, pick $x_i \in X$ so that $\pi(x_i)=e_i$ for $1 \leq i \leq n$, and let $N$ be the vector space spanned by $\{ x_1,...,x_n \}$. Then $X=M \oplus N$.
Question:
(1) How to show that $X \subseteq M + N$ for both cases?
(2) How to show that $M \cap N = \{ 0 \}$ for (b)?
(3) Why we need $X$ to be locally convex for (a)?
 A: (1) We can extend $\alpha_i$ from $M$ to the whole of $X$ (here we need local convexity, as Hahn-Banach does not hold in the general case), let's call these extensions $x_i^* \in X^*$. Write $N := \bigcap_{i=1}^n \ker x_i^*$. We will show that $X = M + N$. Let $x \in X$, and define $m := \sum_{i=1}^n x_i^*(x)e_i \in M$. We have for $1 \le j \le n$, that
\begin{align*}
  x_j^*(m) &= \sum_{i=1}^n x_i^*(x)x_j^*(e_i)\\
           &= \sum_{i=1}^n x_i^*(x)\alpha_j(e_i)
\end{align*}
Now note, that as the $e_i$ form a basis of $M$, the coefficients in 
$$ e_i = 0\cdot e_1 + \cdots + 1 \cdot e_i + \cdots + 0 \cdot e_n \stackrel!= \sum_{j=1}^n \alpha_j(e_i)e_j $$
are unique, hence $\alpha_j(e_i) = \delta_{ij}$, so we may continue
\begin{align*}
   x_j^*(m) &= \sum_{i=1}^n x_i^*(x)\delta_{ij}\\
            &= x_j^*(x)
\end{align*}
That is $x_j^*(x-m)  =0$ for all $j$, hence $x-m \in N$, or $$ x \in m + N \subseteq M + N $$
as $x$ was arbitrary, we have $X = M+N$.
(2) We will start showing $X = M+N$, so let $x \in X$, write $$ \pi(x) = \sum_{i=1}^n \lambda_i e_i $$
for some $\lambda_i \in \mathbf K$. Define $n := \sum_{i=1}^n \lambda_i x_i$, then we have 
$$ \pi(n) = \sum_{i=1}^n \lambda_i \pi(x_i) = \sum_{i=1}^n \lambda_i e_i = \pi(x) $$
that is $\pi(x-n) = 0$ or $x-n \in M$. Hence $x \in n+M \subseteq M+N$.
To show $M \cap N = \{0\}$, let $x \in M \cap N$. As $x \in N$, we may write $x = \sum_{i=1}^n \lambda_i x_i$ for some $\lambda_i \in \mathbf K$. As $x \in M$, we have $\pi(x) = 0$. Now 
$$ 0 = \pi(x) = \sum_{i=1}^n \lambda_i \pi(x_i) = \sum_{i=1}^n \lambda_i e_i $$
As the $e_i$ are linearly independent, it follows that $\lambda_i = 0$, hence $x = \sum_i\lambda_i x_i = 0$.   
