]> matita.cs.unibo.it Git - helm.git/commitdiff
advances on lfsx ...
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 6 Apr 2017 10:51:28 +0000 (10:51 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 6 Apr 2017 10:51:28 +0000 (10:51 +0000)
matita/matita/contribs/lambdadelta/basic_2/etc/lleq/lleq_drop.etc
matita/matita/contribs/lambdadelta/basic_2/etc/llpx_sn/llpx_sn_drop.etc
matita/matita/contribs/lambdadelta/basic_2/etc/lsx/lsx.etc [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/relocation/lexs.ma
matita/matita/contribs/lambdadelta/basic_2/rt_computation/lfsx_lfsx.ma
matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsx_lpx.ma [deleted file]
matita/matita/contribs/lambdadelta/basic_2/static/lfdeq.ma
matita/matita/contribs/lambdadelta/basic_2/static/lfdeq_lfdeq.ma
matita/matita/contribs/lambdadelta/basic_2/static/lfxs.ma
matita/matita/contribs/lambdadelta/basic_2/static/lfxs_lfxs.ma
matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma

index 87ceaf096c88f8d3142b99993d02c237f8373b23..10e8a919a15790702797381358b4797a7a5ae7c2 100644 (file)
@@ -23,9 +23,6 @@ lemma lleq_bind_repl_O: ∀I,L1,L2,V,T. L1.ⓑ{I}V ≡[T, 0] L2.ⓑ{I}V →
                         ∀J,W. L1 ≡[W, 0] L2 → L1.ⓑ{J}W ≡[T, 0] L2.ⓑ{J}W.
 /2 width=7 by llpx_sn_bind_repl_O/ qed-.
 
-lemma lleq_dec: ∀T,L1,L2,l. Decidable (L1 ≡[T, l] L2).
-/3 width=1 by llpx_sn_dec, eq_term_dec/ qed-.
-
 lemma lleq_llpx_sn_trans: ∀R. lleq_transitive R →
                           ∀L1,L2,T,l. L1 ≡[T, l] L2 →
                           ∀L. llpx_sn R l T L2 L → llpx_sn R l T L1 L.
index 9bb605e39bae2cf52811f5fd70feda5b839a2f21..34980b9f61d1deb18a1df2090ccb14e3cd68d4e4 100644 (file)
@@ -125,48 +125,6 @@ lemma llpx_sn_bind_repl_O: ∀R,I,L1,L2,V1,V2,T. llpx_sn R 0 T (L1.ⓑ{I}V1) (L2
                            ∀J,W1,W2. llpx_sn R 0 W1 L1 L2 → R L1 W1 W2 → llpx_sn R 0 T (L1.ⓑ{J}W1) (L2.ⓑ{J}W2).
 /3 width=9 by llpx_sn_bind_repl_SO, llpx_sn_inv_S/ qed-.
 
-lemma llpx_sn_dec: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) →
-                   ∀T,L1,L2,l. Decidable (llpx_sn R l T L1 L2).
-#R #HR #T #L1 @(f2_ind … rfw … L1 T) -L1 -T
-#x #IH #L1 * *
-[ #s #Hx #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, llpx_sn_sort/
-| #i #Hx #L2 elim (eq_nat_dec (|L1|) (|L2|))
-  [ #HL12 #l elim (ylt_split i l) /3 width=1 by llpx_sn_skip, or_introl/
-    #Hli elim (lt_or_ge i (|L1|)) #HiL1
-    elim (lt_or_ge i (|L2|)) #HiL2 /3 width=1 by or_introl, llpx_sn_free/
-    elim (drop_O1_lt (Ⓕ) … HiL2) #I2 #K2 #V2 #HLK2
-    elim (drop_O1_lt (Ⓕ) … HiL1) #I1 #K1 #V1 #HLK1
-    elim (eq_bind2_dec I2 I1)
-    [ #H2 elim (HR K1 V1 V2) -HR
-      [ #H3 elim (IH K1 V1 … K2 0) destruct
-        /3 width=9 by llpx_sn_lref, drop_fwd_rfw, or_introl/
-      ]
-    ]
-    -IH #H3 @or_intror
-    #H elim (llpx_sn_fwd_lref … H) -H [1,3,4,6,7,9: * ]
-    [1,3,5: /3 width=4 by lt_to_le_to_lt, lt_refl_false/
-    |7,8,9: /2 width=4 by ylt_yle_false/
-    ]
-    #Z #Y1 #Y2 #X1 #X2 #HLY1 #HLY2 #HY12 #HX12
-    lapply (drop_mono … HLY1 … HLK1) -HLY1 -HLK1
-    lapply (drop_mono … HLY2 … HLK2) -HLY2 -HLK2
-    #H #H0 destruct /2 width=1 by/
-  ]
-| #p #Hx #L2 elim (eq_nat_dec (|L1|) (|L2|)) /3 width=1 by or_introl, llpx_sn_gref/
-| #a #I #V #T #Hx #L2 #l destruct
-  elim (IH L1 V … L2 l) /2 width=1 by/
-  elim (IH (L1.ⓑ{I}V) T … (L2.ⓑ{I}V) (⫯l)) -IH /3 width=1 by or_introl, llpx_sn_bind/
-  #H1 #H2 @or_intror
-  #H elim (llpx_sn_inv_bind … H) -H /2 width=1 by/
-| #I #V #T #Hx #L2 #l destruct
-  elim (IH L1 V … L2 l) /2 width=1 by/
-  elim (IH L1 T … L2 l) -IH /3 width=1 by or_introl, llpx_sn_flat/
-  #H1 #H2 @or_intror
-  #H elim (llpx_sn_inv_flat … H) -H /2 width=1 by/
-]
--x /4 width=4 by llpx_sn_fwd_length, or_intror/
-qed-.
-
 (* Inversion lemmas on negated lazy pointwise extension *********************)
 
 lemma nllpx_sn_inv_bind: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) →
diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/lsx/lsx.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/lsx/lsx.etc
new file mode 100644 (file)
index 0000000..b5407ab
--- /dev/null
@@ -0,0 +1,25 @@
+lemma lsx_lreq_conf: ∀h,o,G,L1,T,l. G ⊢ ⬊*[h, o, T, l] L1 →
+                    ∀L2. L1 ⩬[l, ∞] L2 → G ⊢ ⬊*[h, o, T, l] L2.
+#h #o #G #L1 #T #l #H @(lsx_ind … H) -L1
+#L1 #_ #IHL1 #L2 #HL12 @lsx_intro
+#L3 #HL23 #HnL23 elim (lreq_lpx_trans_lleq … HL12 … HL23) -HL12 -HL23
+#L0 #HL03 #HL10 #H elim (H T) -H /4 width=4 by/
+qed-.
+
+(* these two are better expressed with the binder \chi *)
+
+lemma lsx_fwd_bind_dx: ∀h,o,a,I,G,L,V,T,l. G ⊢ ⬈*[h, o, ⓑ{a,I}V.T, l] L →
+                       G ⊢ ⬈*[h, o, T, ⫯l] L.ⓑ{I}V.
+#h #o #a #I #G #L #V1 #T #l #H @(lsx_ind … H) -L
+#L1 #_ #IHL1 @lsx_intro
+#Y #H #HT elim (lpx_inv_pair1 … H) -H
+#L2 #V2 #HL12 #_ #H destruct
+@(lsx_lreq_conf … (L2.ⓑ{I}V1)) /2 width=1 by lreq_succ/
+@IHL1 // #H @HT -IHL1 -HL12 -HT
+@(lleq_lreq_trans … (L2.ⓑ{I}V1))
+/2 width=2 by lleq_fwd_bind_dx, lreq_succ/
+qed-.
+
+lemma lsx_inv_bind: ∀h,o,a,I,G,L,V,T,l. G ⊢ ⬈*[h, o, ⓑ{a, I}V.T, l] L →
+                    G ⊢ ⬈*[h, o, V, l] L ∧ G ⊢ ⬈*[h, o, T, ⫯l] L.ⓑ{I}V.
+/3 width=4 by lsx_fwd_bind_sn, lsx_fwd_bind_dx, conj/ qed-.
index b002e073af1af7be489b4f845d88376be49088cf..e4e501f09471369bc6a4312c329046c978ef62c5 100644 (file)
@@ -255,3 +255,26 @@ lemma lexs_sle_split: ∀R1,R2,RP. (∀L. reflexive … (R1 L)) → (∀L. refle
   elim (IH … Hfg) -IH -Hfg /3 width=5 by lexs_next, lexs_push, ex2_intro/
 ]
 qed-.
+
+lemma lexs_dec: ∀RN,RP.
+                (∀L,T1,T2. Decidable (RN L T1 T2)) →
+                (∀L,T1,T2. Decidable (RP L T1 T2)) →
+                ∀L1,L2,f. Decidable (L1 ⦻*[RN, RP, f] L2).
+#RN #RP #HRN #HRP #L1 elim L1 -L1 [ * | #L1 #I1 #V1 #IH * ]
+[ /2 width=1 by lexs_atom, or_introl/
+| #L2 #I2 #V2 #f @or_intror #H
+  lapply (lexs_inv_atom1 … H) -H #H destruct
+| #f @or_intror #H
+  lapply (lexs_inv_atom2 … H) -H #H destruct
+| #L2 #I2 #V2 #f elim (eq_bind2_dec I1 I2) #H destruct
+  [2: @or_intror #H elim (lexs_fwd_pair … H) -H /2 width=1 by/ ]
+  elim (IH L2 (⫱f)) -IH #HL12
+  [2: @or_intror #H elim (lexs_fwd_pair … H) -H /2 width=1 by/ ]
+  elim (pn_split f) * #g #H destruct
+  [ elim (HRP L1 V1 V2) | elim (HRN L1 V1 V2) ] -HRP -HRN #HV12
+  [1,3: /3 width=1 by lexs_push, lexs_next, or_introl/ ]
+  @or_intror #H
+  [ elim (lexs_inv_push … H) | elim (lexs_inv_next … H) ] -H
+  /2 width=1 by/
+]
+qed-.
index 7ca826d116941f719be727e7bf8f347191509bde..7e1d5cffb36d200d89b1416f2f24a78d0be4d510 100644 (file)
@@ -20,6 +20,7 @@ include "basic_2/rt_computation/lfsx.ma".
 
 (* Advanced properties ******************************************************)
 
+(* Basic_2A1: was just: lsx_lleq_trans *)
 lemma lfsx_lfdeq_trans: ∀h,o,G,L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
                         ∀L2. L1 ≡[h, o, T] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄.
 #h #o #G #L1 #T #H @(lfsx_ind … H) -L1
@@ -28,6 +29,13 @@ lemma lfsx_lfdeq_trans: ∀h,o,G,L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
 /4 width=5 by lfdeq_repl/
 qed-.
 
+(* Basic_2A1: was: lsx_lpx_trans *)
+lemma lfsx_lfpx_trans: ∀h,o,G,L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
+                       ∀L2. ⦃G, L1⦄ ⊢ ⬈[h, T] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄.
+#h #o #G #L1 #T #H @(lfsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12
+elim (lfdeq_dec h o L1 L2 T) /3 width=4 by lfsx_lfdeq_trans, lfxs_refl/
+qed-.
+
 (* Advanced forward lemmas **************************************************)
 
 (* Basic_2A1: includes: lsx_fwd_bind_sn lsx_fwd_flat_sn *)
@@ -40,7 +48,6 @@ lemma lfsx_fwd_pair_sn: ∀h,o,I,G,L,V,T. G ⊢ ⬈*[h, o, ②{I}V.T] 𝐒⦃L
 /6 width=4 by lfsx_lfdeq_trans, lfdeq_trans, lfdeq_fwd_pair_sn/
 qed-.
 
-
 (* Basic_2A1: was: lsx_fwd_flat_dx *)
 lemma lfsx_fwd_flat_dx: ∀h,o,I,G,L,V,T. G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄ →
                         G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄.
diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsx_lpx.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsx_lpx.ma
deleted file mode 100644 (file)
index 81dc6e7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||M||                                                             *)
-(*      ||A||       A project by Andrea Asperti                           *)
-(*      ||T||                                                             *)
-(*      ||I||       Developers:                                           *)
-(*      ||T||         The HELM team.                                      *)
-(*      ||A||         http://helm.cs.unibo.it                             *)
-(*      \   /                                                             *)
-(*       \ /        This file is distributed under the terms of the       *)
-(*        v         GNU General Public License Version 2                  *)
-(*                                                                        *)
-(**************************************************************************)
-
-include "basic_2/multiple/lleq_lleq.ma".
-include "basic_2/reduction/lpx_lleq.ma".
-include "basic_2/computation/lsx.ma".
-
-(* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
-
-(* Advanced properties ******************************************************)
-
-lemma lsx_lleq_trans: ∀h,o,T,G,L1,l. G ⊢ ⬊*[h, o, T, l] L1 →
-                      ∀L2. L1 ≡[T, l] L2 → G ⊢ ⬊*[h, o, T, l] L2.
-#h #o #T #G #L1 #l #H @(lsx_ind … H) -L1
-#L1 #_ #IHL1 #L2 #HL12 @lsx_intro
-#K2 #HLK2 #HnLK2 elim (lleq_lpx_trans … HLK2 … HL12) -HLK2
-/5 width=4 by lleq_canc_sn, lleq_trans/
-qed-.
-
-lemma lsx_lpx_trans: ∀h,o,T,G,L1,l. G ⊢ ⬊*[h, o, T, l] L1 →
-                     ∀L2. ⦃G, L1⦄ ⊢ ➡[h, o] L2 → G ⊢ ⬊*[h, o, T, l] L2.
-#h #o #T #G #L1 #l #H @(lsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12
-elim (lleq_dec T L1 L2 l) /3 width=4 by lsx_lleq_trans/
-qed-.
-
-lemma lsx_lreq_conf: ∀h,o,G,L1,T,l. G ⊢ ⬊*[h, o, T, l] L1 →
-                    ∀L2. L1 ⩬[l, ∞] L2 → G ⊢ ⬊*[h, o, T, l] L2.
-#h #o #G #L1 #T #l #H @(lsx_ind … H) -L1
-#L1 #_ #IHL1 #L2 #HL12 @lsx_intro
-#L3 #HL23 #HnL23 elim (lreq_lpx_trans_lleq … HL12 … HL23) -HL12 -HL23
-#L0 #HL03 #HL10 #H elim (H T) -H /4 width=4 by/
-qed-.
-
-(* Advanced forward lemmas **************************************************)
-
-lemma lsx_fwd_bind_dx: ∀h,o,a,I,G,L,V,T,l. G ⊢ ⬊*[h, o, ⓑ{a,I}V.T, l] L →
-                       G ⊢ ⬊*[h, o, T, ⫯l] L.ⓑ{I}V.
-#h #o #a #I #G #L #V1 #T #l #H @(lsx_ind … H) -L
-#L1 #_ #IHL1 @lsx_intro
-#Y #H #HT elim (lpx_inv_pair1 … H) -H
-#L2 #V2 #HL12 #_ #H destruct
-@(lsx_lreq_conf … (L2.ⓑ{I}V1)) /2 width=1 by lreq_succ/
-@IHL1 // #H @HT -IHL1 -HL12 -HT
-@(lleq_lreq_trans … (L2.ⓑ{I}V1))
-/2 width=2 by lleq_fwd_bind_dx, lreq_succ/
-qed-.
-
-(* Advanced inversion lemmas ************************************************)
-
-lemma lsx_inv_bind: ∀h,o,a,I,G,L,V,T,l. G ⊢ ⬊*[h, o, ⓑ{a, I}V.T, l] L →
-                    G ⊢ ⬊*[h, o, V, l] L ∧ G ⊢ ⬊*[h, o, T, ⫯l] L.ⓑ{I}V.
-/3 width=4 by lsx_fwd_bind_sn, lsx_fwd_bind_dx, conj/ qed-.
index aa6484ace27b98d058aba586a2af2dca2a3630d8..f6bc891d7af225ef58240b517c592bdf69f83728 100644 (file)
@@ -176,11 +176,12 @@ lemma lfdeq_fwd_dx: ∀h,o,I,L1,K2,V2. ∀T:term. L1 ≡[h, o, T] K2.ⓑ{I}V2 
                     ∃∃K1,V1. L1 = K1.ⓑ{I}V1.
 /2 width=5 by lfxs_fwd_dx/ qed-.
 
-(* Basic_2A1: removed theorems 30
+(* Basic_2A1: removed theorems 31
               lleq_ind lleq_inv_bind lleq_inv_flat lleq_fwd_length lleq_fwd_lref
               lleq_fwd_drop_sn lleq_fwd_drop_dx
               lleq_fwd_bind_sn lleq_fwd_bind_dx lleq_fwd_flat_sn lleq_fwd_flat_dx
               lleq_sort lleq_skip lleq_lref lleq_free lleq_gref lleq_bind lleq_flat
               lleq_refl lleq_Y lleq_sym lleq_ge_up lleq_ge lleq_bind_O llpx_sn_lrefl
               lleq_trans lleq_canc_sn lleq_canc_dx lleq_nlleq_trans nlleq_lleq_div
+              lleq_dec 
 *)
index c42edd1965c3b00830bad09074b1812d933349d0..9f92ecd272e3c8aa1c5e13eedeb557b1a5c79a19 100644 (file)
@@ -18,6 +18,11 @@ include "basic_2/static/lfdeq.ma".
 
 (* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******)
 
+(* Advanced properties ******************************************************)
+
+lemma lfdeq_dec: ∀h,o,L1,L2. ∀T:term. Decidable (L1 ≡[h, o, T] L2).
+/3 width=1 by lfxs_dec, tdeq_dec/ qed-.
+
 (* Main properties **********************************************************)
 
 theorem lfdeq_bind: ∀h,o,p,I,L1,L2,V1,V2,T.
index 1d7781d7e8adc0e648736ab2bf3664f51a1bb293..d7dae247e3ccbb1e041377d1936d505ae00c47e2 100644 (file)
@@ -268,12 +268,13 @@ lemma lfxs_fwd_dx: ∀R,I,L1,K2,T,V2. L1 ⦻*[R, T] K2.ⓑ{I}V2 →
 /2 width=3 by ex1_2_intro/
 qed-.
 
-(* Basic_2A1: removed theorems 24:
+(* Basic_2A1: removed theorems 25:
               llpx_sn_sort llpx_sn_skip llpx_sn_lref llpx_sn_free llpx_sn_gref
               llpx_sn_bind llpx_sn_flat
               llpx_sn_inv_bind llpx_sn_inv_flat
               llpx_sn_fwd_lref llpx_sn_fwd_pair_sn llpx_sn_fwd_length
               llpx_sn_fwd_bind_sn llpx_sn_fwd_bind_dx llpx_sn_fwd_flat_sn llpx_sn_fwd_flat_dx
               llpx_sn_refl llpx_sn_Y llpx_sn_bind_O llpx_sn_ge_up llpx_sn_ge llpx_sn_co
-              llpx_sn_fwd_drop_sn llpx_sn_fwd_drop_dx              
+              llpx_sn_fwd_drop_sn llpx_sn_fwd_drop_dx
+              llpx_sn_dec      
 *)
index 3b94bdb61dcca96f708ce6c416d8b1d212d51818..54fdb9e43951fe8ae7e8eac5fd81fddb3bb012d4 100644 (file)
@@ -21,6 +21,19 @@ include "basic_2/static/lfxs.ma".
 
 (* Advanced properties ******************************************************)
 
+lemma lfxs_inv_frees: ∀R,L1,L2,T. L1 ⦻*[R, T] L2 →
+                      ∀f. L1 ⊢ 𝐅*⦃T⦄ ≡ f → L1 ⦻*[R, cfull, f] L2.
+#R #L1 #L2 #T * /3 width=6 by frees_mono, lexs_eq_repl_back/
+qed-.
+
+lemma lfxs_dec: ∀R. (∀L,T1,T2. Decidable (R L T1 T2)) →
+                ∀L1,L2,T. Decidable (L1 ⦻*[R, T] L2).
+#R #HR #L1 #L2 #T
+elim (frees_total L1 T) #f #Hf
+elim (lexs_dec R cfull HR … L1 L2 f)
+/4 width=3 by lfxs_inv_frees, cfull_dec, ex2_intro, or_intror, or_introl/
+qed-.
+
 lemma lfxs_pair_sn_split: ∀R1,R2. (∀L. reflexive … (R1 L)) → (∀L. reflexive … (R2 L)) →
                           lexs_frees_confluent … R1 cfull →
                           ∀L1,L2,V. L1 ⦻*[R1, V] L2 → ∀I,T.
index cfefa7fd876f9ac5f317cc08935474d666b389f2..05b8fde6274069f613058478d019d7187de9fcf1 100644 (file)
@@ -56,6 +56,9 @@ lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
 ]
 qed-.
 
+lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
+/2 width=1 by or_introl/ qed-.
+
 (* Basic inversion lemmas ***************************************************)
 
 fact destruct_lpair_lpair_aux: ∀I1,I2,L1,L2,V1,V2. L1.ⓑ{I1}V1 = L2.ⓑ{I2}V2 →
@@ -71,5 +74,5 @@ lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥.
 ]
 qed-.
 
-lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L→ ⊥.
+lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L → ⊥.
 /2 width=4 by discr_lpair_x_xy/ qed-.