# Subspace

**Subspace.** The set of vectors $V$ is a linear subspace of $\mathbb{R}^n \iff$ null vector $\in V$ and $V$ is closed under scalar multiplication and addition.

⚠️ *Union of subspaces is not a subspace*

> The reason why this can happen is that all vector spaces, and hence subspaces too, must be closed under addition (and scalar multiplication). The union of two subspaces takes all the elements already in those spaces, and nothing more. 
> 
> In the union of subspaces $W_1$ and $W_2$ there are new combinations of vectors we can add together that we couldn't before, like $v_1 + v_2$ where $v_1 \in W_1$ and $v_2 \in W_2$.
> 
> For example, take $W_1$ to be the $x$-axis and $W_2$ the $y$-axis, both subspaces of $\mathbb{R}^2$.
Their union includes both $(3,0)$ and $(0,5)$, whose sum, $(3,5)$, is not in the union. Hence, the union is not a vector space.
>
> http://math.stackexchange.com/a/71875/402625

# Linear Dependence and Independence
**Linearly Dependent.** A set of vectors is linearly dependent if there exists a vector in the set that *can be written as a linear combination of the others*.

**Linearly Independent.** A set of vectors is linearly independent $\iff$ the only linear combination that gives the null vector is the linear combination with all coefficients equal to $0$.
$$\Sigma_{i=0}^k \lambda_i v_i = 0 \iff \lambda_1 = \lambda_2 = \dots = \lambda_i = 0$$

_**Proof.**_ ($\Rightarrow$) Say there exists a linear combination of that set ($D$) that evaluates to the null vector and not all coefficients equal $0$, then there exists a linear combination $\Sigma_{i=1}^{n}\lambda_i v_i=0$ with $\lambda_i\in\mathbb{R}, v_i\in D$ and $\lambda_1\neq0$. So, $v_1=\frac{-1}{\lambda_1}\left( \Sigma_{i=2}^{n}\lambda_i v_i \right)$ and the set is linearly dependent.

# Span
**Span**. The *span of a given subset ($D$) of a vector space ($V$)* is *the vector space ($\text{span}(D)$) containing all possible linear combinations of the vectors in the subset ($D$)*.

##### _Example_
\begin{equation}
    A_1=
    \begin{bmatrix}
        1 \\
        0
    \end{bmatrix},
    A_2=
    \begin{bmatrix}
        0 \\
        1
    \end{bmatrix}
\end{equation}
$\text{span}(\{A_1,A_2\})=\langle\{A_1,A_2\}\rangle=\text{vct}(\{A_1,A_2\})= \{\alpha_1A_1 + \alpha_2A_2\mid\alpha_1,\alpha_2\in\mathbb{R}\}$

Two 2-vectors span $\mathbb{R}^2 \iff$ they are linearly independent.

$\text{span}(\{A_1,A_2\})=\mathbb{R}^2$

##### Thoughts
*Q*: If the set of 2 vectors is linearly dependent, can each one be written as a linear combination of the other? What about 3 vectors?

*A*: Trivial for 2 vectors. If the set of vectors $A_1$ and $A_2$ are linearly dependent, there exists a vector in that set that can be written as a linear combination of the other. Say $A_1$ is that vector, then $A_1=\alpha A_2,$ with  $\alpha\in\mathbb{F}$ and $A_2=\frac{1}{\alpha}A_1$. Analogue if $A_2$ is that vector.

For 3 vectors, this isn't necessarily possible (e.g.: $\{(1,0,0),(2,0,0),(0,1,0)\}$). The set of 3 vectors is linearly dependent if (at least) one of them can be written as a linear combination of the others.

# Basis & Dimension

**Basis.** A set of *linearly independent* vectors that *spans a vector space* is a *basis* of that space.

⚠️ *Lemma of Steinitz*

Say $(\mathbb{R},V,+)$ a vector space. Then:
1. if a subset $\subset V$ of $m$ elements exists that spans $V$, then every subset of $V$ with more than $m$ elements is linearly dependent;
2. if a subset $\subset V$ of $n$ elements exists that is linearly independent, then every subset of $V$ with less than $n$ elements cannot span $V$.

**Dimension.** The *dimension of a vector space* equals the *number of elements in a (finite) basis* for that vector space. (_Notation:_ $\text{dim}_{\mathbb{R}}V$)

⚠️

Say $(\mathbb{R},V,+)$ a vector space of dimension $n$. Then:
1. every linear independent subset $\subset V$ can be extended to a basis of $V$;
2. every finite subset $\subset V$ that spans $V$ can be reduced (by removing vectors) to a basis of $V$.


```python

```

a3398163ff03b7c95028982f28b01a7b3d173e4a
ipynb
Jupyter Notebook
H3_vector_spaces.ipynb
jppgks/linear-algebra-notebooks
08ce0ad8e7a8fb65ddd872d3084d1f8946b65fe0
MIT
2016-11-30T09:55:17.000Z
2016-11-30T09:55:17.000Z
H3_vector_spaces.ipynb
jppgks/linear-algebra-notebooks
08ce0ad8e7a8fb65ddd872d3084d1f8946b65fe0
MIT
H3_vector_spaces.ipynb
jppgks/linear-algebra-notebooks
08ce0ad8e7a8fb65ddd872d3084d1f8946b65fe0
MIT
Qwen/Qwen-72B
1. YES
2. YES