$\lm$ notation is used to define functions, and looks like $(\lm ~ \text{input} ~ . ~ \text{output})$. \\
Consider the following statement:
$$
I = \lm a . a
$$
This tells us that $I$ is a function that takes its input, $a$, to itself. We'll call this the \textit{identity function}. \\
To apply functions, put them next to their inputs. We'll omit the usual parentheses to save space.
$$
I ~ \star = (\lm a . a) ~ \star = \star
$$
$$
(M~\star) =
(\lm\tzm{b}a. a)~\tzmr{a}\star =
\star
\begin{tikzpicture}[
overlay,
remember picture,
out=225,
in=315,
distance=0.5cm
]
\draw[->,gray,shorten >=5pt,shorten <=3pt]
(a.center) to (b.center);
\end{tikzpicture}
$$
Functions are left-associative: If $A$ and $B$ are functions, $(A~B~\star)$ is equivalent to $((A~B)~\star)$. As usual, we'll use parentheses to group terms if we want to override this order: $(A~(B~\star))\neq(A~B~\star)$\\
In this handout, all types of parentheses ( $(), [],$ etc ) are equivalent.
\vfill
\generic{$\beta$-Reduction:}
$\beta$-reduction is a fancy name for \say{simplifying an expression.} We've already done it once above.
Let's make another function:
$$
M = \lm f . f f
$$
$M$ takes a function as an input and calls it on itself. What is $(M~I)$?
Before we begin, let's review \textit{function composition}. With \say{normal} functions, composition is written as $(f \circ g)(x)= f(g(x))$. This means \say{$f$ of $g$ of $x$}.
To demonstrate currying, we'll make a function $C$ in lambda calculus, which takes two functions ($f$ and $g$), an input $x$, and produces $f$ applied to $g$ applied to $x$. \\
This last function $\lm x. f(g(x))$ takes one argument, and returns $f(g(x))$. Since this function is inside the previous two, it has access to their arguments, $f$ and $g$.
So, currying allows us to create multivariable functions by nesting single-variable functions. \\
As you saw above, such expressions can get very long. We'll use a bit of shorthand to make them more palatable. If we have an expression with repeated function definitions, we'll combine their arguments under one $\lm$.
This is only notation. \textbf{Curried functions are not multivariable functions!} They must be evaluated one variable at a time, just like their un-curried version. Substituting all curried variables in one go may cause errors, as you'll see below.