Skip to content

Commit 328b351

Browse files
committed
small reorganization of eventually lemmas
1 parent ec1de6b commit 328b351

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

infseq.v

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ CoInductive until (J P: infseq T->Prop) : infseq T -> Prop :=
6363

6464
Inductive eventually (P: infseq T->Prop) : infseq T -> Prop :=
6565
| E0 : forall s, P s -> eventually P s
66-
| E_next : forall x s, eventually P s -> eventually P (Cons x s).
66+
| E_next : forall x s, eventually P s -> eventually P (Cons x s).
6767

6868
Definition inf_often (P: infseq T->Prop) (s: infseq T) : Prop :=
6969
always (eventually P) s.
@@ -208,6 +208,27 @@ Proof.
208208
intros x s P al. change (P (Cons x s) \/ eventually P (tl (Cons x s))). case al; auto.
209209
Qed.
210210

211+
Lemma eventually_trans :
212+
forall (P Q inv: infseq T -> Prop),
213+
(forall x s, inv (Cons x s) -> inv s) ->
214+
(forall s, inv s -> P s -> eventually Q s) ->
215+
forall s, inv s -> eventually P s -> eventually Q s.
216+
Proof.
217+
intros P Q inv is_inv PeQ s invs ev. induction ev as [s Ps | x s ev IHev].
218+
apply PeQ; assumption.
219+
constructor 2. apply IHev. apply is_inv with x; assumption.
220+
Qed.
221+
222+
Lemma not_eventually :
223+
forall (P : infseq T -> Prop),
224+
forall x s, ~ eventually P (Cons x s) -> ~ eventually P s.
225+
Proof.
226+
intros P x s evCP evP.
227+
contradict evCP.
228+
apply E_next.
229+
assumption.
230+
Qed.
231+
211232
Lemma eventually_next :
212233
forall (s: infseq T) P, eventually (next P) s -> eventually P s.
213234
Proof.
@@ -256,17 +277,6 @@ induction ev as [s Ps | x s ev induc_hyp].
256277
apply induc_hyp; assumption.
257278
Qed.
258279

259-
Lemma eventually_trans :
260-
forall (P Q inv: infseq T -> Prop),
261-
(forall x s, inv (Cons x s) -> inv s) ->
262-
(forall s, inv s -> P s -> eventually Q s) ->
263-
forall s, inv s -> eventually P s -> eventually Q s.
264-
Proof.
265-
intros P Q inv is_inv PeQ s invs ev. induction ev as [s Ps | x s ev IHev].
266-
apply PeQ; assumption.
267-
constructor 2. apply IHev. apply is_inv with x; assumption.
268-
Qed.
269-
270280
(* inf_often and continuously facts *)
271281

272282
Lemma inf_often_invar :
@@ -587,12 +597,13 @@ Implicit Arguments always_inf_often [T s P].
587597
Implicit Arguments always_continuously [T s P].
588598

589599
Implicit Arguments until_Cons [T x s J P].
590-
Implicit Arguments eventually_Cons [T x s P].
600+
Implicit Arguments eventually_Cons [T x s P].
601+
Implicit Arguments eventually_trans [T P Q inv s].
602+
Implicit Arguments not_eventually [T P x s].
591603
Implicit Arguments eventually_next [T P s].
592604
Implicit Arguments eventually_always_cumul [T s P Q].
593605
Implicit Arguments eventually_until_cumul [T s P J].
594606
Implicit Arguments until_eventually [T P Q s J].
595-
Implicit Arguments eventually_trans [T P Q inv s].
596607

597608
Implicit Arguments inf_often_invar [T x s P].
598609
Implicit Arguments continuously_invar [T x s P].

0 commit comments

Comments
 (0)