Integers are represented in lambda calculus by the ‘Church numerals’.
Zero is represented by the lambda expression λ`f``x`.`x`, and other integers are generated by the applying successor function λ`n``f``x`.`f`(`n``f``x`) to an existing integer `n`.
In other words, `n` is represented by λ`f``x`.`f`(`f`(...`f`(`f``x`)..)) where there are `n` `f`s on the right.

Addition can be performed using the lambda expression λ`m``n``f``x`.(`m``f`)(`n``f``x`).
This applies `f` to `x` `n` times, and then another `m` times.

Multiplication is also easy, using the lambda expression λ`m``n``f`.`m`(`n``f`).
This applies `f`^`n` `m` times to `x`.

Even exponentiation is easy, using the lambda expression λ`m``n`.`n``m`.
This is more difficult to understand than the previous two expressions.
Remember that `n``m``f``x` means ((`n``m`)`f`)`x`.
This is equivalent to `f`^`m`^...^`m``x`, which is `f`^(`m`^`n`)`x`.

The predecessor function is defined to return the integer before n, unless n is zero in which case it returns zero.
This can be accomplished with the lambda expression n(λ`a``g`.(a(λ`b``c`.`c`))(successor(a(λ`b``c`.`c`))))(λ`g`.00)(λ`a``b`.`a`), where ‘successor’ is the successor function, and 0 represents the zero expression.
This is not as complicated as it looks.
It applies `n` times a function that maps (x,y) to (y,y+1), to the pair (0,0), resulting in a pair (`n`-1,`n`), from which we take the left number, `n`-1.

Subtraction of n from m is accomplished using the lambda expression λ`m``n`.`n`predecessor`m`, where ‘predecessor’ is the predecessor function.