in an inner product space, for any subspace W of a vector space V, you can define W^{⊥}= {v in V: <v,w> = 0, for all w in W}, the orthogonal complement of W.

moreover, V = W⊕W^{⊥}.

if we have another subspace U, with dim(U) > dim(W), then there must exist some vector u in U, that is not in W (otherwise U would be a subspace of W, and thus dim(U) ≤ dim(W)).

since u is not in W, it cannot be 0 (because 0 is in every subspace), and therefore it is a non-zero element of W^{⊥}. hence <u,w> = 0 for all w in W.

*****

here is an example from R^{4}, with the standard dot product:

let W = span({(1,0,0,1),(1,1,0,0)}), and let U = span({1,0,0,0),(0,1,0,0),(0,0,1,0)}).

an element of W is of the form: (a+b,b,0,a). first let's find a basis for W^{⊥}:

writing a typical element of R^{4}as (x,y,z,w) we have:

(a+b,b,0,a).(x,y,z,w) = 0, so: ax+by+aw = 0. letting b = 0, a ≠ 0, we get:

ax+aw = 0, so w = -x.

letting a = 0, b ≠ 0, we get: by = 0, so y = 0. so every element of W^{⊥}is of the form:

(x,0,z,-x) = x(1,0,0,-1) + z(0,0,1,0), so {(1,0,0,-1),(0,0,1,0)} is a basis for W^{⊥}.

now we just need to find an element of U in W^{⊥}, which is easy: (0,0,1,0) clearly fits the bill. as a check:

(a+b,b,0,a).(0,0,1,0) = (a+b)(0) + b(0) + (0)(1) + a(0) = 0 + 0 + 0 + 0 = 0, and clearly (0,0,1,0) is NOT in W, for every element of W has a 0 in the 3rd coordinate.