X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fground%2Flib%2Fstream_tls.ma;h=9f34ba81d06f5b1a723571a005b11f2be8f22654;hp=051c58cca7db7011de8029d30c38b376ebb2e4c7;hb=6604a232815858a6c75dd25ac45abd68438077ff;hpb=888840f6b3a71d3d686b53b702d362ab90ab0038 diff --git a/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma index 051c58cca..9f34ba81d 100644 --- a/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma +++ b/matita/matita/contribs/lambdadelta/ground/lib/stream_tls.ma @@ -14,28 +14,41 @@ include "ground/notation/functions/downspoonstar_3.ma". include "ground/lib/stream_hdtl.ma". +include "ground/arith/nat_succ_iter.ma". -(* STREAMS ******************************************************************) +(* ITERATED TAIL FOR STREAMS ************************************************) -rec definition tls (A:Type[0]) (n:nat) on n: stream A → stream A ≝ ?. -cases n -n [ #t @t | #n #t @tl @(tls … n t) ] -defined. +definition stream_tls (A) (n): stream A → stream A ≝ + (stream_tl A)^n. -interpretation "iterated tail (stram)" 'DownSpoonStar A n f = (tls A n f). +interpretation + "iterated tail (strams)" + 'DownSpoonStar A n f = (stream_tls A n f). -(* basic properties *********************************************************) +(* Basic constructions ******************************************************) -lemma tls_rew_O (A) (t): t = tls A 0 t. +lemma stream_tls_zero (A) (t): + t = ⫰*{A}[𝟎]t. // qed. -lemma tls_rew_S (A) (n) (t): ⫰⫰*[n]t = tls A (↑n) t. -// qed. +lemma stream_tls_tl (A) (n) (t): + (⫰⫰*[n]t) = ⫰*{A}[n]⫰t. +#A #n #t +@(niter_appl … (stream_tl …)) +qed. -lemma tls_S1 (A) (n) (t): ⫰*[n]⫰t = tls A (↑n) t. -#A #n elim n -n // +lemma stream_tls_succ (A) (n) (t): + (⫰⫰*[n]t) = ⫰*{A}[↑n]t. +#A #n #t +@(niter_succ … (stream_tl …)) qed. -lemma tls_eq_repl (A) (n): eq_stream_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). -#A #n elim n -n // -#n #IH * #n1 #t1 * #n2 #t2 #H elim (eq_stream_inv_seq … H) /2 width=7 by/ +lemma stream_tls_swap (A) (n) (t): + (⫰*[n]⫰t) = ⫰*{A}[↑n]t. +// qed. + +lemma stream_tls_eq_repl (A) (n): + stream_eq_repl A (λt1,t2. ⫰*[n] t1 ≗ ⫰*[n] t2). +#A #n @(nat_ind_succ … n) -n // +#n #IH * #n1 #t1 * #n2 #t2 #H elim (stream_eq_inv_cons … H) /2 width=7 by/ qed.