In Coq, which tactic to change the goal from `S x = S y` to `x = y`

可紊 提交于 2019-12-06 01:52:26

The tactic apply f_equal. will do what you want, for any constructor or function.

The lema f_equal shows that for any function f, you always have x = y -> f x = f y. This allows you to reduce the goal from f x = f y to x = y:

Proposition myprop (x y: nat) (H : x = y) : S x = S y.
Proof.
  apply f_equal.  assumption.
Qed.

(The injection tactic implements the converse implication — that for some functions, and in particular for constructors, f x = f y -> x = y.)

You may want to have a look at the injection tactic: http://coq.inria.fr/distrib/V8.4/refman/Reference-Manual011.html#@tactic126

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