Section sum_bijection.
Inductive bijection n g h : Type :=
| in_bij : (forall i, i < n -> g i < n)
-> (forall i, i < n -> h i < n)
-> (forall i, i < n -> g (h i) = i)
-> (forall i, i < n -> h (g i) = i)
-> bijection n g h.

(* Specifications: *)
Theorem sum_bijection n f g h : bijection n g h -> ∑ n f = ∑ n (fun i => f (g i)).
Inductive triangle_bijection n k g h : Prop :=
| in_tb : (forall i j, j < i < n -> h (i,j) < k /\ g (h (i,j)) = (i,j))
-> (forall q, q < k -> snd (g q) < fst (g q) < n /\ h (g q) = q)
-> triangle_bijection n k g h.