1
$\begingroup$

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.
Proof. 
$\endgroup$

1 Answer 1

2
$\begingroup$

You may do a case analysis on Qle_bool q1 q2:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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