# 15.6: Defining functions via lambda abstraction

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$

( \newcommand{\kernel}{\mathrm{null}\,}\) $$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\id}{\mathrm{id}}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\kernel}{\mathrm{null}\,}$$

$$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$

$$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$

$$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

In our brief discussion of compositionality in Chapters 13–14 we focused primarily on denotations, and expressed the truth conditions of sentences in terms of set membership. So, for example, the denotation of a predicate like yellow or snore, in a particular context or universe of discourse, is the set of individuals within that context which are yellow, or which snore. The sentence Henry snores will be true in any model in which the individual named Henry belongs to the denotation set of snore.

We noted in Chapter 13 that the membership of a set can always be expressed as a function, namely its characteristic function. So it is possible to restate the truth conditions of sentences, and to show how these truth conditions are derived compositionally, in terms of functions rather than set membership. The two approaches (sets vs. functions) are essentially equivalent, but for a number of constructions the functional representation provides a simpler, more general, and more convenient way of stating the rules of interpretation.

We will not explore this approach in any detail in the present book, but it will be useful for the reader to be aware of a notation for defining functions that is very widely used in formal semantics. In the standard function-argument format that we learn in secondary school, functions generally have names. For example, the two functions defined in (36) are named “f1” and “f2”. In this kind of definition, the function takes a bound variable (x) as argument and expresses the value as a formula which contains the bound variable. When the function is applied to a real argument, we calculate the value by substituting that argument for the bound variable in the formula. So for example, f1 (13)= 13–4 = 9.

(36) Named functions:
f1(x) = x – 4 f1(13) = 9
f2(x) = 3x2 + 1 f2(3) = 28

Another way of defining functions, using the Greek letter lambda (λ), is illustrated in (37). These two functions are identical to f1 and f2, but written in a different format. Once again, when the function is applied to an argument, we calculate the value by substituting that argument for the bound variable which is introduced by the λ. However, in this format the functions have no names. Functions defined using λ are sometimes described as “anonymous functions”.

(37) Anonymous functions:
[λx. x – 4] [λx. x – 4](13) = 9
[λx. 3x2 + 1] [λx. 3x2 + 1](3) = 28

We can also think of lambda (λ) as an operator which changes propositions into predicates by replacing some element of the proposition with an appropriate bound variable. For example, from the proposition Caesar loves Brutus we can derive “[λy. Caesar loves y]” by replacing the object NP with the variable y. This formula represents a predicate which corresponds to the property of being loved by Caesar. Alternatively, we can derive “[λx. x loves Brutus]” by replacing the subject NP with the variable x. This formula represents a predicate which corresponds to the property of being someone who loves Brutus.

This process is referred to as lambda abstraction. Once again, when we apply these derived predicates to an argument, as illustrated in (38), the result is calculated by replacing the bound variable with the argument. (The argument in the first example is b, representing Brutus; in the second example the argument is c, representing Caesar; and in the third example the argument is a, representing Marc Antony.)

(38) [λy. LOVE(c,y)](b) = LOVE(c,b) ‘Caesar loves Brutus’
[λx. LOVE(x,b)](c) = LOVE(c,b) ‘Caesar loves Brutus’
[λx. LOVE(x,c) ∧ HATE(x,b)](a) = LOVE(a,c) ∧ HATE(a,b)
‘Antony loves Caesar and hates Brutus’

Predicates derived by lambda abstraction can be interpreted as characteristic functions of the corresponding denotation set, as described in Chapter 13:

(39) [λy. LOVE(c,y)](n) = 1 iff Caesar loves n
0 otherwise
[λx. LOVE(x,b)](n) = 1 iff n loves Brutus
0 otherwise
[λx. LOVE(x,c)∧ HATE(x,b)](n) = 1 iff n loves Caesar and hates Brutus
0 otherwise

This means that the semantic value of an intransitive predicate like snore can be represented as a function which takes a single argument: [λx. SNORE(x)]. The semantic value of the sentence Henry snores can be derived by applying this function to the semantic value of the subject NP, as shown in (40):

(40) [λx. SNORE(x)](h) = SNORE(h)
= 1 iff Henry snores
0 otherwise

The semantic value of a transitive predicate like love can be represented as a function which takes two arguments: [λy. [λx. LOVE(x,y)]]. In calculating the truth conditions for a sentence like Caesar loves Brutus, the function named by the verb is applied first to the semantic value of the object NP, as shown in (41a), to derive the semantic value of the VP. The function named by the VP is then applied to the semantic value of the subject NP, as shown in (41b), to derive the semantic value of the sentence as a whole.

(41) a. [λy. [λx. LOVE(x,y)]](b) = [λx. LOVE(x,b)]
‘is someone who loves Brutus’
b. [λx. LOVE(x,b)](c) = LOVE(c,b) ‘Caesar loves Brutus’

In formal semantics, intensions (senses) are often defined as functions from possible worlds to denotations. (Roughly speaking, a “possible world” is any way the universe might conceivably be without changing the structure of the language being investigated.) The intuition behind this analysis is that, as discussed in Chapter 2, it is knowing the meaning (sense) of a word like yellow or speak that allows us to identify the set of all yellow things or speaking things in any particular context. So we can think of the senses of these words as a mapping, or function, from each possible world to the expression’s denotation in that world.

Using the lambda abstraction operator, we might represent the intension of speak as: “[λw. [λx. SPEAK(x) in w]]”. In the same way, the intension of yellow could be represented as: “[λw. [λx. YELLOW(x) in w]]”. The w in these formulae is a variable over the domain of possible worlds. These functions take a possible world as their argument, and return as a value the set of all yellow things (or speaking things) in that world.

This page titled 15.6: Defining functions via lambda abstraction is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Paul Kroeger (Language Library Press) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.