47
$\begingroup$

I am relatively new to the world of academical mathematics, but I have noticed that most, if not all, mathematical textbooks that I've had the chance to come across, seem completely oblivious to the existence of lambda notation.

More specifically, in a linear algebra course I'm taking, I found it a lot easier to understand "higher order functionals" from the second dual space, by putting them in lambda expressions. It makes a lot more sense to me to put them in the neat, clear notation of lambda expressions, rather than in multiple variable functions where not all the arguments are of the same "class" as some are linear functionals and others are vectors. For example, consider the canonical isomorphism - $$A:V \rightarrow V^{**}$$

It would usually be expressed by $$Av(f) = f(v)$$ This was a notation I found particularly difficult to understand at first as there are several processes taking place "under the hood", that can be put a lot more clearly, in my opinion, this way:

$$A = \lambda v \in V. \lambda f \in V^{*}. f(v)$$

I agree that this notation may become tedious and over-explanatory over time, but as a first introduction of the concept I find it a lot easier as it makes it very clear what goes where.

My question is, basically, why isn't this widespread, super popular notation in the world of computer science, not as popular in the field of mathematics? Or is it, and I'm just not aware?

$\endgroup$
  • 14
    $\begingroup$ The functional notation came much earlier and is widespread. For those not used to it, lambda calculus is perfectly unreadable. $\endgroup$ – Yves Daoust Jul 12 '17 at 10:15
  • 4
    $\begingroup$ @MJD I don't see how the latter is any clearer. The former is unambiguous (if defined properly) and the latter would force me to give it a new name because it is way to long. Not to mention this is a functor, not merely a function on objects. $\endgroup$ – Stefan Perko Jul 12 '17 at 12:06
  • 5
    $\begingroup$ Please add an example of what sort of “before” and “after” notational change you're thinking of. I have a feeling that at least some of the people have misunderstood your question (and I'm pretty sure I don't understand it myself). $\endgroup$ – ShreevatsaR Jul 12 '17 at 15:59
  • 8
    $\begingroup$ I believe there's also a chicken-and-egg problem here. It is not widespead, hence it is unfamiliar to many mathematicians, so it is not used in papers, hence it does not spread, etc. Related: it is also not taught to (most) new students -- doing that would also make it more popular. Instead, we continue to write "$f(g)$ where $g(x)=\ldots$" instead of "$f(x \mapsto \ldots)$" or its $\lambda$ variant. (Personally, I'd also love if we at least stopped writing/teaching "the function $f(x)$" instead of "the function $f$", which is a bad habit and copes with $\lambda$ notation) $\endgroup$ – chi Jul 12 '17 at 20:56
  • 7
    $\begingroup$ @Masacroso This is inaccurate both historically and currently. Many theorem provers such as Coq are basically fancy typed lambda calculi, but maybe the Feit-Thompson theorem is a result of computability now. Historically, Alonzo Church was not setting out to study computability but exactly was trying to build a tool to express mathematics, admittedly at a foundational level. $\endgroup$ – Derek Elkins left SE Jul 13 '17 at 17:29
41
$\begingroup$

As Derek already said, there is no essential difference between functions $A\times B \to C$ and functions $A\to (B \to C)$ via Currying (this is also more abstractly expressed by the universal property of an exponential which unifies the set-theoretical currying and currying in a typed lambda calculus).

On the notational side of things, I personally prefer $x\mapsto f(x)$ to $\lambda x. f(x)$ and I suspect many other mathematicians feel the same (especially since $\lambda$ is such a commonly used letter).


EDIT: (now that my answer stopped being one, let me add some rambling that the 29 people so far have not upvoted for):

I'm guessing many mathematicians are less "comfortable" with nested expressions like $v\mapsto (f \mapsto f(v))$. That would be nothing extraordinary, since there are various concepts that some mathematicians feel less comfortable about. Here are two (unrelated) things that I have encountered:

  • empty metric spaces: Some people deliberately require metric spaces to be non-empty which is a nuisance: given a metric space $(X,d)$ and $Y\subseteq X$, $(Y,d|_{Y^2})$ is a metric space again... unless of course $Y=\emptyset$; apparently it doesn't feel "right" for metric spaces to be empty
  • $f(x)$ instead of $f$: Some people refer to a function $f$ as $f(x)$; this is (unfortunately) what I learned in high school and is (rein)forced by notation like $\frac{d f(x)}{d x}$ and $\int f(x) \,dx$

Although, your example:

Let $A : V\to V^{**}$ such that $Av(f) = f(v)$ for all $v\in V$ and $f\in V^*$

is fine and not hard to understand, in my opinion. For every $v\in V$ we have $Av\in V^{**}$, i.e. $Av : V^* \to \mathbb K$. Hence we can plug in an $f\in V^*$ to get $f(v) \in \mathbb{K}$. If the author thinks it is easy to understand and is more used to it than $v\mapsto (f \mapsto f(v))$ then they would obviously have no reason to change the notation.

So the reason why $v\mapsto (f\mapsto f(v))$ (or a variant thereof) is not used as much is probably: "I'm not used to this notation and I'm perfectly happy with mine."

By the way, my personal favourite is also not: $$A : V \to V^{**}, v \mapsto (f\mapsto f(v))$$ but $$A : V\to V^{**}, v\mapsto \_(v)$$ where it is implied that $\_$ is a placeholder, i.e. $\_(v) : V^* \to \mathbb{K}, f\to f(v)$.

| cite | improve this answer | |
$\endgroup$
  • 19
    $\begingroup$ +1 for your last sentence; I'm feeling the same way. This notation was indeed bad marketing by the inventor of lambda calculus. $\endgroup$ – Christian Blatter Jul 12 '17 at 10:09
  • 7
    $\begingroup$ Note that $B^A \to C$ and $(A \to B) \to C$ mean the same thing, while $A \times B \to C$ and $A \to (B \to C)$ are equivalent through Currying. There's a hugh difference between $(A \to B) \to C$ and $A \to (B \to C)$. $\endgroup$ – md2perpe Jul 12 '17 at 10:27
  • 10
    $\begingroup$ The real issue with the $\mapsto$ notation is that it is rarely clearly specified. You could treat $x\mapsto f(x)$ as notation for $\lambda x.\! f(x)$ but that doesn't help if you are unfamiliar with the lambda calculus. I suspect many mathematicians would be uncomfortable with the equivalent of the more complicated nested expressions that are common in lambda calculus. At any rate, the $\mapsto$ notation is also arguably underused. $\endgroup$ – Derek Elkins left SE Jul 12 '17 at 10:47
  • 4
    $\begingroup$ @Pickle I still choose to think it is a reference to Aristotle's Metaphysics. Church's explanation is a bit like John Lennon saying "oh, my toddler just drew a cool picture of a lambda so I put it on the fridge, really liked it and made it into a song" $\endgroup$ – Darren Ringer Jul 12 '17 at 14:00
  • 7
    $\begingroup$ To my mind $ x \mapsto f(x) $ pretty much is lambda calculus, just with different syntax from $ \lambda x. f(x) $ — unfortunately the asker has not (yet) favoured us with a concrete example where lambda syntax is clearer. Both notations may be considered incomplete, as they do not specify range and domain, though we do have $ g: X \to Y : x \mapsto f(x) $ . Both can also equally need either bracketing or a convention for precedence. I suppose the big difference is that a ↦-expression is not generally used as part of a larger expression, while a λ-expression very often is. $\endgroup$ – PJTraill Jul 12 '17 at 21:06
13
$\begingroup$

Lambda calculus is related with computer science through and through. To quote Wikipedia:

Lambda calculus (also written as λ-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution.

Highlights mine. Here, "computation", "application" and "substitution" are very well defined operations on symbols as understood in CS. That is literally what lambda calculus is all about, to start out with: to reason about substituting symbols in formal languages.

Processes like Currying are there because they have relatively practical applications - for example, they make abstract reasoning easier (by reducing all lambdas with multiple arguments to ones with single arguments). "Meta" topics like lazy evalation, typing, strictness etc. can all be explored in the context of lambda calculus and have little impact on general mathematic formulae. For CS, it is important to be super exact with these things, as computers, basically, are machines for manipulating symbols.

So, lambdas have use for the theoretical computer linguist / computer scientist / logician; on the surface you could probably use the notation for general mathematics, but many of the advanced "benefits" do not transfer (or at least not in a helpful manner). In most parts of mathematics, especially applied mathematics (physics...), the question of how exactly to "apply" and "substitute" variables is crystal clear and of little interest to anybody - it is often quite usual to skip writing bound variables completely.

Oh, and the other answer: people are just used to the usual representation. Plenty of mathematical areas tend to have their own notations for quite similar things. It's just how it is.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Is the precision of lambda calculus really needed because computers manipulate symbols? After all, how often does anyone programme in lambda calculus? $\endgroup$ – PJTraill Jul 12 '17 at 21:19
  • 1
    $\begingroup$ Untyped lambda calculus is the basis for Lisp, and typed is the basis for Haskell and ML. $\endgroup$ – Marty Jul 13 '17 at 2:05
  • 3
    $\begingroup$ @Marty: Which just proves that nobody (to within experimental error, and excluding academics because commercial software engineering is much bigger) actually programs in lambda calculus $\endgroup$ – Kevin Jul 13 '17 at 3:12
  • 2
    $\begingroup$ Lambda abstraction can be used outside of the context of studying and processing formal languages. (much like how sets can be used by people who aren't studying set theory) $\endgroup$ – user14972 Jul 13 '17 at 6:31
  • 2
    $\begingroup$ All of you are right; keep in mind that this answer primarily answers the question of "why do we write f(x)=x+1 instead of \lambda x.x+1", that is, a plausible reason why the whole of mathematics did not switch to lambda notation when it was invented. $\endgroup$ – AnoE Jul 13 '17 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.