\(\lambda\)-calculus Part I (Variables and Functions)
2021 James B. Wilson, Colorado State University
What is a...
...variable?
...function?
> c = 4
> f(x) = 3*x+2
> f(c)
14
Often we insist \(x\) be replaced by "numbers" and \(+\) by binary operations on numbers.
These two variables are of different "sorts".
Without more details, variables have no unique role in meaning. In particular they are not always related to functions.
\[\sum_{i=1}^{100}\cdots, \qquad\forall x.(\cdots),\qquad x\mapsto x+3,\qquad\ldots\]
Variables in the language not assigned to logical connectives.
\[\begin{aligned} a^2+b^2 = c^2 \\ x \mapsto x+c\\ n \textnormal{ is even}\end{aligned}\]
Variables given syntax or semantics by a logical connective involving the variable.
\[\begin{aligned} x & \mapsto x+5\\ \forall k.&(2k\textnormal{ is even})\\ \exists x.&(x^2-1=0)\\ \sum_{i=1}^{100} & i^2\end{aligned}\]
But 4 is not a function of c!
So c is not a variable.
Rather c is a name, a definition.
x is clearly a variable:
we will replace x when evaluating f.
> c = 4
> f(x) = 3*x+2
> f(c)
14