]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma
propagating the arithmetics library, partial commit
[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/downspoon_2.ma".
16 include "ground/lib/stream_eq.ma".
17
18 (* HEAD AND TAIL FOR STREAMS ************************************************)
19
20 definition stream_hd (A:Type[0]): stream A → A ≝
21            λt. match t with [ stream_cons a _ ⇒ a ].
22
23 definition stream_tl (A:Type[0]): stream A → stream A ≝
24            λt. match t with [ stream_cons _ t ⇒ t ].
25
26 interpretation
27   "tail (streams)"
28   'DownSpoon A t = (stream_tl A t).
29
30 (* Basic constructions ******************************************************)
31
32 lemma stream_hd_cons (A) (a) (t):
33       a = stream_hd A (a⨮t).
34 // qed.
35
36 lemma stream_tl_cons (A) (a) (t):
37       t = ⫰{A}(a⨮t).
38 // qed.
39
40 lemma eq_stream_split_hd_tl (A) (t):
41       stream_hd … t ⨮ ⫰t ≗{A} t.
42 #A * //
43 qed.