如何访问coq中的记录元素

如何访问coq中的记录元素,coq,Coq,假设我有记录 Record ToyModel:={ universe:Set; aNiceProperty:universe->Prop; color:universe->nat }. 我想定义一个兼容性的概念 ToyModel类型的元素 Definition Compatible(T1 T2: ToyModel):= if there is an element of T1.universe with color a then there exists an element

假设我有记录

Record ToyModel:={
universe:Set; 
aNiceProperty:universe->Prop;
color:universe->nat
}.
我想定义一个兼容性的概念 ToyModel类型的元素

Definition Compatible(T1 T2: ToyModel):=
if there is an element of T1.universe with color a then there 
exists an element of T2.universe with color a. 
我怎么能用coq写呢?问题是我不知道
如何访问记录中的元素。

记录的字段成为它的访问器函数,因此它应该只是一个问题:

universe t (* where t : ToyModel *)
color t u  (* where t : ToyModel, u : universe *)
或:

您可能必须:

Set Printing Projections.
比照

Set Printing Projections.