]> matita.cs.unibo.it Git - helm.git/blob - streams_hdtl.ma
3a31efc350da7ba6e6769ce360969ddfa754b564
[helm.git] / streams_hdtl.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground_2/notation/functions/drop_1.ma".
16 include "ground_2/lib/streams_eq.ma".
17 include "ground_2/lib/arith.ma".
18
19 (* STREAMS ******************************************************************)
20
21 definition hd (A:Type[0]): stream A → A ≝
22               λt. match t with [ seq a _ ⇒ a ].
23
24 definition tl (A:Type[0]): stream A → stream A ≝
25               λt. match t with [ seq _ t ⇒ t ].
26
27 interpretation "tail (streams)" 'Drop t = (tl ? t).
28
29 (* basic properties *********************************************************)
30
31 lemma hd_rew (A) (a) (t): a = hd A (a@t).
32 // qed.
33
34 lemma tl_rew (A) (a) (t): t = tl A (a@t).
35 // qed.
36
37 lemma eq_stream_split (A) (t): (hd … t) @ ↓t ≐⦋A⦌ t.
38 #A * //
39 qed.