Fixpoint Qpositive_c (p q n : nat) {struct n} : Qpositive :=
  match n with
  | O => One
  | S n' =>
      match p - q with
      | O => match q - p with
             | O => One
             | v => dL (Qpositive_c p v n')
             end
      | v => nR (Qpositive_c v q n')
      end
  end.

(* Specifications: *)
Theorem minus_O_le : forall n m : nat, n - m = 0 -> n <= m.
Theorem le_minus_O : forall n m : nat, n <= m -> n - m = 0.
Theorem minus_le : forall m n : nat, m - n <= m.
Theorem mult_reg_l : forall n m p : nat, S n * m = S n * p -> m = p.
Theorem absolu_inj_nat : forall x : nat, Z.abs_nat (Z_of_nat x) = x.
Theorem absolu_mult : forall x y : Z, Z.abs_nat (x * y) = Z.abs_nat x * Z.abs_nat y.
Theorem Qpositive_c_unfold1 : forall p q n : nat, S p + S q + S q <= S n -> Qpositive_c (S p + S q) (S q) (S n) = nR (Qpositive_c (S p) (S q) n).
Theorem Qpositive_c_unfold2 : forall p q n : nat, S p + (S p + S q) <= S n -> Qpositive_c (S p) (S p + S q) (S n) = dL (Qpositive_c (S p) (S q) n).
Theorem construct_correct : forall (w : Qpositive) (p q n : nat), Qpositive_i w = (p, q) -> p + q <= n -> Qpositive_c p q n = w.
Theorem construct_correct2 : forall n p q : nat, S p + S q <= n -> exists d : nat, S p = fst (Qpositive_i (Qpositive_c (S p) (S q) n)) * S d /\ S q = snd (Qpositive_i (Qpositive_c (S p) (S q) n)) * S d.
Theorem construct_correct2' : forall n p q : nat, 1 <= p -> 1 <= q -> p + q <= n -> exists d : nat, p = fst (Qpositive_i (Qpositive_c p q n)) * S d /\ q = snd (Qpositive_i (Qpositive_c p q n)) * S d.
Theorem construct_correct3 : forall n n' p q p' q' d : nat, S p = S d * p' -> S q = S d * q' -> S p + S q <= S n -> p' + q' <= S n' -> Qpositive_c (S p) (S q) (S n) = Qpositive_c p' q' (S n').
Theorem construct_correct4 : forall p q p' q' n n' : nat, S p + S q <= S n -> S p' + S q' <= S n' -> S p * S q' = S p' * S q -> Qpositive_c (S p) (S q) (S n) = Qpositive_c (S p') (S q') (S n').
Theorem construct_correct4' : forall p q p' q' n n' : nat, 1 <= p -> 1 <= q -> 1 <= p' -> 1 <= q' -> p + q <= n -> p' + q' <= n' -> p * q' = p' * q -> Qpositive_c p q n = Qpositive_c p' q' n'.
Theorem interp_inject : forall w w' : Qpositive, Qpositive_i w = Qpositive_i w' -> w = w'.
Theorem minus_decompose : forall a b c d : nat, a = b -> c = d -> a - c = b - d.
Theorem Qpositive_c_equiv : forall n p q n' p' q' : nat, S p + S q <= n -> S p' + S q' <= n' -> Qpositive_c (S p) (S q) n = Qpositive_c (S p') (S q') n' -> S p * S q' = S p' * S q.
Theorem Qpositive_c_equiv' : forall n p q n' p' q' : nat, 1 <= p -> 1 <= q -> 1 <= p' -> 1 <= q' -> p + q <= n -> p' + q' <= n' -> Qpositive_c p q n = Qpositive_c p' q' n' -> p * q' = p' * q.