]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/relocation/lifts_lifts.ma
update in ground and delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / lifts_lifts.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 "static_2/relocation/lifts.ma".
16
17 (* GENERIC RELOCATION FOR TERMS *********************************************)
18
19 (* Main properties **********************************************************)
20
21 (* Basic_1: includes: lift_gen_lift *)
22 (* Basic_2A1: includes: lift_div_le lift_div_be *)
23 theorem lifts_div4: ∀f2,Tf,T. ⇧*[f2] Tf ≘ T → ∀g2,Tg. ⇧*[g2] Tg ≘ T →
24                     ∀f1,g1. H_pr_pat_div f2 g2 f1 g1 →
25                     ∃∃T0. ⇧*[f1] T0 ≘ Tf & ⇧*[g1] T0 ≘ Tg.
26 #f2 #Tf #T #H elim H -f2 -Tf -T
27 [ #f2 #s #g2 #Tg #H #f1 #g1 #_
28   lapply (lifts_inv_sort2 … H) -H #H destruct
29   /2 width=3 by ex2_intro/
30 | #f2 #jf #j #Hf2 #g2 #Tg #H #f1 #g1 #H0
31   elim (lifts_inv_lref2 … H) -H #jg #Hg2 #H destruct
32   elim (H0 … Hf2 Hg2) -H0 -j /3 width=3 by lifts_lref, ex2_intro/
33 | #f2 #l #g2 #Tg #H #f1 #g1 #_
34   lapply (lifts_inv_gref2 … H) -H #H destruct
35   /2 width=3 by ex2_intro/
36 | #f2 #p #I #Vf #V #Tf #T #_ #_ #IHV #IHT #g2 #X #H #f1 #g1 #H0
37   elim (lifts_inv_bind2 … H) -H #Vg #Tg #HVg #HTg #H destruct
38   elim (IHV … HVg … H0) -IHV -HVg
39   elim (IHT … HTg) -IHT -HTg [ |*: /2 width=8 by pr_pat_div_push_bi/ ]
40   /3 width=5 by lifts_bind, ex2_intro/
41 | #f2 #I #Vf #V #Tf #T #_ #_ #IHV #IHT #g2 #X #H #f1 #g1 #H0
42   elim (lifts_inv_flat2 … H) -H #Vg #Tg #HVg #HTg #H destruct
43   elim (IHV … HVg … H0) -IHV -HVg
44   elim (IHT … HTg … H0) -IHT -HTg -H0
45   /3 width=5 by lifts_flat, ex2_intro/
46 ]
47 qed-.
48
49 lemma lifts_div4_one: ∀f,Tf,T. ⇧*[⫯f] Tf ≘ T →
50                       ∀T1. ⇧[1] T1 ≘ T →
51                       ∃∃T0. ⇧[1] T0 ≘ Tf & ⇧*[f] T0 ≘ T1.
52 /4 width=6 by lifts_div4, pr_pat_div_id_dx, pr_pat_div_push_next/ qed-.
53
54 theorem lifts_div3: ∀f2,T,T2. ⇧*[f2] T2 ≘ T → ∀f,T1. ⇧*[f] T1 ≘ T →
55                     ∀f1. f2 ⊚ f1 ≘ f → ⇧*[f1] T1 ≘ T2.
56 #f2 #T #T2 #H elim H -f2 -T -T2
57 [ #f2 #s #f #T1 #H >(lifts_inv_sort2 … H) -T1 //
58 | #f2 #i2 #i #Hi2 #f #T1 #H #f1 #Ht21 elim (lifts_inv_lref2 … H) -H
59   #i1 #Hi1 #H destruct /3 width=6 by lifts_lref, pr_after_des_pat_dx/
60 | #f2 #l #f #T1 #H >(lifts_inv_gref2 … H) -T1 //
61 | #f2 #p #I #W2 #W #U2 #U #_ #_ #IHW #IHU #f #T1 #H
62   elim (lifts_inv_bind2 … H) -H #W1 #U1 #HW1 #HU1 #H destruct
63   /4 width=3 by lifts_bind, after_O2/
64 | #f2 #I #W2 #W #U2 #U #_ #_ #IHW #IHU #f #T1 #H
65   elim (lifts_inv_flat2 … H) -H #W1 #U1 #HW1 #HU1 #H destruct
66   /3 width=3 by lifts_flat/
67 ]
68 qed-.
69
70 (* Basic_1: was: lift1_lift1 (left to right) *)
71 (* Basic_1: includes: lift_free (left to right) lift_d lift1_xhg (right to left) lift1_free (right to left) *)
72 (* Basic_2A1: includes: lift_trans_be lift_trans_le lift_trans_ge lifts_lift_trans_le lifts_lift_trans *)
73 theorem lifts_trans: ∀f1,T1,T. ⇧*[f1] T1 ≘ T → ∀f2,T2. ⇧*[f2] T ≘ T2 →
74                      ∀f. f2 ⊚ f1 ≘ f → ⇧*[f] T1 ≘ T2.
75 #f1 #T1 #T #H elim H -f1 -T1 -T
76 [ #f1 #s #f2 #T2 #H >(lifts_inv_sort1 … H) -T2 //
77 | #f1 #i1 #i #Hi1 #f2 #T2 #H #f #Ht21 elim (lifts_inv_lref1 … H) -H
78   #i2 #Hi2 #H destruct /3 width=6 by lifts_lref, pr_after_des_pat/
79 | #f1 #l #f2 #T2 #H >(lifts_inv_gref1 … H) -T2 //
80 | #f1 #p #I #W1 #W #U1 #U #_ #_ #IHW #IHU #f2 #T2 #H
81   elim (lifts_inv_bind1 … H) -H #W2 #U2 #HW2 #HU2 #H destruct
82   /4 width=3 by lifts_bind, after_O2/
83 | #f1 #I #W1 #W #U1 #U #_ #_ #IHW #IHU #f2 #T2 #H
84   elim (lifts_inv_flat1 … H) -H #W2 #U2 #HW2 #HU2 #H destruct
85   /3 width=3 by lifts_flat/
86 ]
87 qed-.
88
89 lemma lifts_trans4_one (f) (T1) (T2):
90                        ∀T. ⇧[1]T1 ≘ T → ⇧*[⫯f]T ≘ T2 →
91                        ∃∃T0. ⇧*[f]T1 ≘ T0 & ⇧[1]T0 ≘ T2.
92 /4 width=6 by lifts_trans, lifts_split_trans, pr_after_push_unit/ qed-.
93
94 (* Basic_2A1: includes: lift_conf_O1 lift_conf_be *)
95 theorem lifts_conf: ∀f1,T,T1. ⇧*[f1] T ≘ T1 → ∀f,T2. ⇧*[f] T ≘ T2 →
96                     ∀f2. f2 ⊚ f1 ≘ f → ⇧*[f2] T1 ≘ T2.
97 #f1 #T #T1 #H elim H -f1 -T -T1
98 [ #f1 #s #f #T2 #H >(lifts_inv_sort1 … H) -T2 //
99 | #f1 #i #i1 #Hi1 #f #T2 #H #f2 #Ht21 elim (lifts_inv_lref1 … H) -H
100   #i2 #Hi2 #H destruct /3 width=6 by lifts_lref, pr_after_des_pat_sn/
101 | #f1 #l #f #T2 #H >(lifts_inv_gref1 … H) -T2 //
102 | #f1 #p #I #W #W1 #U #U1 #_ #_ #IHW #IHU #f #T2 #H
103   elim (lifts_inv_bind1 … H) -H #W2 #U2 #HW2 #HU2 #H destruct
104   /4 width=3 by lifts_bind, after_O2/
105 | #f1 #I #W #W1 #U #U1 #_ #_ #IHW #IHU #f #T2 #H
106   elim (lifts_inv_flat1 … H) -H #W2 #U2 #HW2 #HU2 #H destruct
107   /3 width=3 by lifts_flat/
108 ]
109 qed-.
110
111 (* Advanced proprerties *****************************************************)
112
113 (* Basic_2A1: includes: lift_inj *)
114 lemma lifts_inj: ∀f. is_inj2 … (lifts f).
115 #f #T1 #U #H1 #T2 #H2 lapply (pr_after_isi_dx 𝐢  … f)
116 /3 width=6 by lifts_div3, lifts_fwd_isid/
117 qed-.
118
119 (* Basic_2A1: includes: lift_mono *)
120 lemma lifts_mono: ∀f,T. is_mono … (lifts f T).
121 #f #T #U1 #H1 #U2 #H2 lapply (pr_after_isi_sn 𝐢  … f)
122 /3 width=6 by lifts_conf, lifts_fwd_isid/
123 qed-.
124
125 lemma liftable2_sn_bi: ∀R. liftable2_sn R → liftable2_bi R.
126 #R #HR #T1 #T2 #HT12 #f #U1 #HTU1 #U2 #HTU2
127 elim (HR … HT12 … HTU1) -HR -T1 #X #HTX #HUX
128 <(lifts_mono … HTX … HTU2) -T2 -U2 -f //
129 qed-.
130
131 lemma deliftable2_sn_bi: ∀R. deliftable2_sn R → deliftable2_bi R.
132 #R #HR #U1 #U2 #HU12 #f #T1 #HTU1 #T2 #HTU2
133 elim (HR … HU12 … HTU1) -HR -U1 #X #HUX #HTX
134 <(lifts_inj … HUX … HTU2) -U2 -T2 -f //
135 qed-.
136
137 lemma lifts_trans_uni (T):
138       ∀l1,T1. ⇧[l1] T1 ≘ T →
139       ∀l2,T2. ⇧[l2] T ≘ T2 → ⇧[l1+l2] T1 ≘ T2.
140 #T #l1 #T1 #HT1 #l2 #T2 #HT2
141 @(lifts_trans … HT1 … HT2) //
142 qed-.