proposition: Theorem inject_nat_convert : forall (p : Z) (q : positive), p = Zpos q -> Z_of_nat (nat_of_P q) = p.
proof: Proof. intros p q H'; rewrite H'. CaseEq (nat_of_P q); simpl in |- *. elim q; unfold nat_of_P in |- *; simpl in |- *; intros; try discriminate. absurd (0%Z = Zpos p0); auto. red in |- *; intros H'0; try discriminate. apply H; auto. change (nat_of_P p0 = 0) in |- *. generalize H0; rewrite ZL6; case (nat_of_P p0); simpl in |- *; auto; intros; try discriminate. intros n; rewrite <- nat_of_P_o_P_of_succ_nat_eq_succ. intros H'0; apply f_equal with (f := Zpos). apply nat_of_P_inj; auto. Qed.
imports: Reals ZArith List PeanoNat Psatz