[proofplan]
We combine two previously established results. By the [Embedding in a Trivial Bundle](/theorems/2278) theorem, $E$ embeds as a subbundle of $X \times \mathbb{R}^N$ for some $N$. By the [Inner Products on Vector Bundles](/theorems/2277) theorem, we can equip $X \times \mathbb{R}^N$ with a continuous family of inner products. Taking $F$ to be the fiberwise orthogonal complement of $E$ in $X \times \mathbb{R}^N$ with respect to this inner product yields the desired complement, and verifying that $F$ is a vector bundle uses the local triviality of orthogonal projection.
[/proofplan]
[step:Embed $E$ as a subbundle of a trivial bundle]
By the [Embedding in a Trivial Bundle](/theorems/2278) theorem, since $X$ is compact Hausdorff, there exists $N \in \mathbb{N}$ and an embedding of vector bundles $\iota: E \hookrightarrow X \times \mathbb{R}^N$ which is a fiberwise linear injection. For each $x \in X$, the fiber $\iota(E_x) \subseteq \{x\} \times \mathbb{R}^N$ is a $d$-dimensional linear subspace, where $d$ is the rank of $E$.
[/step]
[step:Equip $X \times \mathbb{R}^N$ with a continuous family of inner products]
By the [Inner Products on Vector Bundles](/theorems/2277) theorem, the trivial bundle $X \times \mathbb{R}^N$ admits a continuous family of inner products $\langle \cdot, \cdot \rangle_x$ on each fiber $\{x\} \times \mathbb{R}^N$. For the trivial bundle, we may simply take the standard inner product $\langle u, v \rangle_x := \sum_{i=1}^N u_i v_i$ for all $x$, which is manifestly continuous and fiberwise positive definite.
[/step]
[step:Define $F$ as the fiberwise orthogonal complement of $E$]
For each $x \in X$, define
\begin{align*}
F_x := \iota(E_x)^\perp = \{ w \in \mathbb{R}^N : \langle w, v \rangle_x = 0 \text{ for all } v \in \iota(E_x) \}.
\end{align*}
Set $F := \bigsqcup_{x \in X} F_x$ with the projection $\pi_F: F \to X$ sending $F_x$ to $x$. Since $\iota(E_x)$ is a $d$-dimensional subspace of $\mathbb{R}^N$, the orthogonal complement $F_x$ has dimension $N - d$ for every $x \in X$.
By linear algebra, we have a direct sum decomposition $\{x\} \times \mathbb{R}^N = \iota(E_x) \oplus F_x$ for each $x$, which gives a fiberwise direct sum decomposition
\begin{align*}
X \times \mathbb{R}^N = \iota(E) \oplus F.
\end{align*}
[guided]
The orthogonal complement construction is the natural choice because the inner product gives a canonical splitting of each fiber into two complementary subspaces. Without an inner product, there is no canonical way to choose a complement — there are many possible complements, and they need not vary continuously. The inner product resolves both issues: it singles out a unique complement in each fiber, and the continuity of the inner product ensures these complements vary continuously.
[/guided]
[/step]
[step:Verify that $F$ is a vector bundle]
We must show that $F$ is locally trivial. Fix $x_0 \in X$. Since $E$ is locally trivial, there exists an open neighbourhood $U$ of $x_0$ and a trivialization $\varphi: E|_U \xrightarrow{\sim} U \times \mathbb{R}^d$. Through the embedding $\iota$, this gives $d$ continuous sections $e_1, \ldots, e_d: U \to X \times \mathbb{R}^N$ that form a basis for $\iota(E_x)$ at each $x \in U$.
Apply the Gram-Schmidt process fiberwise: extend $\{e_1(x), \ldots, e_d(x)\}$ to a full orthonormal basis $\{e_1(x), \ldots, e_d(x), e_{d+1}(x), \ldots, e_N(x)\}$ of $\mathbb{R}^N$ with respect to $\langle \cdot, \cdot \rangle_x$. The Gram-Schmidt process is continuous in the input vectors and the inner product (as long as the vectors remain linearly independent, which they do on $U$). The sections $e_{d+1}, \ldots, e_N$ are continuous on $U$ and form a basis for $F_x$ at each $x \in U$.
The map
\begin{align*}
\psi: F|_U &\to U \times \mathbb{R}^{N-d} \\
w &\mapsto \bigl(\pi_F(w),\; \langle w, e_{d+1}(\pi_F(w)) \rangle,\; \ldots,\; \langle w, e_N(\pi_F(w)) \rangle\bigr)
\end{align*}
is a continuous fiberwise linear isomorphism, providing a local trivialization of $F$ over $U$. Therefore $F \to X$ is a vector bundle of rank $N - d$.
[guided]
The continuity of the Gram-Schmidt process is worth emphasizing. Given a continuously varying collection of linearly independent vectors and a continuously varying inner product, the orthonormalization process produces a continuously varying orthonormal basis. The linear independence hypothesis is satisfied because $e_1(x), \ldots, e_d(x)$ form a basis for the $d$-dimensional subspace $\iota(E_x)$ for all $x \in U$. The key algebraic fact is that Gram-Schmidt involves only addition, scalar multiplication, inner products, and division by norms — all continuous operations — and the norms are nonzero because the vectors are linearly independent.
The local trivialization $\psi$ works because $\{e_{d+1}(x), \ldots, e_N(x)\}$ is a basis for $F_x$ for each $x \in U$, and the coordinates of $w \in F_x$ with respect to this basis are the inner products $\langle w, e_j(x) \rangle$ (since the basis is orthonormal).
[/guided]
[/step]
[step:Conclude that $E \oplus F \cong X \times \mathbb{R}^N$]
Identifying $E$ with its image $\iota(E)$, the fiberwise orthogonal decomposition gives a bundle isomorphism
\begin{align*}
E \oplus F \xrightarrow{\;\sim\;} X \times \mathbb{R}^N, \quad (v, w) \mapsto v + w,
\end{align*}
where the addition takes place in each fiber $\{x\} \times \mathbb{R}^N$. This map is a continuous fiberwise linear isomorphism (bijectivity follows from the direct sum decomposition $\iota(E_x) \oplus F_x = \mathbb{R}^N$, and linearity is immediate). The bundle $F$ of rank $N - d$ is the desired stable complement.
[/step]