| 1 |
Set Primitive Projections. |
| 2 |
|
| 3 |
CoInductive Stream : Type := Cons { tl : Stream }. |
| 4 |
|
| 5 |
Fixpoint Str_nth_tl (n:nat) (s:Stream) : Stream := |
| 6 |
match n with |
| 7 |
| O => s |
| 8 |
| S m => Str_nth_tl m (tl s) |
| 9 |
end. |
| 10 |
|
| 11 |
CoInductive EqSt (s1 s2: Stream) : Prop := eqst { |
| 12 |
eqst_tl : EqSt (tl s1) (tl s2); |
| 13 |
}. |
| 14 |
|
| 15 |
Axiom EqSt_reflex : forall (s : Stream), EqSt s s. |
| 16 |
|
| 17 |
CoFixpoint map (s:Stream) : Stream := Cons (map (tl s)). |
| 18 |
|
| 19 |
Lemma Str_nth_tl_map : forall n s, EqSt (Str_nth_tl n (map s)) (map (Str_nth_tl n s)). |
| 20 |
Proof. |
| 21 |
induction n. |
| 22 |
+ intros; apply EqSt_reflex. |
| 23 |
+ cbn; intros s; apply IHn. |
| 24 |
Qed. |
| 25 |
|
| 26 |
Definition boom : forall s, tl (map s) = map (tl s) := fun s => eq_refl. |