Let $\beta=\{w_1,w_2,\ldots,w_k\}$ and $\gamma=\{x_1,x_2,\ldots,x_m\}$ be the bases for $W$ and $W^\perp$, respectively. It suffices to show that
$$\beta\cup\gamma=\{w_1,w_2,\ldots,w_k,x_1,x_2,\ldots,x_m\}$$
is a basis for $V$.
Given $v\in V$, then it is well-known that $v=v_1+v_2$ for some $v_1\in W$ and $v_2\in W^\perp$. Also because $\beta$ and $\gamma$ are bases for $W$ and $W^\perp$, respectively, there exist scalars
$a_1,a_2,\ldots,a_k,b_1,b_2,\ldots,b_m$ such that
$v_1=\displaystyle\sum_{i=1}^ka_iw_i$ and $v_2=\displaystyle\sum_{j=1}^mb_jx_j$. Therefore
$$v=v_1+v_2=\sum_{i=1}^ka_iw_i+\sum_{j=1}^mb_jx_j,$$
which follows that $\beta\cup\gamma$ generates $V$. Next, we show that
$\beta\cup\gamma$ is linearly independent. Given
$c_1,c_2,\ldots,c_k,d_1,d_2,\ldots,d_m$ such that
$\displaystyle\sum_{i=1}^kc_iw_i+\sum_{j=1}^md_jx_j={\it 0}$, then
$\displaystyle\sum_{i=1}^kc_iw_i=-\sum_{j=1}^md_jx_j$. It follows that
$$\sum_{i=1}^kc_iw_i\in W\cap W^\perp\quad\mbox{and}\quad
\sum_{j=1}^md_jx_j\in W\cap W^\perp.$$
But since $W\cap W^\perp=\{{\it 0}\,\}$ (gievn $x\in W\cap W^\perp$,
we have $\langle x,x\rangle=0$ and thus $x={\it 0}\,$), we have
$\displaystyle\sum_{i=1}^kc_iw_i=\sum_{j=1}^md_jx_j={\it 0}$. Therefore
$c_i=0$ and $d_j=0$ for each $i,j$ becasue $\beta$ and $\gamma$ are bases
for $W$ and $W^\perp$, respectively. Hence we conclude that $\beta\cup\gamma$ is linearly independent.
The problem lies in your definition of $\lvert v_2\rangle$. It should be$$\lvert v_2 \rangle = \frac{\lvert V_2'\rangle - \langle V_2'\rvert v_1 \rangle \lvert v_1 \rangle}{\sqrt{\langle V_2' \rvert V_2' \rangle}}.$$Using this definition, you will get that, indeed, $\langle v_1|v_2\rangle=0$. Unless your inner product is linear in the first variable and anti-linear in the second one. Then it should be$$\lvert v_2 \rangle = \frac{\lvert V_2'\rangle - \langle V_2'\rvert v_1 \rangle^*\lvert v_1 \rangle}{\sqrt{\langle V_2' \rvert V_2' \rangle}}.$$
Best Answer
The trace is a linear map from $V$ onto $\mathbb{R}$; that means that $U$ has dimension $8$, since it is equal to the kernel of this map.
The orthogonal complement will then be spanned by a single vector. You can find such a vector by finding one which is orthogonal to each vector in a basis for $U$. For example, you can take as your basis $E_{12}$, $E_{13}$, $E_{21}$, $E_{23}$, $E_{31}$, $E_{32}$, $E_{11}-E_{22}$, and $E_{11}-E_{13}$. This will give you information about $w$.
For instance, the fact that $\langle E_{12},w\rangle = 0$ tells you that the $(1,2)$ entry of $w$ must be equal to $0$. Using the rest of the basis, you should get all the information you need about the structure of $w$.
Or you could realize that there is a very special set of matrices $M$ such that for all $A$, $\mathrm{trace}(A)=0$ if and only if $\mathrm{trace}(M^tA) = 0$, and go from there. Hint. Do you know some family of matrices for which it is easy to compute the trace of $M^tA$ in terms of the trace of $A$?