(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
Require Export Qpositive.
Fixpoint Qpositive_le_bool (w w' : Qpositive) {struct w'} : bool :=
match w with
| One => match w' with
| dL y => false
| _ => true
end
| dL y => match w' with
| dL y' => Qpositive_le_bool y y'
| _ => true
end
| nR y => match w' with
| nR y' => Qpositive_le_bool y y'
| _ => false
end
end.
Definition Qpositive_le (w w' : Qpositive) := Qpositive_le_bool w w' = true.
Definition Qpositive_le' (w w' : Qpositive) :=
match Qpositive_i w, Qpositive_i w' with
| (p, q), (p', q') => p * q' <= p' * q
end.

Theorem Qpositive_le_to_Qpositive_le' :
forall w w' : Qpositive, Qpositive_le w w' -> Qpositive_le' w w'.