# [Haskell-cafe] matrix computations based on the GSL

Henning Thielemann lemming at henning-thielemann.de
Fri Jul 8 13:38:50 EDT 2005

On Fri, 8 Jul 2005, Keean Schupke wrote:

> Henning Thielemann wrote:
>
> >On Fri, 8 Jul 2005, Keean Schupke wrote:
> >
> >>So the linear operator is translation (ie: + v)... effectively 'plus'
> >>could be viewed as a function which takes a vector and returns a matrix
> >>(operator)
> >>
> >>    (+) :: Vector -> Matrix
> >
> >Since a matrix _is_ not a linear map but only its representation, this
> >would not make sense. As I said (v+) is not a linear map thus there is no
> >matrix which represents it. A linear map f must fulfill
> > f 0 == 0
> >
> >But since
> > v+0 == v
> >  the function (v+) is only a linear map if 'v' is zero.
> >
> > I can't see how to fit in your vector extension by the 1-component.
> >
> >
> >
> Eh?

Today:

+----------------+
| The Linear Map |
+----------------+

If F is a field, V a set of vectors, and (F,V,+,*) a vectorspace then a
function f of V -> V is linear if:

for all x and y from V            f (x+y) == f x + f y
for all k from F and x from V     f (k*x) == k * f x

Lemma

If f is a linear map, then f 0 = 0.

Proof: For any v from V it is v+(-1)*v = 0.
f 0 = f (v+(-1)*v) = f v + f ((-1)*v) = f v + (-1) * f v = 0

Theorem

If (v+) is a linear map then v == 0.

Proof: (v+0) == 0 (conclusion from the lemma)
=>  v == 0

8-]

> (or the second by the first - the two are isomorphic)... A translation
> can be represented
> by the matrix:
>
>     1   0   0   0
>     0   1   0   0
>     0   0   1   0
>     dx  dy  dz  1
>
> So the result of "v+" is this matrix.

But the vectors I can add to v have one component less than necessary for
multiplication with this matrix.

Indeed you can map all v's with three components to an affine sub-space of
the 4-dimensional space, namely to those vectors with a 1 in the last
component. But you are no longer working with three dimensional vectors
but with four-dimensional ones. Again: isomorphy is not identity.