When studying linear algebra, the determinant function det(⋅) is a horrifying subject. We try to give a friendly approach to it in this article.
I think it is the study of the volume of the parallelotope specified by v1,v2,...,vn∈Rn that gives it away. The parallelotope is defined as the set
⎩⎨⎧i∈[n]∑λivi:λi∈[0,1],∀i∈[n]⎭⎬⎫
Let's denote f(v1,v2,...,vn):Rn×n→R the singed volume function, i.e., ∣f(v1,v2,...,vn)∣ gives the volume of the parallelotope. We will show how to determine the sign of f later. At this point, we do not know how det(⋅) is related to the volume. Therefore, we use the notation f instead.
We show how to derive the formula of f by its properties. The two key properties associated with volume are
f is multi-linear. Specially, it is a linear function in any dimension when other dimensions are fixed:
f(v1,v2,...,cvi,...,vn)=cf(v1,v2,...,vn) for ∀i∈[n] and c∈R. Geometrically, if we scale the i-th vector vi by a factor c, then the volume of the parallelotope should change by the same factor.
In the above example, when v2 is fixed, the area of the parallelogram is determined by its height, i.e., the projection of v1 to the orthogonal direction of v2. When v1 doubles, the length of its projection doubles.
f(v1,v2,...,vi+ui,...,vn)=f(v1,v2,...,vi,...,vn)+f(v1,v2,...,ui,...,vn).
In the above example, when v2 is fixed, the projection to the orthogonal direction of v2 are additive. In particular, denote P(v1) the length of the projection of v1 to the orthogonal direction of v2. Similarly we define P(v2) and P(v1+v2). Then
P(v1+v2)=P(v1)+P(v2)
Note that the projection of two vector can cancel each other in some cases, in the sense that they points to different direction.
In the above example, if we write v1=v1,1e1+v1,2e2, then P(v1,1e1) and P(v1,2e2) points to opposite directions. This implies that we should give volume a sign. For example, we can define the direction pointed by purple vector points to be positive. The volume of the parallelogram increases if a vector's projection moves along this direction and decrease otherwise.
If v1,v2,...,vn are linearly independent, then the parallelotope is contained in a subspace with dimension smaller than n and should have volume zero.
Intuitively, the parallelotope collapses to a lower dimension space. Examples include colinear vectors in two dimension case and the third vector lying in the hyperplane spanned by the other two in the three dimension case.
Finally, we emphases an important case here:
f(...,vi,...,vj,...,)=0, if vi=vj,∀i,j∈[n],i=j
Note that if ki=kj for i=j, then f(ek1,ek2,...,ekn)=0. Therefore,
f(v1,v2,...,vn)=k is a permutation∑v1,k1v2,k2...vn,knf(ek1,ek2,...,ekn)
We are almost done. It is left to determined the value of f(ek1,ek2,...,ekn), where k=(k1,k2,...,kn) is a permutation of (1,2,....,n). Here we claim that is purely determined by the value of f(e1,e2,...,en). By conversion, we define
f(e1,e2,...,en)=1
Then we have the key lemma:
Lemma
f(ek1,ek2,...,ekn)=−1
if k1,k2,...,kn can be recovered to 1,2,...,n by odd number of neighboring swaps and
f(ek1,ek2,...,ekn)=1
if k1,k2,...,kn can be recovered to 1,2,...,n by even number of neighboring swaps.
Proof.
The key is to prove that we swap two neighboring vectors, then the sign of the volume change:
Indeed, in a similar manner, we can prove that for any h:Rn×n→Rn linear function, there exists a vector h, such that
h(x)=h⋅x
Conventionally, d is called the cross product of v2,...,vn is written as
d=v2×v3×...×vn
It has some interesting properties:
d is perpendicular to the subspace spanned by v2,...,vn, as d⋅vi=det(vi,v2,...,vn)=0 for 2≤i≤n.
For any x∈Rn, d⋅x gives the signed volume of the parallelotope spanned by x,v2,...,vn.
When n=2, the length of d equals to that of v2.
When n=3, the length of d equals to the area of the parallelogram spanned by v2,v3. Combined with the fact that d is perpendicular to v2,v3, we see why d⋅x gives the volume of the parallelotope spanned by x,v2,v3: it takes the projection of x to the direction that is perpendicular to v2 and v3, scaled by a factor of the area spanned by v2 and v3.
The direction given of d is given by right hand rule, when n=2 or n=3.
□
Cramer's Rule
Cramer's rule is a formula for solving linear equations. In particular, given an invertible matrix A∈Rn×n, and vector b∈Rn, then the solution for the equation
Ax=b
is given by (∀i∈[n]),
xi=det(A)det(Ai)
where xi is the i-th coordinate of x and Ai is the matrix formed by replacing A's the i-th column by column vector b.
To understand the formula, we view A as a mapping T:Rn→Rn that takes ei(i∈[n]) to A[:,i], i.e.,
T(ei)=A[:,i]
where A[:,i] is the i-th column of A. The image of the hypercube
⎩⎨⎧i∈[n]∑λiei:λi∈[0,1],∀i∈[n]⎭⎬⎫
is given as
⎩⎨⎧i∈[n]∑λiA[:,i]:λi∈[0,1],∀i∈[n]⎭⎬⎫
Original the hypercube has volume 1. After the transformation it has volume det(A). One interesting fact about linear transformation is that it preserves volumes ratio. Define V(⋅) the volume of a parallelotope.
Fact. For any parallelotope P, its volume under transformation T is given by
det(A)V(P)=V(T(P))
Now, we rewrite the Cramer's rule as
det(A)xi=det(Ai)
Its meaning is clear: there is a parallelotope P whose volume is xi and after the transformation it has volume det(Ai).
It is left to verify that the parallelotope indeed exists.
We observe that det(Ai) can be viewed as the volume of the following parallelotope formed by