1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/notation/functions/upspoon_1.ma".
16 include "ground/lib/stream.ma".
17 include "ground/arith/pnat.ma".
19 (* RELOCATION P-STREAM ******************************************************)
21 definition gr_push: gr_map → gr_map ≝ λf. 𝟏⨮f.
23 interpretation "push (pstream)" 'UpSpoon f = (gr_push f).
25 definition gr_next: gr_map → gr_map.
29 interpretation "next (pstream)" 'UpArrow f = (gr_next f).
31 (* Basic properties *********************************************************)
33 lemma gr_push_unfold: ∀f. 𝟏⨮f = ⫯f.
36 lemma gr_next_unfold: ∀f,p. (↑p)⨮f = ↑(p⨮f).
39 (* Basic inversion lemmas ***************************************************)
41 lemma eq_inv_gr_push_bi: injective ? ? gr_push.
42 #f1 #f2 <gr_push_unfold <gr_push_unfold #H destruct //
45 lemma eq_inv_gr_push_next: ∀f1,f2. ⫯f1 = ↑f2 → ⊥.
46 #f1 * #p2 #f2 <gr_push_unfold <gr_next_unfold #H destruct
49 lemma eq_inv_gr_next_push: ∀f1,f2. ↑f1 = ⫯f2 → ⊥.
50 * #p1 #f1 #f2 <gr_next_unfold <gr_push_unfold #H destruct
53 lemma eq_inv_gr_next_bi: injective ? ? gr_next.
54 * #p1 #f1 * #p2 #f2 <gr_next_unfold <gr_next_unfold #H destruct //
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/
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/
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/
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/
73 lemma case_prop (Q:predicate gr_map):
74 (∀f. Q (⫯f)) → (∀f. Q (↑f)) → ∀f. Q f.
78 lemma case_type0 (Q:gr_map→Type[0]):
79 (∀f. Q (⫯f)) → (∀f. Q (↑f)) → ∀f. Q f.
83 lemma iota_push: ∀Q,a,b,f. a f = case_type0 Q a b (⫯f).
86 lemma iota_next: ∀Q,a,b,f. b f = case_type0 Q a b (↑f).