]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream.ma
update in gruound
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / stream.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/oplusright_3.ma".
16 include "ground/lib/relations.ma".
17
18 (* STREAMS ******************************************************************)
19
20 coinductive stream (A:Type[0]): Type[0] ≝
21 | stream_cons: A → stream A → stream A
22 .
23
24 interpretation
25   "cons (streams)"
26   'OPlusRight A a u = (stream_cons A a u).
27
28 (* Basic constructions ******************************************************)
29
30 lemma stream_rew (A) (t:stream A): match t with [ stream_cons a u ⇒ a ⨮ u ] = t.
31 #A * //
32 qed.
33
34 (* Basic inversions *********************************************************)
35
36 lemma eq_inv_stream_cons_bi (A) (a1,a2:A) (u1) (u2):
37       a1 ⨮ u1 = a2 ⨮ u2 → ∧∧ a1 = a2 & u1 = u2.
38 #A #a1 #a2 #u1 #u2 #H destruct
39 /2 width=1 by conj/
40 qed-.