Definition Qpositive_sub (w w' : Qpositive) :=
  let (p, q) := Qpositive_i w in
  let (p', q') := Qpositive_i w' in
  Qpositive_c (p * q' - p' * q) (q * q') (p * q' + p' * q + q * q').

(* Specifications: *)
Theorem lt_mult_conv : forall x y z : nat, S x * y < S x * z -> y < z.
Theorem Qpositive_sub_correct : forall w w' : Qpositive, Qpositive_sub (Qpositive_plus w w') w' = w.
Theorem le_minus_left : forall a b c : nat, b <= a -> c <= a -> c <= b -> a - b <= a - c.
Theorem le_minus_right : forall a b c : nat, a <= b -> a <= c -> b <= c -> b - a <= c - a.
Theorem Qpositive_le_sub_l : forall w w' w'' : Qpositive, w <> w'' -> w' <> w'' -> Qpositive_le w w'' -> Qpositive_le w' w'' -> Qpositive_le w w' -> Qpositive_le (Qpositive_sub w'' w') (Qpositive_sub w'' w).
Theorem Qpositive_le_sub_r : forall w w' w'' : Qpositive, w <> w'' -> w' <> w'' -> Qpositive_le w'' w -> Qpositive_le w'' w' -> Qpositive_le w w' -> Qpositive_le (Qpositive_sub w w'') (Qpositive_sub w' w'').
Theorem Qpositive_mult_minus_distr : forall w w' w'' : Qpositive, w <> w' -> Qpositive_le w w' -> Qpositive_mult (Qpositive_sub w' w) w'' = Qpositive_sub (Qpositive_mult w' w'') (Qpositive_mult w w'').
Theorem Qpositive_plus_simpl : forall w w' w'' : Qpositive, Qpositive_plus w w'' = Qpositive_plus w' w'' -> w = w'.
Theorem Qpositive_sub_correct2 : forall w w' : Qpositive, w <> w' -> Qpositive_le w' w -> Qpositive_plus (Qpositive_sub w w') w' = w.
Theorem Qpositive_sub_le : forall w w' : Qpositive, w <> w' -> Qpositive_le w' w -> Qpositive_le (Qpositive_sub w w') w.
Theorem Qpositive_sub_simpl_r : forall w w' w'' : Qpositive, w <> w'' :>Qpositive -> w' <> w'' :>Qpositive -> Qpositive_le w'' w -> Qpositive_le w'' w' -> Qpositive_sub w w'' = Qpositive_sub w' w'' -> w = w'.
Theorem Qpositive_sub_simpl_l : forall w w' w'' : Qpositive, w <> w'' :>Qpositive -> w' <> w'' :>Qpositive -> Qpositive_le w w'' -> Qpositive_le w' w'' -> Qpositive_sub w'' w = Qpositive_sub w'' w' -> w = w'.
Theorem Qpositive_sub_diff : forall w w' : Qpositive, w <> w' -> Qpositive_le w' w -> w <> Qpositive_sub w w'.
Theorem Qpositive_plus_sub_assoc : forall w w' w'' : Qpositive, w <> w' -> Qpositive_le w' w -> Qpositive_plus (Qpositive_sub w w') w'' = Qpositive_sub (Qpositive_plus w w'') w'.
Theorem Qpositive_sub_sub_assoc : forall w w' w'' : Qpositive, w' <> w'' -> Qpositive_le w'' w' -> w <> Qpositive_sub w' w'' -> Qpositive_le (Qpositive_sub w' w'') w -> Qpositive_sub w (Qpositive_sub w' w'') = Qpositive_sub (Qpositive_plus w w'') w'.
Theorem Qpositive_sub_sub_assoc_l : forall w w' w'' : Qpositive, w <> Qpositive_plus w' w'' -> Qpositive_le (Qpositive_plus w' w'') w -> Qpositive_sub (Qpositive_sub w w') w'' = Qpositive_sub w (Qpositive_plus w' w'').