Vector Space
Consider a vector , here lives in dimensional space this space is a vector space.
For example, for ,


Code to plot this vector (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
m = mvar.MultiVariable()
vector = np.array([[1, 1, 1]])
m.plot_3D_vectors(vector)
## Adjusting axis limits
m.set_axes_limit((-2, 2))
m.setZ_limit((-0.5, 2))
Vector shown in the blue is a vector . All the space surrounding this vector is -dimensional vector space.
If we multiply a vector by a constant say then the resulting vector is in the direction of (or in opposite direction).
Say the resulting vector is then we can say that where , it is a line along vector .
Here you can see that has it's own space inside that dimensional space, it's a vector space inside a vector space.
Example for


Code to plot this vector (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
m = mvar.MultiVariable()
## Here line is defines as [x-start, x-end, y-start, y-end, z-start, z-end]
lines = np.array([[-2, 2, -2, 2, -2, 2]])
m.plot_3D_lines(lines)
vector = np.array([[1, 1, 1]])
m.plot_3D_vectors(vector, plot_separately=False)
## Adjusting axis limits
m.set_axes_limit((-3, 3))
Here you can see the vector has it's own vector space that is that line.
Now Consider a plane(passing through origin) inside a -dimensional space, this plane lives inside -dimensional vector space, but it has it's own vector space.


Code to plot this plane (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
def f(x,y):
return -x -y
m = mvar.MultiVariable()
m.plot_surface_color_3D(f, plot_separately=True, alpha=0.7)
Here you can see the plane has it's own vector space inside -dimensional vector space.
If we add any two -dimensional vectors, we get a -dimensional vector as a output.
Say we have two vectors and , then if we take there linear combination,
then that linear combination will have it's own vector space, but what that vector space looks like?
Well it depends, on how and are oriented.
Case 1: if is parallel to
If and are parallel then , So vector space is just a line.
Example for :
Say the vectors are,


Then the vector space is just a line passing through these vectors.


Code To plot this (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
m = mvar.MultiVariable()
vectors = np.array([
[1, 1, 1],
[2, 2, 2]
])
origin = np.array([0, 0, 0])
m.plot_3D_vectors(vectors, origin, plot_separately=False)
# Structure of lines = [[x-start, x-end, y-start, y-end, z-start, z-end],...]
lines = np.array([
[-2.5, 2.5, -2.5, 2.5, -2.5, 2.5]
])
m.plot_3D_lines(lines, plot_separately=False)
m.set_axes_limit((-3, 3))
Case 2: if is not parallel to
If and are not parallel then the vector space of linear combination of and is a plane.
Example for :
Say the vectors are,


Then the vector space is the plane passing through these vectors (shown below).


Code To plot this (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
# X + Y + Z = 0
def f(x,y):
return -x -y
m = mvar.MultiVariable(count = 10, x_range=(-2,2), y_range=(-2,2), z_range=(-2,2))
vectors = np.array([
[2,-1,-1],
[-1,2,-1]
])
origin = np.array([0,0,0])
m.plot_3D_vectors(vectors, origin, plot_separately=False)
m.plot_surface_lines_3d(f, density = 100, plot_separately=False)
m.set_axes_limit((-3,3))
Vector Space Properties
So when can we say that a space can be a vector space?
A space is a vector space if it full fill these conditions:
- If there is a vector in this space and we multiply that vector with a constant then the resulting vector must be in the space.
- Say we took two vectors and then there sum must be in this space.
Let's see an example of a space which is not a vector space.
Think of a 2 dimensional space where and


We can add vector safely and we don't go out of the space.
What about multiplying a constant to a vector, take a vector in that space .


if we multiply by then if goes out of space.


Code To plot this (python)
import MultiVariable as mvar
import numpy as np
%matplotlib qt
m = mvar.MultiVariable()
x = np.array([0, 5])
y1 = np.array([5,5])
y2 = np.array([0, 0])
m.fill_between(x, y1, y2, alpha=0.3)
vectors = np.array([
[4,3],
[-4,-3],
])
origin = np.array([0,0])
m.plot_2D_vectors(vectors, origin, plot_separately=False, head_width=0.2, head_length=0.2)
m.set_axes_limit((-5,5))
So it can't be a vector space.
A vector space must pass through the origin.
Vector space inside a vector space is referred as a subspace.
Possible subspace of a -dimensional space.
- All space
- All lines passing through origin.
- Origin itself ()