Questions tagged [lambda-calculus]

For questions on the formal system in mathematical logic for expressing computation using abstract notions of functions and combining them through binding and substitution.

Lambda calculus (also written as λ-calculus) is a formal system in mathematical and theoretical for expressing computation based on function abstraction and application using variable binding and substitution. Its namesake, the Greek letter lambda (λ), is used in lambda expressions and lambda terms to denote binding a variable in a function.

It was first introduced by mathematician Alonzo Church in the 1930s as part of his research of the of mathematics. The original system was shown to be logically inconsistent because of the Kleene–Rosser paradox. Subsequently, in 1936 Church isolated and published just the portion relevant to computation, what is now called the untyped lambda calculus.

Untyped lambda calculus is Turing complete, that is, it is a universal model of computation that can be used to simulate any (see ). It may be used to model booleans, arithmetic, data structures and recursion.

Lambda calculus may be untyped or typed. In typed lambda calculus (see ), functions can be applied only if they are capable of accepting the given input's "type" of data. Typed lambda calculi are weaker than the untyped lambda calculus, in the sense that typed lambda calculi can express less than the untyped calculus can, but on the other hand typed lambda calculi allow more things to be proved; in the simply typed lambda calculus it is for example a theorem that every evaluation strategy terminates for every simply typed lambda-term, whereas evaluation of untyped lambda-terms need not terminate. One reason there are many different typed lambda calculi has been the desire to do more (of what the untyped calculus can do) without giving up on being able to prove strong theorems about the calculus.

Typed lambda calculi are closely related to mathematical and via the Curry–Howard isomorphism: types correspond to logic formulas, lambda-terms correspond to derivations in a logic system (depending on the kind of typed lambda calculus) and computation steps in the lambda calculus correspond to normalization (i.e. cut-elimination) steps for derivations.

Lambda calculus has applications in many different areas in mathematics, philosophy, linguistics, and computer science. Lambda calculus has played an important role in the development of the theory of languages, since functional programming languages implement the lambda calculus. Lambda calculus also is a current research topic in .

655 questions
4
votes
0 answers

Head position in lambda calculus

I'm confused about what actually constitutes the head position in a lambda term. Wikipedia defines it as the $(\lambda x. A) M_1$ in: $\lambda x_1 . \ldots \lambda x_n . (\lambda x . A) M_1 M_2 \ldots M_m$ , with $n \ge 0, m \ge 1$ However, if this…
hgiesel
  • 1,257
4
votes
0 answers

Construct successor function with combinators with only 2 variables

For a Uni project I try to build complex lambda expressions with combinators that use only two (bound) variables. For example I managed to create IF-THEN-ELSE $(λp.λa.λb.p a b)$ by using three combinators: $(λx.λy. x y) (λx.λy. x y)$ Now I try the…
woodtluk
  • 143
4
votes
1 answer

In lambda calculus what is the correct definition of numbers

As a programmer I have been diving into functional programming and am therefore interested about the math behind all of the languages. I had a small course of lambda calculus at university, but recently wanted to fresh up my knowledge about the…
Arninja
  • 143
4
votes
2 answers

How do scoping rules work in the Lambda Calculus with nested functions

Let's say I have a lambda expression like this: $$(\lambda a . (ab))(c)$$ It reduces to $$cb$$ But let's say I have a nested function $$(\lambda a . (\lambda x.(ax)))(b)$$ Does this reduce to $$\lambda x.(bx)$$ or to $$\lambda x.(ax)$$ In other…
azani
  • 623
4
votes
1 answer

Defining equality function between booleans in lambda calculus

I'm trying to define a function that simulates equality between booleans. To achieve equality operator, I can use the negation operator together with the xor operator, since for two boolean variables $p,q$, it holds that: $\neg(p\oplus q)=T$ iff $p$…
3
votes
3 answers

How can I prove a simple eta-conversion?

I would like to prove the following: $$\lambda x.\ \lambda y.\ f\ z\ x\ y \overset{\eta}{=} \lambda x.\ f\ z\ x$$ Definitions Free variables $x \in FV(f) :\Leftrightarrow$ $x$ is a variable used within a function $f$ and $x$ is neither a formal…
Martin Thoma
  • 9,821
3
votes
1 answer

Lambda calculus - function reduction

I am trying to learn how to reduce functions in $\lambda$ calculus and I came across this task: Reduce this expression using normal strategy and applicative strategy. $(\lambda x.\lambda y.x)(\lambda x.x)((\lambda x.x x)(\lambda x.x x))$ I tried to…
Smajl
  • 686
3
votes
0 answers

Predecessor function in λI-calculus

The $\lambda_I$-calculus is a restricted version of the usual $\lambda$-calculus. The set of expressions in this restricted calculus, $\Lambda_I$, can be defined inductively: If $x$ is a variable, then $x \in \Lambda_I$. If $M \in \Lambda_I$ and…
3
votes
1 answer

Proving that the Curry fixed point combinator y and the Turing fixed point combinator θ cannot be proved equal in λβ

$y = λf.(λx.f(xx))(λx.f(xx))$ $θ = (λxy.y(xxy))(λxy.y(xxy))$ I'm trying to prove that $y \neq \theta$ in λβ. My idea was to assume the contrary, then by Church - Rosser, there exists some $u$ s.t. both $y$ and $\theta$ beta reduce to $u$. Now we…
3
votes
1 answer

Why is $\lambda x.\lambda y.xy$ not reducible to $\lambda x.x$?

(NB: λ-calculus n00b here!) I derive the following: $$ \lambda x.\lambda y.xy \equiv \lambda x.(\lambda y.xy) \equiv \lambda x.x $$ To check myself, I tried to reduce the same expression with several online "λ-calculus calculators" (e.g. the λ…
kjo
  • 14,334
3
votes
1 answer

Opposite Direction of Church-Rosser Theorem

The Church-Rosser theorem states that if $a \twoheadrightarrow b$ and $a \twoheadrightarrow c$, then there exists a Lambda expression $d$ such that $b \twoheadrightarrow d$ and $c \twoheadrightarrow d$, where $\twoheadrightarrow$ denotes a sequence…
Ziqi Fan
  • 1,816
3
votes
1 answer

In lambda calculus, the λ symbol is followed by a variable. Can that variable be a lambda expression?

In general, in the lambda calculus syntax, the "$\lambda$" symbol is followed by a variable or identifier, but could the variable following the "$\lambda$" symbol be a lambda expression itself. For example, let $$\lambda (\lambda x.x).y$$ be called…
joseville
  • 1,477
3
votes
2 answers

Sequencing function applications in beta reduction

I am working problems in Hindley and Seldin. The -reduction for this formula eludes me at a certain step, because I am having trouble understanding the ordering of function application. Yes, the applications associate to the left - but what order…
3
votes
1 answer

How exactly is lambda calculus the foundation for functional programming languages?

One of the question on usability of lambda calculus highlighted that lambda calculus is the foundation for programming languages, including Haskell and Lisp. How is that exactly? Do compilers in Haskell and Lisp actually implement lambda terms e.g.…
3
votes
1 answer

Lambda calculus defining terms according to description

I'm working on a problem I stumbled across online. The goal is to define terms for two use cases which are defined as follows: lists are encoded as: $ [N_1,N_2,...,N_k] ≜ λc.λn.c N_1 (c N_2 (...(c N_k n)...)) $ $ head [N, . . . ] → _\beta^* N \\ $ $…
1
2
3
15 16