what are the 5 simplest lambda calculus expresions

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I'm struggling to learn lambda Calculus.
I think what might really help is to see the simplest functions that you can create in lambda calculus and how they might be combined to make more complex functions.
For instance I know about the Identity function.
λ
x
.
x
ÃÂ
and the not operator, but it feels like I don't understand how to use the building blocks of lambda calculus to make more complex functions yet.
So I'm asking, if you could, to show me some of the simplest lambda functions and how they combine to create more complex functions.
lambda-calculus
add a comment |Â
up vote
2
down vote
favorite
I'm struggling to learn lambda Calculus.
I think what might really help is to see the simplest functions that you can create in lambda calculus and how they might be combined to make more complex functions.
For instance I know about the Identity function.
λ
x
.
x
ÃÂ
and the not operator, but it feels like I don't understand how to use the building blocks of lambda calculus to make more complex functions yet.
So I'm asking, if you could, to show me some of the simplest lambda functions and how they combine to create more complex functions.
lambda-calculus
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm struggling to learn lambda Calculus.
I think what might really help is to see the simplest functions that you can create in lambda calculus and how they might be combined to make more complex functions.
For instance I know about the Identity function.
λ
x
.
x
ÃÂ
and the not operator, but it feels like I don't understand how to use the building blocks of lambda calculus to make more complex functions yet.
So I'm asking, if you could, to show me some of the simplest lambda functions and how they combine to create more complex functions.
lambda-calculus
I'm struggling to learn lambda Calculus.
I think what might really help is to see the simplest functions that you can create in lambda calculus and how they might be combined to make more complex functions.
For instance I know about the Identity function.
λ
x
.
x
ÃÂ
and the not operator, but it feels like I don't understand how to use the building blocks of lambda calculus to make more complex functions yet.
So I'm asking, if you could, to show me some of the simplest lambda functions and how they combine to create more complex functions.
lambda-calculus
lambda-calculus
asked Sep 5 at 5:01
paradoxlabs
163
163
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
The easiest place to start is probably with the representations of truth values and logical operators in the lambda calculus.
By convention, the truth values TRUE and FALSE are represented as follows:
$textTRUE equiv lambda x.lambda y.x$
$textFALSE equiv lambda x.lambda y.y$
In other words, $textTRUE$ and $textFALSE$ are actually functions that each take two arguments. $textTRUE$ always returns its first argument and $textFALSE$ always returns its second argument.
If we think about the logical operator $textNOT$, then $textNOT$ takes a single argument and returns $textTRUE$ if its input is $textFALSE$ and vice versa. So we can represent $textNOT$ as follows:
$textNOT equiv lambda x.x text FALSE space textTRUE$
If $x$ is $textTRUE$ then $textNOT$ will return the first item from $text FALSE space textTRUE$ which is $textFALSE$ - and vice versa if $x$ is $textFALSE$.
If we think about the logical operator $textOR$ then we want a function that takes two arguments. It returns its first argument if its first argument is $textTRUE$ and it returns its second argument if its first argument is $textFALSE$. We can represent this as follows:
$textOR equiv lambda x.lambda y.x space x space y$
Using similar reasoning we can represent other logical operators as follows:
$textAND equiv lambda x.lambda y.x space y space x$
$textXOR equiv lambda x.lambda y.x space (textNOT space y) space y$
$textIFTHEN equiv lambda x.lambda y.x space y space (textNOT space x)$
$textIFF equiv lambda x.lambda y.x space y space (textNOT space y)$
The Wikipedia article https://en.wikipedia.org/wiki/Lambda_calculus is a good place to start if you want to take things further.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
The easiest place to start is probably with the representations of truth values and logical operators in the lambda calculus.
By convention, the truth values TRUE and FALSE are represented as follows:
$textTRUE equiv lambda x.lambda y.x$
$textFALSE equiv lambda x.lambda y.y$
In other words, $textTRUE$ and $textFALSE$ are actually functions that each take two arguments. $textTRUE$ always returns its first argument and $textFALSE$ always returns its second argument.
If we think about the logical operator $textNOT$, then $textNOT$ takes a single argument and returns $textTRUE$ if its input is $textFALSE$ and vice versa. So we can represent $textNOT$ as follows:
$textNOT equiv lambda x.x text FALSE space textTRUE$
If $x$ is $textTRUE$ then $textNOT$ will return the first item from $text FALSE space textTRUE$ which is $textFALSE$ - and vice versa if $x$ is $textFALSE$.
If we think about the logical operator $textOR$ then we want a function that takes two arguments. It returns its first argument if its first argument is $textTRUE$ and it returns its second argument if its first argument is $textFALSE$. We can represent this as follows:
$textOR equiv lambda x.lambda y.x space x space y$
Using similar reasoning we can represent other logical operators as follows:
$textAND equiv lambda x.lambda y.x space y space x$
$textXOR equiv lambda x.lambda y.x space (textNOT space y) space y$
$textIFTHEN equiv lambda x.lambda y.x space y space (textNOT space x)$
$textIFF equiv lambda x.lambda y.x space y space (textNOT space y)$
The Wikipedia article https://en.wikipedia.org/wiki/Lambda_calculus is a good place to start if you want to take things further.
add a comment |Â
up vote
2
down vote
accepted
The easiest place to start is probably with the representations of truth values and logical operators in the lambda calculus.
By convention, the truth values TRUE and FALSE are represented as follows:
$textTRUE equiv lambda x.lambda y.x$
$textFALSE equiv lambda x.lambda y.y$
In other words, $textTRUE$ and $textFALSE$ are actually functions that each take two arguments. $textTRUE$ always returns its first argument and $textFALSE$ always returns its second argument.
If we think about the logical operator $textNOT$, then $textNOT$ takes a single argument and returns $textTRUE$ if its input is $textFALSE$ and vice versa. So we can represent $textNOT$ as follows:
$textNOT equiv lambda x.x text FALSE space textTRUE$
If $x$ is $textTRUE$ then $textNOT$ will return the first item from $text FALSE space textTRUE$ which is $textFALSE$ - and vice versa if $x$ is $textFALSE$.
If we think about the logical operator $textOR$ then we want a function that takes two arguments. It returns its first argument if its first argument is $textTRUE$ and it returns its second argument if its first argument is $textFALSE$. We can represent this as follows:
$textOR equiv lambda x.lambda y.x space x space y$
Using similar reasoning we can represent other logical operators as follows:
$textAND equiv lambda x.lambda y.x space y space x$
$textXOR equiv lambda x.lambda y.x space (textNOT space y) space y$
$textIFTHEN equiv lambda x.lambda y.x space y space (textNOT space x)$
$textIFF equiv lambda x.lambda y.x space y space (textNOT space y)$
The Wikipedia article https://en.wikipedia.org/wiki/Lambda_calculus is a good place to start if you want to take things further.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
The easiest place to start is probably with the representations of truth values and logical operators in the lambda calculus.
By convention, the truth values TRUE and FALSE are represented as follows:
$textTRUE equiv lambda x.lambda y.x$
$textFALSE equiv lambda x.lambda y.y$
In other words, $textTRUE$ and $textFALSE$ are actually functions that each take two arguments. $textTRUE$ always returns its first argument and $textFALSE$ always returns its second argument.
If we think about the logical operator $textNOT$, then $textNOT$ takes a single argument and returns $textTRUE$ if its input is $textFALSE$ and vice versa. So we can represent $textNOT$ as follows:
$textNOT equiv lambda x.x text FALSE space textTRUE$
If $x$ is $textTRUE$ then $textNOT$ will return the first item from $text FALSE space textTRUE$ which is $textFALSE$ - and vice versa if $x$ is $textFALSE$.
If we think about the logical operator $textOR$ then we want a function that takes two arguments. It returns its first argument if its first argument is $textTRUE$ and it returns its second argument if its first argument is $textFALSE$. We can represent this as follows:
$textOR equiv lambda x.lambda y.x space x space y$
Using similar reasoning we can represent other logical operators as follows:
$textAND equiv lambda x.lambda y.x space y space x$
$textXOR equiv lambda x.lambda y.x space (textNOT space y) space y$
$textIFTHEN equiv lambda x.lambda y.x space y space (textNOT space x)$
$textIFF equiv lambda x.lambda y.x space y space (textNOT space y)$
The Wikipedia article https://en.wikipedia.org/wiki/Lambda_calculus is a good place to start if you want to take things further.
The easiest place to start is probably with the representations of truth values and logical operators in the lambda calculus.
By convention, the truth values TRUE and FALSE are represented as follows:
$textTRUE equiv lambda x.lambda y.x$
$textFALSE equiv lambda x.lambda y.y$
In other words, $textTRUE$ and $textFALSE$ are actually functions that each take two arguments. $textTRUE$ always returns its first argument and $textFALSE$ always returns its second argument.
If we think about the logical operator $textNOT$, then $textNOT$ takes a single argument and returns $textTRUE$ if its input is $textFALSE$ and vice versa. So we can represent $textNOT$ as follows:
$textNOT equiv lambda x.x text FALSE space textTRUE$
If $x$ is $textTRUE$ then $textNOT$ will return the first item from $text FALSE space textTRUE$ which is $textFALSE$ - and vice versa if $x$ is $textFALSE$.
If we think about the logical operator $textOR$ then we want a function that takes two arguments. It returns its first argument if its first argument is $textTRUE$ and it returns its second argument if its first argument is $textFALSE$. We can represent this as follows:
$textOR equiv lambda x.lambda y.x space x space y$
Using similar reasoning we can represent other logical operators as follows:
$textAND equiv lambda x.lambda y.x space y space x$
$textXOR equiv lambda x.lambda y.x space (textNOT space y) space y$
$textIFTHEN equiv lambda x.lambda y.x space y space (textNOT space x)$
$textIFF equiv lambda x.lambda y.x space y space (textNOT space y)$
The Wikipedia article https://en.wikipedia.org/wiki/Lambda_calculus is a good place to start if you want to take things further.
answered Sep 5 at 9:45
gandalf61
6,159522
6,159522
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2905889%2fwhat-are-the-5-simplest-lambda-calculus-expresions%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password