by simias · 4y ago · 0 comments
The immediate example for me would be lambda calculus which makes a lot of sense to me when expressed in code (be it lisp, python or Rust) but just looks like vomit in theoretical papers, for instance:
(λy.M)[x := N] = λy.(M[x := N]), if x ≠ y and y ∉ FV(N)
This looks like a perl one liner from an obfuscation contest.Why is it that software engineers in a few decades have come to the conclusion that proper variable naming is important and abuse of sigils a bad idea but mathematics don't feel the same way?
On the other hand, notation in mathematics is used to represent only a limited set of common concepts for the field, you don't have autocomplete and a single line can contain a lot of concepts. For example, compare two expressions of Stokes' theorem (given HN typesetting limitations):
∫_A dω = ∫_∂A ω
versus integral(A, differential(ω)) = integral(boundary(A), ω)
While the second one is easier to understand at a first glance, the problem of that equation is not the symbols but the concepts behind them. And to understand the concepts you're going to go over similar equations time and time again, and at that point the extra letters and extra space used is going to complicate both writing and reading the equations. Of course, there is always people who overuse and underuse notation, but if mathematics relies heavily on notation it's for a reason: it's useful.Edit: Also, the second one is only "easy" if you're familiarized with function calling in programming. One could argue that to go full notation-less you should only write in proper sentences, and that would make it even more complex.
Reading Newton’s principia is humbling. He does that the whole book; it takes him pages to explain concepts we now learn before university and that can be condensed in a couple of equations. Finding words to describe the maths he uses is difficult, you can almost feel the insane amount of work just to translate the concepts into sentences. It’s a wonderful example, and of course a masterpiece. But reading it is also very difficult because of all the noise around the concepts. Words are fine to give an intuitive understanding, but at some point you need equations.
Same for Maxwell’s equations, for example. You’d spend less time learning basic calculus and algebra than trying to understand what the hell he was meaning.
Or 19th-century chemists, who used fancy and complicated names for compounds that are described much more clearly and succinctly with a chemical formula. Yes, you need to learn the formalism, but it pays off.
Some counter examples are Einstein and Feynman, who could communicate complex concepts with words in an understandable way. Though even them need some abstract notation at some point (lots of it, actually).
I had this problem when I started higher level maths and the Greek alphabet was used. I couldn’t ask what a symbol meant when I couldn’t say what the symbol was. I couldn’t write down a symbol whose name was read out when I didn’t know what it should look like.
I tried learning the Greek alphabet but flash cards and spaced repetition didn’t work for my ADHD brain and I just had to stop doing maths, which was a shame, because up to that point I was good at it.
Usually by looking at the words that surround the equation. Most math texts will introduce notation in words, and it's common to repeat something in words and notation (e.g. 'let the field extension L/k...'). I have studied math for five years and I don't think I ever had the problem of not knowing how to search for something. The only problem I had with notation was finding the LaTeX code for a specific symbol, but other than that the bigger problem were the concepts.
There are also glossaries at the end of books and in some specialized pages too (https://en.wikipedia.org/wiki/Glossary_of_mathematical_symbo...)
> I couldn’t ask what a symbol meant when I couldn’t say what the symbol was. I couldn’t write down a symbol whose name was read out when I didn’t know what it should look like.
In my classes these problems were usually solved by asking "what's that wiggly thingy" or "how do you write 'alpha'".
And the greek alphabet is not used because mathematicians like to annoy people. There are certain customs for how objects are notated. x,y,z for unknowns/variables; f,g,h for variables; α,β for angles; A,B for matrices; G, H for groups... They are used because, even though they might be harder for beginners, they aren't harder than the concepts they're describing and help a lot in reducing the cognitive load when reading things.
You're clearly capable of learning at least one alphabet, why was the second so much harder?
As someone who spent a lot of time in mathy subjects, this is very readable to me - even though I don't know lambda calculus. I'd posit that if you have trouble with this, it is merely due to not spending much time in math.
Imagine someone who spent all his time in BASIC and he suddenly reads a Java codebase, and complains about the syntax.
> Why is it that software engineers in a few decades have come to the conclusion that proper variable naming is important and abuse of sigils a bad idea but mathematics don't feel the same way?
Because they've been doing it for a few hundred years longer than SW engineers have. I hear this refrain often here on HN. I would love to see someone write a textbook on electromagnetics or quantum mechanics using this verbose notation. The derivation of a harmonic oscillator (without ladder operators) takes a few pages of this concise notation. I shudder how lengthy it would be when more verbose.
1. Since you seem to someone who reads papers sometimes, I would encourage you define your "programming notation" and start proving theorems in that notation. Do it for sufficiently complex proofs: the ones that require a few different lemmas, span several pages, and use some non-trivial algebra. Then, attempt to present your proof to someone in your notation. Judge for understanding.
2. You might very well succeed. But if you don't, wonder why out of many many software engineers (or profs at software engineering oriented degrees) over the past few decades who read math/cs papers, no one attempted to use "programming notation" to write a book or notes to communicate mathematics to others?
The big reason for single-letter variable names is that historically multiplication can be denoted by concatenation. It makes formulae shorter, so they don't need line breaks. Personally I don't think that's a huge benefit, particularly when there's more than one sort of product possible so you end up needing to explicitly denote multiplication anyway.
[1] https://eprint.iacr.org/2022/106.pdf (Page 7-8)
Take matrix multiplication, imagine seeing this:
C = zero(m,p)
for k from 1 to n
for i from 1 to m
for j from 1 to p
C_ij += A_ik * B_kj
Now suppose that B is invertible and we actually want to know A in terms of B and C. Oops, we can't figure it out because we've tied ourselves to this algorithmic expression. In contrast to a more typical algebraic expression which describes not a computation but a relation: C = AB
CB^-1 = ABB^-1
CB^-1 = A
Perform that manipulation with the algorithmic description that helpfully obfuscates the relationship between the parts.[And this is a small example, algorithmic expressions of algebraic ideas, like plain English expressions of the same, does not scale very well.]
The reason for single-letter variable names is that mathematics is best learned by manipulating ideas by hand on paper and pen. And that many mathematical expressions are long and if we started using longer names, we would end up writing only a couple of statements per page, which would be much annoying than just using symbols.
Dijkstra did just that[1]. That same site has hundreds of examples of him proving things in that very programmer friendly notation. Bear in mind that Dijkstra was trained as a “mathematical engineer” for his higher education.
I’m not trying to be controversial, but traditional mathematicians are decades behind the best computing scientists when it comes to crafting formalisms. To be fair the typical practicing programmer is even further behind.
I can only speculate about the appeal of a notation that makes it difficult or impossible to just let symbol manipulation do the heavy lifting. Perhaps mathematicians enjoy the intellectual exercise of holding all those concepts in mind? Perhaps they, like many guilds, appreciate the barriers to outsiders that they feel increase their own prestige? Or perhaps it’s just sheer inertia? I really don’t know.
[1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/E...
Could you provide examples? The Dijkstra article doesn't seem like a marked improvement.
> Perhaps mathematicians enjoy the intellectual exercise of holding all those concepts in mind?
Mathematics is not symbol manipulation. I wish it was as easy as that. Mathematics requires you to hold all the concepts in mind while studying and working.
> Perhaps they, like many guilds, appreciate the barriers to outsiders that they feel increase their own prestige?
I am incapable of finding an example where the barrier to outsiders is the notation and not the concepts themselves.
As I said, there are hundreds of examples on that site.
> Mathematics is not symbol manipulation. I wish it was as easy as that. Mathematics requires you to hold all the concepts in mind while studying and working.
Of course concepts must be understood, but that doesn't mean they need to be held in mind for the vast majority of the derivation. In many cases for example it's sufficient to know that an operation is associative to perform some manipulation, without needing to fuss over the specifics of the concept that operation captures. Unless of course you insist on a notational convention where the syntax is semantically ambiguous, as is common practice among traditional mathematicians.
> I am incapable of finding an example where the barrier to outsiders is the notation and not the concepts themselves.
What does the following mean? What concepts must be held in mind to understand it?
sin(s + i + n)
Even the average graduate mathematician is absurdly above the general population average for raw cognitive ability. Because of this, the frankly primitive approach to syntax is less of an impediment to doing interesting work than it would otherwise be. On the other hand if one desires to make mathematics more accessible to persons of ordinary intelligence, then reducing the cognitive load by clearly defining the semantics of a formula using an unambigous syntax is certainly necessary. Evidently though that's of little importance to the mathematical guild.To give just one example, when done properly the use of hinting in the multi-line equational proof format will certainly ease the non-expert’s task of following a proof.
What I disapprove of is using these very terse syntax in definitions like, say, in Wikipedia articles.
In other words it's like how I have no issue using a variable named "int i;" locally in a function, but I'd consider it a very bad practice if a library exported a global "extern int I;" in their public interface.
The common way you learn mathematics, the notation comes automatically, and new mathematics is often understood as a variation on the examples you learn.
Some of these conventions you probably know, like having i for the varying number in a sum or product (or loop in programming) which goes up to an integer n.
If you called an integer f or a complex number n it would make it much harder to read.
If yo read code in standard libraries, you'll see a lot of either single-letter variables or extremely generic variable names.
Most mathematics is dealing with things at least one level of abstraction higher than a standard library.
In most programs outside of things like standard libraries, a variable usually stands for something concrete and specific. A customer. An order. A specific type of element in a UI. Etc.
In theory papers, a variable usually stands in for something generic and general. An arbitrary program. An arbitrary finite set. Etc. Sometimes even an arbitrary program in a programming language that is not defined in particular but only in general (e.g., "any language with parametric polymorphism", "any language with a specific sort of binding structure between things in these two syntactic categories", etc.).
Again, standard libraries already start using more generic variable names, and most theory papers are dealing with an abstraction level higher than standard libraries.
1. A byte is pretty damn concrete. The Java byte implementation [1] uses almost exclusively single-letter names (b,s) or names that are so generic that they might as well be single-letter names (e.g., anotherByte instead of b). When more meaningful names are used, it's because they are public type names (String, int), which is, again, pretty damn concrete.
2. The next level of abstraction is Generics. Here, even Java -- a language whose verbosity is a long-standing joke -- starts using single-letter variable names for both types and values [2].
3. Finally, we dive into things that abstract over generics [3] and start seeing weird sigils in addition to single-letter names. (What does Predicate<? super E> mean?!)
And, again, this is a strong-manned example, since Java is famously verbose and I'm choosing some of the most-used and therefore most verbosely documented .java files in the world.
Notice, btw, that natural language documentation increases as the verbosity of names decreases. This is the same in math, where those symbols are small pieces of 20+ page papers full of english prose explaining the meaning of the symbols.
And, again most mathematics is dealing with things at least one level of abstraction higher than anything you find in a standard library. Sometimes several levels of abstraction.
[1] Byte.java
[2] Dequeue.java
[3] Collection.java