Nullspace $N(A)$ of a matrix $A$ is one of the Four Fundamental Subspaces of the matrix $A$
The nullspace of $A$ contains all $\mathbf x$ that solve the system $A \mathbf x = \mathbf 0$ (this system is called homogeneous)
$A = \begin{bmatrix} 1 & 1 & 2 \\ 2 & 1 & 3 \\ 3 & 1 & 4 \\ 4 & 1 & 5 \\ \end{bmatrix}$, $\mathbf x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix}$, $\mathbf b = \mathbf 0_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}$
Let's find what's inside $N(A)$
1 \\ 1 \\ -1 \end{bmatrix}$ or any multiple of this vector $c \cdot \begin{bmatrix} 1 \\ 1 \\ -1 \end{bmatrix}$
Does it form a Vector Space on its own?
Basis for $N(A)$ is formed by the "special" solutions
We can also consider another nullspace of $A$ - the nullspace of $A^T$ (this is the 4th fundamental subspace of a matrix)
Let's have a look at a system $A^T \mathbf y = \mathbf 0$
Let's take the transpose of $A^T \mathbf y = \mathbf 0$:
$\big[ - \, \mathbf y^T - \big] \Bigg[ ~ ~ ~ ~ ~ {A} ~ ~ ~ ~ ~ \Bigg] = \big[ - \, \mathbf 0^T - \big]$
Let's consider this example
Let $A$ be some rectangular matrix and we find it's rref $R$
1 & 2 & 3 & 1 \\ 1 & 1 & 2 & 1 \\ 2 & 3 & 5 & 2 \\ \end{bmatrix} \leadsto \begin{bmatrix} 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix} = R$
How to best find this left nullspace?
Example cont'd
1 & 2 & 3 & 1 & 1 & 0 & 0 \\ 1 & 1 & 2 & 1 & 0 & 1 & 0 \\ 2 & 3 & 5 & 2 & 0 & 0 & 1 \\ \end{array}\right] \leadsto \left[ \begin{array}{cccc|ccc} 1 & 0 & 1 & 1 & -1 & 2 & 0 \\ 0 & 1 & 1 & 0 & 1 & -1 & 0 \\ 0 & 0 & 0 & 0 & -1 & 0 & 1 \\ \end{array}\right]$
-1 & 2 & 0 \\ 1 & -1 & 0 \\ -1 & 0 & 1 \\ \end{bmatrix}$ and multiply it by $A$, we get
-1 & 2 & 0 \\ 1 & -1 & 0 \\ -1 & 0 & 1 \\ \end{bmatrix} \cdot \begin{bmatrix} 1 & 2 & 3 & 1 \\ 1 & 1 & 2 & 1 \\ 2 & 3 & 5 & 2 \\ \end{bmatrix} = \begin{bmatrix} - & - & - & - \\ - & - & - & - \\ 0 & 0 & 0 & 0 \\ \end{bmatrix}$
Use SVD to compute the nullspace
def null(A, eps=1e-15): u, s, vh = np.linalg.svd(A) null_space = np.compress(s <= eps, vh, axis=0) return null_space.T
From [1]