Program Instance listOfMonotonic {A} (g : G A)
`{SizeMonotonic _ g } : SizeMonotonic (listOf g).
Next Obligation.
rewrite ! semListOfSize.
move => l [H1 H2]; split => //. by eapply leq_trans; eauto.
move => a /H2 Ha. by eapply monotonic; eauto.
Qed.

Lemma In_nth_exists {A} (l: list A) x def :
List.In x l -> exists n, nth def l n = x /\ (n < length l)%coq_nat.