(* -*- 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)         *)
(************************************************************************)
(** Properties of the injection from binary positive numbers to Peano natural numbers *)
(** Original development by Pierre Crégut, CNET, Lannion, France *)
Local Open Scope positive_scope.
Local Open Scope nat_scope.
Module Pos2Nat.
(** [Pos.to_nat] is a morphism for successor, addition, multiplication *)

Theorem inj_sub_max p q :
to_nat (p - q) = Nat.max 1 (to_nat p - to_nat q).