Japanese version

Addition is defined by the following.

PLUS := λ m n f x. m f (n f x)

Let's calculate 1 + 2.

1 and 2 are

1 := λ f x. f x

2 := λ f x. f (f x),

respectively.

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

= (λ n f x. (λ f x. f x) f (n f x)) (λ f x. f (f x))

= (λ n f x. (λ x. f x) (n f x)) (λ f x. f (f x))

= (λ n f x. f (n f x)) (λ f x. f (f x))

= (λ f x. f ((λ f x. f (f x)) f x))

= (λ f x. f ((λ x. f (f x)) x))

= (λ f x. f (f (f x)))

= λ f x. f (f (f x))

= 3

Therefore 1 + 2 = PLUS 1 2 = 3. It seems a magic. But the principle is the same as the Pop1. Church number represents numbers by the number of 'f's. Therefore, addition is basically concatinate the numbers.

If 1 = f and 2 = ff, 1 + 2 = f + ff = fff. In the sama way, for example 3 + 4 = fff + ffff = fffffff = 7.

したたり算法

4 months ago

## No comments:

Post a Comment