简体   繁体   English

在COQ中将集合用作假设和目标

[英]Using sets as hyphotesis and goal in COQ

How exactly could a proof like the following be completed? 怎样才能像下面这样证明?

1 subgoals
IHt1 : {t' : some_type | something_using t'}
IHt2 : {t' : some_type | something_else_using t'}
______________________________________(1/1)
{t' : some_type | another_thing_involving t'}

I do understand that the {x|P x} notation is a shorthand for the sig definition but I really cannot understand how to use it. 我确实知道{x|P x}表示法是sig定义的简写,但我真的不明白如何使用它。

{x : D | P x} {x : D | P x} is intuitively speaking the subset of the domain D containing the elements that satisfy the predicate P . {x : D | P x}直觉上说,域D的子集包含满足谓词P的元素。 As a proposition, it is true if that subset is non-empty, ie if there is a witness x0 in D such that P x0 is true. 作为一个命题,如果那个子集是非空的,即在D有一个见证人x0使得P x0为真,则为真。

An object of type {x : D | P x} {x : D | P x}类型的对象 {x : D | P x} is a pair containing an element x0 : D and a proof of P x0 . {x : D | P x}是一对包含元素x0 : DP x0的证明的对。 This is visible when you look at the definition of {x : D | P x} 当您查看{x : D | P x}的定义时,这是可见的{x : D | P x} {x : D | P x} , which is syntactic sugar for sig (fun x:D => P x) {x : D | P x} ,这是sig (fun x:D => P x)语法糖sig (fun x:D => P x)

Inductive sig (D:Type) (P:D -> Prop) : Type :=
    exist : forall x:D, P x -> sig P.

The type of the constructor is a dependent pair type; 构造函数的类型是从属对类型。 the first element of the pair has the type D and the second element has the type P x in which x is the first element. 该对中的第一个元素具有类型D ,第二个元素具有类型P x ,其中x是第一个元素。

To make use of a hypothesis of the form {x : D | P x} 利用形式{x : D | P x} {x : D | P x} , the most basic way is to use the destruct tactic to break it down into its two components: a witness x0 : D and a proof H : P x0 . {x : D | P x} ,最基本的方法是使用destruct策略将其分解为两个部分:见证x0 : D和证明H : P x0

destruct IHt1.

1 subgoals
t' : some_type
H : something_using t'
IHt2 : {t'0 : some_type | something_else_using t'0}
______________________________________(1/1)
{t'0 : some_type | another_thing_involving t'0}

To prove a goal of the form {x : D | P x} 证明目标的形式为{x : D | P x} {x : D | P x} , the most basic is to use the exist tactic to introduce the intended witness. {x : D | P x} ,最基本的是使用exist策略来介绍预期的证人。 This leaves one subgoal which is to prove that the witness has the desired property. 这留下了一个子目标,以证明证人具有所需的财产。

exists u.

⋮
______________________________________(1/1)
another_thing_involving u

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM