The short version of the Curry-Howard correspondence is: to interpret a type as a proposition, interpret the function type $a\to b$ as "$a$ implies $b$". Interpret the product type $a\times b$ as "Both $a$ and $b$". Interpret the disjoint union type $a \sqcup b$ as "Either $a$ or $b$ (or both)".
Then for example the type of the $K$ combinator, $a\to(b\to a)$, is interpreted as the proposition that if we know $a$, then if we know $b$ we can conclude $a$. Or the type of the program which gets a pair $(a,b)$ and returns $b$ is $a\times b\to b$, and this is the theorem that says that if you can prove $a$ and $b$, then you have a proof of $b$, usually written $a\land b\to b$.
(In the Haskell language, $a\times b$ is notated (a,b)
and $a\sqcup b$ is notated Either a b
.)
The successor function is a bit silly, because its type is a trivial theorem. The type $\Bbb N$ is known to be inhabited, because it contains constants like 0. Such types correspond to propositions that are known to be true. For example, there is a program, written 0
, with type $\Bbb N$, and this is indeed a theorem. So the successor function's type, ${\Bbb N}\to{\Bbb N}$, just says that $\Bbb N$ implies $\Bbb N$, which is not very interesting. Perhaps slightly more interesting is the theorem $a\to \Bbb N$, which corresponds to the program $\lambda a. 13$.
There is more to the correspondence than that types are theorems of logic. More important is that a program with a certain type corresponds to a proof of the corresponding theorem. Evaluation of the program corresponds to elimination of the "cut" rule from the proof. Purely functional programs correspond to theorems of intuitionistic logic, but imperative programs correspond to theorems of classical logic, which is stronger. Double-negation corresponds to exception handling. Glivenko's theorem, which says that any theorem of classical logic has an intuitionistic analogue, corresponds to the implementation of an imperative program in a functional language in continuation-passing style.
I recommend that you read Morten Heine Sørensen and Paweł Urzyczyn's Lectures on the Curry-Howard Isomorphism for complete details.
Also potentially interesting: this answer constructs a program with type $\lnot\lnot(P\lor\lnot P)$.