Proving Addition is Commutative in Idris

First off, I think Idris is pretty great. Over the past several months, I've
been thoroughly enjoying reading and working through Type-Driven Development
with Idris, as well as chatting with the community on IRC (#idris on
freenode).

For every MEAP book, Manning provides a forum. To be honest, though I've
partaken in quite a few MEAPs, I've never really participated in the fora. In
the Type-Driven Development with Idris forum, however, I've made a whopping
two posts so far. One was a clarifying question about a possible error in the
text and the other was an answer to a fellow reader's question. My answer seemed
like a good example of how Idris works, so I thought I'd turn it into a blog
post. Here goes.

In this example, we're trying to prove that addition of natural numbers is
commutative, i.e.
\[\forall n,m \in \mathbb{N}\ (n + m \equiv m + n)\]
… which we can express in Idris as follows:

myPlusCommutative: (n, m:Nat) ->n+m=m+n

The type signature for myPlusCommutative can be read as something like, "For
all natural numbers n and m, n plus m is exactly equivalent to m plus
n."