这很清楚destruct H
ifH
包含合取或析取。但我无法弄清楚它在一般情况下的作用。它做了一些奇怪的事情,尤其是如果H: a -> b
.
一些例子:
Lemma demo : forall (x y: nat), x=4 -> x=4.
Proof.
intros. destruct H.
假设刚刚被破坏:
1 subgoal
x, y : nat
______________________________________(1/1)
x = x
另一个:
Lemma demo : forall (x y: nat), (x = 4 -> x=4) -> True.
Proof.
intros. destruct H.
现在我有两个分支:
1 subgoal
x, y : nat
______________________________________(1/1)
x = 4
1 subgoal
x, y : nat
______________________________________(1/1)
True
第三个例子。这无法证明,但对我来说仍然没有意义:
Lemma demo : forall (x y: nat), (x = 4 -> x = 4) -> x = 4.
Proof.
intros. destruct H.
x = x
现在我必须在第二个分支中证明!
2 subgoals
x, y : nat
______________________________________(1/2)
x = 4
______________________________________(2/2)
x = x
所以,我显然不明白是什么destruct H
。