(* -*- coding: utf-8 -*- *)
(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** Binary Integers (Pierre Crégut, CNET, Lannion, France) *)
Require Export Arith_base.
Local Open Scope Z_scope.
(** Conversions between integers and natural numbers  Seven sections: - chains of conversions (combining two conversions) - module N2Z : from N to Z - module Z2N : from Z to N (negative numbers rounded to 0) - module Zabs2N : from Z to N (via the absolute value) - module Nat2Z : from nat to Z - module Z2Nat : from Z to nat (negative numbers rounded to 0) - module Zabs2Nat : from Z to nat (via the absolute value) *)
(** * Chains of conversions *)
(** When combining successive conversions, we have the following commutative diagram: << ---> Nat ---- |      ^      | |      |      v Pos ---------> Z |      |      ^ |      v      | ----> N ----- >> *)

Lemma Zabs_nat_N n : N.of_nat (Z.abs_nat n) = Z.abs_N n.
Module N2Z.