Coq 如何销毁表达式的值?
我正在学习Coq,并试图证明下一个看似简单的性质。 基本上,我需要考虑所有的情况下<代码> EQB X y <代码>。 但是我通常使用的Coq 如何销毁表达式的值?,coq,Coq,我正在学习Coq,并试图证明下一个看似简单的性质。 基本上,我需要考虑所有的情况下 EQB X y 。 但是我通常使用的destruct和inclusion策略在这里失败了 Fixpoint eqb (x:nat) (y: nat) :bool := match x,y with | 0, 0 => true | S xx, S yy => eqb xx yy | _,_ => false end. Definition bool_to_nat (b:bool) :nat :
destruct
和inclusion
策略在这里失败了
Fixpoint eqb (x:nat) (y: nat) :bool :=
match x,y with
| 0, 0 => true
| S xx, S yy => eqb xx yy
| _,_ => false
end.
Definition bool_to_nat (b:bool) :nat :=
match b with
| true => 1
| false => 0
end.
Theorem should_be_easy: forall x:nat, forall y : nat,
bool_to_nat (eqb x y) + bool_to_nat (negb (eqb x y)) = 1.
intros x y. Abort.
哇!遗憾的是,大多数教程似乎只显示变量的析构函数。
intros x y.
destruct (eqb x y).