Module NatNat.
(* 0 + 1 + ... + n *)
Definition big_sum (n : nat) : nat := nat_rec _ 0 (fun i m => m + (S i)) n.
(* bijection from nat * nat to nat *)
Definition nat2_to_nat '(x, y) : nat := (big_sum (x + y)) + y.
Definition next_nat2 '(x, y) : nat * nat := if x is S x then (x, S y) else (S y, 0).
(* bijection from nat to nat * nat *)
Definition nat_to_nat2 (n : nat) : nat * nat := Nat.iter n next_nat2 (0, 0).

Lemma nat_to_nat2_snd_non_increasing {n} : snd (nat_to_nat2 n) < S n.