Curry-Howard correspondence I read that the Curry-Howard correspondence introduces an isomorphism between typed functions and logical statements. For example, supposedly the function
$$\begin{array}{l}
I : \forall a. a \to a\\
I = \lambda x. x
\end{array}$$
can be interpreted as:
$$p \implies p \text{ for any proposition } p$$
Is that correct? How might I interpret a function $K : \forall ab. a \to (b \to a)$? What about $\text{succ} : \mathbb{N} \to \mathbb{N}$, where $\text{succ} = \lambda x. x + 1$?
If the scope of this question is too large, can someone recommend an introductory book that would cover this? A proof of the isomorphism would probably be enlightening, too: can someone point me to one?
 A: Have a look at Girard, Lafont and Taylor, Proofs and Types. It's available online in its entirety.

We can state the Curry–Howard correspondence in general terms as a correspondence between proof systems and type theories. Two ways of stating it as that proofs are programs and propositions are types. Your question looks like it's focused on the connection which Howard drew between natural deduction and the simply-typed $\lambda$-calculus.
You ask how to interpret a function $K : \forall{a, b} . a \rightarrow (b \rightarrow a)$, which is not precisely the right question to ask, because it misses the intensional aspect of the correspondence. Let $t$ be a term of type $\forall{a, b} . a \rightarrow (b \rightarrow a)$ whose extension is the function $K$. (In general there will be many such $t$ for any given $K$.) What does $t$ correspond to, then? A proof of the proposition which its type corresponds to: the proposition that for arbitrary propositions $a$ and $b$, $a \rightarrow (b \rightarrow a)$.
What might $t$ look like? We can figure this out to some extent because of its type. Start with $r : b \rightarrow a$. Let $v : a$ and $x : b$. Then let $r := \lambda x. v$. Then $t := \lambda y. (\lambda x. v)$.
Of course this isn't terribly informative: to figure out anything substantial we'd need to know what $v$ is. There are lots of things it might be: here's one which fits. Let $v := y$. Then $t := \lambda y. (\lambda x. y)$. In other words, provide terms $u : a$ and $s: b$ (which, remember, are proofs of $a$ and $b$ respectively), so then $(t[u / y])[s / x]$ reduces to just $u$, which is a proof of $b$.
A: 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)$.
