]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_fqus.ma
milestone in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cpxs_fqus.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 (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************)
16
17 include "basic_2/rt_transition/cpx_fqus.ma".
18 include "basic_2/rt_computation/cpxs_drops.ma".
19 include "basic_2/rt_computation/cpxs_lsubr.ma".
20 include "basic_2/rt_computation/cpxs_cpxs.ma".
21
22 (* Properties on supclosure *************************************************)
23
24 lemma fqu_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 →
25                       ∀T1. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
26                       ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, U2⦄.
27 #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
28 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqu_cpx_trans … HT1 … HT2) -T
29 #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
30 qed-.
31
32 lemma fquq_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 →
33                        ∀T1. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
34                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄.
35 #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
36 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fquq_cpx_trans … HT1 … HT2) -T
37 #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
38 qed-.
39
40 lemma fqup_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 →
41                        ∀T1. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ →
42                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, U2⦄.
43 #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
44 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqup_cpx_trans … HT1 … HT2) -T
45 #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
46 qed-.
47
48 lemma fqus_cpxs_trans: ∀h,b,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 →
49                        ∀T1. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ →
50                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, U2⦄.
51 #h #b #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
52 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqus_cpx_trans … HT1 … HT2) -T
53 #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
54 qed-.
55
56 (* Note: a proof based on fqu_cpx_trans_tdneq might exist *)
57 (* Basic_2A1: uses: fqu_cpxs_trans_neq *)
58 lemma fqu_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐[b] ⦃G2, L2, T2⦄ →
59                             ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) →
60                             ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐[b] ⦃G2, L2, U2⦄.
61 #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
62 [ #I #G #L #V1 #V2 #HV12 #_ elim (lifts_total V2 𝐔❴1❵)
63   #U2 #HVU2 @(ex3_intro … U2)
64   [1,3: /3 width=7 by cpxs_delta, fqu_drop/
65   | #H lapply (tdeq_inv_lref1 … H) -H
66     #H destruct /2 width=5 by lifts_inv_lref2_uni_lt/
67   ]
68 | #I #G #L #V1 #T #V2 #HV12 #H0 @(ex3_intro … (②{I}V2.T))
69   [1,3: /2 width=4 by fqu_pair_sn, cpxs_pair_sn/
70   | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
71   ]
72 | #p #I #G #L #V #T1 #T2 #HT12 #H0 @(ex3_intro … (ⓑ{p,I}V.T2))
73   [1,3: /2 width=4 by fqu_bind_dx, cpxs_bind/
74   | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
75   ]
76 | #p #I #G #L #V #T1 #Hb #T2 #HT12 #H0 @(ex3_intro … (ⓑ{p,I}V.T2))
77   [1,3: /4 width=4 by lsubr_cpxs_trans, cpxs_bind, lsubr_unit, fqu_clear/
78   | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
79   ]
80 | #I #G #L #V #T1 #T2 #HT12 #H0 @(ex3_intro … (ⓕ{I}V.T2))
81   [1,3: /2 width=4 by fqu_flat_dx, cpxs_flat/
82   | #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
83   ]
84 | #I #G #L #T1 #U1 #HTU1 #T2 #HT12 #H0
85   elim (cpxs_lifts_sn … HT12 (Ⓣ) … (L.ⓘ{I}) … HTU1) -HT12
86   /4 width=6 by fqu_drop, drops_refl, drops_drop, tdeq_inv_lifts_bi, ex3_intro/
87 ]
88 qed-.
89
90 (* Basic_2A1: uses: fquq_cpxs_trans_neq *)
91 lemma fquq_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮[b] ⦃G2, L2, T2⦄ →
92                              ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) →
93                              ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐⸮[b] ⦃G2, L2, U2⦄.
94 #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 elim H12 -H12
95 [ #H12 #U2 #HTU2 #H elim (fqu_cpxs_trans_tdneq … H12 … HTU2 H) -T2
96   /3 width=4 by fqu_fquq, ex3_intro/
97 | * #HG #HL #HT destruct /3 width=4 by ex3_intro/
98 ]
99 qed-.
100
101 (* Basic_2A1: uses: fqup_cpxs_trans_neq *)
102 lemma fqup_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+[b] ⦃G2, L2, T2⦄ →
103                              ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) →
104                              ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐+[b] ⦃G2, L2, U2⦄.
105 #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind_dx … H) -G1 -L1 -T1
106 [ #G1 #L1 #T1 #H12 #U2 #HTU2 #H elim (fqu_cpxs_trans_tdneq … H12 … HTU2 H) -T2
107   /3 width=4 by fqu_fqup, ex3_intro/
108 | #G #G1 #L #L1 #T #T1 #H1 #_ #IH12 #U2 #HTU2 #H elim (IH12 … HTU2 H) -T2
109   #U1 #HTU1 #H #H12 elim (fqu_cpxs_trans_tdneq … H1 … HTU1 H) -T1
110   /3 width=8 by fqup_strap2, ex3_intro/
111 ]
112 qed-.
113
114 (* Basic_2A1: uses: fqus_cpxs_trans_neq *)
115 lemma fqus_cpxs_trans_tdneq: ∀h,b,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐*[b] ⦃G2, L2, T2⦄ →
116                              ∀U2. ⦃G2, L2⦄ ⊢ T2 ⬈*[h] U2 → (T2 ≛ U2 → ⊥) →
117                              ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ⬈*[h] U1 & T1 ≛ U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐*[b] ⦃G2, L2, U2⦄.
118 #h #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 #U2 #HTU2 #H elim (fqus_inv_fqup … H12) -H12
119 [ #H12 elim (fqup_cpxs_trans_tdneq … H12 … HTU2 H) -T2
120   /3 width=4 by fqup_fqus, ex3_intro/
121 | * #HG #HL #HT destruct /3 width=4 by ex3_intro/
122 ]
123 qed-.