Section CANTOR_PAIRING.
Fixpoint sum_from_0_to (n : nat) {struct n} : nat :=
match n with
| O => 0
| S n' => n + sum_from_0_to n'
end.

Lemma sum_from_0_to_spec (n : nat)
: 2 * sum_from_0_to n = n * (S n).