]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl.ma
b29772d320fca59ef849ff2a0ff4bf28c713ac31
[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 include "ground/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 (stream)" 'DownSpoon A t = (tl A 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.