(** * Logical Predicates *)

Definition eq := @Logic.eq positive.Definition eq_equiv := @eq_equivalence positive.Definition lt x y := (x ?= y) = Lt.Definition gt x y := (x ?= y) = Gt.Definition le x y := (x ?= y) <> Gt.Definition ge x y := (x ?= y) <> Lt.Infix "<=" := Pos.le : positive_scope.Infix "<" := Pos.lt : positive_scope.Infix ">=" := Pos.ge : positive_scope.Infix ">" := Pos.gt : positive_scope.Notation "x <= y <= z" := (x <= y /\ y <= z) : positive_scope.Notation "x <= y < z" := (x <= y /\ y < z) : positive_scope.Notation "x < y < z" := (x < y /\ y < z) : positive_scope.Notation "x < y <= z" := (x < y /\ y <= z) : positive_scope.

(* Specifications: *)
Lemma eq_dec : forall x y:positive, {x = y} + {x <> y}.
Lemma xI_succ_xO p : p~1 = succ p~0.
Lemma succ_discr p : p <> succ p.
Lemma pred_double_spec p : pred_double p = pred (p~0).
Lemma succ_pred_double p : succ (pred_double p) = p~0.
Lemma pred_double_succ p : pred_double (succ p) = p~1.
Lemma double_succ p : (succ p)~0 = succ (succ p~0).
Lemma pred_double_xO_discr p : pred_double p <> p~0.
Lemma succ_not_1 p : succ p <> 1.
Lemma pred_succ p : pred (succ p) = p.
Lemma succ_pred_or p : p = 1 \/ succ (pred p) = p.
Lemma succ_pred p : p <> 1 -> succ (pred p) = p.
Lemma succ_inj p q : succ p = succ q -> p = q.
Lemma pred_N_succ p : pred_N (succ p) = Npos p.
Lemma add_1_r p : p + 1 = succ p.
Lemma add_1_l p : 1 + p = succ p.
Theorem add_carry_spec p q : add_carry p q = succ (p + q).
Theorem add_comm p q : p + q = q + p.
Theorem add_succ_r p q : p + succ q = succ (p + q).
Theorem add_succ_l p q : succ p + q = succ (p + q).
Lemma add_no_neutral p q : q + p <> p.
Lemma add_carry_add p q r s : add_carry p r = add_carry q s -> p + r = q + s.
Lemma add_reg_r p q r : p + r = q + r -> p = q.
Lemma add_reg_l p q r : p + q = p + r -> q = r.
Lemma add_cancel_r p q r : p + r = q + r <-> p = q.
Lemma add_cancel_l p q r : r + p = r + q <-> p = q.
Lemma add_carry_reg_r p q r : add_carry p r = add_carry q r -> p = q.
Lemma add_carry_reg_l p q r : add_carry p q = add_carry p r -> q = r.
Theorem add_assoc p q r : p + (q + r) = p + q + r.
Lemma add_xO p q : (p + q)~0 = p~0 + q~0.
Lemma add_xI_pred_double p q : (p + q)~0 = p~1 + pred_double q.
Lemma add_xO_pred_double p q : pred_double (p + q) = p~0 + pred_double q.
Lemma add_diag p : p + p = p~0.