If you see this, something is wrong
First published on Thursday, Nov 26, 2026 and last modified on Thursday, Nov 26, 2026
The Vector Spaces \( \mathbb{R}^n\)
We shall start this course with the vector spaces R to the power n, that will be seen as the set of column vectors M_{n1},
But let's discover the vector space R to the power 3 in Python.
Launch Anaconda and spider and follow me.
We create a new file.
We save it.
To put it in the right directory and to give it a name: VectorSpaceR3.py.
We import the library numpy, to have the vectors, the arrays.
from numpy import *u is equal to array of, into parentheses, into brackets, 1, -2, 5.
v equals array of, into parentheses, into brackets, -3, 6, 2.
And w equals array of, into parentheses, into brackets, 3, -6, -1.
lam for lambda equals 5.6.
And mu equals 3.1.
u=array([1,-2,5])
v=array([-3,6,2])
w=array([3,-6,-1])
lam=5.6
mu=3.1We will illustrate the fact that the addition is commutative, the addition of vectors.
We print \n, a new line, to read it more easily.
print, into quotes, u plus v equals, comma, u plus v.
And we exchange the terms: v plus u, v plus u.
We save and we run.
You see that u + v and v + u are both equal to -2, 4, 7.
# The addition is commutative
print('\n')
print('u+v=',u+v)
print('v+u=',v+u)Now we will illustrate the fact that the addition is associative, that we can move the parentheses or get rid of them.
print \n.
print, into parentheses, u plus v, plus w equals, comma, u plus v into parentheses, plus w.
And we move the parentheses.
print u plus, into parentheses, v plus w, equals u plus, into parentheses, v plus w.
And we can even get rid of the parentheses.
print u plus v plus w, without parentheses, equals, u plus v plus w.
We save and we run.
And we see that the three formulas give 1, -2, 6.
# The addition is associative
print('\n')
print('(u+v)+w=',(u+v)+w)
print('u+(v+w)=',u+(v+w))
print('u+v+w=',u+v+w)Now we shall illustrate the fact that the null vector is neutral for the addition.
print \n.
print u plus zero, it is the null vector zero, equals u plus the null vector zeros, into parentheses, into brackets, 3.
The null vector of dimension 3.
print null vector plus u equals zeros of 3 into parentheses into brackets, plus u.
And we forgot to print u equals u, to illustrate the fact that the null vector is neutral.
You see that u plus the null vector equals the null vector plus u, equals u.
# The null vector is neutral for the addition
print('\n')
print('u=',u)
print('u+0=',u+zeros([3]))
print('0+u=',zeros([3])+u)Now we shall illustrate the fact that -u is the additive inverse of u.
print u plus -u equals u plus -u.
print -u plus u equals, comma, -u plus u.
We save and we run.
And you see that u plus -u equals -u plus u, equals the null vector of dimension 3.
# -u is the additive inverse of u
print('\n')
print('u+(-u)=',u+(-u))
print('(-u)+u=',(-u)+u)Now we shall illustrate the first distributivity law print \n.
print lam multiplied by, u plus v, equals, comma, lam star, u plus v into parenthesis.
And we will distribute the factor lambda on u and v.
print lam multiplied by u plus lam multiplied by v equals, comma, lamb star u plus lam star v.
We save and we run.
You see that the two formulas give the same result.
# First distributivity law
print('\n')
print('lam(u+v)=',lam*(u+v))
print('lam.u+lam.v=',lam*u+lam*v)And now the second distributivity law.
print, into parentheses, lam plus mu, multiplied by u, is equal to, lam plus mu into parentheses, star u.
print, we distribute u on lam and mu, lam multiplied by u, plus mu multiplied by u, equals comma, lam star u plus mu star u.
We save and we run.
And you see that the two formulas give the same result.
# Second distributivity law
print('\n')
print('(lam+mu)u=',(lam+mu)*u)
print('lam.u+mu.u=',lam*u+mu*u)And now we finish with The associativity law.
print lam multiplied by, into parentheses, mu multiplied by u, equals, comma, lam star, into parentheses, mu star u.
And print, we move the parentheses, lam, there is an error, lam multiplied by mu, u, is equal to lam star mu, close parentheses, star u.
But there is an error, an extra parentheses.
Now it's okay.
We save and we run.
And you see that the two formulas give the same result.
# Associativity law
print('\n')
print('lam(mu.u)=',lam*(mu*u))
print('(lam.mu)u=',(lam*mu)*u)We will assimilate R to the power n to the set of column vectors M_{n1}.
Let's consider the n-uple x, with elements x equals x_0, x_1, etc., x_{n-1}.
Let's consider the column vector big X in M_{n1}, with elements the elements of x.
Big X equals the column vector x_0; x_1; etc.; x_{n-1}.
Then we assimilate big X to x and M_{n1} to R to the power n.
We will write 'Consider the n-uple big X in R to the power n', where big X is a column vector.
\( x=(x_0,x_1,…,x_{n-1})\)
\( X=\begin{bmatrix} x_0\\ x_1\\ \vdots\\ x_{n-1} \end{bmatrix}\)
Now let's define the addition element by element in R to the power n.
Consider the two n-uples big X and big Y in R to the power n, to the square.
Big X equals the column vector x_0; x_1; etc.; x_{n-1}, and big Y equals the column vector y_0; y_1; etc.; y_{n-1}.
Then the sum S equals big X plus big Y of X and Y is the column vector: S equals a column vector x_0 + y_0; x_1 + y_1; etc.; x_{n-1} + y_{n-1}.
It is the sum element by element of X and Y.
\( X=\begin{bmatrix} x_0\\ x_1\\ \vdots\\ x_{n-1} \end{bmatrix}\) and \( Y=\begin{bmatrix} y_0\\ y_1\\ \vdots\\ y_{n-1} \end{bmatrix}\)
\( S=X+Y=\begin{bmatrix} x_0+y_0\\ x_1+y_1\\ \vdots\\ x_{n-1}+y_{n-1} \end{bmatrix}\)
Now we shall define the commutative group R to the power n, plus.
R to the power n plus is a commutative group because of the following properties of the addition in R to the power n.
The commutativity says that we may exchange the terms of an addition.
For any big X and big Y n-uples, big X plus big Y equals big Y plus big X.
The associativity says that we may move the parentheses or get rid of them.
For any big X, big Y, big Z in R to the power n, to the cube, big X plus big Y into parentheses, plus Z, equals X plus, into parentheses, big Y plus big Z, equals big X plus big Y plus big Z without parentheses.
The null n-uple O_{n1} is neutral for the addition.
For any X in R to the power n, X plus O_{n1} equals O_{n1} plus X, equals X. O_{n1} is the n-uple with zeros as elements.
The opposite element by element -X of X is its additive inverse.
For any big X in R to the power n, big X plus minus big X equals minus big X plus big X, equals O_{n1}, the null vector of dimension n.
Commutativity: \( \forall (X,Y)\in(\mathbb{R}^n)^2,\; X+Y=Y+X\)
Associativity: \( \forall(X,Y,Z)\in(\mathbb{R}^n)^3,\; (X+Y)+Z=X+(Y+Z)=X+Y+Z\)
Neutral element: \( \forall X\in\mathbb{R}^n,\; X+O_{n1}=O_{n1}+X=X\)
Opposite: \( \forall X\in\mathbb{R}^n,\; X+(-X)=(-X)+X=O_{n1}\)
Now let's define the scalar multiplication element by element in R to the power n.
Consider a n-uple big X in R to the power n, big X equals column vector x_0; x_1; etc.; x_{n-1}, and the scalar λ in R.
Then the scalar product big P equals λ big X of X by λ is the n-uple Big P equals the column vector λ x_0; λ x_1; etc.; λ x_{n-1}.
It is the product element by the element of big X by λ.
\( X=\begin{bmatrix} x_0\\ x_1\\ \vdots\\ x_{n-1} \end{bmatrix}\)
\( P=\lambda X=\begin{bmatrix} \lambda x_0\\ \lambda x_1\\ \vdots\\ \lambda x_{n-1} \end{bmatrix}\)
And now we shall discover the vector space R to the power n, with the addition and the scalar multiplication.
R to the power n with the addition and the scalar multiplication is a vector space because of the following properties of the addition and scalar multiplication in R to the power n.
R to the power n with the addition is a commutative group.
The first distributivity law says that for any scalar λ and any n-uples X and Y, λ multiplied by, X plus Y into parentheses, equals λX plus λY. We may distribute λ on X and Y.
The second distributivity law says that for any scalars λ and μ and any n-uple big X, λ plus μ, big X, equals λX plus μX.
We may distribute big X on λ and μ.
The associativity law says that for any scalars λ and μ and any n-uple big X, λ multiplied by μX equals λμ multiplied by X.
We may move the parentheses.
\( (\mathbb{R}^n,+,\cdot)\) is a vector space because:
\( (\mathbb{R}^n,+)\) is a commutative group.
First distributivity law: \( \forall (\lambda,X,Y)\in\mathbb{R}\times(\mathbb{R}^n)^2,\; \lambda(X+Y)=\lambda X+\lambda Y\) .
Second distributivity law: \( \forall(\lambda,\mu,X)\in\mathbb{R}^2\times\mathbb{R}^n,\; (\lambda+\mu)X=\lambda X+\mu X\) .
Associativity law: \( \forall(\lambda,\mu,X)\in\mathbb{R}^2\times\mathbb{R}^n,\; \lambda(\mu X)=(\lambda\mu) X\) .
R to the power n with the addition and the scalar multiplication is the canonical vector space of dimension n.
That's why the n-uples are called vectors, and column vectors.
What's coming now? Now we shall define the vector spaces, with more examples of vector spaces than the R to the power n.