[guided]The goal of this step is to prove that $\Gamma(M,E)$ is finitely generated projective using only compactness and local triviality. Compactness is used exactly once: it lets us replace an arbitrary trivializing cover by a finite one. Choose a finite open cover $(U_a)_{a=1}^N$ such that $E|_{U_a}$ has smooth frame sections $e_{a,1},\dots,e_{a,r}:U_a \to E|_{U_a}$. By the [smooth partition of unity](/page/Partition%20of%20Unity) theorem, choose a smooth partition of unity $(\rho_a)_{a=1}^N$ subordinate to this cover, so each $\rho_a:M\to \mathbb{R}$ is smooth, $\operatorname{supp}\rho_a\subset U_a$, and
\begin{align*}
\sum_{a=1}^N \rho_a(x)=1
\end{align*}
for every $x\in M$.
We now turn local frames into global generators. For every pair $(a,i)$, define the map $s_{a,i}:M \to E$ by setting $s_{a,i}(x)=\rho_a(x)e_{a,i}(x)$ for $x\in U_a$ and $s_{a,i}(x)=0$ for $x\notin \operatorname{supp}\rho_a$. This is smooth because $\rho_a$ vanishes on a neighbourhood of $M\setminus U_a$, so the formula does not create a boundary discontinuity at the edge of the coordinate patch.
Define
\begin{align*}
T:(C^\infty(M))^{Nr} &\to \Gamma(M,E)
\end{align*}
by
\begin{align*}
T\big((f_{a,i})\big)
=
\sum_{a=1}^N\sum_{i=1}^r f_{a,i}s_{a,i}.
\end{align*}
This map is $C^\infty(M)$-linear because multiplication of sections by smooth functions is pointwise multiplication in the fibres.
We verify surjectivity. Let $s\in \Gamma(M,E)$. On $U_a$, the frame gives unique smooth coefficient functions
\begin{align*}
s_{a,i}^{\mathrm{loc}}:U_a &\to \mathbb{R}
\end{align*}
such that
\begin{align*}
s(x)=\sum_{i=1}^r s_{a,i}^{\mathrm{loc}}(x)e_{a,i}(x)
\end{align*}
for $x\in U_a$. Using the cutoffs already chosen with $\operatorname{supp}\theta_a\subset U_a$, extend $\theta_a s_{a,i}^{\mathrm{loc}}$ by $0$ outside $U_a$ to obtain a global smooth function $f_{a,i}:M\to \mathbb{R}$. Then, pointwise on $M$,
\begin{align*}
T((f_{a,i}))
=
\sum_{a=1}^N\sum_{i=1}^r f_{a,i}\rho_a e_{a,i}
=
\sum_{a=1}^N \rho_a s
=
s.
\end{align*}
Thus the finitely many sections $s_{a,i}$ generate $\Gamma(M,E)$.
Projectivity requires more than finite generation: we must split this surjection from a free module. Define a smooth bundle map
\begin{align*}
A:E &\to M\times \mathbb{R}^{Nr}
\end{align*}
by taking, in each local frame over $U_a$, the coordinate vector of $v\in E_x$ and multiplying it by $\theta_a(x)$, with the resulting component extended by $0$ outside $U_a$. Define
\begin{align*}
B:M\times \mathbb{R}^{Nr} &\to E
\end{align*}
by sending the standard coordinate vector in the $(a,i)$ slot to $s_{a,i}(x)\in E_x$. Then for every $v\in E_x$,
\begin{align*}
(B\circ A)(v)
=
\sum_{a=1}^N \rho_a(x)\theta_a(x)v
=
\sum_{a=1}^N \rho_a(x)v
=
v,
\end{align*}
because $\theta_a=1$ on $\operatorname{supp}\rho_a$ and the partition of unity sums to $1$. Therefore $B\circ A=\operatorname{id}_E$, and after taking global sections, $\Gamma(M,E)$ is a direct summand of the free module $(C^\infty(M))^{Nr}$. Hence $\Gamma(M,E)$ is projective.[/guided]