I want to prove the following theorem in Coq.

Please give me an advice if possible.

From mathcomp Require Import all_ssreflect.

Require Import QArith.

Theorem Compare_rationals (q1 : Q) (q2 : Q) : 
(if Qle_bool q1 q2 then 1 else 0) == 0 \/
(if Qle_bool q1 q2 then 1 else 0) == 1.

1 Answer 1


You may do a case analysis on Qle_bool q1 q2:

Proof. by case (Qle_bool q1 q2) ; [right | left]. Qed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.