]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambda_delta/basic_2/computation/csn_lcpr.ma
- we polarized binders to control zeta reduction
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / computation / csn_lcpr.ma
index c6024fce8d26579227d6b7484aa149b000d9c2b2..58807c52429484d94332c768b48438d0dad1af90 100644 (file)
@@ -16,20 +16,20 @@ include "basic_2/grammar/tstc_tstc.ma".
 include "basic_2/computation/cprs_cprs.ma".
 include "basic_2/computation/csn_lift.ma".
 include "basic_2/computation/csn_cpr.ma".
-include "basic_2/computation/csn_cprs.ma".
+include "basic_2/computation/csn_alt.ma".
 
 (* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************)
 
 (* Advanced properties ******************************************************)
 
-lemma csn_lcpr_conf: â\88\80L1,L2. L1 â\8a¢ â\9e¡ L2 â\86\92 â\88\80T. L1 â\8a¢ â¬\87* T â\86\92 L2 â\8a¢ â¬\87* T.
-#L1 #L2 #HL12 #T #H @(csn_ind_cprs … H) -T #T #_ #IHT
+lemma csn_lcpr_conf: â\88\80L1,L2. L1 â\8a¢ â\9e¡ L2 â\86\92 â\88\80T. L1 â\8a¢ â¬\8a* T â\86\92 L2 â\8a¢ â¬\8a* T.
+#L1 #L2 #HL12 #T #H @(csn_ind_alt … H) -T #T #_ #IHT
 @csn_intro #T0 #HLT0 #HT0
 @IHT /2 width=2/ -IHT -HT0 /2 width=3/
 qed.
 
-lemma csn_abbr: ∀L,V. L ⊢ ⬇* V → ∀T. L. ⓓV ⊢ ⬇* T → L ⊢ ⬇* ⓓV. T.
-#L #V #HV elim HV -V #V #_ #IHV #T #HT @(csn_ind_cprs … HT) -T #T #HT #IHT
+lemma csn_abbr: ∀a,L,V. L ⊢ ⬊* V → ∀T. L. ⓓV ⊢ ⬊* T → L ⊢ ⬊* ⓓ{a}V. T.
+#a #L #V #HV elim HV -V #V #_ #IHV #T #HT @(csn_ind_alt … HT) -T #T #HT #IHT
 @csn_intro #X #H1 #H2
 elim (cpr_inv_abbr1 … H1) -H1 *
 [ #V0 #V1 #T1 #HLV0 #HLV01 #HLT1 #H destruct
@@ -40,14 +40,15 @@ elim (cpr_inv_abbr1 … H1) -H1 *
     @(csn_lcpr_conf (L. ⓓV)) /2 width=1/ -HLV1 /2 width=3/
   | -IHV -HLV1 * #H destruct /3 width=1/
   ]
-| -IHV -IHT -H2 #T0 #HT0 #HLT0
-  lapply (csn_inv_lift … HT … HT0) -HT /2 width=3/
+| -IHV -IHT -H2 #T0 #HLT0 #HT0
+  lapply (csn_cpr_trans … HT … HLT0) -T #HLT0
+  lapply (csn_inv_lift … HLT0 … HT0) -T0 /2 width=3/
 ]
 qed.
 
-fact csn_appl_beta_aux: ∀L,W. L ⊢ ⬇* W → ∀U. L ⊢ ⬇* U →
-                        ∀V,T. U = ⓓV. T → L ⊢ ⬇* ⓐV. ⓛW. T.
-#L #W #H elim H -W #W #_ #IHW #X #H @(csn_ind_cprs … H) -X #X #HVT #IHVT #V #T #H destruct
+fact csn_appl_beta_aux: ∀a,L,W. L ⊢ ⬊* W → ∀U. L ⊢ ⬊* U →
+                        ∀V,T. U = ⓓ{a}V. T → L ⊢ ⬊* ⓐV. ⓛ{a}W. T.
+#a #L #W #H elim H -W #W #_ #IHW #X #H @(csn_ind_alt … H) -X #X #HVT #IHVT #V #T #H destruct
 lapply (csn_fwd_pair_sn … HVT) #HV
 lapply (csn_fwd_bind_dx … HVT) #HT -HVT
 @csn_intro #X #H #H2
@@ -61,22 +62,22 @@ elim (cpr_inv_appl1 … H) -H *
   | -IHW -HLW0 -HV -HT * #H #HVT0 destruct
     @(IHVT … HVT0) -IHVT -HVT0 // /2 width=1/
   ]
-| -IHW -IHVT -H2 #V0 #W0 #T0 #T1 #HLV0 #HLT01 #H1 #H2 destruct
+| -IHW -IHVT -H2 #b #V0 #W0 #T0 #T1 #HLV0 #HLT01 #H1 #H2 destruct
   lapply (lcpr_cpr_trans (L. ⓓV) … HLT01) -HLT01 /2 width=1/ #HLT01
   @csn_abbr /2 width=3/ -HV
   @(csn_lcpr_conf (L. ⓓV)) /2 width=1/ -V0 /2 width=3/
-| -IHW -IHVT -HV -HT -H2 #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #_ #H destruct
+| -IHW -IHVT -HV -HT -H2 #b #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #_ #H destruct
 ]
 qed.
 
 (* Basic_1: was: sn3_beta *)
-lemma csn_appl_beta: ∀L,W. L ⊢ ⬇* W → ∀V,T. L ⊢ ⬇* (ⓓV. T) → (**)
-                     L â\8a¢ â¬\87* â\93\90V. â\93\9bW. T.
+lemma csn_appl_beta: ∀a,L,W. L ⊢ ⬊* W → ∀V,T. L ⊢ ⬊* ⓓ{a}V. T →
+                     L â\8a¢ â¬\8a* â\93\90V. â\93\9b{a}W. T.
 /2 width=3/ qed.
 
-fact csn_appl_theta_aux: ∀L,U. L ⊢ ⬇* U → ∀V1,V2. ⇧[0, 1] V1 ≡ V2 →
-                         ∀V,T. U = ⓓV. ⓐV2. T → L ⊢ ⬇* ⓐV1. ⓓV. T.
-#L #X #H @(csn_ind_cprs … H) -X #X #HVT #IHVT #V1 #V2 #HV12 #V #T #H destruct
+fact csn_appl_theta_aux: ∀a,L,U. L ⊢ ⬊* U → ∀V1,V2. ⇧[0, 1] V1 ≡ V2 →
+                         ∀V,T. U = ⓓ{a}V. ⓐV2. T → L ⊢ ⬊* ⓐV1. ⓓ{a}V. T.
+#a #L #X #H @(csn_ind_alt … H) -X #X #HVT #IHVT #V1 #V2 #HV12 #V #T #H destruct
 lapply (csn_fwd_pair_sn … HVT) #HV
 lapply (csn_fwd_bind_dx … HVT) -HVT #HVT
 @csn_intro #X #HL #H
@@ -86,7 +87,7 @@ elim (cpr_inv_appl1 … HL) -HL *
   [ #V3 #V4 #T3 #HV3 #HLV34 #HLT3 #H0 destruct
     lapply (cpr_intro … HV3 HLV34) -HLV34 #HLV34
     elim (lift_total V0 0 1) #V5 #HV05
-    elim (term_eq_dec (ⓓV.ⓐV2.T) (ⓓV4.ⓐV5.T3))
+    elim (term_eq_dec (ⓓ{a}V.ⓐV2.T) (ⓓ{a}V4.ⓐV5.T3))
     [ -IHVT #H0 destruct
       elim (eq_false_inv_tpair_sn … H) -H
       [ -HLV10 -HLV34 -HV3 -HLT3 -HVT
@@ -99,12 +100,13 @@ elim (cpr_inv_appl1 … HL) -HL *
       lapply (ltpr_cpr_trans (L. ⓓV) … HLT3) /2 width=1/ -HLT3 #HLT3
       @(IHVT … H … HV05) -IHVT // -H -HV05 /3 width=1/
     ]
-  | -H -IHVT #T0 #HT0 #HLT0
-    @(csn_cpr_trans … (ⓐV1.T0)) /2 width=1/ -V0 -Y
-    @(csn_inv_lift … 0 1 HVT) /2 width=1/
+  | -H -IHVT #T0 #HLT0 #HT0 #H0 destruct
+    lapply (csn_cpr_trans … HVT (ⓐV2.T0) ?) /2 width=1/ -T #HVT0
+    lapply (csn_inv_lift L … 1 HVT0 ? ? ?) -HVT0 [ /2 width=4/ |2,3: skip | /2 width=1/ ] -V2 -T0 #HVY
+    @(csn_cpr_trans … HVY) /2 width=1/
   ]
-| -HV -HV12 -HVT -IHVT -H #V0 #W0 #T0 #T1 #_ #_ #H destruct
-| -IHVT -H #V0 #V3 #W0 #W1 #T0 #T1 #HLV10 #HLW01 #HLT01 #HV03 #H1 #H2 destruct
+| -HV -HV12 -HVT -IHVT -H #b #V0 #W0 #T0 #T1 #_ #_ #H destruct
+| -IHVT -H #b #V0 #V3 #W0 #W1 #T0 #T1 #HLV10 #HLW01 #HLT01 #HV03 #H1 #H2 destruct
   lapply (cpr_lift (L. ⓓW0) … HV12 … HV03 HLV10) -HLV10 -HV12 -HV03 /2 width=1/ #HLV23
   lapply (lcpr_cpr_trans (L. ⓓW0) … HLT01) -HLT01 /2 width=1/ #HLT01
   @csn_abbr /2 width=3/ -HV
@@ -113,15 +115,15 @@ elim (cpr_inv_appl1 … HL) -HL *
 ]
 qed.
 
-lemma csn_appl_theta: ∀V1,V2. ⇧[0, 1] V1 ≡ V2 →
-                      â\88\80L,V,T. L â\8a¢ â¬\87* â\93\93V. â\93\90V2. T â\86\92 L â\8a¢ â¬\87* â\93\90V1. â\93\93V. T.
+lemma csn_appl_theta: ∀a,V1,V2. ⇧[0, 1] V1 ≡ V2 →
+                      â\88\80L,V,T. L â\8a¢ â¬\8a* â\93\93{a}V. â\93\90V2. T â\86\92 L â\8a¢ â¬\8a* â\93\90V1. â\93\93{a}V. T.
 /2 width=5/ qed.
 
 (* Basic_1: was only: sn3_appl_appl *)
-lemma csn_appl_simple_tstc: â\88\80L,V. L â\8a¢ â¬\87* V → ∀T1.
-                            L â\8a¢ â¬\87* T1 →
-                            (∀T2. L ⊢ T1 ➡* T2 → (T1 ≃ T2 → False) → L ⊢ ⬇* ⓐV. T2) →
-                            𝐒[T1] → L ⊢ ⬇* ⓐV. T1.
+lemma csn_appl_simple_tstc: â\88\80L,V. L â\8a¢ â¬\8a* V → ∀T1.
+                            L â\8a¢ â¬\8a* T1 →
+                            (∀T2. L ⊢ T1 ➡* T2 → (T1 ≃ T2 → ⊥) → L ⊢ ⬊* ⓐV. T2) →
+                            𝐒⦃T1⦄ → L ⊢ ⬊* ⓐV. T1.
 #L #V #H @(csn_ind … H) -V #V #_ #IHV #T1 #H @(csn_ind … H) -T1 #T1 #H1T1 #IHT1 #H2T1 #H3T1
 @csn_intro #X #HL #H
 elim (cpr_inv_appl1_simple … HL ?) -HL //