5 ms·
A lot of the problems with mathematical notation, I think, are solved problems in programming languages. Mathematicians could learn a lot from programmers in th
by gabrielgoh 9y ago
A lot of the problems with mathematical notation, I think, are solved problems in programming languages. Mathematicians could learn a lot from programmers in this regard
- Variable Scope. In mathematical writing, the convention is that every variable is a global variable - and in a paper you quicky run out of variable names to use. There should be a way to declare the scope of a variable. For this chapter only, x is this vector.
- Strict Typing. You skim a paper, and you see "x + y". But what is x? a matrix, a vector, a scalar, an operator, a set, a random variable, you have no idea. The "+" operator is so overloaded x and y could be anything. Having to hunt down the definitions for every variable is a time consuming and frankly wasteful process. Conventions are built up around this (upper case letters A,B at the beginning of the alphabet are matrices, but upper case letters at the end X,Y are random variables) but they are mostly rater silly. There needs to be an easy way to infer the type of a variable quickly.
- Anonymous Objects. There is no way to declare a function without either giving a name to it (f(x) = x^2) or at least declaring its input symbols (x |=> x^2). But you can't go, say
(x |=> x^2)(y). Using a symbol to represent a disposable function seems a waste of a valuable global variable (see again, 1) and is inelegant.
- vlasev 9y ago> Variable scope This goes against the very nature of what mathematical variables are like! The whole point is that the symbols are suggestive. This kind of thing allows the reader to quickly get up to speed with what the symbols are all about. As a side-effect, an unconventional use of symbols is usually quite grating to the experienced mathematician. Usually: - x, y, z stand for variables - i, j, k stand for subscripts and superscripts - m, n stand for integers - theta, phi stand for angles - alpha, beta stand for real numbers of some sort - capital letters are usually sets, transformations and such > Strict typing Again. Mathematics is about abstraction. Here "+" means that you can add the two objects, whatever they are. That's all there is to it. Of course, they are mentally typecast to the more general type. The point of this overloading is that, again, its suggestive nature makes it easier to read and write. The abuse is so pervasive that something like 1 + A can easily mean that, yes, 1 is the identity matrix. > Anonymous Objects I agree. Although it's much easier to, once and for all, declare "Let f(x) = x^2" and use "f" instead of the anonymous function every time. All that this kind of thing highlights is, IMHO, the fundamental difference between being a mathematician and being a software developer (and I've said it before if you look through my comment history): - Mathematicians manipulate a given symbol, often in the thousands of times, in their heads or on paper - Software developers read a given line of code, often in the thousands of times, in order to understand what the code does These differences drive, IMHO, 99% of the difference in notation.
- dmurray 9y ago> As a side-effect, an unconventional use of symbols is usually quite grating to the experienced mathematician. There's a great spoof paper that demonstrates this by giving each variable the next available letter of the alphabet. Something like "Let a be a set of points in the plane. Let b, c and d be elements of a. Let e be the angle formed by..." It becomes unreadable very quickly. Sadly I can't find the original now - anyone know what I'm talking about?
- tdm_ 9y agoNot really disagreeing, just chiming in as a mathematician who does a lot of programming: Mathematicians handle variable scope all the time--I would argue that a variable's scope is generally the section, subsection, lemma, theorem, etc that it is defined in. If I write "let x be ..." in the proof of a lemma, I sure don't intend for it to be a global variable. It's not unusual to have an index of symbols at the end of a paper or book. Also, anonymous objects are fine and used all the time. "Applying z => z^2 to the region U, ..." or some such thing. I'm not sure it would be very useful to try to coordinate some standard notation for all of this. Anyway, one nice thing about writing math is that you can make up whatever notation you need, as you need it, and no compiler can tell you not to :)
- posterboy 9y agoAn editor compiling submitted papers could complain.
- agumonkey 9y agoWe've entered the territory where solid programming is back at mathematical and logic roots. After all, the lambda calculus lineage comes from there.
- mtzet 9y agoMathematician here. There is a sentiment here, that seems to be that the hard part of mathematics is in the notation, and that this could be solved by just implementing all mathematics in a programming language. I quite disagree. I believe that mathematics is hard, because explaining ideas is hard. Additionally, it is quite possible to state and prove an important theorem, without at all explaining where this theorem comes from, why it is important and how on earth you might ever cook up something like this. (In fact, I think there is a very great lack of good mathematical resources, even in pure mathematics). With regards to notation and mathematical writing in general, the problem is that it is never explicitly taught. Too many students of mathematics never learn to properly structure sentences in mathematics. In studying programming languages, you have no choice but to understand the structure explicitly. I do think mathematics has all the features you mention, it's just not explicit. > Variable Scope. In mathematical writing, the convention is that every variable is a global variable - and in a paper you quicky run out of variable names to use. Variables usually have local scope. In a mathematical statement like "for a continuous function f ...", the letter f is not defined after the sentence ends. Another common way to "initialize" variables is by statements like "Let f be a continuous function", and while it is true that it is never formally cleared, it is reintroduced when needed in another context. In some rare cases, you might start a chapter with "In this chapter, we let $H$ denote a fixed Hilbert space...", which is the mathematical equivalent to a global variable. > Strict Typing. You skim a paper, and you see "x + y". But what is x? a matrix, a vector, a scalar, an operator, a set, a random variable, you have no idea. The "+" operator is so overloaded x and y could be anything. I don't understand how programming languages are different here. Most modern programming languages also have operator overloading or polymorphism which has precisely this problem. Do you prefer C-style add_object_of_type_T(x, y)? > Having to hunt down the definitions for every variable is a time consuming and frankly wasteful process. Conventions are built up around this (upper case letters A,B at the beginning of the alphabet are matrices, but upper case letters at the end X,Y are random variables) but they are mostly rater silly. There needs to be an easy way to infer the type of a variable quickly. The common convention is to introduce variables just before you use them. That's as I would do it in a programming language? You seem to desire an IDE for mathematics, so that I could ctrl-click any variable to the definition. Though I have to say, if that's such a problem, the paper is probably horribly structured. I don't understand your problem with conventions. Conventions are suggestive, to help you remember the definition, it's much in the same way we choose suggestive variable names in programming languages. > Anonymous Objects. There is no way to declare a function without either giving a name to it (f(x) = x^2) or at least declaring its input symbols (x |=> x^2). But you can't go, say (x |=> x^2)(y). Sure you could write (x |-> x^2)(y), you're allowed to introduce any notation you like. But why wouldn't you just write that expression as y^2? You could declare a function as "the function which ...", which doesn't give it a name. If you want a symbolic expression, I'm not sure how you would do that without declaring any input symbols.