1

In Church encoding of the natural numbers in lambda calculus raising zero to the power zero gives the answer zero. Does anybody know of an encoding where the answer is 1?

1 Answers1

1
(λm.λn.n m) (λf.λx.x) (λf.λx.x)
⇒   (λn.n (λf.λx.x)) (λf.λx.x)
⇒   (λf.λx.x) (λf.λx.x)
⇒   λx.x

Another different calculation ((\m.\n. ((n (\m.\n.\f. (m (n f)))) f x))(\f.\x.x)(\f.\x.x)):

(λm.λn.n (λi0.λi1.λi2.i0 [i1 i2]) f x) (λi0.λi1.i1) (λi0.λi1.i1)
⇒   (λn.n (λm.λi0.λi1.m [i0 i1]) f x) (λi0.λi1.i1)
⇒   (λi0.λi1.i1) (λm.λn.λi0.m (n i0)) f x
⇒   (λi0.i0) f x
⇒   f x

Calculations done using: http://www.cburch.com/lambda/index.html

Loreno Heer
  • 4,460
  • 1
    Which is not a Church numeral at all, is it? So, can we conclude that $0^0$ is undefined in the context of Church encoding? – Daniel R Jan 30 '15 at 12:59
  • @DanielR I am slightly confused by it myself now. I calculated it again using a different approach, which does indeed result in 1. – Loreno Heer Jan 30 '15 at 13:02
  • 4
    $\lambda x.x$ and $1$ are equivalent under $\eta$-expansion – mercio Jan 30 '15 at 13:03
  • 2
    I'm confused. In "Constructive Foundations for Functional Languages" http://www.academia.edu/456528/CONSTRUCTIVE_FOUNDATIONS_FOR_FUNCTIONAL_LANGUAGES it says λx.x is the zero object – William Pearson Jan 30 '15 at 13:18
  • Ping @mercio. $;$ – Daniel R Jan 30 '15 at 13:48
  • 3
    the zero object is $\lambda f. \lambda x. x$. Meanwhile, $\lambda x. x =\alpha \lambda f.f =\eta \lambda f. (\lambda x. f x) = 1$ – mercio Jan 30 '15 at 15:36
  • thanks for the clarification. Just found "For example, the combinators (λy.λx.yx) and (λy.y) are observationally equivalent" on another answerlink. Out of interest could you not also eta expand to λf.(λx.x) f which I really don't understand? why dont you put as answer so I can accept it? – William Pearson Jan 30 '15 at 16:26
  • @William When you address a user who is not the author of the answer or question, you can add a @ and the user name. This way, the user is made aware of your comment by getting a notification in their inbox. This may help your attempt to reach out to mercio. – Daniel R Jan 31 '15 at 11:04
  • @mercio sorry, new here. please see comment before last – William Pearson Jan 31 '15 at 20:12