10

A matrix is usually informally defined as a rectangular array of numbers. To make this definition formal, we can define a matrix as a map from $\{1,...,m\} \times \{1,...,n\}$ to the underlying field of scalars, where $\times$ denotes cartesian product. However, a subtle complication arises when $m=0$ or $n=0$. In that case, the matrix would be an empty function. The problem, however, is that there is then no way to distinguish between $m \times 0$ matrices from $0 \times n$ matrices. In fact, under the cartesian product definition, for all natural numbers $m$, $m'$, $n$, and $n'$, the $m \times 0$, $m' \times 0$, $0 \times n$, and $0 \times n'$ matrices are all the same entity, namely the empty function. This is, to me, an undesirable state of affairs. I want to be able to distinguish, for example, $2 \times 0$, $3 \times 0$, $0 \times 2$, and $0 \times 3$ matrices. Is there a better definition of matrix that some mathematician has written about in some paper or book that avoids that problem?

Gary
  • 31,845
user107952
  • 20,508

4 Answers4

10

A $m\times n$ matrix is a representation of a mapping from a $n$-dimensional vector space to a $m$-dimensional vector space. In that sense, a $0\times m$ matrix is different from a $n\times 0$ matrix. While they both represent the mapping we call "the zero mapping", the zero mappings are different mappings.

In other words, instead of speaking of mappings from $\{1,\dots,m\}\times\{1,\dots,n\}$, you can speak of linear maps from $\mathbb F^n$ to $\mathbb F^m$ (usually denoted something like $\mathcal L(\mathbb F^n, \mathbb F^m)$), and instead of speaking of a $0\times m$ matrix, you can speak of the element of $\mathcal L(\mathbb F^0, \mathbb F^n)$. That element (there is only one) is different from the element of $\mathcal L(\mathbb F^m, \mathbb F^0)$.

5xum
  • 123,496
  • 6
  • 128
  • 204
  • 1
    I'd add for learners that in introductions to matrices, usually the field $\mathbb{F}$ is $\mathbb{R}$, or possibly $\mathbb{C}$. – aschepler Dec 21 '21 at 13:44
  • This gets into some complications though. The issue is that in mathematics, two incompatible definitions of the word "function"/"mapping" tend to be used simultaneously, and due to a correspondence in definitions, we tend to interchange between the two according to convenience and context. If one defines a function as a graph, which is one of the standard definitions, then there actually is no meaningful distinction between empty functions, and so one speaks of the empty function. Martin Argerami's answer does a good job at highlighting and explaining why this is the case. – Angel Dec 21 '21 at 14:52
  • So it is not entirely clear that what is highlighted in your answer is sufficient for solving the problem, and it especially becomes difficult when considering that matrices themselves have multiple definitions. Matrices can be considered as a set $(\mathbb{F}^n)^{(\mathbb{F}^m)},$ or they can be considered as sets $\mathbb{F}^{m\times{n}},$ and the reason one can do this is because both sets, with ring operations, are ring-isomorphic. So any distinction between "empty matrices" in this case is necessarily artificial. – Angel Dec 21 '21 at 14:56
  • 1
    @Angel No, the difference is not artificial. The difference is an actual difference. There exists precisely one element of $\mathcal L(\mathbb F^0, \mathbb F^m)$, and that element is not the empty function. It is the mapping that maps the zero element of $\mathbb F^0$ (which, again, is not an empty set, but contains one element) to the zero element of $\mathbb F^m$. This mapping is not the same mapping as the one in $\mathcal L(\mathbb F^n, \mathbb F^0)$ – 5xum Dec 21 '21 at 15:02
  • @5xum The reason I answered the way I did is due to your first paragraph, which talks about the distinctions between empty functions. This distinction is what I claimed is completely artificial. I was not talking about the distinction between the function from $\mathbb{F}^0$ to $\mathbb{F}^n$ and the function from $\mathbb{F}^m$ to $\mathbb{F}^0.$ Incidentally, your first paragraph has essentially no relationship to your second paragraph. I never addressed your second paragaph at all. – Angel Dec 21 '21 at 15:49
  • @Angel In my first paragraph, I don't talk about empty functions. Indeed, there is only one empty function. However, I talk about the zero mapping, which is not empty. – 5xum Dec 21 '21 at 15:52
  • @5xum In that case, you need to formally clarify what is the distinction between a map and a function, because in the terminology that I see most mathematicians use, they are synonymous and interchangeable words, referring to the same type of object. – Angel Dec 21 '21 at 15:56
  • 1
    @Angel In this answer, I use map and function interchangeably. In fact, I only used the word function once, in the sentence "the zero mappings are different functions" which I now changed to "the zero mappings are different mappings." even though I don't see why thatwould be any more clear. In any case, I was never speaking about the empty function/map/mapping/whateveryouwanttocallit. I was always speaking of the zero function/map/mapping/weywtci. – 5xum Dec 21 '21 at 19:23
  • @5xum Fair enough, it looks like I misread your answer and your previous replies as well. That is my mistake. – Angel Dec 21 '21 at 20:02
3

If $m$ and $n$ are positive integers, then an $m \times n$ matrix with entries in a non-empty set $\mathbb{F}$ (usually but not always a field) is often defined as a function of a 'row' index in the set $\{1, \ldots, m\}$ and a 'column' index in the set $\{1, \ldots, n\}.$

Such a 'function of two variables' invariably tends to be formalised in set theory as a function defined on the Cartesian product set $\{1, \ldots, m\} \times \{1, \ldots, n\}$ and taking values in the set $\mathbb{F}.$

But that is not the only way to do it, and doing it another way gives you the desired distinct concepts of $m \times 0$ and $0 \times n$ matrices, for all non-negative integers $m$ and $n.$

If $A$ and $B$ are sets, the set of all functions $A \to B$ is usually denoted by $B^A$ (although personally I can see no objection to simply writing the set as $A \to B,$ and I'm glad to see this notation used in the Wikipedia article on Currying). A function of two variables, taking its first argument from a set $A$ and its second argument from a set $B,$ and taking values in a set $C,$ is naturally represented as a function $A \to C^B.$

The usual set-theoretic representation of a function $f \colon X \to Y$ is as an ordered triple $(X, Y, G)$ (this in turn may be represented as an ordered pair $((X, Y), G),$ as in @Angel's answer), where $G$ is a set of ordered pairs $(x, y),$ such that $x \in X,$ $y \in Y,$ and there is exactly one value of $y$ for each value of $x \in X.$

Such a representation ensures that both the domain $X$ and the codomain $Y$ are part of the information contained in $f.$

In particular, the set $A$ is part of the information contained in a function $f \colon A \to C^B.$ Also, for any set $B$ and any non-empty set $C,$ the set $C^B$ is non-empty, i.e., there is always at least one function $B \to C.$ Given $f \colon A \to C^B,$ we know the codomain $C^B.$ Given any element of $C^B,$ i.e., any function $B \to C$ (it doesn't matter which one), we know its domain $B.$ Thus, unless the set $C$ is empty, both $A$ and $B$ are part of the information contained in a `function of two variables' $f \colon A \to C^B,$ regardless of whether either $A$ or $B$ is empty.

If $B$ is empty, then there is exactly one function $B \to C,$ therefore there is exactly one function $A \to C^B.$ In the ordered triple representation, it is: $$ (A, \{(\emptyset, C, \emptyset)\}, \{(x, (\emptyset, C, \emptyset)) : x \in A\}). $$

If $A$ is empty, then, more straightforwardly, there is also exactly one function $A \to C^B,$ and in the ordered triple representation, it is: $$ (\emptyset, C^B, \emptyset). $$

In particular, if an $m \times n$ matrix with values in a non-empty set $\mathbb{F}$ is represented as a function $$ \{1, \ldots, m\} \to \mathbb{F}^{\{1, \ldots, n\}}. $$ then for each $m \geqslant 0,$ there is a unique $m\times0$ matrix with entries in $\mathbb{F},$ and its standard set-theoretic representation is $$ (\{1, \ldots, m\}, \{(\emptyset, \mathbb{F}, \emptyset)\}, \{(i, (\emptyset, \mathbb{F}, \emptyset)) : 1 \leqslant i \leqslant m\}), $$ and for each $n \geqslant 0,$ there is a unique $0\times n$ matrix with entries in $\mathbb{F},$ and its standard set-theoretic representation is $$ (\emptyset,\mathbb{F}^{\{1,\ldots,n\}},\emptyset). $$

  • Perhaps I should have remarked that it may often be convenient or natural to regard an $m \times n$ matrix as a sequence of $n$ columns of height $m,$ rather than a sequence of $m$ rows of width $n.$ In this case, it is represented as a function $$ {1, \ldots, n} \to \mathbb{F}^{{1, \ldots, m}}. $$ The conclusions still hold, with the obvious modifications. – Calum Gilhooley Dec 28 '21 at 15:13
2

Not entirely sure what you are aiming for.

The "problem" you find is similar to the fact that $\varnothing \times\{1\}=\varnothing=\varnothing\times \{2\}=\mathbb R\times\varnothing$. The empty set is precisely the only set that is empty. You seem to want different kinds of empty sets, that would have to be distinguished by some kind of metadata. Since there are no matrices of size $2\times0$ nor any matrices of size $0\times3$, you cannot distinguish between them; there is no $2\times0$ matrix that is not $0\times3$, and vice versa.

Martin Argerami
  • 205,756
  • 2
    Some programming languages are able to distinguish them though: Fortran, for instance. It's useful to later concatenate and still check dimensions. Granted, it's not really maths, but it may at least show the concept is not totally useless. – Jean-Claude Arbaut Dec 21 '21 at 13:20
  • @Jean-ClaudeArbaut But that is a strawman response: no one is saying the concept is useless. The OP is specifically asking about formalizing the concept, not about its utility, and the answer is explaining why attempting to formalize in the specific way that OP wants does not make sense in light of the current paradigm of mathematics, and in particular, function theory. You are right that it is useful, but that is not the point. The point is that what OP is trying to achieve is not really consistent with how we understand mathematics formally today. – Angel Dec 21 '21 at 14:49
  • @Jean-ClaudeArbaut It is a matter of definition, and I acknowledged as much within my answer. But not every definition you can come up with is coherent or self-consistent. That is why mathematical rigor is a thing that exists when studying mathematics. I never said anything about revolutionizing mathematics, and neither did Martin Argerami's answer, which is the answer you are replying to. We are just addressing the specific approach presented by OP. – Angel Dec 21 '21 at 16:49
  • @Jean-ClaudeArbaut I am convinced you do not understand my argument at all. I am aware that $0\times{n}$ matrices and $m\times0$ are well-defined in mathematics, and I have acknowledged as much implicitly. I also am aware that there are two different definitions of function that are utilized in mathematics. From the language and context of OP's post, it appears implied that they are talking about the Cartesian definition of a function. But with that definition, there is only one empty function. That cannot be changed. I am aware that with the category-theoretic definition,.. – Angel Dec 21 '21 at 18:27
  • ...there can be multiple empty functions. The problem is that OP is not using that definition. OP is asking for a way to have multiple empty functions with the Cartesian definition of a function. That is impossible. If OP wants to do the formalization they want, then they need to use the category-theoretic definition. You pointed out an approach used in programming languages, but that is the category-theoretic definition, so it does not actually address what Martin or I have said. Martin's answer is pointing out the contradiction in having multiple empty functions with the Cartesian definition – Angel Dec 21 '21 at 18:30
  • ...while my answer, not in this reply thread, makes it explicit that the matrix definition he wants requires the category-theoretic definition, not the Cartesian definition. Also, I have no idea why you are going on about rigidity. I am aware people make new definitions all the time. But definitions in mathematics that become accepted are never self-contradicting But the way OP wants to do things, having multiple empty functions with the Cartesian definition of function, is self contradicting. Also, there are ways to define 0-dimensional matrices that do not use empty functions. – Angel Dec 21 '21 at 18:32
1

Underlying this issue that you have is a broader issue pertaining the definition of "function" in general. There are two incompatible definitions of function that, nonetheless, have a natural correspondence in many context, and so whenever it is convenient, we freely change definitions without specifying it. For mathematicians who are accustomed to this practice, this is not a problem, but it can be confusing to anyone who has not been introduced to this peculiarity of mathematics.

A function can be defined as $((X, Y), G),$ where the ordered pairs are Kuratowski pairs, where $X$ is the domain, $Y$ is the codomain, and $G$ is the graph. $G\subset{X\times{Y}},$ where the Cartesian product $X\times{Y}$ is the set of all Kuratowski pairs $(x,y)$ with $x\in{X}$ and $y\in{Y}.$ For $((X, Y), G)$ to be a function, it must satisfy an axiom: that for all $x\in{X},$ there exists a unique $y\in{Y}$ such that $(x,y)\in{G}.$

On the other hand, in some instances, a function is instead defined as the set $G$ itself. The set $G$ carries a structure that uniquely identifies $X,$ but not $Y.$ Meanwhile, the previous definition does uniquely correspond to some $Y,$ all other things unchanged. So this is where your issue lies: if we go by the latter definition of a function, there really is only one empty function, because there is only one empty graph. But in the former definition, there are multiple empty functions, with the same empty graph and empty domain, but different codomains.

It seems to me like what you are looking for is using the former definition of function for your formalization.

Angel
  • 3,774
  • 12
  • 14
  • The problem, though, is that the Cartesian product of the empty set with any set is the empty set. So, the domain in each case of m by 0 and 0 by n matrices is the empty set. So, I guess the best way to define a matrix is as an ordered triple (m,n,f), where m and n are the dimensions of the matrix, and f is the function itself. – user107952 Dec 22 '21 at 19:17
  • @user107952 That is unnecessary. My answer already addressed this: do not use the Cartesian definition of "function." Then the fact that Cartesian product of the empty set with any set is the empty set is irrelevant. – Angel Jan 03 '22 at 12:55