intros w w'; generalize w; elim w'; clear w w'.
(* Focus 1 *)
intros w'1 Hrec w; case w; clear w.
(* 1.1 *)
intros w; unfold Qpositive_le', Qpositive_le in |- *; simpl in |- *.
generalize (Hrec w); clear Hrec; unfold Qpositive_le, Qpositive_le' in |- *;
simpl in |- *.
elim (interp_non_zero w); intros p Hex; elim Hex; intros q Heq; clear Hex;
rewrite Heq.
elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1;
clear Hex; rewrite Heq1.
intros H H1; (lapply H; [ intros H0; try exact H0 | idtac ]).
apply (fun p n m : nat => plus_le_reg_l n m p) with (S q * S q').
replace (S q * S q' + S p * S q') with ((S p + S q) * S q').
replace (S q * S q' + S p' * S q) with ((S p' + S q') * S q).
auto.
ring.
ring.
(* 1.2 *)
unfold Qpositive_le in |- *; simpl in |- *; auto.
(* 1.3 *)
unfold Qpositive_le in |- *; simpl in |- *.
auto.
(* Focus 2 *)
intros w'1 Hrec w; case w; clear w; unfold Qpositive_le in |- *;
simpl in |- *; auto.
(* 2.1 *)
intros w1; unfold Qpositive_le' in |- *; simpl in |- *.
elim (interp_non_zero w1); intros p Hex; elim Hex; intros q Heq; clear Hex;
rewrite Heq.
elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1;
clear Hex; rewrite Heq1.
rewrite mult_plus_distr_r.
repeat rewrite <- (mult_comm (S p' + S q')).
repeat rewrite mult_plus_distr_r.
repeat rewrite <- (plus_comm (S p' * S q)) || rewrite plus_assoc;
repeat rewrite <- plus_assoc.
pattern (S p' * S q) at 2 in |- *; rewrite plus_n_O.
intros H; generalize (plus_le_reg_l _ _ _ H); simpl in |- *; intros H1;
inversion H1.
(* 2.2 *)
intros w; unfold Qpositive_le', Qpositive_le in |- *; simpl in |- *.
generalize (Hrec w); clear Hrec; unfold Qpositive_le, Qpositive_le' in |- *;
simpl in |- *.
elim (interp_non_zero w); intros p Hex; elim Hex; intros q Heq; clear Hex;
rewrite Heq.
elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1;
clear Hex; rewrite Heq1.
intros H H1; (lapply H; [ intros H0; try exact H0 | idtac ]).
apply (fun p n m : nat => plus_le_reg_l n m p) with (S p * S p').
replace (S p * S p' + S p * S q') with (S p * (S p' + S q')).
replace (S p * S p' + S p' * S q) with (S p' * (S p + S q)).
auto.
ring.
ring.
(* 2.3 *)
unfold Qpositive_le' in |- *; simpl in |- *.
elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1;
clear Hex; rewrite Heq1.
rewrite <- plus_n_O; rewrite <- (mult_comm 1); simpl in |- *; intros H;
generalize (plus_le_reg_l _ _ _ (le_S_n _ _ H)).
intros H1; inversion H1.
(* Focus 3 *)
intros w; case w; clear w; unfold Qpositive_le', Qpositive_le in |- *;
simpl in |- *.
(* 3.1 *)
intros w; elim (interp_non_zero w).
intros p Hex; elim Hex; intros q Heq; rewrite Heq.
rewrite mult_1_r.
rewrite (plus_comm (S p)).
intros H; generalize (plus_le_reg_l _ _ _ H); intros H1; inversion H1.
(* 3.2 *)
auto.
(* 3.3 *)
auto.
Qed.

(* Specifications: *)
Theorem Qpositive_le_trans :
forall w w' w'' : Qpositive,
Qpositive_le w w' -> Qpositive_le w' w'' -> Qpositive_le w w''.