2

I am working through the questions of the Mathematics for Machine Learning book (Page 73 Q2.12, Here) and came across this question on finding a basis for the intersection of two subspaces, given by the following vectors which span $U_1$ and $U_2$, respectively.

$$ U_1 = \operatorname{span} \big[ \begin{pmatrix} 1 \\\\ 1 \\\\ -3 \\\\ 1\\\\ \end{pmatrix}, \begin{pmatrix} 2 \\\\ -1 \\\\ 0 \\\\ -1\\\\ \end{pmatrix}, \begin{pmatrix} -1 \\\\ 1 \\\\ -1 \\\\ 1\\\\ \end{pmatrix} \big]$$

$$ U_2 = \operatorname{span} \big[ \begin{pmatrix} -1\\\\ -2\\\\ 2\\\\ 1\\\\ \end{pmatrix}, \begin{pmatrix} 2\\\\ -2\\\\ 0\\\\ 0\\\\ \end{pmatrix}, \begin{pmatrix} -3\\\\ 6\\\\ 2\\\\ -1\\\\ \end{pmatrix} \big] $$

I have read through some helpful posts, namely (How to find a basis for the intersection of two vector spaces in $\mathbb{R}^n$?) which I found helpful to get started. My understanding is that for any vector $x$ that lies within the intersection of $U_1 \cap U_2$, then it must satisfy the following $\{x^4 \in \Bbb{R}^4 | \ A\lambda = x, By = x\}$ where $A$ and $B$ are matrices whose columns are the column vectors of $U_1$ and $U_2$, respectively.

Having then set up $A\lambda = By$ and then rearranging to $A\lambda - By = 0$ the task then becomes solving for the null space of $L = [ A \ | \ - B]$ but having went through the process of gaussian elimination in an attempt to reduce the matrix to reduced row echelon form, I seem to be stuck with how to proceed. The matrix that I have ended up with is as follows and I would appreciate your thoughts on the below questions / thoughts.

$$ L = \begin{pmatrix} 1 & 2 & -1 & 1 & -2 & 3\\\\ 0 & 1 & \frac{-2}{3} & \frac{-1}{3} & \frac{-4}{3} & 3\\\\ 0 & 0 & 0 & 0 & 0 & 0\\\\ 0 & 0 & 0 & -3 & -2 & 7\\\\ \end{pmatrix} $$

  1. Would you agree that the matrix is in the correct form? I am not confident this is the case, even though I am not sure where I have gone wrong
  2. If so, my understanding is that this implies the pivot columns of this matrix (columns $1$ and $2$, $c_1$ and $c_2$), should be able to express each of the other redundant (linearly dependent) columns as a linear combination to get the zero vector and while this seems fine to do for $c_3$, it seems impossible for $c_{i ; \ i = 4, .., 6}$ because of the entry in the fourth positions. Any ideas where I have gone wrong here?

I would greatly appreciate the communities thoughts / guidance of how to proceed here. Many thanks!

  • You have to find $n$ linearly independent vectors and then write the rest of them as their linear combination. Put the vectors in one subspace one side and others on the other side of the equality. Vectors, either rows or columns, that become zero rows or columns (depending on how you put them in the matrix) are in the intersection. – PinkyWay Jan 01 '24 at 12:31
  • Thanks for your response. To confirm, you're saying to not have the column vectors of $U_1$ and $U_2$ in a single matrix, $L = [A | - B] \in \Bbb{R}^{4x6}$ as I did but in separate matrices in $\Bbb{R}^{4x3}$ and then equate them to one another? Would I be performing gaussian elimination separately on each of the matrices or would any operation on matrix $A$ need be done on $B$ also? If the latter, which I suspect would be the case, would that get me anywhere different to where I am currently stuck? – InvestingScientist Jan 01 '24 at 12:48
  • Given $V_1=\operatorname{span}{v_1,\ldots,v_r},W_2=\operatorname{span}{w_1,\ldots,w_s},$ where the spanning sets are sets of linearly independent vectors, if $v_1,\ldots,v_r,w_1,\ldots w_t$ is a basis for $V_1+V_2,$ write $w_{t+1},\ldots,w_s$ as a linear combination of $v_1,\ldots,v_r,w_1,\ldots,w_t.$ So, $w_i=\sum_{k=1}^r\alpha_{k,i}v_k+\sum_{j=1}^t\beta_{j,i}w_j.$ Then $V_2\ni w_i-\sum_{j=1}^t\beta_{j,i}w_j=\sum_{k=1}^r\alpha_{k,i}v_k\in V_1$ – PinkyWay Jan 01 '24 at 13:13
  • @PinkyWay I understand what you are saying but isn't this what I have done already by stating $A\lambda = By$ and then attempting to solve the for $[A | - B] = 0$? The solution manual presents a way similar way in not using gaussian elimination but for larger systems this appears to be the best way to solve this and I want to understand where I am going wrong. Apologies if I am missing something here – InvestingScientist Jan 01 '24 at 14:01

2 Answers2

2

Let $A_1,A_2$ be matrices whose columns span given subspaces $U_1,U_2$ of $\mathbb{R}^n$.

We can use the fact that $(U_1\cap U_2)^{\perp}=N(A_1^T)+ N(A_2^T)$ to establish a nice method for finding $U_1\cap U_2$. Here it is.

  • Find bases for $N(A_1^T),N(A_2^T)$.

  • Put these basis vectors in the columns of a matrix $B$. Note the columns of $B$ span $(U_1\cap U_2)^{\perp}$.

  • Find a basis $\beta$ for $N(B^T)$.

Then $U_1\cap U_2=\text{span}(\beta)$. In your problem we have $$N(A_1^T)=\text{span}\Bigg\{\begin{pmatrix}1\\ 2\\ 1\\ 0\end{pmatrix},\begin{pmatrix}0\\ -1\\ 0\\ 1\end{pmatrix}\Bigg\}$$ $$N(A_2^T)=\text{span}\Bigg\{ \begin{pmatrix}1\\ 1\\ 0\\ 3\end{pmatrix} \Bigg\}$$

If we set $B=\begin{pmatrix}1&0&1\\ \:2&-1&1\\ \:1&0&0\\ \:0&1&3\end{pmatrix}$ then we get $\text{rref}(B^T)=\begin{pmatrix}1&0&0&4\\ 0&1&0&-1\\ 0&0&1&-2\end{pmatrix}$ whose null space is precisely the intersection you seek: $$U_1\cap U_2=N(B^T)=\text{span}\Bigg\{\begin{pmatrix}-4\\ 1\\ 2\\ 1\end{pmatrix}\Bigg\}$$

Matthew H.
  • 9,191
  • 1
    Thank you for this answer, which is extremely well done and thoughtful to invoke the orthogonal complement. This is again extremely helpful and appreciated, thank you! – InvestingScientist Jan 02 '24 at 18:18
1

Note that the list $\begin{pmatrix}1 \\ 1 \\ -3 \\ 1\end{pmatrix},\begin{pmatrix}2 \\ -1 \\ 0 \\ -1\end{pmatrix},\begin{pmatrix}-1 \\ 1 \\ -1 \\ 1\end{pmatrix}$ is linearly dependent. However, the list $\begin{pmatrix}2 \\ -1 \\ 0 \\ -1\end{pmatrix},\begin{pmatrix}-1 \\ 1 \\ -1 \\ 1\end{pmatrix}$ is a basis for $U_1$. Thus,

$$U_1=\operatorname{span}\left[\begin{pmatrix}2 \\ -1 \\ 0 \\ -1\end{pmatrix},\begin{pmatrix}-1 \\ 1 \\ -1 \\ 1\end{pmatrix}\right].$$

Let $x\in U_1\cap U_2$ be arbitrary, then $x\in U_1$ and $x\in U_2$. Since $x\in U_1$, we have

$$\tag{*}\label{*}x=f\begin{pmatrix}2 \\ -1 \\ 0 \\ -1\end{pmatrix}+g\begin{pmatrix}-1 \\ 1 \\ -1 \\ 1\end{pmatrix},$$

where $f,g\in\Bbb R$. At the same time, since $x\in U_2$, we have

$$\tag{**}\label{**}x=a\begin{pmatrix}-1 \\ -2 \\ 2 \\ 1\end{pmatrix}+b\begin{pmatrix}2 \\ -2 \\ 0 \\ 0\end{pmatrix}+c\begin{pmatrix}-3 \\ 6 \\ 2 \\ -1\end{pmatrix},$$

where $a,b,c\in\Bbb R$.

Since $x=x$, it follows from ($\ref{*}$) and ($\ref{**}$) that

$$\begin{cases}-a+2b-3c=2f-g \\ -2a-2b+6c=-f+g \\ 2a+2c=-g \\ a-c=-f+g\end{cases}$$

The solution of this system of equations is given by

$$\tag{***} \label{***} b = -\frac{3}{2}a \ ; \ c = 0 \ ; \ f = -3 a \ ; \ g = -2 a.$$ Substituting ($\ref{***}$) into ($\ref{*}$), we obtain

$$x=a\begin{pmatrix}-4 \\ 1 \\ 2 \\ 1\end{pmatrix}.$$

Therefore, $$U_1\cap U_2=\operatorname{span}\left[\begin{pmatrix}-4 \\ 1 \\ 2 \\ 1\end{pmatrix}\right].$$

  • 1
    Thank you very much for this @QuantumSuperfield. I managed to solve this myself using this method, after realising that $U_1$ and $U_2$ were not basis themselves and after finding them the methodology became clear. Thank you very much for laying this out as I am sure it will be of use to others. – InvestingScientist Jan 02 '24 at 18:17