{n m} : (n =n m) -> (n = m) := match m as m, n as n return (n =n m) -> (n = m) with | 0, 0 => fun _ => idpath | m'.+1, n'.+1 => fun H : (n' =n m') => ap S ( H) | _, _ => fun H => match H with end end. Global Instance isequiv_path_nat {n m} : IsEquiv (@ n m). Proof. refine (isequiv_adjointify (@ n m) (fun H => transport (fun m' => (n =n m')) H idcode_nat) _ _). { intros []; simpl. induction n; simpl; trivial. by destruct (IHn^)%path. } { intro. apply path_ishprop. } Defined.
Require Import Basics.