(P: Z -> Type): P 0 -> (forall n, 0 ≤ n -> P n -> P (1 + n)) -> (forall n, n ≤ 0 -> P n -> P (n - 1)) -> forall n, P n. Proof. intros P0 Psuc1 Psuc2 n. destruct (int_abs_sig Z nat n) as [[a A]|[a A]]. - rewrite <-A. clear A. revert a. apply naturals.. + rewrite rings.preserves_0. trivial. + intros m E. rewrite rings.preserves_plus, rings.preserves_1. apply Psuc1. * apply to_semiring_nonneg. * trivial. - rewrite <-(groups.negate_involutive n), <-A. clear A. revert a. apply naturals.. + rewrite rings.preserves_0, rings.negate_0. trivial. + intros m E. rewrite rings.preserves_plus, rings.preserves_1. rewrite rings.negate_plus_distr, commutativity. apply Psuc2. * apply naturals.negate_to_ring_nonpos. * trivial. Qed.
Require Import Import NatPair.Instances.