Linear algebra keeps asking one question about a set of vectors: if I add two members or scale one, do I stay inside the set ? A set that always answers yes is a vector space, and a vector space sitting inside a bigger one is a subspace. I'll start with the plane you already know, then test a few shapes against the subspace conditions. We'll finish with the null space, which is the subspace a matrix creates by sending vectors to zero.
- What is a vector space ?
- What conditions make a set a subspace ?
- Can a rectangle or a straight line be a subspace ?
- What is a null space ?
What is a vector space ?
A vector space is defined by what you can do inside it, not by what it looks like. Two operations matter: adding two vectors and multiplying a vector by a scalar. The set must be closed under both, which means the result never leaves the set.
Vector Space means a space that can be covered by adding any two or more vectors or by multiplying with scalar. These two original vectors (vectors being used for the operation) should also belong to the same space and the result of the operation should also be within the space. It is similar concept to a set like Integer Set or Real Set etc in number system.
For example, let's suppose you have a 2-D plane as indicated in blue axis shown below. As you see, we assume that the axis goes to infinity even though we cannot draw such a plane with infinite size. And let's assume that you draw two vectors a and b. These two factor belong to the 2-D plane (let's call this as 'blue plane' now). Now let's take the sum of vector a and b and you get another vector c. As you see, the vector c also within the blue plane. Now multiply a constant to the two vector (as in green vector).
Suppose you are doing these operations for any length of a and b with infinite different ways, then the resulting vectors will cover all the points on blue plane. So this blue plane can be a vector space. Since we take the real vectors in 2D real number plane, this vector space is called R2 space. If you take this operation in 3D axis, it will be called R3 space.
The drawing below shows all of these operations on one plane. The black vector a and the green vector b are the starting vectors. The red vectors c and d are built from them, and the orange dashed lines show the parallelogram of each sum.

Figure 1. Sums and scalar multiples of a and b. Every result stays on the blue plane, so the plane is closed under both operations.
c is the sum a + b : the orange dashed lines complete the parallelogram of a and b, and c is its diagonal.-0.5a and -2b are scalar multiples : a negative scalar reverses the direction, and its size stretches or shrinks the vector.d combines both operations : d = -0.5a + b, so a scaled vector and an unscaled one are added together.The axes run to plus and minus infinity : the plane has no edge, so no sum or multiple can fall off it.
Any vector of the form k1a + k2b is called a linear combination of a and b. When a and b do not point along the same line, their linear combinations reach every point of the plane. In that case we say that a and b span R2. The same idea extends to Rn, where n vectors that are linearly independent span the whole space.
The formal definition adds a few rules that ordinary arithmetic already gives you. Addition must be commutative and associative, a zero vector and a negative of each vector must exist, and scalar multiplication must distribute over addition. For R2 and R3 these rules hold automatically. They matter when the "vectors" are other objects, such as polynomials or signals, which also form vector spaces.
A vector space needs two closures : the sum of two members and every scalar multiple of a member must stay in the set.The zero vector is always a member : multiplying any member by 0 gives the zero vector, so closure forces the zero vector into the set.Rn is the space you use most : it holds every column vector with n real entries, and an n x n matrix maps Rn into itself.A vector space is not only arrows : polynomials of degree 2 or lower, for example, add and scale the same way, so they form a vector space too.
What conditions make a set a subspace ?
A subspace is a smaller set inside a vector space that is still a vector space by itself. You don't need to recheck every rule for it, because the bigger space already guarantees most of them. Only the three conditions below must be checked.
Sub Space means a space that can be covered by adding any two or more vectors or by multiplying with scalar. These two original vectors (vectors being used for the operation) should also belong to the same sub space and the result of the operation should also be within the space. If I represent this in mathematical symbols, it would be as follows. To be a Subspace, it has to meet all of these criteria. If only one of the criterial is not met, it cannot be a Sub space.
In the conditions below, W is the candidate subset, a and b are any two of its members, and k is any real number.

Figure 2. The three subspace conditions. A set W is a subspace only when all three hold.
Condition 1 is closure under addition : a + b must be in W whenever a and b are in W.Condition 2 is closure under scalar multiplication : k a must be in W for every real k, including negative k and k = 0.Condition 3 is the zero vector : W must contain the zero vector. This is the quickest test, so check it first.Condition 3 follows from condition 2 : with k = 0, condition 2 already gives 0 a = 0. It is listed separately because a failure there is easy to spot.
Conditions 1 and 2 can be merged into one test. W is a subspace exactly when every linear combination k1a + k2b of its members stays in W. This form is handy when you check a set given by an equation.
Let's use it on two planes in R3. Take first the plane x + y + z = 0. If two points satisfy the equation, then the coordinates of k1a + k2b add up to k1(0) + k2(0) = 0. So the combination satisfies the equation too. This plane is a subspace. Now take the plane x + y + z = 1. The points (1, 0, 0) and (0, 1, 0) are on it, but their sum (1, 1, 0) gives 2, not 1. The origin gives 0, not 1, so the zero vector test fails as well.
The pattern is general. A set defined by linear equations whose right side is 0 is always a subspace. A set whose right side is not 0 never is, because the zero vector cannot satisfy it. The null space at the end of this page is the first kind.
Can a rectangle or a straight line be a subspace ?
The conditions are easier to feel with pictures. Let's test three shapes in R2: a filled rectangle, a line that misses the origin, and a line through the origin. Only one of them survives, and each failure breaks a different condition.
Let's try with some examples for more intuitive understanding. This idea came from What is a Subspace? on YouTube.
Here goes the first example. Let's suppose you take a small area as shown below. Can this rectangular area be a sub space ?

Figure 3. A rectangle in the first quadrant. It contains the origin, but it has edges.
This cannot be a subspace since you can easily find two vectors, sum of which gets out of the area. So this is violation of condition 1.
The drawing below checks the conditions one panel at a time. On the left, two vectors inside the rectangle are picked. In the middle, their sum, the red vector, leaves the rectangle. On the right, the origin is checked.

Figure 4. The rectangle fails closure under addition. The zero vector test passes, but one failed condition is enough.
The rectangle fails condition 1 : the red sum of the black and green vectors points outside the shaded area.The rectangle also fails condition 2 : multiplying any nonzero vector in it by -1 gives a vector in the third quadrant, and a large k pushes it past the edge.Containing the origin is not enough : condition 3 passes here, which shows that it is necessary but not sufficient.
Here goes another example. Let's suppose you take a straight line extending to infinite range. Note that this line is off the origin (0,0). Can this line be a sub space ?

Figure 5. A straight line that misses the origin. It is infinite, so it has no edge to fall off.
Check with each condition as below. You notice that zero vector does not belong to this line. So this line cannot be a sub space.

Figure 6. The line off the origin fails the zero vector test, so it cannot be a subspace.
The zero vector test settles it : the black dot at the origin in the right panel is not on the line.Condition 1 fails too, although the middle panel marks it YES : take the line y = x + 1. The points (0, 1) and (1, 2) are on it, but their sum (1, 3) is not, because 1 + 1 = 2, not 3. The vectors in the panel are drawn along the line rather than from the origin, which hides the failure.A shifted line is an affine set, not a subspace : it is a subspace moved away from the origin, and the move breaks all three conditions.
Now let's see another example as shown below. In this example, we have a stright line passing through the origin of the axis.

Figure 7. A straight line through the origin. This is the only candidate that contains the zero vector and has no edge.
Check with each condition as below. Now you see all the check points passes the criteria (one check points that is not shown here is about scaling, but you can easily confirm that if you scale green or black vector, the resulting vector still be sitting on the line) So this line can be a sub space.

Figure 8. The line through the origin passes every condition, so it is a subspace of R2.
Every vector on the line is a multiple of one direction : if the line points along v, its members are k v. Then k1 v + k2 v = (k1 + k2) v, which is on the line again.The subspaces of R2 are few : the zero vector alone, every line through the origin, and R2 itself. In R3, planes through the origin join the list.Check the zero vector first : it rejected the shifted line in one step, and it costs nothing to check.
What is a null space ?
The title of this page names a third space, and it comes straight from a matrix. Given a matrix A, which input vectors does A send to zero ? The answer is never just a loose set of vectors. It is always a subspace, and that is why it gets its own name.
For an m x n matrix A, the null space N(A) is the set of all vectors x in Rn with Ax = 0. It is a subspace of Rn, and the three conditions from Figure 2 show why. If Aa = 0 and Ab = 0, then A(a + b) = Aa + Ab = 0. Also A(ka) = kAa = 0, and A0 = 0. So all three conditions hold for any matrix.
Let's take a small example. The rows of the matrix below are multiples of each other, so the two equations say the same thing.
A = | 1 2 | A x = 0 gives x1 + 2 x2 = 0
| 2 4 |
N(A) = { k [-2 1]^T : k any real number }
The null space here is a line through the origin in the direction [-2 1]T. It is exactly the kind of subspace that passed the test in Figure 8. A 3 x 3 example works the same way. For the matrix with rows [1 2 3], [4 5 6] and [7 8 9], row reduction leaves two independent rows. The null space is then the line through [1 -2 1]T. To check it, multiply each row by this vector. The results are 1 - 4 + 3 = 0, 4 - 10 + 6 = 0 and 7 - 16 + 9 = 0.
The size of the null space follows from the rank. For an m x n matrix, the rank-nullity theorem says rank(A) + dim N(A) = n. In the 2 x 2 example, the rank is 1, so the null space has dimension 2 - 1 = 1, a line. In the 3 x 3 example, the rank is 2, so the null space again has dimension 3 - 2 = 1.
The null space is always a subspace : linearity of A gives closure under addition and scaling, and A0 = 0 puts the zero vector inside.Ax = b with b not zero is different : its solutions form a shifted copy of N(A), which misses the origin. That is the same failure as the line in Figure 6.A trivial null space means A is invertible : for a square matrix, N(A) = {0} holds exactly when A has full rank and an inverse exists.The null space describes the lost directions : any vector in N(A) can be added to an input without changing Ax. So Ax = b has one solution or infinitely many, depending on whether N(A) is trivial.