I asked a similar question before, but I did not get a satisfactory response, and people misunderstood the question. In mathematics books and classes, the author or teacher is not looking merely for the correct value, but also the correct expression. So, in a calculus class, if we are asked to compute the derivative of $x$, we would be marked wrong by the teacher if we simply wrote "the derivative of $x$ is the derivative of $x$", even though it is still a true statement. Or, in a set theory class, if we are asked to compute the Cartesian product $\{1,2\} \times \{2,3\}$, we would probably be again marked wrong if we simply wrote $\{1,2\} \times \{2,3\}$ as the answer. Or, even more basically, if we are asked to compute $2 \times 4$, we would be marked wrong in elementary school class by just writing $2 \times 4$. So, with those examples in mind, is there a rigorous definition somewhere, in some math or logic or computer science textbook, that defines what a mathematical expression is, such that different expressions like $2 \times 4$ versus $8$ are indeed technically distinct objects? It has to be broad enough to allow pretty much all mathematical expressions, such as "the derivative of $x$", $\{1,2\} \times \{2,3\}$, $2 \times 4$, $8$, etc.
-
3Of course. You can very much talk about the set of arithmetic expressions — formulas formed from numbers and arithmetical operators and parentheses, say, accodiring to a specific set of rules (a grammar) — and its elements are certainly different from the values that those expressions may or may not have. – Mariano Suárez-Álvarez Nov 21 '22 at 21:52
-
5A single one, for all mathematical fields? No. Do math profs expect students to use their common sense and human ability to understand context to answer questions correctly? Yes. Are mathematicians as literal-minded as computers? Generally no. – JonathanZ Nov 21 '22 at 21:59
-
3People do this all the time in logic. You can fix a vocabulary $V$ and then define the set of all $V$-terms - that is, the set of all expressions that can be formed using the vocabulary $V$. So if your vocabulary includes integer constant symbols and the $\times$ operation, you can consider the two terms $2 \times 4$ and $8$. These are distinct terms; in the "intended model" of $\mathbb{Z}$, they have the same interpretation. To accomodate sets and numbers, you'd want to use multi-sorted logic. – Mark Saving Nov 21 '22 at 22:22
-
2When you figure it out, you can write answers to all the posts here about $0.\overline{9} \ne 1$. – GEdgar Nov 22 '22 at 01:30
-
Interesting. Is "$-3$" the name of a number or is the the result of negating $3$? Is "$\frac12$" the name of a number or is it an expression signifying a division problem? – GEdgar Nov 22 '22 at 01:33
-
@GEdgar -- this depends quite strongly (at least with respect to my answer) on the specifics of the system you want to use. For instance, some people allow "$3$" and "$-3$" to both be basic symbols (which would of course be values in any reasonable system), but you might instead want to only have finitely many "basic" symbols, in which case the normal form might be $1+1+1$ and $0 - 1 - 1 - 1$ respectively. These kinds of questions very rarely have an impact on the broader theory, and to a certain extent, it's a matter of taste. – HallaSurvivor Nov 22 '22 at 01:41
1 Answers
Here is one possible answer to this question:
When working in a particular subject, we usually have syntax associated to the objects in question. For instance, if we're asking questions about $\mathbb{Z}$, we might allow ourselves symbols like $+$, $\times$, $\leq$, as well as numerals like $0$, $1$, $-5$, or $42$.
There are consistent rules for how we can fit these symbols together into terms (which name a certain number) and formulas (which name a truth value about numbers).
For instance, $14 \times 3$ is a term (it represents a number), and $14 \leq 3 \times 2$ is a formula (it represents a statment about numbers, which is either true or false). If we allow variables, then we can make more complicated terms (like $3 + x$) and more complicated formulas, like $\forall x . x \leq x+1$. This won't be relevant for this post, since we'll be focusing on terms, but it's good for cultural growth.
Now. It's clear that multiple terms can represent the same element of $\mathbb{Z}$. For instance, $14 \times 3$, $37 + 5$, and $42$. A reasonable question is whether there's a canonical term representing some element of $\mathbb{Z}$. For many systems there are rewrite rules that tell you how to convert one term into another. For instance, if we're intersted in calculus, we might be interested in terms built from $+$, $\times$, $x$, etc. as well as a special symbol called $\frac{d}{dx}$. Then a rewrite rule might be something of the form
$$ \frac{d}{dx} x^5 \leadsto 5 \times x^{4} $$
now one can prove that every expression involving $\frac{d}{dx}$ can be converted, via these rewrite rules, into an expression that does not contain $\frac{d}{dx}$. Allowing for other rewrite rules that allow us to group like powers, etc. we can prove a theorem saying there is a unique canonical term in each rewrite equivalence class. This is called a normal form, or, if you're a programming language theorist, a value. (NB: In general, normal forms need not be unique, though in many systems arising in practice this will be the case. Some people say canonical form when they want uniqueness, though the exact distinction between normal forms, canonical forms, and values has always been slightly murky to me).
When we do a computation, one can argue that we're "really" applying rewrite rules until no more rewrite rules apply. This actually gives us a purely syntactic way of interpreting the structure we're trying to study (which is called operational semantics for our syntax). For many "nice" systems, there are theorems that tell us we can always reduce to a value -- these theorems are often called "Progress and Preservation" in the PL theory literature. Through this lens, the difference between $4 \times 2$ and $8$ is that the latter is a value, while the former is not. But we can convert from the former to the latter by applying a rewrite rule.
If you're interested in learning more about this, you'll likely be interested in Bob Harper's Practical Foundations for Programming Languages (which is where I learned about a lot of this stuff). The first two chapters already have a good chance of answering many of your questions. I've also heard good things about Klop's Term Rewriting Systems, but I admit I haven't read it myself.
I hope this helps ^_^
- 38,115
- 4
- 46
- 87