(* Transport equality, only matching on eq_refl in contradictory cases, to make sure
   terms using this function reduce *)
Fixpoint nat_cast (P : nat -> Type) {n m} : n = m -> P n -> P m.

Lemma nat_cast_eq_rect: forall (P : nat -> Type), forall (n m : nat) (e: n = m) (pn: P n), nat_cast P e pn = eq_rect n P pn m e.