]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/cpr/tpr_lift.etc
- basic_2: induction for preservation results now uses supclosure
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / cpr / tpr_lift.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 "basic_2/substitution/tps_lift.ma".
16 include "basic_2/reducibility/tpr.ma".
17
18 (* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************)
19
20 (* Relocation properties ****************************************************)
21
22 (* Basic_1: was: pr0_lift *)
23 lemma tpr_lift: t_liftable tpr.
24 #T1 #T2 #H elim H -T1 -T2
25 [ * #i #U1 #d #e #HU1 #U2 #HU2
26   lapply (lift_mono … HU1 … HU2) -HU1 #H destruct
27   [ lapply (lift_inv_sort1 … HU2) -HU2 #H destruct //
28   | lapply (lift_inv_lref1 … HU2) * * #Hid #H destruct //
29   | lapply (lift_inv_gref1 … HU2) -HU2 #H destruct //
30   ]
31 | #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2
32   elim (lift_inv_flat1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct
33   elim (lift_inv_flat1 … HX2) -HX2 #W2 #U2 #HVW2 #HTU2 #HX2 destruct /3 width=4/
34 | #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #X1 #d #e #HX1 #X2 #HX2
35   elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
36   elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
37   elim (lift_inv_bind1 … HX2) -HX2 #V3 #T3 #HV23 #HT23 #HX2 destruct /3 width=4/
38 | #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X1 #d #e #HX1 #X2 #HX2
39   elim (lift_inv_bind1 … HX1) -HX1 #W1 #U1 #HVW1 #HTU1 #HX1 destruct
40   elim (lift_inv_bind1 … HX2) -HX2 #W2 #U0 #HVW2 #HTU0 #HX2 destruct
41   elim (lift_total T (d + 1) e) #U #HTU
42   @tpr_delta
43   [4: @(tps_lift_le … HT2 … HTU HTU0 ?) /2 width=1/ |1: skip |2: /2 width=4/ |3: /2 width=4/ ] (**) (*/3. is too slow *)
44 | #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X1 #d #e #HX1 #X2 #HX2
45   elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
46   elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
47   elim (lift_inv_bind1 … HX2) -HX2 #W3 #X #HW23 #HX #HX2 destruct
48   elim (lift_inv_flat1 … HX) -HX #V3 #T3 #HV3 #HT23 #HX destruct
49   elim (lift_trans_ge … HV2 … HV3 ?) -V // /3 width=4/
50 | #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #H #U2 #HTU2
51   elim (lift_inv_bind1 … H) -H #V3 #T3 #_ #HT13 #H destruct -V
52   elim (lift_conf_O1 … HTU2 … HT2) -T2 /3 width=4/
53 | #V #T1 #T2 #_ #IHT12 #X #d #e #HX #T #HT2
54   elim (lift_inv_flat1 … HX) -HX #V0 #T0 #_ #HT0 #HX destruct /3 width=4/
55 ]
56 qed.
57
58 (* Basic_1: was: pr0_gen_lift *)
59 lemma tpr_inv_lift1: t_deliftable_sn tpr.
60 #T1 #T2 #H elim H -T1 -T2
61 [ * #i #X #d #e #HX
62   [ lapply (lift_inv_sort2 … HX) -HX #H destruct /2 width=3/
63   | lapply (lift_inv_lref2 … HX) -HX * * #Hid #H destruct /3 width=3/
64   | lapply (lift_inv_gref2 … HX) -HX #H destruct /2 width=3/
65   ]
66 | #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX
67   elim (lift_inv_flat2 … HX) -HX #V0 #T0 #HV01 #HT01 #HX destruct
68   elim (IHV12 … HV01) -V1
69   elim (IHT12 … HT01) -T1 /3 width=5/
70 | #a #V1 #V2 #W1 #T1 #T2 #_ #_ #IHV12 #IHT12 #X #d #e #HX
71   elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
72   elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
73   elim (IHV12 … HV01) -V1
74   elim (IHT12 … HT01) -T1 /3 width=5/
75 | #a #I #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV12 #IHT1 #X #d #e #HX
76   elim (lift_inv_bind2 … HX) -HX #W1 #U1 #HWV1 #HUT1 #HX destruct
77   elim (IHV12 … HWV1) -V1 #W2 #HWV2 #HW12
78   elim (IHT1 … HUT1) -T1 #U #HUT #HU1
79   elim (tps_inv_lift1_le … HT2 … HUT ?) -T // [3: /2 width=5/ |2: skip ] #U2 #HU2 #HUT2
80   @ex2_intro  [2: /2 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /3 width=5/ is slow *)
81 | #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #X #d #e #HX
82   elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
83   elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
84   elim (IHV12 … HV01) -V1 #V3 #HV32 #HV03
85   elim (IHW12 … HW01) -W1 #W3 #HW32 #HW03
86   elim (IHT12 … HT01) -T1 #T3 #HT32 #HT03
87   elim (lift_trans_le … HV32 … HV2 ?) -V2 // #V2 #HV32 #HV2
88   @ex2_intro [2: /3 width=2/ |1: skip |3: /2 width=3/ ] (**) (* /4 width=5/ is slow *)
89 | #V #T1 #T #T2 #_ #HT2 #IHT1 #X #d #e #HX
90   elim (lift_inv_bind2 … HX) -HX #V3 #T3 #_ #HT31 #H destruct
91   elim (IHT1 … HT31) -T1 #T1 #HT1 #HT31
92   elim (lift_div_le … HT2 … HT1 ?) -T // /3 width=5/
93 | #V #T1 #T2 #_ #IHT12 #X #d #e #HX
94   elim (lift_inv_flat2 … HX) -HX #V0 #T0 #_ #HT01 #H destruct
95   elim (IHT12 … HT01) -T1 /3 width=3/
96 ]
97 qed-.
98
99 (* Advanced inversion lemmas ************************************************)
100
101 (* Basic_1: was pr0_gen_abst *)
102 lemma tpr_inv_abst1: ∀a,V1,T1,U2. ⓛ{a}V1. T1 ➡ U2 →
103                      ∃∃V2,T2. V1 ➡ V2 & T1 ➡ T2 & U2 = ⓛ{a}V2. T2.
104 #a #V1 #T1 #U2 #H elim (tpr_inv_bind1 … H) -H *
105 [ #V2 #T #T2 #HV12 #HT1 #HT2
106   lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /2 width=5/
107 | #T2 #_ #_ #_ #H destruct
108 ]
109 qed-.
110
111 (* Advanced forward lemmas **************************************************)
112
113 lemma tpr_fwd_abst1: ∀a,V1,T1,U2. ⓛ{a}V1.T1 ➡ U2 → ∀b,I,W.
114                      ∃∃V2,T2. ⓑ{b,I}W.T1 ➡ ⓑ{b,I}W.T2 &
115                               U2 = ⓛ{a}V2.T2.
116 #a #V1 #T1 #U2 #H #b #I #W elim (tpr_inv_bind1 … H) -H *
117 [ #V2 #T #T2 #HV12 #HT1 #HT2
118   lapply (tps_inv_refl_SO2 … HT2 ???) -HT2 // /3 width=4/
119 | #T2 #_ #_ #_ #H destruct
120 ]
121 qed-.