(* 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_proof_irrel: forall (P : nat -> Type), forall (n m : nat) (e1 e2: n = m) (pn: P n), nat_cast P e1 pn = nat_cast P e2 pn.