Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically prove simple equality of real numbers in Coq?

What I am looking for is an auto-like tactic that can prove simple equalities like:

1/2 = 2/4

So far, what I've tried manually is to use ring_simplify and field_simplify to prove equalities. Even this doesn't work out well (Coq 8.5b3). The example below works:

Require Export Coq.Reals.RIneq.
Local Open Scope Z_scope.
Local Open Scope R_scope.

Example test2: 1 = 1 / 1.
Proof. field_simplify. field_simplify. reflexivity.
Qed. 

But it was necessary to use field_simplfy twice before reflexivity. The first field_simplfiy gives me:

1 subgoal
______________________________________(1/1)
1 / 1 = 1 / 1 / (1 / 1)

which is not subject to reflexivity.

The example below does not work, field_simplify seems to do nothing on the goal, and therefore, reflexivity can't be used.

Example test3: 1/2 = 2/4.
Proof. field_simplify. reflexivity. 

Again, is there an automatic way to achieve this, like an field_auto?

like image 317
thor Avatar asked Nov 01 '25 15:11

thor


1 Answers

I believe that tactic field is what you want.

Require Export Coq.Reals.RIneq.
Local Open Scope Z_scope.
Local Open Scope R_scope.


Example test3: 1/2 = 2/4.
Proof.  field. Qed.
like image 141
Rodrigo Ribeiro Avatar answered Nov 04 '25 13:11

Rodrigo Ribeiro



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!