Lob&x27的一个特例;利用Coq的s定理
我有一个归纳式定义如下:Lob&x27的一个特例;利用Coq的s定理,coq,lob,coq-tactic,Coq,Lob,Coq Tactic,我有一个归纳式定义如下: Parameter world : Type. Parameter R : world -> world -> Prop. Definition Proposition : Type := world -> Prop (* This says that R has only a finite number of steps it can take *) Inductive R_ends : world -> Prop := | re : fo
Parameter world : Type.
Parameter R : world -> world -> Prop.
Definition Proposition : Type := world -> Prop
(* This says that R has only a finite number of steps it can take *)
Inductive R_ends : world -> Prop :=
| re : forall w, (forall w', R w w' -> R_ends w') -> R_ends w.
(* if every reachable state will end then this state will end *)
假设:
Hypothesis W : forall w, R_ends w.
我想证明:
forall P: Proposition, (forall w, (forall w0, R w w0 -> P w0) -> P w)) -> (forall w, P w)
我尝试在类型world
上使用归纳
策略,但失败了,因为它不是归纳类型
在Coq中可以证明吗?如果可以,您能建议如何证明吗?您可以对类型为
R\u end的术语使用结构归纳法
:
Lemma lob (P : Proposition) (W : forall w, R_ends w) :
(forall w, (forall w0, R w w0 -> P w0) -> P w) -> (forall w, P w).
Proof.
intros H w.
specialize (W w).
induction W.
apply H.
intros w' Hr.
apply H1.
assumption.
Qed.
顺便说一句,您可以用稍微不同的方式定义R_end
,使用参数而不是索引:
Inductive R_ends (w : world) : Prop :=
| re : (forall w', R w w' -> R_ends w') -> R_ends w.
以这种方式编写时,很容易看出R\u end
类似于标准库()中定义的可访问性谓词Acc
:
它被用来与有根据的归纳法一起工作
Inductive Acc (x: A) : Prop :=
Acc_intro : (forall y:A, R y x -> Acc y) -> Acc x.