is a one-by-one-matrix just a number (scalar)?
I was wondering. Clearly, we cannot multiply a (1x1)-matrix with a (4x3)-matrix; However, we can multiply a scalar with a matrix. This suggests a difference.
On the other hand, I was, for example, in an econometrics lecture today, where we had for a (Tx1)-vector $\underline{û}=\left( \begin{array}{c} û_1\\ \vdots\\ û_T\end{array}\right)$:
$S_{ûû}:= \sum_{i=1}^T û_i^2$ shall be minimized. We see see that $S_{ûû}=\underline{û}^T\underline{û}$.
Well, formally, shouldn't it be $(S_{ûû})=\underline{û}^T\underline{û}$ or $S_{ûû}=\det(\underline{û}^T\underline{û})$, to ensure that we stay in the space of matrices and not suddenly go to the space of scalars? So here, the professor (physicist) not only treats $\underline{û}^T\underline{û}$ like a scalar, but also calls it a scalar. Is this formally legit or a wrong simplification (though it does not seem to have any impact, and surely makes life easier)?
It's just a scalar in the sense that the ring of $1\times 1$ matrices over a field $K$ is isomorphic to $K$ (by the map $[x]\mapsto x$), but, as you observed, when you're considering the interaction of matrices of different sizes, then you have to treat them differently.
Any matrix $A$ carries with it a type $(m,n)$ with $m$, $n\in{\mathbb N}_{\geq1}$. In fact such an $A$ is nothing else but a map $$A:\quad[m]\times[n]\to K\ ,\qquad (i,k)\mapsto a_{ik}\ .$$ When ${\rm type}(A)={\rm type}(B)$ then the sum $A+B$ is defined, and if ${\rm type}(A)=(m,n)$, ${\rm type}(B)=(n,p)$ then the product $AB$ is defined and has type $(m,p)$.
When $m=n=1$ then $A=[a]$ for a single number $a$ in the ground field $K$, e.g., $a\in{\mathbb R}$. Unfortunately there is no established notation to extract this $a$ out of the matrix $A$, just the same as there is no notation to extract the element $a$ out of the one-element set $\{a\}$. At any rate the map $[a]\mapsto a$ is well defined.
In the reverse direction things are more worrying. With any $c\in K$ we can form the $(1,1)$-matrix $[c]$ in a unique way. But note that the product $[c] \,A$ is only defined if $A$ has just one row (i.e., is of type $(1,n)$), and the product $A\, [c]$ is only defined if $A$ has just one column (i.e., is of type $(m,1)$).
Contrasting with this is the fact that the scalar multiple $c\,A$ is defined for all $c\in K$ and any matrix $A$, whatever its type. The effect of left-multiplying $A$ by the scalar $c$ is, that all elements of $A$ are multiplied by $c$. If you want to realize that by means of a matrix product you have to replace the scalar $c$ by a square diagonal matrix ${\rm diag}(c,c,\ldots, c)$ of the appropriate size.