Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equality on type which is not inductive type

Tags:

rocq-prover

I want to think about equality on real number in Coq.

But R in Coq.Reals.Reals. is not inductive type, so I can't define functions like Nat.eqb.

How do I define equality on real numbers in Coq?

like image 990
Daisuke Sugawara Avatar asked Dec 10 '25 06:12

Daisuke Sugawara


1 Answers

The real numbers are axiomatized in Coq, and so is their equality operator:

Require Import Coq.Reals.Reals.

Check Req_EM_T.

(* forall r1 r2 : R, {r1 = r2} + {r1 <> r2} *)

The {r1 = r2} + {r1 <> r2} type is an informative boolean that gives you a proof of whether the two real numbers are equal.

like image 106
Arthur Azevedo De Amorim Avatar answered Dec 12 '25 14:12

Arthur Azevedo De Amorim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!