Library Coq.PArith.Pnat
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.
Import Pos.
Pos.to_nat is a morphism for successor, addition, multiplication
Mapping of xH, xO and xI through Pos.to_nat
Pos.to_nat maps to the strictly positive subset of nat
Pos.to_nat is strictly positive
Pos.to_nat is a bijection between positive and
non-zero nat, with Pos.of_nat as reciprocal.
See Nat2Pos.id below for the dual equation.
Pos.to_nat is hence injective
Pos.to_nat is a morphism for comparison
Pos.to_nat is a morphism for lt, le, etc
Pos.to_nat is a morphism for subtraction
Pos.to_nat and other operations
Pos.of_nat is a bijection between non-zero nat and
positive, with Pos.to_nat as reciprocal.
See Pos2Nat.id above for the dual equation.
Pos.of_nat is hence injective for non-zero numbers
Usual operations are morphisms with respect to Pos.of_nat
for non-zero numbers.
Properties of the shifted injection from Peano natural numbers
to binary positive numbers
Composition of Pos.to_nat and Pos.of_succ_nat is successor
on positive
Composition of Pos.to_nat, Pos.of_succ_nat and Pos.pred
is identity on positive
Composition of Pos.of_succ_nat and Pos.to_nat is successor on nat
Pos.of_succ_nat is hence injective
Another formulation
Successor and comparison are morphisms with respect to
Pos.of_succ_nat
Other operations, for instance Pos.add and plus aren't
directly related this way (we would need to compensate for
the successor hidden in Pos.of_succ_nat
For compatibility, old names and old-style lemmas
Old intermediate results about Pmult_nat