]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_csx.ma
milestone in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / csx_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/rt_transition/lpx_rdeq.ma".
16 include "basic_2/rt_computation/csx_drops.ma".
17
18 (* STRONGLY NORMALIZING TERMS FOR UNBOUND PARALLEL RT-TRANSITION ************)
19
20 (* Advanced properties ******************************************************)
21
22 lemma csx_tdeq_trans: ∀h,G,L,T1. ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ →
23                       ∀T2. T1 ≛ T2 → ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄.
24 #h #G #L #T1 #H @(csx_ind … H) -T1 #T #_ #IH #T2 #HT2
25 @csx_intro #T1 #HT21 #HnT21 elim (tdeq_cpx_trans … HT2 … HT21) -HT21
26 /4 width=5 by tdeq_repl/
27 qed-.
28
29 lemma csx_cpx_trans: ∀h,G,L,T1. ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃T1⦄ →
30                      ∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃T2⦄.
31 #h #G #L #T1 #H @(csx_ind … H) -T1 #T1 #HT1 #IHT1 #T2 #HLT12
32 elim (tdeq_dec T1 T2) /3 width=4 by csx_tdeq_trans/
33 qed-.
34
35 (* Basic_1: was just: sn3_cast *)
36 lemma csx_cast: ∀h,G,L,W. ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃W⦄ →
37                 ∀T. ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃ⓝW.T⦄.
38 #h #G #L #W #HW @(csx_ind … HW) -W
39 #W #HW #IHW #T #HT @(csx_ind … HT) -T
40 #T #HT #IHT @csx_intro
41 #X #H1 #H2 elim (cpx_inv_cast1 … H1) -H1
42 [ * #W0 #T0 #HLW0 #HLT0 #H destruct
43   elim (tdneq_inv_pair … H2) -H2
44   [ -W -T #H elim H -H //
45   | -HW -IHT /3 width=3 by csx_cpx_trans/
46   | -HW -HT -IHW /4 width=3 by csx_cpx_trans, cpx_pair_sn/
47   ]
48 |*: /3 width=3 by csx_cpx_trans/
49 ]
50 qed.
51
52 (* Basic_1: was just: sn3_abbr *)
53 (* Basic_2A1: was: csx_lref_bind *)
54 lemma csx_lref_pair: ∀h,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V →
55                      ⦃G, K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄ → ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄.
56 #h #I #G #L #K #V #i #HLK #HV
57 @csx_intro #X #H #Hi elim (cpx_inv_lref1_drops … H) -H
58 [ #H destruct elim Hi //
59 | -Hi * #I0 #K0 #V0 #V1 #HLK0 #HV01 #HV1
60   lapply (drops_mono … HLK0 … HLK) -HLK #H destruct
61   /3 width=8 by csx_lifts, csx_cpx_trans, drops_isuni_fwd_drop2/
62 ]
63 qed.
64
65 (* Advanced inversion lemmas ************************************************)
66
67 (* Basic_1: was: sn3_gen_def *)
68 (* Basic_2A1: was: csx_inv_lref_bind *)
69 lemma csx_inv_lref_pair: ∀h,I,G,L,K,V,i. ⬇*[i] L ≘ K.ⓑ{I}V →
70                          ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄ → ⦃G, K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄.
71 #h #I #G #L #K #V #i #HLK #Hi
72 elim (lifts_total V (𝐔❴↑i❵))
73 /4 width=9 by csx_inv_lifts, csx_cpx_trans, cpx_delta_drops, drops_isuni_fwd_drop2/
74 qed-.
75
76 lemma csx_inv_lref: ∀h,G,L,i. ⦃G, L⦄ ⊢ ⬈*[h] 𝐒⦃#i⦄ →
77                     ∨∨ ⬇*[Ⓕ, 𝐔❴i❵] L ≘ ⋆
78                      | ∃∃I,K. ⬇*[i] L ≘ K.ⓤ{I}
79                      | ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ ⬈*[h] 𝐒⦃V⦄.
80 #h #G #L #i #H elim (drops_F_uni L i) /2 width=1 by or3_intro0/
81 * * /4 width=9 by csx_inv_lref_pair, ex2_3_intro, ex1_2_intro, or3_intro2, or3_intro1/
82 qed-.