]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/rt_computation/gcp_cr.ma
support for generic reducibility ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / gcp_cr.ma
index 3d11439002f366df33b36239ea3772968cecb39a..6b5dfef444291d3a02e502e66ed9269c6e841dc9 100644 (file)
 
 include "basic_2/notation/relations/ineint_5.ma".
 include "basic_2/syntax/aarity.ma".
-include "basic_2/multiple/mr2_mr2.ma".
-include "basic_2/multiple/lifts_lift_vector.ma".
-include "basic_2/multiple/drops_drop.ma".
-include "basic_2/computation/gcp.ma".
+include "basic_2/relocation/lifts_simple.ma".
+include "basic_2/relocation/lifts_lifts_vector.ma".
+include "basic_2/relocation/drops_drops.ma".
+include "basic_2/rt_computation/gcp.ma".
 
 (* GENERIC COMPUTATION PROPERTIES *******************************************)
 
@@ -39,11 +39,11 @@ definition S4 ≝ λRP,C:candidate.
                 ∀G,L,Vs. all … (RP G L) Vs → ∀s. C G L (ⒶVs.⋆s).
 
 definition S5 ≝ λC:candidate. ∀I,G,L,K,Vs,V1,V2,i.
-                C G L (ⒶVs.V2) → ⬆[0, i+1] V1 ≡ V2 →
-                ⬇[i] L ≡ K.ⓑ{I}V1 → C G L (ⒶVs.#i).
+                C G L (ⒶVs.V2) → ⬆*[⫯i] V1 ≡ V2 →
+                ⬇*[i] L ≡ K.ⓑ{I}V1 → C G L (ⒶVs.#i).
 
 definition S6 ≝ λRP,C:candidate.
-                ∀G,L,V1b,V2b. ⬆[0, 1] V1b ≡ V2b →
+                ∀G,L,V1b,V2b. ⬆*[1] V1b ≡ V2b →
                 ∀a,V,T. C G (L.ⓓV) (ⒶV2b.T) → RP G L V → C G L (ⒶV1b.ⓓ{a}V.T).
 
 definition S7 ≝ λC:candidate.
@@ -51,19 +51,19 @@ definition S7 ≝ λC:candidate.
 
 (* requirements for the generic reducibility candidate *)
 record gcr (RR:relation4 genv lenv term term) (RS:relation term) (RP,C:candidate) : Prop ≝
-{ b1: S1 RP C;
-  b2: S2 RR RS RP C;
-  b3: S3 C;
-  b4: S4 RP C;
-  b5: S5 C;
-  b6: S6 RP C;
-  b7: S7 C
+{ s1: S1 RP C;
+  s2: S2 RR RS RP C;
+  s3: S3 C;
+  s4: S4 RP C;
+  s5: S5 C;
+  s6: S6 RP C;
+  s7: S7 C
 }.
 
 (* the functional construction for candidates *)
 definition cfun: candidate → candidate → candidate ≝
-                 λC1,C2,G,K,T. ∀L,W,U,cs.
-                 ⬇*[Ⓕ, cs] L ≡ K → ⬆*[cs] T ≡ U → C1 G L W → C2 G L (ⓐW.U).
+                 λC1,C2,G,K,T. ∀f,L,W,U.
+                 ⬇*[Ⓕ, f] L ≡ K → ⬆*[f] T ≡ U → C1 G L W → C2 G L (ⓐW.U).
 
 (* the reducibility candidate associated to an atomic arity *)
 rec definition acr (RP:candidate) (A:aarity) on A: candidate ≝
@@ -73,21 +73,27 @@ match A with
 ].
 
 interpretation
-   "candidate of reducibility of an atomic arity (abstract)"
+   "reducibility candidate of an atomic arity (abstract)"
    'InEInt RP G L T A = (acr RP A G L T).
 
 (* Basic properties *********************************************************)
 
-(* Basic 1: was: sc3_lift *)
-lemma gcr_lift: ∀RR,RS,RP. gcp RR RS RP → ∀A,G. d_liftable1 (acr RP A G) (Ⓕ).
-#RR #RS #RP #H #A elim A -A
-/3 width=8 by cp2, drops_cons, lifts_cons/
-qed.
-
+(* Note: this requires multiple relocation *)
+(* Basic 1: includes: sc3_lift *)
+(* Basic 2A1: includes: gcr_lift *)
+(* Basic 2A1: note: gcr_lift should be acr_lift *)
 (* Basic_1: was: sc3_lift1 *)
-lemma gcr_lifts: ∀RR,RS,RP. gcp RR RS RP → ∀A,G. d_liftables1 (acr RP A G) (Ⓕ).
-#RR #RS #RP #H #A #G @d1_liftable_liftables /2 width=7 by gcr_lift/
-qed.
+(* Basic 2A1: was: gcr_lifts *)
+(* Basic 2A1: note: gcr_lifts should be acr_lifts *)
+lemma acr_lifts: ∀RR,RS,RP. gcp RR RS RP → ∀A,G. d_liftable1 (acr RP A G).
+#RR #RS #RP #H #A #G elim A -A
+[ /2 width=7 by cp2/
+| #B #A #HB #HA #K #T #HKT #b #f #L #HLK #U #HTU #f0 #L0 #W #U0 #HL0 #HU0 #HW
+  lapply (drops_trans … HL0 … HLK ??) [3:|*: // ] -L #HL0K
+  lapply (lifts_trans … HTU … HU0 ??) [3:|*: // ] -U #HTU0
+  /2 width=3 by/ (**) (* full auto fails *)
+]
+qed-.
 
 (* Basic_1: was:
    sc3_sn3 sc3_abst sc3_appl sc3_abbr sc3_bind sc3_cast
@@ -98,70 +104,70 @@ lemma acr_gcr: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP →
 #B #A #IHB #IHA @mk_gcr
 [ #G #L #T #H
   elim (cp1 … H1RP G L) #s #HK
-  lapply (H L (⋆s) T (◊) ? ? ?) -H //
-  [ lapply (b2 … IHB G L (◊) … HK) //
-  | /3 width=6 by b1, cp3/
-  ]
-| #G #L #Vs #HVs #T #H1T #H2T #L0 #V0 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V0b #T0 #HV0b #HT0 #H destruct
-  lapply (b1 … IHB … HB) #HV0
-  @(b2 … IHA … (V0 @ V0b))
-  /3 width=14 by gcp2_lifts_all, gcp2_lifts, gcp0_lifts, lifts_simple_dx, conj/
-| #a #G #L #Vs #U #T #W #HA #L0 #V0 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V0b #Y #HV0b #HY #H destruct
+  lapply (s2 … IHB G L (◊) … HK) // #HB
+  lapply (H (𝐈𝐝) L (⋆s) T ? ? ?) -H
+  /3 width=6 by s1, cp3, drops_refl, lifts_refl/
+| #G #L #Vs #HVs #T #H1T #H2T #f #L0 #V0 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V0s #T0 #HV0s #HT0 #H destruct
+  lapply (s1 … IHB … HB) #HV0
+  @(s2 … IHA  … (V0@V0s)) /3 width=13 by cp0, gcp2_all, lifts_simple_dx, conj/
+| #p #G #L #Vs #U #T #W #HA #f #L0 #V0 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct
   elim (lifts_inv_flat1 … HY) -HY #U0 #X #HU0 #HX #H destruct
   elim (lifts_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT0 #H destruct
-  @(b3 … IHA … (V0 @ V0b)) /5 width=6 by lifts_applv, lifts_flat, lifts_bind/
-| #G #L #Vs #HVs #s #L0 #V0 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V0b #Y #HV0b #HY #H destruct
+  @(s3 … IHA … (V0@V0s)) /5 width=6 by lifts_applv, lifts_flat, lifts_bind/
+| #G #L #Vs #HVs #s #f #L0 #V0 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct
   >(lifts_inv_sort1 … HY) -Y
-  lapply (b1 … IHB … HB) #HV0
-  @(b4 … IHA … (V0 @ V0b)) /3 width=7 by gcp2_lifts_all, conj/
-| #I #G #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #L0 #V0 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V0b #Y #HV0b #HY #H destruct
-  elim (lifts_inv_lref1 … HY) -HY #i0 #Hi0 #H destruct
-  elim (drops_drop_trans … HL0 … HLK) #X #cs0 #i1 #HL02 #H #Hi1 #Hcs0
-  >(at_mono … Hi1 … Hi0) in HL02; -i1 #HL02
-  elim (drops_inv_skip2 … Hcs0 … H) -H -cs0 #L2 #W1 #cs0 #Hcs0 #HLK #HVW1 #H destruct
-  elim (lift_total W1 0 (i0 + 1)) #W2 #HW12
-  elim (lifts_lift_trans  … Hcs0 … HVW1 … HW12) // -Hcs0 -Hi0 #V3 #HV13 #HVW2
-  >(lift_mono … HV13 … HV12) in HVW2; -V3 #HVW2
-  @(b5 … IHA … (V0 @ V0b) … HW12 HL02) /3 width=5 by lifts_applv/
-| #G #L #V1b #V2b #HV12b #a #V #T #HA #HV #L0 #V10 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V10b #Y #HV10b #HY #H destruct
+  lapply (s1 … IHB … HB) #HV0
+  @(s4 … IHA … (V0@V0s)) /3 width=7 by gcp2_all, conj/
+| #I #G #L #K #Vs #V1 #V2 #i #HA #HV12 #HLK #f #L0 #V0 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct
+  elim (lifts_inv_lref1 … HY) -HY #j #Hf #H destruct
+  lapply (drops_trans … HL0 … HLK ??) [3: |*: // ] -HLK #H
+  elim (drops_split_trans … H) -H [ |*: /2 width=6 by after_uni_dx/ ] #Y #HLK0 #HY
+  lapply (drops_tls_at … Hf … HY) -HY #HY
+  elim (drops_inv_skip2 … HY) -HY #K0 #W1 #_ #HVW1 #H destruct
+  elim (lifts_total W1 (𝐔❴⫯j❵)) #W2 #HW12
+  lapply (lifts_trans … HVW1 … HW12 ??) -HVW1 [3: |*: // ] #H
+  lapply (lifts_conf … HV12 … H f ?) -V1 [ /2 width=3 by after_uni_succ_sn/ ] #HVW2
+  @(s5 … IHA … (V0@V0s) … HW12) /3 width=4 by drops_inv_gen, lifts_applv/
+| #G #L #V1s #V2s #HV12s #p #V #T #HA #HV #f #L0 #V10 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V10s #Y #HV10s #HY #H destruct
   elim (lifts_inv_bind1 … HY) -HY #V0 #T0 #HV0 #HT0 #H destruct
-  elim (lift_total V10 0 1) #V20 #HV120
-  elim (liftv_total 0 1 V10b) #V20b #HV120b
-  @(b6 … IHA … (V10 @ V10b) (V20 @ V20b)) /3 width=7 by gcp2_lifts, liftv_cons/
-  @(HA … (cs + 1)) /2 width=2 by drops_skip/
+  elim (lifts_total V10 (𝐔❴1❵)) #V20 #HV120
+  elim (liftsv_total (𝐔❴1❵) V10s) #V20s #HV120s
+  @(s6 … IHA … (V10@V10s) (V20@V20s)) /3 width=7 by cp2, liftsv_cons/
+  @(HA … (↑f)) /2 width=2 by drops_skip/
   [ @lifts_applv //
-    elim (liftsv_liftv_trans_le … HV10b … HV120b) -V10b #V10b #HV10b #HV120b
-    >(liftv_mono … HV12b … HV10b) -V1b //
-  | @(gcr_lift … H1RP … HB … HV120) /2 width=2 by drop_drop/
+    lapply (liftsv_trans … HV10s … HV120s ??) -V10s [3: |*: // ] #H
+    elim (liftsv_split_trans … H (𝐔❴1❵) (↑f)) /2 width=1 by after_uni_one_sn/ #V10s #HV10s #HV120s
+    >(liftsv_mono … HV12s … HV10s) -V1s //
+  | @(acr_lifts … H1RP … HB … HV120) /3 width=2 by drops_refl, drops_drop/
   ]
-| #G #L #Vs #T #W #HA #HW #L0 #V0 #X #cs #HL0 #H #HB
-  elim (lifts_inv_applv1 … H) -H #V0b #Y #HV0b #HY #H destruct
+| #G #L #Vs #T #W #HA #HW #f #L0 #V0 #X #HL0 #H #HB
+  elim (lifts_inv_applv1 … H) -H #V0s #Y #HV0s #HY #H destruct
   elim (lifts_inv_flat1 … HY) -HY #W0 #T0 #HW0 #HT0 #H destruct
-  @(b7 … IHA … (V0 @ V0b)) /3 width=5 by lifts_applv/
+  @(s7 … IHA … (V0@V0s)) /3 width=5 by lifts_applv/
 ]
 qed.
 
 lemma acr_abst: ∀RR,RS,RP. gcp RR RS RP → gcr RR RS RP RP →
-                ∀a,G,L,W,T,A,B. ⦃G, L, W⦄ ϵ[RP] 〚B〛 → (
-                   ∀L0,V0,W0,T0,cs. ⬇*[Ⓕ, cs] L0 ≡ L → ⬆*[cs] W ≡ W0 → ⬆*[cs + 1] T ≡ T0 →
+                ∀p,G,L,W,T,A,B. ⦃G, L, W⦄ ϵ[RP] 〚B〛 → (
+                   ∀b,f,L0,V0,W0,T0. ⬇*[b, f] L0 ≡ L → ⬆*[f] W ≡ W0 → ⬆*[↑f] T ≡ T0 →
                                    ⦃G, L0, V0⦄ ϵ[RP] 〚B〛 → ⦃G, L0, W0⦄ ϵ[RP] 〚B〛 → ⦃G, L0.ⓓⓝW0.V0, T0⦄ ϵ[RP] 〚A〛
                 ) →
-                ⦃G, L, ⓛ{a}W.T⦄ ϵ[RP] 〚②B.A〛.
-#RR #RS #RP #H1RP #H2RP #a #G #L #W #T #A #B #HW #HA #L0 #V0 #X #cs #HL0 #H #HB
+                ⦃G, L, ⓛ{p}W.T⦄ ϵ[RP] 〚②B.A〛.
+#RR #RS #RP #H1RP #H2RP #p #G #L #W #T #A #B #HW #HA #f #L0 #V0 #X #HL0 #H #HB
 lapply (acr_gcr … H1RP H2RP A) #HCA
 lapply (acr_gcr … H1RP H2RP B) #HCB
 elim (lifts_inv_bind1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
-lapply (gcr_lifts … H1RP … HL0 … HW0 HW) -HW #HW0
-lapply (b3 … HCA … a G L0 (◊)) #H @H -H
-lapply (b6 … HCA G L0 (◊) (◊) ?) // #H @H -H
+lapply (acr_lifts … H1RP … HW … HL0 … HW0) -HW #HW0
+lapply (s3 … HCA … p G L0 (◊)) #H @H -H
+lapply (s6 … HCA G L0 (◊) (◊) ?) // #H @H -H
 [ @(HA … HL0) //
-| lapply (b1 … HCB) -HCB #HCB
-  lapply (b7 … H2RP G L0 (◊)) /3 width=1 by/
+| lapply (s1 … HCB) -HCB #HCB
+  lapply (s7 … H2RP G L0 (◊)) /3 width=1 by/
 ]
 qed.