]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_eq.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / lift_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 "delayed_updating/substitution/lift.ma".
16 include "ground/relocation/tr_compose_eq.ma".
17 include "ground/relocation/tr_pn_eq.ma".
18
19 (* LIFT FOR PATH ***********************************************************)
20
21 definition lift_exteq (A): relation2 (lift_continuation A) (lift_continuation A) ≝
22            λk1,k2. ∀f1,f2,p. f1 ≗ f2 → k1 f1 p = k2 f2 p.
23
24 interpretation
25   "extensional equivalence (lift continuation)"
26   'RingEq A k1 k2 = (lift_exteq A k1 k2).
27
28 (* Constructions with lift_exteq ********************************************)
29
30 lemma lift_eq_repl (A) (p) (k1) (k2):
31       k1 ≗{A} k2 → stream_eq_repl … (λf1,f2. ↑❨k1, f1, p❩ = ↑❨k2, f2, p❩).
32 #A #p @(path_ind_lift … p) -p [| #n #IH | #n #l0 #q #IH |*: #q #IH ]
33 #k1 #k2 #f1 #f2 #Hk #Hf
34 [ <lift_empty <lift_empty /2 width=1 by/
35 | <lift_d_empty_sn <lift_d_empty_sn <(tr_pap_eq_repl … Hf)
36   /3 width=1 by tr_compose_eq_repl, stream_eq_refl/
37 | <lift_d_lcons_sn <lift_d_lcons_sn
38   /3 width=1 by tr_compose_eq_repl, stream_eq_refl/
39 | /2 width=1 by/
40 | /3 width=1 by tr_push_eq_repl/
41 | /3 width=1 by/
42 | /3 width=1 by/
43 ]
44 qed-.
45
46 (* Advanced constructions ***************************************************)
47
48 lemma lift_lcons_alt (A) (k) (f) (p) (l): k ≗ k →
49       ↑❨λg,p2. k g (l◗p2), f, p❩ = ↑{A}❨λg,p2. k g ((l◗𝐞)●p2), f, p❩.
50 #A #k #f #p #l #Hk
51 @lift_eq_repl // #g1 #g2 #p2 #Hg @Hk -Hk // (**) (* auto fail *)
52 qed.
53
54 lemma lift_append_rcons_sn (A) (k) (f) (p1) (p) (l): k ≗ k →
55       ↑❨λg,p2. k g (p1●l◗p2), f, p❩ = ↑{A}❨λg,p2. k g (p1◖l●p2), f, p❩.
56 #A #k #f #p1 #p #l #Hk
57 @lift_eq_repl // #g1 #g2 #p2 #Hg
58 <list_append_rcons_sn @Hk -Hk // (**) (* auto fail *)
59 qed.
60
61 (* Advanced constructions with proj_path ************************************)
62
63 lemma proj_path_proper:
64       proj_path ≗ proj_path.
65 // qed.
66
67 lemma lift_path_eq_repl (p):
68       stream_eq_repl … (λf1,f2. ↑[f1]p = ↑[f2]p).
69 /2 width=1 by lift_eq_repl/ qed.
70
71 lemma lift_path_append_sn (p) (f) (q):
72       q●↑[f]p = ↑❨(λg,p. proj_path g (q●p)), f, p❩.
73 #p @(path_ind_lift … p) -p // [ #n #l #p |*: #p ] #IH #f #q
74 [ <lift_d_lcons_sn <lift_d_lcons_sn <IH -IH //
75 | <lift_m_sn <lift_m_sn //
76 | <lift_L_sn <lift_L_sn >lift_lcons_alt // >lift_append_rcons_sn //
77   <IH <IH -IH <list_append_rcons_sn //
78 | <lift_A_sn <lift_A_sn >lift_lcons_alt >lift_append_rcons_sn //
79   <IH <IH -IH <list_append_rcons_sn //
80 | <lift_S_sn <lift_S_sn >lift_lcons_alt >lift_append_rcons_sn //
81   <IH <IH -IH <list_append_rcons_sn //
82 ]
83 qed.
84
85 lemma lift_path_lcons (f) (p) (l):
86       l◗↑[f]p = ↑❨(λg,p. proj_path g (l◗p)), f, p❩.
87 #f #p #l
88 >lift_lcons_alt <lift_path_append_sn //
89 qed.
90
91 lemma lift_path_L_sn (f) (p):
92       (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
93 // qed.
94
95 lemma lift_path_A_sn (f) (p):
96       (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
97 // qed.
98
99 lemma lift_path_S_sn (f) (p):
100       (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
101 // qed.