# Calculate intersection of vector subspace by using gauss-algorithm

There are two vector subspaces in $R^4$. $U1 := [(3, 2, 2, 1), (3, 3, 2, 1), (2, 1, 2 ,1)]$, $U2 := [(1, 0, 4, 0), (2, 3, 2, 3), (1, 2, 0, 2)]$

My idea was to calculate the Intersection of those two subspaces by putting all the given vector elements in a matrix (a vector is a column). If I run the gauss-algorithm, this leads to a matrix \begin{pmatrix} 1 & 0 & 0 & 0 & -6 & -4 \\\\ 0 & 1 & 0 & 0 & 3 & 2 \\\\ 0 & 0 & 1 & 0 &6 & 4 \\\\0 &0 & 0 & 1 & -1 & -1 \end{pmatrix}

So I see that the dimension of $U1 + U2$ equals 4, as there are 4 linear independent vectors. Is it somehow possible to get a basis of $[U1] \cap [U2]$ from this matrix? I know that it has to be one dimensional as the dimension of $U2$ equals 2.

-
I think the main thing to see from the reduced matrix is that $v_4$ is not in the span of $v_1,v_2,v_3$ and hence not in the intersection. – James S. Cook Aug 31 '12 at 16:45

% Matlab solution
% First solve [U1 U2]*N=0 where N=[N1; N2]=basis of null space of [U1 U2]
% Then I = U1*N1 = -U2*N2 is a basis for the intersection of U1 and U2
% I may not be a minimal size basis, so use orth(I), which will be
% For this problem I = [1 1 2 1]'
U1=[3,2,2,1; 3,3,2,1; 2,1,2,1]';
U2=[1,0,4,0; 2,3,2,3; 1,2,0,2]';
N=null([U1 U2]); % N = basis for nullspace of [U1 U2]
I=U1*N(1:3,:); % I = basis for intersection of U1 and U2
I=orth(I); % I = orthonormal and minimal size basis
I=I/I(1) % for pretty output (don't use this in general)

-

Yes. The matrix you write reveals the linear dependence of one set of vectors on the other. In particular, the column correspondence principle indicates that

$$v_5=-6v_1+3v_2+6v_3-v_4 \qquad \& \qquad v_6 = -4v_1+2v_2+4v_3-v_4$$

I assume that you ordered the vectors $v_1,v_2, \dots , v_6$ to glue together to make the matrix $M$ and the posted matrix is $rref(M)$.

All 6 vectors can be written as spans of the first 4 vectors. It follows that $v_5,v_6$ can be used to find a basis for the intersection.

Now think about how to obtain a vector from $v_5$ and $v_6$ which is a linear combination of $v_1,v_2,v_3$. I think this vector is the basis for your intersection.

-