]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / stream_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/notation/functions/downharpoonleft_2.ma".
16 include "ground/notation/functions/downharpoonright_2.ma".
17 include "ground/lib/stream.ma".
18
19 (* HEAD AND TAIL FOR STREAMS ************************************************)
20
21 definition stream_hd (A:Type[0]): stream A → A.
22 #A * #a #_ @a
23 defined.
24
25 interpretation
26   "head (streams)"
27   'DownHarpoonLeft A t = (stream_hd A t).
28
29 definition stream_tl (A:Type[0]): stream A → stream A.
30 #A * #_ #t @t
31 defined.
32
33 interpretation
34   "tail (streams)"
35   'DownHarpoonRight A t = (stream_tl A t).
36
37 (* Basic constructions ******************************************************)
38
39 lemma stream_hd_cons (A) (a) (t):
40       a = ⇃{A}(a⨮t).
41 // qed.
42
43 lemma stream_tl_cons (A) (a) (t):
44       t = ⇂{A}(a⨮t).
45 // qed.
46
47 lemma stream_split_tl (A) (t):
48       ⇃{A}t ⨮ ⇂t = t.
49 #A * //
50 qed.