我有一个依赖型该款机型在一个过渡系统有限路径。过渡系统具有功能R
能产生一个命题说法是否有状态s
和s'
与标签a
之间的边缘。有限路径类型是:
Inductive FinPathTail (s : S i) :=
| FPTNil: FinPathTail s
| FPTCons (a : Act i) (s' : S i) : R i s a s' ->
FinPathTail s' -> FinPathTail s.
(该“尾巴”位,因为这实际上机型所有,但开始s
路径的头)。
我已经定义了一个CoInductive类型的可能是无限的PathTail(我将在底部坚持下去,以获得对问题更快),我有一个功能,fpt_to_pt
,来变换FinPathTail成PathTail。这应该“明明”是射的,所以我想证明这种形式的引理:
Lemma fpt_to_pt_inj {s : S i} (fpt fpt' : FinPathTail s)
: (forall s s' : S i, {s = s'} + {s <> s'}) ->
fpt_to_pt fpt = fpt_to_pt fpt' -> fpt = fpt'.
当试图通过感应上fpt
来证明这一点,我很快得到的地方,双方都已知conses之外的情况。我们的目标最终看起来是这样的:
PTCons s a s' r (fpt_to_pt fpt) = PTCons s a2 s'2 r2 (fpt_to_pt fpt') ->
FPTCons s a s' r fpt = FPTCons s a2 s'2 r2 fpt'
我想用injection
战术分解。结果最终是这样的:
existT (fun s'0 : S i => PathTail s'0) s' (fpt_to_pt fpt) =
existT (fun s'0 : S i => PathTail s'0) s'2 (fpt_to_pt fpt') ->
s' = s'2 -> a = a2 -> FPTCons s a s' r fpt = FPTCons s a2 s'2 r2 fpt'
并使用inversion_sigma战术,我可以把它转换为:
B : s' = s'2
C : a = a2
A0 : s' = s'2
A1 : eq_rect s' (fun a : S i => PathTail a) (fpt_to_pt fpt) s'2 A0 = fpt_to_pt fpt'
我想我明白为什么我需要可判定源域,才能使用inj_pair2_eq_dec
。我不明白的是:发生了什么事R和R 2?据我所知,我没有证据无关,但并不意味着他们必须一直在为相同的conses之外相等?还是我误解的东西有关的命题根本?
PS:下面是PathTail的coinductive定义:
CoInductive PathTail (s : S i) :=
| PTNil: PathTail s
| PTCons (a : Act i) (s' : S i) : R i s a s' -> PathTail s' -> PathTail s.
显然,injection
策略默认情况下忽略了证据之间的平等,但是你可以重写与Keep Proof Equalities
flag此行为:
Inductive foo : nat -> Prop :=
| Foo (n : nat) : foo n.
Inductive bar :=
| Bar (n : nat) : foo n -> bar.
Lemma test n nn m mm : Bar n nn = Bar m mm -> False.
Proof.
intros H. injection H. (* No equality generated. *)
Abort.
Set Keep Proof Equalities.
Lemma test n nn m mm : Bar n nn = Bar m mm -> False.
Proof.
intros H. injection H. (* Equality generated. *)
Abort.