Coq中相依记录结构等式的证明
我定义了一个简单的结构:Coq中相依记录结构等式的证明,coq,dependent-type,Coq,Dependent Type,我定义了一个简单的结构: Require Import Ensembles. Record ConfigStructure {T:Type} : Type := mkCS { E: Ensemble T; C: Ensemble (Ensemble T); CS_wf : forall x y, In _ C x -> In _ x y -> In _ E y; rooted := In (Ensemble T) C (Empty_set T) }. CS\u w
Require Import Ensembles.
Record ConfigStructure {T:Type} : Type := mkCS {
E: Ensemble T;
C: Ensemble (Ensemble T);
CS_wf : forall x y, In _ C x -> In _ x y -> In _ E y;
rooted := In (Ensemble T) C (Empty_set T)
}.
CS\u wf
基于这两个参数在构造时强制执行语义格式良好属性。现在稍后,我需要比较两个记录的相等性——我应该如何处理证明组件
我从以下几点开始——我想lhs上也应该出现这两种良好的形式
Lemma CS_split: forall T e1 c1 wf1 e2 c2 wf2,
e1 = e2 /\ c1 = c2 -> mkCS T e1 c1 wf1 = mkCS T e2 c2 wf2.
Proof.
intros.
destruct H as [He Hc].
destruct He; destruct Hc.
f_equal.
Abort.
这让我想到:
T : Type
e1 : Ensemble T
c1 : Ensemble (Ensemble T)
wf1 : forall (x : Ensemble T) (y : T),
In (Ensemble T) c1 x -> In T x y -> In T e1 y
wf2 : forall (x : Ensemble T) (y : T),
In (Ensemble T) c1 x -> In T x y -> In T e1 y
============================
wf1 = wf2
我猜证明无关也起作用了?当然,“应用证明无关”起了作用——它在我的情况下不起作用,因为我的脚本中有一个要求导入经典事实,而正如Coq俱乐部成员指出的,我需要Coq.Logic.proof无关