如何在 Coq 中表达 "there exists a unique X"?

How to express "there exists a unique X" in Coq?

我想知道在 Coq 中是否有一种简洁 的写法来表示存在一个独特的东西(即写出独特的存在量词)?

比如说存在一个xs.t。 2 + x = 4:

Goal exists x, 2 + x = 4.

如何写出存在一个 unique x 具有相同的 属性?

我知道我可以像这样在 s.t. 部分复制谓词:

Goal exists x, 2 + x = 4 /\ forall y, 2 + y = 4 -> y = x.

但是一般来说这是很多重复,有没有办法以某种方式编码一个新的量词,然后写:

Goal exists1, 2 + x = 4.

表达相同的目标?

Coq 已经提供了 exists! 符号。例如:

Goal exists! x, 2 + x = 4.
Proof.
exists 2. split.
+ reflexivity.
+ intros. injection H; intro.
  symmetry; assumption.
Qed.