Coq 辅酶Q亚型

Coq 辅酶Q亚型,coq,dependent-type,Coq,Dependent Type,我对子类型的定义如下 Record Subtype {T:Type}(P : T -> Prop) := { subtype :> Type; subtype_inj :> subtype -> T; subtype_isinj : forall (s t:subtype), (subtype_inj s = subtype_inj t) -> s = t; subtype_h : forall (x : T), P x -> (exi

我对子类型的定义如下

Record Subtype {T:Type}(P : T -> Prop) := {
subtype       :> Type;
subtype_inj   :> subtype -> T;
subtype_isinj : forall (s t:subtype), (subtype_inj s = subtype_inj t) -> s = t;
subtype_h     : forall (x : T), P x -> (exists s:subtype,x = subtype_inj s);
subtype_h0    : forall (s : subtype), P (subtype_inj s)}.
下列定理能被证明吗

Theorem Subtypes_Exist : forall {T}(P : T -> Prop), Subtype P.

如果不是,它是否可以从任何著名的兼容公理中证明?或者我可以把它作为一个公理吗?它会与任何常见的公理相冲突吗?(如可扩展性、函数选择等)

您的定义实际上与MathComp的定义相同;事实上,由于证据相关性,您缺少的主要是内射性

为此,我恐怕你需要假设命题无关:

Require Import ProofIrrelevance.
Theorem Subtypes_Exist : forall {T}(P : T -> Prop), Subtype P.
Proof.
intros T P; set (subtype_inj := @proj1_sig T P).
apply (@Build_Subtype _ _ { x | P x} subtype_inj).
+ intros [s Ps] [t Pt]; simpl; intros ->.
  now rewrite (proof_irrelevance _ Ps Pt).
+ now intros x Px; exists (exist _ x Px).
+ now destruct 0.
Qed.

当然,你总是可以将你的谓词
p
限制为一种有效地证明无关的类型。

是否可以使用UIP?另外,如果知道这个定理有多“强”会很好,比如如果我不想添加证明无关性,那么我将其作为一个公理添加,我会得到证明无关性吗?或者它只是等同于UIP?似乎是后者。但我并不真正理解它,所以如果你能解释它,那就太好了。证明无关性比UIP强,例如,假设你有证明
p1p2:x>0
,其中
x
是实的,那么你不能让它们仅仅与UIP相等。关于你的第二个问题,我不这么认为,但它肯定很接近。
现在
是一个“证明终结者”,是从其他战术语言(如Ssreflect的Isar)引入的。基本思想是,在应用
tac
加上其他一些“简单”战术后,现在需要关闭目标。注意,我更喜欢ssreflect的
by
,因为它通常要快得多,但是如果绑定到stdlib,我现在必须使用
。Coq中的实际定义如下: