]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/csx_lift.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / csx_lift.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 "basic_2A/reduction/cnx_lift.ma".
16 include "basic_2A/computation/gcp.ma".
17 include "basic_2A/computation/csx.ma".
18
19 (* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************)
20
21 (* Relocation properties ****************************************************)
22
23 (* Basic_1: was just: sn3_lift *)
24 lemma csx_lift: ∀h,g,G,L2,L1,T1,s,l,m. ⦃G, L1⦄ ⊢ ⬊*[h, g] T1 →
25                 ∀T2. ⬇[s, l, m] L2 ≡ L1 → ⬆[l, m] T1 ≡ T2 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T2.
26 #h #g #G #L2 #L1 #T1 #s #l #m #H elim H -T1 #T1 #_ #IHT1 #T2 #HL21 #HT12
27 @csx_intro #T #HLT2 #HT2
28 elim (cpx_inv_lift1 … HLT2 … HL21 … HT12) -HLT2 #T0 #HT0 #HLT10
29 @(IHT1 … HLT10) // -L1 -L2 #H destruct
30 >(lift_mono … HT0 … HT12) in HT2; -T1 /2 width=1 by/
31 qed.
32
33 (* Basic_1: was just: sn3_gen_lift *)
34 lemma csx_inv_lift: ∀h,g,G,L2,L1,T1,s,l,m. ⦃G, L1⦄ ⊢ ⬊*[h, g] T1 →
35                     ∀T2. ⬇[s, l, m] L1 ≡ L2 → ⬆[l, m] T2 ≡ T1 → ⦃G, L2⦄ ⊢ ⬊*[h, g] T2.
36 #h #g #G #L2 #L1 #T1 #s #l #m #H elim H -T1 #T1 #_ #IHT1 #T2 #HL12 #HT21
37 @csx_intro #T #HLT2 #HT2
38 elim (lift_total T l m) #T0 #HT0
39 lapply (cpx_lift … HLT2 … HL12 … HT21 … HT0) -HLT2 #HLT10
40 @(IHT1 … HLT10) // -L1 -L2 #H destruct
41 >(lift_inj … HT0 … HT21) in HT2; -T1 /2 width=1 by/
42 qed.
43
44 (* Advanced inversion lemmas ************************************************)
45
46 (* Basic_1: was: sn3_gen_def *)
47 lemma csx_inv_lref_bind: ∀h,g,I,G,L,K,V,i. ⬇[i] L ≡ K.ⓑ{I}V →
48                          ⦃G, L⦄ ⊢ ⬊*[h, g] #i → ⦃G, K⦄ ⊢ ⬊*[h, g] V.
49 #h #g #I #G #L #K #V #i #HLK #Hi
50 elim (lift_total V 0 (i+1))
51 /4 width=9 by csx_inv_lift, csx_cpx_trans, cpx_delta, drop_fwd_drop2/
52 qed-.
53
54 (* Advanced properties ******************************************************)
55
56 (* Basic_1: was just: sn3_abbr *)
57 lemma csx_lref_bind: ∀h,g,I,G,L,K,V,i. ⬇[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ ⬊*[h, g] V → ⦃G, L⦄ ⊢ ⬊*[h, g] #i.
58 #h #g #I #G #L #K #V #i #HLK #HV
59 @csx_intro #X #H #Hi
60 elim (cpx_inv_lref1 … H) -H
61 [ #H destruct elim Hi //
62 | -Hi * #I0 #K0 #V0 #V1 #HLK0 #HV01 #HV1
63   lapply (drop_mono … HLK0 … HLK) -HLK #H destruct
64   /3 width=8 by csx_lift, csx_cpx_trans, drop_fwd_drop2/
65 ]
66 qed.
67
68 lemma csx_appl_simple: ∀h,g,G,L,V. ⦃G, L⦄ ⊢ ⬊*[h, g] V → ∀T1.
69                        (∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → (T1 = T2 → ⊥) → ⦃G, L⦄ ⊢ ⬊*[h, g] ⓐV.T2) →
70                        𝐒⦃T1⦄ → ⦃G, L⦄ ⊢ ⬊*[h, g] ⓐV.T1.
71 #h #g #G #L #V #H @(csx_ind … H) -V #V #_ #IHV #T1 #IHT1 #HT1
72 @csx_intro #X #H1 #H2
73 elim (cpx_inv_appl1_simple … H1) // -H1
74 #V0 #T0 #HLV0 #HLT10 #H destruct
75 elim (eq_false_inv_tpair_dx … H2) -H2
76 [ -IHV -HT1 /4 width=3 by csx_cpx_trans, cpx_pair_sn/
77 | -HLT10 * #H #HV0 destruct
78   @IHV /4 width=3 by csx_cpx_trans, cpx_pair_sn/ (**) (* full auto 17s *)
79 ]
80 qed.
81
82 lemma csx_fqu_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
83                     ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 → ⦃G2, L2⦄ ⊢ ⬊*[h, g] T2.
84 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
85 /2 width=8 by csx_inv_lref_bind, csx_inv_lift, csx_fwd_flat_dx, csx_fwd_bind_dx, csx_fwd_pair_sn/
86 qed-.
87
88 lemma csx_fquq_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
89                      ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 → ⦃G2, L2⦄ ⊢ ⬊*[h, g] T2.
90 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H12 #H elim (fquq_inv_gen … H12) -H12
91 [ /2 width=5 by csx_fqu_conf/
92 | * #HG #HL #HT destruct //
93 ]
94 qed-.
95
96 lemma csx_fqup_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
97                      ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 → ⦃G2, L2⦄ ⊢ ⬊*[h, g] T2.
98 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
99 /3 width=5 by csx_fqu_conf/
100 qed-.
101
102 lemma csx_fqus_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
103                      ⦃G1, L1⦄ ⊢ ⬊*[h, g] T1 → ⦃G2, L2⦄ ⊢ ⬊*[h, g] T2.
104 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H12 #H elim (fqus_inv_gen … H12) -H12
105 [ /2 width=5 by csx_fqup_conf/
106 | * #HG #HL #HT destruct //
107 ]
108 qed-.
109
110 (* Main properties **********************************************************)
111
112 theorem csx_gcp: ∀h,g. gcp (cpx h g) (eq …) (csx h g).
113 #h #g @mk_gcp
114 [ normalize /3 width=13 by cnx_lift/
115 | #G #L elim (deg_total h g 0) /3 width=8 by cnx_sort_iter, ex_intro/
116 | /2 width=8 by csx_lift/
117 | /2 width=3 by csx_fwd_flat_dx/
118 ]
119 qed.