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

匆匆过客 提交于 2019-12-19 10:32:50

问题


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?


回答1:


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.


来源:https://stackoverflow.com/questions/34387573/how-to-automatically-prove-simple-equality-of-real-numbers-in-coq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!