]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/etc/relocation/pstream.etc
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / etc / relocation / pstream.etc
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/upspoon_1.ma".
16 include "ground/lib/stream.ma".
17 include "ground/arith/pnat.ma".
18
19 (* RELOCATION P-STREAM ******************************************************)
20
21 definition gr_push: gr_map → gr_map ≝ λf. 𝟏⨮f.
22
23 interpretation "push (pstream)" 'UpSpoon f = (gr_push f).
24
25 definition gr_next: gr_map → gr_map.
26 * #p #f @(↑p⨮f)
27 defined.
28
29 interpretation "next (pstream)" 'UpArrow f = (gr_next f).
30
31 (* Basic properties *********************************************************)
32
33 lemma gr_push_unfold: ∀f. 𝟏⨮f = ⫯f.
34 // qed.
35
36 lemma gr_next_unfold: ∀f,p. (↑p)⨮f = ↑(p⨮f).
37 // qed.
38
39 (* Basic inversion lemmas ***************************************************)
40
41 lemma eq_inv_gr_push_bi: injective ? ? gr_push.
42 #f1 #f2 <gr_push_unfold <gr_push_unfold #H destruct //
43 qed-.
44
45 lemma eq_inv_gr_push_next: ∀f1,f2. ⫯f1 = ↑f2 → ⊥.
46 #f1 * #p2 #f2 <gr_push_unfold <gr_next_unfold #H destruct
47 qed-.
48
49 lemma eq_inv_gr_next_push: ∀f1,f2. ↑f1 = ⫯f2 → ⊥.
50 * #p1 #f1 #f2 <gr_next_unfold <gr_push_unfold #H destruct
51 qed-.
52
53 lemma eq_inv_gr_next_bi: injective ? ? gr_next.
54 * #p1 #f1 * #p2 #f2 <gr_next_unfold <gr_next_unfold #H destruct //
55 qed-.
56
57 lemma push_inv_seq_sn: ∀f,g,p. p⨮g = ⫯f → ∧∧ 𝟏 = p & g = f.
58 #f #g #p <gr_push_unfold #H destruct /2 width=1 by conj/
59 qed-.
60
61 lemma push_inv_seq_dx: ∀f,g,p. ⫯f = p⨮g → ∧∧ 𝟏 = p & g = f.
62 #f #g #p <gr_push_unfold #H destruct /2 width=1 by conj/
63 qed-.
64
65 lemma next_inv_seq_sn: ∀f,g,p. p⨮g = ↑f → ∃∃q. q⨮g = f & ↑q = p.
66 * #q #f #g #p <gr_next_unfold #H destruct /2 width=3 by ex2_intro/
67 qed-.
68
69 lemma next_inv_seq_dx: ∀f,g,p. ↑f = p⨮g → ∃∃q. q⨮g = f & ↑q = p.
70 * #q #f #g #p <gr_next_unfold #H destruct /2 width=3 by ex2_intro/
71 qed-.
72
73 lemma case_prop (Q:predicate gr_map):
74       (∀f. Q (⫯f)) → (∀f. Q (↑f)) → ∀f. Q f.
75 #Q #H1 #H2 * * //
76 qed-.
77
78 lemma case_type0 (Q:gr_map→Type[0]):
79       (∀f. Q (⫯f)) → (∀f. Q (↑f)) → ∀f. Q f.
80 #Q #H1 #H2 * * //
81 qed-.
82
83 lemma iota_push: ∀Q,a,b,f. a f = case_type0 Q a b (⫯f).
84 // qed.
85
86 lemma iota_next: ∀Q,a,b,f. b f = case_type0 Q a b (↑f).
87 #Q #a #b * //
88 qed.