]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/lsx_csx.ma
883e32d0bcb80b0c81b1682f5b93e5b5973d50ea
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / lsx_csx.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_2/computation/lpxs_lleq.ma".
16 include "basic_2/computation/csx_alt.ma".
17 include "basic_2/computation/lsx_lpxs.ma".
18
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
20
21 (* Advanced forward lemmas **************************************************)
22
23 include "basic_2/computation/cpxs_lleq.ma".
24
25 (*
26 lemma lsx_cpxs_conf: ∀h,g,G,L1,T1,T2. G ⊢ ⋕⬊*[h, g, T1] L1 →
27                      ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → ⦃G, L1⦄ ⊢ T1 ➡*[h, g] T2 →
28                      G ⊢ ⋕⬊*[h, g, T2] L2.
29 #h #g #G #L1 #T1 #T2 #H @(lsx_ind … H) -L1
30 #L1 #HL1 #IHL1 #L2 #HL12 #HT12 @lsx_intro
31 #L3 #HL23 #HnL23 elim (lleq_dec T2 L1 L2 0) [| -HnL23 ]
32 [ #HT2 @(IHL1 L3) /2 width=3 by lpxs_trans/
33
34  @(lsx_lpxs_trans … HL23) 
35 | #HnT2 @(lsx_lpxs_trans … HL23) @(IHL1 … L2) //
36   #HT1 @HnT2 @(lleq_cpxs_conf_dx … HT12) //
37 ]
38 *)
39
40 lemma lsx_fwd_bind_dx_lpxs: ∀h,g,a,I,G,L1,V1. ⦃G, L1⦄ ⊢ ⬊*[h, g] V1 →
41                             ∀L2,T. G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V1.T] L2 → 
42                             ∀V2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → ⦃G, L2⦄ ⊢ V1 ➡*[h, g] V2 →
43                             G ⊢ ⋕⬊*[h, g, T] L2.ⓑ{I}V2.
44 #h #g #a #I #G #L1 #V1 #H @(csx_ind_alt … H) -V1
45 #V1 #_ #IHV1 #L2 #T #H @(lsx_ind … H) -L2
46 #L2 #HL2 #IHL2 #V2 #HL12 #HV12 @lsx_intro
47 #Y #H #HnT elim (lpxs_inv_pair1 … H) -H
48 #L3 #V3 #HL23 #HV23 #H destruct
49 lapply (lpxs_trans … HL12 … HL23) #HL13
50 elim (eq_term_dec V2 V3)
51 [ (* -HV13 -HL2 -IHV1 -HL12 *) #H destruct
52   @IHL2 -IHL2 // -HL23 -HL13 /3 width=2 by lleq_fwd_bind_O/
53 | -IHL2 -HnT #HnV23 elim (eq_term_dec V1 V2)
54   [ #H -HV12 destruct
55   (*  @(lsx_lpxs_trans … (L2.ⓑ{I}V2)) /2 width=1 by lpxs_pair/ *)
56     @(IHV1 … HnV23) -IHV1 -HnV23 /2 width=3 by lpxs_cpxs_trans/ -HL12 -HL13
57   @(lsx_lpxs_trans … HL23)
58
59
60 lemma lsx_fwd_bind_dx_lpxs: ∀h,g,a,I,G,L1,V. ⦃G, L1⦄ ⊢ ⬊*[h, g] V →
61                             ∀L2,T. G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
62                             G ⊢ ⋕⬊*[h, g, T] L2.ⓑ{I}V.
63 #h #g #a #I #G #L1 #V #H @(csx_ind_alt … H) -V
64 #V1 #_ #IHV1 #L2 #T #H @(lsx_ind … H) -L2
65 #L2 #HL2 #IHL2 #HL12 @lsx_intro
66 #Y #H #HnT elim (lpxs_inv_pair1 … H) -H
67 #L3 #V3 #HL23 #HV13 #H destruct
68 lapply (lpxs_trans … HL12 … HL23) #HL13
69 elim (eq_term_dec V1 V3)
70 [ -HV13 -HL2 -IHV1 -HL12 #H destruct
71   @IHL2 -IHL2 // -HL23 -HL13 /3 width=2 by lleq_fwd_bind_O/
72 | -IHL2 -HnT #HnV13
73   @(IHV1 … HnV13) -IHV1 -HnV13 /2 width=3 by lpxs_cpxs_trans/ -HL12 -HL13
74   @(lsx_lpxs_trans … HL23)
75
76
77 (* Advanced inversion lemmas ************************************************)
78
79
80
81 (* Main properties **********************************************************)
82
83 axiom csx_lsx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → G ⊢ ⋕⬊*[h, g, T] L.
84 (*
85 #h #g #G #L #T @(fqup_wf_ind_eq … G L T) -G -L -T
86 #G1 #L1 #T1 #IH #G2 #L2 * *
87 [ #k #HG #HL #HT destruct //
88 | #i #HG #HL #HT destruct
89   #H
90 | #p #HG #HL #HT destruct //
91 | #a #I #V2 #T2 #HG #HL #HT #H destruct
92   elim (csx_fwd_bind … H) -H
93   #HV2 #HT2
94 | #I #V2 #T2 #HG #HL #HT #H destruct
95   elim (csx_fwd_flat … H) -H /3 width=1 by lsx_flat/
96 *)