
Why is it important for a matrix to be square? (2018) - luu
https://math.stackexchange.com/a/2811960/18947
======
solinent
An extension of spectral decomposition on a square matrix is called the
singular value decomposition where _any_ matrix can be decomposed. The trick
is to diagonalize the matrix A A^T and A^T A, in this manner we can find the
left and right singular values and have an equation which is very similar to
the spectral decomposition. It has a very wide range of applicibility--most of
which is also highly valuable.

There's also the Moore-Penrose pseudoinverse which also has plenty of
applicaitons and works on non-square matrices.

~~~
bulldoa
curious, what are some cool application of SVD?

~~~
solinent
Off the top of my head,

\- Principal component analysis

\- Fitting a plane to a set of points

\- Linear least squares

~~~
chestervonwinch
All of these examples are equivalent to least squares :)

~~~
solinent
Yeah, for the most part all of engineering is equivalent to least squares I'd
say, there's always some non-linear optimization procedure that uses a norm^2
metric since it's so well studied and solved already. It's disappointing as a
mathematician, but the rest of me is fine with it :)

------
mumblemumble
If you're looking for a more intuitive understanding of linear algebra, I
highly recommend 3blue1brown's YouTube series, "Essence of Linear Algebra."

~~~
Izkata
Absolutely this. If I remember right, it's roughly 13 videos of 20-30 minutes
each. By the end I had a better understanding of what linear algebra was for
and (conceptually) how the math actually worked than I got from a full
semester at college.

------
akater
Another evidence that linear algebra concepts are terribly confusing when
layed out without geometric background.

This had been criticised for decades. Competently and popularly presented
criticism goes back to at least as far as 1957 (Artin's Geometric Algebra; see
discussion of determinants somewhere near the beginning) but linear algebra is
still often presented decoupled from geometry.

I wonder though if there's purely algebraic approach to matrices that explains
as much (or more) as geometric one. Maybe approaching algebra of matrices
consistently as an example of category algebra could be illuminating.

~~~
dnautics
I learned abstract linear algebra first, and didn't learn geometrical
interpretations until I taught myself many years later so I could write an
asteroids clone in svg.

I don't think it was a pedagogically a problem, except I couldn't bring myself
to care about matrices when I was learning them... It was very easy to take my
abstract knowledge and apply it, and for me it might have been harder the
other way around.

In retrospect a hybrid applied/theoretical topic (like reed Solomon encoding
and recovery) might have perked me up. But I might have also been a strange
case.

~~~
akater
If by “abstract” linear algebra you mean “course that starts with the
definition of vector space”, then it is geometric enough in the sense Artin
talks about.

It is pedagogically a problem for people who ask questions like the one in
topic. But it can also be a problem when one encounters bilinear form and
linear operator in practice but can't distingish between the two. I can't
think of a specific example but I was asked once about some problem (in
electrical engineering, iirc) where the source of confusion was this; some
transformations of a (square) matrix were natural while others were not.

Some people feel strongly about the topic—mostly those with “pure math”
inclinations.

------
anonytrary
I think the answer here is simple and not as profound as people might think.
Square matrices are linear operators which map an input vector into a space
with the same dimensionality. We can characterize a few interesting symmetries
when a matrix happens to be square.

As such, we have more rules and theorems around them, making them suitable for
practical usage. For example, physics deeply utilizes Hermitian matrices,
which are a special subclass of square matrices. Spectral theory is incredibly
important in all sorts of applications.

~~~
anonytrary
Square matrices are also a natural description for graphs (e.g. adjacency
matrices), which are fundamental objects for pretty much _all_ CS applications
across all layers of your tech stack. Square matrices are great for
representing pair-wise interactions between nodes.

------
prostodata
In the context of computer science, matrices are used as a representation
construct with different possible formal interpretations which frequently can
be recognized depending on the supported operations. For example, some
functions of NumPy assume that matrices represent elements of linear algebra
while other functions treat a matrix as a collection of rows or columns. In
the latter case, a square matrix is probably an exception because rows and
columns have completely different semantics.

------
zeroimpl
The question as asked in the title is incorrect. It is not important for a
matrix to be square. Matrices are defined to solve specific problems, and the
specific problem is what determines the geometry, not some goal of having
square matrices.

However the person actually asked why it is important for matrices to be
square _for most of the theorems they are learning_. The actual answers to
this are interesting, but the presence of this question likely implies that
they are being taught abstract theory first prior to building much intuition.

I was taught this way as well in my advanced pure math course. It was all
super abstract until I was studying for the final exam and then had this
eureka moment where suddenly everything made sense (a matrix is just a
numerical way of describing a linear transform! And computing eigenvectors is
like factoring!). Sadly, this happened again the next term where we derived
SVD - except this time it never made sense to me until a later on course where
we needed to use SVD for some application.

------
Item_Boring
The reason the matrix A has to be square for det(A-X _I_n) is a) because we
cannot subtract a matrix A from another matrix B if their dimensions aren’t
the same and since X_ I_n is a nxn matrix A has to be an nxn matrix as well
and b) because the determinant is only defined for square matrices.

------
raincom
V.I. Arnold said: "The determinant of a matrix is an (oriented) volume of the
parallelepiped whose edges are its columns. If the students are told this
secret (which is carefully hidden in the purified algebraic education), then
the whole theory of determinants becomes a clear chapter of the theory of
poly-linear forms. If determinants are defined otherwise, then any sensible
person will forever hate all the determinants, Jacobians and the implicit
function theorem."

From: [https://www.uni-
muenster.de/Physik.TP/~munsteg/arnold.html](https://www.uni-
muenster.de/Physik.TP/~munsteg/arnold.html)

------
ptero
TLDR: the author is asking an honest question, not trying to say that non
square matrices have little use in linear algebra.

As linear transformations of space into itself, a very frequent operation, are
described by a square matrix those matrices do show up more frequently. But
map X into Y of different dimensions and you get a non-square matrix

~~~
thaumasiotes
> But map X into Y of different dimensions and you get a non-square matrix

This is true, but it's also something that is arguably impossible on the one
hand and "unwise" on the other.

You can easily map a higher-dimensional space into a lower-dimensional space,
but you will irretrievably lose a lot of information when you do so.

And in the other direction, you can't actually map a lower-dimensional space
into a higher-dimensional space with a matrix. The image of X can never have
more dimensions than X does -- the choice to represent it with Y > X
dimensions is just that, a representational choice. This idea is only
meaningful in terms of the semantics behind the representation.

~~~
afwaller
Sometimes losing that information is very useful however, to arrive at a
representation that has a specific meaning.

For example, an x-ray computed tomography (CT) image volume in 3D may be
projected into various 2D synthetic planar x-ray projections (digitally
reconstructed radiographs).

There are countless situations where projections are very useful.

~~~
unsrsly
In fact, the 3D CT image itself is reconstructed from projections! See
[https://en.wikipedia.org/wiki/Tomographic_reconstruction](https://en.wikipedia.org/wiki/Tomographic_reconstruction)

~~~
thaumasiotes
Yes, but this is a case where you have three dimensions in the input and also
three dimensions in the output. (You're assembling the 3D image from different
2D slices with different depth coordinates.)

The third dimension is discretized while the other two are continuous; the
reconstruction consists of smoothing out the third dimension.

~~~
unsrsly
In the real world, all of the dimensions are discretized. The input dimensions
are theta (gantry angle), n (detector channel), and z (table position). The
output dimensions are x, y, z. For a fixed z, the plot of projection intensity
as a function of theta and n is called a "sinogram" (which is indeed a 2D
space) which gets reconstructed to form an image (also 2D). It is true that
there are three dimensions of raw data and three dimensions of reconstructed
image. However, due to various tricks with reconstruction models, the total
number of samples does not have to be the same in the raw data and in the
output. As a result you can see recon models employing nonsquare matrices. For
more information, you can read about methods like iterative reconstruction,
compressed sensing, and differentiated backprojection. This description is
adequate for axial tomography, whereas other geometries like cone beam
tomography are more complicated (see FDK method).

------
Ceezy
It s not more important! And most of these theorems can be extended to non
square matrix anyway. Projections are examples of Rn to Rm applications that
are very importants. Coordinates or probability measures too. And it make
little sense to try to reduce them to endomorphism. Matrix can represent
applications but they are objects worth studying for what they are.

------
Koshkin
The most important example of a non-square matrix is a (column) vector.

------
Synaesthesia
An mxn matrix can be thought of as a mapping or function from one subspace Rn
and another Rm. If n=m and the matrix is square, it is possible to have an
inverse mapping, (inverse matrix).

------
raverbashing
Well, because matrices are "weird" mathematical objects. They're a composition
of vectors (which make more sense than matrices) but it seems the square
matrices are where you want to end up and non-square ones are kinda like
special cases.

If you're solving a linear system of equations for example: you need a square
matrix. If you don't either your system is underdefined or you have
redundancies or contradictions into it.

(And one could say algebra with numbers is a special case of a 1x1 matrix, but
anyway...)

So worry about square matrices, about 1xN and Nx1 matrices (which are actually
vectores) and the weird shapes are weird shapes

~~~
gspr
What? They're a convenient device for writing down a linear map between
finite-dimensional vector spaces. Nothing more, nothing less.

Your explanation is bound to confuse people far more than help, as it seems to
mystify something that is very mundane.

~~~
raverbashing
Yes they're mundane, but the "linear map between different vector spaces" case
is pretty much the only thing they can do.

Think of it as type casting in programming languages, you only do it when you
need, but the real work is done processing elements of the same type.

If that wasn't the case, then non-square matrices would have all the "cool"
properties of the square ones.

Yes I might be picking at straws here, and I agree it might confuse people
even more, but this weirdness of matrices hasn't escaped me since I've learned
about it. And then when you get to vectors it all makes sense. Hum...

~~~
gspr
> Yes they're mundane, but the "linear map between different vector spaces"
> case is pretty much the only thing they can do.

 _Of course_ it's all they "can do". They're merely a way of writing down
linear maps for a given choice of bases.

~~~
raverbashing
Yes. Then they're a "different" object than a square matrix or a vector.

My point is, the sub-algebra of all square matrices supports more operations
than mixing matrices of different sizes.

