Definition enum_rank x := @enum_rank_in x T (erefl true) x.

(* Specifications: *)
Lemma enum_val_nth A x i : @enum_val A i = nth x (enum A) i.
Lemma nth_enum_rank x0 : cancel enum_rank (nth x0 (enum T)).
Lemma enum_rankK : cancel enum_rank enum_val.
Lemma enum_valK_in x0 A Ax0 : cancel enum_val (@enum_rank_in x0 A Ax0).
Lemma enum_valK : cancel enum_val enum_rank.
Lemma enum_rank_inj : injective enum_rank.
Lemma enum_val_inj A : injective (@enum_val A).
Lemma enum_rank_bij : bijective enum_rank.
Lemma enum_val_bij : bijective (@enum_val T).
Lemma fin_all_exists U (P : forall x : T, U x -> Prop) : (forall x, exists u, P x u) -> (exists u, forall x, P x (u x)).
Lemma fin_all_exists2 U (P Q : forall x : T, U x -> Prop) : (forall x, exists2 u, P x u & Q x u) -> (exists2 u, forall x, P x (u x) & forall x, Q x (u x)).
Lemma enum_rank_ord n i : enum_rank i = cast_ord (esym (card_ord n)) i.
Lemma enum_val_ord n i : enum_val i = cast_ord (card_ord n) i.