]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl_eq.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / stream_hdtl_eq.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/lib/stream_hdtl.ma".
16 include "ground/lib/stream_eq.ma".
17
18 (* HEAD AND TAIL FOR STREAMS ************************************************)
19
20 (* Constructions with stream_eq *********************************************)
21
22 lemma stream_hd_eq_repl (A):
23       stream_eq_repl A (λt1,t2. ⇃t1 = ⇃t2).
24 #A * #a1 #t1 * #a2 #t2 #H
25 elim (stream_eq_inv_cons_bi … H) -H
26 /2 width=7 by/
27 qed.
28
29 lemma stream_tl_eq_repl (A):
30       stream_eq_repl A (λt1,t2. ⇂t1 ≗ ⇂t2).
31 #A * #a1 #t1 * #a2 #t2 #H
32 elim (stream_eq_inv_cons_bi … H) -H
33 /2 width=7 by/
34 qed.
35
36 lemma stream_hd_tl_eq_repl (A) (t1) (t2):
37       t1 ≗{A} t2 →
38       ∧∧ ⇃t1 = ⇃t2 & ⇂t1 ≗ ⇂t2.
39 #A #t1 #t2 #H
40 /3 width=1 by stream_tl_eq_repl, stream_hd_eq_repl, conj/
41 qed-.
42
43 (* Inversions with stram_eq *************************************************)
44
45 lemma stream_eq_inv_hd_tl_bi (A) (t1) (t2):
46       ⇃t1 = ⇃t2 → ⇂t1 ≗ ⇂t2 → t1 ≗{A} t2.
47 #A * #a1 #t1 * #a2 #t2
48 /2 width=1 by stream_eq_cons/
49 qed-.