如何证明两个不相等的单例集的交集为空

时间:2019-05-26 16:30:24

标签: coq

我将证明的内容简化为一些陈述,即两个不同的单例集的交集是空的,但无法证明这一看似简单的事实。

我已经浏览了Ensembles,Powerset Facts,Constructive Sets之类的库,但是找不到任何有用的东西。

Require Import Coq.Sets.Ensembles.
Require Import Coq.Strings.String.

Example x: string := "x".
Example y: string := "y".

Lemma ex:
Intersection string (Singleton string x)
  (Singleton string y) = Empty_set string.
Proof.
  ???

1 个答案:

答案 0 :(得分:2)

关键是使用可扩展性公理:

Require Import Coq.Sets.Ensembles.
Require Import Coq.Strings.String.

Example x: string := "x".
Example y: string := "y".

Lemma ex:
Intersection string (Singleton string x)
  (Singleton string y) = Empty_set string.
Proof.
apply Extensionality_Ensembles. split.
- intros _ [b Ha Hb].
  inversion Ha. inversion Hb. unfold x, y in *. congruence.
- now intros _ [].
Qed.