]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / stream_tls.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/downspoonstar_3.ma".
16 include "ground/lib/stream_hdtl.ma".
17 include "ground/arith/nat_succ_iter.ma".
18
19 (* ITERATED TAIL FOR STREAMS ************************************************)
20
21 definition stream_tls (A) (n): stream A → stream A ≝
22            (stream_tl A)^n.
23
24 interpretation
25   "iterated tail (strams)"
26   'DownSpoonStar A n f = (stream_tls A n f).
27
28 (* Basic constructions ******************************************************)
29
30 lemma stream_tls_zero (A) (t):
31       t = ⫰*{A}[𝟎]t.
32 // qed.
33
34 lemma stream_tls_tl (A) (n) (t):
35       (⫰⫰*[n]t) = ⫰*{A}[n]⫰t.
36 #A #n #t
37 @(niter_appl … (stream_tl …))
38 qed.
39
40 lemma stream_tls_succ (A) (n) (t):
41       (⫰⫰*[n]t) = ⫰*{A}[↑n]t.
42 #A #n #t
43 @(niter_succ … (stream_tl …))
44 qed.
45
46 lemma stream_tls_swap (A) (n) (t):
47       (⫰*[n]⫰t) = ⫰*{A}[↑n]t.
48 // qed.
49
50 lemma stream_tls_eq_repl (A) (n):
51       stream_eq_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2).
52 #A #n @(nat_ind_succ … n) -n //
53 #n #IH * #n1 #t1 * #n2 #t2 #H elim (stream_eq_inv_cons … H) /2 width=7 by/
54 qed.