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 "delayed_updating/substitution/lift.ma".
16 include "ground/relocation/tr_uni_compose.ma".
17 include "ground/relocation/tr_compose_compose.ma".
18 include "ground/relocation/tr_compose_eq.ma".
19 include "ground/relocation/tr_pn_eq.ma".
21 (* LIFT FOR PATH ***********************************************************)
23 definition lift_exteq (A): relation2 (lift_continuation A) (lift_continuation A) ≝
24 λk1,k2. ∀f1,f2,p. f1 ≗ f2 → k1 f1 p = k2 f2 p.
27 "extensional equivalence (lift continuation)"
28 'RingEq A k1 k2 = (lift_exteq A k1 k2).
30 (* Constructions with lift_exteq ********************************************)
32 lemma lift_eq_repl (A) (p) (k1) (k2):
33 k1 ≗{A} k2 → stream_eq_repl … (λf1,f2. ↑❨k1, f1, p❩ = ↑❨k2, f2, p❩).
34 #A #p @(path_ind_lift … p) -p [| #n #IH | #n #l0 #q #IH |*: #q #IH ]
35 #k1 #k2 #f1 #f2 #Hk #Hf
36 [ <lift_empty <lift_empty /2 width=1 by/
37 | <lift_d_empty_sn <lift_d_empty_sn <(tr_pap_eq_repl … Hf)
38 /3 width=1 by tr_compose_eq_repl, stream_eq_refl/
39 | <lift_d_lcons_sn <lift_d_lcons_sn
40 /3 width=1 by tr_compose_eq_repl, stream_eq_refl/
42 | /3 width=1 by tr_push_eq_repl/
48 (* Advanced constructions ***************************************************)
50 lemma lift_lcons_alt (A) (k) (f) (p) (l): k ≗ k →
51 ↑❨λg,p2. k g (l◗p2), f, p❩ = ↑{A}❨λg,p2. k g ((l◗𝐞)●p2), f, p❩.
53 @lift_eq_repl // #g1 #g2 #p2 #Hg @Hk -Hk // (**) (* auto fail *)
56 lemma lift_append_rcons_sn (A) (k) (f) (p1) (p) (l): k ≗ k →
57 ↑❨λg,p2. k g (p1●l◗p2), f, p❩ = ↑{A}❨λg,p2. k g (p1◖l●p2), f, p❩.
58 #A #k #f #p1 #p #l #Hk
59 @lift_eq_repl // #g1 #g2 #p2 #Hg
60 <list_append_rcons_sn @Hk -Hk // (**) (* auto fail *)
63 (* Advanced constructions with proj_path ************************************)
65 lemma proj_path_proper:
66 proj_path ≗ proj_path.
69 lemma lift_path_eq_repl (p):
70 stream_eq_repl … (λf1,f2. ↑[f1]p = ↑[f2]p).
71 /2 width=1 by lift_eq_repl/ qed.
73 lemma lift_path_append_sn (p) (f) (q):
74 q●↑[f]p = ↑❨(λg,p. proj_path g (q●p)), f, p❩.
75 #p @(path_ind_lift … p) -p // [ #n #l #p |*: #p ] #IH #f #q
76 [ <lift_d_lcons_sn <lift_d_lcons_sn <IH -IH //
77 | <lift_m_sn <lift_m_sn //
78 | <lift_L_sn <lift_L_sn >lift_lcons_alt // >lift_append_rcons_sn //
79 <IH <IH -IH <list_append_rcons_sn //
80 | <lift_A_sn <lift_A_sn >lift_lcons_alt >lift_append_rcons_sn //
81 <IH <IH -IH <list_append_rcons_sn //
82 | <lift_S_sn <lift_S_sn >lift_lcons_alt >lift_append_rcons_sn //
83 <IH <IH -IH <list_append_rcons_sn //
87 lemma lift_path_lcons (f) (p) (l):
88 l◗↑[f]p = ↑❨(λg,p. proj_path g (l◗p)), f, p❩.
90 >lift_lcons_alt <lift_path_append_sn //
93 lemma lift_path_L_sn (f) (p):
94 (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
97 lemma lift_path_A_sn (f) (p):
98 (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
101 lemma lift_path_S_sn (f) (p):
102 (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
105 lemma lift_path_after (p) (f1) (f2):
106 ↑[f2]↑[f1]p = ↑[f2∘f1]p.
107 #p @(path_ind_lift … p) -p // [ #n #l #p | #p ] #IH #f1 #f2
108 [ <lift_path_d_lcons_sn <lift_path_d_lcons_sn
109 >(lift_path_eq_repl … (tr_compose_assoc …)) //
110 | <lift_path_L_sn <lift_path_L_sn <lift_path_L_sn
111 >tr_compose_push_bi //
115 (* Advanced constructions with proj_rmap and stream_tls *********************)
117 lemma lift_rmap_tls_d_dx (f) (p) (m) (n):
118 ⇂*[m+n]↑[p]f ≗ ⇂*[m]↑[p◖𝗱n]f.
120 <lift_rmap_d_dx >nrplus_inj_dx
121 /2 width=1 by tr_tls_compose_uni_dx/